@konversi/konversi-client
v1.3.0
Published
```ts import K from '@konversi/konversi-client';
Downloads
287
Readme
Konversi Client
Automations Examples
Basic Automation Example
import K from '@konversi/konversi-client';
export async function execute(input) {
console.log(input);
}
Base Objects CRUD
import K, { Entity } from '@konversi/konversi-client';
export async function execute(input) {
let result = await K.createObject(Entity.SALES_ORDER, {})
console.log(result);
result = await K.getAllObjects(Entity.SALES_ORDER)
console.log(result);
result = await K.updateObject(Entity.SALES_ORDER, result[0].id, { memo: 'New memo' })
console.log(result);
}
Custom Objects CRUD
import K, { Entity } from '@konversi/konversi-client';
export async function execute(input) {
let createdObject = await K.createCustomObject('ticket', {numEntries: 100, amount: 500000, code: "TICKET-123456"})
console.log(`created object`, createdObject);
let allObjects = await K.getAllCustomObjects('ticket');
console.log(`all objects`, allObjects);
let updateResult = await K.updateCustomObject('ticket', createdObject.id, {numEntries: 200});
console.log(`updated object`, updateResult);
}