@toolyhub/apiesync
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Apiesync nodejs package

Description

Example of use

const apiesyncClient = new ApiesyncClient<D, object>(settings, ds, () => ({
  logError: console.error, logInformation: console.info
}), { fetch })

const { configuration, eventHandler } = apiesyncClient
const serviceName = 'shopify'
const groupName = 'shopify'
const group = await configuration.setModuleMapping(serviceName, [{
  ClientName: Order.name,
  GroupName: groupName,
  ServiceName: 'order',
  EnableCreationOnClientSide: true,
  EnableCreationOnServiceSide: false,
}])
await configuration.setFieldsMapping(serviceName, Order.name, [{
  serviceName: 'id',
  clientName: 'shopifyId',
}])
await configuration.setFieldsMapping(serviceName, Order.name, [{
  serviceName: 'name',
  clientName: 'name',
}])
await configuration.setFieldsMapping(serviceName, Order.name, [{
  serviceName: 'note_attributes',
  clientName: 'note_attributes',
}])
await configuration.setFieldsMapping(serviceName, Order.name, [{
  serviceName: 'updated_at',
  clientName: 'updatedAt',
}])
const sqsGroup = group.sqsGroups.find(g => g.title === groupName)!
const serve = async () => {
  while (true) {
    await eventHandler.handleEventsAsync(sqsGroup)
  }
}
const p = serve()
await p

Readme

Keywords

none

Package Sidebar

Install

npm i @toolyhub/apiesync

Weekly Downloads

5

Version

1.0.8

License

ISC

Unpacked Size

176 kB

Total Files

176

Last publish

Collaborators

  • fidaksar8
  • gratton.math