itrm-tools 1.0.44 → 1.0.46

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.
Files changed (79) hide show
  1. package/dist/api/APIRequest.d.ts +67 -67
  2. package/dist/api/APIRequest.js +145 -145
  3. package/dist/api/APIRequest.js.map +1 -1
  4. package/dist/api/APIRequestBuilder.d.ts +20 -20
  5. package/dist/api/APIRequestBuilder.js +14 -14
  6. package/dist/api/APIRouter.d.ts +11 -11
  7. package/dist/api/APIRouter.js +21 -21
  8. package/dist/api/APIService.d.ts +42 -42
  9. package/dist/api/APIService.js +108 -108
  10. package/dist/api/APIService.js.map +1 -1
  11. package/dist/api/ExpressConfiguration.d.ts +4 -4
  12. package/dist/api/ExpressConfiguration.js +2 -2
  13. package/dist/api/HttpsAPIService.d.ts +10 -10
  14. package/dist/api/HttpsAPIService.js +47 -47
  15. package/dist/api/channel/ServerSentEventsManager.d.ts +8 -8
  16. package/dist/api/channel/ServerSentEventsManager.js +25 -25
  17. package/dist/api/check/APIChecker.d.ts +26 -26
  18. package/dist/api/check/APIChecker.js +40 -40
  19. package/dist/api/check/CheckableAPIRequest.d.ts +9 -9
  20. package/dist/api/check/CheckableAPIRequest.js +44 -44
  21. package/dist/api/check/CheckableAPIRouter.d.ts +11 -11
  22. package/dist/api/check/CheckableAPIRouter.js +48 -48
  23. package/dist/api/check/request/CheckableDeleteRequest.d.ts +8 -8
  24. package/dist/api/check/request/CheckableDeleteRequest.js +17 -17
  25. package/dist/api/check/request/CheckableFileUploadingPostRequest.d.ts +11 -11
  26. package/dist/api/check/request/CheckableFileUploadingPostRequest.js +22 -22
  27. package/dist/api/check/request/CheckableGetRequest.d.ts +8 -8
  28. package/dist/api/check/request/CheckableGetRequest.js +17 -17
  29. package/dist/api/check/request/CheckablePostRequest.d.ts +8 -8
  30. package/dist/api/check/request/CheckablePostRequest.js +17 -17
  31. package/dist/api/check/request/CheckablePutRequest.d.ts +8 -8
  32. package/dist/api/check/request/CheckablePutRequest.js +17 -17
  33. package/dist/api/check/route/SimpleCheckableAPIRouter.d.ts +7 -7
  34. package/dist/api/check/route/SimpleCheckableAPIRouter.js +25 -25
  35. package/dist/api/express/ExpressFileUploadingConfiguration.d.ts +6 -6
  36. package/dist/api/express/ExpressFileUploadingConfiguration.js +27 -27
  37. package/dist/api/express/ExpressStandardConfiguration.d.ts +11 -11
  38. package/dist/api/express/ExpressStandardConfiguration.js +29 -29
  39. package/dist/api/request/DeleteRequest.d.ts +7 -7
  40. package/dist/api/request/DeleteRequest.js +16 -16
  41. package/dist/api/request/GetRequest.d.ts +7 -7
  42. package/dist/api/request/GetRequest.js +16 -16
  43. package/dist/api/request/PostRequest.d.ts +7 -7
  44. package/dist/api/request/PostRequest.js +16 -16
  45. package/dist/api/request/PutRequest.d.ts +7 -7
  46. package/dist/api/request/PutRequest.js +16 -16
  47. package/dist/api/request/RequestAxiosCall.d.ts +7 -7
  48. package/dist/api/request/RequestAxiosCall.js +57 -57
  49. package/dist/api/request/docs/DocumentationModels.d.ts +47 -47
  50. package/dist/api/request/docs/DocumentationModels.js +114 -114
  51. package/dist/api/request/docs/DocumentationRequest.d.ts +12 -12
  52. package/dist/api/request/docs/DocumentationRequest.js +126 -126
  53. package/dist/api/route/SimpleAPIRouter.d.ts +6 -6
  54. package/dist/api/route/SimpleAPIRouter.js +24 -24
  55. package/dist/database/mongoose/MongooseModelManager.d.ts +47 -43
  56. package/dist/database/mongoose/MongooseModelManager.js +65 -65
  57. package/dist/database/mongoose/MongooseModelManager.js.map +1 -1
  58. package/dist/database/redis/RedisConnection.d.ts +7 -7
  59. package/dist/database/redis/RedisConnection.js +17 -17
  60. package/dist/database/redis/RedisModelManager.d.ts +10 -10
  61. package/dist/database/redis/RedisModelManager.js +17 -17
  62. package/dist/database/sequelize/SequelizeConnection.d.ts +16 -16
  63. package/dist/database/sequelize/SequelizeConnection.js +22 -22
  64. package/dist/database/sequelize/SequelizeModelManager.d.ts +26 -26
  65. package/dist/database/sequelize/SequelizeModelManager.js +58 -58
  66. package/dist/index.d.ts +31 -31
  67. package/dist/index.js +67 -67
  68. package/dist/log/Logger.d.ts +7 -7
  69. package/dist/log/Logger.js +28 -28
  70. package/dist/log/LoggerManager.d.ts +7 -7
  71. package/dist/log/LoggerManager.js +63 -63
  72. package/dist/log/LoggerWebSocket.d.ts +10 -10
  73. package/dist/log/LoggerWebSocket.js +15 -15
  74. package/dist/web3/Coin.d.ts +18 -18
  75. package/dist/web3/Coin.js +22 -22
  76. package/dist/web3/Coin.js.map +1 -1
  77. package/dist/web3/coingecko/CoingeckoPriceFinder.d.ts +10 -10
  78. package/dist/web3/coingecko/CoingeckoPriceFinder.js +88 -88
  79. package/package.json +25 -25
