Skip to content

@collectivtech/alana-sdk-js


@collectivtech/alana-sdk-js / resources/file / SecureFile

Class: SecureFile ​

Defined in: src/resources/file.ts:21

A single file stored in the ALANA Secure File Store.

The Store is a long-term document storage system unique to each business user of the platform, allowing secure, encrypted storage of important documents, PII, and other data that can't be viewed even by ALANA Platform administrators if listed as private. Even files marked as public are not shared openly; all access to files requires using the ALANA Platform API.

A File object is just metadata. The actual contents of the file are stored at a signed, time-limited URL. This will be found in the url field of the File object if and only if that file was retrieved directly.

Extends ​

Constructors ​

Constructor ​

new SecureFile(apiResponse, context): SecureFile

Defined in: src/resources/file.ts:73

Parameters ​

apiResponse ​

any

An API response

context ​

ApiContext

The resource's API context

Returns ​

SecureFile

Overrides ​

ApiResource.constructor

Properties ​

_context ​

protected _context: ApiContext

Defined in: src/resource.ts:148

The API context for this resource.

Inherited from ​

ApiResource._context


contentType ​

contentType: string

Defined in: src/resources/file.ts:40

The MIME type of this file. This must be provided when uploading, and may be used by applications to determine how to display a file.


createdAt ​

createdAt: Date

Defined in: src/resources/file.ts:61

The time this file was uploaded.


isPublic ​

isPublic: boolean

Defined in: src/resources/file.ts:56

Whether this file is public or private. Public files can be accessed by any user of the ALANA Platform who knows the owning business and the file path. Private files may only be accessed by administrators of the business, including its owner.


name? ​

optional name?: string

Defined in: src/resources/file.ts:26

The name of the file. This is a human-friendly name or title that can be assigned when uploading a document.


path ​

path: string

Defined in: src/resources/file.ts:34

The path of this file within the business's Secure File Store. The Store provides a filesystem-like view of its contents, so files can be organized into directories with paths separated by forward slashes.


updatedAt ​

updatedAt: Date

Defined in: src/resources/file.ts:66

The time this file was last updated.


url? ​

optional url?: string

Defined in: src/resources/file.ts:48

The access URL for this file. As access URLs are time-sensitive, and access must be restricted as much as possible, this field is only filled when directly retrieving the file; in directory listings or as a response to uploads, it will always be null.

Methods ​

retrieve() ​

retrieve(owner): Promise<SecureFile>

Defined in: src/resources/file.ts:97

Retrieve a new access URL for this file. This will provide an updated File object whose url field is non-null and valid to access for up to 1 hour.

Note that a Business resource must be provided: this is the owner of the file, because the Secure File Store API does not provide this information for security reasons.

Parameters ​

owner ​

Business

The business who owns this file

Returns ​

Promise<SecureFile>

An updated File object containing a valid URL

ALANA™, ALANA Platform™, ALANA Guide™, and ALANA Partner™ are trademarks of Collectiv Technologies Inc.