Skip to content

FilesClientOptions

Defined in: libs/ccs-files-client/src/files-client.ts:55

optional issuerUrl?: string

Defined in: libs/ccs-files-client/src/files-client.ts:61

Identity Server v3 bare issuer origin, e.g. https://auth.centralcodestation.com (no /api). Omitted: the platform’s Identity Server for the environment (CCS_ISSUER_URL, else CCS_ENVIRONMENT, else production), read from env.


clientId: string

Defined in: libs/ccs-files-client/src/files-client.ts:66

A CONFIDENTIAL client with the client_credentials grant and a resource permission on the Files API (files:manage, or files:read / files:config.manage).


clientSecret: string

Defined in: libs/ccs-files-client/src/files-client.ts:68

Keep server-side only, never ship it to a browser.


optional apiUrl?: string

Defined in: libs/ccs-files-client/src/files-client.ts:75

File Service API base URL, e.g. https://files.centralcodestation.com/api/v1. Omitted: FILES_API_URL, else derived from resource / FILES_API_RESOURCE (…/api → …/api/v1), else the CCS_ENVIRONMENT preset (local | staging | production, default production), read from env.


optional resource?: string

Defined in: libs/ccs-files-client/src/files-client.ts:81

RFC 8707 resource identifier of the Files API, e.g. https://files.centralcodestation.com/api (never the audience). Omitted: FILES_API_RESOURCE, else derived from apiUrl / FILES_API_URL (…/api/v1 → …/api), else the CCS_ENVIRONMENT preset, read from env.


optional env?: Readonly<Record<string, string | undefined>>

Defined in: libs/ccs-files-client/src/files-client.ts:87

Where the defaults of issuerUrl, apiUrl and resource read CCS_ENVIRONMENT, FILES_API_URL, FILES_API_RESOURCE and CCS_ISSUER_URL. Default process.env; {} ignores the environment (the production defaults). Unused when all three are given.


optional tenantId?: string

Defined in: libs/ccs-files-client/src/files-client.ts:92

Default context for a tenant backend (its own tenant and application). Omit both in a platform consumer (Chat) and pass context per call. A per-call context field wins over the default.


optional applicationId?: string

Defined in: libs/ccs-files-client/src/files-client.ts:93


optional scope?: string | FilesMachineScope[]

Defined in: libs/ccs-files-client/src/files-client.ts:95

Default 'files:manage'; 'files:read' for a read-only backend; an array is joined with spaces.


optional fetch?: (input, init?) => Promise<Response>

Defined in: libs/ccs-files-client/src/files-client.ts:97

Override fetch (tests, runtimes without a global fetch). Also used for the store PUTs of upload().

string | URL | Request

RequestInit

Promise<Response>


optional maxRetries?: number

Defined in: libs/ccs-files-client/src/files-client.ts:99

Retries after the first attempt, for 5xx and network errors on retryable requests. Default 3; 0 disables.