bkper-js 1.19.1 → 1.19.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
@@ -934,6 +934,7 @@ export declare class Book {
934
934
  */
935
935
  getAccounts(): Promise<Account[]>;
936
936
  private mapAccounts;
937
+
937
938
  /**
938
939
  * Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
939
940
  *
package/lib/model/Book.js CHANGED
@@ -522,7 +522,7 @@ export class Book {
522
522
  const group = (_a = this.idGroupMap) === null || _a === void 0 ? void 0 : _a.get(groupPayload.id || "");
523
523
  if (group != null) {
524
524
  group.addAccount(account);
525
- //TODO add known group to account
525
+ // TODO add known group to account
526
526
  }
527
527
  }
528
528
  }
@@ -631,8 +631,19 @@ export class Book {
631
631
  for (const account of accountsObj) {
632
632
  this.updateAccountCache(account);
633
633
  }
634
+ this.ensureGroupsAccountMapsLoaded();
634
635
  return accountsObj;
635
636
  }
637
+ /** @internal */
638
+ ensureGroupsAccountMapsLoaded() {
639
+ if (this.idGroupMap) {
640
+ for (const group of this.idGroupMap.values()) {
641
+ if (group.accounts == null) {
642
+ group.accounts = new Set();
643
+ }
644
+ }
645
+ }
646
+ }
636
647
  /**
637
648
  * Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
638
649
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.19.1",
3
+ "version": "1.19.2",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",