bkper-js 2.8.1 → 2.9.1

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/CHANGELOG.md CHANGED
@@ -12,12 +12,14 @@ See what's new and what has changed in bkper-js
12
12
  * Enhanced type safety with explicit Config type usage throughout
13
13
  * Standardized `json()` method across resources for consistent JSON serialization
14
14
  * Maintained full backward compatibility - no breaking changes to existing APIs
15
+ * Added `Account.isBalanceVerified`
15
16
  * Added `App.getOwnerWebsiteUrl`
16
17
  * Added `App.getReadme`
17
18
  * Added `App.getRepositoryUrl`
18
19
  * Added `App.getWebsiteUrl`
19
20
  * Added `App.isInstallable`
20
21
  * Added `App.isRepositoryPrivate`
22
+ * Added `Book.getCollaborators`
21
23
  * Added `Collaborator`
22
24
  * Added `Collaborator.json`
23
25
  * Added `Collaborator.getId`
@@ -28,7 +30,7 @@ See what's new and what has changed in bkper-js
28
30
  * Added `Collaborator.create`
29
31
  * Added `Collaborator.update`
30
32
  * Added `Collaborator.remove`
31
- * Added `Book.getCollaborators`
33
+ * Added `Group.isBalanceVerified`
32
34
  * Replaced axios with native Fetch API for better compatibility with multiple environments
33
35
 
34
36
  **August 2025**
