bkper-js 2.40.2 → 2.41.1

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
@@ -2759,6 +2759,7 @@ export declare class EventList {
2759
2759
  export declare enum EventType {
2760
2760
  FILE_CREATED = "FILE_CREATED",
2761
2761
  FILE_UPDATED = "FILE_UPDATED",
2762
+ FILE_DELETED = "FILE_DELETED",
2762
2763
  TRANSACTION_CREATED = "TRANSACTION_CREATED",
2763
2764
  TRANSACTION_UPDATED = "TRANSACTION_UPDATED",
2764
2765
  TRANSACTION_DELETED = "TRANSACTION_DELETED",
@@ -2885,6 +2886,12 @@ export declare class File extends ResourceProperty<bkper.File> {
2885
2886
  * @returns The updated File object
2886
2887
  */
2887
2888
  update(): Promise<File>;
2889
+ /**
2890
+ * Perform delete File.
2891
+ *
2892
+ * @returns This File after deletion
2893
+ */
2894
+ remove(): Promise<File>;
2888
2895
  }
2889
2896
 
2890
2897
  /**
@@ -239,6 +239,7 @@ export var EventType;
239
239
  (function (EventType) {
240
240
  EventType["FILE_CREATED"] = "FILE_CREATED";
241
241
  EventType["FILE_UPDATED"] = "FILE_UPDATED";
242
+ EventType["FILE_DELETED"] = "FILE_DELETED";
242
243
  EventType["TRANSACTION_CREATED"] = "TRANSACTION_CREATED";
243
244
  EventType["TRANSACTION_UPDATED"] = "TRANSACTION_UPDATED";
244
245
  EventType["TRANSACTION_DELETED"] = "TRANSACTION_DELETED";
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.1",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",