@abliteration/sdk 0.1.7 → 0.1.8

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 (38) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +6 -0
  3. package/dist/apis/ModelsApi.d.ts +122 -0
  4. package/dist/apis/ModelsApi.js +120 -1
  5. package/dist/esm/apis/ModelsApi.d.ts +122 -0
  6. package/dist/esm/apis/ModelsApi.js +119 -0
  7. package/dist/esm/models/DownloadAnomaly.d.ts +66 -0
  8. package/dist/esm/models/DownloadAnomaly.js +62 -0
  9. package/dist/esm/models/DownloadPoint.d.ts +34 -0
  10. package/dist/esm/models/DownloadPoint.js +43 -0
  11. package/dist/esm/models/GetModelDownloadHistory200Response.d.ts +67 -0
  12. package/dist/esm/models/GetModelDownloadHistory200Response.js +79 -0
  13. package/dist/esm/models/ListAnomalies200Response.d.ts +67 -0
  14. package/dist/esm/models/ListAnomalies200Response.js +79 -0
  15. package/dist/esm/models/index.d.ts +4 -0
  16. package/dist/esm/models/index.js +4 -0
  17. package/dist/models/DownloadAnomaly.d.ts +66 -0
  18. package/dist/models/DownloadAnomaly.js +70 -0
  19. package/dist/models/DownloadPoint.d.ts +34 -0
  20. package/dist/models/DownloadPoint.js +50 -0
  21. package/dist/models/GetModelDownloadHistory200Response.d.ts +67 -0
  22. package/dist/models/GetModelDownloadHistory200Response.js +87 -0
  23. package/dist/models/ListAnomalies200Response.d.ts +67 -0
  24. package/dist/models/ListAnomalies200Response.js +87 -0
  25. package/dist/models/index.d.ts +4 -0
  26. package/dist/models/index.js +4 -0
  27. package/docs/DownloadAnomaly.md +49 -0
  28. package/docs/DownloadPoint.md +37 -0
  29. package/docs/GetModelDownloadHistory200Response.md +48 -0
  30. package/docs/ListAnomalies200Response.md +48 -0
  31. package/docs/ModelsApi.md +167 -0
  32. package/package.json +1 -1
  33. package/src/apis/ModelsApi.ts +236 -0
  34. package/src/models/DownloadAnomaly.ts +116 -0
  35. package/src/models/DownloadPoint.ts +69 -0
  36. package/src/models/GetModelDownloadHistory200Response.ts +132 -0
  37. package/src/models/ListAnomalies200Response.ts +132 -0
  38. package/src/models/index.ts +4 -0
@@ -12,6 +12,8 @@ docs/DeletionSummary.md
12
12
  docs/DeletionSummaryTimelineInner.md
13
13
  docs/DeletionSummaryTopByDownloadsInner.md
14
14
  docs/DelistedModel.md
15
+ docs/DownloadAnomaly.md
16
+ docs/DownloadPoint.md
15
17
  docs/Envelope.md
16
18
  docs/Event.md
17
19
  docs/GetAuthor200Response.md
@@ -20,10 +22,12 @@ docs/GetHistoricalDeletionSummary200Response.md
20
22
  docs/GetIndex200Response.md
21
23
  docs/GetMethod200Response.md
22
24
  docs/GetModel200Response.md
25
+ docs/GetModelDownloadHistory200Response.md
23
26
  docs/GetModelReadmeAt200Response.md
24
27
  docs/HistoricalDeletion.md
25
28
  docs/IndexDetail.md
26
29
  docs/IndicesApi.md
30
+ docs/ListAnomalies200Response.md
27
31
  docs/ListAuthors200Response.md
28
32
  docs/ListDatasets200Response.md
29
33
  docs/ListDelistedModels200Response.md
@@ -64,6 +68,8 @@ src/models/DeletionSummary.ts
64
68
  src/models/DeletionSummaryTimelineInner.ts