package/lib/index.d.ts CHANGED
@@ -18,12 +18,7 @@
18
18
  export declare class Account extends Resource<bkper.Account> {
19
19
 
20
20
  constructor(book: Book, payload?: bkper.Account);
21
- /**
22
- * Gets the configuration object for this Account.
23
- *
24
- * @returns The Config object from the parent Book
25
- */
26
- getConfig(): Config;
21
+
27
22
  /**
28
23
  * Gets the Account internal id.
29
24
  *
@@ -44,6 +39,12 @@ export declare class Account extends Resource<bkper.Account> {
44
39
  * @returns This Account, for chaining
45
40
  */
46
41
  setName(name: string): Account;
42
+ /**
43
+ * Tells if the balance of this Account has been verified/audited.
44
+ *
45
+ * @returns True if the balance of this Account has been verified/audited
46
+ */
47
+ isBalanceVerified(): boolean | undefined;
47
48
  /**
48
49
  * Gets the normalized name of this Account without spaces or special characters.
49
50
  *
@@ -444,12 +445,7 @@ export declare class Amount {
444
445
  export declare class App extends Resource<bkper.App> {
445
446
  private config?;
446
447
  constructor(payload?: bkper.App, config?: Config);
447
- /**
448
- * Gets the configuration object for this App.
449
- *
450
- * @returns The Config object for this App or the global config
451
- */
452
- getConfig(): Config;
448
+
453
449
  /**
454
450
  * Sets the webhook url for development.
455
451
  *
@@ -1321,12 +1317,7 @@ export declare class Book extends Resource<bkper.Book> {
1321
1317
 
1322
1318
 
1323
1319
  constructor(payload?: bkper.Book, config?: Config);
1324
- /**
1325
- * Gets the configuration object for this Book.
1326
- *
1327
- * @returns The Config object for this Book or the global config
1328
- */
1329
- getConfig(): Config;
1320
+
1330
1321
  /**
1331
1322
  * Gets the unique identifier of this Book.
1332
1323
  *
@@ -1960,12 +1951,7 @@ export declare enum BotResponseType {
1960
1951
  export declare class Collaborator extends Resource<bkper.Collaborator> {
1961
1952
 
1962
1953
  constructor(book: Book, payload?: bkper.Collaborator);
1963
- /**
1964
- * Gets the configuration object for this Collaborator.
1965
- *
1966
- * @returns The Config object from the parent Book
1967
- */
1968
- getConfig(): Config;
1954
+
1969
1955
  /**
1970
1956
  * Gets the Collaborator internal id.
1971
1957
  *
@@ -2028,12 +2014,7 @@ export declare class Collaborator extends Resource<bkper.Collaborator> {
2028
2014
  export declare class Collection extends Resource<bkper.Collection> {
2029
2015
  private config?;
2030
2016
  constructor(payload?: bkper.Collection, config?: Config);
2031
- /**
2032
- * Gets the configuration object for this Collection.
2033
- *
2034
- * @returns The Config object for this Collection or the global config
2035
- */
2036
- getConfig(): Config;
2017
+
2037
2018
  /**
2038
2019
  * Gets the unique identifier of this Collection.
2039
2020
  *
@@ -2169,12 +2150,7 @@ export declare interface Config {
2169
2150
  export declare class Connection extends Resource<bkper.Connection> {
2170
2151
  private config?;
2171
2152
  constructor(payload?: bkper.Connection, config?: Config);
2172
- /**
2173
- * Gets the configuration object for this Connection.
2174
- *
2175
- * @returns The Config object for this Connection or the global config
2176
- */
2177
- getConfig(): Config;
2153
+
2178
2154
  /**
2179
2155
  * Gets the id of the Connection.
2180
2156
  *
@@ -2340,12 +2316,7 @@ export declare class Conversation extends Resource<bkper.Conversation> {
2340
2316
 
2341
2317
  private config?;
2342
2318
  constructor(agent: Agent, payload?: bkper.Conversation, config?: Config);
2343
- /**
2344
- * Gets the configuration object for this Conversation.
2345
- *
2346
- * @returns The Config object for this Conversation or the global config
2347
- */
2348
- getConfig(): Config;
2319
+
2349
2320
  /**
2350
2321
  * Gets the Agent associated to this Conversation.
2351
2322
  *
@@ -2558,12 +2529,7 @@ export declare enum EventType {
2558
2529
  export declare class File extends Resource<bkper.File> {
2559
2530
 
2560
2531
  constructor(book: Book, payload?: bkper.File);
2561
- /**
2562
- * Gets the configuration object for this File.
2563
- *
2564
- * @returns The Config object from the parent Book
2565
- */
2566
- getConfig(): Config;
2532
+
2567
2533
  /**
2568
2534
  * Gets the File id.
2569
2535
  *
@@ -2692,12 +2658,7 @@ export declare class Group extends Resource<bkper.Group> {
2692
2658
 
2693
2659
 
2694
2660
  constructor(book: Book, payload?: bkper.Group);
2695
- /**
2696
- * Gets the configuration object for this Group.
2697
- *
2698
- * @returns The Config object from the parent Book
2699
- */
2700
- getConfig(): Config;
2661
+
2701
2662
  /**
2702
2663
  * Gets the id of this Group.
2703
2664
  *
@@ -2718,6 +2679,12 @@ export declare class Group extends Resource<bkper.Group> {
2718
2679
  * @returns This Group, for chaining
2719
2680
  */
2720
2681
  setName(name: string): Group;
2682
+ /**
2683
+ * Tells if the balance of this Group has been verified/audited.
2684
+ *
2685
+ * @returns True if the balance of this Group has been verified/audited
2686
+ */
2687
+ isBalanceVerified(): Promise<boolean | undefined>;
2721
2688
  /**
2722
2689
  * Tells if the Group is locked by the Book owner.
2723
2690
  *
@@ -2938,12 +2905,7 @@ export declare class Group extends Resource<bkper.Group> {
2938
2905
  export declare class Integration extends Resource<bkper.Integration> {
2939
2906
  private config?;
2940
2907
  constructor(payload?: bkper.Integration, config?: Config);
2941
- /**
2942
- * Gets the configuration object for this Integration.
2943
- *
2944
- * @returns The Config object for this Integration or the global config
2945
- */
2946
- getConfig(): Config;
2908
+
2947
2909
  /**
2948
2910
  * Gets the [[Book]] id of the Integration.
2949
2911
  *
@@ -3054,12 +3016,7 @@ export declare class Message extends Resource<bkper.Message> {
3054
3016
 
3055
3017
 
3056
3018
  constructor(conversation: Conversation, payload?: bkper.Message, config?: Config);
3057
- /**
3058
- * Gets the configuration object for this Message.
3059
- *
3060
- * @returns The Config object from the parent Conversation
3061
- */
3062
- getConfig(): Config;
3019
+
3063
3020
  /**
3064
3021
  * Gets the Message universal identifier.
3065
3022
  *
@@ -3265,12 +3222,7 @@ export declare enum Permission {
3265
3222
  export declare class Query extends Resource<bkper.Query> {
3266
3223
 
3267
3224
  constructor(book: Book, payload?: bkper.Query);
3268
- /**
3269
- * Gets the configuration object for this Query.
3270
- *
3271
- * @returns The Config object from the parent Book
3272
- */
3273
- getConfig(): Config;
3225
+
3274
3226
  /**
3275
3227
  * Gets the Query universal identifier.
3276
3228
  *
@@ -3347,14 +3299,7 @@ declare abstract class Resource<T = any> {
3347
3299
  * @returns An immutable copy of the json payload
3348
3300
  */
3349
3301
  json(): T;
3350
- /**
3351
- * Gets the effective configuration for this resource.
3352
- * Each resource must implement this to either:
3353
- * - Return its own config (for root containers like Book, Collection)
3354
- * - Delegate to its container (for contained resources like Account, Transaction)
3355
- * @returns The resolved configuration
3356
- */
3357
- abstract getConfig(): Config;
3302
+
3358
3303
  }
