bkper-js 2.40.2 → 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 +6 -0
- package/lib/model/File.js +11 -0
- package/lib/service/file-service.js +6 -0
- package/package.json +1 -1
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
|
/**
|
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
|
|
@@ -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
|