bkper-js 1.43.1 → 1.44.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 CHANGED
@@ -1000,6 +1000,13 @@ export declare class Book {
1000
1000
  *
1001
1001
  */
1002
1002
  batchTrashTransactions(transactions: Transaction[], trashChecked?: boolean): Promise<void>;
1003
+ /**
1004
+ * Batch untrash [[Transactions]] on the Book.
1005
+ *
1006
+ * @param transactions The transactions to be untrashed
1007
+ *
1008
+ */
1009
+ batchUntrashTransactions(transactions: Transaction[]): Promise<void>;
1003
1010
  /**
1004
1011
  * Replay [[Events]] on the Book, in batch.
1005
1012
  */
package/lib/model/Book.js CHANGED
@@ -481,6 +481,19 @@ export class Book {
481
481
  yield TransactionService.trashTransactionsBatch(this.getId(), transactionPayloads, trashChecked);
482
482
  });
483
483
  }
484
+ /**
485
+ * Batch untrash [[Transactions]] on the Book.
486
+ *
487
+ * @param transactions The transactions to be untrashed
488
+ *
489
+ */
490
+ batchUntrashTransactions(transactions) {
491
+ return __awaiter(this, void 0, void 0, function* () {
492
+ let transactionPayloads = [];
493
+ transactions.forEach(tx => transactionPayloads.push(tx.json()));
494
+ yield TransactionService.untrashTransactionsBatch(this.getId(), transactionPayloads);
495
+ });
496
+ }
484
497
  /**
485
498
  * Replay [[Events]] on the Book, in batch.
486
499
  */
@@ -52,6 +52,14 @@ export function trashTransactionsBatch(bookId, transactions, trashChecked) {
52
52
  transactionList = yield response.data;
53
53
  });
54
54
  }
55
+ export function untrashTransactionsBatch(bookId, transactions) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ let transactionList = { items: transactions };
58
+ const payload = transactionList;
59
+ const response = yield new HttpBooksApiV5Request(`${bookId}/transactions/untrash/batch`).setMethod('PATCH').setPayload(payload).fetch();
60
+ transactionList = yield response.data;
61
+ });
62
+ }
55
63
  export function updateTransaction(bookId, transaction) {
56
64
  return __awaiter(this, void 0, void 0, function* () {
57
65
  var response = yield new HttpBooksApiV5Request(`${bookId}/transactions`).setMethod('PUT').setPayload(transaction).fetch();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.43.1",
3
+ "version": "1.44.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.19.0"
37
+ "@bkper/bkper-api-types": "^5.20.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "@google-cloud/local-auth": "^3.0.1",