@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.
@@ -29,7 +29,10 @@ T.applyErrorMatchers(DurableObjectMustBeSqlite, [
29
29
  ]);
30
30
  export class InvalidRoute extends Schema.TaggedErrorClass()("InvalidRoute", { code: Schema.Number, message: Schema.String }) {
31
31
  }
32
- T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
32
+ T.applyErrorMatchers(InvalidRoute, [
33
+ { code: 7003 },
34
+ { code: 7003, message: { includes: "Could not route" } },
35
+ ]);
33
36
  export class InvalidRoutePattern extends Schema.TaggedErrorClass()("InvalidRoutePattern", { code: Schema.Number, message: Schema.String }) {
34
37
  }
35
38
  T.applyErrorMatchers(InvalidRoutePattern, [{ code: 10022 }]);
@@ -4249,803 +4252,577 @@ export const deleteScriptDeployment = /*@__PURE__*/ /*#__PURE__*/ API.make(() =>
4249
4252
  output: DeleteScriptDeploymentResponse,
4250
4253
  errors: [WorkerNotFound, DeploymentNotFound],
4251
4254
  }));
4252
- export const GetScriptScheduleRequest =
4253
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4254
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4255
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
4256
- }).pipe(T.Http({
4257
- method: "GET",
4258
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
4259
- }));
4260
- export const GetScriptScheduleResponse =
4261
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4262
- schedules: Schema.Array(Schema.Struct({
4263
- cron: Schema.String,
4264
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4265
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4266
- }).pipe(Schema.encodeKeys({
4267
- cron: "cron",
4268
- createdOn: "created_on",
4269
- modifiedOn: "modified_on",
4270
- }))),
4271
- }).pipe(T.ResponsePath("result"));
4272
- export const getScriptSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4273
- input: GetScriptScheduleRequest,
4274
- output: GetScriptScheduleResponse,
4275
- errors: [WorkerNotFound],
4276
- }));
4277
- export const PutScriptScheduleRequest =
4278
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4279
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4280
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
4281
- body: Schema.Array(Schema.Struct({
4282
- cron: Schema.String,
4283
- })).pipe(T.HttpBody()),
4284
- }).pipe(T.Http({
4285
- method: "PUT",
4286
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
4287
- }));
4288
- export const PutScriptScheduleResponse =
4289
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4290
- schedules: Schema.Array(Schema.Struct({
4291
- cron: Schema.String,
4292
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4293
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4294
- }).pipe(Schema.encodeKeys({
4295
- cron: "cron",
4296
- createdOn: "created_on",
4297
- modifiedOn: "modified_on",
4298
- }))),
4299
- }).pipe(T.ResponsePath("result"));
4300
- export const putScriptSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4301
- input: PutScriptScheduleRequest,
4302
- output: PutScriptScheduleResponse,
4303
- errors: [WorkerNotFound],
4304
- }));
4305
- export const GetScriptScriptAndVersionSettingRequest =
4255
+ export const CreateScriptEdgePreviewRequest =
4306
4256
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4307
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4308
4257
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
4309
- }).pipe(T.Http({
4310
- method: "GET",
4311
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
4312
- }));
4313
- export const GetScriptScriptAndVersionSettingResponse =
4314
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4315
- bindings: Schema.optional(Schema.Union([
4316
- Schema.Array(Schema.Union([
4258
+ scriptName: Schema.String.pipe(T.HttpPath("script_name")),
4259
+ cfPreviewUploadConfigToken: Schema.String.pipe(T.HttpHeader("cf-preview-upload-config-token")),
4260
+ metadata: Schema.optional(Schema.Struct({
4261
+ mainModule: Schema.optional(Schema.String),
4262
+ bodyPart: Schema.optional(Schema.String),
4263
+ compatibilityDate: Schema.optional(Schema.String),
4264
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
4265
+ usageModel: Schema.optional(Schema.Literals(["bundled", "unbound", "standard"])),
4266
+ bindings: Schema.optional(Schema.Array(Schema.Union([
4317
4267
  Schema.Struct({
4268
+ type: Schema.Literal("plain_text"),
4318
4269
  name: Schema.String,
4319
- type: Schema.Literal("ai"),
4270
+ text: Schema.String,
4320
4271
  }),
4321
4272
  Schema.Struct({
4322
- dataset: Schema.String,
4273
+ type: Schema.Literal("secret_text"),
4323
4274
  name: Schema.String,
4324
- type: Schema.Literal("analytics_engine"),
4275
+ text: Schema.String,
4325
4276
  }),
4326
4277
  Schema.Struct({
4278
+ type: Schema.Literal("json"),
4327
4279
  name: Schema.String,
4328
- type: Schema.Literal("assets"),
4280
+ json: Schema.Unknown,
4329
4281
  }),
4330
4282
  Schema.Struct({
4283
+ type: Schema.Literal("kv_namespace"),
4331
4284
  name: Schema.String,
4332
- type: Schema.Literal("browser"),
4333
- }),
4285
+ namespaceId: Schema.String,
4286
+ raw: Schema.optional(Schema.Boolean),
4287
+ }).pipe(Schema.encodeKeys({
4288
+ type: "type",
4289
+ name: "name",
4290
+ namespaceId: "namespace_id",
4291
+ raw: "raw",
4292
+ })),
4334
4293
  Schema.Struct({
4335
- id: Schema.String,
4294
+ type: Schema.Literal("durable_object_namespace"),
4336
4295
  name: Schema.String,
4337
- type: Schema.Literal("d1"),
4338
- }),
4296
+ className: Schema.String,
4297
+ scriptName: Schema.optional(Schema.String),
4298
+ environment: Schema.optional(Schema.String),
4299
+ namespaceId: Schema.optional(Schema.String),
4300
+ }).pipe(Schema.encodeKeys({
4301
+ type: "type",
4302
+ name: "name",
4303
+ className: "class_name",
4304
+ scriptName: "script_name",
4305
+ environment: "environment",
4306
+ namespaceId: "namespace_id",
4307
+ })),
4339
4308
  Schema.Struct({
4309
+ type: Schema.Literal("r2_bucket"),
4340
4310
  name: Schema.String,
4341
- part: Schema.String,
4342
- type: Schema.Literal("data_blob"),
4343
- }),
4311
+ bucketName: Schema.String,
4312
+ jurisdiction: Schema.optional(Schema.String),
4313
+ raw: Schema.optional(Schema.Boolean),
4314
+ }).pipe(Schema.encodeKeys({
4315
+ type: "type",
4316
+ name: "name",
4317
+ bucketName: "bucket_name",
4318
+ jurisdiction: "jurisdiction",
4319
+ raw: "raw",
4320
+ })),
4344
4321
  Schema.Struct({
4322
+ type: Schema.Literal("d1"),
4345
4323
  name: Schema.String,
4346
- namespace: Schema.String,
4347
- type: Schema.Literal("dispatch_namespace"),
4348
- outbound: Schema.optional(Schema.Union([
4349
- Schema.Struct({
4350
- params: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4351
- worker: Schema.optional(Schema.Union([
4352
- Schema.Struct({
4353
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4354
- service: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4355
- }),
4356
- Schema.Null,
4357
- ])),
4358
- }),
4359
- Schema.Null,
4360
- ])),
4324
+ id: Schema.String,
4325
+ raw: Schema.optional(Schema.Boolean),
4361
4326
  }),
4362
4327
  Schema.Struct({
4328
+ type: Schema.Literal("queue"),
4363
4329
  name: Schema.String,
4364
- type: Schema.Literal("durable_object_namespace"),
4365
- className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4366
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4367
- namespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4368
- scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4330
+ queueName: Schema.String,
4331
+ deliveryDelay: Schema.optional(Schema.Number),
4332
+ raw: Schema.optional(Schema.Boolean),
4369
4333
  }).pipe(Schema.encodeKeys({
4370
- name: "name",
4371
4334
  type: "type",
4372
- className: "class_name",
4373
- environment: "environment",
4374
- namespaceId: "namespace_id",
4375
- scriptName: "script_name",
4335
+ name: "name",
4336
+ queueName: "queue_name",
4337
+ deliveryDelay: "delivery_delay",
4338
+ raw: "raw",
4376
4339
  })),
4377
4340
  Schema.Struct({
4378
- id: Schema.String,
4341
+ type: Schema.Literal("service"),
4379
4342
  name: Schema.String,
4380
- type: Schema.Literal("hyperdrive"),
4343
+ service: Schema.String,
4344
+ environment: Schema.optional(Schema.String),
4345
+ entrypoint: Schema.optional(Schema.String),
4381
4346
  }),
4382
4347
  Schema.Struct({
4348
+ type: Schema.Literal("ai"),
4383
4349
  name: Schema.String,
4384
- type: Schema.Literal("inherit"),
4385
- oldName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4386
- versionId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4387
- }).pipe(Schema.encodeKeys({
4388
- name: "name",
4389
- type: "type",
4390
- oldName: "old_name",
4391
- versionId: "version_id",
4392
- })),
4350
+ staging: Schema.optional(Schema.Boolean),
4351
+ raw: Schema.optional(Schema.Boolean),
4352
+ }),
4393
4353
  Schema.Struct({
4354
+ type: Schema.Literal("browser"),
4394
4355
  name: Schema.String,
4395
- type: Schema.Literal("images"),
4356
+ raw: Schema.optional(Schema.Boolean),
4396
4357
  }),
4397
4358
  Schema.Struct({
4398
- json: Schema.String,
4359
+ type: Schema.Literal("images"),
4399
4360
  name: Schema.String,
4400
- type: Schema.Literal("json"),
4361
+ raw: Schema.optional(Schema.Boolean),
4401
4362
  }),
4402
4363
  Schema.Struct({
4364
+ type: Schema.Literal("vectorize"),
4403
4365
  name: Schema.String,
4404
- namespaceId: Schema.String,
4405
- type: Schema.Literal("kv_namespace"),
4366
+ indexName: Schema.String,
4367
+ raw: Schema.optional(Schema.Boolean),
4406
4368
  }).pipe(Schema.encodeKeys({
4407
- name: "name",
4408
- namespaceId: "namespace_id",
4409
4369
  type: "type",
4370
+ name: "name",
4371
+ indexName: "index_name",
4372
+ raw: "raw",
4410
4373
  })),
4411
4374
  Schema.Struct({
4412
- certificateId: Schema.String,
4375
+ type: Schema.Literal("workflow"),
4413
4376
  name: Schema.String,
4414
- type: Schema.Literal("mtls_certificate"),
4377
+ workflowName: Schema.String,
4378
+ className: Schema.String,
4379
+ scriptName: Schema.optional(Schema.String),
4380
+ raw: Schema.optional(Schema.Boolean),
4415
4381
  }).pipe(Schema.encodeKeys({
4416
- certificateId: "certificate_id",
4417
- name: "name",
4418
4382
  type: "type",
4383
+ name: "name",
4384
+ workflowName: "workflow_name",
4385
+ className: "class_name",
4386
+ scriptName: "script_name",
4387
+ raw: "raw",
4419
4388
  })),
4420
4389
  Schema.Struct({
4390
+ type: Schema.Literal("hyperdrive"),
4421
4391
  name: Schema.String,
4422
- text: Schema.String,
4423
- type: Schema.Literal("plain_text"),
4392
+ id: Schema.String,
4424
4393
  }),
4425
4394
  Schema.Struct({
4395
+ type: Schema.Literal("analytics_engine"),
4426
4396
  name: Schema.String,
4427
- pipeline: Schema.String,
4428
- type: Schema.Literal("pipelines"),
4397
+ dataset: Schema.optional(Schema.String),
4398
+ }),
4399
+ Schema.Struct({
4400
+ type: Schema.Literal("dispatch_namespace"),
4401
+ name: Schema.String,
4402
+ namespace: Schema.String,
4403
+ outbound: Schema.optional(Schema.Struct({
4404
+ worker: Schema.optional(Schema.Struct({
4405
+ service: Schema.optional(Schema.String),
4406
+ environment: Schema.optional(Schema.String),
4407
+ })),
4408
+ params: Schema.optional(Schema.Array(Schema.Struct({
4409
+ name: Schema.String,
4410
+ }))),
4411
+ })),
4429
4412
  }),
4430
4413
  Schema.Struct({
4414
+ type: Schema.Literal("send_email"),
4431
4415
  name: Schema.String,
4432
- queueName: Schema.String,
4433
- type: Schema.Literal("queue"),
4416
+ destinationAddress: Schema.optional(Schema.String),
4417
+ allowedDestinationAddresses: Schema.optional(Schema.Array(Schema.String)),
4418
+ allowedSenderAddresses: Schema.optional(Schema.Array(Schema.String)),
4434
4419
  }).pipe(Schema.encodeKeys({
4435
- name: "name",
4436
- queueName: "queue_name",
4437
4420
  type: "type",
4421
+ name: "name",
4422
+ destinationAddress: "destination_address",
4423
+ allowedDestinationAddresses: "allowed_destination_addresses",
4424
+ allowedSenderAddresses: "allowed_sender_addresses",
4438
4425
  })),
4439
4426
  Schema.Struct({
4440
- bucketName: Schema.String,
4427
+ type: Schema.Literal("mtls_certificate"),
4441
4428
  name: Schema.String,
4442
- type: Schema.Literal("r2_bucket"),
4443
- jurisdiction: Schema.optional(Schema.Union([Schema.Literals(["eu", "fedramp"]), Schema.Null])),
4429
+ certificateId: Schema.String,
4444
4430
  }).pipe(Schema.encodeKeys({
4445
- bucketName: "bucket_name",
4446
- name: "name",
4447
4431
  type: "type",
4448
- jurisdiction: "jurisdiction",
4432
+ name: "name",
4433
+ certificateId: "certificate_id",
4449
4434
  })),
4450
4435
  Schema.Struct({
4436
+ type: Schema.Literal("wasm_module"),
4451
4437
  name: Schema.String,
4452
- type: Schema.Literal("secret_text"),
4438
+ part: Schema.String,
4453
4439
  }),
4454
4440
  Schema.Struct({
4441
+ type: Schema.Literal("text_blob"),
4455
4442
  name: Schema.String,
4456
- type: Schema.Literal("send_email"),
4457
- allowedDestinationAddresses: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4458
- allowedSenderAddresses: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4459
- destinationAddress: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4460
- }).pipe(Schema.encodeKeys({
4461
- name: "name",
4462
- type: "type",
4463
- allowedDestinationAddresses: "allowed_destination_addresses",
4464
- allowedSenderAddresses: "allowed_sender_addresses",
4465
- destinationAddress: "destination_address",
4466
- })),
4443
+ part: Schema.String,
4444
+ }),
4467
4445
  Schema.Struct({
4446
+ type: Schema.Literal("data_blob"),
4468
4447
  name: Schema.String,
4469
- service: Schema.String,
4470
- type: Schema.Literal("service"),
4471
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4448
+ part: Schema.String,
4472
4449
  }),
4473
4450
  Schema.Struct({
4451
+ type: Schema.Literal("pipelines"),
4474
4452
  name: Schema.String,
4475
- part: Schema.String,
4476
- type: Schema.Literal("text_blob"),
4453
+ pipeline: Schema.String,
4477
4454
  }),
4478
4455
  Schema.Struct({
4479
- indexName: Schema.String,
4456
+ type: Schema.Literal("secrets_store_secret"),
4480
4457
  name: Schema.String,
4481
- type: Schema.Literal("vectorize"),
4458
+ storeId: Schema.String,
4459
+ secretName: Schema.String,
4482
4460
  }).pipe(Schema.encodeKeys({
4483
- indexName: "index_name",
4484
- name: "name",
4485
4461
  type: "type",
4486
- })),
4487
- Schema.Struct({
4488
- name: Schema.String,
4489
- type: Schema.Literal("version_metadata"),
4490
- }),
4491
- Schema.Struct({
4492
- name: Schema.String,
4493
- secretName: Schema.String,
4494
- storeId: Schema.String,
4495
- type: Schema.Literal("secrets_store_secret"),
4496
- }).pipe(Schema.encodeKeys({
4497
4462
  name: "name",
4498
- secretName: "secret_name",
4499
4463
  storeId: "store_id",
4500
- type: "type",
4501
- })),
4502
- Schema.Struct({
4503
- algorithm: Schema.Unknown,
4504
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
4505
- name: Schema.String,
4506
- type: Schema.Literal("secret_key"),
4507
- usages: Schema.Array(Schema.Literals([
4508
- "encrypt",
4509
- "decrypt",
4510
- "sign",
4511
- "verify",
4512
- "deriveKey",
4513
- "deriveBits",
4514
- "wrapKey",
4515
- "unwrapKey",
4516
- ])),
4517
- }),
4518
- Schema.Struct({
4519
- name: Schema.String,
4520
- type: Schema.Literal("workflow"),
4521
- workflowName: Schema.String,
4522
- className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4523
- scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4524
- }).pipe(Schema.encodeKeys({
4525
- name: "name",
4526
- type: "type",
4527
- workflowName: "workflow_name",
4528
- className: "class_name",
4529
- scriptName: "script_name",
4464
+ secretName: "secret_name",
4530
4465
  })),
4531
4466
  Schema.Struct({
4467
+ type: Schema.Literal("stream"),
4532
4468
  name: Schema.String,
4533
- part: Schema.String,
4534
- type: Schema.Literal("wasm_module"),
4535
- }),
4536
- Schema.Struct({
4537
- name: Schema.String,
4538
- type: Schema.Literal("worker_loader"),
4539
4469
  }),
4540
- ])),
4541
- Schema.Null,
4542
- ])),
4543
- compatibilityDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4544
- compatibilityFlags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4545
- limits: Schema.optional(Schema.Union([
4546
- Schema.Struct({
4547
- cpuMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
4548
- }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
4549
- Schema.Null,
4550
- ])),
4551
- logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4552
- observability: Schema.optional(Schema.Union([
4553
- Schema.Struct({
4554
- enabled: Schema.Boolean,
4555
- headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
4556
- logs: Schema.optional(Schema.Union([
4557
- Schema.Struct({
4558
- enabled: Schema.Boolean,
4559
- invocationLogs: Schema.Boolean,
4560
- destinations: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4561
- headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
4562
- persist: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4563
- }).pipe(Schema.encodeKeys({
4564
- enabled: "enabled",
4565
- invocationLogs: "invocation_logs",
4566
- destinations: "destinations",
4567
- headSamplingRate: "head_sampling_rate",
4568
- persist: "persist",
4569
- })),
4570
- Schema.Null,
4571
- ])),
4572
- }).pipe(Schema.encodeKeys({
4573
- enabled: "enabled",
4574
- headSamplingRate: "head_sampling_rate",
4575
- logs: "logs",
4576
- })),
4577
- Schema.Null,
4578
- ])),
4579
- placement: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
4580
- tags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4581
- tailConsumers: Schema.optional(Schema.Union([
4582
- Schema.Array(Schema.Struct({
4583
- service: Schema.String,
4584
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4585
- namespace: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4586
- })),
4587
- Schema.Null,
4588
- ])),
4589
- usageModel: Schema.optional(Schema.Union([
4590
- Schema.Literals(["standard", "bundled", "unbound"]),
4591
- Schema.Null,
4592
- ])),
4593
- })
4594
- .pipe(Schema.encodeKeys({
4595
- bindings: "bindings",
4596
- compatibilityDate: "compatibility_date",
4597
- compatibilityFlags: "compatibility_flags",
4598
- limits: "limits",
4599
- logpush: "logpush",
4600
- observability: "observability",
4601
- placement: "placement",
4602
- tags: "tags",
4603
- tailConsumers: "tail_consumers",
4604
- usageModel: "usage_model",
4605
- }))
4606
- .pipe(T.ResponsePath("result"));
4607
- export const getScriptScriptAndVersionSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4608
- input: GetScriptScriptAndVersionSettingRequest,
4609
- output: GetScriptScriptAndVersionSettingResponse,
4610
- errors: [WorkerNotFound],
4611
- }));
4612
- export const PatchScriptScriptAndVersionSettingRequest =
4613
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4614
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4615
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
4616
- settings: Schema.optional(Schema.Struct({
4617
- bindings: Schema.optional(Schema.Array(Schema.Union([
4618
4470
  Schema.Struct({
4471
+ type: Schema.Literal("media"),
4619
4472
  name: Schema.String,
4620
- type: Schema.Literal("ai"),
4621
4473
  }),
4622
4474
  Schema.Struct({
4623
- dataset: Schema.String,
4475
+ type: Schema.Literal("version_metadata"),
4624
4476
  name: Schema.String,
4625
- type: Schema.Literal("analytics_engine"),
4626
4477
  }),
4627
4478
  Schema.Struct({
4628
- name: Schema.String,
4629
4479
  type: Schema.Literal("assets"),
4630
- }),
4631
- Schema.Struct({
4632
4480
  name: Schema.String,
4633
- type: Schema.Literal("browser"),
4634
4481
  }),
4635
4482
  Schema.Struct({
4636
- id: Schema.String,
4483
+ type: Schema.Literal("worker_loader"),
4637
4484
  name: Schema.String,
4638
- type: Schema.Literal("d1"),
4639
4485
  }),
4640
4486
  Schema.Struct({
4487
+ type: Schema.Literal("logfwdr"),
4641
4488
  name: Schema.String,
4642
- part: Schema.String,
4643
- type: Schema.Literal("data_blob"),
4489
+ destination: Schema.String,
4644
4490
  }),
4645
4491
  Schema.Struct({
4492
+ type: Schema.Literal("ai_search_namespace"),
4646
4493
  name: Schema.String,
4647
4494
  namespace: Schema.String,
4648
- type: Schema.Literal("dispatch_namespace"),
4649
- outbound: Schema.optional(Schema.Struct({
4650
- params: Schema.optional(Schema.Array(Schema.String)),
4651
- worker: Schema.optional(Schema.Struct({
4652
- environment: Schema.optional(Schema.String),
4653
- service: Schema.optional(Schema.String),
4654
- })),
4655
- })),
4656
4495
  }),
4657
4496
  Schema.Struct({
4497
+ type: Schema.Literal("ai_search"),
4658
4498
  name: Schema.String,
4659
- type: Schema.Literal("durable_object_namespace"),
4660
- className: Schema.optional(Schema.String),
4661
- environment: Schema.optional(Schema.String),
4662
- namespaceId: Schema.optional(Schema.String),
4663
- scriptName: Schema.optional(Schema.String),
4499
+ instanceName: Schema.String,
4664
4500
  }).pipe(Schema.encodeKeys({
4665
- name: "name",
4666
4501
  type: "type",
4667
- className: "class_name",
4668
- environment: "environment",
4669
- namespaceId: "namespace_id",
4670
- scriptName: "script_name",
4671
- })),
4672
- Schema.Struct({
4673
- id: Schema.String,
4674
- name: Schema.String,
4675
- type: Schema.Literal("hyperdrive"),
4676
- }),
4677
- Schema.Struct({
4678
- name: Schema.String,
4679
- type: Schema.Literal("inherit"),
4680
- oldName: Schema.optional(Schema.String),
4681
- versionId: Schema.optional(Schema.String),
4682
- }).pipe(Schema.encodeKeys({
4683
4502
  name: "name",
4684
- type: "type",
4685
- oldName: "old_name",
4686
- versionId: "version_id",
4503
+ instanceName: "instance_name",
4687
4504
  })),
4688
4505
  Schema.Struct({
4689
- name: Schema.String,
4690
- type: Schema.Literal("images"),
4691
- }),
4692
- Schema.Struct({
4693
- json: Schema.String,
4694
- name: Schema.String,
4695
- type: Schema.Literal("json"),
4696
- }),
4697
- Schema.Struct({
4506
+ type: Schema.Literal("ratelimit"),
4698
4507
  name: Schema.String,
4699
4508
  namespaceId: Schema.String,
4700
- type: Schema.Literal("kv_namespace"),
4509
+ simple: Schema.Struct({
4510
+ limit: Schema.Number,
4511
+ period: Schema.Literals(["10", "60"]),
4512
+ }),
4701
4513
  }).pipe(Schema.encodeKeys({
4514
+ type: "type",
4702
4515
  name: "name",
4703
4516
  namespaceId: "namespace_id",
4704
- type: "type",
4517
+ simple: "simple",
4705
4518
  })),
4706
4519
  Schema.Struct({
4707
- certificateId: Schema.String,
4520
+ type: Schema.Literal("inherit"),
4708
4521
  name: Schema.String,
4709
- type: Schema.Literal("mtls_certificate"),
4522
+ }),
4523
+ ]))),
4524
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
4525
+ migrations: Schema.optional(Schema.Struct({
4526
+ oldTag: Schema.optional(Schema.String),
4527
+ newTag: Schema.optional(Schema.String),
4528
+ steps: Schema.optional(Schema.Array(Schema.Struct({
4529
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
4530
+ newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
4531
+ renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
4532
+ from: Schema.optional(Schema.String),
4533
+ to: Schema.optional(Schema.String),
4534
+ }))),
4535
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
4710
4536
  }).pipe(Schema.encodeKeys({
4711
- certificateId: "certificate_id",
4712
- name: "name",
4713
- type: "type",
4714
- })),
4537
+ newClasses: "new_classes",
4538
+ newSqliteClasses: "new_sqlite_classes",
4539
+ renamedClasses: "renamed_classes",
4540
+ deletedClasses: "deleted_classes",
4541
+ })))),
4542
+ }).pipe(Schema.encodeKeys({
4543
+ oldTag: "old_tag",
4544
+ newTag: "new_tag",
4545
+ steps: "steps",
4546
+ }))),
4547
+ capnpSchema: Schema.optional(Schema.String),
4548
+ logpush: Schema.optional(Schema.Boolean),
4549
+ placement: Schema.optional(Schema.Union([
4715
4550
  Schema.Struct({
4716
- name: Schema.String,
4717
- text: Schema.String,
4718
- type: Schema.Literal("plain_text"),
4551
+ mode: Schema.Literal("smart"),
4552
+ hint: Schema.optional(Schema.String),
4719
4553
  }),
4720
4554
  Schema.Struct({
4721
- name: Schema.String,
4722
- pipeline: Schema.String,
4723
- type: Schema.Literal("pipelines"),
4555
+ region: Schema.String,
4724
4556
  }),
4725
4557
  Schema.Struct({
4726
- name: Schema.String,
4727
- queueName: Schema.String,
4728
- type: Schema.Literal("queue"),
4729
- }).pipe(Schema.encodeKeys({
4730
- name: "name",
4731
- queueName: "queue_name",
4732
- type: "type",
4733
- })),
4734
- Schema.Struct({
4735
- bucketName: Schema.String,
4736
- name: Schema.String,
4737
- type: Schema.Literal("r2_bucket"),
4738
- jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
4739
- }).pipe(Schema.encodeKeys({
4740
- bucketName: "bucket_name",
4741
- name: "name",
4742
- type: "type",
4743
- jurisdiction: "jurisdiction",
4744
- })),
4745
- Schema.Struct({
4746
- name: Schema.String,
4747
- text: Schema.String,
4748
- type: Schema.Literal("secret_text"),
4558
+ host: Schema.String,
4749
4559
  }),
4750
4560
  Schema.Struct({
4751
- name: Schema.String,
4752
- type: Schema.Literal("send_email"),
4753
- allowedDestinationAddresses: Schema.optional(Schema.Array(Schema.String)),
4754
- allowedSenderAddresses: Schema.optional(Schema.Array(Schema.String)),
4755
- destinationAddress: Schema.optional(Schema.String),
4561
+ hostname: Schema.String,
4562
+ }),
4563
+ ])),
4564
+ tailConsumers: Schema.optional(Schema.Array(Schema.Struct({
4565
+ service: Schema.String,
4566
+ environment: Schema.optional(Schema.String),
4567
+ }))),
4568
+ streamingTailConsumers: Schema.optional(Schema.Array(Schema.Struct({
4569
+ service: Schema.String,
4570
+ environment: Schema.optional(Schema.String),
4571
+ }))),
4572
+ limits: Schema.optional(Schema.Struct({
4573
+ cpuMs: Schema.optional(Schema.Number),
4574
+ subrequests: Schema.optional(Schema.Number),
4575
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms", subrequests: "subrequests" }))),
4576
+ assets: Schema.optional(Schema.Struct({
4577
+ jwt: Schema.optional(Schema.String),
4578
+ config: Schema.optional(Schema.Struct({
4579
+ htmlHandling: Schema.optional(Schema.Literals([
4580
+ "auto-trailing-slash",
4581
+ "force-trailing-slash",
4582
+ "drop-trailing-slash",
4583
+ "none",
4584
+ ])),
4585
+ notFoundHandling: Schema.optional(Schema.Literals([
4586
+ "single-page-application",
4587
+ "404-page",
4588
+ "none",
4589
+ ])),
4590
+ runWorkerFirst: Schema.optional(Schema.Union([Schema.Boolean, Schema.Array(Schema.String)])),
4591
+ redirects: Schema.optional(Schema.String),
4592
+ headers: Schema.optional(Schema.String),
4756
4593
  }).pipe(Schema.encodeKeys({
4757
- name: "name",
4758
- type: "type",
4759
- allowedDestinationAddresses: "allowed_destination_addresses",
4760
- allowedSenderAddresses: "allowed_sender_addresses",
4761
- destinationAddress: "destination_address",
4762
- })),
4594
+ htmlHandling: "html_handling",
4595
+ notFoundHandling: "not_found_handling",
4596
+ runWorkerFirst: "run_worker_first",
4597
+ redirects: "_redirects",
4598
+ headers: "_headers",
4599
+ }))),
4600
+ })),
4601
+ observability: Schema.optional(Schema.Struct({
4602
+ enabled: Schema.optional(Schema.Boolean),
4603
+ headSamplingRate: Schema.optional(Schema.Number),
4604
+ logs: Schema.optional(Schema.Struct({
4605
+ enabled: Schema.optional(Schema.Boolean),
4606
+ headSamplingRate: Schema.optional(Schema.Number),
4607
+ invocationLogs: Schema.optional(Schema.Boolean),
4608
+ persist: Schema.optional(Schema.Boolean),
4609
+ destinations: Schema.optional(Schema.Array(Schema.String)),
4610
+ }).pipe(Schema.encodeKeys({
4611
+ enabled: "enabled",
4612
+ headSamplingRate: "head_sampling_rate",
4613
+ invocationLogs: "invocation_logs",
4614
+ persist: "persist",
4615
+ destinations: "destinations",
4616
+ }))),
4617
+ traces: Schema.optional(Schema.Struct({
4618
+ enabled: Schema.optional(Schema.Boolean),
4619
+ headSamplingRate: Schema.optional(Schema.Number),
4620
+ persist: Schema.optional(Schema.Boolean),
4621
+ destinations: Schema.optional(Schema.Array(Schema.String)),
4622
+ }).pipe(Schema.encodeKeys({
4623
+ enabled: "enabled",
4624
+ headSamplingRate: "head_sampling_rate",
4625
+ persist: "persist",
4626
+ destinations: "destinations",
4627
+ }))),
4628
+ }).pipe(Schema.encodeKeys({
4629
+ enabled: "enabled",
4630
+ headSamplingRate: "head_sampling_rate",
4631
+ logs: "logs",
4632
+ traces: "traces",
4633
+ }))),
4634
+ containers: Schema.optional(Schema.Array(Schema.Struct({
4635
+ className: Schema.String,
4636
+ }).pipe(Schema.encodeKeys({ className: "class_name" })))),
4637
+ annotations: Schema.optional(Schema.Unknown),
4638
+ keepAssets: Schema.optional(Schema.Boolean),
4639
+ tags: Schema.optional(Schema.Array(Schema.String)),
4640
+ }).pipe(Schema.encodeKeys({
4641
+ mainModule: "main_module",
4642
+ bodyPart: "body_part",
4643
+ compatibilityDate: "compatibility_date",
4644
+ compatibilityFlags: "compatibility_flags",
4645
+ usageModel: "usage_model",
4646
+ bindings: "bindings",
4647
+ keepBindings: "keep_bindings",
4648
+ migrations: "migrations",
4649
+ capnpSchema: "capnp_schema",
4650
+ logpush: "logpush",
4651
+ placement: "placement",
4652
+ tailConsumers: "tail_consumers",
4653
+ streamingTailConsumers: "streaming_tail_consumers",
4654
+ limits: "limits",
4655
+ assets: "assets",
4656
+ observability: "observability",
4657
+ containers: "containers",
4658
+ annotations: "annotations",
4659
+ keepAssets: "keep_assets",
4660
+ tags: "tags",
4661
+ }))),
4662
+ files: Schema.optional(Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile()))),
4663
+ wranglerSessionConfig: Schema.optional(Schema.Union([
4664
+ Schema.Struct({
4665
+ workersDev: Schema.Literal(true),
4666
+ minimalMode: Schema.optional(Schema.Boolean),
4667
+ }).pipe(Schema.encodeKeys({
4668
+ workersDev: "workers_dev",
4669
+ minimalMode: "minimal_mode",
4670
+ })),
4671
+ Schema.Struct({
4672
+ routes: Schema.Array(Schema.String),
4673
+ minimalMode: Schema.optional(Schema.Boolean),
4674
+ }).pipe(Schema.encodeKeys({ routes: "routes", minimalMode: "minimal_mode" })),
4675
+ ])),
4676
+ }).pipe(Schema.encodeKeys({
4677
+ metadata: "metadata",
4678
+ files: "files",
4679
+ wranglerSessionConfig: "wrangler-session-config",
4680
+ }), T.Http({
4681
+ method: "POST",
4682
+ path: "/accounts/{account_id}/workers/scripts/{script_name}/edge-preview",
4683
+ contentType: "multipart",
4684
+ }));
4685
+ export const CreateScriptEdgePreviewResponse =
4686
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4687
+ previewToken: Schema.String,
4688
+ tailUrl: Schema.String,
4689
+ })
4690
+ .pipe(Schema.encodeKeys({ previewToken: "preview_token", tailUrl: "tail_url" }))
4691
+ .pipe(T.ResponsePath("result"));
4692
+ export const createScriptEdgePreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4693
+ input: CreateScriptEdgePreviewRequest,
4694
+ output: CreateScriptEdgePreviewResponse,
4695
+ errors: [InvalidRoute],
4696
+ }));
4697
+ export const GetScriptScheduleRequest =
4698
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4699
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4700
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4701
+ }).pipe(T.Http({
4702
+ method: "GET",
4703
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
4704
+ }));
4705
+ export const GetScriptScheduleResponse =
4706
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4707
+ schedules: Schema.Array(Schema.Struct({
4708
+ cron: Schema.String,
4709
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4710
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4711
+ }).pipe(Schema.encodeKeys({
4712
+ cron: "cron",
4713
+ createdOn: "created_on",
4714
+ modifiedOn: "modified_on",
4715
+ }))),
4716
+ }).pipe(T.ResponsePath("result"));
4717
+ export const getScriptSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4718
+ input: GetScriptScheduleRequest,
4719
+ output: GetScriptScheduleResponse,
4720
+ errors: [WorkerNotFound],
4721
+ }));
4722
+ export const PutScriptScheduleRequest =
4723
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4724
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4725
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4726
+ body: Schema.Array(Schema.Struct({
4727
+ cron: Schema.String,
4728
+ })).pipe(T.HttpBody()),
4729
+ }).pipe(T.Http({
4730
+ method: "PUT",
4731
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/schedules",
4732
+ }));
4733
+ export const PutScriptScheduleResponse =
4734
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4735
+ schedules: Schema.Array(Schema.Struct({
4736
+ cron: Schema.String,
4737
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4738
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4739
+ }).pipe(Schema.encodeKeys({
4740
+ cron: "cron",
4741
+ createdOn: "created_on",
4742
+ modifiedOn: "modified_on",
4743
+ }))),
4744
+ }).pipe(T.ResponsePath("result"));
4745
+ export const putScriptSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4746
+ input: PutScriptScheduleRequest,
4747
+ output: PutScriptScheduleResponse,
4748
+ errors: [WorkerNotFound],
4749
+ }));
4750
+ export const GetScriptScriptAndVersionSettingRequest =
4751
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4752
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
4753
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4754
+ }).pipe(T.Http({
4755
+ method: "GET",
4756
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
4757
+ }));
4758
+ export const GetScriptScriptAndVersionSettingResponse =
4759
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4760
+ bindings: Schema.optional(Schema.Union([
4761
+ Schema.Array(Schema.Union([
4763
4762
  Schema.Struct({
4764
4763
  name: Schema.String,
4765
- service: Schema.String,
4766
- type: Schema.Literal("service"),
4767
- environment: Schema.optional(Schema.String),
4764
+ type: Schema.Literal("ai"),
4768
4765
  }),
4769
4766
  Schema.Struct({
4767
+ dataset: Schema.String,
4770
4768
  name: Schema.String,
4771
- part: Schema.String,
4772
- type: Schema.Literal("text_blob"),
4769
+ type: Schema.Literal("analytics_engine"),
4773
4770
  }),
4774
4771
  Schema.Struct({
4775
- indexName: Schema.String,
4776
4772
  name: Schema.String,
4777
- type: Schema.Literal("vectorize"),
4778
- }).pipe(Schema.encodeKeys({
4779
- indexName: "index_name",
4780
- name: "name",
4781
- type: "type",
4782
- })),
4773
+ type: Schema.Literal("assets"),
4774
+ }),
4783
4775
  Schema.Struct({
4784
4776
  name: Schema.String,
4785
- type: Schema.Literal("version_metadata"),
4777
+ type: Schema.Literal("browser"),
4786
4778
  }),
4787
4779
  Schema.Struct({
4780
+ id: Schema.String,
4788
4781
  name: Schema.String,
4789
- secretName: Schema.String,
4790
- storeId: Schema.String,
4791
- type: Schema.Literal("secrets_store_secret"),
4792
- }).pipe(Schema.encodeKeys({
4793
- name: "name",
4794
- secretName: "secret_name",
4795
- storeId: "store_id",
4796
- type: "type",
4797
- })),
4782
+ type: Schema.Literal("d1"),
4783
+ }),
4798
4784
  Schema.Struct({
4799
- algorithm: Schema.Unknown,
4800
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
4801
4785
  name: Schema.String,
4802
- type: Schema.Literal("secret_key"),
4803
- usages: Schema.Array(Schema.Literals([
4804
- "encrypt",
4805
- "decrypt",
4806
- "sign",
4807
- "verify",
4808
- "deriveKey",
4809
- "deriveBits",
4810
- "wrapKey",
4811
- "unwrapKey",
4786
+ part: Schema.String,
4787
+ type: Schema.Literal("data_blob"),
4788
+ }),
4789
+ Schema.Struct({
4790
+ name: Schema.String,
4791
+ namespace: Schema.String,
4792
+ type: Schema.Literal("dispatch_namespace"),
4793
+ outbound: Schema.optional(Schema.Union([
4794
+ Schema.Struct({
4795
+ params: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4796
+ worker: Schema.optional(Schema.Union([
4797
+ Schema.Struct({
4798
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4799
+ service: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4800
+ }),
4801
+ Schema.Null,
4802
+ ])),
4803
+ }),
4804
+ Schema.Null,
4812
4805
  ])),
4813
- keyBase64: Schema.optional(Schema.String),
4814
- keyJwk: Schema.optional(Schema.Unknown),
4815
- }).pipe(Schema.encodeKeys({
4816
- algorithm: "algorithm",
4817
- format: "format",
4818
- name: "name",
4819
- type: "type",
4820
- usages: "usages",
4821
- keyBase64: "key_base64",
4822
- keyJwk: "key_jwk",
4823
- })),
4806
+ }),
4824
4807
  Schema.Struct({
4825
4808
  name: Schema.String,
4826
- type: Schema.Literal("workflow"),
4827
- workflowName: Schema.String,
4828
- className: Schema.optional(Schema.String),
4829
- scriptName: Schema.optional(Schema.String),
4809
+ type: Schema.Literal("durable_object_namespace"),
4810
+ className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4811
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4812
+ namespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4813
+ scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4830
4814
  }).pipe(Schema.encodeKeys({
4831
4815
  name: "name",
4832
4816
  type: "type",
4833
- workflowName: "workflow_name",
4834
4817
  className: "class_name",
4818
+ environment: "environment",
4819
+ namespaceId: "namespace_id",
4835
4820
  scriptName: "script_name",
4836
4821
  })),
4837
4822
  Schema.Struct({
4823
+ id: Schema.String,
4838
4824
  name: Schema.String,
4839
- part: Schema.String,
4840
- type: Schema.Literal("wasm_module"),
4841
- }),
4842
- Schema.Struct({
4843
- name: Schema.String,
4844
- type: Schema.Literal("worker_loader"),
4845
- }),
4846
- ]))),
4847
- compatibilityDate: Schema.optional(Schema.String),
4848
- compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
4849
- limits: Schema.optional(Schema.Struct({
4850
- cpuMs: Schema.optional(Schema.Number),
4851
- }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" }))),
4852
- logpush: Schema.optional(Schema.Boolean),
4853
- migrations: Schema.optional(Schema.Union([
4854
- Schema.Struct({
4855
- deletedClasses: Schema.optional(Schema.Array(Schema.String)),
4856
- newClasses: Schema.optional(Schema.Array(Schema.String)),
4857
- newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
4858
- newTag: Schema.optional(Schema.String),
4859
- oldTag: Schema.optional(Schema.String),
4860
- renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
4861
- from: Schema.optional(Schema.String),
4862
- to: Schema.optional(Schema.String),
4863
- }))),
4864
- transferredClasses: Schema.optional(Schema.Array(Schema.Struct({
4865
- from: Schema.optional(Schema.String),
4866
- fromScript: Schema.optional(Schema.String),
4867
- to: Schema.optional(Schema.String),
4868
- }).pipe(Schema.encodeKeys({
4869
- from: "from",
4870
- fromScript: "from_script",
4871
- to: "to",
4872
- })))),
4873
- }).pipe(Schema.encodeKeys({
4874
- deletedClasses: "deleted_classes",
4875
- newClasses: "new_classes",
4876
- newSqliteClasses: "new_sqlite_classes",
4877
- newTag: "new_tag",
4878
- oldTag: "old_tag",
4879
- renamedClasses: "renamed_classes",
4880
- transferredClasses: "transferred_classes",
4881
- })),
4882
- Schema.Struct({
4883
- newTag: Schema.optional(Schema.String),
4884
- oldTag: Schema.optional(Schema.String),
4885
- steps: Schema.optional(Schema.Array(Schema.Struct({
4886
- deletedClasses: Schema.optional(Schema.Array(Schema.String)),
4887
- newClasses: Schema.optional(Schema.Array(Schema.String)),
4888
- newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
4889
- renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
4890
- from: Schema.optional(Schema.String),
4891
- to: Schema.optional(Schema.String),
4892
- }))),
4893
- transferredClasses: Schema.optional(Schema.Array(Schema.Struct({
4894
- from: Schema.optional(Schema.String),
4895
- fromScript: Schema.optional(Schema.String),
4896
- to: Schema.optional(Schema.String),
4897
- }).pipe(Schema.encodeKeys({
4898
- from: "from",
4899
- fromScript: "from_script",
4900
- to: "to",
4901
- })))),
4902
- }).pipe(Schema.encodeKeys({
4903
- deletedClasses: "deleted_classes",
4904
- newClasses: "new_classes",
4905
- newSqliteClasses: "new_sqlite_classes",
4906
- renamedClasses: "renamed_classes",
4907
- transferredClasses: "transferred_classes",
4908
- })))),
4909
- }).pipe(Schema.encodeKeys({
4910
- newTag: "new_tag",
4911
- oldTag: "old_tag",
4912
- steps: "steps",
4913
- })),
4914
- ])),
4915
- observability: Schema.optional(Schema.Struct({
4916
- enabled: Schema.Boolean,
4917
- headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
4918
- logs: Schema.optional(Schema.Union([
4919
- Schema.Struct({
4920
- enabled: Schema.Boolean,
4921
- invocationLogs: Schema.Boolean,
4922
- destinations: Schema.optional(Schema.Array(Schema.String)),
4923
- headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
4924
- persist: Schema.optional(Schema.Boolean),
4925
- }).pipe(Schema.encodeKeys({
4926
- enabled: "enabled",
4927
- invocationLogs: "invocation_logs",
4928
- destinations: "destinations",
4929
- headSamplingRate: "head_sampling_rate",
4930
- persist: "persist",
4931
- })),
4932
- Schema.Null,
4933
- ])),
4934
- }).pipe(Schema.encodeKeys({
4935
- enabled: "enabled",
4936
- headSamplingRate: "head_sampling_rate",
4937
- logs: "logs",
4938
- }))),
4939
- placement: Schema.optional(Schema.Union([
4940
- Schema.Struct({
4941
- mode: Schema.Literal("smart"),
4942
- }),
4943
- Schema.Struct({
4944
- region: Schema.String,
4945
- }),
4946
- Schema.Struct({
4947
- hostname: Schema.String,
4948
- }),
4949
- Schema.Struct({
4950
- host: Schema.String,
4951
- }),
4952
- ])),
4953
- tags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
4954
- tailConsumers: Schema.optional(Schema.Union([
4955
- Schema.Array(Schema.Struct({
4956
- service: Schema.String,
4957
- environment: Schema.optional(Schema.String),
4958
- namespace: Schema.optional(Schema.String),
4959
- })),
4960
- Schema.Null,
4961
- ])),
4962
- usageModel: Schema.optional(Schema.Literals(["standard", "bundled", "unbound"])),
4963
- }).pipe(Schema.encodeKeys({
4964
- bindings: "bindings",
4965
- compatibilityDate: "compatibility_date",
4966
- compatibilityFlags: "compatibility_flags",
4967
- limits: "limits",
4968
- logpush: "logpush",
4969
- migrations: "migrations",
4970
- observability: "observability",
4971
- placement: "placement",
4972
- tags: "tags",
4973
- tailConsumers: "tail_consumers",
4974
- usageModel: "usage_model",
4975
- }))),
4976
- }).pipe(T.Http({
4977
- method: "PATCH",
4978
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
4979
- contentType: "multipart",
4980
- }));
4981
- export const PatchScriptScriptAndVersionSettingResponse =
4982
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4983
- bindings: Schema.optional(Schema.Union([
4984
- Schema.Array(Schema.Union([
4985
- Schema.Struct({
4986
- name: Schema.String,
4987
- type: Schema.Literal("ai"),
4988
- }),
4989
- Schema.Struct({
4990
- dataset: Schema.String,
4991
- name: Schema.String,
4992
- type: Schema.Literal("analytics_engine"),
4993
- }),
4994
- Schema.Struct({
4995
- name: Schema.String,
4996
- type: Schema.Literal("assets"),
4997
- }),
4998
- Schema.Struct({
4999
- name: Schema.String,
5000
- type: Schema.Literal("browser"),
5001
- }),
5002
- Schema.Struct({
5003
- id: Schema.String,
5004
- name: Schema.String,
5005
- type: Schema.Literal("d1"),
5006
- }),
5007
- Schema.Struct({
5008
- name: Schema.String,
5009
- part: Schema.String,
5010
- type: Schema.Literal("data_blob"),
5011
- }),
5012
- Schema.Struct({
5013
- name: Schema.String,
5014
- namespace: Schema.String,
5015
- type: Schema.Literal("dispatch_namespace"),
5016
- outbound: Schema.optional(Schema.Union([
5017
- Schema.Struct({
5018
- params: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5019
- worker: Schema.optional(Schema.Union([
5020
- Schema.Struct({
5021
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5022
- service: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5023
- }),
5024
- Schema.Null,
5025
- ])),
5026
- }),
5027
- Schema.Null,
5028
- ])),
5029
- }),
5030
- Schema.Struct({
5031
- name: Schema.String,
5032
- type: Schema.Literal("durable_object_namespace"),
5033
- className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5034
- environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5035
- namespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5036
- scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5037
- }).pipe(Schema.encodeKeys({
5038
- name: "name",
5039
- type: "type",
5040
- className: "class_name",
5041
- environment: "environment",
5042
- namespaceId: "namespace_id",
5043
- scriptName: "script_name",
5044
- })),
5045
- Schema.Struct({
5046
- id: Schema.String,
5047
- name: Schema.String,
5048
- type: Schema.Literal("hyperdrive"),
4825
+ type: Schema.Literal("hyperdrive"),
5049
4826
  }),
5050
4827
  Schema.Struct({
5051
4828
  name: Schema.String,
@@ -5272,58 +5049,726 @@ export const PatchScriptScriptAndVersionSettingResponse =
5272
5049
  usageModel: "usage_model",
5273
5050
  }))
5274
5051
  .pipe(T.ResponsePath("result"));
5275
- export const patchScriptScriptAndVersionSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
5276
- input: PatchScriptScriptAndVersionSettingRequest,
5277
- output: PatchScriptScriptAndVersionSettingResponse,
5278
- errors: [WorkerNotFound, ContentTypeRequired],
5279
- }));
5280
- export const GetScriptSecretRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5281
- scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
5282
- secretName: Schema.String.pipe(T.HttpPath("secretName")),
5283
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
5284
- urlEncoded: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("url_encoded")),
5285
- }).pipe(T.Http({
5286
- method: "GET",
5287
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/secrets/{secretName}",
5288
- }));
5289
- export const GetScriptSecretResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
5290
- Schema.Struct({
5291
- name: Schema.String,
5292
- type: Schema.Literal("secret_text"),
5293
- }),
5294
- Schema.Struct({
5295
- algorithm: Schema.Unknown,
5296
- format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
5297
- name: Schema.String,
5298
- type: Schema.Literal("secret_key"),
5299
- usages: Schema.Array(Schema.Literals([
5300
- "encrypt",
5301
- "decrypt",
5302
- "sign",
5303
- "verify",
5304
- "deriveKey",
5305
- "deriveBits",
5306
- "wrapKey",
5307
- "unwrapKey",
5308
- ])),
5309
- }),
5310
- ]).pipe(T.ResponsePath("result"));
5311
- export const getScriptSecret = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
5312
- input: GetScriptSecretRequest,
5313
- output: GetScriptSecretResponse,
5314
- errors: [WorkerNotFound, SecretNotFound],
5052
+ export const getScriptScriptAndVersionSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
5053
+ input: GetScriptScriptAndVersionSettingRequest,
5054
+ output: GetScriptScriptAndVersionSettingResponse,
5055
+ errors: [WorkerNotFound],
5315
5056
  }));
