@scenario-labs/sdk 2.7.0 → 3.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 (225) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/client.d.mts +12 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +2 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -2
  9. package/client.mjs.map +1 -1
  10. package/core/pagination.d.mts +8 -8
  11. package/core/pagination.d.mts.map +1 -1
  12. package/core/pagination.d.ts +8 -8
  13. package/core/pagination.d.ts.map +1 -1
  14. package/core/pagination.js +8 -8
  15. package/core/pagination.js.map +1 -1
  16. package/core/pagination.mjs +8 -8
  17. package/core/pagination.mjs.map +1 -1
  18. package/lib/job.d.mts +2 -2
  19. package/lib/job.d.mts.map +1 -1
  20. package/lib/job.d.ts +2 -2
  21. package/lib/job.d.ts.map +1 -1
  22. package/lib/job.js +3 -3
  23. package/lib/job.js.map +1 -1
  24. package/lib/job.mjs +3 -3
  25. package/lib/job.mjs.map +1 -1
  26. package/lib/upload.d.mts +2 -2
  27. package/lib/upload.d.mts.map +1 -1
  28. package/lib/upload.d.ts +2 -2
  29. package/lib/upload.d.ts.map +1 -1
  30. package/lib/upload.js +4 -4
  31. package/lib/upload.js.map +1 -1
  32. package/lib/upload.mjs +4 -4
  33. package/lib/upload.mjs.map +1 -1
  34. package/lib/workflow.d.mts +2 -2
  35. package/lib/workflow.d.mts.map +1 -1
  36. package/lib/workflow.d.ts +2 -2
  37. package/lib/workflow.d.ts.map +1 -1
  38. package/lib/workflow.js +2 -2
  39. package/lib/workflow.js.map +1 -1
  40. package/lib/workflow.mjs +2 -2
  41. package/lib/workflow.mjs.map +1 -1
  42. package/package.json +1 -1
  43. package/resources/assets/assets.d.mts +1107 -24
  44. package/resources/assets/assets.d.mts.map +1 -1
  45. package/resources/assets/assets.d.ts +1107 -24
  46. package/resources/assets/assets.d.ts.map +1 -1
  47. package/resources/assets/assets.js +34 -16
  48. package/resources/assets/assets.js.map +1 -1
  49. package/resources/assets/assets.mjs +34 -16
  50. package/resources/assets/assets.mjs.map +1 -1
  51. package/resources/assets/download.d.mts +28 -5
  52. package/resources/assets/download.d.mts.map +1 -1
  53. package/resources/assets/download.d.ts +28 -5
  54. package/resources/assets/download.d.ts.map +1 -1
  55. package/resources/assets/download.js +8 -6
  56. package/resources/assets/download.js.map +1 -1
  57. package/resources/assets/download.mjs +8 -6
  58. package/resources/assets/download.mjs.map +1 -1
  59. package/resources/assets/index.d.mts +1 -1
  60. package/resources/assets/index.d.mts.map +1 -1
  61. package/resources/assets/index.d.ts +1 -1
  62. package/resources/assets/index.d.ts.map +1 -1
  63. package/resources/assets/index.js.map +1 -1
  64. package/resources/assets/index.mjs.map +1 -1
  65. package/resources/collections/assets.d.mts +15 -4
  66. package/resources/collections/assets.d.mts.map +1 -1
  67. package/resources/collections/assets.d.ts +15 -4
  68. package/resources/collections/assets.d.ts.map +1 -1
  69. package/resources/collections/assets.js +14 -4
  70. package/resources/collections/assets.js.map +1 -1
  71. package/resources/collections/assets.mjs +14 -4
  72. package/resources/collections/assets.mjs.map +1 -1
  73. package/resources/collections/collections.d.mts +38 -9
  74. package/resources/collections/collections.d.mts.map +1 -1
  75. package/resources/collections/collections.d.ts +38 -9
  76. package/resources/collections/collections.d.ts.map +1 -1
  77. package/resources/collections/collections.js +11 -8
  78. package/resources/collections/collections.js.map +1 -1
  79. package/resources/collections/collections.mjs +11 -8
  80. package/resources/collections/collections.mjs.map +1 -1
  81. package/resources/collections/index.d.mts +1 -1
  82. package/resources/collections/index.d.mts.map +1 -1
  83. package/resources/collections/index.d.ts +1 -1
  84. package/resources/collections/index.d.ts.map +1 -1
  85. package/resources/collections/index.js.map +1 -1
  86. package/resources/collections/index.mjs.map +1 -1
  87. package/resources/collections/models.d.mts +15 -4
  88. package/resources/collections/models.d.mts.map +1 -1
  89. package/resources/collections/models.d.ts +15 -4
  90. package/resources/collections/models.d.ts.map +1 -1
  91. package/resources/collections/models.js +14 -4
  92. package/resources/collections/models.js.map +1 -1
  93. package/resources/collections/models.mjs +14 -4
  94. package/resources/collections/models.mjs.map +1 -1
  95. package/resources/generate.d.mts +945 -4
  96. package/resources/generate.d.mts.map +1 -1
  97. package/resources/generate.d.ts +945 -4
  98. package/resources/generate.d.ts.map +1 -1
  99. package/resources/generate.js +28 -16
  100. package/resources/generate.js.map +1 -1
  101. package/resources/generate.mjs +28 -16
  102. package/resources/generate.mjs.map +1 -1
  103. package/resources/index.d.mts +5 -5
  104. package/resources/index.d.mts.map +1 -1
  105. package/resources/index.d.ts +5 -5
  106. package/resources/index.d.ts.map +1 -1
  107. package/resources/index.js.map +1 -1
  108. package/resources/index.mjs.map +1 -1
  109. package/resources/jobs.d.mts +146 -2
  110. package/resources/jobs.d.mts.map +1 -1
  111. package/resources/jobs.d.ts +146 -2
  112. package/resources/jobs.d.ts.map +1 -1
  113. package/resources/jobs.js +8 -4
  114. package/resources/jobs.js.map +1 -1
  115. package/resources/jobs.mjs +8 -4
  116. package/resources/jobs.mjs.map +1 -1
  117. package/resources/models/description.d.mts +14 -4
  118. package/resources/models/description.d.mts.map +1 -1
  119. package/resources/models/description.d.ts +14 -4
  120. package/resources/models/description.d.ts.map +1 -1
  121. package/resources/models/description.js +2 -2
  122. package/resources/models/description.js.map +1 -1
  123. package/resources/models/description.mjs +2 -2
  124. package/resources/models/description.mjs.map +1 -1
  125. package/resources/models/examples.d.mts +348 -4
  126. package/resources/models/examples.d.mts.map +1 -1
  127. package/resources/models/examples.d.ts +348 -4
  128. package/resources/models/examples.d.ts.map +1 -1
  129. package/resources/models/examples.js +2 -2
  130. package/resources/models/examples.js.map +1 -1
  131. package/resources/models/examples.mjs +2 -2
  132. package/resources/models/examples.mjs.map +1 -1
  133. package/resources/models/index.d.mts +1 -1
  134. package/resources/models/index.d.mts.map +1 -1
  135. package/resources/models/index.d.ts +1 -1
  136. package/resources/models/index.d.ts.map +1 -1
  137. package/resources/models/index.js.map +1 -1
  138. package/resources/models/index.mjs.map +1 -1
  139. package/resources/models/models.d.mts +71 -13
  140. package/resources/models/models.d.mts.map +1 -1
  141. package/resources/models/models.d.ts +71 -13
  142. package/resources/models/models.d.ts.map +1 -1
  143. package/resources/models/models.js +30 -18
  144. package/resources/models/models.js.map +1 -1
  145. package/resources/models/models.mjs +30 -18
  146. package/resources/models/models.mjs.map +1 -1
  147. package/resources/models/train.d.mts +93 -0
  148. package/resources/models/train.d.mts.map +1 -1
  149. package/resources/models/train.d.ts +93 -0
  150. package/resources/models/train.d.ts.map +1 -1
  151. package/resources/models/train.js +4 -4
  152. package/resources/models/train.js.map +1 -1
  153. package/resources/models/train.mjs +4 -4
  154. package/resources/models/train.mjs.map +1 -1
  155. package/resources/models/training-images.d.mts +22 -2
  156. package/resources/models/training-images.d.mts.map +1 -1
  157. package/resources/models/training-images.d.ts +22 -2
  158. package/resources/models/training-images.d.ts.map +1 -1
  159. package/resources/models/training-images.js +15 -8
  160. package/resources/models/training-images.js.map +1 -1
  161. package/resources/models/training-images.mjs +15 -8
  162. package/resources/models/training-images.mjs.map +1 -1
  163. package/resources/search.d.mts +10 -0
  164. package/resources/search.d.mts.map +1 -1
  165. package/resources/search.d.ts +10 -0
  166. package/resources/search.d.ts.map +1 -1
  167. package/resources/search.js +4 -4
  168. package/resources/search.js.map +1 -1
  169. package/resources/search.mjs +4 -4
  170. package/resources/search.mjs.map +1 -1
  171. package/resources/tags.d.mts +5 -0
  172. package/resources/tags.d.mts.map +1 -1
  173. package/resources/tags.d.ts +5 -0
  174. package/resources/tags.d.ts.map +1 -1
  175. package/resources/uploads.d.mts +35 -20
  176. package/resources/uploads.d.mts.map +1 -1
  177. package/resources/uploads.d.ts +35 -20
  178. package/resources/uploads.d.ts.map +1 -1
  179. package/resources/uploads.js +8 -6
  180. package/resources/uploads.js.map +1 -1
  181. package/resources/uploads.mjs +8 -6
  182. package/resources/uploads.mjs.map +1 -1
  183. package/resources/usages.d.mts +55 -12
  184. package/resources/usages.d.mts.map +1 -1
  185. package/resources/usages.d.ts +55 -12
  186. package/resources/usages.d.ts.map +1 -1
  187. package/resources/workflows.d.mts +446 -266
  188. package/resources/workflows.d.mts.map +1 -1
  189. package/resources/workflows.d.ts +446 -266
  190. package/resources/workflows.d.ts.map +1 -1
  191. package/resources/workflows.js +20 -12
  192. package/resources/workflows.js.map +1 -1
  193. package/resources/workflows.mjs +20 -12
  194. package/resources/workflows.mjs.map +1 -1
  195. package/src/client.ts +18 -4
  196. package/src/core/pagination.ts +20 -20
  197. package/src/lib/job.ts +8 -3
  198. package/src/lib/upload.ts +5 -3
  199. package/src/lib/workflow.ts +3 -1
  200. package/src/resources/assets/assets.ts +1326 -48
  201. package/src/resources/assets/download.ts +40 -7
  202. package/src/resources/assets/index.ts +1 -0
  203. package/src/resources/collections/assets.ts +29 -6
  204. package/src/resources/collections/collections.ts +59 -12
  205. package/src/resources/collections/index.ts +2 -0
  206. package/src/resources/collections/models.ts +29 -6
  207. package/src/resources/generate.ts +1251 -34
  208. package/src/resources/index.ts +7 -0
  209. package/src/resources/jobs.ts +169 -4
  210. package/src/resources/models/description.ts +18 -6
  211. package/src/resources/models/examples.ts +398 -6
  212. package/src/resources/models/index.ts +1 -0
  213. package/src/resources/models/models.ts +112 -26
  214. package/src/resources/models/train.ts +126 -4
  215. package/src/resources/models/training-images.ts +41 -10
  216. package/src/resources/search.ts +16 -4
  217. package/src/resources/tags.ts +6 -0
  218. package/src/resources/uploads.ts +47 -22
  219. package/src/resources/usages.ts +65 -12
  220. package/src/resources/workflows.ts +783 -563
  221. package/src/version.ts +1 -1
  222. package/version.d.mts +1 -1
  223. package/version.d.ts +1 -1
  224. package/version.js +1 -1
  225. package/version.mjs +1 -1
