AssetService
@auvious/asset / Exports / AssetService
Class: AssetService
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new AssetService(commonSource, createInternalSignedUrls?)
AssetService constructor.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
commonSource | Observable<AuviousCommon> | undefined | source for AuviousCommon |
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. |
Properties
assetResource
• Private assetResource: ApiResource
Methods
delete
▸ delete(assetId): Promise<void>
Parameters
| Name | Type |
|---|---|
assetId | string |
Returns
Promise<void>
list
▸ list(applicationId): Promise<IAsset[]>
List all assets for an application.
Parameters
| Name | Type | Description |
|---|---|---|
applicationId | string | applicationId 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
| Name | Type | Description |
|---|---|---|
blob | Blob | the file to upload, as a Blob |
applicationId | string | which applicationId. |
rolesAllowedAccess | Role[] | who to allow access, e.g ["agent","customer"] |
category? | string | category of asset e.g. "background" |
filename? | string | filename information |
Returns
Promise<IAsset>