@actito/data-model-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

data-model-sdk

THIS IS STILL VERY PRELIMINARY. PLEASE DON'T USE.

Example use

async function demoProfiles() {
  const newProfile = { firstName: "Alain", lastName: "Dresse", emailAddress: "ziki@example.com" };

  const { profileId } = await createProfile("Clients", { profile: newProfile });
  const { profile: initialProfile } = await getProfile("Clients", profileId);
  await updateProfile("Clients", profileId, { profile: { firstName: "Ziki" } });
  const { profile: updatedProfile } = await getProfile("Clients", profileId);
  await deleteProfile("Clients", profileId);

  console.log({initialProfile, updatedProfile});
}

async function demoTables() {
  const tableName = "OfferAssignments";
  const newRecord = { synchronized: false, offerReference: "springoffer", profileReference: "alaindresse@example.com" };

  const { businessKey: id } = await addRecord(tableName, newRecord);
  const initialRecord = await getRecord(tableName, id);
  await updateRecord(tableName, id, { assignmentReference: "aaa" });
  const updatedRecord = await getRecord(tableName, id);
  await deleteRecord(tableName, id);

  console.log({initialRecord, updatedRecord});
}

Readme

Keywords

Package Sidebar

Install

npm i @actito/data-model-sdk

Weekly Downloads

2

Version

0.2.5

License

MIT

Unpacked Size

33 kB

Total Files

22

Last publish

Collaborators

  • alaindresse
  • hennek
  • letex
  • seblejeune