@abliteration/sdk 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.openapi-generator/FILES +76 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +140 -49
  5. package/dist/apis/AuthorsApi.d.ts +11 -3
  6. package/dist/apis/AuthorsApi.js +8 -0
  7. package/dist/apis/DatasetsApi.d.ts +9 -3
  8. package/dist/apis/DatasetsApi.js +6 -0
  9. package/dist/apis/IndicesApi.d.ts +9 -3
  10. package/dist/apis/IndicesApi.js +6 -0
  11. package/dist/apis/ModelsApi.d.ts +9 -3
  12. package/dist/apis/ModelsApi.js +6 -0
  13. package/dist/esm/apis/AuthorsApi.d.ts +11 -3
  14. package/dist/esm/apis/AuthorsApi.js +8 -0
  15. package/dist/esm/apis/DatasetsApi.d.ts +9 -3
  16. package/dist/esm/apis/DatasetsApi.js +6 -0
  17. package/dist/esm/apis/IndicesApi.d.ts +9 -3
  18. package/dist/esm/apis/IndicesApi.js +6 -0
  19. package/dist/esm/apis/ModelsApi.d.ts +9 -3
  20. package/dist/esm/apis/ModelsApi.js +6 -0
  21. package/dist/esm/models/Author.d.ts +4 -0
  22. package/dist/esm/models/Author.js +2 -0
  23. package/dist/esm/models/AuthorDetail.d.ts +4 -0
  24. package/dist/esm/models/AuthorDetail.js +2 -0
  25. package/dist/esm/models/Dataset.d.ts +45 -1
  26. package/dist/esm/models/Dataset.js +22 -0
  27. package/dist/esm/models/DatasetDetail.d.ts +85 -2
  28. package/dist/esm/models/DatasetDetail.js +52 -2
  29. package/dist/esm/models/ModelDetail.d.ts +173 -1
  30. package/dist/esm/models/ModelDetail.js +2 -2
  31. package/dist/models/Author.d.ts +4 -0
  32. package/dist/models/Author.js +2 -0
  33. package/dist/models/AuthorDetail.d.ts +4 -0
  34. package/dist/models/AuthorDetail.js +2 -0
  35. package/dist/models/Dataset.d.ts +45 -1
  36. package/dist/models/Dataset.js +22 -0
  37. package/dist/models/DatasetDetail.d.ts +85 -2
  38. package/dist/models/DatasetDetail.js +52 -2
  39. package/dist/models/ModelDetail.d.ts +173 -1
  40. package/dist/models/ModelDetail.js +2 -2
  41. package/docs/Author.md +44 -0
  42. package/docs/AuthorDetail.md +46 -0
  43. package/docs/AuthorsApi.md +167 -0
  44. package/docs/DaiPoint.md +38 -0
  45. package/docs/Dataset.md +76 -0
  46. package/docs/DatasetDetail.md +80 -0
  47. package/docs/DatasetsApi.md +176 -0
  48. package/docs/Envelope.md +48 -0
  49. package/docs/Event.md +46 -0
  50. package/docs/GetAuthor200Response.md +48 -0
  51. package/docs/GetDataset200Response.md +48 -0
  52. package/docs/GetIndex200Response.md +48 -0
  53. package/docs/GetMethod200Response.md +48 -0
  54. package/docs/GetModel200Response.md +48 -0
  55. package/docs/IndexDetail.md +54 -0
  56. package/docs/IndicesApi.md +153 -0
  57. package/docs/ListAuthors200Response.md +48 -0
  58. package/docs/ListDatasets200Response.md +48 -0
  59. package/docs/ListIndices200Response.md +48 -0
  60. package/docs/ListMethods200Response.md +48 -0
  61. package/docs/ListModels200Response.md +48 -0
  62. package/docs/ListTimeline200Response.md +48 -0
  63. package/docs/Method.md +44 -0
  64. package/docs/MethodDetail.md +50 -0
  65. package/docs/MethodDetailAllOfTopAuthors.md +36 -0
  66. package/docs/MethodsApi.md +153 -0
  67. package/docs/ModelDetail.md +131 -0
  68. package/docs/ModelError.md +42 -0
  69. package/docs/ModelIndex.md +52 -0
  70. package/docs/ModelSummary.md +58 -0
  71. package/docs/ModelsApi.md +191 -0
  72. package/docs/Passport.md +38 -0
  73. package/docs/TimelineApi.md +93 -0
  74. package/openapi-generator-config.json +10 -0
  75. package/package.json +14 -16
  76. package/src/apis/AuthorsApi.ts +248 -0
  77. package/src/apis/DatasetsApi.ts +278 -0
  78. package/src/apis/IndicesApi.ts +213 -0
  79. package/src/apis/MethodsApi.ts +214 -0
  80. package/src/apis/ModelsApi.ts +328 -0
  81. package/src/apis/TimelineApi.ts +148 -0
  82. package/src/apis/index.ts +8 -0
  83. package/src/index.ts +5 -0
  84. package/src/models/Author.ts +93 -0
  85. package/src/models/AuthorDetail.ts +107 -0
  86. package/src/models/DaiPoint.ts +75 -0
  87. package/src/models/Dataset.ts +189 -0
  88. package/src/models/DatasetDetail.ts +209 -0
  89. package/src/models/Envelope.ts +124 -0
  90. package/src/models/Event.ts +99 -0
  91. package/src/models/GetAuthor200Response.ts +132 -0
  92. package/src/models/GetDataset200Response.ts +132 -0
  93. package/src/models/GetIndex200Response.ts +132 -0
  94. package/src/models/GetMethod200Response.ts +132 -0
  95. package/src/models/GetModel200Response.ts +132 -0
  96. package/src/models/IndexDetail.ts +153 -0
  97. package/src/models/ListAuthors200Response.ts +132 -0
  98. package/src/models/ListDatasets200Response.ts +132 -0
  99. package/src/models/ListIndices200Response.ts +132 -0
  100. package/src/models/ListMethods200Response.ts +132 -0
  101. package/src/models/ListModels200Response.ts +132 -0
  102. package/src/models/ListTimeline200Response.ts +132 -0
  103. package/src/models/Method.ts +106 -0
  104. package/src/models/MethodDetail.ts +139 -0
  105. package/src/models/MethodDetailAllOfTopAuthors.ts +69 -0
  106. package/src/models/ModelDetail.ts +362 -0
  107. package/src/models/ModelError.ts +89 -0
  108. package/src/models/ModelIndex.ts +147 -0
  109. package/src/models/ModelSummary.ts +135 -0
  110. package/src/models/Passport.ts +75 -0
  111. package/src/models/index.ts +29 -0
  112. package/src/runtime.ts +505 -0
  113. package/tsconfig.esm.json +7 -0
  114. package/tsconfig.json +16 -0
