import { APIResource } from "../core/resource.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { ItemsCursorGetPagination, type ItemsCursorGetPaginationParams, PagePromise } from "../core/pagination.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; export declare class WorkspaceSecrets extends APIResource { /** * List the current workspace's secret keys in ascending key order. Secret values * are never returned. Set include_configs to include allowed hosts and header * configuration. Pass next_cursor as cursor to retrieve the next page, keeping * include_configs unchanged. Pagination reflects the current secrets on each * request, rather than a snapshot. */ list(query?: WorkspaceSecretListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Delete a workspace secret and its allowed hosts. * * Requires workspace admin. Missing keys succeed. */ delete(key: string, options?: RequestOptions): APIPromise; /** * Create or update a workspace secret and the hosts it may be sent to. * * Requires workspace admin. Omit value to keep the current one; it is required to * create a secret. configs replaces the secret's hosts; omitted or empty restores * the built-in defaults for known provider keys. The value is never returned. */ upsert(key: string, body: WorkspaceSecretUpsertParams, options?: RequestOptions): APIPromise; } export type WorkspaceSecretsItemsCursorGetPagination = ItemsCursorGetPagination; /** * A workspace secret's key and the hosts it may be sent to. Never the value. */ export interface WorkspaceSecret { /** * Secret name, e.g. OPENAI_API_KEY. */ key: string; /** * Hosts the secret may be sent to, with built-in defaults applied. Listed secrets * include it only when include_configs is true. */ configs?: Array; } export declare namespace WorkspaceSecret { interface Config { /** * Exact host or a leading '\*.' wildcard, e.g. 'api.openai.com'. */ host_pattern: string; /** * DEFAULT for a built-in provider host, CUSTOM for one an admin set. */ source: 'DEFAULT' | 'CUSTOM'; /** * Omitted for a built-in default. */ id?: string | null; /** * Omitted for a built-in default. */ created_at?: string | null; /** * HTTP header the secret is sent in. Null leaves it to the consumer. */ header_name?: string | null; /** * Header value with '{value}' replaced by the secret, e.g. 'Bearer {value}'. Null * sends the raw secret. */ header_value_template?: string | null; /** * Omitted for a built-in default. */ updated_at?: string | null; } } export interface WorkspaceSecretListParams extends ItemsCursorGetPaginationParams { /** * Include the hosts each secret may be sent to */ include_configs?: boolean; } export interface WorkspaceSecretUpsertParams { /** * Full replacement of the allowed hosts. Omitted or empty removes custom hosts so * the built-in defaults, if any, apply. */ configs?: Array | null; /** * Secret value. Required to create a secret; omit to keep the current value. */ value?: string | null; } export declare namespace WorkspaceSecretUpsertParams { /** * A host a workspace secret may be sent to, and how it is sent. */ interface Config { /** * Exact host or a leading '\*.' wildcard, e.g. 'api.openai.com'. */ host_pattern: string; /** * HTTP header the secret is sent in. Null leaves it to the consumer. */ header_name?: string | null; /** * Header value with '{value}' replaced by the secret, e.g. 'Bearer {value}'. Null * sends the raw secret. */ header_value_template?: string | null; } } export declare namespace WorkspaceSecrets { export { type WorkspaceSecret as WorkspaceSecret, type WorkspaceSecretsItemsCursorGetPagination as WorkspaceSecretsItemsCursorGetPagination, type WorkspaceSecretListParams as WorkspaceSecretListParams, type WorkspaceSecretUpsertParams as WorkspaceSecretUpsertParams, }; }