Skip to content

FilesResource

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:179

Files of the client’s context.

readonly versions: VersionsResource

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:180


readonly renditions: RenditionsResource

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:181


readonly hold: HoldResource

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:183

The file’s legal hold: place, release (files.manage).

get(fileId, options?): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:196

The file; include adds entries, versions and / or shares.

string

FileInclude[]

Promise<File>


update(fileId, patch, options?): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:209

Metadata, status, visibility, external_ref, a move. { ifMatch: file.revision } makes it conditional (FilesPreconditionFailedError, revision_mismatch, on a stale revision).

string

UpdateFileInput

UpdateOptions = {}

Promise<File>


move(fileId, input, options?): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:223

Moves the file to folder_id.

string

string

UpdateOptions = {}

Promise<File>


copy(fileId, input): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:232

Copies the current version into folder_id as a new file. Carries an Idempotency-Key.

string

string

string

Promise<File>


delete(fileId): Promise<void>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:243

Moves the file to the trash.

string

Promise<void>


restore(fileId, input?): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:249

Restores from the trash; folder_id when the original folder is gone.

string

string

Promise<File>


downloadUrl(fileId, options?): Promise<DownloadUrl>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:259

A signed URL for the original (default attachment) or a rendition, cached per (file, version, rendition, disposition) until a minute before it expires; client.invalidate(fileId) drops it.

string

DownloadUrlOptions = {}

Promise<DownloadUrl>


download(fileId, options?): Promise<DownloadUrl>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:275

Downloads the file: mints a fresh signed URL (never cached: every download is audited) and points the window at it, which makes the browser save it. { navigate: false } only returns the URL.

string

DownloadOptions = {}

Promise<DownloadUrl>


myPermissions(fileId): Promise<MyPermissions>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:296

The signed-in user’s actions on the file and where they come from (GET P/files/:file_id/me/permissions).

string

Promise<MyPermissions>


waitUntilReady(fileId, options?): Promise<File>

Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:308

Polls the file until it is available and no processing step is pending. Rejects with a FilesConflictError when the file is quarantined (file_quarantined), rejected by processing (file_rejected), trashed (file_trashed) or a failed step stopped processing (processing_failed, body.step); a failed step processing carried on after (notify done) does not reject; with a FilesApiError (408, wait_timeout) after timeoutMs; with the signal’s reason when it aborts. Listening to file.ready through the Notification Service is the push alternative.

string

WaitUntilReadyOptions = {}

Promise<File>