@distilled.cloud/cloudflare 0.7.11 → 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",
@@ -8894,174 +8897,928 @@ export const deleteScriptDeployment: API.OperationMethod<
8894
8897
  }));
8895
8898
 
8896
8899
  // =============================================================================
8897
- // ScriptSchedule
8900
+ // ScriptEdgePreview
8898
8901
  // =============================================================================
8899
8902
 
8900
- export interface GetScriptScheduleRequest {
8901
- scriptName: string;
8902
- /** Identifier. */
8903
+ export interface CreateScriptEdgePreviewRequest {
8903
8904
  accountId: string;
8904
- }
8905
-
8906
- export const GetScriptScheduleRequest =
8907
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8908
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
8909
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
8910
- }).pipe(
8911
- T.Http({
8912
- method: "GET",
8913
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
8914
- }),
8915
- ) as unknown as Schema.Schema<GetScriptScheduleRequest>;
8916
-
8917
- export interface GetScriptScheduleResponse {
8918
- schedules: {
8919
- cron: string;
8920
- createdOn?: string | null;
8921
- modifiedOn?: string | null;
8922
- }[];
8923
- }
8924
-
8925
- export const GetScriptScheduleResponse =
8926
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8927
- schedules: Schema.Array(
8928
- Schema.Struct({
8929
- cron: Schema.String,
8930
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8931
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8932
- }).pipe(
8933
- Schema.encodeKeys({
8934
- cron: "cron",
8935
- createdOn: "created_on",
8936
- modifiedOn: "modified_on",
8937
- }),
8938
- ),
8939
- ),
8940
- }).pipe(
8941
- T.ResponsePath("result"),
8942
- ) as unknown as Schema.Schema<GetScriptScheduleResponse>;
8943
-
8944
- export type GetScriptScheduleError = DefaultErrors | WorkerNotFound;
8945
-
8946
- export const getScriptSchedule: API.OperationMethod<
8947
- GetScriptScheduleRequest,
8948
- GetScriptScheduleResponse,
8949
- GetScriptScheduleError,
8950
- Credentials | HttpClient.HttpClient
8951
- > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
8952
- input: GetScriptScheduleRequest,
8953
- output: GetScriptScheduleResponse,
8954
- errors: [WorkerNotFound],
8955
- }));
8956
-
8957
- export interface PutScriptScheduleRequest {
8958
8905
  scriptName: string;
8959
- /** Path param: Identifier. */
8960
- accountId: string;
8961
- /** Body param: */
8962
- 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 };
8963
9073
  }
8964
9074
 
8965
- export const PutScriptScheduleRequest =
9075
+ export const CreateScriptEdgePreviewRequest =
8966
9076
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8967
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
8968
9077
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
8969
- body: Schema.Array(
8970
- Schema.Struct({
8971
- cron: Schema.String,
8972
- }),
8973
- ).pipe(T.HttpBody()),
8974
- }).pipe(
8975
- T.Http({
8976
- method: "PUT",
8977
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
8978
- }),
8979
- ) as unknown as Schema.Schema<PutScriptScheduleRequest>;
8980
-
8981
- export interface PutScriptScheduleResponse {
8982
- schedules: {
8983
- cron: string;
8984
- createdOn?: string | null;
8985
- modifiedOn?: string | null;
8986
- }[];
8987
- }
8988
-
8989
- export const PutScriptScheduleResponse =
8990
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8991
- schedules: Schema.Array(
8992
- Schema.Struct({
8993
- cron: Schema.String,
8994
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8995
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
8996
- }).pipe(
8997
- Schema.encodeKeys({
8998
- cron: "cron",
8999
- createdOn: "created_on",
9000
- modifiedOn: "modified_on",
9001
- }),
9002
- ),
9078
+ scriptName: Schema.String.pipe(T.HttpPath("script_name")),
9079
+ cfPreviewUploadConfigToken: Schema.String.pipe(
9080
+ T.HttpHeader("cf-preview-upload-config-token"),
9003
9081
  ),
9004
- }).pipe(
9005
- T.ResponsePath("result"),
9006
- ) as unknown as Schema.Schema<PutScriptScheduleResponse>;
9007
-
9008
- export type PutScriptScheduleError = DefaultErrors | WorkerNotFound;
9009
-
9010
- export const putScriptSchedule: API.OperationMethod<
9011
- PutScriptScheduleRequest,
9012
- PutScriptScheduleResponse,
9013
- PutScriptScheduleError,
9014
- Credentials | HttpClient.HttpClient
9015
- > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
9016
- input: PutScriptScheduleRequest,
9017
- output: PutScriptScheduleResponse,
9018
- errors: [WorkerNotFound],
9019
- }));
9020
-
9021
- // =============================================================================
9022
- // ScriptScriptAndVersionSetting
9023
- // =============================================================================
9024
-
9025
- export interface GetScriptScriptAndVersionSettingRequest {
9026
- scriptName: string;
9027
- /** Identifier. */
9028
- accountId: string;
9029
- }
9030
-
9031
- export const GetScriptScriptAndVersionSettingRequest =
9032
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9033
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
9034
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
9035
- }).pipe(
9036
- T.Http({
9037
- method: "GET",
9038
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
9039
- }),
9040
- ) as unknown as Schema.Schema<GetScriptScriptAndVersionSettingRequest>;
9041
-
9042
- export interface GetScriptScriptAndVersionSettingResponse {
9043
- /** 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. */
9044
- bindings?:
9045
- | (
9046
- | { name: string; type: "ai" }
9047
- | { dataset: string; name: string; type: "analytics_engine" }
9048
- | { name: string; type: "assets" }
9049
- | { name: string; type: "browser" }
9050
- | { id: string; name: string; type: "d1" }
9051
- | { name: string; part: string; type: "data_blob" }
9052
- | {
9053
- name: string;
9054
- namespace: string;
9055
- type: "dispatch_namespace";
9056
- outbound?: {
9057
- params?: string[] | null;
9058
- worker?: {
9059
- environment?: string | null;
9060
- service?: string | null;
9061
- } | null;
9062
- } | null;
9063
- }
9064
- | {
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";
9813
+ outbound?: {
9814
+ params?: string[] | null;
9815
+ worker?: {
9816
+ environment?: string | null;
9817
+ service?: string | null;
9818
+ } | null;
9819
+ } | null;
9820
+ }
9821
+ | {
9065
9822
  name: string;
9066
9823
  type: "durable_object_namespace";
9067
9824
  className?: string | null;
@@ -12779,881 +13536,1637 @@ export const CreateScriptVersionRequest =
12779
13536
  }),
12780
13537
  Schema.Struct({
12781
13538
  name: Schema.String,
12782
- type: Schema.Literal("browser"),
12783
- }),
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
+ ),
12784
13760
  Schema.Struct({
12785
- id: Schema.String,
12786
13761
  name: Schema.String,
12787
- type: Schema.Literal("d1"),
12788
- }),
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
+ ),
12789
13775
  Schema.Struct({
12790
13776
  name: Schema.String,
12791
13777
  part: Schema.String,
12792
- type: Schema.Literal("data_blob"),
13778
+ type: Schema.Literal("wasm_module"),
12793
13779
  }),
