@trigger.dev/core 0.0.0-prerelease-20260909071038 → 0.0.0-prerelease-streamfix-20260909094302
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/dist/commonjs/schemas/eventFilter.d.ts +105 -27
- package/dist/commonjs/schemas/eventFilter.js +38 -38
- package/dist/commonjs/schemas/eventFilter.js.map +1 -1
- package/dist/commonjs/schemas/json.d.ts +3 -3
- package/dist/commonjs/schemas/json.js +12 -20
- package/dist/commonjs/schemas/json.js.map +1 -1
- package/dist/commonjs/v3/apiClient/core.d.ts +14 -14
- package/dist/commonjs/v3/apiClient/core.js +18 -39
- package/dist/commonjs/v3/apiClient/core.js.map +1 -1
- package/dist/commonjs/v3/apiClient/index.d.ts +184 -83
- package/dist/commonjs/v3/apiClient/index.js +8 -27
- package/dist/commonjs/v3/apiClient/index.js.map +1 -1
- package/dist/commonjs/v3/apiClient/stream.d.ts +4 -4
- package/dist/commonjs/v3/apiClient/stream.js.map +1 -1
- package/dist/commonjs/v3/errors.d.ts +4 -5
- package/dist/commonjs/v3/errors.js.map +1 -1
- package/dist/commonjs/v3/index.d.ts +1 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/realtimeStreams/sessionStreamInstance.js +0 -3
- package/dist/commonjs/v3/realtimeStreams/sessionStreamInstance.js.map +1 -1
- package/dist/commonjs/v3/realtimeStreams/streamsWriterV1.js +0 -3
- package/dist/commonjs/v3/realtimeStreams/streamsWriterV1.js.map +1 -1
- package/dist/commonjs/v3/realtimeStreams/streamsWriterV2.js +0 -4
- package/dist/commonjs/v3/realtimeStreams/streamsWriterV2.js.map +1 -1
- package/dist/commonjs/v3/runEngineWorker/supervisor/http.d.ts +115 -20
- package/dist/commonjs/v3/runEngineWorker/supervisor/http.js +11 -2
- package/dist/commonjs/v3/runEngineWorker/supervisor/http.js.map +1 -1
- package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.d.ts +4187 -558
- package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.js +64 -64
- package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.js.map +1 -1
- package/dist/commonjs/v3/runEngineWorker/workload/http.d.ts +109 -13
- package/dist/commonjs/v3/runEngineWorker/workload/http.js +14 -3
- package/dist/commonjs/v3/runEngineWorker/workload/http.js.map +1 -1
- package/dist/commonjs/v3/runEngineWorker/workload/schemas.d.ts +3624 -443
- package/dist/commonjs/v3/runEngineWorker/workload/schemas.js +9 -9
- package/dist/commonjs/v3/runEngineWorker/workload/schemas.js.map +1 -1
- package/dist/commonjs/v3/schemas/api.d.ts +12680 -1851
- package/dist/commonjs/v3/schemas/api.js +942 -1013
- package/dist/commonjs/v3/schemas/api.js.map +1 -1
- package/dist/commonjs/v3/schemas/build.d.ts +9115 -645
- package/dist/commonjs/v3/schemas/build.js +71 -71
- package/dist/commonjs/v3/schemas/build.js.map +1 -1
- package/dist/commonjs/v3/schemas/checkpoints.d.ts +461 -112
- package/dist/commonjs/v3/schemas/checkpoints.js +11 -11
- package/dist/commonjs/v3/schemas/checkpoints.js.map +1 -1
- package/dist/commonjs/v3/schemas/common.d.ts +6499 -1018
- package/dist/commonjs/v3/schemas/common.js +218 -225
- package/dist/commonjs/v3/schemas/common.js.map +1 -1
- package/dist/commonjs/v3/schemas/config.d.ts +9 -3
- package/dist/commonjs/v3/schemas/config.js +4 -4
- package/dist/commonjs/v3/schemas/config.js.map +1 -1
- package/dist/commonjs/v3/schemas/errors.d.ts +173 -42
- package/dist/commonjs/v3/schemas/errors.js +44 -44
- package/dist/commonjs/v3/schemas/errors.js.map +1 -1
- package/dist/commonjs/v3/schemas/eventFilter.d.ts +91 -23
- package/dist/commonjs/v3/schemas/eventFilter.js +35 -35
- package/dist/commonjs/v3/schemas/eventFilter.js.map +1 -1
- package/dist/commonjs/v3/schemas/fetch.d.ts +415 -119
- package/dist/commonjs/v3/schemas/fetch.js +14 -17
- package/dist/commonjs/v3/schemas/fetch.js.map +1 -1
- package/dist/commonjs/v3/schemas/messages.d.ts +7438 -603
- package/dist/commonjs/v3/schemas/messages.js +50 -50
- package/dist/commonjs/v3/schemas/messages.js.map +1 -1
- package/dist/commonjs/v3/schemas/openTelemetry.d.ts +401 -50
- package/dist/commonjs/v3/schemas/openTelemetry.js +32 -32
- package/dist/commonjs/v3/schemas/openTelemetry.js.map +1 -1
- package/dist/commonjs/v3/schemas/query.d.ts +273 -51
- package/dist/commonjs/v3/schemas/query.js +40 -41
- package/dist/commonjs/v3/schemas/query.js.map +1 -1
- package/dist/commonjs/v3/schemas/queues.d.ts +100 -29
- package/dist/commonjs/v3/schemas/queues.js +22 -22
- package/dist/commonjs/v3/schemas/queues.js.map +1 -1
- package/dist/commonjs/v3/schemas/reports.d.ts +692 -150
- package/dist/commonjs/v3/schemas/reports.js +55 -55
- package/dist/commonjs/v3/schemas/reports.js.map +1 -1
- package/dist/commonjs/v3/schemas/resources.d.ts +5985 -533
- package/dist/commonjs/v3/schemas/resources.js +49 -49
- package/dist/commonjs/v3/schemas/resources.js.map +1 -1
- package/dist/commonjs/v3/schemas/runEngine.d.ts +1821 -456
- package/dist/commonjs/v3/schemas/runEngine.js +107 -108
- package/dist/commonjs/v3/schemas/runEngine.js.map +1 -1
- package/dist/commonjs/v3/schemas/scheduleWindow.d.ts +2 -2
- package/dist/commonjs/v3/schemas/scheduleWindow.js +3 -3
- package/dist/commonjs/v3/schemas/scheduleWindow.js.map +1 -1
- package/dist/commonjs/v3/schemas/schemas.d.ts +7456 -788
- package/dist/commonjs/v3/schemas/schemas.js +132 -133
- package/dist/commonjs/v3/schemas/schemas.js.map +1 -1
- package/dist/commonjs/v3/schemas/style.d.ts +86 -24
- package/dist/commonjs/v3/schemas/style.js +12 -12
- package/dist/commonjs/v3/schemas/style.js.map +1 -1
- package/dist/commonjs/v3/schemas/tokens.d.ts +31 -5
- package/dist/commonjs/v3/schemas/tokens.js +10 -10
- package/dist/commonjs/v3/schemas/tokens.js.map +1 -1
- package/dist/commonjs/v3/schemas/warmStart.d.ts +8 -2
- package/dist/commonjs/v3/schemas/warmStart.js +4 -4
- package/dist/commonjs/v3/schemas/warmStart.js.map +1 -1
- package/dist/commonjs/v3/schemas/webhookApi.d.ts +249 -75
- package/dist/commonjs/v3/schemas/webhookApi.js +41 -41
- package/dist/commonjs/v3/schemas/webhookApi.js.map +1 -1
- package/dist/commonjs/v3/schemas/webhookConfig.d.ts +3309 -473
- package/dist/commonjs/v3/schemas/webhookConfig.js +78 -79
- package/dist/commonjs/v3/schemas/webhookConfig.js.map +1 -1
- package/dist/commonjs/v3/schemas/webhookFilter.d.ts +4 -16
- package/dist/commonjs/v3/schemas/webhookFilter.js +16 -16
- package/dist/commonjs/v3/schemas/webhookFilter.js.map +1 -1
- package/dist/commonjs/v3/schemas/webhooks.d.ts +2055 -247
- package/dist/commonjs/v3/schemas/webhooks.js +115 -116
- package/dist/commonjs/v3/schemas/webhooks.js.map +1 -1
- package/dist/commonjs/v3/serverOnly/httpServer.d.ts +8 -19
- package/dist/commonjs/v3/serverOnly/httpServer.js +3 -6
- package/dist/commonjs/v3/serverOnly/httpServer.js.map +1 -1
- package/dist/commonjs/v3/sessionStreams/chatSnapshot.d.ts +16 -73
- package/dist/commonjs/v3/sessionStreams/chatSnapshot.js +8 -100
- package/dist/commonjs/v3/sessionStreams/chatSnapshot.js.map +1 -1
- package/dist/commonjs/v3/sessionStreams/wireProtocol.d.ts +0 -15
- package/dist/commonjs/v3/sessionStreams/wireProtocol.js +1 -16
- package/dist/commonjs/v3/sessionStreams/wireProtocol.js.map +1 -1
- package/dist/commonjs/v3/test/test-session-stream-manager.js +1 -5
- package/dist/commonjs/v3/test/test-session-stream-manager.js.map +1 -1
- package/dist/commonjs/v3/types/schemas.d.ts +1 -21
- package/dist/commonjs/v3/types/schemas.js +1 -2
- package/dist/commonjs/v3/types/schemas.js.map +1 -1
- package/dist/commonjs/v3/types/tools.d.ts +5 -16
- package/dist/commonjs/v3/types/tools.js +2 -2
- package/dist/commonjs/v3/types/tools.js.map +1 -1
- package/dist/commonjs/v3/utils/ioSerialization.js +3 -3
- package/dist/commonjs/v3/utils/ioSerialization.js.map +1 -1
- package/dist/commonjs/v3/workloadDeploymentToken.d.ts +21 -2
- package/dist/commonjs/v3/workloadDeploymentToken.js +10 -10
- package/dist/commonjs/v3/workloadDeploymentToken.js.map +1 -1
- package/dist/commonjs/v3/zodIpc.d.ts +6 -6
- package/dist/commonjs/v3/zodIpc.js +18 -20
- package/dist/commonjs/v3/zodIpc.js.map +1 -1
- package/dist/commonjs/v3/zodMessageHandler.d.ts +21 -14
- package/dist/commonjs/v3/zodMessageHandler.js +7 -20
- package/dist/commonjs/v3/zodMessageHandler.js.map +1 -1
- package/dist/commonjs/v3/zodSocket.d.ts +11 -11
- package/dist/commonjs/v3/zodSocket.js +8 -9
- package/dist/commonjs/v3/zodSocket.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/schemas/eventFilter.d.ts +105 -27
- package/dist/esm/schemas/eventFilter.js +2 -2
- package/dist/esm/schemas/eventFilter.js.map +1 -1
- package/dist/esm/schemas/json.d.ts +3 -3
- package/dist/esm/schemas/json.js +3 -11
- package/dist/esm/schemas/json.js.map +1 -1
- package/dist/esm/v3/apiClient/core.d.ts +14 -14
- package/dist/esm/v3/apiClient/core.js +17 -38
- package/dist/esm/v3/apiClient/core.js.map +1 -1
- package/dist/esm/v3/apiClient/index.d.ts +184 -83
- package/dist/esm/v3/apiClient/index.js +4 -22
- package/dist/esm/v3/apiClient/index.js.map +1 -1
- package/dist/esm/v3/apiClient/stream.d.ts +4 -4
- package/dist/esm/v3/apiClient/stream.js.map +1 -1
- package/dist/esm/v3/errors.d.ts +4 -5
- package/dist/esm/v3/errors.js.map +1 -1
- package/dist/esm/v3/index.d.ts +1 -1
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/realtimeStreams/sessionStreamInstance.js +0 -3
- package/dist/esm/v3/realtimeStreams/sessionStreamInstance.js.map +1 -1
- package/dist/esm/v3/realtimeStreams/streamsWriterV1.js +0 -3
- package/dist/esm/v3/realtimeStreams/streamsWriterV1.js.map +1 -1
- package/dist/esm/v3/realtimeStreams/streamsWriterV2.js +0 -4
- package/dist/esm/v3/realtimeStreams/streamsWriterV2.js.map +1 -1
- package/dist/esm/v3/runEngineWorker/supervisor/http.d.ts +115 -20
- package/dist/esm/v3/runEngineWorker/supervisor/http.js +10 -1
- package/dist/esm/v3/runEngineWorker/supervisor/http.js.map +1 -1
- package/dist/esm/v3/runEngineWorker/supervisor/schemas.d.ts +4187 -558
- package/dist/esm/v3/runEngineWorker/supervisor/schemas.js +5 -5
- package/dist/esm/v3/runEngineWorker/supervisor/schemas.js.map +1 -1
- package/dist/esm/v3/runEngineWorker/workload/http.d.ts +109 -13
- package/dist/esm/v3/runEngineWorker/workload/http.js +14 -3
- package/dist/esm/v3/runEngineWorker/workload/http.js.map +1 -1
- package/dist/esm/v3/runEngineWorker/workload/schemas.d.ts +3624 -443
- package/dist/esm/v3/runEngineWorker/workload/schemas.js +4 -4
- package/dist/esm/v3/runEngineWorker/workload/schemas.js.map +1 -1
- package/dist/esm/v3/schemas/api.d.ts +12680 -1851
- package/dist/esm/v3/schemas/api.js +35 -106
- package/dist/esm/v3/schemas/api.js.map +1 -1
- package/dist/esm/v3/schemas/build.d.ts +9115 -645
- package/dist/esm/v3/schemas/build.js +10 -10
- package/dist/esm/v3/schemas/build.js.map +1 -1
- package/dist/esm/v3/schemas/checkpoints.d.ts +461 -112
- package/dist/esm/v3/schemas/checkpoints.js +1 -1
- package/dist/esm/v3/schemas/checkpoints.js.map +1 -1
- package/dist/esm/v3/schemas/common.d.ts +6499 -1018
- package/dist/esm/v3/schemas/common.js +10 -17
- package/dist/esm/v3/schemas/common.js.map +1 -1
- package/dist/esm/v3/schemas/config.d.ts +9 -3
- package/dist/esm/v3/schemas/config.js +1 -1
- package/dist/esm/v3/schemas/config.js.map +1 -1
- package/dist/esm/v3/schemas/errors.d.ts +173 -42
- package/dist/esm/v3/schemas/errors.js +1 -1
- package/dist/esm/v3/schemas/errors.js.map +1 -1
- package/dist/esm/v3/schemas/eventFilter.d.ts +91 -23
- package/dist/esm/v3/schemas/eventFilter.js +2 -2
- package/dist/esm/v3/schemas/eventFilter.js.map +1 -1
- package/dist/esm/v3/schemas/fetch.d.ts +415 -119
- package/dist/esm/v3/schemas/fetch.js +3 -6
- package/dist/esm/v3/schemas/fetch.js.map +1 -1
- package/dist/esm/v3/schemas/messages.d.ts +7438 -603
- package/dist/esm/v3/schemas/messages.js +3 -3
- package/dist/esm/v3/schemas/messages.js.map +1 -1
- package/dist/esm/v3/schemas/openTelemetry.d.ts +401 -50
- package/dist/esm/v3/schemas/openTelemetry.js +2 -2
- package/dist/esm/v3/schemas/openTelemetry.js.map +1 -1
- package/dist/esm/v3/schemas/query.d.ts +273 -51
- package/dist/esm/v3/schemas/query.js +3 -4
- package/dist/esm/v3/schemas/query.js.map +1 -1
- package/dist/esm/v3/schemas/queues.d.ts +100 -29
- package/dist/esm/v3/schemas/queues.js +1 -1
- package/dist/esm/v3/schemas/queues.js.map +1 -1
- package/dist/esm/v3/schemas/reports.d.ts +692 -150
- package/dist/esm/v3/schemas/reports.js +5 -5
- package/dist/esm/v3/schemas/reports.js.map +1 -1
- package/dist/esm/v3/schemas/resources.d.ts +5985 -533
- package/dist/esm/v3/schemas/resources.js +3 -3
- package/dist/esm/v3/schemas/resources.js.map +1 -1
- package/dist/esm/v3/schemas/runEngine.d.ts +1821 -456
- package/dist/esm/v3/schemas/runEngine.js +3 -4
- package/dist/esm/v3/schemas/runEngine.js.map +1 -1
- package/dist/esm/v3/schemas/scheduleWindow.d.ts +2 -2
- package/dist/esm/v3/schemas/scheduleWindow.js +1 -1
- package/dist/esm/v3/schemas/scheduleWindow.js.map +1 -1
- package/dist/esm/v3/schemas/schemas.d.ts +7456 -788
- package/dist/esm/v3/schemas/schemas.js +10 -11
- package/dist/esm/v3/schemas/schemas.js.map +1 -1
- package/dist/esm/v3/schemas/style.d.ts +86 -24
- package/dist/esm/v3/schemas/style.js +1 -1
- package/dist/esm/v3/schemas/style.js.map +1 -1
- package/dist/esm/v3/schemas/tokens.d.ts +31 -5
- package/dist/esm/v3/schemas/tokens.js +1 -1
- package/dist/esm/v3/schemas/tokens.js.map +1 -1
- package/dist/esm/v3/schemas/warmStart.d.ts +8 -2
- package/dist/esm/v3/schemas/warmStart.js +1 -1
- package/dist/esm/v3/schemas/warmStart.js.map +1 -1
- package/dist/esm/v3/schemas/webhookApi.d.ts +249 -75
- package/dist/esm/v3/schemas/webhookApi.js +2 -2
- package/dist/esm/v3/schemas/webhookApi.js.map +1 -1
- package/dist/esm/v3/schemas/webhookConfig.d.ts +3309 -473
- package/dist/esm/v3/schemas/webhookConfig.js +9 -10
- package/dist/esm/v3/schemas/webhookConfig.js.map +1 -1
- package/dist/esm/v3/schemas/webhookFilter.d.ts +4 -16
- package/dist/esm/v3/schemas/webhookFilter.js +1 -1
- package/dist/esm/v3/schemas/webhookFilter.js.map +1 -1
- package/dist/esm/v3/schemas/webhooks.d.ts +2055 -247
- package/dist/esm/v3/schemas/webhooks.js +2 -3
- package/dist/esm/v3/schemas/webhooks.js.map +1 -1
- package/dist/esm/v3/serverOnly/httpServer.d.ts +8 -19
- package/dist/esm/v3/serverOnly/httpServer.js +2 -5
- package/dist/esm/v3/serverOnly/httpServer.js.map +1 -1
- package/dist/esm/v3/sessionStreams/chatSnapshot.d.ts +16 -73
- package/dist/esm/v3/sessionStreams/chatSnapshot.js +2 -92
- package/dist/esm/v3/sessionStreams/chatSnapshot.js.map +1 -1
- package/dist/esm/v3/sessionStreams/wireProtocol.d.ts +0 -15
- package/dist/esm/v3/sessionStreams/wireProtocol.js +0 -15
- package/dist/esm/v3/sessionStreams/wireProtocol.js.map +1 -1
- package/dist/esm/v3/test/test-session-stream-manager.js +1 -5
- package/dist/esm/v3/test/test-session-stream-manager.js.map +1 -1
- package/dist/esm/v3/types/schemas.d.ts +1 -21
- package/dist/esm/v3/types/schemas.js +1 -2
- package/dist/esm/v3/types/schemas.js.map +1 -1
- package/dist/esm/v3/types/tools.d.ts +5 -16
- package/dist/esm/v3/types/tools.js +2 -2
- package/dist/esm/v3/types/tools.js.map +1 -1
- package/dist/esm/v3/utils/ioSerialization.js +1 -1
- package/dist/esm/v3/utils/ioSerialization.js.map +1 -1
- package/dist/esm/v3/workloadDeploymentToken.d.ts +21 -2
- package/dist/esm/v3/workloadDeploymentToken.js +1 -1
- package/dist/esm/v3/workloadDeploymentToken.js.map +1 -1
- package/dist/esm/v3/zodIpc.d.ts +6 -6
- package/dist/esm/v3/zodIpc.js +3 -5
- package/dist/esm/v3/zodIpc.js.map +1 -1
- package/dist/esm/v3/zodMessageHandler.d.ts +21 -14
- package/dist/esm/v3/zodMessageHandler.js +3 -16
- package/dist/esm/v3/zodMessageHandler.js.map +1 -1
- package/dist/esm/v3/zodSocket.d.ts +11 -11
- package/dist/esm/v3/zodSocket.js +2 -3
- package/dist/esm/v3/zodSocket.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -7
- package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.d.ts +0 -6
- package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.js +0 -20
- package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.js.map +0 -1
- package/dist/commonjs/v3/utils/zod.d.ts +0 -8
- package/dist/commonjs/v3/utils/zod.js +0 -8
- package/dist/commonjs/v3/utils/zod.js.map +0 -1
- package/dist/esm/v3/apiClient/encodeTaskIdForPath.d.ts +0 -6
- package/dist/esm/v3/apiClient/encodeTaskIdForPath.js +0 -17
- package/dist/esm/v3/apiClient/encodeTaskIdForPath.js.map +0 -1
- package/dist/esm/v3/utils/zod.d.ts +0 -8
- package/dist/esm/v3/utils/zod.js +0 -5
- package/dist/esm/v3/utils/zod.js.map +0 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateArtifactResponseBody = exports.CreateArtifactRequestBody = exports.UpsertBranchResponseBody = exports.UpsertBranchRequestBody = exports.DeploymentTriggeredVia = exports.ExternalBuildData = exports.CancelDeploymentRequestBody = exports.ProgressDeploymentRequestBody = exports.BuildServerMetadata = exports.FinalizeDeploymentRequestBody = exports.StartDeploymentIndexingResponseBody = exports.StartDeploymentIndexingRequestBody = exports.GetEnvironmentVariablesResponseBody = exports.RescheduleRunRequestBody = exports.AddTagsRequestBody = exports.GetBatchResponseBody = exports.BatchTriggerTaskResponse = exports.StreamBatchItemsResponse = exports.BatchItemNDJSON = exports.CreateBatchResponse = exports.CreateBatchRequestBody = exports.BatchTriggerTaskV3Response = exports.BatchTriggerTaskV3RequestBody = exports.BatchTriggerTaskV2Response = exports.BatchTriggerTaskV2RequestBody = exports.BatchTriggerTaskItem = exports.BatchTriggerTaskRequestBody = exports.TriggerTaskResponse = exports.TriggerTaskRequestBody = exports.IdempotencyKeyOptionsSchema = exports.RunTags = exports.CreateBackgroundWorkerResponse = exports.CreateBackgroundWorkerRequestBody = exports.GetJWTResponse = exports.GetJWTRequestBody = exports.GetWorkerByTagResponse = exports.GetWorkerTaskResponse = exports.GetProjectEnvironmentsResponseBody = exports.ProjectEnvironment = exports.GetProjectEnvResponse = exports.CreateProjectRequestBody = exports.CreateOrgResponseBody = exports.CreateOrgRequestBody = exports.GetOrgsResponseBody = exports.GetProjectRuntimesResponseBody = exports.NODE_RUNTIME_UPDATE_MAJOR = exports.GetProjectsResponseBody = exports.GetProjectResponseBody = exports.WhoAmIResponseSchema = exports.RunEngineVersion = void 0;
|
|
4
|
-
exports.CreateBulkActionRequestBody = exports.ListRunResponse = exports.ListRunResponseItem = exports.RetrieveRunResponse = exports.RelatedRunDetails = exports.TriggerFunction = exports.RunScheduleDetails = exports.RunEnvironmentDetails = exports.AttemptStatus = exports.RunStatus = exports.TimezonesResult = exports.ListScheduleOptions = exports.ListSchedulesResult = exports.DeletedScheduleObject = exports.ScheduleObject = exports.ScheduleGenerator = exports.UpdateScheduleOptions = exports.CreateScheduleOptions = exports.ScheduledTaskPayload = exports.ScheduleType = exports.ResetIdempotencyKeyResponse = exports.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDisconnectResponseBody = exports.DevDisconnectRequestBody = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.
|
|
5
|
-
exports.WaitForWaitpointTokenResponseBody = exports.CompleteWaitpointTokenResponseBody = exports.ListSessionsResponseBody = exports.ListedSessionItem = exports.ListSessionsOptions = exports.ListSessionsQueryParams = exports.SessionStatus = exports.CloseSessionRequestBody = exports.UpdateSessionRequestBody = exports.EndAndContinueSessionResponseBody = exports.EndAndContinueSessionRequestBody = exports.RetrieveSessionResponseBody = exports.CreatedSessionResponseBody = exports.SessionItem = exports.CreateSessionRequestBody = exports.SessionTriggerConfig = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = exports.waitpointTokenStatuses = exports.CreateSessionStreamWaitpointResponseBody = exports.CreateSessionStreamWaitpointRequestBody = exports.CreateInputStreamWaitpointResponseBody = exports.CreateInputStreamWaitpointRequestBody = exports.CreateWaitpointTokenResponseBody = exports.CreateWaitpointTokenRequestBody = exports.TimePeriod = exports.SubscribeRealtimeStreamChunkRawShape = exports.RetrieveBatchV2Response = exports.RetrieveBatchResponse = exports.BatchStatus = exports.SubscribeRunRawShape = exports.UpdateMetadataResponseBody = exports.UpdateMetadataRequestBody = exports.EnvironmentVariableWithSecret = exports.EnvironmentVariables = exports.EnvironmentVariable = exports.EnvironmentVariableValue = exports.EnvironmentVariableResponseBody = exports.ImportEnvironmentVariablesRequestBody = exports.UpdateEnvironmentVariableRequestBody = exports.CreateEnvironmentVariableRequestBody = exports.ListBulkActionsResponseBody = exports.AbortBulkActionResponseBody = exports.CreateBulkActionResponseBody = exports.BulkActionObject = exports.BulkActionType =
|
|
6
|
-
exports.PromptOverrideCreatedResponseBody = exports.PromptOkResponseBody = exports.ReactivatePromptOverrideRequestBody = exports.UpdatePromptOverrideRequestBody = exports.CreatePromptOverrideRequestBody = exports.PromotePromptVersionRequestBody = exports.ListPromptVersionsResponseBody = exports.ListPromptsResponseBody = exports.ResolvePromptResponseBody = exports.ResolvePromptRequestBody = exports.ReadSessionStreamRecordsResponseBody = exports.SendInputStreamResponseBody = exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveSpanDetailResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody =
|
|
4
|
+
exports.BulkActionStatus = exports.CreateBulkActionRequestBody = exports.ListRunResponse = exports.ListRunResponseItem = exports.RetrieveRunResponse = exports.RelatedRunDetails = exports.TriggerFunction = exports.RunScheduleDetails = exports.RunEnvironmentDetails = exports.AttemptStatus = exports.RunStatus = exports.TimezonesResult = exports.ListScheduleOptions = exports.ListSchedulesResult = exports.DeletedScheduleObject = exports.ScheduleObject = exports.ScheduleGenerator = exports.UpdateScheduleOptions = exports.CreateScheduleOptions = exports.ScheduledTaskPayload = exports.ScheduleType = exports.ResetIdempotencyKeyResponse = exports.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDisconnectResponseBody = exports.DevDisconnectRequestBody = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.CreateUploadPayloadUrlResponseBody = exports.DeploymentEventFromString = exports.DeploymentEvent = exports.DeploymentFinalizedEvent = exports.DeploymentLogEvent = exports.GetLatestDeploymentResponseBody = exports.GetDeploymentBuildEnvVarsResponseBody = exports.GetDeploymentResponseBody = exports.PromoteDeploymentResponseBody = exports.FailDeploymentResponseBody = exports.FailDeploymentRequestBody = exports.DeploymentErrorData = exports.GenerateRegistryCredentialsResponseBody = exports.RemoteBuildProviderStatusResponseBody = exports.GetDeploySettingsResponseBody = exports.DeployBuildPath = exports.InitializeDeploymentRequestBody = exports.InitializeDeploymentResponseBody = void 0;
|
|
5
|
+
exports.WaitForDurationRequestBody = exports.WaitForWaitpointTokenResponseBody = exports.CompleteWaitpointTokenResponseBody = exports.ListSessionsResponseBody = exports.ListedSessionItem = exports.ListSessionsOptions = exports.ListSessionsQueryParams = exports.SessionStatus = exports.CloseSessionRequestBody = exports.UpdateSessionRequestBody = exports.EndAndContinueSessionResponseBody = exports.EndAndContinueSessionRequestBody = exports.RetrieveSessionResponseBody = exports.CreatedSessionResponseBody = exports.SessionItem = exports.CreateSessionRequestBody = exports.SessionTriggerConfig = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = exports.waitpointTokenStatuses = exports.CreateSessionStreamWaitpointResponseBody = exports.CreateSessionStreamWaitpointRequestBody = exports.CreateInputStreamWaitpointResponseBody = exports.CreateInputStreamWaitpointRequestBody = exports.CreateWaitpointTokenResponseBody = exports.CreateWaitpointTokenRequestBody = exports.TimePeriod = exports.SubscribeRealtimeStreamChunkRawShape = exports.RetrieveBatchV2Response = exports.RetrieveBatchResponse = exports.BatchStatus = exports.SubscribeRunRawShape = exports.UpdateMetadataResponseBody = exports.UpdateMetadataRequestBody = exports.EnvironmentVariableWithSecret = exports.EnvironmentVariables = exports.EnvironmentVariable = exports.EnvironmentVariableValue = exports.EnvironmentVariableResponseBody = exports.ImportEnvironmentVariablesRequestBody = exports.UpdateEnvironmentVariableRequestBody = exports.CreateEnvironmentVariableRequestBody = exports.ListBulkActionsResponseBody = exports.AbortBulkActionResponseBody = exports.CreateBulkActionResponseBody = exports.BulkActionObject = exports.BulkActionType = void 0;
|
|
6
|
+
exports.PromptOverrideCreatedResponseBody = exports.PromptOkResponseBody = exports.ReactivatePromptOverrideRequestBody = exports.UpdatePromptOverrideRequestBody = exports.CreatePromptOverrideRequestBody = exports.PromotePromptVersionRequestBody = exports.ListPromptVersionsResponseBody = exports.ListPromptsResponseBody = exports.ResolvePromptResponseBody = exports.ResolvePromptRequestBody = exports.ReadSessionStreamRecordsResponseBody = exports.SendInputStreamResponseBody = exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveSpanDetailResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody = void 0;
|
|
7
7
|
exports.nodeMajor = nodeMajor;
|
|
8
8
|
exports.needsNodeRuntimeUpdate = needsNodeRuntimeUpdate;
|
|
9
9
|
exports.isWaitpointOutputTimeout = isWaitpointOutputTimeout;
|
|
10
10
|
exports.timeoutError = timeoutError;
|
|
11
|
-
const
|
|
12
|
-
const zod_js_1 = require("../utils/zod.js");
|
|
11
|
+
const zod_1 = require("zod");
|
|
13
12
|
const json_js_1 = require("../../schemas/json.js");
|
|
14
13
|
const externalDeploymentId_js_1 = require("../externalDeploymentId.js");
|
|
15
14
|
const common_js_1 = require("./common.js");
|
|
@@ -18,40 +17,40 @@ const runEngine_js_1 = require("./runEngine.js");
|
|
|
18
17
|
const queues_js_1 = require("./queues.js");
|
|
19
18
|
const schemas_js_1 = require("./schemas.js");
|
|
20
19
|
const build_js_1 = require("./build.js");
|
|
21
|
-
exports.RunEngineVersion =
|
|
22
|
-
exports.WhoAmIResponseSchema =
|
|
23
|
-
userId:
|
|
24
|
-
email:
|
|
25
|
-
dashboardUrl:
|
|
26
|
-
project:
|
|
20
|
+
exports.RunEngineVersion = zod_1.z.union([zod_1.z.literal("V1"), zod_1.z.literal("V2")]);
|
|
21
|
+
exports.WhoAmIResponseSchema = zod_1.z.object({
|
|
22
|
+
userId: zod_1.z.string(),
|
|
23
|
+
email: zod_1.z.string().email(),
|
|
24
|
+
dashboardUrl: zod_1.z.string(),
|
|
25
|
+
project: zod_1.z
|
|
27
26
|
.object({
|
|
28
|
-
name:
|
|
29
|
-
url:
|
|
30
|
-
orgTitle:
|
|
27
|
+
name: zod_1.z.string(),
|
|
28
|
+
url: zod_1.z.string(),
|
|
29
|
+
orgTitle: zod_1.z.string(),
|
|
31
30
|
})
|
|
32
31
|
.optional(),
|
|
33
32
|
});
|
|
34
|
-
exports.GetProjectResponseBody =
|
|
35
|
-
id:
|
|
36
|
-
externalRef:
|
|
33
|
+
exports.GetProjectResponseBody = zod_1.z.object({
|
|
34
|
+
id: zod_1.z.string(),
|
|
35
|
+
externalRef: zod_1.z
|
|
37
36
|
.string()
|
|
38
37
|
.describe("The external reference for the project, also known as the project ref, a unique identifier starting with proj_"),
|
|
39
|
-
name:
|
|
40
|
-
slug:
|
|
41
|
-
createdAt:
|
|
38
|
+
name: zod_1.z.string(),
|
|
39
|
+
slug: zod_1.z.string(),
|
|
40
|
+
createdAt: zod_1.z.coerce.date(),
|
|
42
41
|
// Worker-group name of the project's default region, or null when unset
|
|
43
42
|
// (the project falls back to the global platform default). Optional so a
|
|
44
43
|
// newer client still parses responses from an older server that omits it.
|
|
45
|
-
defaultRegion:
|
|
44
|
+
defaultRegion: zod_1.z.string().nullable().optional(),
|
|
46
45
|
defaultRuntime: build_js_1.BuildRuntime.nullable().optional(),
|
|
47
|
-
organization:
|
|
48
|
-
id:
|
|
49
|
-
title:
|
|
50
|
-
slug:
|
|
51
|
-
createdAt:
|
|
46
|
+
organization: zod_1.z.object({
|
|
47
|
+
id: zod_1.z.string(),
|
|
48
|
+
title: zod_1.z.string(),
|
|
49
|
+
slug: zod_1.z.string(),
|
|
50
|
+
createdAt: zod_1.z.coerce.date(),
|
|
52
51
|
}),
|
|
53
52
|
});
|
|
54
|
-
exports.GetProjectsResponseBody =
|
|
53
|
+
exports.GetProjectsResponseBody = zod_1.z.array(exports.GetProjectResponseBody);
|
|
55
54
|
/** The Node.js major version currently targeted by the runtime update report. */
|
|
56
55
|
exports.NODE_RUNTIME_UPDATE_MAJOR = 21;
|
|
57
56
|
/**
|
|
@@ -81,175 +80,169 @@ function needsNodeRuntimeUpdate(runtime, runtimeVersion) {
|
|
|
81
80
|
? Number(configuredMajorMatch[1]) === exports.NODE_RUNTIME_UPDATE_MAJOR
|
|
82
81
|
: false;
|
|
83
82
|
}
|
|
84
|
-
exports.GetProjectRuntimesResponseBody =
|
|
85
|
-
organization:
|
|
86
|
-
title:
|
|
87
|
-
slug:
|
|
83
|
+
exports.GetProjectRuntimesResponseBody = zod_1.z.array(zod_1.z.object({
|
|
84
|
+
organization: zod_1.z.object({
|
|
85
|
+
title: zod_1.z.string(),
|
|
86
|
+
slug: zod_1.z.string(),
|
|
88
87
|
}),
|
|
89
|
-
project:
|
|
90
|
-
name:
|
|
91
|
-
slug:
|
|
92
|
-
externalRef:
|
|
88
|
+
project: zod_1.z.object({
|
|
89
|
+
name: zod_1.z.string(),
|
|
90
|
+
slug: zod_1.z.string(),
|
|
91
|
+
externalRef: zod_1.z.string(),
|
|
93
92
|
}),
|
|
94
|
-
environment:
|
|
95
|
-
slug:
|
|
93
|
+
environment: zod_1.z.object({
|
|
94
|
+
slug: zod_1.z.string(),
|
|
96
95
|
}),
|
|
97
|
-
deployment:
|
|
96
|
+
deployment: zod_1.z
|
|
98
97
|
.object({
|
|
99
|
-
runtime:
|
|
100
|
-
runtimeVersion:
|
|
101
|
-
nodeMajor:
|
|
102
|
-
deployedAt:
|
|
103
|
-
shortCode:
|
|
98
|
+
runtime: zod_1.z.string().nullable(),
|
|
99
|
+
runtimeVersion: zod_1.z.string().nullable(),
|
|
100
|
+
nodeMajor: zod_1.z.number().int().positive().nullable(),
|
|
101
|
+
deployedAt: zod_1.z.coerce.date().nullable(),
|
|
102
|
+
shortCode: zod_1.z.string(),
|
|
104
103
|
})
|
|
105
104
|
.nullable(),
|
|
106
105
|
}));
|
|
107
|
-
exports.GetOrgsResponseBody =
|
|
108
|
-
id:
|
|
109
|
-
title:
|
|
110
|
-
slug:
|
|
111
|
-
createdAt:
|
|
106
|
+
exports.GetOrgsResponseBody = zod_1.z.array(zod_1.z.object({
|
|
107
|
+
id: zod_1.z.string(),
|
|
108
|
+
title: zod_1.z.string(),
|
|
109
|
+
slug: zod_1.z.string(),
|
|
110
|
+
createdAt: zod_1.z.coerce.date(),
|
|
112
111
|
}));
|
|
113
|
-
exports.CreateOrgRequestBody =
|
|
114
|
-
title:
|
|
115
|
-
companySize:
|
|
116
|
-
companyUrl:
|
|
117
|
-
});
|
|
118
|
-
exports.CreateOrgResponseBody =
|
|
119
|
-
id:
|
|
120
|
-
title:
|
|
121
|
-
slug:
|
|
122
|
-
createdAt:
|
|
123
|
-
});
|
|
124
|
-
exports.CreateProjectRequestBody =
|
|
125
|
-
name:
|
|
112
|
+
exports.CreateOrgRequestBody = zod_1.z.object({
|
|
113
|
+
title: zod_1.z.string().trim().min(3).max(50),
|
|
114
|
+
companySize: zod_1.z.string().optional(),
|
|
115
|
+
companyUrl: zod_1.z.string().optional(),
|
|
116
|
+
});
|
|
117
|
+
exports.CreateOrgResponseBody = zod_1.z.object({
|
|
118
|
+
id: zod_1.z.string(),
|
|
119
|
+
title: zod_1.z.string(),
|
|
120
|
+
slug: zod_1.z.string(),
|
|
121
|
+
createdAt: zod_1.z.coerce.date(),
|
|
122
|
+
});
|
|
123
|
+
exports.CreateProjectRequestBody = zod_1.z.object({
|
|
124
|
+
name: zod_1.z
|
|
126
125
|
.string()
|
|
127
126
|
.trim()
|
|
128
127
|
.min(1, "Name is required")
|
|
129
128
|
.max(255, "Name must be less than 255 characters"),
|
|
130
129
|
});
|
|
131
|
-
exports.GetProjectEnvResponse =
|
|
132
|
-
apiKey:
|
|
133
|
-
name:
|
|
134
|
-
apiUrl:
|
|
135
|
-
projectId:
|
|
130
|
+
exports.GetProjectEnvResponse = zod_1.z.object({
|
|
131
|
+
apiKey: zod_1.z.string(),
|
|
132
|
+
name: zod_1.z.string(),
|
|
133
|
+
apiUrl: zod_1.z.string(),
|
|
134
|
+
projectId: zod_1.z.string(),
|
|
136
135
|
defaultRuntime: build_js_1.BuildRuntime.nullable().optional(),
|
|
137
136
|
});
|
|
138
|
-
exports.ProjectEnvironment =
|
|
139
|
-
id:
|
|
137
|
+
exports.ProjectEnvironment = zod_1.z.object({
|
|
138
|
+
id: zod_1.z.string(),
|
|
140
139
|
/// The slug used as the environment identifier in env var endpoints (e.g. "dev", "stg", "prod", "preview")
|
|
141
|
-
slug:
|
|
142
|
-
type:
|
|
140
|
+
slug: zod_1.z.string(),
|
|
141
|
+
type: zod_1.z.enum(["DEVELOPMENT", "STAGING", "PREVIEW", "PRODUCTION"]),
|
|
143
142
|
/// Whether this is the branchable parent (preview); individual branches are not returned
|
|
144
|
-
isBranchableEnvironment:
|
|
145
|
-
branchName:
|
|
146
|
-
paused:
|
|
143
|
+
isBranchableEnvironment: zod_1.z.boolean(),
|
|
144
|
+
branchName: zod_1.z.string().nullable(),
|
|
145
|
+
paused: zod_1.z.boolean(),
|
|
147
146
|
});
|
|
148
|
-
exports.GetProjectEnvironmentsResponseBody =
|
|
147
|
+
exports.GetProjectEnvironmentsResponseBody = zod_1.z.array(exports.ProjectEnvironment);
|
|
149
148
|
// Zod schema for the response body type
|
|
150
|
-
exports.GetWorkerTaskResponse =
|
|
151
|
-
id:
|
|
152
|
-
slug:
|
|
153
|
-
filePath:
|
|
154
|
-
triggerSource:
|
|
155
|
-
createdAt:
|
|
156
|
-
payloadSchema:
|
|
157
|
-
queueConfig:
|
|
158
|
-
});
|
|
159
|
-
exports.GetWorkerByTagResponse =
|
|
160
|
-
worker:
|
|
161
|
-
id:
|
|
162
|
-
version:
|
|
163
|
-
engine:
|
|
164
|
-
sdkVersion:
|
|
165
|
-
cliVersion:
|
|
166
|
-
tasks:
|
|
149
|
+
exports.GetWorkerTaskResponse = zod_1.z.object({
|
|
150
|
+
id: zod_1.z.string(),
|
|
151
|
+
slug: zod_1.z.string(),
|
|
152
|
+
filePath: zod_1.z.string(),
|
|
153
|
+
triggerSource: zod_1.z.string(),
|
|
154
|
+
createdAt: zod_1.z.coerce.date(),
|
|
155
|
+
payloadSchema: zod_1.z.any().nullish(),
|
|
156
|
+
queueConfig: zod_1.z.any().nullish(),
|
|
157
|
+
});
|
|
158
|
+
exports.GetWorkerByTagResponse = zod_1.z.object({
|
|
159
|
+
worker: zod_1.z.object({
|
|
160
|
+
id: zod_1.z.string(),
|
|
161
|
+
version: zod_1.z.string(),
|
|
162
|
+
engine: zod_1.z.string().nullish(),
|
|
163
|
+
sdkVersion: zod_1.z.string().nullish(),
|
|
164
|
+
cliVersion: zod_1.z.string().nullish(),
|
|
165
|
+
tasks: zod_1.z.array(exports.GetWorkerTaskResponse),
|
|
167
166
|
}),
|
|
168
|
-
urls:
|
|
169
|
-
runs:
|
|
167
|
+
urls: zod_1.z.object({
|
|
168
|
+
runs: zod_1.z.string(),
|
|
170
169
|
}),
|
|
171
170
|
});
|
|
172
|
-
exports.GetJWTRequestBody =
|
|
173
|
-
claims:
|
|
171
|
+
exports.GetJWTRequestBody = zod_1.z.object({
|
|
172
|
+
claims: zod_1.z
|
|
174
173
|
.object({
|
|
175
|
-
scopes:
|
|
174
|
+
scopes: zod_1.z.array(zod_1.z.string()).default([]),
|
|
176
175
|
})
|
|
177
176
|
.optional(),
|
|
178
|
-
expirationTime:
|
|
177
|
+
expirationTime: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
|
|
179
178
|
});
|
|
180
|
-
exports.GetJWTResponse =
|
|
181
|
-
token:
|
|
182
|
-
// The environment the exchange resolved, so a caller that named a slug learns the id.
|
|
183
|
-
environmentId: v4_1.z.string().optional(),
|
|
179
|
+
exports.GetJWTResponse = zod_1.z.object({
|
|
180
|
+
token: zod_1.z.string(),
|
|
184
181
|
});
|
|
185
|
-
exports.CreateBackgroundWorkerRequestBody =
|
|
186
|
-
localOnly:
|
|
182
|
+
exports.CreateBackgroundWorkerRequestBody = zod_1.z.object({
|
|
183
|
+
localOnly: zod_1.z.boolean(),
|
|
187
184
|
metadata: resources_js_1.BackgroundWorkerMetadata,
|
|
188
185
|
engine: exports.RunEngineVersion.optional(),
|
|
189
|
-
supportsLazyAttempts:
|
|
190
|
-
buildPlatform:
|
|
191
|
-
targetPlatform:
|
|
186
|
+
supportsLazyAttempts: zod_1.z.boolean().optional(),
|
|
187
|
+
buildPlatform: zod_1.z.string().optional(),
|
|
188
|
+
targetPlatform: zod_1.z.string().optional(),
|
|
192
189
|
});
|
|
193
|
-
exports.CreateBackgroundWorkerResponse =
|
|
194
|
-
id:
|
|
195
|
-
version:
|
|
196
|
-
contentHash:
|
|
190
|
+
exports.CreateBackgroundWorkerResponse = zod_1.z.object({
|
|
191
|
+
id: zod_1.z.string(),
|
|
192
|
+
version: zod_1.z.string(),
|
|
193
|
+
contentHash: zod_1.z.string(),
|
|
197
194
|
});
|
|
198
195
|
//an array of 1, 2, or 3 strings
|
|
199
|
-
const RunTag =
|
|
200
|
-
exports.RunTags =
|
|
196
|
+
const RunTag = zod_1.z.string().max(128, "Tags must be less than 128 characters");
|
|
197
|
+
exports.RunTags = zod_1.z.union([RunTag, RunTag.array()]);
|
|
201
198
|
/** Stores the original user-provided idempotency key and scope */
|
|
202
|
-
exports.IdempotencyKeyOptionsSchema =
|
|
203
|
-
key:
|
|
204
|
-
scope:
|
|
199
|
+
exports.IdempotencyKeyOptionsSchema = zod_1.z.object({
|
|
200
|
+
key: zod_1.z.string(),
|
|
201
|
+
scope: zod_1.z.enum(["run", "attempt", "global"]),
|
|
205
202
|
});
|
|
206
203
|
// Coerces user-supplied concurrencyKey values to string. The downstream Prisma
|
|
207
204
|
// column is String?, so passing a number (a common foot-gun when callers do
|
|
208
205
|
// `concurrencyKey: payload.userId`) used to fail at `prisma.taskRun.create`
|
|
209
206
|
// with PrismaClientValidationError. Accept the intent and stringify here.
|
|
210
|
-
const ConcurrencyKeySchema =
|
|
211
|
-
const ExternalDeploymentId =
|
|
212
|
-
// `null` is the opt-out sentinel callers write; treat it as absent, not a validation error.
|
|
213
|
-
if (value === null) {
|
|
214
|
-
return undefined;
|
|
215
|
-
}
|
|
207
|
+
const ConcurrencyKeySchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform((value) => String(value));
|
|
208
|
+
const ExternalDeploymentId = zod_1.z.preprocess((value) => {
|
|
216
209
|
if (typeof value !== "string") {
|
|
217
210
|
return value;
|
|
218
211
|
}
|
|
219
212
|
const trimmed = value.trim();
|
|
220
213
|
return trimmed === "" ? undefined : trimmed;
|
|
221
|
-
},
|
|
222
|
-
exports.TriggerTaskRequestBody =
|
|
214
|
+
}, zod_1.z.string().max(externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH, `externalId must be at most ${externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH} characters`).optional());
|
|
215
|
+
exports.TriggerTaskRequestBody = zod_1.z
|
|
223
216
|
.object({
|
|
224
|
-
payload:
|
|
225
|
-
context:
|
|
226
|
-
options:
|
|
217
|
+
payload: zod_1.z.any(),
|
|
218
|
+
context: zod_1.z.any(),
|
|
219
|
+
options: zod_1.z
|
|
227
220
|
.object({
|
|
228
221
|
/** @deprecated engine v1 only */
|
|
229
|
-
dependentAttempt:
|
|
222
|
+
dependentAttempt: zod_1.z.string().optional(),
|
|
230
223
|
/** @deprecated engine v1 only */
|
|
231
|
-
parentAttempt:
|
|
224
|
+
parentAttempt: zod_1.z.string().optional(),
|
|
232
225
|
/** @deprecated engine v1 only */
|
|
233
|
-
dependentBatch:
|
|
226
|
+
dependentBatch: zod_1.z.string().optional(),
|
|
234
227
|
/**
|
|
235
228
|
* If triggered in a batch, this is the BatchTaskRun id
|
|
236
229
|
*/
|
|
237
|
-
parentBatch:
|
|
230
|
+
parentBatch: zod_1.z.string().optional(),
|
|
238
231
|
/**
|
|
239
232
|
* RunEngine v2
|
|
240
233
|
* If triggered inside another run, the parentRunId is the friendly ID of the parent run.
|
|
241
234
|
*/
|
|
242
|
-
parentRunId:
|
|
235
|
+
parentRunId: zod_1.z.string().optional(),
|
|
243
236
|
/**
|
|
244
237
|
* RunEngine v2
|
|
245
238
|
* Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
|
|
246
239
|
*/
|
|
247
|
-
resumeParentOnCompletion:
|
|
240
|
+
resumeParentOnCompletion: zod_1.z.boolean().optional(),
|
|
248
241
|
/**
|
|
249
242
|
* Locks the version to the passed value.
|
|
250
243
|
* Automatically set when using `triggerAndWait` or `batchTriggerAndWait`
|
|
251
244
|
*/
|
|
252
|
-
lockToVersion:
|
|
245
|
+
lockToVersion: zod_1.z.string().optional(),
|
|
253
246
|
/**
|
|
254
247
|
* The external deployment id the calling application belongs to — a commit SHA, a
|
|
255
248
|
* CI run id, a release tag. Independent of `lockToVersion`: the SDK reports every
|
|
@@ -258,49 +251,49 @@ exports.TriggerTaskRequestBody = v4_1.z
|
|
|
258
251
|
* deployment that has not landed yet parks the run rather than failing it.
|
|
259
252
|
*/
|
|
260
253
|
externalDeploymentId: ExternalDeploymentId,
|
|
261
|
-
queue:
|
|
254
|
+
queue: zod_1.z
|
|
262
255
|
.object({
|
|
263
|
-
name:
|
|
256
|
+
name: zod_1.z.string(),
|
|
264
257
|
// @deprecated, this is now specified on the queue
|
|
265
|
-
concurrencyLimit:
|
|
258
|
+
concurrencyLimit: zod_1.z.number().int().optional(),
|
|
266
259
|
})
|
|
267
260
|
.optional(),
|
|
268
261
|
concurrencyKey: ConcurrencyKeySchema.optional(),
|
|
269
|
-
delay:
|
|
270
|
-
idempotencyKey:
|
|
262
|
+
delay: zod_1.z.string().or(zod_1.z.coerce.date()).optional(),
|
|
263
|
+
idempotencyKey: zod_1.z
|
|
271
264
|
.string()
|
|
272
265
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
273
266
|
// on the underlying table — values past this fail at the database layer
|
|
274
267
|
// rather than returning a clean 400.
|
|
275
268
|
.max(2048, "idempotencyKey must be 2048 characters or less")
|
|
276
269
|
.optional(),
|
|
277
|
-
idempotencyKeyTTL:
|
|
270
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
278
271
|
/** The original user-provided idempotency key and scope */
|
|
279
272
|
idempotencyKeyOptions: exports.IdempotencyKeyOptionsSchema.optional(),
|
|
280
273
|
machine: common_js_1.MachinePresetName.optional(),
|
|
281
|
-
maxAttempts:
|
|
282
|
-
maxDuration:
|
|
283
|
-
metadata:
|
|
284
|
-
metadataType:
|
|
285
|
-
payloadType:
|
|
274
|
+
maxAttempts: zod_1.z.number().int().optional(),
|
|
275
|
+
maxDuration: zod_1.z.number().optional(),
|
|
276
|
+
metadata: zod_1.z.any(),
|
|
277
|
+
metadataType: zod_1.z.string().optional(),
|
|
278
|
+
payloadType: zod_1.z.string().optional(),
|
|
286
279
|
/**
|
|
287
280
|
* Byte size of the (pre-offload) serialized payload, measured by the caller
|
|
288
281
|
* before any object-store offload. Lets the pipeline know how large a payload
|
|
289
282
|
* is without downloading an "application/store" reference.
|
|
290
283
|
*/
|
|
291
|
-
payloadSize:
|
|
284
|
+
payloadSize: zod_1.z.number().int().nonnegative().optional(),
|
|
292
285
|
tags: exports.RunTags.optional(),
|
|
293
|
-
test:
|
|
294
|
-
ttl:
|
|
295
|
-
priority:
|
|
296
|
-
bulkActionId:
|
|
297
|
-
region:
|
|
298
|
-
debounce:
|
|
286
|
+
test: zod_1.z.boolean().optional(),
|
|
287
|
+
ttl: zod_1.z.string().or(zod_1.z.number().nonnegative().int()).optional(),
|
|
288
|
+
priority: zod_1.z.number().optional(),
|
|
289
|
+
bulkActionId: zod_1.z.string().optional(),
|
|
290
|
+
region: zod_1.z.string().optional(),
|
|
291
|
+
debounce: zod_1.z
|
|
299
292
|
.object({
|
|
300
|
-
key:
|
|
301
|
-
delay:
|
|
302
|
-
mode:
|
|
303
|
-
maxDelay:
|
|
293
|
+
key: zod_1.z.string().max(512),
|
|
294
|
+
delay: zod_1.z.string(),
|
|
295
|
+
mode: zod_1.z.enum(["leading", "trailing"]).optional(),
|
|
296
|
+
maxDelay: zod_1.z.string().optional(),
|
|
304
297
|
})
|
|
305
298
|
.optional(),
|
|
306
299
|
})
|
|
@@ -312,113 +305,113 @@ exports.TriggerTaskRequestBody = v4_1.z
|
|
|
312
305
|
}
|
|
313
306
|
if (typeof value.payload !== "string" || value.payload.length === 0) {
|
|
314
307
|
ctx.addIssue({
|
|
315
|
-
code:
|
|
308
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
316
309
|
message: "payload must be a non-empty string when options.payloadType is application/store",
|
|
317
310
|
path: ["payload"],
|
|
318
311
|
});
|
|
319
312
|
}
|
|
320
313
|
});
|
|
321
|
-
exports.TriggerTaskResponse =
|
|
322
|
-
id:
|
|
323
|
-
isCached:
|
|
314
|
+
exports.TriggerTaskResponse = zod_1.z.object({
|
|
315
|
+
id: zod_1.z.string(),
|
|
316
|
+
isCached: zod_1.z.boolean().optional(),
|
|
324
317
|
});
|
|
325
|
-
exports.BatchTriggerTaskRequestBody =
|
|
318
|
+
exports.BatchTriggerTaskRequestBody = zod_1.z.object({
|
|
326
319
|
items: exports.TriggerTaskRequestBody.array(),
|
|
327
|
-
dependentAttempt:
|
|
320
|
+
dependentAttempt: zod_1.z.string().optional(),
|
|
328
321
|
});
|
|
329
|
-
exports.BatchTriggerTaskItem =
|
|
330
|
-
task:
|
|
331
|
-
payload:
|
|
332
|
-
context:
|
|
333
|
-
options:
|
|
322
|
+
exports.BatchTriggerTaskItem = zod_1.z.object({
|
|
323
|
+
task: zod_1.z.string(),
|
|
324
|
+
payload: zod_1.z.any(),
|
|
325
|
+
context: zod_1.z.any(),
|
|
326
|
+
options: zod_1.z
|
|
334
327
|
.object({
|
|
335
328
|
concurrencyKey: ConcurrencyKeySchema.optional(),
|
|
336
|
-
delay:
|
|
337
|
-
idempotencyKey:
|
|
329
|
+
delay: zod_1.z.string().or(zod_1.z.coerce.date()).optional(),
|
|
330
|
+
idempotencyKey: zod_1.z
|
|
338
331
|
.string()
|
|
339
332
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
340
333
|
// on the underlying table — values past this fail at the database layer
|
|
341
334
|
// rather than returning a clean 400.
|
|
342
335
|
.max(2048, "idempotencyKey must be 2048 characters or less")
|
|
343
336
|
.optional(),
|
|
344
|
-
idempotencyKeyTTL:
|
|
337
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
345
338
|
/** The original user-provided idempotency key and scope */
|
|
346
339
|
idempotencyKeyOptions: exports.IdempotencyKeyOptionsSchema.optional(),
|
|
347
|
-
lockToVersion:
|
|
340
|
+
lockToVersion: zod_1.z.string().optional(),
|
|
348
341
|
/** See `TriggerTaskRequestBody.options.externalDeploymentId`. */
|
|
349
342
|
externalDeploymentId: ExternalDeploymentId,
|
|
350
343
|
machine: common_js_1.MachinePresetName.optional(),
|
|
351
|
-
maxAttempts:
|
|
352
|
-
maxDuration:
|
|
353
|
-
metadata:
|
|
354
|
-
metadataType:
|
|
355
|
-
parentAttempt:
|
|
356
|
-
payloadType:
|
|
344
|
+
maxAttempts: zod_1.z.number().int().optional(),
|
|
345
|
+
maxDuration: zod_1.z.number().optional(),
|
|
346
|
+
metadata: zod_1.z.any(),
|
|
347
|
+
metadataType: zod_1.z.string().optional(),
|
|
348
|
+
parentAttempt: zod_1.z.string().optional(),
|
|
349
|
+
payloadType: zod_1.z.string().optional(),
|
|
357
350
|
/** Byte size of the (pre-offload) serialized payload for this item. */
|
|
358
|
-
payloadSize:
|
|
359
|
-
queue:
|
|
351
|
+
payloadSize: zod_1.z.number().int().nonnegative().optional(),
|
|
352
|
+
queue: zod_1.z
|
|
360
353
|
.object({
|
|
361
|
-
name:
|
|
354
|
+
name: zod_1.z.string(),
|
|
362
355
|
})
|
|
363
356
|
.optional(),
|
|
364
357
|
tags: exports.RunTags.optional(),
|
|
365
|
-
test:
|
|
366
|
-
ttl:
|
|
367
|
-
priority:
|
|
368
|
-
region:
|
|
369
|
-
debounce:
|
|
358
|
+
test: zod_1.z.boolean().optional(),
|
|
359
|
+
ttl: zod_1.z.string().or(zod_1.z.number().nonnegative().int()).optional(),
|
|
360
|
+
priority: zod_1.z.number().optional(),
|
|
361
|
+
region: zod_1.z.string().optional(),
|
|
362
|
+
debounce: zod_1.z
|
|
370
363
|
.object({
|
|
371
|
-
key:
|
|
372
|
-
delay:
|
|
373
|
-
mode:
|
|
374
|
-
maxDelay:
|
|
364
|
+
key: zod_1.z.string().max(512),
|
|
365
|
+
delay: zod_1.z.string(),
|
|
366
|
+
mode: zod_1.z.enum(["leading", "trailing"]).optional(),
|
|
367
|
+
maxDelay: zod_1.z.string().optional(),
|
|
375
368
|
})
|
|
376
369
|
.optional(),
|
|
377
370
|
})
|
|
378
371
|
.optional(),
|
|
379
372
|
});
|
|
380
|
-
exports.BatchTriggerTaskV2RequestBody =
|
|
373
|
+
exports.BatchTriggerTaskV2RequestBody = zod_1.z.object({
|
|
381
374
|
items: exports.BatchTriggerTaskItem.array(),
|
|
382
375
|
/** @deprecated engine v1 only */
|
|
383
|
-
dependentAttempt:
|
|
376
|
+
dependentAttempt: zod_1.z.string().optional(),
|
|
384
377
|
/**
|
|
385
378
|
* RunEngine v2
|
|
386
379
|
* If triggered inside another run, the parentRunId is the friendly ID of the parent run.
|
|
387
380
|
*/
|
|
388
|
-
parentRunId:
|
|
381
|
+
parentRunId: zod_1.z.string().optional(),
|
|
389
382
|
/**
|
|
390
383
|
* RunEngine v2
|
|
391
384
|
* Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
|
|
392
385
|
*/
|
|
393
|
-
resumeParentOnCompletion:
|
|
394
|
-
});
|
|
395
|
-
exports.BatchTriggerTaskV2Response =
|
|
396
|
-
id:
|
|
397
|
-
isCached:
|
|
398
|
-
idempotencyKey:
|
|
399
|
-
runs:
|
|
400
|
-
id:
|
|
401
|
-
taskIdentifier:
|
|
402
|
-
isCached:
|
|
403
|
-
idempotencyKey:
|
|
386
|
+
resumeParentOnCompletion: zod_1.z.boolean().optional(),
|
|
387
|
+
});
|
|
388
|
+
exports.BatchTriggerTaskV2Response = zod_1.z.object({
|
|
389
|
+
id: zod_1.z.string(),
|
|
390
|
+
isCached: zod_1.z.boolean(),
|
|
391
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
392
|
+
runs: zod_1.z.array(zod_1.z.object({
|
|
393
|
+
id: zod_1.z.string(),
|
|
394
|
+
taskIdentifier: zod_1.z.string(),
|
|
395
|
+
isCached: zod_1.z.boolean(),
|
|
396
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
404
397
|
})),
|
|
405
398
|
});
|
|
406
|
-
exports.BatchTriggerTaskV3RequestBody =
|
|
399
|
+
exports.BatchTriggerTaskV3RequestBody = zod_1.z.object({
|
|
407
400
|
items: exports.BatchTriggerTaskItem.array(),
|
|
408
401
|
/**
|
|
409
402
|
* RunEngine v2
|
|
410
403
|
* If triggered inside another run, the parentRunId is the friendly ID of the parent run.
|
|
411
404
|
*/
|
|
412
|
-
parentRunId:
|
|
405
|
+
parentRunId: zod_1.z.string().optional(),
|
|
413
406
|
/**
|
|
414
407
|
* RunEngine v2
|
|
415
408
|
* Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
|
|
416
409
|
*/
|
|
417
|
-
resumeParentOnCompletion:
|
|
410
|
+
resumeParentOnCompletion: zod_1.z.boolean().optional(),
|
|
418
411
|
});
|
|
419
|
-
exports.BatchTriggerTaskV3Response =
|
|
420
|
-
id:
|
|
421
|
-
runCount:
|
|
412
|
+
exports.BatchTriggerTaskV3Response = zod_1.z.object({
|
|
413
|
+
id: zod_1.z.string(),
|
|
414
|
+
runCount: zod_1.z.number(),
|
|
422
415
|
});
|
|
423
416
|
// ============================================================================
|
|
424
417
|
// 2-Phase Batch API (v3) - Streaming NDJSON Support
|
|
@@ -427,17 +420,17 @@ exports.BatchTriggerTaskV3Response = v4_1.z.object({
|
|
|
427
420
|
* Phase 1: Create batch request body
|
|
428
421
|
* Creates the batch record and optionally blocks parent run for batchTriggerAndWait
|
|
429
422
|
*/
|
|
430
|
-
exports.CreateBatchRequestBody =
|
|
423
|
+
exports.CreateBatchRequestBody = zod_1.z.object({
|
|
431
424
|
/** Expected number of items in the batch */
|
|
432
|
-
runCount:
|
|
425
|
+
runCount: zod_1.z.number().int().positive(),
|
|
433
426
|
/** Distinct task identifiers expected in the item stream */
|
|
434
|
-
taskIdentifiers:
|
|
427
|
+
taskIdentifiers: zod_1.z.array(zod_1.z.string().min(1)).min(1).optional(),
|
|
435
428
|
/** Parent run ID for batchTriggerAndWait (friendly ID) */
|
|
436
|
-
parentRunId:
|
|
429
|
+
parentRunId: zod_1.z.string().optional(),
|
|
437
430
|
/** Whether to resume parent on completion (true for batchTriggerAndWait) */
|
|
438
|
-
resumeParentOnCompletion:
|
|
431
|
+
resumeParentOnCompletion: zod_1.z.boolean().optional(),
|
|
439
432
|
/** Idempotency key for the batch */
|
|
440
|
-
idempotencyKey:
|
|
433
|
+
idempotencyKey: zod_1.z
|
|
441
434
|
.string()
|
|
442
435
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
443
436
|
// on the underlying table — values past this fail at the database layer
|
|
@@ -450,15 +443,15 @@ exports.CreateBatchRequestBody = v4_1.z.object({
|
|
|
450
443
|
/**
|
|
451
444
|
* Phase 1: Create batch response
|
|
452
445
|
*/
|
|
453
|
-
exports.CreateBatchResponse =
|
|
446
|
+
exports.CreateBatchResponse = zod_1.z.object({
|
|
454
447
|
/** The batch ID (friendly ID) */
|
|
455
|
-
id:
|
|
448
|
+
id: zod_1.z.string(),
|
|
456
449
|
/** The expected run count */
|
|
457
|
-
runCount:
|
|
450
|
+
runCount: zod_1.z.number(),
|
|
458
451
|
/** Whether this response came from a cached/idempotent batch */
|
|
459
|
-
isCached:
|
|
452
|
+
isCached: zod_1.z.boolean(),
|
|
460
453
|
/** The idempotency key if provided */
|
|
461
|
-
idempotencyKey:
|
|
454
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
462
455
|
});
|
|
463
456
|
/**
|
|
464
457
|
* Phase 2: Individual item in the NDJSON stream
|
|
@@ -466,16 +459,16 @@ exports.CreateBatchResponse = v4_1.z.object({
|
|
|
466
459
|
*
|
|
467
460
|
* `options` reuses the strict shape from BatchTriggerTaskItem so that the
|
|
468
461
|
* Phase-2 streaming path validates option fields identically to the V2/V3
|
|
469
|
-
* batch trigger endpoints — historically this used z.record(z.
|
|
462
|
+
* batch trigger endpoints — historically this used z.record(z.unknown()) and
|
|
470
463
|
* let invalid values (e.g. numeric concurrencyKey) reach Prisma.
|
|
471
464
|
*/
|
|
472
|
-
exports.BatchItemNDJSON =
|
|
465
|
+
exports.BatchItemNDJSON = zod_1.z.object({
|
|
473
466
|
/** Zero-based index of this item (used for idempotency and ordering) */
|
|
474
|
-
index:
|
|
467
|
+
index: zod_1.z.number().int().nonnegative(),
|
|
475
468
|
/** The task identifier to trigger */
|
|
476
|
-
task:
|
|
469
|
+
task: zod_1.z.string(),
|
|
477
470
|
/** The payload for this task run */
|
|
478
|
-
payload:
|
|
471
|
+
payload: zod_1.z.unknown().optional(),
|
|
479
472
|
/** Options for this specific item */
|
|
480
473
|
options: exports.BatchTriggerTaskItem.shape.options,
|
|
481
474
|
});
|
|
@@ -483,81 +476,81 @@ exports.BatchItemNDJSON = v4_1.z.object({
|
|
|
483
476
|
* Phase 2: Stream items response
|
|
484
477
|
* Returned after the NDJSON stream completes
|
|
485
478
|
*/
|
|
486
|
-
exports.StreamBatchItemsResponse =
|
|
479
|
+
exports.StreamBatchItemsResponse = zod_1.z.object({
|
|
487
480
|
/** The batch ID */
|
|
488
|
-
id:
|
|
481
|
+
id: zod_1.z.string(),
|
|
489
482
|
/** Number of items successfully accepted */
|
|
490
|
-
itemsAccepted:
|
|
483
|
+
itemsAccepted: zod_1.z.number(),
|
|
491
484
|
/** Number of items that were deduplicated (already enqueued) */
|
|
492
|
-
itemsDeduplicated:
|
|
485
|
+
itemsDeduplicated: zod_1.z.number(),
|
|
493
486
|
/** Whether the batch was sealed and is ready for processing.
|
|
494
487
|
* If false, the batch needs more items before processing can start.
|
|
495
488
|
* Clients should check this field and retry with missing items if needed. */
|
|
496
|
-
sealed:
|
|
489
|
+
sealed: zod_1.z.boolean(),
|
|
497
490
|
/** Total items currently enqueued (only present when sealed=false to help with retries) */
|
|
498
|
-
enqueuedCount:
|
|
491
|
+
enqueuedCount: zod_1.z.number().optional(),
|
|
499
492
|
/** Expected total item count (only present when sealed=false to help with retries) */
|
|
500
|
-
expectedCount:
|
|
501
|
-
});
|
|
502
|
-
exports.BatchTriggerTaskResponse =
|
|
503
|
-
batchId:
|
|
504
|
-
runs:
|
|
505
|
-
});
|
|
506
|
-
exports.GetBatchResponseBody =
|
|
507
|
-
id:
|
|
508
|
-
items:
|
|
509
|
-
id:
|
|
510
|
-
taskRunId:
|
|
511
|
-
status:
|
|
493
|
+
expectedCount: zod_1.z.number().optional(),
|
|
494
|
+
});
|
|
495
|
+
exports.BatchTriggerTaskResponse = zod_1.z.object({
|
|
496
|
+
batchId: zod_1.z.string(),
|
|
497
|
+
runs: zod_1.z.string().array(),
|
|
498
|
+
});
|
|
499
|
+
exports.GetBatchResponseBody = zod_1.z.object({
|
|
500
|
+
id: zod_1.z.string(),
|
|
501
|
+
items: zod_1.z.array(zod_1.z.object({
|
|
502
|
+
id: zod_1.z.string(),
|
|
503
|
+
taskRunId: zod_1.z.string(),
|
|
504
|
+
status: zod_1.z.enum(["PENDING", "CANCELED", "COMPLETED", "FAILED"]),
|
|
512
505
|
})),
|
|
513
506
|
});
|
|
514
|
-
exports.AddTagsRequestBody =
|
|
507
|
+
exports.AddTagsRequestBody = zod_1.z.object({
|
|
515
508
|
tags: exports.RunTags,
|
|
516
509
|
});
|
|
517
|
-
exports.RescheduleRunRequestBody =
|
|
518
|
-
delay:
|
|
510
|
+
exports.RescheduleRunRequestBody = zod_1.z.object({
|
|
511
|
+
delay: zod_1.z.string().or(zod_1.z.coerce.date()),
|
|
519
512
|
});
|
|
520
|
-
exports.GetEnvironmentVariablesResponseBody =
|
|
521
|
-
variables:
|
|
513
|
+
exports.GetEnvironmentVariablesResponseBody = zod_1.z.object({
|
|
514
|
+
variables: zod_1.z.record(zod_1.z.string()),
|
|
522
515
|
});
|
|
523
|
-
exports.StartDeploymentIndexingRequestBody =
|
|
524
|
-
imageReference:
|
|
525
|
-
selfHosted:
|
|
516
|
+
exports.StartDeploymentIndexingRequestBody = zod_1.z.object({
|
|
517
|
+
imageReference: zod_1.z.string(),
|
|
518
|
+
selfHosted: zod_1.z.boolean().optional(),
|
|
526
519
|
});
|
|
527
|
-
exports.StartDeploymentIndexingResponseBody =
|
|
528
|
-
id:
|
|
529
|
-
contentHash:
|
|
520
|
+
exports.StartDeploymentIndexingResponseBody = zod_1.z.object({
|
|
521
|
+
id: zod_1.z.string(),
|
|
522
|
+
contentHash: zod_1.z.string(),
|
|
530
523
|
});
|
|
531
|
-
exports.FinalizeDeploymentRequestBody =
|
|
532
|
-
skipPromotion:
|
|
533
|
-
imageDigest:
|
|
534
|
-
skipPushToRegistry:
|
|
524
|
+
exports.FinalizeDeploymentRequestBody = zod_1.z.object({
|
|
525
|
+
skipPromotion: zod_1.z.boolean().optional(),
|
|
526
|
+
imageDigest: zod_1.z.string().optional(),
|
|
527
|
+
skipPushToRegistry: zod_1.z.boolean().optional(),
|
|
535
528
|
});
|
|
536
|
-
exports.BuildServerMetadata =
|
|
537
|
-
buildId:
|
|
538
|
-
isNativeBuild:
|
|
539
|
-
artifactKey:
|
|
540
|
-
skipPromotion:
|
|
541
|
-
configFilePath:
|
|
542
|
-
skipEnqueue:
|
|
543
|
-
fromBundle:
|
|
529
|
+
exports.BuildServerMetadata = zod_1.z.object({
|
|
530
|
+
buildId: zod_1.z.string().optional(),
|
|
531
|
+
isNativeBuild: zod_1.z.boolean().optional(),
|
|
532
|
+
artifactKey: zod_1.z.string().optional(),
|
|
533
|
+
skipPromotion: zod_1.z.boolean().optional(),
|
|
534
|
+
configFilePath: zod_1.z.string().optional(),
|
|
535
|
+
skipEnqueue: zod_1.z.boolean().optional(),
|
|
536
|
+
fromBundle: zod_1.z.boolean().optional(),
|
|
544
537
|
});
|
|
545
|
-
exports.ProgressDeploymentRequestBody =
|
|
546
|
-
contentHash:
|
|
538
|
+
exports.ProgressDeploymentRequestBody = zod_1.z.object({
|
|
539
|
+
contentHash: zod_1.z.string().optional(),
|
|
547
540
|
gitMeta: common_js_1.GitMeta.optional(),
|
|
548
|
-
runtime:
|
|
541
|
+
runtime: zod_1.z.string().optional(),
|
|
549
542
|
buildServerMetadata: exports.BuildServerMetadata.optional(),
|
|
550
543
|
});
|
|
551
|
-
exports.CancelDeploymentRequestBody =
|
|
552
|
-
reason:
|
|
544
|
+
exports.CancelDeploymentRequestBody = zod_1.z.object({
|
|
545
|
+
reason: zod_1.z.string().max(200, "Reason must be less than 200 characters").optional(),
|
|
553
546
|
});
|
|
554
|
-
exports.ExternalBuildData =
|
|
555
|
-
buildId:
|
|
556
|
-
buildToken:
|
|
557
|
-
projectId:
|
|
547
|
+
exports.ExternalBuildData = zod_1.z.object({
|
|
548
|
+
buildId: zod_1.z.string(),
|
|
549
|
+
buildToken: zod_1.z.string(),
|
|
550
|
+
projectId: zod_1.z.string(),
|
|
558
551
|
});
|
|
559
|
-
const anyString =
|
|
560
|
-
exports.DeploymentTriggeredVia =
|
|
552
|
+
const anyString = zod_1.z.custom((v) => typeof v === "string");
|
|
553
|
+
exports.DeploymentTriggeredVia = zod_1.z
|
|
561
554
|
.enum([
|
|
562
555
|
"cli:manual",
|
|
563
556
|
"cli:ci_other",
|
|
@@ -575,76 +568,76 @@ exports.DeploymentTriggeredVia = v4_1.z
|
|
|
575
568
|
.or(anyString);
|
|
576
569
|
// TriggerSource, TriggerAction, and RunAnnotations are defined in runEngine.ts
|
|
577
570
|
// They are re-exported through the schemas barrel (index.ts)
|
|
578
|
-
exports.UpsertBranchRequestBody =
|
|
571
|
+
exports.UpsertBranchRequestBody = zod_1.z.object({
|
|
579
572
|
git: common_js_1.GitMeta.optional(),
|
|
580
|
-
env:
|
|
581
|
-
branch:
|
|
582
|
-
});
|
|
583
|
-
exports.UpsertBranchResponseBody =
|
|
584
|
-
id:
|
|
585
|
-
});
|
|
586
|
-
exports.CreateArtifactRequestBody =
|
|
587
|
-
type:
|
|
588
|
-
contentType:
|
|
589
|
-
contentLength:
|
|
590
|
-
});
|
|
591
|
-
exports.CreateArtifactResponseBody =
|
|
592
|
-
artifactKey:
|
|
593
|
-
uploadUrl:
|
|
594
|
-
uploadFields:
|
|
595
|
-
expiresAt:
|
|
596
|
-
});
|
|
597
|
-
exports.InitializeDeploymentResponseBody =
|
|
598
|
-
id:
|
|
599
|
-
contentHash:
|
|
600
|
-
shortCode:
|
|
601
|
-
version:
|
|
602
|
-
imageTag:
|
|
603
|
-
imagePlatform:
|
|
604
|
-
externalId:
|
|
605
|
-
outcome:
|
|
606
|
-
isPromoted:
|
|
573
|
+
env: zod_1.z.enum(["preview", "development"]),
|
|
574
|
+
branch: zod_1.z.string(),
|
|
575
|
+
});
|
|
576
|
+
exports.UpsertBranchResponseBody = zod_1.z.object({
|
|
577
|
+
id: zod_1.z.string(),
|
|
578
|
+
});
|
|
579
|
+
exports.CreateArtifactRequestBody = zod_1.z.object({
|
|
580
|
+
type: zod_1.z.enum(["deployment_context", "deployment_bundle"]).default("deployment_context"),
|
|
581
|
+
contentType: zod_1.z.string().default("application/gzip"),
|
|
582
|
+
contentLength: zod_1.z.number().optional(),
|
|
583
|
+
});
|
|
584
|
+
exports.CreateArtifactResponseBody = zod_1.z.object({
|
|
585
|
+
artifactKey: zod_1.z.string(),
|
|
586
|
+
uploadUrl: zod_1.z.string(),
|
|
587
|
+
uploadFields: zod_1.z.record(zod_1.z.string()),
|
|
588
|
+
expiresAt: zod_1.z.string().datetime(),
|
|
589
|
+
});
|
|
590
|
+
exports.InitializeDeploymentResponseBody = zod_1.z.object({
|
|
591
|
+
id: zod_1.z.string(),
|
|
592
|
+
contentHash: zod_1.z.string(),
|
|
593
|
+
shortCode: zod_1.z.string(),
|
|
594
|
+
version: zod_1.z.string(),
|
|
595
|
+
imageTag: zod_1.z.string(),
|
|
596
|
+
imagePlatform: zod_1.z.string(),
|
|
597
|
+
externalId: zod_1.z.string().optional(),
|
|
598
|
+
outcome: zod_1.z.enum(["created", "existing"]).optional(),
|
|
599
|
+
isPromoted: zod_1.z.boolean().optional(),
|
|
607
600
|
externalBuildData: exports.ExternalBuildData.optional().nullable(),
|
|
608
|
-
canceledDeployments:
|
|
609
|
-
eventStream:
|
|
601
|
+
canceledDeployments: zod_1.z.array(zod_1.z.object({ version: zod_1.z.string(), shortCode: zod_1.z.string() })).optional(),
|
|
602
|
+
eventStream: zod_1.z
|
|
610
603
|
.object({
|
|
611
|
-
s2:
|
|
612
|
-
basin:
|
|
613
|
-
stream:
|
|
614
|
-
accessToken:
|
|
604
|
+
s2: zod_1.z.object({
|
|
605
|
+
basin: zod_1.z.string(),
|
|
606
|
+
stream: zod_1.z.string(),
|
|
607
|
+
accessToken: zod_1.z.string(),
|
|
615
608
|
}),
|
|
616
609
|
})
|
|
617
610
|
.optional(),
|
|
618
611
|
});
|
|
619
|
-
const InitializeDeploymentRequestBodyBase =
|
|
620
|
-
contentHash:
|
|
621
|
-
userId:
|
|
612
|
+
const InitializeDeploymentRequestBodyBase = zod_1.z.object({
|
|
613
|
+
contentHash: zod_1.z.string(),
|
|
614
|
+
userId: zod_1.z.string().optional(),
|
|
622
615
|
/** @deprecated This is now determined by the webapp. This is only used to warn users with old CLI versions. */
|
|
623
|
-
selfHosted:
|
|
616
|
+
selfHosted: zod_1.z.boolean().optional(),
|
|
624
617
|
gitMeta: common_js_1.GitMeta.optional(),
|
|
625
|
-
type:
|
|
626
|
-
runtime:
|
|
627
|
-
initialStatus:
|
|
628
|
-
isLocalBuild:
|
|
618
|
+
type: zod_1.z.enum(["MANAGED", "UNMANAGED", "V1"]).optional(),
|
|
619
|
+
runtime: zod_1.z.string().optional(),
|
|
620
|
+
initialStatus: zod_1.z.enum(["PENDING", "BUILDING"]).optional(),
|
|
621
|
+
isLocalBuild: zod_1.z.boolean().optional(),
|
|
629
622
|
triggeredVia: exports.DeploymentTriggeredVia.optional(),
|
|
630
|
-
buildId:
|
|
623
|
+
buildId: zod_1.z.string().optional(),
|
|
631
624
|
externalId: ExternalDeploymentId,
|
|
632
|
-
force:
|
|
625
|
+
force: zod_1.z.boolean().optional(),
|
|
633
626
|
});
|
|
634
627
|
const InitializeDeploymentRequestBodyFull = InitializeDeploymentRequestBodyBase.extend({
|
|
635
|
-
isNativeBuild:
|
|
636
|
-
skipPromotion:
|
|
637
|
-
artifactKey:
|
|
638
|
-
configFilePath:
|
|
639
|
-
skipEnqueue:
|
|
628
|
+
isNativeBuild: zod_1.z.boolean().default(false),
|
|
629
|
+
skipPromotion: zod_1.z.boolean().optional(),
|
|
630
|
+
artifactKey: zod_1.z.string().optional(),
|
|
631
|
+
configFilePath: zod_1.z.string().optional(),
|
|
632
|
+
skipEnqueue: zod_1.z.boolean().optional().default(false),
|
|
640
633
|
// The artifact is a pre-built bundle; the build server only runs the container build
|
|
641
|
-
fromBundle:
|
|
634
|
+
fromBundle: zod_1.z.boolean().optional(),
|
|
642
635
|
// Build-time env var values for fromBundle deploys, stored encrypted on the deployment
|
|
643
|
-
buildEnvVars:
|
|
636
|
+
buildEnvVars: zod_1.z.record(zod_1.z.string()).optional(),
|
|
644
637
|
}).superRefine((data, ctx) => {
|
|
645
638
|
if (data.force && !data.externalId) {
|
|
646
639
|
ctx.addIssue({
|
|
647
|
-
code:
|
|
640
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
648
641
|
path: ["force"],
|
|
649
642
|
message: "force requires externalId",
|
|
650
643
|
});
|
|
@@ -657,40 +650,40 @@ exports.InitializeDeploymentRequestBody = InitializeDeploymentRequestBodyFull.tr
|
|
|
657
650
|
const { skipPromotion, artifactKey, configFilePath, skipEnqueue, fromBundle, buildEnvVars, ...rest } = data;
|
|
658
651
|
return { ...rest, isNativeBuild: false };
|
|
659
652
|
});
|
|
660
|
-
exports.DeployBuildPath =
|
|
661
|
-
exports.GetDeploySettingsResponseBody =
|
|
653
|
+
exports.DeployBuildPath = zod_1.z.enum(["depot", "native", "native_local_bundle"]);
|
|
654
|
+
exports.GetDeploySettingsResponseBody = zod_1.z.object({
|
|
662
655
|
build_path: exports.DeployBuildPath,
|
|
663
656
|
});
|
|
664
|
-
exports.RemoteBuildProviderStatusResponseBody =
|
|
665
|
-
status:
|
|
666
|
-
message:
|
|
657
|
+
exports.RemoteBuildProviderStatusResponseBody = zod_1.z.object({
|
|
658
|
+
status: zod_1.z.enum(["operational", "degraded", "unknown"]),
|
|
659
|
+
message: zod_1.z.string(),
|
|
667
660
|
});
|
|
668
|
-
exports.GenerateRegistryCredentialsResponseBody =
|
|
669
|
-
username:
|
|
670
|
-
password:
|
|
671
|
-
expiresAt:
|
|
672
|
-
repositoryUri:
|
|
661
|
+
exports.GenerateRegistryCredentialsResponseBody = zod_1.z.object({
|
|
662
|
+
username: zod_1.z.string(),
|
|
663
|
+
password: zod_1.z.string(),
|
|
664
|
+
expiresAt: zod_1.z.string(),
|
|
665
|
+
repositoryUri: zod_1.z.string(),
|
|
673
666
|
});
|
|
674
|
-
exports.DeploymentErrorData =
|
|
675
|
-
name:
|
|
676
|
-
message:
|
|
677
|
-
stack:
|
|
678
|
-
stderr:
|
|
667
|
+
exports.DeploymentErrorData = zod_1.z.object({
|
|
668
|
+
name: zod_1.z.string(),
|
|
669
|
+
message: zod_1.z.string(),
|
|
670
|
+
stack: zod_1.z.string().optional(),
|
|
671
|
+
stderr: zod_1.z.string().optional(),
|
|
679
672
|
});
|
|
680
|
-
exports.FailDeploymentRequestBody =
|
|
673
|
+
exports.FailDeploymentRequestBody = zod_1.z.object({
|
|
681
674
|
error: exports.DeploymentErrorData,
|
|
682
675
|
});
|
|
683
|
-
exports.FailDeploymentResponseBody =
|
|
684
|
-
id:
|
|
676
|
+
exports.FailDeploymentResponseBody = zod_1.z.object({
|
|
677
|
+
id: zod_1.z.string(),
|
|
685
678
|
});
|
|
686
|
-
exports.PromoteDeploymentResponseBody =
|
|
687
|
-
id:
|
|
688
|
-
version:
|
|
689
|
-
shortCode:
|
|
679
|
+
exports.PromoteDeploymentResponseBody = zod_1.z.object({
|
|
680
|
+
id: zod_1.z.string(),
|
|
681
|
+
version: zod_1.z.string(),
|
|
682
|
+
shortCode: zod_1.z.string(),
|
|
690
683
|
});
|
|
691
|
-
exports.GetDeploymentResponseBody =
|
|
692
|
-
id:
|
|
693
|
-
status:
|
|
684
|
+
exports.GetDeploymentResponseBody = zod_1.z.object({
|
|
685
|
+
id: zod_1.z.string(),
|
|
686
|
+
status: zod_1.z.enum([
|
|
694
687
|
"PENDING",
|
|
695
688
|
"INSTALLING",
|
|
696
689
|
"BUILDING",
|
|
@@ -700,160 +693,139 @@ exports.GetDeploymentResponseBody = v4_1.z.object({
|
|
|
700
693
|
"CANCELED",
|
|
701
694
|
"TIMED_OUT",
|
|
702
695
|
]),
|
|
703
|
-
contentHash:
|
|
704
|
-
shortCode:
|
|
705
|
-
version:
|
|
706
|
-
imageReference:
|
|
707
|
-
imagePlatform:
|
|
708
|
-
commitSHA:
|
|
709
|
-
/**
|
|
710
|
-
* The `--external-id` this deployment was deployed under, used by version skew
|
|
711
|
-
* protection to pin runs. Distinct from `commitSHA`, which is git metadata.
|
|
712
|
-
*
|
|
713
|
-
* `optional`, not `nullish`, to stay assignable to the CLI's narrower
|
|
714
|
-
* `InitializeDeploymentResponseBody` shape, which this is spread into on the
|
|
715
|
-
* attach-to-existing-deployment path (`cli-v3/src/commands/deploy.ts:1156`).
|
|
716
|
-
*/
|
|
717
|
-
externalId: v4_1.z.string().optional(),
|
|
696
|
+
contentHash: zod_1.z.string(),
|
|
697
|
+
shortCode: zod_1.z.string(),
|
|
698
|
+
version: zod_1.z.string(),
|
|
699
|
+
imageReference: zod_1.z.string().nullish(),
|
|
700
|
+
imagePlatform: zod_1.z.string(),
|
|
701
|
+
commitSHA: zod_1.z.string().nullish(),
|
|
718
702
|
externalBuildData: exports.ExternalBuildData.optional().nullable(),
|
|
719
703
|
errorData: exports.DeploymentErrorData.nullish(),
|
|
720
|
-
canceledReason:
|
|
721
|
-
worker:
|
|
704
|
+
canceledReason: zod_1.z.string().nullish(),
|
|
705
|
+
worker: zod_1.z
|
|
722
706
|
.object({
|
|
723
|
-
id:
|
|
724
|
-
version:
|
|
725
|
-
tasks:
|
|
726
|
-
id:
|
|
727
|
-
slug:
|
|
728
|
-
filePath:
|
|
729
|
-
exportName:
|
|
707
|
+
id: zod_1.z.string(),
|
|
708
|
+
version: zod_1.z.string(),
|
|
709
|
+
tasks: zod_1.z.array(zod_1.z.object({
|
|
710
|
+
id: zod_1.z.string(),
|
|
711
|
+
slug: zod_1.z.string(),
|
|
712
|
+
filePath: zod_1.z.string(),
|
|
713
|
+
exportName: zod_1.z.string().optional(),
|
|
730
714
|
})),
|
|
731
715
|
})
|
|
732
716
|
.optional(),
|
|
733
|
-
integrationDeployments:
|
|
734
|
-
.array(
|
|
735
|
-
id:
|
|
736
|
-
integrationName:
|
|
737
|
-
integrationDeploymentId:
|
|
738
|
-
commitSHA:
|
|
739
|
-
createdAt:
|
|
717
|
+
integrationDeployments: zod_1.z
|
|
718
|
+
.array(zod_1.z.object({
|
|
719
|
+
id: zod_1.z.string(),
|
|
720
|
+
integrationName: zod_1.z.string(),
|
|
721
|
+
integrationDeploymentId: zod_1.z.string(),
|
|
722
|
+
commitSHA: zod_1.z.string(),
|
|
723
|
+
createdAt: zod_1.z.coerce.date(),
|
|
740
724
|
}))
|
|
741
725
|
.nullish(),
|
|
742
726
|
});
|
|
743
727
|
// Secret material, deliberately kept off GetDeploymentResponseBody
|
|
744
|
-
exports.GetDeploymentBuildEnvVarsResponseBody =
|
|
745
|
-
variables:
|
|
728
|
+
exports.GetDeploymentBuildEnvVarsResponseBody = zod_1.z.object({
|
|
729
|
+
variables: zod_1.z.record(zod_1.z.string()),
|
|
746
730
|
});
|
|
747
731
|
exports.GetLatestDeploymentResponseBody = exports.GetDeploymentResponseBody.omit({
|
|
748
732
|
worker: true,
|
|
749
733
|
});
|
|
750
|
-
exports.DeploymentLogEvent =
|
|
751
|
-
type:
|
|
752
|
-
data:
|
|
753
|
-
level:
|
|
754
|
-
message:
|
|
734
|
+
exports.DeploymentLogEvent = zod_1.z.object({
|
|
735
|
+
type: zod_1.z.literal("log"),
|
|
736
|
+
data: zod_1.z.object({
|
|
737
|
+
level: zod_1.z.enum(["debug", "info", "warn", "error"]).optional().default("info"),
|
|
738
|
+
message: zod_1.z.string(),
|
|
755
739
|
}),
|
|
756
740
|
});
|
|
757
|
-
exports.DeploymentFinalizedEvent =
|
|
758
|
-
type:
|
|
759
|
-
data:
|
|
760
|
-
result:
|
|
761
|
-
message:
|
|
741
|
+
exports.DeploymentFinalizedEvent = zod_1.z.object({
|
|
742
|
+
type: zod_1.z.literal("finalized"),
|
|
743
|
+
data: zod_1.z.object({
|
|
744
|
+
result: zod_1.z.enum(["succeeded", "failed", "timed_out", "canceled"]).or(anyString),
|
|
745
|
+
message: zod_1.z.string().optional(),
|
|
762
746
|
}),
|
|
763
747
|
});
|
|
764
|
-
exports.DeploymentEvent =
|
|
748
|
+
exports.DeploymentEvent = zod_1.z.discriminatedUnion("type", [
|
|
765
749
|
exports.DeploymentLogEvent,
|
|
766
750
|
exports.DeploymentFinalizedEvent,
|
|
767
751
|
]);
|
|
768
|
-
exports.DeploymentEventFromString =
|
|
752
|
+
exports.DeploymentEventFromString = zod_1.z
|
|
769
753
|
.string()
|
|
770
754
|
.transform((s, ctx) => {
|
|
771
755
|
try {
|
|
772
756
|
return JSON.parse(s);
|
|
773
757
|
}
|
|
774
758
|
catch {
|
|
775
|
-
ctx.addIssue({ code:
|
|
776
|
-
return
|
|
759
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: "Invalid JSON" });
|
|
760
|
+
return zod_1.z.NEVER;
|
|
777
761
|
}
|
|
778
762
|
})
|
|
779
763
|
.pipe(exports.DeploymentEvent);
|
|
780
|
-
exports.CreateUploadPayloadUrlResponseBody =
|
|
781
|
-
presignedUrl:
|
|
764
|
+
exports.CreateUploadPayloadUrlResponseBody = zod_1.z.object({
|
|
765
|
+
presignedUrl: zod_1.z.string(),
|
|
782
766
|
/** Present on `/api/v2/packets` PUT (upload handshake); omitted on v1 GET download presign. */
|
|
783
|
-
storagePath:
|
|
767
|
+
storagePath: zod_1.z.string().optional(),
|
|
784
768
|
});
|
|
785
|
-
|
|
786
|
-
exports.SessionTranscriptResponseBody = v4_1.z.object({
|
|
787
|
-
messages: v4_1.z.array(v4_1.z.unknown()),
|
|
788
|
-
state: v4_1.z.unknown().nullable(),
|
|
789
|
-
cursors: v4_1.z
|
|
790
|
-
.object({
|
|
791
|
-
lastOutEventId: v4_1.z.string().optional(),
|
|
792
|
-
lastInEventId: v4_1.z.string().optional(),
|
|
793
|
-
})
|
|
794
|
-
.optional(),
|
|
795
|
-
nextCursor: v4_1.z.string().optional(),
|
|
796
|
-
});
|
|
797
|
-
exports.WorkersListResponseBody = v4_1.z
|
|
769
|
+
exports.WorkersListResponseBody = zod_1.z
|
|
798
770
|
.object({
|
|
799
|
-
type:
|
|
800
|
-
name:
|
|
801
|
-
description:
|
|
802
|
-
latestVersion:
|
|
803
|
-
lastHeartbeatAt:
|
|
804
|
-
isDefault:
|
|
805
|
-
updatedAt:
|
|
771
|
+
type: zod_1.z.string(),
|
|
772
|
+
name: zod_1.z.string(),
|
|
773
|
+
description: zod_1.z.string().nullish(),
|
|
774
|
+
latestVersion: zod_1.z.string().nullish(),
|
|
775
|
+
lastHeartbeatAt: zod_1.z.string().nullish(),
|
|
776
|
+
isDefault: zod_1.z.boolean(),
|
|
777
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
806
778
|
})
|
|
807
779
|
.array();
|
|
808
|
-
exports.WorkersCreateRequestBody =
|
|
809
|
-
name:
|
|
810
|
-
description:
|
|
811
|
-
});
|
|
812
|
-
exports.WorkersCreateResponseBody =
|
|
813
|
-
workerGroup:
|
|
814
|
-
name:
|
|
815
|
-
description:
|
|
780
|
+
exports.WorkersCreateRequestBody = zod_1.z.object({
|
|
781
|
+
name: zod_1.z.string().optional(),
|
|
782
|
+
description: zod_1.z.string().optional(),
|
|
783
|
+
});
|
|
784
|
+
exports.WorkersCreateResponseBody = zod_1.z.object({
|
|
785
|
+
workerGroup: zod_1.z.object({
|
|
786
|
+
name: zod_1.z.string(),
|
|
787
|
+
description: zod_1.z.string().nullish(),
|
|
816
788
|
}),
|
|
817
|
-
token:
|
|
818
|
-
plaintext:
|
|
789
|
+
token: zod_1.z.object({
|
|
790
|
+
plaintext: zod_1.z.string(),
|
|
819
791
|
}),
|
|
820
792
|
});
|
|
821
|
-
exports.DevConfigResponseBody =
|
|
822
|
-
environmentId:
|
|
823
|
-
dequeueIntervalWithRun:
|
|
824
|
-
dequeueIntervalWithoutRun:
|
|
825
|
-
maxConcurrentRuns:
|
|
826
|
-
engineUrl:
|
|
793
|
+
exports.DevConfigResponseBody = zod_1.z.object({
|
|
794
|
+
environmentId: zod_1.z.string(),
|
|
795
|
+
dequeueIntervalWithRun: zod_1.z.number(),
|
|
796
|
+
dequeueIntervalWithoutRun: zod_1.z.number(),
|
|
797
|
+
maxConcurrentRuns: zod_1.z.number(),
|
|
798
|
+
engineUrl: zod_1.z.string(),
|
|
827
799
|
});
|
|
828
|
-
exports.DevDequeueRequestBody =
|
|
829
|
-
currentWorker:
|
|
830
|
-
oldWorkers:
|
|
800
|
+
exports.DevDequeueRequestBody = zod_1.z.object({
|
|
801
|
+
currentWorker: zod_1.z.string(),
|
|
802
|
+
oldWorkers: zod_1.z.string().array(),
|
|
831
803
|
maxResources: runEngine_js_1.MachineResources.optional(),
|
|
832
804
|
});
|
|
833
|
-
exports.DevDequeueResponseBody =
|
|
805
|
+
exports.DevDequeueResponseBody = zod_1.z.object({
|
|
834
806
|
dequeuedMessages: runEngine_js_1.DequeuedMessage.array(),
|
|
835
807
|
});
|
|
836
|
-
exports.DevDisconnectRequestBody =
|
|
837
|
-
runFriendlyIds:
|
|
808
|
+
exports.DevDisconnectRequestBody = zod_1.z.object({
|
|
809
|
+
runFriendlyIds: zod_1.z.string().array(),
|
|
838
810
|
});
|
|
839
|
-
exports.DevDisconnectResponseBody =
|
|
840
|
-
cancelled:
|
|
841
|
-
bulkActionId:
|
|
811
|
+
exports.DevDisconnectResponseBody = zod_1.z.object({
|
|
812
|
+
cancelled: zod_1.z.number(),
|
|
813
|
+
bulkActionId: zod_1.z.string().optional(),
|
|
842
814
|
});
|
|
843
|
-
exports.ReplayRunResponse =
|
|
844
|
-
id:
|
|
815
|
+
exports.ReplayRunResponse = zod_1.z.object({
|
|
816
|
+
id: zod_1.z.string(),
|
|
845
817
|
});
|
|
846
|
-
exports.CanceledRunResponse =
|
|
847
|
-
id:
|
|
818
|
+
exports.CanceledRunResponse = zod_1.z.object({
|
|
819
|
+
id: zod_1.z.string(),
|
|
848
820
|
});
|
|
849
|
-
exports.ResetIdempotencyKeyResponse =
|
|
850
|
-
id:
|
|
821
|
+
exports.ResetIdempotencyKeyResponse = zod_1.z.object({
|
|
822
|
+
id: zod_1.z.string(),
|
|
851
823
|
});
|
|
852
|
-
exports.ScheduleType =
|
|
853
|
-
exports.ScheduledTaskPayload =
|
|
824
|
+
exports.ScheduleType = zod_1.z.union([zod_1.z.literal("DECLARATIVE"), zod_1.z.literal("IMPERATIVE")]);
|
|
825
|
+
exports.ScheduledTaskPayload = zod_1.z.object({
|
|
854
826
|
/** The schedule id associated with this run (you can have many schedules for the same task).
|
|
855
827
|
You can use this to remove the schedule, update it, etc */
|
|
856
|
-
scheduleId:
|
|
828
|
+
scheduleId: zod_1.z.string(),
|
|
857
829
|
/** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
|
|
858
830
|
*
|
|
859
831
|
* **DECLARATIVE** – defined inline on your `schedules.task` using the `cron` property. They can only be created, updated or deleted by modifying the `cron` property on your task.
|
|
@@ -870,24 +842,24 @@ exports.ScheduledTaskPayload = v4_1.z.object({
|
|
|
870
842
|
timeZone: payload.timezone,
|
|
871
843
|
});
|
|
872
844
|
``` */
|
|
873
|
-
timestamp:
|
|
845
|
+
timestamp: zod_1.z.date(),
|
|
874
846
|
/** When the task was last run (it has been).
|
|
875
847
|
This can be undefined if it's never been run. This date is UTC. */
|
|
876
|
-
lastTimestamp:
|
|
848
|
+
lastTimestamp: zod_1.z.date().optional(),
|
|
877
849
|
/** You can optionally provide an external id when creating the schedule.
|
|
878
850
|
Usually you would use a userId or some other unique identifier.
|
|
879
851
|
This defaults to undefined if you didn't provide one. */
|
|
880
|
-
externalId:
|
|
852
|
+
externalId: zod_1.z.string().optional(),
|
|
881
853
|
/** The IANA timezone the schedule is set to. The default is UTC.
|
|
882
854
|
* You can see the full list of supported timezones here: https://cloud.trigger.dev/timezones
|
|
883
855
|
*/
|
|
884
|
-
timezone:
|
|
856
|
+
timezone: zod_1.z.string(),
|
|
885
857
|
/** The next 5 dates this task is scheduled to run */
|
|
886
|
-
upcoming:
|
|
858
|
+
upcoming: zod_1.z.array(zod_1.z.date()),
|
|
887
859
|
});
|
|
888
|
-
exports.CreateScheduleOptions =
|
|
860
|
+
exports.CreateScheduleOptions = zod_1.z.object({
|
|
889
861
|
/** The id of the task you want to attach to. */
|
|
890
|
-
task:
|
|
862
|
+
task: zod_1.z.string(),
|
|
891
863
|
/** The schedule in CRON format.
|
|
892
864
|
*
|
|
893
865
|
* ```txt
|
|
@@ -904,16 +876,16 @@ exports.CreateScheduleOptions = v4_1.z.object({
|
|
|
904
876
|
"L" means the last. In the "day of week" field, 1L means the last Monday of the month. In the day of month field, L means the last day of the month.
|
|
905
877
|
|
|
906
878
|
*/
|
|
907
|
-
cron:
|
|
879
|
+
cron: zod_1.z.string(),
|
|
908
880
|
/** You can only create one schedule with this key. If you use it twice, the second call will update the schedule.
|
|
909
881
|
*
|
|
910
882
|
* This is required to prevent you from creating duplicate schedules. */
|
|
911
|
-
deduplicationKey:
|
|
883
|
+
deduplicationKey: zod_1.z.string(),
|
|
912
884
|
/** Optionally, you can specify your own IDs (like a user ID) and then use it inside the run function of your task.
|
|
913
885
|
*
|
|
914
886
|
* This allows you to have per-user CRON tasks.
|
|
915
887
|
*/
|
|
916
|
-
externalId:
|
|
888
|
+
externalId: zod_1.z.string().optional(),
|
|
917
889
|
/** Optionally, you can specify a timezone in the IANA format. If unset it will use UTC.
|
|
918
890
|
* If specified then the CRON will be evaluated in that timezone and will respect daylight savings.
|
|
919
891
|
*
|
|
@@ -924,7 +896,7 @@ exports.CreateScheduleOptions = v4_1.z.object({
|
|
|
924
896
|
* @example "America/New_York", "Europe/London", "Asia/Tokyo", "Africa/Cairo"
|
|
925
897
|
*
|
|
926
898
|
*/
|
|
927
|
-
timezone:
|
|
899
|
+
timezone: zod_1.z.string().optional(),
|
|
928
900
|
/** Optionally delay each occurrence by a stable amount within this window.
|
|
929
901
|
* Absolute windows use whole minutes or hours up to 24 hours and are capped at the next
|
|
930
902
|
* nominal interval. Percentages are relative to each nominal interval.
|
|
@@ -934,61 +906,50 @@ exports.CreateScheduleOptions = v4_1.z.object({
|
|
|
934
906
|
window: schemas_js_1.ScheduleWindow.optional(),
|
|
935
907
|
});
|
|
936
908
|
exports.UpdateScheduleOptions = exports.CreateScheduleOptions.omit({ deduplicationKey: true });
|
|
937
|
-
exports.ScheduleGenerator =
|
|
938
|
-
type:
|
|
939
|
-
expression:
|
|
940
|
-
description:
|
|
909
|
+
exports.ScheduleGenerator = zod_1.z.object({
|
|
910
|
+
type: zod_1.z.literal("CRON"),
|
|
911
|
+
expression: zod_1.z.string(),
|
|
912
|
+
description: zod_1.z.string(),
|
|
941
913
|
});
|
|
942
|
-
exports.ScheduleObject =
|
|
943
|
-
id:
|
|
914
|
+
exports.ScheduleObject = zod_1.z.object({
|
|
915
|
+
id: zod_1.z.string(),
|
|
944
916
|
type: exports.ScheduleType,
|
|
945
|
-
task:
|
|
946
|
-
active:
|
|
947
|
-
deduplicationKey:
|
|
948
|
-
externalId:
|
|
917
|
+
task: zod_1.z.string(),
|
|
918
|
+
active: zod_1.z.boolean(),
|
|
919
|
+
deduplicationKey: zod_1.z.string().nullish(),
|
|
920
|
+
externalId: zod_1.z.string().nullish(),
|
|
949
921
|
generator: exports.ScheduleGenerator,
|
|
950
|
-
timezone:
|
|
922
|
+
timezone: zod_1.z.string(),
|
|
951
923
|
window: schemas_js_1.ScheduleWindow.optional(),
|
|
952
924
|
/** The next nominal CRON time. */
|
|
953
|
-
nextRun:
|
|
925
|
+
nextRun: zod_1.z.coerce.date().nullish(),
|
|
954
926
|
/** The stable assigned time for the next nominal CRON time. */
|
|
955
|
-
nextRunEffectiveAt:
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
*/
|
|
961
|
-
appliedSchedulePolicy: v4_1.z
|
|
962
|
-
.object({
|
|
963
|
-
minimumWindowSeconds: v4_1.z.number(),
|
|
964
|
-
reason: v4_1.z.literal("free_schedule"),
|
|
965
|
-
})
|
|
966
|
-
.optional(),
|
|
967
|
-
environments: v4_1.z.array(v4_1.z.object({
|
|
968
|
-
id: v4_1.z.string(),
|
|
969
|
-
type: v4_1.z.string(),
|
|
970
|
-
userName: v4_1.z.string().nullish(),
|
|
927
|
+
nextRunEffectiveAt: zod_1.z.coerce.date().nullish(),
|
|
928
|
+
environments: zod_1.z.array(zod_1.z.object({
|
|
929
|
+
id: zod_1.z.string(),
|
|
930
|
+
type: zod_1.z.string(),
|
|
931
|
+
userName: zod_1.z.string().nullish(),
|
|
971
932
|
})),
|
|
972
933
|
});
|
|
973
|
-
exports.DeletedScheduleObject =
|
|
974
|
-
id:
|
|
934
|
+
exports.DeletedScheduleObject = zod_1.z.object({
|
|
935
|
+
id: zod_1.z.string(),
|
|
975
936
|
});
|
|
976
|
-
exports.ListSchedulesResult =
|
|
977
|
-
data:
|
|
978
|
-
pagination:
|
|
979
|
-
currentPage:
|
|
980
|
-
totalPages:
|
|
981
|
-
count:
|
|
937
|
+
exports.ListSchedulesResult = zod_1.z.object({
|
|
938
|
+
data: zod_1.z.array(exports.ScheduleObject),
|
|
939
|
+
pagination: zod_1.z.object({
|
|
940
|
+
currentPage: zod_1.z.number(),
|
|
941
|
+
totalPages: zod_1.z.number(),
|
|
942
|
+
count: zod_1.z.number(),
|
|
982
943
|
}),
|
|
983
944
|
});
|
|
984
|
-
exports.ListScheduleOptions =
|
|
985
|
-
page:
|
|
986
|
-
perPage:
|
|
945
|
+
exports.ListScheduleOptions = zod_1.z.object({
|
|
946
|
+
page: zod_1.z.number().optional(),
|
|
947
|
+
perPage: zod_1.z.number().optional(),
|
|
987
948
|
});
|
|
988
|
-
exports.TimezonesResult =
|
|
989
|
-
timezones:
|
|
949
|
+
exports.TimezonesResult = zod_1.z.object({
|
|
950
|
+
timezones: zod_1.z.array(zod_1.z.string()),
|
|
990
951
|
});
|
|
991
|
-
exports.RunStatus =
|
|
952
|
+
exports.RunStatus = zod_1.z.enum([
|
|
992
953
|
/// Task is waiting for a version update because it cannot execute without additional information (task, queue, etc.)
|
|
993
954
|
"PENDING_VERSION",
|
|
994
955
|
/// Task is waiting to be executed by a worker
|
|
@@ -1016,7 +977,7 @@ exports.RunStatus = v4_1.z.enum([
|
|
|
1016
977
|
/// Task has reached it's maxDuration and has been stopped
|
|
1017
978
|
"TIMED_OUT",
|
|
1018
979
|
]);
|
|
1019
|
-
exports.AttemptStatus =
|
|
980
|
+
exports.AttemptStatus = zod_1.z.enum([
|
|
1020
981
|
"PENDING",
|
|
1021
982
|
"EXECUTING",
|
|
1022
983
|
"PAUSED",
|
|
@@ -1024,102 +985,102 @@ exports.AttemptStatus = v4_1.z.enum([
|
|
|
1024
985
|
"FAILED",
|
|
1025
986
|
"CANCELED",
|
|
1026
987
|
]);
|
|
1027
|
-
exports.RunEnvironmentDetails =
|
|
1028
|
-
id:
|
|
1029
|
-
name:
|
|
1030
|
-
user:
|
|
1031
|
-
});
|
|
1032
|
-
exports.RunScheduleDetails =
|
|
1033
|
-
id:
|
|
1034
|
-
externalId:
|
|
1035
|
-
deduplicationKey:
|
|
988
|
+
exports.RunEnvironmentDetails = zod_1.z.object({
|
|
989
|
+
id: zod_1.z.string(),
|
|
990
|
+
name: zod_1.z.string(),
|
|
991
|
+
user: zod_1.z.string().optional(),
|
|
992
|
+
});
|
|
993
|
+
exports.RunScheduleDetails = zod_1.z.object({
|
|
994
|
+
id: zod_1.z.string(),
|
|
995
|
+
externalId: zod_1.z.string().optional(),
|
|
996
|
+
deduplicationKey: zod_1.z.string().optional(),
|
|
1036
997
|
generator: exports.ScheduleGenerator,
|
|
1037
998
|
});
|
|
1038
|
-
exports.TriggerFunction =
|
|
999
|
+
exports.TriggerFunction = zod_1.z.enum([
|
|
1039
1000
|
"triggerAndWait",
|
|
1040
1001
|
"trigger",
|
|
1041
1002
|
"batchTriggerAndWait",
|
|
1042
1003
|
"batchTrigger",
|
|
1043
1004
|
]);
|
|
1044
1005
|
const CommonRunFields = {
|
|
1045
|
-
id:
|
|
1006
|
+
id: zod_1.z.string(),
|
|
1046
1007
|
status: exports.RunStatus,
|
|
1047
|
-
taskIdentifier:
|
|
1048
|
-
idempotencyKey:
|
|
1049
|
-
version:
|
|
1050
|
-
isQueued:
|
|
1051
|
-
isExecuting:
|
|
1052
|
-
isWaiting:
|
|
1053
|
-
isCompleted:
|
|
1054
|
-
isSuccess:
|
|
1055
|
-
isFailed:
|
|
1056
|
-
isCancelled:
|
|
1057
|
-
isTest:
|
|
1058
|
-
createdAt:
|
|
1059
|
-
updatedAt:
|
|
1060
|
-
startedAt:
|
|
1061
|
-
finishedAt:
|
|
1062
|
-
delayedUntil:
|
|
1063
|
-
ttl:
|
|
1064
|
-
expiredAt:
|
|
1065
|
-
tags:
|
|
1066
|
-
costInCents:
|
|
1067
|
-
baseCostInCents:
|
|
1068
|
-
durationMs:
|
|
1069
|
-
metadata:
|
|
1070
|
-
taskKind:
|
|
1071
|
-
region:
|
|
1008
|
+
taskIdentifier: zod_1.z.string(),
|
|
1009
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
1010
|
+
version: zod_1.z.string().optional(),
|
|
1011
|
+
isQueued: zod_1.z.boolean(),
|
|
1012
|
+
isExecuting: zod_1.z.boolean(),
|
|
1013
|
+
isWaiting: zod_1.z.boolean(),
|
|
1014
|
+
isCompleted: zod_1.z.boolean(),
|
|
1015
|
+
isSuccess: zod_1.z.boolean(),
|
|
1016
|
+
isFailed: zod_1.z.boolean(),
|
|
1017
|
+
isCancelled: zod_1.z.boolean(),
|
|
1018
|
+
isTest: zod_1.z.boolean(),
|
|
1019
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1020
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
1021
|
+
startedAt: zod_1.z.coerce.date().optional(),
|
|
1022
|
+
finishedAt: zod_1.z.coerce.date().optional(),
|
|
1023
|
+
delayedUntil: zod_1.z.coerce.date().optional(),
|
|
1024
|
+
ttl: zod_1.z.string().optional(),
|
|
1025
|
+
expiredAt: zod_1.z.coerce.date().optional(),
|
|
1026
|
+
tags: zod_1.z.string().array(),
|
|
1027
|
+
costInCents: zod_1.z.number(),
|
|
1028
|
+
baseCostInCents: zod_1.z.number(),
|
|
1029
|
+
durationMs: zod_1.z.number(),
|
|
1030
|
+
metadata: zod_1.z.record(zod_1.z.any()).optional(),
|
|
1031
|
+
taskKind: zod_1.z.string().optional(),
|
|
1032
|
+
region: zod_1.z.string().optional(),
|
|
1072
1033
|
};
|
|
1073
1034
|
const RetrieveRunCommandFields = {
|
|
1074
1035
|
...CommonRunFields,
|
|
1075
|
-
depth:
|
|
1076
|
-
triggerFunction:
|
|
1077
|
-
batchId:
|
|
1036
|
+
depth: zod_1.z.number(),
|
|
1037
|
+
triggerFunction: zod_1.z.enum(["triggerAndWait", "trigger", "batchTriggerAndWait", "batchTrigger"]),
|
|
1038
|
+
batchId: zod_1.z.string().optional(),
|
|
1078
1039
|
};
|
|
1079
|
-
exports.RelatedRunDetails =
|
|
1080
|
-
exports.RetrieveRunResponse =
|
|
1040
|
+
exports.RelatedRunDetails = zod_1.z.object(RetrieveRunCommandFields);
|
|
1041
|
+
exports.RetrieveRunResponse = zod_1.z.object({
|
|
1081
1042
|
...RetrieveRunCommandFields,
|
|
1082
|
-
payload:
|
|
1083
|
-
payloadPresignedUrl:
|
|
1084
|
-
output:
|
|
1085
|
-
outputPresignedUrl:
|
|
1043
|
+
payload: zod_1.z.any().optional(),
|
|
1044
|
+
payloadPresignedUrl: zod_1.z.string().optional(),
|
|
1045
|
+
output: zod_1.z.any().optional(),
|
|
1046
|
+
outputPresignedUrl: zod_1.z.string().optional(),
|
|
1086
1047
|
error: common_js_1.SerializedError.optional(),
|
|
1087
1048
|
schedule: exports.RunScheduleDetails.optional(),
|
|
1088
|
-
relatedRuns:
|
|
1049
|
+
relatedRuns: zod_1.z.object({
|
|
1089
1050
|
root: exports.RelatedRunDetails.optional(),
|
|
1090
1051
|
parent: exports.RelatedRunDetails.optional(),
|
|
1091
|
-
children:
|
|
1052
|
+
children: zod_1.z.array(exports.RelatedRunDetails).optional(),
|
|
1092
1053
|
}),
|
|
1093
|
-
attemptCount:
|
|
1054
|
+
attemptCount: zod_1.z.number().default(0),
|
|
1094
1055
|
});
|
|
1095
|
-
exports.ListRunResponseItem =
|
|
1056
|
+
exports.ListRunResponseItem = zod_1.z.object({
|
|
1096
1057
|
...CommonRunFields,
|
|
1097
1058
|
env: exports.RunEnvironmentDetails,
|
|
1098
1059
|
});
|
|
1099
|
-
exports.ListRunResponse =
|
|
1100
|
-
data:
|
|
1101
|
-
pagination:
|
|
1102
|
-
next:
|
|
1103
|
-
previous:
|
|
1060
|
+
exports.ListRunResponse = zod_1.z.object({
|
|
1061
|
+
data: zod_1.z.array(exports.ListRunResponseItem),
|
|
1062
|
+
pagination: zod_1.z.object({
|
|
1063
|
+
next: zod_1.z.string().optional(),
|
|
1064
|
+
previous: zod_1.z.string().optional(),
|
|
1104
1065
|
}),
|
|
1105
1066
|
});
|
|
1106
|
-
const StringOrStringArray =
|
|
1107
|
-
const MachineOrMachineArray =
|
|
1108
|
-
const QueueOrQueueArray =
|
|
1109
|
-
const DateOrNumber =
|
|
1110
|
-
const BulkActionFilterRequestBody =
|
|
1067
|
+
const StringOrStringArray = zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]);
|
|
1068
|
+
const MachineOrMachineArray = zod_1.z.union([common_js_1.MachinePresetName, zod_1.z.array(common_js_1.MachinePresetName)]);
|
|
1069
|
+
const QueueOrQueueArray = zod_1.z.union([queues_js_1.QueueTypeName, zod_1.z.array(queues_js_1.QueueTypeName)]);
|
|
1070
|
+
const DateOrNumber = zod_1.z.union([zod_1.z.coerce.date(), zod_1.z.number()]);
|
|
1071
|
+
const BulkActionFilterRequestBody = zod_1.z
|
|
1111
1072
|
.object({
|
|
1112
|
-
status:
|
|
1073
|
+
status: zod_1.z.union([exports.RunStatus, zod_1.z.array(exports.RunStatus)]).optional(),
|
|
1113
1074
|
taskIdentifier: StringOrStringArray.optional(),
|
|
1114
1075
|
version: StringOrStringArray.optional(),
|
|
1115
1076
|
from: DateOrNumber.optional(),
|
|
1116
1077
|
to: DateOrNumber.optional(),
|
|
1117
|
-
period:
|
|
1118
|
-
bulkAction:
|
|
1078
|
+
period: zod_1.z.string().optional(),
|
|
1079
|
+
bulkAction: zod_1.z.string().optional(),
|
|
1119
1080
|
tag: StringOrStringArray.optional(),
|
|
1120
|
-
schedule:
|
|
1121
|
-
isTest:
|
|
1122
|
-
batch:
|
|
1081
|
+
schedule: zod_1.z.string().optional(),
|
|
1082
|
+
isTest: zod_1.z.boolean().optional(),
|
|
1083
|
+
batch: zod_1.z.string().optional(),
|
|
1123
1084
|
queue: QueueOrQueueArray.optional(),
|
|
1124
1085
|
machine: MachineOrMachineArray.optional(),
|
|
1125
1086
|
region: StringOrStringArray.optional(),
|
|
@@ -1142,87 +1103,91 @@ function isNonEmptyBulkActionFilterValue(value) {
|
|
|
1142
1103
|
}
|
|
1143
1104
|
const BulkActionSelectionRequestBody = {
|
|
1144
1105
|
filter: BulkActionFilterRequestBody.optional(),
|
|
1145
|
-
runIds:
|
|
1146
|
-
name:
|
|
1106
|
+
runIds: zod_1.z.array(zod_1.z.string()).min(1).optional(),
|
|
1107
|
+
name: zod_1.z.string().max(255, "Name must be less than 255 characters").optional(),
|
|
1147
1108
|
};
|
|
1148
|
-
exports.CreateBulkActionRequestBody =
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1109
|
+
exports.CreateBulkActionRequestBody = zod_1.z
|
|
1110
|
+
.discriminatedUnion("action", [
|
|
1111
|
+
zod_1.z.object({
|
|
1112
|
+
action: zod_1.z.literal("cancel"),
|
|
1113
|
+
targetRegion: zod_1.z.never().optional(),
|
|
1152
1114
|
...BulkActionSelectionRequestBody,
|
|
1153
1115
|
}),
|
|
1154
|
-
|
|
1155
|
-
action:
|
|
1156
|
-
targetRegion:
|
|
1116
|
+
zod_1.z.object({
|
|
1117
|
+
action: zod_1.z.literal("replay"),
|
|
1118
|
+
targetRegion: zod_1.z.string().optional(),
|
|
1157
1119
|
...BulkActionSelectionRequestBody,
|
|
1158
1120
|
}),
|
|
1159
|
-
])
|
|
1121
|
+
])
|
|
1122
|
+
.refine((body) => (body.filter ? 1 : 0) + (body.runIds ? 1 : 0) === 1, {
|
|
1160
1123
|
message: "Exactly one of filter or runIds must be provided",
|
|
1161
1124
|
});
|
|
1162
|
-
exports.BulkActionStatus =
|
|
1163
|
-
exports.BulkActionType =
|
|
1164
|
-
exports.BulkActionObject =
|
|
1165
|
-
id:
|
|
1166
|
-
name:
|
|
1125
|
+
exports.BulkActionStatus = zod_1.z.enum(["PENDING", "COMPLETED", "ABORTED"]);
|
|
1126
|
+
exports.BulkActionType = zod_1.z.enum(["CANCEL", "REPLAY"]);
|
|
1127
|
+
exports.BulkActionObject = zod_1.z.object({
|
|
1128
|
+
id: zod_1.z.string(),
|
|
1129
|
+
name: zod_1.z.string().optional(),
|
|
1167
1130
|
type: exports.BulkActionType,
|
|
1168
1131
|
status: exports.BulkActionStatus,
|
|
1169
|
-
counts:
|
|
1170
|
-
total:
|
|
1171
|
-
success:
|
|
1172
|
-
failure:
|
|
1132
|
+
counts: zod_1.z.object({
|
|
1133
|
+
total: zod_1.z.number(),
|
|
1134
|
+
success: zod_1.z.number(),
|
|
1135
|
+
failure: zod_1.z.number(),
|
|
1173
1136
|
}),
|
|
1174
|
-
createdAt:
|
|
1175
|
-
completedAt:
|
|
1137
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1138
|
+
completedAt: zod_1.z.coerce.date().optional(),
|
|
1176
1139
|
});
|
|
1177
|
-
exports.CreateBulkActionResponseBody =
|
|
1178
|
-
id:
|
|
1140
|
+
exports.CreateBulkActionResponseBody = zod_1.z.object({
|
|
1141
|
+
id: zod_1.z.string(),
|
|
1179
1142
|
});
|
|
1180
|
-
exports.AbortBulkActionResponseBody =
|
|
1181
|
-
id:
|
|
1143
|
+
exports.AbortBulkActionResponseBody = zod_1.z.object({
|
|
1144
|
+
id: zod_1.z.string(),
|
|
1182
1145
|
});
|
|
1183
|
-
exports.ListBulkActionsResponseBody =
|
|
1184
|
-
data:
|
|
1185
|
-
pagination:
|
|
1186
|
-
next:
|
|
1187
|
-
previous:
|
|
1146
|
+
exports.ListBulkActionsResponseBody = zod_1.z.object({
|
|
1147
|
+
data: zod_1.z.array(exports.BulkActionObject),
|
|
1148
|
+
pagination: zod_1.z.object({
|
|
1149
|
+
next: zod_1.z.string().optional(),
|
|
1150
|
+
previous: zod_1.z.string().optional(),
|
|
1188
1151
|
}),
|
|
1189
1152
|
});
|
|
1190
|
-
exports.CreateEnvironmentVariableRequestBody =
|
|
1191
|
-
name:
|
|
1192
|
-
value:
|
|
1153
|
+
exports.CreateEnvironmentVariableRequestBody = zod_1.z.object({
|
|
1154
|
+
name: zod_1.z.string(),
|
|
1155
|
+
value: zod_1.z.string(),
|
|
1193
1156
|
// When omitted, the variable defaults to non-secret (the DB default is false).
|
|
1194
|
-
isSecret:
|
|
1157
|
+
isSecret: zod_1.z.boolean().optional(),
|
|
1195
1158
|
});
|
|
1196
|
-
exports.UpdateEnvironmentVariableRequestBody =
|
|
1197
|
-
value:
|
|
1159
|
+
exports.UpdateEnvironmentVariableRequestBody = zod_1.z.object({
|
|
1160
|
+
value: zod_1.z.string(),
|
|
1198
1161
|
});
|
|
1199
|
-
exports.ImportEnvironmentVariablesRequestBody =
|
|
1200
|
-
variables:
|
|
1201
|
-
parentVariables:
|
|
1202
|
-
override:
|
|
1162
|
+
exports.ImportEnvironmentVariablesRequestBody = zod_1.z.object({
|
|
1163
|
+
variables: zod_1.z.record(zod_1.z.string()),
|
|
1164
|
+
parentVariables: zod_1.z.record(zod_1.z.string()).optional(),
|
|
1165
|
+
override: zod_1.z.boolean().optional(),
|
|
1203
1166
|
// When omitted, variables default to non-secret (the DB default is false).
|
|
1204
|
-
isSecret:
|
|
1205
|
-
source:
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1167
|
+
isSecret: zod_1.z.boolean().optional(),
|
|
1168
|
+
source: zod_1.z
|
|
1169
|
+
.discriminatedUnion("type", [
|
|
1170
|
+
zod_1.z.object({ type: zod_1.z.literal("user"), userId: zod_1.z.string() }),
|
|
1171
|
+
zod_1.z.object({ type: zod_1.z.literal("integration"), integration: zod_1.z.string() }),
|
|
1172
|
+
])
|
|
1173
|
+
.optional(),
|
|
1209
1174
|
});
|
|
1210
|
-
exports.EnvironmentVariableResponseBody =
|
|
1211
|
-
success:
|
|
1175
|
+
exports.EnvironmentVariableResponseBody = zod_1.z.object({
|
|
1176
|
+
success: zod_1.z.boolean(),
|
|
1212
1177
|
});
|
|
1213
|
-
exports.EnvironmentVariableValue =
|
|
1214
|
-
value:
|
|
1178
|
+
exports.EnvironmentVariableValue = zod_1.z.object({
|
|
1179
|
+
value: zod_1.z.string(),
|
|
1215
1180
|
});
|
|
1216
|
-
exports.EnvironmentVariable =
|
|
1217
|
-
name:
|
|
1218
|
-
value:
|
|
1181
|
+
exports.EnvironmentVariable = zod_1.z.object({
|
|
1182
|
+
name: zod_1.z.string(),
|
|
1183
|
+
value: zod_1.z.string(),
|
|
1219
1184
|
});
|
|
1220
|
-
exports.EnvironmentVariables =
|
|
1221
|
-
exports.EnvironmentVariableWithSecret =
|
|
1185
|
+
exports.EnvironmentVariables = zod_1.z.array(exports.EnvironmentVariable);
|
|
1186
|
+
exports.EnvironmentVariableWithSecret = zod_1.z.object({
|
|
1222
1187
|
/** The name of the env var, e.g. `DATABASE_URL` */
|
|
1223
|
-
name:
|
|
1188
|
+
name: zod_1.z.string(),
|
|
1224
1189
|
/** The value of the env var. If it's a secret, this will be a redacted value, not the real value. */
|
|
1225
|
-
value:
|
|
1190
|
+
value: zod_1.z.string(),
|
|
1226
1191
|
/**
|
|
1227
1192
|
* Whether the env var is a secret or not.
|
|
1228
1193
|
* When you create env vars you can mark them as secrets.
|
|
@@ -1230,25 +1195,25 @@ exports.EnvironmentVariableWithSecret = v4_1.z.object({
|
|
|
1230
1195
|
* You can't view the value of a secret env var after setting it initially.
|
|
1231
1196
|
* For a secret env var, the value will be redacted.
|
|
1232
1197
|
*/
|
|
1233
|
-
isSecret:
|
|
1198
|
+
isSecret: zod_1.z.boolean(),
|
|
1234
1199
|
});
|
|
1235
1200
|
exports.UpdateMetadataRequestBody = common_js_1.FlushedRunMetadata;
|
|
1236
|
-
exports.UpdateMetadataResponseBody =
|
|
1237
|
-
metadata:
|
|
1201
|
+
exports.UpdateMetadataResponseBody = zod_1.z.object({
|
|
1202
|
+
metadata: zod_1.z.record(json_js_1.DeserializedJsonSchema),
|
|
1238
1203
|
});
|
|
1239
|
-
const RawShapeDate =
|
|
1204
|
+
const RawShapeDate = zod_1.z
|
|
1240
1205
|
.string()
|
|
1241
1206
|
.transform((val) => `${val}Z`)
|
|
1242
|
-
.pipe(
|
|
1243
|
-
const RawOptionalShapeDate =
|
|
1207
|
+
.pipe(zod_1.z.coerce.date());
|
|
1208
|
+
const RawOptionalShapeDate = zod_1.z
|
|
1244
1209
|
.string()
|
|
1245
1210
|
.nullish()
|
|
1246
1211
|
.transform((val) => (val ? new Date(`${val}Z`) : val));
|
|
1247
|
-
exports.SubscribeRunRawShape =
|
|
1248
|
-
id:
|
|
1249
|
-
taskIdentifier:
|
|
1250
|
-
friendlyId:
|
|
1251
|
-
status:
|
|
1212
|
+
exports.SubscribeRunRawShape = zod_1.z.object({
|
|
1213
|
+
id: zod_1.z.string(),
|
|
1214
|
+
taskIdentifier: zod_1.z.string(),
|
|
1215
|
+
friendlyId: zod_1.z.string(),
|
|
1216
|
+
status: zod_1.z.string(),
|
|
1252
1217
|
createdAt: RawShapeDate,
|
|
1253
1218
|
updatedAt: RawShapeDate,
|
|
1254
1219
|
startedAt: RawOptionalShapeDate,
|
|
@@ -1256,74 +1221,74 @@ exports.SubscribeRunRawShape = v4_1.z.object({
|
|
|
1256
1221
|
queuedAt: RawOptionalShapeDate,
|
|
1257
1222
|
expiredAt: RawOptionalShapeDate,
|
|
1258
1223
|
completedAt: RawOptionalShapeDate,
|
|
1259
|
-
idempotencyKey:
|
|
1260
|
-
number:
|
|
1261
|
-
isTest:
|
|
1262
|
-
usageDurationMs:
|
|
1263
|
-
costInCents:
|
|
1264
|
-
baseCostInCents:
|
|
1265
|
-
ttl:
|
|
1266
|
-
payload:
|
|
1267
|
-
payloadType:
|
|
1268
|
-
metadata:
|
|
1269
|
-
metadataType:
|
|
1270
|
-
output:
|
|
1271
|
-
outputType:
|
|
1272
|
-
runTags:
|
|
1224
|
+
idempotencyKey: zod_1.z.string().nullish(),
|
|
1225
|
+
number: zod_1.z.number().default(0),
|
|
1226
|
+
isTest: zod_1.z.boolean().default(false),
|
|
1227
|
+
usageDurationMs: zod_1.z.number().default(0),
|
|
1228
|
+
costInCents: zod_1.z.number().default(0),
|
|
1229
|
+
baseCostInCents: zod_1.z.number().default(0),
|
|
1230
|
+
ttl: zod_1.z.string().nullish(),
|
|
1231
|
+
payload: zod_1.z.string().nullish(),
|
|
1232
|
+
payloadType: zod_1.z.string().nullish(),
|
|
1233
|
+
metadata: zod_1.z.string().nullish(),
|
|
1234
|
+
metadataType: zod_1.z.string().nullish(),
|
|
1235
|
+
output: zod_1.z.string().nullish(),
|
|
1236
|
+
outputType: zod_1.z.string().nullish(),
|
|
1237
|
+
runTags: zod_1.z.array(zod_1.z.string()).nullish().default([]),
|
|
1273
1238
|
error: common_js_1.TaskRunError.nullish(),
|
|
1274
|
-
realtimeStreams:
|
|
1239
|
+
realtimeStreams: zod_1.z.array(zod_1.z.string()).nullish().default([]),
|
|
1275
1240
|
});
|
|
1276
|
-
exports.BatchStatus =
|
|
1241
|
+
exports.BatchStatus = zod_1.z.enum([
|
|
1277
1242
|
"PENDING",
|
|
1278
1243
|
"PROCESSING",
|
|
1279
1244
|
"COMPLETED",
|
|
1280
1245
|
"PARTIAL_FAILED",
|
|
1281
1246
|
"ABORTED",
|
|
1282
1247
|
]);
|
|
1283
|
-
exports.RetrieveBatchResponse =
|
|
1284
|
-
id:
|
|
1248
|
+
exports.RetrieveBatchResponse = zod_1.z.object({
|
|
1249
|
+
id: zod_1.z.string(),
|
|
1285
1250
|
status: exports.BatchStatus,
|
|
1286
|
-
idempotencyKey:
|
|
1287
|
-
createdAt:
|
|
1288
|
-
updatedAt:
|
|
1289
|
-
runCount:
|
|
1290
|
-
runs:
|
|
1291
|
-
});
|
|
1292
|
-
exports.RetrieveBatchV2Response =
|
|
1293
|
-
id:
|
|
1251
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
1252
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1253
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
1254
|
+
runCount: zod_1.z.number(),
|
|
1255
|
+
runs: zod_1.z.array(zod_1.z.string()),
|
|
1256
|
+
});
|
|
1257
|
+
exports.RetrieveBatchV2Response = zod_1.z.object({
|
|
1258
|
+
id: zod_1.z.string(),
|
|
1294
1259
|
status: exports.BatchStatus,
|
|
1295
|
-
idempotencyKey:
|
|
1296
|
-
createdAt:
|
|
1297
|
-
updatedAt:
|
|
1298
|
-
runCount:
|
|
1299
|
-
runs:
|
|
1300
|
-
processing:
|
|
1301
|
-
completedAt:
|
|
1302
|
-
errors:
|
|
1303
|
-
index:
|
|
1304
|
-
taskIdentifier:
|
|
1305
|
-
error:
|
|
1306
|
-
errorCode:
|
|
1260
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
1261
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1262
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
1263
|
+
runCount: zod_1.z.number(),
|
|
1264
|
+
runs: zod_1.z.array(zod_1.z.string()),
|
|
1265
|
+
processing: zod_1.z.object({
|
|
1266
|
+
completedAt: zod_1.z.coerce.date().optional(),
|
|
1267
|
+
errors: zod_1.z.array(zod_1.z.object({
|
|
1268
|
+
index: zod_1.z.number(),
|
|
1269
|
+
taskIdentifier: zod_1.z.string(),
|
|
1270
|
+
error: zod_1.z.string(),
|
|
1271
|
+
errorCode: zod_1.z.string().optional(),
|
|
1307
1272
|
})),
|
|
1308
1273
|
}),
|
|
1309
1274
|
});
|
|
1310
|
-
exports.SubscribeRealtimeStreamChunkRawShape =
|
|
1311
|
-
id:
|
|
1312
|
-
runId:
|
|
1313
|
-
sequence:
|
|
1314
|
-
key:
|
|
1315
|
-
value:
|
|
1316
|
-
createdAt:
|
|
1275
|
+
exports.SubscribeRealtimeStreamChunkRawShape = zod_1.z.object({
|
|
1276
|
+
id: zod_1.z.string(),
|
|
1277
|
+
runId: zod_1.z.string(),
|
|
1278
|
+
sequence: zod_1.z.number(),
|
|
1279
|
+
key: zod_1.z.string(),
|
|
1280
|
+
value: zod_1.z.string(),
|
|
1281
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1317
1282
|
});
|
|
1318
|
-
exports.TimePeriod =
|
|
1319
|
-
exports.CreateWaitpointTokenRequestBody =
|
|
1283
|
+
exports.TimePeriod = zod_1.z.string().or(zod_1.z.coerce.date());
|
|
1284
|
+
exports.CreateWaitpointTokenRequestBody = zod_1.z.object({
|
|
1320
1285
|
/**
|
|
1321
1286
|
* An optional idempotency key for the waitpoint.
|
|
1322
1287
|
* If you use the same key twice (and the key hasn't expired), you will get the original waitpoint back.
|
|
1323
1288
|
*
|
|
1324
1289
|
* Note: This waitpoint may already be complete, in which case when you wait for it, it will immediately continue.
|
|
1325
1290
|
*/
|
|
1326
|
-
idempotencyKey:
|
|
1291
|
+
idempotencyKey: zod_1.z
|
|
1327
1292
|
.string()
|
|
1328
1293
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
1329
1294
|
// on the underlying table — values past this fail at the database layer
|
|
@@ -1334,7 +1299,7 @@ exports.CreateWaitpointTokenRequestBody = v4_1.z.object({
|
|
|
1334
1299
|
* When set, this means the passed in idempotency key will expire after this time.
|
|
1335
1300
|
* This means after that time if you pass the same idempotency key again, you will get a new waitpoint.
|
|
1336
1301
|
*/
|
|
1337
|
-
idempotencyKeyTTL:
|
|
1302
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
1338
1303
|
/** The resume token will timeout after this time.
|
|
1339
1304
|
* If you are waiting for the token in a run, the token will return a result where `ok` is false.
|
|
1340
1305
|
*
|
|
@@ -1356,33 +1321,33 @@ exports.CreateWaitpointTokenRequestBody = v4_1.z.object({
|
|
|
1356
1321
|
*/
|
|
1357
1322
|
tags: exports.RunTags.optional(),
|
|
1358
1323
|
});
|
|
1359
|
-
exports.CreateWaitpointTokenResponseBody =
|
|
1360
|
-
id:
|
|
1361
|
-
isCached:
|
|
1362
|
-
url:
|
|
1324
|
+
exports.CreateWaitpointTokenResponseBody = zod_1.z.object({
|
|
1325
|
+
id: zod_1.z.string(),
|
|
1326
|
+
isCached: zod_1.z.boolean(),
|
|
1327
|
+
url: zod_1.z.string(),
|
|
1363
1328
|
});
|
|
1364
|
-
exports.CreateInputStreamWaitpointRequestBody =
|
|
1365
|
-
streamId:
|
|
1366
|
-
timeout:
|
|
1367
|
-
idempotencyKey:
|
|
1329
|
+
exports.CreateInputStreamWaitpointRequestBody = zod_1.z.object({
|
|
1330
|
+
streamId: zod_1.z.string(),
|
|
1331
|
+
timeout: zod_1.z.string().optional(),
|
|
1332
|
+
idempotencyKey: zod_1.z
|
|
1368
1333
|
.string()
|
|
1369
1334
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
1370
1335
|
// on the underlying table — values past this fail at the database layer
|
|
1371
1336
|
// rather than returning a clean 400.
|
|
1372
1337
|
.max(2048, "idempotencyKey must be 2048 characters or less")
|
|
1373
1338
|
.optional(),
|
|
1374
|
-
idempotencyKeyTTL:
|
|
1375
|
-
tags:
|
|
1339
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
1340
|
+
tags: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1376
1341
|
/**
|
|
1377
1342
|
* The last S2 sequence number the client has seen on this input stream.
|
|
1378
1343
|
* Used to check for data that arrived before .wait() was called.
|
|
1379
1344
|
* If undefined, the server checks from the beginning of the stream.
|
|
1380
1345
|
*/
|
|
1381
|
-
lastSeqNum:
|
|
1346
|
+
lastSeqNum: zod_1.z.number().optional(),
|
|
1382
1347
|
});
|
|
1383
|
-
exports.CreateInputStreamWaitpointResponseBody =
|
|
1384
|
-
waitpointId:
|
|
1385
|
-
isCached:
|
|
1348
|
+
exports.CreateInputStreamWaitpointResponseBody = zod_1.z.object({
|
|
1349
|
+
waitpointId: zod_1.z.string(),
|
|
1350
|
+
isCached: zod_1.z.boolean(),
|
|
1386
1351
|
});
|
|
1387
1352
|
/**
|
|
1388
1353
|
* Create a run-scoped waitpoint that completes when the next record lands on
|
|
@@ -1390,55 +1355,55 @@ exports.CreateInputStreamWaitpointResponseBody = v4_1.z.object({
|
|
|
1390
1355
|
* but keyed by `{sessionId, io}` instead of `{runId, streamId}`. The run is
|
|
1391
1356
|
* still the thing being suspended — Session only supplies the trigger source.
|
|
1392
1357
|
*/
|
|
1393
|
-
exports.CreateSessionStreamWaitpointRequestBody =
|
|
1358
|
+
exports.CreateSessionStreamWaitpointRequestBody = zod_1.z.object({
|
|
1394
1359
|
/** Session friendlyId (`session_*`) or user-supplied externalId. */
|
|
1395
|
-
session:
|
|
1396
|
-
io:
|
|
1397
|
-
timeout:
|
|
1398
|
-
idempotencyKey:
|
|
1360
|
+
session: zod_1.z.string(),
|
|
1361
|
+
io: zod_1.z.enum(["out", "in"]),
|
|
1362
|
+
timeout: zod_1.z.string().optional(),
|
|
1363
|
+
idempotencyKey: zod_1.z
|
|
1399
1364
|
.string()
|
|
1400
1365
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
1401
1366
|
// on the underlying table — values past this fail at the database layer
|
|
1402
1367
|
// rather than returning a clean 400.
|
|
1403
1368
|
.max(2048, "idempotencyKey must be 2048 characters or less")
|
|
1404
1369
|
.optional(),
|
|
1405
|
-
idempotencyKeyTTL:
|
|
1406
|
-
tags:
|
|
1370
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
1371
|
+
tags: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1407
1372
|
/**
|
|
1408
1373
|
* Last S2 sequence number the client has seen on this session channel.
|
|
1409
1374
|
* Used to catch data that arrived before `.wait()` was called.
|
|
1410
1375
|
*/
|
|
1411
|
-
lastSeqNum:
|
|
1376
|
+
lastSeqNum: zod_1.z.number().optional(),
|
|
1412
1377
|
});
|
|
1413
|
-
exports.CreateSessionStreamWaitpointResponseBody =
|
|
1414
|
-
waitpointId:
|
|
1415
|
-
isCached:
|
|
1378
|
+
exports.CreateSessionStreamWaitpointResponseBody = zod_1.z.object({
|
|
1379
|
+
waitpointId: zod_1.z.string(),
|
|
1380
|
+
isCached: zod_1.z.boolean(),
|
|
1416
1381
|
});
|
|
1417
1382
|
exports.waitpointTokenStatuses = ["WAITING", "COMPLETED", "TIMED_OUT"];
|
|
1418
|
-
exports.WaitpointTokenStatus =
|
|
1419
|
-
exports.WaitpointTokenItem =
|
|
1420
|
-
id:
|
|
1383
|
+
exports.WaitpointTokenStatus = zod_1.z.enum(exports.waitpointTokenStatuses);
|
|
1384
|
+
exports.WaitpointTokenItem = zod_1.z.object({
|
|
1385
|
+
id: zod_1.z.string(),
|
|
1421
1386
|
/** If you make a POST request to this URL, it will complete the waitpoint. */
|
|
1422
|
-
url:
|
|
1387
|
+
url: zod_1.z.string(),
|
|
1423
1388
|
status: exports.WaitpointTokenStatus,
|
|
1424
|
-
completedAt:
|
|
1425
|
-
completedAfter:
|
|
1426
|
-
timeoutAt:
|
|
1427
|
-
idempotencyKey:
|
|
1428
|
-
idempotencyKeyExpiresAt:
|
|
1429
|
-
tags:
|
|
1430
|
-
createdAt:
|
|
1389
|
+
completedAt: zod_1.z.coerce.date().optional(),
|
|
1390
|
+
completedAfter: zod_1.z.coerce.date().optional(),
|
|
1391
|
+
timeoutAt: zod_1.z.coerce.date().optional(),
|
|
1392
|
+
idempotencyKey: zod_1.z.string().optional(),
|
|
1393
|
+
idempotencyKeyExpiresAt: zod_1.z.coerce.date().optional(),
|
|
1394
|
+
tags: zod_1.z.array(zod_1.z.string()),
|
|
1395
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1431
1396
|
});
|
|
1432
1397
|
exports.WaitpointListTokenItem = exports.WaitpointTokenItem.omit({
|
|
1433
1398
|
completedAfter: true,
|
|
1434
1399
|
});
|
|
1435
|
-
exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem.and(
|
|
1436
|
-
output:
|
|
1437
|
-
outputType:
|
|
1438
|
-
outputIsError:
|
|
1400
|
+
exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem.and(zod_1.z.object({
|
|
1401
|
+
output: zod_1.z.string().optional(),
|
|
1402
|
+
outputType: zod_1.z.string().optional(),
|
|
1403
|
+
outputIsError: zod_1.z.boolean().optional(),
|
|
1439
1404
|
}));
|
|
1440
|
-
exports.CompleteWaitpointTokenRequestBody =
|
|
1441
|
-
data:
|
|
1405
|
+
exports.CompleteWaitpointTokenRequestBody = zod_1.z.object({
|
|
1406
|
+
data: zod_1.z.any().nullish(),
|
|
1442
1407
|
});
|
|
1443
1408
|
/**
|
|
1444
1409
|
* Trigger config persisted on a Session. Drives every run the session
|
|
@@ -1447,27 +1412,20 @@ exports.CompleteWaitpointTokenRequestBody = v4_1.z.object({
|
|
|
1447
1412
|
* `trigger: "preload" | "trigger"` are merged on top per-call by the
|
|
1448
1413
|
* server's trigger machinery.
|
|
1449
1414
|
*/
|
|
1450
|
-
exports.SessionTriggerConfig =
|
|
1451
|
-
basePayload:
|
|
1415
|
+
exports.SessionTriggerConfig = zod_1.z.object({
|
|
1416
|
+
basePayload: zod_1.z.record(zod_1.z.unknown()),
|
|
1452
1417
|
machine: common_js_1.MachinePresetName.optional(),
|
|
1453
|
-
queue:
|
|
1454
|
-
tags:
|
|
1455
|
-
maxAttempts:
|
|
1418
|
+
queue: zod_1.z.string().max(128).optional(),
|
|
1419
|
+
tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
|
|
1420
|
+
maxAttempts: zod_1.z.number().int().positive().max(10).optional(),
|
|
1456
1421
|
/** Per-run wall-clock cap (seconds). Forwarded to `TaskRunOptions.maxDuration`. */
|
|
1457
|
-
maxDuration:
|
|
1422
|
+
maxDuration: zod_1.z.number().int().positive().optional(),
|
|
1458
1423
|
/** Pin every run to a specific worker version. Forwarded to `TaskRunOptions.lockToVersion`. */
|
|
1459
|
-
lockToVersion:
|
|
1460
|
-
/**
|
|
1461
|
-
* Pin every run the session schedules to the deployment carrying this id, refreshed by each
|
|
1462
|
-
* `sessions.start`. Independent of `lockToVersion`, which wins.
|
|
1463
|
-
*/
|
|
1464
|
-
externalDeploymentId: ExternalDeploymentId,
|
|
1424
|
+
lockToVersion: zod_1.z.string().optional(),
|
|
1465
1425
|
/** Region to schedule runs in. Forwarded to `TaskRunOptions.region`. */
|
|
1466
|
-
region:
|
|
1426
|
+
region: zod_1.z.string().optional(),
|
|
1467
1427
|
/** Convenience field surfaced to chat.agent via the wire payload. */
|
|
1468
|
-
idleTimeoutInSeconds:
|
|
1469
|
-
/** How long a run may sit undequeued before it expires. Forwarded to `TaskRunOptions.ttl`. */
|
|
1470
|
-
ttl: v4_1.z.string().or(v4_1.z.number().nonnegative().int()).optional(),
|
|
1428
|
+
idleTimeoutInSeconds: zod_1.z.number().int().positive().max(3600).optional(),
|
|
1471
1429
|
});
|
|
1472
1430
|
/**
|
|
1473
1431
|
* Request body for `POST /api/v1/sessions`. Creates a Session and
|
|
@@ -1476,11 +1434,11 @@ exports.SessionTriggerConfig = v4_1.z.object({
|
|
|
1476
1434
|
* (after run termination, after `end-and-continue`) reuse the same
|
|
1477
1435
|
* config.
|
|
1478
1436
|
*/
|
|
1479
|
-
exports.CreateSessionRequestBody =
|
|
1437
|
+
exports.CreateSessionRequestBody = zod_1.z.object({
|
|
1480
1438
|
/** Plain string discriminator — e.g. `"chat.agent"`. Not validated against an enum on the server. */
|
|
1481
|
-
type:
|
|
1439
|
+
type: zod_1.z.string().min(1).max(64),
|
|
1482
1440
|
/** User-supplied idempotency key. Unique per environment. Empty strings are rejected. */
|
|
1483
|
-
externalId:
|
|
1441
|
+
externalId: zod_1.z
|
|
1484
1442
|
.string()
|
|
1485
1443
|
.trim()
|
|
1486
1444
|
.min(1)
|
|
@@ -1490,21 +1448,21 @@ exports.CreateSessionRequestBody = v4_1.z.object({
|
|
|
1490
1448
|
})
|
|
1491
1449
|
.optional(),
|
|
1492
1450
|
/** Task this session triggers runs against. Required. */
|
|
1493
|
-
taskIdentifier:
|
|
1451
|
+
taskIdentifier: zod_1.z.string().min(1).max(128),
|
|
1494
1452
|
/** Trigger config used for every run scheduled by this session. */
|
|
1495
1453
|
triggerConfig: exports.SessionTriggerConfig,
|
|
1496
1454
|
/** Up to 10 tags for dashboard filtering. */
|
|
1497
|
-
tags:
|
|
1455
|
+
tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
|
|
1498
1456
|
/** Arbitrary JSON metadata. */
|
|
1499
|
-
metadata:
|
|
1457
|
+
metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
1500
1458
|
/** Absolute expiry timestamp for retention. */
|
|
1501
|
-
expiresAt:
|
|
1459
|
+
expiresAt: zod_1.z.coerce.date().optional(),
|
|
1502
1460
|
});
|
|
1503
|
-
exports.SessionItem =
|
|
1504
|
-
id:
|
|
1505
|
-
externalId:
|
|
1506
|
-
type:
|
|
1507
|
-
taskIdentifier:
|
|
1461
|
+
exports.SessionItem = zod_1.z.object({
|
|
1462
|
+
id: zod_1.z.string(),
|
|
1463
|
+
externalId: zod_1.z.string().nullable(),
|
|
1464
|
+
type: zod_1.z.string(),
|
|
1465
|
+
taskIdentifier: zod_1.z.string(),
|
|
1508
1466
|
/**
|
|
1509
1467
|
* Optional on the wire because some surfaces (the list endpoint backed
|
|
1510
1468
|
* by ClickHouse, list-page rendering) don't carry triggerConfig.
|
|
@@ -1517,27 +1475,22 @@ exports.SessionItem = v4_1.z.object({
|
|
|
1517
1475
|
* `SessionItem` are responsible for resolving the friendly form
|
|
1518
1476
|
* from the underlying cuid before returning.
|
|
1519
1477
|
*/
|
|
1520
|
-
currentRunId:
|
|
1521
|
-
tags:
|
|
1522
|
-
metadata:
|
|
1523
|
-
closedAt:
|
|
1524
|
-
closedReason:
|
|
1525
|
-
expiresAt:
|
|
1526
|
-
createdAt:
|
|
1527
|
-
updatedAt:
|
|
1478
|
+
currentRunId: zod_1.z.string().nullable().optional(),
|
|
1479
|
+
tags: zod_1.z.array(zod_1.z.string()),
|
|
1480
|
+
metadata: zod_1.z.record(zod_1.z.unknown()).nullable(),
|
|
1481
|
+
closedAt: zod_1.z.coerce.date().nullable(),
|
|
1482
|
+
closedReason: zod_1.z.string().nullable(),
|
|
1483
|
+
expiresAt: zod_1.z.coerce.date().nullable(),
|
|
1484
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1485
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
1528
1486
|
});
|
|
1529
1487
|
exports.CreatedSessionResponseBody = exports.SessionItem.extend({
|
|
1530
1488
|
/** Friendly id of the first run triggered alongside session create. */
|
|
1531
|
-
runId:
|
|
1489
|
+
runId: zod_1.z.string(),
|
|
1532
1490
|
/** Session-scoped public access token: `read:sessions:{ext} + write:sessions:{ext}`. */
|
|
1533
|
-
publicAccessToken:
|
|
1491
|
+
publicAccessToken: zod_1.z.string(),
|
|
1534
1492
|
/** True if the session existed already (idempotent upsert), false if newly created. */
|
|
1535
|
-
isCached:
|
|
1536
|
-
/**
|
|
1537
|
-
* The session's live run is parked waiting for a deployment carrying its external deployment
|
|
1538
|
-
* id. Messages sent meanwhile are durable. Optional, so older servers read as `false`.
|
|
1539
|
-
*/
|
|
1540
|
-
pendingVersion: v4_1.z.boolean().optional(),
|
|
1493
|
+
isCached: zod_1.z.boolean(),
|
|
1541
1494
|
});
|
|
1542
1495
|
exports.RetrieveSessionResponseBody = exports.SessionItem;
|
|
1543
1496
|
/**
|
|
@@ -1547,42 +1500,31 @@ exports.RetrieveSessionResponseBody = exports.SessionItem;
|
|
|
1547
1500
|
* server triggers a new run, atomically swaps `currentRunId`, and the
|
|
1548
1501
|
* caller exits.
|
|
1549
1502
|
*/
|
|
1550
|
-
exports.EndAndContinueSessionRequestBody =
|
|
1503
|
+
exports.EndAndContinueSessionRequestBody = zod_1.z.object({
|
|
1551
1504
|
/** The friendlyId of the run requesting the handoff. */
|
|
1552
|
-
callingRunId:
|
|
1505
|
+
callingRunId: zod_1.z.string(),
|
|
1553
1506
|
/** Free-form label for the SessionRun audit row. e.g. `"upgrade"`. */
|
|
1554
|
-
reason:
|
|
1555
|
-
/**
|
|
1556
|
-
* Re-pin the session to this id instead of clearing the pin. Only read when `reason` is
|
|
1557
|
-
* `"upgrade"`. `lockToVersion` is never cleared.
|
|
1558
|
-
*/
|
|
1559
|
-
externalDeploymentId: ExternalDeploymentId,
|
|
1507
|
+
reason: zod_1.z.string().max(64),
|
|
1560
1508
|
});
|
|
1561
|
-
exports.EndAndContinueSessionResponseBody =
|
|
1509
|
+
exports.EndAndContinueSessionResponseBody = zod_1.z.object({
|
|
1562
1510
|
/** friendlyId of the run that has taken over the session. */
|
|
1563
|
-
runId:
|
|
1511
|
+
runId: zod_1.z.string(),
|
|
1564
1512
|
/**
|
|
1565
1513
|
* False when the swap was preempted (a different run was already
|
|
1566
1514
|
* running by the time we tried to claim). The caller should treat
|
|
1567
1515
|
* this as "someone else moved on" — exit cleanly without expecting
|
|
1568
1516
|
* to drive the next run.
|
|
1569
1517
|
*/
|
|
1570
|
-
swapped:
|
|
1571
|
-
/**
|
|
1572
|
-
* The run that took over is parked waiting for its deployment. Surface this so a
|
|
1573
|
-
* handoff onto a version that has not landed reads as a deploy in progress rather
|
|
1574
|
-
* than a chat that went quiet.
|
|
1575
|
-
*/
|
|
1576
|
-
pendingVersion: v4_1.z.boolean().optional(),
|
|
1518
|
+
swapped: zod_1.z.boolean(),
|
|
1577
1519
|
});
|
|
1578
|
-
exports.UpdateSessionRequestBody =
|
|
1579
|
-
tags:
|
|
1580
|
-
metadata:
|
|
1520
|
+
exports.UpdateSessionRequestBody = zod_1.z.object({
|
|
1521
|
+
tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
|
|
1522
|
+
metadata: zod_1.z.record(zod_1.z.unknown()).nullable().optional(),
|
|
1581
1523
|
// Null explicitly clears the externalId; non-null values must be non-empty.
|
|
1582
|
-
externalId:
|
|
1524
|
+
externalId: zod_1.z
|
|
1583
1525
|
.union([
|
|
1584
|
-
|
|
1585
|
-
|
|
1526
|
+
zod_1.z.literal(null),
|
|
1527
|
+
zod_1.z
|
|
1586
1528
|
.string()
|
|
1587
1529
|
.trim()
|
|
1588
1530
|
.min(1)
|
|
@@ -1593,17 +1535,10 @@ exports.UpdateSessionRequestBody = v4_1.z.object({
|
|
|
1593
1535
|
])
|
|
1594
1536
|
.optional(),
|
|
1595
1537
|
});
|
|
1596
|
-
exports.CloseSessionRequestBody =
|
|
1597
|
-
reason:
|
|
1598
|
-
/**
|
|
1599
|
-
* The friendlyId of the run requesting the close, when the close comes
|
|
1600
|
-
* from inside the session's own run (`chat.close()`). That run is already
|
|
1601
|
-
* exiting, so the server skips appending the wake-up close record to `.in`
|
|
1602
|
-
* for it. Omitted for an external close (dashboard, `sessions.close()`, MCP).
|
|
1603
|
-
*/
|
|
1604
|
-
callingRunId: v4_1.z.string().optional(),
|
|
1538
|
+
exports.CloseSessionRequestBody = zod_1.z.object({
|
|
1539
|
+
reason: zod_1.z.string().max(256).optional(),
|
|
1605
1540
|
});
|
|
1606
|
-
exports.SessionStatus =
|
|
1541
|
+
exports.SessionStatus = zod_1.z.enum(["ACTIVE", "CLOSED", "EXPIRED"]);
|
|
1607
1542
|
/**
|
|
1608
1543
|
* Server-side validation schema for `GET /api/v1/sessions`. Follows the same
|
|
1609
1544
|
* cursor-pagination convention as runs/waitpoints (`page[size]`,
|
|
@@ -1611,19 +1546,19 @@ exports.SessionStatus = v4_1.z.enum(["ACTIVE", "CLOSED", "EXPIRED"]);
|
|
|
1611
1546
|
* narrowing fields — both produced automatically by `zodfetchCursorPage`
|
|
1612
1547
|
* and the matching client-side search-query helper.
|
|
1613
1548
|
*/
|
|
1614
|
-
exports.ListSessionsQueryParams =
|
|
1549
|
+
exports.ListSessionsQueryParams = zod_1.z
|
|
1615
1550
|
.object({
|
|
1616
|
-
"page[size]":
|
|
1617
|
-
"page[after]":
|
|
1618
|
-
"page[before]":
|
|
1619
|
-
"filter[type]":
|
|
1620
|
-
"filter[tags]":
|
|
1621
|
-
"filter[taskIdentifier]":
|
|
1622
|
-
"filter[externalId]":
|
|
1623
|
-
"filter[status]":
|
|
1624
|
-
"filter[createdAt][period]":
|
|
1625
|
-
"filter[createdAt][from]":
|
|
1626
|
-
"filter[createdAt][to]":
|
|
1551
|
+
"page[size]": zod_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
1552
|
+
"page[after]": zod_1.z.string().optional(),
|
|
1553
|
+
"page[before]": zod_1.z.string().optional(),
|
|
1554
|
+
"filter[type]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1555
|
+
"filter[tags]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1556
|
+
"filter[taskIdentifier]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1557
|
+
"filter[externalId]": zod_1.z.string().optional(),
|
|
1558
|
+
"filter[status]": zod_1.z.union([exports.SessionStatus, zod_1.z.array(exports.SessionStatus)]).optional(),
|
|
1559
|
+
"filter[createdAt][period]": zod_1.z.string().optional(),
|
|
1560
|
+
"filter[createdAt][from]": zod_1.z.coerce.number().int().optional(),
|
|
1561
|
+
"filter[createdAt][to]": zod_1.z.coerce.number().int().optional(),
|
|
1627
1562
|
})
|
|
1628
1563
|
.refine((value) => !(value["page[after]"] && value["page[before]"]), {
|
|
1629
1564
|
message: "Cannot pass both page[after] and page[before] on the same request",
|
|
@@ -1634,41 +1569,41 @@ exports.ListSessionsQueryParams = v4_1.z
|
|
|
1634
1569
|
* {@link ApiClient.listSessions} converts into the `filter[*]` / `page[*]`
|
|
1635
1570
|
* query string before sending.
|
|
1636
1571
|
*/
|
|
1637
|
-
exports.ListSessionsOptions =
|
|
1638
|
-
limit:
|
|
1639
|
-
after:
|
|
1640
|
-
before:
|
|
1641
|
-
type:
|
|
1642
|
-
tag:
|
|
1643
|
-
taskIdentifier:
|
|
1644
|
-
externalId:
|
|
1645
|
-
status:
|
|
1646
|
-
period:
|
|
1647
|
-
from:
|
|
1648
|
-
to:
|
|
1572
|
+
exports.ListSessionsOptions = zod_1.z.object({
|
|
1573
|
+
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
1574
|
+
after: zod_1.z.string().optional(),
|
|
1575
|
+
before: zod_1.z.string().optional(),
|
|
1576
|
+
type: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1577
|
+
tag: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1578
|
+
taskIdentifier: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
|
|
1579
|
+
externalId: zod_1.z.string().optional(),
|
|
1580
|
+
status: zod_1.z.union([exports.SessionStatus, zod_1.z.array(exports.SessionStatus)]).optional(),
|
|
1581
|
+
period: zod_1.z.string().optional(),
|
|
1582
|
+
from: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
1583
|
+
to: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
1649
1584
|
});
|
|
1650
1585
|
exports.ListedSessionItem = exports.SessionItem;
|
|
1651
|
-
exports.ListSessionsResponseBody =
|
|
1652
|
-
data:
|
|
1653
|
-
pagination:
|
|
1654
|
-
next:
|
|
1655
|
-
previous:
|
|
1586
|
+
exports.ListSessionsResponseBody = zod_1.z.object({
|
|
1587
|
+
data: zod_1.z.array(exports.ListedSessionItem),
|
|
1588
|
+
pagination: zod_1.z.object({
|
|
1589
|
+
next: zod_1.z.string().optional(),
|
|
1590
|
+
previous: zod_1.z.string().optional(),
|
|
1656
1591
|
}),
|
|
1657
1592
|
});
|
|
1658
|
-
exports.CompleteWaitpointTokenResponseBody =
|
|
1659
|
-
success:
|
|
1593
|
+
exports.CompleteWaitpointTokenResponseBody = zod_1.z.object({
|
|
1594
|
+
success: zod_1.z.literal(true),
|
|
1660
1595
|
});
|
|
1661
|
-
exports.WaitForWaitpointTokenResponseBody =
|
|
1662
|
-
success:
|
|
1596
|
+
exports.WaitForWaitpointTokenResponseBody = zod_1.z.object({
|
|
1597
|
+
success: zod_1.z.boolean(),
|
|
1663
1598
|
});
|
|
1664
|
-
exports.WaitForDurationRequestBody =
|
|
1599
|
+
exports.WaitForDurationRequestBody = zod_1.z.object({
|
|
1665
1600
|
/**
|
|
1666
1601
|
* An optional idempotency key for the waitpoint.
|
|
1667
1602
|
* If you use the same key twice (and the key hasn't expired), you will get the original waitpoint back.
|
|
1668
1603
|
*
|
|
1669
1604
|
* Note: This waitpoint may already be complete, in which case when you wait for it, it will immediately continue.
|
|
1670
1605
|
*/
|
|
1671
|
-
idempotencyKey:
|
|
1606
|
+
idempotencyKey: zod_1.z
|
|
1672
1607
|
.string()
|
|
1673
1608
|
// Caps user-supplied keys before they reach the unique idempotency index
|
|
1674
1609
|
// on the underlying table — values past this fail at the database layer
|
|
@@ -1679,20 +1614,20 @@ exports.WaitForDurationRequestBody = v4_1.z.object({
|
|
|
1679
1614
|
* When set, this means the passed in idempotency key will expire after this time.
|
|
1680
1615
|
* This means after that time if you pass the same idempotency key again, you will get a new waitpoint.
|
|
1681
1616
|
*/
|
|
1682
|
-
idempotencyKeyTTL:
|
|
1617
|
+
idempotencyKeyTTL: zod_1.z.string().optional(),
|
|
1683
1618
|
/**
|
|
1684
1619
|
* The date that the waitpoint will complete.
|
|
1685
1620
|
*/
|
|
1686
|
-
date:
|
|
1621
|
+
date: zod_1.z.coerce.date(),
|
|
1687
1622
|
});
|
|
1688
|
-
exports.WaitForDurationResponseBody =
|
|
1623
|
+
exports.WaitForDurationResponseBody = zod_1.z.object({
|
|
1689
1624
|
/**
|
|
1690
1625
|
If you pass an idempotencyKey, you may actually not need to wait.
|
|
1691
1626
|
Use this date to determine when to continue.
|
|
1692
1627
|
*/
|
|
1693
|
-
waitUntil:
|
|
1694
|
-
waitpoint:
|
|
1695
|
-
id:
|
|
1628
|
+
waitUntil: zod_1.z.coerce.date(),
|
|
1629
|
+
waitpoint: zod_1.z.object({
|
|
1630
|
+
id: zod_1.z.string(),
|
|
1696
1631
|
}),
|
|
1697
1632
|
});
|
|
1698
1633
|
const WAITPOINT_TIMEOUT_ERROR_CODE = "TRIGGER_WAITPOINT_TIMEOUT";
|
|
@@ -1712,19 +1647,19 @@ function timeoutError(timeout) {
|
|
|
1712
1647
|
};
|
|
1713
1648
|
}
|
|
1714
1649
|
const ApiDeploymentCommonShape = {
|
|
1715
|
-
from:
|
|
1716
|
-
to:
|
|
1717
|
-
period:
|
|
1718
|
-
status:
|
|
1650
|
+
from: zod_1.z.string().describe("The date to start the search from, in ISO 8601 format").optional(),
|
|
1651
|
+
to: zod_1.z.string().describe("The date to end the search, in ISO 8601 format").optional(),
|
|
1652
|
+
period: zod_1.z.string().describe("The period to search within (e.g. 1d, 7d, 3h, etc.)").optional(),
|
|
1653
|
+
status: zod_1.z
|
|
1719
1654
|
.enum(["PENDING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"])
|
|
1720
1655
|
.describe("Filter deployments that are in this status")
|
|
1721
1656
|
.optional(),
|
|
1722
1657
|
};
|
|
1723
|
-
const ApiDeploymentListPaginationCursor =
|
|
1658
|
+
const ApiDeploymentListPaginationCursor = zod_1.z
|
|
1724
1659
|
.string()
|
|
1725
1660
|
.describe("The deployment ID to start the search from, to get the next page")
|
|
1726
1661
|
.optional();
|
|
1727
|
-
const ApiDeploymentListPaginationLimit =
|
|
1662
|
+
const ApiDeploymentListPaginationLimit = zod_1.z.coerce
|
|
1728
1663
|
.number()
|
|
1729
1664
|
.describe("The number of deployments to return, defaults to 20 (max 100)")
|
|
1730
1665
|
.min(1, "Limit must be at least 1")
|
|
@@ -1735,20 +1670,20 @@ exports.ApiDeploymentListParams = {
|
|
|
1735
1670
|
cursor: ApiDeploymentListPaginationCursor,
|
|
1736
1671
|
limit: ApiDeploymentListPaginationLimit,
|
|
1737
1672
|
};
|
|
1738
|
-
exports.ApiDeploymentListOptions =
|
|
1739
|
-
exports.ApiDeploymentListSearchParams =
|
|
1673
|
+
exports.ApiDeploymentListOptions = zod_1.z.object(exports.ApiDeploymentListParams);
|
|
1674
|
+
exports.ApiDeploymentListSearchParams = zod_1.z.object({
|
|
1740
1675
|
...ApiDeploymentCommonShape,
|
|
1741
1676
|
"page[after]": ApiDeploymentListPaginationCursor,
|
|
1742
1677
|
"page[size]": ApiDeploymentListPaginationLimit,
|
|
1743
1678
|
});
|
|
1744
|
-
exports.ApiDeploymentListResponseItem =
|
|
1745
|
-
id:
|
|
1746
|
-
createdAt:
|
|
1747
|
-
shortCode:
|
|
1748
|
-
version:
|
|
1749
|
-
runtime:
|
|
1750
|
-
runtimeVersion:
|
|
1751
|
-
status:
|
|
1679
|
+
exports.ApiDeploymentListResponseItem = zod_1.z.object({
|
|
1680
|
+
id: zod_1.z.string(),
|
|
1681
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1682
|
+
shortCode: zod_1.z.string(),
|
|
1683
|
+
version: zod_1.z.string(),
|
|
1684
|
+
runtime: zod_1.z.string().nullable(),
|
|
1685
|
+
runtimeVersion: zod_1.z.string().nullable(),
|
|
1686
|
+
status: zod_1.z.enum([
|
|
1752
1687
|
"PENDING",
|
|
1753
1688
|
"BUILDING",
|
|
1754
1689
|
"DEPLOYING",
|
|
@@ -1757,112 +1692,106 @@ exports.ApiDeploymentListResponseItem = v4_1.z.object({
|
|
|
1757
1692
|
"CANCELED",
|
|
1758
1693
|
"TIMED_OUT",
|
|
1759
1694
|
]),
|
|
1760
|
-
deployedAt:
|
|
1761
|
-
git:
|
|
1695
|
+
deployedAt: zod_1.z.coerce.date().optional(),
|
|
1696
|
+
git: zod_1.z.record(zod_1.z.any()).optional(),
|
|
1762
1697
|
error: exports.DeploymentErrorData.optional(),
|
|
1763
|
-
/**
|
|
1764
|
-
* The `--external-id` this deployment was deployed under, used by version skew
|
|
1765
|
-
* protection to pin runs. Nullish on deployments created without one, and on
|
|
1766
|
-
* servers older than this field.
|
|
1767
|
-
*/
|
|
1768
|
-
externalId: v4_1.z.string().nullish(),
|
|
1769
1698
|
});
|
|
1770
1699
|
exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem;
|
|
1771
|
-
exports.ApiBranchListResponseBody =
|
|
1772
|
-
branches:
|
|
1773
|
-
id:
|
|
1774
|
-
name:
|
|
1775
|
-
createdAt:
|
|
1776
|
-
updatedAt:
|
|
1777
|
-
git:
|
|
1778
|
-
isPaused:
|
|
1700
|
+
exports.ApiBranchListResponseBody = zod_1.z.object({
|
|
1701
|
+
branches: zod_1.z.array(zod_1.z.object({
|
|
1702
|
+
id: zod_1.z.string(),
|
|
1703
|
+
name: zod_1.z.string(),
|
|
1704
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1705
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
1706
|
+
git: zod_1.z.record(zod_1.z.any()).optional(),
|
|
1707
|
+
isPaused: zod_1.z.boolean(),
|
|
1779
1708
|
})),
|
|
1780
1709
|
});
|
|
1781
|
-
exports.RetrieveRunTraceSpanSchema =
|
|
1782
|
-
id:
|
|
1783
|
-
parentId:
|
|
1784
|
-
runId:
|
|
1785
|
-
data:
|
|
1786
|
-
message:
|
|
1787
|
-
taskSlug:
|
|
1788
|
-
taskPath:
|
|
1789
|
-
events:
|
|
1790
|
-
startTime:
|
|
1791
|
-
duration:
|
|
1792
|
-
isError:
|
|
1793
|
-
isPartial:
|
|
1794
|
-
isCancelled:
|
|
1795
|
-
level:
|
|
1796
|
-
workerVersion:
|
|
1797
|
-
queueName:
|
|
1798
|
-
machinePreset:
|
|
1799
|
-
properties:
|
|
1800
|
-
output:
|
|
1710
|
+
exports.RetrieveRunTraceSpanSchema = zod_1.z.object({
|
|
1711
|
+
id: zod_1.z.string(),
|
|
1712
|
+
parentId: zod_1.z.string().optional(),
|
|
1713
|
+
runId: zod_1.z.string(),
|
|
1714
|
+
data: zod_1.z.object({
|
|
1715
|
+
message: zod_1.z.string(),
|
|
1716
|
+
taskSlug: zod_1.z.string().optional(),
|
|
1717
|
+
taskPath: zod_1.z.string().optional(),
|
|
1718
|
+
events: zod_1.z.array(zod_1.z.any()).optional(),
|
|
1719
|
+
startTime: zod_1.z.coerce.date(),
|
|
1720
|
+
duration: zod_1.z.number(),
|
|
1721
|
+
isError: zod_1.z.boolean(),
|
|
1722
|
+
isPartial: zod_1.z.boolean(),
|
|
1723
|
+
isCancelled: zod_1.z.boolean(),
|
|
1724
|
+
level: zod_1.z.string(),
|
|
1725
|
+
workerVersion: zod_1.z.string().optional(),
|
|
1726
|
+
queueName: zod_1.z.string().optional(),
|
|
1727
|
+
machinePreset: zod_1.z.string().optional(),
|
|
1728
|
+
properties: zod_1.z.record(zod_1.z.any()).optional(),
|
|
1729
|
+
output: zod_1.z.unknown().optional(),
|
|
1801
1730
|
}),
|
|
1802
1731
|
});
|
|
1803
1732
|
exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema.extend({
|
|
1804
|
-
children:
|
|
1733
|
+
children: zod_1.z.lazy(() => exports.RetrieveRunTraceSpan.array()),
|
|
1805
1734
|
});
|
|
1806
|
-
exports.RetrieveRunTraceResponseBody =
|
|
1807
|
-
trace:
|
|
1808
|
-
traceId:
|
|
1735
|
+
exports.RetrieveRunTraceResponseBody = zod_1.z.object({
|
|
1736
|
+
trace: zod_1.z.object({
|
|
1737
|
+
traceId: zod_1.z.string(),
|
|
1809
1738
|
rootSpan: exports.RetrieveRunTraceSpan,
|
|
1810
1739
|
}),
|
|
1811
1740
|
});
|
|
1812
|
-
exports.RetrieveSpanDetailResponseBody =
|
|
1813
|
-
spanId:
|
|
1814
|
-
parentId:
|
|
1815
|
-
runId:
|
|
1816
|
-
message:
|
|
1817
|
-
isError:
|
|
1818
|
-
isPartial:
|
|
1819
|
-
isCancelled:
|
|
1820
|
-
level:
|
|
1821
|
-
startTime:
|
|
1822
|
-
durationMs:
|
|
1823
|
-
properties:
|
|
1824
|
-
events:
|
|
1825
|
-
entityType:
|
|
1826
|
-
ai:
|
|
1741
|
+
exports.RetrieveSpanDetailResponseBody = zod_1.z.object({
|
|
1742
|
+
spanId: zod_1.z.string(),
|
|
1743
|
+
parentId: zod_1.z.string().nullable(),
|
|
1744
|
+
runId: zod_1.z.string(),
|
|
1745
|
+
message: zod_1.z.string(),
|
|
1746
|
+
isError: zod_1.z.boolean(),
|
|
1747
|
+
isPartial: zod_1.z.boolean(),
|
|
1748
|
+
isCancelled: zod_1.z.boolean(),
|
|
1749
|
+
level: zod_1.z.string(),
|
|
1750
|
+
startTime: zod_1.z.coerce.date(),
|
|
1751
|
+
durationMs: zod_1.z.number(),
|
|
1752
|
+
properties: zod_1.z.record(zod_1.z.any()).optional(),
|
|
1753
|
+
events: zod_1.z.array(zod_1.z.any()).optional(),
|
|
1754
|
+
entityType: zod_1.z.string().optional(),
|
|
1755
|
+
ai: zod_1.z
|
|
1827
1756
|
.object({
|
|
1828
|
-
model:
|
|
1829
|
-
provider:
|
|
1830
|
-
operationName:
|
|
1831
|
-
inputTokens:
|
|
1832
|
-
outputTokens:
|
|
1833
|
-
totalTokens:
|
|
1834
|
-
cachedTokens:
|
|
1835
|
-
reasoningTokens:
|
|
1836
|
-
inputCost:
|
|
1837
|
-
outputCost:
|
|
1838
|
-
totalCost:
|
|
1839
|
-
cachedCost:
|
|
1840
|
-
cacheCreationCost:
|
|
1841
|
-
tokensPerSecond:
|
|
1842
|
-
msToFirstChunk:
|
|
1843
|
-
durationMs:
|
|
1844
|
-
finishReason:
|
|
1845
|
-
responseText:
|
|
1757
|
+
model: zod_1.z.string(),
|
|
1758
|
+
provider: zod_1.z.string(),
|
|
1759
|
+
operationName: zod_1.z.string(),
|
|
1760
|
+
inputTokens: zod_1.z.number(),
|
|
1761
|
+
outputTokens: zod_1.z.number(),
|
|
1762
|
+
totalTokens: zod_1.z.number(),
|
|
1763
|
+
cachedTokens: zod_1.z.number().optional(),
|
|
1764
|
+
reasoningTokens: zod_1.z.number().optional(),
|
|
1765
|
+
inputCost: zod_1.z.number().optional(),
|
|
1766
|
+
outputCost: zod_1.z.number().optional(),
|
|
1767
|
+
totalCost: zod_1.z.number().optional(),
|
|
1768
|
+
cachedCost: zod_1.z.number().optional(),
|
|
1769
|
+
cacheCreationCost: zod_1.z.number().optional(),
|
|
1770
|
+
tokensPerSecond: zod_1.z.number().optional(),
|
|
1771
|
+
msToFirstChunk: zod_1.z.number().optional(),
|
|
1772
|
+
durationMs: zod_1.z.number(),
|
|
1773
|
+
finishReason: zod_1.z.string().optional(),
|
|
1774
|
+
responseText: zod_1.z.string().optional(),
|
|
1846
1775
|
})
|
|
1847
1776
|
.optional(),
|
|
1848
|
-
triggeredRuns:
|
|
1849
|
-
.array(
|
|
1850
|
-
runId:
|
|
1851
|
-
taskIdentifier:
|
|
1852
|
-
status:
|
|
1853
|
-
createdAt:
|
|
1777
|
+
triggeredRuns: zod_1.z
|
|
1778
|
+
.array(zod_1.z.object({
|
|
1779
|
+
runId: zod_1.z.string(),
|
|
1780
|
+
taskIdentifier: zod_1.z.string(),
|
|
1781
|
+
status: zod_1.z.string(),
|
|
1782
|
+
createdAt: zod_1.z.coerce.date(),
|
|
1854
1783
|
}))
|
|
1855
1784
|
.optional(),
|
|
1856
1785
|
});
|
|
1857
|
-
exports.CreateStreamResponseBody =
|
|
1858
|
-
version:
|
|
1786
|
+
exports.CreateStreamResponseBody = zod_1.z.object({
|
|
1787
|
+
version: zod_1.z.string(),
|
|
1859
1788
|
});
|
|
1860
|
-
exports.AppendToStreamResponseBody =
|
|
1861
|
-
ok:
|
|
1862
|
-
message:
|
|
1789
|
+
exports.AppendToStreamResponseBody = zod_1.z.object({
|
|
1790
|
+
ok: zod_1.z.boolean(),
|
|
1791
|
+
message: zod_1.z.string().optional(),
|
|
1863
1792
|
});
|
|
1864
|
-
exports.SendInputStreamResponseBody =
|
|
1865
|
-
ok:
|
|
1793
|
+
exports.SendInputStreamResponseBody = zod_1.z.object({
|
|
1794
|
+
ok: zod_1.z.boolean(),
|
|
1866
1795
|
});
|
|
1867
1796
|
/**
|
|
1868
1797
|
* Response body for `GET /realtime/v1/sessions/:id/:io/records`. A non-SSE,
|
|
@@ -1879,80 +1808,80 @@ exports.SendInputStreamResponseBody = v4_1.z.object({
|
|
|
1879
1808
|
* already runtime-check on the discriminator and tolerate malformed
|
|
1880
1809
|
* records by skipping them.
|
|
1881
1810
|
*/
|
|
1882
|
-
exports.ReadSessionStreamRecordsResponseBody =
|
|
1883
|
-
records:
|
|
1884
|
-
data:
|
|
1885
|
-
id:
|
|
1886
|
-
seqNum:
|
|
1811
|
+
exports.ReadSessionStreamRecordsResponseBody = zod_1.z.object({
|
|
1812
|
+
records: zod_1.z.array(zod_1.z.object({
|
|
1813
|
+
data: zod_1.z.unknown(),
|
|
1814
|
+
id: zod_1.z.string(),
|
|
1815
|
+
seqNum: zod_1.z.number(),
|
|
1887
1816
|
// S2 record headers — present on Trigger control records (e.g.
|
|
1888
1817
|
// `trigger-control: turn-complete` plus sibling headers). The
|
|
1889
1818
|
// server has always serialized them; older schemas stripped them
|
|
1890
1819
|
// client-side, so treat as optional.
|
|
1891
|
-
headers:
|
|
1820
|
+
headers: zod_1.z.array(zod_1.z.tuple([zod_1.z.string(), zod_1.z.string()])).optional(),
|
|
1892
1821
|
})),
|
|
1893
1822
|
});
|
|
1894
|
-
exports.ResolvePromptRequestBody =
|
|
1895
|
-
variables:
|
|
1896
|
-
label:
|
|
1897
|
-
version:
|
|
1898
|
-
});
|
|
1899
|
-
exports.ResolvePromptResponseBody =
|
|
1900
|
-
data:
|
|
1901
|
-
promptId:
|
|
1902
|
-
slug:
|
|
1903
|
-
version:
|
|
1904
|
-
labels:
|
|
1905
|
-
template:
|
|
1906
|
-
text:
|
|
1907
|
-
model:
|
|
1908
|
-
config:
|
|
1823
|
+
exports.ResolvePromptRequestBody = zod_1.z.object({
|
|
1824
|
+
variables: zod_1.z.record(zod_1.z.unknown()).default({}),
|
|
1825
|
+
label: zod_1.z.string().optional(),
|
|
1826
|
+
version: zod_1.z.number().optional(),
|
|
1827
|
+
});
|
|
1828
|
+
exports.ResolvePromptResponseBody = zod_1.z.object({
|
|
1829
|
+
data: zod_1.z.object({
|
|
1830
|
+
promptId: zod_1.z.string(),
|
|
1831
|
+
slug: zod_1.z.string(),
|
|
1832
|
+
version: zod_1.z.number(),
|
|
1833
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
1834
|
+
template: zod_1.z.string().optional(),
|
|
1835
|
+
text: zod_1.z.string().optional(),
|
|
1836
|
+
model: zod_1.z.string().optional().nullable(),
|
|
1837
|
+
config: zod_1.z.record(zod_1.z.unknown()).optional().nullable(),
|
|
1909
1838
|
}),
|
|
1910
1839
|
});
|
|
1911
|
-
exports.ListPromptsResponseBody =
|
|
1912
|
-
data:
|
|
1913
|
-
slug:
|
|
1914
|
-
friendlyId:
|
|
1915
|
-
description:
|
|
1916
|
-
tags:
|
|
1917
|
-
defaultModel:
|
|
1918
|
-
currentVersion:
|
|
1919
|
-
hasOverride:
|
|
1920
|
-
updatedAt:
|
|
1840
|
+
exports.ListPromptsResponseBody = zod_1.z.object({
|
|
1841
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
1842
|
+
slug: zod_1.z.string(),
|
|
1843
|
+
friendlyId: zod_1.z.string(),
|
|
1844
|
+
description: zod_1.z.string().nullable(),
|
|
1845
|
+
tags: zod_1.z.array(zod_1.z.string()),
|
|
1846
|
+
defaultModel: zod_1.z.string().nullable(),
|
|
1847
|
+
currentVersion: zod_1.z.number().nullable(),
|
|
1848
|
+
hasOverride: zod_1.z.boolean(),
|
|
1849
|
+
updatedAt: zod_1.z.string(),
|
|
1921
1850
|
})),
|
|
1922
1851
|
});
|
|
1923
|
-
exports.ListPromptVersionsResponseBody =
|
|
1924
|
-
data:
|
|
1925
|
-
id:
|
|
1926
|
-
version:
|
|
1927
|
-
labels:
|
|
1928
|
-
source:
|
|
1929
|
-
model:
|
|
1930
|
-
textContent:
|
|
1931
|
-
commitMessage:
|
|
1932
|
-
contentHash:
|
|
1933
|
-
createdAt:
|
|
1852
|
+
exports.ListPromptVersionsResponseBody = zod_1.z.object({
|
|
1853
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
1854
|
+
id: zod_1.z.string(),
|
|
1855
|
+
version: zod_1.z.number(),
|
|
1856
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
1857
|
+
source: zod_1.z.string(),
|
|
1858
|
+
model: zod_1.z.string().nullable(),
|
|
1859
|
+
textContent: zod_1.z.string().nullable(),
|
|
1860
|
+
commitMessage: zod_1.z.string().nullable(),
|
|
1861
|
+
contentHash: zod_1.z.string(),
|
|
1862
|
+
createdAt: zod_1.z.string(),
|
|
1934
1863
|
})),
|
|
1935
1864
|
});
|
|
1936
|
-
exports.PromotePromptVersionRequestBody =
|
|
1937
|
-
version:
|
|
1865
|
+
exports.PromotePromptVersionRequestBody = zod_1.z.object({
|
|
1866
|
+
version: zod_1.z.number().int().positive(),
|
|
1938
1867
|
});
|
|
1939
|
-
exports.CreatePromptOverrideRequestBody =
|
|
1940
|
-
textContent:
|
|
1941
|
-
model:
|
|
1942
|
-
commitMessage:
|
|
1943
|
-
source:
|
|
1868
|
+
exports.CreatePromptOverrideRequestBody = zod_1.z.object({
|
|
1869
|
+
textContent: zod_1.z.string(),
|
|
1870
|
+
model: zod_1.z.string().optional(),
|
|
1871
|
+
commitMessage: zod_1.z.string().optional(),
|
|
1872
|
+
source: zod_1.z.string().optional(),
|
|
1944
1873
|
});
|
|
1945
|
-
exports.UpdatePromptOverrideRequestBody =
|
|
1946
|
-
textContent:
|
|
1947
|
-
model:
|
|
1948
|
-
commitMessage:
|
|
1874
|
+
exports.UpdatePromptOverrideRequestBody = zod_1.z.object({
|
|
1875
|
+
textContent: zod_1.z.string().optional(),
|
|
1876
|
+
model: zod_1.z.string().optional(),
|
|
1877
|
+
commitMessage: zod_1.z.string().optional(),
|
|
1949
1878
|
});
|
|
1950
|
-
exports.ReactivatePromptOverrideRequestBody =
|
|
1951
|
-
version:
|
|
1879
|
+
exports.ReactivatePromptOverrideRequestBody = zod_1.z.object({
|
|
1880
|
+
version: zod_1.z.number().int().positive(),
|
|
1952
1881
|
});
|
|
1953
|
-
exports.PromptOkResponseBody =
|
|
1954
|
-
exports.PromptOverrideCreatedResponseBody =
|
|
1955
|
-
ok:
|
|
1956
|
-
version:
|
|
1882
|
+
exports.PromptOkResponseBody = zod_1.z.object({ ok: zod_1.z.boolean() });
|
|
1883
|
+
exports.PromptOverrideCreatedResponseBody = zod_1.z.object({
|
|
1884
|
+
ok: zod_1.z.boolean(),
|
|
1885
|
+
version: zod_1.z.number(),
|
|
1957
1886
|
});
|
|
1958
1887
|
//# sourceMappingURL=api.js.map
|