// 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> = { accountId: "account_id", perPage: "per_page", resultInfo: "result_info", storeId: "store_id", totalCount: "total_count", }; export class InvalidAccountId extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidAccountId", { code: S.Number, message: S.String, }), [{ code: 7003 }], ) {} export class InvalidJsonBody extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidJsonBody", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "invalid_json_body" } }], ) {} export class MaximumStoresExceeded extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "MaximumStoresExceeded", { code: S.Number, message: S.String, }, ), [{ code: 1003, message: { includes: "maximum_stores_exceeded" } }], ) {} export class NotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NotFound", { code: S.Number, message: S.String, }), [{ code: 1000 }], ) {} export class SecretNameAlreadyExists extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "SecretNameAlreadyExists", { code: S.Number, message: S.String, }, ), [{ code: 1003, message: { includes: "secret_name_already_exists" } }], ) {} export class SecretNameEmpty extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("SecretNameEmpty", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "secret_name_empty" } }], ) {} export class SecretNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("SecretNotFound", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "secret_not_found" } }], ) {} export class SecretScopeInvalid extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("SecretScopeInvalid", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "secret_scope_invalid" } }], ) {} export class SecretScopesEmpty extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("SecretScopesEmpty", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "secret_scopes_empty" } }], ) {} export class StoreNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("StoreNotFound", { code: S.Number, message: S.String, }), [{ code: 1001, message: { includes: "store_not_found" } }], ) {} export interface BulkDeleteStoreSecretsRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; } export const BulkDeleteStoreSecretsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkDeleteStoreSecretsRequest", }) as any as S.Schema; export type BulkDeleteStoreSecretsResponse = unknown; export const BulkDeleteStoreSecretsResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkDeleteStoreSecretsResponse", }) as any as S.Schema; export interface CreateStoreRequest { /** Account Identifier */ accountId: string; /** The name of the store */ name: string; } export const CreateStoreRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), name: S.String, }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/secrets_store/stores", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateStoreRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateStoreResponse { /** Store Identifier */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the store */ name: string; /** Account Identifier */ accountId?: string | null; } export const CreateStoreResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, accountId: S.optional(S.NullOr(S.String).pipe(T.Body("account_id"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateStoreResponse", }) as any as S.Schema; export type StoresSecretsCreateRequestBodyItemScopesList = Array; export const StoresSecretsCreateRequestBodyItemScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface StoresSecretsCreateRequestBodyItem { /** The name of the secret */ name: string; /** The list of services that can use this secret. */ scopes: StoresSecretsCreateRequestBodyItemScopesList; /** The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets. */ value: string; /** Freeform text describing the secret */ comment?: string; } export const StoresSecretsCreateRequestBodyItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, scopes: StoresSecretsCreateRequestBodyItemScopesList, value: S.String, comment: S.optional(S.String), }), ).annotate({ identifier: "StoresSecretsCreateRequestBodyItem", }) as any as S.Schema; export type StoresSecretsCreateRequestBodyList = Array; export const StoresSecretsCreateRequestBodyList = /*@__PURE__*/ S.Array( StoresSecretsCreateRequestBodyItem, ) as any as S.Schema; export interface CreateStoreSecretRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; body: StoresSecretsCreateRequestBodyList; } export const CreateStoreSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), body: StoresSecretsCreateRequestBodyList.pipe(T.HttpBody()), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateStoreSecretRequest", }) as any as S.Schema; export type StoresSecretsCreateResultItemStatus = | "pending" | "active" | "deleted"; export const StoresSecretsCreateResultItemStatus = /*@__PURE__*/ S.String; export type StoresSecretsCreateResultItemScopesList = Array; export const StoresSecretsCreateResultItemScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface StoresSecretsCreateResultItem { /** Secret identifier tag. */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the secret */ name: string; status: StoresSecretsCreateResultItemStatus; /** Store Identifier */ storeId: string; /** Freeform text describing the secret */ comment?: string | null; /** The list of services that can use this secret. */ scopes?: StoresSecretsCreateResultItemScopesList | null; } export const StoresSecretsCreateResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, status: StoresSecretsCreateResultItemStatus, storeId: S.String.pipe(T.Body("store_id")), comment: S.optional(S.NullOr(S.String)), scopes: S.optional(S.NullOr(StoresSecretsCreateResultItemScopesList)), }), ).annotate({ identifier: "StoresSecretsCreateResultItem", }) as any as S.Schema; export type StoresSecretsCreateResultList = Array; export const StoresSecretsCreateResultList = /*@__PURE__*/ S.Array( StoresSecretsCreateResultItem, ) as any as S.Schema; export interface CreateStoreSecretResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: StoresSecretsCreateResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const CreateStoreSecretResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: StoresSecretsCreateResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateStoreSecretResponse", }) as any as S.Schema; export interface DeleteStoreRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** When true, cascade-deletes all secrets in the store before deleting */ force?: boolean; } export const DeleteStoreRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), force: S.optional(S.Boolean.pipe(T.Query())), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteStoreRequest", }) as any as S.Schema; export type DeleteStoreResponse = unknown; export const DeleteStoreResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteStoreResponse", }) as any as S.Schema; export interface DeleteStoreSecretRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** Secret identifier tag. */ secretId: string; } export const DeleteStoreSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), secretId: S.String.pipe(T.Label("secret_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteStoreSecretRequest", }) as any as S.Schema; export type DeleteStoreSecretResponse = unknown; export const DeleteStoreSecretResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteStoreSecretResponse", }) as any as S.Schema; export type StoresSecretsDuplicateRequestScopesList = Array; export const StoresSecretsDuplicateRequestScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface DuplicateStoreSecretRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** Secret identifier tag. */ secretId: string; /** The name of the secret */ name: string; /** The list of services that can use this secret. */ scopes: StoresSecretsDuplicateRequestScopesList; /** Freeform text describing the secret */ comment?: string; } export const DuplicateStoreSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), secretId: S.String.pipe(T.Label("secret_id")), name: S.String, scopes: StoresSecretsDuplicateRequestScopesList, comment: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}/duplicate", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DuplicateStoreSecretRequest", }) as any as S.Schema; export type StoresSecretsDuplicateResponseStatus = | "pending" | "active" | "deleted"; export const StoresSecretsDuplicateResponseStatus = /*@__PURE__*/ S.String; export type StoresSecretsDuplicateResponseScopesList = Array; export const StoresSecretsDuplicateResponseScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DuplicateStoreSecretResponse { /** Secret identifier tag. */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the secret */ name: string; status: StoresSecretsDuplicateResponseStatus; /** Store Identifier */ storeId: string; /** Freeform text describing the secret */ comment?: string | null; /** The list of services that can use this secret. */ scopes?: StoresSecretsDuplicateResponseScopesList | null; } export const DuplicateStoreSecretResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, status: StoresSecretsDuplicateResponseStatus, storeId: S.String.pipe(T.Body("store_id")), comment: S.optional(S.NullOr(S.String)), scopes: S.optional(S.NullOr(StoresSecretsDuplicateResponseScopesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DuplicateStoreSecretResponse", }) as any as S.Schema; export interface GetQuotaRequest { /** Account Identifier */ accountId: string; } export const GetQuotaRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/secrets_store/quota", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetQuotaRequest", }) as any as S.Schema; export interface QuotaGetResponseSecrets { /** The number of secrets the account is entitlted to use */ quota: number; /** The number of secrets the account is currently using */ usage: number; } export const QuotaGetResponseSecrets = /*@__PURE__*/ S.suspend(() => S.Struct({ quota: S.Number, usage: S.Number, }), ).annotate({ identifier: "QuotaGetResponseSecrets", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetQuotaResponse { secrets: QuotaGetResponseSecrets; } export const GetQuotaResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ secrets: QuotaGetResponseSecrets, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetQuotaResponse", }) as any as S.Schema; export interface GetStoreRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; } export const GetStoreRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStoreRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetStoreResponse { /** Store Identifier */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the store */ name: string; /** Account Identifier */ accountId?: string | null; } export const GetStoreResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, accountId: S.optional(S.NullOr(S.String).pipe(T.Body("account_id"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStoreResponse", }) as any as S.Schema; export interface GetStoreSecretRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** Secret identifier tag. */ secretId: string; } export const GetStoreSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), secretId: S.String.pipe(T.Label("secret_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStoreSecretRequest", }) as any as S.Schema; export type StoresSecretsGetResponseStatus = "pending" | "active" | "deleted"; export const StoresSecretsGetResponseStatus = /*@__PURE__*/ S.String; export type StoresSecretsGetResponseScopesList = Array; export const StoresSecretsGetResponseScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetStoreSecretResponse { /** Secret identifier tag. */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the secret */ name: string; status: StoresSecretsGetResponseStatus; /** Store Identifier */ storeId: string; /** Freeform text describing the secret */ comment?: string | null; /** The list of services that can use this secret. */ scopes?: StoresSecretsGetResponseScopesList | null; } export const GetStoreSecretResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, status: StoresSecretsGetResponseStatus, storeId: S.String.pipe(T.Body("store_id")), comment: S.optional(S.NullOr(S.String)), scopes: S.optional(S.NullOr(StoresSecretsGetResponseScopesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetStoreSecretResponse", }) as any as S.Schema; export type StoresListRequestDirection = "asc" | "desc"; export const StoresListRequestDirection = /*@__PURE__*/ S.String; export type StoresListRequestOrder = | "name" | "comment" | "created" | "modified" | "status"; export const StoresListRequestOrder = /*@__PURE__*/ S.String; export interface ListStoresRequest { /** Account Identifier */ accountId: string; /** Direction to sort objects */ direction?: StoresListRequestDirection | (string & {}); /** Order secrets by values in the given field */ order?: StoresListRequestOrder | (string & {}); /** Page number */ page?: number; /** Number of objects to return per page */ perPage?: number; } export const ListStoresRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), direction: S.optional(StoresListRequestDirection.pipe(T.Query())), order: S.optional(StoresListRequestOrder.pipe(T.Query())), 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}/secrets_store/stores", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListStoresRequest", }) as any as S.Schema; export interface StoresListResultItem { /** Store Identifier */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the store */ name: string; /** Account Identifier */ accountId?: string | null; } export const StoresListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, accountId: S.optional(S.NullOr(S.String).pipe(T.Body("account_id"))), }), ).annotate({ identifier: "StoresListResultItem", }) as any as S.Schema; export type StoresListResultList = Array; export const StoresListResultList = /*@__PURE__*/ S.Array( StoresListResultItem, ) as any as S.Schema; export interface ListStoresResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: StoresListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListStoresResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: StoresListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListStoresResponse", }) as any as S.Schema; export type StoresSecretsListRequestDirection = "asc" | "desc"; export const StoresSecretsListRequestDirection = /*@__PURE__*/ S.String; export type StoresSecretsListRequestOrder = | "name" | "comment" | "created" | "modified" | "status"; export const StoresSecretsListRequestOrder = /*@__PURE__*/ S.String; export type StoresSecretsListRequestScopesList = Array; export const StoresSecretsListRequestScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ListStoreSecretsRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** Direction to sort objects */ direction?: StoresSecretsListRequestDirection | (string & {}); /** Order secrets by values in the given field */ order?: StoresSecretsListRequestOrder | (string & {}); /** Page number */ page?: number; /** Number of objects to return per page */ perPage?: number; /** Only secrets with the given scopes will be returned */ scopes?: StoresSecretsListRequestScopesList; /** Search secrets using a filter string, filtering across name and comment */ search?: string; } export const ListStoreSecretsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), direction: S.optional(StoresSecretsListRequestDirection.pipe(T.Query())), order: S.optional(StoresSecretsListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), scopes: S.optional(StoresSecretsListRequestScopesList.pipe(T.Query())), search: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListStoreSecretsRequest", }) as any as S.Schema; export type StoresSecretsListResultItemStatus = | "pending" | "active" | "deleted"; export const StoresSecretsListResultItemStatus = /*@__PURE__*/ S.String; export type StoresSecretsListResultItemScopesList = Array; export const StoresSecretsListResultItemScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface StoresSecretsListResultItem { /** Secret identifier tag. */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the secret */ name: string; status: StoresSecretsListResultItemStatus; /** Store Identifier */ storeId: string; /** Freeform text describing the secret */ comment?: string | null; /** The list of services that can use this secret. */ scopes?: StoresSecretsListResultItemScopesList | null; } export const StoresSecretsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, status: StoresSecretsListResultItemStatus, storeId: S.String.pipe(T.Body("store_id")), comment: S.optional(S.NullOr(S.String)), scopes: S.optional(S.NullOr(StoresSecretsListResultItemScopesList)), }), ).annotate({ identifier: "StoresSecretsListResultItem", }) as any as S.Schema; export type StoresSecretsListResultList = Array; export const StoresSecretsListResultList = /*@__PURE__*/ S.Array( StoresSecretsListResultItem, ) as any as S.Schema; export interface ListStoreSecretsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: StoresSecretsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListStoreSecretsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: StoresSecretsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListStoreSecretsResponse", }) as any as S.Schema; export type StoresSecretsEditRequestScopesList = Array; export const StoresSecretsEditRequestScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface PatchStoreSecretRequest { /** Account Identifier */ accountId: string; /** Store Identifier */ storeId: string; /** Secret identifier tag. */ secretId: string; /** Freeform text describing the secret */ comment?: string; /** The list of services that can use this secret. */ scopes?: StoresSecretsEditRequestScopesList; /** The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets. */ value?: string; } export const PatchStoreSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), storeId: S.String.pipe(T.Label("store_id")), secretId: S.String.pipe(T.Label("secret_id")), comment: S.optional(S.String), scopes: S.optional(StoresSecretsEditRequestScopesList), value: S.optional(S.String), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchStoreSecretRequest", }) as any as S.Schema; export type StoresSecretsEditResponseStatus = "pending" | "active" | "deleted"; export const StoresSecretsEditResponseStatus = /*@__PURE__*/ S.String; export type StoresSecretsEditResponseScopesList = Array; export const StoresSecretsEditResponseScopesList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchStoreSecretResponse { /** Secret identifier tag. */ id: string; /** Whenthe secret was created. */ created: string; /** When the secret was modified. */ modified: string; /** The name of the secret */ name: string; status: StoresSecretsEditResponseStatus; /** Store Identifier */ storeId: string; /** Freeform text describing the secret */ comment?: string | null; /** The list of services that can use this secret. */ scopes?: StoresSecretsEditResponseScopesList | null; } export const PatchStoreSecretResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, modified: S.String, name: S.String, status: StoresSecretsEditResponseStatus, storeId: S.String.pipe(T.Body("store_id")), comment: S.optional(S.NullOr(S.String)), scopes: S.optional(S.NullOr(StoresSecretsEditResponseScopesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchStoreSecretResponse", }) as any as S.Schema; export type BulkDeleteStoreSecretsError = | StoreNotFound | InvalidAccountId | InvalidJsonBody | CloudflareOpError; /** Deletes one or more secrets */ export const bulkDeleteStoreSecrets: API.OperationMethod< BulkDeleteStoreSecretsRequest, BulkDeleteStoreSecretsResponse, BulkDeleteStoreSecretsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: BulkDeleteStoreSecretsRequest, output: BulkDeleteStoreSecretsResponse, errors: [ StoreNotFound, InvalidAccountId, InvalidJsonBody, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateStoreError = | InvalidAccountId | MaximumStoresExceeded | CloudflareOpError; /** Creates a store in the account */ export const createStore: API.OperationMethod< CreateStoreRequest, CreateStoreResponse, CreateStoreError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateStoreRequest, output: CreateStoreResponse, errors: [ InvalidAccountId, MaximumStoresExceeded, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateStoreSecretError = | StoreNotFound | InvalidAccountId | SecretNameEmpty | SecretNameAlreadyExists | SecretScopeInvalid | CloudflareOpError; /** Creates a secret in the account */ export const createStoreSecret: API.PaginatedOperationMethod< CreateStoreSecretRequest, CreateStoreSecretResponse, CreateStoreSecretError, CloudflareOpContext, StoresSecretsCreateResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: CreateStoreSecretRequest, output: CreateStoreSecretResponse, errors: [ StoreNotFound, InvalidAccountId, SecretNameEmpty, SecretNameAlreadyExists, SecretScopeInvalid, CloudflareRateLimited, CloudflareError, ], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type DeleteStoreError = | StoreNotFound | InvalidAccountId | NotFound | CloudflareOpError; /** Deletes a single store. By default, a store that still contains secrets cannot be deleted and returns HTTP 409 (Conflict) with the "store_not_empty" error. Pass `force=true` to cascade-delete all secrets in the store. Empty stores are always deleted regardless of the force parameter. */ export const deleteStore: API.OperationMethod< DeleteStoreRequest, DeleteStoreResponse, DeleteStoreError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteStoreRequest, output: DeleteStoreResponse, errors: [ StoreNotFound, InvalidAccountId, NotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteStoreSecretError = | StoreNotFound | SecretNotFound | InvalidAccountId | NotFound | CloudflareOpError; /** Deletes a single secret */ export const deleteStoreSecret: API.OperationMethod< DeleteStoreSecretRequest, DeleteStoreSecretResponse, DeleteStoreSecretError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteStoreSecretRequest, output: DeleteStoreSecretResponse, errors: [ StoreNotFound, SecretNotFound, InvalidAccountId, NotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DuplicateStoreSecretError = | StoreNotFound | SecretNotFound | SecretNameEmpty | SecretScopesEmpty | SecretNameAlreadyExists | InvalidAccountId | SecretScopeInvalid | CloudflareOpError; /** Duplicates the secret, keeping the value */ export const duplicateStoreSecret: API.OperationMethod< DuplicateStoreSecretRequest, DuplicateStoreSecretResponse, DuplicateStoreSecretError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DuplicateStoreSecretRequest, output: DuplicateStoreSecretResponse, errors: [ StoreNotFound, SecretNotFound, SecretNameEmpty, SecretScopesEmpty, SecretNameAlreadyExists, InvalidAccountId, SecretScopeInvalid, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetQuotaError = InvalidAccountId | CloudflareOpError; /** Lists the number of secrets used in the account. */ export const getQuota: API.OperationMethod< GetQuotaRequest, GetQuotaResponse, GetQuotaError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetQuotaRequest, output: GetQuotaResponse, errors: [InvalidAccountId, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetStoreError = CloudflareOpError; /** Returns details of a single store */ export const getStore: API.OperationMethod< GetStoreRequest, GetStoreResponse, GetStoreError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetStoreRequest, output: GetStoreResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetStoreSecretError = | StoreNotFound | SecretNotFound | InvalidAccountId | NotFound | CloudflareOpError; /** Returns details of a single secret */ export const getStoreSecret: API.OperationMethod< GetStoreSecretRequest, GetStoreSecretResponse, GetStoreSecretError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetStoreSecretRequest, output: GetStoreSecretResponse, errors: [ StoreNotFound, SecretNotFound, InvalidAccountId, NotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListStoresError = InvalidAccountId | CloudflareOpError; /** Lists all the stores in an account */ export const listStores: API.PaginatedOperationMethod< ListStoresRequest, ListStoresResponse, ListStoresError, CloudflareOpContext, StoresListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListStoresRequest, output: ListStoresResponse, errors: [InvalidAccountId, 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 ListStoreSecretsError = | StoreNotFound | InvalidAccountId | CloudflareOpError; /** Lists all store secrets */ export const listStoreSecrets: API.PaginatedOperationMethod< ListStoreSecretsRequest, ListStoreSecretsResponse, ListStoreSecretsError, CloudflareOpContext, StoresSecretsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListStoreSecretsRequest, output: ListStoreSecretsResponse, errors: [ StoreNotFound, InvalidAccountId, 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 PatchStoreSecretError = | StoreNotFound | SecretNotFound | InvalidAccountId | SecretScopeInvalid | CloudflareOpError; /** Updates a single secret */ export const patchStoreSecret: API.OperationMethod< PatchStoreSecretRequest, PatchStoreSecretResponse, PatchStoreSecretError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchStoreSecretRequest, output: PatchStoreSecretResponse, errors: [ StoreNotFound, SecretNotFound, InvalidAccountId, SecretScopeInvalid, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));