Skip to main content

@auvious/asset / AssetService

Class: AssetService

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new AssetService(commonSource, createInternalSignedUrls?): AssetService

AssetService constructor.

Parameters​

NameTypeDefault valueDescription
commonSourceObservable<AuviousCommon>undefinedsource for AuviousCommon
createInternalSignedUrlsbooleantrueIf true internal signed urls will be used, otherwise storage provider urls will be used. True by default, if not supplied true will be used.

Returns​

AssetService

Properties​

assetResource​

• Private assetResource: ApiResource


createInternalSignedUrls​

• Private createInternalSignedUrls: boolean = true

If true internal signed urls will be used, otherwise storage provider urls will be used. True by default, if not supplied true will be used.

Methods​

delete​

▸ delete(assetId): Promise<void>

Parameters​

NameType
assetIdstring

Returns​

Promise<void>


list​

▸ list(applicationId): Promise<IAsset[]>

List all assets for an application.

Parameters​

NameTypeDescription
applicationIdstringapplicationId of assets to return

Returns​

Promise<IAsset[]>

list of assets


signedUrlProvider​

▸ signedUrlProvider(): SignedUrlProvider

Returns​

SignedUrlProvider


upload​

▸ upload(blob, applicationId, rolesAllowedAccess?, category?, filename?): Promise<IAsset>

Upload a file.

Parameters​

NameTypeDescription
blobBlobthe file to upload, as a Blob
applicationIdstringwhich applicationId.
rolesAllowedAccessRole[]who to allow access, e.g ["agent","customer"]
category?stringcategory of asset e.g. "background"
filename?stringfilename information

Returns​

Promise<IAsset>