const assets = [
{ name: 'First asset' },
{ name: 'Second asset', description: 'Another asset', externalId: 'anotherAsset' },
{ name: 'Child asset', parentExternalId: 'anotherAsset'},
];
const createdAssets = await client.assets.create(assets);
await client.assets.delete([{id: 123}, {externalId: 'abc'}]);
const assets = await client.assets.list({ filter: { name: '21PT1019' } });
const assets = await client.assets.retrieve([{id: 123}, {externalId: 'abc'}]);
const assets = await client.assets.search({
filter: {
parentIds: [1, 2]
},
search: {
query: '21PT1019'
}
});
const assets = await client.assets.update([{id: 123, update: {name: {set: 'New name'}}}]);
Aggregate assets
const aggregates = await client.assets.aggregate({ filter: { root: true } }); console.log('Number of root assets: ', aggregates[0].count)