ismx-nexo-node-app 0.4.37 → 0.4.39

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.
@@ -82,6 +82,7 @@ class BusinessServer extends Business_1.default {
82
82
  case 'json': return this.express.json();
83
83
  case 'xml': return this.express.xml();
84
84
  case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
85
+ case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
85
86
  default: return this.express.json();
86
87
  }
87
88
  })();
@@ -117,6 +118,7 @@ class BusinessServer extends Business_1.default {
117
118
  let indexParams = request.url.indexOf('?');
118
119
  let endpoint = indexParams > 0 ? request.url.substring(0, indexParams) : request.url;
119
120
  request.endpoint = !!endpoint ? endpoint : "/";
121
+ console.log(request.body.length);
120
122
  try {
121
123
  try {
122
124
  (_a = this.onRequest) === null || _a === void 0 ? void 0 : _a.call(this, request);
@@ -24,7 +24,7 @@ export declare class HttpResponse<T = any> {
24
24
  static ok<T = any>(content: T): HttpResponse<any>;
25
25
  static ko<T = any>(httpCode: number, content: T): HttpResponse<any>;
26
26
  }
27
- export type ServiceType = "json" | "xml" | 'stream';
27
+ export type ServiceType = "json" | "xml" | 'stream' | 'image';
28
28
  export default abstract class Service<Req, Res> {
29
29
  static readonly services: Service<any, any>[];
30
30
  readonly method: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.37",
3
+ "version": "0.4.39",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -29,7 +29,7 @@ export class HttpResponse<T = any> {
29
29
  }
30
30
  }
31
31
 
32
- export type ServiceType = "json" | "xml" | 'stream';
32
+ export type ServiceType = "json" | "xml" | 'stream' | 'image';
33
33
  export default abstract class Service<Req, Res>
34
34
  {
35
35
  public static readonly services: Service<any, any>[] = []
@@ -64,6 +64,7 @@ export default class BusinessServer extends Business
64
64
  case 'json': return this.express.json();
65
65
  case 'xml': return this.express.xml();
66
66
  case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
67
+ case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
67
68
  default: return this.express.json();
68
69
  }})();
69
70
 
@@ -90,6 +91,8 @@ export default class BusinessServer extends Business
90
91
  let endpoint = indexParams > 0 ? request.url.substring(0,indexParams) : request.url
91
92
  request.endpoint = !!endpoint ? endpoint : "/";
92
93
 
94
+ console.log(request.body.length);
95
+
93
96
  try {
94
97
  try { this.onRequest?.(request); } catch(e) { }
95
98
  response = await service.serve?.(request);