@scenario-labs/sdk 1.1.0 → 2.0.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 (236) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +67 -43
  7. package/client.js.map +1 -1
  8. package/client.mjs +67 -44
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.js +7 -7
  11. package/core/api-promise.js.map +1 -1
  12. package/core/api-promise.mjs +7 -7
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.js +6 -0
  15. package/core/error.js.map +1 -1
  16. package/core/error.mjs +6 -0
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.js +24 -6
  19. package/core/pagination.js.map +1 -1
  20. package/core/pagination.mjs +24 -6
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/resource.js +1 -0
  23. package/core/resource.js.map +1 -1
  24. package/core/resource.mjs +1 -0
  25. package/core/resource.mjs.map +1 -1
  26. package/index.d.mts +1 -0
  27. package/index.d.mts.map +1 -1
  28. package/index.d.ts +1 -0
  29. package/index.d.ts.map +1 -1
  30. package/index.js +3 -1
  31. package/index.js.map +1 -1
  32. package/index.mjs +1 -0
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.js +1 -1
  35. package/internal/detect-platform.js.map +1 -1
  36. package/internal/detect-platform.mjs +1 -1
  37. package/internal/detect-platform.mjs.map +1 -1
  38. package/internal/qs/stringify.js +1 -1
  39. package/internal/qs/stringify.js.map +1 -1
  40. package/internal/qs/stringify.mjs +1 -1
  41. package/internal/qs/stringify.mjs.map +1 -1
  42. package/internal/request-options.d.mts +0 -4
  43. package/internal/request-options.d.mts.map +1 -1
  44. package/internal/request-options.d.ts +0 -4
  45. package/internal/request-options.d.ts.map +1 -1
  46. package/internal/request-options.js.map +1 -1
  47. package/internal/request-options.mjs.map +1 -1
  48. package/internal/to-file.js +2 -2
  49. package/internal/to-file.js.map +1 -1
  50. package/internal/to-file.mjs +2 -2
  51. package/internal/to-file.mjs.map +1 -1
  52. package/internal/tslib.js +0 -18
  53. package/internal/tslib.mjs +1 -17
  54. package/internal/types.d.mts +6 -6
  55. package/internal/types.d.mts.map +1 -1
  56. package/internal/types.d.ts +6 -6
  57. package/internal/types.d.ts.map +1 -1
  58. package/internal/utils/log.d.mts.map +1 -1
  59. package/internal/utils/log.d.ts.map +1 -1
  60. package/internal/utils/log.js +2 -0
  61. package/internal/utils/log.js.map +1 -1
  62. package/internal/utils/log.mjs +2 -0
  63. package/internal/utils/log.mjs.map +1 -1
  64. package/lib/job.js +3 -3
  65. package/lib/job.js.map +1 -1
  66. package/lib/job.mjs +3 -3
  67. package/lib/job.mjs.map +1 -1
  68. package/lib/models.js +1 -4
  69. package/lib/models.js.map +1 -1
  70. package/lib/models.mjs +1 -4
  71. package/lib/models.mjs.map +1 -1
  72. package/lib/scenario.js +6 -9
  73. package/lib/scenario.js.map +1 -1
  74. package/lib/scenario.mjs +6 -9
  75. package/lib/scenario.mjs.map +1 -1
  76. package/lib/upload.js +6 -6
  77. package/lib/upload.js.map +1 -1
  78. package/lib/upload.mjs +6 -6
  79. package/lib/upload.mjs.map +1 -1
  80. package/lib/workflow.d.mts +2 -2
  81. package/lib/workflow.d.mts.map +1 -1
  82. package/lib/workflow.d.ts +2 -2
  83. package/lib/workflow.d.ts.map +1 -1
  84. package/lib/workflow.js +2 -2
  85. package/lib/workflow.js.map +1 -1
  86. package/lib/workflow.mjs +2 -2
  87. package/lib/workflow.mjs.map +1 -1
  88. package/lib/workflow_converter.d.mts +174 -0
  89. package/lib/workflow_converter.d.mts.map +1 -0
  90. package/lib/workflow_converter.d.ts +174 -0
  91. package/lib/workflow_converter.d.ts.map +1 -0
  92. package/lib/workflow_converter.js +995 -0
  93. package/lib/workflow_converter.js.map +1 -0
  94. package/lib/workflow_converter.mjs +992 -0
  95. package/lib/workflow_converter.mjs.map +1 -0
  96. package/package.json +1 -1
  97. package/resources/assets/assets.d.mts +13 -5
  98. package/resources/assets/assets.d.mts.map +1 -1
  99. package/resources/assets/assets.d.ts +13 -5
  100. package/resources/assets/assets.d.ts.map +1 -1
  101. package/resources/assets/assets.js +1 -8
  102. package/resources/assets/assets.js.map +1 -1
  103. package/resources/assets/assets.mjs +1 -8
  104. package/resources/assets/assets.mjs.map +1 -1
  105. package/resources/assets/index.d.mts +0 -1
  106. package/resources/assets/index.d.mts.map +1 -1
  107. package/resources/assets/index.d.ts +0 -1
  108. package/resources/assets/index.d.ts.map +1 -1
  109. package/resources/assets/index.js +1 -3
  110. package/resources/assets/index.js.map +1 -1
  111. package/resources/assets/index.mjs +0 -1
  112. package/resources/assets/index.mjs.map +1 -1
  113. package/resources/collections/collections.js +2 -5
  114. package/resources/collections/collections.js.map +1 -1
  115. package/resources/collections/collections.mjs +2 -5
  116. package/resources/collections/collections.mjs.map +1 -1
  117. package/resources/generate.d.mts +96 -0
  118. package/resources/generate.d.mts.map +1 -1
  119. package/resources/generate.d.ts +96 -0
  120. package/resources/generate.d.ts.map +1 -1
  121. package/resources/index.d.mts +2 -1
  122. package/resources/index.d.mts.map +1 -1
  123. package/resources/index.d.ts +2 -1
  124. package/resources/index.d.ts.map +1 -1
  125. package/resources/index.js +3 -1
  126. package/resources/index.js.map +1 -1
  127. package/resources/index.mjs +1 -0
  128. package/resources/index.mjs.map +1 -1
  129. package/resources/jobs.d.mts +46 -3
  130. package/resources/jobs.d.mts.map +1 -1
  131. package/resources/jobs.d.ts +46 -3
  132. package/resources/jobs.d.ts.map +1 -1
  133. package/resources/models/examples.d.mts +24 -0
  134. package/resources/models/examples.d.mts.map +1 -1
  135. package/resources/models/examples.d.ts +24 -0
  136. package/resources/models/examples.d.ts.map +1 -1
  137. package/resources/models/models.d.mts +55 -11
  138. package/resources/models/models.d.mts.map +1 -1
  139. package/resources/models/models.d.ts +55 -11
  140. package/resources/models/models.d.ts.map +1 -1
  141. package/resources/models/models.js +4 -7
  142. package/resources/models/models.js.map +1 -1
  143. package/resources/models/models.mjs +4 -7
  144. package/resources/models/models.mjs.map +1 -1
  145. package/resources/models/train.d.mts +24 -0
  146. package/resources/models/train.d.mts.map +1 -1
  147. package/resources/models/train.d.ts +24 -0
  148. package/resources/models/train.d.ts.map +1 -1
  149. package/resources/oscu.d.mts +5 -0
  150. package/resources/oscu.d.mts.map +1 -1
  151. package/resources/oscu.d.ts +5 -0
  152. package/resources/oscu.d.ts.map +1 -1
  153. package/resources/oscu.js +5 -0
  154. package/resources/oscu.js.map +1 -1
  155. package/resources/oscu.mjs +5 -0
  156. package/resources/oscu.mjs.map +1 -1
  157. package/resources/pricing/index.d.mts +3 -0
  158. package/resources/pricing/index.d.mts.map +1 -0
  159. package/resources/pricing/index.d.ts +3 -0
  160. package/resources/pricing/index.d.ts.map +1 -0
  161. package/resources/pricing/index.js +9 -0
  162. package/resources/pricing/index.js.map +1 -0
  163. package/resources/pricing/index.mjs +4 -0
  164. package/resources/pricing/index.mjs.map +1 -0
  165. package/resources/pricing/oscu.d.mts +25 -0
  166. package/resources/pricing/oscu.d.mts.map +1 -0
  167. package/resources/pricing/oscu.d.ts +25 -0
  168. package/resources/pricing/oscu.d.ts.map +1 -0
  169. package/resources/pricing/oscu.js +16 -0
  170. package/resources/pricing/oscu.js.map +1 -0
  171. package/resources/pricing/oscu.mjs +12 -0
  172. package/resources/pricing/oscu.mjs.map +1 -0
  173. package/resources/pricing/pricing.d.mts +10 -0
  174. package/resources/pricing/pricing.d.mts.map +1 -0
  175. package/resources/pricing/pricing.d.ts +10 -0
  176. package/resources/pricing/pricing.d.ts.map +1 -0
  177. package/resources/pricing/pricing.js +14 -0
  178. package/resources/pricing/pricing.js.map +1 -0
  179. package/resources/pricing/pricing.mjs +9 -0
  180. package/resources/pricing/pricing.mjs.map +1 -0
  181. package/resources/pricing.d.mts +2 -0
  182. package/resources/pricing.d.mts.map +1 -0
  183. package/resources/pricing.d.ts +2 -0
  184. package/resources/pricing.d.ts.map +1 -0
  185. package/resources/pricing.js +6 -0
  186. package/resources/pricing.js.map +1 -0
  187. package/resources/pricing.mjs +3 -0
  188. package/resources/pricing.mjs.map +1 -0
  189. package/resources/usages.d.mts +29 -4
  190. package/resources/usages.d.mts.map +1 -1
  191. package/resources/usages.d.ts +29 -4
  192. package/resources/usages.d.ts.map +1 -1
  193. package/resources/workflows.d.mts +1298 -1152
  194. package/resources/workflows.d.mts.map +1 -1
  195. package/resources/workflows.d.ts +1298 -1152
  196. package/resources/workflows.d.ts.map +1 -1
  197. package/resources/workflows.js +8 -4
  198. package/resources/workflows.js.map +1 -1
  199. package/resources/workflows.mjs +8 -4
  200. package/resources/workflows.mjs.map +1 -1
  201. package/src/client.ts +24 -11
  202. package/src/index.ts +14 -0
  203. package/src/internal/request-options.ts +0 -2
  204. package/src/internal/types.ts +6 -8
  205. package/src/internal/utils/log.ts +2 -0
  206. package/src/lib/workflow.ts +4 -4
  207. package/src/lib/workflow_converter.ts +1250 -0
  208. package/src/resources/assets/assets.ts +17 -13
  209. package/src/resources/assets/index.ts +0 -6
  210. package/src/resources/generate.ts +112 -0
  211. package/src/resources/index.ts +3 -1
  212. package/src/resources/jobs.ts +54 -4
  213. package/src/resources/models/examples.ts +28 -0
  214. package/src/resources/models/models.ts +100 -11
  215. package/src/resources/models/train.ts +28 -0
  216. package/src/resources/oscu.ts +5 -0
  217. package/src/resources/pricing/index.ts +4 -0
  218. package/src/resources/pricing/oscu.ts +35 -0
  219. package/src/resources/pricing/pricing.ts +15 -0
  220. package/src/resources/pricing.ts +3 -0
  221. package/src/resources/usages.ts +33 -3
  222. package/src/resources/workflows.ts +1691 -1519
  223. package/src/version.ts +1 -1
  224. package/version.d.mts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/resources/assets/public.d.mts +0 -1538
  229. package/resources/assets/public.d.mts.map +0 -1
  230. package/resources/assets/public.d.ts +0 -1538
  231. package/resources/assets/public.d.ts.map +0 -1
  232. package/resources/assets/public.js +0 -28
  233. package/resources/assets/public.js.map +0 -1
  234. package/resources/assets/public.mjs +0 -24
  235. package/resources/assets/public.mjs.map +0 -1
  236. package/src/resources/assets/public.ts +0 -2461