@@ -0,0 +1,278 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * abliteration.org Public API
5
+ * Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import * as runtime from '../runtime';
16
+ import {
17
+ type GetDataset200Response,
18
+ GetDataset200ResponseFromJSON,
19
+ GetDataset200ResponseToJSON,
20
+ } from '../models/GetDataset200Response';
21
+ import {
22
+ type ListDatasets200Response,
23
+ ListDatasets200ResponseFromJSON,
24
+ ListDatasets200ResponseToJSON,
25
+ } from '../models/ListDatasets200Response';
26
+
27
+ export interface GetDatasetRequest {
28
+ /**
29
+ *
30
+ */
31
+ id: string;
32
+ }
33
+
34
+ export interface ListDatasetsRequest {
35
+ /**
36
+ * Workflow stage, for example heal or extract.
37
+ */
38
+ category?: string;
39
+ /**
40
+ * Publisher handle, case-insensitive.
41
+ */
42
+ author?: string;
43
+ /**
44
+ * License string as published.
45
+ */
46
+ license?: string;
47
+ /**
48
+ * Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` are aliases for the full column names.
49
+ */
50
+ sort?: ListDatasetsSortEnum;
51
+ /**
52
+ * Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
53
+ */
54
+ limit?: number;
55
+ /**
56
+ * Rows to skip. Negative and non-numeric values are treated as 0.
57
+ */
58
+ offset?: number;
59
+ }
60
+
61
+ /**
62
+ * DatasetsApi - interface
63
+ *
64
+ * @export
65
+ * @interface DatasetsApiInterface
66
+ */
67
+ export interface DatasetsApiInterface {
68
+ /**
69
+ * Creates request options for getDataset without sending the request
70
+ * @param {string} id
71
+ * @throws {RequiredError}
72
+ * @memberof DatasetsApiInterface
73
+ */
74
+ getDatasetRequestOpts(requestParameters: GetDatasetRequest): Promise<runtime.RequestOpts>;
75
+
76
+ /**
77
+ * Cost: 1 credit. The passport is null for datasets that do not have one yet.
78
+ * @summary Get one dataset
79
+ * @param {string} id
80
+ * @param {*} [options] Override http request option.
81
+ * @throws {RequiredError}
82
+ * @memberof DatasetsApiInterface
83
+ */
84
+ getDatasetRaw(requestParameters: GetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDataset200Response>>;
85
+
86
+ /**
87
+ * Cost: 1 credit. The passport is null for datasets that do not have one yet.
88
+ * Get one dataset
89
+ */
90
+ getDataset(requestParameters: GetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDataset200Response>;
91
+
92
+ /**
93
+ * Creates request options for listDatasets without sending the request
94
+ * @param {string} [category] Workflow stage, for example heal or extract.
95
+ * @param {string} [author] Publisher handle, case-insensitive.
96
+ * @param {string} [license] License string as published.
97
+ * @param {'downloads' | '-downloads' | 'likes' | '-likes' | 'created' | '-created' | 'created_at' | '-created_at' | 'first_seen' | '-first_seen' | 'first_seen_at' | '-first_seen_at'} [sort] Bare key is the natural direction (downloads/likes &#x3D; most first, dates &#x3D; newest first). A leading &#x60;-&#x60; flips it. &#x60;created&#x60; and &#x60;first_seen&#x60; are aliases for the full column names.
98
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
99
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
100
+ * @throws {RequiredError}
101
+ * @memberof DatasetsApiInterface
102
+ */
103
+ listDatasetsRequestOpts(requestParameters: ListDatasetsRequest): Promise<runtime.RequestOpts>;
104
+
105
+ /**
106
+ * Cost: 5-15 credits, by rows returned.
107
+ * @summary List datasets
108
+ * @param {string} [category] Workflow stage, for example heal or extract.
109
+ * @param {string} [author] Publisher handle, case-insensitive.
110
+ * @param {string} [license] License string as published.
111
+ * @param {'downloads' | '-downloads' | 'likes' | '-likes' | 'created' | '-created' | 'created_at' | '-created_at' | 'first_seen' | '-first_seen' | 'first_seen_at' | '-first_seen_at'} [sort] Bare key is the natural direction (downloads/likes &#x3D; most first, dates &#x3D; newest first). A leading &#x60;-&#x60; flips it. &#x60;created&#x60; and &#x60;first_seen&#x60; are aliases for the full column names.
112
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
113
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ * @memberof DatasetsApiInterface
117
+ */
118
+ listDatasetsRaw(requestParameters: ListDatasetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDatasets200Response>>;
119
+
120
+ /**
121
+ * Cost: 5-15 credits, by rows returned.
122
+ * List datasets
123
+ */
124
+ listDatasets(requestParameters: ListDatasetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDatasets200Response>;
125
+
126
+ }
127
+
128
+ /**
129
+ *
130
+ */
131
+ export class DatasetsApi extends runtime.BaseAPI implements DatasetsApiInterface {
132
+
133
+ /**
134
+ * Creates request options for getDataset without sending the request
135
+ */
136
+ async getDatasetRequestOpts(requestParameters: GetDatasetRequest): Promise<runtime.RequestOpts> {
137
+ if (requestParameters['id'] == null) {
138
+ throw new runtime.RequiredError(
139
+ 'id',
140
+ 'Required parameter "id" was null or undefined when calling getDataset().'
141
+ );
142
+ }
143
+
144
+ const queryParameters: any = {};
145
+
146
+ const headerParameters: runtime.HTTPHeaders = {};
147
+
148
+ if (this.configuration && this.configuration.accessToken) {
149
+ const token = this.configuration.accessToken;
150
+ const tokenString = await token("bearerAuth", []);
151
+
152
+ if (tokenString) {
153
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
154
+ }
155
+ }
156
+
157
+ let urlPath = `/api/v1/datasets/{id}`;
158
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
159
+
160
+ return {
161
+ path: urlPath,
162
+ method: 'GET',
163
+ headers: headerParameters,
164
+ query: queryParameters,
165
+ };
166
+ }
167
+
168
+ /**
169
+ * Cost: 1 credit. The passport is null for datasets that do not have one yet.
170
+ * Get one dataset
171
+ */
172
+ async getDatasetRaw(requestParameters: GetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDataset200Response>> {
173
+ const requestOptions = await this.getDatasetRequestOpts(requestParameters);
174
+ const response = await this.request(requestOptions, initOverrides);
175
+
176
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetDataset200ResponseFromJSON(jsonValue));
177
+ }
178
+
179
+ /**
180
+ * Cost: 1 credit. The passport is null for datasets that do not have one yet.
181
+ * Get one dataset
182
+ */
183
+ async getDataset(requestParameters: GetDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDataset200Response> {
184
+ const response = await this.getDatasetRaw(requestParameters, initOverrides);
185
+ return await response.value();
186
+ }
187
+
188
+ /**
189
+ * Creates request options for listDatasets without sending the request
190
+ */
191
+ async listDatasetsRequestOpts(requestParameters: ListDatasetsRequest): Promise<runtime.RequestOpts> {
192
+ const queryParameters: any = {};
193
+
194
+ if (requestParameters['category'] != null) {
195
+ queryParameters['category'] = requestParameters['category'];
196
+ }
197
+
198
+ if (requestParameters['author'] != null) {
199
+ queryParameters['author'] = requestParameters['author'];
200
+ }
201
+
202
+ if (requestParameters['license'] != null) {
203
+ queryParameters['license'] = requestParameters['license'];
204
+ }
205
+
206
+ if (requestParameters['sort'] != null) {
207
+ queryParameters['sort'] = requestParameters['sort'];
208
+ }
209
+
210
+ if (requestParameters['limit'] != null) {
211
+ queryParameters['limit'] = requestParameters['limit'];
212
+ }
213
+
214
+ if (requestParameters['offset'] != null) {
215
+ queryParameters['offset'] = requestParameters['offset'];
216
+ }
217
+
218
+ const headerParameters: runtime.HTTPHeaders = {};
219
+
220
+ if (this.configuration && this.configuration.accessToken) {
221
+ const token = this.configuration.accessToken;
222
+ const tokenString = await token("bearerAuth", []);
223
+
224
+ if (tokenString) {
225
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
226
+ }
227
+ }
228
+
229
+ let urlPath = `/api/v1/datasets`;
230
+
231
+ return {
232
+ path: urlPath,
233
+ method: 'GET',
234
+ headers: headerParameters,
235
+ query: queryParameters,
236
+ };
237
+ }
238
+
239
+ /**
240
+ * Cost: 5-15 credits, by rows returned.
241
+ * List datasets
242
+ */
243
+ async listDatasetsRaw(requestParameters: ListDatasetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDatasets200Response>> {
244
+ const requestOptions = await this.listDatasetsRequestOpts(requestParameters);
245
+ const response = await this.request(requestOptions, initOverrides);
246
+
247
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListDatasets200ResponseFromJSON(jsonValue));
248
+ }
249
+
250
+ /**
251
+ * Cost: 5-15 credits, by rows returned.
252
+ * List datasets
253
+ */
254
+ async listDatasets(requestParameters: ListDatasetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDatasets200Response> {
255
+ const response = await this.listDatasetsRaw(requestParameters, initOverrides);
256
+ return await response.value();
257
+ }
258
+
259
+ }
260
+
261
+ /**
262
+ * @export
263
+ */
264
+ export const ListDatasetsSortEnum = {
265
+ Downloads: 'downloads',
266
+ Downloads2: '-downloads',
267
+ Likes: 'likes',
268
+ Likes2: '-likes',
269
+ Created: 'created',
270
+ Created2: '-created',
271
+ CreatedAt: 'created_at',
272
+ CreatedAt2: '-created_at',
273
+ FirstSeen: 'first_seen',
274
+ FirstSeen2: '-first_seen',
275
+ FirstSeenAt: 'first_seen_at',
276
+ FirstSeenAt2: '-first_seen_at',
277
+ } as const;
278
+ export type ListDatasetsSortEnum = typeof ListDatasetsSortEnum[keyof typeof ListDatasetsSortEnum];
@@ -0,0 +1,213 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * abliteration.org Public API
5
+ * Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import * as runtime from '../runtime';
16
+ import {
17
+ type GetIndex200Response,
18
+ GetIndex200ResponseFromJSON,
19
+ GetIndex200ResponseToJSON,
20
+ } from '../models/GetIndex200Response';
21
+ import {
22
+ type ListIndices200Response,
23
+ ListIndices200ResponseFromJSON,
24
+ ListIndices200ResponseToJSON,
25
+ } from '../models/ListIndices200Response';
26
+
27
+ export interface GetIndexRequest {
28
+ /**
29
+ * Canonical id or one of the short aliases (DAI, FV, WEAP, F2W). Case-insensitive.
30
+ */
31
+ id: GetIndexIdEnum;
32
+ }
33
+
34
+ /**
35
+ * IndicesApi - interface
36
+ *
37
+ * @export
38
+ * @interface IndicesApiInterface
39
+ */
40
+ export interface IndicesApiInterface {
41
+ /**
42
+ * Creates request options for getIndex without sending the request
43
+ * @param {'dai' | 'DAI' | 'freedom-velocity' | 'FV' | 'freedom_velocity' | 'weaponization' | 'WEAP' | 'f2w-latency' | 'F2W' | 'f2w_latency'} id Canonical id or one of the short aliases (DAI, FV, WEAP, F2W). Case-insensitive.
44
+ * @throws {RequiredError}
45
+ * @memberof IndicesApiInterface
46
+ */
47
+ getIndexRequestOpts(requestParameters: GetIndexRequest): Promise<runtime.RequestOpts>;
48
+
49
+ /**
50
+ * Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
51
+ * @summary One index with history
52
+ * @param {'dai' | 'DAI' | 'freedom-velocity' | 'FV' | 'freedom_velocity' | 'weaponization' | 'WEAP' | 'f2w-latency' | 'F2W' | 'f2w_latency'} id Canonical id or one of the short aliases (DAI, FV, WEAP, F2W). Case-insensitive.
53
+ * @param {*} [options] Override http request option.
54
+ * @throws {RequiredError}
55
+ * @memberof IndicesApiInterface
56
+ */
57
+ getIndexRaw(requestParameters: GetIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetIndex200Response>>;
58
+
59
+ /**
60
+ * Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
61
+ * One index with history
62
+ */
63
+ getIndex(requestParameters: GetIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetIndex200Response>;
64
+
65
+ /**
66
+ * Creates request options for listIndices without sending the request
67
+ * @throws {RequiredError}
68
+ * @memberof IndicesApiInterface
69
+ */
70
+ listIndicesRequestOpts(): Promise<runtime.RequestOpts>;
71
+
72
+ /**
73
+ * Cost: 20 credits. Check the measured flag before treating a value as a finding.
74
+ * @summary All four indices
75
+ * @param {*} [options] Override http request option.
76
+ * @throws {RequiredError}
77
+ * @memberof IndicesApiInterface
78
+ */
79
+ listIndicesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListIndices200Response>>;
80
+
81
+ /**
82
+ * Cost: 20 credits. Check the measured flag before treating a value as a finding.
83
+ * All four indices
84
+ */
85
+ listIndices(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListIndices200Response>;
86
+
87
+ }
88
+
89
+ /**
90
+ *
91
+ */
92
+ export class IndicesApi extends runtime.BaseAPI implements IndicesApiInterface {
93
+
94
+ /**
95
+ * Creates request options for getIndex without sending the request
96
+ */
97
+ async getIndexRequestOpts(requestParameters: GetIndexRequest): Promise<runtime.RequestOpts> {
98
+ if (requestParameters['id'] == null) {
99
+ throw new runtime.RequiredError(
100
+ 'id',
101
+ 'Required parameter "id" was null or undefined when calling getIndex().'
102
+ );
103
+ }
104
+
105
+ const queryParameters: any = {};
106
+
107
+ const headerParameters: runtime.HTTPHeaders = {};
108
+
109
+ if (this.configuration && this.configuration.accessToken) {
110
+ const token = this.configuration.accessToken;
111
+ const tokenString = await token("bearerAuth", []);
112
+
113
+ if (tokenString) {
114
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
115
+ }
116
+ }
117
+
118
+ let urlPath = `/api/v1/indices/{id}`;
119
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
120
+
121
+ return {
122
+ path: urlPath,
123
+ method: 'GET',
124
+ headers: headerParameters,
125
+ query: queryParameters,
126
+ };
127
+ }
128
+
129
+ /**
130
+ * Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
131
+ * One index with history
132
+ */
133
+ async getIndexRaw(requestParameters: GetIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetIndex200Response>> {
134
+ const requestOptions = await this.getIndexRequestOpts(requestParameters);
135
+ const response = await this.request(requestOptions, initOverrides);
136
+
137
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetIndex200ResponseFromJSON(jsonValue));
138
+ }
139
+
140
+ /**
141
+ * Cost: 10 credits. Only dai has a history series; the others return an empty array with history_available false.
142
+ * One index with history
143
+ */
144
+ async getIndex(requestParameters: GetIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetIndex200Response> {
145
+ const response = await this.getIndexRaw(requestParameters, initOverrides);
146
+ return await response.value();
147
+ }
148
+
149
+ /**
150
+ * Creates request options for listIndices without sending the request
151
+ */
152
+ async listIndicesRequestOpts(): Promise<runtime.RequestOpts> {
153
+ const queryParameters: any = {};
154
+
155
+ const headerParameters: runtime.HTTPHeaders = {};
156
+
157
+ if (this.configuration && this.configuration.accessToken) {
158
+ const token = this.configuration.accessToken;
159
+ const tokenString = await token("bearerAuth", []);
160
+
161
+ if (tokenString) {
162
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
163
+ }
164
+ }
165
+
166
+ let urlPath = `/api/v1/indices`;
167
+
168
+ return {
169
+ path: urlPath,
170
+ method: 'GET',
171
+ headers: headerParameters,
172
+ query: queryParameters,
173
+ };
174
+ }
175
+
176
+ /**
177
+ * Cost: 20 credits. Check the measured flag before treating a value as a finding.
178
+ * All four indices
179
+ */
180
+ async listIndicesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListIndices200Response>> {
181
+ const requestOptions = await this.listIndicesRequestOpts();
182
+ const response = await this.request(requestOptions, initOverrides);
183
+
184
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListIndices200ResponseFromJSON(jsonValue));
185
+ }
186
+
187
+ /**
188
+ * Cost: 20 credits. Check the measured flag before treating a value as a finding.
189
+ * All four indices
190
+ */
191
+ async listIndices(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListIndices200Response> {
192
+ const response = await this.listIndicesRaw(initOverrides);
193
+ return await response.value();
194
+ }
195
+
196
+ }
197
+
198
+ /**
199
+ * @export
200
+ */
201
+ export const GetIndexIdEnum = {
202
+ Dai: 'dai',
203
+ Dai2: 'DAI',
204
+ FreedomVelocity: 'freedom-velocity',
205
+ Fv: 'FV',
206
+ FreedomVelocity2: 'freedom_velocity',
207
+ Weaponization: 'weaponization',
208
+ Weap: 'WEAP',
209
+ F2wLatency: 'f2w-latency',
210
+ F2W: 'F2W',
211
+ F2wLatency2: 'f2w_latency',
212
+ } as const;
213
+ export type GetIndexIdEnum = typeof GetIndexIdEnum[keyof typeof GetIndexIdEnum];