3359
3304
 
3360
3305
  /**
@@ -3367,12 +3312,7 @@ declare abstract class Resource<T = any> {
3367
3312
  export declare class Template extends Resource<bkper.Template> {
3368
3313
  private config?;
3369
3314
  constructor(json?: bkper.Template, config?: Config);
3370
- /**
3371
- * Gets the configuration object for this Template.
3372
- *
3373
- * @returns The Config object for this Template or the global config
3374
- */
3375
- getConfig(): Config;
3315
+
3376
3316
  /**
3377
3317
  * Gets the name of the Template.
3378
3318
  *
@@ -3434,12 +3374,7 @@ export declare class Template extends Resource<bkper.Template> {
3434
3374
  export declare class Transaction extends Resource<bkper.Transaction> {
3435
3375
 
3436
3376
  constructor(book: Book, payload?: bkper.Transaction);
3437
- /**
3438
- * Gets the configuration object for this Transaction.
3439
- *
3440
- * @returns The Config object from the parent Book
3441
- */
3442
- getConfig(): Config;
3377
+
3443
3378
  /**
3444
3379
  * Gets the book associated with this transaction.
3445
3380
  *
@@ -3937,12 +3872,7 @@ export declare class TransactionList {
3937
3872
  export declare class User extends Resource<bkper.User> {
3938
3873
  private config?;
3939
3874
  constructor(payload?: bkper.User, config?: Config);
3940
- /**
3941
- * Gets the configuration object for this User.
3942
- *
3943
- * @returns The Config object for this User or the global config
3944
- */
3945
- getConfig(): Config;
3875
+
3946
3876
  /**
3947
3877
  * Gets the id of the User.
3948
3878
  *
@@ -26,11 +26,7 @@ export class Account extends Resource {
26
26
  super(payload || { createdAt: `${Date.now()}` });
27
27
  this.book = book;
28
28
  }
29
- /**
30
- * Gets the configuration object for this Account.
31
- *
32
- * @returns The Config object from the parent Book
33
- */
29
+ /** @internal */
34
30
  getConfig() {
35
31
  return this.book.getConfig();
36
32
  }
