ismx-nexo-node-app 0.4.140 → 0.4.142
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.
|
@@ -81,10 +81,10 @@ class BusinessServer extends Business_1.default {
|
|
|
81
81
|
switch (service.type) {
|
|
82
82
|
case 'json': return this.express.json();
|
|
83
83
|
case 'xml': return this.express.xml();
|
|
84
|
-
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '
|
|
85
|
-
case 'image': return this.express.raw({ type: 'image/*', limit: '
|
|
86
|
-
case 'audio': return this.express.raw({ type: 'audio/*', limit: '
|
|
87
|
-
case '*': return this.express.raw({ type: () => true, limit: '
|
|
84
|
+
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '50mb' });
|
|
85
|
+
case 'image': return this.express.raw({ type: 'image/*', limit: '50mb' });
|
|
86
|
+
case 'audio': return this.express.raw({ type: 'audio/*', limit: '50mb' });
|
|
87
|
+
case '*': return this.express.raw({ type: () => true, limit: '50mb' });
|
|
88
88
|
default: return this.express.json();
|
|
89
89
|
}
|
|
90
90
|
})();
|
|
@@ -4,5 +4,12 @@ class NumberUtils {
|
|
|
4
4
|
static random(lower, upper) {
|
|
5
5
|
return Math.floor(Math.random() * (upper + 1 - lower)) + lower;
|
|
6
6
|
}
|
|
7
|
+
static duration(seconds) {
|
|
8
|
+
const mins = Math.floor(seconds / 60);
|
|
9
|
+
const secs = seconds % 60;
|
|
10
|
+
const minsStr = mins.toString().padStart(2, '0');
|
|
11
|
+
const secsStr = secs.toString().padStart(2, '0');
|
|
12
|
+
return `${minsStr}:${secsStr}`;
|
|
13
|
+
}
|
|
7
14
|
}
|
|
8
15
|
exports.default = NumberUtils;
|
package/package.json
CHANGED
|
@@ -63,10 +63,10 @@ export default class BusinessServer extends Business
|
|
|
63
63
|
const app = (() => { switch (service.type) {
|
|
64
64
|
case 'json': return this.express.json();
|
|
65
65
|
case 'xml': return this.express.xml();
|
|
66
|
-
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '
|
|
67
|
-
case 'image': return this.express.raw({ type: 'image/*', limit: '
|
|
68
|
-
case 'audio': return this.express.raw({ type: 'audio/*', limit: '
|
|
69
|
-
case '*': return this.express.raw({ type: () => true, limit: '
|
|
66
|
+
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '50mb' });
|
|
67
|
+
case 'image': return this.express.raw({ type: 'image/*', limit: '50mb' });
|
|
68
|
+
case 'audio': return this.express.raw({ type: 'audio/*', limit: '50mb' });
|
|
69
|
+
case '*': return this.express.raw({ type: () => true, limit: '50mb' });
|
|
70
70
|
default: return this.express.json();
|
|
71
71
|
}})();
|
|
72
72
|
|
|
@@ -3,4 +3,12 @@ export default abstract class NumberUtils {
|
|
|
3
3
|
static random(lower:number, upper:number) {
|
|
4
4
|
return Math.floor(Math.random() * (upper + 1 - lower)) + lower;
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
static duration(seconds: number): string {
|
|
8
|
+
const mins = Math.floor(seconds / 60);
|
|
9
|
+
const secs = seconds % 60;
|
|
10
|
+
const minsStr = mins.toString().padStart(2, '0');
|
|
11
|
+
const secsStr = secs.toString().padStart(2, '0');
|
|
12
|
+
return `${minsStr}:${secsStr}`;
|
|
13
|
+
}
|
|
6
14
|
}
|