65
69
  src/models/DeletionSummaryTopByDownloadsInner.ts
66
70
  src/models/DelistedModel.ts
71
+ src/models/DownloadAnomaly.ts
72
+ src/models/DownloadPoint.ts
67
73
  src/models/Envelope.ts
68
74
  src/models/Event.ts
69
75
  src/models/GetAuthor200Response.ts
@@ -72,9 +78,11 @@ src/models/GetHistoricalDeletionSummary200Response.ts
72
78
  src/models/GetIndex200Response.ts
73
79
  src/models/GetMethod200Response.ts
74
80
  src/models/GetModel200Response.ts
81
+ src/models/GetModelDownloadHistory200Response.ts
75
82
  src/models/GetModelReadmeAt200Response.ts
76
83
  src/models/HistoricalDeletion.ts
77
84
  src/models/IndexDetail.ts
85
+ src/models/ListAnomalies200Response.ts
78
86
  src/models/ListAuthors200Response.ts
79
87
  src/models/ListDatasets200Response.ts
80
88
  src/models/ListDelistedModels200Response.ts
package/README.md CHANGED
@@ -64,7 +64,9 @@ All URIs are relative to *https://abliteration.org*
64
64
  *MethodsApi* | [**listMethods**](docs/MethodsApi.md#listmethods) | **GET** /api/v1/methods | List the method taxonomy
65
65
  *ModelsApi* | [**getHistoricalDeletionSummary**](docs/ModelsApi.md#gethistoricaldeletionsummary) | **GET** /api/v1/models/historical-deletions/summary | Historical deletions — aggregate summary
66
66
  *ModelsApi* | [**getModel**](docs/ModelsApi.md#getmodel) | **GET** /api/v1/models/{id} | Get one model
67
+ *ModelsApi* | [**getModelDownloadHistory**](docs/ModelsApi.md#getmodeldownloadhistory) | **GET** /api/v1/models/{id}/download-history | Per-model download timeline
67
68
  *ModelsApi* | [**getModelReadmeAt**](docs/ModelsApi.md#getmodelreadmeat) | **GET** /api/v1/models/{id}/readme-at/{commit} | README content at one commit (wayback)
69
+ *ModelsApi* | [**listAnomalies**](docs/ModelsApi.md#listanomalies) | **GET** /api/v1/market/anomalies | Anomalies in the download counter (change stream)
68
70
  *ModelsApi* | [**listDelistedModels**](docs/ModelsApi.md#listdelistedmodels) | **GET** /api/v1/models/delisted | List delisted models (change stream)
69
71
  *ModelsApi* | [**listHistoricalDeletions**](docs/ModelsApi.md#listhistoricaldeletions) | **GET** /api/v1/models/historical-deletions/list | Historical deletions — paged list
70
72
  *ModelsApi* | [**listModelReadmeDrifts**](docs/ModelsApi.md#listmodelreadmedrifts) | **GET** /api/v1/models/{id}/drifts | README drift stream for one model
@@ -83,6 +85,8 @@ All URIs are relative to *https://abliteration.org*
83
85
  - [DeletionSummaryTimelineInner](docs/DeletionSummaryTimelineInner.md)
84
86
  - [DeletionSummaryTopByDownloadsInner](docs/DeletionSummaryTopByDownloadsInner.md)
85
87
  - [DelistedModel](docs/DelistedModel.md)
88
+ - [DownloadAnomaly](docs/DownloadAnomaly.md)
89
+ - [DownloadPoint](docs/DownloadPoint.md)
86
90
  - [Envelope](docs/Envelope.md)
87
91
  - [Event](docs/Event.md)
88
92
  - [GetAuthor200Response](docs/GetAuthor200Response.md)
@@ -91,9 +95,11 @@ All URIs are relative to *https://abliteration.org*
91
95
  - [GetIndex200Response](docs/GetIndex200Response.md)
92
96
  - [GetMethod200Response](docs/GetMethod200Response.md)
93
97
  - [GetModel200Response](docs/GetModel200Response.md)
98
+ - [GetModelDownloadHistory200Response](docs/GetModelDownloadHistory200Response.md)
94
99
  - [GetModelReadmeAt200Response](docs/GetModelReadmeAt200Response.md)
95
100
  - [HistoricalDeletion](docs/HistoricalDeletion.md)
96
101
  - [IndexDetail](docs/IndexDetail.md)
102
+ - [ListAnomalies200Response](docs/ListAnomalies200Response.md)
97
103
  - [ListAuthors200Response](docs/ListAuthors200Response.md)
98
104
  - [ListDatasets200Response](docs/ListDatasets200Response.md)
99
105
  - [ListDelistedModels200Response](docs/ListDelistedModels200Response.md)
@@ -12,7 +12,9 @@
12
12
  import * as runtime from '../runtime';
13
13
  import { type GetHistoricalDeletionSummary200Response } from '../models/GetHistoricalDeletionSummary200Response';
14
14
  import { type GetModel200Response } from '../models/GetModel200Response';
15
+ import { type GetModelDownloadHistory200Response } from '../models/GetModelDownloadHistory200Response';
15
16
  import { type GetModelReadmeAt200Response } from '../models/GetModelReadmeAt200Response';
17
+ import { type ListAnomalies200Response } from '../models/ListAnomalies200Response';
16
18
  import { type ListDelistedModels200Response } from '../models/ListDelistedModels200Response';
17
19
  import { type ListHistoricalDeletions200Response } from '../models/ListHistoricalDeletions200Response';
18
20
  import { type ListModelReadmeDrifts200Response } from '../models/ListModelReadmeDrifts200Response';
@@ -23,6 +25,16 @@ export interface GetModelRequest {
23
25
  */
24
26
  id: string;
25
27
  }
28
+ export interface GetModelDownloadHistoryRequest {
29
+ /**
30
+ *
31
+ */
32
+ id: string;
33
+ /**
34
+ * Window in days (max 365). Pass 0 for full history.
35
+ */
36
+ days?: number;
37
+ }
26
38
  export interface GetModelReadmeAtRequest {
27
39
  /**
28
40
  *
@@ -33,6 +45,28 @@ export interface GetModelReadmeAtRequest {
33
45
  */
34
46
  commit: string;
35
47
  }
48
+ export interface ListAnomaliesRequest {
49
+ /**
50
+ * Baseline distance in days. Default 7, min 1, max 365.
51
+ */
52
+ windowDays?: number;
53
+ /**
54
+ * Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000.
55
+ */
56
+ minBaseline?: number;
57
+ /**
58
+ * Filter to one class. Omit for both.
59
+ */
60
+ kind?: ListAnomaliesKindEnum;
61
+ /**
62
+ * Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
63
+ */
64
+ limit?: number;
65
+ /**
66
+ * Rows to skip. Negative and non-numeric values are treated as 0.
67
+ */
68
+ offset?: number;
69
+ }
36
70
  export interface ListDelistedModelsRequest {
37
71
  /**
38
72
  * ISO-8601 date or timestamp. Rows with last_seen_at >= since only. Use your previous poll's newest last_seen_at to build an incremental feed.
@@ -188,6 +222,29 @@ export interface ModelsApiInterface {
188
222
  * Get one model
189
223
  */
190
224
  getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModel200Response>;
225
+ /**
226
+ * Creates request options for getModelDownloadHistory without sending the request
227
+ * @param {string} id
228
+ * @param {number} [days] Window in days (max 365). Pass 0 for full history.
229
+ * @throws {RequiredError}
230
+ * @memberof ModelsApiInterface
231
+ */
232
+ getModelDownloadHistoryRequestOpts(requestParameters: GetModelDownloadHistoryRequest): Promise<runtime.RequestOpts>;
233
+ /**
234
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
235
+ * @summary Per-model download timeline
236
+ * @param {string} id
237
+ * @param {number} [days] Window in days (max 365). Pass 0 for full history.
238
+ * @param {*} [options] Override http request option.
239
+ * @throws {RequiredError}
240
+ * @memberof ModelsApiInterface
241
+ */
242
+ getModelDownloadHistoryRaw(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelDownloadHistory200Response>>;
243
+ /**
244
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
245
+ * Per-model download timeline
246
+ */
247
+ getModelDownloadHistory(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelDownloadHistory200Response>;
191
248
  /**
192
249
  * Creates request options for getModelReadmeAt without sending the request
193
250
  * @param {string} id
@@ -211,6 +268,35 @@ export interface ModelsApiInterface {
211
268
  * README content at one commit (wayback)
212
269
  */
213
270
  getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response>;
271
+ /**
272
+ * Creates request options for listAnomalies without sending the request
273
+ * @param {number} [windowDays] Baseline distance in days. Default 7, min 1, max 365.
274
+ * @param {number} [minBaseline] Only rows where baseline downloads &gt;&#x3D; this. Filters &#x60;0→10&#x60; noise. Default 1000.
275
+ * @param {'spike' | 'drop'} [kind] Filter to one class. Omit for both.
276
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
277
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
278
+ * @throws {RequiredError}
279
+ * @memberof ModelsApiInterface
280
+ */
281
+ listAnomaliesRequestOpts(requestParameters: ListAnomaliesRequest): Promise<runtime.RequestOpts>;
282
+ /**
283
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
284
+ * @summary Anomalies in the download counter (change stream)
285
+ * @param {number} [windowDays] Baseline distance in days. Default 7, min 1, max 365.
286
+ * @param {number} [minBaseline] Only rows where baseline downloads &gt;&#x3D; this. Filters &#x60;0→10&#x60; noise. Default 1000.
287
+ * @param {'spike' | 'drop'} [kind] Filter to one class. Omit for both.
288
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
289
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ * @memberof ModelsApiInterface
293
+ */
294
+ listAnomaliesRaw(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAnomalies200Response>>;
295
+ /**
296
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
297
+ * Anomalies in the download counter (change stream)
298
+ */
299
+ listAnomalies(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAnomalies200Response>;
214
300
  /**
215
301
  * Creates request options for listDelistedModels without sending the request
216
302
  * @param {string} [since] ISO-8601 date or timestamp. Rows with last_seen_at &gt;&#x3D; since only. Use your previous poll\&#39;s newest last_seen_at to build an incremental feed.
@@ -370,6 +456,20 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
370
456
  * Get one model
371
457
  */
372
458
  getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModel200Response>;
459
+ /**
460
+ * Creates request options for getModelDownloadHistory without sending the request
461
+ */
462
+ getModelDownloadHistoryRequestOpts(requestParameters: GetModelDownloadHistoryRequest): Promise<runtime.RequestOpts>;
463
+ /**
464
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
465
+ * Per-model download timeline
466
+ */
467
+ getModelDownloadHistoryRaw(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelDownloadHistory200Response>>;
468
+ /**
469
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
470
+ * Per-model download timeline
471
+ */
472
+ getModelDownloadHistory(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelDownloadHistory200Response>;
373
473
  /**
374
474
  * Creates request options for getModelReadmeAt without sending the request
375
475
  */
@@ -384,6 +484,20 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
384
484
  * README content at one commit (wayback)
385
485
  */
386
486
  getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response>;
487
+ /**
488
+ * Creates request options for listAnomalies without sending the request
489
+ */
490
+ listAnomaliesRequestOpts(requestParameters: ListAnomaliesRequest): Promise<runtime.RequestOpts>;
491
+ /**
492
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
493
+ * Anomalies in the download counter (change stream)
494
+ */
495
+ listAnomaliesRaw(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAnomalies200Response>>;
496
+ /**
497
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
498
+ * Anomalies in the download counter (change stream)
499
+ */
500
+ listAnomalies(requestParameters?: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAnomalies200Response>;
387
501
  /**
388
502
  * Creates request options for listDelistedModels without sending the request
389
503
  */
@@ -441,6 +555,14 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
441
555
  */
442
556
  listModels(requestParameters?: ListModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListModels200Response>;
443
557
  }
558
+ /**
559
+ * @export
560
+ */
561
+ export declare const ListAnomaliesKindEnum: {
562
+ readonly Spike: "spike";
563
+ readonly Drop: "drop";
564
+ };
565
+ export type ListAnomaliesKindEnum = typeof ListAnomaliesKindEnum[keyof typeof ListAnomaliesKindEnum];
444
566
  /**
445
567
  * @export
446
568
  */
@@ -22,11 +22,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ListModelsSortEnum = exports.ListModelsDelistedEnum = exports.ListHistoricalDeletionsSortEnum = exports.ListDelistedModelsSortEnum = exports.ModelsApi = void 0;
25
+ exports.ListModelsSortEnum = exports.ListModelsDelistedEnum = exports.ListHistoricalDeletionsSortEnum = exports.ListDelistedModelsSortEnum = exports.ListAnomaliesKindEnum = exports.ModelsApi = void 0;
26
26
  const runtime = require("../runtime");
27
27
  const GetHistoricalDeletionSummary200Response_1 = require("../models/GetHistoricalDeletionSummary200Response");
28
28
  const GetModel200Response_1 = require("../models/GetModel200Response");
29
+ const GetModelDownloadHistory200Response_1 = require("../models/GetModelDownloadHistory200Response");
29
30
  const GetModelReadmeAt200Response_1 = require("../models/GetModelReadmeAt200Response");
31
+ const ListAnomalies200Response_1 = require("../models/ListAnomalies200Response");
30
32
  const ListDelistedModels200Response_1 = require("../models/ListDelistedModels200Response");
31
33
  const ListHistoricalDeletions200Response_1 = require("../models/ListHistoricalDeletions200Response");
32
34
  const ListModelReadmeDrifts200Response_1 = require("../models/ListModelReadmeDrifts200Response");
@@ -127,6 +129,57 @@ class ModelsApi extends runtime.BaseAPI {
127
129
  return yield response.value();
128
130
  });
129
131
  }
132
+ /**
133
+ * Creates request options for getModelDownloadHistory without sending the request
134
+ */
135
+ getModelDownloadHistoryRequestOpts(requestParameters) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ if (requestParameters['id'] == null) {
138
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getModelDownloadHistory().');
139
+ }
140
+ const queryParameters = {};
141
+ if (requestParameters['days'] != null) {
142
+ queryParameters['days'] = requestParameters['days'];
143
+ }
144
+ const headerParameters = {};
145
+ if (this.configuration && this.configuration.accessToken) {
146
+ const token = this.configuration.accessToken;
147
+ const tokenString = yield token("bearerAuth", []);
148
+ if (tokenString) {
149
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
150
+ }
151
+ }
152
+ let urlPath = `/api/v1/models/{id}/download-history`;
153
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
154
+ return {
155
+ path: urlPath,
156
+ method: 'GET',
157
+ headers: headerParameters,
158
+ query: queryParameters,
159
+ };
160
+ });
161
+ }
162
+ /**
163
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
164
+ * Per-model download timeline
165
+ */
166
+ getModelDownloadHistoryRaw(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ const requestOptions = yield this.getModelDownloadHistoryRequestOpts(requestParameters);
169
+ const response = yield this.request(requestOptions, initOverrides);
170
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetModelDownloadHistory200Response_1.GetModelDownloadHistory200ResponseFromJSON)(jsonValue));
171
+ });
172
+ }
173
+ /**
174
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
175
+ * Per-model download timeline
176
+ */
177
+ getModelDownloadHistory(requestParameters, initOverrides) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ const response = yield this.getModelDownloadHistoryRaw(requestParameters, initOverrides);
180
+ return yield response.value();
181
+ });
182
+ }
130
183
  /**
131
184
  * Creates request options for getModelReadmeAt without sending the request
132
185
  */
@@ -179,6 +232,65 @@ class ModelsApi extends runtime.BaseAPI {
179
232
  return yield response.value();
180
233
  });
181
234
  }
235
+ /**
236
+ * Creates request options for listAnomalies without sending the request
237
+ */
238
+ listAnomaliesRequestOpts(requestParameters) {
239
+ return __awaiter(this, void 0, void 0, function* () {
240
+ const queryParameters = {};
241
+ if (requestParameters['windowDays'] != null) {
242
+ queryParameters['window_days'] = requestParameters['windowDays'];
243
+ }
244
+ if (requestParameters['minBaseline'] != null) {
245
+ queryParameters['min_baseline'] = requestParameters['minBaseline'];
246
+ }
247
+ if (requestParameters['kind'] != null) {
248
+ queryParameters['kind'] = requestParameters['kind'];
249
+ }
250
+ if (requestParameters['limit'] != null) {
251
+ queryParameters['limit'] = requestParameters['limit'];
252
+ }
253
+ if (requestParameters['offset'] != null) {
254
+ queryParameters['offset'] = requestParameters['offset'];
255
+ }
256
+ const headerParameters = {};
257
+ if (this.configuration && this.configuration.accessToken) {
258
+ const token = this.configuration.accessToken;
259
+ const tokenString = yield token("bearerAuth", []);
260
+ if (tokenString) {
261
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
262
+ }
263
+ }
264
+ let urlPath = `/api/v1/market/anomalies`;
265
+ return {
266
+ path: urlPath,
267
+ method: 'GET',
268
+ headers: headerParameters,
269
+ query: queryParameters,
270
+ };
271
+ });
272
+ }
273
+ /**
274
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
275
+ * Anomalies in the download counter (change stream)
276
+ */
277
+ listAnomaliesRaw(requestParameters, initOverrides) {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ const requestOptions = yield this.listAnomaliesRequestOpts(requestParameters);
280
+ const response = yield this.request(requestOptions, initOverrides);
281
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListAnomalies200Response_1.ListAnomalies200ResponseFromJSON)(jsonValue));
282
+ });
283
+ }
284
+ /**
285
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
286
+ * Anomalies in the download counter (change stream)
287
+ */
288
+ listAnomalies() {
289
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
290
+ const response = yield this.listAnomaliesRaw(requestParameters, initOverrides);
291
+ return yield response.value();
292
+ });
293
+ }
182
294
  /**
183
295
  * Creates request options for listDelistedModels without sending the request
184
296
  */