5316
- export const ListScriptSecretsRequest =
5057
+ export const PatchScriptScriptAndVersionSettingRequest =
5317
5058
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5318
5059
  scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
5319
5060
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
5320
- }).pipe(T.Http({
5321
- method: "GET",
5322
- path: "/accounts/{account_id}/workers/scripts/{scriptName}/secrets",
5323
- }));
5324
- export const ListScriptSecretsResponse =
5325
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5326
- result: Schema.Array(Schema.Union([
5061
+ settings: Schema.optional(Schema.Struct({
5062
+ bindings: Schema.optional(Schema.Array(Schema.Union([
5063
+ Schema.Struct({
5064
+ name: Schema.String,
5065
+ type: Schema.Literal("ai"),
5066
+ }),
5067
+ Schema.Struct({
5068
+ dataset: Schema.String,
5069
+ name: Schema.String,
5070
+ type: Schema.Literal("analytics_engine"),
5071
+ }),
5072
+ Schema.Struct({
5073
+ name: Schema.String,
5074
+ type: Schema.Literal("assets"),
5075
+ }),
5076
+ Schema.Struct({
5077
+ name: Schema.String,
5078
+ type: Schema.Literal("browser"),
5079
+ }),
5080
+ Schema.Struct({
5081
+ id: Schema.String,
5082
+ name: Schema.String,
5083
+ type: Schema.Literal("d1"),
5084
+ }),
5085
+ Schema.Struct({
5086
+ name: Schema.String,
5087
+ part: Schema.String,
5088
+ type: Schema.Literal("data_blob"),
5089
+ }),
5090
+ Schema.Struct({
5091
+ name: Schema.String,
5092
+ namespace: Schema.String,
5093
+ type: Schema.Literal("dispatch_namespace"),
5094
+ outbound: Schema.optional(Schema.Struct({
5095
+ params: Schema.optional(Schema.Array(Schema.String)),
5096
+ worker: Schema.optional(Schema.Struct({
5097
+ environment: Schema.optional(Schema.String),
5098
+ service: Schema.optional(Schema.String),
5099
+ })),
5100
+ })),
5101
+ }),
5102
+ Schema.Struct({
5103
+ name: Schema.String,
5104
+ type: Schema.Literal("durable_object_namespace"),
5105
+ className: Schema.optional(Schema.String),
5106
+ environment: Schema.optional(Schema.String),
5107
+ namespaceId: Schema.optional(Schema.String),
5108
+ scriptName: Schema.optional(Schema.String),
5109
+ }).pipe(Schema.encodeKeys({
5110
+ name: "name",
5111
+ type: "type",
5112
+ className: "class_name",
5113
+ environment: "environment",
5114
+ namespaceId: "namespace_id",
5115
+ scriptName: "script_name",
5116
+ })),
5117
+ Schema.Struct({
5118
+ id: Schema.String,
5119
+ name: Schema.String,
5120
+ type: Schema.Literal("hyperdrive"),
5121
+ }),
5122
+ Schema.Struct({
5123
+ name: Schema.String,
5124
+ type: Schema.Literal("inherit"),
5125
+ oldName: Schema.optional(Schema.String),
5126
+ versionId: Schema.optional(Schema.String),
5127
+ }).pipe(Schema.encodeKeys({
5128
+ name: "name",
5129
+ type: "type",
5130
+ oldName: "old_name",
5131
+ versionId: "version_id",
5132
+ })),
5133
+ Schema.Struct({
5134
+ name: Schema.String,
5135
+ type: Schema.Literal("images"),
5136
+ }),
5137
+ Schema.Struct({
5138
+ json: Schema.String,
5139
+ name: Schema.String,
5140
+ type: Schema.Literal("json"),
5141
+ }),
5142
+ Schema.Struct({
5143
+ name: Schema.String,
5144
+ namespaceId: Schema.String,
5145
+ type: Schema.Literal("kv_namespace"),
5146
+ }).pipe(Schema.encodeKeys({
5147
+ name: "name",
5148
+ namespaceId: "namespace_id",
5149
+ type: "type",
5150
+ })),
5151
+ Schema.Struct({
5152
+ certificateId: Schema.String,
5153
+ name: Schema.String,
5154
+ type: Schema.Literal("mtls_certificate"),
5155
+ }).pipe(Schema.encodeKeys({
5156
+ certificateId: "certificate_id",
5157
+ name: "name",
5158
+ type: "type",
5159
+ })),
5160
+ Schema.Struct({
5161
+ name: Schema.String,
5162
+ text: Schema.String,
5163
+ type: Schema.Literal("plain_text"),
5164
+ }),
5165
+ Schema.Struct({
5166
+ name: Schema.String,
5167
+ pipeline: Schema.String,
5168
+ type: Schema.Literal("pipelines"),
5169
+ }),
5170
+ Schema.Struct({
5171
+ name: Schema.String,
5172
+ queueName: Schema.String,
5173
+ type: Schema.Literal("queue"),
5174
+ }).pipe(Schema.encodeKeys({
5175
+ name: "name",
5176
+ queueName: "queue_name",
5177
+ type: "type",
5178
+ })),
5179
+ Schema.Struct({
5180
+ bucketName: Schema.String,
5181
+ name: Schema.String,
5182
+ type: Schema.Literal("r2_bucket"),
5183
+ jurisdiction: Schema.optional(Schema.Literals(["eu", "fedramp"])),
5184
+ }).pipe(Schema.encodeKeys({
5185
+ bucketName: "bucket_name",
5186
+ name: "name",
5187
+ type: "type",
5188
+ jurisdiction: "jurisdiction",
5189
+ })),
5190
+ Schema.Struct({
5191
+ name: Schema.String,
5192
+ text: Schema.String,
5193
+ type: Schema.Literal("secret_text"),
5194
+ }),
5195
+ Schema.Struct({
5196
+ name: Schema.String,
5197
+ type: Schema.Literal("send_email"),
5198
+ allowedDestinationAddresses: Schema.optional(Schema.Array(Schema.String)),
5199
+ allowedSenderAddresses: Schema.optional(Schema.Array(Schema.String)),
5200
+ destinationAddress: Schema.optional(Schema.String),
5201
+ }).pipe(Schema.encodeKeys({
5202
+ name: "name",
5203
+ type: "type",
5204
+ allowedDestinationAddresses: "allowed_destination_addresses",
5205
+ allowedSenderAddresses: "allowed_sender_addresses",
5206
+ destinationAddress: "destination_address",
5207
+ })),
5208
+ Schema.Struct({
5209
+ name: Schema.String,
5210
+ service: Schema.String,
5211
+ type: Schema.Literal("service"),
5212
+ environment: Schema.optional(Schema.String),
5213
+ }),
5214
+ Schema.Struct({
5215
+ name: Schema.String,
5216
+ part: Schema.String,
5217
+ type: Schema.Literal("text_blob"),
5218
+ }),
5219
+ Schema.Struct({
5220
+ indexName: Schema.String,
5221
+ name: Schema.String,
5222
+ type: Schema.Literal("vectorize"),
5223
+ }).pipe(Schema.encodeKeys({
5224
+ indexName: "index_name",
5225
+ name: "name",
5226
+ type: "type",
5227
+ })),
5228
+ Schema.Struct({
5229
+ name: Schema.String,
5230
+ type: Schema.Literal("version_metadata"),
5231
+ }),
5232
+ Schema.Struct({
5233
+ name: Schema.String,
5234
+ secretName: Schema.String,
5235
+ storeId: Schema.String,
5236
+ type: Schema.Literal("secrets_store_secret"),
5237
+ }).pipe(Schema.encodeKeys({
5238
+ name: "name",
5239
+ secretName: "secret_name",
5240
+ storeId: "store_id",
5241
+ type: "type",
5242
+ })),
5243
+ Schema.Struct({
5244
+ algorithm: Schema.Unknown,
5245
+ format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
5246
+ name: Schema.String,
5247
+ type: Schema.Literal("secret_key"),
5248
+ usages: Schema.Array(Schema.Literals([
5249
+ "encrypt",
5250
+ "decrypt",
5251
+ "sign",
5252
+ "verify",
5253
+ "deriveKey",
5254
+ "deriveBits",
5255
+ "wrapKey",
5256
+ "unwrapKey",
5257
+ ])),
5258
+ keyBase64: Schema.optional(Schema.String),
5259
+ keyJwk: Schema.optional(Schema.Unknown),
5260
+ }).pipe(Schema.encodeKeys({
5261
+ algorithm: "algorithm",
5262
+ format: "format",
5263
+ name: "name",
5264
+ type: "type",
5265
+ usages: "usages",
5266
+ keyBase64: "key_base64",
5267
+ keyJwk: "key_jwk",
5268
+ })),
5269
+ Schema.Struct({
5270
+ name: Schema.String,
5271
+ type: Schema.Literal("workflow"),
5272
+ workflowName: Schema.String,
5273
+ className: Schema.optional(Schema.String),
5274
+ scriptName: Schema.optional(Schema.String),
5275
+ }).pipe(Schema.encodeKeys({
5276
+ name: "name",
5277
+ type: "type",
5278
+ workflowName: "workflow_name",
5279
+ className: "class_name",
5280
+ scriptName: "script_name",
5281
+ })),
5282
+ Schema.Struct({
5283
+ name: Schema.String,
5284
+ part: Schema.String,
5285
+ type: Schema.Literal("wasm_module"),
5286
+ }),
5287
+ Schema.Struct({
5288
+ name: Schema.String,
5289
+ type: Schema.Literal("worker_loader"),
5290
+ }),
5291
+ ]))),
5292
+ compatibilityDate: Schema.optional(Schema.String),
5293
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
5294
+ limits: Schema.optional(Schema.Struct({
5295
+ cpuMs: Schema.optional(Schema.Number),
5296
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" }))),
5297
+ logpush: Schema.optional(Schema.Boolean),
5298
+ migrations: Schema.optional(Schema.Union([
5299
+ Schema.Struct({
5300
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
5301
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
5302
+ newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
5303
+ newTag: Schema.optional(Schema.String),
5304
+ oldTag: Schema.optional(Schema.String),
5305
+ renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
5306
+ from: Schema.optional(Schema.String),
5307
+ to: Schema.optional(Schema.String),
5308
+ }))),
5309
+ transferredClasses: Schema.optional(Schema.Array(Schema.Struct({
5310
+ from: Schema.optional(Schema.String),
5311
+ fromScript: Schema.optional(Schema.String),
5312
+ to: Schema.optional(Schema.String),
5313
+ }).pipe(Schema.encodeKeys({
5314
+ from: "from",
5315
+ fromScript: "from_script",
5316
+ to: "to",
5317
+ })))),
5318
+ }).pipe(Schema.encodeKeys({
5319
+ deletedClasses: "deleted_classes",
5320
+ newClasses: "new_classes",
5321
+ newSqliteClasses: "new_sqlite_classes",
5322
+ newTag: "new_tag",
5323
+ oldTag: "old_tag",
5324
+ renamedClasses: "renamed_classes",
5325
+ transferredClasses: "transferred_classes",
5326
+ })),
5327
+ Schema.Struct({
5328
+ newTag: Schema.optional(Schema.String),
5329
+ oldTag: Schema.optional(Schema.String),
5330
+ steps: Schema.optional(Schema.Array(Schema.Struct({
5331
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
5332
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
5333
+ newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
5334
+ renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
5335
+ from: Schema.optional(Schema.String),
5336
+ to: Schema.optional(Schema.String),
5337
+ }))),
5338
+ transferredClasses: Schema.optional(Schema.Array(Schema.Struct({
5339
+ from: Schema.optional(Schema.String),
5340
+ fromScript: Schema.optional(Schema.String),
5341
+ to: Schema.optional(Schema.String),
5342
+ }).pipe(Schema.encodeKeys({
5343
+ from: "from",
5344
+ fromScript: "from_script",
5345
+ to: "to",
5346
+ })))),
5347
+ }).pipe(Schema.encodeKeys({
5348
+ deletedClasses: "deleted_classes",
5349
+ newClasses: "new_classes",
5350
+ newSqliteClasses: "new_sqlite_classes",
5351
+ renamedClasses: "renamed_classes",
5352
+ transferredClasses: "transferred_classes",
5353
+ })))),
5354
+ }).pipe(Schema.encodeKeys({
5355
+ newTag: "new_tag",
5356
+ oldTag: "old_tag",
5357
+ steps: "steps",
5358
+ })),
5359
+ ])),
5360
+ observability: Schema.optional(Schema.Struct({
5361
+ enabled: Schema.Boolean,
5362
+ headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
5363
+ logs: Schema.optional(Schema.Union([
5364
+ Schema.Struct({
5365
+ enabled: Schema.Boolean,
5366
+ invocationLogs: Schema.Boolean,
5367
+ destinations: Schema.optional(Schema.Array(Schema.String)),
5368
+ headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
5369
+ persist: Schema.optional(Schema.Boolean),
5370
+ }).pipe(Schema.encodeKeys({
5371
+ enabled: "enabled",
5372
+ invocationLogs: "invocation_logs",
5373
+ destinations: "destinations",
5374
+ headSamplingRate: "head_sampling_rate",
5375
+ persist: "persist",
5376
+ })),
5377
+ Schema.Null,
5378
+ ])),
5379
+ }).pipe(Schema.encodeKeys({
5380
+ enabled: "enabled",
5381
+ headSamplingRate: "head_sampling_rate",
5382
+ logs: "logs",
5383
+ }))),
5384
+ placement: Schema.optional(Schema.Union([
5385
+ Schema.Struct({
5386
+ mode: Schema.Literal("smart"),
5387
+ }),
5388
+ Schema.Struct({
5389
+ region: Schema.String,
5390
+ }),
5391
+ Schema.Struct({
5392
+ hostname: Schema.String,
5393
+ }),
5394
+ Schema.Struct({
5395
+ host: Schema.String,
5396
+ }),
5397
+ ])),
5398
+ tags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5399
+ tailConsumers: Schema.optional(Schema.Union([
5400
+ Schema.Array(Schema.Struct({
5401
+ service: Schema.String,
5402
+ environment: Schema.optional(Schema.String),
5403
+ namespace: Schema.optional(Schema.String),
5404
+ })),
5405
+ Schema.Null,
5406
+ ])),
5407
+ usageModel: Schema.optional(Schema.Literals(["standard", "bundled", "unbound"])),
5408
+ }).pipe(Schema.encodeKeys({
5409
+ bindings: "bindings",
5410
+ compatibilityDate: "compatibility_date",
5411
+ compatibilityFlags: "compatibility_flags",
5412
+ limits: "limits",
5413
+ logpush: "logpush",
5414
+ migrations: "migrations",
5415
+ observability: "observability",
5416
+ placement: "placement",
5417
+ tags: "tags",
5418
+ tailConsumers: "tail_consumers",
5419
+ usageModel: "usage_model",
5420
+ }))),
5421
+ }).pipe(T.Http({
5422
+ method: "PATCH",
5423
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/settings",
5424
+ contentType: "multipart",
5425
+ }));
5426
+ export const PatchScriptScriptAndVersionSettingResponse =
5427
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5428
+ bindings: Schema.optional(Schema.Union([
5429
+ Schema.Array(Schema.Union([
5430
+ Schema.Struct({
5431
+ name: Schema.String,
5432
+ type: Schema.Literal("ai"),
5433
+ }),
5434
+ Schema.Struct({
5435
+ dataset: Schema.String,
5436
+ name: Schema.String,
5437
+ type: Schema.Literal("analytics_engine"),
5438
+ }),
5439
+ Schema.Struct({
5440
+ name: Schema.String,
5441
+ type: Schema.Literal("assets"),
5442
+ }),
5443
+ Schema.Struct({
5444
+ name: Schema.String,
5445
+ type: Schema.Literal("browser"),
5446
+ }),
5447
+ Schema.Struct({
5448
+ id: Schema.String,
5449
+ name: Schema.String,
5450
+ type: Schema.Literal("d1"),
5451
+ }),
5452
+ Schema.Struct({
5453
+ name: Schema.String,
5454
+ part: Schema.String,
5455
+ type: Schema.Literal("data_blob"),
5456
+ }),
5457
+ Schema.Struct({
5458
+ name: Schema.String,
5459
+ namespace: Schema.String,
5460
+ type: Schema.Literal("dispatch_namespace"),
5461
+ outbound: Schema.optional(Schema.Union([
5462
+ Schema.Struct({
5463
+ params: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5464
+ worker: Schema.optional(Schema.Union([
5465
+ Schema.Struct({
5466
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5467
+ service: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5468
+ }),
5469
+ Schema.Null,
5470
+ ])),
5471
+ }),
5472
+ Schema.Null,
5473
+ ])),
5474
+ }),
5475
+ Schema.Struct({
5476
+ name: Schema.String,
5477
+ type: Schema.Literal("durable_object_namespace"),
5478
+ className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5479
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5480
+ namespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5481
+ scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5482
+ }).pipe(Schema.encodeKeys({
5483
+ name: "name",
5484
+ type: "type",
5485
+ className: "class_name",
5486
+ environment: "environment",
5487
+ namespaceId: "namespace_id",
5488
+ scriptName: "script_name",
5489
+ })),
5490
+ Schema.Struct({
5491
+ id: Schema.String,
5492
+ name: Schema.String,
5493
+ type: Schema.Literal("hyperdrive"),
5494
+ }),
5495
+ Schema.Struct({
5496
+ name: Schema.String,
5497
+ type: Schema.Literal("inherit"),
5498
+ oldName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5499
+ versionId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5500
+ }).pipe(Schema.encodeKeys({
5501
+ name: "name",
5502
+ type: "type",
5503
+ oldName: "old_name",
5504
+ versionId: "version_id",
5505
+ })),
5506
+ Schema.Struct({
5507
+ name: Schema.String,
5508
+ type: Schema.Literal("images"),
5509
+ }),
5510
+ Schema.Struct({
5511
+ json: Schema.String,
5512
+ name: Schema.String,
5513
+ type: Schema.Literal("json"),
5514
+ }),
5515
+ Schema.Struct({
5516
+ name: Schema.String,
5517
+ namespaceId: Schema.String,
5518
+ type: Schema.Literal("kv_namespace"),
5519
+ }).pipe(Schema.encodeKeys({
5520
+ name: "name",
5521
+ namespaceId: "namespace_id",
5522
+ type: "type",
5523
+ })),
5524
+ Schema.Struct({
5525
+ certificateId: Schema.String,
5526
+ name: Schema.String,
5527
+ type: Schema.Literal("mtls_certificate"),
5528
+ }).pipe(Schema.encodeKeys({
5529
+ certificateId: "certificate_id",
5530
+ name: "name",
5531
+ type: "type",
5532
+ })),
5533
+ Schema.Struct({
5534
+ name: Schema.String,
5535
+ text: Schema.String,
5536
+ type: Schema.Literal("plain_text"),
5537
+ }),
5538
+ Schema.Struct({
5539
+ name: Schema.String,
5540
+ pipeline: Schema.String,
5541
+ type: Schema.Literal("pipelines"),
5542
+ }),
5543
+ Schema.Struct({
5544
+ name: Schema.String,
5545
+ queueName: Schema.String,
5546
+ type: Schema.Literal("queue"),
5547
+ }).pipe(Schema.encodeKeys({
5548
+ name: "name",
5549
+ queueName: "queue_name",
5550
+ type: "type",
5551
+ })),
5552
+ Schema.Struct({
5553
+ bucketName: Schema.String,
5554
+ name: Schema.String,
5555
+ type: Schema.Literal("r2_bucket"),
5556
+ jurisdiction: Schema.optional(Schema.Union([Schema.Literals(["eu", "fedramp"]), Schema.Null])),
5557
+ }).pipe(Schema.encodeKeys({
5558
+ bucketName: "bucket_name",
5559
+ name: "name",
5560
+ type: "type",
5561
+ jurisdiction: "jurisdiction",
5562
+ })),
5563
+ Schema.Struct({
5564
+ name: Schema.String,
5565
+ type: Schema.Literal("secret_text"),
5566
+ }),
5567
+ Schema.Struct({
5568
+ name: Schema.String,
5569
+ type: Schema.Literal("send_email"),
5570
+ allowedDestinationAddresses: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5571
+ allowedSenderAddresses: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5572
+ destinationAddress: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5573
+ }).pipe(Schema.encodeKeys({
5574
+ name: "name",
5575
+ type: "type",
5576
+ allowedDestinationAddresses: "allowed_destination_addresses",
5577
+ allowedSenderAddresses: "allowed_sender_addresses",
5578
+ destinationAddress: "destination_address",
5579
+ })),
5580
+ Schema.Struct({
5581
+ name: Schema.String,
5582
+ service: Schema.String,
5583
+ type: Schema.Literal("service"),
5584
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5585
+ }),
5586
+ Schema.Struct({
5587
+ name: Schema.String,
5588
+ part: Schema.String,
5589
+ type: Schema.Literal("text_blob"),
5590
+ }),
5591
+ Schema.Struct({
5592
+ indexName: Schema.String,
5593
+ name: Schema.String,
5594
+ type: Schema.Literal("vectorize"),
5595
+ }).pipe(Schema.encodeKeys({
5596
+ indexName: "index_name",
5597
+ name: "name",
5598
+ type: "type",
5599
+ })),
5600
+ Schema.Struct({
5601
+ name: Schema.String,
5602
+ type: Schema.Literal("version_metadata"),
5603
+ }),
5604
+ Schema.Struct({
5605
+ name: Schema.String,
5606
+ secretName: Schema.String,
5607
+ storeId: Schema.String,
5608
+ type: Schema.Literal("secrets_store_secret"),
5609
+ }).pipe(Schema.encodeKeys({
5610
+ name: "name",
5611
+ secretName: "secret_name",
5612
+ storeId: "store_id",
5613
+ type: "type",
5614
+ })),
5615
+ Schema.Struct({
5616
+ algorithm: Schema.Unknown,
5617
+ format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
5618
+ name: Schema.String,
5619
+ type: Schema.Literal("secret_key"),
5620
+ usages: Schema.Array(Schema.Literals([
5621
+ "encrypt",
5622
+ "decrypt",
5623
+ "sign",
5624
+ "verify",
5625
+ "deriveKey",
5626
+ "deriveBits",
5627
+ "wrapKey",
5628
+ "unwrapKey",
5629
+ ])),
5630
+ }),
5631
+ Schema.Struct({
5632
+ name: Schema.String,
5633
+ type: Schema.Literal("workflow"),
5634
+ workflowName: Schema.String,
5635
+ className: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5636
+ scriptName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5637
+ }).pipe(Schema.encodeKeys({
5638
+ name: "name",
5639
+ type: "type",
5640
+ workflowName: "workflow_name",
5641
+ className: "class_name",
5642
+ scriptName: "script_name",
5643
+ })),
5644
+ Schema.Struct({
5645
+ name: Schema.String,
5646
+ part: Schema.String,
5647
+ type: Schema.Literal("wasm_module"),
5648
+ }),
5649
+ Schema.Struct({
5650
+ name: Schema.String,
5651
+ type: Schema.Literal("worker_loader"),
5652
+ }),
5653
+ ])),
5654
+ Schema.Null,
5655
+ ])),
5656
+ compatibilityDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5657
+ compatibilityFlags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5658
+ limits: Schema.optional(Schema.Union([
5659
+ Schema.Struct({
5660
+ cpuMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
5661
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
5662
+ Schema.Null,
5663
+ ])),
5664
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
5665
+ observability: Schema.optional(Schema.Union([
5666
+ Schema.Struct({
5667
+ enabled: Schema.Boolean,
5668
+ headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
5669
+ logs: Schema.optional(Schema.Union([
5670
+ Schema.Struct({
5671
+ enabled: Schema.Boolean,
5672
+ invocationLogs: Schema.Boolean,
5673
+ destinations: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5674
+ headSamplingRate: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
5675
+ persist: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
5676
+ }).pipe(Schema.encodeKeys({
5677
+ enabled: "enabled",
5678
+ invocationLogs: "invocation_logs",
5679
+ destinations: "destinations",
5680
+ headSamplingRate: "head_sampling_rate",
5681
+ persist: "persist",
5682
+ })),
5683
+ Schema.Null,
5684
+ ])),
5685
+ }).pipe(Schema.encodeKeys({
5686
+ enabled: "enabled",
5687
+ headSamplingRate: "head_sampling_rate",
5688
+ logs: "logs",
5689
+ })),
5690
+ Schema.Null,
5691
+ ])),
5692
+ placement: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
5693
+ tags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
5694
+ tailConsumers: Schema.optional(Schema.Union([
5695
+ Schema.Array(Schema.Struct({
5696
+ service: Schema.String,
5697
+ environment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5698
+ namespace: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
5699
+ })),
5700
+ Schema.Null,
5701
+ ])),
5702
+ usageModel: Schema.optional(Schema.Union([
5703
+ Schema.Literals(["standard", "bundled", "unbound"]),
5704
+ Schema.Null,
5705
+ ])),
5706
+ })
5707
+ .pipe(Schema.encodeKeys({
5708
+ bindings: "bindings",
5709
+ compatibilityDate: "compatibility_date",
5710
+ compatibilityFlags: "compatibility_flags",
5711
+ limits: "limits",
5712
+ logpush: "logpush",
5713
+ observability: "observability",
5714
+ placement: "placement",
5715
+ tags: "tags",
5716
+ tailConsumers: "tail_consumers",
5717
+ usageModel: "usage_model",
5718
+ }))
5719
+ .pipe(T.ResponsePath("result"));
5720
+ export const patchScriptScriptAndVersionSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
5721
+ input: PatchScriptScriptAndVersionSettingRequest,
5722
+ output: PatchScriptScriptAndVersionSettingResponse,
5723
+ errors: [WorkerNotFound, ContentTypeRequired],
5724
+ }));
5725
+ export const GetScriptSecretRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5726
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
5727
+ secretName: Schema.String.pipe(T.HttpPath("secretName")),
5728
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
5729
+ urlEncoded: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("url_encoded")),
5730
+ }).pipe(T.Http({
5731
+ method: "GET",
5732
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/secrets/{secretName}",
5733
+ }));
5734
+ export const GetScriptSecretResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
5735
+ Schema.Struct({
5736
+ name: Schema.String,
5737
+ type: Schema.Literal("secret_text"),
5738
+ }),
5739
+ Schema.Struct({
5740
+ algorithm: Schema.Unknown,
5741
+ format: Schema.Literals(["raw", "pkcs8", "spki", "jwk"]),
5742
+ name: Schema.String,
5743
+ type: Schema.Literal("secret_key"),
5744
+ usages: Schema.Array(Schema.Literals([
5745
+ "encrypt",
5746
+ "decrypt",
5747
+ "sign",
5748
+ "verify",
5749
+ "deriveKey",
5750
+ "deriveBits",
5751
+ "wrapKey",
5752
+ "unwrapKey",
5753
+ ])),
5754
+ }),
5755
+ ]).pipe(T.ResponsePath("result"));
5756
+ export const getScriptSecret = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
5757
+ input: GetScriptSecretRequest,
5758
+ output: GetScriptSecretResponse,
5759
+ errors: [WorkerNotFound, SecretNotFound],
5760
+ }));
5761
+ export const ListScriptSecretsRequest =
5762
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5763
+ scriptName: Schema.String.pipe(T.HttpPath("scriptName")),
5764
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
5765
+ }).pipe(T.Http({
5766
+ method: "GET",
5767
+ path: "/accounts/{account_id}/workers/scripts/{scriptName}/secrets",
5768
+ }));
5769
+ export const ListScriptSecretsResponse =
5770
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
5771
+ result: Schema.Array(Schema.Union([
5327
5772
  Schema.Struct({
5328
5773
  name: Schema.String,
5329
5774
  type: Schema.Literal("secret_text"),
@@ -6648,103 +7093,546 @@ export const CreateScriptVersionResponse =
6648
7093
  ])),
6649
7094
  Schema.Null,
6650
7095
  ])),