@@ -10,15 +10,20 @@ export class Uploads extends APIResource {
10
10
  * Create a temporary upload URL for a file. Support multipart uploads. Return a
11
11
  * list of URLs for each part of the file.
12
12
  */
13
- create(body: UploadCreateParams, options?: RequestOptions): APIPromise<UploadCreateResponse> {
14
- return this._client.post('/uploads', { body, ...options });
13
+ create(params: UploadCreateParams, options?: RequestOptions): APIPromise<UploadCreateResponse> {
14
+ const { projectId, ...body } = params;
15
+ return this._client.post('/uploads', { query: { projectId }, body, ...options });
15
16
  }
16
17
 
17
18
  /**
18
19
  * Get the details of an existing upload
19
20
  */
20
- retrieve(uploadID: string, options?: RequestOptions): APIPromise<UploadRetrieveResponse> {
21
- return this._client.get(path`/uploads/${uploadID}`, options);
21
+ retrieve(
22
+ uploadID: string,
23
+ query: UploadRetrieveParams | null | undefined = {},
24
+ options?: RequestOptions,
25
+ ): APIPromise<UploadRetrieveResponse> {
26
+ return this._client.get(path`/uploads/${uploadID}`, { query, ...options });
22
27
  }
23
28
 
24
29
  /**
@@ -26,10 +31,11 @@ export class Uploads extends APIResource {
26
31
  */
27
32
  triggerAction(
28
33
  uploadID: string,
29
- body: UploadTriggerActionParams,
34
+ params: UploadTriggerActionParams,
30
35
  options?: RequestOptions,
31
36
  ): APIPromise<UploadTriggerActionResponse> {
32
- return this._client.post(path`/uploads/${uploadID}/action`, { body, ...options });
37
+ const { projectId, ...body } = params;
38
+ return this._client.post(path`/uploads/${uploadID}/action`, { query: { projectId }, body, ...options });
33
39
  }
34
40
  }
35
41
 
@@ -275,53 +281,62 @@ export namespace UploadTriggerActionResponse {
275
281
 
276
282
  export interface UploadCreateParams {
277
283
  /**
278
- * Asset extra options. Only available for kinds which produce an asset. (Not
279
- * available for model kind)
284
+ * Query param: The projectId used for ownership resource management. Either to
285
+ * assert ownership or to set the owner of the resource(s)
286
+ */
287
+ projectId?: string;
288
+
289
+ /**
290
+ * Body param: Asset extra options. Only available for kinds which produce an
291
+ * asset. (Not available for model kind)
280
292
  */
281
293
  assetOptions?: UploadCreateParams.AssetOptions;
282
294
 
283
295
  /**
284
- * The civitai.com url of the model (example:
296
+ * Body param: The civitai.com url of the model (example:
285
297
  * "https://civitai.com/models/370194/translucent-subsurface-scattering-test?modelVersionId=413566").
286
298
  */
287
299
  civitaiModelUrl?: string;
288
300
 
289
301
  /**
290
- * Required for multipart upload. The MIME type of the file (example: "image/jpeg")
302
+ * Body param: Required for multipart upload. The MIME type of the file (example:
303
+ * "image/jpeg")
291
304
  */
292
305
  contentType?: string;
293
306
 
294
307
  /**
295
- * Required for multipart upload. The original file name of the image (example:
296
- * "low-res-image.jpg"). It will be ignored if assetId is provided.
308
+ * Body param: Required for multipart upload. The original file name of the image
309
+ * (example: "low-res-image.jpg"). It will be ignored if assetId is provided.
297
310
  */
298
311
  fileName?: string;
299
312
 
300
313
  /**
301
- * Required for multipart upload. The size of the file in bytes
314
+ * Body param: Required for multipart upload. The size of the file in bytes
302
315
  */
303
316
  fileSize?: number;
304
317
 
305
318
  /**
306
- * The huggingface.co modelName (example: "black-forest-labs/FLUX.1-dev"). No need
307
- * to setup other fields if you setup huggingFaceModelName
319
+ * Body param: The huggingface.co modelName (example:
320
+ * "black-forest-labs/FLUX.1-dev"). No need to setup other fields if you setup
321
+ * huggingFaceModelName
308
322
  */
309
323
  huggingFaceModelName?: string;
310
324
 
311
325
  /**
312
- * Required for multipart upload and url. The purpose of the file once validated
313
- * (example: "model")
326
+ * Body param: Required for multipart upload and url. The purpose of the file once
327
+ * validated (example: "model")
314
328
  */
315
329
  kind?: '3d' | 'asset' | 'audio' | 'avatar' | 'image' | 'model' | 'text' | 'video';
316
330
 
317
331
  /**
318
- * Required for multipart upload. The number of parts the file will be uploaded in
332
+ * Body param: Required for multipart upload. The number of parts the file will be
333
+ * uploaded in
319
334
  */
320
335
  parts?: number;
321
336
 
322
337
  /**
323
- * The url where to download the file. If you setup url you MUST setup kind as
324
- * well.
338
+ * Body param: The url where to download the file. If you setup url you MUST setup
339
+ * kind as well.
325
340
  */
326
341
  url?: string;
327
342
  }
@@ -349,12 +364,21 @@ export namespace UploadCreateParams {
349
364
  }
350
365
  }
351
366
 
367
+ export interface UploadRetrieveParams {
368
+ projectId?: unknown;
369
+ }
370
+
352
371
  export interface UploadTriggerActionParams {
353
372
  /**
354
- * The action to perform on an upload, currently only "upload-complete" is
355
- * supported
373
+ * Body param: The action to perform on an upload, currently only "upload-complete"
374
+ * is supported
356
375
  */
357
376
  action: 'complete';
377
+
378
+ /**
379
+ * Query param
380
+ */
381
+ projectId?: unknown;
358
382
  }
359
383
 
360
384
  export declare namespace Uploads {
@@ -363,6 +387,7 @@ export declare namespace Uploads {
363
387
  type UploadRetrieveResponse as UploadRetrieveResponse,
364
388
  type UploadTriggerActionResponse as UploadTriggerActionResponse,
365
389
  type UploadCreateParams as UploadCreateParams,
390
+ type UploadRetrieveParams as UploadRetrieveParams,
366
391
  type UploadTriggerActionParams as UploadTriggerActionParams,
367
392
  };
368
393
  }
@@ -31,6 +31,8 @@ export interface UsageListResponse {
31
31
 
32
32
  nsfwUsages?: Array<UsageListResponse.NsfwUsage>;
33
33
 
34
+ slopUsages?: Array<UsageListResponse.SlopUsage>;
35
+
34
36
  usages?: Array<UsageListResponse.Usage>;
35
37
  }
36
38
 
@@ -277,6 +279,12 @@ export namespace UsageListResponse {
277
279
  * The Compute Units consumption for the user
278
280
  */
279
281
  value: number;
282
+
283
+ /**
284
+ * Compute Units consumed per billing action, when a breakdown is available
285
+ * (example: `{ "slop-detection": 12 }`). Values are included in `value`.
286
+ */
287
+ costDetails?: unknown;
280
288
  }
281
289
 
282
290
  export interface Entities {
@@ -652,12 +660,12 @@ export namespace UsageListResponse {
652
660
  /**
653
661
  * Camera eye position in the splat's world frame.
654
662
  */
655
- position: Array<unknown>;
663
+ position: Array<number>;
656
664
 
657
665
  /**
658
666
  * Look-at point in the splat's world frame.
659
667
  */
660
- target: Array<unknown>;
668
+ target: Array<number>;
661
669
 
662
670
  /**
663
671
  * Vertical field of view in degrees (defaults to 50 in the renderer).
@@ -1747,6 +1755,43 @@ export namespace UsageListResponse {
1747
1755
  }
1748
1756
  }
1749
1757
 
1758
+ /**
1759
+ * A SlopGuard verdict series: one per bucket (total | pass | warn | fail).
1760
+ */
1761
+ export interface SlopUsage {
1762
+ /**
1763
+ * The data points
1764
+ */
1765
+ points: Array<SlopUsage.Point>;
1766
+
1767
+ /**
1768
+ * The verdict bucket: "total", "pass", "warn", or "fail"
1769
+ */
1770
+ verdict: string;
1771
+ }
1772
+
1773
+ export namespace SlopUsage {
1774
+ /**
1775
+ * One time-bucket point in a SlopGuard verdict series.
1776
+ */
1777
+ export interface Point {
1778
+ /**
1779
+ * Distinct scored assets in this bucket for this verdict
1780
+ */
1781
+ count: number;
1782
+
1783
+ /**
1784
+ * Of `count`, the number of assets generated via an API key.
1785
+ */
1786
+ countApiKey: number;
1787
+
1788
+ /**
1789
+ * The UTC ISO date of the point
1790
+ */
1791
+ time: string;
1792
+ }
1793
+ }
1794
+
1750
1795
  export interface Usage {
1751
1796
  /**
1752
1797
  * Granularity for points (example: "1d", "1h", "1m", "15m")
@@ -1840,13 +1885,13 @@ export interface UsageListParams {
1840
1885
 
1841
1886
  /**
1842
1887
  * When set, points whose numeric fields are all zero are removed from `usages`,
1843
- * `modelUsages`, `assetUsages` and `nsfwUsages`. The parent entry (model, kind,
1844
- * label, usageName) is preserved with `points: []` so callers still see every row.
1845
- * Useful on wide windows × fine granularities × many models, where the zero-fill
1846
- * can push the response past the 6 MB API Gateway sync limit. The bare
1847
- * `?dropZeroPoints` form, plus any value (`true`, `1`, `yes`, `on`, …) enables it;
1848
- * absent or explicit falsy literals (`false`, `0`, `no`, `off`) disable it.
1849
- * Default disabled for backwards compatibility.
1888
+ * `modelUsages`, `assetUsages`, `nsfwUsages` and `slopUsages`. The parent entry
1889
+ * (model, kind, label, usageName) is preserved with `points: []` so callers still
1890
+ * see every row. Useful on wide windows × fine granularities × many models, where
1891
+ * the zero-fill can push the response past the 6 MB API Gateway sync limit. The
1892
+ * bare `?dropZeroPoints` form, plus any value (`true`, `1`, `yes`, `on`, …)
1893
+ * enables it; absent or explicit falsy literals (`false`, `0`, `no`, `off`)
1894
+ * disable it. Default disabled for backwards compatibility.
1850
1895
  */
1851
1896
  dropZeroPoints?: boolean;
1852
1897
 
@@ -1868,6 +1913,12 @@ export interface UsageListParams {
1868
1913
  */
1869
1914
  startDate?: string;
1870
1915
 
1916
+ /**
1917
+ * The teamId used for ownership resource management. Either to assert ownership or
1918
+ * to set the owner of the resource(s)
1919
+ */
1920
+ teamId?: string;
1921
+
1871
1922
  /**
1872
1923
  * The time range of the usage. If not provided, use default timeRange. If
1873
1924
  * startDate and endDate provided, timeRange is ignored.
@@ -1877,10 +1928,12 @@ export interface UsageListParams {
1877
1928
  /**
1878
1929
  * The type of the usage data. Can be one or more comma separated values. Can be
1879
1930
  * any of the following values: usages, activity, consumption, model-usages,
1880
- * asset-usages, nsfw-usages. Default is all types. If bad type or empty, all types
1881
- * will be returned.
1931
+ * asset-usages, nsfw-usages, slop-usages. Default is all types. If bad type or
1932
+ * empty, all types will be returned.
1882
1933
  */
1883
- type?: Array<'usages' | 'activity' | 'consumption' | 'model-usages' | 'asset-usages' | 'nsfw-usages'>;
1934
+ type?: Array<
1935
+ 'usages' | 'activity' | 'consumption' | 'model-usages' | 'asset-usages' | 'nsfw-usages' | 'slop-usages'
1936
+ >;
1884
1937
 
1885
1938
  /**
1886
1939
  * The unique identifier of the user for the usage. If not provided, returns all