@deepkit/http 1.0.1-alpha.16 → 1.0.1-alpha.160
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/CHANGELOG.md +236 -0
- package/dist/cjs/index.d.ts +14 -10
- package/dist/cjs/index.js +19 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/controllers.d.ts +10 -3
- package/dist/cjs/src/controllers.js +7 -3
- package/dist/cjs/src/controllers.js.map +1 -1
- package/dist/cjs/src/decorator.d.ts +144 -70
- package/dist/cjs/src/decorator.js +277 -102
- package/dist/cjs/src/decorator.js.map +1 -1
- package/dist/cjs/src/filter.d.ts +49 -0
- package/dist/cjs/src/filter.js +215 -0
- package/dist/cjs/src/filter.js.map +1 -0
- package/dist/cjs/src/http-app.d.ts +8 -0
- package/dist/cjs/src/http-app.js +16 -0
- package/dist/cjs/src/http-app.js.map +1 -0
- package/dist/cjs/src/http.d.ts +131 -32
- package/dist/cjs/src/http.js +523 -122
- package/dist/cjs/src/http.js.map +1 -1
- package/dist/cjs/src/kernel.d.ts +50 -9
- package/dist/cjs/src/kernel.js +109 -98
- package/dist/cjs/src/kernel.js.map +1 -1
- package/dist/cjs/src/logger.d.ts +3 -3
- package/dist/cjs/src/logger.js +9 -12
- package/dist/cjs/src/logger.js.map +1 -1
- package/dist/cjs/src/middleware.d.ts +61 -0
- package/dist/cjs/src/middleware.js +95 -0
- package/dist/cjs/src/middleware.js.map +1 -0
- package/dist/cjs/src/model.d.ts +270 -4
- package/dist/cjs/src/model.js +401 -3
- package/dist/cjs/src/model.js.map +1 -1
- package/dist/cjs/src/module.config.d.ts +149 -4
- package/dist/cjs/src/module.config.js +11 -6
- package/dist/cjs/src/module.config.js.map +1 -1
- package/dist/cjs/src/module.d.ts +14 -32
- package/dist/cjs/src/module.js +122 -7
- package/dist/cjs/src/module.js.map +1 -1
- package/dist/cjs/src/request-parser.d.ts +37 -0
- package/dist/cjs/src/request-parser.js +382 -0
- package/dist/cjs/src/request-parser.js.map +1 -0
- package/dist/cjs/src/router.d.ts +174 -75
- package/dist/cjs/src/router.js +469 -288
- package/dist/cjs/src/router.js.map +1 -1
- package/dist/cjs/src/static-serving.d.ts +32 -4
- package/dist/cjs/src/static-serving.js +115 -71
- package/dist/cjs/src/static-serving.js.map +1 -1
- package/dist/cjs/src/utils.js +2 -2
- package/dist/cjs/src/utils.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -2916
- package/dist/esm/index.d.ts +14 -10
- package/dist/esm/index.js +14 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/controllers.d.ts +10 -3
- package/dist/esm/src/controllers.js +7 -3
- package/dist/esm/src/controllers.js.map +1 -1
- package/dist/esm/src/decorator.d.ts +144 -70
- package/dist/esm/src/decorator.js +272 -99
- package/dist/esm/src/decorator.js.map +1 -1
- package/dist/esm/src/filter.d.ts +49 -0
- package/dist/esm/src/filter.js +209 -0
- package/dist/esm/src/filter.js.map +1 -0
- package/dist/esm/src/http-app.d.ts +8 -0
- package/dist/esm/src/http-app.js +12 -0
- package/dist/esm/src/http-app.js.map +1 -0
- package/dist/esm/src/http.d.ts +131 -32
- package/dist/esm/src/http.js +504 -121
- package/dist/esm/src/http.js.map +1 -1
- package/dist/esm/src/kernel.d.ts +50 -9
- package/dist/esm/src/kernel.js +110 -100
- package/dist/esm/src/kernel.js.map +1 -1
- package/dist/esm/src/logger.d.ts +3 -3
- package/dist/esm/src/logger.js +7 -11
- package/dist/esm/src/logger.js.map +1 -1
- package/dist/esm/src/middleware.d.ts +61 -0
- package/dist/esm/src/middleware.js +90 -0
- package/dist/esm/src/middleware.js.map +1 -0
- package/dist/esm/src/model.d.ts +270 -4
- package/dist/esm/src/model.js +357 -1
- package/dist/esm/src/model.js.map +1 -1
- package/dist/esm/src/module.config.d.ts +149 -4
- package/dist/esm/src/module.config.js +9 -5
- package/dist/esm/src/module.config.js.map +1 -1
- package/dist/esm/src/module.d.ts +14 -32
- package/dist/esm/src/module.js +121 -7
- package/dist/esm/src/module.js.map +1 -1
- package/dist/esm/src/request-parser.d.ts +37 -0
- package/dist/esm/src/request-parser.js +372 -0
- package/dist/esm/src/request-parser.js.map +1 -0
- package/dist/esm/src/router.d.ts +174 -75
- package/dist/esm/src/router.js +463 -285
- package/dist/esm/src/router.js.map +1 -1
- package/dist/esm/src/static-serving.d.ts +32 -4
- package/dist/esm/src/static-serving.js +107 -65
- package/dist/esm/src/static-serving.js.map +1 -1
- package/dist/esm/src/utils.js +1 -0
- package/dist/esm/src/utils.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -2916
- package/index.ts +14 -10
- package/package.json +30 -19
- package/src/controllers.ts +4 -3
- package/src/decorator.ts +242 -104
- package/src/filter.ts +224 -0
- package/src/http-app.ts +11 -0
- package/src/http.ts +501 -100
- package/src/kernel.ts +128 -80
- package/src/logger.ts +4 -6
- package/src/middleware.ts +116 -0
- package/src/model.ts +516 -5
- package/src/module.config.ts +168 -5
- package/src/module.ts +120 -7
- package/src/request-parser.ts +430 -0
- package/src/router.ts +546 -317
- package/src/static-serving.ts +120 -50
- package/src/utils.ts +0 -2
- package/tsconfig.esm.json +7 -7
- package/tsconfig.json +18 -11
- package/tsconfig.spec.json +8 -0
- package/dist/cjs/tests/router.spec.d.ts +0 -1
- package/dist/cjs/tests/router.spec.js +0 -481
- package/dist/cjs/tests/router.spec.js.map +0 -1
- package/dist/esm/tests/router.spec.d.ts +0 -1
- package/dist/esm/tests/router.spec.js +0 -479
- package/dist/esm/tests/router.spec.js.map +0 -1
- package/tests/router.spec.ts +0 -347
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const globals_1 = require("@jest/globals");
|
|
16
|
-
require("reflect-metadata");
|
|
17
|
-
const router_1 = require("../src/router");
|
|
18
|
-
const decorator_1 = require("../src/decorator");
|
|
19
|
-
const type_1 = require("@deepkit/type");
|
|
20
|
-
const http_1 = require("../src/http");
|
|
21
|
-
const kernel_1 = require("../src/kernel");
|
|
22
|
-
const event_1 = require("@deepkit/event");
|
|
23
|
-
const injector_1 = require("@deepkit/injector");
|
|
24
|
-
const logger_1 = require("@deepkit/logger");
|
|
25
|
-
const model_1 = require("../src/model");
|
|
26
|
-
const app_1 = require("@deepkit/app");
|
|
27
|
-
function createHttpKernel(controllers, providers = []) {
|
|
28
|
-
const tagProviders = new app_1.TagProviders();
|
|
29
|
-
for (const provider of providers)
|
|
30
|
-
if (provider instanceof injector_1.Tag)
|
|
31
|
-
tagProviders.tags.push(provider);
|
|
32
|
-
const router = router_1.Router.forControllers(controllers, tagProviders);
|
|
33
|
-
const injector = injector_1.InjectorContext.forProviders([{ provide: router_1.Router, useValue: router }, ...controllers, http_1.HttpListener, logger_1.Logger, ...providers]);
|
|
34
|
-
const eventDispatcher = new event_1.EventDispatcher(injector);
|
|
35
|
-
eventDispatcher.registerListener(http_1.HttpListener);
|
|
36
|
-
return new kernel_1.HttpKernel(router, eventDispatcher, injector, new logger_1.Logger(), false);
|
|
37
|
-
}
|
|
38
|
-
globals_1.test('router', async () => {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
class Controller {
|
|
41
|
-
helloWorld() {
|
|
42
|
-
}
|
|
43
|
-
hello(name) {
|
|
44
|
-
}
|
|
45
|
-
userStatic(id) {
|
|
46
|
-
}
|
|
47
|
-
userStatic2(id, id2) {
|
|
48
|
-
}
|
|
49
|
-
static() {
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
__decorate([
|
|
53
|
-
decorator_1.http.GET(),
|
|
54
|
-
__metadata("design:type", Function),
|
|
55
|
-
__metadata("design:paramtypes", []),
|
|
56
|
-
__metadata("design:returntype", void 0)
|
|
57
|
-
], Controller.prototype, "helloWorld", null);
|
|
58
|
-
__decorate([
|
|
59
|
-
decorator_1.http.GET(':name'),
|
|
60
|
-
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [String]),
|
|
62
|
-
__metadata("design:returntype", void 0)
|
|
63
|
-
], Controller.prototype, "hello", null);
|
|
64
|
-
__decorate([
|
|
65
|
-
decorator_1.http.GET('/user/:id/static'),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [String]),
|
|
68
|
-
__metadata("design:returntype", void 0)
|
|
69
|
-
], Controller.prototype, "userStatic", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
decorator_1.http.GET('/user2/:id/static/:id2'),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", [String, String]),
|
|
74
|
-
__metadata("design:returntype", void 0)
|
|
75
|
-
], Controller.prototype, "userStatic2", null);
|
|
76
|
-
__decorate([
|
|
77
|
-
decorator_1.http.GET('/static'),
|
|
78
|
-
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", []),
|
|
80
|
-
__metadata("design:returntype", void 0)
|
|
81
|
-
], Controller.prototype, "static", null);
|
|
82
|
-
const router = router_1.Router.forControllers([Controller]);
|
|
83
|
-
globals_1.expect((_a = (await router.resolve('GET', '/'))) === null || _a === void 0 ? void 0 : _a.routeConfig.action).toMatchObject({ controller: Controller, methodName: 'helloWorld' });
|
|
84
|
-
globals_1.expect((_b = (await router.resolve('GET', '/peter'))) === null || _b === void 0 ? void 0 : _b.routeConfig.action).toMatchObject({ controller: Controller, methodName: 'hello' });
|
|
85
|
-
globals_1.expect((_c = (await router.resolve('GET', '/peter'))) === null || _c === void 0 ? void 0 : _c.parameters(undefined)).toEqual(['peter']);
|
|
86
|
-
const userStatic = await router.resolve('GET', '/user/1233/static');
|
|
87
|
-
globals_1.expect(userStatic === null || userStatic === void 0 ? void 0 : userStatic.routeConfig.action).toMatchObject({ controller: Controller, methodName: 'userStatic' });
|
|
88
|
-
globals_1.expect(userStatic === null || userStatic === void 0 ? void 0 : userStatic.parameters(undefined)).toEqual(['1233']);
|
|
89
|
-
const userStatic2 = await router.resolve('GET', '/user2/1233/static/123');
|
|
90
|
-
globals_1.expect(userStatic2 === null || userStatic2 === void 0 ? void 0 : userStatic2.routeConfig.action).toMatchObject({ controller: Controller, methodName: 'userStatic2' });
|
|
91
|
-
globals_1.expect(userStatic2 === null || userStatic2 === void 0 ? void 0 : userStatic2.parameters(undefined)).toEqual(['1233', '123']);
|
|
92
|
-
});
|
|
93
|
-
globals_1.test('router parameters', async () => {
|
|
94
|
-
var _a;
|
|
95
|
-
class Controller {
|
|
96
|
-
string(name) {
|
|
97
|
-
return new http_1.JSONResponse(name);
|
|
98
|
-
}
|
|
99
|
-
number(id) {
|
|
100
|
-
return new http_1.JSONResponse(id);
|
|
101
|
-
}
|
|
102
|
-
boolean(yes) {
|
|
103
|
-
return new http_1.JSONResponse(yes);
|
|
104
|
-
}
|
|
105
|
-
any(path) {
|
|
106
|
-
return new http_1.JSONResponse(path);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
__decorate([
|
|
110
|
-
decorator_1.http.GET('/user/:name'),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [String]),
|
|
113
|
-
__metadata("design:returntype", void 0)
|
|
114
|
-
], Controller.prototype, "string", null);
|
|
115
|
-
__decorate([
|
|
116
|
-
decorator_1.http.GET('/user-id/:id'),
|
|
117
|
-
__metadata("design:type", Function),
|
|
118
|
-
__metadata("design:paramtypes", [Number]),
|
|
119
|
-
__metadata("design:returntype", void 0)
|
|
120
|
-
], Controller.prototype, "number", null);
|
|
121
|
-
__decorate([
|
|
122
|
-
decorator_1.http.GET('/boolean/:yes'),
|
|
123
|
-
__metadata("design:type", Function),
|
|
124
|
-
__metadata("design:paramtypes", [Boolean]),
|
|
125
|
-
__metadata("design:returntype", void 0)
|
|
126
|
-
], Controller.prototype, "boolean", null);
|
|
127
|
-
__decorate([
|
|
128
|
-
decorator_1.http.GET(':path').regexp('path', '.*'),
|
|
129
|
-
__metadata("design:type", Function),
|
|
130
|
-
__metadata("design:paramtypes", [String]),
|
|
131
|
-
__metadata("design:returntype", void 0)
|
|
132
|
-
], Controller.prototype, "any", null);
|
|
133
|
-
const router = router_1.Router.forControllers([Controller]);
|
|
134
|
-
globals_1.expect((_a = (await router.resolve('GET', '/user/peter'))) === null || _a === void 0 ? void 0 : _a.routeConfig.action).toMatchObject({ controller: Controller, methodName: 'string' });
|
|
135
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
136
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/user/peter')).toBe('peter');
|
|
137
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/user-id/123')).toBe(123);
|
|
138
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/user-id/asd')).toMatchObject({ message: 'Validation failed: id(No number given): invalid_number' });
|
|
139
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/boolean/1')).toBe(true);
|
|
140
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/boolean/false')).toBe(false);
|
|
141
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/any')).toBe('any');
|
|
142
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/any/path')).toBe('any/path');
|
|
143
|
-
});
|
|
144
|
-
globals_1.test('router HttpRequest', async () => {
|
|
145
|
-
class Controller {
|
|
146
|
-
anyReq(req, path) {
|
|
147
|
-
return [req.url, path];
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
__decorate([
|
|
151
|
-
decorator_1.http.GET(':path').regexp('path', '.*'),
|
|
152
|
-
__metadata("design:type", Function),
|
|
153
|
-
__metadata("design:paramtypes", [model_1.HttpRequest, String]),
|
|
154
|
-
__metadata("design:returntype", void 0)
|
|
155
|
-
], Controller.prototype, "anyReq", null);
|
|
156
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
157
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/req/any/path')).toEqual(['/req/any/path', 'req/any/path']);
|
|
158
|
-
});
|
|
159
|
-
globals_1.test('router parameterResolver', async () => {
|
|
160
|
-
class User {
|
|
161
|
-
constructor(username) {
|
|
162
|
-
this.username = username;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
class Controller {
|
|
166
|
-
route1(user) {
|
|
167
|
-
return [user.username];
|
|
168
|
-
}
|
|
169
|
-
route2(user) {
|
|
170
|
-
return [user.username];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
__decorate([
|
|
174
|
-
decorator_1.http.GET('user/:username'),
|
|
175
|
-
__metadata("design:type", Function),
|
|
176
|
-
__metadata("design:paramtypes", [User]),
|
|
177
|
-
__metadata("design:returntype", void 0)
|
|
178
|
-
], Controller.prototype, "route1", null);
|
|
179
|
-
__decorate([
|
|
180
|
-
decorator_1.http.GET('group'),
|
|
181
|
-
__metadata("design:type", Function),
|
|
182
|
-
__metadata("design:paramtypes", [User]),
|
|
183
|
-
__metadata("design:returntype", void 0)
|
|
184
|
-
], Controller.prototype, "route2", null);
|
|
185
|
-
class MyRouteParameterResolver {
|
|
186
|
-
resolve(context) {
|
|
187
|
-
if (!context.parameters.username)
|
|
188
|
-
throw new Error('No :username specified');
|
|
189
|
-
return new User(context.parameters.username);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
const httpKernel = createHttpKernel([Controller], [router_1.RouteParameterResolverTag.provide(MyRouteParameterResolver).forClassType(User)]);
|
|
193
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/user/peter')).toEqual(['peter']);
|
|
194
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/group')).toEqual('Internal error');
|
|
195
|
-
});
|
|
196
|
-
globals_1.test('router body', async () => {
|
|
197
|
-
class Body {
|
|
198
|
-
}
|
|
199
|
-
__decorate([
|
|
200
|
-
type_1.t,
|
|
201
|
-
__metadata("design:type", String)
|
|
202
|
-
], Body.prototype, "username", void 0);
|
|
203
|
-
class Controller {
|
|
204
|
-
anyReq(body, req) {
|
|
205
|
-
return [body.username, body instanceof Body, req.url];
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
__decorate([
|
|
209
|
-
decorator_1.http.POST(),
|
|
210
|
-
__param(0, decorator_1.http.body()),
|
|
211
|
-
__metadata("design:type", Function),
|
|
212
|
-
__metadata("design:paramtypes", [Body, model_1.HttpRequest]),
|
|
213
|
-
__metadata("design:returntype", void 0)
|
|
214
|
-
], Controller.prototype, "anyReq", null);
|
|
215
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
216
|
-
globals_1.expect(await httpKernel.handleRequestFor('POST', '/', { username: 'Peter' })).toEqual(['Peter', true, '/']);
|
|
217
|
-
});
|
|
218
|
-
globals_1.test('router body double', async () => {
|
|
219
|
-
class Body {
|
|
220
|
-
}
|
|
221
|
-
__decorate([
|
|
222
|
-
type_1.t,
|
|
223
|
-
__metadata("design:type", String)
|
|
224
|
-
], Body.prototype, "username", void 0);
|
|
225
|
-
class Controller {
|
|
226
|
-
anyReq(body, body2, req) {
|
|
227
|
-
return [body2.username, body2 instanceof Body && body instanceof Body, req.url];
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
__decorate([
|
|
231
|
-
decorator_1.http.POST(),
|
|
232
|
-
__param(0, decorator_1.http.body()), __param(1, decorator_1.http.body()),
|
|
233
|
-
__metadata("design:type", Function),
|
|
234
|
-
__metadata("design:paramtypes", [Body, Body, model_1.HttpRequest]),
|
|
235
|
-
__metadata("design:returntype", void 0)
|
|
236
|
-
], Controller.prototype, "anyReq", null);
|
|
237
|
-
const httpData = decorator_1.httpClass._fetch(Controller);
|
|
238
|
-
if (!httpData)
|
|
239
|
-
throw new Error('httpClass undefined');
|
|
240
|
-
const action = [...httpData.getActions()][0];
|
|
241
|
-
globals_1.expect(action.methodName).toBe('anyReq');
|
|
242
|
-
globals_1.expect(action.httpMethod).toBe('POST');
|
|
243
|
-
globals_1.expect(action.parameters['body']).not.toBeUndefined();
|
|
244
|
-
globals_1.expect(action.parameters['body'].name).toBe('body');
|
|
245
|
-
globals_1.expect(action.parameters['body2']).not.toBeUndefined();
|
|
246
|
-
globals_1.expect(action.parameters['body2'].name).toBe('body2');
|
|
247
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
248
|
-
globals_1.expect(await httpKernel.handleRequestFor('POST', '/', { username: 'Peter' })).toEqual(['Peter', true, '/']);
|
|
249
|
-
});
|
|
250
|
-
globals_1.test('router groups', async () => {
|
|
251
|
-
{
|
|
252
|
-
class Controller {
|
|
253
|
-
a() {
|
|
254
|
-
}
|
|
255
|
-
b() {
|
|
256
|
-
}
|
|
257
|
-
c() {
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
__decorate([
|
|
261
|
-
decorator_1.http.GET('a').group('a'),
|
|
262
|
-
__metadata("design:type", Function),
|
|
263
|
-
__metadata("design:paramtypes", []),
|
|
264
|
-
__metadata("design:returntype", void 0)
|
|
265
|
-
], Controller.prototype, "a", null);
|
|
266
|
-
__decorate([
|
|
267
|
-
decorator_1.http.GET('b'),
|
|
268
|
-
__metadata("design:type", Function),
|
|
269
|
-
__metadata("design:paramtypes", []),
|
|
270
|
-
__metadata("design:returntype", void 0)
|
|
271
|
-
], Controller.prototype, "b", null);
|
|
272
|
-
__decorate([
|
|
273
|
-
decorator_1.http.GET('c').group('c'),
|
|
274
|
-
__metadata("design:type", Function),
|
|
275
|
-
__metadata("design:paramtypes", []),
|
|
276
|
-
__metadata("design:returntype", void 0)
|
|
277
|
-
], Controller.prototype, "c", null);
|
|
278
|
-
const httpData = decorator_1.httpClass._fetch(Controller);
|
|
279
|
-
if (!httpData)
|
|
280
|
-
throw new Error('httpClass undefined');
|
|
281
|
-
globals_1.expect(httpData.getAction('a').groups).toEqual(['a']);
|
|
282
|
-
globals_1.expect(httpData.getAction('b').groups).toEqual([]);
|
|
283
|
-
globals_1.expect(httpData.getAction('c').groups).toEqual(['c']);
|
|
284
|
-
}
|
|
285
|
-
{
|
|
286
|
-
let Controller = class Controller {
|
|
287
|
-
a() {
|
|
288
|
-
}
|
|
289
|
-
b() {
|
|
290
|
-
}
|
|
291
|
-
c() {
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
__decorate([
|
|
295
|
-
decorator_1.http.GET('a').group('a'),
|
|
296
|
-
__metadata("design:type", Function),
|
|
297
|
-
__metadata("design:paramtypes", []),
|
|
298
|
-
__metadata("design:returntype", void 0)
|
|
299
|
-
], Controller.prototype, "a", null);
|
|
300
|
-
__decorate([
|
|
301
|
-
decorator_1.http.GET('b'),
|
|
302
|
-
__metadata("design:type", Function),
|
|
303
|
-
__metadata("design:paramtypes", []),
|
|
304
|
-
__metadata("design:returntype", void 0)
|
|
305
|
-
], Controller.prototype, "b", null);
|
|
306
|
-
__decorate([
|
|
307
|
-
decorator_1.http.GET('c').group('c'),
|
|
308
|
-
__metadata("design:type", Function),
|
|
309
|
-
__metadata("design:paramtypes", []),
|
|
310
|
-
__metadata("design:returntype", void 0)
|
|
311
|
-
], Controller.prototype, "c", null);
|
|
312
|
-
Controller = __decorate([
|
|
313
|
-
decorator_1.http.groupAll('all')
|
|
314
|
-
], Controller);
|
|
315
|
-
const httpData = decorator_1.httpClass._fetch(Controller);
|
|
316
|
-
if (!httpData)
|
|
317
|
-
throw new Error('httpClass undefined');
|
|
318
|
-
globals_1.expect(httpData.getAction('a').groups).toEqual(['a', 'all']);
|
|
319
|
-
globals_1.expect(httpData.getAction('b').groups).toEqual(['all']);
|
|
320
|
-
globals_1.expect(httpData.getAction('c').groups).toEqual(['c', 'all']);
|
|
321
|
-
}
|
|
322
|
-
globals_1.expect(() => {
|
|
323
|
-
let ControllerC = class ControllerC {
|
|
324
|
-
};
|
|
325
|
-
ControllerC = __decorate([
|
|
326
|
-
decorator_1.http.group('all')
|
|
327
|
-
], ControllerC);
|
|
328
|
-
}).toThrow('Property decorators can only be used on class properties');
|
|
329
|
-
});
|
|
330
|
-
globals_1.test('router query', async () => {
|
|
331
|
-
class Controller {
|
|
332
|
-
anyReq(test) {
|
|
333
|
-
return test;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
__decorate([
|
|
337
|
-
decorator_1.http.GET('my-action'),
|
|
338
|
-
__param(0, decorator_1.http.query().optional),
|
|
339
|
-
__metadata("design:type", Function),
|
|
340
|
-
__metadata("design:paramtypes", [Number]),
|
|
341
|
-
__metadata("design:returntype", void 0)
|
|
342
|
-
], Controller.prototype, "anyReq", null);
|
|
343
|
-
const httpData = decorator_1.httpClass._fetch(Controller);
|
|
344
|
-
if (!httpData)
|
|
345
|
-
throw new Error('httpClass undefined');
|
|
346
|
-
const action = [...httpData.getActions()][0];
|
|
347
|
-
globals_1.expect(action.methodName).toBe('anyReq');
|
|
348
|
-
globals_1.expect(action.httpMethod).toBe('GET');
|
|
349
|
-
globals_1.expect(action.parameters['test']).not.toBeUndefined();
|
|
350
|
-
globals_1.expect(action.parameters['test'].name).toBe('test');
|
|
351
|
-
globals_1.expect(action.parameters['test'].type).toBe('query');
|
|
352
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
353
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/my-action?test=123')).toEqual(123);
|
|
354
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/my-action')).toEqual(undefined);
|
|
355
|
-
});
|
|
356
|
-
globals_1.test('router query all', async () => {
|
|
357
|
-
class AnyReqQuery {
|
|
358
|
-
}
|
|
359
|
-
__decorate([
|
|
360
|
-
type_1.t.optional,
|
|
361
|
-
__metadata("design:type", String)
|
|
362
|
-
], AnyReqQuery.prototype, "test", void 0);
|
|
363
|
-
__decorate([
|
|
364
|
-
type_1.t.optional,
|
|
365
|
-
__metadata("design:type", String)
|
|
366
|
-
], AnyReqQuery.prototype, "filter", void 0);
|
|
367
|
-
__decorate([
|
|
368
|
-
type_1.t.optional,
|
|
369
|
-
__metadata("design:type", Number)
|
|
370
|
-
], AnyReqQuery.prototype, "page", void 0);
|
|
371
|
-
class Controller {
|
|
372
|
-
anyReq(anyReqQuery) {
|
|
373
|
-
return anyReqQuery;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
__decorate([
|
|
377
|
-
decorator_1.http.GET('my-action'),
|
|
378
|
-
__param(0, decorator_1.http.queries()),
|
|
379
|
-
__metadata("design:type", Function),
|
|
380
|
-
__metadata("design:paramtypes", [AnyReqQuery]),
|
|
381
|
-
__metadata("design:returntype", void 0)
|
|
382
|
-
], Controller.prototype, "anyReq", null);
|
|
383
|
-
const httpKernel = createHttpKernel([Controller]);
|
|
384
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/my-action?test=123')).toEqual({ test: '123' });
|
|
385
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/my-action')).toEqual({});
|
|
386
|
-
globals_1.expect(await httpKernel.handleRequestFor('GET', '/my-action?filter=page&page=5')).toEqual({ filter: 'page', page: 5 });
|
|
387
|
-
});
|
|
388
|
-
globals_1.test('router dotToUrlPath', () => {
|
|
389
|
-
globals_1.expect(router_1.dotToUrlPath('peter')).toBe('peter');
|
|
390
|
-
globals_1.expect(router_1.dotToUrlPath('foo.bar')).toBe('foo[bar]');
|
|
391
|
-
globals_1.expect(router_1.dotToUrlPath('foo.bar.deep')).toBe('foo[bar][deep]');
|
|
392
|
-
globals_1.expect(router_1.dotToUrlPath('foo.bar.deep.very')).toBe('foo[bar][deep][very]');
|
|
393
|
-
});
|
|
394
|
-
globals_1.test('router url resolve', async () => {
|
|
395
|
-
class AnyReqQuery {
|
|
396
|
-
}
|
|
397
|
-
__decorate([
|
|
398
|
-
type_1.t.optional,
|
|
399
|
-
__metadata("design:type", String)
|
|
400
|
-
], AnyReqQuery.prototype, "test", void 0);
|
|
401
|
-
__decorate([
|
|
402
|
-
type_1.t.optional,
|
|
403
|
-
__metadata("design:type", String)
|
|
404
|
-
], AnyReqQuery.prototype, "filter", void 0);
|
|
405
|
-
__decorate([
|
|
406
|
-
type_1.t.optional,
|
|
407
|
-
__metadata("design:type", Number)
|
|
408
|
-
], AnyReqQuery.prototype, "page", void 0);
|
|
409
|
-
class Controller {
|
|
410
|
-
first() {
|
|
411
|
-
return '';
|
|
412
|
-
}
|
|
413
|
-
second(peter) {
|
|
414
|
-
return '';
|
|
415
|
-
}
|
|
416
|
-
secondQuery(peter) {
|
|
417
|
-
return '';
|
|
418
|
-
}
|
|
419
|
-
secondQuery2(peter) {
|
|
420
|
-
return '';
|
|
421
|
-
}
|
|
422
|
-
third(params) {
|
|
423
|
-
return params;
|
|
424
|
-
}
|
|
425
|
-
third2(params) {
|
|
426
|
-
return params;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
__decorate([
|
|
430
|
-
decorator_1.http.GET('').name('first'),
|
|
431
|
-
__metadata("design:type", Function),
|
|
432
|
-
__metadata("design:paramtypes", []),
|
|
433
|
-
__metadata("design:returntype", void 0)
|
|
434
|
-
], Controller.prototype, "first", null);
|
|
435
|
-
__decorate([
|
|
436
|
-
decorator_1.http.GET(':peter').name('second'),
|
|
437
|
-
__metadata("design:type", Function),
|
|
438
|
-
__metadata("design:paramtypes", [String]),
|
|
439
|
-
__metadata("design:returntype", void 0)
|
|
440
|
-
], Controller.prototype, "second", null);
|
|
441
|
-
__decorate([
|
|
442
|
-
decorator_1.http.GET('').name('secondQuery'),
|
|
443
|
-
__param(0, decorator_1.http.query()),
|
|
444
|
-
__metadata("design:type", Function),
|
|
445
|
-
__metadata("design:paramtypes", [String]),
|
|
446
|
-
__metadata("design:returntype", void 0)
|
|
447
|
-
], Controller.prototype, "secondQuery", null);
|
|
448
|
-
__decorate([
|
|
449
|
-
decorator_1.http.GET('').name('secondQuery2'),
|
|
450
|
-
__param(0, decorator_1.http.query('changed')),
|
|
451
|
-
__metadata("design:type", Function),
|
|
452
|
-
__metadata("design:paramtypes", [String]),
|
|
453
|
-
__metadata("design:returntype", void 0)
|
|
454
|
-
], Controller.prototype, "secondQuery2", null);
|
|
455
|
-
__decorate([
|
|
456
|
-
decorator_1.http.GET('third').name('third'),
|
|
457
|
-
__param(0, decorator_1.http.queries()),
|
|
458
|
-
__metadata("design:type", Function),
|
|
459
|
-
__metadata("design:paramtypes", [AnyReqQuery]),
|
|
460
|
-
__metadata("design:returntype", void 0)
|
|
461
|
-
], Controller.prototype, "third", null);
|
|
462
|
-
__decorate([
|
|
463
|
-
decorator_1.http.GET('third2').name('third2'),
|
|
464
|
-
__param(0, decorator_1.http.queries('deep')),
|
|
465
|
-
__metadata("design:type", Function),
|
|
466
|
-
__metadata("design:paramtypes", [AnyReqQuery]),
|
|
467
|
-
__metadata("design:returntype", void 0)
|
|
468
|
-
], Controller.prototype, "third2", null);
|
|
469
|
-
const router = router_1.Router.forControllers([Controller]);
|
|
470
|
-
globals_1.expect(router.resolveUrl('first')).toBe('/');
|
|
471
|
-
globals_1.expect(router.resolveUrl('second', { peter: 'foo' })).toBe('/foo');
|
|
472
|
-
globals_1.expect(router.resolveUrl('secondQuery', { peter: 'foo' })).toBe('/?peter=foo');
|
|
473
|
-
globals_1.expect(router.resolveUrl('secondQuery2', { peter: 'foo' })).toBe('/?changed=foo');
|
|
474
|
-
globals_1.expect(router.resolveUrl('third', {})).toBe('/third');
|
|
475
|
-
globals_1.expect(router.resolveUrl('third', { params: { test: 123 } })).toBe('/third?test=123');
|
|
476
|
-
globals_1.expect(router.resolveUrl('third', { params: { test: 123, filter: 'peter' } })).toBe('/third?test=123&filter=peter');
|
|
477
|
-
globals_1.expect(router.resolveUrl('third2', {})).toBe('/third2');
|
|
478
|
-
globals_1.expect(router.resolveUrl('third2', { params: { test: 123 } })).toBe('/third2?deep[test]=123');
|
|
479
|
-
globals_1.expect(router.resolveUrl('third2', { params: { test: 123, filter: 'peter' } })).toBe('/third2?deep[test]=123&deep[filter]=peter');
|
|
480
|
-
});
|
|
481
|
-
//# sourceMappingURL=router.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router.spec.js","sourceRoot":"","sources":["../../../tests/router.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA6C;AAC7C,4BAA0B;AAC1B,0CAA+G;AAC/G,gDAAmD;AACnD,wCAAkC;AAClC,sCAAyD;AACzD,0CAA2C;AAC3C,0CAAiD;AACjD,gDAA4E;AAC5E,4CAAyC;AACzC,wCAA2C;AAE3C,sCAA4C;AAE5C,SAAS,gBAAgB,CAAC,WAAwB,EAAE,YAAiC,EAAE;IACnF,MAAM,YAAY,GAAG,IAAI,kBAAY,EAAE,CAAC;IACxC,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,IAAI,QAAQ,YAAY,cAAG;YAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChG,MAAM,MAAM,GAAG,eAAM,CAAC,cAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,0BAAe,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,eAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,WAAW,EAAE,mBAAY,EAAE,eAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3I,MA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