@maxdome/cbe2
v1.0.3
Published
## Get an asset without knowing the type
Downloads
7
Keywords
Readme
Usage
Get an asset without knowing the type
const cbe2 = require('@maxdome/cbe2')({ cbe2Url: process.env.CBE2_URL });
const objectId = 0;
const mamAsset = cbe2.asset(objectId);
Get an asset with the type
const cbe2 = require('@maxdome/cbe2')({ cbe2Url: process.env.CBE2_URL });
const objectId = 0;
const objectType = '';
const mamAsset = cbe2.asset(objectId, objectType);
Get the asset data of all updated assets for a diff
const cbe2 = require('@maxdome/cbe2')({ cbe2Url: process.env.CBE2_URL });
const timestamp = 0;
const diffs = cbe2.diff(timestamp);
for (const diff of diffs) {
for (const objectId of diff.updated) {
const mamAsset = await cb2.asset(objectId, diff.objectType);
}
}