@scenario-labs/sdk 3.1.0 → 3.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 +119 -0
- package/client.d.mts +22 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +22 -7
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +42 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +42 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +79 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +75 -0
- package/core/pagination.mjs.map +1 -1
- package/internal/utils/values.d.mts +6 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +6 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +11 -0
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +10 -0
- package/internal/utils/values.mjs.map +1 -1
- package/lib/generate.js +7 -7
- package/lib/generate.js.map +1 -1
- package/lib/generate.mjs +7 -7
- package/lib/generate.mjs.map +1 -1
- package/lib/job.d.mts +1 -1
- package/lib/job.d.mts.map +1 -1
- package/lib/job.d.ts +1 -1
- package/lib/job.d.ts.map +1 -1
- package/lib/job.js +5 -6
- package/lib/job.js.map +1 -1
- package/lib/job.mjs +6 -7
- package/lib/job.mjs.map +1 -1
- package/lib/models.d.mts.map +1 -1
- package/lib/models.d.ts.map +1 -1
- package/lib/models.js +7 -5
- package/lib/models.js.map +1 -1
- package/lib/models.mjs +8 -6
- package/lib/models.mjs.map +1 -1
- package/lib/query.d.mts +21 -0
- package/lib/query.d.mts.map +1 -0
- package/lib/query.d.ts +21 -0
- package/lib/query.d.ts.map +1 -0
- package/lib/query.js +36 -0
- package/lib/query.js.map +1 -0
- package/lib/query.mjs +33 -0
- package/lib/query.mjs.map +1 -0
- package/lib/scenario.d.mts +3 -0
- package/lib/scenario.d.mts.map +1 -1
- package/lib/scenario.d.ts +3 -0
- package/lib/scenario.d.ts.map +1 -1
- package/lib/scenario.js +6 -0
- package/lib/scenario.js.map +1 -1
- package/lib/scenario.mjs +6 -0
- package/lib/scenario.mjs.map +1 -1
- package/lib/scope.d.mts +27 -7
- package/lib/scope.d.mts.map +1 -1
- package/lib/scope.d.ts +27 -7
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +40 -7
- package/lib/scope.js.map +1 -1
- package/lib/scope.mjs +37 -7
- package/lib/scope.mjs.map +1 -1
- package/lib/upload.d.mts +1 -1
- package/lib/upload.d.mts.map +1 -1
- package/lib/upload.d.ts +1 -1
- package/lib/upload.d.ts.map +1 -1
- package/lib/upload.js +6 -7
- package/lib/upload.js.map +1 -1
- package/lib/upload.mjs +7 -8
- package/lib/upload.mjs.map +1 -1
- package/lib/workflow.d.mts.map +1 -1
- package/lib/workflow.d.ts.map +1 -1
- package/lib/workflow.js +8 -6
- package/lib/workflow.js.map +1 -1
- package/lib/workflow.mjs +9 -7
- package/lib/workflow.mjs.map +1 -1
- package/lib/workflow_converter.d.mts +6 -0
- package/lib/workflow_converter.d.mts.map +1 -1
- package/lib/workflow_converter.d.ts +6 -0
- package/lib/workflow_converter.d.ts.map +1 -1
- package/lib/workflow_converter.js +99 -12
- package/lib/workflow_converter.js.map +1 -1
- package/lib/workflow_converter.mjs +99 -12
- package/lib/workflow_converter.mjs.map +1 -1
- package/lib/workflow_validator.d.mts +8 -1
- package/lib/workflow_validator.d.mts.map +1 -1
- package/lib/workflow_validator.d.ts +8 -1
- package/lib/workflow_validator.d.ts.map +1 -1
- package/lib/workflow_validator.js +154 -1
- package/lib/workflow_validator.js.map +1 -1
- package/lib/workflow_validator.mjs +154 -1
- package/lib/workflow_validator.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/assets/assets.d.mts +304 -122
- package/resources/assets/assets.d.mts.map +1 -1
- package/resources/assets/assets.d.ts +304 -122
- package/resources/assets/assets.d.ts.map +1 -1
- package/resources/assets/assets.js +34 -11
- package/resources/assets/assets.js.map +1 -1
- package/resources/assets/assets.mjs +34 -11
- package/resources/assets/assets.mjs.map +1 -1
- package/resources/assets/download.d.mts +39 -5
- package/resources/assets/download.d.mts.map +1 -1
- package/resources/assets/download.d.ts +39 -5
- package/resources/assets/download.d.ts.map +1 -1
- package/resources/assets/download.js +16 -4
- package/resources/assets/download.js.map +1 -1
- package/resources/assets/download.mjs +16 -4
- package/resources/assets/download.mjs.map +1 -1
- package/resources/collections/assets.d.mts.map +1 -1
- package/resources/collections/assets.d.ts.map +1 -1
- package/resources/collections/assets.js +3 -2
- package/resources/collections/assets.js.map +1 -1
- package/resources/collections/assets.mjs +3 -2
- package/resources/collections/assets.mjs.map +1 -1
- package/resources/collections/collections.d.mts.map +1 -1
- package/resources/collections/collections.d.ts.map +1 -1
- package/resources/collections/collections.js +20 -5
- package/resources/collections/collections.js.map +1 -1
- package/resources/collections/collections.mjs +20 -5
- package/resources/collections/collections.mjs.map +1 -1
- package/resources/collections/models.d.mts.map +1 -1
- package/resources/collections/models.d.ts.map +1 -1
- package/resources/collections/models.js +3 -2
- package/resources/collections/models.js.map +1 -1
- package/resources/collections/models.mjs +3 -2
- package/resources/collections/models.mjs.map +1 -1
- package/resources/generate.d.mts +2089 -437
- package/resources/generate.d.mts.map +1 -1
- package/resources/generate.d.ts +2089 -437
- package/resources/generate.d.ts.map +1 -1
- package/resources/generate.js +62 -9
- package/resources/generate.js.map +1 -1
- package/resources/generate.mjs +62 -9
- package/resources/generate.mjs.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/jobs.d.mts +253 -120
- package/resources/jobs.d.mts.map +1 -1
- package/resources/jobs.d.ts +253 -120
- package/resources/jobs.d.ts.map +1 -1
- package/resources/jobs.js +13 -5
- package/resources/jobs.js.map +1 -1
- package/resources/jobs.mjs +13 -5
- package/resources/jobs.mjs.map +1 -1
- package/resources/models/description.d.mts +18 -0
- package/resources/models/description.d.mts.map +1 -1
- package/resources/models/description.d.ts +18 -0
- package/resources/models/description.d.ts.map +1 -1
- package/resources/models/description.js +6 -2
- package/resources/models/description.js.map +1 -1
- package/resources/models/description.mjs +6 -2
- package/resources/models/description.mjs.map +1 -1
- package/resources/models/examples.d.mts +198 -92
- package/resources/models/examples.d.mts.map +1 -1
- package/resources/models/examples.d.ts +198 -92
- package/resources/models/examples.d.ts.map +1 -1
- package/resources/models/examples.js +6 -2
- package/resources/models/examples.js.map +1 -1
- package/resources/models/examples.mjs +6 -2
- package/resources/models/examples.mjs.map +1 -1
- package/resources/models/index.d.mts +3 -0
- package/resources/models/index.d.mts.map +1 -1
- package/resources/models/index.d.ts +3 -0
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js +7 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs +3 -0
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.mts +346 -112
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +346 -112
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +57 -12
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +57 -12
- package/resources/models/models.mjs.map +1 -1
- package/resources/models/presets.d.mts +1016 -0
- package/resources/models/presets.d.mts.map +1 -0
- package/resources/models/presets.d.ts +1016 -0
- package/resources/models/presets.d.ts.map +1 -0
- package/resources/models/presets.js +52 -0
- package/resources/models/presets.js.map +1 -0
- package/resources/models/presets.mjs +48 -0
- package/resources/models/presets.mjs.map +1 -0
- package/resources/models/prompt-guide.d.mts +64 -0
- package/resources/models/prompt-guide.d.mts.map +1 -0
- package/resources/models/prompt-guide.d.ts +64 -0
- package/resources/models/prompt-guide.d.ts.map +1 -0
- package/resources/models/prompt-guide.js +31 -0
- package/resources/models/prompt-guide.js.map +1 -0
- package/resources/models/prompt-guide.mjs +27 -0
- package/resources/models/prompt-guide.mjs.map +1 -0
- package/resources/models/scores.d.mts +278 -0
- package/resources/models/scores.d.mts.map +1 -0
- package/resources/models/scores.d.ts +278 -0
- package/resources/models/scores.d.ts.map +1 -0
- package/resources/models/scores.js +29 -0
- package/resources/models/scores.js.map +1 -0
- package/resources/models/scores.mjs +25 -0
- package/resources/models/scores.mjs.map +1 -0
- package/resources/models/train.d.mts +186 -83
- package/resources/models/train.d.mts.map +1 -1
- package/resources/models/train.d.ts +186 -83
- package/resources/models/train.d.ts.map +1 -1
- package/resources/models/train.js +4 -3
- package/resources/models/train.js.map +1 -1
- package/resources/models/train.mjs +4 -3
- package/resources/models/train.mjs.map +1 -1
- package/resources/models/training-images.d.mts.map +1 -1
- package/resources/models/training-images.d.ts.map +1 -1
- package/resources/models/training-images.js +5 -4
- package/resources/models/training-images.js.map +1 -1
- package/resources/models/training-images.mjs +5 -4
- package/resources/models/training-images.mjs.map +1 -1
- package/resources/projects/api-keys.d.mts +54 -0
- package/resources/projects/api-keys.d.mts.map +1 -0
- package/resources/projects/api-keys.d.ts +54 -0
- package/resources/projects/api-keys.d.ts.map +1 -0
- package/resources/projects/api-keys.js +23 -0
- package/resources/projects/api-keys.js.map +1 -0
- package/resources/projects/api-keys.mjs +19 -0
- package/resources/projects/api-keys.mjs.map +1 -0
- package/resources/projects/brief.d.mts +149 -0
- package/resources/projects/brief.d.mts.map +1 -0
- package/resources/projects/brief.d.ts +149 -0
- package/resources/projects/brief.d.ts.map +1 -0
- package/resources/projects/brief.js +28 -0
- package/resources/projects/brief.js.map +1 -0
- package/resources/projects/brief.mjs +24 -0
- package/resources/projects/brief.mjs.map +1 -0
- package/resources/projects/index.d.mts +9 -0
- package/resources/projects/index.d.mts.map +1 -0
- package/resources/projects/index.d.ts +9 -0
- package/resources/projects/index.d.ts.map +1 -0
- package/resources/projects/index.js +21 -0
- package/resources/projects/index.js.map +1 -0
- package/resources/projects/index.mjs +10 -0
- package/resources/projects/index.mjs.map +1 -0
- package/resources/projects/instructions.d.mts +102 -0
- package/resources/projects/instructions.d.mts.map +1 -0
- package/resources/projects/instructions.d.ts +102 -0
- package/resources/projects/instructions.d.ts.map +1 -0
- package/resources/projects/instructions.js +24 -0
- package/resources/projects/instructions.js.map +1 -0
- package/resources/projects/instructions.mjs +20 -0
- package/resources/projects/instructions.mjs.map +1 -0
- package/resources/projects/members.d.mts +788 -0
- package/resources/projects/members.d.mts.map +1 -0
- package/resources/projects/members.d.ts +788 -0
- package/resources/projects/members.d.ts.map +1 -0
- package/resources/projects/members.js +30 -0
- package/resources/projects/members.js.map +1 -0
- package/resources/projects/members.mjs +26 -0
- package/resources/projects/members.mjs.map +1 -0
- package/resources/projects/memory.d.mts +102 -0
- package/resources/projects/memory.d.mts.map +1 -0
- package/resources/projects/memory.d.ts +102 -0
- package/resources/projects/memory.d.ts.map +1 -0
- package/resources/projects/memory.js +24 -0
- package/resources/projects/memory.js.map +1 -0
- package/resources/projects/memory.mjs +20 -0
- package/resources/projects/memory.mjs.map +1 -0
- package/resources/projects/projects.d.mts +1129 -0
- package/resources/projects/projects.d.mts.map +1 -0
- package/resources/projects/projects.d.ts +1129 -0
- package/resources/projects/projects.d.ts.map +1 -0
- package/resources/projects/projects.js +79 -0
- package/resources/projects/projects.js.map +1 -0
- package/resources/projects/projects.mjs +74 -0
- package/resources/projects/projects.mjs.map +1 -0
- package/resources/projects/watermark.d.mts +459 -0
- package/resources/projects/watermark.d.mts.map +1 -0
- package/resources/projects/watermark.d.ts +459 -0
- package/resources/projects/watermark.d.ts.map +1 -0
- package/resources/projects/watermark.js +46 -0
- package/resources/projects/watermark.js.map +1 -0
- package/resources/projects/watermark.mjs +42 -0
- package/resources/projects/watermark.mjs.map +1 -0
- package/resources/projects/webhook-endpoints/events.d.mts +87 -0
- package/resources/projects/webhook-endpoints/events.d.mts.map +1 -0
- package/resources/projects/webhook-endpoints/events.d.ts +87 -0
- package/resources/projects/webhook-endpoints/events.d.ts.map +1 -0
- package/resources/projects/webhook-endpoints/events.js +28 -0
- package/resources/projects/webhook-endpoints/events.js.map +1 -0
- package/resources/projects/webhook-endpoints/events.mjs +24 -0
- package/resources/projects/webhook-endpoints/events.mjs.map +1 -0
- package/resources/projects/webhook-endpoints/index.d.mts +3 -0
- package/resources/projects/webhook-endpoints/index.d.mts.map +1 -0
- package/resources/projects/webhook-endpoints/index.d.ts +3 -0
- package/resources/projects/webhook-endpoints/index.d.ts.map +1 -0
- package/resources/projects/webhook-endpoints/index.js +9 -0
- package/resources/projects/webhook-endpoints/index.js.map +1 -0
- package/resources/projects/webhook-endpoints/index.mjs +4 -0
- package/resources/projects/webhook-endpoints/index.mjs.map +1 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.d.mts +249 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.d.mts.map +1 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.d.ts +249 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.d.ts.map +1 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.js +44 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.js.map +1 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.mjs +39 -0
- package/resources/projects/webhook-endpoints/webhook-endpoints.mjs.map +1 -0
- package/resources/projects/webhook-endpoints.d.mts +2 -0
- package/resources/projects/webhook-endpoints.d.mts.map +1 -0
- package/resources/projects/webhook-endpoints.d.ts +2 -0
- package/resources/projects/webhook-endpoints.d.ts.map +1 -0
- package/resources/projects/webhook-endpoints.js +6 -0
- package/resources/projects/webhook-endpoints.js.map +1 -0
- package/resources/projects/webhook-endpoints.mjs +3 -0
- package/resources/projects/webhook-endpoints.mjs.map +1 -0
- package/resources/projects.d.mts +2 -0
- package/resources/projects.d.mts.map +1 -0
- package/resources/projects.d.ts +2 -0
- package/resources/projects.d.ts.map +1 -0
- package/resources/projects.js +6 -0
- package/resources/projects.js.map +1 -0
- package/resources/projects.mjs +3 -0
- package/resources/projects.mjs.map +1 -0
- package/resources/recommendations.d.mts +1107 -0
- package/resources/recommendations.d.mts.map +1 -0
- package/resources/recommendations.d.ts +1107 -0
- package/resources/recommendations.d.ts.map +1 -0
- package/resources/recommendations.js +17 -0
- package/resources/recommendations.js.map +1 -0
- package/resources/recommendations.mjs +13 -0
- package/resources/recommendations.mjs.map +1 -0
- package/resources/search.d.mts +168 -5
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +168 -5
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +17 -3
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +17 -3
- package/resources/search.mjs.map +1 -1
- package/resources/tags.d.mts.map +1 -1
- package/resources/tags.d.ts.map +1 -1
- package/resources/tags.js +5 -1
- package/resources/tags.js.map +1 -1
- package/resources/tags.mjs +5 -1
- package/resources/tags.mjs.map +1 -1
- package/resources/teams/brief.d.mts +149 -0
- package/resources/teams/brief.d.mts.map +1 -0
- package/resources/teams/brief.d.ts +149 -0
- package/resources/teams/brief.d.ts.map +1 -0
- package/resources/teams/brief.js +28 -0
- package/resources/teams/brief.js.map +1 -0
- package/resources/teams/brief.mjs +24 -0
- package/resources/teams/brief.mjs.map +1 -0
- package/resources/teams/index.d.mts +7 -0
- package/resources/teams/index.d.mts.map +1 -0
- package/resources/teams/index.d.ts +7 -0
- package/resources/teams/index.d.ts.map +1 -0
- package/resources/teams/index.js +17 -0
- package/resources/teams/index.js.map +1 -0
- package/resources/teams/index.mjs +8 -0
- package/resources/teams/index.mjs.map +1 -0
- package/resources/teams/ip-filters.d.mts +115 -0
- package/resources/teams/ip-filters.d.mts.map +1 -0
- package/resources/teams/ip-filters.d.ts +115 -0
- package/resources/teams/ip-filters.d.ts.map +1 -0
- package/resources/teams/ip-filters.js +45 -0
- package/resources/teams/ip-filters.js.map +1 -0
- package/resources/teams/ip-filters.mjs +41 -0
- package/resources/teams/ip-filters.mjs.map +1 -0
- package/resources/teams/members.d.mts +204 -0
- package/resources/teams/members.d.mts.map +1 -0
- package/resources/teams/members.d.ts +204 -0
- package/resources/teams/members.d.ts.map +1 -0
- package/resources/teams/members.js +30 -0
- package/resources/teams/members.js.map +1 -0
- package/resources/teams/members.mjs +26 -0
- package/resources/teams/members.mjs.map +1 -0
- package/resources/teams/teams.d.mts +878 -0
- package/resources/teams/teams.d.mts.map +1 -0
- package/resources/teams/teams.d.ts +878 -0
- package/resources/teams/teams.d.ts.map +1 -0
- package/resources/teams/teams.js +66 -0
- package/resources/teams/teams.js.map +1 -0
- package/resources/teams/teams.mjs +61 -0
- package/resources/teams/teams.mjs.map +1 -0
- package/resources/teams/watermark.d.mts +459 -0
- package/resources/teams/watermark.d.mts.map +1 -0
- package/resources/teams/watermark.d.ts +459 -0
- package/resources/teams/watermark.d.ts.map +1 -0
- package/resources/teams/watermark.js +46 -0
- package/resources/teams/watermark.js.map +1 -0
- package/resources/teams/watermark.mjs +42 -0
- package/resources/teams/watermark.mjs.map +1 -0
- package/resources/teams/webhook-endpoints/events.d.mts +87 -0
- package/resources/teams/webhook-endpoints/events.d.mts.map +1 -0
- package/resources/teams/webhook-endpoints/events.d.ts +87 -0
- package/resources/teams/webhook-endpoints/events.d.ts.map +1 -0
- package/resources/teams/webhook-endpoints/events.js +28 -0
- package/resources/teams/webhook-endpoints/events.js.map +1 -0
- package/resources/teams/webhook-endpoints/events.mjs +24 -0
- package/resources/teams/webhook-endpoints/events.mjs.map +1 -0
- package/resources/teams/webhook-endpoints/index.d.mts +3 -0
- package/resources/teams/webhook-endpoints/index.d.mts.map +1 -0
- package/resources/teams/webhook-endpoints/index.d.ts +3 -0
- package/resources/teams/webhook-endpoints/index.d.ts.map +1 -0
- package/resources/teams/webhook-endpoints/index.js +9 -0
- package/resources/teams/webhook-endpoints/index.js.map +1 -0
- package/resources/teams/webhook-endpoints/index.mjs +4 -0
- package/resources/teams/webhook-endpoints/index.mjs.map +1 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.d.mts +250 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.d.mts.map +1 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.d.ts +250 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.d.ts.map +1 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.js +45 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.js.map +1 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.mjs +40 -0
- package/resources/teams/webhook-endpoints/webhook-endpoints.mjs.map +1 -0
- package/resources/teams/webhook-endpoints.d.mts +2 -0
- package/resources/teams/webhook-endpoints.d.mts.map +1 -0
- package/resources/teams/webhook-endpoints.d.ts +2 -0
- package/resources/teams/webhook-endpoints.d.ts.map +1 -0
- package/resources/teams/webhook-endpoints.js +6 -0
- package/resources/teams/webhook-endpoints.js.map +1 -0
- package/resources/teams/webhook-endpoints.mjs +3 -0
- package/resources/teams/webhook-endpoints.mjs.map +1 -0
- package/resources/teams.d.mts +2 -0
- package/resources/teams.d.mts.map +1 -0
- package/resources/teams.d.ts +2 -0
- package/resources/teams.d.ts.map +1 -0
- package/resources/teams.js +6 -0
- package/resources/teams.js.map +1 -0
- package/resources/teams.mjs +3 -0
- package/resources/teams.mjs.map +1 -0
- package/resources/uploads.d.mts +13 -3
- package/resources/uploads.d.mts.map +1 -1
- package/resources/uploads.d.ts +13 -3
- package/resources/uploads.d.ts.map +1 -1
- package/resources/uploads.js +16 -4
- package/resources/uploads.js.map +1 -1
- package/resources/uploads.mjs +16 -4
- package/resources/uploads.mjs.map +1 -1
- package/resources/usages.d.mts +85 -51
- package/resources/usages.d.mts.map +1 -1
- package/resources/usages.d.ts +85 -51
- package/resources/usages.d.ts.map +1 -1
- package/resources/usages.js +2 -1
- package/resources/usages.js.map +1 -1
- package/resources/usages.mjs +2 -1
- package/resources/usages.mjs.map +1 -1
- package/resources/workflows.d.mts +1639 -385
- package/resources/workflows.d.mts.map +1 -1
- package/resources/workflows.d.ts +1639 -385
- package/resources/workflows.d.ts.map +1 -1
- package/resources/workflows.js +39 -8
- package/resources/workflows.js.map +1 -1
- package/resources/workflows.mjs +39 -8
- package/resources/workflows.mjs.map +1 -1
- package/src/client.ts +107 -0
- package/src/core/pagination.ts +144 -0
- package/src/internal/utils/values.ts +10 -0
- package/src/lib/generate.ts +7 -7
- package/src/lib/job.ts +9 -7
- package/src/lib/models.ts +8 -6
- package/src/lib/query.ts +42 -0
- package/src/lib/scenario.ts +8 -0
- package/src/lib/scope.ts +42 -7
- package/src/lib/upload.ts +10 -8
- package/src/lib/workflow.ts +9 -7
- package/src/lib/workflow_converter.ts +126 -12
- package/src/lib/workflow_validator.ts +183 -1
- package/src/resources/assets/assets.ts +766 -132
- package/src/resources/assets/download.ts +61 -9
- package/src/resources/collections/assets.ts +3 -2
- package/src/resources/collections/collections.ts +20 -5
- package/src/resources/collections/models.ts +3 -2
- package/src/resources/generate.ts +2935 -512
- package/src/resources/index.ts +37 -0
- package/src/resources/jobs.ts +277 -121
- package/src/resources/models/description.ts +126 -2
- package/src/resources/models/examples.ts +318 -92
- package/src/resources/models/index.ts +25 -0
- package/src/resources/models/models.ts +463 -124
- package/src/resources/models/presets.ts +1335 -0
- package/src/resources/models/prompt-guide.ts +102 -0
- package/src/resources/models/scores.ts +383 -0
- package/src/resources/models/train.ts +202 -87
- package/src/resources/models/training-images.ts +5 -4
- package/src/resources/projects/api-keys.ts +86 -0
- package/src/resources/projects/brief.ts +197 -0
- package/src/resources/projects/index.ts +71 -0
- package/src/resources/projects/instructions.ts +134 -0
- package/src/resources/projects/members.ts +958 -0
- package/src/resources/projects/memory.ts +134 -0
- package/src/resources/projects/projects.ts +1478 -0
- package/src/resources/projects/watermark.ts +590 -0
- package/src/resources/projects/webhook-endpoints/events.ts +179 -0
- package/src/resources/projects/webhook-endpoints/index.ts +19 -0
- package/src/resources/projects/webhook-endpoints/webhook-endpoints.ts +452 -0
- package/src/resources/projects/webhook-endpoints.ts +3 -0
- package/src/resources/projects.ts +3 -0
- package/src/resources/recommendations.ts +1502 -0
- package/src/resources/search.ts +220 -8
- package/src/resources/tags.ts +5 -1
- package/src/resources/teams/brief.ts +193 -0
- package/src/resources/teams/index.ts +62 -0
- package/src/resources/teams/ip-filters.ts +177 -0
- package/src/resources/teams/members.ts +282 -0
- package/src/resources/teams/teams.ts +1255 -0
- package/src/resources/teams/watermark.ts +590 -0
- package/src/resources/teams/webhook-endpoints/events.ts +179 -0
- package/src/resources/teams/webhook-endpoints/index.ts +19 -0
- package/src/resources/teams/webhook-endpoints/webhook-endpoints.ts +453 -0
- package/src/resources/teams/webhook-endpoints.ts +3 -0
- package/src/resources/teams.ts +3 -0
- package/src/resources/uploads.ts +30 -7
- package/src/resources/usages.ts +98 -50
- package/src/resources/workflows.ts +2053 -434
- 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
package/src/lib/query.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FinalRequestOptions } from '../internal/request-options';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Keep unset query values from erasing the client's `defaultQuery`.
|
|
5
|
+
*
|
|
6
|
+
* Generated methods build their typed query with every key, set or not:
|
|
7
|
+
* `{ dryRun, projectId, ...options?.query }` yields `projectId: undefined` when
|
|
8
|
+
* the caller did not pass one. `buildURL` then spreads that object over the
|
|
9
|
+
* client's `defaultQuery`, so the unset key erases the client-level `projectId`
|
|
10
|
+
* and the request goes out unscoped — the API then falls back to the team's
|
|
11
|
+
* default project.
|
|
12
|
+
*
|
|
13
|
+
* So, on a new object (the query may be the caller's own params object):
|
|
14
|
+
* - `undefined` is dropped everywhere (the query serializer skips it anyway);
|
|
15
|
+
* - `null` and `''` are dropped only for keys `defaultQuery` provides, so the
|
|
16
|
+
* default applies. Elsewhere they keep their usual serialization (`key=`).
|
|
17
|
+
*
|
|
18
|
+
* Called from the enhanced client's `prepareOptions`, i.e. on every request
|
|
19
|
+
* (retries included — it is idempotent).
|
|
20
|
+
*/
|
|
21
|
+
export function normalizeQuery(
|
|
22
|
+
options: FinalRequestOptions,
|
|
23
|
+
defaultQuery: Record<string, unknown> | undefined,
|
|
24
|
+
): void {
|
|
25
|
+
const query = options.query;
|
|
26
|
+
// Only plain objects: rebuilding a URLSearchParams, a Map or a class instance
|
|
27
|
+
// from its own enumerable entries would silently empty it.
|
|
28
|
+
if (typeof query !== 'object' || query === null) return;
|
|
29
|
+
const proto = Object.getPrototypeOf(query);
|
|
30
|
+
if (proto !== Object.prototype && proto !== null) return;
|
|
31
|
+
options.query = Object.fromEntries(
|
|
32
|
+
Object.entries(query).filter(
|
|
33
|
+
([key, value]) =>
|
|
34
|
+
value !== undefined &&
|
|
35
|
+
!(
|
|
36
|
+
defaultQuery &&
|
|
37
|
+
Object.prototype.hasOwnProperty.call(defaultQuery, key) &&
|
|
38
|
+
(value === null || value === '')
|
|
39
|
+
),
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
}
|
package/src/lib/scenario.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Scenario as BaseScenario, type ClientOptions as BaseClientOptions } from '../client';
|
|
2
|
+
import type { FinalRequestOptions } from '../internal/request-options';
|
|
2
3
|
import { EnhancedAssets } from './asset';
|
|
3
4
|
import { EnhancedGenerate } from './generate';
|
|
4
5
|
import { EnhancedJobs } from './job';
|
|
5
6
|
import { EnhancedModels } from './models';
|
|
7
|
+
import { normalizeQuery } from './query';
|
|
6
8
|
import { EnhancedUploads } from './upload';
|
|
7
9
|
import { EnhancedWorkflows } from './workflow';
|
|
8
10
|
|
|
@@ -82,6 +84,12 @@ export class Scenario extends BaseScenario {
|
|
|
82
84
|
} as BaseClientOptions);
|
|
83
85
|
this.projectId = projectId ?? null;
|
|
84
86
|
}
|
|
87
|
+
|
|
88
|
+
/** Keep unset query values from erasing the client's `defaultQuery` (see `./query`). */
|
|
89
|
+
protected override async prepareOptions(options: FinalRequestOptions): Promise<void> {
|
|
90
|
+
await super.prepareOptions(options);
|
|
91
|
+
normalizeQuery(options, this.defaultQuery());
|
|
92
|
+
}
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
function stripKey<T extends object>(obj: T | undefined, key: string): Partial<T> | undefined {
|
package/src/lib/scope.ts
CHANGED
|
@@ -26,15 +26,50 @@ export function extractScope(options?: RequestOptions): Scope | undefined {
|
|
|
26
26
|
return { projectId };
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/** Read the typed `projectId` param of a call (`params`, `query` or `body`). Returns `undefined` if absent. */
|
|
30
|
+
export function paramsProjectId(params: unknown): string | undefined {
|
|
31
|
+
if (!params || typeof params !== 'object') return undefined;
|
|
32
|
+
const projectId = (params as Record<string, unknown>)['projectId'];
|
|
33
|
+
return typeof projectId === 'string' && projectId ? projectId : undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The project a request was actually sent to, read from its final options —
|
|
38
|
+
* the ones `APIResponseProps.options` carries, after the generated method
|
|
39
|
+
* merged typed params with `options.query` and `prepareOptions` normalized
|
|
40
|
+
* the query. Its `projectId` if it holds one, else the client default that
|
|
41
|
+
* `buildURL` merges in; `undefined` with neither (e.g. API-key auth with
|
|
42
|
+
* implicit scope).
|
|
43
|
+
*
|
|
44
|
+
* Reading the request instead of predicting it from params and options keeps
|
|
45
|
+
* this right whatever the generated merge does. Capture it on enhanced
|
|
46
|
+
* entities so that follow-up helper calls (`.wait()`, `entity.run()`, ...)
|
|
47
|
+
* stay in the project the originating request went to.
|
|
48
|
+
*/
|
|
49
|
+
export function sentScope(
|
|
50
|
+
finalOptions: RequestOptions,
|
|
51
|
+
clientDefault: string | null | undefined,
|
|
52
|
+
): Scope | undefined {
|
|
53
|
+
const projectId = extractScope(finalOptions)?.projectId ?? clientDefault;
|
|
54
|
+
return projectId ? { projectId } : undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Whether a call names its project itself, with a non-empty `projectId` in
|
|
59
|
+
* its typed params or in `options.query`. Only then must a scope captured
|
|
60
|
+
* earlier not be replayed over it; an unset value (`undefined`, `null`, `''`,
|
|
61
|
+
* e.g. from an optional spread) leaves the captured scope in charge.
|
|
62
|
+
*/
|
|
63
|
+
export function hasExplicitProjectId(options: RequestOptions | undefined, params: unknown): boolean {
|
|
64
|
+
return paramsProjectId(params) !== undefined || extractScope(options) !== undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
29
67
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* 2. Otherwise, fall back to the client's default `projectId`.
|
|
33
|
-
* 3. If neither is set (e.g. API-key auth with implicit scope), return `undefined`.
|
|
68
|
+
* Two-tier resolution (`options.query.projectId`, else a fallback) that
|
|
69
|
+
* ignores typed params.
|
|
34
70
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* scope and stay in sync with the call that produced them.
|
|
71
|
+
* @deprecated Predicts the scope instead of reading it from the request.
|
|
72
|
+
* Use {@link sentScope} on the final request options.
|
|
38
73
|
*/
|
|
39
74
|
export function effectiveScope(
|
|
40
75
|
options: RequestOptions | undefined,
|
package/src/lib/upload.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '../resources/uploads';
|
|
13
13
|
import type { AssetRetrieveResponse } from '../resources/assets/assets';
|
|
14
14
|
import type { ModelRetrieveResponse } from '../resources/models/models';
|
|
15
|
-
import { type Scope, clientProjectId,
|
|
15
|
+
import { type Scope, clientProjectId, sentScope, withScope } from './scope';
|
|
16
16
|
|
|
17
17
|
type UploadKind = NonNullable<UploadCreateParams['kind']>;
|
|
18
18
|
|
|
@@ -149,12 +149,14 @@ export type WithUpload<T extends { upload: unknown }> = T & { upload: UploadMeth
|
|
|
149
149
|
export function enhanceUpload<T extends { upload: { id: string; status: string } }>(
|
|
150
150
|
client: Scenario,
|
|
151
151
|
promise: APIPromise<T>,
|
|
152
|
-
options?: RequestOptions,
|
|
153
152
|
): APIPromise<WithUpload<T>> {
|
|
154
|
-
|
|
155
|
-
return promise._thenUnwrap((data) => ({
|
|
153
|
+
return promise._thenUnwrap((data, props) => ({
|
|
156
154
|
...data,
|
|
157
|
-
upload: Upload.from(
|
|
155
|
+
upload: Upload.from(
|
|
156
|
+
client,
|
|
157
|
+
data.upload as UploadRetrieveResponse['upload'],
|
|
158
|
+
sentScope(props.options, clientProjectId(client)),
|
|
159
|
+
),
|
|
158
160
|
}));
|
|
159
161
|
}
|
|
160
162
|
|
|
@@ -170,7 +172,7 @@ export class EnhancedUploads extends Uploads {
|
|
|
170
172
|
body: UploadCreateParams,
|
|
171
173
|
options?: RequestOptions,
|
|
172
174
|
): APIPromise<WithUpload<UploadCreateResponse>> {
|
|
173
|
-
return enhanceUpload(this._client, super.create(body, options)
|
|
175
|
+
return enhanceUpload(this._client, super.create(body, options));
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
override retrieve(
|
|
@@ -178,7 +180,7 @@ export class EnhancedUploads extends Uploads {
|
|
|
178
180
|
query: UploadRetrieveParams | null | undefined = {},
|
|
179
181
|
options?: RequestOptions,
|
|
180
182
|
): APIPromise<WithUpload<UploadRetrieveResponse>> {
|
|
181
|
-
return enhanceUpload(this._client, super.retrieve(uploadID, query, options)
|
|
183
|
+
return enhanceUpload(this._client, super.retrieve(uploadID, query, options));
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
override triggerAction(
|
|
@@ -186,7 +188,7 @@ export class EnhancedUploads extends Uploads {
|
|
|
186
188
|
body: UploadTriggerActionParams,
|
|
187
189
|
options?: RequestOptions,
|
|
188
190
|
): APIPromise<WithUpload<UploadTriggerActionResponse>> {
|
|
189
|
-
return enhanceUpload(this._client, super.triggerAction(uploadID, body, options)
|
|
191
|
+
return enhanceUpload(this._client, super.triggerAction(uploadID, body, options));
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
/**
|
package/src/lib/workflow.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type WorkflowRunResponse,
|
|
11
11
|
} from '../resources/workflows';
|
|
12
12
|
import { type WithJob, enhanceJob } from './job';
|
|
13
|
-
import { type Scope,
|
|
13
|
+
import { type Scope, hasExplicitProjectId, sentScope, withScope } from './scope';
|
|
14
14
|
import { validateWorkflowFlow } from './workflow_validator';
|
|
15
15
|
// Type-only import to break the circular `scenario.ts` ↔ `workflow.ts` graph at runtime.
|
|
16
16
|
import type { Scenario } from './scenario';
|
|
@@ -72,7 +72,10 @@ export class WorkflowEntity {
|
|
|
72
72
|
params: WorkflowRunParams,
|
|
73
73
|
options?: RequestOptions,
|
|
74
74
|
): APIPromise<WithJob<WorkflowRunResponse>> {
|
|
75
|
-
|
|
75
|
+
// The captured scope is only a fallback: an explicit `params.projectId` or
|
|
76
|
+
// `options.query.projectId` on this call wins.
|
|
77
|
+
const scope = hasExplicitProjectId(options, params) ? undefined : this._scope;
|
|
78
|
+
return this._client.workflows.run(this.id, params, withScope(scope, options));
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
/** @internal Create a WorkflowEntity from raw workflow data, optionally remembering the originating scope. */
|
|
@@ -109,10 +112,9 @@ export class EnhancedWorkflows extends Workflows {
|
|
|
109
112
|
options?: RequestOptions,
|
|
110
113
|
): APIPromise<EnhancedWorkflowRetrieveResponse> {
|
|
111
114
|
const client = this._client as Scenario;
|
|
112
|
-
|
|
113
|
-
return super.retrieve(workflowID, query, options)._thenUnwrap((data) => ({
|
|
115
|
+
return super.retrieve(workflowID, query, options)._thenUnwrap((data, props) => ({
|
|
114
116
|
...data,
|
|
115
|
-
workflow: WorkflowEntity.from(client, data.workflow,
|
|
117
|
+
workflow: WorkflowEntity.from(client, data.workflow, sentScope(props.options, client.projectId)),
|
|
116
118
|
}));
|
|
117
119
|
}
|
|
118
120
|
|
|
@@ -122,7 +124,7 @@ export class EnhancedWorkflows extends Workflows {
|
|
|
122
124
|
params: WorkflowRunParams,
|
|
123
125
|
options?: RequestOptions,
|
|
124
126
|
): APIPromise<WithJob<WorkflowRunResponse>> {
|
|
125
|
-
return enhanceJob(this._client, super.run(workflowID, params, options)
|
|
127
|
+
return enhanceJob(this._client, super.run(workflowID, params, options));
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
/** Approve a user approval node. Returns an enhanced response where `job` has `.wait()`. */
|
|
@@ -131,6 +133,6 @@ export class EnhancedWorkflows extends Workflows {
|
|
|
131
133
|
body: WorkflowApproveUserParams,
|
|
132
134
|
options?: RequestOptions,
|
|
133
135
|
): APIPromise<WithJob<WorkflowUserApprovalResponse>> {
|
|
134
|
-
return enhanceJob(this._client, super.userApproval(workflowID, body, options)
|
|
136
|
+
return enhanceJob(this._client, super.userApproval(workflowID, body, options));
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -55,9 +55,11 @@ export type WorkflowEditorNode =
|
|
|
55
55
|
data: NodeCommonData & {
|
|
56
56
|
from?: number | string;
|
|
57
57
|
count?: number | string;
|
|
58
|
+
mode?: 'default' | 'randomize' | 'choose';
|
|
58
59
|
isRandomize?: boolean;
|
|
59
60
|
randomSeed?: string;
|
|
60
61
|
isSeedLocked?: boolean;
|
|
62
|
+
message?: string;
|
|
61
63
|
value?: string;
|
|
62
64
|
};
|
|
63
65
|
}
|
|
@@ -134,6 +136,11 @@ type ModelInputNodeData = NodeCommonData & {
|
|
|
134
136
|
|
|
135
137
|
const RUNNABLE_TYPES = new Set(['model', 'llm', 'forEach', 'forEachEnd']);
|
|
136
138
|
const MODEL_CUSTOM_INPUT_HANDLE_SUFFIX = '-source-custom';
|
|
139
|
+
const USER_SELECTION_MIN_SELECT = 1;
|
|
140
|
+
const USER_SELECTION_MAX_SELECT = 100;
|
|
141
|
+
const DEFAULT_SLICE_ASSETS_CHOOSE_MESSAGE = 'Select the items to continue';
|
|
142
|
+
|
|
143
|
+
type SliceAssetsMode = 'default' | 'randomize' | 'choose';
|
|
137
144
|
|
|
138
145
|
export const ASPECT_RATIO_PRESETS = [
|
|
139
146
|
'21:9',
|
|
@@ -176,6 +183,10 @@ export type WorkflowEditorFlowInput = {
|
|
|
176
183
|
ref?: WorkflowEditorFlowInputRef | undefined;
|
|
177
184
|
value?: string | number | string[] | boolean | undefined;
|
|
178
185
|
items?: WorkflowEditorFlowInput[][] | undefined;
|
|
186
|
+
/** Inclusive minimum for number/array inputs. For user-selection, items the user must pick. */
|
|
187
|
+
min?: number | undefined;
|
|
188
|
+
/** Inclusive maximum for number/array inputs. For user-selection, items the user may pick. */
|
|
189
|
+
max?: number | undefined;
|
|
179
190
|
};
|
|
180
191
|
|
|
181
192
|
export type WorkflowEditorFlowItem = {
|
|
@@ -215,12 +226,17 @@ function nodeIdToFlowId(nodeId: string): string {
|
|
|
215
226
|
return nodeId.replace(/\s/g, '');
|
|
216
227
|
}
|
|
217
228
|
|
|
229
|
+
/** CEL identifiers cannot contain hyphens (`loop2-end` parses as subtraction). */
|
|
230
|
+
function toCelIdentifier(name: string): string {
|
|
231
|
+
return name.replaceAll('-', '_');
|
|
232
|
+
}
|
|
233
|
+
|
|
218
234
|
function escapeCELString(value: string): string {
|
|
219
235
|
return value.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\n/g, '\\n');
|
|
220
236
|
}
|
|
221
237
|
|
|
222
238
|
function formatTextAsCELString(text: string): string {
|
|
223
|
-
return `'${text
|
|
239
|
+
return `'${escapeCELString(text)}'`;
|
|
224
240
|
}
|
|
225
241
|
|
|
226
242
|
function buildConcatArrayTransform(variables: ConcatVariable[]): string {
|
|
@@ -566,13 +582,33 @@ function hasHandleConnection(
|
|
|
566
582
|
}
|
|
567
583
|
|
|
568
584
|
function getOutputHandleVarName(targetNodeId: string, handleName: string): string {
|
|
569
|
-
return
|
|
585
|
+
return toCelIdentifier(
|
|
586
|
+
['output', 'allOutputs'].includes(handleName) ? targetNodeId : `${targetNodeId}_${handleName}`,
|
|
587
|
+
);
|
|
570
588
|
}
|
|
571
589
|
|
|
572
590
|
function getIsSliceAssetsItemsSourceHandle(nodeId: string, sourceHandle: string | null | undefined): boolean {
|
|
573
591
|
return sourceHandle === `${nodeId}-source-items` || sourceHandle === `${nodeId}-source-assets`;
|
|
574
592
|
}
|
|
575
593
|
|
|
594
|
+
/**
|
|
595
|
+
* Prompt Builder (transformText) binds upstream vars for CEL. Reuse the same
|
|
596
|
+
* list-producer rules as concat/slice (`groupItems`, `sliceAssets`, `allOutputs`,
|
|
597
|
+
* split-text, LLM "All Results", `isArray` handles): those nodes always emit CEL
|
|
598
|
+
* lists (via concat/slice/randomSample), so Prompt Builder must bind them as
|
|
599
|
+
* `string_array` for indexing. Scalar text (plain text nodes, forEach outputs)
|
|
600
|
+
* stays `string`.
|
|
601
|
+
*/
|
|
602
|
+
function getPromptBuilderInputType(
|
|
603
|
+
targetNode: WorkflowEditorNode,
|
|
604
|
+
outHandle: WorkflowEditorHandleOutput | undefined,
|
|
605
|
+
outHandleName: string,
|
|
606
|
+
): 'string' | 'string_array' {
|
|
607
|
+
return getConcatListSourceDescriptor(targetNode, outHandle, outHandleName).inputType === 'string_array' ?
|
|
608
|
+
'string_array'
|
|
609
|
+
: 'string';
|
|
610
|
+
}
|
|
611
|
+
|
|
576
612
|
function getConcatListSourceDescriptor(
|
|
577
613
|
targetNode: WorkflowEditorNode,
|
|
578
614
|
outHandle: WorkflowEditorHandleOutput | undefined,
|
|
@@ -607,7 +643,7 @@ function getConcatListSourceDescriptor(
|
|
|
607
643
|
|
|
608
644
|
/**
|
|
609
645
|
* Builds the concat variables and flow inputs for a list-concatenating node
|
|
610
|
-
* (groupItems, sliceAssets in randomize mode) from its incoming edges.
|
|
646
|
+
* (groupItems, sliceAssets in randomize/choose mode) from its incoming edges.
|
|
611
647
|
* `getVarName` maps a target node id + output handle name to the variable name,
|
|
612
648
|
* which differs between callers.
|
|
613
649
|
*/
|
|
@@ -1568,7 +1604,7 @@ export function convertWorkflowEditorToFlow(
|
|
|
1568
1604
|
flow.push({
|
|
1569
1605
|
id: flowId,
|
|
1570
1606
|
type: 'transform',
|
|
1571
|
-
logic: { transform:
|
|
1607
|
+
logic: { transform: formatTextAsCELString(value) },
|
|
1572
1608
|
inputs: flowInputs.length > 0 ? flowInputs : undefined,
|
|
1573
1609
|
});
|
|
1574
1610
|
|
|
@@ -1601,7 +1637,7 @@ export function convertWorkflowEditorToFlow(
|
|
|
1601
1637
|
flow.push({
|
|
1602
1638
|
id: flowId,
|
|
1603
1639
|
type: 'transform',
|
|
1604
|
-
logic: { transform:
|
|
1640
|
+
logic: { transform: formatTextAsCELString(value) },
|
|
1605
1641
|
inputs: flowInputs.length > 0 ? flowInputs : undefined,
|
|
1606
1642
|
});
|
|
1607
1643
|
|
|
@@ -1622,7 +1658,11 @@ export function convertWorkflowEditorToFlow(
|
|
|
1622
1658
|
const outHandle = targetNode.data.outputHandles?.find((h) => h.id === edge.targetHandle);
|
|
1623
1659
|
const outHandleName = outHandle?.name ?? 'output';
|
|
1624
1660
|
const targetFlowId = nodeIdToFlowIdMap.get(targetNode.id) ?? targetNode.id;
|
|
1625
|
-
flowInputs.push({
|
|
1661
|
+
flowInputs.push({
|
|
1662
|
+
name: `${targetFlowId}_${outHandleName}`,
|
|
1663
|
+
type: getPromptBuilderInputType(targetNode, outHandle, outHandleName),
|
|
1664
|
+
ref,
|
|
1665
|
+
});
|
|
1626
1666
|
}
|
|
1627
1667
|
flowInputs.push(...collectConditionalConnectionInputs(incomingEdges, node.id, ctx));
|
|
1628
1668
|
flow.push({
|
|
@@ -1670,10 +1710,12 @@ export function convertWorkflowEditorToFlow(
|
|
|
1670
1710
|
const { variables, flowInputs } = collectConcatVarsAndInputs(
|
|
1671
1711
|
incomingEdges.filter((e) => e.sourceHandle !== conditionalHandleId),
|
|
1672
1712
|
ctx,
|
|
1673
|
-
(targetNodeId, handleName) => `${targetNodeId}_${handleName}
|
|
1713
|
+
(targetNodeId, handleName) => toCelIdentifier(`${targetNodeId}_${handleName}`),
|
|
1674
1714
|
);
|
|
1675
1715
|
|
|
1676
|
-
const orderedValues = convertValueToList((node.data as { value?: string }).value ?? '')
|
|
1716
|
+
const orderedValues = convertValueToList((node.data as { value?: string }).value ?? '').map(
|
|
1717
|
+
toCelIdentifier,
|
|
1718
|
+
);
|
|
1677
1719
|
variables.sort((a, b) => orderedValues.indexOf(a.name) - orderedValues.indexOf(b.name));
|
|
1678
1720
|
flowInputs.sort((a, b) => orderedValues.indexOf(a.name) - orderedValues.indexOf(b.name));
|
|
1679
1721
|
flowInputs.push(...collectConditionalConnectionInputs(incomingEdges, node.id, ctx));
|
|
@@ -1685,16 +1727,19 @@ export function convertWorkflowEditorToFlow(
|
|
|
1685
1727
|
});
|
|
1686
1728
|
|
|
1687
1729
|
// ------------------------------------
|
|
1688
|
-
// SliceAssets -> slice
|
|
1730
|
+
// SliceAssets -> slice / randomSample transform, or user-selection in choose mode
|
|
1689
1731
|
// ------------------------------------
|
|
1690
1732
|
} else if (node.type === 'sliceAssets') {
|
|
1691
1733
|
const sliceData = node.data as {
|
|
1692
1734
|
from?: number | string;
|
|
1693
1735
|
count?: number | string;
|
|
1736
|
+
mode?: SliceAssetsMode;
|
|
1694
1737
|
isRandomize?: boolean;
|
|
1695
1738
|
randomSeed?: string;
|
|
1696
1739
|
isSeedLocked?: boolean;
|
|
1740
|
+
message?: string;
|
|
1697
1741
|
};
|
|
1742
|
+
const mode = getSliceAssetsMode(sliceData);
|
|
1698
1743
|
const conditionalHandleId = getConditionalInputHandleId(node.id);
|
|
1699
1744
|
const itemsEdges = incomingEdges.filter(
|
|
1700
1745
|
(e) =>
|
|
@@ -1702,7 +1747,58 @@ export function convertWorkflowEditorToFlow(
|
|
|
1702
1747
|
getIsSliceAssetsItemsSourceHandle(node.id, e.sourceHandle),
|
|
1703
1748
|
);
|
|
1704
1749
|
|
|
1705
|
-
if (
|
|
1750
|
+
if (mode === 'choose') {
|
|
1751
|
+
const connectionInputs = collectConditionalConnectionInputs(incomingEdges, node.id, ctx);
|
|
1752
|
+
|
|
1753
|
+
// No item sources → unsatisfiable selection; mirror default empty fallback.
|
|
1754
|
+
if (itemsEdges.length === 0) {
|
|
1755
|
+
flow.push({
|
|
1756
|
+
id: flowId,
|
|
1757
|
+
type: 'transform',
|
|
1758
|
+
logic: { transform: '[]' },
|
|
1759
|
+
inputs: connectionInputs.length > 0 ? connectionInputs : undefined,
|
|
1760
|
+
});
|
|
1761
|
+
} else {
|
|
1762
|
+
const { variables, flowInputs } = collectConcatVarsAndInputs(
|
|
1763
|
+
itemsEdges,
|
|
1764
|
+
ctx,
|
|
1765
|
+
getOutputHandleVarName,
|
|
1766
|
+
);
|
|
1767
|
+
const count = clampUserSelectionCount(parseInt(String(sliceData.count ?? ''), 10) || 1);
|
|
1768
|
+
const message = sliceData.message?.trim() || DEFAULT_SLICE_ASSETS_CHOOSE_MESSAGE;
|
|
1769
|
+
const arrayType = getUserSelectionArrayType(flowInputs);
|
|
1770
|
+
|
|
1771
|
+
// Single array-typed source can feed user-selection directly; scalars must be wrapped.
|
|
1772
|
+
if (variables.length === 1 && variables[0]?.isArray && flowInputs[0]?.ref) {
|
|
1773
|
+
flow.push({
|
|
1774
|
+
id: flowId,
|
|
1775
|
+
type: 'user-selection',
|
|
1776
|
+
label: message,
|
|
1777
|
+
inputs: [
|
|
1778
|
+
{ name: 'items', type: arrayType, ref: flowInputs[0].ref, min: count, max: count },
|
|
1779
|
+
...connectionInputs,
|
|
1780
|
+
],
|
|
1781
|
+
});
|
|
1782
|
+
} else {
|
|
1783
|
+
const concatId = `${flowId}_items`;
|
|
1784
|
+
flow.push({
|
|
1785
|
+
id: concatId,
|
|
1786
|
+
type: 'transform',
|
|
1787
|
+
logic: { transform: buildConcatArrayTransform(variables) },
|
|
1788
|
+
inputs: flowInputs.length > 0 ? flowInputs : undefined,
|
|
1789
|
+
});
|
|
1790
|
+
flow.push({
|
|
1791
|
+
id: flowId,
|
|
1792
|
+
type: 'user-selection',
|
|
1793
|
+
label: message,
|
|
1794
|
+
inputs: [
|
|
1795
|
+
{ name: 'items', type: arrayType, ref: { node: concatId }, min: count, max: count },
|
|
1796
|
+
...connectionInputs,
|
|
1797
|
+
],
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
} else if (mode === 'randomize') {
|
|
1706
1802
|
const { variables, flowInputs } = collectConcatVarsAndInputs(itemsEdges, ctx, getOutputHandleVarName);
|
|
1707
1803
|
flowInputs.push(...collectConditionalConnectionInputs(incomingEdges, node.id, ctx));
|
|
1708
1804
|
|
|
@@ -1737,7 +1833,7 @@ export function convertWorkflowEditorToFlow(
|
|
|
1737
1833
|
from < 0 ?
|
|
1738
1834
|
`slice(${varName}, (${varName}).size() + ${from}, (${varName}).size() + ${from + count})`
|
|
1739
1835
|
: `slice(${varName}, ${from}, ${from + count})`;
|
|
1740
|
-
const
|
|
1836
|
+
const sliceFlowInputs: WorkflowEditorFlowInput[] = [
|
|
1741
1837
|
{ name: varName, type: inputType, ref },
|
|
1742
1838
|
...collectConditionalConnectionInputs(incomingEdges, node.id, ctx),
|
|
1743
1839
|
];
|
|
@@ -1745,7 +1841,7 @@ export function convertWorkflowEditorToFlow(
|
|
|
1745
1841
|
id: flowId,
|
|
1746
1842
|
type: 'transform',
|
|
1747
1843
|
logic: { transform },
|
|
1748
|
-
inputs:
|
|
1844
|
+
inputs: sliceFlowInputs.length > 0 ? sliceFlowInputs : undefined,
|
|
1749
1845
|
});
|
|
1750
1846
|
}
|
|
1751
1847
|
}
|
|
@@ -1991,3 +2087,21 @@ function applyApprovalsToFlow({
|
|
|
1991
2087
|
});
|
|
1992
2088
|
}
|
|
1993
2089
|
}
|
|
2090
|
+
|
|
2091
|
+
// ---- SliceAssets / user-selection helpers ----
|
|
2092
|
+
|
|
2093
|
+
function getSliceAssetsMode(data: { mode?: SliceAssetsMode; isRandomize?: boolean }): SliceAssetsMode {
|
|
2094
|
+
if (data.mode === 'choose' || data.mode === 'randomize' || data.mode === 'default') {
|
|
2095
|
+
return data.mode;
|
|
2096
|
+
}
|
|
2097
|
+
return data.isRandomize ? 'randomize' : 'default';
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
function clampUserSelectionCount(count: number): number {
|
|
2101
|
+
return Math.min(USER_SELECTION_MAX_SELECT, Math.max(USER_SELECTION_MIN_SELECT, count));
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
function getUserSelectionArrayType(flowInputs: WorkflowEditorFlowInput[]): 'file_array' | 'string_array' {
|
|
2105
|
+
const hasFile = flowInputs.some((input) => input.type === 'file' || input.type === 'file_array');
|
|
2106
|
+
return hasFile || flowInputs.length === 0 ? 'file_array' : 'string_array';
|
|
2107
|
+
}
|