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