12794
13780
  Schema.Struct({
12795
13781
  name: Schema.String,
12796
- namespace: Schema.String,
12797
- type: Schema.Literal("dispatch_namespace"),
12798
- outbound: Schema.optional(
12799
- Schema.Struct({
12800
- params: Schema.optional(Schema.Array(Schema.String)),
12801
- 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([
12802
13998
  Schema.Struct({
12803
- environment: Schema.optional(Schema.String),
12804
- 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
+ ),
12805
14018
  }),
12806
- ),
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",
12807
14046
  }),
12808
14047
  ),
12809
- }),
12810
- Schema.Struct({
12811
- name: Schema.String,
12812
- type: Schema.Literal("durable_object_namespace"),
12813
- className: Schema.optional(Schema.String),
12814
- environment: Schema.optional(Schema.String),
12815
- namespaceId: Schema.optional(Schema.String),
12816
- scriptName: Schema.optional(Schema.String),
12817
- }).pipe(
12818
- Schema.encodeKeys({
12819
- name: "name",
12820
- type: "type",
12821
- className: "class_name",
12822
- environment: "environment",
12823
- namespaceId: "namespace_id",
12824
- scriptName: "script_name",
14048
+ Schema.Struct({
14049
+ id: Schema.String,
14050
+ name: Schema.String,
14051
+ type: Schema.Literal("hyperdrive"),
12825
14052
  }),
12826
- ),
12827
- Schema.Struct({
12828
- id: Schema.String,
12829
- name: Schema.String,
12830
- type: Schema.Literal("hyperdrive"),
12831
- }),
12832
- Schema.Struct({
12833
- name: Schema.String,
12834
- type: Schema.Literal("inherit"),
12835
- oldName: Schema.optional(Schema.String),
12836
- versionId: Schema.optional(Schema.String),
12837
- }).pipe(
12838
- Schema.encodeKeys({
12839
- name: "name",
12840
- type: "type",
12841
- oldName: "old_name",
12842
- 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"),
12843
14073
  }),
12844
- ),
12845
- Schema.Struct({
12846
- name: Schema.String,
12847
- type: Schema.Literal("images"),
12848
- }),
12849
- Schema.Struct({
12850
- json: Schema.String,
12851
- name: Schema.String,
12852
- type: Schema.Literal("json"),
12853
- }),
12854
- Schema.Struct({
12855
- name: Schema.String,
12856
- namespaceId: Schema.String,
12857
- type: Schema.Literal("kv_namespace"),
12858
- }).pipe(
12859
- Schema.encodeKeys({
12860
- name: "name",
12861
- namespaceId: "namespace_id",
12862
- type: "type",
14074
+ Schema.Struct({
14075
+ json: Schema.String,
14076
+ name: Schema.String,
14077
+ type: Schema.Literal("json"),
12863
14078
  }),
12864
- ),
12865
- Schema.Struct({
12866
- certificateId: Schema.String,
12867
- name: Schema.String,
12868
- type: Schema.Literal("mtls_certificate"),
12869
- }).pipe(
12870
- Schema.encodeKeys({
12871
- certificateId: "certificate_id",
12872
- name: "name",
12873
- 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
+ ),
12874
14172
  }),
12875
- ),
12876
- Schema.Struct({
12877
- name: Schema.String,
12878
- text: Schema.String,
12879
- type: Schema.Literal("plain_text"),
12880
- }),
12881
- Schema.Struct({
12882
- name: Schema.String,
12883
- pipeline: Schema.String,
12884
- type: Schema.Literal("pipelines"),
12885
- }),
12886
- Schema.Struct({
12887
- name: Schema.String,
12888
- queueName: Schema.String,
12889
- type: Schema.Literal("queue"),
12890
- }).pipe(
12891
- Schema.encodeKeys({
12892
- name: "name",
12893
- queueName: "queue_name",
12894
- type: "type",
14173
+ Schema.Struct({
14174
+ name: Schema.String,
14175
+ part: Schema.String,
14176
+ type: Schema.Literal("text_blob"),
12895
14177
  }),
12896
- ),
12897
- Schema.Struct({
12898
- bucketName: Schema.String,
12899
- name: Schema.String,
12900
- type: Schema.Literal("r2_bucket"),
12901
- jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
12902
- }).pipe(
12903
- Schema.encodeKeys({
12904
- bucketName: "bucket_name",
12905
- name: "name",
12906
- type: "type",
12907
- 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"),
12908
14192
  }),
12909
- ),
12910
- Schema.Struct({
12911
- name: Schema.String,
12912
- text: Schema.String,
12913
- type: Schema.Literal("secret_text"),
12914
- }),
12915
- Schema.Struct({
12916
- name: Schema.String,
12917
- type: Schema.Literal("send_email"),
12918
- allowedDestinationAddresses: Schema.optional(
12919
- 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
+ }),
12920
14205
  ),
12921
- allowedSenderAddresses: Schema.optional(
12922
- 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
+ }),
12923
14242
  ),
12924
- destinationAddress: Schema.optional(Schema.String),
12925
- }).pipe(
12926
- Schema.encodeKeys({
12927
- name: "name",
12928
- type: "type",
12929
- allowedDestinationAddresses: "allowed_destination_addresses",
12930
- allowedSenderAddresses: "allowed_sender_addresses",
12931
- destinationAddress: "destination_address",
14243
+ Schema.Struct({
14244
+ name: Schema.String,
14245
+ part: Schema.String,
14246
+ type: Schema.Literal("wasm_module"),
12932
14247
  }),
12933
- ),
12934
- Schema.Struct({
12935
- name: Schema.String,
12936
- service: Schema.String,
12937
- type: Schema.Literal("service"),
12938
- environment: Schema.optional(Schema.String),
12939
- }),
12940
- Schema.Struct({
12941
- name: Schema.String,
12942
- part: Schema.String,
12943
- type: Schema.Literal("text_blob"),
12944
- }),
12945
- Schema.Struct({
12946
- indexName: Schema.String,
12947
- name: Schema.String,
12948
- type: Schema.Literal("vectorize"),
12949
- }).pipe(
12950
- Schema.encodeKeys({
12951
- indexName: "index_name",
12952
- name: "name",
12953
- type: "type",
14248
+ Schema.Struct({
14249
+ name: Schema.String,
14250
+ type: Schema.Literal("worker_loader"),
12954
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]),
12955
14263
  ),
12956
- Schema.Struct({
12957
- name: Schema.String,
12958
- 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",
12959
14288
  }),
12960
- Schema.Struct({
12961
- name: Schema.String,
12962
- secretName: Schema.String,
12963
- storeId: Schema.String,
12964
- type: Schema.Literal("secrets_store_secret"),
12965
- }).pipe(
12966
- Schema.encodeKeys({
12967
- name: "name",
12968
- secretName: "secret_name",
12969
- storeId: "store_id",
12970
- type: "type",
12971
- }),
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]),
12972
14298
  ),
12973
- Schema.Struct({
12974
- algorithm: Schema.Unknown,
12975
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
12976
- name: Schema.String,
12977
- type: Schema.Literal("secret_key"),
12978
- usages: Schema.Array(
12979
- Schema.Literals([
12980
- "encrypt",
12981
- "decrypt",
12982
- "sign",
12983
- "verify",
12984
- "deriveKey",
12985
- "deriveBits",
12986
- "wrapKey",
12987
- "unwrapKey",
12988
- ]),
12989
- ),
12990
- keyBase64: Schema.optional(Schema.String),
12991
- keyJwk: Schema.optional(Schema.Unknown),
12992
- }).pipe(
12993
- Schema.encodeKeys({
12994
- algorithm: "algorithm",
12995
- format: "format",
12996
- name: "name",
12997
- type: "type",
12998
- usages: "usages",
12999
- keyBase64: "key_base64",
13000
- keyJwk: "key_jwk",
13001
- }),
14299
+ compatibilityFlags: Schema.optional(
14300
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13002
14301
  ),
13003
- Schema.Struct({
13004
- name: Schema.String,
13005
- type: Schema.Literal("workflow"),
13006
- workflowName: Schema.String,
13007
- className: Schema.optional(Schema.String),
13008
- scriptName: Schema.optional(Schema.String),
13009
- }).pipe(
13010
- Schema.encodeKeys({
13011
- name: "name",
13012
- type: "type",
13013
- workflowName: "workflow_name",
13014
- className: "class_name",
13015
- scriptName: "script_name",
13016
- }),
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
+ ]),
13017
14311
  ),
13018
- Schema.Struct({
13019
- name: Schema.String,
13020
- part: Schema.String,
13021
- type: Schema.Literal("wasm_module"),
13022
- }),
13023
- Schema.Struct({
13024
- name: Schema.String,
13025
- 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",
13026
14328
  }),
13027
- ]),
13028
- ),
13029
- ),
13030
- compatibilityDate: Schema.optional(Schema.String),
13031
- compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
13032
- keepBindings: Schema.optional(Schema.Array(Schema.String)),
13033
- usageModel: Schema.optional(
13034
- Schema.Literals(["standard", "bundled", "unbound"]),
14329
+ ),
14330
+ Schema.Null,
14331
+ ]),
13035
14332
  ),