@@ -511,6 +511,13 @@ export namespace TrainActionResponse {
511
511
  */
512
512
  max?: number;
513
513
 
514
+ /**
515
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
516
+ * \`file_array\` input types for video and audio assets. Validated against
517
+ * \`asset.properties.duration\` at job creation time.
518
+ */
519
+ maxDuration?: number;
520
+
514
521
  /**
515
522
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
516
523
  * \`string_array\`.
@@ -1743,6 +1750,13 @@ export namespace TrainTriggerResponse {
1743
1750
  */
1744
1751
  max?: number;
1745
1752
 
1753
+ /**
1754
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1755
+ * \`file_array\` input types for video and audio assets. Validated against
1756
+ * \`asset.properties.duration\` at job creation time.
1757
+ */
1758
+ maxDuration?: number;
1759
+
1746
1760
  /**
1747
1761
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1748
1762
  * \`string_array\`.
@@ -1969,6 +1983,13 @@ export namespace TrainTriggerResponse {
1969
1983
  */
1970
1984
  max?: number;
1971
1985
 
1986
+ /**
1987
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1988
+ * \`file_array\` input types for video and audio assets. Validated against
1989
+ * \`asset.properties.duration\` at job creation time.
1990
+ */
1991
+ maxDuration?: number;
1992
+
1972
1993
  /**
1973
1994
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1974
1995
  * \`string_array\`.
@@ -2767,6 +2788,13 @@ export namespace TrainTriggerResponse {
2767
2788
  */
2768
2789
  max?: number;
2769
2790
 
2791
+ /**
2792
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
2793
+ * \`file_array\` input types for video and audio assets. Validated against
2794
+ * \`asset.properties.duration\` at job creation time.
2795
+ */
2796
+ maxDuration?: number;
2797
+
2770
2798
  /**
2771
2799
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
2772
2800
  * \`string_array\`.
@@ -4,10 +4,15 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * @deprecated Use `pricing` instead.
9
+ */
7
10
  export class Oscu extends APIResource {
8
11
  /**
9
12
  * Get the public Prepaid Compute Units (or OSCU for One Shot Compute Units) price
10
13
  * details
14
+ *
15
+ * @deprecated Use `pricing` instead.
11
16
  */
12
17
  retrievePrices(options?: RequestOptions): APIPromise<OscuRetrievePricesResponse> {
13
18
  return this._client.get('/oscu/prices', options);
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Oscu, type OscuRetrievePricesResponse } from './oscu';
4
+ export { Pricing } from './pricing';
@@ -0,0 +1,35 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ export class Oscu extends APIResource {
8
+ /**
9
+ * Get the public Prepaid Compute Units (or OSCU for One Shot Compute Units) price
10
+ * details
11
+ */
12
+ retrievePrices(options?: RequestOptions): APIPromise<OscuRetrievePricesResponse> {
13
+ return this._client.get('/oscu/prices', options);
14
+ }
15
+ }
16
+
17
+ export interface OscuRetrievePricesResponse {
18
+ prices: Array<OscuRetrievePricesResponse.Price>;
19
+ }
20
+
21
+ export namespace OscuRetrievePricesResponse {
22
+ export interface Price {
23
+ creativeUnits?: number;
24
+
25
+ currency?: string;
26
+
27
+ expires?: number;
28
+
29
+ unitAmount?: number;
30
+ }
31
+ }
32
+
33
+ export declare namespace Oscu {
34
+ export { type OscuRetrievePricesResponse as OscuRetrievePricesResponse };
35
+ }
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as OscuAPI from './oscu';
5
+ import { Oscu, OscuRetrievePricesResponse } from './oscu';
6
+
7
+ export class Pricing extends APIResource {
8
+ oscu: OscuAPI.Oscu = new OscuAPI.Oscu(this._client);
9
+ }
10
+
11
+ Pricing.Oscu = Oscu;
12
+
13
+ export declare namespace Pricing {
14
+ export { Oscu as Oscu, type OscuRetrievePricesResponse as OscuRetrievePricesResponse };
15
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './pricing/index';
@@ -138,8 +138,10 @@ export namespace UsageListResponse {
138
138
  | 'update-model-prompt-guide'
139
139
  | 'update-oscu-auto-refill'
140
140
  | 'update-project'
141
+ | 'update-project-instructions'
141
142
  | 'update-subscription'
142
143
  | 'update-team'
144
+ | 'update-team-instructions'
143
145
  | 'update-team-member'
144
146
  | 'upscale'
145
147
  | 'vectorization';
@@ -962,6 +964,13 @@ export namespace UsageListResponse {
962
964
  */
963
965
  max?: number;
964
966
 
967
+ /**
968
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
969
+ * \`file_array\` input types for video and audio assets. Validated against
970
+ * \`asset.properties.duration\` at job creation time.
971
+ */
972
+ maxDuration?: number;
973
+
965
974
  /**
966
975
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
967
976
  * \`string_array\`.
@@ -1188,6 +1197,13 @@ export namespace UsageListResponse {
1188
1197
  */
1189
1198
  max?: number;
1190
1199
 
1200
+ /**
1201
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
1202
+ * \`file_array\` input types for video and audio assets. Validated against
1203
+ * \`asset.properties.duration\` at job creation time.
1204
+ */
1205
+ maxDuration?: number;
1206
+
1191
1207
  /**
1192
1208
  * The maximum allowed length for \`string\` inputs. Also applies to each item in
1193
1209
  * \`string_array\`.
@@ -1732,6 +1748,18 @@ export interface UsageListParams {
1732
1748
  */
1733
1749
  activityOffset?: number;
1734
1750
 
1751
+ /**
1752
+ * When set, points whose numeric fields are all zero are removed from `usages`,
1753
+ * `modelUsages`, `assetUsages` and `nsfwUsages`. The parent entry (model, kind,
1754
+ * label, usageName) is preserved with `points: []` so callers still see every row.
1755
+ * Useful on wide windows × fine granularities × many models, where the zero-fill
1756
+ * can push the response past the 6 MB API Gateway sync limit. The bare
1757
+ * `?dropZeroPoints` form, plus any value (`true`, `1`, `yes`, `on`, …) enables it;
1758
+ * absent or explicit falsy literals (`false`, `0`, `no`, `off`) disable it.
1759
+ * Default disabled for backwards compatibility.
1760
+ */
1761
+ dropZeroPoints?: boolean;
1762
+
1735
1763
  /**
1736
1764
  * The end date of the usage in ISO 8601 format. If not provided, use default
1737
1765
  * timeRange. If provided, startDate is required.
@@ -1757,10 +1785,12 @@ export interface UsageListParams {
1757
1785
  timeRange?: 'last-hour' | 'last-day' | 'last-three-days' | 'last-seven-days' | 'last-thirty-one-days';
1758
1786
 
1759
1787
  /**
1760
- * The type of the usage data. Can be one or more comma separated values. Default
1761
- * is all types. If bad type or empty, all types will be returned.
1788
+ * The type of the usage data. Can be one or more comma separated values. Can be
1789
+ * any of the following values: usages, activity, consumption, model-usages,
1790
+ * asset-usages, nsfw-usages. Default is all types. If bad type or empty, all types
1791
+ * will be returned.
1762
1792
  */
1763
- type?: 'usages' | 'activity' | 'consumption' | 'model-usages' | 'asset-usages' | 'nsfw-usages';
1793
+ type?: Array<'usages' | 'activity' | 'consumption' | 'model-usages' | 'asset-usages' | 'nsfw-usages'>;
1764
1794
 
1765
1795
  /**
1766
1796
  * The unique identifier of the user for the usage. If not provided, returns all