@@ -433,6 +545,13 @@ class ModelsApi extends runtime.BaseAPI {
433
545
  }
434
546
  }
435
547
  exports.ModelsApi = ModelsApi;
548
+ /**
549
+ * @export
550
+ */
551
+ exports.ListAnomaliesKindEnum = {
552
+ Spike: 'spike',
553
+ Drop: 'drop',
554
+ };
436
555
  /**
437
556
  * @export
438
557
  */
@@ -12,7 +12,9 @@
12
12
  import * as runtime from '../runtime';
13
13
  import { type GetHistoricalDeletionSummary200Response } from '../models/GetHistoricalDeletionSummary200Response';
14
14
  import { type GetModel200Response } from '../models/GetModel200Response';
15
+ import { type GetModelDownloadHistory200Response } from '../models/GetModelDownloadHistory200Response';
15
16
  import { type GetModelReadmeAt200Response } from '../models/GetModelReadmeAt200Response';
17
+ import { type ListAnomalies200Response } from '../models/ListAnomalies200Response';
16
18
  import { type ListDelistedModels200Response } from '../models/ListDelistedModels200Response';
17
19
  import { type ListHistoricalDeletions200Response } from '../models/ListHistoricalDeletions200Response';
18
20
  import { type ListModelReadmeDrifts200Response } from '../models/ListModelReadmeDrifts200Response';