13036
14333
  }).pipe(
13037
14334
  Schema.encodeKeys({
13038
- mainModule: "main_module",
13039
- annotations: "annotations",
13040
14335
  bindings: "bindings",
13041
- compatibilityDate: "compatibility_date",
13042
- compatibilityFlags: "compatibility_flags",
13043
- keepBindings: "keep_bindings",
13044
- usageModel: "usage_model",
14336
+ script: "script",
14337
+ scriptRuntime: "script_runtime",
13045
14338
  }),
13046
14339
  ),
13047
- files: Schema.optional(
13048
- 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
+ ]),
13049
14386
  ),
13050
- }).pipe(
13051
- T.Http({
13052
- method: "POST",
13053
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/versions",
13054
- contentType: "multipart",
13055
- }),
13056
- ) 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>;
13057
14402
 
13058
- export interface CreateScriptVersionResponse {
13059
- resources: {
13060
- bindings?:
13061
- | (
13062
- | { name: string; type: "ai" }
13063
- | { dataset: string; name: string; type: "analytics_engine" }
13064
- | { name: string; type: "assets" }
13065
- | { name: string; type: "browser" }
13066
- | { id: string; name: string; type: "d1" }
13067
- | { name: string; part: string; type: "data_blob" }
13068
- | {
13069
- name: string;
13070
- namespace: string;
13071
- type: "dispatch_namespace";
13072
- outbound?: {
13073
- params?: string[] | null;
13074
- worker?: {
13075
- environment?: string | null;
13076
- service?: string | null;
13077
- } | null;
13078
- } | null;
13079
- }
13080
- | {
13081
- name: string;
13082
- type: "durable_object_namespace";
13083
- className?: string | null;
13084
- environment?: string | null;
13085
- namespaceId?: string | null;
13086
- scriptName?: string | null;
13087
- }
13088
- | { id: string; name: string; type: "hyperdrive" }
13089
- | {
13090
- name: string;
13091
- type: "inherit";
13092
- oldName?: string | null;
13093
- versionId?: string | null;
13094
- }
13095
- | { name: string; type: "images" }
13096
- | { json: string; name: string; type: "json" }
13097
- | { name: string; namespaceId: string; type: "kv_namespace" }
13098
- | { certificateId: string; name: string; type: "mtls_certificate" }
13099
- | { name: string; text: string; type: "plain_text" }
13100
- | { name: string; pipeline: string; type: "pipelines" }
13101
- | { name: string; queueName: string; type: "queue" }
13102
- | {
13103
- bucketName: string;
13104
- name: string;
13105
- type: "r2_bucket";
13106
- jurisdiction?: "eu" | "fedramp" | null;
13107
- }
13108
- | { name: string; type: "secret_text" }
13109
- | {
13110
- name: string;
13111
- type: "send_email";
13112
- allowedDestinationAddresses?: string[] | null;
13113
- allowedSenderAddresses?: string[] | null;
13114
- destinationAddress?: string | null;
13115
- }
13116
- | {
13117
- name: string;
13118
- service: string;
13119
- type: "service";
13120
- environment?: string | null;
13121
- }
13122
- | { name: string; part: string; type: "text_blob" }
13123
- | { indexName: string; name: string; type: "vectorize" }
13124
- | { name: string; type: "version_metadata" }
13125
- | {
13126
- name: string;
13127
- secretName: string;
13128
- storeId: string;
13129
- type: "secrets_store_secret";
13130
- }
13131
- | {
13132
- algorithm: unknown;
13133
- format: "raw" | "pkcs8" | "spki" | "jwk";
13134
- name: string;
13135
- type: "secret_key";
13136
- usages: (
13137
- | "encrypt"
13138
- | "decrypt"
13139
- | "sign"
13140
- | "verify"
13141
- | "deriveKey"
13142
- | "deriveBits"
13143
- | "wrapKey"
13144
- | "unwrapKey"
13145
- )[];
13146
- }
13147
- | {
13148
- name: string;
13149
- type: "workflow";
13150
- workflowName: string;
13151
- className?: string | null;
13152
- scriptName?: string | null;
13153
- }
13154
- | { name: string; part: string; type: "wasm_module" }
13155
- | { name: string; type: "worker_loader" }
13156
- )[]
13157
- | null;
13158
- script?: {
13159
- etag?: string | null;
13160
- handlers?: string[] | null;
13161
- lastDeployedFrom?: string | null;
13162
- namedHandlers?:
13163
- | { handlers?: string[] | null; name?: string | null }[]
13164
- | null;
13165
- } | null;
13166
- scriptRuntime?: {
13167
- compatibilityDate?: string | null;
13168
- compatibilityFlags?: string[] | null;
13169
- limits?: { cpuMs?: number | null } | null;
13170
- migrationTag?: string | null;
13171
- usageModel?: "bundled" | "unbound" | "standard" | null;
13172
- } | 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[];
13173
14585
  };
13174
- /** Unique identifier for the version. */
13175
- id?: string | null;
13176
- metadata?: {
13177
- authorEmail?: string | null;
13178
- authorId?: string | null;
13179
- createdOn?: string | null;
13180
- hasPreview?: boolean | null;
13181
- modifiedOn?: string | null;
13182
- source?:
13183
- | "unknown"
13184
- | "api"
13185
- | "wrangler"
13186
- | "terraform"
13187
- | "dash"
13188
- | "dash_template"
13189
- | "integration"
13190
- | "quick_editor"
13191
- | "playground"
13192
- | "workersci"
13193
- | null;
13194
- } | null;
13195
- /** Sequential version number. */
13196
- number?: number | null;
13197
- /** Time in milliseconds spent on [Worker startup](https://developers.cloudflare.com/workers/platform/limits/#worker-startup-time). */
13198
- 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 };
13199
14591
  }
