npm.io
4.6.17 • Published 5h ago

@tactfulai/erp-sdk

Licence
ISC
Version
4.6.17
Deps
2
Size
1.0 MB
Vulns
0
Weekly
0

Tactful.ai ERP SDK

Installation

npm i --save @tactfulai/erp-sdk

How To Use In Your Project

import { Configuration as ERPConfig, initializeTactful as ERPInit } from "@tactfulai/erp-sdk";
export const erpApiConfig = new ERPConfig({
    basePath: config.ERP_API_HOST_URL,
    apiKey: `Bearer ${erpToken?.access_token}`,
    options: {
      mode: 'cors',
    }
});

export const ERPCore = ERPInit(erpApiConfig);

APIs Calls

https://erp.qa.dev.tactful.ai/

const res = await ERPCore.<namespace>.<operation>(<payload>,<options>);
# example - get customer
const customer = await ERPCore.customers.showCustomer({customer:this.CustomerId});

Generate and Publish

  • Edit API_HOST in generate-api-client.sh with erp service host
  • ./generate-api-client.sh auth

  • cd erp/typescript

  • Change sdk version in package.json
  • npm run login

  • npm run build

  • npm version < major | minor | patch >

  • npm publish