itrm-tools 1.0.39 → 1.0.41
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/api/APIRequest.d.ts +28 -3
- package/dist/api/APIRequest.js +43 -11
- package/dist/api/APIRequest.js.map +1 -1
- package/dist/api/APIRequestBuilder.d.ts +20 -0
- package/dist/api/APIRequestBuilder.js +15 -0
- package/dist/api/APIRequestBuilder.js.map +1 -0
- package/dist/api/APIRouter.d.ts +1 -0
- package/dist/api/APIRouter.js +2 -0
- package/dist/api/APIRouter.js.map +1 -1
- package/dist/api/APIService.d.ts +7 -0
- package/dist/api/APIService.js +14 -0
- package/dist/api/APIService.js.map +1 -1
- package/dist/api/request/docs/DocumentationModels.d.ts +29 -0
- package/dist/api/request/docs/DocumentationModels.js +95 -0
- package/dist/api/request/docs/DocumentationModels.js.map +1 -0
- package/dist/api/request/docs/DocumentationRequest.d.ts +11 -0
- package/dist/api/request/docs/DocumentationRequest.js +115 -0
- package/dist/api/request/docs/DocumentationRequest.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/api/APIRequest.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Express, Request, Response, Router } from 'express';
|
|
2
2
|
import { ServerSentEventsManager } from './channel/ServerSentEventsManager';
|
|
3
|
+
import { DocDetails } from './APIRequestBuilder';
|
|
3
4
|
export declare enum RequestMethod {
|
|
4
5
|
GET = "GET",
|
|
5
6
|
POST = "POST",
|
|
@@ -12,23 +13,46 @@ export declare enum RequestContext {
|
|
|
12
13
|
PARAMS = "params",
|
|
13
14
|
QUERY = "query"
|
|
14
15
|
}
|
|
16
|
+
export declare enum RequestParameterType {
|
|
17
|
+
STRING = "string",
|
|
18
|
+
NUMBER = "number",
|
|
19
|
+
BOOLEAN = "boolean",
|
|
20
|
+
ANY = "any"
|
|
21
|
+
}
|
|
22
|
+
export declare interface IProperties {
|
|
23
|
+
name: string;
|
|
24
|
+
type: RequestParameterType;
|
|
25
|
+
}
|
|
26
|
+
export declare interface IMissing {
|
|
27
|
+
missing: string[];
|
|
28
|
+
wrongType: string[];
|
|
29
|
+
}
|
|
15
30
|
export declare interface GroupedParameters {
|
|
16
31
|
context: RequestContext;
|
|
17
|
-
properties:
|
|
32
|
+
properties: IProperties[];
|
|
18
33
|
}
|
|
19
34
|
export declare interface APIRequestConfig {
|
|
20
35
|
path: string;
|
|
21
36
|
params: GroupedParameters[];
|
|
37
|
+
details?: DocDetails;
|
|
22
38
|
}
|
|
23
39
|
export declare abstract class APIRequest {
|
|
24
40
|
method: RequestMethod;
|
|
25
41
|
path: string;
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
details?: DocDetails;
|
|
43
|
+
protected params: GroupedParameters[];
|
|
44
|
+
protected bodyParams: GroupedParameters[];
|
|
28
45
|
constructor(method: RequestMethod, config: APIRequestConfig);
|
|
29
46
|
abstract addToApp(app: Express): void;
|
|
30
47
|
abstract addToRouter(router: Router): void;
|
|
31
48
|
abstract apply(req: Request, res: Response): Promise<any>;
|
|
49
|
+
getRequestDetails(): {
|
|
50
|
+
path: string;
|
|
51
|
+
method: RequestMethod;
|
|
52
|
+
params: GroupedParameters[];
|
|
53
|
+
details: DocDetails | undefined;
|
|
54
|
+
bodyParams: GroupedParameters[];
|
|
55
|
+
};
|
|
32
56
|
process(req: Request, res: Response): Promise<any>;
|
|
33
57
|
static buildKey(req: Request): string;
|
|
34
58
|
private checkParameters;
|
|
@@ -37,6 +61,7 @@ export declare abstract class APIRequest {
|
|
|
37
61
|
private checkItem;
|
|
38
62
|
private buildResponseMessage;
|
|
39
63
|
private buildMissingParametersMessage;
|
|
64
|
+
private buildMessage;
|
|
40
65
|
private findMissingParameters;
|
|
41
66
|
protected openSentServerEvents(res: Response): ServerSentEventsManager;
|
|
42
67
|
}
|
package/dist/api/APIRequest.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.APIRequest = exports.RequestContext = exports.RequestMethod = void 0;
|
|
12
|
+
exports.APIRequest = exports.RequestParameterType = exports.RequestContext = exports.RequestMethod = void 0;
|
|
13
13
|
const APIService_1 = require("./APIService");
|
|
14
14
|
const ServerSentEventsManager_1 = require("./channel/ServerSentEventsManager");
|
|
15
15
|
var RequestMethod;
|
|
@@ -26,13 +26,30 @@ var RequestContext;
|
|
|
26
26
|
RequestContext["PARAMS"] = "params";
|
|
27
27
|
RequestContext["QUERY"] = "query";
|
|
28
28
|
})(RequestContext = exports.RequestContext || (exports.RequestContext = {}));
|
|
29
|
+
var RequestParameterType;
|
|
30
|
+
(function (RequestParameterType) {
|
|
31
|
+
RequestParameterType["STRING"] = "string";
|
|
32
|
+
RequestParameterType["NUMBER"] = "number";
|
|
33
|
+
RequestParameterType["BOOLEAN"] = "boolean";
|
|
34
|
+
RequestParameterType["ANY"] = "any";
|
|
35
|
+
})(RequestParameterType = exports.RequestParameterType || (exports.RequestParameterType = {}));
|
|
29
36
|
class APIRequest {
|
|
30
37
|
constructor(method, config) {
|
|
31
38
|
this.method = method;
|
|
32
39
|
this.path = config.path;
|
|
33
40
|
this.params = config.params;
|
|
41
|
+
this.details = config.details;
|
|
34
42
|
this.bodyParams = config.params.filter(param => { return param.context === RequestContext.BODY; });
|
|
35
43
|
}
|
|
44
|
+
getRequestDetails() {
|
|
45
|
+
return {
|
|
46
|
+
path: this.path,
|
|
47
|
+
method: this.method,
|
|
48
|
+
params: this.params,
|
|
49
|
+
details: this.details,
|
|
50
|
+
bodyParams: this.bodyParams
|
|
51
|
+
};
|
|
52
|
+
}
|
|
36
53
|
process(req, res) {
|
|
37
54
|
var _a, _b, _c, _d;
|
|
38
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -87,24 +104,39 @@ class APIRequest {
|
|
|
87
104
|
return { status: 'Error', message: group.context + " was not found, check your express configuration" };
|
|
88
105
|
return result;
|
|
89
106
|
}
|
|
90
|
-
buildResponseMessage(response, group,
|
|
91
|
-
if (missing.length > 0)
|
|
92
|
-
return (response && response.blocked) ? response : { status: 'Error', message: this.buildMissingParametersMessage(group.context, missing), blocked: group.properties.length > missing.length };
|
|
107
|
+
buildResponseMessage(response, group, failures) {
|
|
108
|
+
if (failures.missing.length > 0 || failures.wrongType.length > 0)
|
|
109
|
+
return (response && response.blocked) ? response : { status: 'Error', message: this.buildMissingParametersMessage(group.context, failures.missing, failures.wrongType), blocked: group.properties.length > failures.missing.length };
|
|
93
110
|
return { status: 'OK', blocked: true };
|
|
94
111
|
}
|
|
95
|
-
buildMissingParametersMessage(context, missing) {
|
|
112
|
+
buildMissingParametersMessage(context, missing, wrongType) {
|
|
96
113
|
let message = "Parameters";
|
|
97
|
-
|
|
98
|
-
message += (
|
|
99
|
-
|
|
114
|
+
if (missing.length > 0) {
|
|
115
|
+
message += this.buildMessage(missing);
|
|
116
|
+
message += " were not found in " + context;
|
|
117
|
+
}
|
|
118
|
+
if (wrongType.length > 0) {
|
|
119
|
+
message += missing.length > 0 ? " and" : "";
|
|
120
|
+
message += this.buildMessage(wrongType);
|
|
121
|
+
message += " have invalid type ";
|
|
122
|
+
}
|
|
123
|
+
return message;
|
|
124
|
+
}
|
|
125
|
+
buildMessage(array) {
|
|
126
|
+
let message = "";
|
|
127
|
+
for (let i = 0; i < array.length; i++)
|
|
128
|
+
message += (i > 0 ? ", " : " ") + "'" + array[i] + "'";
|
|
100
129
|
return message;
|
|
101
130
|
}
|
|
102
131
|
findMissingParameters(context, properties) {
|
|
103
132
|
let missing = [];
|
|
133
|
+
let wrongType = [];
|
|
104
134
|
for (let property of properties)
|
|
105
|
-
if (!context.hasOwnProperty(property))
|
|
106
|
-
missing.push(property);
|
|
107
|
-
|
|
135
|
+
if (!context.hasOwnProperty(property.name))
|
|
136
|
+
missing.push(property.name);
|
|
137
|
+
else if (typeof context[property.name] !== property.type)
|
|
138
|
+
wrongType.push(property.name);
|
|
139
|
+
return { missing, wrongType };
|
|
108
140
|
}
|
|
109
141
|
openSentServerEvents(res) {
|
|
110
142
|
return new ServerSentEventsManager_1.ServerSentEventsManager(res);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIRequest.js","sourceRoot":"","sources":["../../src/api/APIRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAAoD;AACpD,+EAA4E;
|
|
1
|
+
{"version":3,"file":"APIRequest.js","sourceRoot":"","sources":["../../src/api/APIRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAAoD;AACpD,+EAA4E;AAG5E,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,kCAAiB,CAAA;AACrB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAED,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;AACnB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAED,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;IACjB,2CAAmB,CAAA;IACnB,mCAAW,CAAA;AACf,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAuBD,MAAsB,UAAU;IAO5B,YAAY,MAAqB,EAAE,MAAwB;QACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAA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,IAAI,CAAC,CAAC;iBAC3B,IAAI,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;gBACpD,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAClC,CAAC;IAES,oBAAoB,CAAC,GAAa;QACxC,OAAO,IAAI,iDAAuB,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;CACJ;AA9HD,gCA8HC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GroupedParameters } from "./APIRequest";
|
|
2
|
+
export declare interface ISamples {
|
|
3
|
+
status: number;
|
|
4
|
+
input: any;
|
|
5
|
+
output: any;
|
|
6
|
+
}
|
|
7
|
+
export declare interface DocDetails {
|
|
8
|
+
description: string;
|
|
9
|
+
samples: ISamples[];
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class APIRequestBuilder {
|
|
12
|
+
constructor();
|
|
13
|
+
abstract buildParams(): GroupedParameters[];
|
|
14
|
+
abstract buildDocDetails(): DocDetails;
|
|
15
|
+
buildApiRequestConfig(path: string): {
|
|
16
|
+
path: string;
|
|
17
|
+
params: GroupedParameters[];
|
|
18
|
+
details: DocDetails;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIRequestBuilder = void 0;
|
|
4
|
+
class APIRequestBuilder {
|
|
5
|
+
constructor() { }
|
|
6
|
+
buildApiRequestConfig(path) {
|
|
7
|
+
return {
|
|
8
|
+
path: path,
|
|
9
|
+
params: this.buildParams(),
|
|
10
|
+
details: this.buildDocDetails()
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.APIRequestBuilder = APIRequestBuilder;
|
|
15
|
+
//# sourceMappingURL=APIRequestBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIRequestBuilder.js","sourceRoot":"","sources":["../../src/api/APIRequestBuilder.ts"],"names":[],"mappings":";;;AAaA,MAAsB,iBAAiB;IAEnC,gBAAgB,CAAC;IAKV,qBAAqB,CAAC,IAAY;QACrC,OAAO;YACH,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE;YAC1B,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE;SAClC,CAAA;IACL,CAAC;CACJ;AAdD,8CAcC"}
|
package/dist/api/APIRouter.d.ts
CHANGED
package/dist/api/APIRouter.js
CHANGED
|
@@ -5,6 +5,7 @@ const express_1 = require("express");
|
|
|
5
5
|
const APIService_1 = require("./APIService");
|
|
6
6
|
class APIRouter {
|
|
7
7
|
constructor(path, options) {
|
|
8
|
+
this.linkedRequest = [];
|
|
8
9
|
this.path = path;
|
|
9
10
|
this.router = (0, express_1.Router)(options);
|
|
10
11
|
}
|
|
@@ -14,6 +15,7 @@ class APIRouter {
|
|
|
14
15
|
addRequest(request) {
|
|
15
16
|
APIService_1.ITRMAPIServiceGlobal.requests[request.method + "_" + this.path + request.path] = request;
|
|
16
17
|
request.addToRouter(this.router);
|
|
18
|
+
this.linkedRequest.push(request.method + "_" + this.path + request.path);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
exports.APIRouter = APIRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIRouter.js","sourceRoot":"","sources":["../../src/api/APIRouter.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAEhF,6CAAoD;AAEpD,MAAsB,SAAS;
|
|
1
|
+
{"version":3,"file":"APIRouter.js","sourceRoot":"","sources":["../../src/api/APIRouter.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAEhF,6CAAoD;AAEpD,MAAsB,SAAS;IAK3B,YAAY,IAAY,EAAE,OAAuB;QAF1C,kBAAa,GAAa,EAAE,CAAC;QAGhC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,EAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAEM,IAAI;QACP,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;IAEM,UAAU,CAAC,OAAmB;QACjC,iCAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QACzF,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC;CAGJ;AArBD,8BAqBC"}
|
package/dist/api/APIService.d.ts
CHANGED
|
@@ -30,6 +30,13 @@ export declare class APIService {
|
|
|
30
30
|
init(): void;
|
|
31
31
|
addRouter(router: APIRouter): void;
|
|
32
32
|
addRequest(request: APIRequest): void;
|
|
33
|
+
getServerInformation(): {
|
|
34
|
+
name: string;
|
|
35
|
+
port: string | number;
|
|
36
|
+
routers: any;
|
|
37
|
+
requests: any;
|
|
38
|
+
};
|
|
39
|
+
enableDocumentation(): void;
|
|
33
40
|
run(init: Function): Promise<APIServiceResponse>;
|
|
34
41
|
close(finish: Function): Promise<APIServiceResponse>;
|
|
35
42
|
}
|
package/dist/api/APIService.js
CHANGED
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.APIService = exports.ITRMAPIServiceGlobal = void 0;
|
|
16
16
|
const express_1 = __importDefault(require("express"));
|
|
17
|
+
const DocumentationRequest_1 = require("./request/docs/DocumentationRequest");
|
|
17
18
|
var ITRMAPIServiceGlobal;
|
|
18
19
|
(function (ITRMAPIServiceGlobal) {
|
|
19
20
|
ITRMAPIServiceGlobal.memory = {};
|
|
@@ -46,6 +47,19 @@ class APIService {
|
|
|
46
47
|
ITRMAPIServiceGlobal.requests[request.method + "_" + request.path] = request;
|
|
47
48
|
request.addToApp(this.app);
|
|
48
49
|
}
|
|
50
|
+
getServerInformation() {
|
|
51
|
+
return {
|
|
52
|
+
name: this.name,
|
|
53
|
+
port: this.port,
|
|
54
|
+
routers: ITRMAPIServiceGlobal.routers,
|
|
55
|
+
requests: ITRMAPIServiceGlobal.requests
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
enableDocumentation() {
|
|
59
|
+
const swaggerUi = require('swagger-ui-express');
|
|
60
|
+
const documentationRequest = new DocumentationRequest_1.DocumentationRequest();
|
|
61
|
+
this.app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(documentationRequest.init()));
|
|
62
|
+
}
|
|
49
63
|
run(init) {
|
|
50
64
|
return new Promise((resolve, reject) => {
|
|
51
65
|
this.server = this.app.listen(this.port, () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../src/api/APIService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA8D;
|
|
1
|
+
{"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../src/api/APIService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA8D;AAI9D,8EAA2E;AAE3E,IAAiB,oBAAoB,CAOpC;AAPD,WAAiB,oBAAoB;IACtB,2BAAM,GAAQ,EAAE,CAAC;IACjB,4BAAO,GAA2B,SAAS,CAAC;IAC5C,6BAAQ,GAAQ,EAAE,CAAC;IACnB,4BAAO,GAAQ,EAAE,CAAC;IAClB,8BAAS,GAAa,EAAE,CAAC;IACzB,0BAAK,GAAQ,EAAE,CAAC;A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b,CAAC,CAAC;gBACP,IAAI;oBACA,MAAM,MAAM,EAAE,CAAC;oBACf,OAAO,CAAC;wBACJ,MAAM,EAAE,IAAI;wBACZ,OAAO,EAAE,wBAAwB;qBACpC,CAAC,CAAC;iBACN;gBAAC,OAAO,GAAQ,EAAE;oBACf,MAAM,CAAC;wBACH,MAAM,EAAE,OAAO;wBACf,OAAO,EAAE,8CAA8C;wBACvD,KAAK,EAAE,GAAG;qBACb,CAAC,CAAC;iBACN;YACL,CAAC,CAAA,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAzFD,gCAyFC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare let defaultDocumentationSchema: {
|
|
2
|
+
openapi: string;
|
|
3
|
+
info: {
|
|
4
|
+
title: string;
|
|
5
|
+
version: string;
|
|
6
|
+
description: string;
|
|
7
|
+
contact: {};
|
|
8
|
+
};
|
|
9
|
+
servers: {
|
|
10
|
+
url: string;
|
|
11
|
+
}[];
|
|
12
|
+
paths: {};
|
|
13
|
+
tags: {
|
|
14
|
+
name: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export declare let defaultBodySchema: {
|
|
18
|
+
content: {
|
|
19
|
+
"application/json": {
|
|
20
|
+
schema: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties: any;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const httpStatusCodes: {
|
|
28
|
+
[key: number]: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpStatusCodes = exports.defaultBodySchema = exports.defaultDocumentationSchema = void 0;
|
|
4
|
+
exports.defaultDocumentationSchema = {
|
|
5
|
+
openapi: "3.0.0",
|
|
6
|
+
info: {
|
|
7
|
+
title: "Documentation",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
description: "Documentation",
|
|
10
|
+
contact: {}
|
|
11
|
+
},
|
|
12
|
+
servers: [
|
|
13
|
+
{
|
|
14
|
+
url: "http://localhost:3000"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
paths: {},
|
|
18
|
+
tags: []
|
|
19
|
+
};
|
|
20
|
+
exports.defaultBodySchema = {
|
|
21
|
+
content: {
|
|
22
|
+
"application/json": {
|
|
23
|
+
schema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.httpStatusCodes = {
|
|
31
|
+
100: 'Continue',
|
|
32
|
+
101: 'Switching Protocols',
|
|
33
|
+
102: 'Processing',
|
|
34
|
+
103: 'Early Hints',
|
|
35
|
+
200: 'OK',
|
|
36
|
+
201: 'Created',
|
|
37
|
+
202: 'Accepted',
|
|
38
|
+
203: 'Non-Authoritative Information',
|
|
39
|
+
204: 'No Content',
|
|
40
|
+
205: 'Reset Content',
|
|
41
|
+
206: 'Partial Content',
|
|
42
|
+
207: 'Multi-Status',
|
|
43
|
+
208: 'Already Reported',
|
|
44
|
+
226: 'IM Used',
|
|
45
|
+
300: 'Multiple Choices',
|
|
46
|
+
301: 'Moved Permanently',
|
|
47
|
+
302: 'Found',
|
|
48
|
+
303: 'See Other',
|
|
49
|
+
304: 'Not Modified',
|
|
50
|
+
305: 'Use Proxy',
|
|
51
|
+
306: 'Switch Proxy',
|
|
52
|
+
307: 'Temporary Redirect',
|
|
53
|
+
308: 'Permanent Redirect',
|
|
54
|
+
400: 'Bad Request',
|
|
55
|
+
401: 'Unauthorized',
|
|
56
|
+
402: 'Payment Required',
|
|
57
|
+
403: 'Forbidden',
|
|
58
|
+
404: 'Not Found',
|
|
59
|
+
405: 'Method Not Allowed',
|
|
60
|
+
406: 'Not Acceptable',
|
|
61
|
+
407: 'Proxy Authentication Required',
|
|
62
|
+
408: 'Request Timeout',
|
|
63
|
+
409: 'Conflict',
|
|
64
|
+
410: 'Gone',
|
|
65
|
+
411: 'Length Required',
|
|
66
|
+
412: 'Precondition Failed',
|
|
67
|
+
413: 'Payload Too Large',
|
|
68
|
+
414: 'URI Too Long',
|
|
69
|
+
415: 'Unsupported Media Type',
|
|
70
|
+
416: 'Range Not Satisfiable',
|
|
71
|
+
417: 'Expectation Failed',
|
|
72
|
+
418: 'I\'m a Teapot',
|
|
73
|
+
421: 'Misdirected Request',
|
|
74
|
+
422: 'Unprocessable Entity',
|
|
75
|
+
423: 'Locked',
|
|
76
|
+
424: 'Failed Dependency',
|
|
77
|
+
425: 'Too Early',
|
|
78
|
+
426: 'Upgrade Required',
|
|
79
|
+
428: 'Precondition Required',
|
|
80
|
+
429: 'Too Many Requests',
|
|
81
|
+
431: 'Request Header Fields Too Large',
|
|
82
|
+
451: 'Unavailable For Legal Reasons',
|
|
83
|
+
500: 'Internal Server Error',
|
|
84
|
+
501: 'Not Implemented',
|
|
85
|
+
502: 'Bad Gateway',
|
|
86
|
+
503: 'Service Unavailable',
|
|
87
|
+
504: 'Gateway Timeout',
|
|
88
|
+
505: 'HTTP Version Not Supported',
|
|
89
|
+
506: 'Variant Also Negotiates',
|
|
90
|
+
507: 'Insufficient Storage',
|
|
91
|
+
508: 'Loop Detected',
|
|
92
|
+
510: 'Not Extended',
|
|
93
|
+
511: 'Network Authentication Required'
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=DocumentationModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentationModels.js","sourceRoot":"","sources":["../../../../src/api/request/docs/DocumentationModels.ts"],"names":[],"mappings":";;;AAAW,QAAA,0BAA0B,GAAG;IACpC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE;QACF,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,EAAE;KACd;IACD,OAAO,EAAE;QACL;YAC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nB,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,yBAAyB;IAC9B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,iCAAiC;CACzC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class DocumentationRequest {
|
|
2
|
+
constructor();
|
|
3
|
+
init(): any;
|
|
4
|
+
private createTagsObject;
|
|
5
|
+
private createPathsObject;
|
|
6
|
+
private buildRequest;
|
|
7
|
+
private buildBodyParams;
|
|
8
|
+
private buildParams;
|
|
9
|
+
private buildResponses;
|
|
10
|
+
private buildResponseProperties;
|
|
11
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentationRequest = void 0;
|
|
4
|
+
const DocumentationModels_1 = require("./DocumentationModels");
|
|
5
|
+
const APIService_1 = require("../../APIService");
|
|
6
|
+
class DocumentationRequest {
|
|
7
|
+
constructor() { }
|
|
8
|
+
init() {
|
|
9
|
+
var _a;
|
|
10
|
+
const { name, port, routers, requests } = (_a = APIService_1.ITRMAPIServiceGlobal.service) === null || _a === void 0 ? void 0 : _a.getServerInformation();
|
|
11
|
+
DocumentationModels_1.defaultDocumentationSchema.info.title = name;
|
|
12
|
+
DocumentationModels_1.defaultDocumentationSchema.servers = [{ url: `http://localhost:${port}` }];
|
|
13
|
+
DocumentationModels_1.defaultDocumentationSchema.tags = this.createTagsObject(routers, name);
|
|
14
|
+
DocumentationModels_1.defaultDocumentationSchema.paths = this.createPathsObject(requests, name);
|
|
15
|
+
return DocumentationModels_1.defaultDocumentationSchema;
|
|
16
|
+
}
|
|
17
|
+
createTagsObject(routers, name) {
|
|
18
|
+
let tags = [];
|
|
19
|
+
for (let router in routers)
|
|
20
|
+
tags.push({ name: router.replace("/", "") });
|
|
21
|
+
tags.push({ name: name });
|
|
22
|
+
return tags;
|
|
23
|
+
}
|
|
24
|
+
createPathsObject(requests, name) {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
let paths = {};
|
|
27
|
+
for (let request in requests) {
|
|
28
|
+
let buildRequest = this.buildRequest(requests[request], request, name);
|
|
29
|
+
paths[buildRequest.name] ? paths[buildRequest.name] : paths[buildRequest.name] = {};
|
|
30
|
+
paths[buildRequest.name][buildRequest.requestMethod] = {
|
|
31
|
+
tags: [buildRequest.tag],
|
|
32
|
+
operationId: buildRequest.requestMethod + " " + (buildRequest.name).toLowerCase(),
|
|
33
|
+
description: (_b = (_a = requests[request].details) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : (buildRequest.name).toLowerCase(),
|
|
34
|
+
summary: (_d = (_c = requests[request].details) === null || _c === void 0 ? void 0 : _c.description) !== null && _d !== void 0 ? _d : (buildRequest.name).toLowerCase(),
|
|
35
|
+
parameters: buildRequest.params,
|
|
36
|
+
responses: this.buildResponses(requests[request])
|
|
37
|
+
};
|
|
38
|
+
if ((buildRequest.requestMethod === "post" || buildRequest.requestMethod === "put") && requests[request].bodyParams.length > 0)
|
|
39
|
+
paths[buildRequest.name][buildRequest.requestMethod].requestBody = this.buildBodyParams(requests[request].bodyParams);
|
|
40
|
+
}
|
|
41
|
+
return paths;
|
|
42
|
+
}
|
|
43
|
+
buildRequest(request, requestName, serviceName) {
|
|
44
|
+
let name = requestName.replace(`${request.method}_`, "");
|
|
45
|
+
name = name.replace(/:([^/]+)/g, '{$1}');
|
|
46
|
+
let tag = name === request.path ? serviceName : name.split("/")[1];
|
|
47
|
+
let requestMethod = request.method.toLowerCase();
|
|
48
|
+
let buildParams = this.buildParams(request.getRequestDetails().params);
|
|
49
|
+
return { name, tag, requestMethod, params: buildParams };
|
|
50
|
+
}
|
|
51
|
+
buildBodyParams(bodyParams) {
|
|
52
|
+
let bodySchema = structuredClone(DocumentationModels_1.defaultBodySchema);
|
|
53
|
+
for (let param of bodyParams) {
|
|
54
|
+
let parameter = param.properties;
|
|
55
|
+
parameter.forEach((element) => {
|
|
56
|
+
bodySchema.content["application/json"].schema.properties[element.name] = { type: element.type };
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return bodySchema;
|
|
60
|
+
}
|
|
61
|
+
buildParams(params) {
|
|
62
|
+
let parameters = [];
|
|
63
|
+
if (params.length > 0) {
|
|
64
|
+
for (let param of params) {
|
|
65
|
+
let parameter = param.properties;
|
|
66
|
+
parameter.forEach((element) => {
|
|
67
|
+
if (param.context !== "body") {
|
|
68
|
+
let body = {
|
|
69
|
+
name: element.name,
|
|
70
|
+
in: param.context === "params" ? "path" : param.context,
|
|
71
|
+
schema: {
|
|
72
|
+
type: element.type
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
if (param.context === "params")
|
|
76
|
+
body.required = true;
|
|
77
|
+
parameters.push(body);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return parameters;
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
buildResponses(request) {
|
|
86
|
+
var _a;
|
|
87
|
+
let response = {};
|
|
88
|
+
if (request.details) {
|
|
89
|
+
for (let sample of request.details.samples) {
|
|
90
|
+
response[sample.status] = {
|
|
91
|
+
description: (_a = DocumentationModels_1.httpStatusCodes[sample.status]) !== null && _a !== void 0 ? _a : "response",
|
|
92
|
+
content: {
|
|
93
|
+
"application/json": {
|
|
94
|
+
schema: {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: this.buildResponseProperties(sample)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
else
|
|
105
|
+
return { "200": { description: "Successful response" } };
|
|
106
|
+
}
|
|
107
|
+
buildResponseProperties(sample) {
|
|
108
|
+
let properties = {};
|
|
109
|
+
for (let key in sample.output)
|
|
110
|
+
properties[key] = { type: typeof (sample.output[key]), example: sample.output[key] };
|
|
111
|
+
return properties;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.DocumentationRequest = DocumentationRequest;
|
|
115
|
+
//# sourceMappingURL=DocumentationRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentationRequest.js","sourceRoot":"","sources":["../../../../src/api/request/docs/DocumentationRequest.ts"],"names":[],"mappings":";;;AAAA,+DAAuG;AAEvG,iDAAwD;AAIxD,MAAa,oBAAoB;IAE7B,gBAAgB,CAAC;IAEV,IAAI;;QACP,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAA,iCAAoB,CAAC,OAAO,0CAAE,oBAAoB,EAAG,CAAC;QAChG,gDAA0B,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAC7C,gDAA0B,CAAC,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,oBAAoB,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3E,gDAA0B,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,C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OAAO,UAAU,CAAC;SACrB;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAEO,cAAc,CAAC,OAAmB;;QACtC,IAAI,QAAQ,GAAQ,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,OAAO,EAAE;YACjB,KAAK,IAAI,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE;gBACxC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;oBACtB,WAAW,EAAE,MAAA,qCAAe,CAAC,MAAM,CAAC,MAAM,CAAC,mCAAI,UAAU;oBACzD,OAAO,EAAE;wBACL,kBAAkB,EAAE;4BAChB,MAAM,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,UAAU,EAAE,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC;6BACnD;yBACJ;qBACJ;iBACJ,CAAC;aACL;YACD,OAAO,QAAQ,CAAC;SACnB;;YAEG,OAAO,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,EAAE,CAAA;IAChE,CAAC;IAEO,uBAAuB,CAAC,MAAgB;QAC5C,IAAI,UAAU,GAAmD,EAAE,CAAC;QACpE,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,MAAM;YACzB,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACzF,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AAhHD,oDAgHC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { HttpsAPIService as HttpsAPIService } from './api/HttpsAPIService';
|
|
|
3
3
|
export { ExpressConfiguration as ExpressConfiguration } from './api/ExpressConfiguration';
|
|
4
4
|
export { ExpressStandardConfiguration as ExpressStandardConfiguration } from './api/express/ExpressStandardConfiguration';
|
|
5
5
|
export { ExpressFileUploadingConfiguration as ExpressFileUploadingConfiguration } from './api/express/ExpressFileUploadingConfiguration';
|
|
6
|
-
export { APIRequest as APIRequest, RequestMethod as RequestMethod, RequestContext as RequestContext, GroupedParameters as GroupedParameters, APIRequestConfig as APIRequestConfig } from './api/APIRequest';
|
|
6
|
+
export { APIRequest as APIRequest, RequestMethod as RequestMethod, RequestContext as RequestContext, GroupedParameters as GroupedParameters, APIRequestConfig as APIRequestConfig, RequestParameterType as RequestParameterType } from './api/APIRequest';
|
|
7
|
+
export { APIRequestBuilder as APIRequestBuilder, DocDetails as DocDetails, ISamples as ISamples } from './api/APIRequestBuilder';
|
|
7
8
|
export { APIRouter as APIRouter } from './api/APIRouter';
|
|
8
9
|
export { SimpleAPIRouter as SimpleAPIRouter } from './api/route/SimpleAPIRouter';
|
|
9
10
|
export { RequestAxiosCall as RequestAxiosCall } from './api/request/RequestAxiosCall';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoingeckoPriceFinder = exports.Coin = exports.LoggerWebSocket = exports.LoggerManager = exports.Logger = exports.SequelizeModelManager = exports.SequelizeConnection = exports.MongooseModelManager = exports.SimpleCheckableAPIRouter = exports.CheckableAPIRouter = exports.CheckableFileUploadingPostRequest = exports.CheckablePutRequest = exports.CheckablePostRequest = exports.CheckableGetRequest = exports.CheckableDeleteRequest = exports.APIChecker = exports.CheckableAPIRequest = exports.DeleteRequest = exports.PutRequest = exports.PostRequest = exports.GetRequest = exports.RequestAxiosCall = exports.SimpleAPIRouter = exports.APIRouter = exports.RequestContext = exports.RequestMethod = exports.APIRequest = exports.ExpressFileUploadingConfiguration = exports.ExpressStandardConfiguration = exports.HttpsAPIService = exports.ITRMAPIServiceGlobal = exports.APIService = void 0;
|
|
3
|
+
exports.CoingeckoPriceFinder = exports.Coin = exports.LoggerWebSocket = exports.LoggerManager = exports.Logger = exports.SequelizeModelManager = exports.SequelizeConnection = exports.MongooseModelManager = exports.SimpleCheckableAPIRouter = exports.CheckableAPIRouter = exports.CheckableFileUploadingPostRequest = exports.CheckablePutRequest = exports.CheckablePostRequest = exports.CheckableGetRequest = exports.CheckableDeleteRequest = exports.APIChecker = exports.CheckableAPIRequest = exports.DeleteRequest = exports.PutRequest = exports.PostRequest = exports.GetRequest = exports.RequestAxiosCall = exports.SimpleAPIRouter = exports.APIRouter = exports.APIRequestBuilder = exports.RequestParameterType = exports.RequestContext = exports.RequestMethod = exports.APIRequest = exports.ExpressFileUploadingConfiguration = exports.ExpressStandardConfiguration = exports.HttpsAPIService = exports.ITRMAPIServiceGlobal = exports.APIService = void 0;
|
|
4
4
|
var APIService_1 = require("./api/APIService");
|
|
5
5
|
Object.defineProperty(exports, "APIService", { enumerable: true, get: function () { return APIService_1.APIService; } });
|
|
6
6
|
Object.defineProperty(exports, "ITRMAPIServiceGlobal", { enumerable: true, get: function () { return APIService_1.ITRMAPIServiceGlobal; } });
|
|
@@ -14,6 +14,9 @@ var APIRequest_1 = require("./api/APIRequest");
|
|
|
14
14
|
Object.defineProperty(exports, "APIRequest", { enumerable: true, get: function () { return APIRequest_1.APIRequest; } });
|
|
15
15
|
Object.defineProperty(exports, "RequestMethod", { enumerable: true, get: function () { return APIRequest_1.RequestMethod; } });
|
|
16
16
|
Object.defineProperty(exports, "RequestContext", { enumerable: true, get: function () { return APIRequest_1.RequestContext; } });
|
|
17
|
+
Object.defineProperty(exports, "RequestParameterType", { enumerable: true, get: function () { return APIRequest_1.RequestParameterType; } });
|
|
18
|
+
var APIRequestBuilder_1 = require("./api/APIRequestBuilder");
|
|
19
|
+
Object.defineProperty(exports, "APIRequestBuilder", { enumerable: true, get: function () { return APIRequestBuilder_1.APIRequestBuilder; } });
|
|
17
20
|
var APIRouter_1 = require("./api/APIRouter");
|
|
18
21
|
Object.defineProperty(exports, "APIRouter", { enumerable: true, get: function () { return APIRouter_1.APIRouter; } });
|
|
19
22
|
var SimpleAPIRouter_1 = require("./api/route/SimpleAPIRouter");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0L;AAA3I,wGAAA,UAAU,OAAc;AAA4C,kHAAA,oBAAoB,OAAwB;AAC/J,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;AAE3C,2FAA0H;AAAjH,4IAAA,4BAA4B,OAAgC;AACrE,qGAAyI;AAAhI,sJAAA,iCAAiC,OAAqC;AAC/E,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0L;AAA3I,wGAAA,UAAU,OAAc;AAA4C,kHAAA,oBAAoB,OAAwB;AAC/J,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;AAE3C,2FAA0H;AAAjH,4IAAA,4BAA4B,OAAgC;AACrE,qGAAyI;AAAhI,sJAAA,iCAAiC,OAAqC;AAC/E,+CAA0P;AAAjP,wGAAA,UAAU,OAAc;AAAE,2GAAA,aAAa,OAAiB;AAAE,4GAAA,cAAc,OAAkB;AAAgF,kHAAA,oBAAoB,OAAwB;AAC/N,6DAAiI;AAAxH,sHAAA,iBAAiB,OAAqB;AAC/C,6CAAyD;AAAhD,sGAAA,SAAS,OAAa;AAC/B,+DAAgF;AAAvE,kHAAA,eAAe,OAAmB;AAC3C,mEAAsF;AAA7E,oHAAA,gBAAgB,OAAoB;AAC7C,uDAAoE;AAA3D,wGAAA,UAAU,OAAc;AACjC,yDAAuE;AAA9D,0GAAA,WAAW,OAAe;AACnC,uDAAoE;AAA3D,wGAAA,UAAU,OAAc;AACjC,6DAA6E;AAApE,8GAAA,aAAa,OAAiB;AACvC,uEAA6F;AAApF,0HAAA,mBAAmB,OAAuB;AACnD,qDAAoL;AAA3F,wGAAA,UAAU,OAAc;AACjH,qFAA8G;AAArG,gIAAA,sBAAsB,OAA0B;AACzD,+EAAqG;AAA5F,0HAAA,mBAAmB,OAAuB;AACnD,iFAAwG;AAA/F,4HAAA,oBAAoB,OAAwB;AACrD,+EAAqG;AAA5F,0HAAA,mBAAmB,OAAuB;AACnD,2GAA+I;AAAtI,sJAAA,iCAAiC,OAAqC;AAC/E,qEAA0F;AAAjF,wHAAA,kBAAkB,OAAsB;AACjD,uFAAkH;AAAzG,oIAAA,wBAAwB,OAA4B;AAE7D,iFAAwG;AAA/F,4HAAA,oBAAoB,OAAwB;AACrD,gFAAsG;AAA7F,0HAAA,mBAAmB,OAAuB;AACnD,oFAA4G;AAAnG,8HAAA,qBAAqB,OAAyB;AAEvD,uCAAgD;AAAvC,gGAAA,MAAM,OAAU;AACzB,qDAAqE;AAA5D,8GAAA,aAAa,OAAiB;AACvC,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;AAE3C,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,8EAA6E;AAApE,4HAAA,oBAAoB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "itrm-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"link": "npm run build && npm link",
|
|
16
16
|
"test": "npm run build && jest --runInBand --detectOpenHandles",
|
|
17
17
|
"test-silent": "npm run build && jest --runInBand --detectOpenHandles --silent",
|
|
18
|
+
"test-watch": "npm run build && jest --watch --runInBand --detectOpenHandles",
|
|
19
|
+
"test-watch-start": "jest --watch --runInBand --detectOpenHandles",
|
|
18
20
|
"test-coverage": "npm run build && jest --runInBand --detectOpenHandles --silent --coverage"
|
|
19
21
|
},
|
|
20
22
|
"repository": {
|
|
@@ -32,10 +34,13 @@
|
|
|
32
34
|
"@types/jest": "^29.2.5",
|
|
33
35
|
"@types/multer": "^1.4.7",
|
|
34
36
|
"@types/node": "^18.11.18",
|
|
37
|
+
"@types/swagger-ui-express": "^4.1.3",
|
|
35
38
|
"@types/uuid": "^9.0.0",
|
|
36
39
|
"axios-mock-adapter": "^1.21.2",
|
|
37
|
-
"jest": "^29.
|
|
40
|
+
"jest": "^29.6.2",
|
|
41
|
+
"jest-puppeteer": "^9.0.0",
|
|
38
42
|
"mongodb-memory-server": "^8.11.1",
|
|
43
|
+
"puppeteer": "^20.9.0",
|
|
39
44
|
"rimraf": "^3.0.2",
|
|
40
45
|
"sqlite3": "^5.1.4",
|
|
41
46
|
"ts-jest": "^29.0.3",
|
|
@@ -58,6 +63,7 @@
|
|
|
58
63
|
"pg": "^8.8.0",
|
|
59
64
|
"pg-hstore": "^2.3.4",
|
|
60
65
|
"redis": "^4.5.1",
|
|
66
|
+
"swagger-ui-express": "^5.0.0",
|
|
61
67
|
"ws": "^8.12.0"
|
|
62
68
|
}
|
|
63
69
|
}
|