@maxdome/cbe2

1.0.3 • Public • Published

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);
  }
}

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @maxdome/cbe2

    Weekly Downloads

    2

    Version

    1.0.3

    License

    none

    Unpacked Size

    3.57 kB

    Total Files

    6

    Last publish

    Collaborators

    • dragonnodejs
    • sharaal
    • fabsrc
    • markusz
    • mxdbv
    • csaba.lorincz
    • goexrock
    • dimified