@abliteration/sdk 0.1.0 → 0.1.1
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.
- package/.openapi-generator/FILES +76 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +140 -49
- package/dist/apis/AuthorsApi.d.ts +11 -3
- package/dist/apis/AuthorsApi.js +8 -0
- package/dist/apis/DatasetsApi.d.ts +9 -3
- package/dist/apis/DatasetsApi.js +6 -0
- package/dist/apis/IndicesApi.d.ts +9 -3
- package/dist/apis/IndicesApi.js +6 -0
- package/dist/apis/ModelsApi.d.ts +9 -3
- package/dist/apis/ModelsApi.js +6 -0
- package/dist/esm/apis/AuthorsApi.d.ts +11 -3
- package/dist/esm/apis/AuthorsApi.js +8 -0
- package/dist/esm/apis/DatasetsApi.d.ts +9 -3
- package/dist/esm/apis/DatasetsApi.js +6 -0
- package/dist/esm/apis/IndicesApi.d.ts +9 -3
- package/dist/esm/apis/IndicesApi.js +6 -0
- package/dist/esm/apis/ModelsApi.d.ts +9 -3
- package/dist/esm/apis/ModelsApi.js +6 -0
- package/dist/esm/models/Author.d.ts +4 -0
- package/dist/esm/models/Author.js +2 -0
- package/dist/esm/models/AuthorDetail.d.ts +4 -0
- package/dist/esm/models/AuthorDetail.js +2 -0
- package/dist/models/Author.d.ts +4 -0
- package/dist/models/Author.js +2 -0
- package/dist/models/AuthorDetail.d.ts +4 -0
- package/dist/models/AuthorDetail.js +2 -0
- package/docs/Author.md +44 -0
- package/docs/AuthorDetail.md +46 -0
- package/docs/AuthorsApi.md +167 -0
- package/docs/DaiPoint.md +38 -0
- package/docs/Dataset.md +54 -0
- package/docs/DatasetDetail.md +39 -0
- package/docs/DatasetsApi.md +176 -0
- package/docs/Envelope.md +48 -0
- package/docs/Event.md +46 -0
- package/docs/GetAuthor200Response.md +48 -0
- package/docs/GetDataset200Response.md +48 -0
- package/docs/GetIndex200Response.md +48 -0
- package/docs/GetMethod200Response.md +48 -0
- package/docs/GetModel200Response.md +48 -0
- package/docs/IndexDetail.md +54 -0
- package/docs/IndicesApi.md +153 -0
- package/docs/ListAuthors200Response.md +48 -0
- package/docs/ListDatasets200Response.md +48 -0
- package/docs/ListIndices200Response.md +48 -0
- package/docs/ListMethods200Response.md +48 -0
- package/docs/ListModels200Response.md +48 -0
- package/docs/ListTimeline200Response.md +48 -0
- package/docs/Method.md +44 -0
- package/docs/MethodDetail.md +50 -0
- package/docs/MethodDetailAllOfTopAuthors.md +36 -0
- package/docs/MethodsApi.md +153 -0
- package/docs/ModelDetail.md +45 -0
- package/docs/ModelError.md +42 -0
- package/docs/ModelIndex.md +52 -0
- package/docs/ModelSummary.md +58 -0
- package/docs/ModelsApi.md +191 -0
- package/docs/Passport.md +38 -0
- package/docs/TimelineApi.md +93 -0
- package/openapi-generator-config.json +10 -0
- package/package.json +14 -16
- package/src/apis/AuthorsApi.ts +248 -0
- package/src/apis/DatasetsApi.ts +278 -0
- package/src/apis/IndicesApi.ts +213 -0
- package/src/apis/MethodsApi.ts +214 -0
- package/src/apis/ModelsApi.ts +328 -0
- package/src/apis/TimelineApi.ts +148 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +5 -0
- package/src/models/Author.ts +93 -0
- package/src/models/AuthorDetail.ts +107 -0
- package/src/models/DaiPoint.ts +75 -0
- package/src/models/Dataset.ts +123 -0
- package/src/models/DatasetDetail.ts +86 -0
- package/src/models/Envelope.ts +124 -0
- package/src/models/Event.ts +99 -0
- package/src/models/GetAuthor200Response.ts +132 -0
- package/src/models/GetDataset200Response.ts +132 -0
- package/src/models/GetIndex200Response.ts +132 -0
- package/src/models/GetMethod200Response.ts +132 -0
- package/src/models/GetModel200Response.ts +132 -0
- package/src/models/IndexDetail.ts +153 -0
- package/src/models/ListAuthors200Response.ts +132 -0
- package/src/models/ListDatasets200Response.ts +132 -0
- package/src/models/ListIndices200Response.ts +132 -0
- package/src/models/ListMethods200Response.ts +132 -0
- package/src/models/ListModels200Response.ts +132 -0
- package/src/models/ListTimeline200Response.ts +132 -0
- package/src/models/Method.ts +106 -0
- package/src/models/MethodDetail.ts +139 -0
- package/src/models/MethodDetailAllOfTopAuthors.ts +69 -0
- package/src/models/ModelDetail.ts +104 -0
- package/src/models/ModelError.ts +89 -0
- package/src/models/ModelIndex.ts +147 -0
- package/src/models/ModelSummary.ts +135 -0
- package/src/models/Passport.ts +75 -0
- package/src/models/index.ts +29 -0
- package/src/runtime.ts +505 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abliteration/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "OpenAPI client for @abliteration/sdk",
|
|
5
|
+
"author": "OpenAPI-Generator",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/neymark/abliteration.git"
|
|
9
|
+
},
|
|
6
10
|
"main": "./dist/index.js",
|
|
7
11
|
"types": "./dist/index.d.ts",
|
|
8
12
|
"module": "./dist/esm/index.js",
|
|
@@ -14,18 +18,12 @@
|
|
|
14
18
|
"devDependencies": {
|
|
15
19
|
"typescript": "^4.0 || ^5.0"
|
|
16
20
|
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"registry": "https://registry.npmjs.org/",
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
17
25
|
"homepage": "https://abliteration.org/api",
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"llm",
|
|
22
|
-
"catalog",
|
|
23
|
-
"api",
|
|
24
|
-
"openapi",
|
|
25
|
-
"sdk"
|
|
26
|
-
],
|
|
27
|
-
"files": [
|
|
28
|
-
"dist",
|
|
29
|
-
"README.md"
|
|
30
|
-
]
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/neymark/abliteration/issues"
|
|
28
|
+
}
|
|
31
29
|
}
|
|
@@ -0,0 +1,248 @@
|
|
|
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 GetAuthor200Response,
|
|
18
|
+
GetAuthor200ResponseFromJSON,
|
|
19
|
+
GetAuthor200ResponseToJSON,
|
|
20
|
+
} from '../models/GetAuthor200Response';
|
|
21
|
+
import {
|
|
22
|
+
type ListAuthors200Response,
|
|
23
|
+
ListAuthors200ResponseFromJSON,
|
|
24
|
+
ListAuthors200ResponseToJSON,
|
|
25
|
+
} from '../models/ListAuthors200Response';
|
|
26
|
+
|
|
27
|
+
export interface GetAuthorRequest {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ListAuthorsRequest {
|
|
35
|
+
/**
|
|
36
|
+
* Bare key is DESC (largest first); a leading `-` flips to ASC. Aliases: `downloads` == `total_downloads`, `models` == `total_models`, `likes` == `total_likes`.
|
|
37
|
+
*/
|
|
38
|
+
sort?: ListAuthorsSortEnum;
|
|
39
|
+
/**
|
|
40
|
+
* Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
41
|
+
*/
|
|
42
|
+
limit?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Rows to skip. Negative and non-numeric values are treated as 0.
|
|
45
|
+
*/
|
|
46
|
+
offset?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* AuthorsApi - interface
|
|
51
|
+
*
|
|
52
|
+
* @export
|
|
53
|
+
* @interface AuthorsApiInterface
|
|
54
|
+
*/
|
|
55
|
+
export interface AuthorsApiInterface {
|
|
56
|
+
/**
|
|
57
|
+
* Creates request options for getAuthor without sending the request
|
|
58
|
+
* @param {string} id
|
|
59
|
+
* @throws {RequiredError}
|
|
60
|
+
* @memberof AuthorsApiInterface
|
|
61
|
+
*/
|
|
62
|
+
getAuthorRequestOpts(requestParameters: GetAuthorRequest): Promise<runtime.RequestOpts>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Cost: 1 credit.
|
|
66
|
+
* @summary Get one author
|
|
67
|
+
* @param {string} id
|
|
68
|
+
* @param {*} [options] Override http request option.
|
|
69
|
+
* @throws {RequiredError}
|
|
70
|
+
* @memberof AuthorsApiInterface
|
|
71
|
+
*/
|
|
72
|
+
getAuthorRaw(requestParameters: GetAuthorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAuthor200Response>>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Cost: 1 credit.
|
|
76
|
+
* Get one author
|
|
77
|
+
*/
|
|
78
|
+
getAuthor(requestParameters: GetAuthorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAuthor200Response>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates request options for listAuthors without sending the request
|
|
82
|
+
* @param {'total_downloads' | '-total_downloads' | 'downloads' | '-downloads' | 'total_models' | '-total_models' | 'models' | '-models' | 'total_likes' | '-total_likes' | 'likes' | '-likes'} [sort] Bare key is DESC (largest first); a leading `-` flips to ASC. Aliases: `downloads` == `total_downloads`, `models` == `total_models`, `likes` == `total_likes`.
|
|
83
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
84
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
* @memberof AuthorsApiInterface
|
|
87
|
+
*/
|
|
88
|
+
listAuthorsRequestOpts(requestParameters: ListAuthorsRequest): Promise<runtime.RequestOpts>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Cost: 5-15 credits, by rows returned.
|
|
92
|
+
* @summary List authors
|
|
93
|
+
* @param {'total_downloads' | '-total_downloads' | 'downloads' | '-downloads' | 'total_models' | '-total_models' | 'models' | '-models' | 'total_likes' | '-total_likes' | 'likes' | '-likes'} [sort] Bare key is DESC (largest first); a leading `-` flips to ASC. Aliases: `downloads` == `total_downloads`, `models` == `total_models`, `likes` == `total_likes`.
|
|
94
|
+
* @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
|
|
95
|
+
* @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
|
|
96
|
+
* @param {*} [options] Override http request option.
|
|
97
|
+
* @throws {RequiredError}
|
|
98
|
+
* @memberof AuthorsApiInterface
|
|
99
|
+
*/
|
|
100
|
+
listAuthorsRaw(requestParameters: ListAuthorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAuthors200Response>>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Cost: 5-15 credits, by rows returned.
|
|
104
|
+
* List authors
|
|
105
|
+
*/
|
|
106
|
+
listAuthors(requestParameters: ListAuthorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAuthors200Response>;
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
export class AuthorsApi extends runtime.BaseAPI implements AuthorsApiInterface {
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates request options for getAuthor without sending the request
|
|
117
|
+
*/
|
|
118
|
+
async getAuthorRequestOpts(requestParameters: GetAuthorRequest): Promise<runtime.RequestOpts> {
|
|
119
|
+
if (requestParameters['id'] == null) {
|
|
120
|
+
throw new runtime.RequiredError(
|
|
121
|
+
'id',
|
|
122
|
+
'Required parameter "id" was null or undefined when calling getAuthor().'
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const queryParameters: any = {};
|
|
127
|
+
|
|
128
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
129
|
+
|
|
130
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
131
|
+
const token = this.configuration.accessToken;
|
|
132
|
+
const tokenString = await token("bearerAuth", []);
|
|
133
|
+
|
|
134
|
+
if (tokenString) {
|
|
135
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
let urlPath = `/api/v1/authors/{id}`;
|
|
140
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
path: urlPath,
|
|
144
|
+
method: 'GET',
|
|
145
|
+
headers: headerParameters,
|
|
146
|
+
query: queryParameters,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Cost: 1 credit.
|
|
152
|
+
* Get one author
|
|
153
|
+
*/
|
|
154
|
+
async getAuthorRaw(requestParameters: GetAuthorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAuthor200Response>> {
|
|
155
|
+
const requestOptions = await this.getAuthorRequestOpts(requestParameters);
|
|
156
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
157
|
+
|
|
158
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetAuthor200ResponseFromJSON(jsonValue));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Cost: 1 credit.
|
|
163
|
+
* Get one author
|
|
164
|
+
*/
|
|
165
|
+
async getAuthor(requestParameters: GetAuthorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAuthor200Response> {
|
|
166
|
+
const response = await this.getAuthorRaw(requestParameters, initOverrides);
|
|
167
|
+
return await response.value();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Creates request options for listAuthors without sending the request
|
|
172
|
+
*/
|
|
173
|
+
async listAuthorsRequestOpts(requestParameters: ListAuthorsRequest): Promise<runtime.RequestOpts> {
|
|
174
|
+
const queryParameters: any = {};
|
|
175
|
+
|
|
176
|
+
if (requestParameters['sort'] != null) {
|
|
177
|
+
queryParameters['sort'] = requestParameters['sort'];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (requestParameters['limit'] != null) {
|
|
181
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (requestParameters['offset'] != null) {
|
|
185
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
189
|
+
|
|
190
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
191
|
+
const token = this.configuration.accessToken;
|
|
192
|
+
const tokenString = await token("bearerAuth", []);
|
|
193
|
+
|
|
194
|
+
if (tokenString) {
|
|
195
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let urlPath = `/api/v1/authors`;
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
path: urlPath,
|
|
203
|
+
method: 'GET',
|
|
204
|
+
headers: headerParameters,
|
|
205
|
+
query: queryParameters,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Cost: 5-15 credits, by rows returned.
|
|
211
|
+
* List authors
|
|
212
|
+
*/
|
|
213
|
+
async listAuthorsRaw(requestParameters: ListAuthorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAuthors200Response>> {
|
|
214
|
+
const requestOptions = await this.listAuthorsRequestOpts(requestParameters);
|
|
215
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
216
|
+
|
|
217
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListAuthors200ResponseFromJSON(jsonValue));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Cost: 5-15 credits, by rows returned.
|
|
222
|
+
* List authors
|
|
223
|
+
*/
|
|
224
|
+
async listAuthors(requestParameters: ListAuthorsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAuthors200Response> {
|
|
225
|
+
const response = await this.listAuthorsRaw(requestParameters, initOverrides);
|
|
226
|
+
return await response.value();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @export
|
|
233
|
+
*/
|
|
234
|
+
export const ListAuthorsSortEnum = {
|
|
235
|
+
TotalDownloads: 'total_downloads',
|
|
236
|
+
TotalDownloads2: '-total_downloads',
|
|
237
|
+
Downloads: 'downloads',
|
|
238
|
+
Downloads2: '-downloads',
|
|
239
|
+
TotalModels: 'total_models',
|
|
240
|
+
TotalModels2: '-total_models',
|
|
241
|
+
Models: 'models',
|
|
242
|
+
Models2: '-models',
|
|
243
|
+
TotalLikes: 'total_likes',
|
|
244
|
+
TotalLikes2: '-total_likes',
|
|
245
|
+
Likes: 'likes',
|
|
246
|
+
Likes2: '-likes',
|
|
247
|
+
} as const;
|
|
248
|
+
export type ListAuthorsSortEnum = typeof ListAuthorsSortEnum[keyof typeof ListAuthorsSortEnum];
|
|
@@ -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 = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` 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 = most first, dates = newest first). A leading `-` flips it. `created` and `first_seen` 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];
|