bkper-js 2.16.2 → 2.17.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 +6 -0
- package/lib/model/File.js +12 -3
- package/lib/service/file-service.js +6 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -2514,6 +2514,12 @@ export declare class File extends ResourceProperty<bkper.File> {
|
|
|
2514
2514
|
* @returns The created File object
|
|
2515
2515
|
*/
|
|
2516
2516
|
create(): Promise<File>;
|
|
2517
|
+
/**
|
|
2518
|
+
* Perform update File, applying pending changes.
|
|
2519
|
+
*
|
|
2520
|
+
* @returns The updated File object
|
|
2521
|
+
*/
|
|
2522
|
+
update(): Promise<File>;
|
|
2517
2523
|
}
|
|
2518
2524
|
|
|
2519
2525
|
/**
|
package/lib/model/File.js
CHANGED
|
@@ -131,9 +131,18 @@ export class File extends ResourceProperty {
|
|
|
131
131
|
*/
|
|
132
132
|
create() {
|
|
133
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
this.payload = yield FileService.createFile(this.book.getId(), this.payload, this.getConfig());
|
|
135
|
+
return this;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Perform update File, applying pending changes.
|
|
140
|
+
*
|
|
141
|
+
* @returns The updated File object
|
|
142
|
+
*/
|
|
143
|
+
update() {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
this.payload = yield FileService.updateFile(this.book.getId(), this.payload, this.getConfig());
|
|
137
146
|
return this;
|
|
138
147
|
});
|
|
139
148
|
}
|
|
@@ -20,4 +20,10 @@ export function getFile(bookId, id, config) {
|
|
|
20
20
|
return response.data;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
export function updateFile(bookId, file, config) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
let response = yield new HttpBooksApiV5Request(`${bookId}/files`, config).setMethod('PUT').setPayload(file).fetch();
|
|
26
|
+
return response.data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
23
29
|
//# 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.17.0",
|
|
4
4
|
"description": "Javascript client for Bkper REST API",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@bkper/bkper-api-types": "^5.
|
|
38
|
+
"@bkper/bkper-api-types": "^5.32.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"big.js": "^6.0.3",
|