ismx-nexo-node-app 0.3.33 → 0.3.34
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.
|
@@ -17,8 +17,6 @@ const ServiceRestFormal_1 = __importDefault(require("./ServiceRestFormal"));
|
|
|
17
17
|
class ServiceRestFormalTemplate {
|
|
18
18
|
constructor(resource, database, tableName) {
|
|
19
19
|
this.indexer = "id";
|
|
20
|
-
this.unwrap = ServiceRestFormal_1.default.unwrap;
|
|
21
|
-
this.fullSelect = ServiceRestFormal_1.default.fullSelect;
|
|
22
20
|
this.resource = resource;
|
|
23
21
|
this.database = database;
|
|
24
22
|
this.tableName = tableName;
|
|
@@ -141,5 +139,15 @@ class ServiceRestFormalTemplate {
|
|
|
141
139
|
return Service_1.HttpResponse.ok("not implemented yet");
|
|
142
140
|
});
|
|
143
141
|
}
|
|
142
|
+
unwrap(request) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
return ServiceRestFormal_1.default.unwrap(request);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
fullSelect(request, api) {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
return ServiceRestFormal_1.default.fullSelect(request, api);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
153
|
exports.default = ServiceRestFormalTemplate;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRequest, HttpResponse } from "./Service";
|
|
2
|
-
import ServiceRestFormal from "./ServiceRestFormal";
|
|
2
|
+
import ServiceRestFormal, { Wrapper } from "./ServiceRestFormal";
|
|
3
3
|
import { Pagination } from "../repository/RepositoryDatabase";
|
|
4
4
|
import RepositoryDatabase from "../repository/RepositoryDatabase";
|
|
5
5
|
export default class ServiceRestFormalTemplate<Model = any> {
|
|
@@ -39,6 +39,9 @@ export default class ServiceRestFormalTemplate<Model = any> {
|
|
|
39
39
|
protected servePost(request: HttpRequest<Model>): Promise<HttpResponse<Model>>;
|
|
40
40
|
protected servePut(request: HttpRequest<Model>): Promise<HttpResponse<Model>>;
|
|
41
41
|
protected serveDel(request: HttpRequest): Promise<HttpResponse<Model>>;
|
|
42
|
-
protected
|
|
43
|
-
protected
|
|
42
|
+
protected unwrap<Res>(request: Promise<HttpResponse<Wrapper<Res>>>): Promise<Res | undefined>;
|
|
43
|
+
protected fullSelect<Req, Res>(request: HttpRequest<Req>, api: {
|
|
44
|
+
select: ServiceRestFormal<Req, string[]>;
|
|
45
|
+
full: ServiceRestFormal<Req, Res>;
|
|
46
|
+
}): Promise<(Awaited<Res> | undefined)[]>;
|
|
44
47
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {HttpRequest, HttpResponse} from "./Service";
|
|
2
|
-
import ServiceRestFormal from "./ServiceRestFormal";
|
|
2
|
+
import ServiceRestFormal, {Wrapper} from "./ServiceRestFormal";
|
|
3
3
|
import {Pagination} from "../repository/RepositoryDatabase";
|
|
4
4
|
import RepositoryDatabase from "../repository/RepositoryDatabase";
|
|
5
5
|
|
|
@@ -138,6 +138,11 @@ export default class ServiceRestFormalTemplate<Model=any>
|
|
|
138
138
|
return HttpResponse.ok("not implemented yet");
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
protected
|
|
142
|
-
|
|
141
|
+
protected async unwrap<Res>(request: Promise<HttpResponse<Wrapper<Res>>>): Promise<Res | undefined> {
|
|
142
|
+
return ServiceRestFormal.unwrap<Res>(request);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
protected async fullSelect<Req, Res>(request: HttpRequest<Req>, api: { select: ServiceRestFormal<Req, string[]>, full: ServiceRestFormal<Req, Res> }) {
|
|
146
|
+
return ServiceRestFormal.fullSelect(request, api);
|
|
147
|
+
}
|
|
143
148
|
}
|