@actito/data-model-sdk
v0.2.5
Published
SDK for ACTITO data model (profile tables, linked tables and content tables)
Downloads
21
Keywords
Readme
data-model-sdk
|THIS IS STILL VERY PRELIMINARY. PLEASE DON'T USE.| |---|
Example use
async function demoProfiles() {
const newProfile = { firstName: "Alain", lastName: "Dresse", emailAddress: "[email protected]" };
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: "[email protected]" };
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});
}