@distilled.cloud/cloudflare 0.7.10 → 0.7.12

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.
@@ -48,7 +48,10 @@ export class InvalidRoute extends Schema.TaggedErrorClass<InvalidRoute>()(
48
48
  "InvalidRoute",
49
49
  { code: Schema.Number, message: Schema.String },
50
50
  ) {}
51
- T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
51
+ T.applyErrorMatchers(InvalidRoute, [
52
+ { code: 7003 },
53
+ { code: 7003, message: { includes: "Could not route" } },
54
+ ]);
52
55
 
53
56
  export class InvalidRoutePattern extends Schema.TaggedErrorClass<InvalidRoutePattern>()(
54
57
  "InvalidRoutePattern",
@@ -62,6 +65,12 @@ export class InvalidWorkerScript extends Schema.TaggedErrorClass<InvalidWorkerSc
62
65
  ) {}
63
66
  T.applyErrorMatchers(InvalidWorkerScript, [{ code: 10068 }]);
64
67
 
68
+ export class QueueConsumerConflict extends Schema.TaggedErrorClass<QueueConsumerConflict>()(
69
+ "QueueConsumerConflict",
70
+ { code: Schema.Number, message: Schema.String },
71
+ ) {}
72
+ T.applyErrorMatchers(QueueConsumerConflict, [{ code: 10064 }]);
73
+
65
74
  export class RouteNotFound extends Schema.TaggedErrorClass<RouteNotFound>()(
66
75
  "RouteNotFound",
67
76
  { code: Schema.Number, message: Schema.String },
@@ -74,6 +83,12 @@ export class SecretNotFound extends Schema.TaggedErrorClass<SecretNotFound>()(
74
83
  ) {}
75
84
  T.applyErrorMatchers(SecretNotFound, [{ code: 10056 }]);
76
85
 
86
+ export class ServiceBindingConflict extends Schema.TaggedErrorClass<ServiceBindingConflict>()(
87
+ "ServiceBindingConflict",
88
+ { code: Schema.Number, message: Schema.String },
89
+ ) {}
90
+ T.applyErrorMatchers(ServiceBindingConflict, [{ code: 10142 }]);
91
+
77
92
  export class VersionNotFound extends Schema.TaggedErrorClass<VersionNotFound>()(
78
93
  "VersionNotFound",
79
94
  { code: Schema.Number, message: Schema.String },
@@ -7846,7 +7861,11 @@ export const DeleteScriptResponse =
7846
7861
  T.ResponsePath("result"),
7847
7862
  ) as unknown as Schema.Schema<DeleteScriptResponse>;
7848
7863
 
7849
- export type DeleteScriptError = DefaultErrors | WorkerNotFound;
7864
+ export type DeleteScriptError =
7865
+ | DefaultErrors
7866
+ | WorkerNotFound
7867
+ | QueueConsumerConflict
7868
+ | ServiceBindingConflict;
7850
7869
 
7851
7870
  export const deleteScript: API.OperationMethod<
7852
7871
  DeleteScriptRequest,
@@ -7856,7 +7875,7 @@ export const deleteScript: API.OperationMethod<
7856
7875
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
7857
7876
  input: DeleteScriptRequest,
7858
7877
  output: DeleteScriptResponse,
7859
- errors: [WorkerNotFound],
7878
+ errors: [WorkerNotFound, QueueConsumerConflict, ServiceBindingConflict],
7860
7879
  }));
7861
7880
 
7862
7881
  export interface SearchScriptRequest {
@@ -8878,165 +8897,919 @@ export const deleteScriptDeployment: API.OperationMethod<
8878
8897
  }));
8879
8898
 
8880
8899
  // =============================================================================
8881
- // ScriptSchedule
8900
+ // ScriptEdgePreview
8882
8901
  // =============================================================================
8883
8902
 
8884
- export interface GetScriptScheduleRequest {
8885
- scriptName: string;
8886
- /** Identifier. */
8903
+ export interface CreateScriptEdgePreviewRequest {
8887
8904
  accountId: string;
8888
- }
8889
-
8890
- export const GetScriptScheduleRequest =
8891
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8892
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
8893
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
8894
- }).pipe(
8895
- T.Http({
8896
- method: "GET",
8897
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
8898
- }),
8899
- ) as unknown as Schema.Schema<GetScriptScheduleRequest>;
8900
-
8901
- export interface GetScriptScheduleResponse {
8902
- schedules: {
8903
- cron: string;
8904
- createdOn?: string | null;
8905
- modifiedOn?: string | null;
8906
- }[];
8907
- }
8908
-
8909
- export const GetScriptScheduleResponse =
8910
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8911
- schedules: Schema.Array(
8912
- Schema.Struct({
8913
- cron: Schema.String,
8914
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8915
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8916
- }).pipe(
8917
- Schema.encodeKeys({
8918
- cron: "cron",
8919
- createdOn: "created_on",
8920
- modifiedOn: "modified_on",
8921
- }),
8922
- ),
8923
- ),
8924
- }).pipe(
8925
- T.ResponsePath("result"),
8926
- ) as unknown as Schema.Schema<GetScriptScheduleResponse>;
8927
-
8928
- export type GetScriptScheduleError = DefaultErrors | WorkerNotFound;
8929
-
8930
- export const getScriptSchedule: API.OperationMethod<
8931
- GetScriptScheduleRequest,
8932
- GetScriptScheduleResponse,
8933
- GetScriptScheduleError,
8934
- Credentials | HttpClient.HttpClient
8935
- > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
8936
- input: GetScriptScheduleRequest,
8937
- output: GetScriptScheduleResponse,
8938
- errors: [WorkerNotFound],
8939
- }));
8940
-
8941
- export interface PutScriptScheduleRequest {
8942
8905
  scriptName: string;
8943
- /** Path param: Identifier. */
8944
- accountId: string;
8945
- /** Body param: */
8946
- body: { cron: string }[];
8906
+ /** The session token returned by createZoneEdgePreviewSession or createSubdomainEdgePreviewSession. */
8907
+ cfPreviewUploadConfigToken: string;
8908
+ metadata?: {
8909
+ mainModule?: string;
8910
+ bodyPart?: string;
8911
+ compatibilityDate?: string;
8912
+ compatibilityFlags?: string[];
8913
+ usageModel?: "bundled" | "unbound" | "standard";
8914
+ bindings?: (
8915
+ | { type: "plain_text"; name: string; text: string }
8916
+ | { type: "secret_text"; name: string; text: string }
8917
+ | { type: "json"; name: string; json: unknown }
8918
+ | {
8919
+ type: "kv_namespace";
8920
+ name: string;
8921
+ namespaceId: string;
8922
+ raw?: boolean;
8923
+ }
8924
+ | {
8925
+ type: "durable_object_namespace";
8926
+ name: string;
8927
+ className: string;
8928
+ scriptName?: string;
8929
+ environment?: string;
8930
+ namespaceId?: string;
8931
+ }
8932
+ | {
8933
+ type: "r2_bucket";
8934
+ name: string;
8935
+ bucketName: string;
8936
+ jurisdiction?: string;
8937
+ raw?: boolean;
8938
+ }
8939
+ | { type: "d1"; name: string; id: string; raw?: boolean }
8940
+ | {
8941
+ type: "queue";
8942
+ name: string;
8943
+ queueName: string;
8944
+ deliveryDelay?: number;
8945
+ raw?: boolean;
8946
+ }
8947
+ | {
8948
+ type: "service";
8949
+ name: string;
8950
+ service: string;
8951
+ environment?: string;
8952
+ entrypoint?: string;
8953
+ }
8954
+ | { type: "ai"; name: string; staging?: boolean; raw?: boolean }
8955
+ | { type: "browser"; name: string; raw?: boolean }
8956
+ | { type: "images"; name: string; raw?: boolean }
8957
+ | { type: "vectorize"; name: string; indexName: string; raw?: boolean }
8958
+ | {
8959
+ type: "workflow";
8960
+ name: string;
8961
+ workflowName: string;
8962
+ className: string;
8963
+ scriptName?: string;
8964
+ raw?: boolean;
8965
+ }
8966
+ | { type: "hyperdrive"; name: string; id: string }
8967
+ | { type: "analytics_engine"; name: string; dataset?: string }
8968
+ | {
8969
+ type: "dispatch_namespace";
8970
+ name: string;
8971
+ namespace: string;
8972
+ outbound?: {
8973
+ worker?: { service?: string; environment?: string };
8974
+ params?: { name: string }[];
8975
+ };
8976
+ }
8977
+ | {
8978
+ type: "send_email";
8979
+ name: string;
8980
+ destinationAddress?: string;
8981
+ allowedDestinationAddresses?: string[];
8982
+ allowedSenderAddresses?: string[];
8983
+ }
8984
+ | { type: "mtls_certificate"; name: string; certificateId: string }
8985
+ | { type: "wasm_module"; name: string; part: string }
8986
+ | { type: "text_blob"; name: string; part: string }
8987
+ | { type: "data_blob"; name: string; part: string }
8988
+ | { type: "pipelines"; name: string; pipeline: string }
8989
+ | {
8990
+ type: "secrets_store_secret";
8991
+ name: string;
8992
+ storeId: string;
8993
+ secretName: string;
8994
+ }
8995
+ | { type: "stream"; name: string }
8996
+ | { type: "media"; name: string }
8997
+ | { type: "version_metadata"; name: string }
8998
+ | { type: "assets"; name: string }
8999
+ | { type: "worker_loader"; name: string }
9000
+ | { type: "logfwdr"; name: string; destination: string }
9001
+ | { type: "ai_search_namespace"; name: string; namespace: string }
9002
+ | { type: "ai_search"; name: string; instanceName: string }
9003
+ | {
9004
+ type: "ratelimit";
9005
+ name: string;
9006
+ namespaceId: string;
9007
+ simple: { limit: number; period: "10" | "60" };
9008
+ }
9009
+ | { type: "inherit"; name: string }
9010
+ )[];
9011
+ keepBindings?: string[];
9012
+ migrations?: {
9013
+ oldTag?: string;
9014
+ newTag?: string;
9015
+ steps?: {
9016
+ newClasses?: string[];
9017
+ newSqliteClasses?: string[];
9018
+ renamedClasses?: { from?: string; to?: string }[];
9019
+ deletedClasses?: string[];
9020
+ }[];
9021
+ };
9022
+ capnpSchema?: string;
9023
+ logpush?: boolean;
9024
+ placement?:
9025
+ | { mode: "smart"; hint?: string }
9026
+ | { region: string }
9027
+ | { host: string }
9028
+ | { hostname: string };
9029
+ tailConsumers?: { service: string; environment?: string }[];
9030
+ streamingTailConsumers?: { service: string; environment?: string }[];
9031
+ limits?: { cpuMs?: number; subrequests?: number };
9032
+ assets?: {
9033
+ jwt?: string;
9034
+ config?: {
9035
+ htmlHandling?:
9036
+ | "auto-trailing-slash"
9037
+ | "force-trailing-slash"
9038
+ | "drop-trailing-slash"
9039
+ | "none";
9040
+ notFoundHandling?: "single-page-application" | "404-page" | "none";
9041
+ runWorkerFirst?: boolean | string[];
9042
+ redirects?: string;
9043
+ headers?: string;
9044
+ };
9045
+ };
9046
+ observability?: {
9047
+ enabled?: boolean;
9048
+ headSamplingRate?: number;
9049
+ logs?: {
9050
+ enabled?: boolean;
9051
+ headSamplingRate?: number;
9052
+ invocationLogs?: boolean;
9053
+ persist?: boolean;
9054
+ destinations?: string[];
9055
+ };
9056
+ traces?: {
9057
+ enabled?: boolean;
9058
+ headSamplingRate?: number;
9059
+ persist?: boolean;
9060
+ destinations?: string[];
9061
+ };
9062
+ };
9063
+ containers?: { className: string }[];
9064
+ annotations?: unknown;
9065
+ keepAssets?: boolean;
9066
+ tags?: string[];
9067
+ };
9068
+ /** Module files comprising the worker script. */
9069
+ files?: (File | Blob)[];
9070
+ wranglerSessionConfig?:
9071
+ | { workersDev: true; minimalMode?: boolean }
9072
+ | { routes: string[]; minimalMode?: boolean };
8947
9073
  }
8948
9074
 
