bkper-js 2.40.1 → 2.41.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/dist/bkper.min.js +2 -2
- package/dist/bkper.min.js.map +3 -3
- package/lib/index.d.ts +12 -0
- package/lib/model/File.js +11 -0
- package/lib/model/User.js +8 -0
- package/lib/service/file-service.js +6 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -2885,6 +2885,12 @@ export declare class File extends ResourceProperty<bkper.File> {
|
|
|
2885
2885
|
* @returns The updated File object
|
|
2886
2886
|
*/
|
|
2887
2887
|
update(): Promise<File>;
|
|
2888
|
+
/**
|
|
2889
|
+
* Perform delete File.
|
|
2890
|
+
*
|
|
2891
|
+
* @returns This File after deletion
|
|
2892
|
+
*/
|
|
2893
|
+
remove(): Promise<File>;
|
|
2888
2894
|
}
|
|
2889
2895
|
|
|
2890
2896
|
/**
|
|
@@ -4368,6 +4374,12 @@ export declare class User extends Resource<bkper.User> {
|
|
|
4368
4374
|
* @returns The User's hosted domain
|
|
4369
4375
|
*/
|
|
4370
4376
|
getHostedDomain(): string | undefined;
|
|
4377
|
+
/**
|
|
4378
|
+
* Gets the billing cycle of the User's current plan.
|
|
4379
|
+
*
|
|
4380
|
+
* @returns The User's plan billing cycle
|
|
4381
|
+
*/
|
|
4382
|
+
getPlanCycle(): 'MONTHLY' | 'YEARLY' | undefined;
|
|
4371
4383
|
/**
|
|
4372
4384
|
* Gets the username of the User.
|
|
4373
4385
|
*
|
package/lib/model/File.js
CHANGED
|
@@ -154,5 +154,16 @@ export class File extends ResourceProperty {
|
|
|
154
154
|
return this;
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Perform delete File.
|
|
159
|
+
*
|
|
160
|
+
* @returns This File after deletion
|
|
161
|
+
*/
|
|
162
|
+
remove() {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
this.payload = yield FileService.deleteFile(this.book.getId(), this.payload, this.getConfig());
|
|
165
|
+
return this;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
157
168
|
}
|
|
158
169
|
//# sourceMappingURL=File.js.map
|
package/lib/model/User.js
CHANGED
|
@@ -87,6 +87,14 @@ export class User extends Resource {
|
|
|
87
87
|
getHostedDomain() {
|
|
88
88
|
return this.payload.hostedDomain;
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Gets the billing cycle of the User's current plan.
|
|
92
|
+
*
|
|
93
|
+
* @returns The User's plan billing cycle
|
|
94
|
+
*/
|
|
95
|
+
getPlanCycle() {
|
|
96
|
+
return this.payload.planCycle;
|
|
97
|
+
}
|
|
90
98
|
/**
|
|
91
99
|
* Gets the username of the User.
|
|
92
100
|
*
|
|
@@ -40,4 +40,10 @@ export function updateFile(bookId, file, config) {
|
|
|
40
40
|
return response.data;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
export function deleteFile(bookId, file, config) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield new HttpBooksApiV5Request(`${bookId}/files/${file.id}`, config).setMethod('DELETE').fetch();
|
|
46
|
+
return response.data;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
43
49
|
//# sourceMappingURL=file-service.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.41.0",
|
|
4
4
|
"description": "Javascript client for Bkper REST API",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"release:major": "npm version major -m \"chore(release): v%s\""
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@bkper/bkper-api-types": "^5.43.
|
|
41
|
+
"@bkper/bkper-api-types": "^5.43.1",
|
|
42
42
|
"big.js": "^6.0.3",
|
|
43
43
|
"dayjs": "^1.10.3",
|
|
44
44
|
"luxon": "^1.25.0",
|