bkper-js 2.10.2 → 2.12.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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +1 -0
- package/lib/model/Backlog.js +29 -0
- package/lib/model/Book.js +12 -0
- package/lib/model/Integration.js +18 -0
- package/lib/service/event-service.js +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,9 @@ See what's new and what has changed in bkper-js
|
|
|
20
20
|
- Added `App.isInstallable`
|
|
21
21
|
- Added `App.isRepositoryPrivate`
|
|
22
22
|
- Added `Book.getCollaborators`
|
|
23
|
+
- Added `Book.getBacklog`
|
|
24
|
+
- Added `Backlog`
|
|
25
|
+
- Added `Backlog.getCount`
|
|
23
26
|
- Added `Collaborator`
|
|
24
27
|
- Added `Collaborator.json`
|
|
25
28
|
- Added `Collaborator.getId`
|
|
@@ -31,6 +34,9 @@ See what's new and what has changed in bkper-js
|
|
|
31
34
|
- Added `Collaborator.update`
|
|
32
35
|
- Added `Collaborator.remove`
|
|
33
36
|
- Added `Group.isBalanceVerified`
|
|
37
|
+
- Deprecated `Integration.getLogo`
|
|
38
|
+
- Added `Integration.getLogoUrl`
|
|
39
|
+
- Added `Integration.getLogoUrlDark`
|
|
34
40
|
- Replaced axios with native Fetch API for better compatibility with multiple environments
|
|
35
41
|
|
|
36
42
|
**August 2025**
|
package/lib/index.d.ts
CHANGED
|
@@ -640,6 +640,26 @@ export declare class App extends Resource<bkper.App> {
|
|
|
640
640
|
update(): Promise<App>;
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
+
/**
|
|
644
|
+
*
|
|
645
|
+
* This class defines the Backlog of a [[Book]].
|
|
646
|
+
*
|
|
647
|
+
* A Backlog is a list of pending tasks in a Book
|
|
648
|
+
*
|
|
649
|
+
* @public
|
|
650
|
+
*/
|
|
651
|
+
export declare class Backlog extends Resource<bkper.Backlog> {
|
|
652
|
+
private config?;
|
|
653
|
+
constructor(payload?: bkper.Backlog, config?: Config);
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Returns the number of pending tasks in this Backlog.
|
|
657
|
+
*
|
|
658
|
+
* @returns The number of tasks in the Backlog, or undefined if not available.
|
|
659
|
+
*/
|
|
660
|
+
getCount(): number | undefined;
|
|
661
|
+
}
|
|
662
|
+
|
|
643
663
|
/**
|
|
644
664
|
* Class that represents an [[Account]] or [[Group]] balance on a window of time (Day / Month / Year).
|
|
645
665
|
*
|
|
@@ -1844,6 +1864,12 @@ export declare class Book extends Resource<bkper.Book> {
|
|
|
1844
1864
|
* @returns Array of Collaborator objects
|
|
1845
1865
|
*/
|
|
1846
1866
|
getCollaborators(): Promise<Collaborator[]>;
|
|
1867
|
+
/**
|
|
1868
|
+
* Gets the Backlog of this Book.
|
|
1869
|
+
*
|
|
1870
|
+
* @returns The Backlog object
|
|
1871
|
+
*/
|
|
1872
|
+
getBacklog(): Promise<Backlog>;
|
|
1847
1873
|
}
|
|
1848
1874
|
|
|
1849
1875
|
/**
|
|
@@ -2868,8 +2894,22 @@ export declare class Integration extends Resource<bkper.Integration> {
|
|
|
2868
2894
|
* Gets the logo of the Integration.
|
|
2869
2895
|
*
|
|
2870
2896
|
* @returns The Integration's logo
|
|
2897
|
+
*
|
|
2898
|
+
* @deprecated Use getLogoUrl instead.
|
|
2871
2899
|
*/
|
|
2872
2900
|
getLogo(): string | undefined;
|
|
2901
|
+
/**
|
|
2902
|
+
* Gets the logo url of this Integration.
|
|
2903
|
+
*
|
|
2904
|
+
* @returns The logo url of this Integration
|
|
2905
|
+
*/
|
|
2906
|
+
getLogoUrl(): string | undefined;
|
|
2907
|
+
/**
|
|
2908
|
+
* Gets the logo url of this Integration in dark mode.
|
|
2909
|
+
*
|
|
2910
|
+
* @returns The logo url of this Integration in dark mode
|
|
2911
|
+
*/
|
|
2912
|
+
getLogoUrlDark(): string | undefined;
|
|
2873
2913
|
/**
|
|
2874
2914
|
* Gets the date when the Integration was added.
|
|
2875
2915
|
*
|
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { Account } from "./model/Account.js";
|
|
|
9
9
|
export { Agent } from "./model/Agent.js";
|
|
10
10
|
export { Amount } from "./model/Amount.js";
|
|
11
11
|
export { App } from "./model/App.js";
|
|
12
|
+
export { Backlog } from "./model/Backlog.js";
|
|
12
13
|
export { Balance } from "./model/Balance.js";
|
|
13
14
|
export { BalancesDataTableBuilder } from "./model/BalancesDataTableBuilder.js";
|
|
14
15
|
export { BalancesReport } from "./model/BalancesReport.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Resource } from "./Resource.js";
|
|
2
|
+
import { Bkper } from "./Bkper.js";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* This class defines the Backlog of a [[Book]].
|
|
6
|
+
*
|
|
7
|
+
* A Backlog is a list of pending tasks in a Book
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class Backlog extends Resource {
|
|
12
|
+
constructor(payload, config) {
|
|
13
|
+
super(payload);
|
|
14
|
+
this.config = config;
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
getConfig() {
|
|
18
|
+
return this.config || Bkper.globalConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns the number of pending tasks in this Backlog.
|
|
22
|
+
*
|
|
23
|
+
* @returns The number of tasks in the Backlog, or undefined if not available.
|
|
24
|
+
*/
|
|
25
|
+
getCount() {
|
|
26
|
+
return this.payload.count;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Backlog.js.map
|
package/lib/model/Book.js
CHANGED
|
@@ -33,6 +33,7 @@ import { BalancesReport } from "./BalancesReport.js";
|
|
|
33
33
|
import { App } from "./App.js";
|
|
34
34
|
import { Query } from "./Query.js";
|
|
35
35
|
import { Bkper } from "./Bkper.js";
|
|
36
|
+
import { Backlog } from "./Backlog.js";
|
|
36
37
|
/**
|
|
37
38
|
* A Book represents a [General Ledger](https://en.wikipedia.org/wiki/General_ledger) for a company or business, but can also represent a [Ledger](https://en.wikipedia.org/wiki/Ledger) for a project or department
|
|
38
39
|
*
|
|
@@ -1140,5 +1141,16 @@ export class Book extends Resource {
|
|
|
1140
1141
|
return this.collaborators;
|
|
1141
1142
|
});
|
|
1142
1143
|
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Gets the Backlog of this Book.
|
|
1146
|
+
*
|
|
1147
|
+
* @returns The Backlog object
|
|
1148
|
+
*/
|
|
1149
|
+
getBacklog() {
|
|
1150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1151
|
+
const backlogPayload = yield EventService.getBacklog(this, this.getConfig());
|
|
1152
|
+
return new Backlog(backlogPayload);
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1143
1155
|
}
|
|
1144
1156
|
//# sourceMappingURL=Book.js.map
|
package/lib/model/Integration.js
CHANGED
|
@@ -68,10 +68,28 @@ export class Integration extends Resource {
|
|
|
68
68
|
* Gets the logo of the Integration.
|
|
69
69
|
*
|
|
70
70
|
* @returns The Integration's logo
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use getLogoUrl instead.
|
|
71
73
|
*/
|
|
72
74
|
getLogo() {
|
|
73
75
|
return this.payload.logo;
|
|
74
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the logo url of this Integration.
|
|
79
|
+
*
|
|
80
|
+
* @returns The logo url of this Integration
|
|
81
|
+
*/
|
|
82
|
+
getLogoUrl() {
|
|
83
|
+
return this.payload.logo;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Gets the logo url of this Integration in dark mode.
|
|
87
|
+
*
|
|
88
|
+
* @returns The logo url of this Integration in dark mode
|
|
89
|
+
*/
|
|
90
|
+
getLogoUrlDark() {
|
|
91
|
+
return this.payload.logoDark;
|
|
92
|
+
}
|
|
75
93
|
/**
|
|
76
94
|
* Gets the date when the Integration was added.
|
|
77
95
|
*
|
|
@@ -44,4 +44,10 @@ export function replayEventsBatch(book, eventList, errorsOnly, config) {
|
|
|
44
44
|
yield request.fetch();
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
export function getBacklog(book, config) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const response = yield new HttpBooksApiV5Request(`${book.getId()}/events/backlog`, config).setMethod("GET").fetch();
|
|
50
|
+
return response.data;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
47
53
|
//# sourceMappingURL=event-service.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
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.
|
|
37
|
+
"@bkper/bkper-api-types": "^5.29.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"big.js": "^6.0.3",
|