import { APIResource } from "../../../core/resource.js"; import { APIPromise } from "../../../core/api-promise.js"; import { PagePromise, SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../core/pagination.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class BaseSecrets extends APIResource { static readonly _key: readonly ['secretsStore', 'stores', 'secrets']; /** * Creates a secret in the account * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const secretCreateResponse of client.secretsStore.stores.secrets.create( * '023e105f4ecef8ad9ca31a8372d0c353', * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * body: [ * { * name: 'MY_API_KEY', * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * value: 'api-token-secret-123', * }, * ], * }, * )) { * // ... * } * ``` */ create(storeID: string, params: SecretCreateParams, options?: RequestOptions): PagePromise; /** * Lists all store secrets * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const secretListResponse of client.secretsStore.stores.secrets.list( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '985e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(storeID: string, params: SecretListParams, options?: RequestOptions): PagePromise; /** * Deletes a single secret * * @example * ```ts * const secret = * await client.secretsStore.stores.secrets.delete( * '3fd85f74b32742f1bff64a85009dda07', * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * store_id: '023e105f4ecef8ad9ca31a8372d0c353', * }, * ); * ``` */ delete(secretID: string, params: SecretDeleteParams, options?: RequestOptions): APIPromise; /** * Deletes one or more secrets * * @example * ```ts * const response = * await client.secretsStore.stores.secrets.bulkDelete( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '985e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ bulkDelete(storeID: string, params: SecretBulkDeleteParams, options?: RequestOptions): APIPromise; /** * Duplicates the secret, keeping the value * * @example * ```ts * const response = * await client.secretsStore.stores.secrets.duplicate( * '3fd85f74b32742f1bff64a85009dda07', * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * store_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', * scopes: ['workers', 'ai_gateway', 'dex', 'access'], * }, * ); * ``` */ duplicate(secretID: string, params: SecretDuplicateParams, options?: RequestOptions): APIPromise; /** * Updates a single secret * * @example * ```ts * const response = * await client.secretsStore.stores.secrets.edit( * '3fd85f74b32742f1bff64a85009dda07', * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * store_id: '023e105f4ecef8ad9ca31a8372d0c353', * }, * ); * ``` */ edit(secretID: string, params: SecretEditParams, options?: RequestOptions): APIPromise; /** * Returns details of a single secret * * @example * ```ts * const secret = await client.secretsStore.stores.secrets.get( * '3fd85f74b32742f1bff64a85009dda07', * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * store_id: '023e105f4ecef8ad9ca31a8372d0c353', * }, * ); * ``` */ get(secretID: string, params: SecretGetParams, options?: RequestOptions): APIPromise; } export declare class Secrets extends BaseSecrets { } export type SecretCreateResponsesSinglePage = SinglePage; export type SecretListResponsesV4PagePaginationArray = V4PagePaginationArray; export interface SecretCreateResponse { /** * 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: 'pending' | 'active' | 'deleted'; /** * Store Identifier */ store_id: string; /** * Freeform text describing the secret */ comment?: string; /** * The list of services that can use this secret. */ scopes?: Array; } export interface SecretListResponse { /** * 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: 'pending' | 'active' | 'deleted'; /** * Store Identifier */ store_id: string; /** * Freeform text describing the secret */ comment?: string; /** * The list of services that can use this secret. */ scopes?: Array; } /** * Result is null for delete operations. */ export type SecretDeleteResponse = unknown; /** * Result is null for delete operations. */ export type SecretBulkDeleteResponse = unknown; export interface SecretDuplicateResponse { /** * 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: 'pending' | 'active' | 'deleted'; /** * Store Identifier */ store_id: string; /** * Freeform text describing the secret */ comment?: string; /** * The list of services that can use this secret. */ scopes?: Array; } export interface SecretEditResponse { /** * 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: 'pending' | 'active' | 'deleted'; /** * Store Identifier */ store_id: string; /** * Freeform text describing the secret */ comment?: string; /** * The list of services that can use this secret. */ scopes?: Array; } export interface SecretGetResponse { /** * 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: 'pending' | 'active' | 'deleted'; /** * Store Identifier */ store_id: string; /** * Freeform text describing the secret */ comment?: string; /** * The list of services that can use this secret. */ scopes?: Array; } export interface SecretCreateParams { /** * Path param: Account Identifier */ account_id: string; /** * Body param */ body: Array; } export declare namespace SecretCreateParams { interface Body { /** * The name of the secret */ name: string; /** * The list of services that can use this secret. */ scopes: Array; /** * 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 interface SecretListParams extends V4PagePaginationArrayParams { /** * Path param: Account Identifier */ account_id: string; /** * Query param: Direction to sort objects */ direction?: 'asc' | 'desc'; /** * Query param: Order secrets by values in the given field */ order?: 'name' | 'comment' | 'created' | 'modified' | 'status'; /** * Query param: Only secrets with the given scopes will be returned */ scopes?: Array>; /** * Query param: Search secrets using a filter string, filtering across name and * comment */ search?: string; } export interface SecretDeleteParams { /** * Account Identifier */ account_id: string; /** * Store Identifier */ store_id: string; } export interface SecretBulkDeleteParams { /** * Account Identifier */ account_id: string; } export interface SecretDuplicateParams { /** * Path param: Account Identifier */ account_id: string; /** * Path param: Store Identifier */ store_id: string; /** * Body param: The name of the secret */ name: string; /** * Body param: The list of services that can use this secret. */ scopes: Array; /** * Body param: Freeform text describing the secret */ comment?: string; } export interface SecretEditParams { /** * Path param: Account Identifier */ account_id: string; /** * Path param: Store Identifier */ store_id: string; /** * Body param: Freeform text describing the secret */ comment?: string; /** * Body param: The list of services that can use this secret. */ scopes?: Array; /** * Body param: 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 interface SecretGetParams { /** * Account Identifier */ account_id: string; /** * Store Identifier */ store_id: string; } export declare namespace Secrets { export { type SecretCreateResponse as SecretCreateResponse, type SecretListResponse as SecretListResponse, type SecretDeleteResponse as SecretDeleteResponse, type SecretBulkDeleteResponse as SecretBulkDeleteResponse, type SecretDuplicateResponse as SecretDuplicateResponse, type SecretEditResponse as SecretEditResponse, type SecretGetResponse as SecretGetResponse, type SecretCreateResponsesSinglePage as SecretCreateResponsesSinglePage, type SecretListResponsesV4PagePaginationArray as SecretListResponsesV4PagePaginationArray, type SecretCreateParams as SecretCreateParams, type SecretListParams as SecretListParams, type SecretDeleteParams as SecretDeleteParams, type SecretBulkDeleteParams as SecretBulkDeleteParams, type SecretDuplicateParams as SecretDuplicateParams, type SecretEditParams as SecretEditParams, type SecretGetParams as SecretGetParams, }; } //# sourceMappingURL=secrets.d.ts.map