13200
14592
 
13201
- export const CreateScriptVersionResponse =
14593
+ export const CreateServiceEdgePreviewRequest =
13202
14594
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
13203
- resources: Schema.Struct({
13204
- bindings: Schema.optional(
13205
- 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(
13206
14611
  Schema.Array(
13207
14612
  Schema.Union([
13208
14613
  Schema.Struct({
14614
+ type: Schema.Literal("plain_text"),
13209
14615
  name: Schema.String,
13210
- type: Schema.Literal("ai"),
13211
- }),
13212
- Schema.Struct({
13213
- dataset: Schema.String,
13214
- name: Schema.String,
13215
- type: Schema.Literal("analytics_engine"),
13216
- }),
13217
- Schema.Struct({
13218
- name: Schema.String,
13219
- type: Schema.Literal("assets"),
13220
- }),
13221
- Schema.Struct({
13222
- name: Schema.String,
13223
- type: Schema.Literal("browser"),
13224
- }),
13225
- Schema.Struct({
13226
- id: Schema.String,
13227
- name: Schema.String,
13228
- type: Schema.Literal("d1"),
14616
+ text: Schema.String,
13229
14617
  }),
13230
14618
  Schema.Struct({
14619
+ type: Schema.Literal("secret_text"),
13231
14620
  name: Schema.String,
13232
- part: Schema.String,
13233
- type: Schema.Literal("data_blob"),
14621
+ text: Schema.String,
13234
14622
  }),
13235
14623
  Schema.Struct({
14624
+ type: Schema.Literal("json"),
13236
14625
  name: Schema.String,
13237
- namespace: Schema.String,
13238
- type: Schema.Literal("dispatch_namespace"),
13239
- outbound: Schema.optional(
13240
- Schema.Union([
13241
- Schema.Struct({
13242
- params: Schema.optional(
13243
- Schema.Union([
13244
- Schema.Array(Schema.String),
13245
- Schema.Null,
13246
- ]),
13247
- ),
13248
- worker: Schema.optional(
13249
- Schema.Union([
13250
- Schema.Struct({
13251
- environment: Schema.optional(
13252
- Schema.Union([Schema.String, Schema.Null]),
13253
- ),
13254
- service: Schema.optional(
13255
- Schema.Union([Schema.String, Schema.Null]),
13256
- ),
13257
- }),
13258
- Schema.Null,
13259
- ]),
13260
- ),
13261
- }),
13262
- Schema.Null,
13263
- ]),
13264
- ),
14626
+ json: Schema.Unknown,
13265
14627
  }),
13266
14628
  Schema.Struct({
14629
+ type: Schema.Literal("kv_namespace"),
13267
14630
  name: Schema.String,
13268
- type: Schema.Literal("durable_object_namespace"),
13269
- className: Schema.optional(
13270
- Schema.Union([Schema.String, Schema.Null]),
13271
- ),
13272
- environment: Schema.optional(
13273
- Schema.Union([Schema.String, Schema.Null]),
13274
- ),
13275
- namespaceId: Schema.optional(
13276
- Schema.Union([Schema.String, Schema.Null]),
13277
- ),
13278
- scriptName: Schema.optional(
13279
- Schema.Union([Schema.String, Schema.Null]),
13280
- ),
14631
+ namespaceId: Schema.String,
14632
+ raw: Schema.optional(Schema.Boolean),
13281
14633
  }).pipe(
13282
14634
  Schema.encodeKeys({
13283
- name: "name",
13284
14635
  type: "type",
13285
- className: "class_name",
13286
- environment: "environment",
14636
+ name: "name",
13287
14637
  namespaceId: "namespace_id",
13288
- scriptName: "script_name",
14638
+ raw: "raw",
13289
14639
  }),
13290
14640
  ),
13291
14641
  Schema.Struct({
13292
- id: Schema.String,
13293
- name: Schema.String,
13294
- type: Schema.Literal("hyperdrive"),
13295
- }),
13296
- Schema.Struct({
14642
+ type: Schema.Literal("durable_object_namespace"),
13297
14643
  name: Schema.String,
13298
- type: Schema.Literal("inherit"),
13299
- oldName: Schema.optional(
13300
- Schema.Union([Schema.String, Schema.Null]),
13301
- ),
13302
- versionId: Schema.optional(
13303
- Schema.Union([Schema.String, Schema.Null]),
13304
- ),
14644
+ className: Schema.String,
14645
+ scriptName: Schema.optional(Schema.String),
14646
+ environment: Schema.optional(Schema.String),
14647
+ namespaceId: Schema.optional(Schema.String),
13305
14648
  }).pipe(
13306
14649
  Schema.encodeKeys({
13307
- name: "name",
13308
14650
  type: "type",
13309
- oldName: "old_name",
13310
- versionId: "version_id",
14651
+ name: "name",
14652
+ className: "class_name",
14653
+ scriptName: "script_name",
14654
+ environment: "environment",
14655
+ namespaceId: "namespace_id",
13311
14656
  }),
13312
14657
  ),
13313
14658
  Schema.Struct({
14659
+ type: Schema.Literal("r2_bucket"),
13314
14660
  name: Schema.String,
13315
- type: Schema.Literal("images"),
13316
- }),
13317
- Schema.Struct({
13318
- json: Schema.String,
13319
- name: Schema.String,
13320
- type: Schema.Literal("json"),
13321
- }),
13322
- Schema.Struct({
13323
- name: Schema.String,
13324
- namespaceId: Schema.String,
13325
- type: Schema.Literal("kv_namespace"),
14661
+ bucketName: Schema.String,
14662
+ jurisdiction: Schema.optional(Schema.String),
14663
+ raw: Schema.optional(Schema.Boolean),
13326
14664
  }).pipe(
13327
14665
  Schema.encodeKeys({
13328
- name: "name",
13329
- namespaceId: "namespace_id",
13330
14666
  type: "type",
14667
+ name: "name",
14668
+ bucketName: "bucket_name",
14669
+ jurisdiction: "jurisdiction",
14670
+ raw: "raw",
13331
14671
  }),
13332
14672
  ),
13333
14673
  Schema.Struct({
13334
- certificateId: Schema.String,
14674
+ type: Schema.Literal("d1"),
13335
14675
  name: Schema.String,
13336
- 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),
13337
14685
  }).pipe(
13338
- Schema.encodeKeys({
13339
- certificateId: "certificate_id",
13340
- name: "name",
14686
+ Schema.encodeKeys({
13341
14687
  type: "type",
14688
+ name: "name",
14689
+ queueName: "queue_name",
14690
+ deliveryDelay: "delivery_delay",
14691
+ raw: "raw",
13342
14692
  }),
13343
14693
  ),
13344
14694
  Schema.Struct({
14695
+ type: Schema.Literal("service"),
13345
14696
  name: Schema.String,
13346
- text: Schema.String,
13347
- type: Schema.Literal("plain_text"),
14697
+ service: Schema.String,
14698
+ environment: Schema.optional(Schema.String),
14699
+ entrypoint: Schema.optional(Schema.String),
13348
14700
  }),
13349
14701
  Schema.Struct({
14702
+ type: Schema.Literal("ai"),
13350
14703
  name: Schema.String,
13351
- pipeline: Schema.String,
13352
- type: Schema.Literal("pipelines"),
14704
+ staging: Schema.optional(Schema.Boolean),
14705
+ raw: Schema.optional(Schema.Boolean),
13353
14706
  }),
13354
14707
  Schema.Struct({
14708
+ type: Schema.Literal("browser"),
13355
14709
  name: Schema.String,
13356
- queueName: Schema.String,
13357
- 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),
13358
14722
  }).pipe(
13359
14723
  Schema.encodeKeys({
13360
- name: "name",
13361
- queueName: "queue_name",
13362
14724
  type: "type",
14725
+ name: "name",
14726
+ indexName: "index_name",
14727
+ raw: "raw",
13363
14728
  }),
13364
14729
  ),
13365
14730
  Schema.Struct({
13366
- bucketName: Schema.String,
14731
+ type: Schema.Literal("workflow"),
13367
14732
  name: Schema.String,
13368
- type: Schema.Literal("r2_bucket"),
13369
- jurisdiction: Schema.optional(
13370
- Schema.Union([
13371
- Schema.Literals(["eu", "fedramp"]),
13372
- Schema.Null,
13373
- ]),
13374
- ),
14733
+ workflowName: Schema.String,
14734
+ className: Schema.String,
14735
+ scriptName: Schema.optional(Schema.String),
14736
+ raw: Schema.optional(Schema.Boolean),
13375
14737
  }).pipe(
13376
14738
  Schema.encodeKeys({
13377
- bucketName: "bucket_name",
13378
- name: "name",
13379
14739
  type: "type",
13380
- jurisdiction: "jurisdiction",
14740
+ name: "name",
14741
+ workflowName: "workflow_name",
14742
+ className: "class_name",
14743
+ scriptName: "script_name",
14744
+ raw: "raw",
13381
14745
  }),
13382
14746
  ),
13383
14747
  Schema.Struct({
14748
+ type: Schema.Literal("hyperdrive"),
13384
14749
  name: Schema.String,
13385
- type: Schema.Literal("secret_text"),
14750
+ id: Schema.String,
13386
14751
  }),
13387
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"),
13388
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({
13389
14780
  type: Schema.Literal("send_email"),
14781
+ name: Schema.String,
14782
+ destinationAddress: Schema.optional(Schema.String),
13390
14783
  allowedDestinationAddresses: Schema.optional(
13391
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
14784
+ Schema.Array(Schema.String),
13392
14785
  ),
13393
14786
  allowedSenderAddresses: Schema.optional(
13394
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13395
- ),
13396
- destinationAddress: Schema.optional(
13397
- Schema.Union([Schema.String, Schema.Null]),
14787
+ Schema.Array(Schema.String),
13398
14788
  ),
13399
14789
  }).pipe(
13400
14790
  Schema.encodeKeys({
13401
- name: "name",
13402
14791
  type: "type",
14792
+ name: "name",
14793
+ destinationAddress: "destination_address",
13403
14794
  allowedDestinationAddresses: "allowed_destination_addresses",
13404
14795
  allowedSenderAddresses: "allowed_sender_addresses",
13405
- destinationAddress: "destination_address",
13406
14796
  }),
13407
14797
  ),
13408
14798
  Schema.Struct({
14799
+ type: Schema.Literal("mtls_certificate"),
13409
14800
  name: Schema.String,
13410
- service: Schema.String,
13411
- type: Schema.Literal("service"),
13412
- environment: Schema.optional(
13413
- Schema.Union([Schema.String, Schema.Null]),
13414
- ),
13415
- }),
14801
+ certificateId: Schema.String,
14802
+ }).pipe(
14803
+ Schema.encodeKeys({
14804
+ type: "type",
14805
+ name: "name",
14806
+ certificateId: "certificate_id",
14807
+ }),
14808
+ ),
13416
14809
  Schema.Struct({
14810
+ type: Schema.Literal("wasm_module"),
13417
14811
  name: Schema.String,
13418
14812
  part: Schema.String,
14813
+ }),
14814
+ Schema.Struct({
13419
14815
  type: Schema.Literal("text_blob"),
14816
+ name: Schema.String,
14817
+ part: Schema.String,
13420
14818
  }),
13421
14819
  Schema.Struct({
13422
- indexName: Schema.String,
14820
+ type: Schema.Literal("data_blob"),
13423
14821
  name: Schema.String,
13424
- type: Schema.Literal("vectorize"),
13425
- }).pipe(
13426
- Schema.encodeKeys({
13427
- indexName: "index_name",
13428
- name: "name",
13429
- type: "type",
13430
- }),
13431
- ),
14822
+ part: Schema.String,
14823
+ }),
13432
14824
  Schema.Struct({
14825
+ type: Schema.Literal("pipelines"),
13433
14826
  name: Schema.String,
13434
- type: Schema.Literal("version_metadata"),
14827
+ pipeline: Schema.String,
13435
14828
  }),
13436
14829
  Schema.Struct({
14830
+ type: Schema.Literal("secrets_store_secret"),
13437
14831
  name: Schema.String,
13438
- secretName: Schema.String,
13439
14832
  storeId: Schema.String,
13440
- type: Schema.Literal("secrets_store_secret"),
14833
+ secretName: Schema.String,
13441
14834
  }).pipe(
13442
14835
  Schema.encodeKeys({
14836
+ type: "type",
13443
14837
  name: "name",
13444
- secretName: "secret_name",
13445
14838
  storeId: "store_id",
13446
- type: "type",
14839
+ secretName: "secret_name",
13447
14840
  }),
13448
14841
  ),
13449
14842
  Schema.Struct({
13450
- algorithm: Schema.Unknown,
13451
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
14843
+ type: Schema.Literal("stream"),
13452
14844
  name: Schema.String,
13453
- type: Schema.Literal("secret_key"),
13454
- usages: Schema.Array(
13455
- Schema.Literals([
13456
- "encrypt",
13457
- "decrypt",
13458
- "sign",
13459
- "verify",
13460
- "deriveKey",
13461
- "deriveBits",
13462
- "wrapKey",
13463
- "unwrapKey",
13464
- ]),
13465
- ),
13466
14845
  }),
13467
14846
  Schema.Struct({
14847
+ type: Schema.Literal("media"),
13468
14848
  name: Schema.String,
13469
- type: Schema.Literal("workflow"),
13470
- workflowName: Schema.String,
13471
- className: Schema.optional(
13472
- Schema.Union([Schema.String, Schema.Null]),
13473
- ),
13474
- scriptName: Schema.optional(
13475
- Schema.Union([Schema.String, Schema.Null]),
13476
- ),
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,
13477
14876
  }).pipe(
13478
14877
  Schema.encodeKeys({
13479
- name: "name",
13480
14878
  type: "type",
13481
- workflowName: "workflow_name",
13482
- className: "class_name",
13483
- scriptName: "script_name",
14879
+ name: "name",
14880
+ instanceName: "instance_name",
13484
14881
  }),
13485
14882
  ),
13486
14883
  Schema.Struct({
14884
+ type: Schema.Literal("ratelimit"),
13487
14885
  name: Schema.String,
13488
- part: Schema.String,
13489
- type: Schema.Literal("wasm_module"),
13490
- }),
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
+ ),
13491
14899
  Schema.Struct({
14900
+ type: Schema.Literal("inherit"),
13492
14901
  name: Schema.String,
13493
- type: Schema.Literal("worker_loader"),
13494
14902
  }),
13495
14903
  ]),