@@ -61,6 +57,14 @@ export class Account extends Resource {
61
57
  this.payload.name = name;
62
58
  return this;
63
59
  }
60
+ /**
61
+ * Tells if the balance of this Account has been verified/audited.
62
+ *
63
+ * @returns True if the balance of this Account has been verified/audited
64
+ */
65
+ isBalanceVerified() {
66
+ return this.payload.balanceVerified;
67
+ }
64
68
  /**
65
69
  * Gets the normalized name of this Account without spaces or special characters.
66
70
  *
package/lib/model/App.js CHANGED
@@ -22,11 +22,7 @@ export class App extends Resource {
22
22
  super(payload);
23
23
  this.config = config;
24
24
  }
25
- /**
26
- * Gets the configuration object for this App.
27
- *
28
- * @returns The Config object for this App or the global config
29
- */
25
+ /** @internal */
30
26
  getConfig() {
31
27
  return this.config || Bkper.globalConfig;
32
28
  }
package/lib/model/Book.js CHANGED
@@ -51,11 +51,7 @@ export class Book extends Resource {
51
51
  this.mapGroups(this.payload.groups);
52
52
  this.mapAccounts(this.payload.accounts);
53
53
  }
54
- /**
55
- * Gets the configuration object for this Book.
56
- *
57
- * @returns The Config object for this Book or the global config
58
- */
54
+ /** @internal */
59
55
  getConfig() {
60
56
  return this.config || Bkper.globalConfig;
61
57
  }
@@ -21,11 +21,7 @@ export class Collaborator extends Resource {
21
21
  super(payload);
22
22
  this.book = book;
23
23
  }
24
- /**
25
- * Gets the configuration object for this Collaborator.
26
- *
27
- * @returns The Config object from the parent Book
28
- */
24
+ /** @internal */
29
25
  getConfig() {
30
26
  return this.book.getConfig();
31
27
  }
@@ -21,11 +21,7 @@ export class Collection extends Resource {
21
21
  super(payload);
22
22
  this.config = config;
23
23
  }
24
- /**
25
- * Gets the configuration object for this Collection.
26
- *
27
- * @returns The Config object for this Collection or the global config
28
- */
24
+ /** @internal */
29
25
  getConfig() {
30
26
  return this.config || Bkper.globalConfig;
31
27
  }
@@ -21,11 +21,7 @@ export class Connection extends Resource {
21
21
  super(payload);
22
22
  this.config = config;
23
23
  }
24
- /**
25
- * Gets the configuration object for this Connection.
26
- *
27
- * @returns The Config object for this Connection or the global config
28
- */
24
+ /** @internal */
29
25
  getConfig() {
30
26
  return this.config || Bkper.globalConfig;
31
27
  }
@@ -25,11 +25,7 @@ export class Conversation extends Resource {
25
25
  this.agent = agent;
26
26
  this.config = config;
27
27
  }
28
- /**
29
- * Gets the configuration object for this Conversation.
30
- *
31
- * @returns The Config object for this Conversation or the global config
32
- */
28
+ /** @internal */
33
29
  getConfig() {
34
30
  return this.config || Bkper.globalConfig;
35
31
  }
package/lib/model/File.js CHANGED
@@ -22,11 +22,7 @@ export class File extends Resource {
22
22
  super(payload || { createdAt: `${Date.now()}` });
23
23
  this.book = book;
24
24
  }
25
- /**
26
- * Gets the configuration object for this File.
27
- *
28
- * @returns The Config object from the parent Book
29
- */
25
+ /** @internal */
30
26
  getConfig() {
31
27
  return this.book.getConfig();
32
28
  }
@@ -27,11 +27,7 @@ export class Group extends Resource {
27
27
  this.children = new Map();
28
28
  this.book = book;
29
29
  }
30
- /**
31
- * Gets the configuration object for this Group.
32
- *
33
- * @returns The Config object from the parent Book
34
- */
30
+ /** @internal */
35
31
  getConfig() {
36
32
  return this.book.getConfig();
37
33
  }
