@chift/chift-nodejs 1.0.17 → 1.0.18

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 (114) hide show
  1. package/package.json +5 -2
  2. package/.eslintignore +0 -1
  3. package/.eslintrc.json +0 -25
  4. package/.github/workflows/ci.yml +0 -75
  5. package/.husky/pre-commit +0 -4
  6. package/.prettierignore +0 -1
  7. package/.prettierrc.json +0 -7
  8. package/CHANGELOG.md +0 -108
  9. package/dist/src/helpers/openapi.d.ts +0 -3
  10. package/dist/src/helpers/openapi.js +0 -18
  11. package/dist/src/helpers/settings.d.ts +0 -4
  12. package/dist/src/helpers/settings.js +0 -5
  13. package/dist/src/index.d.ts +0 -1
  14. package/dist/src/modules/accounting.d.ts +0 -68
  15. package/dist/src/modules/accounting.js +0 -326
  16. package/dist/src/modules/api.d.ts +0 -18351
  17. package/dist/src/modules/api.js +0 -36
  18. package/dist/src/modules/consumer.d.ts +0 -3622
  19. package/dist/src/modules/consumer.js +0 -142
  20. package/dist/src/modules/consumers.d.ts +0 -18237
  21. package/dist/src/modules/consumers.js +0 -51
  22. package/dist/src/modules/custom.d.ts +0 -8
  23. package/dist/src/modules/custom.js +0 -36
  24. package/dist/src/modules/datastores.d.ts +0 -18
  25. package/dist/src/modules/datastores.js +0 -23
  26. package/dist/src/modules/ecommerce.d.ts +0 -24
  27. package/dist/src/modules/ecommerce.js +0 -97
  28. package/dist/src/modules/flow.d.ts +0 -15
  29. package/dist/src/modules/flow.js +0 -156
  30. package/dist/src/modules/integrations.d.ts +0 -23
  31. package/dist/src/modules/integrations.js +0 -23
  32. package/dist/src/modules/internalApi.d.ts +0 -24
  33. package/dist/src/modules/internalApi.js +0 -175
  34. package/dist/src/modules/invoicing.d.ts +0 -20
  35. package/dist/src/modules/invoicing.js +0 -90
  36. package/dist/src/modules/payment.d.ts +0 -14
  37. package/dist/src/modules/payment.js +0 -41
  38. package/dist/src/modules/pms.d.ts +0 -15
  39. package/dist/src/modules/pms.js +0 -47
  40. package/dist/src/modules/pos.d.ts +0 -26
  41. package/dist/src/modules/pos.js +0 -101
  42. package/dist/src/modules/sync.d.ts +0 -14654
  43. package/dist/src/modules/sync.js +0 -73
  44. package/dist/src/modules/syncs.d.ts +0 -11
  45. package/dist/src/modules/syncs.js +0 -39
  46. package/dist/src/modules/webhooks.d.ts +0 -58
  47. package/dist/src/modules/webhooks.js +0 -53
  48. package/dist/src/types/api.d.ts +0 -29
  49. package/dist/src/types/api.js +0 -2
  50. package/dist/src/types/consumers.d.ts +0 -8
  51. package/dist/src/types/consumers.js +0 -2
  52. package/dist/src/types/public-api/mappings.d.ts +0 -21
  53. package/dist/src/types/public-api/mappings.js +0 -2
  54. package/dist/src/types/sync.d.ts +0 -37
  55. package/dist/src/types/sync.js +0 -2
  56. package/dist/test/modules/accounting.test.d.ts +0 -1
  57. package/dist/test/modules/accounting.test.js +0 -590
  58. package/dist/test/modules/consumer.test.d.ts +0 -1
  59. package/dist/test/modules/consumer.test.js +0 -89
  60. package/dist/test/modules/consumers.test.d.ts +0 -1
  61. package/dist/test/modules/consumers.test.js +0 -109
  62. package/dist/test/modules/ecommerce.test.d.ts +0 -1
  63. package/dist/test/modules/ecommerce.test.js +0 -224
  64. package/dist/test/modules/integrations.test.d.ts +0 -1
  65. package/dist/test/modules/integrations.test.js +0 -54
  66. package/dist/test/modules/invoicing.test.d.ts +0 -1
  67. package/dist/test/modules/invoicing.test.js +0 -115
  68. package/dist/test/modules/payment.test.d.ts +0 -1
  69. package/dist/test/modules/payment.test.js +0 -88
  70. package/dist/test/modules/pms.test.d.ts +0 -1
  71. package/dist/test/modules/pms.test.js +0 -90
  72. package/dist/test/modules/pos.test.d.ts +0 -1
  73. package/dist/test/modules/pos.test.js +0 -179
  74. package/dist/test/modules/sync.test.d.ts +0 -1
  75. package/dist/test/modules/sync.test.js +0 -93
  76. package/dist/test/modules/syncs.test.d.ts +0 -1
  77. package/dist/test/modules/syncs.test.js +0 -53
  78. package/dist/test/modules/webhooks.test.d.ts +0 -1
  79. package/dist/test/modules/webhooks.test.js +0 -120
  80. package/jest.config.ts +0 -195
  81. package/src/helpers/openapi.ts +0 -22
  82. package/src/helpers/settings.ts +0 -3
  83. package/src/index.ts +0 -1
  84. package/src/modules/accounting.ts +0 -510
  85. package/src/modules/api.ts +0 -35
  86. package/src/modules/consumer.ts +0 -216
  87. package/src/modules/consumers.ts +0 -82
  88. package/src/modules/custom.ts +0 -36
  89. package/src/modules/datastores.ts +0 -19
  90. package/src/modules/ecommerce.ts +0 -129
  91. package/src/modules/flow.ts +0 -168
  92. package/src/modules/integrations.ts +0 -24
  93. package/src/modules/internalApi.ts +0 -182
  94. package/src/modules/invoicing.ts +0 -118
  95. package/src/modules/payment.ts +0 -59
  96. package/src/modules/pms.ts +0 -67
  97. package/src/modules/pos.ts +0 -144
  98. package/src/modules/sync.ts +0 -77
  99. package/src/modules/syncs.ts +0 -59
  100. package/src/modules/webhooks.ts +0 -86
  101. package/test/data/accounting_invoice.pdf +0 -0
  102. package/test/modules/accounting.test.ts +0 -647
  103. package/test/modules/consumer.test.ts +0 -68
  104. package/test/modules/consumers.test.ts +0 -85
  105. package/test/modules/ecommerce.test.ts +0 -213
  106. package/test/modules/integrations.test.ts +0 -22
  107. package/test/modules/invoicing.test.ts +0 -98
  108. package/test/modules/payment.test.ts +0 -65
  109. package/test/modules/pms.test.ts +0 -69
  110. package/test/modules/pos.test.ts +0 -164
  111. package/test/modules/sync.test.ts +0 -74
  112. package/test/modules/syncs.test.ts +0 -23
  113. package/test/modules/webhooks.test.ts +0 -92
  114. package/tsconfig.json +0 -107
