bkper-js 1.44.0 → 1.46.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 +27 -0
- package/lib/model/App.js +30 -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
|
@@ -417,6 +417,26 @@ export declare class App {
|
|
|
417
417
|
* @return The name of the owner of this App
|
|
418
418
|
*/
|
|
419
419
|
getOwnerName(): string | undefined;
|
|
420
|
+
/**
|
|
421
|
+
* @return The menu url of this App
|
|
422
|
+
*/
|
|
423
|
+
getMenuUrl(): string | undefined;
|
|
424
|
+
/**
|
|
425
|
+
* @return The menu development url of this App
|
|
426
|
+
*/
|
|
427
|
+
getMenuUrlDev(): string | undefined;
|
|
428
|
+
/**
|
|
429
|
+
* @return The menu text of this App
|
|
430
|
+
*/
|
|
431
|
+
getMenuText(): string | undefined;
|
|
432
|
+
/**
|
|
433
|
+
* @return The menu popup width of this App
|
|
434
|
+
*/
|
|
435
|
+
getMenuPopupWidth(): string | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* @return The menu popup height of this App
|
|
438
|
+
*/
|
|
439
|
+
getMenuPopupHeight(): string | undefined;
|
|
420
440
|
/**
|
|
421
441
|
* @return The logo url of the owner of this App
|
|
422
442
|
*/
|
|
@@ -966,6 +986,13 @@ export declare class Book {
|
|
|
966
986
|
* @returns The created Transactions
|
|
967
987
|
*/
|
|
968
988
|
batchCreateTransactions(transactions: Transaction[]): Promise<Transaction[]>;
|
|
989
|
+
/**
|
|
990
|
+
* Batch post [[Transactions]] on the Book.
|
|
991
|
+
*
|
|
992
|
+
* @param transactions The transactions to be posted
|
|
993
|
+
*
|
|
994
|
+
*/
|
|
995
|
+
batchPostTransactions(transactions: Transaction[]): Promise<void>;
|
|
969
996
|
/**
|
|
970
997
|
* Batch update [[Transactions]] on the Book.
|
|
971
998
|
*
|
package/lib/model/App.js
CHANGED
|
@@ -116,6 +116,36 @@ export class App {
|
|
|
116
116
|
getOwnerName() {
|
|
117
117
|
return this.payload.ownerName;
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* @return The menu url of this App
|
|
121
|
+
*/
|
|
122
|
+
getMenuUrl() {
|
|
123
|
+
return this.payload.menuUrl;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @return The menu development url of this App
|
|
127
|
+
*/
|
|
128
|
+
getMenuUrlDev() {
|
|
129
|
+
return this.payload.menuUrlDev;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @return The menu text of this App
|
|
133
|
+
*/
|
|
134
|
+
getMenuText() {
|
|
135
|
+
return this.payload.menuText;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @return The menu popup width of this App
|
|
139
|
+
*/
|
|
140
|
+
getMenuPopupWidth() {
|
|
141
|
+
return this.payload.menuPopupWidth;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @return The menu popup height of this App
|
|
145
|
+
*/
|
|
146
|
+
getMenuPopupHeight() {
|
|
147
|
+
return this.payload.menuPopupHeight;
|
|
148
|
+
}
|
|
119
149
|
/**
|
|
120
150
|
* @return The logo url of the owner of this App
|
|
121
151
|
*/
|
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.46.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",
|