@@ -62,6 +58,22 @@ export class Group extends Resource {
62
58
  this.payload.name = name;
63
59
  return this;
64
60
  }
61
+ /**
62
+ * Tells if the balance of this Group has been verified/audited.
63
+ *
64
+ * @returns True if the balance of this Group has been verified/audited
65
+ */
66
+ isBalanceVerified() {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const accounts = yield this.getAccounts();
69
+ for (const account of accounts) {
70
+ if (!account.isBalanceVerified()) {
71
+ return false;
72
+ }
73
+ }
74
+ return true;
75
+ });
76
+ }
65
77
  /**
66
78
  * Tells if the Group is locked by the Book owner.
67
79
  *
@@ -20,11 +20,7 @@ export class Integration extends Resource {
20
20
  super(payload || {});
21
21
  this.config = config;
22
22
  }
23
- /**
24
- * Gets the configuration object for this Integration.
25
- *
26
- * @returns The Config object for this Integration or the global config
27
- */
23
+ /** @internal */
28
24
  getConfig() {
29
25
  return this.config || Bkper.globalConfig;
30
26
  }
@@ -23,11 +23,7 @@ export class Message extends Resource {
23
23
  super(payload || {});
24
24
  this.conversation = conversation;
25
25
  }
26
- /**
27
- * Gets the configuration object for this Message.
28
- *
29
- * @returns The Config object from the parent Conversation
30
- */
26
+ /** @internal */
31
27
  getConfig() {
32
28
  return this.conversation.getConfig();
33
29
  }
@@ -21,11 +21,7 @@ export class Query extends Resource {
21
21
  super(payload);
22
22
  this.book = book;
23
23
  }
24
- /**
25
- * Gets the configuration object for this Query.
26
- *
27
- * @returns The Config object from the parent Book
28
- */
24
+ /** @internal */
29
25
  getConfig() {
30
26
  return this.book.getConfig();
31
27
  }
@@ -12,11 +12,7 @@ export class Template extends Resource {
12
12
  super(json);
13
13
  this.config = config;
14
14
  }
15
- /**
16
- * Gets the configuration object for this Template.
17
- *
18
- * @returns The Config object for this Template or the global config
19
- */
15
+ /** @internal */
20
16
  getConfig() {
21
17
  return this.config || Bkper.globalConfig;
22
18
  }
@@ -26,11 +26,7 @@ export class Transaction extends Resource {
26
26
  super(payload || { createdAt: `${Date.now()}` });
27
27
  this.book = book;
28
28
  }
29
- /**
30
- * Gets the configuration object for this Transaction.
31
- *
32
- * @returns The Config object from the parent Book
33
- */
29
+ /** @internal */
34
30
  getConfig() {
35
31
  return this.book.getConfig();
36
32
  }
package/lib/model/User.js CHANGED
@@ -25,11 +25,7 @@ export class User extends Resource {
25
25
  super(payload);
26
26
  this.config = config;
27
27
  }
28
- /**
29
- * Gets the configuration object for this User.
30
- *
31
- * @returns The Config object for this User or the global config
32
- */
28
+ /** @internal */
33
29
  getConfig() {
34
30
  return this.config || Bkper.globalConfig;
35
31
  }
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.50.0"
8
+ "packageVersion": "7.52.12"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "2.8.1",
3
+ "version": "2.9.1",
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.25.0"
37
+ "@bkper/bkper-api-types": "^5.26.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "big.js": "^6.0.3",
@@ -42,7 +42,7 @@
42
42
  "luxon": "^1.25.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.12.1",
45
+ "@microsoft/api-extractor": "^7.52.12",
46
46
  "@types/big.js": "^6.0.2",
47
47
  "@types/chai": "^4.2.14",
48
48
  "@types/luxon": "^1.25.1",