@chift/chift-nodejs 1.0.26 → 1.0.27
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.
- package/dist/src/modules/accounting.d.ts +8 -0
- package/dist/src/modules/accounting.js +41 -0
- package/dist/src/modules/api.d.ts +2133 -83
- package/dist/src/modules/api.js +2 -0
- package/dist/src/modules/banking.d.ts +3 -1
- package/dist/src/modules/banking.js +10 -2
- package/dist/src/modules/consumer.d.ts +405 -15
- package/dist/src/modules/consumer.js +5 -0
- package/dist/src/modules/consumers.d.ts +2049 -84
- package/dist/src/modules/ecommerce.d.ts +2 -2
- package/dist/src/modules/integrations.d.ts +5 -0
- package/dist/src/modules/internalApi.d.ts +4 -4
- package/dist/src/modules/invoicing.d.ts +2 -2
- package/dist/src/modules/issues.d.ts +68 -0
- package/dist/src/modules/issues.js +33 -0
- package/dist/src/modules/pms.d.ts +3 -0
- package/dist/src/modules/pms.js +15 -0
- package/dist/src/modules/sync.d.ts +1639 -67
- package/dist/src/modules/syncs.d.ts +0 -1
- package/dist/src/modules/syncs.js +0 -5
- package/dist/src/types/public-api/mappings.d.ts +21 -3
- package/dist/src/types/public-api/schema.d.ts +2682 -1001
- package/dist/test/modules/banking.test.js +3 -1
- package/dist/test/modules/consumer.test.js +1 -1
- package/dist/test/modules/raw-data.test.js +6 -4
- package/package.json +2 -2
- package/src/types/public-api/schema.d.ts +2682 -1001
|
@@ -74,7 +74,9 @@ let transactions;
|
|
|
74
74
|
if (!accounts.length) {
|
|
75
75
|
throw new Error('No accounts found to test getAccountTransactions');
|
|
76
76
|
}
|
|
77
|
-
transactions = yield consumer.banking.getAccountTransactions(
|
|
77
|
+
transactions = yield consumer.banking.getAccountTransactions({
|
|
78
|
+
account_id: accounts[0].id,
|
|
79
|
+
});
|
|
78
80
|
(0, globals_1.expect)(transactions).toBeInstanceOf(Array);
|
|
79
81
|
if (transactions.length > 0) {
|
|
80
82
|
(0, globals_1.expect)(transactions[0]).toHaveProperty('id', globals_1.expect.any(String));
|
|
@@ -56,7 +56,7 @@ let consumer;
|
|
|
56
56
|
syncConsumer = yield client.Consumers.getConsumerById(process.env.CHIFT_SYNC_CONSUMER_ID);
|
|
57
57
|
}));
|
|
58
58
|
(0, globals_1.test)('createConnection', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
const body = { integrationid: 1000, name: 'odoo test sdk' };
|
|
59
|
+
const body = { integrationid: 1000, name: 'odoo test sdk', redirect: false };
|
|
60
60
|
const result = yield consumer.createConnection(body);
|
|
61
61
|
(0, globals_1.expect)(result).toHaveProperty('url', globals_1.expect.any(String));
|
|
62
62
|
}));
|
|
@@ -30,10 +30,10 @@ const banking_1 = require("../../src/modules/banking");
|
|
|
30
30
|
});
|
|
31
31
|
(0, globals_1.test)('banking factory methods support rawData parameter', () => {
|
|
32
32
|
// Test that getAccountTransactions supports rawData parameter
|
|
33
|
-
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions('test-account-id'
|
|
33
|
+
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions({ account_id: 'test-account-id' }, { rawData: true });
|
|
34
34
|
(0, globals_1.expect)(getTransactionsRequest).toHaveProperty('rawData', true);
|
|
35
35
|
(0, globals_1.expect)(getTransactionsRequest).toHaveProperty('method', 'get');
|
|
36
|
-
(0, globals_1.expect)(getTransactionsRequest).toHaveProperty('url', '/consumers/{consumer_id}/banking/
|
|
36
|
+
(0, globals_1.expect)(getTransactionsRequest).toHaveProperty('url', '/consumers/{consumer_id}/banking/transactions');
|
|
37
37
|
});
|
|
38
38
|
(0, globals_1.test)('rawData parameter defaults to undefined when not specified', () => {
|
|
39
39
|
// Test that rawData is undefined when not specified
|
|
@@ -41,7 +41,9 @@ const banking_1 = require("../../src/modules/banking");
|
|
|
41
41
|
(0, globals_1.expect)(getInvoicesRequest.rawData).toBeUndefined();
|
|
42
42
|
const getOrdersRequest = ecommerce_1.ecommerceFactory.getOrders();
|
|
43
43
|
(0, globals_1.expect)(getOrdersRequest.rawData).toBeUndefined();
|
|
44
|
-
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions(
|
|
44
|
+
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions({
|
|
45
|
+
account_id: 'test-account-id',
|
|
46
|
+
});
|
|
45
47
|
(0, globals_1.expect)(getTransactionsRequest.rawData).toBeUndefined();
|
|
46
48
|
});
|
|
47
49
|
(0, globals_1.test)('rawData parameter can be explicitly set to false', () => {
|
|
@@ -50,6 +52,6 @@ const banking_1 = require("../../src/modules/banking");
|
|
|
50
52
|
(0, globals_1.expect)(getInvoicesRequest).toHaveProperty('rawData', false);
|
|
51
53
|
const getOrdersRequest = ecommerce_1.ecommerceFactory.getOrders({}, { rawData: false });
|
|
52
54
|
(0, globals_1.expect)(getOrdersRequest).toHaveProperty('rawData', false);
|
|
53
|
-
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions('test-account-id'
|
|
55
|
+
const getTransactionsRequest = banking_1.bankingFactory.getAccountTransactions({ account_id: 'test-account-id' }, { rawData: false });
|
|
54
56
|
(0, globals_1.expect)(getTransactionsRequest).toHaveProperty('rawData', false);
|
|
55
57
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chift/chift-nodejs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "The Chift NodeJS library provides convenient access to the Chift API from applications written in the NodeJS language (Javascript/Typescript).",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "chokidar src --command 'npm run build' --debounce=5000",
|
|
13
13
|
"prepare": "husky install",
|
|
14
|
-
"build": "tsc
|
|
14
|
+
"build": "tsc",
|
|
15
15
|
"test": "jest --maxWorkers 1"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [],
|