@scenario-labs/sdk 0.2.0 → 0.3.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.
- package/CHANGELOG.md +26 -0
- package/README.md +4 -2
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js +11 -11
- package/client.js.map +1 -1
- package/client.mjs +11 -11
- package/client.mjs.map +1 -1
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/request-options.d.mts +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/lib/workflow.d.mts +6 -1
- package/lib/workflow.d.mts.map +1 -1
- package/lib/workflow.d.ts +6 -1
- package/lib/workflow.d.ts.map +1 -1
- package/lib/workflow.js +9 -1
- package/lib/workflow.js.map +1 -1
- package/lib/workflow.mjs +9 -1
- package/lib/workflow.mjs.map +1 -1
- package/lib/workflow_validator.d.mts +22 -0
- package/lib/workflow_validator.d.mts.map +1 -0
- package/lib/workflow_validator.d.ts +22 -0
- package/lib/workflow_validator.d.ts.map +1 -0
- package/lib/workflow_validator.js +124 -0
- package/lib/workflow_validator.js.map +1 -0
- package/lib/workflow_validator.mjs +121 -0
- package/lib/workflow_validator.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/assets/assets.d.mts +9 -3
- package/resources/assets/assets.d.mts.map +1 -1
- package/resources/assets/assets.d.ts +9 -3
- package/resources/assets/assets.d.ts.map +1 -1
- package/resources/assets/assets.js +2 -2
- package/resources/assets/assets.js.map +1 -1
- package/resources/assets/assets.mjs +2 -2
- package/resources/assets/assets.mjs.map +1 -1
- package/resources/assets/index.d.mts +1 -1
- package/resources/assets/index.d.mts.map +1 -1
- package/resources/assets/index.d.ts +1 -1
- package/resources/assets/index.d.ts.map +1 -1
- package/resources/assets/index.js.map +1 -1
- package/resources/assets/index.mjs.map +1 -1
- package/resources/collections/assets.d.mts +8 -2
- package/resources/collections/assets.d.mts.map +1 -1
- package/resources/collections/assets.d.ts +8 -2
- package/resources/collections/assets.d.ts.map +1 -1
- package/resources/collections/assets.js +2 -2
- package/resources/collections/assets.js.map +1 -1
- package/resources/collections/assets.mjs +2 -2
- package/resources/collections/assets.mjs.map +1 -1
- package/resources/collections/collections.d.mts +4 -4
- package/resources/collections/collections.d.mts.map +1 -1
- package/resources/collections/collections.d.ts +4 -4
- package/resources/collections/collections.d.ts.map +1 -1
- package/resources/collections/collections.js.map +1 -1
- package/resources/collections/collections.mjs.map +1 -1
- package/resources/collections/index.d.mts +2 -2
- package/resources/collections/index.d.mts.map +1 -1
- package/resources/collections/index.d.ts +2 -2
- package/resources/collections/index.d.ts.map +1 -1
- package/resources/collections/index.js.map +1 -1
- package/resources/collections/index.mjs +2 -2
- package/resources/collections/index.mjs.map +1 -1
- package/resources/collections/models.d.mts +8 -2
- package/resources/collections/models.d.mts.map +1 -1
- package/resources/collections/models.d.ts +8 -2
- package/resources/collections/models.d.ts.map +1 -1
- package/resources/collections/models.js +2 -2
- package/resources/collections/models.js.map +1 -1
- package/resources/collections/models.mjs +2 -2
- package/resources/collections/models.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/models/models.d.mts +133 -133
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +133 -133
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/train.d.mts +38 -38
- package/resources/models/train.d.mts.map +1 -1
- package/resources/models/train.d.ts +38 -38
- package/resources/models/train.d.ts.map +1 -1
- package/src/client.ts +15 -13
- package/src/index.ts +1 -0
- package/src/internal/request-options.ts +1 -1
- package/src/lib/workflow.ts +10 -1
- package/src/lib/workflow_validator.ts +167 -0
- package/src/resources/assets/assets.ts +84 -3
- package/src/resources/assets/index.ts +1 -0
- package/src/resources/collections/assets.ts +14 -2
- package/src/resources/collections/collections.ts +4 -2
- package/src/resources/collections/index.ts +14 -2
- package/src/resources/collections/models.ts +14 -2
- package/src/resources/index.ts +1 -0
- package/src/resources/models/models.ts +140 -140
- package/src/resources/models/train.ts +40 -40
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const VALID_NODE_TYPES = new Set([
|
|
2
|
+
'custom-model',
|
|
3
|
+
'for-each',
|
|
4
|
+
'generate-prompt',
|
|
5
|
+
'list',
|
|
6
|
+
'logic',
|
|
7
|
+
'model',
|
|
8
|
+
'remove-background',
|
|
9
|
+
'transform',
|
|
10
|
+
'user-approval',
|
|
11
|
+
'workflow',
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
type RawRef = {
|
|
15
|
+
node?: unknown;
|
|
16
|
+
conditional?: unknown;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type RawInput = {
|
|
20
|
+
name?: unknown;
|
|
21
|
+
ref?: RawRef;
|
|
22
|
+
items?: unknown[][];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type RawNode = {
|
|
26
|
+
id?: unknown;
|
|
27
|
+
type?: unknown;
|
|
28
|
+
modelId?: unknown;
|
|
29
|
+
workflowId?: unknown;
|
|
30
|
+
logicType?: unknown;
|
|
31
|
+
loopBodyNodeIds?: unknown;
|
|
32
|
+
count?: unknown;
|
|
33
|
+
dependsOn?: unknown;
|
|
34
|
+
inputs?: unknown;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Validates the structural integrity of a workflow flow (array of nodes).
|
|
39
|
+
*
|
|
40
|
+
* Throws an `Error` with a human-readable message on the first violation found.
|
|
41
|
+
*
|
|
42
|
+
* Checks performed:
|
|
43
|
+
* 1. Every node has a non-empty string `id`
|
|
44
|
+
* 2. Node IDs are unique within the flow
|
|
45
|
+
* 3. Every node `type` is a recognized workflow node type
|
|
46
|
+
* 4. Per-type required fields:
|
|
47
|
+
* - custom-model → modelId
|
|
48
|
+
* - workflow → workflowId
|
|
49
|
+
* - logic → logicType
|
|
50
|
+
* - for-each → loopBodyNodeIds (non-empty) OR count (>0)
|
|
51
|
+
* 5. Cross-references all point to node IDs that exist in the flow:
|
|
52
|
+
* - dependsOn entries
|
|
53
|
+
* - input ref.node (excluding "workflow" which is a reserved keyword)
|
|
54
|
+
* - input ref.conditional entries
|
|
55
|
+
* - loopBodyNodeIds entries
|
|
56
|
+
*/
|
|
57
|
+
export function validateWorkflowFlow(flow: unknown[]): void {
|
|
58
|
+
const nodeIds = new Set<string>();
|
|
59
|
+
const firstSeenAt = new Map<string, number>();
|
|
60
|
+
|
|
61
|
+
// Pass 1 — per-node checks (ID, type, required fields)
|
|
62
|
+
for (let i = 0; i < flow.length; i++) {
|
|
63
|
+
const node = flow[i] as RawNode;
|
|
64
|
+
|
|
65
|
+
if (typeof node.id !== 'string' || !node.id) {
|
|
66
|
+
throw new Error(`Node at index ${i} is missing an "id" field`);
|
|
67
|
+
}
|
|
68
|
+
if (nodeIds.has(node.id)) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Duplicate node id "${node.id}" at index ${i} (first seen at index ${firstSeenAt.get(node.id)})`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
nodeIds.add(node.id);
|
|
74
|
+
firstSeenAt.set(node.id, i);
|
|
75
|
+
|
|
76
|
+
const label = `"${node.id}"`;
|
|
77
|
+
|
|
78
|
+
if (typeof node.type !== 'string' || !VALID_NODE_TYPES.has(node.type)) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
`Node ${label} has invalid type "${node.type}". Valid types are: ${[...VALID_NODE_TYPES].join(', ')}`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const type = node.type;
|
|
85
|
+
|
|
86
|
+
if (type === 'custom-model' && !node.modelId) {
|
|
87
|
+
throw new Error(`Node ${label} (custom-model) is missing required field "modelId"`);
|
|
88
|
+
}
|
|
89
|
+
if (type === 'workflow' && !node.workflowId) {
|
|
90
|
+
throw new Error(`Node ${label} (workflow) is missing required field "workflowId"`);
|
|
91
|
+
}
|
|
92
|
+
if (type === 'logic' && !node.logicType) {
|
|
93
|
+
throw new Error(`Node ${label} (logic) is missing required field "logicType"`);
|
|
94
|
+
}
|
|
95
|
+
if (type === 'for-each') {
|
|
96
|
+
const hasLoopBody = Array.isArray(node.loopBodyNodeIds) && node.loopBodyNodeIds.length > 0;
|
|
97
|
+
const hasCount = typeof node.count === 'number' && node.count > 0;
|
|
98
|
+
if (!hasLoopBody && !hasCount) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
`Node ${label} (for-each) requires either "loopBodyNodeIds" (non-empty array) or "count" (positive number)`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Pass 2 — cross-reference checks (all node IDs are now collected)
|
|
107
|
+
for (const rawNode of flow) {
|
|
108
|
+
const node = rawNode as RawNode;
|
|
109
|
+
const nodeId = node.id as string;
|
|
110
|
+
|
|
111
|
+
if (Array.isArray(node.dependsOn)) {
|
|
112
|
+
for (const depId of node.dependsOn) {
|
|
113
|
+
if (typeof depId === 'string' && !nodeIds.has(depId)) {
|
|
114
|
+
throw new Error(`Node "${nodeId}" dependsOn unknown node "${depId}"`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (Array.isArray(node.inputs)) {
|
|
120
|
+
for (const input of node.inputs) {
|
|
121
|
+
validateInputRefs(nodeId, input as RawInput, nodeIds);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (Array.isArray(node.loopBodyNodeIds)) {
|
|
126
|
+
for (const bodyId of node.loopBodyNodeIds as unknown[]) {
|
|
127
|
+
if (typeof bodyId === 'string' && !nodeIds.has(bodyId)) {
|
|
128
|
+
throw new Error(`Node "${nodeId}" loopBodyNodeIds references unknown node "${bodyId}"`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function validateInputRefs(nodeId: string, input: RawInput, nodeIds: Set<string>): void {
|
|
136
|
+
const inputName = typeof input.name === 'string' && input.name ? input.name : '(unnamed)';
|
|
137
|
+
|
|
138
|
+
if (input.ref) {
|
|
139
|
+
const { node: refNode, conditional } = input.ref;
|
|
140
|
+
|
|
141
|
+
// "workflow" is a reserved keyword meaning "take from the workflow's own inputs"
|
|
142
|
+
if (typeof refNode === 'string' && refNode !== 'workflow' && !nodeIds.has(refNode)) {
|
|
143
|
+
throw new Error(`Node "${nodeId}" input "${inputName}" references unknown node "${refNode}"`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (Array.isArray(conditional)) {
|
|
147
|
+
for (const condId of conditional) {
|
|
148
|
+
if (typeof condId === 'string' && !nodeIds.has(condId)) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Node "${nodeId}" input "${inputName}" has a conditional ref pointing to unknown node "${condId}"`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Recurse into INPUTS_ARRAY sub-inputs
|
|
158
|
+
if (Array.isArray(input.items)) {
|
|
159
|
+
for (const item of input.items) {
|
|
160
|
+
if (Array.isArray(item)) {
|
|
161
|
+
for (const subInput of item) {
|
|
162
|
+
validateInputRefs(nodeId, subInput as RawInput, nodeIds);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -60,8 +60,8 @@ export class Assets extends APIResource {
|
|
|
60
60
|
/**
|
|
61
61
|
* Delete multiple assets
|
|
62
62
|
*/
|
|
63
|
-
deleteMultiple(options?: RequestOptions): APIPromise<unknown> {
|
|
64
|
-
return this._client.delete('/assets', options);
|
|
63
|
+
deleteMultiple(body: AssetDeleteMultipleParams, options?: RequestOptions): APIPromise<unknown> {
|
|
64
|
+
return this._client.delete('/assets', { body, ...options });
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -10274,7 +10274,80 @@ export interface AssetListParams {
|
|
|
10274
10274
|
* img2img, txt2video, uploaded, uploaded-video, uploaded-audio, uploaded-3d,
|
|
10275
10275
|
* uploaded-avatar, upscale-video
|
|
10276
10276
|
*/
|
|
10277
|
-
types?:
|
|
10277
|
+
types?:
|
|
10278
|
+
| 'inference-txt2img'
|
|
10279
|
+
| 'inference-txt2img-ip-adapter'
|
|
10280
|
+
| 'inference-txt2img-texture'
|
|
10281
|
+
| 'inference-img2img'
|
|
10282
|
+
| 'inference-img2img-ip-adapter'
|
|
10283
|
+
| 'inference-img2img-texture'
|
|
10284
|
+
| 'inference-inpaint'
|
|
10285
|
+
| 'inference-inpaint-ip-adapter'
|
|
10286
|
+
| 'inference-reference'
|
|
10287
|
+
| 'inference-reference-texture'
|
|
10288
|
+
| 'inference-controlnet'
|
|
10289
|
+
| 'inference-controlnet-ip-adapter'
|
|
10290
|
+
| 'inference-controlnet-img2img'
|
|
10291
|
+
| 'inference-controlnet-reference'
|
|
10292
|
+
| 'inference-controlnet-inpaint'
|
|
10293
|
+
| 'inference-controlnet-inpaint-ip-adapter'
|
|
10294
|
+
| 'inference-controlnet-texture'
|
|
10295
|
+
| 'background-removal'
|
|
10296
|
+
| 'canvas'
|
|
10297
|
+
| 'canvas-export'
|
|
10298
|
+
| 'canvas-drawing'
|
|
10299
|
+
| 'detection'
|
|
10300
|
+
| 'patch'
|
|
10301
|
+
| 'pixelization'
|
|
10302
|
+
| 'upscale'
|
|
10303
|
+
| 'upscale-texture'
|
|
10304
|
+
| 'upscale-skybox'
|
|
10305
|
+
| 'vectorization'
|
|
10306
|
+
| 'segment'
|
|
10307
|
+
| 'segmentation-image'
|
|
10308
|
+
| 'segmentation-mask'
|
|
10309
|
+
| 'skybox-base-360'
|
|
10310
|
+
| 'skybox-hdri'
|
|
10311
|
+
| 'skybox-3d'
|
|
10312
|
+
| 'restyle'
|
|
10313
|
+
| 'reframe'
|
|
10314
|
+
| 'generative-fill'
|
|
10315
|
+
| 'texture'
|
|
10316
|
+
| 'texture-height'
|
|
10317
|
+
| 'texture-normal'
|
|
10318
|
+
| 'texture-smoothness'
|
|
10319
|
+
| 'texture-metallic'
|
|
10320
|
+
| 'texture-edge'
|
|
10321
|
+
| 'texture-ao'
|
|
10322
|
+
| 'texture-albedo'
|
|
10323
|
+
| 'image-prompt-editing'
|
|
10324
|
+
| 'unknown'
|
|
10325
|
+
| 'img23d'
|
|
10326
|
+
| 'txt23d'
|
|
10327
|
+
| 'video23d'
|
|
10328
|
+
| '3d23d'
|
|
10329
|
+
| '3d23d-texture'
|
|
10330
|
+
| '3d-texture'
|
|
10331
|
+
| '3d-texture-mtl'
|
|
10332
|
+
| '3d-texture-albedo'
|
|
10333
|
+
| '3d-texture-normal'
|
|
10334
|
+
| '3d-texture-roughness'
|
|
10335
|
+
| '3d-texture-metallic'
|
|
10336
|
+
| 'img2video'
|
|
10337
|
+
| 'txt2audio'
|
|
10338
|
+
| 'audio2audio'
|
|
10339
|
+
| 'voice-clone'
|
|
10340
|
+
| 'video2video'
|
|
10341
|
+
| 'video2img'
|
|
10342
|
+
| 'txt2img'
|
|
10343
|
+
| 'img2img'
|
|
10344
|
+
| 'txt2video'
|
|
10345
|
+
| 'uploaded'
|
|
10346
|
+
| 'uploaded-video'
|
|
10347
|
+
| 'uploaded-audio'
|
|
10348
|
+
| 'uploaded-3d'
|
|
10349
|
+
| 'uploaded-avatar'
|
|
10350
|
+
| 'upscale-video';
|
|
10278
10351
|
|
|
10279
10352
|
/**
|
|
10280
10353
|
* Filter results to only return assets updated after the specified ISO string date
|
|
@@ -10289,6 +10362,13 @@ export interface AssetListParams {
|
|
|
10289
10362
|
updatedBefore?: string;
|
|
10290
10363
|
}
|
|
10291
10364
|
|
|
10365
|
+
export interface AssetDeleteMultipleParams {
|
|
10366
|
+
/**
|
|
10367
|
+
* The ids of the assets to delete. (Max 100 at once)
|
|
10368
|
+
*/
|
|
10369
|
+
assetIds: Array<string>;
|
|
10370
|
+
}
|
|
10371
|
+
|
|
10292
10372
|
export interface AssetDuplicateParams {
|
|
10293
10373
|
/**
|
|
10294
10374
|
* Query param: If set to true, returns the original asset without transformation
|
|
@@ -10442,6 +10522,7 @@ export declare namespace Assets {
|
|
|
10442
10522
|
type AssetRetrieveParams as AssetRetrieveParams,
|
|
10443
10523
|
type AssetUpdateParams as AssetUpdateParams,
|
|
10444
10524
|
type AssetListParams as AssetListParams,
|
|
10525
|
+
type AssetDeleteMultipleParams as AssetDeleteMultipleParams,
|
|
10445
10526
|
type AssetDuplicateParams as AssetDuplicateParams,
|
|
10446
10527
|
type AssetGetBulkParams as AssetGetBulkParams,
|
|
10447
10528
|
type AssetListSnapshotsParams as AssetListSnapshotsParams,
|
|
@@ -16,8 +16,12 @@ export class Assets extends APIResource {
|
|
|
16
16
|
/**
|
|
17
17
|
* Remove assets from a specific collection
|
|
18
18
|
*/
|
|
19
|
-
remove(
|
|
20
|
-
|
|
19
|
+
remove(
|
|
20
|
+
collectionID: string,
|
|
21
|
+
body: AssetRemoveParams,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): APIPromise<AssetRemoveResponse> {
|
|
24
|
+
return this._client.delete(path`/collections/${collectionID}/assets`, { body, ...options });
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -142,10 +146,18 @@ export interface AssetAddParams {
|
|
|
142
146
|
assetIds: Array<string>;
|
|
143
147
|
}
|
|
144
148
|
|
|
149
|
+
export interface AssetRemoveParams {
|
|
150
|
+
/**
|
|
151
|
+
* The ids of the assets to remove from the collection. (Max 49 at once)
|
|
152
|
+
*/
|
|
153
|
+
assetIds: Array<string>;
|
|
154
|
+
}
|
|
155
|
+
|
|
145
156
|
export declare namespace Assets {
|
|
146
157
|
export {
|
|
147
158
|
type AssetAddResponse as AssetAddResponse,
|
|
148
159
|
type AssetRemoveResponse as AssetRemoveResponse,
|
|
149
160
|
type AssetAddParams as AssetAddParams,
|
|
161
|
+
type AssetRemoveParams as AssetRemoveParams,
|
|
150
162
|
};
|
|
151
163
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as AssetsAPI from './assets';
|
|
5
|
-
import { AssetAddParams, AssetAddResponse, AssetRemoveResponse, Assets } from './assets';
|
|
5
|
+
import { AssetAddParams, AssetAddResponse, AssetRemoveParams, AssetRemoveResponse, Assets } from './assets';
|
|
6
6
|
import * as ModelsAPI from './models';
|
|
7
|
-
import { ModelAddParams, ModelAddResponse, ModelRemoveResponse, Models } from './models';
|
|
7
|
+
import { ModelAddParams, ModelAddResponse, ModelRemoveParams, ModelRemoveResponse, Models } from './models';
|
|
8
8
|
import { APIPromise } from '../../core/api-promise';
|
|
9
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
10
10
|
import { path } from '../../internal/utils/path';
|
|
@@ -344,6 +344,7 @@ export declare namespace Collections {
|
|
|
344
344
|
type AssetAddResponse as AssetAddResponse,
|
|
345
345
|
type AssetRemoveResponse as AssetRemoveResponse,
|
|
346
346
|
type AssetAddParams as AssetAddParams,
|
|
347
|
+
type AssetRemoveParams as AssetRemoveParams,
|
|
347
348
|
};
|
|
348
349
|
|
|
349
350
|
export {
|
|
@@ -351,5 +352,6 @@ export declare namespace Collections {
|
|
|
351
352
|
type ModelAddResponse as ModelAddResponse,
|
|
352
353
|
type ModelRemoveResponse as ModelRemoveResponse,
|
|
353
354
|
type ModelAddParams as ModelAddParams,
|
|
355
|
+
type ModelRemoveParams as ModelRemoveParams,
|
|
354
356
|
};
|
|
355
357
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
Assets,
|
|
5
|
+
type AssetAddResponse,
|
|
6
|
+
type AssetRemoveResponse,
|
|
7
|
+
type AssetAddParams,
|
|
8
|
+
type AssetRemoveParams,
|
|
9
|
+
} from './assets';
|
|
4
10
|
export {
|
|
5
11
|
Collections,
|
|
6
12
|
type CollectionCreateResponse,
|
|
@@ -12,4 +18,10 @@ export {
|
|
|
12
18
|
type CollectionUpdateParams,
|
|
13
19
|
type CollectionListParams,
|
|
14
20
|
} from './collections';
|
|
15
|
-
export {
|
|
21
|
+
export {
|
|
22
|
+
Models,
|
|
23
|
+
type ModelAddResponse,
|
|
24
|
+
type ModelRemoveResponse,
|
|
25
|
+
type ModelAddParams,
|
|
26
|
+
type ModelRemoveParams,
|
|
27
|
+
} from './models';
|
|
@@ -16,8 +16,12 @@ export class Models extends APIResource {
|
|
|
16
16
|
/**
|
|
17
17
|
* Remove models from a specific collection
|
|
18
18
|
*/
|
|
19
|
-
remove(
|
|
20
|
-
|
|
19
|
+
remove(
|
|
20
|
+
collectionID: string,
|
|
21
|
+
body: ModelRemoveParams,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): APIPromise<ModelRemoveResponse> {
|
|
24
|
+
return this._client.delete(path`/collections/${collectionID}/models`, { body, ...options });
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -142,10 +146,18 @@ export interface ModelAddParams {
|
|
|
142
146
|
modelIds: Array<string>;
|
|
143
147
|
}
|
|
144
148
|
|
|
149
|
+
export interface ModelRemoveParams {
|
|
150
|
+
/**
|
|
151
|
+
* The ids of the models to remove from the collection. (Max 49 at once)
|
|
152
|
+
*/
|
|
153
|
+
modelIds: Array<string>;
|
|
154
|
+
}
|
|
155
|
+
|
|
145
156
|
export declare namespace Models {
|
|
146
157
|
export {
|
|
147
158
|
type ModelAddResponse as ModelAddResponse,
|
|
148
159
|
type ModelRemoveResponse as ModelRemoveResponse,
|
|
149
160
|
type ModelAddParams as ModelAddParams,
|
|
161
|
+
type ModelRemoveParams as ModelRemoveParams,
|
|
150
162
|
};
|
|
151
163
|
}
|