@asapjs/router 1.0.0-alpha.42 → 1.0.0-alpha.43
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/decorator/AutoInject.d.ts +2 -24
- package/dist/decorator/AutoInject.d.ts.map +1 -1
- package/dist/decorator/AutoInject.js +9 -31
- package/dist/decorator/AutoInject.js.map +1 -1
- package/dist/decorator/ErrorPayload.d.ts +1 -4
- package/dist/decorator/ErrorPayload.d.ts.map +1 -1
- package/dist/decorator/ErrorPayload.js +7 -14
- package/dist/decorator/ErrorPayload.js.map +1 -1
- package/dist/decorator/ResponsePayload.d.ts +1 -19
- package/dist/decorator/ResponsePayload.d.ts.map +1 -1
- package/dist/decorator/ResponsePayload.js +7 -29
- package/dist/decorator/ResponsePayload.js.map +1 -1
- package/dist/decorator/index.d.ts +6 -6
- package/dist/decorator/index.d.ts.map +1 -1
- package/dist/decorator/index.js +10 -13
- package/dist/decorator/index.js.map +1 -1
- package/dist/express/router.d.ts +25 -22
- package/dist/express/router.d.ts.map +1 -1
- package/dist/express/router.js +51 -408
- package/dist/express/router.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/middleware/errorHandler.d.ts +4 -1
- package/dist/middleware/errorHandler.d.ts.map +1 -1
- package/dist/middleware/errorHandler.js +14 -10
- package/dist/middleware/errorHandler.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +20 -30
- package/dist/plugin.js.map +1 -1
- package/dist/registry.d.ts +3 -18
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +10 -22
- package/dist/registry.js.map +1 -1
- package/dist/router/index.d.ts +21 -3
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +24 -122
- package/dist/router/index.js.map +1 -1
- package/dist/swagger/index.d.ts +2 -17
- package/dist/swagger/index.d.ts.map +1 -1
- package/dist/swagger/index.js +17 -222
- package/dist/swagger/index.js.map +1 -1
- package/dist/utils/defineMiddleware.js +1 -1
- package/dist/utils/defineMiddleware.js.map +1 -1
- package/dist/utils/generateSchemeRefWithName.d.ts +2 -2
- package/dist/utils/generateSchemeRefWithName.d.ts.map +1 -1
- package/dist/utils/generateSchemeRefWithName.js +4 -1
- package/dist/utils/generateSchemeRefWithName.js.map +1 -1
- package/dist/utils/wrapper.d.ts +16 -10
- package/dist/utils/wrapper.d.ts.map +1 -1
- package/dist/utils/wrapper.js +23 -84
- package/dist/utils/wrapper.js.map +1 -1
- package/package.json +21 -14
- package/dist/utils/registeredMiddlewares.d.ts +0 -4
- package/dist/utils/registeredMiddlewares.d.ts.map +0 -1
- package/dist/utils/registeredMiddlewares.js +0 -12
- package/dist/utils/registeredMiddlewares.js.map +0 -1
package/dist/swagger/index.js
CHANGED
|
@@ -1,225 +1,20 @@
|
|
|
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
45
|
-
var t = {};
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
47
|
-
t[p] = s[p];
|
|
48
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
49
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
50
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
51
|
-
t[p[i]] = s[p[i]];
|
|
52
|
-
}
|
|
53
|
-
return t;
|
|
54
|
-
};
|
|
55
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
|
-
};
|
|
58
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
exports.getSwaggerDataStatic = exports.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.swaggerScheme.push(data);
|
|
77
|
-
});
|
|
78
|
-
this.generateSwaggerData = (req) => {
|
|
79
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
80
|
-
try {
|
|
81
|
-
const config = (0, common_1.getConfig)();
|
|
82
|
-
this.swaggerData.info.title = ((_a = config === null || config === void 0 ? void 0 : config.swagger) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
83
|
-
this.swaggerData.info.version = ((_b = config === null || config === void 0 ? void 0 : config.swagger) === null || _b === void 0 ? void 0 : _b.version) || '';
|
|
84
|
-
this.swaggerData.info.description = ((_c = config === null || config === void 0 ? void 0 : config.swagger) === null || _c === void 0 ? void 0 : _c.description) || '';
|
|
85
|
-
this.swaggerData.components.securitySchemes.OAuthLogin.flows.password.tokenUrl =
|
|
86
|
-
((_d = config === null || config === void 0 ? void 0 : config.swagger) === null || _d === void 0 ? void 0 : _d.auth_url) || '';
|
|
87
|
-
this.swaggerData.servers = [
|
|
88
|
-
{
|
|
89
|
-
url: `${(_e = config === null || config === void 0 ? void 0 : config.swagger) === null || _e === void 0 ? void 0 : _e.scheme}://${req.headers.host}${(config === null || config === void 0 ? void 0 : config.basePath) ? `/${config === null || config === void 0 ? void 0 : config.basePath}` : ''}`,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
url: `${(_f = config === null || config === void 0 ? void 0 : config.swagger) === null || _f === void 0 ? void 0 : _f.scheme}://${(_g = config === null || config === void 0 ? void 0 : config.swagger) === null || _g === void 0 ? void 0 : _g.host}${(config === null || config === void 0 ? void 0 : config.basePath) ? `/${config === null || config === void 0 ? void 0 : config.basePath}` : ''}`,
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
this.generatePathsAndSchemes();
|
|
96
|
-
this.generatedSwaggerData = Object.assign({}, this.swaggerData);
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
common_1.logger.error('@router swagger.json generation failed', err, {
|
|
100
|
-
operation: 'generateSwaggerData',
|
|
101
|
-
context: {
|
|
102
|
-
pathCount: this.swaggerPath.length,
|
|
103
|
-
schemeCount: this.swaggerScheme.length,
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
throw err;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
this.getSwaggerData = (req) => {
|
|
110
|
-
if (this.generatedSwaggerData === null) {
|
|
111
|
-
this.generateSwaggerData(req);
|
|
112
|
-
}
|
|
113
|
-
return this.generatedSwaggerData;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Export swagger data to a JSON file without requiring an HTTP request.
|
|
117
|
-
* Uses config values for server URL, or accepts overrides via options.
|
|
118
|
-
*/
|
|
119
|
-
this.exportToFile = (filePath, options) => {
|
|
120
|
-
var _a, _b, _c, _d, _e, _f;
|
|
121
|
-
try {
|
|
122
|
-
const config = (0, common_1.getConfig)();
|
|
123
|
-
const title = (options === null || options === void 0 ? void 0 : options.title) || ((_a = config === null || config === void 0 ? void 0 : config.swagger) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
124
|
-
const version = (options === null || options === void 0 ? void 0 : options.version) || ((_b = config === null || config === void 0 ? void 0 : config.swagger) === null || _b === void 0 ? void 0 : _b.version) || '';
|
|
125
|
-
const description = (options === null || options === void 0 ? void 0 : options.description) || ((_c = config === null || config === void 0 ? void 0 : config.swagger) === null || _c === void 0 ? void 0 : _c.description) || '';
|
|
126
|
-
this.swaggerData.info.title = title;
|
|
127
|
-
this.swaggerData.info.version = version;
|
|
128
|
-
this.swaggerData.info.description = description;
|
|
129
|
-
this.swaggerData.components.securitySchemes.OAuthLogin.flows.password.tokenUrl =
|
|
130
|
-
((_d = config === null || config === void 0 ? void 0 : config.swagger) === null || _d === void 0 ? void 0 : _d.auth_url) || '';
|
|
131
|
-
if (options === null || options === void 0 ? void 0 : options.serverUrl) {
|
|
132
|
-
this.swaggerData.servers = [{ url: options.serverUrl }];
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
const scheme = ((_e = config === null || config === void 0 ? void 0 : config.swagger) === null || _e === void 0 ? void 0 : _e.scheme) || 'https';
|
|
136
|
-
const host = ((_f = config === null || config === void 0 ? void 0 : config.swagger) === null || _f === void 0 ? void 0 : _f.host) || 'localhost';
|
|
137
|
-
const basePath = (config === null || config === void 0 ? void 0 : config.basePath) ? `/${config.basePath}` : '';
|
|
138
|
-
this.swaggerData.servers = [{ url: `${scheme}://${host}${basePath}` }];
|
|
139
|
-
}
|
|
140
|
-
this.generatePathsAndSchemes();
|
|
141
|
-
const dir = path.dirname(filePath);
|
|
142
|
-
if (!fs.existsSync(dir)) {
|
|
143
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
144
|
-
}
|
|
145
|
-
fs.writeFileSync(filePath, JSON.stringify(this.swaggerData, null, 2), 'utf-8');
|
|
146
|
-
common_1.logger.info(`@router swagger.json exported to ${filePath}`);
|
|
147
|
-
}
|
|
148
|
-
catch (err) {
|
|
149
|
-
common_1.logger.error('@router swagger.json export failed', err, {
|
|
150
|
-
operation: 'exportToFile',
|
|
151
|
-
filePath,
|
|
152
|
-
});
|
|
153
|
-
throw err;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* Get swagger data as a plain object without requiring an HTTP request.
|
|
158
|
-
* Uses config values for server URL, or accepts overrides via options.
|
|
159
|
-
*/
|
|
160
|
-
this.getSwaggerDataStatic = (options) => {
|
|
161
|
-
var _a, _b, _c, _d, _e, _f;
|
|
162
|
-
const config = (0, common_1.getConfig)();
|
|
163
|
-
const title = (options === null || options === void 0 ? void 0 : options.title) || ((_a = config === null || config === void 0 ? void 0 : config.swagger) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
164
|
-
const version = (options === null || options === void 0 ? void 0 : options.version) || ((_b = config === null || config === void 0 ? void 0 : config.swagger) === null || _b === void 0 ? void 0 : _b.version) || '';
|
|
165
|
-
const description = (options === null || options === void 0 ? void 0 : options.description) || ((_c = config === null || config === void 0 ? void 0 : config.swagger) === null || _c === void 0 ? void 0 : _c.description) || '';
|
|
166
|
-
this.swaggerData.info.title = title;
|
|
167
|
-
this.swaggerData.info.version = version;
|
|
168
|
-
this.swaggerData.info.description = description;
|
|
169
|
-
this.swaggerData.components.securitySchemes.OAuthLogin.flows.password.tokenUrl =
|
|
170
|
-
((_d = config === null || config === void 0 ? void 0 : config.swagger) === null || _d === void 0 ? void 0 : _d.auth_url) || '';
|
|
171
|
-
if (options === null || options === void 0 ? void 0 : options.serverUrl) {
|
|
172
|
-
this.swaggerData.servers = [{ url: options.serverUrl }];
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
const scheme = ((_e = config === null || config === void 0 ? void 0 : config.swagger) === null || _e === void 0 ? void 0 : _e.scheme) || 'https';
|
|
176
|
-
const host = ((_f = config === null || config === void 0 ? void 0 : config.swagger) === null || _f === void 0 ? void 0 : _f.host) || 'localhost';
|
|
177
|
-
const basePath = (config === null || config === void 0 ? void 0 : config.basePath) ? `/${config.basePath}` : '';
|
|
178
|
-
this.swaggerData.servers = [{ url: `${scheme}://${host}${basePath}` }];
|
|
179
|
-
}
|
|
180
|
-
this.generatePathsAndSchemes();
|
|
181
|
-
return Object.assign({}, this.swaggerData);
|
|
182
|
-
};
|
|
183
|
-
this.generatePathsAndSchemes = () => {
|
|
184
|
-
this.swaggerPath.sort((a, b) => {
|
|
185
|
-
var _a, _b, _c, _d;
|
|
186
|
-
const ix1 = methods.indexOf(a.method.toLowerCase());
|
|
187
|
-
const ix2 = methods.indexOf(b.method.toLowerCase());
|
|
188
|
-
return (((_a = a.tags) === null || _a === void 0 ? void 0 : _a[0]) || 0) > (((_b = b.tags) === null || _b === void 0 ? void 0 : _b[0]) || 0)
|
|
189
|
-
? 1
|
|
190
|
-
: (((_c = a.tags) === null || _c === void 0 ? void 0 : _c[0]) || 0) < (((_d = b.tags) === null || _d === void 0 ? void 0 : _d[0]) || 0)
|
|
191
|
-
? -1
|
|
192
|
-
: a.path > b.path
|
|
193
|
-
? 1
|
|
194
|
-
: a.path < b.path
|
|
195
|
-
? -1
|
|
196
|
-
: ix1 > ix2
|
|
197
|
-
? 1
|
|
198
|
-
: ix1 < ix2
|
|
199
|
-
? -1
|
|
200
|
-
: 0;
|
|
201
|
-
});
|
|
202
|
-
this.swaggerData.paths = {};
|
|
203
|
-
this.swaggerPath.forEach((v) => {
|
|
204
|
-
var _a;
|
|
205
|
-
if (!this.swaggerData.paths[v.path])
|
|
206
|
-
this.swaggerData.paths[v.path] = {};
|
|
207
|
-
const { path: _, method: __ } = v, props = __rest(v, ["path", "method"]);
|
|
208
|
-
this.swaggerData.paths[v.path][(_a = v.method) === null || _a === void 0 ? void 0 : _a.toLowerCase()] = props;
|
|
209
|
-
});
|
|
210
|
-
this.swaggerData.components.schemas = {};
|
|
211
|
-
this.swaggerScheme.forEach((v) => {
|
|
212
|
-
if (!this.swaggerData.components.schemas[v.name])
|
|
213
|
-
this.swaggerData.components.schemas[v.name] = {};
|
|
214
|
-
this.swaggerData.components.schemas[v.name] = v.data;
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
const docsApp = new DocsApplication();
|
|
220
|
-
exports.addPaths = docsApp.addPaths;
|
|
221
|
-
exports.addScheme = docsApp.addScheme;
|
|
222
|
-
exports.getSwaggerData = docsApp.getSwaggerData;
|
|
223
|
-
exports.exportToFile = docsApp.exportToFile;
|
|
224
|
-
exports.getSwaggerDataStatic = docsApp.getSwaggerDataStatic;
|
|
3
|
+
exports.getSwaggerDataStatic = exports.getSwaggerData = exports.exportToFile = exports.addScheme = exports.addPaths = void 0;
|
|
4
|
+
// R13 (adapter-neutral extraction): the Swagger document assembler
|
|
5
|
+
// (`DocsApplication`) moved to @asapjs/common/http (`swagger-doc.ts`) so both
|
|
6
|
+
// the Express and Fastify adapters assemble the document from the same shared
|
|
7
|
+
// path/scheme registries. This file is now a re-export shell so the
|
|
8
|
+
// pre-existing `@asapjs/router` import paths keep working unchanged.
|
|
9
|
+
//
|
|
10
|
+
// The re-exported members are internal plumbing: `RouterController.execute()`
|
|
11
|
+
// calls `addPaths`/`addScheme` automatically for every decorated route, and
|
|
12
|
+
// `getSwaggerData`/`getSwaggerDataStatic` are consumed by `RouterPlugin`/CLI —
|
|
13
|
+
// application code does not call these directly (ARCHITECTURE_AUDIT.md §5 R16).
|
|
14
|
+
var common_1 = require("@asapjs/common");
|
|
15
|
+
Object.defineProperty(exports, "addPaths", { enumerable: true, get: function () { return common_1.addPaths; } });
|
|
16
|
+
Object.defineProperty(exports, "addScheme", { enumerable: true, get: function () { return common_1.addScheme; } });
|
|
17
|
+
Object.defineProperty(exports, "exportToFile", { enumerable: true, get: function () { return common_1.exportToFile; } });
|
|
18
|
+
Object.defineProperty(exports, "getSwaggerData", { enumerable: true, get: function () { return common_1.getSwaggerData; } });
|
|
19
|
+
Object.defineProperty(exports, "getSwaggerDataStatic", { enumerable: true, get: function () { return common_1.getSwaggerDataStatic; } });
|
|
225
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swagger/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swagger/index.ts"],"names":[],"mappings":";;;AAAA,mEAAmE;AACnE,8EAA8E;AAC9E,8EAA8E;AAC9E,oEAAoE;AACpE,qEAAqE;AACrE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,gFAAgF;AAChF,yCAAyG;AAAhG,kGAAA,QAAQ,OAAA;AAAE,mGAAA,SAAS,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,wGAAA,cAAc,OAAA;AAAE,8GAAA,oBAAoB,OAAA"}
|
|
@@ -11,7 +11,7 @@ function respondWithError(err, res) {
|
|
|
11
11
|
res.status(status).json(new error_1.HttpError(status, 'HTTP_EXCEPTION', String(message)).toJSON());
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
const message = err instanceof Error ? err.message :
|
|
14
|
+
const message = err instanceof Error ? err.message : (0, error_1.getUnknownServerErrorMessage)();
|
|
15
15
|
res.status(500).json(new error_1.HttpError(500, 'INTERNAL_SERVER_ERROR', message).toJSON());
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineMiddleware.js","sourceRoot":"","sources":["../../src/utils/defineMiddleware.ts"],"names":[],"mappings":";;AAiBA,4CA+BC;AA/CD,
|
|
1
|
+
{"version":3,"file":"defineMiddleware.js","sourceRoot":"","sources":["../../src/utils/defineMiddleware.ts"],"names":[],"mappings":";;AAiBA,4CA+BC;AA/CD,yCAAwE;AAIxE,SAAS,gBAAgB,CAAC,GAAY,EAAE,GAAa;IACpD,IAAI,GAAG,YAAY,iBAAS,EAAE,CAAC;QAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;SAAM,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,QAAQ,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;QAClF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAA0C,CAAC;QACvE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,iBAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5F,CAAC;SAAM,CAAC;QACP,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,oCAA4B,GAAE,CAAC;QACpF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,iBAAS,CAAC,GAAG,EAAE,uBAAuB,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;AACF,CAAC;AAED,SAAgB,gBAAgB,CAI/B,OAA2E,EAC3E,IAEC;;IAED,MAAM,cAAc,GAAG,CAAC,OAAqB,EAA6C,EAAE;QAC3F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,CAAC,GAAQ,EAAE,GAAa,EAAE,IAAS,EAAE,EAAE;YAC7C,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAY,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAChD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;oBAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBACnD,CAAC;YACF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC;QACF,CAAC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,cAAwD,CAAC;IAC5E,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE;QAC7C,KAAK,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,mCAAI,EAAE;QACzB,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export default
|
|
1
|
+
import { generateSchemeRefWithName } from '@asapjs/common';
|
|
2
|
+
export default generateSchemeRefWithName;
|
|
3
3
|
//# sourceMappingURL=generateSchemeRefWithName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSchemeRefWithName.d.ts","sourceRoot":"","sources":["../../src/utils/generateSchemeRefWithName.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateSchemeRefWithName.d.ts","sourceRoot":"","sources":["../../src/utils/generateSchemeRefWithName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAI3D,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const common_1 = require("@asapjs/common");
|
|
4
|
+
// Canonical implementation moved to @asapjs/common (shared swagger registry).
|
|
5
|
+
// Kept as a delegating default export for compatibility with existing imports.
|
|
6
|
+
exports.default = common_1.generateSchemeRefWithName;
|
|
4
7
|
//# sourceMappingURL=generateSchemeRefWithName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSchemeRefWithName.js","sourceRoot":"","sources":["../../src/utils/generateSchemeRefWithName.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"generateSchemeRefWithName.js","sourceRoot":"","sources":["../../src/utils/generateSchemeRefWithName.ts"],"names":[],"mappings":";;AAAA,2CAA2D;AAE3D,8EAA8E;AAC9E,+EAA+E;AAC/E,kBAAe,kCAAyB,CAAC"}
|
package/dist/utils/wrapper.d.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecuteArgsBase, Paging } from '@asapjs/types';
|
|
2
2
|
import type { NextFunction, Request, Response } from 'express';
|
|
3
3
|
type Callback = (request: Request<any, any, any, any>, response: Response, next: NextFunction) => Promise<unknown>;
|
|
4
|
-
declare global {
|
|
5
|
-
namespace Express {
|
|
6
|
-
interface Request {
|
|
7
|
-
user: any;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
4
|
export interface GlobalMiddlewareContext {
|
|
12
5
|
}
|
|
13
|
-
export type ExecuteArgs<P = {}, Q = {}, B = {}, Context = GlobalMiddlewareContext> = {
|
|
6
|
+
export type ExecuteArgs<P = {}, Q = {}, B = {}, Context = GlobalMiddlewareContext> = ExecuteArgsBase<P, Q, B, Context> & {
|
|
7
|
+
req: Request;
|
|
8
|
+
res: Response;
|
|
9
|
+
files?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated 과도기 별칭 — 인덱스 시그니처로 임의 프로퍼티를 허용하던 기존(느슨한)
|
|
15
|
+
* ExecuteArgs 형태. 강타입화된 `ExecuteArgs`로 이전하는 동안 컴파일 브레이크를 피하기
|
|
16
|
+
* 위한 임시 탈출구이며, 한 릴리스 동안만 유지한다. path/query/body에 오타나 미선언
|
|
17
|
+
* 프로퍼티를 그대로 통과시키므로 신규 코드에서는 사용하지 말 것.
|
|
18
|
+
*/
|
|
19
|
+
export type LooseExecuteArgs<P = {}, Q = {}, B = {}, Context = GlobalMiddlewareContext> = {
|
|
14
20
|
req: Request;
|
|
15
21
|
res: Response;
|
|
16
22
|
path?: P | {
|
|
@@ -25,7 +31,7 @@ export type ExecuteArgs<P = {}, Q = {}, B = {}, Context = GlobalMiddlewareContex
|
|
|
25
31
|
files?: {
|
|
26
32
|
[key: string]: any;
|
|
27
33
|
};
|
|
28
|
-
paging:
|
|
34
|
+
paging: Paging;
|
|
29
35
|
} & Context;
|
|
30
36
|
export default function Wrapper(cb: (args: ExecuteArgs) => Promise<unknown>, responseDtoClass?: (new () => any) | null): Callback;
|
|
31
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,KAAK,QAAQ,GAAG,CACf,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,YAAY,KACd,OAAO,CAAC,OAAO,CAAC,CAAC;AAGtB,MAAM,WAAW,uBAAuB;CAAG;AAW3C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,uBAAuB,IAAI,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,GAAG;IACxH,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,uBAAuB,IAAI;IACzF,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAClC,KAAK,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAClC,IAAI,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC;AAEZ,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,QAAQ,CA6ChI"}
|
package/dist/utils/wrapper.js
CHANGED
|
@@ -46,35 +46,32 @@ exports.default = Wrapper;
|
|
|
46
46
|
const common_1 = require("@asapjs/common");
|
|
47
47
|
const error_1 = require("@asapjs/error");
|
|
48
48
|
const Sentry = __importStar(require("@sentry/node"));
|
|
49
|
-
const AutoInject_1 = require("../decorator/AutoInject");
|
|
50
|
-
const ErrorPayload_1 = require("../decorator/ErrorPayload");
|
|
51
|
-
const ResponsePayload_1 = require("../decorator/ResponsePayload");
|
|
52
49
|
function Wrapper(cb, responseDtoClass) {
|
|
53
50
|
return function _Wrapper(req, res, _next) {
|
|
54
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
52
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
const paging = {
|
|
60
|
-
page,
|
|
61
|
-
limit,
|
|
62
|
-
};
|
|
53
|
+
// R13-②: paging 파싱과 Proxy args 빌더는 @asapjs/common/http로 이관됐다
|
|
54
|
+
// (buildPaging/buildArgs) — fastify wrapper와 완전히 동일한 런타임 코드.
|
|
55
|
+
const paging = (0, common_1.buildPaging)(req.query);
|
|
63
56
|
const base = { req, res, query: req.query, path: req.params, body: req.body, paging };
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
});
|
|
57
|
+
// R9: buildArgs의 Proxy는 "타입에 없는 프로퍼티를 위한 폴백"이 아니다 —
|
|
58
|
+
// TypedMiddleware가 GlobalMiddlewareContext 모듈 증강으로 선언한 컨텍스트
|
|
59
|
+
// 키(예: user)를 req에서 읽어오는 공식 런타임 해석 채널이다. 선언되지 않은
|
|
60
|
+
// 키의 오타 차단은 타입 계층(ExecuteArgs)에서 이미 이뤄진다.
|
|
61
|
+
const args = (0, common_1.buildArgs)(base, req);
|
|
71
62
|
const output = yield cb(args);
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
// R13-S②: 핸들러가 이미 res.send/res.json 등으로 직접 응답을 보낸 뒤 값을
|
|
64
|
+
// 반환하는 경우(health-check류 패턴) res.status().json()을 다시 호출하면
|
|
65
|
+
// ERR_HTTP_HEADERS_SENT로 크래시한다. fastify wrapper의 !reply.sent 가드와
|
|
66
|
+
// 대칭을 맞춰 headersSent 가드를 추가한다 — 이미 응답이 나간 요청은 조용히 스킵.
|
|
67
|
+
if (output !== undefined && !res.headersSent) {
|
|
68
|
+
const finalResponse = (0, common_1.applyGlobalResponse)(output, req, responseDtoClass);
|
|
74
69
|
res.status(200).json(finalResponse);
|
|
75
70
|
}
|
|
76
71
|
}
|
|
77
72
|
catch (err) {
|
|
73
|
+
if (res.headersSent)
|
|
74
|
+
return;
|
|
78
75
|
const isServerError = err == null ||
|
|
79
76
|
typeof err !== 'object' ||
|
|
80
77
|
err.status === 500 ||
|
|
@@ -85,74 +82,16 @@ function Wrapper(cb, responseDtoClass) {
|
|
|
85
82
|
Sentry.captureException(err);
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
statusCode = err.status;
|
|
93
|
-
}
|
|
94
|
-
else if (err && typeof err === 'object' && 'status' in err && 'message' in err) {
|
|
95
|
-
const { status, message } = err;
|
|
96
|
-
errorBody = new error_1.HttpError(status, 'HTTP_EXCEPTION', String(message)).toJSON();
|
|
97
|
-
statusCode = status;
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
const message = err instanceof Error ? err.message : '알 수 없는 서버 오류가 발생했습니다.';
|
|
101
|
-
errorBody = new error_1.HttpError(500, 'INTERNAL_SERVER_ERROR', message).toJSON();
|
|
102
|
-
statusCode = 500;
|
|
103
|
-
}
|
|
104
|
-
const finalErrorResponse = applyGlobalErrorResponse(errorBody, req, responseDtoClass);
|
|
85
|
+
// err→HttpError 정규화는 resolveErrorBody(@asapjs/error)로 일원화 (R6-④)
|
|
86
|
+
const errorBody = (0, error_1.resolveErrorBody)(err);
|
|
87
|
+
const statusCode = errorBody.status;
|
|
88
|
+
const finalErrorResponse = (0, common_1.applyGlobalErrorResponse)(errorBody, req, responseDtoClass);
|
|
105
89
|
res.status(statusCode).json(finalErrorResponse);
|
|
106
90
|
}
|
|
107
91
|
});
|
|
108
92
|
};
|
|
109
93
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return output;
|
|
114
|
-
const autoInjectEntries = (0, AutoInject_1.getAutoInjectEntries)(DtoClass);
|
|
115
|
-
const payloadKey = (0, ResponsePayload_1.getResponsePayloadKey)(DtoClass);
|
|
116
|
-
const injected = {};
|
|
117
|
-
for (const { key, factory } of autoInjectEntries) {
|
|
118
|
-
injected[key] = factory(req);
|
|
119
|
-
}
|
|
120
|
-
if (payloadKey) {
|
|
121
|
-
return Object.assign(Object.assign({}, injected), { [payloadKey]: output });
|
|
122
|
-
}
|
|
123
|
-
if (typeof output === 'object' && output !== null) {
|
|
124
|
-
return Object.assign(Object.assign({}, injected), output);
|
|
125
|
-
}
|
|
126
|
-
return Object.assign(Object.assign({}, injected), { result: output });
|
|
127
|
-
}
|
|
128
|
-
function resolveResponseDtoClass(controllerDto) {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
if (controllerDto === null)
|
|
131
|
-
return null;
|
|
132
|
-
if (controllerDto)
|
|
133
|
-
return controllerDto;
|
|
134
|
-
if ((0, common_1.hasConfig)()) {
|
|
135
|
-
const config = (0, common_1.getConfig)();
|
|
136
|
-
return ((_b = (_a = config.router) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.responseDto) || null;
|
|
137
|
-
}
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
function applyGlobalErrorResponse(errorBody, req, responseDtoClass) {
|
|
141
|
-
const DtoClass = resolveResponseDtoClass(responseDtoClass);
|
|
142
|
-
if (!DtoClass)
|
|
143
|
-
return errorBody;
|
|
144
|
-
const errorPayloadKey = (0, ErrorPayload_1.getErrorPayloadKey)(DtoClass);
|
|
145
|
-
if (!errorPayloadKey)
|
|
146
|
-
return errorBody;
|
|
147
|
-
const autoInjectEntries = (0, AutoInject_1.getAutoInjectEntries)(DtoClass);
|
|
148
|
-
const injected = {};
|
|
149
|
-
for (const { key, factory } of autoInjectEntries) {
|
|
150
|
-
injected[key] = factory(req);
|
|
151
|
-
}
|
|
152
|
-
const successKey = Object.keys(injected).find((k) => typeof injected[k] === 'boolean');
|
|
153
|
-
if (successKey) {
|
|
154
|
-
injected[successKey] = false;
|
|
155
|
-
}
|
|
156
|
-
return Object.assign(Object.assign({}, injected), { [errorPayloadKey]: errorBody });
|
|
157
|
-
}
|
|
94
|
+
// R13 (adapter-neutral extraction): applyGlobalResponse / applyGlobalErrorResponse /
|
|
95
|
+
// resolveResponseDtoClass moved to @asapjs/common/http (global-response.ts) so the
|
|
96
|
+
// fastify wrapper uses byte-identical envelope logic. Imported above.
|
|
158
97
|
//# sourceMappingURL=wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,0BA6CC;AA3FD,2CAAqI;AACrI,yCAAiD;AAEjD,qDAAuC;AA2CvC,SAAwB,OAAO,CAAC,EAA2C,EAAE,gBAAyC;IACrH,OAAO,SAAe,QAAQ,CAAC,GAAY,EAAE,GAAa,EAAE,KAAmB;;YAC9E,IAAI,CAAC;gBACJ,6DAA6D;gBAC7D,6DAA6D;gBAC7D,MAAM,MAAM,GAAW,IAAA,oBAAW,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC9C,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;gBACtF,oDAAoD;gBACpD,4DAA4D;gBAC5D,iDAAiD;gBACjD,0CAA0C;gBAC1C,MAAM,IAAI,GAAG,IAAA,kBAAS,EAAC,IAAI,EAAE,GAAG,CAAgB,CAAC;gBACjD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC9B,uDAAuD;gBACvD,yDAAyD;gBACzD,iEAAiE;gBACjE,sDAAsD;gBACtD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;oBAC9C,MAAM,aAAa,GAAG,IAAA,4BAAmB,EAAC,MAAM,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;oBACzE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBACrC,CAAC;YACF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,IAAI,GAAG,CAAC,WAAW;oBAAE,OAAO;gBAE5B,MAAM,aAAa,GAClB,GAAG,IAAI,IAAI;oBACX,OAAO,GAAG,KAAK,QAAQ;oBACtB,GAA2B,CAAC,MAAM,KAAK,GAAG;oBAC1C,GAA2B,CAAC,MAAM,KAAK,SAAS,CAAC;gBAEnD,IAAI,aAAa,EAAE,CAAC;oBACnB,eAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;oBACpC,IAAI,IAAA,kBAAS,GAAE,IAAK,IAAA,kBAAS,GAAU,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;wBAC9D,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;oBAC9B,CAAC;gBACF,CAAC;gBAED,iEAAiE;gBACjE,MAAM,SAAS,GAAG,IAAA,wBAAgB,EAAC,GAAG,CAAC,CAAC;gBACxC,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;gBAEpC,MAAM,kBAAkB,GAAG,IAAA,iCAAwB,EAAC,SAAS,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;gBACtF,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACjD,CAAC;QACF,CAAC;KAAA,CAAC;AACH,CAAC;AACD,qFAAqF;AACrF,mFAAmF;AACnF,sEAAsE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asapjs/router",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.43",
|
|
4
4
|
"description": "Router and API layer for AsapJS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prebuild": "rm -rf dist",
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"test": "npx jest --config jest.config.js
|
|
13
|
+
"test": "npx jest --config jest.config.js"
|
|
14
14
|
},
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "ISC",
|
|
@@ -19,30 +19,37 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@asapjs/common": "^1.0.0-alpha.
|
|
23
|
-
"@asapjs/error": "^1.0.0-alpha.
|
|
24
|
-
"@asapjs/
|
|
25
|
-
"@asapjs/types": "^1.0.0-alpha.
|
|
22
|
+
"@asapjs/common": "^1.0.0-alpha.43",
|
|
23
|
+
"@asapjs/error": "^1.0.0-alpha.43",
|
|
24
|
+
"@asapjs/schema": "^1.0.0-alpha.43",
|
|
25
|
+
"@asapjs/types": "^1.0.0-alpha.43",
|
|
26
26
|
"@sentry/node": "^6.19.7",
|
|
27
27
|
"body-parser": "^1.20.3",
|
|
28
28
|
"cors": "^2.8.5",
|
|
29
29
|
"express": "^4.20.0",
|
|
30
30
|
"express-basic-auth": "^1.2.1",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"sequelize": "^6.29.0",
|
|
34
|
-
"sequelize-typescript": "^2.1.6",
|
|
35
|
-
"swagger-ui-express": "^5.0.1",
|
|
36
|
-
"winston": "^3.6.0"
|
|
31
|
+
"reflect-metadata": "^0.1.13",
|
|
32
|
+
"swagger-ui-express": "^5.0.1"
|
|
37
33
|
},
|
|
38
34
|
"devDependencies": {
|
|
35
|
+
"@asapjs/sequelize": "^1.0.0-alpha.43",
|
|
39
36
|
"@types/body-parser": "^1.19.2",
|
|
40
37
|
"@types/cors": "^2.8.12",
|
|
41
38
|
"@types/express": "^4.17.13",
|
|
42
|
-
"@types/jsonwebtoken": "^9.0.2",
|
|
43
39
|
"@types/node": "^17.0.21",
|
|
44
40
|
"@types/swagger-ui-express": "^4.1.8",
|
|
41
|
+
"@types/validator": "^13.12.0",
|
|
42
|
+
"sequelize": "^6.29.0",
|
|
43
|
+
"sequelize-typescript": "^2.1.6",
|
|
45
44
|
"typescript": "^5.8.3"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "1cff2c1a929d45ab7b4f69eeeb9a260f71a16b44",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@asapjs/sequelize": "^1.0.0-alpha.41"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@asapjs/sequelize": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TypedMiddleware } from '@asapjs/types';
|
|
2
|
-
export declare function setRegisteredMiddlewares(mws: readonly TypedMiddleware<any, any>[]): void;
|
|
3
|
-
export declare function getRegisteredMiddlewares(): readonly TypedMiddleware<any, any>[];
|
|
4
|
-
//# sourceMappingURL=registeredMiddlewares.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registeredMiddlewares.d.ts","sourceRoot":"","sources":["../../src/utils/registeredMiddlewares.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAExF;AAED,wBAAgB,wBAAwB,IAAI,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAE/E"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setRegisteredMiddlewares = setRegisteredMiddlewares;
|
|
4
|
-
exports.getRegisteredMiddlewares = getRegisteredMiddlewares;
|
|
5
|
-
let middlewares = [];
|
|
6
|
-
function setRegisteredMiddlewares(mws) {
|
|
7
|
-
middlewares = mws;
|
|
8
|
-
}
|
|
9
|
-
function getRegisteredMiddlewares() {
|
|
10
|
-
return middlewares;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=registeredMiddlewares.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registeredMiddlewares.js","sourceRoot":"","sources":["../../src/utils/registeredMiddlewares.ts"],"names":[],"mappings":";;AAIA,4DAEC;AAED,4DAEC;AARD,IAAI,WAAW,GAAyC,EAAE,CAAC;AAE3D,SAAgB,wBAAwB,CAAC,GAAyC;IACjF,WAAW,GAAG,GAAG,CAAC;AACnB,CAAC;AAED,SAAgB,wBAAwB;IACvC,OAAO,WAAW,CAAC;AACpB,CAAC"}
|