SDK
API Documentation
asset-core
classes
Assetcoreservice

Class: AssetCoreService

Core asset operations. Move, Copy, Delete, Update, Refresh, Get, Create Thumbnail, Delete Thumbnail.

Implements

Constructors

new AssetCoreService()

new AssetCoreService(connectClient, assetMapper): AssetCoreService

Constructor for AssetCoreService.

Parameters

ParameterTypeDescription
connectClientConnectClientInterfaceConnect client to make API calls from the Connect SDK
assetMapperAssetMapperMapper to map asset API response to asset object.

Returns

AssetCoreService

Remarks

It is easier to use the AssetCoreServiceFactory to create an instance of this class as it will inject the required dependencies.

Defined in

service/assetCoreService.ts:76 (opens in a new tab)

Methods

copyAsset()

copyAsset(id, folderId): Promise<CopyAssetResult>

Copy an asset by its id to a destination folder by its id.

Parameters

ParameterType
idAssetInstanceId
folderIdstring

Returns

Promise<CopyAssetResult>

Implementation of

AssetCoreServiceInterface.copyAsset

Defined in

service/assetCoreService.ts:220 (opens in a new tab)


copyMultiAssets()

copyMultiAssets(ids, folderId): Promise<CopyMultiAssetResult[]>

Copy multiple assets by their ids to a destination folder by its id. This is not transactional, so some assets may be copied while others fail.

Parameters

ParameterType
idsAssetInstanceId[]
folderIdstring

Returns

Promise<CopyMultiAssetResult[]>

Defined in

service/assetCoreService.ts:245 (opens in a new tab)


createThumbnail()

createThumbnail(id): Promise<CreateThumbnailResult>

Create a thumbnail for an asset by its id. This wil return an upload URL that needs to be used to upload the thumbnail.

Parameters

ParameterType
idAssetInstanceId

Returns

Promise<CreateThumbnailResult>

Implementation of

AssetCoreServiceInterface.createThumbnail

Defined in

service/assetCoreService.ts:265 (opens in a new tab)


deleteAsset()

deleteAsset(id): Promise<DeleteAssetResult>

Delete an asset by its id.

Parameters

ParameterType
idAssetInstanceId

Returns

Promise<DeleteAssetResult>

Implementation of

AssetCoreServiceInterface.deleteAsset

Defined in

service/assetCoreService.ts:126 (opens in a new tab)


deleteThumbnail()

deleteThumbnail(id): Promise<DeleteThumbnailResult>

Remove the thumbnail for an asset by its id.

Parameters

ParameterType
idAssetInstanceId

Returns

Promise<DeleteThumbnailResult>

Implementation of

AssetCoreServiceInterface.deleteThumbnail

Defined in

service/assetCoreService.ts:292 (opens in a new tab)


getAsset()

getAsset(id): Promise<GetAssetResult>

Load an asset by its id.

Parameters

ParameterType
idAssetInstanceId

Returns

Promise<GetAssetResult>

Implementation of

AssetCoreServiceInterface.getAsset

Defined in

service/assetCoreService.ts:102 (opens in a new tab)


moveAsset()

moveAsset(id, folderId): Promise<MoveAssetResult>

Move an asset by its a id to a destination folder by its id.

Parameters

ParameterType
idAssetInstanceId
folderIdstring

Returns

Promise<MoveAssetResult>

Implementation of

AssetCoreServiceInterface.moveAsset

Defined in

service/assetCoreService.ts:177 (opens in a new tab)


moveMultiAssets()

moveMultiAssets(ids, folderId): Promise<MoveMultiAssetResult[]>

Move multiple assets by their ids to a destination folder by its id. This is not transactional, so some assets may be moved while others fail.

Parameters

ParameterType
idsAssetInstanceId[]
folderIdstring

Returns

Promise<MoveMultiAssetResult[]>

Defined in

service/assetCoreService.ts:202 (opens in a new tab)


refreshAsset()

refreshAsset(id): Promise<RefreshAssetResult>

Refreshes the asset with the given id from the server. This will not return the asset, but will update the cache.

Parameters

ParameterType
idAssetInstanceId

Returns

Promise<RefreshAssetResult>

Implementation of

AssetCoreServiceInterface.refreshAsset

Defined in

service/assetCoreService.ts:85 (opens in a new tab)


updateAsset()

updateAsset(id, variables): Promise<UpdateAssetResult>

Update an asset by its id, setting the name and description.

Parameters

ParameterType
idAssetInstanceId
variablesobject
variables.descriptionstring
variables.namestring

Returns

Promise<UpdateAssetResult>

Implementation of

AssetCoreServiceInterface.updateAsset

Defined in

service/assetCoreService.ts:150 (opens in a new tab)