ismx-nexo-node-app 0.4.143 → 0.4.148
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/dist/js/api/utils/ColorUtils.js +2 -0
- package/dist/js/business/FormalLoopbackBusiness.js +5 -0
- package/dist/js/business/FormalProxyBusiness.js +5 -0
- package/dist/js/business/utils/NumberUtils.js +1 -1
- package/dist/types/business/FormalLoopbackBusiness.d.ts +2 -0
- package/dist/types/business/FormalProxyBusiness.d.ts +2 -0
- package/package.json +1 -1
- package/src/main/node/api/utils/ColorUtils.ts +1 -0
- package/src/main/node/business/FormalLoopbackBusiness.ts +5 -0
- package/src/main/node/business/FormalProxyBusiness.ts +6 -0
- package/src/main/node/business/utils/NumberUtils.ts +1 -1
|
@@ -48,6 +48,11 @@ class FormalLoopbackBusiness extends LoopbackBusiness_1.default {
|
|
|
48
48
|
return this.call(tag, 'GET', '/map', request);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
+
page(tag_1) {
|
|
52
|
+
return __awaiter(this, arguments, void 0, function* (tag, request = {}) {
|
|
53
|
+
return this.call(tag, 'GET', '/page', request);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
51
56
|
exist(tag_1) {
|
|
52
57
|
return __awaiter(this, arguments, void 0, function* (tag, request = {}) {
|
|
53
58
|
return this.call(tag, 'GET', '/exist', request);
|
|
@@ -43,6 +43,11 @@ class FormalProxyBusiness extends ProxyBusiness_1.default {
|
|
|
43
43
|
return this.call(tag, 'GET', '/keymap', request);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
page(tag_1) {
|
|
47
|
+
return __awaiter(this, arguments, void 0, function* (tag, request = {}) {
|
|
48
|
+
return this.call(tag, 'GET', '/page', request);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
46
51
|
map(tag_1) {
|
|
47
52
|
return __awaiter(this, arguments, void 0, function* (tag, request = {}) {
|
|
48
53
|
return this.call(tag, 'GET', '/map', request);
|
|
@@ -7,7 +7,7 @@ class NumberUtils {
|
|
|
7
7
|
static duration(seconds) {
|
|
8
8
|
if (seconds == null)
|
|
9
9
|
return null;
|
|
10
|
-
const truncated = Math.trunc(seconds);
|
|
10
|
+
const truncated = Math.trunc(seconds + 1);
|
|
11
11
|
const mins = Math.floor(truncated / 60);
|
|
12
12
|
const secs = truncated % 60;
|
|
13
13
|
const minsStr = mins.toString().padStart(2, '0');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpRequest } from "../api/Service";
|
|
2
2
|
import LoopbackBusiness from "./LoopbackBusiness";
|
|
3
|
+
import { Pagination } from "../index";
|
|
3
4
|
export default class FormalLoopbackBusiness extends LoopbackBusiness {
|
|
4
5
|
constructor();
|
|
5
6
|
get<Res>(tag: string, request?: HttpRequest): Promise<Res>;
|
|
@@ -12,6 +13,7 @@ export default class FormalLoopbackBusiness extends LoopbackBusiness {
|
|
|
12
13
|
map<Res>(tag: string, request?: HttpRequest): Promise<{
|
|
13
14
|
[key: string]: Res;
|
|
14
15
|
}>;
|
|
16
|
+
page<Res>(tag: string, request?: HttpRequest): Promise<Pagination<Res>>;
|
|
15
17
|
exist(tag: string, request?: HttpRequest): Promise<boolean>;
|
|
16
18
|
post<Res>(tag: string, request?: HttpRequest): Promise<Res>;
|
|
17
19
|
put<Res>(tag: string, request?: HttpRequest): Promise<Res>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpRequest } from "../api/Service";
|
|
2
2
|
import ProxyBusiness from "./ProxyBusiness";
|
|
3
|
+
import { Pagination } from "../index";
|
|
3
4
|
export default class FormalProxyBusiness extends ProxyBusiness {
|
|
4
5
|
constructor();
|
|
5
6
|
get<Res>(tag: string, request?: HttpRequest): Promise<Res>;
|
|
@@ -9,6 +10,7 @@ export default class FormalProxyBusiness extends ProxyBusiness {
|
|
|
9
10
|
keymap(tag: string, request?: HttpRequest): Promise<{
|
|
10
11
|
[key: string]: string;
|
|
11
12
|
}>;
|
|
13
|
+
page<Res>(tag: string, request?: HttpRequest): Promise<Pagination<Res>>;
|
|
12
14
|
map<Res>(tag: string, request?: HttpRequest): Promise<{
|
|
13
15
|
[key: string]: Res;
|
|
14
16
|
}>;
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import fetch from "node-fetch";
|
|
|
6
6
|
import LoopbackBusiness from "./LoopbackBusiness";
|
|
7
7
|
import RepositoryRestFormal from "../repository/RepositoryRestFormal";
|
|
8
8
|
import RepositoryRest from "../repository/RepositoryRest";
|
|
9
|
+
import {Pagination} from "../index";
|
|
9
10
|
|
|
10
11
|
export default class FormalLoopbackBusiness extends LoopbackBusiness {
|
|
11
12
|
|
|
@@ -37,6 +38,10 @@ export default class FormalLoopbackBusiness extends LoopbackBusiness {
|
|
|
37
38
|
return this.call<{ [key:string]: Res }>(tag, 'GET', '/map', request);
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
async page<Res>(tag: string, request: HttpRequest = {}): Promise<Pagination<Res>> {
|
|
42
|
+
return this.call<Pagination<Res>>(tag, 'GET', '/page', request);
|
|
43
|
+
}
|
|
44
|
+
|
|
40
45
|
async exist(tag: string, request: HttpRequest = {}): Promise<boolean> {
|
|
41
46
|
return this.call<boolean>(tag, 'GET', '/exist', request);
|
|
42
47
|
}
|
|
@@ -4,6 +4,7 @@ import {Wrapper} from "../api/ServiceRestFormal";
|
|
|
4
4
|
import Business from "./Business";
|
|
5
5
|
import fetch from "node-fetch";
|
|
6
6
|
import RepositoryRest from "../repository/RepositoryRest";
|
|
7
|
+
import {Pagination} from "../index";
|
|
7
8
|
|
|
8
9
|
export default class FormalProxyBusiness extends ProxyBusiness {
|
|
9
10
|
|
|
@@ -31,6 +32,10 @@ export default class FormalProxyBusiness extends ProxyBusiness {
|
|
|
31
32
|
return this.call<{ [key:string]: string }>(tag, 'GET', '/keymap', request);
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
async page<Res>(tag: string, request: HttpRequest = {}): Promise<Pagination<Res>> {
|
|
36
|
+
return this.call<Pagination<Res>>(tag, 'GET', '/page', request);
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
async map<Res>(tag: string, request: HttpRequest = {}): Promise<{ [key:string]: Res }> {
|
|
35
40
|
return this.call<{ [key:string]: Res }>(tag, 'GET', '/map', request);
|
|
36
41
|
}
|
|
@@ -55,6 +60,7 @@ export default class FormalProxyBusiness extends ProxyBusiness {
|
|
|
55
60
|
return this.deformalize(() => super.call<any, Wrapper<Res>>(tag, method, endpoint, request));
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
|
|
58
64
|
private async deformalize<Res>(call: () => Promise<fetch.Response>): Promise<Res> {
|
|
59
65
|
let result = await call();
|
|
60
66
|
if (result.ok) {
|
|
@@ -8,7 +8,7 @@ export default abstract class NumberUtils {
|
|
|
8
8
|
static duration(seconds: null | undefined): null;
|
|
9
9
|
static duration(seconds: number | null | undefined): string | null {
|
|
10
10
|
if (seconds == null) return null;
|
|
11
|
-
const truncated = Math.trunc(seconds);
|
|
11
|
+
const truncated = Math.trunc(seconds+1);
|
|
12
12
|
const mins = Math.floor(truncated / 60);
|
|
13
13
|
const secs = truncated % 60;
|
|
14
14
|
const minsStr = mins.toString().padStart(2, '0');
|