@@ -1,67 +1,67 @@
1
- import { Express, Request, Response, Router } from 'express';
2
- import { ServerSentEventsManager } from './channel/ServerSentEventsManager';
3
- import { DocDetails } from './APIRequestBuilder';
4
- export declare enum RequestMethod {
5
- GET = "GET",
6
- POST = "POST",
7
- PUT = "PUT",
8
- DELETE = "DELETE"
9
- }
10
- export declare enum RequestContext {
11
- BODY = "body",
12
- HEADERS = "headers",
13
- PARAMS = "params",
14
- QUERY = "query"
15
- }
16
- export declare enum RequestParameterType {
17
- STRING = "string",
18
- NUMBER = "number",
19
- BOOLEAN = "boolean",
20
- OBJECT = "object"
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
- }
30
- export declare interface GroupedParameters {
31
- context: RequestContext;
32
- properties: IProperties[];
33
- }
34
- export declare interface APIRequestConfig {
35
- path: string;
36
- params: GroupedParameters[];
37
- details?: DocDetails;
38
- }
39
- export declare abstract class APIRequest {
40
- method: RequestMethod;
41
- path: string;
42
- details?: DocDetails;
43
- protected params: GroupedParameters[];
44
- protected bodyParams: GroupedParameters[];
45
- constructor(method: RequestMethod, config: APIRequestConfig);
46
- abstract addToApp(app: Express): void;
47
- abstract addToRouter(router: Router): void;
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
- };
56
- process(req: Request, res: Response): Promise<any>;
57
- static buildKey(req: Request): string;
58
- private checkParameters;
59
- private checkValuesPropertyParameters;
60
- private hasValidValuesProperty;
61
- private checkItem;
62
- private buildResponseMessage;
63
- private buildMissingParametersMessage;
64
- private buildMessage;
65
- private findMissingParameters;
66
- protected openSentServerEvents(res: Response): ServerSentEventsManager;
67
- }
1
+ import { Express, Request, Response, Router } from 'express';
2
+ import { ServerSentEventsManager } from './channel/ServerSentEventsManager';
3
+ import { DocDetails } from './APIRequestBuilder';
4
+ export declare enum RequestMethod {
5
+ GET = "GET",
6
+ POST = "POST",
7
+ PUT = "PUT",
8
+ DELETE = "DELETE"
9
+ }
10
+ export declare enum RequestContext {
11
+ BODY = "body",
12
+ HEADERS = "headers",
13
+ PARAMS = "params",
14
+ QUERY = "query"
15
+ }
16
+ export declare enum RequestParameterType {
17
+ STRING = "string",
18
+ NUMBER = "number",
19
+ BOOLEAN = "boolean",
20
+ OBJECT = "object"
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
+ }
30
+ export declare interface GroupedParameters {
31
+ context: RequestContext;
32
+ properties: IProperties[];
33
+ }
34
+ export declare interface APIRequestConfig {
35
+ path: string;
36
+ params: GroupedParameters[];
37
+ details?: DocDetails;
38
+ }
39
+ export declare abstract class APIRequest {
40
+ method: RequestMethod;
41
+ path: string;
42
+ details?: DocDetails;
43
+ protected params: GroupedParameters[];
44
+ protected bodyParams: GroupedParameters[];
45
+ constructor(method: RequestMethod, config: APIRequestConfig);
46
+ abstract addToApp(app: Express): void;
47
+ abstract addToRouter(router: Router): void;
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
+ };
56
+ process(req: Request, res: Response): Promise<any>;
57
+ static buildKey(req: Request): string;
58
+ private checkParameters;
59
+ private checkValuesPropertyParameters;
60
+ private hasValidValuesProperty;
61
+ private checkItem;
62
+ private buildResponseMessage;
63
+ private buildMissingParametersMessage;
64
+ private buildMessage;
65
+ private findMissingParameters;
66
+ protected openSentServerEvents(res: Response): ServerSentEventsManager;
67
+ }
@@ -1,146 +1,146 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.APIRequest = exports.RequestParameterType = exports.RequestContext = exports.RequestMethod = void 0;
13
- const APIService_1 = require("./APIService");
14
- const ServerSentEventsManager_1 = require("./channel/ServerSentEventsManager");
15
- var RequestMethod;
16
- (function (RequestMethod) {
17
- RequestMethod["GET"] = "GET";
18
- RequestMethod["POST"] = "POST";
19
- RequestMethod["PUT"] = "PUT";
20
- RequestMethod["DELETE"] = "DELETE";
21
- })(RequestMethod = exports.RequestMethod || (exports.RequestMethod = {}));
22
- var RequestContext;
23
- (function (RequestContext) {
24
- RequestContext["BODY"] = "body";
25
- RequestContext["HEADERS"] = "headers";
26
- RequestContext["PARAMS"] = "params";
27
- RequestContext["QUERY"] = "query";
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["OBJECT"] = "object";
35
- })(RequestParameterType = exports.RequestParameterType || (exports.RequestParameterType = {}));
36
- class APIRequest {
37
- constructor(method, config) {
38
- this.method = method;
39
- this.path = config.path;
40
- this.params = config.params;
41
- this.details = config.details;
42
- this.bodyParams = config.params.filter(param => { return param.context === RequestContext.BODY; });
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
- }
53
- process(req, res) {
54
- var _a, _b, _c, _d;
55
- return __awaiter(this, void 0, void 0, function* () {
56
- try {
57
- let request = APIService_1.ITRMAPIServiceGlobal.requests[APIRequest.buildKey(req)];
58
- let check = request.checkParameters(req);
59
- for (let key of Object.keys(check))
60
- if (check[key].status !== 'OK')
61
- return yield res.status(400).json(check[key]);
62
- return yield request.apply(req, res);
63
- }
64
- catch (error) {
65
- return yield res.status((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 500).json({
66
- type: 'InternalRequestError',
67
- error: 'An error has ocurred when procesing the request',
68
- payload: (_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) !== null && _d !== void 0 ? _d : error
69
- });
70
- }
71
- });
72
- }
73
- static buildKey(req) {
74
- if (req.route.path.includes(req.baseUrl))
75
- return req.method + "_" + req.route.path;
76
- return req.method + "_" + req.baseUrl + req.route.path;
77
- }
78
- checkParameters(req) {
79
- let result = this.checkItem(req, this.params);
80
- if (this.hasValidValuesProperty(req.body))
81
- result = this.checkValuesPropertyParameters(req);
82
- return result;
83
- }
84
- checkValuesPropertyParameters(req) {
85
- let result = {};
86
- for (let i = 0; i < req.body.values.length; i++) {
87
- result = this.checkItem({ body: req.body.values[i] }, this.bodyParams);
88
- if (result[RequestContext.BODY].status === 'Error') {
89
- result[RequestContext.BODY].message += ', item ' + (i + 1);
90
- return result;
91
- }
92
- }
93
- return result;
94
- }
95
- hasValidValuesProperty(context) {
96
- return context && context.values && Array.isArray(context.values);
97
- }
98
- checkItem(item, params) {
99
- let result = {};
100
- for (let group of params)
101
- if (item[group.context])
102
- result[group.context] = this.buildResponseMessage(result[group.context], group, this.findMissingParameters(item[group.context], group.properties));
103
- else
104
- return { status: 'Error', message: group.context + " was not found, check your express configuration" };
105
- return result;
106
- }
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 };
110
- return { status: 'OK', blocked: true };
111
- }
112
- buildMissingParametersMessage(context, missing, wrongType) {
113
- let message = "Parameters";
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] + "'";
129
- return message;
130
- }
131
- findMissingParameters(context, properties) {
132
- let missing = [];
133
- let wrongType = [];
134
- for (let property of properties)
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 };
140
- }
141
- openSentServerEvents(res) {
142
- return new ServerSentEventsManager_1.ServerSentEventsManager(res);
143
- }
144
- }
145
- exports.APIRequest = APIRequest;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.APIRequest = exports.RequestParameterType = exports.RequestContext = exports.RequestMethod = void 0;
13
+ const APIService_1 = require("./APIService");
14
+ const ServerSentEventsManager_1 = require("./channel/ServerSentEventsManager");
15
+ var RequestMethod;
16
+ (function (RequestMethod) {
17
+ RequestMethod["GET"] = "GET";
18
+ RequestMethod["POST"] = "POST";
19
+ RequestMethod["PUT"] = "PUT";
20
+ RequestMethod["DELETE"] = "DELETE";
21
+ })(RequestMethod || (exports.RequestMethod = RequestMethod = {}));
22
+ var RequestContext;
23
+ (function (RequestContext) {
24
+ RequestContext["BODY"] = "body";
25
+ RequestContext["HEADERS"] = "headers";
26
+ RequestContext["PARAMS"] = "params";
27
+ RequestContext["QUERY"] = "query";
28
+ })(RequestContext || (exports.RequestContext = RequestContext = {}));
29
+ var RequestParameterType;
30
+ (function (RequestParameterType) {
31
+ RequestParameterType["STRING"] = "string";
32
+ RequestParameterType["NUMBER"] = "number";
33
+ RequestParameterType["BOOLEAN"] = "boolean";
34
+ RequestParameterType["OBJECT"] = "object";
35
+ })(RequestParameterType || (exports.RequestParameterType = RequestParameterType = {}));
36
+ class APIRequest {
37
+ constructor(method, config) {
38
+ this.method = method;
39
+ this.path = config.path;
40
+ this.params = config.params;
41
+ this.details = config.details;
42
+ this.bodyParams = config.params.filter(param => { return param.context === RequestContext.BODY; });
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
+ }
53
+ process(req, res) {
54
+ var _a, _b, _c, _d;
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ try {
57
+ let request = APIService_1.ITRMAPIServiceGlobal.requests[APIRequest.buildKey(req)];
58
+ let check = request.checkParameters(req);
59
+ for (let key of Object.keys(check))
60
+ if (check[key].status !== 'OK')
61
+ return yield res.status(400).json(check[key]);
62
+ return yield request.apply(req, res);
63
+ }
64
+ catch (error) {
65
+ return yield res.status((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 500).json({
66
+ type: 'InternalRequestError',
67
+ error: 'An error has ocurred when procesing the request',
68
+ payload: (_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) !== null && _d !== void 0 ? _d : error
69
+ });
70
+ }
71
+ });
72
+ }
73
+ static buildKey(req) {
74
+ if (req.route.path.includes(req.baseUrl))
75
+ return req.method + "_" + req.route.path;
76
+ return req.method + "_" + req.baseUrl + req.route.path;
77
+ }
78
+ checkParameters(req) {
79
+ let result = this.checkItem(req, this.params);
80
+ if (this.hasValidValuesProperty(req.body))
81
+ result = this.checkValuesPropertyParameters(req);
82
+ return result;
83
+ }
84
+ checkValuesPropertyParameters(req) {
85
+ let result = {};
86
+ for (let i = 0; i < req.body.values.length; i++) {
87
+ result = this.checkItem({ body: req.body.values[i] }, this.bodyParams);
88
+ if (result[RequestContext.BODY].status === 'Error') {
89
+ result[RequestContext.BODY].message += ', item ' + (i + 1);
90
+ return result;
91
+ }
92
+ }
93
+ return result;
94
+ }
95
+ hasValidValuesProperty(context) {
96
+ return context && context.values && Array.isArray(context.values);
97
+ }
98
+ checkItem(item, params) {
99
+ let result = {};
100
+ for (let group of params)
101
+ if (item[group.context])
102
+ result[group.context] = this.buildResponseMessage(result[group.context], group, this.findMissingParameters(item[group.context], group.properties));
103
+ else
104
+ return { status: 'Error', message: group.context + " was not found, check your express configuration" };
105
+ return result;
106
+ }
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 };
110
+ return { status: 'OK', blocked: true };
111
+ }
112
+ buildMissingParametersMessage(context, missing, wrongType) {
113
+ let message = "Parameters";
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] + "'";
129
+ return message;
130
+ }
131
+ findMissingParameters(context, properties) {
132
+ let missing = [];
133
+ let wrongType = [];
134
+ for (let property of properties)
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 };
140
+ }
141
+ openSentServerEvents(res) {
142
+ return new ServerSentEventsManager_1.ServerSentEventsManager(res);
143
+ }
144
+ }
145
+ exports.APIRequest = APIRequest;
146
146
  //# sourceMappingURL=APIRequest.js.map