8949
- export const PutScriptScheduleRequest =
9075
+ export const CreateScriptEdgePreviewRequest =
8950
9076
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8951
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
8952
9077
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
8953
- body: Schema.Array(
8954
- Schema.Struct({
8955
- cron: Schema.String,
8956
- }),
8957
- ).pipe(T.HttpBody()),
8958
- }).pipe(
8959
- T.Http({
8960
- method: "PUT",
8961
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
8962
- }),
8963
- ) as unknown as Schema.Schema<PutScriptScheduleRequest>;
8964
-
8965
- export interface PutScriptScheduleResponse {
8966
- schedules: {
8967
- cron: string;
8968
- createdOn?: string | null;
8969
- modifiedOn?: string | null;
8970
- }[];
8971
- }
8972
-
8973
- export const PutScriptScheduleResponse =
8974
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8975
- schedules: Schema.Array(
8976
- Schema.Struct({
8977
- cron: Schema.String,
8978
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8979
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8980
- }).pipe(
8981
- Schema.encodeKeys({
8982
- cron: "cron",
8983
- createdOn: "created_on",
8984
- modifiedOn: "modified_on",
8985
- }),
8986
- ),
9078
+ scriptName: Schema.String.pipe(T.HttpPath("script_name")),
9079
+ cfPreviewUploadConfigToken: Schema.String.pipe(
9080
+ T.HttpHeader("cf-preview-upload-config-token"),
8987
9081
  ),
8988
- }).pipe(
8989
- T.ResponsePath("result"),
8990
- ) as unknown as Schema.Schema<PutScriptScheduleResponse>;
8991
-
8992
- export type PutScriptScheduleError = DefaultErrors | WorkerNotFound;
8993
-
8994
- export const putScriptSchedule: API.OperationMethod<
8995
- PutScriptScheduleRequest,
8996
- PutScriptScheduleResponse,
8997
- PutScriptScheduleError,
8998
- Credentials | HttpClient.HttpClient
8999
- > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
9000
- input: PutScriptScheduleRequest,
9001
- output: PutScriptScheduleResponse,
9002
- errors: [WorkerNotFound],
9003
- }));
9004
-
9005
- // =============================================================================
9006
- // ScriptScriptAndVersionSetting
9007
- // =============================================================================
9008
-
9009
- export interface GetScriptScriptAndVersionSettingRequest {
9010
- scriptName: string;
9011
- /** Identifier. */
9012
- accountId: string;
9013
- }
9014
-
9015
- export const GetScriptScriptAndVersionSettingRequest =
9016
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9017
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
9018
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
9019
- }).pipe(
9020
- T.Http({
9021
- method: "GET",
9022
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
9023
- }),
9024
- ) as unknown as Schema.Schema<GetScriptScriptAndVersionSettingRequest>;
9025
-
9026
- export interface GetScriptScriptAndVersionSettingResponse {
9027
- /** List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. */
9028
- bindings?:
9029
- | (
9030
- | { name: string; type: "ai" }
9031
- | { dataset: string; name: string; type: "analytics_engine" }
9032
- | { name: string; type: "assets" }
9033
- | { name: string; type: "browser" }
9034
- | { id: string; name: string; type: "d1" }
9035
- | { name: string; part: string; type: "data_blob" }
9036
- | {
9037
- name: string;
9038
- namespace: string;
9039
- type: "dispatch_namespace";
9082
+ metadata: Schema.optional(
9083
+ Schema.Struct({
9084
+ mainModule: Schema.optional(Schema.String),
9085
+ bodyPart: Schema.optional(Schema.String),
9086
+ compatibilityDate: Schema.optional(Schema.String),
9087
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
9088
+ usageModel: Schema.optional(
9089
+ Schema.Literals(["bundled", "unbound", "standard"]),
9090
+ ),
9091
+ bindings: Schema.optional(
9092
+ Schema.Array(
9093
+ Schema.Union([
9094
+ Schema.Struct({
9095
+ type: Schema.Literal("plain_text"),
9096
+ name: Schema.String,
9097
+ text: Schema.String,
9098
+ }),
9099
+ Schema.Struct({
9100
+ type: Schema.Literal("secret_text"),
9101
+ name: Schema.String,
9102
+ text: Schema.String,
9103
+ }),
9104
+ Schema.Struct({
9105
+ type: Schema.Literal("json"),
9106
+ name: Schema.String,
9107
+ json: Schema.Unknown,
9108
+ }),
9109
+ Schema.Struct({
9110
+ type: Schema.Literal("kv_namespace"),
9111
+ name: Schema.String,
9112
+ namespaceId: Schema.String,
9113
+ raw: Schema.optional(Schema.Boolean),
9114
+ }).pipe(
9115
+ Schema.encodeKeys({
9116
+ type: "type",
9117
+ name: "name",
9118
+ namespaceId: "namespace_id",
9119
+ raw: "raw",
9120
+ }),
9121
+ ),
9122
+ Schema.Struct({
9123
+ type: Schema.Literal("durable_object_namespace"),
9124
+ name: Schema.String,
9125
+ className: Schema.String,
9126
+ scriptName: Schema.optional(Schema.String),
9127
+ environment: Schema.optional(Schema.String),
9128
+ namespaceId: Schema.optional(Schema.String),
9129
+ }).pipe(
9130
+ Schema.encodeKeys({
9131
+ type: "type",
9132
+ name: "name",
9133
+ className: "class_name",
9134
+ scriptName: "script_name",
9135
+ environment: "environment",
9136
+ namespaceId: "namespace_id",
9137
+ }),
9138
+ ),
9139
+ Schema.Struct({
9140
+ type: Schema.Literal("r2_bucket"),
9141
+ name: Schema.String,
9142
+ bucketName: Schema.String,
9143
+ jurisdiction: Schema.optional(Schema.String),
9144
+ raw: Schema.optional(Schema.Boolean),
9145
+ }).pipe(
9146
+ Schema.encodeKeys({
9147
+ type: "type",
9148
+ name: "name",
9149
+ bucketName: "bucket_name",
9150
+ jurisdiction: "jurisdiction",
9151
+ raw: "raw",
9152
+ }),
9153
+ ),
9154
+ Schema.Struct({
9155
+ type: Schema.Literal("d1"),
9156
+ name: Schema.String,
9157
+ id: Schema.String,
9158
+ raw: Schema.optional(Schema.Boolean),
9159
+ }),
9160
+ Schema.Struct({
9161
+ type: Schema.Literal("queue"),
9162
+ name: Schema.String,
9163
+ queueName: Schema.String,
9164
+ deliveryDelay: Schema.optional(Schema.Number),
9165
+ raw: Schema.optional(Schema.Boolean),
9166
+ }).pipe(
9167
+ Schema.encodeKeys({
9168
+ type: "type",
9169
+ name: "name",
9170
+ queueName: "queue_name",
9171
+ deliveryDelay: "delivery_delay",
9172
+ raw: "raw",
9173
+ }),
9174
+ ),
9175
+ Schema.Struct({
9176
+ type: Schema.Literal("service"),
9177
+ name: Schema.String,
9178
+ service: Schema.String,
9179
+ environment: Schema.optional(Schema.String),
9180
+ entrypoint: Schema.optional(Schema.String),
9181
+ }),
9182
+ Schema.Struct({
9183
+ type: Schema.Literal("ai"),
9184
+ name: Schema.String,
9185
+ staging: Schema.optional(Schema.Boolean),
9186
+ raw: Schema.optional(Schema.Boolean),
9187
+ }),
9188
+ Schema.Struct({
9189
+ type: Schema.Literal("browser"),
9190
+ name: Schema.String,
9191
+ raw: Schema.optional(Schema.Boolean),
9192
+ }),
9193
+ Schema.Struct({
9194
+ type: Schema.Literal("images"),
9195
+ name: Schema.String,
9196
+ raw: Schema.optional(Schema.Boolean),
9197
+ }),
9198
+ Schema.Struct({
9199
+ type: Schema.Literal("vectorize"),
9200
+ name: Schema.String,
9201
+ indexName: Schema.String,
9202
+ raw: Schema.optional(Schema.Boolean),
9203
+ }).pipe(
9204
+ Schema.encodeKeys({
9205
+ type: "type",
9206
+ name: "name",
9207
+ indexName: "index_name",
9208
+ raw: "raw",
9209
+ }),
9210
+ ),
9211
+ Schema.Struct({
9212
+ type: Schema.Literal("workflow"),
9213
+ name: Schema.String,
9214
+ workflowName: Schema.String,
9215
+ className: Schema.String,
9216
+ scriptName: Schema.optional(Schema.String),
9217
+ raw: Schema.optional(Schema.Boolean),
9218
+ }).pipe(
9219
+ Schema.encodeKeys({
9220
+ type: "type",
9221
+ name: "name",
9222
+ workflowName: "workflow_name",
9223
+ className: "class_name",
9224
+ scriptName: "script_name",
9225
+ raw: "raw",
9226
+ }),
9227
+ ),
9228
+ Schema.Struct({
9229
+ type: Schema.Literal("hyperdrive"),
9230
+ name: Schema.String,
9231
+ id: Schema.String,
9232
+ }),
9233
+ Schema.Struct({
9234
+ type: Schema.Literal("analytics_engine"),
9235
+ name: Schema.String,
9236
+ dataset: Schema.optional(Schema.String),
9237
+ }),
9238
+ Schema.Struct({
9239
+ type: Schema.Literal("dispatch_namespace"),
9240
+ name: Schema.String,
9241
+ namespace: Schema.String,
9242
+ outbound: Schema.optional(
9243
+ Schema.Struct({
9244
+ worker: Schema.optional(
9245
+ Schema.Struct({
9246
+ service: Schema.optional(Schema.String),
9247
+ environment: Schema.optional(Schema.String),
9248
+ }),
9249
+ ),
9250
+ params: Schema.optional(
9251
+ Schema.Array(
9252
+ Schema.Struct({
9253
+ name: Schema.String,
9254
+ }),
9255
+ ),
9256
+ ),
9257
+ }),
9258
+ ),
9259
+ }),
9260
+ Schema.Struct({
9261
+ type: Schema.Literal("send_email"),
9262
+ name: Schema.String,
9263
+ destinationAddress: Schema.optional(Schema.String),
9264
+ allowedDestinationAddresses: Schema.optional(
9265
+ Schema.Array(Schema.String),
9266
+ ),
9267
+ allowedSenderAddresses: Schema.optional(
9268
+ Schema.Array(Schema.String),
9269
+ ),
9270
+ }).pipe(
9271
+ Schema.encodeKeys({
9272
+ type: "type",
9273
+ name: "name",
9274
+ destinationAddress: "destination_address",
9275
+ allowedDestinationAddresses: "allowed_destination_addresses",
9276
+ allowedSenderAddresses: "allowed_sender_addresses",
9277
+ }),
9278
+ ),
9279
+ Schema.Struct({
9280
+ type: Schema.Literal("mtls_certificate"),
9281
+ name: Schema.String,
9282
+ certificateId: Schema.String,
9283
+ }).pipe(
9284
+ Schema.encodeKeys({
9285
+ type: "type",
9286
+ name: "name",
9287
+ certificateId: "certificate_id",
9288
+ }),
9289
+ ),
9290
+ Schema.Struct({
9291
+ type: Schema.Literal("wasm_module"),
9292
+ name: Schema.String,
9293
+ part: Schema.String,
9294
+ }),
9295
+ Schema.Struct({
9296
+ type: Schema.Literal("text_blob"),
9297
+ name: Schema.String,
9298
+ part: Schema.String,
9299
+ }),
9300
+ Schema.Struct({
9301
+ type: Schema.Literal("data_blob"),
9302
+ name: Schema.String,
9303
+ part: Schema.String,
9304
+ }),
9305
+ Schema.Struct({
9306
+ type: Schema.Literal("pipelines"),
9307
+ name: Schema.String,
9308
+ pipeline: Schema.String,
9309
+ }),
9310
+ Schema.Struct({
9311
+ type: Schema.Literal("secrets_store_secret"),
9312
+ name: Schema.String,
9313
+ storeId: Schema.String,
9314
+ secretName: Schema.String,
9315
+ }).pipe(
9316
+ Schema.encodeKeys({
9317
+ type: "type",
9318
+ name: "name",
9319
+ storeId: "store_id",
9320
+ secretName: "secret_name",
9321
+ }),
9322
+ ),
9323
+ Schema.Struct({
9324
+ type: Schema.Literal("stream"),
9325
+ name: Schema.String,
9326
+ }),
9327
+ Schema.Struct({
9328
+ type: Schema.Literal("media"),
9329
+ name: Schema.String,
9330
+ }),
9331
+ Schema.Struct({
9332
+ type: Schema.Literal("version_metadata"),
9333
+ name: Schema.String,
9334
+ }),
9335
+ Schema.Struct({
9336
+ type: Schema.Literal("assets"),
9337
+ name: Schema.String,
9338
+ }),
9339
+ Schema.Struct({
9340
+ type: Schema.Literal("worker_loader"),
9341
+ name: Schema.String,
9342
+ }),
9343
+ Schema.Struct({
9344
+ type: Schema.Literal("logfwdr"),
9345
+ name: Schema.String,
9346
+ destination: Schema.String,
9347
+ }),
9348
+ Schema.Struct({
9349
+ type: Schema.Literal("ai_search_namespace"),
9350
+ name: Schema.String,
9351
+ namespace: Schema.String,
9352
+ }),
9353
+ Schema.Struct({
9354
+ type: Schema.Literal("ai_search"),
9355
+ name: Schema.String,
9356
+ instanceName: Schema.String,
9357
+ }).pipe(
9358
+ Schema.encodeKeys({
9359
+ type: "type",
9360
+ name: "name",
9361
+ instanceName: "instance_name",
9362
+ }),
9363
+ ),
9364
+ Schema.Struct({
9365
+ type: Schema.Literal("ratelimit"),
9366
+ name: Schema.String,
9367
+ namespaceId: Schema.String,
9368
+ simple: Schema.Struct({
9369
+ limit: Schema.Number,
9370
+ period: Schema.Literals(["10", "60"]),
9371
+ }),
9372
+ }).pipe(
9373
+ Schema.encodeKeys({
9374
+ type: "type",
9375
+ name: "name",
9376
+ namespaceId: "namespace_id",
9377
+ simple: "simple",
9378
+ }),
9379
+ ),
9380
+ Schema.Struct({
9381
+ type: Schema.Literal("inherit"),
9382
+ name: Schema.String,
9383
+ }),
9384
+ ]),
9385
+ ),
9386
+ ),
9387
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
9388
+ migrations: Schema.optional(
9389
+ Schema.Struct({
9390
+ oldTag: Schema.optional(Schema.String),
9391
+ newTag: Schema.optional(Schema.String),
9392
+ steps: Schema.optional(
9393
+ Schema.Array(
9394
+ Schema.Struct({
9395
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
9396
+ newSqliteClasses: Schema.optional(
9397
+ Schema.Array(Schema.String),
9398
+ ),
9399
+ renamedClasses: Schema.optional(
9400
+ Schema.Array(
9401
+ Schema.Struct({
9402
+ from: Schema.optional(Schema.String),
9403
+ to: Schema.optional(Schema.String),
9404
+ }),
9405
+ ),
9406
+ ),
9407
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
9408
+ }).pipe(
9409
+ Schema.encodeKeys({
9410
+ newClasses: "new_classes",
9411
+ newSqliteClasses: "new_sqlite_classes",
9412
+ renamedClasses: "renamed_classes",
9413
+ deletedClasses: "deleted_classes",
9414
+ }),
9415
+ ),
9416
+ ),
9417
+ ),
9418
+ }).pipe(
9419
+ Schema.encodeKeys({
9420
+ oldTag: "old_tag",
9421
+ newTag: "new_tag",
9422
+ steps: "steps",
9423
+ }),
9424
+ ),
9425
+ ),
9426
+ capnpSchema: Schema.optional(Schema.String),
9427
+ logpush: Schema.optional(Schema.Boolean),
9428
+ placement: Schema.optional(
9429
+ Schema.Union([
9430
+ Schema.Struct({
9431
+ mode: Schema.Literal("smart"),
9432
+ hint: Schema.optional(Schema.String),
9433
+ }),
9434
+ Schema.Struct({
9435
+ region: Schema.String,
9436
+ }),
9437
+ Schema.Struct({
9438
+ host: Schema.String,
9439
+ }),
9440
+ Schema.Struct({
9441
+ hostname: Schema.String,
9442
+ }),
9443
+ ]),
9444
+ ),
9445
+ tailConsumers: Schema.optional(
9446
+ Schema.Array(
9447
+ Schema.Struct({
9448
+ service: Schema.String,
9449
+ environment: Schema.optional(Schema.String),
9450
+ }),
9451
+ ),
9452
+ ),
9453
+ streamingTailConsumers: Schema.optional(
9454
+ Schema.Array(
9455
+ Schema.Struct({
9456
+ service: Schema.String,
9457
+ environment: Schema.optional(Schema.String),
9458
+ }),
9459
+ ),
9460
+ ),
9461
+ limits: Schema.optional(
9462
+ Schema.Struct({
9463
+ cpuMs: Schema.optional(Schema.Number),
9464
+ subrequests: Schema.optional(Schema.Number),
9465
+ }).pipe(
9466
+ Schema.encodeKeys({ cpuMs: "cpu_ms", subrequests: "subrequests" }),
9467
+ ),
9468
+ ),
9469
+ assets: Schema.optional(
9470
+ Schema.Struct({
9471
+ jwt: Schema.optional(Schema.String),
9472
+ config: Schema.optional(
9473
+ Schema.Struct({
9474
+ htmlHandling: Schema.optional(
9475
+ Schema.Literals([
9476
+ "auto-trailing-slash",
9477
+ "force-trailing-slash",
9478
+ "drop-trailing-slash",
9479
+ "none",
9480
+ ]),
9481
+ ),
9482
+ notFoundHandling: Schema.optional(
9483
+ Schema.Literals([
9484
+ "single-page-application",
9485
+ "404-page",
9486
+ "none",
9487
+ ]),
9488
+ ),
9489
+ runWorkerFirst: Schema.optional(
9490
+ Schema.Union([Schema.Boolean, Schema.Array(Schema.String)]),
9491
+ ),
9492
+ redirects: Schema.optional(Schema.String),
9493
+ headers: Schema.optional(Schema.String),
9494
+ }).pipe(
9495
+ Schema.encodeKeys({
9496
+ htmlHandling: "html_handling",
9497
+ notFoundHandling: "not_found_handling",
9498
+ runWorkerFirst: "run_worker_first",
9499
+ redirects: "_redirects",
9500
+ headers: "_headers",
9501
+ }),
9502
+ ),
9503
+ ),
9504
+ }),
9505
+ ),
9506
+ observability: Schema.optional(
9507
+ Schema.Struct({
9508
+ enabled: Schema.optional(Schema.Boolean),
9509
+ headSamplingRate: Schema.optional(Schema.Number),
9510
+ logs: Schema.optional(
9511
+ Schema.Struct({
9512
+ enabled: Schema.optional(Schema.Boolean),
9513
+ headSamplingRate: Schema.optional(Schema.Number),
9514
+ invocationLogs: Schema.optional(Schema.Boolean),
9515
+ persist: Schema.optional(Schema.Boolean),
9516
+ destinations: Schema.optional(Schema.Array(Schema.String)),
9517
+ }).pipe(
9518
+ Schema.encodeKeys({
9519
+ enabled: "enabled",
9520
+ headSamplingRate: "head_sampling_rate",
9521
+ invocationLogs: "invocation_logs",
9522
+ persist: "persist",
9523
+ destinations: "destinations",
9524
+ }),
9525
+ ),
9526
+ ),
9527
+ traces: Schema.optional(
9528
+ Schema.Struct({
9529
+ enabled: Schema.optional(Schema.Boolean),
9530
+ headSamplingRate: Schema.optional(Schema.Number),
9531
+ persist: Schema.optional(Schema.Boolean),
9532
+ destinations: Schema.optional(Schema.Array(Schema.String)),
9533
+ }).pipe(
9534
+ Schema.encodeKeys({
9535
+ enabled: "enabled",
9536
+ headSamplingRate: "head_sampling_rate",
9537
+ persist: "persist",
9538
+ destinations: "destinations",
9539
+ }),
9540
+ ),
9541
+ ),
9542
+ }).pipe(
9543
+ Schema.encodeKeys({
9544
+ enabled: "enabled",
9545
+ headSamplingRate: "head_sampling_rate",
9546
+ logs: "logs",
9547
+ traces: "traces",
9548
+ }),
9549
+ ),
9550
+ ),
9551
+ containers: Schema.optional(
9552
+ Schema.Array(
9553
+ Schema.Struct({
9554
+ className: Schema.String,
9555
+ }).pipe(Schema.encodeKeys({ className: "class_name" })),
9556
+ ),
9557
+ ),
9558
+ annotations: Schema.optional(Schema.Unknown),
9559
+ keepAssets: Schema.optional(Schema.Boolean),
9560
+ tags: Schema.optional(Schema.Array(Schema.String)),
9561
+ }).pipe(
9562
+ Schema.encodeKeys({
9563
+ mainModule: "main_module",
9564
+ bodyPart: "body_part",
9565
+ compatibilityDate: "compatibility_date",
9566
+ compatibilityFlags: "compatibility_flags",
9567
+ usageModel: "usage_model",
9568
+ bindings: "bindings",
9569
+ keepBindings: "keep_bindings",
9570
+ migrations: "migrations",
9571
+ capnpSchema: "capnp_schema",
9572
+ logpush: "logpush",
9573
+ placement: "placement",
9574
+ tailConsumers: "tail_consumers",
9575
+ streamingTailConsumers: "streaming_tail_consumers",
9576
+ limits: "limits",
9577
+ assets: "assets",
9578
+ observability: "observability",
9579
+ containers: "containers",
9580
+ annotations: "annotations",
9581
+ keepAssets: "keep_assets",
9582
+ tags: "tags",
9583
+ }),
9584
+ ),
9585
+ ),
9586
+ files: Schema.optional(
9587
+ Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile())),
9588
+ ),
9589
+ wranglerSessionConfig: Schema.optional(
9590
+ Schema.Union([
9591
+ Schema.Struct({
9592
+ workersDev: Schema.Literal(true),
9593
+ minimalMode: Schema.optional(Schema.Boolean),
9594
+ }).pipe(
9595
+ Schema.encodeKeys({
9596
+ workersDev: "workers_dev",
9597
+ minimalMode: "minimal_mode",
9598
+ }),
9599
+ ),
9600
+ Schema.Struct({
9601
+ routes: Schema.Array(Schema.String),
9602
+ minimalMode: Schema.optional(Schema.Boolean),
9603
+ }).pipe(
9604
+ Schema.encodeKeys({ routes: "routes", minimalMode: "minimal_mode" }),
9605
+ ),
9606
+ ]),
9607
+ ),
9608
+ }).pipe(
9609
+ Schema.encodeKeys({
9610
+ metadata: "metadata",
9611
+ files: "files",
9612
+ wranglerSessionConfig: "wrangler-session-config",
9613
+ }),
9614
+ T.Http({
9615
+ method: "POST",
9616
+ path: "/accounts/{account_id}/workers/scripts/{script_name}/edge-preview",
9617
+ contentType: "multipart",
9618
+ }),
9619
+ ) as unknown as Schema.Schema<CreateScriptEdgePreviewRequest>;
9620
+
9621
+ export interface CreateScriptEdgePreviewResponse {
9622
+ /** Token to send as cf-workers-preview-token header when making requests to the preview host. */
9623
+ previewToken: string;
9624
+ /** URL for tailing live logs from the preview worker. */
9625
+ tailUrl: string;
9626
+ }
9627
+
9628
+ export const CreateScriptEdgePreviewResponse =
9629
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9630
+ previewToken: Schema.String,
9631
+ tailUrl: Schema.String,
9632
+ })
9633
+ .pipe(
9634
+ Schema.encodeKeys({ previewToken: "preview_token", tailUrl: "tail_url" }),
9635
+ )
9636
+ .pipe(
9637
+ T.ResponsePath("result"),
9638
+ ) as unknown as Schema.Schema<CreateScriptEdgePreviewResponse>;
9639
+
9640
+ export type CreateScriptEdgePreviewError = DefaultErrors | InvalidRoute;
9641
+
9642
+ export const createScriptEdgePreview: API.OperationMethod<
9643
+ CreateScriptEdgePreviewRequest,
9644
+ CreateScriptEdgePreviewResponse,
9645
+ CreateScriptEdgePreviewError,
9646
+ Credentials | HttpClient.HttpClient
9647
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
9648
+ input: CreateScriptEdgePreviewRequest,
9649
+ output: CreateScriptEdgePreviewResponse,
9650
+ errors: [InvalidRoute],
9651
+ }));
9652
+
9653
+ // =============================================================================
9654
+ // ScriptSchedule
9655
+ // =============================================================================
9656
+
9657
+ export interface GetScriptScheduleRequest {
9658
+ scriptName: string;
9659
+ /** Identifier. */
9660
+ accountId: string;
9661
+ }
9662
+
9663
+ export const GetScriptScheduleRequest =
9664
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9665
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
9666
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
9667
+ }).pipe(
9668
+ T.Http({
9669
+ method: "GET",
9670
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
9671
+ }),
9672
+ ) as unknown as Schema.Schema<GetScriptScheduleRequest>;
9673
+
9674
+ export interface GetScriptScheduleResponse {
9675
+ schedules: {
9676
+ cron: string;
9677
+ createdOn?: string | null;
9678
+ modifiedOn?: string | null;
9679
+ }[];
9680
+ }
9681
+
9682
+ export const GetScriptScheduleResponse =
9683
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9684
+ schedules: Schema.Array(
9685
+ Schema.Struct({
9686
+ cron: Schema.String,
9687
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
9688
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
9689
+ }).pipe(
9690
+ Schema.encodeKeys({
9691
+ cron: "cron",
9692
+ createdOn: "created_on",
9693
+ modifiedOn: "modified_on",
9694
+ }),
9695
+ ),
9696
+ ),
9697
+ }).pipe(
9698
+ T.ResponsePath("result"),
9699
+ ) as unknown as Schema.Schema<GetScriptScheduleResponse>;
9700
+
9701
+ export type GetScriptScheduleError = DefaultErrors | WorkerNotFound;
9702
+
9703
+ export const getScriptSchedule: API.OperationMethod<
9704
+ GetScriptScheduleRequest,
9705
+ GetScriptScheduleResponse,
9706
+ GetScriptScheduleError,
9707
+ Credentials | HttpClient.HttpClient
9708
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
9709
+ input: GetScriptScheduleRequest,
9710
+ output: GetScriptScheduleResponse,
9711
+ errors: [WorkerNotFound],
9712
+ }));
9713
+
9714
+ export interface PutScriptScheduleRequest {
9715
+ scriptName: string;
9716
+ /** Path param: Identifier. */
9717
+ accountId: string;
9718
+ /** Body param: */
9719
+ body: { cron: string }[];
9720
+ }
9721
+
9722
+ export const PutScriptScheduleRequest =
9723
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9724
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
9725
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
9726
+ body: Schema.Array(
9727
+ Schema.Struct({
9728
+ cron: Schema.String,
9729
+ }),
9730
+ ).pipe(T.HttpBody()),
9731
+ }).pipe(
9732
+ T.Http({
9733
+ method: "PUT",
9734
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
9735
+ }),
9736
+ ) as unknown as Schema.Schema<PutScriptScheduleRequest>;
9737
+
9738
+ export interface PutScriptScheduleResponse {
9739
+ schedules: {
9740
+ cron: string;
9741
+ createdOn?: string | null;
9742
+ modifiedOn?: string | null;
9743
+ }[];
9744
+ }
9745
+
9746
+ export const PutScriptScheduleResponse =
9747
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9748
+ schedules: Schema.Array(
9749
+ Schema.Struct({
9750
+ cron: Schema.String,
9751
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
9752
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
9753
+ }).pipe(
9754
+ Schema.encodeKeys({
9755
+ cron: "cron",
9756
+ createdOn: "created_on",
9757
+ modifiedOn: "modified_on",
9758
+ }),
9759
+ ),
9760
+ ),
9761
+ }).pipe(
9762
+ T.ResponsePath("result"),
9763
+ ) as unknown as Schema.Schema<PutScriptScheduleResponse>;
9764
+
9765
+ export type PutScriptScheduleError = DefaultErrors | WorkerNotFound;
9766
+
9767
+ export const putScriptSchedule: API.OperationMethod<
9768
+ PutScriptScheduleRequest,
9769
+ PutScriptScheduleResponse,
9770
+ PutScriptScheduleError,
9771
+ Credentials | HttpClient.HttpClient
9772
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
9773
+ input: PutScriptScheduleRequest,
9774
+ output: PutScriptScheduleResponse,
9775
+ errors: [WorkerNotFound],
9776
+ }));
9777
+
9778
+ // =============================================================================
9779
+ // ScriptScriptAndVersionSetting
9780
+ // =============================================================================
9781
+
9782
+ export interface GetScriptScriptAndVersionSettingRequest {
9783
+ scriptName: string;
9784
+ /** Identifier. */
9785
+ accountId: string;
9786
+ }
9787
+
9788
+ export const GetScriptScriptAndVersionSettingRequest =
9789
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9790
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
9791
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
9792
+ }).pipe(
9793
+ T.Http({
9794
+ method: "GET",
9795
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
9796
+ }),
9797
+ ) as unknown as Schema.Schema<GetScriptScriptAndVersionSettingRequest>;
9798
+
9799
+ export interface GetScriptScriptAndVersionSettingResponse {
9800
+ /** List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. */
9801
+ bindings?:
9802
+ | (
9803
+ | { name: string; type: "ai" }
9804
+ | { dataset: string; name: string; type: "analytics_engine" }
9805
+ | { name: string; type: "assets" }
9806
+ | { name: string; type: "browser" }
9807
+ | { id: string; name: string; type: "d1" }
9808
+ | { name: string; part: string; type: "data_blob" }
9809
+ | {
9810
+ name: string;
9811
+ namespace: string;
9812
+ type: "dispatch_namespace";
9040
9813
  outbound?: {
9041
9814
  params?: string[] | null;
9042
9815
  worker?: {
@@ -12763,881 +13536,1637 @@ export const CreateScriptVersionRequest =
12763
13536
  }),
12764
13537
  Schema.Struct({
12765
13538
  name: Schema.String,
12766
- type: Schema.Literal("browser"),
12767
- }),
13539
+ type: Schema.Literal("browser"),
13540
+ }),
13541
+ Schema.Struct({
13542
+ id: Schema.String,
13543
+ name: Schema.String,
13544
+ type: Schema.Literal("d1"),
13545
+ }),
13546
+ Schema.Struct({
13547
+ name: Schema.String,
13548
+ part: Schema.String,
13549
+ type: Schema.Literal("data_blob"),
13550
+ }),
13551
+ Schema.Struct({
13552
+ name: Schema.String,
13553
+ namespace: Schema.String,
13554
+ type: Schema.Literal("dispatch_namespace"),
13555
+ outbound: Schema.optional(
13556
+ Schema.Struct({
13557
+ params: Schema.optional(Schema.Array(Schema.String)),
13558
+ worker: Schema.optional(
13559
+ Schema.Struct({
13560
+ environment: Schema.optional(Schema.String),
13561
+ service: Schema.optional(Schema.String),
13562
+ }),
13563
+ ),
13564
+ }),
13565
+ ),
13566
+ }),
13567
+ Schema.Struct({
13568
+ name: Schema.String,
13569
+ type: Schema.Literal("durable_object_namespace"),
13570
+ className: Schema.optional(Schema.String),
13571
+ environment: Schema.optional(Schema.String),
13572
+ namespaceId: Schema.optional(Schema.String),
13573
+ scriptName: Schema.optional(Schema.String),
13574
+ }).pipe(
13575
+ Schema.encodeKeys({
13576
+ name: "name",
13577
+ type: "type",
13578
+ className: "class_name",
13579
+ environment: "environment",
13580
+ namespaceId: "namespace_id",
13581
+ scriptName: "script_name",
13582
+ }),
13583
+ ),
13584
+ Schema.Struct({
13585
+ id: Schema.String,
13586
+ name: Schema.String,
13587
+ type: Schema.Literal("hyperdrive"),
13588
+ }),
13589
+ Schema.Struct({
13590
+ name: Schema.String,
13591
+ type: Schema.Literal("inherit"),
13592
+ oldName: Schema.optional(Schema.String),
13593
+ versionId: Schema.optional(Schema.String),
13594
+ }).pipe(
13595
+ Schema.encodeKeys({
13596
+ name: "name",
13597
+ type: "type",
13598
+ oldName: "old_name",
13599
+ versionId: "version_id",
13600
+ }),
13601
+ ),
13602
+ Schema.Struct({
13603
+ name: Schema.String,
13604
+ type: Schema.Literal("images"),
13605
+ }),
13606
+ Schema.Struct({
13607
+ json: Schema.String,
13608
+ name: Schema.String,
13609
+ type: Schema.Literal("json"),
13610
+ }),
13611
+ Schema.Struct({
13612
+ name: Schema.String,
13613
+ namespaceId: Schema.String,
13614
+ type: Schema.Literal("kv_namespace"),
13615
+ }).pipe(
13616
+ Schema.encodeKeys({
13617
+ name: "name",
13618
+ namespaceId: "namespace_id",
13619
+ type: "type",
13620
+ }),
13621
+ ),
13622
+ Schema.Struct({
13623
+ certificateId: Schema.String,
13624
+ name: Schema.String,
13625
+ type: Schema.Literal("mtls_certificate"),
13626
+ }).pipe(
13627
+ Schema.encodeKeys({
13628
+ certificateId: "certificate_id",
13629
+ name: "name",
13630
+ type: "type",
13631
+ }),
13632
+ ),
13633
+ Schema.Struct({
13634
+ name: Schema.String,
13635
+ text: Schema.String,
13636
+ type: Schema.Literal("plain_text"),
13637
+ }),
13638
+ Schema.Struct({
13639
+ name: Schema.String,
13640
+ pipeline: Schema.String,
13641
+ type: Schema.Literal("pipelines"),
13642
+ }),
13643
+ Schema.Struct({
13644
+ name: Schema.String,
13645
+ queueName: Schema.String,
13646
+ type: Schema.Literal("queue"),
13647
+ }).pipe(
13648
+ Schema.encodeKeys({
13649
+ name: "name",
13650
+ queueName: "queue_name",
13651
+ type: "type",
13652
+ }),
13653
+ ),
13654
+ Schema.Struct({
13655
+ bucketName: Schema.String,
13656
+ name: Schema.String,
13657
+ type: Schema.Literal("r2_bucket"),
13658
+ jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
13659
+ }).pipe(
13660
+ Schema.encodeKeys({
13661
+ bucketName: "bucket_name",
13662
+ name: "name",
13663
+ type: "type",
13664
+ jurisdiction: "jurisdiction",
13665
+ }),
13666
+ ),
13667
+ Schema.Struct({
13668
+ name: Schema.String,
13669
+ text: Schema.String,
13670
+ type: Schema.Literal("secret_text"),
13671
+ }),
13672
+ Schema.Struct({
13673
+ name: Schema.String,
13674
+ type: Schema.Literal("send_email"),
13675
+ allowedDestinationAddresses: Schema.optional(
13676
+ Schema.Array(Schema.String),
13677
+ ),
13678
+ allowedSenderAddresses: Schema.optional(
13679
+ Schema.Array(Schema.String),
13680
+ ),
13681
+ destinationAddress: Schema.optional(Schema.String),
13682
+ }).pipe(
13683
+ Schema.encodeKeys({
13684
+ name: "name",
13685
+ type: "type",
13686
+ allowedDestinationAddresses: "allowed_destination_addresses",
13687
+ allowedSenderAddresses: "allowed_sender_addresses",
13688
+ destinationAddress: "destination_address",
13689
+ }),
13690
+ ),
13691
+ Schema.Struct({
13692
+ name: Schema.String,
13693
+ service: Schema.String,
13694
+ type: Schema.Literal("service"),
13695
+ environment: Schema.optional(Schema.String),
13696
+ }),
13697
+ Schema.Struct({
13698
+ name: Schema.String,
13699
+ part: Schema.String,
13700
+ type: Schema.Literal("text_blob"),
13701
+ }),
13702
+ Schema.Struct({
13703
+ indexName: Schema.String,
13704
+ name: Schema.String,
13705
+ type: Schema.Literal("vectorize"),
13706
+ }).pipe(
13707
+ Schema.encodeKeys({
13708
+ indexName: "index_name",
13709
+ name: "name",
13710
+ type: "type",
13711
+ }),
13712
+ ),
13713
+ Schema.Struct({
13714
+ name: Schema.String,
13715
+ type: Schema.Literal("version_metadata"),
13716
+ }),
13717
+ Schema.Struct({
13718
+ name: Schema.String,
13719
+ secretName: Schema.String,
13720
+ storeId: Schema.String,
13721
+ type: Schema.Literal("secrets_store_secret"),
13722
+ }).pipe(
13723
+ Schema.encodeKeys({
13724
+ name: "name",
13725
+ secretName: "secret_name",
13726
+ storeId: "store_id",
13727
+ type: "type",
13728
+ }),
13729
+ ),
13730
+ Schema.Struct({
13731
+ algorithm: Schema.Unknown,
13732
+ format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
13733
+ name: Schema.String,
13734
+ type: Schema.Literal("secret_key"),
13735
+ usages: Schema.Array(
13736
+ Schema.Literals([
13737
+ "encrypt",
13738
+ "decrypt",
13739
+ "sign",
13740
+ "verify",
13741
+ "deriveKey",
13742
+ "deriveBits",
13743
+ "wrapKey",
13744
+ "unwrapKey",
13745
+ ]),
13746
+ ),
13747
+ keyBase64: Schema.optional(Schema.String),
13748
+ keyJwk: Schema.optional(Schema.Unknown),
13749
+ }).pipe(
13750
+ Schema.encodeKeys({
13751
+ algorithm: "algorithm",
13752
+ format: "format",
13753
+ name: "name",
13754
+ type: "type",
13755
+ usages: "usages",
13756
+ keyBase64: "key_base64",
13757
+ keyJwk: "key_jwk",
13758
+ }),
13759
+ ),
12768
13760
  Schema.Struct({
12769
- id: Schema.String,
12770
13761
  name: Schema.String,
12771
- type: Schema.Literal("d1"),
12772
- }),
13762
+ type: Schema.Literal("workflow"),
13763
+ workflowName: Schema.String,
13764
+ className: Schema.optional(Schema.String),
13765
+ scriptName: Schema.optional(Schema.String),
13766
+ }).pipe(
13767
+ Schema.encodeKeys({
13768
+ name: "name",
13769
+ type: "type",
13770
+ workflowName: "workflow_name",
13771
+ className: "class_name",
13772
+ scriptName: "script_name",
13773
+ }),
13774
+ ),
12773
13775
  Schema.Struct({
12774
13776
  name: Schema.String,
12775
13777
  part: Schema.String,
12776
- type: Schema.Literal("data_blob"),
13778
+ type: Schema.Literal("wasm_module"),
12777
13779
  }),
