@chift/chift-nodejs 1.0.6 → 1.0.8

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 (66) hide show
  1. package/.github/workflows/ci.yml +38 -38
  2. package/CHANGELOG.md +42 -0
  3. package/dist/src/modules/accounting.d.ts +27 -24
  4. package/dist/src/modules/accounting.js +76 -31
  5. package/dist/src/modules/api.d.ts +2119 -28031
  6. package/dist/src/modules/consumer.d.ts +413 -64
  7. package/dist/src/modules/consumer.js +10 -0
  8. package/dist/src/modules/consumers.d.ts +2130 -365
  9. package/dist/src/modules/ecommerce.d.ts +8 -0
  10. package/dist/src/modules/ecommerce.js +28 -0
  11. package/dist/src/modules/flow.js +1 -1
  12. package/dist/src/modules/pos.d.ts +3 -1
  13. package/dist/src/modules/pos.js +7 -0
  14. package/dist/src/modules/sync.d.ts +1710 -298
  15. package/dist/src/modules/syncs.d.ts +8 -27677
  16. package/dist/src/modules/syncs.js +10 -0
  17. package/dist/test/modules/accounting.test.js +28 -11
  18. package/dist/test/modules/ecommerce.test.js +34 -7
  19. package/dist/test/modules/pos.test.js +10 -5
  20. package/package.json +2 -2
  21. package/src/modules/accounting.ts +120 -35
  22. package/src/modules/api.ts +2 -2
  23. package/src/modules/consumer.ts +21 -0
  24. package/src/modules/ecommerce.ts +52 -0
  25. package/src/modules/flow.ts +1 -1
  26. package/src/modules/pos.ts +15 -1
  27. package/src/modules/syncs.ts +32 -1
  28. package/src/types/public-api/schema.d.ts +3624 -2621
  29. package/test/modules/accounting.test.ts +31 -14
  30. package/test/modules/ecommerce.test.ts +34 -3
  31. package/test/modules/pos.test.ts +11 -5
  32. package/.eslintcache +0 -1
  33. package/coverage/clover.xml +0 -1645
  34. package/coverage/coverage-final.json +0 -19
  35. package/coverage/lcov-report/base.css +0 -224
  36. package/coverage/lcov-report/block-navigation.js +0 -87
  37. package/coverage/lcov-report/favicon.png +0 -0
  38. package/coverage/lcov-report/index.html +0 -146
  39. package/coverage/lcov-report/prettify.css +0 -1
  40. package/coverage/lcov-report/prettify.js +0 -2
  41. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  42. package/coverage/lcov-report/sorter.js +0 -196
  43. package/coverage/lcov-report/src/helpers/index.html +0 -131
  44. package/coverage/lcov-report/src/helpers/openapi.ts.html +0 -151
  45. package/coverage/lcov-report/src/helpers/settings.ts.html +0 -94
  46. package/coverage/lcov-report/src/index.html +0 -116
  47. package/coverage/lcov-report/src/index.ts.html +0 -88
  48. package/coverage/lcov-report/src/modules/accounting.ts.html +0 -1156
  49. package/coverage/lcov-report/src/modules/api.ts.html +0 -190
  50. package/coverage/lcov-report/src/modules/consumer.ts.html +0 -616
  51. package/coverage/lcov-report/src/modules/consumers.ts.html +0 -331
  52. package/coverage/lcov-report/src/modules/custom.ts.html +0 -193
  53. package/coverage/lcov-report/src/modules/datastores.ts.html +0 -142
  54. package/coverage/lcov-report/src/modules/ecommerce.ts.html +0 -331
  55. package/coverage/lcov-report/src/modules/flow.ts.html +0 -589
  56. package/coverage/lcov-report/src/modules/index.html +0 -326
  57. package/coverage/lcov-report/src/modules/integrations.ts.html +0 -151
  58. package/coverage/lcov-report/src/modules/internalApi.ts.html +0 -586
  59. package/coverage/lcov-report/src/modules/invoicing.ts.html +0 -391
  60. package/coverage/lcov-report/src/modules/pos.ts.html +0 -421
  61. package/coverage/lcov-report/src/modules/sync.ts.html +0 -316
  62. package/coverage/lcov-report/src/modules/syncs.ts.html +0 -169
  63. package/coverage/lcov-report/src/modules/webhooks.ts.html +0 -343
  64. package/coverage/lcov.info +0 -1976
  65. package/dist/test/modules/flow.test.d.ts +0 -1
  66. package/dist/test/modules/flow.test.js +0 -69
@@ -1 +0,0 @@
1
- export {};
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- const globals_1 = require("@jest/globals");
36
- const chift = __importStar(require("../../src/index"));
37
- const dotenv = __importStar(require("dotenv"));
38
- dotenv.config();
39
- const client = new chift.API({
40
- baseUrl: process.env.CHIFT_BASE_URL,
41
- clientId: process.env.CHIFT_CLIENT_ID,
42
- clientSecret: process.env.CHIFT_CLIENT_SECRET,
43
- accountId: process.env.CHIFT_ACCOUNT_ID,
44
- });
45
- let flow;
46
- (0, globals_1.beforeAll)(() => __awaiter(void 0, void 0, void 0, function* () {
47
- const syncId = process.env.CHIFT_TEST_SYNC_ID;
48
- const sync = yield client.Syncs.getSyncById(syncId);
49
- flow = yield sync.createFlow({
50
- name: 'Je suis un flux de test',
51
- description: 'Flux de test',
52
- execution: {
53
- type: 'code',
54
- },
55
- trigger: {
56
- type: 'event',
57
- },
58
- config: {},
59
- }, (consumer, flowContext) => __awaiter(void 0, void 0, void 0, function* () {
60
- console.log(`Mon flow_id : ${flowContext.flow_id}`);
61
- console.log(`Bonjour, ceci est un test, on exécute le flux pour consumer: ${consumer}`);
62
- }));
63
- }));
64
- (0, globals_1.test)('executeLocal', () => __awaiter(void 0, void 0, void 0, function* () {
65
- flow.execute({ context: { logs: true, local: true } });
66
- }));
67
- (0, globals_1.test)('execute', () => __awaiter(void 0, void 0, void 0, function* () {
68
- flow.execute({ context: { logs: true, local: false } });
69
- }));