ismx-nexo-node-app 0.4.123 → 0.4.125

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.
@@ -83,6 +83,7 @@ class BusinessServer extends Business_1.default {
83
83
  case 'xml': return this.express.xml();
84
84
  case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
85
85
  case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
86
+ case 'audio': return this.express.raw({ type: 'audio/*', limit: '10mb' });
86
87
  case '*': return this.express.raw({ type: () => true, limit: '10mb' });
87
88
  default: return this.express.json();
88
89
  }
@@ -128,6 +128,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
129
  if (!this.tables[tableName])
130
130
  throw new Error(`table ${tableName} does not exist`);
131
+ if (objects.length === 0)
132
+ return [];
131
133
  let table = this.tables[tableName];
132
134
  let schema = table[0].schema;
133
135
  let columns = PostgresUtils_1.default.columns(table);
@@ -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' | 'image' | '*';
27
+ export type ServiceType = "json" | "xml" | 'stream' | 'image' | 'audio' | 'video' | '*';
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.123",
3
+ "version": "0.4.125",
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' | 'image' | '*';
32
+ export type ServiceType = "json" | "xml" | 'stream' | 'image' | 'audio' | 'video' | '*';
33
33
  export default abstract class Service<Req, Res>
34
34
  {
35
35
  public static readonly services: Service<any, any>[] = []
@@ -65,6 +65,7 @@ export default class BusinessServer extends Business
65
65
  case 'xml': return this.express.xml();
66
66
  case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
67
67
  case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
68
+ case 'audio': return this.express.raw({ type: 'audio/*', limit: '10mb' });
68
69
  case '*': return this.express.raw({ type: () => true, limit: '10mb' });
69
70
  default: return this.express.json();
70
71
  }})();
@@ -102,6 +102,8 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
102
102
  async addAll<T>(tableName: string, objects: ({[key:string]:Valuable }|any)[]): Promise<T[]>
103
103
  {
104
104
  if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
105
+ if (objects.length === 0) return [];
106
+
105
107
  let table = this.tables[tableName];
106
108
  let schema = table[0].schema;
107
109
  let columns = PostgresUtils.columns(table);