bkper-js 1.44.0 → 1.45.0
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/lib/index.d.ts +7 -0
- package/lib/model/Book.js +13 -0
- package/lib/service/transaction-service.js +6 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -966,6 +966,13 @@ export declare class Book {
|
|
|
966
966
|
* @returns The created Transactions
|
|
967
967
|
*/
|
|
968
968
|
batchCreateTransactions(transactions: Transaction[]): Promise<Transaction[]>;
|
|
969
|
+
/**
|
|
970
|
+
* Batch post [[Transactions]] on the Book.
|
|
971
|
+
*
|
|
972
|
+
* @param transactions The transactions to be posted
|
|
973
|
+
*
|
|
974
|
+
*/
|
|
975
|
+
batchPostTransactions(transactions: Transaction[]): Promise<void>;
|
|
969
976
|
/**
|
|
970
977
|
* Batch update [[Transactions]] on the Book.
|
|
971
978
|
*
|
package/lib/model/Book.js
CHANGED
|
@@ -421,6 +421,19 @@ export class Book {
|
|
|
421
421
|
return transactions;
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Batch post [[Transactions]] on the Book.
|
|
426
|
+
*
|
|
427
|
+
* @param transactions The transactions to be posted
|
|
428
|
+
*
|
|
429
|
+
*/
|
|
430
|
+
batchPostTransactions(transactions) {
|
|
431
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
432
|
+
let transactionPayloads = [];
|
|
433
|
+
transactions.forEach(tx => transactionPayloads.push(tx.json()));
|
|
434
|
+
yield TransactionService.postTransactionsBatch(this.getId(), transactionPayloads);
|
|
435
|
+
});
|
|
436
|
+
}
|
|
424
437
|
/**
|
|
425
438
|
* Batch update [[Transactions]] on the Book.
|
|
426
439
|
*
|
|
@@ -14,6 +14,12 @@ export function createTransaction(bookId, transaction) {
|
|
|
14
14
|
return response.data;
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
export function postTransactionsBatch(bookId, transactions) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const payload = { items: transactions };
|
|
20
|
+
yield new HttpBooksApiV5Request(`${bookId}/transactions/post/batch`).setMethod('PATCH').setPayload(payload).fetch();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
17
23
|
export function createTransactionsBatch(bookId, transactions) {
|
|
18
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
25
|
let transactionList = { items: transactions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"description": "Javascript client for Bkper REST API",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@bkper/bkper-api-types": "^5.
|
|
37
|
+
"@bkper/bkper-api-types": "^5.21.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@google-cloud/local-auth": "^3.0.1",
|