Skip to main content

AssetService

@auvious/asset / Exports / AssetService

Class: AssetService

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AssetService(commonSource, createInternalSignedUrls?)

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.

Properties

assetResource

Private assetResource: ApiResource

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

Private 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>