@@ -23,6 +25,16 @@ export interface GetModelRequest {
23
25
  */
24
26
  id: string;
25
27
  }
28
+ export interface GetModelDownloadHistoryRequest {
29
+ /**
30
+ *
31
+ */
32
+ id: string;
33
+ /**
34
+ * Window in days (max 365). Pass 0 for full history.
35
+ */
36
+ days?: number;
37
+ }
26
38
  export interface GetModelReadmeAtRequest {
27
39
  /**
28
40
  *
@@ -33,6 +45,28 @@ export interface GetModelReadmeAtRequest {
33
45
  */
34
46
  commit: string;
35
47
  }
48
+ export interface ListAnomaliesRequest {
49
+ /**
50
+ * Baseline distance in days. Default 7, min 1, max 365.
51
+ */
52
+ windowDays?: number;
53
+ /**
54
+ * Only rows where baseline downloads >= this. Filters `0→10` noise. Default 1000.
55
+ */
56
+ minBaseline?: number;
57
+ /**
58
+ * Filter to one class. Omit for both.
59
+ */
60
+ kind?: ListAnomaliesKindEnum;
61
+ /**
62
+ * Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
63
+ */
64
+ limit?: number;
65
+ /**
66
+ * Rows to skip. Negative and non-numeric values are treated as 0.
67
+ */
68
+ offset?: number;
69
+ }
36
70
  export interface ListDelistedModelsRequest {
37
71
  /**
38
72
  * ISO-8601 date or timestamp. Rows with last_seen_at >= since only. Use your previous poll's newest last_seen_at to build an incremental feed.
@@ -188,6 +222,29 @@ export interface ModelsApiInterface {
188
222
  * Get one model
189
223
  */
190
224
  getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModel200Response>;
225
+ /**
226
+ * Creates request options for getModelDownloadHistory without sending the request
227
+ * @param {string} id
228
+ * @param {number} [days] Window in days (max 365). Pass 0 for full history.
229
+ * @throws {RequiredError}
230
+ * @memberof ModelsApiInterface
231
+ */
232
+ getModelDownloadHistoryRequestOpts(requestParameters: GetModelDownloadHistoryRequest): Promise<runtime.RequestOpts>;
233
+ /**
234
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
235
+ * @summary Per-model download timeline
236
+ * @param {string} id
237
+ * @param {number} [days] Window in days (max 365). Pass 0 for full history.
238
+ * @param {*} [options] Override http request option.
239
+ * @throws {RequiredError}
240
+ * @memberof ModelsApiInterface
241
+ */
242
+ getModelDownloadHistoryRaw(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelDownloadHistory200Response>>;
243
+ /**
244
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
245
+ * Per-model download timeline
246
+ */
247
+ getModelDownloadHistory(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelDownloadHistory200Response>;
191
248
  /**
192
249
  * Creates request options for getModelReadmeAt without sending the request
193
250
  * @param {string} id
@@ -211,6 +268,35 @@ export interface ModelsApiInterface {
211
268
  * README content at one commit (wayback)
212
269
  */
213
270
  getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response>;
271
+ /**
272
+ * Creates request options for listAnomalies without sending the request
273
+ * @param {number} [windowDays] Baseline distance in days. Default 7, min 1, max 365.
274
+ * @param {number} [minBaseline] Only rows where baseline downloads &gt;&#x3D; this. Filters &#x60;0→10&#x60; noise. Default 1000.
275
+ * @param {'spike' | 'drop'} [kind] Filter to one class. Omit for both.
276
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
277
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
278
+ * @throws {RequiredError}
279
+ * @memberof ModelsApiInterface
280
+ */
281
+ listAnomaliesRequestOpts(requestParameters: ListAnomaliesRequest): Promise<runtime.RequestOpts>;
282
+ /**
283
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
284
+ * @summary Anomalies in the download counter (change stream)
285
+ * @param {number} [windowDays] Baseline distance in days. Default 7, min 1, max 365.
286
+ * @param {number} [minBaseline] Only rows where baseline downloads &gt;&#x3D; this. Filters &#x60;0→10&#x60; noise. Default 1000.
287
+ * @param {'spike' | 'drop'} [kind] Filter to one class. Omit for both.
288
+ * @param {number} [limit] Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
289
+ * @param {number} [offset] Rows to skip. Negative and non-numeric values are treated as 0.
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ * @memberof ModelsApiInterface
293
+ */
294
+ listAnomaliesRaw(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAnomalies200Response>>;
295
+ /**
296
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
297
+ * Anomalies in the download counter (change stream)
298
+ */
299
+ listAnomalies(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAnomalies200Response>;
214
300
  /**
215
301
  * Creates request options for listDelistedModels without sending the request
216
302
  * @param {string} [since] ISO-8601 date or timestamp. Rows with last_seen_at &gt;&#x3D; since only. Use your previous poll\&#39;s newest last_seen_at to build an incremental feed.
@@ -370,6 +456,20 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
370
456
  * Get one model
371
457
  */
372
458
  getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModel200Response>;
459
+ /**
460
+ * Creates request options for getModelDownloadHistory without sending the request
461
+ */
462
+ getModelDownloadHistoryRequestOpts(requestParameters: GetModelDownloadHistoryRequest): Promise<runtime.RequestOpts>;
463
+ /**
464
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
465
+ * Per-model download timeline
466
+ */
467
+ getModelDownloadHistoryRaw(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModelDownloadHistory200Response>>;
468
+ /**
469
+ * Cost: 5 credits, flat. Raw signal that /market/anomalies scans over. Callers with a chart or their own anomaly detector pull it once per model.
470
+ * Per-model download timeline
471
+ */
472
+ getModelDownloadHistory(requestParameters: GetModelDownloadHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelDownloadHistory200Response>;
373
473
  /**
374
474
  * Creates request options for getModelReadmeAt without sending the request
375
475
  */
@@ -384,6 +484,20 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
384
484
  * README content at one commit (wayback)
385
485
  */
386
486
  getModelReadmeAt(requestParameters: GetModelReadmeAtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModelReadmeAt200Response>;
487
+ /**
488
+ * Creates request options for listAnomalies without sending the request
489
+ */
490
+ listAnomaliesRequestOpts(requestParameters: ListAnomaliesRequest): Promise<runtime.RequestOpts>;
491
+ /**
492
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
493
+ * Anomalies in the download counter (change stream)
494
+ */
495
+ listAnomaliesRaw(requestParameters: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListAnomalies200Response>>;
496
+ /**
497
+ * Cost: 15 credits, flat. Every row is a model whose downloads-per-window has crossed a threshold: 2× jump = `spike`, 0.5× fall = `drop`. Sorted by absolute delta so biggest movers surface first. Consumers get \"what is happening in the field right now\" without re-implementing the ETL over `download_history`.
498
+ * Anomalies in the download counter (change stream)
499
+ */
500
+ listAnomalies(requestParameters?: ListAnomaliesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAnomalies200Response>;
387
501
  /**
388
502
  * Creates request options for listDelistedModels without sending the request
389
503
  */
@@ -441,6 +555,14 @@ export declare class ModelsApi extends runtime.BaseAPI implements ModelsApiInter
441
555
  */
442
556
  listModels(requestParameters?: ListModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListModels200Response>;
443
557
  }
558
+ /**
559
+ * @export
560
+ */
561
+ export declare const ListAnomaliesKindEnum: {
562
+ readonly Spike: "spike";
563
+ readonly Drop: "drop";
564
+ };
565
+ export type ListAnomaliesKindEnum = typeof ListAnomaliesKindEnum[keyof typeof ListAnomaliesKindEnum];
444
566
  /**
445
567
  * @export
446
568
  */