bkper-js 2.16.2 → 2.17.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
@@ -2402,6 +2402,7 @@ export declare class EventList {
2402
2402
  */
2403
2403
  export declare enum EventType {
2404
2404
  FILE_CREATED = "FILE_CREATED",
2405
+ FILE_UPDATED = "FILE_UPDATED",
2405
2406
  TRANSACTION_CREATED = "TRANSACTION_CREATED",
2406
2407
  TRANSACTION_UPDATED = "TRANSACTION_UPDATED",
2407
2408
  TRANSACTION_DELETED = "TRANSACTION_DELETED",
@@ -2514,6 +2515,12 @@ export declare class File extends ResourceProperty<bkper.File> {
2514
2515
  * @returns The created File object
2515
2516
  */
2516
2517
  create(): Promise<File>;
2518
+ /**
2519
+ * Perform update File, applying pending changes.
2520
+ *
2521
+ * @returns The updated File object
2522
+ */
2523
+ update(): Promise<File>;
2517
2524
  }
2518
2525
 
2519
2526
  /**
@@ -196,6 +196,7 @@ export var BotResponseType;
196
196
  export var EventType;
197
197
  (function (EventType) {
198
198
  EventType["FILE_CREATED"] = "FILE_CREATED";
199
+ EventType["FILE_UPDATED"] = "FILE_UPDATED";
199
200
  EventType["TRANSACTION_CREATED"] = "TRANSACTION_CREATED";
200
201
  EventType["TRANSACTION_UPDATED"] = "TRANSACTION_UPDATED";
201
202
  EventType["TRANSACTION_DELETED"] = "TRANSACTION_DELETED";
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
- if (this.book) {
135
- this.payload = yield FileService.createFile(this.book.getId(), this.payload, this.getConfig());
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.16.2",
3
+ "version": "2.17.1",
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.30.0"
38
+ "@bkper/bkper-api-types": "^5.32.0"
39
39
  },
40
40
  "dependencies": {
41
41
  "big.js": "^6.0.3",