FilesResource
Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:179
Files of the client’s context.
Properties
Section titled “Properties”versions
Section titled “versions”
readonlyversions:VersionsResource
Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:180
renditions
Section titled “renditions”
readonlyrenditions:RenditionsResource
Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:181
readonlyhold:HoldResource
Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:183
The file’s legal hold: place, release (files.manage).
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
options?
Section titled “options?”include?
Section titled “include?”Returns
Section titled “Returns”Promise<File>
update()
Section titled “update()”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).
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
options?
Section titled “options?”UpdateOptions = {}
Returns
Section titled “Returns”Promise<File>
move()
Section titled “move()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
folder_id
Section titled “folder_id”string
options?
Section titled “options?”UpdateOptions = {}
Returns
Section titled “Returns”Promise<File>
copy()
Section titled “copy()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
folder_id
Section titled “folder_id”string
string
Returns
Section titled “Returns”Promise<File>
delete()
Section titled “delete()”delete(
fileId):Promise<void>
Defined in: libs/ccs-files-user-client/src/core/resources/files.ts:243
Moves the file to the trash.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
Returns
Section titled “Returns”Promise<void>
restore()
Section titled “restore()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
input?
Section titled “input?”folder_id?
Section titled “folder_id?”string
Returns
Section titled “Returns”Promise<File>
downloadUrl()
Section titled “downloadUrl()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
options?
Section titled “options?”DownloadUrlOptions = {}
Returns
Section titled “Returns”Promise<DownloadUrl>
download()
Section titled “download()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
options?
Section titled “options?”DownloadOptions = {}
Returns
Section titled “Returns”Promise<DownloadUrl>
myPermissions()
Section titled “myPermissions()”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).
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
Returns
Section titled “Returns”Promise<MyPermissions>
waitUntilReady()
Section titled “waitUntilReady()”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.
Parameters
Section titled “Parameters”fileId
Section titled “fileId”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<File>