bkper-js 1.9.1 → 1.9.2
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 +7 -0
- package/lib/service/account-service.js +4 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -751,9 +751,16 @@ export declare class Book {
|
|
|
751
751
|
getGroup(idOrName?: string): Promise<Group | undefined>;
|
|
752
752
|
/**
|
|
753
753
|
* Gets all [[Groups]] of this Book
|
|
754
|
+
*
|
|
755
|
+
* @returns The retrieved Group objects
|
|
754
756
|
*/
|
|
755
757
|
getGroups(): Promise<Group[]>;
|
|
756
758
|
private mapGroups;
|
|
759
|
+
/**
|
|
760
|
+
* Gets all [[Accounts]] of this Book
|
|
761
|
+
*
|
|
762
|
+
* @returns The retrieved Account objects
|
|
763
|
+
*/
|
|
757
764
|
getAccounts(): Promise<Account[]>;
|
|
758
765
|
private mapAccounts;
|
|
759
766
|
/**
|
package/lib/model/Book.js
CHANGED
|
@@ -540,6 +540,8 @@ export class Book {
|
|
|
540
540
|
}
|
|
541
541
|
/**
|
|
542
542
|
* Gets all [[Groups]] of this Book
|
|
543
|
+
*
|
|
544
|
+
* @returns The retrieved Group objects
|
|
543
545
|
*/
|
|
544
546
|
getGroups() {
|
|
545
547
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -561,6 +563,11 @@ export class Book {
|
|
|
561
563
|
}
|
|
562
564
|
return groupsObj;
|
|
563
565
|
}
|
|
566
|
+
/**
|
|
567
|
+
* Gets all [[Accounts]] of this Book
|
|
568
|
+
*
|
|
569
|
+
* @returns The retrieved Account objects
|
|
570
|
+
*/
|
|
564
571
|
getAccounts() {
|
|
565
572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
566
573
|
if (this.idAccountMap) {
|
|
@@ -29,14 +29,15 @@ export function deleteAccount(bookId, account) {
|
|
|
29
29
|
}
|
|
30
30
|
export function getAccount(bookId, idOrName) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
|
|
32
|
+
let response = yield new HttpBooksApiV5Request(`${bookId}/accounts/${encodeURIComponent(idOrName)}`).setMethod('GET').fetch();
|
|
33
33
|
return response.data;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
export function getAccounts(bookId) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
var
|
|
39
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
let response = yield new HttpBooksApiV5Request(`${bookId}/accounts`).setMethod('GET').fetch();
|
|
40
|
+
return ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
//# sourceMappingURL=account-service.js.map
|