@chift/chift-nodejs 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.eslintcache +1 -0
  2. package/CHANGELOG.md +9 -0
  3. package/coverage/clover.xml +1645 -0
  4. package/coverage/coverage-final.json +19 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.html +146 -0
  9. package/coverage/lcov-report/prettify.css +1 -0
  10. package/coverage/lcov-report/prettify.js +2 -0
  11. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  12. package/coverage/lcov-report/sorter.js +196 -0
  13. package/coverage/lcov-report/src/helpers/index.html +131 -0
  14. package/coverage/lcov-report/src/helpers/openapi.ts.html +151 -0
  15. package/coverage/lcov-report/src/helpers/settings.ts.html +94 -0
  16. package/coverage/lcov-report/src/index.html +116 -0
  17. package/coverage/lcov-report/src/index.ts.html +88 -0
  18. package/coverage/lcov-report/src/modules/accounting.ts.html +1156 -0
  19. package/coverage/lcov-report/src/modules/api.ts.html +190 -0
  20. package/coverage/lcov-report/src/modules/consumer.ts.html +616 -0
  21. package/coverage/lcov-report/src/modules/consumers.ts.html +331 -0
  22. package/coverage/lcov-report/src/modules/custom.ts.html +193 -0
  23. package/coverage/lcov-report/src/modules/datastores.ts.html +142 -0
  24. package/coverage/lcov-report/src/modules/ecommerce.ts.html +331 -0
  25. package/coverage/lcov-report/src/modules/flow.ts.html +589 -0
  26. package/coverage/lcov-report/src/modules/index.html +326 -0
  27. package/coverage/lcov-report/src/modules/integrations.ts.html +151 -0
  28. package/coverage/lcov-report/src/modules/internalApi.ts.html +586 -0
  29. package/coverage/lcov-report/src/modules/invoicing.ts.html +391 -0
  30. package/coverage/lcov-report/src/modules/pos.ts.html +421 -0
  31. package/coverage/lcov-report/src/modules/sync.ts.html +316 -0
  32. package/coverage/lcov-report/src/modules/syncs.ts.html +169 -0
  33. package/coverage/lcov-report/src/modules/webhooks.ts.html +343 -0
  34. package/coverage/lcov.info +1976 -0
  35. package/dist/src/modules/accounting.d.ts +5 -1
  36. package/dist/src/modules/accounting.js +12 -1
  37. package/dist/src/modules/api.d.ts +781 -226
  38. package/dist/src/modules/consumer.d.ts +52 -15
  39. package/dist/src/modules/consumers.d.ts +260 -75
  40. package/dist/src/modules/datastores.d.ts +1 -1
  41. package/dist/src/modules/internalApi.js +5 -1
  42. package/dist/src/modules/sync.d.ts +208 -60
  43. package/dist/src/modules/syncs.d.ts +520 -150
  44. package/dist/test/modules/accounting.test.js +23 -0
  45. package/dist/test/modules/flow.test.d.ts +1 -0
  46. package/dist/test/modules/flow.test.js +69 -0
  47. package/package.json +1 -1
  48. package/src/modules/accounting.ts +17 -3
  49. package/src/modules/internalApi.ts +19 -10
  50. package/src/types/public-api/schema.d.ts +343 -33
  51. package/test/modules/accounting.test.ts +27 -0
@@ -9,7 +9,7 @@ declare const DataStores: (internalApi: InternalAPI) => {
9
9
  name: string;
10
10
  title: string;
11
11
  type: string;
12
- Optional?: boolean | undefined;
12
+ optional?: boolean | undefined;
13
13
  }[];
14
14
  search_column?: string | undefined;
15
15
  };
@@ -57,7 +57,7 @@ class InternalAPI {
57
57
  this.patch = this.instance.patch;
58
58
  this.delete = this.instance.delete;
59
59
  this.instance.interceptors.request.use((config) => {
60
- return new Promise((resolve) => {
60
+ return new Promise((resolve, reject) => {
61
61
  var _a, _b;
62
62
  if (this.relatedChainExecutionId) {
63
63
  config.headers['X-Chift-RelatedChainExecutionId'] =
@@ -70,6 +70,8 @@ class InternalAPI {
70
70
  config.headers['Authorization'] =
71
71
  'Bearer ' + ((_a = this.token) === null || _a === void 0 ? void 0 : _a.access_token);
72
72
  return resolve(config);
73
+ }).catch((err) => {
74
+ return reject(err);
73
75
  });
74
76
  }
75
77
  else {
@@ -82,6 +84,8 @@ class InternalAPI {
82
84
  var _a;
83
85
  config.headers['Authorization'] = 'Bearer ' + ((_a = this.token) === null || _a === void 0 ? void 0 : _a.access_token);
84
86
  return resolve(config);
87
+ }).catch((err) => {
88
+ return reject(err);
85
89
  });
86
90
  }
87
91
  });