13496
14904
  ),
13497
- Schema.Null,
13498
- ]),
13499
- ),
13500
- script: Schema.optional(
13501
- Schema.Union([
14905
+ ),
14906
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
14907
+ migrations: Schema.optional(
13502
14908
  Schema.Struct({
13503
- etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13504
- handlers: Schema.optional(
13505
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13506
- ),
13507
- lastDeployedFrom: Schema.optional(
13508
- Schema.Union([Schema.String, Schema.Null]),
13509
- ),
13510
- namedHandlers: Schema.optional(
13511
- Schema.Union([
13512
- Schema.Array(
13513
- Schema.Struct({
13514
- handlers: Schema.optional(
13515
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13516
- ),
13517
- name: Schema.optional(
13518
- 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
+ }),
13519
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",
13520
14933
  }),
13521
14934
  ),
13522
- Schema.Null,
13523
- ]),
14935
+ ),
13524
14936
  ),
13525
14937
  }).pipe(
13526
14938
  Schema.encodeKeys({
13527
- etag: "etag",
13528
- handlers: "handlers",
13529
- lastDeployedFrom: "last_deployed_from",
13530
- 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),
13531
14969
  }),
13532
14970
  ),
13533
- Schema.Null,
13534
- ]),
13535
- ),
13536
- scriptRuntime: Schema.optional(
13537
- 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(
13538
14981
  Schema.Struct({
13539
- compatibilityDate: Schema.optional(
13540
- Schema.Union([Schema.String, Schema.Null]),
13541
- ),
13542
- compatibilityFlags: Schema.optional(
13543
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
13544
- ),
13545
- limits: Schema.optional(
13546
- Schema.Union([
13547
- Schema.Struct({
13548
- cpuMs: Schema.optional(
13549
- Schema.Union([Schema.Number, Schema.Null]),
13550
- ),
13551
- }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
13552
- Schema.Null,
13553
- ]),
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
+ ),
13554
15022
  ),
13555
- migrationTag: Schema.optional(
13556
- 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
+ ),
13557
15045
  ),
13558
- usageModel: Schema.optional(
13559
- Schema.Union([
13560
- Schema.Literals(["bundled", "unbound", "standard"]),
13561
- Schema.Null,
13562
- ]),
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
+ ),
13563
15060
  ),
13564
15061
  }).pipe(
13565
15062
  Schema.encodeKeys({
13566
- compatibilityDate: "compatibility_date",
13567
- compatibilityFlags: "compatibility_flags",
13568
- limits: "limits",
13569
- migrationTag: "migration_tag",
13570
- usageModel: "usage_model",
15063
+ enabled: "enabled",
15064
+ headSamplingRate: "head_sampling_rate",
15065
+ logs: "logs",
15066
+ traces: "traces",
13571
15067
  }),
13572
15068
  ),