12778
13780
  Schema.Struct({
12779
13781
  name: Schema.String,
12780
- namespace: Schema.String,
12781
- type: Schema.Literal("dispatch_namespace"),
12782
- outbound: Schema.optional(
12783
- Schema.Struct({
12784
- params: Schema.optional(Schema.Array(Schema.String)),
12785
- worker: Schema.optional(
13782
+ type: Schema.Literal("worker_loader"),
13783
+ }),
13784
+ ]),
13785
+ ),
13786
+ ),
13787
+ compatibilityDate: Schema.optional(Schema.String),
13788
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
13789
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
13790
+ usageModel: Schema.optional(
13791
+ Schema.Literals(["standard", "bundled", "unbound"]),
13792
+ ),
13793
+ }).pipe(
13794
+ Schema.encodeKeys({
13795
+ mainModule: "main_module",
13796
+ annotations: "annotations",
13797
+ bindings: "bindings",
13798
+ compatibilityDate: "compatibility_date",
13799
+ compatibilityFlags: "compatibility_flags",
13800
+ keepBindings: "keep_bindings",
13801
+ usageModel: "usage_model",
13802
+ }),
13803
+ ),
13804
+ files: Schema.optional(
13805
+ Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile())),
13806
+ ),
13807
+ }).pipe(
13808
+ T.Http({
13809
+ method: "POST",
13810
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/versions",
13811
+ contentType: "multipart",
13812
+ }),
13813
+ ) as unknown as Schema.Schema<CreateScriptVersionRequest>;
13814
+
13815
+ export interface CreateScriptVersionResponse {
13816
+ resources: {
13817
+ bindings?:
13818
+ | (
13819
+ | { name: string; type: "ai" }
13820
+ | { dataset: string; name: string; type: "analytics_engine" }
13821
+ | { name: string; type: "assets" }
13822
+ | { name: string; type: "browser" }
13823
+ | { id: string; name: string; type: "d1" }
13824
+ | { name: string; part: string; type: "data_blob" }
13825
+ | {
13826
+ name: string;
13827
+ namespace: string;
13828
+ type: "dispatch_namespace";
13829
+ outbound?: {
13830
+ params?: string[] | null;
13831
+ worker?: {
13832
+ environment?: string | null;
13833
+ service?: string | null;
13834
+ } | null;
13835
+ } | null;
13836
+ }
13837
+ | {
13838
+ name: string;
13839
+ type: "durable_object_namespace";
13840
+ className?: string | null;
13841
+ environment?: string | null;
13842
+ namespaceId?: string | null;
13843
+ scriptName?: string | null;
13844
+ }
13845
+ | { id: string; name: string; type: "hyperdrive" }
13846
+ | {
13847
+ name: string;
13848
+ type: "inherit";
13849
+ oldName?: string | null;
13850
+ versionId?: string | null;
13851
+ }
13852
+ | { name: string; type: "images" }
13853
+ | { json: string; name: string; type: "json" }
13854
+ | { name: string; namespaceId: string; type: "kv_namespace" }
13855
+ | { certificateId: string; name: string; type: "mtls_certificate" }
13856
+ | { name: string; text: string; type: "plain_text" }
13857
+ | { name: string; pipeline: string; type: "pipelines" }
13858
+ | { name: string; queueName: string; type: "queue" }
13859
+ | {
13860
+ bucketName: string;
13861
+ name: string;
13862
+ type: "r2_bucket";
13863
+ jurisdiction?: "eu" | "fedramp" | null;
13864
+ }
13865
+ | { name: string; type: "secret_text" }
13866
+ | {
13867
+ name: string;
13868
+ type: "send_email";
13869
+ allowedDestinationAddresses?: string[] | null;
13870
+ allowedSenderAddresses?: string[] | null;
13871
+ destinationAddress?: string | null;
13872
+ }
13873
+ | {
13874
+ name: string;
13875
+ service: string;
13876
+ type: "service";
13877
+ environment?: string | null;
13878
+ }
13879
+ | { name: string; part: string; type: "text_blob" }
13880
+ | { indexName: string; name: string; type: "vectorize" }
13881
+ | { name: string; type: "version_metadata" }
13882
+ | {
13883
+ name: string;
13884
+ secretName: string;
13885
+ storeId: string;
13886
+ type: "secrets_store_secret";
13887
+ }
13888
+ | {
13889
+ algorithm: unknown;
13890
+ format: "raw" | "pkcs8" | "spki" | "jwk";
13891
+ name: string;
13892
+ type: "secret_key";
13893
+ usages: (
13894
+ | "encrypt"
13895
+ | "decrypt"
13896
+ | "sign"
13897
+ | "verify"
13898
+ | "deriveKey"
13899
+ | "deriveBits"
13900
+ | "wrapKey"
13901
+ | "unwrapKey"
13902
+ )[];
13903
+ }
13904
+ | {
13905
+ name: string;
13906
+ type: "workflow";
13907
+ workflowName: string;
13908
+ className?: string | null;
13909
+ scriptName?: string | null;
13910
+ }
13911
+ | { name: string; part: string; type: "wasm_module" }
13912
+ | { name: string; type: "worker_loader" }
13913
+ )[]
13914
+ | null;
13915
+ script?: {
13916
+ etag?: string | null;
13917
+ handlers?: string[] | null;
13918
+ lastDeployedFrom?: string | null;
13919
+ namedHandlers?:
13920
+ | { handlers?: string[] | null; name?: string | null }[]
13921
+ | null;
13922
+ } | null;
13923
+ scriptRuntime?: {
13924
+ compatibilityDate?: string | null;
13925
+ compatibilityFlags?: string[] | null;
13926
+ limits?: { cpuMs?: number | null } | null;
13927
+ migrationTag?: string | null;
13928
+ usageModel?: "bundled" | "unbound" | "standard" | null;
13929
+ } | null;
13930
+ };
13931
+ /** Unique identifier for the version. */
13932
+ id?: string | null;
13933
+ metadata?: {
13934
+ authorEmail?: string | null;
13935
+ authorId?: string | null;
13936
+ createdOn?: string | null;
13937
+ hasPreview?: boolean | null;
13938
+ modifiedOn?: string | null;
13939
+ source?:
13940
+ | "unknown"
13941
+ | "api"
13942
+ | "wrangler"
13943
+ | "terraform"
13944
+ | "dash"
13945
+ | "dash_template"
13946
+ | "integration"
13947
+ | "quick_editor"
13948
+ | "playground"
13949
+ | "workersci"
13950
+ | null;
13951
+ } | null;
13952
+ /** Sequential version number. */
13953
+ number?: number | null;
13954
+ /** Time in milliseconds spent on [Worker startup](https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time). */
13955
+ startupTimeMs?: number | null;
13956
+ }
13957
+
13958
+ export const CreateScriptVersionResponse =
13959
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
13960
+ resources: Schema.Struct({
13961
+ bindings: Schema.optional(
13962
+ Schema.Union([
13963
+ Schema.Array(
13964
+ Schema.Union([
13965
+ Schema.Struct({
13966
+ name: Schema.String,
13967
+ type: Schema.Literal("ai"),
13968
+ }),
13969
+ Schema.Struct({
13970
+ dataset: Schema.String,
13971
+ name: Schema.String,
13972
+ type: Schema.Literal("analytics_engine"),
13973
+ }),
13974
+ Schema.Struct({
13975
+ name: Schema.String,
13976
+ type: Schema.Literal("assets"),
13977
+ }),
13978
+ Schema.Struct({
13979
+ name: Schema.String,
13980
+ type: Schema.Literal("browser"),
13981
+ }),
13982
+ Schema.Struct({
13983
+ id: Schema.String,
13984
+ name: Schema.String,
13985
+ type: Schema.Literal("d1"),
13986
+ }),
13987
+ Schema.Struct({
13988
+ name: Schema.String,
13989
+ part: Schema.String,
13990
+ type: Schema.Literal("data_blob"),
13991
+ }),
13992
+ Schema.Struct({
13993
+ name: Schema.String,
13994
+ namespace: Schema.String,
13995
+ type: Schema.Literal("dispatch_namespace"),
13996
+ outbound: Schema.optional(
13997
+ Schema.Union([
12786
13998
  Schema.Struct({
12787
- environment: Schema.optional(Schema.String),
12788
- service: Schema.optional(Schema.String),
13999
+ params: Schema.optional(
14000
+ Schema.Union([
14001
+ Schema.Array(Schema.String),
14002
+ Schema.Null,
14003
+ ]),
14004
+ ),
14005
+ worker: Schema.optional(
14006
+ Schema.Union([
14007
+ Schema.Struct({
14008
+ environment: Schema.optional(
14009
+ Schema.Union([Schema.String, Schema.Null]),
14010
+ ),
14011
+ service: Schema.optional(
14012
+ Schema.Union([Schema.String, Schema.Null]),
14013
+ ),
14014
+ }),
14015
+ Schema.Null,
14016
+ ]),
14017
+ ),
12789
14018
  }),
12790
- ),
14019
+ Schema.Null,
14020
+ ]),
14021
+ ),
14022
+ }),
14023
+ Schema.Struct({
14024
+ name: Schema.String,
14025
+ type: Schema.Literal("durable_object_namespace"),
14026
+ className: Schema.optional(
14027
+ Schema.Union([Schema.String, Schema.Null]),
14028
+ ),
14029
+ environment: Schema.optional(
14030
+ Schema.Union([Schema.String, Schema.Null]),
14031
+ ),
14032
+ namespaceId: Schema.optional(
14033
+ Schema.Union([Schema.String, Schema.Null]),
14034
+ ),
14035
+ scriptName: Schema.optional(
14036
+ Schema.Union([Schema.String, Schema.Null]),
14037
+ ),
14038
+ }).pipe(
14039
+ Schema.encodeKeys({
14040
+ name: "name",
14041
+ type: "type",
14042
+ className: "class_name",
14043
+ environment: "environment",
14044
+ namespaceId: "namespace_id",
14045
+ scriptName: "script_name",
12791
14046
  }),
12792
14047
  ),
12793
- }),
12794
- Schema.Struct({
12795
- name: Schema.String,
12796
- type: Schema.Literal("durable_object_namespace"),
12797
- className: Schema.optional(Schema.String),
12798
- environment: Schema.optional(Schema.String),
12799
- namespaceId: Schema.optional(Schema.String),
12800
- scriptName: Schema.optional(Schema.String),
12801
- }).pipe(
12802
- Schema.encodeKeys({
12803
- name: "name",
12804
- type: "type",
12805
- className: "class_name",
12806
- environment: "environment",
12807
- namespaceId: "namespace_id",
12808
- scriptName: "script_name",
14048
+ Schema.Struct({
14049
+ id: Schema.String,
14050
+ name: Schema.String,
14051
+ type: Schema.Literal("hyperdrive"),
12809
14052
  }),
12810
- ),
12811
- Schema.Struct({
12812
- id: Schema.String,
12813
- name: Schema.String,
12814
- type: Schema.Literal("hyperdrive"),
12815
- }),
12816
- Schema.Struct({
12817
- name: Schema.String,
12818
- type: Schema.Literal("inherit"),
12819
- oldName: Schema.optional(Schema.String),
12820
- versionId: Schema.optional(Schema.String),
12821
- }).pipe(
12822
- Schema.encodeKeys({
12823
- name: "name",
12824
- type: "type",
12825
- oldName: "old_name",
12826
- versionId: "version_id",
14053
+ Schema.Struct({
14054
+ name: Schema.String,
14055
+ type: Schema.Literal("inherit"),
14056
+ oldName: Schema.optional(
14057
+ Schema.Union([Schema.String, Schema.Null]),
14058
+ ),
14059
+ versionId: Schema.optional(
14060
+ Schema.Union([Schema.String, Schema.Null]),
14061
+ ),
14062
+ }).pipe(
14063
+ Schema.encodeKeys({
14064
+ name: "name",
14065
+ type: "type",
14066
+ oldName: "old_name",
14067
+ versionId: "version_id",
14068
+ }),
14069
+ ),
14070
+ Schema.Struct({
14071
+ name: Schema.String,
14072
+ type: Schema.Literal("images"),
12827
14073
  }),
12828
- ),
12829
- Schema.Struct({
12830
- name: Schema.String,
12831
- type: Schema.Literal("images"),
12832
- }),
12833
- Schema.Struct({
12834
- json: Schema.String,
12835
- name: Schema.String,
12836
- type: Schema.Literal("json"),
12837
- }),
12838
- Schema.Struct({
12839
- name: Schema.String,
12840
- namespaceId: Schema.String,
12841
- type: Schema.Literal("kv_namespace"),
12842
- }).pipe(
12843
- Schema.encodeKeys({
12844
- name: "name",
12845
- namespaceId: "namespace_id",
12846
- type: "type",
14074
+ Schema.Struct({
14075
+ json: Schema.String,
14076
+ name: Schema.String,
14077
+ type: Schema.Literal("json"),
12847
14078
  }),
12848
- ),
12849
- Schema.Struct({
12850
- certificateId: Schema.String,
12851
- name: Schema.String,
12852
- type: Schema.Literal("mtls_certificate"),
12853
- }).pipe(
12854
- Schema.encodeKeys({
12855
- certificateId: "certificate_id",
12856
- name: "name",
12857
- type: "type",
14079
+ Schema.Struct({
14080
+ name: Schema.String,
14081
+ namespaceId: Schema.String,
14082
+ type: Schema.Literal("kv_namespace"),
14083
+ }).pipe(
14084
+ Schema.encodeKeys({
14085
+ name: "name",
14086
+ namespaceId: "namespace_id",
14087
+ type: "type",
14088
+ }),
14089
+ ),
14090
+ Schema.Struct({
14091
+ certificateId: Schema.String,
14092
+ name: Schema.String,
14093
+ type: Schema.Literal("mtls_certificate"),
14094
+ }).pipe(
14095
+ Schema.encodeKeys({
14096
+ certificateId: "certificate_id",
14097
+ name: "name",
14098
+ type: "type",
14099
+ }),
14100
+ ),
14101
+ Schema.Struct({
14102
+ name: Schema.String,
14103
+ text: Schema.String,
14104
+ type: Schema.Literal("plain_text"),
14105
+ }),
14106
+ Schema.Struct({
14107
+ name: Schema.String,
14108
+ pipeline: Schema.String,
14109
+ type: Schema.Literal("pipelines"),
14110
+ }),
14111
+ Schema.Struct({
14112
+ name: Schema.String,
14113
+ queueName: Schema.String,
14114
+ type: Schema.Literal("queue"),
14115
+ }).pipe(
14116
+ Schema.encodeKeys({
14117
+ name: "name",
14118
+ queueName: "queue_name",
14119
+ type: "type",
14120
+ }),
14121
+ ),
14122
+ Schema.Struct({
14123
+ bucketName: Schema.String,
14124
+ name: Schema.String,
14125
+ type: Schema.Literal("r2_bucket"),
14126
+ jurisdiction: Schema.optional(
14127
+ Schema.Union([
14128
+ Schema.Literals(["eu", "fedramp"]),
14129
+ Schema.Null,
14130
+ ]),
14131
+ ),
14132
+ }).pipe(
14133
+ Schema.encodeKeys({
14134
+ bucketName: "bucket_name",
14135
+ name: "name",
14136
+ type: "type",
14137
+ jurisdiction: "jurisdiction",
14138
+ }),
14139
+ ),
14140
+ Schema.Struct({
14141
+ name: Schema.String,
14142
+ type: Schema.Literal("secret_text"),
14143
+ }),
14144
+ Schema.Struct({
14145
+ name: Schema.String,
14146
+ type: Schema.Literal("send_email"),
14147
+ allowedDestinationAddresses: Schema.optional(
14148
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
14149
+ ),
14150
+ allowedSenderAddresses: Schema.optional(
14151
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
14152
+ ),
14153
+ destinationAddress: Schema.optional(
14154
+ Schema.Union([Schema.String, Schema.Null]),
14155
+ ),
14156
+ }).pipe(
14157
+ Schema.encodeKeys({
14158
+ name: "name",
14159
+ type: "type",
14160
+ allowedDestinationAddresses: "allowed_destination_addresses",
14161
+ allowedSenderAddresses: "allowed_sender_addresses",
14162
+ destinationAddress: "destination_address",
14163
+ }),
14164
+ ),
14165
+ Schema.Struct({
14166
+ name: Schema.String,
14167
+ service: Schema.String,
14168
+ type: Schema.Literal("service"),
14169
+ environment: Schema.optional(
14170
+ Schema.Union([Schema.String, Schema.Null]),
14171
+ ),
12858
14172
  }),
12859
- ),
12860
- Schema.Struct({
12861
- name: Schema.String,
12862
- text: Schema.String,
12863
- type: Schema.Literal("plain_text"),
12864
- }),
12865
- Schema.Struct({
12866
- name: Schema.String,
12867
- pipeline: Schema.String,
12868
- type: Schema.Literal("pipelines"),
12869
- }),
12870
- Schema.Struct({
12871
- name: Schema.String,
12872
- queueName: Schema.String,
12873
- type: Schema.Literal("queue"),
12874
- }).pipe(
12875
- Schema.encodeKeys({
12876
- name: "name",
12877
- queueName: "queue_name",
12878
- type: "type",
14173
+ Schema.Struct({
14174
+ name: Schema.String,
14175
+ part: Schema.String,
14176
+ type: Schema.Literal("text_blob"),
12879
14177
  }),
12880
- ),
12881
- Schema.Struct({
12882
- bucketName: Schema.String,
12883
- name: Schema.String,
12884
- type: Schema.Literal("r2_bucket"),
12885
- jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
12886
- }).pipe(
12887
- Schema.encodeKeys({
12888
- bucketName: "bucket_name",
12889
- name: "name",
12890
- type: "type",
12891
- jurisdiction: "jurisdiction",
14178
+ Schema.Struct({
14179
+ indexName: Schema.String,
14180
+ name: Schema.String,
14181
+ type: Schema.Literal("vectorize"),
14182
+ }).pipe(
14183
+ Schema.encodeKeys({
14184
+ indexName: "index_name",
14185
+ name: "name",
14186
+ type: "type",
14187
+ }),
14188
+ ),
14189
+ Schema.Struct({
14190
+ name: Schema.String,
14191
+ type: Schema.Literal("version_metadata"),
12892
14192
  }),
12893
- ),
12894
- Schema.Struct({
12895
- name: Schema.String,
12896
- text: Schema.String,
12897
- type: Schema.Literal("secret_text"),
12898
- }),
12899
- Schema.Struct({
12900
- name: Schema.String,
12901
- type: Schema.Literal("send_email"),
12902
- allowedDestinationAddresses: Schema.optional(
12903
- Schema.Array(Schema.String),
14193
+ Schema.Struct({
14194
+ name: Schema.String,
14195
+ secretName: Schema.String,
14196
+ storeId: Schema.String,
14197
+ type: Schema.Literal("secrets_store_secret"),
14198
+ }).pipe(
14199
+ Schema.encodeKeys({
14200
+ name: "name",
14201
+ secretName: "secret_name",
14202
+ storeId: "store_id",
14203
+ type: "type",
14204
+ }),
12904
14205
  ),
12905
- allowedSenderAddresses: Schema.optional(
12906
- Schema.Array(Schema.String),
14206
+ Schema.Struct({
14207
+ algorithm: Schema.Unknown,
14208
+ format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
14209
+ name: Schema.String,
14210
+ type: Schema.Literal("secret_key"),
14211
+ usages: Schema.Array(
14212
+ Schema.Literals([
14213
+ "encrypt",
14214
+ "decrypt",
14215
+ "sign",
14216
+ "verify",
14217
+ "deriveKey",
14218
+ "deriveBits",
14219
+ "wrapKey",
14220
+ "unwrapKey",
14221
+ ]),
14222
+ ),
14223
+ }),
14224
+ Schema.Struct({
14225
+ name: Schema.String,
14226
+ type: Schema.Literal("workflow"),
14227
+ workflowName: Schema.String,
14228
+ className: Schema.optional(
14229
+ Schema.Union([Schema.String, Schema.Null]),
14230
+ ),
14231
+ scriptName: Schema.optional(
14232
+ Schema.Union([Schema.String, Schema.Null]),
14233
+ ),
14234
+ }).pipe(
14235
+ Schema.encodeKeys({
14236
+ name: "name",
14237
+ type: "type",
14238
+ workflowName: "workflow_name",
14239
+ className: "class_name",
14240
+ scriptName: "script_name",
14241
+ }),
12907
14242
  ),
12908
- destinationAddress: Schema.optional(Schema.String),
12909
- }).pipe(
12910
- Schema.encodeKeys({
12911
- name: "name",
12912
- type: "type",
12913
- allowedDestinationAddresses: "allowed_destination_addresses",
12914
- allowedSenderAddresses: "allowed_sender_addresses",
12915
- destinationAddress: "destination_address",
14243
+ Schema.Struct({
14244
+ name: Schema.String,
14245
+ part: Schema.String,
14246
+ type: Schema.Literal("wasm_module"),
12916
14247
  }),
12917
- ),
12918
- Schema.Struct({
12919
- name: Schema.String,
12920
- service: Schema.String,
12921
- type: Schema.Literal("service"),
12922
- environment: Schema.optional(Schema.String),
12923
- }),
12924
- Schema.Struct({
12925
- name: Schema.String,
12926
- part: Schema.String,
12927
- type: Schema.Literal("text_blob"),
12928
- }),
12929
- Schema.Struct({
12930
- indexName: Schema.String,
12931
- name: Schema.String,
12932
- type: Schema.Literal("vectorize"),
12933
- }).pipe(
12934
- Schema.encodeKeys({
12935
- indexName: "index_name",
12936
- name: "name",
12937
- type: "type",
14248
+ Schema.Struct({
14249
+ name: Schema.String,
14250
+ type: Schema.Literal("worker_loader"),
12938
14251
  }),
14252
+ ]),
14253
+ ),
14254
+ Schema.Null,
14255
+ ]),
14256
+ ),
14257
+ script: Schema.optional(
14258
+ Schema.Union([
14259
+ Schema.Struct({
14260
+ etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
14261
+ handlers: Schema.optional(
14262
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
12939
14263
  ),
12940
- Schema.Struct({
12941
- name: Schema.String,
12942
- type: Schema.Literal("version_metadata"),
14264
+ lastDeployedFrom: Schema.optional(
14265
+ Schema.Union([Schema.String, Schema.Null]),
14266
+ ),
14267
+ namedHandlers: Schema.optional(
14268
+ Schema.Union([
14269
+ Schema.Array(
14270
+ Schema.Struct({
14271
+ handlers: Schema.optional(
14272
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
14273
+ ),
14274
+ name: Schema.optional(
14275
+ Schema.Union([Schema.String, Schema.Null]),
14276
+ ),
14277
+ }),
14278
+ ),
14279
+ Schema.Null,
14280
+ ]),
14281
+ ),
14282
+ }).pipe(
14283
+ Schema.encodeKeys({
14284
+ etag: "etag",
14285
+ handlers: "handlers",
14286
+ lastDeployedFrom: "last_deployed_from",
14287
+ namedHandlers: "named_handlers",
12943
14288
  }),
12944
- Schema.Struct({
12945
- name: Schema.String,
12946
- secretName: Schema.String,
12947
- storeId: Schema.String,
12948
- type: Schema.Literal("secrets_store_secret"),
12949
- }).pipe(
12950
- Schema.encodeKeys({
12951
- name: "name",
12952
- secretName: "secret_name",
12953
- storeId: "store_id",
12954
- type: "type",
12955
- }),
14289
+ ),
14290
+ Schema.Null,
14291
+ ]),
14292
+ ),
14293
+ scriptRuntime: Schema.optional(
14294
+ Schema.Union([
14295
+ Schema.Struct({
14296
+ compatibilityDate: Schema.optional(
14297
+ Schema.Union([Schema.String, Schema.Null]),
12956
14298
  ),
12957
- Schema.Struct({
12958
- algorithm: Schema.Unknown,
12959
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
12960
- name: Schema.String,
12961
- type: Schema.Literal("secret_key"),
12962
- usages: Schema.Array(
12963
- Schema.Literals([
12964
- "encrypt",
12965
- "decrypt",
12966
- "sign",
12967
- "verify",
12968
- "deriveKey",
12969
- "deriveBits",
12970
- "wrapKey",
12971
- "unwrapKey",
12972
- ]),
12973
- ),
12974
- keyBase64: Schema.optional(Schema.String),
12975
- keyJwk: Schema.optional(Schema.Unknown),
12976
- }).pipe(
12977
- Schema.encodeKeys({
12978
- algorithm: "algorithm",
12979
- format: "format",
12980
- name: "name",
12981
- type: "type",
12982
- usages: "usages",
12983
- keyBase64: "key_base64",
12984
- keyJwk: "key_jwk",
12985
- }),
14299
+ compatibilityFlags: Schema.optional(
14300
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
12986
14301
  ),
12987
- Schema.Struct({
12988
- name: Schema.String,
12989
- type: Schema.Literal("workflow"),
12990
- workflowName: Schema.String,
12991
- className: Schema.optional(Schema.String),
12992
- scriptName: Schema.optional(Schema.String),
12993
- }).pipe(
12994
- Schema.encodeKeys({
12995
- name: "name",
12996
- type: "type",
12997
- workflowName: "workflow_name",
12998
- className: "class_name",
12999
- scriptName: "script_name",
13000
- }),
14302
+ limits: Schema.optional(
14303
+ Schema.Union([
14304
+ Schema.Struct({
14305
+ cpuMs: Schema.optional(
14306
+ Schema.Union([Schema.Number, Schema.Null]),
14307
+ ),
14308
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
14309
+ Schema.Null,
14310
+ ]),
13001
14311
  ),
13002
- Schema.Struct({
13003
- name: Schema.String,
13004
- part: Schema.String,
13005
- type: Schema.Literal("wasm_module"),
13006
- }),
13007
- Schema.Struct({
13008
- name: Schema.String,
13009
- type: Schema.Literal("worker_loader"),
14312
+ migrationTag: Schema.optional(
14313
+ Schema.Union([Schema.String, Schema.Null]),
14314
+ ),
14315
+ usageModel: Schema.optional(
14316
+ Schema.Union([
14317
+ Schema.Literals(["bundled", "unbound", "standard"]),
14318
+ Schema.Null,
14319
+ ]),
14320
+ ),
14321
+ }).pipe(
14322
+ Schema.encodeKeys({
14323
+ compatibilityDate: "compatibility_date",
14324
+ compatibilityFlags: "compatibility_flags",
14325
+ limits: "limits",
14326
+ migrationTag: "migration_tag",
14327
+ usageModel: "usage_model",
13010
14328
  }),
13011
- ]),
13012
- ),
13013
- ),
13014
- compatibilityDate: Schema.optional(Schema.String),
13015
- compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
13016
- keepBindings: Schema.optional(Schema.Array(Schema.String)),
13017
- usageModel: Schema.optional(
13018
- Schema.Literals(["standard", "bundled", "unbound"]),
14329
+ ),
14330
+ Schema.Null,
14331
+ ]),
13019
14332
  ),
13020
14333
  }).pipe(
13021
14334
  Schema.encodeKeys({
13022
- mainModule: "main_module",
13023
- annotations: "annotations",
13024
14335
  bindings: "bindings",
13025
- compatibilityDate: "compatibility_date",
13026
- compatibilityFlags: "compatibility_flags",
13027
- keepBindings: "keep_bindings",
13028
- usageModel: "usage_model",
14336
+ script: "script",
14337
+ scriptRuntime: "script_runtime",
13029
14338
  }),
13030
14339
  ),
13031
- files: Schema.optional(
13032
- Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile())),
14340
+ id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
14341
+ metadata: Schema.optional(
14342
+ Schema.Union([
14343
+ Schema.Struct({
14344
+ authorEmail: Schema.optional(
14345
+ Schema.Union([Schema.String, Schema.Null]),
14346
+ ),
14347
+ authorId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
14348
+ createdOn: Schema.optional(
14349
+ Schema.Union([Schema.String, Schema.Null]),
14350
+ ),
14351
+ hasPreview: Schema.optional(
14352
+ Schema.Union([Schema.Boolean, Schema.Null]),
14353
+ ),
14354
+ modifiedOn: Schema.optional(
14355
+ Schema.Union([Schema.String, Schema.Null]),
14356
+ ),
14357
+ source: Schema.optional(
14358
+ Schema.Union([
14359
+ Schema.Literals([
14360
+ "unknown",
14361
+ "api",
14362
+ "wrangler",
14363
+ "terraform",
14364
+ "dash",
14365
+ "dash_template",
14366
+ "integration",
14367
+ "quick_editor",
14368
+ "playground",
14369
+ "workersci",
14370
+ ]),
14371
+ Schema.Null,
14372
+ ]),
14373
+ ),
14374
+ }).pipe(
14375
+ Schema.encodeKeys({
14376
+ authorEmail: "author_email",
14377
+ authorId: "author_id",
14378
+ createdOn: "created_on",
14379
+ hasPreview: "hasPreview",
14380
+ modifiedOn: "modified_on",
14381
+ source: "source",
14382
+ }),
14383
+ ),
14384
+ Schema.Null,
14385
+ ]),
13033
14386
  ),
13034
- }).pipe(
13035
- T.Http({
13036
- method: "POST",
13037
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/versions",
13038
- contentType: "multipart",
13039
- }),
13040
- ) as unknown as Schema.Schema<CreateScriptVersionRequest>;
14387
+ number: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
14388
+ startupTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
14389
+ })
14390
+ .pipe(
14391
+ Schema.encodeKeys({
14392
+ resources: "resources",
14393
+ id: "id",
14394
+ metadata: "metadata",
14395
+ number: "number",
14396
+ startupTimeMs: "startup_time_ms",
14397
+ }),
14398
+ )
14399
+ .pipe(
14400
+ T.ResponsePath("result"),
14401
+ ) as unknown as Schema.Schema<CreateScriptVersionResponse>;
13041
14402
 
13042
- export interface CreateScriptVersionResponse {
13043
- resources: {
13044
- bindings?:
13045
- | (
13046
- | { name: string; type: "ai" }
13047
- | { dataset: string; name: string; type: "analytics_engine" }
13048
- | { name: string; type: "assets" }
13049
- | { name: string; type: "browser" }
13050
- | { id: string; name: string; type: "d1" }
13051
- | { name: string; part: string; type: "data_blob" }
13052
- | {
13053
- name: string;
13054
- namespace: string;
13055
- type: "dispatch_namespace";
13056
- outbound?: {
13057
- params?: string[] | null;
13058
- worker?: {
13059
- environment?: string | null;
13060
- service?: string | null;
13061
- } | null;
13062
- } | null;
13063
- }
13064
- | {
13065
- name: string;
13066
- type: "durable_object_namespace";
13067
- className?: string | null;
13068
- environment?: string | null;
13069
- namespaceId?: string | null;
13070
- scriptName?: string | null;
13071
- }
13072
- | { id: string; name: string; type: "hyperdrive" }
13073
- | {
13074
- name: string;
13075
- type: "inherit";
13076
- oldName?: string | null;
13077
- versionId?: string | null;
13078
- }
13079
- | { name: string; type: "images" }
13080
- | { json: string; name: string; type: "json" }
13081
- | { name: string; namespaceId: string; type: "kv_namespace" }
13082
- | { certificateId: string; name: string; type: "mtls_certificate" }
13083
- | { name: string; text: string; type: "plain_text" }
13084
- | { name: string; pipeline: string; type: "pipelines" }
13085
- | { name: string; queueName: string; type: "queue" }
13086
- | {
13087
- bucketName: string;
13088
- name: string;
13089
- type: "r2_bucket";
13090
- jurisdiction?: "eu" | "fedramp" | null;
13091
- }
13092
- | { name: string; type: "secret_text" }
13093
- | {
13094
- name: string;
13095
- type: "send_email";
13096
- allowedDestinationAddresses?: string[] | null;
13097
- allowedSenderAddresses?: string[] | null;
13098
- destinationAddress?: string | null;
13099
- }
13100
- | {
13101
- name: string;
13102
- service: string;
13103
- type: "service";
13104
- environment?: string | null;
13105
- }
13106
- | { name: string; part: string; type: "text_blob" }
13107
- | { indexName: string; name: string; type: "vectorize" }
13108
- | { name: string; type: "version_metadata" }
13109
- | {
13110
- name: string;
13111
- secretName: string;
13112
- storeId: string;
13113
- type: "secrets_store_secret";
13114
- }
13115
- | {
13116
- algorithm: unknown;
13117
- format: "raw" | "pkcs8" | "spki" | "jwk";
13118
- name: string;
13119
- type: "secret_key";
13120
- usages: (
13121
- | "encrypt"
13122
- | "decrypt"
13123
- | "sign"
13124
- | "verify"
13125
- | "deriveKey"
13126
- | "deriveBits"
13127
- | "wrapKey"
13128
- | "unwrapKey"
13129
- )[];
13130
- }
13131
- | {
13132
- name: string;
13133
- type: "workflow";
13134
- workflowName: string;
13135
- className?: string | null;
13136
- scriptName?: string | null;
13137
- }
13138
- | { name: string; part: string; type: "wasm_module" }
13139
- | { name: string; type: "worker_loader" }
13140
- )[]
13141
- | null;
13142
- script?: {
13143
- etag?: string | null;
13144
- handlers?: string[] | null;
13145
- lastDeployedFrom?: string | null;
13146
- namedHandlers?:
13147
- | { handlers?: string[] | null; name?: string | null }[]
13148
- | null;
13149
- } | null;
13150
- scriptRuntime?: {
13151
- compatibilityDate?: string | null;
13152
- compatibilityFlags?: string[] | null;
13153
- limits?: { cpuMs?: number | null } | null;
13154
- migrationTag?: string | null;
13155
- usageModel?: "bundled" | "unbound" | "standard" | null;
13156
- } | null;
14403
+ export type CreateScriptVersionError = DefaultErrors | WorkerNotFound;
14404
+
14405
+ export const createScriptVersion: API.OperationMethod<
14406
+ CreateScriptVersionRequest,
14407
+ CreateScriptVersionResponse,
14408
+ CreateScriptVersionError,
14409
+ Credentials | HttpClient.HttpClient
14410
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
14411
+ input: CreateScriptVersionRequest,
14412
+ output: CreateScriptVersionResponse,
14413
+ errors: [WorkerNotFound],
14414
+ }));
14415
+
14416
+ // =============================================================================
14417
+ // ServiceEdgePreview
14418
+ // =============================================================================
14419
+
14420
+ export interface CreateServiceEdgePreviewRequest {
14421
+ accountId: string;
14422
+ serviceName: string;
14423
+ environmentName: string;
14424
+ /** The session token returned by createZoneEdgePreviewSession or createSubdomainEdgePreviewSession. */
14425
+ cfPreviewUploadConfigToken: string;
14426
+ metadata?: {
14427
+ mainModule?: string;
14428
+ bodyPart?: string;
14429
+ compatibilityDate?: string;
14430
+ compatibilityFlags?: string[];
14431
+ usageModel?: "bundled" | "unbound" | "standard";
14432
+ bindings?: (
14433
+ | { type: "plain_text"; name: string; text: string }
14434
+ | { type: "secret_text"; name: string; text: string }
14435
+ | { type: "json"; name: string; json: unknown }
14436
+ | {
14437
+ type: "kv_namespace";
14438
+ name: string;
14439
+ namespaceId: string;
14440
+ raw?: boolean;
14441
+ }
14442
+ | {
14443
+ type: "durable_object_namespace";
14444
+ name: string;
14445
+ className: string;
14446
+ scriptName?: string;
14447
+ environment?: string;
14448
+ namespaceId?: string;
14449
+ }
14450
+ | {
14451
+ type: "r2_bucket";
14452
+ name: string;
14453
+ bucketName: string;
14454
+ jurisdiction?: string;
14455
+ raw?: boolean;
14456
+ }
14457
+ | { type: "d1"; name: string; id: string; raw?: boolean }
14458
+ | {
14459
+ type: "queue";
14460
+ name: string;
14461
+ queueName: string;
14462
+ deliveryDelay?: number;
14463
+ raw?: boolean;
14464
+ }
14465
+ | {
14466
+ type: "service";
14467
+ name: string;
14468
+ service: string;
14469
+ environment?: string;
14470
+ entrypoint?: string;
14471
+ }
14472
+ | { type: "ai"; name: string; staging?: boolean; raw?: boolean }
14473
+ | { type: "browser"; name: string; raw?: boolean }
14474
+ | { type: "images"; name: string; raw?: boolean }
14475
+ | { type: "vectorize"; name: string; indexName: string; raw?: boolean }
14476
+ | {
14477
+ type: "workflow";
14478
+ name: string;
14479
+ workflowName: string;
14480
+ className: string;
14481
+ scriptName?: string;
14482
+ raw?: boolean;
14483
+ }
14484
+ | { type: "hyperdrive"; name: string; id: string }
14485
+ | { type: "analytics_engine"; name: string; dataset?: string }
14486
+ | {
14487
+ type: "dispatch_namespace";
14488
+ name: string;
14489
+ namespace: string;
14490
+ outbound?: {
14491
+ worker?: { service?: string; environment?: string };
14492
+ params?: { name: string }[];
14493
+ };
14494
+ }
14495
+ | {
14496
+ type: "send_email";
14497
+ name: string;
14498
+ destinationAddress?: string;
14499
+ allowedDestinationAddresses?: string[];
14500
+ allowedSenderAddresses?: string[];
14501
+ }
14502
+ | { type: "mtls_certificate"; name: string; certificateId: string }
14503
+ | { type: "wasm_module"; name: string; part: string }
14504
+ | { type: "text_blob"; name: string; part: string }
14505
+ | { type: "data_blob"; name: string; part: string }
14506
+ | { type: "pipelines"; name: string; pipeline: string }
14507
+ | {
14508
+ type: "secrets_store_secret";
14509
+ name: string;
14510
+ storeId: string;
14511
+ secretName: string;
14512
+ }
14513
+ | { type: "stream"; name: string }
14514
+ | { type: "media"; name: string }
14515
+ | { type: "version_metadata"; name: string }
14516
+ | { type: "assets"; name: string }
14517
+ | { type: "worker_loader"; name: string }
14518
+ | { type: "logfwdr"; name: string; destination: string }
14519
+ | { type: "ai_search_namespace"; name: string; namespace: string }
14520
+ | { type: "ai_search"; name: string; instanceName: string }
14521
+ | {
14522
+ type: "ratelimit";
14523
+ name: string;
14524
+ namespaceId: string;
14525
+ simple: { limit: number; period: "10" | "60" };
14526
+ }
14527
+ | { type: "inherit"; name: string }
14528
+ )[];
14529
+ keepBindings?: string[];
14530
+ migrations?: {
14531
+ oldTag?: string;
14532
+ newTag?: string;
14533
+ steps?: {
14534
+ newClasses?: string[];
14535
+ newSqliteClasses?: string[];
14536
+ renamedClasses?: { from?: string; to?: string }[];
14537
+ deletedClasses?: string[];
14538
+ }[];
14539
+ };
14540
+ capnpSchema?: string;
14541
+ logpush?: boolean;
14542
+ placement?:
14543
+ | { mode: "smart"; hint?: string }
14544
+ | { region: string }
14545
+ | { host: string }
14546
+ | { hostname: string };
14547
+ tailConsumers?: { service: string; environment?: string }[];
14548
+ streamingTailConsumers?: { service: string; environment?: string }[];
14549
+ limits?: { cpuMs?: number; subrequests?: number };
14550
+ assets?: {
14551
+ jwt?: string;
14552
+ config?: {
14553
+ htmlHandling?:
14554
+ | "auto-trailing-slash"
14555
+ | "force-trailing-slash"
14556
+ | "drop-trailing-slash"
14557
+ | "none";
14558
+ notFoundHandling?: "single-page-application" | "404-page" | "none";
14559
+ runWorkerFirst?: boolean | string[];
14560
+ redirects?: string;
14561
+ headers?: string;
14562
+ };
14563
+ };
14564
+ observability?: {
14565
+ enabled?: boolean;
14566
+ headSamplingRate?: number;
14567
+ logs?: {
14568
+ enabled?: boolean;
14569
+ headSamplingRate?: number;
14570
+ invocationLogs?: boolean;
14571
+ persist?: boolean;
14572
+ destinations?: string[];
14573
+ };
14574
+ traces?: {
14575
+ enabled?: boolean;
14576
+ headSamplingRate?: number;
14577
+ persist?: boolean;
14578
+ destinations?: string[];
14579
+ };
14580
+ };
14581
+ containers?: { className: string }[];
14582
+ annotations?: unknown;
14583
+ keepAssets?: boolean;
14584
+ tags?: string[];
13157
14585
  };
13158
- /** Unique identifier for the version. */
13159
- id?: string | null;
13160
- metadata?: {
13161
- authorEmail?: string | null;
13162
- authorId?: string | null;
13163
- createdOn?: string | null;
13164
- hasPreview?: boolean | null;
13165
- modifiedOn?: string | null;
13166
- source?:
13167
- | "unknown"
13168
- | "api"
13169
- | "wrangler"
13170
- | "terraform"
13171
- | "dash"
13172
- | "dash_template"
13173
- | "integration"
13174
- | "quick_editor"
13175
- | "playground"
13176
- | "workersci"
13177
- | null;
13178
- } | null;
13179
- /** Sequential version number. */
13180
- number?: number | null;
13181
- /** Time in milliseconds spent on [Worker startup](https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time). */
13182
- startupTimeMs?: number | null;
14586
+ /** Module files comprising the worker script. */
14587
+ files?: (File | Blob)[];
14588
+ wranglerSessionConfig?:
14589
+ | { workersDev: true; minimalMode?: boolean }
14590
+ | { routes: string[]; minimalMode?: boolean };
13183
14591
  }
13184
14592
 
13185
- export const CreateScriptVersionResponse =
14593
+ export const CreateServiceEdgePreviewRequest =
13186
14594
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
13187
- resources: Schema.Struct({
13188
- bindings: Schema.optional(
13189
- Schema.Union([
14595
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
14596
+ serviceName: Schema.String.pipe(T.HttpPath("service_name")),
14597
+ environmentName: Schema.String.pipe(T.HttpPath("environment_name")),
14598
+ cfPreviewUploadConfigToken: Schema.String.pipe(
14599
+ T.HttpHeader("cf-preview-upload-config-token"),
14600
+ ),
14601
+ metadata: Schema.optional(
14602
+ Schema.Struct({
14603
+ mainModule: Schema.optional(Schema.String),
14604
+ bodyPart: Schema.optional(Schema.String),
14605
+ compatibilityDate: Schema.optional(Schema.String),
14606
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
14607
+ usageModel: Schema.optional(
14608
+ Schema.Literals(["bundled", "unbound", "standard"]),
14609
+ ),
14610
+ bindings: Schema.optional(
13190
14611
  Schema.Array(
13191
14612
  Schema.Union([
13192
14613
  Schema.Struct({
14614
+ type: Schema.Literal("plain_text"),
13193
14615
  name: Schema.String,
13194
- type: Schema.Literal("ai"),
13195
- }),
13196
- Schema.Struct({
13197
- dataset: Schema.String,
13198
- name: Schema.String,
13199
- type: Schema.Literal("analytics_engine"),
13200
- }),
13201
- Schema.Struct({
13202
- name: Schema.String,
13203
- type: Schema.Literal("assets"),
13204
- }),
13205
- Schema.Struct({
13206
- name: Schema.String,
13207
- type: Schema.Literal("browser"),
13208
- }),
13209
- Schema.Struct({
13210
- id: Schema.String,
13211
- name: Schema.String,
13212
- type: Schema.Literal("d1"),
14616
+ text: Schema.String,
13213
14617
  }),
13214
14618
  Schema.Struct({
14619
+ type: Schema.Literal("secret_text"),
13215
14620
  name: Schema.String,
13216
- part: Schema.String,
13217
- type: Schema.Literal("data_blob"),
14621
+ text: Schema.String,
13218
14622
  }),
13219
14623
  Schema.Struct({
14624
+ type: Schema.Literal("json"),
13220
14625
  name: Schema.String,
13221
- namespace: Schema.String,
13222
- type: Schema.Literal("dispatch_namespace"),
13223
- outbound: Schema.optional(
13224
- Schema.Union([
13225
- Schema.Struct({
13226
- params: Schema.optional(
13227
- Schema.Union([
13228
- Schema.Array(Schema.String),
13229
- Schema.Null,
13230
- ]),
13231
- ),
13232
- worker: Schema.optional(
13233
- Schema.Union([
13234
- Schema.Struct({
13235
- environment: Schema.optional(
13236
- Schema.Union([Schema.String, Schema.Null]),
13237
- ),
13238
- service: Schema.optional(
13239
- Schema.Union([Schema.String, Schema.Null]),
13240
- ),
13241
- }),
13242
- Schema.Null,
13243
- ]),
13244
- ),
13245
- }),
13246
- Schema.Null,
13247
- ]),
13248
- ),
14626
+ json: Schema.Unknown,
13249
14627
  }),
13250
14628
  Schema.Struct({
14629
+ type: Schema.Literal("kv_namespace"),
13251
14630
  name: Schema.String,
13252
- type: Schema.Literal("durable_object_namespace"),
13253
- className: Schema.optional(
13254
- Schema.Union([Schema.String, Schema.Null]),
13255
- ),
13256
- environment: Schema.optional(
13257
- Schema.Union([Schema.String, Schema.Null]),
13258
- ),
13259
- namespaceId: Schema.optional(
13260
- Schema.Union([Schema.String, Schema.Null]),
13261
- ),
13262
- scriptName: Schema.optional(
13263
- Schema.Union([Schema.String, Schema.Null]),
13264
- ),
14631
+ namespaceId: Schema.String,
14632
+ raw: Schema.optional(Schema.Boolean),
13265
14633
  }).pipe(
13266
14634
  Schema.encodeKeys({
13267
- name: "name",
13268
14635
  type: "type",
13269
- className: "class_name",
13270
- environment: "environment",
14636
+ name: "name",
13271
14637
  namespaceId: "namespace_id",
13272
- scriptName: "script_name",
14638
+ raw: "raw",
13273
14639
  }),
13274
14640
  ),
13275
14641
  Schema.Struct({
13276
- id: Schema.String,
13277
- name: Schema.String,
13278
- type: Schema.Literal("hyperdrive"),
13279
- }),
13280
- Schema.Struct({
14642
+ type: Schema.Literal("durable_object_namespace"),
13281
14643
  name: Schema.String,
13282
- type: Schema.Literal("inherit"),
13283
- oldName: Schema.optional(
13284
- Schema.Union([Schema.String, Schema.Null]),
13285
- ),
13286
- versionId: Schema.optional(
13287
- Schema.Union([Schema.String, Schema.Null]),
13288
- ),
14644
+ className: Schema.String,
14645
+ scriptName: Schema.optional(Schema.String),
14646
+ environment: Schema.optional(Schema.String),
14647
+ namespaceId: Schema.optional(Schema.String),
13289
14648
  }).pipe(
13290
14649
  Schema.encodeKeys({
13291
- name: "name",
13292
14650
  type: "type",
13293
- oldName: "old_name",
13294
- versionId: "version_id",
14651
+ name: "name",
14652
+ className: "class_name",
14653
+ scriptName: "script_name",
14654
+ environment: "environment",
14655
+ namespaceId: "namespace_id",
13295
14656
  }),
13296
14657
  ),
13297
14658
  Schema.Struct({
14659
+ type: Schema.Literal("r2_bucket"),
13298
14660
  name: Schema.String,
13299
- type: Schema.Literal("images"),
13300
- }),
13301
- Schema.Struct({
13302
- json: Schema.String,
13303
- name: Schema.String,
13304
- type: Schema.Literal("json"),
13305
- }),
13306
- Schema.Struct({
13307
- name: Schema.String,
13308
- namespaceId: Schema.String,
13309
- type: Schema.Literal("kv_namespace"),
14661
+ bucketName: Schema.String,
14662
+ jurisdiction: Schema.optional(Schema.String),
14663
+ raw: Schema.optional(Schema.Boolean),
13310
14664
  }).pipe(
13311
14665
  Schema.encodeKeys({
13312
- name: "name",
13313
- namespaceId: "namespace_id",
13314
14666
  type: "type",
14667
+ name: "name",
14668
+ bucketName: "bucket_name",
14669
+ jurisdiction: "jurisdiction",
14670
+ raw: "raw",
13315
14671
  }),
13316
14672
  ),
13317
14673
  Schema.Struct({
13318
- certificateId: Schema.String,
14674
+ type: Schema.Literal("d1"),
13319
14675
  name: Schema.String,
13320
- type: Schema.Literal("mtls_certificate"),
14676
+ id: Schema.String,
14677
+ raw: Schema.optional(Schema.Boolean),
14678
+ }),
14679
+ Schema.Struct({
14680
+ type: Schema.Literal("queue"),
14681
+ name: Schema.String,
14682
+ queueName: Schema.String,
14683
+ deliveryDelay: Schema.optional(Schema.Number),
14684
+ raw: Schema.optional(Schema.Boolean),
13321
14685
  }).pipe(
13322
- Schema.encodeKeys({
13323
- certificateId: "certificate_id",
13324
- name: "name",
14686
+ Schema.encodeKeys({
13325
14687
  type: "type",
14688
+ name: "name",
14689
+ queueName: "queue_name",
14690
+ deliveryDelay: "delivery_delay",
14691
+ raw: "raw",
13326
14692
  }),
13327
14693
  ),
13328
14694
  Schema.Struct({
14695
+ type: Schema.Literal("service"),
13329
14696
  name: Schema.String,
13330
- text: Schema.String,
13331
- type: Schema.Literal("plain_text"),
14697
+ service: Schema.String,
14698
+ environment: Schema.optional(Schema.String),
14699
+ entrypoint: Schema.optional(Schema.String),
13332
14700
  }),
13333
14701
  Schema.Struct({
14702
+ type: Schema.Literal("ai"),
13334
14703
  name: Schema.String,
13335
- pipeline: Schema.String,
13336
- type: Schema.Literal("pipelines"),
14704
+ staging: Schema.optional(Schema.Boolean),
14705
+ raw: Schema.optional(Schema.Boolean),
13337
14706
  }),
13338
14707
  Schema.Struct({
14708
+ type: Schema.Literal("browser"),
13339
14709
  name: Schema.String,
13340
- queueName: Schema.String,
13341
- type: Schema.Literal("queue"),
14710
+ raw: Schema.optional(Schema.Boolean),
14711
+ }),
14712
+ Schema.Struct({
14713
+ type: Schema.Literal("images"),
14714
+ name: Schema.String,
14715
+ raw: Schema.optional(Schema.Boolean),
14716
+ }),
14717
+ Schema.Struct({
14718
+ type: Schema.Literal("vectorize"),
14719
+ name: Schema.String,
14720
+ indexName: Schema.String,
14721
+ raw: Schema.optional(Schema.Boolean),
13342
14722
  }).pipe(
13343
14723
  Schema.encodeKeys({
13344
- name: "name",
13345
- queueName: "queue_name",
13346
14724
  type: "type",
14725
+ name: "name",
14726
+ indexName: "index_name",
14727
+ raw: "raw",
13347
14728
  }),
13348
14729
  ),
13349
14730
  Schema.Struct({
13350
- bucketName: Schema.String,
14731
+ type: Schema.Literal("workflow"),
13351
14732
  name: Schema.String,
13352
- type: Schema.Literal("r2_bucket"),
13353
- jurisdiction: Schema.optional(
13354
- Schema.Union([
13355
- Schema.Literals(["eu", "fedramp"]),
13356
- Schema.Null,
13357
- ]),
13358
- ),
14733
+ workflowName: Schema.String,
14734
+ className: Schema.String,
14735
+ scriptName: Schema.optional(Schema.String),
14736
+ raw: Schema.optional(Schema.Boolean),
13359
14737
  }).pipe(
13360
14738
  Schema.encodeKeys({
13361
- bucketName: "bucket_name",
13362
- name: "name",
13363
14739
  type: "type",
13364
- jurisdiction: "jurisdiction",
14740
+ name: "name",
14741
+ workflowName: "workflow_name",
14742
+ className: "class_name",
14743
+ scriptName: "script_name",
14744
+ raw: "raw",
13365
14745
  }),
13366
14746
  ),
13367
14747
  Schema.Struct({
14748
+ type: Schema.Literal("hyperdrive"),
13368
14749
  name: Schema.String,
13369
- type: Schema.Literal("secret_text"),
14750
+ id: Schema.String,
13370
14751
  }),
13371
14752
  Schema.Struct({
14753
+ type: Schema.Literal("analytics_engine"),
14754
+ name: Schema.String,
14755
+ dataset: Schema.optional(Schema.String),
14756
+ }),
14757
+ Schema.Struct({
14758
+ type: Schema.Literal("dispatch_namespace"),
13372
14759
  name: Schema.String,
14760
+ namespace: Schema.String,
14761
+ outbound: Schema.optional(
14762
+ Schema.Struct({
14763
+ worker: Schema.optional(
14764
+ Schema.Struct({
14765
+ service: Schema.optional(Schema.String),
14766
+ environment: Schema.optional(Schema.String),
14767
+ }),
14768
+ ),
14769
+ params: Schema.optional(
14770
+ Schema.Array(
14771
+ Schema.Struct({
14772
+ name: Schema.String,
14773
+ }),
14774
+ ),
14775
+ ),
14776
+ }),
14777
+ ),
14778
+ }),
14779
+ Schema.Struct({
13373
14780
  type: Schema.Literal("send_email"),
14781
+ name: Schema.String,
14782
+ destinationAddress: Schema.optional(Schema.String),
13374
14783
  allowedDestinationAddresses: Schema.optional(
13375
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
14784
+ Schema.Array(Schema.String),
13376
14785
  ),
13377
14786
  allowedSenderAddresses: Schema.optional(
13378
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13379
- ),
13380
- destinationAddress: Schema.optional(
13381
- Schema.Union([Schema.String, Schema.Null]),
14787
+ Schema.Array(Schema.String),
13382
14788
  ),
13383
14789
  }).pipe(
13384
14790
  Schema.encodeKeys({
13385
- name: "name",
13386
14791
  type: "type",
14792
+ name: "name",
14793
+ destinationAddress: "destination_address",
13387
14794
  allowedDestinationAddresses: "allowed_destination_addresses",
13388
14795
  allowedSenderAddresses: "allowed_sender_addresses",
13389
- destinationAddress: "destination_address",
13390
14796
  }),
13391
14797
  ),
13392
14798
  Schema.Struct({
14799
+ type: Schema.Literal("mtls_certificate"),
13393
14800
  name: Schema.String,
13394
- service: Schema.String,
13395
- type: Schema.Literal("service"),
13396
- environment: Schema.optional(
13397
- Schema.Union([Schema.String, Schema.Null]),
13398
- ),
13399
- }),
14801
+ certificateId: Schema.String,
14802
+ }).pipe(
14803
+ Schema.encodeKeys({
14804
+ type: "type",
14805
+ name: "name",
14806
+ certificateId: "certificate_id",
14807
+ }),
14808
+ ),
13400
14809
  Schema.Struct({
14810
+ type: Schema.Literal("wasm_module"),
13401
14811
  name: Schema.String,
13402
14812
  part: Schema.String,
14813
+ }),
14814
+ Schema.Struct({
13403
14815
  type: Schema.Literal("text_blob"),
14816
+ name: Schema.String,
14817
+ part: Schema.String,
13404
14818
  }),
13405
14819
  Schema.Struct({
13406
- indexName: Schema.String,
14820
+ type: Schema.Literal("data_blob"),
13407
14821
  name: Schema.String,
13408
- type: Schema.Literal("vectorize"),
13409
- }).pipe(
13410
- Schema.encodeKeys({
13411
- indexName: "index_name",
13412
- name: "name",
13413
- type: "type",
13414
- }),
13415
- ),
14822
+ part: Schema.String,
14823
+ }),
13416
14824
  Schema.Struct({
14825
+ type: Schema.Literal("pipelines"),
13417
14826
  name: Schema.String,
13418
- type: Schema.Literal("version_metadata"),
14827
+ pipeline: Schema.String,
13419
14828
  }),
13420
14829
  Schema.Struct({
14830
+ type: Schema.Literal("secrets_store_secret"),
13421
14831
  name: Schema.String,
13422
- secretName: Schema.String,
13423
14832
  storeId: Schema.String,
13424
- type: Schema.Literal("secrets_store_secret"),
14833
+ secretName: Schema.String,
13425
14834
  }).pipe(
13426
14835
  Schema.encodeKeys({
14836
+ type: "type",
13427
14837
  name: "name",
13428
- secretName: "secret_name",
13429
14838
  storeId: "store_id",
13430
- type: "type",
14839
+ secretName: "secret_name",
13431
14840
  }),
13432
14841
  ),
13433
14842
  Schema.Struct({
13434
- algorithm: Schema.Unknown,
13435
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
14843
+ type: Schema.Literal("stream"),
13436
14844
  name: Schema.String,
13437
- type: Schema.Literal("secret_key"),
13438
- usages: Schema.Array(
13439
- Schema.Literals([
13440
- "encrypt",
13441
- "decrypt",
13442
- "sign",
13443
- "verify",
13444
- "deriveKey",
13445
- "deriveBits",
13446
- "wrapKey",
13447
- "unwrapKey",
13448
- ]),
13449
- ),
13450
14845
  }),
13451
14846
  Schema.Struct({
14847
+ type: Schema.Literal("media"),
13452
14848
  name: Schema.String,
13453
- type: Schema.Literal("workflow"),
13454
- workflowName: Schema.String,
13455
- className: Schema.optional(
13456
- Schema.Union([Schema.String, Schema.Null]),
13457
- ),
13458
- scriptName: Schema.optional(
13459
- Schema.Union([Schema.String, Schema.Null]),
13460
- ),
14849
+ }),
14850
+ Schema.Struct({
14851
+ type: Schema.Literal("version_metadata"),
14852
+ name: Schema.String,
14853
+ }),
14854
+ Schema.Struct({
14855
+ type: Schema.Literal("assets"),
14856
+ name: Schema.String,
14857
+ }),
14858
+ Schema.Struct({
14859
+ type: Schema.Literal("worker_loader"),
14860
+ name: Schema.String,
14861
+ }),
14862
+ Schema.Struct({
14863
+ type: Schema.Literal("logfwdr"),
14864
+ name: Schema.String,
14865
+ destination: Schema.String,
14866
+ }),
14867
+ Schema.Struct({
14868
+ type: Schema.Literal("ai_search_namespace"),
14869
+ name: Schema.String,
14870
+ namespace: Schema.String,
14871
+ }),
14872
+ Schema.Struct({
14873
+ type: Schema.Literal("ai_search"),
14874
+ name: Schema.String,
14875
+ instanceName: Schema.String,
13461
14876
  }).pipe(
13462
14877
  Schema.encodeKeys({
13463
- name: "name",
13464
14878
  type: "type",
13465
- workflowName: "workflow_name",
13466
- className: "class_name",
13467
- scriptName: "script_name",
14879
+ name: "name",
14880
+ instanceName: "instance_name",
13468
14881
  }),
13469
14882
  ),
13470
14883
  Schema.Struct({
14884
+ type: Schema.Literal("ratelimit"),
13471
14885
  name: Schema.String,
13472
- part: Schema.String,
13473
- type: Schema.Literal("wasm_module"),
13474
- }),
14886
+ namespaceId: Schema.String,
14887
+ simple: Schema.Struct({
14888
+ limit: Schema.Number,
14889
+ period: Schema.Literals(["10", "60"]),
14890
+ }),
14891
+ }).pipe(
14892
+ Schema.encodeKeys({
14893
+ type: "type",
14894
+ name: "name",
14895
+ namespaceId: "namespace_id",
14896
+ simple: "simple",
14897
+ }),
14898
+ ),
13475
14899
  Schema.Struct({
14900
+ type: Schema.Literal("inherit"),
13476
14901
  name: Schema.String,
13477
- type: Schema.Literal("worker_loader"),
13478
14902
  }),
13479
14903
  ]),
13480
14904
  ),
13481
- Schema.Null,
13482
- ]),
13483
- ),
13484
- script: Schema.optional(
13485
- Schema.Union([
14905
+ ),
14906
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
14907
+ migrations: Schema.optional(
13486
14908
  Schema.Struct({
13487
- etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13488
- handlers: Schema.optional(
13489
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13490
- ),
13491
- lastDeployedFrom: Schema.optional(
13492
- Schema.Union([Schema.String, Schema.Null]),
13493
- ),
13494
- namedHandlers: Schema.optional(
13495
- Schema.Union([
13496
- Schema.Array(
13497
- Schema.Struct({
13498
- handlers: Schema.optional(
13499
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13500
- ),
13501
- name: Schema.optional(
13502
- Schema.Union([Schema.String, Schema.Null]),
14909
+ oldTag: Schema.optional(Schema.String),
14910
+ newTag: Schema.optional(Schema.String),
14911
+ steps: Schema.optional(
14912
+ Schema.Array(
14913
+ Schema.Struct({
14914
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
14915
+ newSqliteClasses: Schema.optional(
14916
+ Schema.Array(Schema.String),
14917
+ ),
14918
+ renamedClasses: Schema.optional(
14919
+ Schema.Array(
14920
+ Schema.Struct({
14921
+ from: Schema.optional(Schema.String),
14922
+ to: Schema.optional(Schema.String),
14923
+ }),
13503
14924
  ),
14925
+ ),
14926
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
14927
+ }).pipe(
14928
+ Schema.encodeKeys({
14929
+ newClasses: "new_classes",
14930
+ newSqliteClasses: "new_sqlite_classes",
14931
+ renamedClasses: "renamed_classes",
14932
+ deletedClasses: "deleted_classes",
13504
14933
  }),
13505
14934
  ),
13506
- Schema.Null,
13507
- ]),
14935
+ ),
13508
14936
  ),
13509
14937
  }).pipe(
13510
14938
  Schema.encodeKeys({
13511
- etag: "etag",
13512
- handlers: "handlers",
13513
- lastDeployedFrom: "last_deployed_from",
13514
- namedHandlers: "named_handlers",
14939
+ oldTag: "old_tag",
14940
+ newTag: "new_tag",
14941
+ steps: "steps",
14942
+ }),
14943
+ ),
14944
+ ),
14945
+ capnpSchema: Schema.optional(Schema.String),
14946
+ logpush: Schema.optional(Schema.Boolean),
14947
+ placement: Schema.optional(
14948
+ Schema.Union([
14949
+ Schema.Struct({
14950
+ mode: Schema.Literal("smart"),
14951
+ hint: Schema.optional(Schema.String),
14952
+ }),
14953
+ Schema.Struct({
14954
+ region: Schema.String,
14955
+ }),
14956
+ Schema.Struct({
14957
+ host: Schema.String,
14958
+ }),
14959
+ Schema.Struct({
14960
+ hostname: Schema.String,
14961
+ }),
14962
+ ]),
14963
+ ),
14964
+ tailConsumers: Schema.optional(
14965
+ Schema.Array(
14966
+ Schema.Struct({
14967
+ service: Schema.String,
14968
+ environment: Schema.optional(Schema.String),
13515
14969
  }),
13516
14970
  ),
13517
- Schema.Null,
13518
- ]),
13519
- ),
13520
- scriptRuntime: Schema.optional(
13521
- Schema.Union([
14971
+ ),
14972
+ streamingTailConsumers: Schema.optional(
14973
+ Schema.Array(
14974
+ Schema.Struct({
14975
+ service: Schema.String,
14976
+ environment: Schema.optional(Schema.String),
14977
+ }),
14978
+ ),
14979
+ ),
14980
+ limits: Schema.optional(
13522
14981
  Schema.Struct({
13523
- compatibilityDate: Schema.optional(
13524
- Schema.Union([Schema.String, Schema.Null]),
13525
- ),
13526
- compatibilityFlags: Schema.optional(
13527
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13528
- ),
13529
- limits: Schema.optional(
13530
- Schema.Union([
13531
- Schema.Struct({
13532
- cpuMs: Schema.optional(
13533
- Schema.Union([Schema.Number, Schema.Null]),
13534
- ),
13535
- }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
13536
- Schema.Null,
13537
- ]),
14982
+ cpuMs: Schema.optional(Schema.Number),
14983
+ subrequests: Schema.optional(Schema.Number),
14984
+ }).pipe(
14985
+ Schema.encodeKeys({ cpuMs: "cpu_ms", subrequests: "subrequests" }),
14986
+ ),
14987
+ ),
14988
+ assets: Schema.optional(
14989
+ Schema.Struct({
14990
+ jwt: Schema.optional(Schema.String),
14991
+ config: Schema.optional(
14992
+ Schema.Struct({
14993
+ htmlHandling: Schema.optional(
14994
+ Schema.Literals([
14995
+ "auto-trailing-slash",
14996
+ "force-trailing-slash",
14997
+ "drop-trailing-slash",
14998
+ "none",
14999
+ ]),
15000
+ ),
15001
+ notFoundHandling: Schema.optional(
15002
+ Schema.Literals([
15003
+ "single-page-application",
15004
+ "404-page",
15005
+ "none",
15006
+ ]),
15007
+ ),
15008
+ runWorkerFirst: Schema.optional(
15009
+ Schema.Union([Schema.Boolean, Schema.Array(Schema.String)]),
15010
+ ),
15011
+ redirects: Schema.optional(Schema.String),
15012
+ headers: Schema.optional(Schema.String),
15013
+ }).pipe(
15014
+ Schema.encodeKeys({
15015
+ htmlHandling: "html_handling",
15016
+ notFoundHandling: "not_found_handling",
15017
+ runWorkerFirst: "run_worker_first",
15018
+ redirects: "_redirects",
15019
+ headers: "_headers",
15020
+ }),
15021
+ ),
13538
15022
  ),
13539
- migrationTag: Schema.optional(
13540
- Schema.Union([Schema.String, Schema.Null]),
15023
+ }),
15024
+ ),
15025
+ observability: Schema.optional(
15026
+ Schema.Struct({
15027
+ enabled: Schema.optional(Schema.Boolean),
15028
+ headSamplingRate: Schema.optional(Schema.Number),
15029
+ logs: Schema.optional(
15030
+ Schema.Struct({
15031
+ enabled: Schema.optional(Schema.Boolean),
15032
+ headSamplingRate: Schema.optional(Schema.Number),
15033
+ invocationLogs: Schema.optional(Schema.Boolean),
15034
+ persist: Schema.optional(Schema.Boolean),
15035
+ destinations: Schema.optional(Schema.Array(Schema.String)),
15036
+ }).pipe(
15037
+ Schema.encodeKeys({
15038
+ enabled: "enabled",
15039
+ headSamplingRate: "head_sampling_rate",
15040
+ invocationLogs: "invocation_logs",
15041
+ persist: "persist",
15042
+ destinations: "destinations",
15043
+ }),
15044
+ ),
13541
15045
  ),
13542
- usageModel: Schema.optional(
13543
- Schema.Union([
13544
- Schema.Literals(["bundled", "unbound", "standard"]),
13545
- Schema.Null,
13546
- ]),
15046
+ traces: Schema.optional(
15047
+ Schema.Struct({
15048
+ enabled: Schema.optional(Schema.Boolean),
15049
+ headSamplingRate: Schema.optional(Schema.Number),
15050
+ persist: Schema.optional(Schema.Boolean),
15051
+ destinations: Schema.optional(Schema.Array(Schema.String)),
15052
+ }).pipe(
15053
+ Schema.encodeKeys({
15054
+ enabled: "enabled",
15055
+ headSamplingRate: "head_sampling_rate",
15056
+ persist: "persist",
15057
+ destinations: "destinations",
15058
+ }),
15059
+ ),
13547
15060
  ),
13548
15061
  }).pipe(
13549
15062
  Schema.encodeKeys({
13550
- compatibilityDate: "compatibility_date",
13551
- compatibilityFlags: "compatibility_flags",
13552
- limits: "limits",
13553
- migrationTag: "migration_tag",
13554
- usageModel: "usage_model",
15063
+ enabled: "enabled",
15064
+ headSamplingRate: "head_sampling_rate",
15065
+ logs: "logs",
15066
+ traces: "traces",
13555
15067
  }),
13556
15068
  ),
13557
- Schema.Null,
13558
- ]),
15069
+ ),
15070
+ containers: Schema.optional(
15071
+ Schema.Array(
15072
+ Schema.Struct({
15073
+ className: Schema.String,
15074
+ }).pipe(Schema.encodeKeys({ className: "class_name" })),
15075
+ ),
15076
+ ),
15077
+ annotations: Schema.optional(Schema.Unknown),
15078
+ keepAssets: Schema.optional(Schema.Boolean),
15079
+ tags: Schema.optional(Schema.Array(Schema.String)),
15080
+ }).pipe(
15081
+ Schema.encodeKeys({
15082
+ mainModule: "main_module",
15083
+ bodyPart: "body_part",
15084
+ compatibilityDate: "compatibility_date",
15085
+ compatibilityFlags: "compatibility_flags",
15086
+ usageModel: "usage_model",
15087
+ bindings: "bindings",
15088
+ keepBindings: "keep_bindings",
15089
+ migrations: "migrations",
15090
+ capnpSchema: "capnp_schema",
15091
+ logpush: "logpush",
15092
+ placement: "placement",
15093
+ tailConsumers: "tail_consumers",
15094
+ streamingTailConsumers: "streaming_tail_consumers",
15095
+ limits: "limits",
15096
+ assets: "assets",
15097
+ observability: "observability",
15098
+ containers: "containers",
15099
+ annotations: "annotations",
15100
+ keepAssets: "keep_assets",
15101
+ tags: "tags",
15102
+ }),
13559
15103
  ),
13560
- }).pipe(
13561
- Schema.encodeKeys({
13562
- bindings: "bindings",
13563
- script: "script",
13564
- scriptRuntime: "script_runtime",
13565
- }),
13566
15104
  ),
13567
- id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13568
- metadata: Schema.optional(
15105
+ files: Schema.optional(
15106
+ Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile())),
15107
+ ),
15108
+ wranglerSessionConfig: Schema.optional(
13569
15109
  Schema.Union([
13570
15110
  Schema.Struct({
13571
- authorEmail: Schema.optional(
13572
- Schema.Union([Schema.String, Schema.Null]),
13573
- ),
13574
- authorId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13575
- createdOn: Schema.optional(
13576
- Schema.Union([Schema.String, Schema.Null]),
13577
- ),
13578
- hasPreview: Schema.optional(
13579
- Schema.Union([Schema.Boolean, Schema.Null]),
13580
- ),
13581
- modifiedOn: Schema.optional(
13582
- Schema.Union([Schema.String, Schema.Null]),
13583
- ),
13584
- source: Schema.optional(
13585
- Schema.Union([
13586
- Schema.Literals([
13587
- "unknown",
13588
- "api",
13589
- "wrangler",
13590
- "terraform",
13591
- "dash",
13592
- "dash_template",
13593
- "integration",
13594
- "quick_editor",
13595
- "playground",
13596
- "workersci",
13597
- ]),
13598
- Schema.Null,
13599
- ]),
13600
- ),
15111
+ workersDev: Schema.Literal(true),
15112
+ minimalMode: Schema.optional(Schema.Boolean),
13601
15113
  }).pipe(
13602
15114
  Schema.encodeKeys({
13603
- authorEmail: "author_email",
13604
- authorId: "author_id",
13605
- createdOn: "created_on",
13606
- hasPreview: "hasPreview",
13607
- modifiedOn: "modified_on",
13608
- source: "source",
15115
+ workersDev: "workers_dev",
15116
+ minimalMode: "minimal_mode",
13609
15117
  }),
13610
15118
  ),
13611
- Schema.Null,
15119
+ Schema.Struct({
15120
+ routes: Schema.Array(Schema.String),
15121
+ minimalMode: Schema.optional(Schema.Boolean),
15122
+ }).pipe(
15123
+ Schema.encodeKeys({ routes: "routes", minimalMode: "minimal_mode" }),
15124
+ ),
13612
15125
  ]),
13613
15126
  ),
13614
- number: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
13615
- startupTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
15127
+ }).pipe(
15128
+ Schema.encodeKeys({
15129
+ metadata: "metadata",
15130
+ files: "files",
15131
+ wranglerSessionConfig: "wrangler-session-config",
15132
+ }),
15133
+ T.Http({
15134
+ method: "POST",
15135
+ path: "/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/edge-preview",
15136
+ contentType: "multipart",
15137
+ }),
15138
+ ) as unknown as Schema.Schema<CreateServiceEdgePreviewRequest>;
15139
+
15140
+ export interface CreateServiceEdgePreviewResponse {
15141
+ /** Token to send as cf-workers-preview-token header when making requests to the preview host. */
15142
+ previewToken: string;
15143
+ /** URL for tailing live logs from the preview worker. */
15144
+ tailUrl: string;
15145
+ }
15146
+
15147
+ export const CreateServiceEdgePreviewResponse =
15148
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15149
+ previewToken: Schema.String,
15150
+ tailUrl: Schema.String,
13616
15151
  })
13617
15152
  .pipe(
13618
- Schema.encodeKeys({
13619
- resources: "resources",
13620
- id: "id",
13621
- metadata: "metadata",
13622
- number: "number",
13623
- startupTimeMs: "startup_time_ms",
13624
- }),
15153
+ Schema.encodeKeys({ previewToken: "preview_token", tailUrl: "tail_url" }),
13625
15154
  )
13626
15155
  .pipe(
13627
15156
  T.ResponsePath("result"),
13628
- ) as unknown as Schema.Schema<CreateScriptVersionResponse>;
15157
+ ) as unknown as Schema.Schema<CreateServiceEdgePreviewResponse>;
13629
15158
 
13630
- export type CreateScriptVersionError = DefaultErrors | WorkerNotFound;
15159
+ export type CreateServiceEdgePreviewError = DefaultErrors | InvalidRoute;
13631
15160
 
13632
- export const createScriptVersion: API.OperationMethod<
13633
- CreateScriptVersionRequest,
13634
- CreateScriptVersionResponse,
13635
- CreateScriptVersionError,
15161
+ export const createServiceEdgePreview: API.OperationMethod<
15162
+ CreateServiceEdgePreviewRequest,
15163
+ CreateServiceEdgePreviewResponse,
15164
+ CreateServiceEdgePreviewError,
13636
15165
  Credentials | HttpClient.HttpClient
13637
15166
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
13638
- input: CreateScriptVersionRequest,
13639
- output: CreateScriptVersionResponse,
13640
- errors: [WorkerNotFound],
15167
+ input: CreateServiceEdgePreviewRequest,
15168
+ output: CreateServiceEdgePreviewResponse,
15169
+ errors: [InvalidRoute],
13641
15170
  }));
13642
15171
 
13643
15172
  // =============================================================================
@@ -13748,3 +15277,98 @@ export const deleteSubdomain: API.OperationMethod<
13748
15277
  output: DeleteSubdomainResponse,
13749
15278
  errors: [InvalidRoute],
13750
15279
  }));
15280
+
15281
+ // =============================================================================
15282
+ // SubdomainEdgePreviewSession
15283
+ // =============================================================================
15284
+
15285
+ export interface CreateSubdomainEdgePreviewSessionRequest {
15286
+ accountId: string;
15287
+ }
15288
+
15289
+ export const CreateSubdomainEdgePreviewSessionRequest =
15290
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15291
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
15292
+ }).pipe(
15293
+ T.Http({
15294
+ method: "GET",
15295
+ path: "/accounts/{account_id}/workers/subdomain/edge-preview",
15296
+ }),
15297
+ ) as unknown as Schema.Schema<CreateSubdomainEdgePreviewSessionRequest>;
15298
+
15299
+ export interface CreateSubdomainEdgePreviewSessionResponse {
15300
+ /** Session token used as cf-preview-upload-config-token when uploading a preview worker. */
15301
+ token: string;
15302
+ /** Optional URL to exchange the token for a re-encoded version. */
15303
+ exchangeUrl?: string | null;
15304
+ }
15305
+
15306
+ export const CreateSubdomainEdgePreviewSessionResponse =
15307
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15308
+ token: Schema.String,
15309
+ exchangeUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
15310
+ })
15311
+ .pipe(Schema.encodeKeys({ token: "token", exchangeUrl: "exchange_url" }))
15312
+ .pipe(
15313
+ T.ResponsePath("result"),
15314
+ ) as unknown as Schema.Schema<CreateSubdomainEdgePreviewSessionResponse>;
15315
+
15316
+ export type CreateSubdomainEdgePreviewSessionError =
15317
+ | DefaultErrors
15318
+ | InvalidRoute;
15319
+
15320
+ export const createSubdomainEdgePreviewSession: API.OperationMethod<
15321
+ CreateSubdomainEdgePreviewSessionRequest,
15322
+ CreateSubdomainEdgePreviewSessionResponse,
15323
+ CreateSubdomainEdgePreviewSessionError,
15324
+ Credentials | HttpClient.HttpClient
15325
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
15326
+ input: CreateSubdomainEdgePreviewSessionRequest,
15327
+ output: CreateSubdomainEdgePreviewSessionResponse,
15328
+ errors: [InvalidRoute],
15329
+ }));
15330
+
15331
+ // =============================================================================
15332
+ // ZoneEdgePreviewSession
15333
+ // =============================================================================
15334
+
15335
+ export interface CreateZoneEdgePreviewSessionRequest {
15336
+ zoneId: string;
15337
+ }
15338
+
15339
+ export const CreateZoneEdgePreviewSessionRequest =
15340
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15341
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
15342
+ }).pipe(
15343
+ T.Http({ method: "GET", path: "/zones/{zone_id}/workers/edge-preview" }),
15344
+ ) as unknown as Schema.Schema<CreateZoneEdgePreviewSessionRequest>;
15345
+
15346
+ export interface CreateZoneEdgePreviewSessionResponse {
15347
+ /** Session token used as cf-preview-upload-config-token when uploading a preview worker. */
15348
+ token: string;
15349
+ /** Optional URL to exchange the token for a re-encoded version. */
15350
+ exchangeUrl?: string | null;
15351
+ }
15352
+
15353
+ export const CreateZoneEdgePreviewSessionResponse =
15354
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15355
+ token: Schema.String,
15356
+ exchangeUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
15357
+ })
15358
+ .pipe(Schema.encodeKeys({ token: "token", exchangeUrl: "exchange_url" }))
15359
+ .pipe(
15360
+ T.ResponsePath("result"),
15361
+ ) as unknown as Schema.Schema<CreateZoneEdgePreviewSessionResponse>;
15362
+
15363
+ export type CreateZoneEdgePreviewSessionError = DefaultErrors | InvalidRoute;
15364
+
15365
+ export const createZoneEdgePreviewSession: API.OperationMethod<
15366
+ CreateZoneEdgePreviewSessionRequest,
15367
+ CreateZoneEdgePreviewSessionResponse,
15368
+ CreateZoneEdgePreviewSessionError,
15369
+ Credentials | HttpClient.HttpClient
15370
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
15371
+ input: CreateZoneEdgePreviewSessionRequest,
15372
+ output: CreateZoneEdgePreviewSessionResponse,
15373
+ errors: [InvalidRoute],
15374
+ }));