@abliteration/sdk 0.1.0

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 (150) hide show
  1. package/README.md +67 -0
  2. package/dist/apis/AuthorsApi.d.ts +131 -0
  3. package/dist/apis/AuthorsApi.js +144 -0
  4. package/dist/apis/DatasetsApi.d.ts +151 -0
  5. package/dist/apis/DatasetsApi.js +155 -0
  6. package/dist/apis/IndicesApi.d.ts +111 -0
  7. package/dist/apis/IndicesApi.js +135 -0
  8. package/dist/apis/MethodsApi.d.ts +118 -0
  9. package/dist/apis/MethodsApi.js +142 -0
  10. package/dist/apis/ModelsApi.d.ts +181 -0
  11. package/dist/apis/ModelsApi.js +170 -0
  12. package/dist/apis/TimelineApi.d.ts +85 -0
  13. package/dist/apis/TimelineApi.js +89 -0
  14. package/dist/apis/index.d.ts +6 -0
  15. package/dist/apis/index.js +24 -0
  16. package/dist/esm/apis/AuthorsApi.d.ts +131 -0
  17. package/dist/esm/apis/AuthorsApi.js +140 -0
  18. package/dist/esm/apis/DatasetsApi.d.ts +151 -0
  19. package/dist/esm/apis/DatasetsApi.js +151 -0
  20. package/dist/esm/apis/IndicesApi.d.ts +111 -0
  21. package/dist/esm/apis/IndicesApi.js +131 -0
  22. package/dist/esm/apis/MethodsApi.d.ts +118 -0
  23. package/dist/esm/apis/MethodsApi.js +138 -0
  24. package/dist/esm/apis/ModelsApi.d.ts +181 -0
  25. package/dist/esm/apis/ModelsApi.js +166 -0
  26. package/dist/esm/apis/TimelineApi.d.ts +85 -0
  27. package/dist/esm/apis/TimelineApi.js +85 -0
  28. package/dist/esm/apis/index.d.ts +6 -0
  29. package/dist/esm/apis/index.js +8 -0
  30. package/dist/esm/index.d.ts +3 -0
  31. package/dist/esm/index.js +5 -0
  32. package/dist/esm/models/Author.d.ts +46 -0
  33. package/dist/esm/models/Author.js +49 -0
  34. package/dist/esm/models/AuthorDetail.d.ts +51 -0
  35. package/dist/esm/models/AuthorDetail.js +52 -0
  36. package/dist/esm/models/DaiPoint.d.ts +38 -0
  37. package/dist/esm/models/DaiPoint.js +45 -0
  38. package/dist/esm/models/Dataset.d.ts +70 -0
  39. package/dist/esm/models/Dataset.js +61 -0
  40. package/dist/esm/models/DatasetDetail.d.ts +40 -0
  41. package/dist/esm/models/DatasetDetail.js +38 -0
  42. package/dist/esm/models/Envelope.d.ts +66 -0
  43. package/dist/esm/models/Envelope.js +78 -0
  44. package/dist/esm/models/Event.d.ts +54 -0
  45. package/dist/esm/models/Event.js +53 -0
  46. package/dist/esm/models/GetAuthor200Response.d.ts +67 -0
  47. package/dist/esm/models/GetAuthor200Response.js +79 -0
  48. package/dist/esm/models/GetDataset200Response.d.ts +67 -0
  49. package/dist/esm/models/GetDataset200Response.js +79 -0
  50. package/dist/esm/models/GetIndex200Response.d.ts +67 -0
  51. package/dist/esm/models/GetIndex200Response.js +79 -0
  52. package/dist/esm/models/GetMethod200Response.d.ts +67 -0
  53. package/dist/esm/models/GetMethod200Response.js +79 -0
  54. package/dist/esm/models/GetModel200Response.d.ts +67 -0
  55. package/dist/esm/models/GetModel200Response.js +79 -0
  56. package/dist/esm/models/IndexDetail.d.ts +89 -0
  57. package/dist/esm/models/IndexDetail.js +78 -0
  58. package/dist/esm/models/ListAuthors200Response.d.ts +67 -0
  59. package/dist/esm/models/ListAuthors200Response.js +79 -0
  60. package/dist/esm/models/ListDatasets200Response.d.ts +67 -0
  61. package/dist/esm/models/ListDatasets200Response.js +79 -0
  62. package/dist/esm/models/ListIndices200Response.d.ts +67 -0
  63. package/dist/esm/models/ListIndices200Response.js +79 -0
  64. package/dist/esm/models/ListMethods200Response.d.ts +67 -0
  65. package/dist/esm/models/ListMethods200Response.js +79 -0
  66. package/dist/esm/models/ListModels200Response.d.ts +67 -0
  67. package/dist/esm/models/ListModels200Response.js +79 -0
  68. package/dist/esm/models/ListTimeline200Response.d.ts +67 -0
  69. package/dist/esm/models/ListTimeline200Response.js +79 -0
  70. package/dist/esm/models/Method.d.ts +60 -0
  71. package/dist/esm/models/Method.js +60 -0
  72. package/dist/esm/models/MethodDetail.d.ts +74 -0
  73. package/dist/esm/models/MethodDetail.js +68 -0
  74. package/dist/esm/models/MethodDetailAllOfTopAuthors.d.ts +34 -0
  75. package/dist/esm/models/MethodDetailAllOfTopAuthors.js +43 -0
  76. package/dist/esm/models/ModelDetail.d.ts +52 -0
  77. package/dist/esm/models/ModelDetail.js +38 -0
  78. package/dist/esm/models/ModelError.d.ts +46 -0
  79. package/dist/esm/models/ModelError.js +53 -0
  80. package/dist/esm/models/ModelIndex.d.ts +85 -0
  81. package/dist/esm/models/ModelIndex.js +76 -0
  82. package/dist/esm/models/ModelSummary.d.ts +78 -0
  83. package/dist/esm/models/ModelSummary.js +65 -0
  84. package/dist/esm/models/Passport.d.ts +38 -0
  85. package/dist/esm/models/Passport.js +45 -0
  86. package/dist/esm/models/index.d.ts +27 -0
  87. package/dist/esm/models/index.js +29 -0
  88. package/dist/esm/runtime.d.ts +196 -0
  89. package/dist/esm/runtime.js +400 -0
  90. package/dist/index.d.ts +3 -0
  91. package/dist/index.js +21 -0
  92. package/dist/models/Author.d.ts +46 -0
  93. package/dist/models/Author.js +56 -0
  94. package/dist/models/AuthorDetail.d.ts +51 -0
  95. package/dist/models/AuthorDetail.js +59 -0
  96. package/dist/models/DaiPoint.d.ts +38 -0
  97. package/dist/models/DaiPoint.js +52 -0
  98. package/dist/models/Dataset.d.ts +70 -0
  99. package/dist/models/Dataset.js +68 -0
  100. package/dist/models/DatasetDetail.d.ts +40 -0
  101. package/dist/models/DatasetDetail.js +45 -0
  102. package/dist/models/Envelope.d.ts +66 -0
  103. package/dist/models/Envelope.js +86 -0
  104. package/dist/models/Event.d.ts +54 -0
  105. package/dist/models/Event.js +60 -0
  106. package/dist/models/GetAuthor200Response.d.ts +67 -0
  107. package/dist/models/GetAuthor200Response.js +87 -0
  108. package/dist/models/GetDataset200Response.d.ts +67 -0
  109. package/dist/models/GetDataset200Response.js +87 -0
  110. package/dist/models/GetIndex200Response.d.ts +67 -0
  111. package/dist/models/GetIndex200Response.js +87 -0
  112. package/dist/models/GetMethod200Response.d.ts +67 -0
  113. package/dist/models/GetMethod200Response.js +87 -0
  114. package/dist/models/GetModel200Response.d.ts +67 -0
  115. package/dist/models/GetModel200Response.js +87 -0
  116. package/dist/models/IndexDetail.d.ts +89 -0
  117. package/dist/models/IndexDetail.js +86 -0
  118. package/dist/models/ListAuthors200Response.d.ts +67 -0
  119. package/dist/models/ListAuthors200Response.js +87 -0
  120. package/dist/models/ListDatasets200Response.d.ts +67 -0
  121. package/dist/models/ListDatasets200Response.js +87 -0
  122. package/dist/models/ListIndices200Response.d.ts +67 -0
  123. package/dist/models/ListIndices200Response.js +87 -0
  124. package/dist/models/ListMethods200Response.d.ts +67 -0
  125. package/dist/models/ListMethods200Response.js +87 -0
  126. package/dist/models/ListModels200Response.d.ts +67 -0
  127. package/dist/models/ListModels200Response.js +87 -0
  128. package/dist/models/ListTimeline200Response.d.ts +67 -0
  129. package/dist/models/ListTimeline200Response.js +87 -0
  130. package/dist/models/Method.d.ts +60 -0
  131. package/dist/models/Method.js +68 -0
  132. package/dist/models/MethodDetail.d.ts +74 -0
  133. package/dist/models/MethodDetail.js +76 -0
  134. package/dist/models/MethodDetailAllOfTopAuthors.d.ts +34 -0
  135. package/dist/models/MethodDetailAllOfTopAuthors.js +50 -0
  136. package/dist/models/ModelDetail.d.ts +52 -0
  137. package/dist/models/ModelDetail.js +45 -0
  138. package/dist/models/ModelError.d.ts +46 -0
  139. package/dist/models/ModelError.js +60 -0
  140. package/dist/models/ModelIndex.d.ts +85 -0
  141. package/dist/models/ModelIndex.js +84 -0
  142. package/dist/models/ModelSummary.d.ts +78 -0
  143. package/dist/models/ModelSummary.js +72 -0
  144. package/dist/models/Passport.d.ts +38 -0
  145. package/dist/models/Passport.js +52 -0
  146. package/dist/models/index.d.ts +27 -0
  147. package/dist/models/index.js +45 -0
  148. package/dist/runtime.d.ts +196 -0
  149. package/dist/runtime.js +421 -0
  150. package/package.json +31 -0