6651
- script: Schema.optional(Schema.Union([
7096
+ script: Schema.optional(Schema.Union([
7097
+ Schema.Struct({
7098
+ etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7099
+ handlers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
7100
+ lastDeployedFrom: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7101
+ namedHandlers: Schema.optional(Schema.Union([
7102
+ Schema.Array(Schema.Struct({
7103
+ handlers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
7104
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7105
+ })),
7106
+ Schema.Null,
7107
+ ])),
7108
+ }).pipe(Schema.encodeKeys({
7109
+ etag: "etag",
7110
+ handlers: "handlers",
7111
+ lastDeployedFrom: "last_deployed_from",
7112
+ namedHandlers: "named_handlers",
7113
+ })),
7114
+ Schema.Null,
7115
+ ])),
7116
+ scriptRuntime: Schema.optional(Schema.Union([
7117
+ Schema.Struct({
7118
+ compatibilityDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7119
+ compatibilityFlags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
7120
+ limits: Schema.optional(Schema.Union([
7121
+ Schema.Struct({
7122
+ cpuMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
7123
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
7124
+ Schema.Null,
7125
+ ])),
7126
+ migrationTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7127
+ usageModel: Schema.optional(Schema.Union([
7128
+ Schema.Literals(["bundled", "unbound", "standard"]),
7129
+ Schema.Null,
7130
+ ])),
7131
+ }).pipe(Schema.encodeKeys({
7132
+ compatibilityDate: "compatibility_date",
7133
+ compatibilityFlags: "compatibility_flags",
7134
+ limits: "limits",
7135
+ migrationTag: "migration_tag",
7136
+ usageModel: "usage_model",
7137
+ })),
7138
+ Schema.Null,
7139
+ ])),
7140
+ }).pipe(Schema.encodeKeys({
7141
+ bindings: "bindings",
7142
+ script: "script",
7143
+ scriptRuntime: "script_runtime",
7144
+ })),
7145
+ id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7146
+ metadata: Schema.optional(Schema.Union([
7147
+ Schema.Struct({
7148
+ authorEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7149
+ authorId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7150
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7151
+ hasPreview: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
7152
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7153
+ source: Schema.optional(Schema.Union([
7154
+ Schema.Literals([
7155
+ "unknown",
7156
+ "api",
7157
+ "wrangler",
7158
+ "terraform",
7159
+ "dash",
7160
+ "dash_template",
7161
+ "integration",
7162
+ "quick_editor",
7163
+ "playground",
7164
+ "workersci",
7165
+ ]),
7166
+ Schema.Null,
7167
+ ])),
7168
+ }).pipe(Schema.encodeKeys({
7169
+ authorEmail: "author_email",
7170
+ authorId: "author_id",
7171
+ createdOn: "created_on",
7172
+ hasPreview: "hasPreview",
7173
+ modifiedOn: "modified_on",
7174
+ source: "source",
7175
+ })),
7176
+ Schema.Null,
7177
+ ])),
7178
+ number: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
7179
+ startupTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
7180
+ })
7181
+ .pipe(Schema.encodeKeys({
7182
+ resources: "resources",
7183
+ id: "id",
7184
+ metadata: "metadata",
7185
+ number: "number",
7186
+ startupTimeMs: "startup_time_ms",
7187
+ }))
7188
+ .pipe(T.ResponsePath("result"));
7189
+ export const createScriptVersion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
7190
+ input: CreateScriptVersionRequest,
7191
+ output: CreateScriptVersionResponse,
7192
+ errors: [WorkerNotFound],
7193
+ }));
7194
+ export const CreateServiceEdgePreviewRequest =
7195
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7196
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
7197
+ serviceName: Schema.String.pipe(T.HttpPath("service_name")),
7198
+ environmentName: Schema.String.pipe(T.HttpPath("environment_name")),
7199
+ cfPreviewUploadConfigToken: Schema.String.pipe(T.HttpHeader("cf-preview-upload-config-token")),
7200
+ metadata: Schema.optional(Schema.Struct({
7201
+ mainModule: Schema.optional(Schema.String),
7202
+ bodyPart: Schema.optional(Schema.String),
7203
+ compatibilityDate: Schema.optional(Schema.String),
7204
+ compatibilityFlags: Schema.optional(Schema.Array(Schema.String)),
7205
+ usageModel: Schema.optional(Schema.Literals(["bundled", "unbound", "standard"])),
7206
+ bindings: Schema.optional(Schema.Array(Schema.Union([
7207
+ Schema.Struct({
7208
+ type: Schema.Literal("plain_text"),
7209
+ name: Schema.String,
7210
+ text: Schema.String,
7211
+ }),
7212
+ Schema.Struct({
7213
+ type: Schema.Literal("secret_text"),
7214
+ name: Schema.String,
7215
+ text: Schema.String,
7216
+ }),
7217
+ Schema.Struct({
7218
+ type: Schema.Literal("json"),
7219
+ name: Schema.String,
7220
+ json: Schema.Unknown,
7221
+ }),
7222
+ Schema.Struct({
7223
+ type: Schema.Literal("kv_namespace"),
7224
+ name: Schema.String,
7225
+ namespaceId: Schema.String,
7226
+ raw: Schema.optional(Schema.Boolean),
7227
+ }).pipe(Schema.encodeKeys({
7228
+ type: "type",
7229
+ name: "name",
7230
+ namespaceId: "namespace_id",
7231
+ raw: "raw",
7232
+ })),
7233
+ Schema.Struct({
7234
+ type: Schema.Literal("durable_object_namespace"),
7235
+ name: Schema.String,
7236
+ className: Schema.String,
7237
+ scriptName: Schema.optional(Schema.String),
7238
+ environment: Schema.optional(Schema.String),
7239
+ namespaceId: Schema.optional(Schema.String),
7240
+ }).pipe(Schema.encodeKeys({
7241
+ type: "type",
7242
+ name: "name",
7243
+ className: "class_name",
7244
+ scriptName: "script_name",
7245
+ environment: "environment",
7246
+ namespaceId: "namespace_id",
7247
+ })),
7248
+ Schema.Struct({
7249
+ type: Schema.Literal("r2_bucket"),
7250
+ name: Schema.String,
7251
+ bucketName: Schema.String,
7252
+ jurisdiction: Schema.optional(Schema.String),
7253
+ raw: Schema.optional(Schema.Boolean),
7254
+ }).pipe(Schema.encodeKeys({
7255
+ type: "type",
7256
+ name: "name",
7257
+ bucketName: "bucket_name",
7258
+ jurisdiction: "jurisdiction",
7259
+ raw: "raw",
7260
+ })),
7261
+ Schema.Struct({
7262
+ type: Schema.Literal("d1"),
7263
+ name: Schema.String,
7264
+ id: Schema.String,
7265
+ raw: Schema.optional(Schema.Boolean),
7266
+ }),
7267
+ Schema.Struct({
7268
+ type: Schema.Literal("queue"),
7269
+ name: Schema.String,
7270
+ queueName: Schema.String,
7271
+ deliveryDelay: Schema.optional(Schema.Number),
7272
+ raw: Schema.optional(Schema.Boolean),
7273
+ }).pipe(Schema.encodeKeys({
7274
+ type: "type",
7275
+ name: "name",
7276
+ queueName: "queue_name",
7277
+ deliveryDelay: "delivery_delay",
7278
+ raw: "raw",
7279
+ })),
7280
+ Schema.Struct({
7281
+ type: Schema.Literal("service"),
7282
+ name: Schema.String,
7283
+ service: Schema.String,
7284
+ environment: Schema.optional(Schema.String),
7285
+ entrypoint: Schema.optional(Schema.String),
7286
+ }),
7287
+ Schema.Struct({
7288
+ type: Schema.Literal("ai"),
7289
+ name: Schema.String,
7290
+ staging: Schema.optional(Schema.Boolean),
7291
+ raw: Schema.optional(Schema.Boolean),
7292
+ }),
7293
+ Schema.Struct({
7294
+ type: Schema.Literal("browser"),
7295
+ name: Schema.String,
7296
+ raw: Schema.optional(Schema.Boolean),
7297
+ }),
7298
+ Schema.Struct({
7299
+ type: Schema.Literal("images"),
7300
+ name: Schema.String,
7301
+ raw: Schema.optional(Schema.Boolean),
7302
+ }),
7303
+ Schema.Struct({
7304
+ type: Schema.Literal("vectorize"),
7305
+ name: Schema.String,
7306
+ indexName: Schema.String,
7307
+ raw: Schema.optional(Schema.Boolean),
7308
+ }).pipe(Schema.encodeKeys({
7309
+ type: "type",
7310
+ name: "name",
7311
+ indexName: "index_name",
7312
+ raw: "raw",
7313
+ })),
7314
+ Schema.Struct({
7315
+ type: Schema.Literal("workflow"),
7316
+ name: Schema.String,
7317
+ workflowName: Schema.String,
7318
+ className: Schema.String,
7319
+ scriptName: Schema.optional(Schema.String),
7320
+ raw: Schema.optional(Schema.Boolean),
7321
+ }).pipe(Schema.encodeKeys({
7322
+ type: "type",
7323
+ name: "name",
7324
+ workflowName: "workflow_name",
7325
+ className: "class_name",
7326
+ scriptName: "script_name",
7327
+ raw: "raw",
7328
+ })),
7329
+ Schema.Struct({
7330
+ type: Schema.Literal("hyperdrive"),
7331
+ name: Schema.String,
7332
+ id: Schema.String,
7333
+ }),
7334
+ Schema.Struct({
7335
+ type: Schema.Literal("analytics_engine"),
7336
+ name: Schema.String,
7337
+ dataset: Schema.optional(Schema.String),
7338
+ }),
7339
+ Schema.Struct({
7340
+ type: Schema.Literal("dispatch_namespace"),
7341
+ name: Schema.String,
7342
+ namespace: Schema.String,
7343
+ outbound: Schema.optional(Schema.Struct({
7344
+ worker: Schema.optional(Schema.Struct({
7345
+ service: Schema.optional(Schema.String),
7346
+ environment: Schema.optional(Schema.String),
7347
+ })),
7348
+ params: Schema.optional(Schema.Array(Schema.Struct({
7349
+ name: Schema.String,
7350
+ }))),
7351
+ })),
7352
+ }),
7353
+ Schema.Struct({
7354
+ type: Schema.Literal("send_email"),
7355
+ name: Schema.String,
7356
+ destinationAddress: Schema.optional(Schema.String),
7357
+ allowedDestinationAddresses: Schema.optional(Schema.Array(Schema.String)),
7358
+ allowedSenderAddresses: Schema.optional(Schema.Array(Schema.String)),
7359
+ }).pipe(Schema.encodeKeys({
7360
+ type: "type",
7361
+ name: "name",
7362
+ destinationAddress: "destination_address",
7363
+ allowedDestinationAddresses: "allowed_destination_addresses",
7364
+ allowedSenderAddresses: "allowed_sender_addresses",
7365
+ })),
7366
+ Schema.Struct({
7367
+ type: Schema.Literal("mtls_certificate"),
7368
+ name: Schema.String,
7369
+ certificateId: Schema.String,
7370
+ }).pipe(Schema.encodeKeys({
7371
+ type: "type",
7372
+ name: "name",
7373
+ certificateId: "certificate_id",
7374
+ })),
7375
+ Schema.Struct({
7376
+ type: Schema.Literal("wasm_module"),
7377
+ name: Schema.String,
7378
+ part: Schema.String,
7379
+ }),
7380
+ Schema.Struct({
7381
+ type: Schema.Literal("text_blob"),
7382
+ name: Schema.String,
7383
+ part: Schema.String,
7384
+ }),
7385
+ Schema.Struct({
7386
+ type: Schema.Literal("data_blob"),
7387
+ name: Schema.String,
7388
+ part: Schema.String,
7389
+ }),
7390
+ Schema.Struct({
7391
+ type: Schema.Literal("pipelines"),
7392
+ name: Schema.String,
7393
+ pipeline: Schema.String,
7394
+ }),
7395
+ Schema.Struct({
7396
+ type: Schema.Literal("secrets_store_secret"),
7397
+ name: Schema.String,
7398
+ storeId: Schema.String,
7399
+ secretName: Schema.String,
7400
+ }).pipe(Schema.encodeKeys({
7401
+ type: "type",
7402
+ name: "name",
7403
+ storeId: "store_id",
7404
+ secretName: "secret_name",
7405
+ })),
6652
7406
  Schema.Struct({
6653
- etag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6654
- handlers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
6655
- lastDeployedFrom: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6656
- namedHandlers: Schema.optional(Schema.Union([
6657
- Schema.Array(Schema.Struct({
6658
- handlers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
6659
- name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6660
- })),
6661
- Schema.Null,
6662
- ])),
7407
+ type: Schema.Literal("stream"),
7408
+ name: Schema.String,
7409
+ }),
7410
+ Schema.Struct({
7411
+ type: Schema.Literal("media"),
7412
+ name: Schema.String,
7413
+ }),
7414
+ Schema.Struct({
7415
+ type: Schema.Literal("version_metadata"),
7416
+ name: Schema.String,
7417
+ }),
7418
+ Schema.Struct({
7419
+ type: Schema.Literal("assets"),
7420
+ name: Schema.String,
7421
+ }),
7422
+ Schema.Struct({
7423
+ type: Schema.Literal("worker_loader"),
7424
+ name: Schema.String,
7425
+ }),
7426
+ Schema.Struct({
7427
+ type: Schema.Literal("logfwdr"),
7428
+ name: Schema.String,
7429
+ destination: Schema.String,
7430
+ }),
7431
+ Schema.Struct({
7432
+ type: Schema.Literal("ai_search_namespace"),
7433
+ name: Schema.String,
7434
+ namespace: Schema.String,
7435
+ }),
7436
+ Schema.Struct({
7437
+ type: Schema.Literal("ai_search"),
7438
+ name: Schema.String,
7439
+ instanceName: Schema.String,
6663
7440
  }).pipe(Schema.encodeKeys({
6664
- etag: "etag",
6665
- handlers: "handlers",
6666
- lastDeployedFrom: "last_deployed_from",
6667
- namedHandlers: "named_handlers",
7441
+ type: "type",
7442
+ name: "name",
7443
+ instanceName: "instance_name",
6668
7444
  })),
6669
- Schema.Null,
6670
- ])),
6671
- scriptRuntime: Schema.optional(Schema.Union([
6672
7445
  Schema.Struct({
6673
- compatibilityDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6674
- compatibilityFlags: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
6675
- limits: Schema.optional(Schema.Union([
6676
- Schema.Struct({
6677
- cpuMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
6678
- }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms" })),
6679
- Schema.Null,
6680
- ])),
6681
- migrationTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6682
- usageModel: Schema.optional(Schema.Union([
6683
- Schema.Literals(["bundled", "unbound", "standard"]),
6684
- Schema.Null,
6685
- ])),
7446
+ type: Schema.Literal("ratelimit"),
7447
+ name: Schema.String,
7448
+ namespaceId: Schema.String,
7449
+ simple: Schema.Struct({
7450
+ limit: Schema.Number,
7451
+ period: Schema.Literals(["10", "60"]),
7452
+ }),
6686
7453
  }).pipe(Schema.encodeKeys({
6687
- compatibilityDate: "compatibility_date",
6688
- compatibilityFlags: "compatibility_flags",
6689
- limits: "limits",
6690
- migrationTag: "migration_tag",
6691
- usageModel: "usage_model",
7454
+ type: "type",
7455
+ name: "name",
7456
+ namespaceId: "namespace_id",
7457
+ simple: "simple",
6692
7458
  })),
6693
- Schema.Null,
7459
+ Schema.Struct({
7460
+ type: Schema.Literal("inherit"),
7461
+ name: Schema.String,
7462
+ }),
7463
+ ]))),
7464
+ keepBindings: Schema.optional(Schema.Array(Schema.String)),
7465
+ migrations: Schema.optional(Schema.Struct({
7466
+ oldTag: Schema.optional(Schema.String),
7467
+ newTag: Schema.optional(Schema.String),
7468
+ steps: Schema.optional(Schema.Array(Schema.Struct({
7469
+ newClasses: Schema.optional(Schema.Array(Schema.String)),
7470
+ newSqliteClasses: Schema.optional(Schema.Array(Schema.String)),
7471
+ renamedClasses: Schema.optional(Schema.Array(Schema.Struct({
7472
+ from: Schema.optional(Schema.String),
7473
+ to: Schema.optional(Schema.String),
7474
+ }))),
7475
+ deletedClasses: Schema.optional(Schema.Array(Schema.String)),
7476
+ }).pipe(Schema.encodeKeys({
7477
+ newClasses: "new_classes",
7478
+ newSqliteClasses: "new_sqlite_classes",
7479
+ renamedClasses: "renamed_classes",
7480
+ deletedClasses: "deleted_classes",
7481
+ })))),
7482
+ }).pipe(Schema.encodeKeys({
7483
+ oldTag: "old_tag",
7484
+ newTag: "new_tag",
7485
+ steps: "steps",
7486
+ }))),
7487
+ capnpSchema: Schema.optional(Schema.String),
7488
+ logpush: Schema.optional(Schema.Boolean),
7489
+ placement: Schema.optional(Schema.Union([
7490
+ Schema.Struct({
7491
+ mode: Schema.Literal("smart"),
7492
+ hint: Schema.optional(Schema.String),
7493
+ }),
7494
+ Schema.Struct({
7495
+ region: Schema.String,
7496
+ }),
7497
+ Schema.Struct({
7498
+ host: Schema.String,
7499
+ }),
7500
+ Schema.Struct({
7501
+ hostname: Schema.String,
7502
+ }),
6694
7503
  ])),
7504
+ tailConsumers: Schema.optional(Schema.Array(Schema.Struct({
7505
+ service: Schema.String,
7506
+ environment: Schema.optional(Schema.String),
7507
+ }))),
7508
+ streamingTailConsumers: Schema.optional(Schema.Array(Schema.Struct({
7509
+ service: Schema.String,
7510
+ environment: Schema.optional(Schema.String),
7511
+ }))),
7512
+ limits: Schema.optional(Schema.Struct({
7513
+ cpuMs: Schema.optional(Schema.Number),
7514
+ subrequests: Schema.optional(Schema.Number),
7515
+ }).pipe(Schema.encodeKeys({ cpuMs: "cpu_ms", subrequests: "subrequests" }))),
7516
+ assets: Schema.optional(Schema.Struct({
7517
+ jwt: Schema.optional(Schema.String),
7518
+ config: Schema.optional(Schema.Struct({
7519
+ htmlHandling: Schema.optional(Schema.Literals([
7520
+ "auto-trailing-slash",
7521
+ "force-trailing-slash",
7522
+ "drop-trailing-slash",
7523
+ "none",
7524
+ ])),
7525
+ notFoundHandling: Schema.optional(Schema.Literals([
7526
+ "single-page-application",
7527
+ "404-page",
7528
+ "none",
7529
+ ])),
7530
+ runWorkerFirst: Schema.optional(Schema.Union([Schema.Boolean, Schema.Array(Schema.String)])),
7531
+ redirects: Schema.optional(Schema.String),
7532
+ headers: Schema.optional(Schema.String),
7533
+ }).pipe(Schema.encodeKeys({
7534
+ htmlHandling: "html_handling",
7535
+ notFoundHandling: "not_found_handling",
7536
+ runWorkerFirst: "run_worker_first",
7537
+ redirects: "_redirects",
7538
+ headers: "_headers",
7539
+ }))),
7540
+ })),
7541
+ observability: Schema.optional(Schema.Struct({
7542
+ enabled: Schema.optional(Schema.Boolean),
7543
+ headSamplingRate: Schema.optional(Schema.Number),
7544
+ logs: Schema.optional(Schema.Struct({
7545
+ enabled: Schema.optional(Schema.Boolean),
7546
+ headSamplingRate: Schema.optional(Schema.Number),
7547
+ invocationLogs: Schema.optional(Schema.Boolean),
7548
+ persist: Schema.optional(Schema.Boolean),
7549
+ destinations: Schema.optional(Schema.Array(Schema.String)),
7550
+ }).pipe(Schema.encodeKeys({
7551
+ enabled: "enabled",
7552
+ headSamplingRate: "head_sampling_rate",
7553
+ invocationLogs: "invocation_logs",
7554
+ persist: "persist",
7555
+ destinations: "destinations",
7556
+ }))),
7557
+ traces: Schema.optional(Schema.Struct({
7558
+ enabled: Schema.optional(Schema.Boolean),
7559
+ headSamplingRate: Schema.optional(Schema.Number),
7560
+ persist: Schema.optional(Schema.Boolean),
7561
+ destinations: Schema.optional(Schema.Array(Schema.String)),
7562
+ }).pipe(Schema.encodeKeys({
7563
+ enabled: "enabled",
7564
+ headSamplingRate: "head_sampling_rate",
7565
+ persist: "persist",
7566
+ destinations: "destinations",
7567
+ }))),
7568
+ }).pipe(Schema.encodeKeys({
7569
+ enabled: "enabled",
7570
+ headSamplingRate: "head_sampling_rate",
7571
+ logs: "logs",
7572
+ traces: "traces",
7573
+ }))),
7574
+ containers: Schema.optional(Schema.Array(Schema.Struct({
7575
+ className: Schema.String,
7576
+ }).pipe(Schema.encodeKeys({ className: "class_name" })))),
7577
+ annotations: Schema.optional(Schema.Unknown),
7578
+ keepAssets: Schema.optional(Schema.Boolean),
7579
+ tags: Schema.optional(Schema.Array(Schema.String)),
6695
7580
  }).pipe(Schema.encodeKeys({
7581
+ mainModule: "main_module",
7582
+ bodyPart: "body_part",
7583
+ compatibilityDate: "compatibility_date",
7584
+ compatibilityFlags: "compatibility_flags",
7585
+ usageModel: "usage_model",
6696
7586
  bindings: "bindings",
6697
- script: "script",
6698
- scriptRuntime: "script_runtime",
6699
- })),
6700
- id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6701
- metadata: Schema.optional(Schema.Union([
7587
+ keepBindings: "keep_bindings",
7588
+ migrations: "migrations",
7589
+ capnpSchema: "capnp_schema",
7590
+ logpush: "logpush",
7591
+ placement: "placement",
7592
+ tailConsumers: "tail_consumers",
7593
+ streamingTailConsumers: "streaming_tail_consumers",
7594
+ limits: "limits",
7595
+ assets: "assets",
7596
+ observability: "observability",
7597
+ containers: "containers",
7598
+ annotations: "annotations",
7599
+ keepAssets: "keep_assets",
7600
+ tags: "tags",
7601
+ }))),
7602
+ files: Schema.optional(Schema.Array(UploadableSchema.pipe(T.HttpFormDataFile()))),
7603
+ wranglerSessionConfig: Schema.optional(Schema.Union([
6702
7604
  Schema.Struct({
6703
- authorEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6704
- authorId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6705
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6706
- hasPreview: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
6707
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
6708
- source: Schema.optional(Schema.Union([
6709
- Schema.Literals([
6710
- "unknown",
6711
- "api",
6712
- "wrangler",
6713
- "terraform",
6714
- "dash",
6715
- "dash_template",
6716
- "integration",
6717
- "quick_editor",
6718
- "playground",
6719
- "workersci",
6720
- ]),
6721
- Schema.Null,
6722
- ])),
7605
+ workersDev: Schema.Literal(true),
7606
+ minimalMode: Schema.optional(Schema.Boolean),
6723
7607
  }).pipe(Schema.encodeKeys({
6724
- authorEmail: "author_email",
6725
- authorId: "author_id",
6726
- createdOn: "created_on",
6727
- hasPreview: "hasPreview",
6728
- modifiedOn: "modified_on",
6729
- source: "source",
7608
+ workersDev: "workers_dev",
7609
+ minimalMode: "minimal_mode",
6730
7610
  })),
6731
- Schema.Null,
7611
+ Schema.Struct({
7612
+ routes: Schema.Array(Schema.String),
7613
+ minimalMode: Schema.optional(Schema.Boolean),
7614
+ }).pipe(Schema.encodeKeys({ routes: "routes", minimalMode: "minimal_mode" })),
6732
7615
  ])),
6733
- number: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
6734
- startupTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
6735
- })
6736
- .pipe(Schema.encodeKeys({
6737
- resources: "resources",
6738
- id: "id",
7616
+ }).pipe(Schema.encodeKeys({
6739
7617
  metadata: "metadata",
6740
- number: "number",
6741
- startupTimeMs: "startup_time_ms",
6742
- }))
7618
+ files: "files",
7619
+ wranglerSessionConfig: "wrangler-session-config",
7620
+ }), T.Http({
7621
+ method: "POST",
7622
+ path: "/accounts/{account_id}/workers/services/{service_name}/environments/{environment_name}/edge-preview",
7623
+ contentType: "multipart",
7624
+ }));
7625
+ export const CreateServiceEdgePreviewResponse =
7626
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7627
+ previewToken: Schema.String,
7628
+ tailUrl: Schema.String,
7629
+ })
7630
+ .pipe(Schema.encodeKeys({ previewToken: "preview_token", tailUrl: "tail_url" }))
6743
7631
  .pipe(T.ResponsePath("result"));
