ismx-nexo-node-app 0.4.36 → 0.4.37
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/ServiceRest.js +2 -2
- package/dist/js/api/ServiceRestFormal.js +2 -2
- package/dist/types/api/ServiceRest.d.ts +2 -2
- package/dist/types/api/ServiceRestFormal.d.ts +2 -2
- package/package.json +1 -1
- package/src/main/node/api/ServiceRest.ts +3 -3
- package/src/main/node/api/ServiceRestFormal.ts +3 -3
|
@@ -34,8 +34,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
const Service_1 = __importStar(require("./Service"));
|
|
36
36
|
class ServiceRest extends Service_1.default {
|
|
37
|
-
constructor(method, endpoint = "/") {
|
|
38
|
-
super(method, endpoint);
|
|
37
|
+
constructor(method, endpoint = "/", type = "json") {
|
|
38
|
+
super(method, endpoint, type);
|
|
39
39
|
}
|
|
40
40
|
serve(request) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -39,8 +39,8 @@ const Service_1 = __importStar(require("./Service"));
|
|
|
39
39
|
const ServiceRest_1 = __importDefault(require("./ServiceRest"));
|
|
40
40
|
const BusinessErrors_1 = require("../business/BusinessErrors");
|
|
41
41
|
class ServiceRestFormal extends ServiceRest_1.default {
|
|
42
|
-
constructor(method, endpoint = "/") {
|
|
43
|
-
super(method, endpoint);
|
|
42
|
+
constructor(method, endpoint = "/", type = "json") {
|
|
43
|
+
super(method, endpoint, type);
|
|
44
44
|
}
|
|
45
45
|
serveRest(request) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Service, { HttpRequest, HttpResponse } from "./Service";
|
|
1
|
+
import Service, { HttpRequest, HttpResponse, ServiceType } from "./Service";
|
|
2
2
|
export default class ServiceRest<Req, Res> extends Service<Req, Res> {
|
|
3
|
-
constructor(method: string, endpoint?: string);
|
|
3
|
+
constructor(method: string, endpoint?: string, type?: ServiceType);
|
|
4
4
|
serve(request: HttpRequest<Req>): Promise<HttpResponse<Res>>;
|
|
5
5
|
serveRest(request: HttpRequest<Req>): Promise<HttpResponse<Res>>;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpRequest, HttpResponse } from "./Service";
|
|
1
|
+
import { HttpRequest, HttpResponse, ServiceType } from "./Service";
|
|
2
2
|
import ServiceRest from "./ServiceRest";
|
|
3
3
|
export interface Wrapper<T> {
|
|
4
4
|
code: string;
|
|
@@ -7,7 +7,7 @@ export interface Wrapper<T> {
|
|
|
7
7
|
debug?: string;
|
|
8
8
|
}
|
|
9
9
|
export default class ServiceRestFormal<Req = any, Res = any> extends ServiceRest<Req, Wrapper<Res>> {
|
|
10
|
-
constructor(method: string, endpoint?: string);
|
|
10
|
+
constructor(method: string, endpoint?: string, type?: ServiceType);
|
|
11
11
|
serveRest(request: HttpRequest<Req>): Promise<HttpResponse<Wrapper<Res>>>;
|
|
12
12
|
serveRestFormal(request: HttpRequest<Req>): Promise<HttpResponse<Res>>;
|
|
13
13
|
unwrap<Res>(request: Promise<HttpResponse<Wrapper<Res>>>): Promise<Res | undefined>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Service, {HttpRequest, HttpResponse} from "./Service";
|
|
1
|
+
import Service, {HttpRequest, HttpResponse, ServiceType} from "./Service";
|
|
2
2
|
|
|
3
3
|
export default class ServiceRest<Req, Res> extends Service<Req, Res>
|
|
4
4
|
{
|
|
5
|
-
constructor(method: string, endpoint: string = "/") {
|
|
6
|
-
super(method, endpoint);
|
|
5
|
+
constructor(method: string, endpoint: string = "/", type: ServiceType = "json") {
|
|
6
|
+
super(method, endpoint, type);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
async serve(request: HttpRequest<Req>): Promise<HttpResponse<Res>>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Service, {HttpRequest, HttpResponse} from "./Service";
|
|
1
|
+
import Service, {HttpRequest, HttpResponse, ServiceType} from "./Service";
|
|
2
2
|
import ServiceRest from "./ServiceRest";
|
|
3
3
|
import {FormalError} from "../business/BusinessErrors";
|
|
4
4
|
|
|
@@ -11,8 +11,8 @@ export interface Wrapper<T> {
|
|
|
11
11
|
|
|
12
12
|
export default class ServiceRestFormal<Req=any, Res=any> extends ServiceRest<Req, Wrapper<Res>>
|
|
13
13
|
{
|
|
14
|
-
constructor(method: string, endpoint: string = "/") {
|
|
15
|
-
super(method, endpoint);
|
|
14
|
+
constructor(method: string, endpoint: string = "/", type: ServiceType = "json") {
|
|
15
|
+
super(method, endpoint, type);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async serveRest(request: HttpRequest<Req>): Promise<HttpResponse<Wrapper<Res>>>
|