@trigger.dev/core 4.1.2 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1967,6 +1967,28 @@ export declare const ExternalBuildData: z.ZodObject<{
1967
1967
  buildToken: string;
1968
1968
  }>;
1969
1969
  export type ExternalBuildData = z.infer<typeof ExternalBuildData>;
1970
+ export declare const DeploymentTriggeredVia: z.ZodUnion<[z.ZodEnum<["cli:manual", "cli:ci_other", "cli:github_actions", "cli:gitlab_ci", "cli:circleci", "cli:jenkins", "cli:azure_pipelines", "cli:bitbucket_pipelines", "cli:travis_ci", "cli:buildkite", "git_integration:github", "dashboard"]>, z.ZodType<string & {}, z.ZodTypeDef, string & {}>]>;
1971
+ export type DeploymentTriggeredVia = z.infer<typeof DeploymentTriggeredVia>;
1972
+ export declare const BuildServerMetadata: z.ZodObject<{
1973
+ buildId: z.ZodOptional<z.ZodString>;
1974
+ isNativeBuild: z.ZodOptional<z.ZodBoolean>;
1975
+ artifactKey: z.ZodOptional<z.ZodString>;
1976
+ skipPromotion: z.ZodOptional<z.ZodBoolean>;
1977
+ configFilePath: z.ZodOptional<z.ZodString>;
1978
+ }, "strip", z.ZodTypeAny, {
1979
+ skipPromotion?: boolean | undefined;
1980
+ buildId?: string | undefined;
1981
+ isNativeBuild?: boolean | undefined;
1982
+ artifactKey?: string | undefined;
1983
+ configFilePath?: string | undefined;
1984
+ }, {
1985
+ skipPromotion?: boolean | undefined;
1986
+ buildId?: string | undefined;
1987
+ isNativeBuild?: boolean | undefined;
1988
+ artifactKey?: string | undefined;
1989
+ configFilePath?: string | undefined;
1990
+ }>;
1991
+ export type BuildServerMetadata = z.infer<typeof BuildServerMetadata>;
1970
1992
  export declare const UpsertBranchRequestBody: z.ZodObject<{
1971
1993
  git: z.ZodOptional<z.ZodObject<{
1972
1994
  provider: z.ZodOptional<z.ZodString>;
@@ -2059,6 +2081,37 @@ export declare const UpsertBranchResponseBody: z.ZodObject<{
2059
2081
  id: string;
2060
2082
  }>;
2061
2083
  export type UpsertBranchResponseBody = z.infer<typeof UpsertBranchResponseBody>;
2084
+ export declare const CreateArtifactRequestBody: z.ZodObject<{
2085
+ type: z.ZodDefault<z.ZodEnum<["deployment_context"]>>;
2086
+ contentType: z.ZodDefault<z.ZodString>;
2087
+ contentLength: z.ZodOptional<z.ZodNumber>;
2088
+ }, "strip", z.ZodTypeAny, {
2089
+ type: "deployment_context";
2090
+ contentType: string;
2091
+ contentLength?: number | undefined;
2092
+ }, {
2093
+ type?: "deployment_context" | undefined;
2094
+ contentType?: string | undefined;
2095
+ contentLength?: number | undefined;
2096
+ }>;
2097
+ export type CreateArtifactRequestBody = z.infer<typeof CreateArtifactRequestBody>;
2098
+ export declare const CreateArtifactResponseBody: z.ZodObject<{
2099
+ artifactKey: z.ZodString;
2100
+ uploadUrl: z.ZodString;
2101
+ uploadFields: z.ZodRecord<z.ZodString, z.ZodString>;
2102
+ expiresAt: z.ZodString;
2103
+ }, "strip", z.ZodTypeAny, {
2104
+ artifactKey: string;
2105
+ uploadUrl: string;
2106
+ uploadFields: Record<string, string>;
2107
+ expiresAt: string;
2108
+ }, {
2109
+ artifactKey: string;
2110
+ uploadUrl: string;
2111
+ uploadFields: Record<string, string>;
2112
+ expiresAt: string;
2113
+ }>;
2114
+ export type CreateArtifactResponseBody = z.infer<typeof CreateArtifactResponseBody>;
2062
2115
  export declare const InitializeDeploymentResponseBody: z.ZodObject<{
2063
2116
  id: z.ZodString;
2064
2117
  contentHash: z.ZodString;
@@ -2079,6 +2132,33 @@ export declare const InitializeDeploymentResponseBody: z.ZodObject<{
2079
2132
  buildId: string;
2080
2133
  buildToken: string;
2081
2134
  }>>>;
2135
+ eventStream: z.ZodOptional<z.ZodObject<{
2136
+ s2: z.ZodObject<{
2137
+ basin: z.ZodString;
2138
+ stream: z.ZodString;
2139
+ accessToken: z.ZodString;
2140
+ }, "strip", z.ZodTypeAny, {
2141
+ basin: string;
2142
+ stream: string;
2143
+ accessToken: string;
2144
+ }, {
2145
+ basin: string;
2146
+ stream: string;
2147
+ accessToken: string;
2148
+ }>;
2149
+ }, "strip", z.ZodTypeAny, {
2150
+ s2: {
2151
+ basin: string;
2152
+ stream: string;
2153
+ accessToken: string;
2154
+ };
2155
+ }, {
2156
+ s2: {
2157
+ basin: string;
2158
+ stream: string;
2159
+ accessToken: string;
2160
+ };
2161
+ }>>;
2082
2162
  }, "strip", z.ZodTypeAny, {
2083
2163
  id: string;
2084
2164
  version: string;
@@ -2091,6 +2171,13 @@ export declare const InitializeDeploymentResponseBody: z.ZodObject<{
2091
2171
  buildId: string;
2092
2172
  buildToken: string;
2093
2173
  } | null | undefined;
2174
+ eventStream?: {
2175
+ s2: {
2176
+ basin: string;
2177
+ stream: string;
2178
+ accessToken: string;
2179
+ };
2180
+ } | undefined;
2094
2181
  }, {
2095
2182
  id: string;
2096
2183
  version: string;
@@ -2103,9 +2190,16 @@ export declare const InitializeDeploymentResponseBody: z.ZodObject<{
2103
2190
  buildId: string;
2104
2191
  buildToken: string;
2105
2192
  } | null | undefined;
2193
+ eventStream?: {
2194
+ s2: {
2195
+ basin: string;
2196
+ stream: string;
2197
+ accessToken: string;
2198
+ };
2199
+ } | undefined;
2106
2200
  }>;
2107
2201
  export type InitializeDeploymentResponseBody = z.infer<typeof InitializeDeploymentResponseBody>;
2108
- export declare const InitializeDeploymentRequestBody: z.ZodObject<{
2202
+ export declare const InitializeDeploymentRequestBody: z.ZodIntersection<z.ZodObject<{
2109
2203
  contentHash: z.ZodString;
2110
2204
  userId: z.ZodOptional<z.ZodString>;
2111
2205
  /** @deprecated This is now determined by the webapp. This is only used to warn users with old CLI versions. */
@@ -2156,6 +2250,8 @@ export declare const InitializeDeploymentRequestBody: z.ZodObject<{
2156
2250
  type: z.ZodOptional<z.ZodEnum<["MANAGED", "UNMANAGED", "V1"]>>;
2157
2251
  runtime: z.ZodOptional<z.ZodString>;
2158
2252
  initialStatus: z.ZodOptional<z.ZodEnum<["PENDING", "BUILDING"]>>;
2253
+ triggeredVia: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["cli:manual", "cli:ci_other", "cli:github_actions", "cli:gitlab_ci", "cli:circleci", "cli:jenkins", "cli:azure_pipelines", "cli:bitbucket_pipelines", "cli:travis_ci", "cli:buildkite", "git_integration:github", "dashboard"]>, z.ZodType<string & {}, z.ZodTypeDef, string & {}>]>>;
2254
+ buildId: z.ZodOptional<z.ZodString>;
2159
2255
  }, "strip", z.ZodTypeAny, {
2160
2256
  contentHash: string;
2161
2257
  type?: "V1" | "MANAGED" | "UNMANAGED" | undefined;
@@ -2177,7 +2273,9 @@ export declare const InitializeDeploymentRequestBody: z.ZodObject<{
2177
2273
  pullRequestTitle?: string | undefined;
2178
2274
  pullRequestState?: "open" | "closed" | "merged" | undefined;
2179
2275
  } | undefined;
2276
+ buildId?: string | undefined;
2180
2277
  initialStatus?: "PENDING" | "BUILDING" | undefined;
2278
+ triggeredVia?: (string & {}) | "cli:manual" | "cli:ci_other" | "cli:github_actions" | "cli:gitlab_ci" | "cli:circleci" | "cli:jenkins" | "cli:azure_pipelines" | "cli:bitbucket_pipelines" | "cli:travis_ci" | "cli:buildkite" | "git_integration:github" | "dashboard" | undefined;
2181
2279
  }, {
2182
2280
  contentHash: string;
2183
2281
  type?: "V1" | "MANAGED" | "UNMANAGED" | undefined;
@@ -2199,8 +2297,38 @@ export declare const InitializeDeploymentRequestBody: z.ZodObject<{
2199
2297
  pullRequestTitle?: string | undefined;
2200
2298
  pullRequestState?: "open" | "closed" | "merged" | undefined;
2201
2299
  } | undefined;
2300
+ buildId?: string | undefined;
2202
2301
  initialStatus?: "PENDING" | "BUILDING" | undefined;
2203
- }>;
2302
+ triggeredVia?: (string & {}) | "cli:manual" | "cli:ci_other" | "cli:github_actions" | "cli:gitlab_ci" | "cli:circleci" | "cli:jenkins" | "cli:azure_pipelines" | "cli:bitbucket_pipelines" | "cli:travis_ci" | "cli:buildkite" | "git_integration:github" | "dashboard" | undefined;
2303
+ }>, z.ZodEffects<z.ZodDiscriminatedUnion<"isNativeBuild", [z.ZodObject<{
2304
+ isNativeBuild: z.ZodLiteral<true>;
2305
+ skipPromotion: z.ZodBoolean;
2306
+ artifactKey: z.ZodString;
2307
+ configFilePath: z.ZodOptional<z.ZodString>;
2308
+ }, "strip", z.ZodTypeAny, {
2309
+ skipPromotion: boolean;
2310
+ isNativeBuild: true;
2311
+ artifactKey: string;
2312
+ configFilePath?: string | undefined;
2313
+ }, {
2314
+ skipPromotion: boolean;
2315
+ isNativeBuild: true;
2316
+ artifactKey: string;
2317
+ configFilePath?: string | undefined;
2318
+ }>, z.ZodObject<{
2319
+ isNativeBuild: z.ZodLiteral<false>;
2320
+ }, "strip", z.ZodTypeAny, {
2321
+ isNativeBuild: false;
2322
+ }, {
2323
+ isNativeBuild: false;
2324
+ }>]>, {
2325
+ skipPromotion: boolean;
2326
+ isNativeBuild: true;
2327
+ artifactKey: string;
2328
+ configFilePath?: string | undefined;
2329
+ } | {
2330
+ isNativeBuild: false;
2331
+ }, unknown>>;
2204
2332
  export type InitializeDeploymentRequestBody = z.infer<typeof InitializeDeploymentRequestBody>;
2205
2333
  export declare const RemoteBuildProviderStatusResponseBody: z.ZodObject<{
2206
2334
  status: z.ZodEnum<["operational", "degraded", "unknown"]>;
@@ -2219,14 +2347,14 @@ export declare const GenerateRegistryCredentialsResponseBody: z.ZodObject<{
2219
2347
  expiresAt: z.ZodString;
2220
2348
  repositoryUri: z.ZodString;
2221
2349
  }, "strip", z.ZodTypeAny, {
2350
+ expiresAt: string;
2222
2351
  username: string;
2223
2352
  password: string;
2224
- expiresAt: string;
2225
2353
  repositoryUri: string;
2226
2354
  }, {
2355
+ expiresAt: string;
2227
2356
  username: string;
2228
2357
  password: string;
2229
- expiresAt: string;
2230
2358
  repositoryUri: string;
2231
2359
  }>;
2232
2360
  export type GenerateRegistryCredentialsResponseBody = z.infer<typeof GenerateRegistryCredentialsResponseBody>;
@@ -2552,6 +2680,157 @@ export declare const GetLatestDeploymentResponseBody: z.ZodObject<Omit<{
2552
2680
  } | null | undefined;
2553
2681
  }>;
2554
2682
  export type GetLatestDeploymentResponseBody = z.infer<typeof GetLatestDeploymentResponseBody>;
2683
+ export declare const DeploymentLogEvent: z.ZodObject<{
2684
+ type: z.ZodLiteral<"log">;
2685
+ data: z.ZodObject<{
2686
+ level: z.ZodDefault<z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>>;
2687
+ message: z.ZodString;
2688
+ }, "strip", z.ZodTypeAny, {
2689
+ message: string;
2690
+ level: "error" | "warn" | "info" | "debug";
2691
+ }, {
2692
+ message: string;
2693
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2694
+ }>;
2695
+ }, "strip", z.ZodTypeAny, {
2696
+ type: "log";
2697
+ data: {
2698
+ message: string;
2699
+ level: "error" | "warn" | "info" | "debug";
2700
+ };
2701
+ }, {
2702
+ type: "log";
2703
+ data: {
2704
+ message: string;
2705
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2706
+ };
2707
+ }>;
2708
+ export declare const DeploymentFinalizedEvent: z.ZodObject<{
2709
+ type: z.ZodLiteral<"finalized">;
2710
+ data: z.ZodObject<{
2711
+ result: z.ZodUnion<[z.ZodEnum<["succeeded", "failed", "timed_out", "canceled"]>, z.ZodType<string & {}, z.ZodTypeDef, string & {}>]>;
2712
+ message: z.ZodOptional<z.ZodString>;
2713
+ }, "strip", z.ZodTypeAny, {
2714
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2715
+ message?: string | undefined;
2716
+ }, {
2717
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2718
+ message?: string | undefined;
2719
+ }>;
2720
+ }, "strip", z.ZodTypeAny, {
2721
+ type: "finalized";
2722
+ data: {
2723
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2724
+ message?: string | undefined;
2725
+ };
2726
+ }, {
2727
+ type: "finalized";
2728
+ data: {
2729
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2730
+ message?: string | undefined;
2731
+ };
2732
+ }>;
2733
+ export declare const DeploymentEvent: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2734
+ type: z.ZodLiteral<"log">;
2735
+ data: z.ZodObject<{
2736
+ level: z.ZodDefault<z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>>;
2737
+ message: z.ZodString;
2738
+ }, "strip", z.ZodTypeAny, {
2739
+ message: string;
2740
+ level: "error" | "warn" | "info" | "debug";
2741
+ }, {
2742
+ message: string;
2743
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2744
+ }>;
2745
+ }, "strip", z.ZodTypeAny, {
2746
+ type: "log";
2747
+ data: {
2748
+ message: string;
2749
+ level: "error" | "warn" | "info" | "debug";
2750
+ };
2751
+ }, {
2752
+ type: "log";
2753
+ data: {
2754
+ message: string;
2755
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2756
+ };
2757
+ }>, z.ZodObject<{
2758
+ type: z.ZodLiteral<"finalized">;
2759
+ data: z.ZodObject<{
2760
+ result: z.ZodUnion<[z.ZodEnum<["succeeded", "failed", "timed_out", "canceled"]>, z.ZodType<string & {}, z.ZodTypeDef, string & {}>]>;
2761
+ message: z.ZodOptional<z.ZodString>;
2762
+ }, "strip", z.ZodTypeAny, {
2763
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2764
+ message?: string | undefined;
2765
+ }, {
2766
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2767
+ message?: string | undefined;
2768
+ }>;
2769
+ }, "strip", z.ZodTypeAny, {
2770
+ type: "finalized";
2771
+ data: {
2772
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2773
+ message?: string | undefined;
2774
+ };
2775
+ }, {
2776
+ type: "finalized";
2777
+ data: {
2778
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2779
+ message?: string | undefined;
2780
+ };
2781
+ }>]>;
2782
+ export type DeploymentEvent = z.infer<typeof DeploymentEvent>;
2783
+ export type DeploymentLogEvent = z.infer<typeof DeploymentLogEvent>;
2784
+ export type DeploymentFinalizedEvent = z.infer<typeof DeploymentFinalizedEvent>;
2785
+ export declare const DeploymentEventFromString: z.ZodPipeline<z.ZodEffects<z.ZodString, any, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2786
+ type: z.ZodLiteral<"log">;
2787
+ data: z.ZodObject<{
2788
+ level: z.ZodDefault<z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>>;
2789
+ message: z.ZodString;
2790
+ }, "strip", z.ZodTypeAny, {
2791
+ message: string;
2792
+ level: "error" | "warn" | "info" | "debug";
2793
+ }, {
2794
+ message: string;
2795
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2796
+ }>;
2797
+ }, "strip", z.ZodTypeAny, {
2798
+ type: "log";
2799
+ data: {
2800
+ message: string;
2801
+ level: "error" | "warn" | "info" | "debug";
2802
+ };
2803
+ }, {
2804
+ type: "log";
2805
+ data: {
2806
+ message: string;
2807
+ level?: "error" | "warn" | "info" | "debug" | undefined;
2808
+ };
2809
+ }>, z.ZodObject<{
2810
+ type: z.ZodLiteral<"finalized">;
2811
+ data: z.ZodObject<{
2812
+ result: z.ZodUnion<[z.ZodEnum<["succeeded", "failed", "timed_out", "canceled"]>, z.ZodType<string & {}, z.ZodTypeDef, string & {}>]>;
2813
+ message: z.ZodOptional<z.ZodString>;
2814
+ }, "strip", z.ZodTypeAny, {
2815
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2816
+ message?: string | undefined;
2817
+ }, {
2818
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2819
+ message?: string | undefined;
2820
+ }>;
2821
+ }, "strip", z.ZodTypeAny, {
2822
+ type: "finalized";
2823
+ data: {
2824
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2825
+ message?: string | undefined;
2826
+ };
2827
+ }, {
2828
+ type: "finalized";
2829
+ data: {
2830
+ result: (string & {}) | "succeeded" | "failed" | "timed_out" | "canceled";
2831
+ message?: string | undefined;
2832
+ };
2833
+ }>]>>;
2555
2834
  export declare const CreateUploadPayloadUrlResponseBody: z.ZodObject<{
2556
2835
  presignedUrl: z.ZodString;
2557
2836
  }, "strip", z.ZodTypeAny, {
@@ -6081,10 +6360,10 @@ export declare const RetrieveRunTraceSpanSchema: z.ZodObject<{
6081
6360
  message: string;
6082
6361
  duration: number;
6083
6362
  isCancelled: boolean;
6363
+ level: string;
6084
6364
  startTime: Date;
6085
6365
  isError: boolean;
6086
6366
  isPartial: boolean;
6087
- level: string;
6088
6367
  output?: unknown;
6089
6368
  properties?: Record<string, any> | undefined;
6090
6369
  taskSlug?: string | undefined;
@@ -6097,10 +6376,10 @@ export declare const RetrieveRunTraceSpanSchema: z.ZodObject<{
6097
6376
  message: string;
6098
6377
  duration: number;
6099
6378
  isCancelled: boolean;
6379
+ level: string;
6100
6380
  startTime: Date;
6101
6381
  isError: boolean;
6102
6382
  isPartial: boolean;
6103
- level: string;
6104
6383
  output?: unknown;
6105
6384
  properties?: Record<string, any> | undefined;
6106
6385
  taskSlug?: string | undefined;
@@ -6116,10 +6395,10 @@ export declare const RetrieveRunTraceSpanSchema: z.ZodObject<{
6116
6395
  message: string;
6117
6396
  duration: number;
6118
6397
  isCancelled: boolean;
6398
+ level: string;
6119
6399
  startTime: Date;
6120
6400
  isError: boolean;
6121
6401
  isPartial: boolean;
6122
- level: string;
6123
6402
  output?: unknown;
6124
6403
  properties?: Record<string, any> | undefined;
6125
6404
  taskSlug?: string | undefined;
@@ -6137,10 +6416,10 @@ export declare const RetrieveRunTraceSpanSchema: z.ZodObject<{
6137
6416
  message: string;
6138
6417
  duration: number;
6139
6418
  isCancelled: boolean;
6419
+ level: string;
6140
6420
  startTime: Date;
6141
6421
  isError: boolean;
6142
6422
  isPartial: boolean;
6143
- level: string;
6144
6423
  output?: unknown;
6145
6424
  properties?: Record<string, any> | undefined;
6146
6425
  taskSlug?: string | undefined;
@@ -6169,10 +6448,10 @@ export declare const RetrieveRunTraceResponseBody: z.ZodObject<{
6169
6448
  message: string;
6170
6449
  duration: number;
6171
6450
  isCancelled: boolean;
6451
+ level: string;
6172
6452
  startTime: Date;
6173
6453
  isError: boolean;
6174
6454
  isPartial: boolean;
6175
- level: string;
6176
6455
  output?: unknown;
6177
6456
  properties?: Record<string, any> | undefined;
6178
6457
  taskSlug?: string | undefined;
@@ -6195,10 +6474,10 @@ export declare const RetrieveRunTraceResponseBody: z.ZodObject<{
6195
6474
  message: string;
6196
6475
  duration: number;
6197
6476
  isCancelled: boolean;
6477
+ level: string;
6198
6478
  startTime: Date;
6199
6479
  isError: boolean;
6200
6480
  isPartial: boolean;
6201
- level: string;
6202
6481
  output?: unknown;
6203
6482
  properties?: Record<string, any> | undefined;
6204
6483
  taskSlug?: string | undefined;
@@ -6223,10 +6502,10 @@ export declare const RetrieveRunTraceResponseBody: z.ZodObject<{
6223
6502
  message: string;
6224
6503
  duration: number;
6225
6504
  isCancelled: boolean;
6505
+ level: string;
6226
6506
  startTime: Date;
6227
6507
  isError: boolean;
6228
6508
  isPartial: boolean;
6229
- level: string;
6230
6509
  output?: unknown;
6231
6510
  properties?: Record<string, any> | undefined;
6232
6511
  taskSlug?: string | undefined;
@@ -6251,10 +6530,10 @@ export declare const RetrieveRunTraceResponseBody: z.ZodObject<{
6251
6530
  message: string;
6252
6531
  duration: number;
6253
6532
  isCancelled: boolean;
6533
+ level: string;
6254
6534
  startTime: Date;
6255
6535
  isError: boolean;
6256
6536
  isPartial: boolean;
6257
- level: string;
6258
6537
  output?: unknown;
6259
6538
  properties?: Record<string, any> | undefined;
6260
6539
  taskSlug?: string | undefined;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.CreateUploadPayloadUrlResponseBody = exports.GetLatestDeploymentResponseBody = exports.GetDeploymentResponseBody = exports.PromoteDeploymentResponseBody = exports.FailDeploymentResponseBody = exports.FailDeploymentRequestBody = exports.DeploymentErrorData = exports.GenerateRegistryCredentialsResponseBody = exports.RemoteBuildProviderStatusResponseBody = exports.InitializeDeploymentRequestBody = exports.InitializeDeploymentResponseBody = exports.UpsertBranchResponseBody = exports.UpsertBranchRequestBody = exports.ExternalBuildData = exports.CancelDeploymentRequestBody = exports.ProgressDeploymentRequestBody = exports.FinalizeDeploymentRequestBody = exports.StartDeploymentIndexingResponseBody = exports.StartDeploymentIndexingRequestBody = exports.GetEnvironmentVariablesResponseBody = exports.RescheduleRunRequestBody = exports.AddTagsRequestBody = exports.GetBatchResponseBody = exports.BatchTriggerTaskResponse = exports.BatchTriggerTaskV3Response = exports.BatchTriggerTaskV3RequestBody = exports.BatchTriggerTaskV2Response = exports.BatchTriggerTaskV2RequestBody = exports.BatchTriggerTaskItem = exports.BatchTriggerTaskRequestBody = exports.TriggerTaskResponse = exports.TriggerTaskRequestBody = exports.RunTags = exports.CreateBackgroundWorkerResponse = exports.CreateBackgroundWorkerRequestBody = exports.GetJWTResponse = exports.GetJWTRequestBody = exports.GetWorkerByTagResponse = exports.GetWorkerTaskResponse = exports.GetProjectEnvResponse = exports.CreateProjectRequestBody = exports.GetOrgsResponseBody = exports.GetProjectsResponseBody = exports.GetProjectResponseBody = exports.WhoAmIResponseSchema = exports.RunEngineVersion = void 0;
4
- exports.WaitForDurationRequestBody = exports.WaitForWaitpointTokenResponseBody = exports.CompleteWaitpointTokenResponseBody = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = exports.waitpointTokenStatuses = 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.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.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = void 0;
5
- exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody = void 0;
3
+ exports.DeploymentLogEvent = exports.GetLatestDeploymentResponseBody = exports.GetDeploymentResponseBody = exports.PromoteDeploymentResponseBody = exports.FailDeploymentResponseBody = exports.FailDeploymentRequestBody = exports.DeploymentErrorData = exports.GenerateRegistryCredentialsResponseBody = exports.RemoteBuildProviderStatusResponseBody = exports.InitializeDeploymentRequestBody = exports.InitializeDeploymentResponseBody = exports.CreateArtifactResponseBody = exports.CreateArtifactRequestBody = exports.UpsertBranchResponseBody = exports.UpsertBranchRequestBody = exports.BuildServerMetadata = exports.DeploymentTriggeredVia = exports.ExternalBuildData = exports.CancelDeploymentRequestBody = exports.ProgressDeploymentRequestBody = exports.FinalizeDeploymentRequestBody = exports.StartDeploymentIndexingResponseBody = exports.StartDeploymentIndexingRequestBody = exports.GetEnvironmentVariablesResponseBody = exports.RescheduleRunRequestBody = exports.AddTagsRequestBody = exports.GetBatchResponseBody = exports.BatchTriggerTaskResponse = exports.BatchTriggerTaskV3Response = exports.BatchTriggerTaskV3RequestBody = exports.BatchTriggerTaskV2Response = exports.BatchTriggerTaskV2RequestBody = exports.BatchTriggerTaskItem = exports.BatchTriggerTaskRequestBody = exports.TriggerTaskResponse = exports.TriggerTaskRequestBody = exports.RunTags = exports.CreateBackgroundWorkerResponse = exports.CreateBackgroundWorkerRequestBody = exports.GetJWTResponse = exports.GetJWTRequestBody = exports.GetWorkerByTagResponse = exports.GetWorkerTaskResponse = exports.GetProjectEnvResponse = exports.CreateProjectRequestBody = exports.GetOrgsResponseBody = exports.GetProjectsResponseBody = exports.GetProjectResponseBody = exports.WhoAmIResponseSchema = exports.RunEngineVersion = void 0;
4
+ exports.waitpointTokenStatuses = 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.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.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.CreateUploadPayloadUrlResponseBody = exports.DeploymentEventFromString = exports.DeploymentEvent = exports.DeploymentFinalizedEvent = void 0;
5
+ exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody = exports.WaitForDurationRequestBody = exports.WaitForWaitpointTokenResponseBody = exports.CompleteWaitpointTokenResponseBody = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = void 0;
6
6
  exports.isWaitpointOutputTimeout = isWaitpointOutputTimeout;
7
7
  exports.timeoutError = timeoutError;
8
8
  const zod_1 = require("zod");
@@ -292,6 +292,30 @@ exports.ExternalBuildData = zod_1.z.object({
292
292
  buildToken: zod_1.z.string(),
293
293
  projectId: zod_1.z.string(),
294
294
  });
295
+ const anyString = zod_1.z.custom((v) => typeof v === "string");
296
+ exports.DeploymentTriggeredVia = zod_1.z
297
+ .enum([
298
+ "cli:manual",
299
+ "cli:ci_other",
300
+ "cli:github_actions",
301
+ "cli:gitlab_ci",
302
+ "cli:circleci",
303
+ "cli:jenkins",
304
+ "cli:azure_pipelines",
305
+ "cli:bitbucket_pipelines",
306
+ "cli:travis_ci",
307
+ "cli:buildkite",
308
+ "git_integration:github",
309
+ "dashboard",
310
+ ])
311
+ .or(anyString);
312
+ exports.BuildServerMetadata = zod_1.z.object({
313
+ buildId: zod_1.z.string().optional(),
314
+ isNativeBuild: zod_1.z.boolean().optional(),
315
+ artifactKey: zod_1.z.string().optional(),
316
+ skipPromotion: zod_1.z.boolean().optional(),
317
+ configFilePath: zod_1.z.string().optional(),
318
+ });
295
319
  exports.UpsertBranchRequestBody = zod_1.z.object({
296
320
  git: common_js_1.GitMeta.optional(),
297
321
  env: zod_1.z.enum(["preview"]),
@@ -300,6 +324,17 @@ exports.UpsertBranchRequestBody = zod_1.z.object({
300
324
  exports.UpsertBranchResponseBody = zod_1.z.object({
301
325
  id: zod_1.z.string(),
302
326
  });
327
+ exports.CreateArtifactRequestBody = zod_1.z.object({
328
+ type: zod_1.z.enum(["deployment_context"]).default("deployment_context"),
329
+ contentType: zod_1.z.string().default("application/gzip"),
330
+ contentLength: zod_1.z.number().optional(),
331
+ });
332
+ exports.CreateArtifactResponseBody = zod_1.z.object({
333
+ artifactKey: zod_1.z.string(),
334
+ uploadUrl: zod_1.z.string(),
335
+ uploadFields: zod_1.z.record(zod_1.z.string()),
336
+ expiresAt: zod_1.z.string().datetime(),
337
+ });
303
338
  exports.InitializeDeploymentResponseBody = zod_1.z.object({
304
339
  id: zod_1.z.string(),
305
340
  contentHash: zod_1.z.string(),
@@ -308,8 +343,18 @@ exports.InitializeDeploymentResponseBody = zod_1.z.object({
308
343
  imageTag: zod_1.z.string(),
309
344
  imagePlatform: zod_1.z.string(),
310
345
  externalBuildData: exports.ExternalBuildData.optional().nullable(),
346
+ eventStream: zod_1.z
347
+ .object({
348
+ s2: zod_1.z.object({
349
+ basin: zod_1.z.string(),
350
+ stream: zod_1.z.string(),
351
+ accessToken: zod_1.z.string(),
352
+ }),
353
+ })
354
+ .optional(),
311
355
  });
312
- exports.InitializeDeploymentRequestBody = zod_1.z.object({
356
+ exports.InitializeDeploymentRequestBody = zod_1.z
357
+ .object({
313
358
  contentHash: zod_1.z.string(),
314
359
  userId: zod_1.z.string().optional(),
315
360
  /** @deprecated This is now determined by the webapp. This is only used to warn users with old CLI versions. */
@@ -318,7 +363,26 @@ exports.InitializeDeploymentRequestBody = zod_1.z.object({
318
363
  type: zod_1.z.enum(["MANAGED", "UNMANAGED", "V1"]).optional(),
319
364
  runtime: zod_1.z.string().optional(),
320
365
  initialStatus: zod_1.z.enum(["PENDING", "BUILDING"]).optional(),
321
- });
366
+ triggeredVia: exports.DeploymentTriggeredVia.optional(),
367
+ buildId: zod_1.z.string().optional(),
368
+ })
369
+ .and(zod_1.z.preprocess((val) => {
370
+ const obj = val;
371
+ if (!obj || !obj.isNativeBuild) {
372
+ return { ...obj, isNativeBuild: false };
373
+ }
374
+ return obj;
375
+ }, zod_1.z.discriminatedUnion("isNativeBuild", [
376
+ zod_1.z.object({
377
+ isNativeBuild: zod_1.z.literal(true),
378
+ skipPromotion: zod_1.z.boolean(),
379
+ artifactKey: zod_1.z.string(),
380
+ configFilePath: zod_1.z.string().optional(),
381
+ }),
382
+ zod_1.z.object({
383
+ isNativeBuild: zod_1.z.literal(false),
384
+ }),
385
+ ])));
322
386
  exports.RemoteBuildProviderStatusResponseBody = zod_1.z.object({
323
387
  status: zod_1.z.enum(["operational", "degraded", "unknown"]),
324
388
  message: zod_1.z.string(),
@@ -381,6 +445,36 @@ exports.GetDeploymentResponseBody = zod_1.z.object({
381
445
  exports.GetLatestDeploymentResponseBody = exports.GetDeploymentResponseBody.omit({
382
446
  worker: true,
383
447
  });
448
+ exports.DeploymentLogEvent = zod_1.z.object({
449
+ type: zod_1.z.literal("log"),
450
+ data: zod_1.z.object({
451
+ level: zod_1.z.enum(["debug", "info", "warn", "error"]).optional().default("info"),
452
+ message: zod_1.z.string(),
453
+ }),
454
+ });
455
+ exports.DeploymentFinalizedEvent = zod_1.z.object({
456
+ type: zod_1.z.literal("finalized"),
457
+ data: zod_1.z.object({
458
+ result: zod_1.z.enum(["succeeded", "failed", "timed_out", "canceled"]).or(anyString),
459
+ message: zod_1.z.string().optional(),
460
+ }),
461
+ });
462
+ exports.DeploymentEvent = zod_1.z.discriminatedUnion("type", [
463
+ exports.DeploymentLogEvent,
464
+ exports.DeploymentFinalizedEvent,
465
+ ]);
466
+ exports.DeploymentEventFromString = zod_1.z
467
+ .string()
468
+ .transform((s, ctx) => {
469
+ try {
470
+ return JSON.parse(s);
471
+ }
472
+ catch {
473
+ ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: "Invalid JSON" });
474
+ return zod_1.z.NEVER;
475
+ }
476
+ })
477
+ .pipe(exports.DeploymentEvent);
384
478
  exports.CreateUploadPayloadUrlResponseBody = zod_1.z.object({
385
479
  presignedUrl: zod_1.z.string(),
386
480
  });