import { APIResource } from "../core/resource.js"; import * as CompletionsAPI from "./chat/completions.js"; import { APIPromise } from "../core/api-promise.js"; import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Credentials extends APIResource { /** * Create a new credential for storing sensitive data like API keys, tokens, or * other secrets. */ create(body: CredentialCreateParams, options?: RequestOptions): APIPromise; /** * Retrieve a specific credential by its unique identifier. */ retrieve(credentialID: string, options?: RequestOptions): APIPromise; /** * Update an existing credential's properties including name, description, type, * payload, and metadata. */ update(credentialID: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise; /** * Retrieve a paginated list of all credentials for the current account with * optional name filtering. */ list(query?: CredentialListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Permanently delete a credential and all its associated data. */ delete(credentialID: string, options?: RequestOptions): APIPromise; /** * Retrieve the plaintext payload of a credential by its ID. */ decrypt(credentialID: string, options?: RequestOptions): APIPromise; /** * Retrieve the plaintext payload of a credential by its name. */ decryptByName(credentialName: string, options?: RequestOptions): APIPromise; /** * Retrieve a specific credential by its name. */ retrieveByName(credentialName: string, options?: RequestOptions): APIPromise; } export type CredentialsCursorPage = CursorPage; export interface Credential { id: string; created_at: string; created_by_identity_type: string | null; created_by_user_id: string | null; credential_metadata: { [key: string]: unknown; } | null; description: string | null; name: string; type: string; updated_at: string; object?: string; } export interface CredentialSecret { result: string; object?: string; } export interface CredentialDeleteResponse { id: string; deleted: boolean; object?: string; } export interface CredentialCreateParams { /** * User-friendly name for the credential */ name: string; /** * The credential payload to be encrypted */ payload: string; /** * Type of credential: key or json */ type: string; /** * Optional unencrypted credential_metadata */ credential_metadata?: { [key: string]: unknown; }; /** * Optional description */ description?: string; } export interface CredentialUpdateParams { /** * Optional unencrypted credential_metadata */ credential_metadata?: { [key: string]: unknown; }; /** * Optional description */ description?: string; /** * User-friendly name for the credential */ name?: string; /** * The credential payload to be encrypted */ payload?: string; /** * Type of credential: key or json */ type?: string; } export interface CredentialListParams extends CursorPageParams { /** * Filter credentials by name */ name?: string; sort_by?: string; sort_order?: CompletionsAPI.SortOrder; } export declare namespace Credentials { export { type Credential as Credential, type CredentialSecret as CredentialSecret, type CredentialDeleteResponse as CredentialDeleteResponse, type CredentialsCursorPage as CredentialsCursorPage, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, }; } //# sourceMappingURL=credentials.d.ts.map