@chift/chift-nodejs 1.0.5 → 1.0.7

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 (70) hide show
  1. package/.github/workflows/ci.yml +38 -38
  2. package/CHANGELOG.md +22 -0
  3. package/dist/src/modules/accounting.d.ts +6 -6
  4. package/dist/src/modules/accounting.js +17 -11
  5. package/dist/src/modules/api.d.ts +1925 -27777
  6. package/dist/src/modules/consumer.d.ts +372 -70
  7. package/dist/src/modules/consumer.js +10 -0
  8. package/dist/src/modules/consumers.d.ts +1931 -396
  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/internalApi.js +10 -5
  13. package/dist/src/modules/pos.d.ts +6 -0
  14. package/dist/src/modules/pos.js +21 -0
  15. package/dist/src/modules/sync.d.ts +1552 -324
  16. package/dist/src/modules/syncs.d.ts +8 -27387
  17. package/dist/src/modules/syncs.js +10 -0
  18. package/dist/test/modules/accounting.test.js +0 -11
  19. package/dist/test/modules/ecommerce.test.js +34 -7
  20. package/dist/test/modules/pos.test.js +18 -0
  21. package/jest.config.ts +1 -1
  22. package/package.json +2 -2
  23. package/src/modules/accounting.ts +25 -13
  24. package/src/modules/api.ts +2 -2
  25. package/src/modules/consumer.ts +21 -0
  26. package/src/modules/ecommerce.ts +52 -0
  27. package/src/modules/flow.ts +1 -1
  28. package/src/modules/pos.ts +40 -0
  29. package/src/modules/sync.ts +1 -1
  30. package/src/modules/syncs.ts +34 -3
  31. package/src/types/public-api/schema.d.ts +3299 -1950
  32. package/test/modules/accounting.test.ts +0 -14
  33. package/test/modules/consumer.test.ts +1 -1
  34. package/test/modules/ecommerce.test.ts +34 -3
  35. package/test/modules/pos.test.ts +21 -0
  36. package/.eslintcache +0 -1
  37. package/coverage/clover.xml +0 -1645
  38. package/coverage/coverage-final.json +0 -19
  39. package/coverage/lcov-report/base.css +0 -224
  40. package/coverage/lcov-report/block-navigation.js +0 -87
  41. package/coverage/lcov-report/favicon.png +0 -0
  42. package/coverage/lcov-report/index.html +0 -146
  43. package/coverage/lcov-report/prettify.css +0 -1
  44. package/coverage/lcov-report/prettify.js +0 -2
  45. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  46. package/coverage/lcov-report/sorter.js +0 -196
  47. package/coverage/lcov-report/src/helpers/index.html +0 -131
  48. package/coverage/lcov-report/src/helpers/openapi.ts.html +0 -151
  49. package/coverage/lcov-report/src/helpers/settings.ts.html +0 -94
  50. package/coverage/lcov-report/src/index.html +0 -116
  51. package/coverage/lcov-report/src/index.ts.html +0 -88
  52. package/coverage/lcov-report/src/modules/accounting.ts.html +0 -1156
  53. package/coverage/lcov-report/src/modules/api.ts.html +0 -190
  54. package/coverage/lcov-report/src/modules/consumer.ts.html +0 -616
  55. package/coverage/lcov-report/src/modules/consumers.ts.html +0 -331
  56. package/coverage/lcov-report/src/modules/custom.ts.html +0 -193
  57. package/coverage/lcov-report/src/modules/datastores.ts.html +0 -142
  58. package/coverage/lcov-report/src/modules/ecommerce.ts.html +0 -331
  59. package/coverage/lcov-report/src/modules/flow.ts.html +0 -589
  60. package/coverage/lcov-report/src/modules/index.html +0 -326
  61. package/coverage/lcov-report/src/modules/integrations.ts.html +0 -151
  62. package/coverage/lcov-report/src/modules/internalApi.ts.html +0 -586
  63. package/coverage/lcov-report/src/modules/invoicing.ts.html +0 -391
  64. package/coverage/lcov-report/src/modules/pos.ts.html +0 -421
  65. package/coverage/lcov-report/src/modules/sync.ts.html +0 -316
  66. package/coverage/lcov-report/src/modules/syncs.ts.html +0 -169
  67. package/coverage/lcov-report/src/modules/webhooks.ts.html +0 -343
  68. package/coverage/lcov.info +0 -1976
  69. package/dist/test/modules/flow.test.d.ts +0 -1
  70. package/dist/test/modules/flow.test.js +0 -69
