// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { additionalRoutes: "additional_routes", cookieAttributes: "cookie_attributes", cookieSuffix: "cookie_suffix", createdOn: "created_on", customHtml: "custom_html", customPageHtml: "custom_page_html", defaultTemplateLanguage: "default_template_language", disableSessionRenewal: "disable_session_renewal", enabledOriginCommands: "enabled_origin_commands", estimatedQueuedUsers: "estimated_queued_users", estimatedTotalActiveUsers: "estimated_total_active_users", eventEndTime: "event_end_time", eventId: "event_id", eventStartTime: "event_start_time", jsonResponseEnabled: "json_response_enabled", lastUpdated: "last_updated", maxEstimatedTimeMinutes: "max_estimated_time_minutes", modifiedOn: "modified_on", newUsersPerMinute: "new_users_per_minute", nextEventPrequeueStartTime: "next_event_prequeue_start_time", nextEventStartTime: "next_event_start_time", perPage: "per_page", prequeueStartTime: "prequeue_start_time", previewUrl: "preview_url", queueAll: "queue_all", queueingMethod: "queueing_method", queueingStatusCode: "queueing_status_code", resultInfo: "result_info", searchEngineCrawlerBypass: "search_engine_crawler_bypass", sessionDuration: "session_duration", shuffleAtEventStart: "shuffle_at_event_start", totalActiveUsers: "total_active_users", totalCount: "total_count", turnstileAction: "turnstile_action", turnstileMode: "turnstile_mode", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class WaitingRoomNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("WaitingRoomNotFound", { code: S.Number, message: S.String, }), [{ code: 1001 }], ) {} export class ZoneNotEntitled extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("ZoneNotEntitled", { code: S.Number, message: S.String, }), [{ code: 1034 }], ) {} export type EventsCreateRequestTurnstileAction = "log" | "infinite_queue"; export const EventsCreateRequestTurnstileAction = /*@__PURE__*/ S.String; export type EventsCreateRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsCreateRequestTurnstileMode = /*@__PURE__*/ S.String; export interface CreateEventRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime: string; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime: string; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string; /** A note that you can use to add more details about the event. */ description?: string; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsCreateRequestTurnstileAction | (string & {}); /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsCreateRequestTurnstileMode | (string & {}); } export const CreateEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventEndTime: S.String.pipe(T.Body("event_end_time")), eventStartTime: S.String.pipe(T.Body("event_start_time")), name: S.String, customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), newUsersPerMinute: S.optional( S.Number.pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional(S.String.pipe(T.Body("prequeue_start_time"))), queueingMethod: S.optional(S.String.pipe(T.Body("queueing_method"))), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), shuffleAtEventStart: S.optional( S.Boolean.pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.Boolean), totalActiveUsers: S.optional(S.Number.pipe(T.Body("total_active_users"))), turnstileAction: S.optional( EventsCreateRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( EventsCreateRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateEventRequest", }) as any as S.Schema; export type EventsCreateResponseTurnstileAction = "log" | "infinite_queue"; export const EventsCreateResponseTurnstileAction = /*@__PURE__*/ S.String; export type EventsCreateResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsCreateResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateEventResponse { id?: string | null; createdOn?: string | null; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string | null; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number | null; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsCreateResponseTurnstileAction | null; /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsCreateResponseTurnstileMode | null; } export const CreateEventResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EventsCreateResponseTurnstileAction).pipe( T.Body("turnstile_action"), ), ), turnstileMode: S.optional( S.NullOr(EventsCreateResponseTurnstileMode).pipe( T.Body("turnstile_mode"), ), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateEventResponse", }) as any as S.Schema; export type RulesCreateRequestRulesAction = "bypass_waiting_room"; export const RulesCreateRequestRulesAction = /*@__PURE__*/ S.String; export interface RulesCreateRequestRules { /** The action to take when the expression matches. */ action: RulesCreateRequestRulesAction | (string & {}); /** Criteria defining when there is a match for the current rule. */ expression: string; /** The description of the rule. */ description?: string; /** When set to true, the rule is enabled. */ enabled?: boolean; } export const RulesCreateRequestRules = /*@__PURE__*/ S.suspend(() => S.Struct({ action: RulesCreateRequestRulesAction, expression: S.String, description: S.optional(S.String), enabled: S.optional(S.Boolean), }), ).annotate({ identifier: "RulesCreateRequestRules", }) as any as S.Schema; export interface CreateRuleRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; rules: RulesCreateRequestRules; } export const CreateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), rules: RulesCreateRequestRules, }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleRequest", }) as any as S.Schema; export type RulesCreateResultItemAction = "bypass_waiting_room"; export const RulesCreateResultItemAction = /*@__PURE__*/ S.String; export interface RulesCreateResultItem { /** The ID of the rule. */ id?: string | null; /** The action to take when the expression matches. */ action?: RulesCreateResultItemAction | null; /** The description of the rule. */ description?: string | null; /** When set to true, the rule is enabled. */ enabled?: boolean | null; /** Criteria defining when there is a match for the current rule. */ expression?: string | null; lastUpdated?: string | null; /** The version of the rule. */ version?: string | null; } export const RulesCreateResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesCreateResultItemAction)), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), expression: S.optional(S.NullOr(S.String)), lastUpdated: S.optional(S.NullOr(S.String).pipe(T.Body("last_updated"))), version: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesCreateResultItem", }) as any as S.Schema; export type RulesCreateResultList = Array; export const RulesCreateResultList = /*@__PURE__*/ S.Array( RulesCreateResultItem, ) as any as S.Schema; export interface CreateRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesCreateResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const CreateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesCreateResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRuleResponse", }) as any as S.Schema; export interface CreateRequestAdditionalRoutesItem { /** The hostname to which this waiting room will be applied (no wildcards). The hostname must be the primary domain, subdomain, or custom hostname (if using SSL for SaaS) of this zone. Please do not include the scheme (http:// or https://). */ host?: string; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string; } export const CreateRequestAdditionalRoutesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional(S.String), path: S.optional(S.String), }), ).annotate({ identifier: "CreateRequestAdditionalRoutesItem", }) as any as S.Schema; export type CreateRequestAdditionalRoutesList = Array; export const CreateRequestAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateRequestAdditionalRoutesItem, ) as any as S.Schema; export type CreateRequestCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const CreateRequestCookieAttributesSamesite = /*@__PURE__*/ S.String; export type CreateRequestCookieAttributesSecure = "auto" | "always" | "never"; export const CreateRequestCookieAttributesSecure = /*@__PURE__*/ S.String; export interface CreateRequestCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: CreateRequestCookieAttributesSamesite | (string & {}); /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: CreateRequestCookieAttributesSecure | (string & {}); } export const CreateRequestCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(CreateRequestCookieAttributesSamesite), secure: S.optional(CreateRequestCookieAttributesSecure), }), ).annotate({ identifier: "CreateRequestCookieAttributes", }) as any as S.Schema; export type CreateRequestDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const CreateRequestDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type CreateRequestEnabledOriginCommandsItem = "revoke"; export const CreateRequestEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type CreateRequestEnabledOriginCommandsList = Array< CreateRequestEnabledOriginCommandsItem | (string & {}) >; export const CreateRequestEnabledOriginCommandsList = /*@__PURE__*/ S.Array( CreateRequestEnabledOriginCommandsItem, ) as any as S.Schema; export type CreateRequestQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const CreateRequestQueueingMethod = /*@__PURE__*/ S.String; export type CreateRequestQueueingStatusCode = 200 | 202 | 429; export const CreateRequestQueueingStatusCode = /*@__PURE__*/ S.Number; export type CreateRequestTurnstileAction = "log" | "infinite_queue"; export const CreateRequestTurnstileAction = /*@__PURE__*/ S.String; export type CreateRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const CreateRequestTurnstileMode = /*@__PURE__*/ S.String; export interface CreateWaitingRoomRequest { /** Identifier. */ zoneId: string; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host: string; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute: number; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers: number; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: CreateRequestAdditionalRoutesList; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: CreateRequestCookieAttributes; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: | CreateRequestDefaultTemplateLanguage | (string & {}); /** A note that you can use to add more details about the waiting room. */ description?: string; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean; /** A list of enabled origin commands. */ enabledOriginCommands?: CreateRequestEnabledOriginCommandsList; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: CreateRequestQueueingMethod | (string & {}); /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: CreateRequestQueueingStatusCode | (number & {}); /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: CreateRequestTurnstileAction | (string & {}); /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: CreateRequestTurnstileMode | (string & {}); } export const CreateWaitingRoomRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), host: S.String, name: S.String, newUsersPerMinute: S.Number.pipe(T.Body("new_users_per_minute")), totalActiveUsers: S.Number.pipe(T.Body("total_active_users")), additionalRoutes: S.optional( CreateRequestAdditionalRoutesList.pipe(T.Body("additional_routes")), ), cookieAttributes: S.optional( CreateRequestCookieAttributes.pipe(T.Body("cookie_attributes")), ), cookieSuffix: S.optional(S.String.pipe(T.Body("cookie_suffix"))), customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), defaultTemplateLanguage: S.optional( CreateRequestDefaultTemplateLanguage.pipe( T.Body("default_template_language"), ), ), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( CreateRequestEnabledOriginCommandsList.pipe( T.Body("enabled_origin_commands"), ), ), jsonResponseEnabled: S.optional( S.Boolean.pipe(T.Body("json_response_enabled")), ), path: S.optional(S.String), queueAll: S.optional(S.Boolean.pipe(T.Body("queue_all"))), queueingMethod: S.optional( CreateRequestQueueingMethod.pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( CreateRequestQueueingStatusCode.pipe(T.Body("queueing_status_code")), ), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), suspended: S.optional(S.Boolean), turnstileAction: S.optional( CreateRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( CreateRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/waiting_rooms", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateWaitingRoomRequest", }) as any as S.Schema; export interface CreateResponseAdditionalRoutesItem { /** The hostname to which this waiting room will be applied (no wildcards). The hostname must be the primary domain, subdomain, or custom hostname (if using SSL for SaaS) of this zone. Please do not include the scheme (http:// or https://). */ host?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; } export const CreateResponseAdditionalRoutesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ host: S.optional(S.NullOr(S.String)), path: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreateResponseAdditionalRoutesItem", }) as any as S.Schema; export type CreateResponseAdditionalRoutesList = Array; export const CreateResponseAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateResponseAdditionalRoutesItem, ) as any as S.Schema; export type CreateResponseCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const CreateResponseCookieAttributesSamesite = /*@__PURE__*/ S.String; export type CreateResponseCookieAttributesSecure = "auto" | "always" | "never"; export const CreateResponseCookieAttributesSecure = /*@__PURE__*/ S.String; export interface CreateResponseCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: CreateResponseCookieAttributesSamesite | null; /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: CreateResponseCookieAttributesSecure | null; } export const CreateResponseCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(S.NullOr(CreateResponseCookieAttributesSamesite)), secure: S.optional(S.NullOr(CreateResponseCookieAttributesSecure)), }), ).annotate({ identifier: "CreateResponseCookieAttributes", }) as any as S.Schema; export type CreateResponseDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const CreateResponseDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type CreateResponseEnabledOriginCommandsItem = "revoke"; export const CreateResponseEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type CreateResponseEnabledOriginCommandsList = Array; export const CreateResponseEnabledOriginCommandsList = /*@__PURE__*/ S.Array( CreateResponseEnabledOriginCommandsItem, ) as any as S.Schema; export type CreateResponseQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const CreateResponseQueueingMethod = /*@__PURE__*/ S.String; export type CreateResponseQueueingStatusCode = 200 | 202 | 429; export const CreateResponseQueueingStatusCode = /*@__PURE__*/ S.Number; export type CreateResponseTurnstileAction = "log" | "infinite_queue"; export const CreateResponseTurnstileAction = /*@__PURE__*/ S.String; export type CreateResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const CreateResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateWaitingRoomResponse { id?: string | null; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: CreateResponseAdditionalRoutesList | null; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: CreateResponseCookieAttributes | null; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string | null; createdOn?: string | null; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string | null; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: CreateResponseDefaultTemplateLanguage | null; /** A note that you can use to add more details about the waiting room. */ description?: string | null; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean | null; /** A list of enabled origin commands. */ enabledOriginCommands?: CreateResponseEnabledOriginCommandsList | null; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host?: string | null; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean | null; modifiedOn?: string | null; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when the next event will begin queueing. */ nextEventPrequeueStartTime?: string | null; /** An ISO 8601 timestamp that marks when the next event will start. */ nextEventStartTime?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean | null; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: CreateResponseQueueingMethod | null; /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: CreateResponseQueueingStatusCode | null; /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number | null; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean | null; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers?: number | null; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: CreateResponseTurnstileAction | null; /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: CreateResponseTurnstileMode | null; } export const CreateWaitingRoomResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), additionalRoutes: S.optional( S.NullOr(CreateResponseAdditionalRoutesList).pipe( T.Body("additional_routes"), ), ), cookieAttributes: S.optional( S.NullOr(CreateResponseCookieAttributes).pipe( T.Body("cookie_attributes"), ), ), cookieSuffix: S.optional(S.NullOr(S.String).pipe(T.Body("cookie_suffix"))), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), defaultTemplateLanguage: S.optional( S.NullOr(CreateResponseDefaultTemplateLanguage).pipe( T.Body("default_template_language"), ), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( S.NullOr(CreateResponseEnabledOriginCommandsList).pipe( T.Body("enabled_origin_commands"), ), ), host: S.optional(S.NullOr(S.String)), jsonResponseEnabled: S.optional( S.NullOr(S.Boolean).pipe(T.Body("json_response_enabled")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), nextEventPrequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_prequeue_start_time")), ), nextEventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_start_time")), ), path: S.optional(S.NullOr(S.String)), queueAll: S.optional(S.NullOr(S.Boolean).pipe(T.Body("queue_all"))), queueingMethod: S.optional( S.NullOr(CreateResponseQueueingMethod).pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( S.NullOr(CreateResponseQueueingStatusCode).pipe( T.Body("queueing_status_code"), ), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(CreateResponseTurnstileAction).pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( S.NullOr(CreateResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateWaitingRoomResponse", }) as any as S.Schema; export interface DeleteEventRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; eventId: string; } export const DeleteEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventId: S.String.pipe(T.Label("event_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteEventRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteEventResponse { id?: string | null; } export const DeleteEventResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteEventResponse", }) as any as S.Schema; export interface DeleteRuleRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** The ID of the rule. */ ruleId: string; } export const DeleteRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), ruleId: S.String.pipe(T.Label("rule_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleRequest", }) as any as S.Schema; export type RulesDeleteResultItemAction = "bypass_waiting_room"; export const RulesDeleteResultItemAction = /*@__PURE__*/ S.String; export interface RulesDeleteResultItem { /** The ID of the rule. */ id?: string | null; /** The action to take when the expression matches. */ action?: RulesDeleteResultItemAction | null; /** The description of the rule. */ description?: string | null; /** When set to true, the rule is enabled. */ enabled?: boolean | null; /** Criteria defining when there is a match for the current rule. */ expression?: string | null; lastUpdated?: string | null; /** The version of the rule. */ version?: string | null; } export const RulesDeleteResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesDeleteResultItemAction)), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), expression: S.optional(S.NullOr(S.String)), lastUpdated: S.optional(S.NullOr(S.String).pipe(T.Body("last_updated"))), version: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesDeleteResultItem", }) as any as S.Schema; export type RulesDeleteResultList = Array; export const RulesDeleteResultList = /*@__PURE__*/ S.Array( RulesDeleteResultItem, ) as any as S.Schema; export interface DeleteRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesDeleteResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const DeleteRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesDeleteResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRuleResponse", }) as any as S.Schema; export interface DeleteWaitingRoomRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; } export const DeleteWaitingRoomRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWaitingRoomRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteWaitingRoomResponse { id?: string | null; } export const DeleteWaitingRoomResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteWaitingRoomResponse", }) as any as S.Schema; export interface GetEventRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; eventId: string; } export const GetEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventId: S.String.pipe(T.Label("event_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEventRequest", }) as any as S.Schema; export type EventsGetResponseTurnstileAction = "log" | "infinite_queue"; export const EventsGetResponseTurnstileAction = /*@__PURE__*/ S.String; export type EventsGetResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsGetResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetEventResponse { id?: string | null; createdOn?: string | null; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string | null; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number | null; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsGetResponseTurnstileAction | null; /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsGetResponseTurnstileMode | null; } export const GetEventResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EventsGetResponseTurnstileAction).pipe( T.Body("turnstile_action"), ), ), turnstileMode: S.optional( S.NullOr(EventsGetResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEventResponse", }) as any as S.Schema; export interface GetEventDetailRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; eventId: string; } export const GetEventDetailRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventId: S.String.pipe(T.Label("event_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}/details", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEventDetailRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetEventDetailResponse { id?: string | null; createdOn?: string | null; customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; queueingMethod?: string | null; sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; totalActiveUsers?: number | null; } export const GetEventDetailResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetEventDetailResponse", }) as any as S.Schema; export interface GetRuleRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; } export const GetRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleRequest" }) as any as S.Schema; export type RulesGetResultItemAction = "bypass_waiting_room"; export const RulesGetResultItemAction = /*@__PURE__*/ S.String; export interface RulesGetResultItem { /** The ID of the rule. */ id?: string | null; /** The action to take when the expression matches. */ action?: RulesGetResultItemAction | null; /** The description of the rule. */ description?: string | null; /** When set to true, the rule is enabled. */ enabled?: boolean | null; /** Criteria defining when there is a match for the current rule. */ expression?: string | null; lastUpdated?: string | null; /** The version of the rule. */ version?: string | null; } export const RulesGetResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesGetResultItemAction)), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), expression: S.optional(S.NullOr(S.String)), lastUpdated: S.optional(S.NullOr(S.String).pipe(T.Body("last_updated"))), version: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesGetResultItem", }) as any as S.Schema; export type RulesGetResultList = Array; export const RulesGetResultList = /*@__PURE__*/ S.Array( RulesGetResultItem, ) as any as S.Schema; export interface GetRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesGetResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const GetRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesGetResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRuleResponse", }) as any as S.Schema; export interface GetSettingRequest { /** Identifier. */ zoneId: string; } export const GetSettingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/settings", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetSettingRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetSettingResponse { /** Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. */ searchEngineCrawlerBypass: boolean; } export const GetSettingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ searchEngineCrawlerBypass: S.Boolean.pipe( T.Body("search_engine_crawler_bypass"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetSettingResponse", }) as any as S.Schema; export interface GetStatusRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; } export const GetStatusRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/status", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStatusRequest", }) as any as S.Schema; export type StatusesGetResponseStatus = | "event_prequeueing" | "not_queueing" | "queueing" | "suspended"; export const StatusesGetResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetStatusResponse { estimatedQueuedUsers?: number | null; estimatedTotalActiveUsers?: number | null; eventId?: string | null; maxEstimatedTimeMinutes?: number | null; status?: StatusesGetResponseStatus | null; } export const GetStatusResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ estimatedQueuedUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("estimated_queued_users")), ), estimatedTotalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("estimated_total_active_users")), ), eventId: S.optional(S.NullOr(S.String).pipe(T.Body("event_id"))), maxEstimatedTimeMinutes: S.optional( S.NullOr(S.Number).pipe(T.Body("max_estimated_time_minutes")), ), status: S.optional(S.NullOr(StatusesGetResponseStatus)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStatusResponse", }) as any as S.Schema; export interface GetWaitingRoomRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; } export const GetWaitingRoomRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWaitingRoomRequest", }) as any as S.Schema; export type GetResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export const GetResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export type GetResponseAdditionalRoutesList = Array; export const GetResponseAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateResponseAdditionalRoutesItem, ) as any as S.Schema; export type GetResponseCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const GetResponseCookieAttributesSamesite = /*@__PURE__*/ S.String; export type GetResponseCookieAttributesSecure = "auto" | "always" | "never"; export const GetResponseCookieAttributesSecure = /*@__PURE__*/ S.String; export interface GetResponseCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: GetResponseCookieAttributesSamesite | null; /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: GetResponseCookieAttributesSecure | null; } export const GetResponseCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(S.NullOr(GetResponseCookieAttributesSamesite)), secure: S.optional(S.NullOr(GetResponseCookieAttributesSecure)), }), ).annotate({ identifier: "GetResponseCookieAttributes", }) as any as S.Schema; export type GetResponseDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const GetResponseDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type GetResponseEnabledOriginCommandsItem = "revoke"; export const GetResponseEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type GetResponseEnabledOriginCommandsList = Array; export const GetResponseEnabledOriginCommandsList = /*@__PURE__*/ S.Array( GetResponseEnabledOriginCommandsItem, ) as any as S.Schema; export type GetResponseQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const GetResponseQueueingMethod = /*@__PURE__*/ S.String; export type GetResponseQueueingStatusCode = 200 | 202 | 429; export const GetResponseQueueingStatusCode = /*@__PURE__*/ S.Number; export type GetResponseTurnstileAction = "log" | "infinite_queue"; export const GetResponseTurnstileAction = /*@__PURE__*/ S.String; export type GetResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const GetResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetWaitingRoomResponse { id?: string | null; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: GetResponseAdditionalRoutesList | null; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: GetResponseCookieAttributes | null; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string | null; createdOn?: string | null; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string | null; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: GetResponseDefaultTemplateLanguage | null; /** A note that you can use to add more details about the waiting room. */ description?: string | null; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean | null; /** A list of enabled origin commands. */ enabledOriginCommands?: GetResponseEnabledOriginCommandsList | null; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host?: string | null; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean | null; modifiedOn?: string | null; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when the next event will begin queueing. */ nextEventPrequeueStartTime?: string | null; /** An ISO 8601 timestamp that marks when the next event will start. */ nextEventStartTime?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean | null; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: GetResponseQueueingMethod | null; /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: GetResponseQueueingStatusCode | null; /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number | null; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean | null; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers?: number | null; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: GetResponseTurnstileAction | null; /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: GetResponseTurnstileMode | null; } export const GetWaitingRoomResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), additionalRoutes: S.optional( S.NullOr(GetResponseAdditionalRoutesList).pipe( T.Body("additional_routes"), ), ), cookieAttributes: S.optional( S.NullOr(GetResponseCookieAttributes).pipe(T.Body("cookie_attributes")), ), cookieSuffix: S.optional(S.NullOr(S.String).pipe(T.Body("cookie_suffix"))), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), defaultTemplateLanguage: S.optional( S.NullOr(GetResponseDefaultTemplateLanguage).pipe( T.Body("default_template_language"), ), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( S.NullOr(GetResponseEnabledOriginCommandsList).pipe( T.Body("enabled_origin_commands"), ), ), host: S.optional(S.NullOr(S.String)), jsonResponseEnabled: S.optional( S.NullOr(S.Boolean).pipe(T.Body("json_response_enabled")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), nextEventPrequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_prequeue_start_time")), ), nextEventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_start_time")), ), path: S.optional(S.NullOr(S.String)), queueAll: S.optional(S.NullOr(S.Boolean).pipe(T.Body("queue_all"))), queueingMethod: S.optional( S.NullOr(GetResponseQueueingMethod).pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( S.NullOr(GetResponseQueueingStatusCode).pipe( T.Body("queueing_status_code"), ), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(GetResponseTurnstileAction).pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( S.NullOr(GetResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetWaitingRoomResponse", }) as any as S.Schema; export interface ListEventsRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** Page number of paginated results. */ page?: number; /** Maximum number of results per page. Must be a multiple of 5. */ perPage?: number; } export const ListEventsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListEventsRequest", }) as any as S.Schema; export type EventsListResultItemTurnstileAction = "log" | "infinite_queue"; export const EventsListResultItemTurnstileAction = /*@__PURE__*/ S.String; export type EventsListResultItemTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsListResultItemTurnstileMode = /*@__PURE__*/ S.String; export interface EventsListResultItem { id?: string | null; createdOn?: string | null; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string | null; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number | null; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsListResultItemTurnstileAction | null; /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsListResultItemTurnstileMode | null; } export const EventsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EventsListResultItemTurnstileAction).pipe( T.Body("turnstile_action"), ), ), turnstileMode: S.optional( S.NullOr(EventsListResultItemTurnstileMode).pipe( T.Body("turnstile_mode"), ), ), }), ).annotate({ identifier: "EventsListResultItem", }) as any as S.Schema; export type EventsListResultList = Array; export const EventsListResultList = /*@__PURE__*/ S.Array( EventsListResultItem, ) as any as S.Schema; export interface ListEventsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: EventsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListEventsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: EventsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListEventsResponse", }) as any as S.Schema; export interface ListWaitingRoomsForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Page number of paginated results. */ page?: number; /** Maximum number of results per page. Must be a multiple of 5. */ perPage?: number; } export const ListWaitingRoomsForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/waiting_rooms", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWaitingRoomsForAccountRequest", }) as any as S.Schema; export type ListResultItemAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export const ListResultItemAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export type ListResultItemAdditionalRoutesList = Array; export const ListResultItemAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateResponseAdditionalRoutesItem, ) as any as S.Schema; export type ListResultItemCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const ListResultItemCookieAttributesSamesite = /*@__PURE__*/ S.String; export type ListResultItemCookieAttributesSecure = "auto" | "always" | "never"; export const ListResultItemCookieAttributesSecure = /*@__PURE__*/ S.String; export interface ListResultItemCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: ListResultItemCookieAttributesSamesite | null; /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: ListResultItemCookieAttributesSecure | null; } export const ListResultItemCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(S.NullOr(ListResultItemCookieAttributesSamesite)), secure: S.optional(S.NullOr(ListResultItemCookieAttributesSecure)), }), ).annotate({ identifier: "ListResultItemCookieAttributes", }) as any as S.Schema; export type ListResultItemDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const ListResultItemDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type ListResultItemEnabledOriginCommandsItem = "revoke"; export const ListResultItemEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type ListResultItemEnabledOriginCommandsList = Array; export const ListResultItemEnabledOriginCommandsList = /*@__PURE__*/ S.Array( ListResultItemEnabledOriginCommandsItem, ) as any as S.Schema; export type ListResultItemQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const ListResultItemQueueingMethod = /*@__PURE__*/ S.String; export type ListResultItemQueueingStatusCode = 200 | 202 | 429; export const ListResultItemQueueingStatusCode = /*@__PURE__*/ S.Number; export type ListResultItemTurnstileAction = "log" | "infinite_queue"; export const ListResultItemTurnstileAction = /*@__PURE__*/ S.String; export type ListResultItemTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const ListResultItemTurnstileMode = /*@__PURE__*/ S.String; export interface ListResultItem { id?: string | null; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: ListResultItemAdditionalRoutesList | null; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: ListResultItemCookieAttributes | null; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string | null; createdOn?: string | null; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string | null; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: ListResultItemDefaultTemplateLanguage | null; /** A note that you can use to add more details about the waiting room. */ description?: string | null; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean | null; /** A list of enabled origin commands. */ enabledOriginCommands?: ListResultItemEnabledOriginCommandsList | null; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host?: string | null; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean | null; modifiedOn?: string | null; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when the next event will begin queueing. */ nextEventPrequeueStartTime?: string | null; /** An ISO 8601 timestamp that marks when the next event will start. */ nextEventStartTime?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean | null; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: ListResultItemQueueingMethod | null; /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: ListResultItemQueueingStatusCode | null; /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number | null; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean | null; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers?: number | null; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: ListResultItemTurnstileAction | null; /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: ListResultItemTurnstileMode | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), additionalRoutes: S.optional( S.NullOr(ListResultItemAdditionalRoutesList).pipe( T.Body("additional_routes"), ), ), cookieAttributes: S.optional( S.NullOr(ListResultItemCookieAttributes).pipe( T.Body("cookie_attributes"), ), ), cookieSuffix: S.optional(S.NullOr(S.String).pipe(T.Body("cookie_suffix"))), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), defaultTemplateLanguage: S.optional( S.NullOr(ListResultItemDefaultTemplateLanguage).pipe( T.Body("default_template_language"), ), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( S.NullOr(ListResultItemEnabledOriginCommandsList).pipe( T.Body("enabled_origin_commands"), ), ), host: S.optional(S.NullOr(S.String)), jsonResponseEnabled: S.optional( S.NullOr(S.Boolean).pipe(T.Body("json_response_enabled")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), nextEventPrequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_prequeue_start_time")), ), nextEventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_start_time")), ), path: S.optional(S.NullOr(S.String)), queueAll: S.optional(S.NullOr(S.Boolean).pipe(T.Body("queue_all"))), queueingMethod: S.optional( S.NullOr(ListResultItemQueueingMethod).pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( S.NullOr(ListResultItemQueueingStatusCode).pipe( T.Body("queueing_status_code"), ), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(ListResultItemTurnstileAction).pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( S.NullOr(ListResultItemTurnstileMode).pipe(T.Body("turnstile_mode")), ), }), ).annotate({ identifier: "ListResultItem" }) as any as S.Schema; export type ListResultList = Array; export const ListResultList = /*@__PURE__*/ S.Array( ListResultItem, ) as any as S.Schema; export interface ListWaitingRoomsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListWaitingRoomsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWaitingRoomsResponse", }) as any as S.Schema; export interface ListWaitingRoomsForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Page number of paginated results. */ page?: number; /** Maximum number of results per page. Must be a multiple of 5. */ perPage?: number; } export const ListWaitingRoomsForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/waiting_rooms", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListWaitingRoomsForZoneRequest", }) as any as S.Schema; export type EventsEditRequestTurnstileAction = "log" | "infinite_queue"; export const EventsEditRequestTurnstileAction = /*@__PURE__*/ S.String; export type EventsEditRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsEditRequestTurnstileMode = /*@__PURE__*/ S.String; export interface PatchEventRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; eventId: string; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime: string; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime: string; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string; /** A note that you can use to add more details about the event. */ description?: string; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsEditRequestTurnstileAction | (string & {}); /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsEditRequestTurnstileMode | (string & {}); } export const PatchEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventId: S.String.pipe(T.Label("event_id")), eventEndTime: S.String.pipe(T.Body("event_end_time")), eventStartTime: S.String.pipe(T.Body("event_start_time")), name: S.String, customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), newUsersPerMinute: S.optional( S.Number.pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional(S.String.pipe(T.Body("prequeue_start_time"))), queueingMethod: S.optional(S.String.pipe(T.Body("queueing_method"))), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), shuffleAtEventStart: S.optional( S.Boolean.pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.Boolean), totalActiveUsers: S.optional(S.Number.pipe(T.Body("total_active_users"))), turnstileAction: S.optional( EventsEditRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( EventsEditRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchEventRequest", }) as any as S.Schema; export type EventsEditResponseTurnstileAction = "log" | "infinite_queue"; export const EventsEditResponseTurnstileAction = /*@__PURE__*/ S.String; export type EventsEditResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsEditResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchEventResponse { id?: string | null; createdOn?: string | null; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string | null; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number | null; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsEditResponseTurnstileAction | null; /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsEditResponseTurnstileMode | null; } export const PatchEventResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EventsEditResponseTurnstileAction).pipe( T.Body("turnstile_action"), ), ), turnstileMode: S.optional( S.NullOr(EventsEditResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchEventResponse", }) as any as S.Schema; export type RulesEditRequestAction = "bypass_waiting_room"; export const RulesEditRequestAction = /*@__PURE__*/ S.String; export interface RulesEditRequestPositionIndex { /** Places the rule in the exact position specified by the integer number . Position numbers start with 1. Existing rules in the ruleset from the specified position number onward are shifted one position (no rule is overwritten). */ index?: number; } export const RulesEditRequestPositionIndex = /*@__PURE__*/ S.suspend(() => S.Struct({ index: S.optional(S.Number), }), ).annotate({ identifier: "RulesEditRequestPositionIndex", }) as any as S.Schema; export interface RulesEditRequestPositionBefore { /** Places the rule before rule . Use this argument with an empty rule ID value ("") to set the rule as the first rule in the ruleset. */ before?: string; } export const RulesEditRequestPositionBefore = /*@__PURE__*/ S.suspend(() => S.Struct({ before: S.optional(S.String), }), ).annotate({ identifier: "RulesEditRequestPositionBefore", }) as any as S.Schema; export interface RulesEditRequestPositionAfter { /** Places the rule after rule . Use this argument with an empty rule ID value ("") to set the rule as the last rule in the ruleset. */ after?: string; } export const RulesEditRequestPositionAfter = /*@__PURE__*/ S.suspend(() => S.Struct({ after: S.optional(S.String), }), ).annotate({ identifier: "RulesEditRequestPositionAfter", }) as any as S.Schema; export type RulesEditRequestPosition = | RulesEditRequestPositionIndex | RulesEditRequestPositionBefore | RulesEditRequestPositionAfter; export const RulesEditRequestPosition = /*@__PURE__*/ S.Unknown.pipe( T.UnionCases([["index"], ["before"], ["after"]]), ); export interface PatchRuleRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** The ID of the rule. */ ruleId: string; /** The action to take when the expression matches. */ action: RulesEditRequestAction | (string & {}); /** Criteria defining when there is a match for the current rule. */ expression: string; /** The description of the rule. */ description?: string; /** When set to true, the rule is enabled. */ enabled?: boolean; /** Reorder the position of a rule */ position?: RulesEditRequestPosition; } export const PatchRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), ruleId: S.String.pipe(T.Label("rule_id")), action: RulesEditRequestAction, expression: S.String, description: S.optional(S.String), enabled: S.optional(S.Boolean), position: S.optional(RulesEditRequestPosition), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleRequest", }) as any as S.Schema; export type RulesEditResultItemAction = "bypass_waiting_room"; export const RulesEditResultItemAction = /*@__PURE__*/ S.String; export interface RulesEditResultItem { /** The ID of the rule. */ id?: string | null; /** The action to take when the expression matches. */ action?: RulesEditResultItemAction | null; /** The description of the rule. */ description?: string | null; /** When set to true, the rule is enabled. */ enabled?: boolean | null; /** Criteria defining when there is a match for the current rule. */ expression?: string | null; lastUpdated?: string | null; /** The version of the rule. */ version?: string | null; } export const RulesEditResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesEditResultItemAction)), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), expression: S.optional(S.NullOr(S.String)), lastUpdated: S.optional(S.NullOr(S.String).pipe(T.Body("last_updated"))), version: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesEditResultItem", }) as any as S.Schema; export type RulesEditResultList = Array; export const RulesEditResultList = /*@__PURE__*/ S.Array( RulesEditResultItem, ) as any as S.Schema; export interface PatchRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesEditResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const PatchRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesEditResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchRuleResponse", }) as any as S.Schema; export interface PatchSettingRequest { /** Identifier. */ zoneId: string; /** Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. */ searchEngineCrawlerBypass?: boolean; } export const PatchSettingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), searchEngineCrawlerBypass: S.optional( S.Boolean.pipe(T.Body("search_engine_crawler_bypass")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/waiting_rooms/settings", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchSettingRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchSettingResponse { /** Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. */ searchEngineCrawlerBypass: boolean; } export const PatchSettingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ searchEngineCrawlerBypass: S.Boolean.pipe( T.Body("search_engine_crawler_bypass"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchSettingResponse", }) as any as S.Schema; export type EditRequestAdditionalRoutesItem = CreateRequestAdditionalRoutesItem; export const EditRequestAdditionalRoutesItem = CreateRequestAdditionalRoutesItem; export type EditRequestAdditionalRoutesList = Array; export const EditRequestAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateRequestAdditionalRoutesItem, ) as any as S.Schema; export type EditRequestCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const EditRequestCookieAttributesSamesite = /*@__PURE__*/ S.String; export type EditRequestCookieAttributesSecure = "auto" | "always" | "never"; export const EditRequestCookieAttributesSecure = /*@__PURE__*/ S.String; export interface EditRequestCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: EditRequestCookieAttributesSamesite | (string & {}); /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: EditRequestCookieAttributesSecure | (string & {}); } export const EditRequestCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(EditRequestCookieAttributesSamesite), secure: S.optional(EditRequestCookieAttributesSecure), }), ).annotate({ identifier: "EditRequestCookieAttributes", }) as any as S.Schema; export type EditRequestDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const EditRequestDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type EditRequestEnabledOriginCommandsItem = "revoke"; export const EditRequestEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type EditRequestEnabledOriginCommandsList = Array< EditRequestEnabledOriginCommandsItem | (string & {}) >; export const EditRequestEnabledOriginCommandsList = /*@__PURE__*/ S.Array( EditRequestEnabledOriginCommandsItem, ) as any as S.Schema; export type EditRequestQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const EditRequestQueueingMethod = /*@__PURE__*/ S.String; export type EditRequestQueueingStatusCode = 200 | 202 | 429; export const EditRequestQueueingStatusCode = /*@__PURE__*/ S.Number; export type EditRequestTurnstileAction = "log" | "infinite_queue"; export const EditRequestTurnstileAction = /*@__PURE__*/ S.String; export type EditRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EditRequestTurnstileMode = /*@__PURE__*/ S.String; export interface PatchWaitingRoomRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host: string; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute: number; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers: number; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: EditRequestAdditionalRoutesList; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: EditRequestCookieAttributes; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: EditRequestDefaultTemplateLanguage | (string & {}); /** A note that you can use to add more details about the waiting room. */ description?: string; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean; /** A list of enabled origin commands. */ enabledOriginCommands?: EditRequestEnabledOriginCommandsList; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: EditRequestQueueingMethod | (string & {}); /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: EditRequestQueueingStatusCode | (number & {}); /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: EditRequestTurnstileAction | (string & {}); /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: EditRequestTurnstileMode | (string & {}); } export const PatchWaitingRoomRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), host: S.String, name: S.String, newUsersPerMinute: S.Number.pipe(T.Body("new_users_per_minute")), totalActiveUsers: S.Number.pipe(T.Body("total_active_users")), additionalRoutes: S.optional( EditRequestAdditionalRoutesList.pipe(T.Body("additional_routes")), ), cookieAttributes: S.optional( EditRequestCookieAttributes.pipe(T.Body("cookie_attributes")), ), cookieSuffix: S.optional(S.String.pipe(T.Body("cookie_suffix"))), customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), defaultTemplateLanguage: S.optional( EditRequestDefaultTemplateLanguage.pipe( T.Body("default_template_language"), ), ), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( EditRequestEnabledOriginCommandsList.pipe( T.Body("enabled_origin_commands"), ), ), jsonResponseEnabled: S.optional( S.Boolean.pipe(T.Body("json_response_enabled")), ), path: S.optional(S.String), queueAll: S.optional(S.Boolean.pipe(T.Body("queue_all"))), queueingMethod: S.optional( EditRequestQueueingMethod.pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( EditRequestQueueingStatusCode.pipe(T.Body("queueing_status_code")), ), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), suspended: S.optional(S.Boolean), turnstileAction: S.optional( EditRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( EditRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "PATCH", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchWaitingRoomRequest", }) as any as S.Schema; export type EditResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export const EditResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export type EditResponseAdditionalRoutesList = Array; export const EditResponseAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateResponseAdditionalRoutesItem, ) as any as S.Schema; export type EditResponseCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const EditResponseCookieAttributesSamesite = /*@__PURE__*/ S.String; export type EditResponseCookieAttributesSecure = "auto" | "always" | "never"; export const EditResponseCookieAttributesSecure = /*@__PURE__*/ S.String; export interface EditResponseCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: EditResponseCookieAttributesSamesite | null; /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: EditResponseCookieAttributesSecure | null; } export const EditResponseCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(S.NullOr(EditResponseCookieAttributesSamesite)), secure: S.optional(S.NullOr(EditResponseCookieAttributesSecure)), }), ).annotate({ identifier: "EditResponseCookieAttributes", }) as any as S.Schema; export type EditResponseDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const EditResponseDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type EditResponseEnabledOriginCommandsItem = "revoke"; export const EditResponseEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type EditResponseEnabledOriginCommandsList = Array; export const EditResponseEnabledOriginCommandsList = /*@__PURE__*/ S.Array( EditResponseEnabledOriginCommandsItem, ) as any as S.Schema; export type EditResponseQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const EditResponseQueueingMethod = /*@__PURE__*/ S.String; export type EditResponseQueueingStatusCode = 200 | 202 | 429; export const EditResponseQueueingStatusCode = /*@__PURE__*/ S.Number; export type EditResponseTurnstileAction = "log" | "infinite_queue"; export const EditResponseTurnstileAction = /*@__PURE__*/ S.String; export type EditResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EditResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchWaitingRoomResponse { id?: string | null; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: EditResponseAdditionalRoutesList | null; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: EditResponseCookieAttributes | null; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string | null; createdOn?: string | null; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string | null; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: EditResponseDefaultTemplateLanguage | null; /** A note that you can use to add more details about the waiting room. */ description?: string | null; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean | null; /** A list of enabled origin commands. */ enabledOriginCommands?: EditResponseEnabledOriginCommandsList | null; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host?: string | null; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean | null; modifiedOn?: string | null; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when the next event will begin queueing. */ nextEventPrequeueStartTime?: string | null; /** An ISO 8601 timestamp that marks when the next event will start. */ nextEventStartTime?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean | null; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: EditResponseQueueingMethod | null; /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: EditResponseQueueingStatusCode | null; /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number | null; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean | null; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers?: number | null; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: EditResponseTurnstileAction | null; /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: EditResponseTurnstileMode | null; } export const PatchWaitingRoomResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), additionalRoutes: S.optional( S.NullOr(EditResponseAdditionalRoutesList).pipe( T.Body("additional_routes"), ), ), cookieAttributes: S.optional( S.NullOr(EditResponseCookieAttributes).pipe(T.Body("cookie_attributes")), ), cookieSuffix: S.optional(S.NullOr(S.String).pipe(T.Body("cookie_suffix"))), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), defaultTemplateLanguage: S.optional( S.NullOr(EditResponseDefaultTemplateLanguage).pipe( T.Body("default_template_language"), ), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( S.NullOr(EditResponseEnabledOriginCommandsList).pipe( T.Body("enabled_origin_commands"), ), ), host: S.optional(S.NullOr(S.String)), jsonResponseEnabled: S.optional( S.NullOr(S.Boolean).pipe(T.Body("json_response_enabled")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), nextEventPrequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_prequeue_start_time")), ), nextEventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_start_time")), ), path: S.optional(S.NullOr(S.String)), queueAll: S.optional(S.NullOr(S.Boolean).pipe(T.Body("queue_all"))), queueingMethod: S.optional( S.NullOr(EditResponseQueueingMethod).pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( S.NullOr(EditResponseQueueingStatusCode).pipe( T.Body("queueing_status_code"), ), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EditResponseTurnstileAction).pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( S.NullOr(EditResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchWaitingRoomResponse", }) as any as S.Schema; export interface PreviewPageRequest { /** Identifier. */ zoneId: string; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customHtml: string; } export const PreviewPageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), customHtml: S.String.pipe(T.Body("custom_html")), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/waiting_rooms/preview", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PreviewPageRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PreviewPageResponse { /** URL where the custom waiting room page can temporarily be previewed. */ previewUrl?: string | null; } export const PreviewPageResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ previewUrl: S.optional(S.NullOr(S.String).pipe(T.Body("preview_url"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PreviewPageResponse", }) as any as S.Schema; export interface PutSettingRequest { /** Identifier. */ zoneId: string; /** Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. */ searchEngineCrawlerBypass?: boolean; } export const PutSettingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), searchEngineCrawlerBypass: S.optional( S.Boolean.pipe(T.Body("search_engine_crawler_bypass")), ), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/waiting_rooms/settings", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutSettingRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutSettingResponse { /** Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone. */ searchEngineCrawlerBypass: boolean; } export const PutSettingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ searchEngineCrawlerBypass: S.Boolean.pipe( T.Body("search_engine_crawler_bypass"), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutSettingResponse", }) as any as S.Schema; export type EventsUpdateRequestTurnstileAction = "log" | "infinite_queue"; export const EventsUpdateRequestTurnstileAction = /*@__PURE__*/ S.String; export type EventsUpdateRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsUpdateRequestTurnstileMode = /*@__PURE__*/ S.String; export interface UpdateEventRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; eventId: string; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime: string; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime: string; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string; /** A note that you can use to add more details about the event. */ description?: string; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsUpdateRequestTurnstileAction | (string & {}); /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsUpdateRequestTurnstileMode | (string & {}); } export const UpdateEventRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), eventId: S.String.pipe(T.Label("event_id")), eventEndTime: S.String.pipe(T.Body("event_end_time")), eventStartTime: S.String.pipe(T.Body("event_start_time")), name: S.String, customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), newUsersPerMinute: S.optional( S.Number.pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional(S.String.pipe(T.Body("prequeue_start_time"))), queueingMethod: S.optional(S.String.pipe(T.Body("queueing_method"))), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), shuffleAtEventStart: S.optional( S.Boolean.pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.Boolean), totalActiveUsers: S.optional(S.Number.pipe(T.Body("total_active_users"))), turnstileAction: S.optional( EventsUpdateRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( EventsUpdateRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events/{event_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateEventRequest", }) as any as S.Schema; export type EventsUpdateResponseTurnstileAction = "log" | "infinite_queue"; export const EventsUpdateResponseTurnstileAction = /*@__PURE__*/ S.String; export type EventsUpdateResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const EventsUpdateResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateEventResponse { id?: string | null; createdOn?: string | null; /** If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it. */ customPageHtml?: string | null; /** A note that you can use to add more details about the event. */ description?: string | null; /** If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it. */ disableSessionRenewal?: boolean | null; /** An ISO 8601 timestamp that marks the end of the event. */ eventEndTime?: string | null; /** An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`. */ eventStartTime?: string | null; modifiedOn?: string | null; /** A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`. */ prequeueStartTime?: string | null; /** If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it. */ queueingMethod?: string | null; /** If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it. */ sessionDuration?: number | null; /** If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary. */ shuffleAtEventStart?: boolean | null; /** Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration. */ suspended?: boolean | null; /** If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set. */ totalActiveUsers?: number | null; /** If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it. */ turnstileAction?: EventsUpdateResponseTurnstileAction | null; /** If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it. */ turnstileMode?: EventsUpdateResponseTurnstileMode | null; } export const UpdateEventResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), eventEndTime: S.optional(S.NullOr(S.String).pipe(T.Body("event_end_time"))), eventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("event_start_time")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), prequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("prequeue_start_time")), ), queueingMethod: S.optional( S.NullOr(S.String).pipe(T.Body("queueing_method")), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), shuffleAtEventStart: S.optional( S.NullOr(S.Boolean).pipe(T.Body("shuffle_at_event_start")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(EventsUpdateResponseTurnstileAction).pipe( T.Body("turnstile_action"), ), ), turnstileMode: S.optional( S.NullOr(EventsUpdateResponseTurnstileMode).pipe( T.Body("turnstile_mode"), ), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateEventResponse", }) as any as S.Schema; export type RulesUpdateRequestRulesItemAction = "bypass_waiting_room"; export const RulesUpdateRequestRulesItemAction = /*@__PURE__*/ S.String; export interface RulesUpdateRequestRulesItem { /** The action to take when the expression matches. */ action: RulesUpdateRequestRulesItemAction | (string & {}); /** Criteria defining when there is a match for the current rule. */ expression: string; /** The description of the rule. */ description?: string; /** When set to true, the rule is enabled. */ enabled?: boolean; } export const RulesUpdateRequestRulesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ action: RulesUpdateRequestRulesItemAction, expression: S.String, description: S.optional(S.String), enabled: S.optional(S.Boolean), }), ).annotate({ identifier: "RulesUpdateRequestRulesItem", }) as any as S.Schema; export type RulesUpdateRequestRulesList = Array; export const RulesUpdateRequestRulesList = /*@__PURE__*/ S.Array( RulesUpdateRequestRulesItem, ) as any as S.Schema; export interface UpdateRuleRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; rules: RulesUpdateRequestRulesList; } export const UpdateRuleRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), rules: RulesUpdateRequestRulesList, }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleRequest", }) as any as S.Schema; export type RulesUpdateResultItemAction = "bypass_waiting_room"; export const RulesUpdateResultItemAction = /*@__PURE__*/ S.String; export interface RulesUpdateResultItem { /** The ID of the rule. */ id?: string | null; /** The action to take when the expression matches. */ action?: RulesUpdateResultItemAction | null; /** The description of the rule. */ description?: string | null; /** When set to true, the rule is enabled. */ enabled?: boolean | null; /** Criteria defining when there is a match for the current rule. */ expression?: string | null; lastUpdated?: string | null; /** The version of the rule. */ version?: string | null; } export const RulesUpdateResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(RulesUpdateResultItemAction)), description: S.optional(S.NullOr(S.String)), enabled: S.optional(S.NullOr(S.Boolean)), expression: S.optional(S.NullOr(S.String)), lastUpdated: S.optional(S.NullOr(S.String).pipe(T.Body("last_updated"))), version: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "RulesUpdateResultItem", }) as any as S.Schema; export type RulesUpdateResultList = Array; export const RulesUpdateResultList = /*@__PURE__*/ S.Array( RulesUpdateResultItem, ) as any as S.Schema; export interface UpdateRuleResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RulesUpdateResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const UpdateRuleResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RulesUpdateResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateRuleResponse", }) as any as S.Schema; export type UpdateRequestAdditionalRoutesItem = CreateRequestAdditionalRoutesItem; export const UpdateRequestAdditionalRoutesItem = CreateRequestAdditionalRoutesItem; export type UpdateRequestAdditionalRoutesList = Array; export const UpdateRequestAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateRequestAdditionalRoutesItem, ) as any as S.Schema; export type UpdateRequestCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const UpdateRequestCookieAttributesSamesite = /*@__PURE__*/ S.String; export type UpdateRequestCookieAttributesSecure = "auto" | "always" | "never"; export const UpdateRequestCookieAttributesSecure = /*@__PURE__*/ S.String; export interface UpdateRequestCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: UpdateRequestCookieAttributesSamesite | (string & {}); /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: UpdateRequestCookieAttributesSecure | (string & {}); } export const UpdateRequestCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(UpdateRequestCookieAttributesSamesite), secure: S.optional(UpdateRequestCookieAttributesSecure), }), ).annotate({ identifier: "UpdateRequestCookieAttributes", }) as any as S.Schema; export type UpdateRequestDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const UpdateRequestDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type UpdateRequestEnabledOriginCommandsItem = "revoke"; export const UpdateRequestEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type UpdateRequestEnabledOriginCommandsList = Array< UpdateRequestEnabledOriginCommandsItem | (string & {}) >; export const UpdateRequestEnabledOriginCommandsList = /*@__PURE__*/ S.Array( UpdateRequestEnabledOriginCommandsItem, ) as any as S.Schema; export type UpdateRequestQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const UpdateRequestQueueingMethod = /*@__PURE__*/ S.String; export type UpdateRequestQueueingStatusCode = 200 | 202 | 429; export const UpdateRequestQueueingStatusCode = /*@__PURE__*/ S.Number; export type UpdateRequestTurnstileAction = "log" | "infinite_queue"; export const UpdateRequestTurnstileAction = /*@__PURE__*/ S.String; export type UpdateRequestTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const UpdateRequestTurnstileMode = /*@__PURE__*/ S.String; export interface UpdateWaitingRoomRequest { /** Identifier. */ zoneId: string; waitingRoomId: string; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host: string; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name: string; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute: number; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers: number; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: UpdateRequestAdditionalRoutesList; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: UpdateRequestCookieAttributes; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: | UpdateRequestDefaultTemplateLanguage | (string & {}); /** A note that you can use to add more details about the waiting room. */ description?: string; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean; /** A list of enabled origin commands. */ enabledOriginCommands?: UpdateRequestEnabledOriginCommandsList; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: UpdateRequestQueueingMethod | (string & {}); /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: UpdateRequestQueueingStatusCode | (number & {}); /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: UpdateRequestTurnstileAction | (string & {}); /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: UpdateRequestTurnstileMode | (string & {}); } export const UpdateWaitingRoomRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), waitingRoomId: S.String.pipe(T.Label("waiting_room_id")), host: S.String, name: S.String, newUsersPerMinute: S.Number.pipe(T.Body("new_users_per_minute")), totalActiveUsers: S.Number.pipe(T.Body("total_active_users")), additionalRoutes: S.optional( UpdateRequestAdditionalRoutesList.pipe(T.Body("additional_routes")), ), cookieAttributes: S.optional( UpdateRequestCookieAttributes.pipe(T.Body("cookie_attributes")), ), cookieSuffix: S.optional(S.String.pipe(T.Body("cookie_suffix"))), customPageHtml: S.optional(S.String.pipe(T.Body("custom_page_html"))), defaultTemplateLanguage: S.optional( UpdateRequestDefaultTemplateLanguage.pipe( T.Body("default_template_language"), ), ), description: S.optional(S.String), disableSessionRenewal: S.optional( S.Boolean.pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( UpdateRequestEnabledOriginCommandsList.pipe( T.Body("enabled_origin_commands"), ), ), jsonResponseEnabled: S.optional( S.Boolean.pipe(T.Body("json_response_enabled")), ), path: S.optional(S.String), queueAll: S.optional(S.Boolean.pipe(T.Body("queue_all"))), queueingMethod: S.optional( UpdateRequestQueueingMethod.pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( UpdateRequestQueueingStatusCode.pipe(T.Body("queueing_status_code")), ), sessionDuration: S.optional(S.Number.pipe(T.Body("session_duration"))), suspended: S.optional(S.Boolean), turnstileAction: S.optional( UpdateRequestTurnstileAction.pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( UpdateRequestTurnstileMode.pipe(T.Body("turnstile_mode")), ), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/waiting_rooms/{waiting_room_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateWaitingRoomRequest", }) as any as S.Schema; export type UpdateResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export const UpdateResponseAdditionalRoutesItem = CreateResponseAdditionalRoutesItem; export type UpdateResponseAdditionalRoutesList = Array; export const UpdateResponseAdditionalRoutesList = /*@__PURE__*/ S.Array( CreateResponseAdditionalRoutesItem, ) as any as S.Schema; export type UpdateResponseCookieAttributesSamesite = | "auto" | "lax" | "none" | "strict"; export const UpdateResponseCookieAttributesSamesite = /*@__PURE__*/ S.String; export type UpdateResponseCookieAttributesSecure = "auto" | "always" | "never"; export const UpdateResponseCookieAttributesSecure = /*@__PURE__*/ S.String; export interface UpdateResponseCookieAttributes { /** Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`. */ samesite?: UpdateResponseCookieAttributesSamesite | null; /** Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled. */ secure?: UpdateResponseCookieAttributesSecure | null; } export const UpdateResponseCookieAttributes = /*@__PURE__*/ S.suspend(() => S.Struct({ samesite: S.optional(S.NullOr(UpdateResponseCookieAttributesSamesite)), secure: S.optional(S.NullOr(UpdateResponseCookieAttributesSecure)), }), ).annotate({ identifier: "UpdateResponseCookieAttributes", }) as any as S.Schema; export type UpdateResponseDefaultTemplateLanguage = | "en-US" | "es-ES" | "de-DE" | "fr-FR" | "it-IT" | "ja-JP" | "ko-KR" | "pt-BR" | "zh-CN" | "zh-TW" | "nl-NL" | "pl-PL" | "id-ID" | "tr-TR" | "ar-EG" | "ru-RU" | "fa-IR" | "bg-BG" | "hr-HR" | "cs-CZ" | "da-DK" | "fi-FI" | "lt-LT" | "ms-MY" | "nb-NO" | "ro-RO" | "el-GR" | "he-IL" | "hi-IN" | "hu-HU" | "sr-BA" | "sk-SK" | "sl-SI" | "sv-SE" | "tl-PH" | "th-TH" | "uk-UA" | "vi-VN"; export const UpdateResponseDefaultTemplateLanguage = /*@__PURE__*/ S.String; export type UpdateResponseEnabledOriginCommandsItem = "revoke"; export const UpdateResponseEnabledOriginCommandsItem = /*@__PURE__*/ S.String; export type UpdateResponseEnabledOriginCommandsList = Array; export const UpdateResponseEnabledOriginCommandsList = /*@__PURE__*/ S.Array( UpdateResponseEnabledOriginCommandsItem, ) as any as S.Schema; export type UpdateResponseQueueingMethod = | "fifo" | "random" | "passthrough" | "reject"; export const UpdateResponseQueueingMethod = /*@__PURE__*/ S.String; export type UpdateResponseQueueingStatusCode = 200 | 202 | 429; export const UpdateResponseQueueingStatusCode = /*@__PURE__*/ S.Number; export type UpdateResponseTurnstileAction = "log" | "infinite_queue"; export const UpdateResponseTurnstileAction = /*@__PURE__*/ S.String; export type UpdateResponseTurnstileMode = | "off" | "invisible" | "visible_non_interactive" | "visible_managed"; export const UpdateResponseTurnstileMode = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateWaitingRoomResponse { id?: string | null; /** Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. */ additionalRoutes?: UpdateResponseAdditionalRoutesList | null; /** Configures cookie attributes for the waiting room cookie. This encrypted cookie stores a user's status in the waiting room, such as queue position. */ cookieAttributes?: UpdateResponseCookieAttributes | null; /** Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`. */ cookieSuffix?: string | null; createdOn?: string | null; /** Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: */ customPageHtml?: string | null; /** The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used. */ defaultTemplateLanguage?: UpdateResponseDefaultTemplateLanguage | null; /** A note that you can use to add more details about the waiting room. */ description?: string | null; /** Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request. */ disableSessionRenewal?: boolean | null; /** A list of enabled origin commands. */ enabledOriginCommands?: UpdateResponseEnabledOriginCommandsList | null; /** The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique. */ host?: string | null; /** Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user's status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields: */ jsonResponseEnabled?: boolean | null; modifiedOn?: string | null; /** A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: string | null; /** Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world. */ newUsersPerMinute?: number | null; /** An ISO 8601 timestamp that marks when the next event will begin queueing. */ nextEventPrequeueStartTime?: string | null; /** An ISO 8601 timestamp that marks when the next event will start. */ nextEventStartTime?: string | null; /** Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported. */ path?: string | null; /** If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable. */ queueAll?: boolean | null; /** Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are: */ queueingMethod?: UpdateResponseQueueingMethod | null; /** HTTP status code returned to a user while in the queue. */ queueingStatusCode?: UpdateResponseQueueingStatusCode | null; /** Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route. */ sessionDuration?: number | null; /** Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. */ suspended?: boolean | null; /** Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world. */ totalActiveUsers?: number | null; /** Which action to take when a bot is detected using Turnstile. `log` will */ turnstileAction?: UpdateResponseTurnstileAction | null; /** Which Turnstile widget type to use for detecting bot traffic. See */ turnstileMode?: UpdateResponseTurnstileMode | null; } export const UpdateWaitingRoomResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), additionalRoutes: S.optional( S.NullOr(UpdateResponseAdditionalRoutesList).pipe( T.Body("additional_routes"), ), ), cookieAttributes: S.optional( S.NullOr(UpdateResponseCookieAttributes).pipe( T.Body("cookie_attributes"), ), ), cookieSuffix: S.optional(S.NullOr(S.String).pipe(T.Body("cookie_suffix"))), createdOn: S.optional(S.NullOr(S.String).pipe(T.Body("created_on"))), customPageHtml: S.optional( S.NullOr(S.String).pipe(T.Body("custom_page_html")), ), defaultTemplateLanguage: S.optional( S.NullOr(UpdateResponseDefaultTemplateLanguage).pipe( T.Body("default_template_language"), ), ), description: S.optional(S.NullOr(S.String)), disableSessionRenewal: S.optional( S.NullOr(S.Boolean).pipe(T.Body("disable_session_renewal")), ), enabledOriginCommands: S.optional( S.NullOr(UpdateResponseEnabledOriginCommandsList).pipe( T.Body("enabled_origin_commands"), ), ), host: S.optional(S.NullOr(S.String)), jsonResponseEnabled: S.optional( S.NullOr(S.Boolean).pipe(T.Body("json_response_enabled")), ), modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), name: S.optional(S.NullOr(S.String)), newUsersPerMinute: S.optional( S.NullOr(S.Number).pipe(T.Body("new_users_per_minute")), ), nextEventPrequeueStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_prequeue_start_time")), ), nextEventStartTime: S.optional( S.NullOr(S.String).pipe(T.Body("next_event_start_time")), ), path: S.optional(S.NullOr(S.String)), queueAll: S.optional(S.NullOr(S.Boolean).pipe(T.Body("queue_all"))), queueingMethod: S.optional( S.NullOr(UpdateResponseQueueingMethod).pipe(T.Body("queueing_method")), ), queueingStatusCode: S.optional( S.NullOr(UpdateResponseQueueingStatusCode).pipe( T.Body("queueing_status_code"), ), ), sessionDuration: S.optional( S.NullOr(S.Number).pipe(T.Body("session_duration")), ), suspended: S.optional(S.NullOr(S.Boolean)), totalActiveUsers: S.optional( S.NullOr(S.Number).pipe(T.Body("total_active_users")), ), turnstileAction: S.optional( S.NullOr(UpdateResponseTurnstileAction).pipe(T.Body("turnstile_action")), ), turnstileMode: S.optional( S.NullOr(UpdateResponseTurnstileMode).pipe(T.Body("turnstile_mode")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateWaitingRoomResponse", }) as any as S.Schema; export type CreateEventError = CloudflareOpError; /** Only available for the Waiting Room Advanced subscription. Creates an event for a waiting room. An event takes place during a specified period of time, temporarily changing the behavior of a waiting room. While the event is active, some of the properties in the event's configuration may either override or inherit from the waiting room's configuration. Note that events cannot overlap with each other, so only one event can be active at a time. */ export const createEvent: API.OperationMethod< CreateEventRequest, CreateEventResponse, CreateEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateEventRequest, output: CreateEventResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateRuleError = CloudflareOpError; /** Only available for the Waiting Room Advanced subscription. Creates a rule for a waiting room. */ export const createRule: API.PaginatedOperationMethod< CreateRuleRequest, CreateRuleResponse, CreateRuleError, CloudflareOpContext, RulesCreateResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: CreateRuleRequest, output: CreateRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type CreateWaitingRoomError = | ZoneNotEntitled | Forbidden | CloudflareOpError; /** Creates a new waiting room. */ export const createWaitingRoom: API.OperationMethod< CreateWaitingRoomRequest, CreateWaitingRoomResponse, CreateWaitingRoomError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateWaitingRoomRequest, output: CreateWaitingRoomResponse, errors: [ZoneNotEntitled, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteEventError = CloudflareOpError; /** Deletes an event for a waiting room. */ export const deleteEvent: API.OperationMethod< DeleteEventRequest, DeleteEventResponse, DeleteEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteEventRequest, output: DeleteEventResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRuleError = CloudflareOpError; /** Deletes a rule for a waiting room. */ export const deleteRule: API.PaginatedOperationMethod< DeleteRuleRequest, DeleteRuleResponse, DeleteRuleError, CloudflareOpContext, RulesDeleteResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: DeleteRuleRequest, output: DeleteRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type DeleteWaitingRoomError = | WaitingRoomNotFound | Forbidden | CloudflareOpError; /** Deletes a waiting room. */ export const deleteWaitingRoom: API.OperationMethod< DeleteWaitingRoomRequest, DeleteWaitingRoomResponse, DeleteWaitingRoomError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteWaitingRoomRequest, output: DeleteWaitingRoomResponse, errors: [ WaitingRoomNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetEventError = CloudflareOpError; /** Fetches a single configured event for a waiting room. */ export const getEvent: API.OperationMethod< GetEventRequest, GetEventResponse, GetEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetEventRequest, output: GetEventResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetEventDetailError = CloudflareOpError; /** Previews an event's configuration as if it was active. Inherited fields from the waiting room will be displayed with their current values. */ export const getEventDetail: API.OperationMethod< GetEventDetailRequest, GetEventDetailResponse, GetEventDetailError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetEventDetailRequest, output: GetEventDetailResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRuleError = CloudflareOpError; /** Lists rules for a waiting room. */ export const getRule: API.PaginatedOperationMethod< GetRuleRequest, GetRuleResponse, GetRuleError, CloudflareOpContext, RulesGetResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: GetRuleRequest, output: GetRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type GetSettingError = Forbidden | CloudflareOpError; /** Gets the zone-level Waiting Room settings that apply as defaults to all waiting rooms on the zone. */ export const getSetting: API.OperationMethod< GetSettingRequest, GetSettingResponse, GetSettingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetSettingRequest, output: GetSettingResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetStatusError = CloudflareOpError; /** Fetches the status of a configured waiting room. Response fields include: 1. `status`: String indicating the status of the waiting room. The possible status are: - **not\_queueing** indicates that the configured thresholds have not been met and all users are going through to the origin. - **queueing** indicates that the thresholds have been met and some users are held in the waiting room. - **event\_prequeueing** indicates that an event is active and is currently prequeueing users before it starts. - **suspended** indicates that the room is suspended. 1. `event_id`: String of the current event's `id` if an event is active, otherwise an empty string. 1. `estimated_queued_users`: Integer of the estimated number of users currently waiting in the queue. 1. `estimated_total_active_users`: Integer of the estimated number of users currently active on the origin. 1. `max_estimated_time_minutes`: Integer of the maximum estimated time currently presented to the users. */ export const getStatus: API.OperationMethod< GetStatusRequest, GetStatusResponse, GetStatusError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetStatusRequest, output: GetStatusResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetWaitingRoomError = | WaitingRoomNotFound | Forbidden | CloudflareOpError; /** Fetches a single configured waiting room. */ export const getWaitingRoom: API.OperationMethod< GetWaitingRoomRequest, GetWaitingRoomResponse, GetWaitingRoomError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetWaitingRoomRequest, output: GetWaitingRoomResponse, errors: [ WaitingRoomNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListEventsError = CloudflareOpError; /** Lists events for a waiting room. */ export const listEvents: API.PaginatedOperationMethod< ListEventsRequest, ListEventsResponse, ListEventsError, CloudflareOpContext, EventsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListEventsRequest, output: ListEventsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWaitingRoomsForAccountError = Forbidden | CloudflareOpError; /** Lists waiting rooms for account or zone. */ export const listWaitingRoomsForAccount: API.PaginatedOperationMethod< ListWaitingRoomsForAccountRequest, ListWaitingRoomsResponse, ListWaitingRoomsForAccountError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWaitingRoomsForAccountRequest, output: ListWaitingRoomsResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListWaitingRoomsForZoneError = Forbidden | CloudflareOpError; /** Lists waiting rooms for account or zone. */ export const listWaitingRoomsForZone: API.PaginatedOperationMethod< ListWaitingRoomsForZoneRequest, ListWaitingRoomsResponse, ListWaitingRoomsForZoneError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListWaitingRoomsForZoneRequest, output: ListWaitingRoomsResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type PatchEventError = CloudflareOpError; /** Patches a configured event for a waiting room. */ export const patchEvent: API.OperationMethod< PatchEventRequest, PatchEventResponse, PatchEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchEventRequest, output: PatchEventResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchRuleError = CloudflareOpError; /** Patches a rule for a waiting room. */ export const patchRule: API.PaginatedOperationMethod< PatchRuleRequest, PatchRuleResponse, PatchRuleError, CloudflareOpContext, RulesEditResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: PatchRuleRequest, output: PatchRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type PatchSettingError = CloudflareOpError; /** Partially updates zone-level Waiting Room settings using PATCH semantics. */ export const patchSetting: API.OperationMethod< PatchSettingRequest, PatchSettingResponse, PatchSettingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchSettingRequest, output: PatchSettingResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchWaitingRoomError = CloudflareOpError; /** Patches a configured waiting room. */ export const patchWaitingRoom: API.OperationMethod< PatchWaitingRoomRequest, PatchWaitingRoomResponse, PatchWaitingRoomError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchWaitingRoomRequest, output: PatchWaitingRoomResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PreviewPageError = CloudflareOpError; /** Creates a waiting room page preview. Upload a custom waiting room page for preview. You will receive a preview URL in the form `http://waitingrooms.dev/preview/`. You can use the following query parameters to change the state of the preview: 1. `force_queue`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website (also known as queueAll). 1. `queue_is_full`: Boolean indicating if the waiting room's queue is currently full and not accepting new users at the moment. 1. `queueing_method`: The queueing method currently used by the waiting room. - **fifo** indicates a FIFO queue. - **random** indicates a Random queue. - **passthrough** indicates a Passthrough queue. Keep in mind that the waiting room page will only be displayed if `force_queue=true` or `event=prequeueing` — for other cases the request will pass through to the origin. For our preview, this will be a fake origin website returning "Welcome". - **reject** indicates a Reject queue. 1. `event`: Used to preview a waiting room event. - **none** indicates no event is occurring. - **prequeueing** indicates that an event is prequeueing (between `prequeue_start_time` and `event_start_time`). - **started** indicates that an event has started (between `event_start_time` and `event_end_time`). 1. `shuffle_at_event_start`: Boolean indicating if the event will shuffle users in the prequeue when it starts. This can only be set to **true** if an event is active (`event` is not **none**). For example, you can make a request to `http://waitingrooms.dev/preview/?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6. `waitTime`: Non-zero, positive integer indicating the estimated wait time in minutes. The default value is 10 minutes. For example, you can make a request to `http://waitingrooms.dev/preview/?waitTime=50` to configure the estimated wait time as 50 minutes. */ export const previewPage: API.OperationMethod< PreviewPageRequest, PreviewPageResponse, PreviewPageError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PreviewPageRequest, output: PreviewPageResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutSettingError = ZoneNotEntitled | Forbidden | CloudflareOpError; /** Fully updates zone-level Waiting Room settings, replacing the existing configuration. */ export const putSetting: API.OperationMethod< PutSettingRequest, PutSettingResponse, PutSettingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutSettingRequest, output: PutSettingResponse, errors: [ZoneNotEntitled, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateEventError = CloudflareOpError; /** Updates a configured event for a waiting room. */ export const updateEvent: API.OperationMethod< UpdateEventRequest, UpdateEventResponse, UpdateEventError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateEventRequest, output: UpdateEventResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateRuleError = CloudflareOpError; /** Only available for the Waiting Room Advanced subscription. Replaces all rules for a waiting room. */ export const updateRule: API.PaginatedOperationMethod< UpdateRuleRequest, UpdateRuleResponse, UpdateRuleError, CloudflareOpContext, RulesUpdateResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: UpdateRuleRequest, output: UpdateRuleResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type UpdateWaitingRoomError = | WaitingRoomNotFound | ZoneNotEntitled | Forbidden | CloudflareOpError; /** Updates a configured waiting room. */ export const updateWaitingRoom: API.OperationMethod< UpdateWaitingRoomRequest, UpdateWaitingRoomResponse, UpdateWaitingRoomError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateWaitingRoomRequest, output: UpdateWaitingRoomResponse, errors: [ WaitingRoomNotFound, ZoneNotEntitled, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));