13573
- Schema.Null,
13574
- ]),
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
+ }),
13575
15103
  ),
13576
- }).pipe(
13577
- Schema.encodeKeys({
13578
- bindings: "bindings",
13579
- script: "script",
13580
- scriptRuntime: "script_runtime",
13581
- }),
13582
15104
  ),
13583
- id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13584
- metadata: Schema.optional(
15105
+ files: Schema.optional(
15106
+ Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile())),
15107
+ ),
15108
+ wranglerSessionConfig: Schema.optional(
13585
15109
  Schema.Union([
13586
15110
  Schema.Struct({
13587
- authorEmail: Schema.optional(
13588
- Schema.Union([Schema.String, Schema.Null]),
13589
- ),
13590
- authorId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
13591
- createdOn: Schema.optional(
13592
- Schema.Union([Schema.String, Schema.Null]),
13593
- ),
13594
- hasPreview: Schema.optional(
13595
- Schema.Union([Schema.Boolean, Schema.Null]),
13596
- ),
13597
- modifiedOn: Schema.optional(
13598
- Schema.Union([Schema.String, Schema.Null]),
13599
- ),
13600
- source: Schema.optional(
13601
- Schema.Union([
13602
- Schema.Literals([
13603
- "unknown",
13604
- "api",
13605
- "wrangler",
13606
- "terraform",
13607
- "dash",
13608
- "dash_template",
13609
- "integration",
13610
- "quick_editor",
13611
- "playground",
13612
- "workersci",
13613
- ]),
13614
- Schema.Null,
13615
- ]),
13616
- ),
15111
+ workersDev: Schema.Literal(true),
15112
+ minimalMode: Schema.optional(Schema.Boolean),
13617
15113
  }).pipe(
13618
15114
  Schema.encodeKeys({
13619
- authorEmail: "author_email",
13620
- authorId: "author_id",
13621
- createdOn: "created_on",
13622
- hasPreview: "hasPreview",
13623
- modifiedOn: "modified_on",
13624
- source: "source",
15115
+ workersDev: "workers_dev",
15116
+ minimalMode: "minimal_mode",
13625
15117
  }),
13626
15118
  ),
13627
- 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
+ ),
13628
15125
  ]),