@@ -3,56 +3,56 @@ name: Test and publish
3
3
  on:
4
4
  workflow_dispatch: {}
5
5
  push:
6
- branches:
7
- - main
8
- - feature/**
9
- tags:
10
- - v[0-9]+.[0-9]+.[0-9]+*
6
+ branches:
7
+ - main
8
+ - feature/**
9
+ tags:
10
+ - v[0-9]+.[0-9]+.[0-9]+*
11
11
  pull_request:
12
- branches:
13
- - main
14
- - feature/**
12
+ branches:
13
+ - main
14
+ - feature/**
15
15
 
16
16
  jobs:
17
17
  test:
18
- name: Test
19
- runs-on: ubuntu-latest
20
- steps:
21
- - name: Checkout
22
- uses: actions/checkout@v3
18
+ if: false
19
+ name: Test
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v3
23
24
 
24
- - name: Use Node.js 16.x
25
- uses: actions/setup-node@v3
26
- with:
27
- node-version: 16.x
25
+ - name: Use Node.js 16.x
26
+ uses: actions/setup-node@v3
27
+ with:
28
+ node-version: 16.x
28
29
 
29
- - name: Install dependencies
30
- run: npm install
30
+ - name: Install dependencies
31
+ run: npm install
31
32
 
32
- - name: Test
33
- run: npm test --coverage && ./node_modules/coveralls/bin/coveralls.js < coverage/lcov.info
34
- env:
35
- CHIFT_BASE_URL: ${{ secrets.CHIFT_BASE_URL }}
36
- CHIFT_CLIENT_ID: ${{ secrets.CHIFT_CLIENT_ID }}
37
- CHIFT_CLIENT_SECRET: ${{ secrets.CHIFT_CLIENT_SECRET }}
38
- CHIFT_ACCOUNT_ID: ${{ secrets.CHIFT_ACCOUNT_ID }}
39
- CHIFT_ODOO_CONSUMER_ID: ${{ secrets.CHIFT_ODOO_CONSUMER_ID }}
40
- CHIFT_WOOCOMMERCE_CONSUMER_ID: ${{ secrets.CHIFT_WOOCOMMERCE_CONSUMER_ID }}
41
- CHIFT_AXONAUT_CONSUMER_ID: ${{ secrets.CHIFT_AXONAUT_CONSUMER_ID }}
42
- CHIFT_CASHPAD_CONSUMER_ID: ${{ secrets.CHIFT_CASHPAD_CONSUMER_ID }}
43
- CHIFT_LIGHTSPEED_CONSUMER_ID: ${{ secrets.CHIFT_LIGHTSPEED_CONSUMER_ID }}
44
- CHIFT_TEST_SYNC_ID: ${{ secrets.CHIFT_TEST_SYNC_ID }}
45
- CHIFT_SYNC_CONSUMER_ID: ${{ secrets.CHIFT_SYNC_CONSUMER_ID }}
46
- COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
33
+ - name: Test
34
+ run: npm test --coverage && ./node_modules/coveralls/bin/coveralls.js < coverage/lcov.info
35
+ env:
36
+ CHIFT_BASE_URL: ${{ secrets.CHIFT_BASE_URL }}
37
+ CHIFT_CLIENT_ID: ${{ secrets.CHIFT_CLIENT_ID }}
38
+ CHIFT_CLIENT_SECRET: ${{ secrets.CHIFT_CLIENT_SECRET }}
39
+ CHIFT_ACCOUNT_ID: ${{ secrets.CHIFT_ACCOUNT_ID }}
40
+ CHIFT_ODOO_CONSUMER_ID: ${{ secrets.CHIFT_ODOO_CONSUMER_ID }}
41
+ CHIFT_WOOCOMMERCE_CONSUMER_ID: ${{ secrets.CHIFT_WOOCOMMERCE_CONSUMER_ID }}
42
+ CHIFT_AXONAUT_CONSUMER_ID: ${{ secrets.CHIFT_AXONAUT_CONSUMER_ID }}
43
+ CHIFT_CASHPAD_CONSUMER_ID: ${{ secrets.CHIFT_CASHPAD_CONSUMER_ID }}
44
+ CHIFT_LIGHTSPEED_CONSUMER_ID: ${{ secrets.CHIFT_LIGHTSPEED_CONSUMER_ID }}
45
+ CHIFT_POPINA_CONSUMER_ID: ${{ secrets.CHIFT_POPINA_CONSUMER_ID }}
46
+ CHIFT_TEST_SYNC_ID: ${{ secrets.CHIFT_TEST_SYNC_ID }}
47
+ CHIFT_SYNC_CONSUMER_ID: ${{ secrets.CHIFT_SYNC_CONSUMER_ID }}
48
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
47
49
 
48
- - name: Report Coveralls
49
- uses: coverallsapp/github-action@v2
50
+ - name: Report Coveralls
51
+ uses: coverallsapp/github-action@v2
50
52
 
51
53
  publish:
52
54
  name: Publish
53
- if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
54
55
  runs-on: ubuntu-latest
55
- needs: test
56
56
  steps:
57
57
  - name: Checkout
58
58
  uses: actions/checkout@v3
package/CHANGELOG.md CHANGED
@@ -27,3 +27,25 @@
27
27
  ## 1.0.5 - 2023-10-26
28
28
 
29
29
  - Return correct error on authentication (promise)
30
+
31
+ ## 1.0.6 - 2023-11-24
32
+
33
+ - Update models & add new POS Routes
34
+
35
+ ## 1.0.7 - 2024-03-26
36
+
37
+ - [ACCOUNTING] Remove getAnalyticLinesOfAccount
38
+ - [ACCOUNTING] Deprecate/Replace Create Journal Entry
39
+ - [ACCOUNTING] Update create misc operation params
40
+ - [ACCOUNTING] Update get misc operation params
41
+ - [ACCOUNTING] Update get balance of accounts params
42
+ - [ACCOUNTING] Update get employees params
43
+ - [POS] Add getAccountingCategories
44
+ - [POS] Fix getProductCategories type
45
+ - [ECOMMERCE] Add getPaymentMethods
46
+ - [ECOMMERCE] Add getProductCategories
47
+ - [ECOMMERCE] Add getCountries
48
+ - [ECOMMERCE] Add getTaxes
49
+ - [SYNC] Add create sync
50
+ - [SYNC] Add update sync
51
+ - [CONSUMER] Add enable consumer flow
@@ -31,25 +31,25 @@ declare const accountingFactory: {
31
31
  getAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
32
32
  updateAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string, analyticAccount: components['schemas']['AnalyticAccountItemUpdate']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
33
33
  getAnalyticAccountsWithMultiplePlans(): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans'][]>;
34
- getAnalyticLinesOfAccount(analytic_account_id: string): RequestData<components['schemas']['AnalyticAccountLineItemOut'][]>;
35
34
  getJournalEntries(params: getJournalEntriesParams): RequestData<components['schemas']['JournalEntryMonoAnalyticPlan'][]>;
36
35
  getJournalEntriesWithMultiplePlans(params: getJournalEntriesWithMultiplePlansParams): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan'][]>;
37
36
  getPaymentsByInvoiceId(invoice_id: string): RequestData<components['schemas']['Payment'][]>;
38
37
  getJournals(): RequestData<components['schemas']['Journal'][]>;
39
38
  getVatCodes(): RequestData<components['schemas']['app__routers__accounting__VatCode'][]>;
40
39
  getMiscOperations(params: getMiscOperationsParams): RequestData<components['schemas']['MiscellaneousOperationOut'][]>;
41
- createMiscOperation(operation: components['schemas']['MiscellaneousOperationIn']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
42
- getMiscOperation(operation_id: string): RequestData<components['schemas']['MiscellaneousOperationOut']>;
40
+ createMiscOperation(operation: components['schemas']['MiscellaneousOperationIn'], params: operations['accounting_create_miscellaneous_operation']['parameters']['query']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
41
+ getMiscOperation(operation_id: string, params: operations['accounting_get_miscellaneous_operation']['parameters']['query']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
43
42
  attachPDF(invoice_id: string, attachment: components['schemas']['AttachmentItem'], params: operations['accounting_add_attachment']['parameters']['query']): RequestData<operations['accounting_add_attachment']['responses'][201]>;
44
43
  getChartOfAccounts(params: getChartOfAccountsParams): RequestData<components['schemas']['AccountItem'][]>;
45
- getBalanceOfAccounts(filter: components['schemas']['AccountBalanceFilter']): RequestData<components['schemas']['AccountBalance'][]>;
46
- getEmployees(): RequestData<components['schemas']['EmployeeItem'][]>;
44
+ getBalanceOfAccounts(filter: components['schemas']['AccountBalanceFilter'], params: operations['accounting_get_accounts_balances']['parameters']['query']): RequestData<components['schemas']['AccountBalance'][]>;
45
+ getEmployees(params: operations['accounting_get_employees']['parameters']['query']): RequestData<components['schemas']['EmployeeItem'][]>;
47
46
  getOutstandings(params: getOutstandingsParams): RequestData<components['schemas']['OutstandingItem'][]>;
48
47
  /**
49
48
  * @deprecated replaced by createFinancialEntry
50
49
  */
