bkper-js 2.3.0 → 2.4.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 CHANGED
@@ -1190,10 +1190,17 @@ export declare class Bkper {
1190
1190
  *
1191
1191
  * @param id - The universal book id - The same bookId param of URL you access at app.bkper.com
1192
1192
  * @param includeAccounts - Optional parameter to include accounts in the retrieved Book
1193
+ * @param includeGroups - Optional parameter to include groups in the retrieved Book
1194
+ *
1195
+ * If both includeAccounts and includeGroups are false, the Book will be returned with only the basic information.
1196
+ *
1197
+ * If includeAccounts is true, the Book will be returned with the accounts and groups.
1198
+ *
1199
+ * If includeGroups is true, the Book will be returned with the groups.
1193
1200
  *
1194
1201
  * @returns The retrieved Book
1195
1202
  */
1196
- getBook(id: string, includeAccounts?: boolean): Promise<Book>;
1203
+ getBook(id: string, includeAccounts?: boolean, includeGroups?: boolean): Promise<Book>;
1197
1204
  /**
1198
1205
  * Gets all [[Books]] the user has access to.
1199
1206
  *
@@ -63,12 +63,19 @@ export class Bkper {
63
63
  *
64
64
  * @param id - The universal book id - The same bookId param of URL you access at app.bkper.com
65
65
  * @param includeAccounts - Optional parameter to include accounts in the retrieved Book
66
+ * @param includeGroups - Optional parameter to include groups in the retrieved Book
67
+ *
68
+ * If both includeAccounts and includeGroups are false, the Book will be returned with only the basic information.
69
+ *
70
+ * If includeAccounts is true, the Book will be returned with the accounts and groups.
71
+ *
72
+ * If includeGroups is true, the Book will be returned with the groups.
66
73
  *
67
74
  * @returns The retrieved Book
68
75
  */
69
- getBook(id, includeAccounts) {
76
+ getBook(id, includeAccounts, includeGroups) {
70
77
  return __awaiter(this, void 0, void 0, function* () {
71
- let book = yield BookService.loadBook(id, includeAccounts);
78
+ let book = yield BookService.loadBook(id, includeAccounts, includeGroups);
72
79
  return new Book(book);
73
80
  });
74
81
  }
@@ -26,13 +26,14 @@ export function loadBooks(query) {
26
26
  return booksJson;
27
27
  });
28
28
  }
29
- export function loadBook(bookId, loadAccounts) {
29
+ export function loadBook(bookId, loadAccounts, loadGroups) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  if (bookId == null) {
32
32
  throw new Error("Book id null!");
33
33
  }
34
34
  loadAccounts = loadAccounts || false;
35
- let response = yield new HttpBooksApiV5Request(bookId).addParam('loadAccounts', loadAccounts).fetch();
35
+ loadGroups = loadGroups || false;
36
+ let response = yield new HttpBooksApiV5Request(bookId).addParam('loadAccounts', loadAccounts).addParam('loadGroups', loadGroups).fetch();
36
37
  return response.data;
37
38
  });
38
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",