13629
15126
  ),
13630
- number: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
13631
- 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,
13632
15151
  })
13633
15152
  .pipe(
13634
- Schema.encodeKeys({
13635
- resources: "resources",
13636
- id: "id",
13637
- metadata: "metadata",
13638
- number: "number",
13639
- startupTimeMs: "startup_time_ms",
13640
- }),
15153
+ Schema.encodeKeys({ previewToken: "preview_token", tailUrl: "tail_url" }),
13641
15154
  )
13642
15155
  .pipe(
13643
15156
  T.ResponsePath("result"),
13644
- ) as unknown as Schema.Schema<CreateScriptVersionResponse>;
15157
+ ) as unknown as Schema.Schema<CreateServiceEdgePreviewResponse>;
13645
15158
 
13646
- export type CreateScriptVersionError = DefaultErrors | WorkerNotFound;
15159
+ export type CreateServiceEdgePreviewError = DefaultErrors | InvalidRoute;
13647
15160
 
13648
- export const createScriptVersion: API.OperationMethod<
13649
- CreateScriptVersionRequest,
13650
- CreateScriptVersionResponse,
13651
- CreateScriptVersionError,
15161
+ export const createServiceEdgePreview: API.OperationMethod<
15162
+ CreateServiceEdgePreviewRequest,
15163
+ CreateServiceEdgePreviewResponse,
15164
+ CreateServiceEdgePreviewError,
13652
15165
  Credentials | HttpClient.HttpClient
13653
15166
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
13654
- input: CreateScriptVersionRequest,
13655
- output: CreateScriptVersionResponse,
13656
- errors: [WorkerNotFound],
15167
+ input: CreateServiceEdgePreviewRequest,
15168
+ output: CreateServiceEdgePreviewResponse,
15169
+ errors: [InvalidRoute],
13657
15170
  }));
13658
15171
 
13659
15172
  // =============================================================================
@@ -13764,3 +15277,98 @@ export const deleteSubdomain: API.OperationMethod<
13764
15277
  output: DeleteSubdomainResponse,
13765
15278
  errors: [InvalidRoute],
13766
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
+ }));