bkper-js 1.9.0 → 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 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
  /**
@@ -765,7 +772,7 @@ export declare class Book {
765
772
  *
766
773
  * @returns A TransactionPage object containing the list of transactions
767
774
  */
768
- listTransactions(query?: string, limit?: number, cursor?: string): Promise<TransactionPage>;
775
+ listTransactions(query?: string, limit?: number, cursor?: string): Promise<TransactionList>;
769
776
  /**
770
777
  * Retrieve a transaction by id
771
778
  */
@@ -1776,7 +1783,7 @@ export declare class Transaction {
1776
1783
  /**
1777
1784
  * A list associated with a transaction query.
1778
1785
  */
1779
- export declare class TransactionPage {
1786
+ export declare class TransactionList {
1780
1787
  private payload;
1781
1788
 
1782
1789
  constructor(book: Book, payload: bkper.TransactionList);
package/lib/index.js CHANGED
@@ -17,7 +17,7 @@ export { Group } from './model/Group.js';
17
17
  export { Integration } from './model/Integration.js';
18
18
  export { Template } from './model/Template.js';
19
19
  export { Transaction } from './model/Transaction.js';
20
- export { TransactionList as TransactionPage } from './model/TransactionList.js';
20
+ export { TransactionList } from './model/TransactionList.js';
21
21
  export { User } from './model/User.js';
22
22
  export { Periodicity, DecimalSeparator, Permission, Visibility, AccountType, Period, Month } from './model/Enums.js';
23
23
  //# sourceMappingURL=index.js.map
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
- var response = yield new HttpBooksApiV5Request(`${bookId}/accounts/${encodeURIComponent(idOrName)}`).setMethod('GET').fetch();
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 response = yield new HttpBooksApiV5Request(`${bookId}/accounts`).setMethod('GET').fetch();
39
- return response.data;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",