diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index 61a1094150..01fb318102 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -44,781 +44,51 @@ export class Settings extends APIResource { export interface SettingEditResponse { /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | SettingEditResponse.WorkersKVNamespaceBinding - | SettingEditResponse.WorkersServiceBinding - | SettingEditResponse.WorkersDoBinding - | SettingEditResponse.WorkersR2Binding - | SettingEditResponse.WorkersQueueBinding - | SettingEditResponse.WorkersD1Binding - | SettingEditResponse.WorkersDispatchNamespaceBinding - | SettingEditResponse.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: SettingEditResponse.WorkersSingleStepMigrations | SettingEditResponse.WorkersSteppedMigrations; - - placement?: SettingEditResponse.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace SettingEditResponse { - export interface WorkersKVNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace identifier tag. - */ - namespace_id: string; - - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * Namespace identifier tag. - */ - namespace_id?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * A JavaScript variable name for the binding. - */ - binding: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } - - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - - /** - * A reference to a script that will consume logs from the attached Worker. - */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } -} - -export interface SettingGetResponse { - /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | SettingGetResponse.WorkersKVNamespaceBinding - | SettingGetResponse.WorkersServiceBinding - | SettingGetResponse.WorkersDoBinding - | SettingGetResponse.WorkersR2Binding - | SettingGetResponse.WorkersQueueBinding - | SettingGetResponse.WorkersD1Binding - | SettingGetResponse.WorkersDispatchNamespaceBinding - | SettingGetResponse.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: SettingGetResponse.WorkersSingleStepMigrations | SettingGetResponse.WorkersSteppedMigrations; - - placement?: SettingGetResponse.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace SettingGetResponse { - export interface WorkersKVNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace identifier tag. - */ - namespace_id: string; - - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * Namespace identifier tag. - */ - namespace_id?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * A JavaScript variable name for the binding. - */ - binding: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; /** - * A single set of migrations to apply. + * List of Workers that will consume logs from the attached Worker. */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } + tail_consumers?: Array; +} - export interface WorkersSteppedMigrations { +export namespace SettingEditResponse { + /** + * A reference to a script that will consume logs from the attached Worker. + */ + export interface TailConsumer { /** - * Tag to set as the latest migration tag. + * Name of Worker that is to be the consumer. */ - new_tag?: string; + service: string; /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. + * Optional environment if the Worker utilizes one. */ - old_tag?: string; + environment?: string; /** - * Migrations to apply in order. + * Optional dispatch namespace the script belongs to. */ - steps?: Array; + namespace?: string; } +} - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } +export interface SettingGetResponse { + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; +} +export namespace SettingGetResponse { /** * A reference to a script that will consume logs from the attached Worker. */ @@ -881,333 +151,18 @@ export namespace SettingEditParams { } export interface Result { - /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | Result.WorkersKVNamespaceBinding - | Result.WorkersServiceBinding - | Result.WorkersDoBinding - | Result.WorkersR2Binding - | Result.WorkersQueueBinding - | Result.WorkersD1Binding - | Result.WorkersDispatchNamespaceBinding - | Result.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - /** * Whether Logpush is turned on for the Worker. */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: Result.WorkersSingleStepMigrations | Result.WorkersSteppedMigrations; - - placement?: Result.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - /** * List of Workers that will consume logs from the attached Worker. */ tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; } export namespace Result { - export interface WorkersKVNamespaceBinding { - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } - - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - /** * A reference to a script that will consume logs from the attached Worker. */ diff --git a/src/resources/workers/scripts/settings.ts b/src/resources/workers/scripts/settings.ts index 5062965398..6ebad379a8 100644 --- a/src/resources/workers/scripts/settings.ts +++ b/src/resources/workers/scripts/settings.ts @@ -7,7 +7,7 @@ import { multipartFormRequestOptions } from 'cloudflare/core'; export class Settings extends APIResource { /** - * Patch script metadata or config, such as bindings or usage model + * Patch metadata or config, such as bindings or usage model */ edit( scriptName: string, @@ -24,7 +24,7 @@ export class Settings extends APIResource { } /** - * Get script metadata and config, such as bindings or usage model + * Get metadata and config, such as bindings or usage model */ get( scriptName: string, @@ -853,242 +853,285 @@ export interface SettingEditParams { export namespace SettingEditParams { export interface Settings { - errors: Array; + /** + * List of bindings attached to this Worker + */ + bindings?: Array< + | Settings.WorkersKVNamespaceBinding + | Settings.WorkersServiceBinding + | Settings.WorkersDoBinding + | Settings.WorkersR2Binding + | Settings.WorkersQueueBinding + | Settings.WorkersD1Binding + | Settings.WorkersDispatchNamespaceBinding + | Settings.WorkersMTLSCERTBinding + >; + + /** + * Opt your Worker into changes after this date + */ + compatibility_date?: string; + + /** + * Opt your Worker into specific changes + */ + compatibility_flags?: Array; - messages: Array; + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; - result: Settings.Result; + /** + * Migrations to apply for Durable Objects associated with this Worker. + */ + migrations?: Settings.WorkersSingleStepMigrations | Settings.WorkersSteppedMigrations; + + placement?: Settings.Placement; /** - * Whether the API call was successful + * Tags to help you manage your Workers */ - success: true; + tags?: Array; + + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; + + /** + * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). + */ + usage_model?: string; } export namespace Settings { - export interface Error { - code: number; - - message: string; + export interface WorkersKVNamespaceBinding { + /** + * The class of resource that the binding provides. + */ + type: 'kv_namespace'; } - export interface Message { - code: number; + export interface WorkersServiceBinding { + /** + * Optional environment if the Worker utilizes one. + */ + environment: string; - message: string; - } + /** + * Name of Worker to bind to + */ + service: string; - export interface Result { /** - * List of bindings attached to this Worker + * The class of resource that the binding provides. */ - bindings?: Array< - | Result.WorkersKVNamespaceBinding - | Result.WorkersServiceBinding - | Result.WorkersDoBinding - | Result.WorkersR2Binding - | Result.WorkersQueueBinding - | Result.WorkersD1Binding - | Result.WorkersDispatchNamespaceBinding - | Result.WorkersMTLSCERTBinding - >; + type: 'service'; + } + export interface WorkersDoBinding { /** - * Opt your Worker into changes after this date + * The exported class name of the Durable Object */ - compatibility_date?: string; + class_name: string; /** - * Opt your Worker into specific changes + * The class of resource that the binding provides. */ - compatibility_flags?: Array; + type: 'durable_object_namespace'; /** - * Whether Logpush is turned on for the Worker. + * The environment of the script_name to bind to */ - logpush?: boolean; + environment?: string; /** - * Migrations to apply for Durable Objects associated with this Worker. + * The script where the Durable Object is defined, if it is external to this Worker */ - migrations?: Result.WorkersSingleStepMigrations | Result.WorkersSteppedMigrations; + script_name?: string; + } - placement?: Result.Placement; + export interface WorkersR2Binding { + /** + * R2 bucket to bind to + */ + bucket_name: string; /** - * Tags to help you manage your Workers + * The class of resource that the binding provides. */ - tags?: Array; + type: 'r2_bucket'; + } + export interface WorkersQueueBinding { /** - * List of Workers that will consume logs from the attached Worker. + * Name of the Queue to bind to */ - tail_consumers?: Array; + queue_name: string; /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). + * The class of resource that the binding provides. */ - usage_model?: string; + type: 'queue'; } - export namespace Result { - export interface WorkersKVNamespaceBinding { - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } + export interface WorkersD1Binding { + /** + * ID of the D1 database to bind to + */ + id: string; - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; + /** + * The name of the D1 database associated with the 'id' provided. + */ + name: string; - /** - * Name of Worker to bind to - */ - service: string; + /** + * The class of resource that the binding provides. + */ + type: 'd1'; + } - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } + export interface WorkersDispatchNamespaceBinding { + /** + * Namespace to bind to + */ + namespace: string; - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; + /** + * The class of resource that the binding provides. + */ + type: 'dispatch_namespace'; - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; + /** + * Outbound worker + */ + outbound?: WorkersDispatchNamespaceBinding.Outbound; + } + export namespace WorkersDispatchNamespaceBinding { + /** + * Outbound worker + */ + export interface Outbound { /** - * The environment of the script_name to bind to + * Pass information from the Dispatch Worker to the Outbound Worker through the + * parameters */ - environment?: string; + params?: Array; /** - * The script where the Durable Object is defined, if it is external to this Worker + * Outbound worker */ - script_name?: string; + worker?: Outbound.Worker; } - export interface WorkersR2Binding { + export namespace Outbound { /** - * R2 bucket to bind to + * Outbound worker */ - bucket_name: string; + export interface Worker { + /** + * Environment of the outbound worker + */ + environment?: string; - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; + /** + * Name of the outbound worker + */ + service?: string; + } } + } - export interface WorkersQueueBinding { - /** - * Name of the Queue to bind to - */ - queue_name: string; + export interface WorkersMTLSCERTBinding { + certificate: unknown; - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } + /** + * The class of resource that the binding provides. + */ + type: 'mtls_certificate'; - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; + /** + * ID of the certificate to bind to + */ + certificate_id?: string; + } - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; + /** + * A single set of migrations to apply. + */ + export interface WorkersSingleStepMigrations { + /** + * A list of classes to delete Durable Object namespaces from. + */ + deleted_classes?: Array; - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } + /** + * A list of classes to create Durable Object namespaces from. + */ + new_classes?: Array; - export interface WorkersDispatchNamespaceBinding { - /** - * Namespace to bind to - */ - namespace: string; + /** + * Tag to set as the latest migration tag. + */ + new_tag?: string; - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; + /** + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. + */ + old_tag?: string; - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } + /** + * A list of classes with Durable Object namespaces that were renamed. + */ + renamed_classes?: Array; - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; + /** + * A list of transfers for Durable Object namespaces from a different Worker and + * class to a class defined in this Worker. + */ + transferred_classes?: Array; + } - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } + export namespace WorkersSingleStepMigrations { + export interface RenamedClass { + from?: string; - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } + to?: string; } - export interface WorkersMTLSCERTBinding { - certificate: unknown; + export interface TransferredClass { + from?: string; - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; + from_script?: string; - /** - * ID of the certificate to bind to - */ - certificate_id?: string; + to?: string; } + } + export interface WorkersSteppedMigrations { /** - * A single set of migrations to apply. + * Tag to set as the latest migration tag. */ - export interface WorkersSingleStepMigrations { + new_tag?: string; + + /** + * Tag used to verify against the latest migration tag for this Worker. If they + * don't match, the upload is rejected. + */ + old_tag?: string; + + /** + * Migrations to apply in order. + */ + steps?: Array; + } + + export namespace WorkersSteppedMigrations { + export interface Step { /** * A list of classes to delete Durable Object namespaces from. */ @@ -1099,30 +1142,19 @@ export namespace SettingEditParams { */ new_classes?: Array; - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - /** * A list of classes with Durable Object namespaces that were renamed. */ - renamed_classes?: Array; + renamed_classes?: Array; /** * A list of transfers for Durable Object namespaces from a different Worker and * class to a class defined in this Worker. */ - transferred_classes?: Array; + transferred_classes?: Array; } - export namespace WorkersSingleStepMigrations { + export namespace Step { export interface RenamedClass { from?: string; @@ -1137,94 +1169,35 @@ export namespace SettingEditParams { to?: string; } } + } - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } + export interface Placement { + /** + * Enables + * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + * Only `"smart"` is currently supported + */ + mode?: 'smart'; + } + /** + * A reference to a script that will consume logs from the attached Worker. + */ + export interface TailConsumer { /** - * A reference to a script that will consume logs from the attached Worker. + * Name of Worker that is to be the consumer. */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; + service: string; - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } + /** + * Optional dispatch namespace the script belongs to. + */ + namespace?: string; } } } diff --git a/src/resources/workers/services/environments/settings.ts b/src/resources/workers/services/environments/settings.ts index 624cfd736a..e908d94bd6 100644 --- a/src/resources/workers/services/environments/settings.ts +++ b/src/resources/workers/services/environments/settings.ts @@ -44,781 +44,51 @@ export class Settings extends APIResource { export interface SettingEditResponse { /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | SettingEditResponse.WorkersKVNamespaceBinding - | SettingEditResponse.WorkersServiceBinding - | SettingEditResponse.WorkersDoBinding - | SettingEditResponse.WorkersR2Binding - | SettingEditResponse.WorkersQueueBinding - | SettingEditResponse.WorkersD1Binding - | SettingEditResponse.WorkersDispatchNamespaceBinding - | SettingEditResponse.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: SettingEditResponse.WorkersSingleStepMigrations | SettingEditResponse.WorkersSteppedMigrations; - - placement?: SettingEditResponse.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace SettingEditResponse { - export interface WorkersKVNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace identifier tag. - */ - namespace_id: string; - - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * Namespace identifier tag. - */ - namespace_id?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * A JavaScript variable name for the binding. - */ - binding: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } - - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - - /** - * A reference to a script that will consume logs from the attached Worker. - */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } -} - -export interface SettingGetResponse { - /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | SettingGetResponse.WorkersKVNamespaceBinding - | SettingGetResponse.WorkersServiceBinding - | SettingGetResponse.WorkersDoBinding - | SettingGetResponse.WorkersR2Binding - | SettingGetResponse.WorkersQueueBinding - | SettingGetResponse.WorkersD1Binding - | SettingGetResponse.WorkersDispatchNamespaceBinding - | SettingGetResponse.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: SettingGetResponse.WorkersSingleStepMigrations | SettingGetResponse.WorkersSteppedMigrations; - - placement?: SettingGetResponse.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace SettingGetResponse { - export interface WorkersKVNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace identifier tag. - */ - namespace_id: string; - - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * Namespace identifier tag. - */ - namespace_id?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * A JavaScript variable name for the binding. - */ - binding: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * A JavaScript variable name for the binding. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; /** - * A single set of migrations to apply. + * List of Workers that will consume logs from the attached Worker. */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } + tail_consumers?: Array; +} - export interface WorkersSteppedMigrations { +export namespace SettingEditResponse { + /** + * A reference to a script that will consume logs from the attached Worker. + */ + export interface TailConsumer { /** - * Tag to set as the latest migration tag. + * Name of Worker that is to be the consumer. */ - new_tag?: string; + service: string; /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. + * Optional environment if the Worker utilizes one. */ - old_tag?: string; + environment?: string; /** - * Migrations to apply in order. + * Optional dispatch namespace the script belongs to. */ - steps?: Array; + namespace?: string; } +} - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } +export interface SettingGetResponse { + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; +} +export namespace SettingGetResponse { /** * A reference to a script that will consume logs from the attached Worker. */ @@ -881,333 +151,18 @@ export namespace SettingEditParams { } export interface Result { - /** - * List of bindings attached to this Worker - */ - bindings?: Array< - | Result.WorkersKVNamespaceBinding - | Result.WorkersServiceBinding - | Result.WorkersDoBinding - | Result.WorkersR2Binding - | Result.WorkersQueueBinding - | Result.WorkersD1Binding - | Result.WorkersDispatchNamespaceBinding - | Result.WorkersMTLSCERTBinding - >; - - /** - * Opt your Worker into changes after this date - */ - compatibility_date?: string; - - /** - * Opt your Worker into specific changes - */ - compatibility_flags?: Array; - /** * Whether Logpush is turned on for the Worker. */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: Result.WorkersSingleStepMigrations | Result.WorkersSteppedMigrations; - - placement?: Result.Placement; - - /** - * Tags to help you manage your Workers - */ - tags?: Array; - /** * List of Workers that will consume logs from the attached Worker. */ tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; } export namespace Result { - export interface WorkersKVNamespaceBinding { - /** - * The class of resource that the binding provides. - */ - type: 'kv_namespace'; - } - - export interface WorkersServiceBinding { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; - - /** - * Name of Worker to bind to - */ - service: string; - - /** - * The class of resource that the binding provides. - */ - type: 'service'; - } - - export interface WorkersDoBinding { - /** - * The exported class name of the Durable Object - */ - class_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'durable_object_namespace'; - - /** - * The environment of the script_name to bind to - */ - environment?: string; - - /** - * The script where the Durable Object is defined, if it is external to this Worker - */ - script_name?: string; - } - - export interface WorkersR2Binding { - /** - * R2 bucket to bind to - */ - bucket_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'r2_bucket'; - } - - export interface WorkersQueueBinding { - /** - * Name of the Queue to bind to - */ - queue_name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'queue'; - } - - export interface WorkersD1Binding { - /** - * ID of the D1 database to bind to - */ - id: string; - - /** - * The name of the D1 database associated with the 'id' provided. - */ - name: string; - - /** - * The class of resource that the binding provides. - */ - type: 'd1'; - } - - export interface WorkersDispatchNamespaceBinding { - /** - * Namespace to bind to - */ - namespace: string; - - /** - * The class of resource that the binding provides. - */ - type: 'dispatch_namespace'; - - /** - * Outbound worker - */ - outbound?: WorkersDispatchNamespaceBinding.Outbound; - } - - export namespace WorkersDispatchNamespaceBinding { - /** - * Outbound worker - */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters - */ - params?: Array; - - /** - * Outbound worker - */ - worker?: Outbound.Worker; - } - - export namespace Outbound { - /** - * Outbound worker - */ - export interface Worker { - /** - * Environment of the outbound worker - */ - environment?: string; - - /** - * Name of the outbound worker - */ - service?: string; - } - } - } - - export interface WorkersMTLSCERTBinding { - certificate: unknown; - - /** - * The class of resource that the binding provides. - */ - type: 'mtls_certificate'; - - /** - * ID of the certificate to bind to - */ - certificate_id?: string; - } - - /** - * A single set of migrations to apply. - */ - export interface WorkersSingleStepMigrations { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace WorkersSingleStepMigrations { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - - export interface WorkersSteppedMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - - export namespace WorkersSteppedMigrations { - export interface Step { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; - } - - export namespace Step { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } - } - } - - export interface Placement { - /** - * Enables - * [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - * Only `"smart"` is currently supported - */ - mode?: 'smart'; - } - /** * A reference to a script that will consume logs from the attached Worker. */ diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts index 02f81d26a6..9b58738424 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts @@ -58,38 +58,12 @@ describe('resource settings', () => { { code: 1000, message: 'string' }, ], result: { - bindings: [{ type: 'kv_namespace' }, { type: 'kv_namespace' }, { type: 'kv_namespace' }], - compatibility_date: '2022-04-05', - compatibility_flags: [ - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', - ], logpush: false, - migrations: { - new_tag: 'v2', - old_tag: 'v1', - deleted_classes: ['string', 'string', 'string'], - new_classes: ['string', 'string', 'string'], - renamed_classes: [ - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - ], - transferred_classes: [ - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - ], - }, - placement: { mode: 'smart' }, - tags: ['my-tag', 'my-tag', 'my-tag'], tail_consumers: [ { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, ], - usage_model: 'unbound', }, success: true, }, diff --git a/tests/api-resources/workers/scripts/settings.test.ts b/tests/api-resources/workers/scripts/settings.test.ts index b1780aa700..f301b65e17 100644 --- a/tests/api-resources/workers/scripts/settings.test.ts +++ b/tests/api-resources/workers/scripts/settings.test.ts @@ -29,51 +29,38 @@ describe('resource settings', () => { const response = await cloudflare.workers.scripts.settings.edit('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', settings: { - errors: [ - { code: 1000, message: 'string' }, - { code: 1000, message: 'string' }, - { code: 1000, message: 'string' }, + bindings: [{ type: 'kv_namespace' }, { type: 'kv_namespace' }, { type: 'kv_namespace' }], + compatibility_date: '2022-04-05', + compatibility_flags: [ + 'formdata_parser_supports_files', + 'formdata_parser_supports_files', + 'formdata_parser_supports_files', ], - messages: [ - { code: 1000, message: 'string' }, - { code: 1000, message: 'string' }, - { code: 1000, message: 'string' }, - ], - result: { - bindings: [{ type: 'kv_namespace' }, { type: 'kv_namespace' }, { type: 'kv_namespace' }], - compatibility_date: '2022-04-05', - compatibility_flags: [ - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', + logpush: false, + migrations: { + new_tag: 'v2', + old_tag: 'v1', + deleted_classes: ['string', 'string', 'string'], + new_classes: ['string', 'string', 'string'], + renamed_classes: [ + { from: 'string', to: 'string' }, + { from: 'string', to: 'string' }, + { from: 'string', to: 'string' }, ], - logpush: false, - migrations: { - new_tag: 'v2', - old_tag: 'v1', - deleted_classes: ['string', 'string', 'string'], - new_classes: ['string', 'string', 'string'], - renamed_classes: [ - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - ], - transferred_classes: [ - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - ], - }, - placement: { mode: 'smart' }, - tags: ['my-tag', 'my-tag', 'my-tag'], - tail_consumers: [ - { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, - { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, - { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, + transferred_classes: [ + { from: 'string', from_script: 'string', to: 'string' }, + { from: 'string', from_script: 'string', to: 'string' }, + { from: 'string', from_script: 'string', to: 'string' }, ], - usage_model: 'unbound', }, - success: true, + placement: { mode: 'smart' }, + tags: ['my-tag', 'my-tag', 'my-tag'], + tail_consumers: [ + { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, + { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, + { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, + ], + usage_model: 'unbound', }, }); }); diff --git a/tests/api-resources/workers/services/environments/settings.test.ts b/tests/api-resources/workers/services/environments/settings.test.ts index 4b3874a091..2bdcdd4a9f 100644 --- a/tests/api-resources/workers/services/environments/settings.test.ts +++ b/tests/api-resources/workers/services/environments/settings.test.ts @@ -55,38 +55,12 @@ describe('resource settings', () => { { code: 1000, message: 'string' }, ], result: { - bindings: [{ type: 'kv_namespace' }, { type: 'kv_namespace' }, { type: 'kv_namespace' }], - compatibility_date: '2022-04-05', - compatibility_flags: [ - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', - 'formdata_parser_supports_files', - ], logpush: false, - migrations: { - new_tag: 'v2', - old_tag: 'v1', - deleted_classes: ['string', 'string', 'string'], - new_classes: ['string', 'string', 'string'], - renamed_classes: [ - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - { from: 'string', to: 'string' }, - ], - transferred_classes: [ - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - { from: 'string', from_script: 'string', to: 'string' }, - ], - }, - placement: { mode: 'smart' }, - tags: ['my-tag', 'my-tag', 'my-tag'], tail_consumers: [ { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, { environment: 'production', namespace: 'my-namespace', service: 'my-log-consumer' }, ], - usage_model: 'unbound', }, success: true, });