package/jest.config.ts DELETED
@@ -1,195 +0,0 @@
1
- /*
2
- * For a detailed explanation regarding each configuration property and type check, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- export default {
7
- // All imported modules in your tests should be mocked automatically
8
- // automock: false,
9
-
10
- // Stop running tests after `n` failures
11
- // bail: 0,
12
-
13
- // The directory where Jest should store its cached dependency information
14
- // cacheDirectory: "/private/var/folders/z7/d2q2nkfs49x74tqyg3t_7zt40000gn/T/jest_dx",
15
-
16
- // Automatically clear mock calls, instances, contexts and results before every test
17
- clearMocks: true,
18
-
19
- // Indicates whether the coverage information should be collected while executing the test
20
- collectCoverage: true,
21
-
22
- // An array of glob patterns indicating a set of files for which coverage information should be collected
23
- // collectCoverageFrom: undefined,
24
-
25
- // The directory where Jest should output its coverage files
26
- coverageDirectory: 'coverage',
27
-
28
- // An array of regexp pattern strings used to skip coverage collection
29
- // coveragePathIgnorePatterns: [
30
- // "/node_modules/"
31
- // ],
32
-
33
- // Indicates which provider should be used to instrument code for coverage
34
- coverageProvider: 'v8',
35
-
36
- // A list of reporter names that Jest uses when writing coverage reports
37
- // coverageReporters: [
38
- // "json",
39
- // "text",
40
- // "lcov",
41
- // "clover"
42
- // ],
43
-
44
- // An object that configures minimum threshold enforcement for coverage results
45
- // coverageThreshold: undefined,
46
-
47
- // A path to a custom dependency extractor
48
- // dependencyExtractor: undefined,
49
-
50
- // Make calling deprecated APIs throw helpful error messages
51
- // errorOnDeprecated: false,
52
-
53
- // The default configuration for fake timers
54
- // fakeTimers: {
55
- // "enableGlobally": false
56
- // },
57
-
58
- // Force coverage collection from ignored files using an array of glob patterns
59
- // forceCoverageMatch: [],
60
-
61
- // A path to a module which exports an async function that is triggered once before all test suites
62
- // globalSetup: undefined,
63
-
64
- // A path to a module which exports an async function that is triggered once after all test suites
65
- // globalTeardown: undefined,
66
-
67
- // A set of global variables that need to be available in all test environments
68
- // globals: {},
69
-
70
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
71
- // maxWorkers: "50%",
72
-
73
- // An array of directory names to be searched recursively up from the requiring module's location
74
- moduleDirectories: ['node_modules', 'src'],
75
-
76
- // An array of file extensions your modules use
77
- // moduleFileExtensions: [
78
- // "js",
79
- // "mjs",
80
- // "cjs",
81
- // "jsx",
82
- // "ts",
83
- // "tsx",
84
- // "json",
85
- // "node"
86
- // ],
87
-
88
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
89
- // moduleNameMapper: {},
90
-
91
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
92
- // modulePathIgnorePatterns: [],
93
-
94
- // Activates notifications for test results
95
- // notify: false,
96
-
97
- // An enum that specifies notification mode. Requires { notify: true }
98
- // notifyMode: "failure-change",
99
-
100
- // A preset that is used as a base for Jest's configuration
101
- preset: 'ts-jest',
102
-
103
- // Run tests from one or more projects
104
- // projects: undefined,
105
-
106
- // Use this configuration option to add custom reporters to Jest
107
- // reporters: undefined,
108
-
109
- // Automatically reset mock state before every test
110
- // resetMocks: false,
111
-
112
- // Reset the module registry before running each individual test
113
- // resetModules: false,
114
-
115
- // A path to a custom resolver
116
- // resolver: undefined,
117
-
118
- // Automatically restore mock state and implementation before every test
119
- // restoreMocks: false,
120
-
121
- // The root directory that Jest should scan for tests and modules within
122
- // rootDir: undefined,
123
-
124
- // A list of paths to directories that Jest should use to search for files in
125
- // roots: [
126
- // "<rootDir>"
127
- // ],
128
-
129
- // Allows you to use a custom runner instead of Jest's default test runner
130
- // runner: "jest-runner",
131
-
132
- // The paths to modules that run some code to configure or set up the testing environment before each test
133
- // setupFiles: [],
134
-
135
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
136
- // setupFilesAfterEnv: [],
137
-
138
- // The number of seconds after which a test is considered as slow and reported as such in the results.
139
- // slowTestThreshold: 5,
140
-
141
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
142
- // snapshotSerializers: [],
143
-
144
- // The test environment that will be used for testing
145
- testEnvironment: 'node',
146
-
147
- // Options that will be passed to the testEnvironment
148
- // testEnvironmentOptions: {},
149
-
150
- // Adds a location field to test results
151
- // testLocationInResults: false,
152
-
153
- // The glob patterns Jest uses to detect test files
154
- // testMatch: [
155
- // "**/__tests__/**/*.[jt]s?(x)",
156
- // "**/?(*.)+(spec|test).[tj]s?(x)"
157
- // ],
158
-
159
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
160
- // testPathIgnorePatterns: [
161
- // "/node_modules/"
162
- // ],
163
-
164
- // The regexp pattern or array of patterns that Jest uses to detect test files
165
- // testRegex: [],
166
-
167
- // This option allows the use of a custom results processor
168
- // testResultsProcessor: undefined,
169
-
170
- // This option allows use of a custom test runner
171
- // testRunner: "jest-circus/runner",
172
-
173
- // A map from regular expressions to paths to transformers
174
- //transform: undefined,
175
-
176
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
177
- // transformIgnorePatterns: [
178
- // "/node_modules/",
179
- // "\\.pnp\\.[^\\/]+$"
180
- // ],
181
-
182
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
183
- // unmockedModulePathPatterns: undefined,
184
-
185
- // Indicates whether each individual test should be reported during the run
186
- // verbose: undefined,
187
-
188
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
189
- // watchPathIgnorePatterns: [],
190
-
191
- // Whether to use watchman for file crawling
192
- // watchman: true,
193
-
194
- testTimeout: 60000,
195
- };
@@ -1,22 +0,0 @@
1
- import { InternalAPI } from '../modules/internalApi';
2
- import { RequestFactory, ApiFor } from '../types/api';
3
-
4
- export function createApiFor<TFactory extends RequestFactory>(
5
- factory: TFactory,
6
- internalApi: InternalAPI,
7
- consumerName: string,
8
- consumerId: string
9
- ) {
10
- return new Proxy(factory, {
11
- get(target: any, property) {
12
- return (...args: any[]) => {
13
- const requestData = target[property](...args);
14
- requestData.property = property;
15
- requestData.consumerName = consumerName;
16
- requestData.consumerId = consumerId;
17
- requestData.url = requestData.url.replace('{consumer_id}', consumerId);
18
- return internalApi.makeRequest(requestData);
19
- };
20
- },
21
- }) as unknown as ApiFor<TFactory>;
22
- }
@@ -1,3 +0,0 @@
1
- export default {
2
- BASE_URL: 'https://api.chift.eu',
3
- };
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './modules/api';