6744
- export const createScriptVersion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
6745
- input: CreateScriptVersionRequest,
6746
- output: CreateScriptVersionResponse,
6747
- errors: [WorkerNotFound],
7632
+ export const createServiceEdgePreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
7633
+ input: CreateServiceEdgePreviewRequest,
7634
+ output: CreateServiceEdgePreviewResponse,
7635
+ errors: [InvalidRoute],
6748
7636
  }));
6749
7637
  export const GetSubdomainRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
6750
7638
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
@@ -6782,4 +7670,39 @@ export const deleteSubdomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
6782
7670
  output: DeleteSubdomainResponse,
6783
7671
  errors: [InvalidRoute],
6784
7672
  }));
7673
+ export const CreateSubdomainEdgePreviewSessionRequest =
7674
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7675
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
7676
+ }).pipe(T.Http({
7677
+ method: "GET",
7678
+ path: "/accounts/{account_id}/workers/subdomain/edge-preview",
7679
+ }));
7680
+ export const CreateSubdomainEdgePreviewSessionResponse =
7681
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7682
+ token: Schema.String,
7683
+ exchangeUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7684
+ })
7685
+ .pipe(Schema.encodeKeys({ token: "token", exchangeUrl: "exchange_url" }))
7686
+ .pipe(T.ResponsePath("result"));
7687
+ export const createSubdomainEdgePreviewSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
7688
+ input: CreateSubdomainEdgePreviewSessionRequest,
7689
+ output: CreateSubdomainEdgePreviewSessionResponse,
7690
+ errors: [InvalidRoute],
7691
+ }));
7692
+ export const CreateZoneEdgePreviewSessionRequest =
7693
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7694
+ zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
7695
+ }).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/workers/edge-preview" }));
7696
+ export const CreateZoneEdgePreviewSessionResponse =
7697
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7698
+ token: Schema.String,
7699
+ exchangeUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
7700
+ })
7701
+ .pipe(Schema.encodeKeys({ token: "token", exchangeUrl: "exchange_url" }))
7702
+ .pipe(T.ResponsePath("result"));
7703
+ export const createZoneEdgePreviewSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
7704
+ input: CreateZoneEdgePreviewSessionRequest,
7705
+ output: CreateZoneEdgePreviewSessionResponse,
7706
+ errors: [InvalidRoute],
7707
+ }));
6785
7708
  //# sourceMappingURL=workers.js.map