@@ -0,0 +1,421 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * abliteration.org Public API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
+ exports.querystring = querystring;
27
+ exports.exists = exists;
28
+ exports.serializeDateTime = serializeDateTime;
29
+ exports.serializeDate = serializeDate;
30
+ exports.parseDate = parseDate;
31
+ exports.parseDateTime = parseDateTime;
32
+ exports.mapValues = mapValues;
33
+ exports.anyToJSON = anyToJSON;
34
+ exports.canConsumeForm = canConsumeForm;
35
+ exports.BASE_PATH = "https://abliteration.org".replace(/\/+$/, "");
36
+ class Configuration {
37
+ constructor(configuration = {}) {
38
+ this.configuration = configuration;
39
+ }
40
+ set config(configuration) {
41
+ this.configuration = configuration;
42
+ }
43
+ get basePath() {
44
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
45
+ }
46
+ get fetchApi() {
47
+ return this.configuration.fetchApi;
48
+ }
49
+ get middleware() {
50
+ return this.configuration.middleware || [];
51
+ }
52
+ get queryParamsStringify() {
53
+ return this.configuration.queryParamsStringify || querystring;
54
+ }
55
+ get username() {
56
+ return this.configuration.username;
57
+ }
58
+ get password() {
59
+ return this.configuration.password;
60
+ }
61
+ get apiKey() {
62
+ const apiKey = this.configuration.apiKey;
63
+ if (apiKey) {
64
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
65
+ }
66
+ return undefined;
67
+ }
68
+ get accessToken() {
69
+ const accessToken = this.configuration.accessToken;
70
+ if (accessToken) {
71
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
72
+ }
73
+ return undefined;
74
+ }
75
+ get headers() {
76
+ return this.configuration.headers;
77
+ }
78
+ get credentials() {
79
+ return this.configuration.credentials;
80
+ }
81
+ }
82
+ exports.Configuration = Configuration;
83
+ exports.DefaultConfig = new Configuration();
84
+ /**
85
+ * This is the base class for all generated API classes.
86
+ */
87
+ class BaseAPI {
88
+ constructor(configuration = exports.DefaultConfig) {
89
+ this.configuration = configuration;
90
+ this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
91
+ let fetchParams = { url, init };
92
+ for (const middleware of this.middleware) {
93
+ if (middleware.pre) {
94
+ fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
95
+ }
96
+ }
97
+ let response = undefined;
98
+ try {
99
+ response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
100
+ }
101
+ catch (e) {
102
+ for (const middleware of this.middleware) {
103
+ if (middleware.onError) {
104
+ response = (yield middleware.onError({
105
+ fetch: this.fetchApi,
106
+ url: fetchParams.url,
107
+ init: fetchParams.init,
108
+ error: e,
109
+ response: response ? response.clone() : undefined,
110
+ })) || response;
111
+ }
112
+ }
113
+ if (response === undefined) {
114
+ if (e instanceof Error) {
115
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
116
+ }
117
+ else {
118
+ throw e;
119
+ }
120
+ }
121
+ }
122
+ for (const middleware of this.middleware) {
123
+ if (middleware.post) {
124
+ response = (yield middleware.post({
125
+ fetch: this.fetchApi,
126
+ url: fetchParams.url,
127
+ init: fetchParams.init,
128
+ response: response.clone(),
129
+ })) || response;
130
+ }
131
+ }
132
+ return response;
133
+ });
134
+ this.middleware = configuration.middleware;
135
+ }
136
+ withMiddleware(...middlewares) {
137
+ const next = this.clone();
138
+ next.middleware = next.middleware.concat(...middlewares);
139
+ return next;
140
+ }
141
+ withPreMiddleware(...preMiddlewares) {
142
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
143
+ return this.withMiddleware(...middlewares);
144
+ }
145
+ withPostMiddleware(...postMiddlewares) {
146
+ const middlewares = postMiddlewares.map((post) => ({ post }));
147
+ return this.withMiddleware(...middlewares);
148
+ }
149
+ /**
150
+ * Check if the given MIME is a JSON MIME.
151
+ * JSON MIME examples:
152
+ * application/json
153
+ * application/json; charset=UTF8
154
+ * APPLICATION/JSON
155
+ * application/vnd.company+json
156
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
157
+ * @return True if the given MIME is JSON, false otherwise.
158
+ */
159
+ isJsonMime(mime) {
160
+ if (!mime) {
161
+ return false;
162
+ }
163
+ return BaseAPI.jsonRegex.test(mime);
164
+ }
165
+ request(context, initOverrides) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
168
+ const response = yield this.fetchApi(url, init);
169
+ if (response && (response.status >= 200 && response.status < 300)) {
170
+ return response;
171
+ }
172
+ throw new ResponseError(response, 'Response returned an error code');
173
+ });
174
+ }
175
+ createFetchParams(context, initOverrides) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ let url = this.configuration.basePath + context.path;
178
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
179
+ // only add the querystring to the URL if there are query parameters.
180
+ // this is done to avoid urls ending with a "?" character which buggy webservers
181
+ // do not handle correctly sometimes.
182
+ url += '?' + this.configuration.queryParamsStringify(context.query);
183
+ }
184
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
185
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
186
+ const initOverrideFn = typeof initOverrides === "function"
187
+ ? initOverrides
188
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
189
+ const initParams = {
190
+ method: context.method,
191
+ headers,
192
+ body: context.body,
193
+ credentials: this.configuration.credentials,
194
+ };
195
+ const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
196
+ init: initParams,
197
+ context,
198
+ })));
199
+ let body;
200
+ if (isFormData(overriddenInit.body)
201
+ || (overriddenInit.body instanceof URLSearchParams)
202
+ || isBlob(overriddenInit.body)) {
203
+ body = overriddenInit.body;
204
+ }
205
+ else if (this.isJsonMime(headers['Content-Type'])) {
206
+ body = JSON.stringify(overriddenInit.body);
207
+ }
208
+ else {
209
+ body = overriddenInit.body;
210
+ }
211
+ const init = Object.assign(Object.assign({}, overriddenInit), { body });
212
+ return { url, init };
213
+ });
214
+ }
215
+ /**
216
+ * Create a shallow clone of `this` by constructing a new instance
217
+ * and then shallow cloning data members.
218
+ */
219
+ clone() {
220
+ const constructor = this.constructor;
221
+ const next = new constructor(this.configuration);
222
+ next.middleware = this.middleware.slice();
223
+ return next;
224
+ }
225
+ }
226
+ exports.BaseAPI = BaseAPI;
227
+ BaseAPI.jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
228
+ ;
229
+ function isBlob(value) {
230
+ return typeof Blob !== 'undefined' && value instanceof Blob;
231
+ }
232
+ function isFormData(value) {
233
+ return typeof FormData !== "undefined" && value instanceof FormData;
234
+ }
235
+ class ResponseError extends Error {
236
+ constructor(response, msg) {
237
+ super(msg);
238
+ this.response = response;
239
+ this.name = "ResponseError";
240
+ // restore prototype chain
241
+ const actualProto = new.target.prototype;
242
+ if (Object.setPrototypeOf) {
243
+ Object.setPrototypeOf(this, actualProto);
244
+ }
245
+ }
246
+ }
247
+ exports.ResponseError = ResponseError;
248
+ class FetchError extends Error {
249
+ constructor(cause, msg) {
250
+ super(msg);
251
+ this.cause = cause;
252
+ this.name = "FetchError";
253
+ // restore prototype chain
254
+ const actualProto = new.target.prototype;
255
+ if (Object.setPrototypeOf) {
256
+ Object.setPrototypeOf(this, actualProto);
257
+ }
258
+ }
259
+ }
260
+ exports.FetchError = FetchError;
261
+ class RequiredError extends Error {
262
+ constructor(field, msg) {
263
+ super(msg);
264
+ this.field = field;
265
+ this.name = "RequiredError";
266
+ // restore prototype chain
267
+ const actualProto = new.target.prototype;
268
+ if (Object.setPrototypeOf) {
269
+ Object.setPrototypeOf(this, actualProto);
270
+ }
271
+ }
272
+ }
273
+ exports.RequiredError = RequiredError;
274
+ exports.COLLECTION_FORMATS = {
275
+ csv: ",",
276
+ ssv: " ",
277
+ tsv: "\t",
278
+ pipes: "|",
279
+ };
280
+ function querystring(params, prefix = '') {
281
+ return Object.keys(params)
282
+ .map(key => querystringSingleKey(key, params[key], prefix))
283
+ .filter(part => part.length > 0)
284
+ .join('&');
285
+ }
286
+ function querystringSingleKey(key, value, keyPrefix = '') {
287
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
288
+ if (value instanceof Array) {
289
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
290
+ .join(`&${encodeURIComponent(fullKey)}=`);
291
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
292
+ }
293
+ if (value instanceof Set) {
294
+ const valueAsArray = Array.from(value);
295
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
296
+ }
297
+ if (value instanceof Date) {
298
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(serializeDateTime(value))}`;
299
+ }
300
+ if (value instanceof Object) {
301
+ return querystring(value, fullKey);
302
+ }
303
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
304
+ }
305
+ function exists(json, key) {
306
+ const value = json[key];
307
+ return value !== null && value !== undefined;
308
+ }
309
+ /**
310
+ * Every generated date call site routes through these.
311
+ *
312
+ * `format: date` is a calendar date, with no time and no offset, so it is converted
313
+ * against the local calendar on both ends: they have to agree or the date shifts by
314
+ * a day. `format: date-time` is an instant and uses UTC.
315
+ */
316
+ function serializeDateTime(value) {
317
+ return value.toISOString();
318
+ }
319
+ function serializeDate(value) {
320
+ if (isNaN(value.getTime())) {
321
+ throw new RangeError('Invalid time value');
322
+ }
323
+ const year = ('000' + value.getFullYear()).slice(-4);
324
+ const month = ('0' + (value.getMonth() + 1)).slice(-2);
325
+ const day = ('0' + value.getDate()).slice(-2);
326
+ return `${year}-${month}-${day}`;
327
+ }
328
+ function parseDate(value) {
329
+ if (value instanceof Date) {
330
+ return value;
331
+ }
332
+ // `new Date("2026-08-05")` would parse as UTC midnight: a different day west of UTC.
333
+ // Local midnight is the stated day everywhere. setFullYear avoids the 1900 offset the
334
+ // multi-argument constructor applies to years 0-99.
335
+ const fullDate = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(value));
336
+ if (fullDate) {
337
+ const year = Number(fullDate[1]);
338
+ const month = Number(fullDate[2]) - 1;
339
+ const day = Number(fullDate[3]);
340
+ const date = new Date(0);
341
+ date.setFullYear(year, month, day);
342
+ date.setHours(0, 0, 0, 0);
343
+ // Out-of-range components (or a day the local zone skipped) silently roll over,
344
+ // which would hand back a date the server never sent.
345
+ if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {
346
+ return new Date(NaN);
347
+ }
348
+ return date;
349
+ }
350
+ return new Date(value);
351
+ }
352
+ function parseDateTime(value) {
353
+ return new Date(value);
354
+ }
355
+ function mapValues(data, fn) {
356
+ const result = {};
357
+ for (const key of Object.keys(data)) {
358
+ result[key] = fn(data[key]);
359
+ }
360
+ return result;
361
+ }
362
+ // Pass-through serializer for `any`-typed properties in form data. See #1877.
363
+ function anyToJSON(value) {
364
+ return value;
365
+ }
366
+ function canConsumeForm(consumes) {
367
+ var _a;
368
+ for (const consume of consumes) {
369
+ if (((_a = consume.contentType) === null || _a === void 0 ? void 0 : _a.startsWith('multipart/form-data')) == true) {
370
+ return true;
371
+ }
372
+ }
373
+ return false;
374
+ }
375
+ class JSONApiResponse {
376
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
377
+ this.raw = raw;
378
+ this.transformer = transformer;
379
+ }
380
+ value() {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ return this.transformer(yield this.raw.json());
383
+ });
384
+ }
385
+ }
386
+ exports.JSONApiResponse = JSONApiResponse;
387
+ class VoidApiResponse {
388
+ constructor(raw) {
389
+ this.raw = raw;
390
+ }
391
+ value() {
392
+ return __awaiter(this, void 0, void 0, function* () {
393
+ return undefined;
394
+ });
395
+ }
396
+ }
397
+ exports.VoidApiResponse = VoidApiResponse;
398
+ class BlobApiResponse {
399
+ constructor(raw) {
400
+ this.raw = raw;
401
+ }
402
+ value() {
403
+ return __awaiter(this, void 0, void 0, function* () {
404
+ return yield this.raw.blob();
405
+ });
406
+ }
407
+ ;
408
+ }
409
+ exports.BlobApiResponse = BlobApiResponse;
410
+ class TextApiResponse {
411
+ constructor(raw) {
412
+ this.raw = raw;
413
+ }
414
+ value() {
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ return yield this.raw.text();
417
+ });
418
+ }
419
+ ;
420
+ }
421
+ exports.TextApiResponse = TextApiResponse;
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
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>",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "module": "./dist/esm/index.js",
9
+ "sideEffects": false,
10
+ "scripts": {
11
+ "build": "tsc && tsc -p tsconfig.esm.json",
12
+ "prepare": "npm run build"
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^4.0 || ^5.0"
16
+ },
17
+ "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
+ ]
31
+ }