import type { RequestOptions } from "@cerbos/core"; import type { ClientOptions } from "./client.js"; import type { GetFilesRequest, GetFilesResponse, ListFilesRequest, ListFilesResponse, ModifyFilesRequest, ModifyFilesResponse, ReplaceFilesRequest, ReplaceFilesResponse } from "./types.js"; /** * A client for interacting with policy stores in Cerbos Hub. */ export declare class StoresClient { private readonly client; /** * Create a client for interacting with policy stores in Cerbos Hub. * * @param options - Settings for the client. * * @example * ```typescript * const stores = new StoresClient({ credentials: credentialsFromEnv() }); * ``` */ constructor(options: ClientOptions); /** * List file paths in a policy store. * * @example * ```typescript * const { storeVersion, files } = await stores.listFiles({ storeId: "MWPKEMFX3CK1" }); * ``` */ listFiles(request: ListFilesRequest, options?: RequestOptions): Promise; /** * Get file contents from a policy store. * * @example * ```typescript * const { storeVersion, files } = await stores.getFiles({ * storeId: "MWPKEMFX3CK1", * files: ["policy.yaml"], * }); * ``` */ getFiles(request: GetFilesRequest, options?: RequestOptions): Promise; /** * Modify files in a policy store. * * @remarks * This is a "patch" operation; files that aren't included in the request won't be modified. * * @example * ```typescript * const { newStoreVersion } = await stores.modifyFiles({ * storeId: "MWPKEMFX3CK1", * operations: [ * { * addOrUpdate: { * path: "policy.yaml", * contents: await readFile("path/to/policy.yaml"), * }, * }, * ], * }); * ``` */ modifyFiles(request: ModifyFilesRequest, options?: RequestOptions): Promise; /** * Replace files in a policy store. * * @remarks * This is a "put" operation; files that aren't included in the request will be removed from the store. * * @example * Upload individual files: * * ```typescript * const { newStoreVersion } = await stores.replaceFiles({ * storeId: "MWPKEMFX3CK1", * contents: { * files: [ * { * path: "policy.yaml", * contents: await readFile("path/to/policy.yaml"), * }, * ], * }, * }); * ``` * * @example * Upload zipped files: * * ```typescript * const { newStoreVersion } = await stores.replaceFiles({ * storeId: "MWPKEMFX3CK1", * contents: { * zipped: await readFile("path/to/policies.zip"), * }, * }); * ``` */ replaceFiles(request: ReplaceFilesRequest, options?: RequestOptions): Promise; } //# sourceMappingURL=stores.d.ts.map