@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,191 @@
1
+ # ModelsApi
2
+
3
+ All URIs are relative to *https://abliteration.org*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**getModel**](ModelsApi.md#getmodel) | **GET** /api/v1/models/{id} | Get one model |
8
+ | [**listModels**](ModelsApi.md#listmodels) | **GET** /api/v1/models | List models |
9
+
10
+
11
+
12
+ ## getModel
13
+
14
+ > GetModel200Response getModel(id)
15
+
16
+ Get one model
17
+
18
+ Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded.
19
+
20
+ ### Example
21
+
22
+ ```ts
23
+ import {
24
+ Configuration,
25
+ ModelsApi,
26
+ } from '@abliteration/sdk';
27
+ import type { GetModelRequest } from '@abliteration/sdk';
28
+
29
+ async function example() {
30
+ console.log("🚀 Testing @abliteration/sdk SDK...");
31
+ const config = new Configuration({
32
+ // Configure HTTP bearer authorization: bearerAuth
33
+ accessToken: "YOUR BEARER TOKEN",
34
+ });
35
+ const api = new ModelsApi(config);
36
+
37
+ const body = {
38
+ // string
39
+ id: mlabonne/Qwen3-30B-A3B-abliterated,
40
+ } satisfies GetModelRequest;
41
+
42
+ try {
43
+ const data = await api.getModel(body);
44
+ console.log(data);
45
+ } catch (error) {
46
+ console.error(error);
47
+ }
48
+ }
49
+
50
+ // Run the test
51
+ example().catch(console.error);
52
+ ```
53
+
54
+ ### Parameters
55
+
56
+
57
+ | Name | Type | Description | Notes |
58
+ |------------- | ------------- | ------------- | -------------|
59
+ | **id** | `string` | | [Defaults to `undefined`] |
60
+
61
+ ### Return type
62
+
63
+ [**GetModel200Response**](GetModel200Response.md)
64
+
65
+ ### Authorization
66
+
67
+ [bearerAuth](../README.md#bearerAuth)
68
+
69
+ ### HTTP request headers
70
+
71
+ - **Content-Type**: Not defined
72
+ - **Accept**: `application/json`
73
+
74
+
75
+ ### HTTP response details
76
+ | Status code | Description | Response headers |
77
+ |-------------|-------------|------------------|
78
+ | **200** | Full model record. | - |
79
+ | **401** | Missing, unknown or revoked key. | - |
80
+ | **402** | Not enough credits. Only possible while metering is enabled. | - |
81
+ | **404** | No such entity. | - |
82
+ | **429** | Per-key rate limit exceeded. Retry-After header is set. | - |
83
+ | **503** | Catalog temporarily unreadable. Nothing was charged. | - |
84
+
85
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
86
+
87
+
88
+ ## listModels
89
+
90
+ > ListModels200Response listModels(method, family, author, license, downloadsGte, downloadsLte, createdAfter, createdBefore, sort, limit, offset)
91
+
92
+ List models
93
+
94
+ Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded here but remain reachable by id.
95
+
96
+ ### Example
97
+
98
+ ```ts
99
+ import {
100
+ Configuration,
101
+ ModelsApi,
102
+ } from '@abliteration/sdk';
103
+ import type { ListModelsRequest } from '@abliteration/sdk';
104
+
105
+ async function example() {
106
+ console.log("🚀 Testing @abliteration/sdk SDK...");
107
+ const config = new Configuration({
108
+ // Configure HTTP bearer authorization: bearerAuth
109
+ accessToken: "YOUR BEARER TOKEN",
110
+ });
111
+ const api = new ModelsApi(config);
112
+
113
+ const body = {
114
+ // string | M-code, case-insensitive. See GET /api/v1/methods. (optional)
115
+ method: method_example,
116
+ // string | Base family, for example qwen or llama. (optional)
117
+ family: family_example,
118
+ // string | Publisher handle, case-insensitive. (optional)
119
+ author: author_example,
120
+ // string | SPDX-ish license string as published. (optional)
121
+ license: license_example,
122
+ // number (optional)
123
+ downloadsGte: 56,
124
+ // number (optional)
125
+ downloadsLte: 56,
126
+ // string | ISO-8601 date or timestamp, inclusive. (optional)
127
+ createdAfter: createdAfter_example,
128
+ // string | ISO-8601 date or timestamp, inclusive. (optional)
129
+ createdBefore: createdBefore_example,
130
+ // 'downloads' | '-downloads' | 'likes' | '-likes' | 'created' | '-created' | 'created_at' | '-created_at' | 'first_seen' | '-first_seen' | 'first_seen_at' | '-first_seen_at' | 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. (optional)
131
+ sort: sort_example,
132
+ // number | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (optional)
133
+ limit: 56,
134
+ // number | Rows to skip. Negative and non-numeric values are treated as 0. (optional)
135
+ offset: 56,
136
+ } satisfies ListModelsRequest;
137
+
138
+ try {
139
+ const data = await api.listModels(body);
140
+ console.log(data);
141
+ } catch (error) {
142
+ console.error(error);
143
+ }
144
+ }
145
+
146
+ // Run the test
147
+ example().catch(console.error);
148
+ ```
149
+
150
+ ### Parameters
151
+
152
+
153
+ | Name | Type | Description | Notes |
154
+ |------------- | ------------- | ------------- | -------------|
155
+ | **method** | `string` | M-code, case-insensitive. See GET /api/v1/methods. | [Optional] [Defaults to `undefined`] |
156
+ | **family** | `string` | Base family, for example qwen or llama. | [Optional] [Defaults to `undefined`] |
157
+ | **author** | `string` | Publisher handle, case-insensitive. | [Optional] [Defaults to `undefined`] |
158
+ | **license** | `string` | SPDX-ish license string as published. | [Optional] [Defaults to `undefined`] |
159
+ | **downloadsGte** | `number` | | [Optional] [Defaults to `undefined`] |
160
+ | **downloadsLte** | `number` | | [Optional] [Defaults to `undefined`] |
161
+ | **createdAfter** | `string` | ISO-8601 date or timestamp, inclusive. | [Optional] [Defaults to `undefined`] |
162
+ | **createdBefore** | `string` | ISO-8601 date or timestamp, inclusive. | [Optional] [Defaults to `undefined`] |
163
+ | **sort** | `downloads`, `-downloads`, `likes`, `-likes`, `created`, `-created`, `created_at`, `-created_at`, `first_seen`, `-first_seen`, `first_seen_at`, `-first_seen_at` | 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. | [Optional] [Defaults to `'downloads'`] [Enum: downloads, -downloads, likes, -likes, created, -created, created_at, -created_at, first_seen, -first_seen, first_seen_at, -first_seen_at] |
164
+ | **limit** | `number` | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. | [Optional] [Defaults to `50`] |
165
+ | **offset** | `number` | Rows to skip. Negative and non-numeric values are treated as 0. | [Optional] [Defaults to `0`] |
166
+
167
+ ### Return type
168
+
169
+ [**ListModels200Response**](ListModels200Response.md)
170
+
171
+ ### Authorization
172
+
173
+ [bearerAuth](../README.md#bearerAuth)
174
+
175
+ ### HTTP request headers
176
+
177
+ - **Content-Type**: Not defined
178
+ - **Accept**: `application/json`
179
+
180
+
181
+ ### HTTP response details
182
+ | Status code | Description | Response headers |
183
+ |-------------|-------------|------------------|
184
+ | **200** | Matching models. | - |
185
+ | **401** | Missing, unknown or revoked key. | - |
186
+ | **402** | Not enough credits. Only possible while metering is enabled. | - |
187
+ | **429** | Per-key rate limit exceeded. Retry-After header is set. | - |
188
+ | **503** | Catalog temporarily unreadable. Nothing was charged. | - |
189
+
190
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
191
+
@@ -0,0 +1,38 @@
1
+
2
+ # Passport
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `one_liner` | string
10
+ `practitioner` | string
11
+ `research` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { Passport } from '@abliteration/sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "one_liner": null,
21
+ "practitioner": null,
22
+ "research": null,
23
+ } satisfies Passport
24
+
25
+ console.log(example)
26
+
27
+ // Convert the instance to a JSON string
28
+ const exampleJSON: string = JSON.stringify(example)
29
+ console.log(exampleJSON)
30
+
31
+ // Parse the JSON string back to an object
32
+ const exampleParsed = JSON.parse(exampleJSON) as Passport
33
+ console.log(exampleParsed)
34
+ ```
35
+
36
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
37
+
38
+
@@ -0,0 +1,93 @@
1
+ # TimelineApi
2
+
3
+ All URIs are relative to *https://abliteration.org*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**listTimeline**](TimelineApi.md#listtimeline) | **GET** /api/v1/timeline | Curated field events |
8
+
9
+
10
+
11
+ ## listTimeline
12
+
13
+ > ListTimeline200Response listTimeline(from, to, eventType, limit)
14
+
15
+ Curated field events
16
+
17
+ Cost: 50 credits, flat.
18
+
19
+ ### Example
20
+
21
+ ```ts
22
+ import {
23
+ Configuration,
24
+ TimelineApi,
25
+ } from '@abliteration/sdk';
26
+ import type { ListTimelineRequest } from '@abliteration/sdk';
27
+
28
+ async function example() {
29
+ console.log("🚀 Testing @abliteration/sdk SDK...");
30
+ const config = new Configuration({
31
+ // Configure HTTP bearer authorization: bearerAuth
32
+ accessToken: "YOUR BEARER TOKEN",
33
+ });
34
+ const api = new TimelineApi(config);
35
+
36
+ const body = {
37
+ // string | Inclusive lower bound on the event date, ISO-8601. (optional)
38
+ from: from_example,
39
+ // string | Inclusive upper bound on the event date, ISO-8601. (optional)
40
+ to: to_example,
41
+ // string | Event type, case-insensitive. (optional)
42
+ eventType: eventType_example,
43
+ // number (optional)
44
+ limit: 56,
45
+ } satisfies ListTimelineRequest;
46
+
47
+ try {
48
+ const data = await api.listTimeline(body);
49
+ console.log(data);
50
+ } catch (error) {
51
+ console.error(error);
52
+ }
53
+ }
54
+
55
+ // Run the test
56
+ example().catch(console.error);
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+
62
+ | Name | Type | Description | Notes |
63
+ |------------- | ------------- | ------------- | -------------|
64
+ | **from** | `string` | Inclusive lower bound on the event date, ISO-8601. | [Optional] [Defaults to `undefined`] |
65
+ | **to** | `string` | Inclusive upper bound on the event date, ISO-8601. | [Optional] [Defaults to `undefined`] |
66
+ | **eventType** | `string` | Event type, case-insensitive. | [Optional] [Defaults to `undefined`] |
67
+ | **limit** | `number` | | [Optional] [Defaults to `100`] |
68
+
69
+ ### Return type
70
+
71
+ [**ListTimeline200Response**](ListTimeline200Response.md)
72
+
73
+ ### Authorization
74
+
75
+ [bearerAuth](../README.md#bearerAuth)
76
+
77
+ ### HTTP request headers
78
+
79
+ - **Content-Type**: Not defined
80
+ - **Accept**: `application/json`
81
+
82
+
83
+ ### HTTP response details
84
+ | Status code | Description | Response headers |
85
+ |-------------|-------------|------------------|
86
+ | **200** | Events, newest first. | - |
87
+ | **401** | Missing, unknown or revoked key. | - |
88
+ | **402** | Not enough credits. Only possible while metering is enabled. | - |
89
+ | **429** | Per-key rate limit exceeded. Retry-After header is set. | - |
90
+ | **503** | Catalog temporarily unreadable. Nothing was charged. | - |
91
+
92
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
93
+
@@ -0,0 +1,10 @@
1
+ {
2
+ "npmName": "@abliteration/sdk",
3
+ "npmVersion": "0.1.0",
4
+ "npmRepository": "https://abliteration.org/api",
5
+ "supportsES6": true,
6
+ "typescriptThreePlus": true,
7
+ "modelPropertyNaming": "original",
8
+ "withInterfaces": true,
9
+ "useSingleRequestParameter": true
10
+ }
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@abliteration/sdk",
3
- "version": "0.1.0",
4
- "description": "Auto-generated TypeScript SDK for the abliteration.org LLM catalog API. Covers every route on /api/v1 with typed models.",
5
- "author": "Catyonic OU <contact@catyonic.com>",
3
+ "version": "0.1.2",
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
- "license": "MIT",
19
- "keywords": [
20
- "abliteration",
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 &#x60;-&#x60; flips to ASC. Aliases: &#x60;downloads&#x60; &#x3D;&#x3D; &#x60;total_downloads&#x60;, &#x60;models&#x60; &#x3D;&#x3D; &#x60;total_models&#x60;, &#x60;likes&#x60; &#x3D;&#x3D; &#x60;total_likes&#x60;.
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 &#x60;-&#x60; flips to ASC. Aliases: &#x60;downloads&#x60; &#x3D;&#x3D; &#x60;total_downloads&#x60;, &#x60;models&#x60; &#x3D;&#x3D; &#x60;total_models&#x60;, &#x60;likes&#x60; &#x3D;&#x3D; &#x60;total_likes&#x60;.
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];