// 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> = { addedAt: "added_at", cryptominingScore: "cryptomining_score", dataflowScore: "dataflow_score", domainAttribute: "domain_attribute", domainReportedMalicious: "domain_reported_malicious", expiresAttribute: "expires_attribute", fetchedAt: "fetched_at", firstPageUrl: "first_page_url", firstSeenAt: "first_seen_at", httpOnlyAttribute: "http_only_attribute", jsIntegrityScore: "js_integrity_score", lastSeenAt: "last_seen_at", magecartScore: "magecart_score", maliciousDomainCategories: "malicious_domain_categories", maliciousUrlCategories: "malicious_url_categories", malwareScore: "malware_score", maxAgeAttribute: "max_age_attribute", obfuscationScore: "obfuscation_score", pageUrls: "page_urls", pathAttribute: "path_attribute", sameSiteAttribute: "same_site_attribute", secureAttribute: "secure_attribute", updatedAt: "updated_at", urlContainsCdnCgiPath: "url_contains_cdn_cgi_path", urlReportedMalicious: "url_reported_malicious", useCloudflareReportingEndpoint: "use_cloudflare_reporting_endpoint", useConnectionUrlPath: "use_connection_url_path", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class NotEntitled extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NotEntitled", { code: S.Number, message: S.String, }), [{ status: 403, message: { includes: "not entitled" } }], ) {} export class PolicyNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PolicyNotFound", { code: S.Number, message: S.String, }), [{ status: 404, message: { includes: "Could not find Policy" } }], ) {} export class PolicyQuotaExceeded extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("PolicyQuotaExceeded", { code: S.Number, message: S.String, }), [ { status: 400, message: { includes: "exceeded the maximum number of rules in the phase http_response_page_shield", }, }, ], ) {} export type PoliciesCreateRequestAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesCreateRequestAction = /*@__PURE__*/ S.String; export interface CreatePolicyRequest { /** Identifier */ zoneId: string; /** The action to take if the expression matches */ action: PoliciesCreateRequestAction | (string & {}); /** A description for the policy */ description: string; /** Whether the policy is enabled */ enabled: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression: string; /** The policy which will be applied */ value: string; } export const CreatePolicyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), action: PoliciesCreateRequestAction, description: S.String, enabled: S.Boolean, expression: S.String, value: S.String, }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/page_shield/policies", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePolicyRequest", }) as any as S.Schema; export type PoliciesCreateResponseAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesCreateResponseAction = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreatePolicyResponse { /** Identifier */ id: string; /** The action to take if the expression matches */ action: PoliciesCreateResponseAction; /** A description for the policy */ description: string; /** Whether the policy is enabled */ enabled: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression: string; /** The policy which will be applied */ value: string; } export const CreatePolicyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, action: PoliciesCreateResponseAction, description: S.String, enabled: S.Boolean, expression: S.String, value: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreatePolicyResponse", }) as any as S.Schema; export interface DeletePolicyRequest { /** Identifier */ zoneId: string; /** Identifier */ policyId: string; } export const DeletePolicyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), policyId: S.String.pipe(T.Label("policy_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/zones/{zone_id}/page_shield/policies/{policy_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeletePolicyRequest", }) as any as S.Schema; export interface DeletePolicyResponse {} export const DeletePolicyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeletePolicyResponse", }) as any as S.Schema; export interface GetConnectionRequest { /** Identifier */ zoneId: string; /** Identifier */ connectionId: string; } export const GetConnectionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), connectionId: S.String.pipe(T.Label("connection_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/connections/{connection_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConnectionRequest", }) as any as S.Schema; export type ConnectionsGetResponseMaliciousDomainCategoriesList = Array; export const ConnectionsGetResponseMaliciousDomainCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConnectionsGetResponseMaliciousUrlCategoriesList = Array; export const ConnectionsGetResponseMaliciousUrlCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConnectionsGetResponsePageUrlsList = Array; export const ConnectionsGetResponsePageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetConnectionResponse { /** Identifier */ id: string; addedAt: string; firstSeenAt: string; host: string; lastSeenAt: string; url: string; urlContainsCdnCgiPath: boolean; domainReportedMalicious?: boolean | null; firstPageUrl?: string | null; maliciousDomainCategories?: ConnectionsGetResponseMaliciousDomainCategoriesList | null; maliciousUrlCategories?: ConnectionsGetResponseMaliciousUrlCategoriesList | null; pageUrls?: ConnectionsGetResponsePageUrlsList | null; urlReportedMalicious?: boolean | null; } export const GetConnectionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, addedAt: S.String.pipe(T.Body("added_at")), firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), url: S.String, urlContainsCdnCgiPath: S.Boolean.pipe(T.Body("url_contains_cdn_cgi_path")), domainReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("domain_reported_malicious")), ), firstPageUrl: S.optional(S.NullOr(S.String).pipe(T.Body("first_page_url"))), maliciousDomainCategories: S.optional( S.NullOr(ConnectionsGetResponseMaliciousDomainCategoriesList).pipe( T.Body("malicious_domain_categories"), ), ), maliciousUrlCategories: S.optional( S.NullOr(ConnectionsGetResponseMaliciousUrlCategoriesList).pipe( T.Body("malicious_url_categories"), ), ), pageUrls: S.optional( S.NullOr(ConnectionsGetResponsePageUrlsList).pipe(T.Body("page_urls")), ), urlReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("url_reported_malicious")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetConnectionResponse", }) as any as S.Schema; export interface GetCookyRequest { /** Identifier */ zoneId: string; /** Identifier */ cookieId: string; } export const GetCookyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), cookieId: S.String.pipe(T.Label("cookie_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/cookies/{cookie_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetCookyRequest", }) as any as S.Schema; export type CookiesGetResponseType = "first_party" | "unknown"; export const CookiesGetResponseType = /*@__PURE__*/ S.String; export type CookiesGetResponsePageUrlsList = Array; export const CookiesGetResponsePageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CookiesGetResponseSameSiteAttribute = "lax" | "strict" | "none"; export const CookiesGetResponseSameSiteAttribute = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetCookyResponse { /** Identifier */ id: string; firstSeenAt: string; host: string; lastSeenAt: string; name: string; type: CookiesGetResponseType; domainAttribute?: string | null; expiresAttribute?: string | null; httpOnlyAttribute?: boolean | null; maxAgeAttribute?: number | null; pageUrls?: CookiesGetResponsePageUrlsList | null; pathAttribute?: string | null; sameSiteAttribute?: CookiesGetResponseSameSiteAttribute | null; secureAttribute?: boolean | null; } export const GetCookyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), name: S.String, type: CookiesGetResponseType, domainAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("domain_attribute")), ), expiresAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("expires_attribute")), ), httpOnlyAttribute: S.optional( S.NullOr(S.Boolean).pipe(T.Body("http_only_attribute")), ), maxAgeAttribute: S.optional( S.NullOr(S.Number).pipe(T.Body("max_age_attribute")), ), pageUrls: S.optional( S.NullOr(CookiesGetResponsePageUrlsList).pipe(T.Body("page_urls")), ), pathAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("path_attribute")), ), sameSiteAttribute: S.optional( S.NullOr(CookiesGetResponseSameSiteAttribute).pipe( T.Body("same_site_attribute"), ), ), secureAttribute: S.optional( S.NullOr(S.Boolean).pipe(T.Body("secure_attribute")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetCookyResponse", }) as any as S.Schema; export interface GetPageShieldRequest { /** Identifier */ zoneId: string; } export const GetPageShieldRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield", code: 200 }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPageShieldRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetPageShieldResponse { /** When true, indicates that Page Shield is enabled. */ enabled: boolean; /** The timestamp of when Page Shield was last updated. */ updatedAt: string; /** When true, CSP reports will be sent to https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report */ useCloudflareReportingEndpoint: boolean; /** When true, the paths associated with connections URLs will also be analyzed. */ useConnectionUrlPath: boolean; } export const GetPageShieldResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, updatedAt: S.String.pipe(T.Body("updated_at")), useCloudflareReportingEndpoint: S.Boolean.pipe( T.Body("use_cloudflare_reporting_endpoint"), ), useConnectionUrlPath: S.Boolean.pipe(T.Body("use_connection_url_path")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPageShieldResponse", }) as any as S.Schema; export interface GetPolicyRequest { /** Identifier */ zoneId: string; /** Identifier */ policyId: string; } export const GetPolicyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), policyId: S.String.pipe(T.Label("policy_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/policies/{policy_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPolicyRequest", }) as any as S.Schema; export type PoliciesGetResponseAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesGetResponseAction = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetPolicyResponse { /** Identifier */ id: string; /** The action to take if the expression matches */ action: PoliciesGetResponseAction; /** A description for the policy */ description: string; /** Whether the policy is enabled */ enabled: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression: string; /** The policy which will be applied */ value: string; } export const GetPolicyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, action: PoliciesGetResponseAction, description: S.String, enabled: S.Boolean, expression: S.String, value: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetPolicyResponse", }) as any as S.Schema; export interface GetScriptRequest { /** Identifier */ zoneId: string; /** Identifier */ scriptId: string; } export const GetScriptRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), scriptId: S.String.pipe(T.Label("script_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/scripts/{script_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetScriptRequest", }) as any as S.Schema; export type ScriptsGetResponseMaliciousDomainCategoriesList = Array; export const ScriptsGetResponseMaliciousDomainCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ScriptsGetResponseMaliciousUrlCategoriesList = Array; export const ScriptsGetResponseMaliciousUrlCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ScriptsGetResponsePageUrlsList = Array; export const ScriptsGetResponsePageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ScriptsGetResponseVersionsItem { /** The cryptomining score of the JavaScript content. */ cryptominingScore?: number | null; /** The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ dataflowScore?: number | null; /** The timestamp of when the script was last fetched. */ fetchedAt?: string | null; /** The computed hash of the analyzed script. */ hash?: string | null; /** The integrity score of the JavaScript content. */ jsIntegrityScore?: number | null; /** The magecart score of the JavaScript content. */ magecartScore?: number | null; /** The malware score of the JavaScript content. */ malwareScore?: number | null; /** The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ obfuscationScore?: number | null; } export const ScriptsGetResponseVersionsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ cryptominingScore: S.optional( S.NullOr(S.Number).pipe(T.Body("cryptomining_score")), ), dataflowScore: S.optional( S.NullOr(S.Number).pipe(T.Body("dataflow_score")), ), fetchedAt: S.optional(S.NullOr(S.String).pipe(T.Body("fetched_at"))), hash: S.optional(S.NullOr(S.String)), jsIntegrityScore: S.optional( S.NullOr(S.Number).pipe(T.Body("js_integrity_score")), ), magecartScore: S.optional( S.NullOr(S.Number).pipe(T.Body("magecart_score")), ), malwareScore: S.optional(S.NullOr(S.Number).pipe(T.Body("malware_score"))), obfuscationScore: S.optional( S.NullOr(S.Number).pipe(T.Body("obfuscation_score")), ), }), ).annotate({ identifier: "ScriptsGetResponseVersionsItem", }) as any as S.Schema; export type ScriptsGetResponseVersionsList = Array; export const ScriptsGetResponseVersionsList = /*@__PURE__*/ S.Array( ScriptsGetResponseVersionsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetScriptResponse { /** Identifier */ id: string; addedAt: string; firstSeenAt: string; host: string; lastSeenAt: string; url: string; urlContainsCdnCgiPath: boolean; /** The cryptomining score of the JavaScript content. */ cryptominingScore?: number | null; /** The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ dataflowScore?: number | null; domainReportedMalicious?: boolean | null; /** The timestamp of when the script was last fetched. */ fetchedAt?: string | null; firstPageUrl?: string | null; /** The computed hash of the analyzed script. */ hash?: string | null; /** The integrity score of the JavaScript content. */ jsIntegrityScore?: number | null; /** The magecart score of the JavaScript content. */ magecartScore?: number | null; maliciousDomainCategories?: ScriptsGetResponseMaliciousDomainCategoriesList | null; maliciousUrlCategories?: ScriptsGetResponseMaliciousUrlCategoriesList | null; /** The malware score of the JavaScript content. */ malwareScore?: number | null; /** The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ obfuscationScore?: number | null; pageUrls?: ScriptsGetResponsePageUrlsList | null; urlReportedMalicious?: boolean | null; versions?: ScriptsGetResponseVersionsList | null; } export const GetScriptResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, addedAt: S.String.pipe(T.Body("added_at")), firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), url: S.String, urlContainsCdnCgiPath: S.Boolean.pipe(T.Body("url_contains_cdn_cgi_path")), cryptominingScore: S.optional( S.NullOr(S.Number).pipe(T.Body("cryptomining_score")), ), dataflowScore: S.optional( S.NullOr(S.Number).pipe(T.Body("dataflow_score")), ), domainReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("domain_reported_malicious")), ), fetchedAt: S.optional(S.NullOr(S.String).pipe(T.Body("fetched_at"))), firstPageUrl: S.optional(S.NullOr(S.String).pipe(T.Body("first_page_url"))), hash: S.optional(S.NullOr(S.String)), jsIntegrityScore: S.optional( S.NullOr(S.Number).pipe(T.Body("js_integrity_score")), ), magecartScore: S.optional( S.NullOr(S.Number).pipe(T.Body("magecart_score")), ), maliciousDomainCategories: S.optional( S.NullOr(ScriptsGetResponseMaliciousDomainCategoriesList).pipe( T.Body("malicious_domain_categories"), ), ), maliciousUrlCategories: S.optional( S.NullOr(ScriptsGetResponseMaliciousUrlCategoriesList).pipe( T.Body("malicious_url_categories"), ), ), malwareScore: S.optional(S.NullOr(S.Number).pipe(T.Body("malware_score"))), obfuscationScore: S.optional( S.NullOr(S.Number).pipe(T.Body("obfuscation_score")), ), pageUrls: S.optional( S.NullOr(ScriptsGetResponsePageUrlsList).pipe(T.Body("page_urls")), ), urlReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("url_reported_malicious")), ), versions: S.optional(S.NullOr(ScriptsGetResponseVersionsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetScriptResponse", }) as any as S.Schema; export type ConnectionsListRequestDirection = "asc" | "desc"; export const ConnectionsListRequestDirection = /*@__PURE__*/ S.String; export type ConnectionsListRequestExport = "csv"; export const ConnectionsListRequestExport = /*@__PURE__*/ S.String; export type ConnectionsListRequestOrderBy = "first_seen_at" | "last_seen_at"; export const ConnectionsListRequestOrderBy = /*@__PURE__*/ S.String; export interface ListConnectionsRequest { /** Identifier */ zoneId: string; /** The direction used to sort returned connections. */ direction?: ConnectionsListRequestDirection | (string & {}); /** When true, excludes connections seen in a `/cdn-cgi` path from the returned connections. The default value is true. */ excludeCdnCgi?: boolean; /** Excludes connections whose URL contains one of the URL-encoded URLs separated by commas. */ excludeUrls?: string; /** Export the list of connections as a file, limited to 50000 entries. */ export?: ConnectionsListRequestExport | (string & {}); /** Includes connections that match one or more URL-encoded hostnames separated by commas. */ hosts?: string; /** The field used to sort returned connections. */ orderBy?: ConnectionsListRequestOrderBy | (string & {}); /** The current page number of the paginated results. */ page?: string; /** Includes connections that match one or more page URLs (separated by commas) where they were last seen */ pageUrl?: string; /** The number of results per page. */ perPage?: number; /** When true, malicious connections appear first in the returned connections. */ prioritizeMalicious?: boolean; /** Filters the returned connections using a comma-separated list of connection statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`. */ status?: string; /** Includes connections whose URL contain one or more URL-encoded URLs separated by commas. */ urls?: string; } export const ListConnectionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), direction: S.optional(ConnectionsListRequestDirection.pipe(T.Query())), excludeCdnCgi: S.optional(S.Boolean.pipe(T.Query("exclude_cdn_cgi"))), excludeUrls: S.optional(S.String.pipe(T.Query("exclude_urls"))), export: S.optional(ConnectionsListRequestExport.pipe(T.Query())), hosts: S.optional(S.String.pipe(T.Query())), orderBy: S.optional( ConnectionsListRequestOrderBy.pipe(T.Query("order_by")), ), page: S.optional(S.String.pipe(T.Query())), pageUrl: S.optional(S.String.pipe(T.Query("page_url"))), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), prioritizeMalicious: S.optional( S.Boolean.pipe(T.Query("prioritize_malicious")), ), status: S.optional(S.String.pipe(T.Query())), urls: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/connections", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListConnectionsRequest", }) as any as S.Schema; export type ConnectionsListResultItemMaliciousDomainCategoriesList = Array; export const ConnectionsListResultItemMaliciousDomainCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConnectionsListResultItemMaliciousUrlCategoriesList = Array; export const ConnectionsListResultItemMaliciousUrlCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ConnectionsListResultItemPageUrlsList = Array; export const ConnectionsListResultItemPageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ConnectionsListResultItem { /** Identifier */ id: string; addedAt: string; firstSeenAt: string; host: string; lastSeenAt: string; url: string; urlContainsCdnCgiPath: boolean; domainReportedMalicious?: boolean | null; firstPageUrl?: string | null; maliciousDomainCategories?: ConnectionsListResultItemMaliciousDomainCategoriesList | null; maliciousUrlCategories?: ConnectionsListResultItemMaliciousUrlCategoriesList | null; pageUrls?: ConnectionsListResultItemPageUrlsList | null; urlReportedMalicious?: boolean | null; } export const ConnectionsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, addedAt: S.String.pipe(T.Body("added_at")), firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), url: S.String, urlContainsCdnCgiPath: S.Boolean.pipe(T.Body("url_contains_cdn_cgi_path")), domainReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("domain_reported_malicious")), ), firstPageUrl: S.optional(S.NullOr(S.String).pipe(T.Body("first_page_url"))), maliciousDomainCategories: S.optional( S.NullOr(ConnectionsListResultItemMaliciousDomainCategoriesList).pipe( T.Body("malicious_domain_categories"), ), ), maliciousUrlCategories: S.optional( S.NullOr(ConnectionsListResultItemMaliciousUrlCategoriesList).pipe( T.Body("malicious_url_categories"), ), ), pageUrls: S.optional( S.NullOr(ConnectionsListResultItemPageUrlsList).pipe(T.Body("page_urls")), ), urlReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("url_reported_malicious")), ), }), ).annotate({ identifier: "ConnectionsListResultItem", }) as any as S.Schema; export type ConnectionsListResultList = Array; export const ConnectionsListResultList = /*@__PURE__*/ S.Array( ConnectionsListResultItem, ) as any as S.Schema; export interface ListConnectionsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ConnectionsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListConnectionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ConnectionsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListConnectionsResponse", }) as any as S.Schema; export type CookiesListRequestDirection = "asc" | "desc"; export const CookiesListRequestDirection = /*@__PURE__*/ S.String; export type CookiesListRequestExport = "csv"; export const CookiesListRequestExport = /*@__PURE__*/ S.String; export type CookiesListRequestOrderBy = "first_seen_at" | "last_seen_at"; export const CookiesListRequestOrderBy = /*@__PURE__*/ S.String; export type CookiesListRequestSameSite = "lax" | "strict" | "none"; export const CookiesListRequestSameSite = /*@__PURE__*/ S.String; export type CookiesListRequestType = "first_party" | "unknown"; export const CookiesListRequestType = /*@__PURE__*/ S.String; export interface ListCookiesRequest { /** Identifier */ zoneId: string; /** The direction used to sort returned cookies.' */ direction?: CookiesListRequestDirection | (string & {}); /** Filters the returned cookies that match the specified domain attribute */ domain?: string; /** Export the list of cookies as a file, limited to 50000 entries. */ export?: CookiesListRequestExport | (string & {}); /** Includes cookies that match one or more URL-encoded hostnames separated by commas. */ hosts?: string; /** Filters the returned cookies that are set with HttpOnly */ httpOnly?: boolean; /** Filters the returned cookies that match the specified name. */ name?: string; /** The field used to sort returned cookies. */ orderBy?: CookiesListRequestOrderBy | (string & {}); /** The current page number of the paginated results. */ page?: string; /** Includes connections that match one or more page URLs (separated by commas) where they were last seen */ pageUrl?: string; /** Filters the returned cookies that match the specified path attribute */ path?: string; /** The number of results per page. */ perPage?: number; /** Filters the returned cookies that match the specified same_site attribute */ sameSite?: CookiesListRequestSameSite | (string & {}); /** Filters the returned cookies that are set with Secure */ secure?: boolean; /** Filters the returned cookies that match the specified type attribute */ type?: CookiesListRequestType | (string & {}); } export const ListCookiesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), direction: S.optional(CookiesListRequestDirection.pipe(T.Query())), domain: S.optional(S.String.pipe(T.Query())), export: S.optional(CookiesListRequestExport.pipe(T.Query())), hosts: S.optional(S.String.pipe(T.Query())), httpOnly: S.optional(S.Boolean.pipe(T.Query("http_only"))), name: S.optional(S.String.pipe(T.Query())), orderBy: S.optional(CookiesListRequestOrderBy.pipe(T.Query("order_by"))), page: S.optional(S.String.pipe(T.Query())), pageUrl: S.optional(S.String.pipe(T.Query("page_url"))), path: S.optional(S.String.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), sameSite: S.optional(CookiesListRequestSameSite.pipe(T.Query("same_site"))), secure: S.optional(S.Boolean.pipe(T.Query())), type: S.optional(CookiesListRequestType.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/cookies", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListCookiesRequest", }) as any as S.Schema; export type CookiesListResultItemType = "first_party" | "unknown"; export const CookiesListResultItemType = /*@__PURE__*/ S.String; export type CookiesListResultItemPageUrlsList = Array; export const CookiesListResultItemPageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type CookiesListResultItemSameSiteAttribute = "lax" | "strict" | "none"; export const CookiesListResultItemSameSiteAttribute = /*@__PURE__*/ S.String; export interface CookiesListResultItem { /** Identifier */ id: string; firstSeenAt: string; host: string; lastSeenAt: string; name: string; type: CookiesListResultItemType; domainAttribute?: string | null; expiresAttribute?: string | null; httpOnlyAttribute?: boolean | null; maxAgeAttribute?: number | null; pageUrls?: CookiesListResultItemPageUrlsList | null; pathAttribute?: string | null; sameSiteAttribute?: CookiesListResultItemSameSiteAttribute | null; secureAttribute?: boolean | null; } export const CookiesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), name: S.String, type: CookiesListResultItemType, domainAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("domain_attribute")), ), expiresAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("expires_attribute")), ), httpOnlyAttribute: S.optional( S.NullOr(S.Boolean).pipe(T.Body("http_only_attribute")), ), maxAgeAttribute: S.optional( S.NullOr(S.Number).pipe(T.Body("max_age_attribute")), ), pageUrls: S.optional( S.NullOr(CookiesListResultItemPageUrlsList).pipe(T.Body("page_urls")), ), pathAttribute: S.optional( S.NullOr(S.String).pipe(T.Body("path_attribute")), ), sameSiteAttribute: S.optional( S.NullOr(CookiesListResultItemSameSiteAttribute).pipe( T.Body("same_site_attribute"), ), ), secureAttribute: S.optional( S.NullOr(S.Boolean).pipe(T.Body("secure_attribute")), ), }), ).annotate({ identifier: "CookiesListResultItem", }) as any as S.Schema; export type CookiesListResultList = Array; export const CookiesListResultList = /*@__PURE__*/ S.Array( CookiesListResultItem, ) as any as S.Schema; export interface ListCookiesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: CookiesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListCookiesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: CookiesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListCookiesResponse", }) as any as S.Schema; export interface ListPoliciesRequest { /** Identifier */ zoneId: string; } export const ListPoliciesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/policies", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListPoliciesRequest", }) as any as S.Schema; export type PoliciesListResultItemAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesListResultItemAction = /*@__PURE__*/ S.String; export interface PoliciesListResultItem { /** Identifier */ id: string; /** The action to take if the expression matches */ action: PoliciesListResultItemAction; /** A description for the policy */ description: string; /** Whether the policy is enabled */ enabled: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression: string; /** The policy which will be applied */ value: string; } export const PoliciesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, action: PoliciesListResultItemAction, description: S.String, enabled: S.Boolean, expression: S.String, value: S.String, }), ).annotate({ identifier: "PoliciesListResultItem", }) as any as S.Schema; export type PoliciesListResultList = Array; export const PoliciesListResultList = /*@__PURE__*/ S.Array( PoliciesListResultItem, ) as any as S.Schema; export interface ListPoliciesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: PoliciesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListPoliciesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: PoliciesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListPoliciesResponse", }) as any as S.Schema; export type ScriptsListRequestDirection = "asc" | "desc"; export const ScriptsListRequestDirection = /*@__PURE__*/ S.String; export type ScriptsListRequestExport = "csv"; export const ScriptsListRequestExport = /*@__PURE__*/ S.String; export type ScriptsListRequestOrderBy = "first_seen_at" | "last_seen_at"; export const ScriptsListRequestOrderBy = /*@__PURE__*/ S.String; export interface ListScriptsRequest { /** Identifier */ zoneId: string; /** The direction used to sort returned scripts. */ direction?: ScriptsListRequestDirection | (string & {}); /** When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts. The default value is true. */ excludeCdnCgi?: boolean; /** When true, excludes duplicate scripts. We consider a script duplicate of another if their javascript */ excludeDuplicates?: boolean; /** Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas. */ excludeUrls?: string; /** Export the list of scripts as a file, limited to 50000 entries. */ export?: ScriptsListRequestExport | (string & {}); /** Includes scripts that match one or more URL-encoded hostnames separated by commas. */ hosts?: string; /** The field used to sort returned scripts. */ orderBy?: ScriptsListRequestOrderBy | (string & {}); /** The current page number of the paginated results. */ page?: string; /** Includes scripts that match one or more page URLs (separated by commas) where they were last seen */ pageUrl?: string; /** The number of results per page. */ perPage?: number; /** When true, malicious scripts appear first in the returned scripts. */ prioritizeMalicious?: boolean; /** Filters the returned scripts using a comma-separated list of scripts statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default value is `active`. */ status?: string; /** Includes scripts whose URL contain one or more URL-encoded URLs separated by commas. */ urls?: string; } export const ListScriptsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), direction: S.optional(ScriptsListRequestDirection.pipe(T.Query())), excludeCdnCgi: S.optional(S.Boolean.pipe(T.Query("exclude_cdn_cgi"))), excludeDuplicates: S.optional( S.Boolean.pipe(T.Query("exclude_duplicates")), ), excludeUrls: S.optional(S.String.pipe(T.Query("exclude_urls"))), export: S.optional(ScriptsListRequestExport.pipe(T.Query())), hosts: S.optional(S.String.pipe(T.Query())), orderBy: S.optional(ScriptsListRequestOrderBy.pipe(T.Query("order_by"))), page: S.optional(S.String.pipe(T.Query())), pageUrl: S.optional(S.String.pipe(T.Query("page_url"))), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), prioritizeMalicious: S.optional( S.Boolean.pipe(T.Query("prioritize_malicious")), ), status: S.optional(S.String.pipe(T.Query())), urls: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/page_shield/scripts", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListScriptsRequest", }) as any as S.Schema; export type ScriptsListResultItemMaliciousDomainCategoriesList = Array; export const ScriptsListResultItemMaliciousDomainCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ScriptsListResultItemMaliciousUrlCategoriesList = Array; export const ScriptsListResultItemMaliciousUrlCategoriesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ScriptsListResultItemPageUrlsList = Array; export const ScriptsListResultItemPageUrlsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ScriptsListResultItem { /** Identifier */ id: string; addedAt: string; firstSeenAt: string; host: string; lastSeenAt: string; url: string; urlContainsCdnCgiPath: boolean; /** The cryptomining score of the JavaScript content. */ cryptominingScore?: number | null; /** The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ dataflowScore?: number | null; domainReportedMalicious?: boolean | null; /** The timestamp of when the script was last fetched. */ fetchedAt?: string | null; firstPageUrl?: string | null; /** The computed hash of the analyzed script. */ hash?: string | null; /** The integrity score of the JavaScript content. */ jsIntegrityScore?: number | null; /** The magecart score of the JavaScript content. */ magecartScore?: number | null; maliciousDomainCategories?: ScriptsListResultItemMaliciousDomainCategoriesList | null; maliciousUrlCategories?: ScriptsListResultItemMaliciousUrlCategoriesList | null; /** The malware score of the JavaScript content. */ malwareScore?: number | null; /** The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score. */ obfuscationScore?: number | null; pageUrls?: ScriptsListResultItemPageUrlsList | null; urlReportedMalicious?: boolean | null; } export const ScriptsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, addedAt: S.String.pipe(T.Body("added_at")), firstSeenAt: S.String.pipe(T.Body("first_seen_at")), host: S.String, lastSeenAt: S.String.pipe(T.Body("last_seen_at")), url: S.String, urlContainsCdnCgiPath: S.Boolean.pipe(T.Body("url_contains_cdn_cgi_path")), cryptominingScore: S.optional( S.NullOr(S.Number).pipe(T.Body("cryptomining_score")), ), dataflowScore: S.optional( S.NullOr(S.Number).pipe(T.Body("dataflow_score")), ), domainReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("domain_reported_malicious")), ), fetchedAt: S.optional(S.NullOr(S.String).pipe(T.Body("fetched_at"))), firstPageUrl: S.optional(S.NullOr(S.String).pipe(T.Body("first_page_url"))), hash: S.optional(S.NullOr(S.String)), jsIntegrityScore: S.optional( S.NullOr(S.Number).pipe(T.Body("js_integrity_score")), ), magecartScore: S.optional( S.NullOr(S.Number).pipe(T.Body("magecart_score")), ), maliciousDomainCategories: S.optional( S.NullOr(ScriptsListResultItemMaliciousDomainCategoriesList).pipe( T.Body("malicious_domain_categories"), ), ), maliciousUrlCategories: S.optional( S.NullOr(ScriptsListResultItemMaliciousUrlCategoriesList).pipe( T.Body("malicious_url_categories"), ), ), malwareScore: S.optional(S.NullOr(S.Number).pipe(T.Body("malware_score"))), obfuscationScore: S.optional( S.NullOr(S.Number).pipe(T.Body("obfuscation_score")), ), pageUrls: S.optional( S.NullOr(ScriptsListResultItemPageUrlsList).pipe(T.Body("page_urls")), ), urlReportedMalicious: S.optional( S.NullOr(S.Boolean).pipe(T.Body("url_reported_malicious")), ), }), ).annotate({ identifier: "ScriptsListResultItem", }) as any as S.Schema; export type ScriptsListResultList = Array; export const ScriptsListResultList = /*@__PURE__*/ S.Array( ScriptsListResultItem, ) as any as S.Schema; export interface ListScriptsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ScriptsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListScriptsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ScriptsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListScriptsResponse", }) as any as S.Schema; export interface PutPageShieldRequest { /** Identifier */ zoneId: string; /** When true, indicates that Page Shield is enabled. */ enabled?: boolean; /** When true, CSP reports will be sent to https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report */ useCloudflareReportingEndpoint?: boolean; /** When true, the paths associated with connections URLs will also be analyzed. */ useConnectionUrlPath?: boolean; } export const PutPageShieldRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), enabled: S.optional(S.Boolean), useCloudflareReportingEndpoint: S.optional( S.Boolean.pipe(T.Body("use_cloudflare_reporting_endpoint")), ), useConnectionUrlPath: S.optional( S.Boolean.pipe(T.Body("use_connection_url_path")), ), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/page_shield", code: 200 }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutPageShieldRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutPageShieldResponse { /** When true, indicates that Page Shield is enabled. */ enabled: boolean; /** The timestamp of when Page Shield was last updated. */ updatedAt: string; /** When true, CSP reports will be sent to https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report */ useCloudflareReportingEndpoint: boolean; /** When true, the paths associated with connections URLs will also be analyzed. */ useConnectionUrlPath: boolean; } export const PutPageShieldResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, updatedAt: S.String.pipe(T.Body("updated_at")), useCloudflareReportingEndpoint: S.Boolean.pipe( T.Body("use_cloudflare_reporting_endpoint"), ), useConnectionUrlPath: S.Boolean.pipe(T.Body("use_connection_url_path")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutPageShieldResponse", }) as any as S.Schema; export type PoliciesUpdateRequestAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesUpdateRequestAction = /*@__PURE__*/ S.String; export interface UpdatePolicyRequest { /** Identifier */ zoneId: string; /** Identifier */ policyId: string; /** The action to take if the expression matches */ action?: PoliciesUpdateRequestAction | (string & {}); /** A description for the policy */ description?: string; /** Whether the policy is enabled */ enabled?: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression?: string; /** The policy which will be applied */ value?: string; } export const UpdatePolicyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), policyId: S.String.pipe(T.Label("policy_id")), action: S.optional(PoliciesUpdateRequestAction), description: S.optional(S.String), enabled: S.optional(S.Boolean), expression: S.optional(S.String), value: S.optional(S.String), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/page_shield/policies/{policy_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdatePolicyRequest", }) as any as S.Schema; export type PoliciesUpdateResponseAction = | "allow" | "log" | "add_reporting_directives"; export const PoliciesUpdateResponseAction = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdatePolicyResponse { /** Identifier */ id: string; /** The action to take if the expression matches */ action: PoliciesUpdateResponseAction; /** A description for the policy */ description: string; /** Whether the policy is enabled */ enabled: boolean; /** The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax */ expression: string; /** The policy which will be applied */ value: string; } export const UpdatePolicyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, action: PoliciesUpdateResponseAction, description: S.String, enabled: S.Boolean, expression: S.String, value: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdatePolicyResponse", }) as any as S.Schema; export type CreatePolicyError = | PolicyQuotaExceeded | Forbidden | CloudflareOpError; /** Create a Page Shield policy. */ export const createPolicy: API.OperationMethod< CreatePolicyRequest, CreatePolicyResponse, CreatePolicyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreatePolicyRequest, output: CreatePolicyResponse, errors: [ PolicyQuotaExceeded, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeletePolicyError = PolicyNotFound | Forbidden | CloudflareOpError; /** Delete a Page Shield policy by ID. */ export const deletePolicy: API.OperationMethod< DeletePolicyRequest, DeletePolicyResponse, DeletePolicyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeletePolicyRequest, output: DeletePolicyResponse, errors: [PolicyNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetConnectionError = CloudflareOpError; /** Fetches a connection detected by Page Shield by connection ID. */ export const getConnection: API.OperationMethod< GetConnectionRequest, GetConnectionResponse, GetConnectionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetConnectionRequest, output: GetConnectionResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetCookyError = CloudflareOpError; /** Fetches a cookie collected by Page Shield by cookie ID. */ export const getCooky: API.OperationMethod< GetCookyRequest, GetCookyResponse, GetCookyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetCookyRequest, output: GetCookyResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetPageShieldError = Forbidden | CloudflareOpError; /** Fetches the Page Shield settings. */ export const getPageShield: API.OperationMethod< GetPageShieldRequest, GetPageShieldResponse, GetPageShieldError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetPageShieldRequest, output: GetPageShieldResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetPolicyError = PolicyNotFound | Forbidden | CloudflareOpError; /** Fetches a Page Shield policy by ID. */ export const getPolicy: API.OperationMethod< GetPolicyRequest, GetPolicyResponse, GetPolicyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetPolicyRequest, output: GetPolicyResponse, errors: [PolicyNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetScriptError = CloudflareOpError; /** Fetches a script detected by Page Shield by script ID. */ export const getScript: API.OperationMethod< GetScriptRequest, GetScriptResponse, GetScriptError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetScriptRequest, output: GetScriptResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListConnectionsError = CloudflareOpError; /** Lists all connections detected by Page Shield. */ export const listConnections: API.PaginatedOperationMethod< ListConnectionsRequest, ListConnectionsResponse, ListConnectionsError, CloudflareOpContext, ConnectionsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListConnectionsRequest, output: ListConnectionsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListCookiesError = CloudflareOpError; /** Lists all cookies collected by Page Shield. */ export const listCookies: API.PaginatedOperationMethod< ListCookiesRequest, ListCookiesResponse, ListCookiesError, CloudflareOpContext, CookiesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListCookiesRequest, output: ListCookiesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListPoliciesError = Forbidden | CloudflareOpError; /** Lists all Page Shield policies. */ export const listPolicies: API.PaginatedOperationMethod< ListPoliciesRequest, ListPoliciesResponse, ListPoliciesError, CloudflareOpContext, PoliciesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListPoliciesRequest, output: ListPoliciesResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListScriptsError = CloudflareOpError; /** Lists all scripts detected by Page Shield. */ export const listScripts: API.PaginatedOperationMethod< ListScriptsRequest, ListScriptsResponse, ListScriptsError, CloudflareOpContext, ScriptsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListScriptsRequest, output: ListScriptsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type PutPageShieldError = NotEntitled | Forbidden | CloudflareOpError; /** Updates Page Shield settings. */ export const putPageShield: API.OperationMethod< PutPageShieldRequest, PutPageShieldResponse, PutPageShieldError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutPageShieldRequest, output: PutPageShieldResponse, errors: [NotEntitled, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdatePolicyError = PolicyNotFound | Forbidden | CloudflareOpError; /** Update a Page Shield policy by ID. */ export const updatePolicy: API.OperationMethod< UpdatePolicyRequest, UpdatePolicyResponse, UpdatePolicyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdatePolicyRequest, output: UpdatePolicyResponse, errors: [PolicyNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));