@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/resources/workflows.mjs
CHANGED
|
@@ -2,34 +2,46 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { WorkflowsCursor } from "../core/pagination.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
import { omitUndefined } from "../internal/utils/values.mjs";
|
|
5
6
|
export class Workflows extends APIResource {
|
|
6
7
|
/**
|
|
7
8
|
* Create workflow
|
|
8
9
|
*/
|
|
9
10
|
create(params, options) {
|
|
10
11
|
const { projectId, ...body } = params;
|
|
11
|
-
return this._client.post('/workflows', {
|
|
12
|
+
return this._client.post('/workflows', {
|
|
13
|
+
body,
|
|
14
|
+
...options,
|
|
15
|
+
query: { projectId, ...omitUndefined(options?.query) },
|
|
16
|
+
});
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* Get workflow by ID
|
|
15
20
|
*/
|
|
16
21
|
retrieve(workflowID, query = {}, options) {
|
|
17
|
-
return this._client.get(path `/workflows/${workflowID}`, {
|
|
22
|
+
return this._client.get(path `/workflows/${workflowID}`, {
|
|
23
|
+
...options,
|
|
24
|
+
query: { ...query, ...omitUndefined(options?.query) },
|
|
25
|
+
});
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* Update workflow
|
|
21
29
|
*/
|
|
22
30
|
update(workflowID, params, options) {
|
|
23
31
|
const { projectId, ...body } = params;
|
|
24
|
-
return this._client.put(path `/workflows/${workflowID}`, {
|
|
32
|
+
return this._client.put(path `/workflows/${workflowID}`, {
|
|
33
|
+
body,
|
|
34
|
+
...options,
|
|
35
|
+
query: { projectId, ...omitUndefined(options?.query) },
|
|
36
|
+
});
|
|
25
37
|
}
|
|
26
38
|
/**
|
|
27
39
|
* List workflows
|
|
28
40
|
*/
|
|
29
41
|
list(query = {}, options) {
|
|
30
42
|
return this._client.getAPIList('/workflows', (WorkflowsCursor), {
|
|
31
|
-
query,
|
|
32
43
|
...options,
|
|
44
|
+
query: { ...query, ...omitUndefined(options?.query) },
|
|
33
45
|
});
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
@@ -37,14 +49,20 @@ export class Workflows extends APIResource {
|
|
|
37
49
|
*/
|
|
38
50
|
delete(workflowID, params = {}, options) {
|
|
39
51
|
const { projectId } = params ?? {};
|
|
40
|
-
return this._client.delete(path `/workflows/${workflowID}`, {
|
|
52
|
+
return this._client.delete(path `/workflows/${workflowID}`, {
|
|
53
|
+
...options,
|
|
54
|
+
query: { projectId, ...omitUndefined(options?.query) },
|
|
55
|
+
});
|
|
41
56
|
}
|
|
42
57
|
/**
|
|
43
58
|
* Get all unique tags from workflows in a project (all privacy levels). Optionally
|
|
44
59
|
* filter by status.
|
|
45
60
|
*/
|
|
46
61
|
getTags(query = {}, options) {
|
|
47
|
-
return this._client.get('/workflows/tags', {
|
|
62
|
+
return this._client.get('/workflows/tags', {
|
|
63
|
+
...options,
|
|
64
|
+
query: { ...query, ...omitUndefined(options?.query) },
|
|
65
|
+
});
|
|
48
66
|
}
|
|
49
67
|
/**
|
|
50
68
|
* Run a workflow
|
|
@@ -52,9 +70,9 @@ export class Workflows extends APIResource {
|
|
|
52
70
|
run(workflowID, params, options) {
|
|
53
71
|
const { body, dryRun, projectId } = params;
|
|
54
72
|
return this._client.put(path `/workflows/${workflowID}/run`, {
|
|
55
|
-
query: { dryRun, projectId },
|
|
56
73
|
body: body,
|
|
57
74
|
...options,
|
|
75
|
+
query: { dryRun, projectId, ...omitUndefined(options?.query) },
|
|
58
76
|
});
|
|
59
77
|
}
|
|
60
78
|
/**
|
|
@@ -66,9 +84,22 @@ export class Workflows extends APIResource {
|
|
|
66
84
|
userApproval(workflowID, params, options) {
|
|
67
85
|
const { projectId, ...body } = params;
|
|
68
86
|
return this._client.put(path `/workflows/${workflowID}/user-approval`, {
|
|
69
|
-
query: { projectId },
|
|
70
87
|
body,
|
|
71
88
|
...options,
|
|
89
|
+
query: { projectId, ...omitUndefined(options?.query) },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Respond to a user-selection node in a workflow. Pass action="select" with
|
|
94
|
+
* selectedIndices to pick items and resume the workflow, or action="reject" to
|
|
95
|
+
* mark the node Rejected and cancel the workflow.
|
|
96
|
+
*/
|
|
97
|
+
userSelection(workflowID, params, options) {
|
|
98
|
+
const { projectId, ...body } = params;
|
|
99
|
+
return this._client.put(path `/workflows/${workflowID}/user-selection`, {
|
|
100
|
+
body,
|
|
101
|
+
...options,
|
|
102
|
+
query: { projectId, ...omitUndefined(options?.query) },
|
|
72
103
|
});
|
|
73
104
|
}
|
|
74
105
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.mjs","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAe,eAAe,EAA8B,+BAA2B;AAE9F,OAAO,EAAE,IAAI,EAAE,mCAA+B;
|
|
1
|
+
{"version":3,"file":"workflows.mjs","sourceRoot":"","sources":["../src/resources/workflows.ts"],"names":[],"mappings":"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"}
|
package/src/client.ts
CHANGED
|
@@ -25,12 +25,18 @@ import {
|
|
|
25
25
|
JobsCursorResponse,
|
|
26
26
|
type ModelsCursorParams,
|
|
27
27
|
ModelsCursorResponse,
|
|
28
|
+
type ProjectsCursorParams,
|
|
29
|
+
ProjectsCursorResponse,
|
|
30
|
+
type RecommendationsCursorParams,
|
|
31
|
+
RecommendationsCursorResponse,
|
|
28
32
|
type SearchHitsOffsetParams,
|
|
29
33
|
SearchHitsOffsetResponse,
|
|
30
34
|
type SnapshotsCursorParams,
|
|
31
35
|
SnapshotsCursorResponse,
|
|
32
36
|
type TagsCursorParams,
|
|
33
37
|
TagsCursorResponse,
|
|
38
|
+
type ThreadsCursorParams,
|
|
39
|
+
ThreadsCursorResponse,
|
|
34
40
|
type WorkflowsCursorParams,
|
|
35
41
|
WorkflowsCursorResponse,
|
|
36
42
|
} from './core/pagination';
|
|
@@ -47,10 +53,14 @@ import {
|
|
|
47
53
|
GenerateDetectResponse,
|
|
48
54
|
GenerateEmbedParams,
|
|
49
55
|
GenerateEmbedResponse,
|
|
56
|
+
GenerateIPDetectionParams,
|
|
57
|
+
GenerateIPDetectionResponse,
|
|
50
58
|
GeneratePatchParams,
|
|
51
59
|
GeneratePatchResponse,
|
|
52
60
|
GeneratePromptParams,
|
|
53
61
|
GeneratePromptResponse,
|
|
62
|
+
GenerateQualityGateParams,
|
|
63
|
+
GenerateQualityGateResponse,
|
|
54
64
|
GenerateRunModelParams,
|
|
55
65
|
GenerateRunModelResponse,
|
|
56
66
|
GenerateTranslateParams,
|
|
@@ -67,6 +77,12 @@ import {
|
|
|
67
77
|
Jobs,
|
|
68
78
|
} from './resources/jobs';
|
|
69
79
|
import { Oscu, OscuRetrievePricesResponse } from './resources/oscu';
|
|
80
|
+
import {
|
|
81
|
+
RecommendationListModelsParams,
|
|
82
|
+
RecommendationListModelsResponse,
|
|
83
|
+
RecommendationListModelsResponsesRecommendationsCursor,
|
|
84
|
+
Recommendations,
|
|
85
|
+
} from './resources/recommendations';
|
|
70
86
|
import {
|
|
71
87
|
Search,
|
|
72
88
|
SearchAssetSearchParams,
|
|
@@ -75,6 +91,9 @@ import {
|
|
|
75
91
|
SearchModelSearchParams,
|
|
76
92
|
SearchModelSearchResponse,
|
|
77
93
|
SearchModelSearchResponsesSearchHitsOffset,
|
|
94
|
+
SearchWorkflowSearchParams,
|
|
95
|
+
SearchWorkflowSearchResponse,
|
|
96
|
+
SearchWorkflowSearchResponsesSearchHitsOffset,
|
|
78
97
|
} from './resources/search';
|
|
79
98
|
import { TagListParams, TagListResponse, TagListResponsesTagsCursor, Tags } from './resources/tags';
|
|
80
99
|
import {
|
|
@@ -106,6 +125,8 @@ import {
|
|
|
106
125
|
WorkflowUpdateResponse,
|
|
107
126
|
WorkflowUserApprovalParams,
|
|
108
127
|
WorkflowUserApprovalResponse,
|
|
128
|
+
WorkflowUserSelectionParams,
|
|
129
|
+
WorkflowUserSelectionResponse,
|
|
109
130
|
Workflows,
|
|
110
131
|
} from './resources/workflows';
|
|
111
132
|
import {
|
|
@@ -176,6 +197,28 @@ import {
|
|
|
176
197
|
Models,
|
|
177
198
|
} from './resources/models/models';
|
|
178
199
|
import { Pricing } from './resources/pricing/pricing';
|
|
200
|
+
import {
|
|
201
|
+
ProjectCreateParams,
|
|
202
|
+
ProjectCreateResponse,
|
|
203
|
+
ProjectDeleteResponse,
|
|
204
|
+
ProjectListParams,
|
|
205
|
+
ProjectListResponse,
|
|
206
|
+
ProjectListResponsesProjectsCursor,
|
|
207
|
+
ProjectRetrieveResponse,
|
|
208
|
+
ProjectUpdateParams,
|
|
209
|
+
ProjectUpdateResponse,
|
|
210
|
+
Projects,
|
|
211
|
+
} from './resources/projects/projects';
|
|
212
|
+
import {
|
|
213
|
+
TeamDeleteInvitationsParams,
|
|
214
|
+
TeamDeleteInvitationsResponse,
|
|
215
|
+
TeamListResponse,
|
|
216
|
+
TeamRetrieveLimitsResponse,
|
|
217
|
+
TeamRetrieveResponse,
|
|
218
|
+
TeamUpdateParams,
|
|
219
|
+
TeamUpdateResponse,
|
|
220
|
+
Teams,
|
|
221
|
+
} from './resources/teams/teams';
|
|
179
222
|
import { type Fetch } from './internal/builtin-types';
|
|
180
223
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
181
224
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -978,8 +1021,11 @@ export class Scenario {
|
|
|
978
1021
|
models: API.Models = new API.Models(this);
|
|
979
1022
|
oscu: API.Oscu = new API.Oscu(this);
|
|
980
1023
|
pricing: API.Pricing = new API.Pricing(this);
|
|
1024
|
+
projects: API.Projects = new API.Projects(this);
|
|
1025
|
+
recommendations: API.Recommendations = new API.Recommendations(this);
|
|
981
1026
|
search: API.Search = new API.Search(this);
|
|
982
1027
|
tags: API.Tags = new API.Tags(this);
|
|
1028
|
+
teams: API.Teams = new API.Teams(this);
|
|
983
1029
|
uploads: API.Uploads = new API.Uploads(this);
|
|
984
1030
|
usages: API.Usages = new API.Usages(this);
|
|
985
1031
|
workflows: API.Workflows = new API.Workflows(this);
|
|
@@ -992,8 +1038,11 @@ Scenario.Jobs = Jobs;
|
|
|
992
1038
|
Scenario.Models = Models;
|
|
993
1039
|
Scenario.Oscu = Oscu;
|
|
994
1040
|
Scenario.Pricing = Pricing;
|
|
1041
|
+
Scenario.Projects = Projects;
|
|
1042
|
+
Scenario.Recommendations = Recommendations;
|
|
995
1043
|
Scenario.Search = Search;
|
|
996
1044
|
Scenario.Tags = Tags;
|
|
1045
|
+
Scenario.Teams = Teams;
|
|
997
1046
|
Scenario.Uploads = UploadsAPIUploads;
|
|
998
1047
|
Scenario.Usages = Usages;
|
|
999
1048
|
Scenario.Workflows = Workflows;
|
|
@@ -1031,6 +1080,24 @@ export declare namespace Scenario {
|
|
|
1031
1080
|
type WorkflowsCursorResponse as WorkflowsCursorResponse,
|
|
1032
1081
|
};
|
|
1033
1082
|
|
|
1083
|
+
export import ThreadsCursor = Pagination.ThreadsCursor;
|
|
1084
|
+
export {
|
|
1085
|
+
type ThreadsCursorParams as ThreadsCursorParams,
|
|
1086
|
+
type ThreadsCursorResponse as ThreadsCursorResponse,
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
export import ProjectsCursor = Pagination.ProjectsCursor;
|
|
1090
|
+
export {
|
|
1091
|
+
type ProjectsCursorParams as ProjectsCursorParams,
|
|
1092
|
+
type ProjectsCursorResponse as ProjectsCursorResponse,
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
export import RecommendationsCursor = Pagination.RecommendationsCursor;
|
|
1096
|
+
export {
|
|
1097
|
+
type RecommendationsCursorParams as RecommendationsCursorParams,
|
|
1098
|
+
type RecommendationsCursorResponse as RecommendationsCursorResponse,
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1034
1101
|
export import SearchHitsOffset = Pagination.SearchHitsOffset;
|
|
1035
1102
|
export {
|
|
1036
1103
|
type SearchHitsOffsetParams as SearchHitsOffsetParams,
|
|
@@ -1086,16 +1153,20 @@ export declare namespace Scenario {
|
|
|
1086
1153
|
type GenerateDescribeStyleResponse as GenerateDescribeStyleResponse,
|
|
1087
1154
|
type GenerateDetectResponse as GenerateDetectResponse,
|
|
1088
1155
|
type GenerateEmbedResponse as GenerateEmbedResponse,
|
|
1156
|
+
type GenerateIPDetectionResponse as GenerateIPDetectionResponse,
|
|
1089
1157
|
type GeneratePatchResponse as GeneratePatchResponse,
|
|
1090
1158
|
type GeneratePromptResponse as GeneratePromptResponse,
|
|
1159
|
+
type GenerateQualityGateResponse as GenerateQualityGateResponse,
|
|
1091
1160
|
type GenerateRunModelResponse as GenerateRunModelResponse,
|
|
1092
1161
|
type GenerateTranslateResponse as GenerateTranslateResponse,
|
|
1093
1162
|
type GenerateCaptionParams as GenerateCaptionParams,
|
|
1094
1163
|
type GenerateDescribeStyleParams as GenerateDescribeStyleParams,
|
|
1095
1164
|
type GenerateDetectParams as GenerateDetectParams,
|
|
1096
1165
|
type GenerateEmbedParams as GenerateEmbedParams,
|
|
1166
|
+
type GenerateIPDetectionParams as GenerateIPDetectionParams,
|
|
1097
1167
|
type GeneratePatchParams as GeneratePatchParams,
|
|
1098
1168
|
type GeneratePromptParams as GeneratePromptParams,
|
|
1169
|
+
type GenerateQualityGateParams as GenerateQualityGateParams,
|
|
1099
1170
|
type GenerateRunModelParams as GenerateRunModelParams,
|
|
1100
1171
|
type GenerateTranslateParams as GenerateTranslateParams,
|
|
1101
1172
|
};
|
|
@@ -1142,14 +1213,37 @@ export declare namespace Scenario {
|
|
|
1142
1213
|
|
|
1143
1214
|
export { Pricing as Pricing };
|
|
1144
1215
|
|
|
1216
|
+
export {
|
|
1217
|
+
Projects as Projects,
|
|
1218
|
+
type ProjectCreateResponse as ProjectCreateResponse,
|
|
1219
|
+
type ProjectRetrieveResponse as ProjectRetrieveResponse,
|
|
1220
|
+
type ProjectUpdateResponse as ProjectUpdateResponse,
|
|
1221
|
+
type ProjectListResponse as ProjectListResponse,
|
|
1222
|
+
type ProjectDeleteResponse as ProjectDeleteResponse,
|
|
1223
|
+
type ProjectListResponsesProjectsCursor as ProjectListResponsesProjectsCursor,
|
|
1224
|
+
type ProjectCreateParams as ProjectCreateParams,
|
|
1225
|
+
type ProjectUpdateParams as ProjectUpdateParams,
|
|
1226
|
+
type ProjectListParams as ProjectListParams,
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
export {
|
|
1230
|
+
Recommendations as Recommendations,
|
|
1231
|
+
type RecommendationListModelsResponse as RecommendationListModelsResponse,
|
|
1232
|
+
type RecommendationListModelsResponsesRecommendationsCursor as RecommendationListModelsResponsesRecommendationsCursor,
|
|
1233
|
+
type RecommendationListModelsParams as RecommendationListModelsParams,
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1145
1236
|
export {
|
|
1146
1237
|
Search as Search,
|
|
1147
1238
|
type SearchAssetSearchResponse as SearchAssetSearchResponse,
|
|
1148
1239
|
type SearchModelSearchResponse as SearchModelSearchResponse,
|
|
1240
|
+
type SearchWorkflowSearchResponse as SearchWorkflowSearchResponse,
|
|
1149
1241
|
type SearchAssetSearchResponsesSearchHitsOffset as SearchAssetSearchResponsesSearchHitsOffset,
|
|
1150
1242
|
type SearchModelSearchResponsesSearchHitsOffset as SearchModelSearchResponsesSearchHitsOffset,
|
|
1243
|
+
type SearchWorkflowSearchResponsesSearchHitsOffset as SearchWorkflowSearchResponsesSearchHitsOffset,
|
|
1151
1244
|
type SearchAssetSearchParams as SearchAssetSearchParams,
|
|
1152
1245
|
type SearchModelSearchParams as SearchModelSearchParams,
|
|
1246
|
+
type SearchWorkflowSearchParams as SearchWorkflowSearchParams,
|
|
1153
1247
|
};
|
|
1154
1248
|
|
|
1155
1249
|
export {
|
|
@@ -1159,6 +1253,17 @@ export declare namespace Scenario {
|
|
|
1159
1253
|
type TagListParams as TagListParams,
|
|
1160
1254
|
};
|
|
1161
1255
|
|
|
1256
|
+
export {
|
|
1257
|
+
Teams as Teams,
|
|
1258
|
+
type TeamRetrieveResponse as TeamRetrieveResponse,
|
|
1259
|
+
type TeamUpdateResponse as TeamUpdateResponse,
|
|
1260
|
+
type TeamListResponse as TeamListResponse,
|
|
1261
|
+
type TeamDeleteInvitationsResponse as TeamDeleteInvitationsResponse,
|
|
1262
|
+
type TeamRetrieveLimitsResponse as TeamRetrieveLimitsResponse,
|
|
1263
|
+
type TeamUpdateParams as TeamUpdateParams,
|
|
1264
|
+
type TeamDeleteInvitationsParams as TeamDeleteInvitationsParams,
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1162
1267
|
export {
|
|
1163
1268
|
UploadsAPIUploads as Uploads,
|
|
1164
1269
|
type UploadCreateResponse as UploadCreateResponse,
|
|
@@ -1185,6 +1290,7 @@ export declare namespace Scenario {
|
|
|
1185
1290
|
type WorkflowGetTagsResponse as WorkflowGetTagsResponse,
|
|
1186
1291
|
type WorkflowRunResponse as WorkflowRunResponse,
|
|
1187
1292
|
type WorkflowUserApprovalResponse as WorkflowUserApprovalResponse,
|
|
1293
|
+
type WorkflowUserSelectionResponse as WorkflowUserSelectionResponse,
|
|
1188
1294
|
type WorkflowListResponsesWorkflowsCursor as WorkflowListResponsesWorkflowsCursor,
|
|
1189
1295
|
type WorkflowCreateParams as WorkflowCreateParams,
|
|
1190
1296
|
type WorkflowRetrieveParams as WorkflowRetrieveParams,
|
|
@@ -1194,6 +1300,7 @@ export declare namespace Scenario {
|
|
|
1194
1300
|
type WorkflowGetTagsParams as WorkflowGetTagsParams,
|
|
1195
1301
|
type WorkflowRunParams as WorkflowRunParams,
|
|
1196
1302
|
type WorkflowUserApprovalParams as WorkflowUserApprovalParams,
|
|
1303
|
+
type WorkflowUserSelectionParams as WorkflowUserSelectionParams,
|
|
1197
1304
|
type WorkflowApproveUserParams as WorkflowApproveUserParams,
|
|
1198
1305
|
};
|
|
1199
1306
|
}
|
package/src/core/pagination.ts
CHANGED
|
@@ -436,6 +436,150 @@ export class WorkflowsCursor<Item> extends AbstractPage<Item> implements Workflo
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
+
export interface ThreadsCursorResponse<Item> {
|
|
440
|
+
nextPaginationToken: string;
|
|
441
|
+
|
|
442
|
+
threads: Array<Item>;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface ThreadsCursorParams {
|
|
446
|
+
paginationToken?: string;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export class ThreadsCursor<Item> extends AbstractPage<Item> implements ThreadsCursorResponse<Item> {
|
|
450
|
+
nextPaginationToken: string;
|
|
451
|
+
|
|
452
|
+
threads: Array<Item>;
|
|
453
|
+
|
|
454
|
+
constructor(
|
|
455
|
+
client: Scenario,
|
|
456
|
+
response: Response,
|
|
457
|
+
body: ThreadsCursorResponse<Item>,
|
|
458
|
+
options: FinalRequestOptions,
|
|
459
|
+
) {
|
|
460
|
+
super(client, response, body, options);
|
|
461
|
+
|
|
462
|
+
this.nextPaginationToken = body.nextPaginationToken || '';
|
|
463
|
+
this.threads = body.threads || [];
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
getPaginatedItems(): Item[] {
|
|
467
|
+
return this.threads ?? [];
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
nextPageRequestOptions(): PageRequestOptions | null {
|
|
471
|
+
const cursor = this.nextPaginationToken;
|
|
472
|
+
if (!cursor) {
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return {
|
|
477
|
+
...this.options,
|
|
478
|
+
query: {
|
|
479
|
+
...maybeObj(this.options.query),
|
|
480
|
+
paginationToken: cursor,
|
|
481
|
+
},
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export interface ProjectsCursorResponse<Item> {
|
|
487
|
+
nextPaginationToken: string;
|
|
488
|
+
|
|
489
|
+
projects: Array<Item>;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface ProjectsCursorParams {
|
|
493
|
+
paginationToken?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export class ProjectsCursor<Item> extends AbstractPage<Item> implements ProjectsCursorResponse<Item> {
|
|
497
|
+
nextPaginationToken: string;
|
|
498
|
+
|
|
499
|
+
projects: Array<Item>;
|
|
500
|
+
|
|
501
|
+
constructor(
|
|
502
|
+
client: Scenario,
|
|
503
|
+
response: Response,
|
|
504
|
+
body: ProjectsCursorResponse<Item>,
|
|
505
|
+
options: FinalRequestOptions,
|
|
506
|
+
) {
|
|
507
|
+
super(client, response, body, options);
|
|
508
|
+
|
|
509
|
+
this.nextPaginationToken = body.nextPaginationToken || '';
|
|
510
|
+
this.projects = body.projects || [];
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
getPaginatedItems(): Item[] {
|
|
514
|
+
return this.projects ?? [];
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
nextPageRequestOptions(): PageRequestOptions | null {
|
|
518
|
+
const cursor = this.nextPaginationToken;
|
|
519
|
+
if (!cursor) {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return {
|
|
524
|
+
...this.options,
|
|
525
|
+
query: {
|
|
526
|
+
...maybeObj(this.options.query),
|
|
527
|
+
paginationToken: cursor,
|
|
528
|
+
},
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export interface RecommendationsCursorResponse<Item> {
|
|
534
|
+
models: Array<Item>;
|
|
535
|
+
|
|
536
|
+
nextToken: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export interface RecommendationsCursorParams {
|
|
540
|
+
nextToken?: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export class RecommendationsCursor<Item>
|
|
544
|
+
extends AbstractPage<Item>
|
|
545
|
+
implements RecommendationsCursorResponse<Item>
|
|
546
|
+
{
|
|
547
|
+
models: Array<Item>;
|
|
548
|
+
|
|
549
|
+
nextToken: string;
|
|
550
|
+
|
|
551
|
+
constructor(
|
|
552
|
+
client: Scenario,
|
|
553
|
+
response: Response,
|
|
554
|
+
body: RecommendationsCursorResponse<Item>,
|
|
555
|
+
options: FinalRequestOptions,
|
|
556
|
+
) {
|
|
557
|
+
super(client, response, body, options);
|
|
558
|
+
|
|
559
|
+
this.models = body.models || [];
|
|
560
|
+
this.nextToken = body.nextToken || '';
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
getPaginatedItems(): Item[] {
|
|
564
|
+
return this.models ?? [];
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
nextPageRequestOptions(): PageRequestOptions | null {
|
|
568
|
+
const cursor = this.nextToken;
|
|
569
|
+
if (!cursor) {
|
|
570
|
+
return null;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
return {
|
|
574
|
+
...this.options,
|
|
575
|
+
query: {
|
|
576
|
+
...maybeObj(this.options.query),
|
|
577
|
+
nextToken: cursor,
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
439
583
|
export interface SearchHitsOffsetResponse<Item> {
|
|
440
584
|
estimatedTotalHits: number;
|
|
441
585
|
|
|
@@ -21,6 +21,16 @@ export function maybeObj(x: unknown): object {
|
|
|
21
21
|
return x ?? {};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Returns a copy of the object's own enumerable entries, without the ones whose value is
|
|
26
|
+
* `undefined`. Used to merge `options.query` over the typed query params: like
|
|
27
|
+
* `options.headers`, an `undefined` value means "leave it", not "erase it".
|
|
28
|
+
*/
|
|
29
|
+
export function omitUndefined(obj: object | null | undefined): Record<string, unknown> {
|
|
30
|
+
if (!obj) return {};
|
|
31
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
// https://stackoverflow.com/a/34491287
|
|
25
35
|
export function isEmptyObj(obj: Object | null | undefined): boolean {
|
|
26
36
|
if (!obj) return true;
|
package/src/lib/generate.ts
CHANGED
|
@@ -29,35 +29,35 @@ export class EnhancedGenerate extends Generate {
|
|
|
29
29
|
params: GenerateCaptionParams,
|
|
30
30
|
options?: RequestOptions,
|
|
31
31
|
): APIPromise<WithJob<GenerateCaptionResponse>> {
|
|
32
|
-
return enhanceJob(this._client, super.caption(params, options)
|
|
32
|
+
return enhanceJob(this._client, super.caption(params, options));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
override describeStyle(
|
|
36
36
|
params: GenerateDescribeStyleParams,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<WithJob<GenerateDescribeStyleResponse>> {
|
|
39
|
-
return enhanceJob(this._client, super.describeStyle(params, options)
|
|
39
|
+
return enhanceJob(this._client, super.describeStyle(params, options));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
override detect(
|
|
43
43
|
params: GenerateDetectParams,
|
|
44
44
|
options?: RequestOptions,
|
|
45
45
|
): APIPromise<WithJob<GenerateDetectResponse>> {
|
|
46
|
-
return enhanceJob(this._client, super.detect(params, options)
|
|
46
|
+
return enhanceJob(this._client, super.detect(params, options));
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
override embed(
|
|
50
50
|
params: GenerateEmbedParams,
|
|
51
51
|
options?: RequestOptions,
|
|
52
52
|
): APIPromise<WithJob<GenerateEmbedResponse>> {
|
|
53
|
-
return enhanceJob(this._client, super.embed(params, options)
|
|
53
|
+
return enhanceJob(this._client, super.embed(params, options));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
override patch(
|
|
57
57
|
params: GeneratePatchParams,
|
|
58
58
|
options?: RequestOptions,
|
|
59
59
|
): APIPromise<WithJob<GeneratePatchResponse>> {
|
|
60
|
-
return enhanceJob(this._client, super.patch(params, options)
|
|
60
|
+
return enhanceJob(this._client, super.patch(params, options));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
override runModel(
|
|
@@ -65,13 +65,13 @@ export class EnhancedGenerate extends Generate {
|
|
|
65
65
|
params: GenerateRunModelParams,
|
|
66
66
|
options?: RequestOptions,
|
|
67
67
|
): APIPromise<WithJob<GenerateRunModelResponse>> {
|
|
68
|
-
return enhanceJob(this._client, super.runModel(modelID, params, options)
|
|
68
|
+
return enhanceJob(this._client, super.runModel(modelID, params, options));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
override translate(
|
|
72
72
|
params: GenerateTranslateParams,
|
|
73
73
|
options?: RequestOptions,
|
|
74
74
|
): APIPromise<WithJob<GenerateTranslateResponse>> {
|
|
75
|
-
return enhanceJob(this._client, super.translate(params, options)
|
|
75
|
+
return enhanceJob(this._client, super.translate(params, options));
|
|
76
76
|
}
|
|
77
77
|
}
|
package/src/lib/job.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type JobTriggerActionParams,
|
|
9
9
|
type JobTriggerActionResponse,
|
|
10
10
|
} from '../resources/jobs';
|
|
11
|
-
import { type Scope, clientProjectId,
|
|
11
|
+
import { type Scope, clientProjectId, sentScope, withScope } from './scope';
|
|
12
12
|
|
|
13
13
|
export interface WaitOptions {
|
|
14
14
|
/** Polling interval in milliseconds. Default: 3000 */
|
|
@@ -91,12 +91,14 @@ export type WithJob<T extends { job: unknown }> = T & { job: JobMethods };
|
|
|
91
91
|
export function enhanceJob<T extends { job: { jobId: string; status: string } }>(
|
|
92
92
|
client: Scenario,
|
|
93
93
|
promise: APIPromise<T>,
|
|
94
|
-
options?: RequestOptions,
|
|
95
94
|
): APIPromise<WithJob<T>> {
|
|
96
|
-
|
|
97
|
-
return promise._thenUnwrap((data) => ({
|
|
95
|
+
return promise._thenUnwrap((data, props) => ({
|
|
98
96
|
...data,
|
|
99
|
-
job: Job.from(
|
|
97
|
+
job: Job.from(
|
|
98
|
+
client,
|
|
99
|
+
data.job as JobRetrieveResponse['job'],
|
|
100
|
+
sentScope(props.options, clientProjectId(client)),
|
|
101
|
+
),
|
|
100
102
|
}));
|
|
101
103
|
}
|
|
102
104
|
|
|
@@ -113,7 +115,7 @@ export class EnhancedJobs extends Jobs {
|
|
|
113
115
|
query: JobRetrieveParams | null | undefined = {},
|
|
114
116
|
options?: RequestOptions,
|
|
115
117
|
): APIPromise<WithJob<JobRetrieveResponse>> {
|
|
116
|
-
return enhanceJob(this._client, super.retrieve(jobID, query, options)
|
|
118
|
+
return enhanceJob(this._client, super.retrieve(jobID, query, options));
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
override triggerAction(
|
|
@@ -121,7 +123,7 @@ export class EnhancedJobs extends Jobs {
|
|
|
121
123
|
params: JobTriggerActionParams,
|
|
122
124
|
options?: RequestOptions,
|
|
123
125
|
): APIPromise<WithJob<JobTriggerActionResponse>> {
|
|
124
|
-
return enhanceJob(this._client, super.triggerAction(jobID, params, options)
|
|
126
|
+
return enhanceJob(this._client, super.triggerAction(jobID, params, options));
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
|
package/src/lib/models.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { GenerateRunModelParams, GenerateRunModelResponse } from '../resour
|
|
|
4
4
|
import { Models, type ModelRetrieveParams, type ModelRetrieveResponse } from '../resources/models/models';
|
|
5
5
|
import { Train, type TrainTriggerParams, type TrainTriggerResponse } from '../resources/models/train';
|
|
6
6
|
import { type WithJob, enhanceJob } from './job';
|
|
7
|
-
import { type Scope,
|
|
7
|
+
import { type Scope, hasExplicitProjectId, sentScope, withScope } from './scope';
|
|
8
8
|
// Type-only import to break the circular `scenario.ts` ↔ `models.ts` graph at runtime.
|
|
9
9
|
import type { Scenario } from './scenario';
|
|
10
10
|
|
|
@@ -38,7 +38,10 @@ export class ModelEntity {
|
|
|
38
38
|
params: GenerateRunModelParams,
|
|
39
39
|
options?: RequestOptions,
|
|
40
40
|
): APIPromise<WithJob<GenerateRunModelResponse>> {
|
|
41
|
-
|
|
41
|
+
// The captured scope is only a fallback: an explicit `params.projectId` or
|
|
42
|
+
// `options.query.projectId` on this call wins.
|
|
43
|
+
const scope = hasExplicitProjectId(options, params) ? undefined : this._scope;
|
|
44
|
+
return this._client.generate.runModel(this.id, params, withScope(scope, options));
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
/** @internal Create a ModelEntity wrapping raw model data, optionally remembering the originating scope. */
|
|
@@ -69,7 +72,7 @@ export class EnhancedTrain extends Train {
|
|
|
69
72
|
params: TrainTriggerParams,
|
|
70
73
|
options?: RequestOptions,
|
|
71
74
|
): APIPromise<WithJob<TrainTriggerResponse>> {
|
|
72
|
-
return enhanceJob(this._client, super.trigger(modelID, params, options)
|
|
75
|
+
return enhanceJob(this._client, super.trigger(modelID, params, options));
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
|
|
@@ -88,10 +91,9 @@ export class EnhancedModels extends Models {
|
|
|
88
91
|
options?: RequestOptions,
|
|
89
92
|
): APIPromise<EnhancedModelRetrieveResponse> {
|
|
90
93
|
const client = this._client as Scenario;
|
|
91
|
-
|
|
92
|
-
return super.retrieve(modelID, query, options)._thenUnwrap((data) => ({
|
|
94
|
+
return super.retrieve(modelID, query, options)._thenUnwrap((data, props) => ({
|
|
93
95
|
...data,
|
|
94
|
-
model: ModelEntity.from(client, data.model,
|
|
96
|
+
model: ModelEntity.from(client, data.model, sentScope(props.options, client.projectId)),
|
|
95
97
|
}));
|
|
96
98
|
}
|
|
97
99
|
}
|