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