alado 1.0.0
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/LICENSE +18 -0
- package/README.md +515 -0
- package/ROADMAP.md +0 -0
- package/accets/swagger-initializer.js +20 -0
- package/dist/alado-server/alado-server.d.ts +18 -0
- package/dist/alado-server/alado-server.js +66 -0
- package/dist/alado-server/alado-server.js.map +1 -0
- package/dist/alado-server/index.d.ts +1 -0
- package/dist/alado-server/index.js +6 -0
- package/dist/alado-server/index.js.map +1 -0
- package/dist/constants/content-type.d.ts +6 -0
- package/dist/constants/content-type.js +11 -0
- package/dist/constants/content-type.js.map +1 -0
- package/dist/constants/default-doc-object.d.ts +1 -0
- package/dist/constants/default-doc-object.js +122 -0
- package/dist/constants/default-doc-object.js.map +1 -0
- package/dist/constants/http-method.d.ts +10 -0
- package/dist/constants/http-method.js +15 -0
- package/dist/constants/http-method.js.map +1 -0
- package/dist/constants/http-status.d.ts +1 -0
- package/dist/constants/http-status.js +79 -0
- package/dist/constants/http-status.js.map +1 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +22 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/reg-ex.d.ts +5 -0
- package/dist/constants/reg-ex.js +9 -0
- package/dist/constants/reg-ex.js.map +1 -0
- package/dist/dto/alado-server-error.d.ts +4 -0
- package/dist/dto/alado-server-error.js +3 -0
- package/dist/dto/alado-server-error.js.map +1 -0
- package/dist/dto/alado-server-logger.d.ts +3 -0
- package/dist/dto/alado-server-logger.js +3 -0
- package/dist/dto/alado-server-logger.js.map +1 -0
- package/dist/dto/context.d.ts +11 -0
- package/dist/dto/context.js +3 -0
- package/dist/dto/context.js.map +1 -0
- package/dist/dto/index.d.ts +8 -0
- package/dist/dto/index.js +25 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/property-definition.d.ts +30 -0
- package/dist/dto/property-definition.js +3 -0
- package/dist/dto/property-definition.js.map +1 -0
- package/dist/dto/request-authentication.d.ts +9 -0
- package/dist/dto/request-authentication.js +3 -0
- package/dist/dto/request-authentication.js.map +1 -0
- package/dist/dto/request.d.ts +28 -0
- package/dist/dto/request.js +3 -0
- package/dist/dto/request.js.map +1 -0
- package/dist/dto/response.d.ts +7 -0
- package/dist/dto/response.js +3 -0
- package/dist/dto/response.js.map +1 -0
- package/dist/dto/route.d.ts +9 -0
- package/dist/dto/route.js +3 -0
- package/dist/dto/route.js.map +1 -0
- package/dist/factory/http-server-factory.d.ts +8 -0
- package/dist/factory/http-server-factory.js +16 -0
- package/dist/factory/http-server-factory.js.map +1 -0
- package/dist/factory/index.d.ts +2 -0
- package/dist/factory/index.js +19 -0
- package/dist/factory/index.js.map +1 -0
- package/dist/factory/open-api-doc-factory.d.ts +2 -0
- package/dist/factory/open-api-doc-factory.js +151 -0
- package/dist/factory/open-api-doc-factory.js.map +1 -0
- package/dist/helpers/accessor/get-property.d.ts +1 -0
- package/dist/helpers/accessor/get-property.js +38 -0
- package/dist/helpers/accessor/get-property.js.map +1 -0
- package/dist/helpers/accessor/index.d.ts +2 -0
- package/dist/helpers/accessor/index.js +19 -0
- package/dist/helpers/accessor/index.js.map +1 -0
- package/dist/helpers/accessor/set-property.d.ts +1 -0
- package/dist/helpers/accessor/set-property.js +45 -0
- package/dist/helpers/accessor/set-property.js.map +1 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.js +21 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/parser/authenticate.d.ts +2 -0
- package/dist/helpers/parser/authenticate.js +27 -0
- package/dist/helpers/parser/authenticate.js.map +1 -0
- package/dist/helpers/parser/body-parser.d.ts +3 -0
- package/dist/helpers/parser/body-parser.js +68 -0
- package/dist/helpers/parser/body-parser.js.map +1 -0
- package/dist/helpers/parser/index.d.ts +3 -0
- package/dist/helpers/parser/index.js +20 -0
- package/dist/helpers/parser/index.js.map +1 -0
- package/dist/helpers/parser/query-parser.d.ts +1 -0
- package/dist/helpers/parser/query-parser.js +24 -0
- package/dist/helpers/parser/query-parser.js.map +1 -0
- package/dist/helpers/service/clear-route.d.ts +1 -0
- package/dist/helpers/service/clear-route.js +16 -0
- package/dist/helpers/service/clear-route.js.map +1 -0
- package/dist/helpers/service/index.d.ts +2 -0
- package/dist/helpers/service/index.js +19 -0
- package/dist/helpers/service/index.js.map +1 -0
- package/dist/helpers/service/is-readable-stream.d.ts +3 -0
- package/dist/helpers/service/is-readable-stream.js +15 -0
- package/dist/helpers/service/is-readable-stream.js.map +1 -0
- package/dist/helpers/validate/alado-options/index.d.ts +1 -0
- package/dist/helpers/validate/alado-options/index.js +18 -0
- package/dist/helpers/validate/alado-options/index.js.map +1 -0
- package/dist/helpers/validate/alado-options/validate-alado-options.d.ts +2 -0
- package/dist/helpers/validate/alado-options/validate-alado-options.js +79 -0
- package/dist/helpers/validate/alado-options/validate-alado-options.js.map +1 -0
- package/dist/helpers/validate/context/index.d.ts +3 -0
- package/dist/helpers/validate/context/index.js +20 -0
- package/dist/helpers/validate/context/index.js.map +1 -0
- package/dist/helpers/validate/context/validate-context.d.ts +3 -0
- package/dist/helpers/validate/context/validate-context.js +165 -0
- package/dist/helpers/validate/context/validate-context.js.map +1 -0
- package/dist/helpers/validate/context/validate-request-files.d.ts +2 -0
- package/dist/helpers/validate/context/validate-request-files.js +33 -0
- package/dist/helpers/validate/context/validate-request-files.js.map +1 -0
- package/dist/helpers/validate/context/validate-request-part.d.ts +5 -0
- package/dist/helpers/validate/context/validate-request-part.js +46 -0
- package/dist/helpers/validate/context/validate-request-part.js.map +1 -0
- package/dist/helpers/validate/index.d.ts +2 -0
- package/dist/helpers/validate/index.js +19 -0
- package/dist/helpers/validate/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/options/alado-server-options.d.ts +12 -0
- package/dist/options/alado-server-options.js +3 -0
- package/dist/options/alado-server-options.js.map +1 -0
- package/dist/options/context-options.d.ts +8 -0
- package/dist/options/context-options.js +3 -0
- package/dist/options/context-options.js.map +1 -0
- package/dist/options/cors-options.d.ts +7 -0
- package/dist/options/cors-options.js +3 -0
- package/dist/options/cors-options.js.map +1 -0
- package/dist/options/index.d.ts +6 -0
- package/dist/options/index.js +23 -0
- package/dist/options/index.js.map +1 -0
- package/dist/options/open-api-doc.d.ts +10 -0
- package/dist/options/open-api-doc.js +3 -0
- package/dist/options/open-api-doc.js.map +1 -0
- package/dist/options/request-processor-options.d.ts +9 -0
- package/dist/options/request-processor-options.js +3 -0
- package/dist/options/request-processor-options.js.map +1 -0
- package/dist/options/router-options.d.ts +8 -0
- package/dist/options/router-options.js +3 -0
- package/dist/options/router-options.js.map +1 -0
- package/dist/request-processor/index.d.ts +1 -0
- package/dist/request-processor/index.js +18 -0
- package/dist/request-processor/index.js.map +1 -0
- package/dist/request-processor/request-processor.d.ts +11 -0
- package/dist/request-processor/request-processor.js +163 -0
- package/dist/request-processor/request-processor.js.map +1 -0
- package/dist/router/index.d.ts +1 -0
- package/dist/router/index.js +18 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/router.d.ts +14 -0
- package/dist/router/router.js +110 -0
- package/dist/router/router.js.map +1 -0
- package/package.json +47 -0
- package/postinstall.sh +3 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultOpenApiDocObject = void 0;
|
|
4
|
+
exports.defaultOpenApiDocObject = {
|
|
5
|
+
openapi: '3.0.0',
|
|
6
|
+
info: {
|
|
7
|
+
title: '',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
description: ''
|
|
10
|
+
},
|
|
11
|
+
servers: [],
|
|
12
|
+
paths: {},
|
|
13
|
+
components: {
|
|
14
|
+
schemas: {
|
|
15
|
+
Error: {
|
|
16
|
+
properties: {
|
|
17
|
+
message: {
|
|
18
|
+
type: 'string'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
securitySchemes: {},
|
|
24
|
+
responses: {
|
|
25
|
+
'204': {
|
|
26
|
+
description: 'No content'
|
|
27
|
+
},
|
|
28
|
+
'401': {
|
|
29
|
+
description: 'Unauthorized',
|
|
30
|
+
content: {
|
|
31
|
+
'application/json': {
|
|
32
|
+
schema: {
|
|
33
|
+
$ref: '#/components/schemas/Error',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
'402': {
|
|
39
|
+
description: 'Payment required',
|
|
40
|
+
content: {
|
|
41
|
+
'application/json': {
|
|
42
|
+
schema: {
|
|
43
|
+
$ref: '#/components/schemas/Error',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
'403': {
|
|
49
|
+
description: 'Forbidden',
|
|
50
|
+
content: {
|
|
51
|
+
'application/json': {
|
|
52
|
+
schema: {
|
|
53
|
+
$ref: '#/components/schemas/Error',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
'404': {
|
|
59
|
+
description: 'Not Found',
|
|
60
|
+
content: {
|
|
61
|
+
'application/json': {
|
|
62
|
+
schema: {
|
|
63
|
+
$ref: '#/components/schemas/Error',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
'405': {
|
|
69
|
+
description: 'Method Not Allowed',
|
|
70
|
+
content: {
|
|
71
|
+
'application/json': {
|
|
72
|
+
schema: {
|
|
73
|
+
$ref: '#/components/schemas/Error',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
'409': {
|
|
79
|
+
description: 'Conflict',
|
|
80
|
+
content: {
|
|
81
|
+
'application/json': {
|
|
82
|
+
schema: {
|
|
83
|
+
$ref: '#/components/schemas/Error',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
'413': {
|
|
89
|
+
description: 'Request entity too large',
|
|
90
|
+
content: {
|
|
91
|
+
'application/json': {
|
|
92
|
+
schema: {
|
|
93
|
+
$ref: '#/components/schemas/Error',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
'429': {
|
|
99
|
+
description: 'Too many requests',
|
|
100
|
+
content: {
|
|
101
|
+
'application/json': {
|
|
102
|
+
schema: {
|
|
103
|
+
$ref: '#/components/schemas/Error',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
'451': {
|
|
109
|
+
description: 'Unavailable For Legal Reasons',
|
|
110
|
+
content: {
|
|
111
|
+
'application/json': {
|
|
112
|
+
schema: {
|
|
113
|
+
$ref: '#/components/schemas/Error',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
security: []
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=default-doc-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-doc-object.js","sourceRoot":"","sources":["../../src/constants/default-doc-object.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAQ;IAC1C,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,EAAE;KAChB;IACD,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF;SACF;QACD,eAAe,EAAE,EAAE;QACnB,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,WAAW,EAAE,YAAY;aAC1B;YACD,KAAK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W,EAAE,+BAA+B;gBAC5C,OAAO,EAAE;oBACP,kBAAkB,EAAE;wBAClB,MAAM,EAAE;4BACN,IAAI,EAAE,4BAA4B;yBACnC;qBACF;iBACF;aACF;SACF;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpMethods = exports.HttpMethod = void 0;
|
|
4
|
+
var HttpMethod;
|
|
5
|
+
(function (HttpMethod) {
|
|
6
|
+
HttpMethod["GET"] = "GET";
|
|
7
|
+
HttpMethod["POST"] = "POST";
|
|
8
|
+
HttpMethod["PUT"] = "PUT";
|
|
9
|
+
HttpMethod["PATCH"] = "PATCH";
|
|
10
|
+
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
11
|
+
HttpMethod["HEAD"] = "HEAD";
|
|
12
|
+
HttpMethod["DELETE"] = "DELETE";
|
|
13
|
+
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
|
|
14
|
+
exports.httpMethods = Object.values(HttpMethod);
|
|
15
|
+
//# sourceMappingURL=http-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-method.js","sourceRoot":"","sources":["../../src/constants/http-method.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,+BAAiB,CAAA;AACnB,CAAC,EARW,UAAU,0BAAV,UAAU,QAQrB;AAEY,QAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const httpStatus: Record<string, Record<string, number>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpStatus = void 0;
|
|
4
|
+
exports.httpStatus = {
|
|
5
|
+
INFORMATIONAL_RESPONSE: {
|
|
6
|
+
CONTINUE: 100,
|
|
7
|
+
SWITCHING_PROTOCOLS: 101,
|
|
8
|
+
PROCESSING: 102,
|
|
9
|
+
EARLY_HINTS: 103
|
|
10
|
+
},
|
|
11
|
+
SUCCESS: {
|
|
12
|
+
OK: 200,
|
|
13
|
+
CREATED: 201,
|
|
14
|
+
ACCEPTED: 202,
|
|
15
|
+
NON_AUTHORITATIVE_INFORMATION: 203,
|
|
16
|
+
NO_CONTENT: 204,
|
|
17
|
+
RESET_CONTENT: 205,
|
|
18
|
+
PARTIAL_CONTENT: 206,
|
|
19
|
+
MULTI_STATUS: 207,
|
|
20
|
+
ALREADY_REPORTED: 208,
|
|
21
|
+
IM_USED: 226
|
|
22
|
+
},
|
|
23
|
+
REDIRECT: {
|
|
24
|
+
MULTIPLE_CHOICES: 300,
|
|
25
|
+
MOVED_PERMANENTLY: 301,
|
|
26
|
+
FOUND: 302,
|
|
27
|
+
SEE_OTHER: 303,
|
|
28
|
+
NOT_MODIFIED: 304,
|
|
29
|
+
USE_PROXY: 305,
|
|
30
|
+
SWITCH_PROXY: 306,
|
|
31
|
+
TEMPORARY_REDIRECT: 307,
|
|
32
|
+
PERMANENT_REDIRECT: 308
|
|
33
|
+
},
|
|
34
|
+
CLIENT_ERROR: {
|
|
35
|
+
BAD_REQUEST: 400,
|
|
36
|
+
UNAUTHORIZED: 401,
|
|
37
|
+
PAYMENT_REQUIRED: 402,
|
|
38
|
+
FORBIDDEN: 403,
|
|
39
|
+
NOT_FOUND: 404,
|
|
40
|
+
METHOD_NOT_ALLOWED: 405,
|
|
41
|
+
NOT_ACCEPTABLE: 406,
|
|
42
|
+
PROXY_AUTHENTICATION_REQUIRED: 407,
|
|
43
|
+
REQUEST_TIMEOUT: 408,
|
|
44
|
+
CONFLICT: 409,
|
|
45
|
+
GONE: 410,
|
|
46
|
+
LENGTH_REQUIRED: 411,
|
|
47
|
+
PRECONDITION_FAILED: 412,
|
|
48
|
+
PAYLOAD_TOO_LARGE: 413,
|
|
49
|
+
URI_TOO_LONG: 414,
|
|
50
|
+
UNSUPPORTED_MEDIA_TYPE: 415,
|
|
51
|
+
RANGE_NOT_SATISFIABLE: 416,
|
|
52
|
+
EXPECTATION_FAILED: 417,
|
|
53
|
+
I_AM_A_TEAPOT: 418,
|
|
54
|
+
MISDIRECTED_REQUEST: 421,
|
|
55
|
+
UNPROCESSABLE_CONTENT: 422,
|
|
56
|
+
LOCKED: 423,
|
|
57
|
+
FAILED_DEPENDENCY: 424,
|
|
58
|
+
TOO_EARLY: 425,
|
|
59
|
+
UPGRADE_REQUIRED: 426,
|
|
60
|
+
PRECONDITION_REQUIRED: 428,
|
|
61
|
+
TOO_MANY_REQUESTS: 429,
|
|
62
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
|
|
63
|
+
UNAVAILABLE_FOR_LEGAL_REASONS: 451
|
|
64
|
+
},
|
|
65
|
+
SERVER_ERROR: {
|
|
66
|
+
INTERNAL_SERVER_ERROR: 500,
|
|
67
|
+
NOT_IMPLEMENTED: 501,
|
|
68
|
+
BAD_GATEWAY: 502,
|
|
69
|
+
SERVICE_UNAVAILABLE: 503,
|
|
70
|
+
GATEWAY_TIMEOUT: 504,
|
|
71
|
+
HTTP_VERSION_NOT_SUPPORTED: 505,
|
|
72
|
+
VARIANT_ALSO_NEGOTIATES: 506,
|
|
73
|
+
INSUFFICIENT_STORAGE: 507,
|
|
74
|
+
LOOP_DETECTED: 508,
|
|
75
|
+
NOT_EXTENDED: 510,
|
|
76
|
+
NETWORK_AUTHENTICATION_REQUIRED: 511
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=http-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status.js","sourceRoot":"","sources":["../../src/constants/http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B,MAAM,EAAE,GAAG;QACX,iBAAiB,EAAE,GAAG;QACtB,SAAS,EAAE,GAAG;QACd,gBAAgB,EAAE,GAAG;QACrB,qBAAqB,EAAE,GAAG;QAC1B,iBAAiB,EAAE,GAAG;QACtB,+BAA+B,EAAE,GAAG;QACpC,6BAA6B,EAAE,GAAG;KACnC;IACD,YAAY,EAAE;QACZ,qBAAqB,EAAE,GAAG;QAC1B,eAAe,EAAE,GAAG;QACpB,WAAW,EAAE,GAAG;QAChB,mBAAmB,EAAE,GAAG;QACxB,eAAe,EAAE,GAAG;QACpB,0BAA0B,EAAE,GAAG;QAC/B,uBAAuB,EAAE,GAAG;QAC5B,oBAAoB,EAAE,GAAG;QACzB,aAAa,EAAE,GAAG;QAClB,YAAY,EAAE,GAAG;QACjB,+BAA+B,EAAE,GAAG;KACrC;CACF,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./content-type"), exports);
|
|
18
|
+
__exportStar(require("./default-doc-object"), exports);
|
|
19
|
+
__exportStar(require("./http-method"), exports);
|
|
20
|
+
__exportStar(require("./http-status"), exports);
|
|
21
|
+
__exportStar(require("./reg-ex"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B;AAC9B,2CAAyB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.multiSlashRegEx = exports.trimRouteRegex = exports.startRouteRegex = exports.outputPropertyRegex = exports.inputPropertyRegex = void 0;
|
|
4
|
+
exports.inputPropertyRegex = /^(headers|body|query|path)(\.\w+)$/;
|
|
5
|
+
exports.outputPropertyRegex = /^auth(\.\w+)?$/;
|
|
6
|
+
exports.startRouteRegex = /^\//;
|
|
7
|
+
exports.trimRouteRegex = /\/$/;
|
|
8
|
+
exports.multiSlashRegEx = /\/+/g;
|
|
9
|
+
//# sourceMappingURL=reg-ex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reg-ex.js","sourceRoot":"","sources":["../../src/constants/reg-ex.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,oCAAoC,CAAC;AAC1D,QAAA,mBAAmB,GAAG,gBAAgB,CAAC;AAEvC,QAAA,eAAe,GAAW,KAAK,CAAC;AAChC,QAAA,cAAc,GAAW,KAAK,CAAC;AAC/B,QAAA,eAAe,GAAW,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alado-server-error.js","sourceRoot":"","sources":["../../src/dto/alado-server-error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alado-server-logger.js","sourceRoot":"","sources":["../../src/dto/alado-server-logger.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContextOptions } from '../options';
|
|
2
|
+
import { RequestAuthentication } from './request-authentication';
|
|
3
|
+
import { Response } from './response';
|
|
4
|
+
import { ContextRequest } from './request';
|
|
5
|
+
export interface Context<T> {
|
|
6
|
+
title: string;
|
|
7
|
+
auth?: RequestAuthentication;
|
|
8
|
+
options: ContextOptions;
|
|
9
|
+
request: ContextRequest;
|
|
10
|
+
response: Response<T>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/dto/context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './context';
|
|
2
|
+
export * from './alado-server-error';
|
|
3
|
+
export * from './alado-server-logger';
|
|
4
|
+
export * from './request';
|
|
5
|
+
export * from './response';
|
|
6
|
+
export * from './property-definition';
|
|
7
|
+
export * from './request-authentication';
|
|
8
|
+
export * from './route';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./context"), exports);
|
|
18
|
+
__exportStar(require("./alado-server-error"), exports);
|
|
19
|
+
__exportStar(require("./alado-server-logger"), exports);
|
|
20
|
+
__exportStar(require("./request"), exports);
|
|
21
|
+
__exportStar(require("./response"), exports);
|
|
22
|
+
__exportStar(require("./property-definition"), exports);
|
|
23
|
+
__exportStar(require("./request-authentication"), exports);
|
|
24
|
+
__exportStar(require("./route"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,uDAAqC;AACrC,wDAAsC;AACtC,4CAA0B;AAC1B,6CAA2B;AAC3B,wDAAsC;AACtC,2DAAyC;AACzC,0CAAwB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AladoServerError } from './alado-server-error';
|
|
2
|
+
export interface PropertyDefinitionSchema {
|
|
3
|
+
type?: string;
|
|
4
|
+
$ref?: string;
|
|
5
|
+
enum?: any[];
|
|
6
|
+
items?: PropertyDefinitionSchema;
|
|
7
|
+
}
|
|
8
|
+
export interface PropertyDocumentation {
|
|
9
|
+
schema: PropertyDefinitionSchema;
|
|
10
|
+
description?: string;
|
|
11
|
+
example?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface PropertyValidation {
|
|
14
|
+
required?: boolean;
|
|
15
|
+
handler: (value: any) => boolean | Promise<boolean>;
|
|
16
|
+
error: AladoServerError;
|
|
17
|
+
}
|
|
18
|
+
export interface PropertyDefinition {
|
|
19
|
+
validation: PropertyValidation;
|
|
20
|
+
openApiDoc?: PropertyDocumentation;
|
|
21
|
+
transform?: (value: any) => any | Promise<any>;
|
|
22
|
+
}
|
|
23
|
+
export interface FilePropertyDefinition {
|
|
24
|
+
mimetypes: string[];
|
|
25
|
+
maxSize: number;
|
|
26
|
+
required: boolean;
|
|
27
|
+
mimetypeError: AladoServerError;
|
|
28
|
+
maxSizeError: AladoServerError;
|
|
29
|
+
requiredError: AladoServerError;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-definition.js","sourceRoot":"","sources":["../../src/dto/property-definition.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AladoServerError } from './alado-server-error';
|
|
2
|
+
export interface RequestAuthentication {
|
|
3
|
+
inputProperty: string;
|
|
4
|
+
outputProperty: string;
|
|
5
|
+
handler: (value: any) => any | Promise<any>;
|
|
6
|
+
handlerContext?: any;
|
|
7
|
+
required: boolean;
|
|
8
|
+
error: AladoServerError;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-authentication.js","sourceRoot":"","sources":["../../src/dto/request-authentication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { IncomingHttpHeaders } from 'http';
|
|
4
|
+
import { PassThrough } from 'stream';
|
|
5
|
+
import { FilePropertyDefinition, PropertyDefinition } from './property-definition';
|
|
6
|
+
import { HttpMethod } from '../constants';
|
|
7
|
+
export interface ContextRequest {
|
|
8
|
+
headers?: Record<string, PropertyDefinition>;
|
|
9
|
+
query?: Record<string, PropertyDefinition>;
|
|
10
|
+
path?: Record<string, PropertyDefinition>;
|
|
11
|
+
body?: Record<string, PropertyDefinition>;
|
|
12
|
+
files?: Record<string, FilePropertyDefinition>;
|
|
13
|
+
auth?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export interface Request {
|
|
16
|
+
method?: HttpMethod;
|
|
17
|
+
url?: string;
|
|
18
|
+
auth?: Record<string, any>;
|
|
19
|
+
path?: Record<string, string>;
|
|
20
|
+
headers?: IncomingHttpHeaders;
|
|
21
|
+
query?: Record<string, string | string[]>;
|
|
22
|
+
body?: Record<string, any>;
|
|
23
|
+
files?: Record<string, {
|
|
24
|
+
stream: PassThrough;
|
|
25
|
+
size: number;
|
|
26
|
+
mimetype: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/dto/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/dto/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/dto/route.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { SecureContextOptions } from 'tls';
|
|
5
|
+
import http from 'http';
|
|
6
|
+
import https from 'https';
|
|
7
|
+
import { RequestProcessorOptions } from '../options';
|
|
8
|
+
export declare function httpServerFactory(requestProcessorOptions: RequestProcessorOptions, ssl?: SecureContextOptions): https.Server<typeof http.IncomingMessage, typeof http.ServerResponse> | http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.httpServerFactory = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("http"));
|
|
8
|
+
const https_1 = __importDefault(require("https"));
|
|
9
|
+
const _request_processor_1 = require("../request-processor");
|
|
10
|
+
function httpServerFactory(requestProcessorOptions, ssl) {
|
|
11
|
+
const requestProcessor = new _request_processor_1.RequestProcessor(requestProcessorOptions);
|
|
12
|
+
const handler = requestProcessor.process.bind(requestProcessor);
|
|
13
|
+
return ssl ? https_1.default.createServer(ssl, handler) : http_1.default.createServer(handler);
|
|
14
|
+
}
|
|
15
|
+
exports.httpServerFactory = httpServerFactory;
|
|
16
|
+
//# sourceMappingURL=http-server-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-server-factory.js","sourceRoot":"","sources":["../../src/factory/http-server-factory.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,kDAA0B;AAE1B,2DAAsD;AAEtD,SAAgB,iBAAiB,CAAC,uBAAgD,EAAE,GAA0B;IAC5G,MAAM,gBAAgB,GAAqB,IAAI,qCAAgB,CAAC,uBAAuB,CAAC,CAAC;IACzF,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChE,OAAO,GAAG,CAAC,CAAC,CAAC,eAAK,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAC7E,CAAC;AAJD,8CAIC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./open-api-doc-factory"), exports);
|
|
18
|
+
__exportStar(require("./http-server-factory"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,wDAAsC"}
|