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/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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "2.40.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",