@@ -36,6 +36,7 @@ local EndpointType = {
36
36
--- @field buildId string
37
37
38
38
--- This data is saved internally for caching
39
+ --- Save this to disk for temporary local caching if required/desired
39
40
--- @class BuildInfoCache
40
41
--- @field pobdata string
41
42
--- @field name string
@@ -48,11 +49,11 @@ local EndpointType = {
48
49
--- @field name string
49
50
--- @field fallbackVersion integer
50
51
--- @field endpointType EndpointType
51
- --- @field baseAPIPath string
52
- --- @field league_filter boolean
53
- --- @field gem_filter boolean
52
+ --- @field baseAPIPath ? string
53
+ --- @field league_filter ? boolean
54
+ --- @field gem_filter ? boolean
54
55
55
- --- This primarily exists for the lua language server
56
+ --- This primarily exists for the lua language server
56
57
--- @param buildInfo BuildInfo
57
58
--- @param source APICapabilities
58
59
--- @return BuildInfoCache
@@ -81,15 +82,14 @@ local getBuildVersions = {
81
82
[0 ] = function (...) return APIContractBuilds :GetBuildsVersion1 (... ) end ,
82
83
}
83
84
84
- --- comments
85
- --- @param path string
85
+ --- Gets the builds from the source
86
86
--- @param source APISourceInfo
87
- function APIContractBuilds :GetBuilds (path , source )
88
- local builds = getBuildVersions [source .fallbackVersion ](path , source .endpointType )
87
+ function APIContractBuilds :GetBuilds (source )
88
+ getBuildVersions [source .fallbackVersion ](source .endpointType )
89
89
end
90
90
91
91
--- @param source APISourceInfo
92
- function APIContractBuilds :GetAPICapabilities (source )
92
+ function APIContractBuilds :UpdateAPICapabilities (source )
93
93
-- TODO: Which features are supported?
94
94
-- What is the latest version that is supported?
95
95
-- Which endpoints are supported
@@ -103,6 +103,7 @@ function APIContractBuilds:GetAPICapabilities(source)
103
103
function (...) return APIContractBuilds :APICapabilitiesCallback (source , ... ) end , {})
104
104
end
105
105
106
+ --- Updates the API capabilities for the source
106
107
--- @param response table
107
108
--- @param errMsg any
108
109
--- @param source APISourceInfo
@@ -119,6 +120,7 @@ function APIContractBuilds:APICapabilitiesCallback(source, response, errMsg)
119
120
self .apiCapabilities [source .name ] = parsedResponse
120
121
end
121
122
123
+ --- Adds/Updates Builds for the source based on version 1
122
124
--- @param response table
123
125
--- @param errMsg any
124
126
--- @param source APICapabilities
@@ -132,15 +134,15 @@ function APIContractBuilds:BuildsVersion1Callback(source, response, errMsg)
132
134
end
133
135
end
134
136
135
- --- Version 1 of the API Contract for Builds
136
- --- @param path string
137
+ --- Version 1 of the API Contract for Builds
137
138
--- @param source APICapabilities
138
- function APIContractBuilds :GetBuildsVersion1 (path , source )
139
- if source .endpointType ~= EndpointType .REST then
139
+ function APIContractBuilds :GetBuildsVersion1 (source )
140
+ if source .endpointType == EndpointType .CSV then
141
+ -- TODO: Implement CSV Parsing and Format
140
142
return
141
143
end
142
144
143
- launch :DownloadPage (source .baseAPIPath + path , function (...)
145
+ launch :DownloadPage (source .baseAPIPath + " /v1/builds " , function (...)
144
146
self :BuildsVersion1Callback (source , ... )
145
147
end , {})
146
148
end
0 commit comments