51
50
  createFinancialEntryOld(financial_entry: components['schemas']['FinancialEntryItemInOld'], params: operations['accounting_create_financial_entry']['parameters']['query']): RequestData<components['schemas']['FinancialEntryItemOutOld']>;
52
51
  createFinancialEntry(financial_entry: components['schemas']['FinancialEntryItemIn'], params: operations['accounting_create_financial_entries']['parameters']['query']): RequestData<components['schemas']['FinancialEntryItemOut'][]>;
53
- createJournalEntry(journal_entry: components['schemas']['JournalEntryIn']): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']>;
52
+ createJournalEntryOld(journal_entry: components['schemas']['JournalEntryIn']): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']>;
53
+ createJournalEntry(journal_entry: components['schemas']['GenericJournalEntry'], params: operations['accounting_create_generic_journal_entry']['parameters']['query']): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']>;
54
54
  };
55
55
  export { accountingFactory };
@@ -158,12 +158,6 @@ const accountingFactory = {
158
158
  url: '/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans',
159
159
  };
160
160
  },
161
- getAnalyticLinesOfAccount(analytic_account_id) {
162
- return {
163
- method: 'get',
164
- url: `/consumers/{consumer_id}/accounting/analytic-account-lines/account/${analytic_account_id}`,
165
- };
166
- },
167
161
  getJournalEntries(params) {
168
162
  return {
169
163
  params,
@@ -203,15 +197,17 @@ const accountingFactory = {
203
197
  url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
204
198
  };
205
199
  },
206
- createMiscOperation(operation) {
200
+ createMiscOperation(operation, params) {
207
201
  return {
202
+ params,
208
203
  method: 'post',
209
204
  url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
210
205
  body: operation,
211
206
  };
212
207
  },
213
- getMiscOperation(operation_id) {
208
+ getMiscOperation(operation_id, params) {
214
209
  return {
210
+ params,
215
211
  method: 'get',
216
212
  url: `/consumers/{consumer_id}/accounting/miscellaneous-operation/${operation_id}`,
217
213
  };
@@ -231,15 +227,17 @@ const accountingFactory = {
231
227
  url: '/consumers/{consumer_id}/accounting/chart-of-accounts',
232
228
  };
233
229
  },
234
- getBalanceOfAccounts(filter) {
230
+ getBalanceOfAccounts(filter, params) {
235
231
  return {
232
+ params,
236
233
  method: 'post',
237
234
  url: '/consumers/{consumer_id}/accounting/chart-of-accounts/balance',
238
235
  body: filter,
239
236
  };
240
237
  },
241
- getEmployees() {
238
+ getEmployees(params) {
242
239
  return {
240
+ params,
243
241
  method: 'get',
244
242
  url: '/consumers/{consumer_id}/accounting/employees',
245
243
  };
@@ -270,12 +268,20 @@ const accountingFactory = {
270
268
  body: financial_entry,
271
269
  };
272
270
  },
273
- createJournalEntry(journal_entry) {
271
+ createJournalEntryOld(journal_entry) {
274
272
  return {
275
273
  method: 'post',
276
274
  url: '/consumers/{consumer_id}/accounting/journal/entries',
277
275
  body: journal_entry,
278
276
  };
279
277
  },
278
+ createJournalEntry(journal_entry, params) {
279
+ return {
280
+ params,
281
+ method: 'post',
282
+ url: '/consumers/{consumer_id}/accounting/journal-entries',
283
+ body: journal_entry,
284
+ };
285
+ },
280
286
  };
281
287
  exports.accountingFactory = accountingFactory;