@@ -1 +1 @@
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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CAAC,MAAM,EAAE,CAAC,EAAE;YACjC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAC3D,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,qBAAqB,CAAC,OAAY,EAAE,UAAyB;QACjE,IAAI,OAAO,GAAa,EAAE,CAAC;QAC3B,IAAI,SAAS,GAAa,EAAE,CAAC;QAC7B,KAAK,IAAI,QAAQ,IAAI,UAAU;YAC3B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACtC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,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"}
@@ -1,20 +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
- }
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
+ }
@@ -1,15 +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;
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
15
  //# sourceMappingURL=APIRequestBuilder.js.map
@@ -1,11 +1,11 @@
1
- import { NextFunction, Router, RouterOptions, Request, Response } from 'express';
2
- import { APIRequest } from './APIRequest';
3
- export declare abstract class APIRouter {
4
- path: string;
5
- router: Router;
6
- linkedRequest: string[];
7
- constructor(path: string, options?: RouterOptions);
8
- init(): void;
9
- addRequest(request: APIRequest): void;
10
- protected abstract runMiddleware(req: Request, res: Response, next: NextFunction): Promise<void | Response>;
11
- }
1
+ import { NextFunction, Router, RouterOptions, Request, Response } from 'express';
2
+ import { APIRequest } from './APIRequest';
3
+ export declare abstract class APIRouter {
4
+ path: string;
5
+ router: Router;
6
+ linkedRequest: string[];
7
+ constructor(path: string, options?: RouterOptions);
8
+ init(): void;
9
+ addRequest(request: APIRequest): void;
10
+ protected abstract runMiddleware(req: Request, res: Response, next: NextFunction): Promise<void | Response>;
11
+ }
@@ -1,22 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIRouter = void 0;
4
- const express_1 = require("express");
5
- const APIService_1 = require("./APIService");
6
- class APIRouter {
7
- constructor(path, options) {
8
- this.linkedRequest = [];
9
- this.path = path;
10
- this.router = (0, express_1.Router)(options);
11
- }
12
- init() {
13
- this.router.use(this.runMiddleware);
14
- }
15
- addRequest(request) {
16
- APIService_1.ITRMAPIServiceGlobal.requests[request.method + "_" + this.path + request.path] = request;
17
- request.addToRouter(this.router);
18
- this.linkedRequest.push(request.method + "_" + this.path + request.path);
19
- }
20
- }
21
- exports.APIRouter = APIRouter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIRouter = void 0;
4
+ const express_1 = require("express");
5
+ const APIService_1 = require("./APIService");
6
+ class APIRouter {
7
+ constructor(path, options) {
8
+ this.linkedRequest = [];
9
+ this.path = path;
10
+ this.router = (0, express_1.Router)(options);
11
+ }
12
+ init() {
13
+ this.router.use(this.runMiddleware);
14
+ }
15
+ addRequest(request) {
16
+ APIService_1.ITRMAPIServiceGlobal.requests[request.method + "_" + this.path + request.path] = request;
17
+ request.addToRouter(this.router);
18
+ this.linkedRequest.push(request.method + "_" + this.path + request.path);
19
+ }
20
+ }
21
+ exports.APIRouter = APIRouter;
22
22
  //# sourceMappingURL=APIRouter.js.map