remult 0.18.1-exp.7 → 0.18.1-exp.8

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.
@@ -84,11 +84,6 @@ export interface queuedJobInfo {
84
84
  setResult(result: any): void;
85
85
  setProgress(progress: number): void;
86
86
  }
87
- export interface ApiActionResponse {
88
- error(error: any): void;
89
- success(result: any): void;
90
- progress(progress: number): void;
91
- }
92
87
  export interface QueueStorage {
93
88
  createJob(url: string, userId: string): Promise<string>;
94
89
  getJobInfo(queuedJobId: string): Promise<queuedJobInfo>;
@@ -617,7 +617,11 @@ class inProcessQueueHandler {
617
617
  this.actions.get(url)(body, req, {
618
618
  error: error => job.setErrorResult(serializeError(error)),
619
619
  success: result => job.setResult(result),
620
- progress: progress => job.setProgress(progress)
620
+ progress: progress => job.setProgress(progress),
621
+ created: () => { throw Error("Created response not expected for queue"); },
622
+ deleted: () => { throw Error("deleted response not expected for queue"); },
623
+ notFound: () => { throw Error("notFound response not expected for queue"); },
624
+ forbidden: () => job.setErrorResult("Forbidden")
621
625
  });
622
626
  return id;
623
627
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.18.1-exp.7",
3
+ "version": "0.18.1-exp.8",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -84,11 +84,6 @@ export interface queuedJobInfo {
84
84
  setResult(result: any): void;
85
85
  setProgress(progress: number): void;
86
86
  }
87
- export interface ApiActionResponse {
88
- error(error: any): void;
89
- success(result: any): void;
90
- progress(progress: number): void;
91
- }
92
87
  export interface QueueStorage {
93
88
  createJob(url: string, userId: string): Promise<string>;
94
89
  getJobInfo(queuedJobId: string): Promise<queuedJobInfo>;
@@ -790,7 +790,11 @@ var inProcessQueueHandler = /** @class */ (function () {
790
790
  this.actions.get(url)(body, req, {
791
791
  error: function (error) { return job.setErrorResult(data_api_1.serializeError(error)); },
792
792
  success: function (result) { return job.setResult(result); },
793
- progress: function (progress) { return job.setProgress(progress); }
793
+ progress: function (progress) { return job.setProgress(progress); },
794
+ created: function () { throw Error("Created response not expected for queue"); },
795
+ deleted: function () { throw Error("deleted response not expected for queue"); },
796
+ notFound: function () { throw Error("notFound response not expected for queue"); },
797
+ forbidden: function () { return job.setErrorResult("Forbidden"); }
794
798
  });
795
799
  return [2 /*return*/, id];
796
800
  }