@dooboostore/simple-boot-http-server 1.0.25 → 1.0.27
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/README.md +100 -14
- package/dist/cjs/SimpleBootHttpServer.js +34 -18
- package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
- package/dist/cjs/bundle-entry.js +34 -24
- package/dist/cjs/bundle-entry.js.map +2 -2
- package/dist/cjs/codes/Mimes.js +2 -0
- package/dist/cjs/codes/Mimes.js.map +2 -2
- package/dist/cjs/decorators/MethodMapping.js +2 -2
- package/dist/cjs/decorators/MethodMapping.js.map +2 -2
- package/dist/cjs/filters/ResourceFilter.js +0 -1
- package/dist/cjs/filters/ResourceFilter.js.map +2 -2
- package/dist/cjs/option/HttpServerOption.js.map +2 -2
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/cjs/websocket/WebSocketClient.js +2 -1
- package/dist/cjs/websocket/WebSocketClient.js.map +2 -2
- package/dist/cjs/websocket/WebSocketManager.js +68 -40
- package/dist/cjs/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm/SimpleBootHttpServer.js +34 -18
- package/dist/esm/SimpleBootHttpServer.js.map +2 -2
- package/dist/esm/bundle-entry.js +14 -12
- package/dist/esm/bundle-entry.js.map +2 -2
- package/dist/esm/codes/Mimes.js +2 -0
- package/dist/esm/codes/Mimes.js.map +2 -2
- package/dist/esm/decorators/MethodMapping.js +2 -2
- package/dist/esm/decorators/MethodMapping.js.map +2 -2
- package/dist/esm/filters/ResourceFilter.js +0 -1
- package/dist/esm/filters/ResourceFilter.js.map +2 -2
- package/dist/esm/option/HttpServerOption.js.map +2 -2
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/esm/websocket/WebSocketClient.js +3 -2
- package/dist/esm/websocket/WebSocketClient.js.map +2 -2
- package/dist/esm/websocket/WebSocketManager.js +68 -40
- package/dist/esm/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +19134 -9180
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
- package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
- package/dist/types/bundle-entry.d.ts +7 -12
- package/dist/types/bundle-entry.d.ts.map +1 -1
- package/dist/types/codes/Mimes.d.ts +2 -0
- package/dist/types/codes/Mimes.d.ts.map +1 -1
- package/dist/types/decorators/MethodMapping.d.ts +8 -0
- package/dist/types/decorators/MethodMapping.d.ts.map +1 -1
- package/dist/types/filters/ResourceFilter.d.ts.map +1 -1
- package/dist/types/option/HttpServerOption.d.ts +6 -2
- package/dist/types/option/HttpServerOption.d.ts.map +1 -1
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts +5 -15
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketClient.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketManager.d.ts +3 -1
- package/dist/types/websocket/WebSocketManager.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +19121 -9173
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
- package/dist/umd-bundle/websocket-client.umd.js +412 -1482
- package/dist/umd-bundle/websocket-client.umd.js.map +4 -4
- package/package.json +8 -8
- package/src/SimpleBootHttpServer.ts +37 -18
- package/src/bundle-entry.ts +12 -12
- package/src/codes/Mimes.ts +2 -0
- package/src/decorators/MethodMapping.ts +14 -7
- package/src/filters/ResourceFilter.ts +0 -1
- package/src/option/HttpServerOption.ts +4 -2
- package/src/proxy/TopicProtocolApiServiceProxy.ts +260 -275
- package/src/websocket/WebSocketClient.ts +3 -2
- package/src/websocket/WebSocketManager.ts +69 -41
package/README.md
CHANGED
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
## 🚀 Key Features
|
|
12
12
|
|
|
13
|
-
- **Declarative Routing**: Map URL paths and HTTP methods directly to your controller methods using decorators like `@Router`, `@Route`, `@GET`,
|
|
14
|
-
- **Dependency Injection (DI)**: Manage dependencies between services automatically using the `@Sim` decorator
|
|
15
|
-
- **Middleware & Filters**: Systematically separate pre/post-processing logic (CORS,
|
|
13
|
+
- **Declarative Routing**: Map URL paths and HTTP methods directly to your controller methods using decorators like `@Router`, `@Route`, `@GET`, `@POST`, `@PUT`, `@DELETE`, `@PATCH`.
|
|
14
|
+
- **Dependency Injection (DI)**: Manage dependencies between services automatically using the `@Sim` decorator — the exact same DI/AOP container as `@dooboostore/simple-boot`.
|
|
15
|
+
- **Middleware & Filters**: Systematically separate pre/post-processing logic (CORS, caching, auth, logging, OpenAPI generation, etc.) through the `Filter` interface.
|
|
16
16
|
- **Powerful Exception Handling**: Leverage AOP-based `GlobalAdvice` to isolate business logic from error handling logic.
|
|
17
|
-
- **
|
|
17
|
+
- **Manual Response Streaming**: Opt out of the automatic response pipeline with `res: { manual: true }` to stream Server-Sent Events, NDJSON, or any long-lived response directly from the injected `ServerResponse`.
|
|
18
|
+
- **Real-time WebSocket Protocol**: A topic-based pub/sub protocol over a single socket — subscribe/unsubscribe, request/response, *and* server-initiated events the server can `await` a client reply for — with automatic reconnection and re-subscription.
|
|
19
|
+
- **Binary File Transfer over WebSocket**: `Buffer`/`File` values anywhere in a message are detected automatically and shipped as raw bytes in a compact binary frame (length header + JSON metadata + concatenated buffers) instead of being bloated with base64 — no separate upload endpoint needed.
|
|
18
20
|
- **Resource Resolvers**: Provides `ResourceResolver` for serving static files and templates effortlessly.
|
|
19
21
|
|
|
20
22
|
---
|
|
@@ -33,7 +35,7 @@ pnpm add @dooboostore/simple-boot-http-server reflect-metadata
|
|
|
33
35
|
Create a service that contains business logic using `@Sim`.
|
|
34
36
|
|
|
35
37
|
```typescript
|
|
36
|
-
import { Sim } from '@dooboostore/simple-boot
|
|
38
|
+
import { Sim } from '@dooboostore/simple-boot';
|
|
37
39
|
|
|
38
40
|
@Sim
|
|
39
41
|
export class UserService {
|
|
@@ -49,9 +51,8 @@ export class UserService {
|
|
|
49
51
|
Define endpoints using decorators. Inject services through the constructor.
|
|
50
52
|
|
|
51
53
|
```typescript
|
|
52
|
-
import { Sim } from '@dooboostore/simple-boot
|
|
53
|
-
import {
|
|
54
|
-
import { GET, POST } from '@dooboostore/simple-boot-http-server/decorators/MethodMapping';
|
|
54
|
+
import { Sim, Router, Route } from '@dooboostore/simple-boot';
|
|
55
|
+
import { GET, POST } from '@dooboostore/simple-boot-http-server';
|
|
55
56
|
|
|
56
57
|
@Sim
|
|
57
58
|
@Router({ path: '/api' })
|
|
@@ -71,8 +72,7 @@ Configure `HttpServerOption` and launch the server.
|
|
|
71
72
|
|
|
72
73
|
```typescript
|
|
73
74
|
import 'reflect-metadata';
|
|
74
|
-
import { SimpleBootHttpServer } from '@dooboostore/simple-boot-http-server
|
|
75
|
-
import { HttpServerOption } from '@dooboostore/simple-boot-http-server/option/HttpServerOption';
|
|
75
|
+
import { SimpleBootHttpServer, HttpServerOption } from '@dooboostore/simple-boot-http-server';
|
|
76
76
|
|
|
77
77
|
const option = new HttpServerOption(
|
|
78
78
|
{ listen: { port: 8080 } },
|
|
@@ -88,18 +88,104 @@ console.log('🚀 Server running at http://localhost:8080');
|
|
|
88
88
|
## 🛠️ Advanced Features
|
|
89
89
|
|
|
90
90
|
### Filters
|
|
91
|
-
Implement the `Filter` interface to perform common request processing.
|
|
91
|
+
Implement the `Filter` interface to perform common request processing. A filter has two hooks: `proceedBefore` runs before the route handler (return `false` to stop the chain right there), and `proceedAfter` runs after it (receives `before`, the boolean `proceedBefore` returned).
|
|
92
92
|
|
|
93
93
|
```typescript
|
|
94
|
+
import { Sim } from '@dooboostore/simple-boot';
|
|
95
|
+
import { Filter, RequestResponse, SimpleBootHttpServer } from '@dooboostore/simple-boot-http-server';
|
|
96
|
+
|
|
94
97
|
@Sim
|
|
95
98
|
export class MyAuthFilter implements Filter {
|
|
96
|
-
async
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
async onInit(app: SimpleBootHttpServer) {}
|
|
100
|
+
|
|
101
|
+
async proceedBefore({ rr }: { rr: RequestResponse; app: SimpleBootHttpServer; carrier: Map<string, any> }): Promise<boolean> {
|
|
102
|
+
// Returning false stops the request from proceeding to the next filter/route handler.
|
|
103
|
+
return true;
|
|
99
104
|
}
|
|
105
|
+
|
|
106
|
+
async proceedAfter({ rr, before }: { rr: RequestResponse; app: SimpleBootHttpServer; before: boolean; carrier: Map<string, any> }): Promise<boolean> {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Manual Response Streaming (SSE / NDJSON)
|
|
113
|
+
By default, a route's return value is automatically serialized and written as a single response. Set `res: { manual: true }` to skip that entirely and take direct control of the injected `ServerResponse` — the request handler's promise simply stays pending until you're done, so nothing else writes to the response underneath you.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { ServerResponse } from 'http';
|
|
117
|
+
import { Route } from '@dooboostore/simple-boot';
|
|
118
|
+
import { GET } from '@dooboostore/simple-boot-http-server';
|
|
119
|
+
|
|
120
|
+
@Route({ path: '/stream/time' })
|
|
121
|
+
@GET({ res: { manual: true } }) // status/header/body auto-write is skipped
|
|
122
|
+
streamTime(res: ServerResponse) {
|
|
123
|
+
res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache' });
|
|
124
|
+
|
|
125
|
+
return new Promise<void>(resolve => {
|
|
126
|
+
const timer = setInterval(() => {
|
|
127
|
+
res.write(`data: ${JSON.stringify({ time: new Date().toISOString() })}\n\n`);
|
|
128
|
+
}, 1000);
|
|
129
|
+
res.on('close', () => { clearInterval(timer); resolve(); }); // clean up when the client disconnects
|
|
130
|
+
});
|
|
100
131
|
}
|
|
101
132
|
```
|
|
102
133
|
|
|
134
|
+
`res: { manual: true }` is a discriminated union with the normal `{ status, header, contentType }` shape, so TypeScript won't let you accidentally combine them — a route is either auto-written or fully manual.
|
|
135
|
+
|
|
136
|
+
### WebSocket: Topic Protocol + Binary File Transfer
|
|
137
|
+
Register `WebSocketManager` as a `webSocketEndPoints` entry to get a topic-based pub/sub protocol over a single connection — subscribe/unsubscribe, request/response, and **server-initiated events the server can `await` a client reply for**.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { WebSocketManager } from '@dooboostore/simple-boot-http-server/websocket/WebSocketManager';
|
|
141
|
+
|
|
142
|
+
const option = new HttpServerOption({
|
|
143
|
+
webSocketEndPoints: [WebSocketManager],
|
|
144
|
+
listen: { port: 8080 }
|
|
145
|
+
}, { rootRouter: AppRouter });
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Any `@Sim({ symbol })`-tagged service's public methods become callable by name over the socket via an intent target (`Symbol.for(ClassName)://methodName`) — no extra decorator needed:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
@Sim({ symbol: Symbol.for('UserService') })
|
|
152
|
+
export class UserService {
|
|
153
|
+
say(message: any) {
|
|
154
|
+
return { echo: message };
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`WebSocketClient` (the browser-side counterpart) ships as its own standalone UMD bundle at `dist/umd-bundle/websocket-client.umd.js` — it's *not* resolvable through the package's `exports` map, it's meant to be loaded with a plain `<script>` tag:
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<script src="./node_modules/@dooboostore/simple-boot-http-server/dist/umd-bundle/websocket-client.umd.js"></script>
|
|
163
|
+
<script>
|
|
164
|
+
const { WebSocketClient } = dooboostoreSimpleBootHttpServerWebSocketClient;
|
|
165
|
+
const ws = new WebSocketClient('http://localhost:8080', { retryConnectionCount: Infinity, retryConnectionDelay: 1000 });
|
|
166
|
+
|
|
167
|
+
const subject = ws.subject('Symbol.for(UserService)://say', { type: 'intent' });
|
|
168
|
+
subject.observable.subscribe({ next: data => console.log('received:', data) });
|
|
169
|
+
subject.send({ hello: 'world' });
|
|
170
|
+
|
|
171
|
+
// subject.observable.subscribe(...) returns a *local* RxJS-style subscription —
|
|
172
|
+
// unsubscribing it only stops local delivery. To actually tell the server to
|
|
173
|
+
// drop the topic, call the outer object's own unsubscribe:
|
|
174
|
+
subject.unsubscribe();
|
|
175
|
+
</script>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Drop a `Buffer` (Node) or `File`/`Blob` (browser) anywhere inside a message body and it's detected automatically and shipped as raw bytes in a compact binary frame (4-byte length header + JSON metadata with `$file` references + concatenated buffers) instead of being base64-inflated inside JSON — reconstructed transparently as a real `File`/`{name, mime, size, buffer}` on the other side:
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
say(message: any) {
|
|
182
|
+
const buffer = Buffer.from('hello binary world', 'utf8');
|
|
183
|
+
return { echo: message, file: { name: 'greeting.txt', mime: 'text/plain', buffer } };
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
See the [WebSocket Detailed Guide](https://github.com/dooboostore-develop/packages/tree/main/simple-boot-http-server/document/websocket) for the full wire protocol.
|
|
188
|
+
|
|
103
189
|
---
|
|
104
190
|
|
|
105
191
|
## 📖 Learn More
|
|
@@ -58,7 +58,7 @@ class SimpleBootHttpServer extends import_simple_boot.SimpleApplication {
|
|
|
58
58
|
otherInstanceSim ??= /* @__PURE__ */ new Map();
|
|
59
59
|
otherInstanceSim.set(SimpleBootHttpServer, this);
|
|
60
60
|
super.run(otherInstanceSim);
|
|
61
|
-
const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...this.option.filters ?? []];
|
|
61
|
+
const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...(this.option.filters ?? []).map((it) => it.filter)];
|
|
62
62
|
Promise.all(targets.map((it) => typeof it === "function" ? this.simstanceManager.getOrNewSim({ target: it }) : it).map((it) => it.onInit(this))).then((it) => {
|
|
63
63
|
this.startServer();
|
|
64
64
|
});
|
|
@@ -152,8 +152,20 @@ class SimpleBootHttpServer extends import_simple_boot.SimpleApplication {
|
|
|
152
152
|
};
|
|
153
153
|
for (let i = 0; this.option.filters && i < this.option.filters.length; i++) {
|
|
154
154
|
const it = this.option.filters[i];
|
|
155
|
-
|
|
155
|
+
let isSkip = false;
|
|
156
|
+
if (typeof it.isSupport === "boolean") {
|
|
157
|
+
isSkip = !it.isSupport;
|
|
158
|
+
} else if (typeof it.isSupport === "object") {
|
|
159
|
+
isSkip = !it.isSupport.test(rr.reqUrlPathName);
|
|
160
|
+
} else if (typeof it.isSupport === "function") {
|
|
161
|
+
isSkip = !it.isSupport(rr);
|
|
162
|
+
}
|
|
163
|
+
if (isSkip) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
156
166
|
let sw = true;
|
|
167
|
+
const itFilter = it.filter;
|
|
168
|
+
const execute = typeof itFilter === "function" ? this.simstanceManager.getOrNewSim({ target: itFilter }) : itFilter;
|
|
157
169
|
if (execute?.proceedBefore) {
|
|
158
170
|
sw = await execute.proceedBefore({ rr, app: this, carrier: filter.carrier });
|
|
159
171
|
filter.filters.push({ filter: execute, sw });
|
|
@@ -279,23 +291,27 @@ class SimpleBootHttpServer extends import_simple_boot.SimpleApplication {
|
|
|
279
291
|
target: moduleInstance,
|
|
280
292
|
targetKey: it.propertyKey
|
|
281
293
|
}, otherStorage);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
const resConfig = it.config?.res;
|
|
295
|
+
if (resConfig?.manual === true) {
|
|
296
|
+
} else {
|
|
297
|
+
if (it.config?.resolver) {
|
|
298
|
+
const execute = typeof it.config.resolver === "function" ? this.simstanceManager.getOrNewSim({ target: it.config.resolver }) : it.config.resolver;
|
|
299
|
+
data = await execute?.resolve?.(data, rr);
|
|
300
|
+
}
|
|
301
|
+
const status = resConfig?.status ?? import_HttpStatus.HttpStatus.Ok;
|
|
302
|
+
const headers = resConfig?.header ?? {};
|
|
303
|
+
if (resConfig?.contentType) {
|
|
304
|
+
headers[import_HttpHeaders.HttpHeaders.ContentType] = resConfig.contentType;
|
|
305
|
+
}
|
|
306
|
+
if ((resConfig?.contentType?.toLowerCase().indexOf(import_Mimes.Mimes.ApplicationJson.toLowerCase()) ?? -1) > -1) {
|
|
307
|
+
data = JSON.stringify(data);
|
|
308
|
+
} else if (data && typeof data === "object") {
|
|
309
|
+
data = JSON.stringify(data);
|
|
310
|
+
}
|
|
311
|
+
rr.resSetHeaders(headers);
|
|
312
|
+
rr.resSetStatusCode(status);
|
|
313
|
+
rr.resWrite(data);
|
|
295
314
|
}
|
|
296
|
-
rr.resSetHeaders(headers);
|
|
297
|
-
rr.resSetStatusCode(status);
|
|
298
|
-
rr.resWrite(data);
|
|
299
315
|
}
|
|
300
316
|
}
|
|
301
317
|
if (this.option.noSuchRouteEndPointMappingThrow && methods.length <= 0 && rr.reqMethod()?.toUpperCase() !== import_HttpMethod.HttpMethod.OPTIONS) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SimpleBootHttpServer.ts"],
|
|
4
|
-
"sourcesContent": ["import {SimpleApplication} from '@dooboostore/simple-boot';\nimport {HttpServerOption} from './option/HttpServerOption';\nimport {ConstructorType} from '@dooboostore/core';\nimport {IncomingMessage, Server as HttpServer, ServerResponse} from 'http'\nimport {Server as HttpsServer} from 'https'; // Add HTTPS support\nimport {WebSocketServer, WebSocket} from 'ws';\nimport {RequestResponse} from './models/RequestResponse';\nimport {getUrlMapping, getUrlMappings, SaveMappingConfig, UrlMappingSituationType} from './decorators/MethodMapping';\nimport {HttpStatus} from './codes/HttpStatus';\nimport {HttpHeaders} from './codes/HttpHeaders';\nimport {Mimes} from './codes/Mimes';\nimport {Filter} from './filters/Filter';\nimport {ExceptionHandlerSituationType, targetExceptionHandler} from '@dooboostore/simple-boot';\nimport {getInject, SituationTypeContainer, SituationTypeContainers} from '@dooboostore/simple-boot';\nimport {EndPoint} from './endpoints/EndPoint';\nimport {ReflectUtils} from '@dooboostore/core';\nimport {ReqFormUrlBody} from './models/datas/body/ReqFormUrlBody';\nimport {ReqJsonBody} from './models/datas/body/ReqJsonBody';\nimport {ReqHeader} from './models/datas/ReqHeader';\nimport {RouterModule} from '@dooboostore/simple-boot';\nimport {ReqMultipartFormBody} from './models/datas/body/ReqMultipartFormBody';\nimport {execValidationInValid, getValidIndex} from '@dooboostore/simple-boot';\nimport {ValidException} from '@dooboostore/simple-boot';\nimport {HttpError} from './errors/HttpError';\nimport {getRoute} from '@dooboostore/simple-boot';\nimport {OnInit} from './lifecycle/OnInit';\nimport {URLSearchParams} from 'url';\nimport {HttpMethod} from './codes/HttpMethod';\nimport {SessionManager} from './session/SessionManager';\nimport {InjectSituationType} from './inject/InjectSituationType';\nimport {ReqSearchParamsObj} from \"./models/datas/path/ReqSearchParamsObj\";\nimport {SimConfig} from '@dooboostore/simple-boot';\nimport {ReqPathData} from './models/datas/path/ReqPathData';\nimport {WebSocketEndPoint} from './endpoints/WebSocketEndPoint';\n\nexport class SimpleBootHttpServer extends SimpleApplication {\n public server?: HttpServer | HttpsServer;\n private sessionManager: SessionManager;\n private webSocketClients = new Map<WebSocket, { request: IncomingMessage }>();\n\n constructor(public option: HttpServerOption = new HttpServerOption()) {\n super(option);\n this.sessionManager = new SessionManager(this.option);\n }\n\n\n public run(otherInstanceSim?: Map<ConstructorType<any> | Function | SimConfig | symbol, any>) {\n otherInstanceSim ??= new Map<ConstructorType<any> | Function | SimConfig | symbol, any>();\n otherInstanceSim.set(SimpleBootHttpServer, this);\n super.run(otherInstanceSim);\n const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...this.option.filters ?? []];\n Promise.all(targets.map(it => (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it as ConstructorType<any>}) : it) as OnInit).map(it => it.onInit(this))).then(it => {\n this.startServer();\n });\n return this;\n }\n\n private startServer() {\n\n // const a = this.option.serverOption as HttpsServerOption;\n // this.option.serverOption?.\n\n if (this.option.serverOption && 'key' in this.option.serverOption && 'cert' in this.option.serverOption) {\n this.server = new HttpsServer(this.option.serverOption);\n const httpServer = new HttpServer();\n httpServer.on('request', (req: IncomingMessage, res: ServerResponse) => {\n res.writeHead(301, {Location: `https://${req.headers.host}${req.url}`});\n res.end();\n });\n httpServer.listen(80, this.option.listen.hostname, () => {\n console.log('HTTP redirect server running on port 80');\n });\n } else if (this.option.serverOption) {\n this.server = new HttpServer(this.option.serverOption);\n } else {\n this.server = new HttpServer();\n }\n // const thisRef = this;\n this.server.on('request', async (req: IncomingMessage, res: ServerResponse) => {\n // console.log('request', req.url);\n const transactionManager = this.option.transactionManagerFactory ? await this.option.transactionManagerFactory() : undefined;\n res.on('close', async () => {\n if (this.option.closeEndPoints) {\n for (const it of this.option.closeEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as EndPoint;\n const endPoint = execute?.endPoint(rr, this);\n if (endPoint instanceof Promise) {\n await endPoint;\n }\n } catch (e) {\n }\n }\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n res.on('error', async () => {\n if (this.option.errorEndPoints) {\n for (const it of this.option.errorEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as EndPoint;\n const endPoint = execute?.endPoint(rr, this);\n if (endPoint instanceof Promise) {\n await endPoint;\n }\n } catch (e) {\n }\n }\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n\n const rr = new RequestResponse(req, res, {sessionManager: this.sessionManager, option: this.option});\n /*\n default setting first\n */\n rr.resSetHeader(HttpHeaders.Server, 'simple-boot-http-server');\n const cookie = rr.reqCookieGet(this.option.sessionOption.key);\n if (!cookie) {\n const session = await this.sessionManager.session();\n\n const cookieParts: string[] = [];\n cookieParts.push(`${this.option.sessionOption.key}=${session.uuid}`);\n cookieParts.push(`Path=${this.option.sessionOption.path}`);\n if (this.option.sessionOption.httpOnly) cookieParts.push('HttpOnly');\n if (this.option.sessionOption.secure) cookieParts.push('Secure');\n if (this.option.sessionOption.sameSite != null && this.option.sessionOption.sameSite) cookieParts.push(`SameSite=${this.option.sessionOption.sameSite}`);\n const maxAge = (this.option.sessionOption as any).maxAge ?? (this.sessionManager.sessionOption)?.maxAge;\n if (maxAge != null) cookieParts.push(`Max-Age=${maxAge}`);\n rr.resSetHeader(HttpHeaders.SetCookie, cookieParts.join('; '));\n }\n\n const otherStorage = new Map<ConstructorType<any>, any>();\n otherStorage.set(RequestResponse, rr);\n otherStorage.set(IncomingMessage, req);\n otherStorage.set(ServerResponse, res);\n try {\n transactionManager?.try();\n if (this.option.requestEndPoints) {\n for (const it of this.option.requestEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim<EndPoint>({target: it}) : it) as EndPoint;\n execute?.endPoint(rr, this);\n } catch (e) {\n }\n }\n }\n\n const filter = {\n carrier: new Map<string, any>(),\n filters: [] as { filter: Filter, sw: boolean }[]\n };\n for (let i = 0; this.option.filters && i < this.option.filters.length; i++) {\n const it = this.option.filters[i];\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as Filter;\n let sw = true;\n if (execute?.proceedBefore) {\n sw = await execute.proceedBefore({rr, app: this, carrier: filter.carrier});\n filter.filters.push({filter: execute, sw});\n }\n if (!sw) {\n break;\n }\n }\n\n // body.. something..\n if (!rr.resIsDone()) {\n const routerModule = await super.routing(rr.reqIntent);\n otherStorage.set(RouterModule, routerModule);\n const moduleInstance = routerModule?.getModuleInstance?.();\n let methods: SaveMappingConfig[] = [];\n if (routerModule && moduleInstance) {\n // router \uD074\uB798\uC2A4 \uB0B4\uBD80\uC5D0\uC11C \uC120\uC5B8\uB41C Route\uC77C\uB54C\n if (routerModule.propertyKeys) {\n const map = routerModule.propertyKeys?.map((it: string | symbol) => {\n return {propertyKey: it, config: getUrlMapping(moduleInstance, it)} as SaveMappingConfig\n });\n methods.push(...(map ?? []));\n } else {\n methods.push(...(getUrlMappings(moduleInstance).filter(it => !getRoute(moduleInstance, it.propertyKey)) ?? []));\n }\n\n // options\uB85C \uC694\uCCAD\uC624\uBA74\uC740 allow\uB85C \uB123\uACE0 \uADF8\uB0E5 200\uCC98\uB9AC\uD574\uC57C\uB428.\n if (rr.reqMethod()?.toUpperCase() === HttpMethod.OPTIONS.toUpperCase()) {\n rr.resSetHeader(HttpHeaders.Allow, methods.map(it => it.config.method).join(', '));\n rr.resStatusCode(HttpStatus.Ok);\n }\n\n // method \uCC3E\uAE30\n methods = methods.filter(it => it && it.propertyKey && it.config && rr.reqMethod()?.toUpperCase() === it.config.method.toUpperCase());\n methods.sort((a, b) => {\n return ((b.config?.req?.contentType?.length ?? 0) + (b.config?.req?.accept?.length ?? 0)) - ((a.config?.req?.contentType?.length ?? 0) + (a.config?.req?.accept?.length ?? 0));\n });\n methods = methods\n .filter(it => it.config?.req?.contentType ? (!!it.config?.req?.contentType?.find(sit => rr.reqHasContentTypeHeader(sit))) : true)\n .filter(it => it.config?.req?.accept ? (!!it.config?.req?.accept?.find(sit => rr.reqHasAcceptHeader(sit))) : true);\n\n if (methods[0]) {\n const it = methods[0];\n const paramTypes = ReflectUtils.getParameterTypes(moduleInstance, it.propertyKey)\n const injects = getInject(moduleInstance, it.propertyKey);\n const validIndexs = getValidIndex(moduleInstance, it.propertyKey);\n if (injects) {\n const isPathData = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_PATH_DATA);\n const isJson = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_JSON_BODY);\n const isSearchParamsObj = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ);\n const isFormUrl = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_FORM_URL_BODY);\n // \uC6B0\uC120 \uB2E4\uC2DC \uC81C\uAC70\uD55C\uB2E4.. \uD2B8\uB79C\uC81D\uC158 \uC5B4\uB5BB\uAC8C \uD560\uC9C0 \uB2E4\uC2DC \uC0DD\uAC01\n // const isTransactionManager = injects.find(it => it.config?.situationType === InjectSituationType.TransactionManager);\n const siturationContainers = new SituationTypeContainers();\n if (isPathData) {\n let data = await routerModule.pathData\n if (isPathData.type) {\n data = Object.assign(new isPathData.type(), data);\n }\n if (validIndexs.includes(isPathData.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_PATH_DATA,\n data\n }));\n }\n if (isJson) {\n let data = await rr.reqBodyJsonData();\n if (data !== null && isJson.type) {\n data = Object.assign(new isJson.type(), data);\n }\n if (validIndexs.includes(isJson.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_JSON_BODY,\n data\n }));\n }\n if (isSearchParamsObj) {\n let data = rr.reqUrlSearchParamsObj\n if (validIndexs.includes(isSearchParamsObj.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ,\n data\n }));\n }\n if (isFormUrl) {\n let data = await rr.reqBodyFormUrlData()\n if (isFormUrl.type) {\n data = Object.assign(new isFormUrl.type(), data);\n }\n if (validIndexs.includes(isFormUrl.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({situationType: UrlMappingSituationType.REQ_FORM_URL_BODY, data}));\n }\n // \uD2B8\uB79C\uC81D\uC158 \uC6B0\uC120 \uC81C\uAC70 \uB098\uC911\uC5D0 \uC5B4\uB5BB\uAC8C \uAD6C\uD604\uD560\uC9C0 \uC0DD\uAC01..\n // if (isTransactionManager && isTransactionManager.type && transactionManager && transactionManager.hasTransaction(isTransactionManager.type)) {\n // let data = await transactionManager.getTransaction(isTransactionManager.type);\n // if (data) {\n // data = await data.try(isTransactionManager.config.argument);\n // siturationContainers.push(new SituationTypeContainer({situationType: InjectSituationType.TransactionManager, data, index: isTransactionManager.index}));\n // }\n // }\n if (siturationContainers.length) {\n otherStorage.set(SituationTypeContainers, siturationContainers);\n }\n }\n\n for (const paramType of paramTypes) {\n if (paramType === ReqFormUrlBody) {\n otherStorage.set(ReqFormUrlBody, await rr.reqBodyReqFormUrlBody())\n } else if (paramType === ReqPathData) {\n otherStorage.set(ReqPathData, routerModule.pathData)\n } else if (paramType === ReqJsonBody) {\n otherStorage.set(ReqJsonBody, await rr.reqBodyReqJsonBody())\n } else if (paramType === ReqSearchParamsObj) {\n otherStorage.set(ReqSearchParamsObj, rr.reqUrlSearchParamsObj)\n } else if (paramType === URLSearchParams) {\n otherStorage.set(URLSearchParams, rr.reqUrlSearchParams)\n } else if (paramType === ReqMultipartFormBody) {\n otherStorage.set(ReqMultipartFormBody, rr.reqBodyMultipartFormData())\n } else if (paramType === ReqHeader) {\n otherStorage.set(ReqHeader, rr.reqHeaderObj)\n }\n }\n\n // execute !!!\n let data = await this.simstanceManager.executeBindParameterSimPromise({\n target: moduleInstance,\n targetKey: it.propertyKey\n }, otherStorage);\n /*\n \uC5EC\uAE30\uC5D0\uC11C \uC815\uD574\uC9C4 \uD0C0\uC785 \uB9AC\uD134\uC5D0 \uB530\uB978 \uC870\uCE58\n ...\n */\n if (it.config?.resolver) {\n const execute = typeof it.config.resolver === 'function' ? this.simstanceManager.getOrNewSim({target: it.config.resolver}) : it.config.resolver;\n data = await execute?.resolve?.(data, rr);\n }\n const status = it.config?.res?.status ?? HttpStatus.Ok;\n const headers = it.config?.res?.header ?? {};\n if (it.config?.res?.contentType) {\n headers[HttpHeaders.ContentType] = it.config?.res?.contentType;\n }\n if ((it.config?.res?.contentType?.toLowerCase().indexOf(Mimes.ApplicationJson.toLowerCase()) ?? -1) > -1) {\n data = JSON.stringify(data);\n } else if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n rr.resSetHeaders(headers)\n rr.resSetStatusCode(status);\n rr.resWrite(data);\n }\n }\n\n if (this.option.noSuchRouteEndPointMappingThrow && methods.length <= 0 && rr.reqMethod()?.toUpperCase() !== HttpMethod.OPTIONS) {\n throw this.option.noSuchRouteEndPointMappingThrow(rr);\n }\n }\n\n // after\n for (const it of filter.filters.reverse()) {\n if (it.filter?.proceedAfter && !await it.filter.proceedAfter({rr, app: this, before: it.sw, carrier: filter.carrier})) {\n break;\n }\n }\n } catch (e) {\n console.error('request error:', e);\n transactionManager?.catch(e);\n rr.resStatusCode(e instanceof HttpError ? e.status : HttpStatus.InternalServerError)\n const execute = typeof this.option.globalAdvice === 'function' ? this.simstanceManager.getOrNewSim(this.option.globalAdvice) : this.option.globalAdvice;\n if (!execute) {\n rr.resEnd();\n // rr.resEnd().catch(e => {\n // });\n return;\n }\n if (e && typeof e === 'object') {\n otherStorage.set(e.constructor as ConstructorType<any>, e);\n otherStorage.set(SituationTypeContainer, new SituationTypeContainer({\n situationType: ExceptionHandlerSituationType.ERROR_OBJECT,\n data: e\n }));\n }\n const target = targetExceptionHandler(execute, e);\n if (target) {\n await this.simstanceManager.executeBindParameterSimPromise({\n target: execute,\n targetKey: target.propertyKey\n }, otherStorage);\n }\n } finally {\n transactionManager?.finally();\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n\n if (this.option.webSocketEndPoints) {\n const webSocketServer = new WebSocketServer({server: this.server});\n const execute = this.option.webSocketEndPoints.map(it => typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it);\n webSocketServer.on('connection', async (ws, request) => {\n this.webSocketClients.set(ws, {request});\n const wsSet = {socket: ws, request};\n execute.forEach(it => it.connect?.(wsSet));\n ws.on('error', err => execute.forEach(it => it.error?.(wsSet, err)));\n ws.on('message', (data, isBinary) => execute.forEach(it => it.message(wsSet, {data, isBinary})));\n ws.on('ping', () => execute.forEach(it => it.ping?.(wsSet)));\n ws.on('close', () => {\n this.webSocketClients.delete(ws);\n execute.forEach(it => it.close?.(wsSet));\n });\n });\n }\n this.server.listen(this.option.listen.port, this.option.listen.hostname, this.option.listen.backlog, () => {\n this.option.listen.listeningListener?.(this, this.server);\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAgC;AAChC,8BAA+B;AAE/B,kBAAoE;AACpE,mBAAoC;AACpC,gBAAyC;AACzC,6BAA8B;AAC9B,2BAAwF;AACxF,wBAAyB;AACzB,yBAA0B;AAC1B,mBAAoB;AAEpB,IAAAA,sBAAoE;AACpE,IAAAA,sBAAyE;AAEzE,IAAAC,eAA2B;AAC3B,4BAA6B;AAC7B,yBAA0B;AAC1B,uBAAwB;AACxB,IAAAD,sBAA2B;AAC3B,kCAAmC;AACnC,IAAAA,sBAAmD;AACnD,IAAAA,sBAA6B;AAC7B,uBAAwB;AACxB,IAAAA,sBAAuB;AAEvB,iBAA8B;AAC9B,wBAAyB;AACzB,4BAA6B;AAE7B,gCAAiC;AAEjC,yBAA0B;AAGnB,MAAM,6BAA6B,qCAAkB;AAAA,EAK1D,YAAmB,SAA2B,IAAI,yCAAiB,GAAG;AACpE,UAAM,MAAM;AADK;AAFnB,SAAQ,mBAAmB,oBAAI,IAA6C;AAI1E,SAAK,iBAAiB,IAAI,qCAAe,KAAK,MAAM;AAAA,EACtD;AAAA,EAGO,IAAI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AK,CAAC,CAAC;AAC3D,WAAG,GAAG,SAAS,MAAM;AACnB,eAAK,iBAAiB,OAAO,EAAE;AAC/B,kBAAQ,QAAQ,QAAM,GAAG,QAAQ,KAAK,CAAC;AAAA,QACzC,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AACA,SAAK,OAAO,OAAO,KAAK,OAAO,OAAO,MAAM,KAAK,OAAO,OAAO,UAAU,KAAK,OAAO,OAAO,SAAS,MAAM;AACzG,WAAK,OAAO,OAAO,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;",
|
|
4
|
+
"sourcesContent": ["import {SimpleApplication} from '@dooboostore/simple-boot';\nimport {HttpServerOption} from './option/HttpServerOption';\nimport {ConstructorType} from '@dooboostore/core';\nimport {IncomingMessage, Server as HttpServer, ServerResponse} from 'http'\nimport {Server as HttpsServer} from 'https'; // Add HTTPS support\nimport {WebSocketServer, WebSocket} from 'ws';\nimport {RequestResponse} from './models/RequestResponse';\nimport {getUrlMapping, getUrlMappings, SaveMappingConfig, UrlMappingSituationType} from './decorators/MethodMapping';\nimport {HttpStatus} from './codes/HttpStatus';\nimport {HttpHeaders} from './codes/HttpHeaders';\nimport {Mimes} from './codes/Mimes';\nimport {Filter} from './filters/Filter';\nimport {ExceptionHandlerSituationType, targetExceptionHandler} from '@dooboostore/simple-boot';\nimport {getInject, SituationTypeContainer, SituationTypeContainers} from '@dooboostore/simple-boot';\nimport {EndPoint} from './endpoints/EndPoint';\nimport {ReflectUtils} from '@dooboostore/core';\nimport {ReqFormUrlBody} from './models/datas/body/ReqFormUrlBody';\nimport {ReqJsonBody} from './models/datas/body/ReqJsonBody';\nimport {ReqHeader} from './models/datas/ReqHeader';\nimport {RouterModule} from '@dooboostore/simple-boot';\nimport {ReqMultipartFormBody} from './models/datas/body/ReqMultipartFormBody';\nimport {execValidationInValid, getValidIndex} from '@dooboostore/simple-boot';\nimport {ValidException} from '@dooboostore/simple-boot';\nimport {HttpError} from './errors/HttpError';\nimport {getRoute} from '@dooboostore/simple-boot';\nimport {OnInit} from './lifecycle/OnInit';\nimport {URLSearchParams} from 'url';\nimport {HttpMethod} from './codes/HttpMethod';\nimport {SessionManager} from './session/SessionManager';\nimport {InjectSituationType} from './inject/InjectSituationType';\nimport {ReqSearchParamsObj} from \"./models/datas/path/ReqSearchParamsObj\";\nimport {SimConfig} from '@dooboostore/simple-boot';\nimport {ReqPathData} from './models/datas/path/ReqPathData';\nimport {WebSocketEndPoint} from './endpoints/WebSocketEndPoint';\n\nexport class SimpleBootHttpServer extends SimpleApplication {\n public server?: HttpServer | HttpsServer;\n private sessionManager: SessionManager;\n private webSocketClients = new Map<WebSocket, { request: IncomingMessage }>();\n\n constructor(public option: HttpServerOption = new HttpServerOption()) {\n super(option);\n this.sessionManager = new SessionManager(this.option);\n }\n\n\n public run(otherInstanceSim?: Map<ConstructorType<any> | Function | SimConfig | symbol, any>) {\n otherInstanceSim ??= new Map<ConstructorType<any> | Function | SimConfig | symbol, any>();\n otherInstanceSim.set(SimpleBootHttpServer, this);\n super.run(otherInstanceSim);\n const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...(this.option.filters ?? []).map(it=>it.filter)];\n Promise.all(targets.map(it => (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it as ConstructorType<any>}) : it) as OnInit).map(it => it.onInit(this))).then(it => {\n this.startServer();\n });\n return this;\n }\n\n private startServer() {\n\n // const a = this.option.serverOption as HttpsServerOption;\n // this.option.serverOption?.\n\n if (this.option.serverOption && 'key' in this.option.serverOption && 'cert' in this.option.serverOption) {\n this.server = new HttpsServer(this.option.serverOption);\n const httpServer = new HttpServer();\n httpServer.on('request', (req: IncomingMessage, res: ServerResponse) => {\n res.writeHead(301, {Location: `https://${req.headers.host}${req.url}`});\n res.end();\n });\n httpServer.listen(80, this.option.listen.hostname, () => {\n console.log('HTTP redirect server running on port 80');\n });\n } else if (this.option.serverOption) {\n this.server = new HttpServer(this.option.serverOption);\n } else {\n this.server = new HttpServer();\n }\n // const thisRef = this;\n this.server.on('request', async (req: IncomingMessage, res: ServerResponse) => {\n // console.log('request', req.url);\n const transactionManager = this.option.transactionManagerFactory ? await this.option.transactionManagerFactory() : undefined;\n res.on('close', async () => {\n if (this.option.closeEndPoints) {\n for (const it of this.option.closeEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as EndPoint;\n const endPoint = execute?.endPoint(rr, this);\n if (endPoint instanceof Promise) {\n await endPoint;\n }\n } catch (e) {\n }\n }\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n res.on('error', async () => {\n if (this.option.errorEndPoints) {\n for (const it of this.option.errorEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as EndPoint;\n const endPoint = execute?.endPoint(rr, this);\n if (endPoint instanceof Promise) {\n await endPoint;\n }\n } catch (e) {\n }\n }\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n\n const rr = new RequestResponse(req, res, {sessionManager: this.sessionManager, option: this.option});\n /*\n default setting first\n */\n rr.resSetHeader(HttpHeaders.Server, 'simple-boot-http-server');\n const cookie = rr.reqCookieGet(this.option.sessionOption.key);\n if (!cookie) {\n const session = await this.sessionManager.session();\n\n const cookieParts: string[] = [];\n cookieParts.push(`${this.option.sessionOption.key}=${session.uuid}`);\n cookieParts.push(`Path=${this.option.sessionOption.path}`);\n if (this.option.sessionOption.httpOnly) cookieParts.push('HttpOnly');\n if (this.option.sessionOption.secure) cookieParts.push('Secure');\n if (this.option.sessionOption.sameSite != null && this.option.sessionOption.sameSite) cookieParts.push(`SameSite=${this.option.sessionOption.sameSite}`);\n const maxAge = (this.option.sessionOption as any).maxAge ?? (this.sessionManager.sessionOption)?.maxAge;\n if (maxAge != null) cookieParts.push(`Max-Age=${maxAge}`);\n rr.resSetHeader(HttpHeaders.SetCookie, cookieParts.join('; '));\n }\n\n const otherStorage = new Map<ConstructorType<any>, any>();\n otherStorage.set(RequestResponse, rr);\n otherStorage.set(IncomingMessage, req);\n otherStorage.set(ServerResponse, res);\n try {\n transactionManager?.try();\n if (this.option.requestEndPoints) {\n for (const it of this.option.requestEndPoints) {\n try {\n const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim<EndPoint>({target: it}) : it) as EndPoint;\n execute?.endPoint(rr, this);\n } catch (e) {\n }\n }\n }\n\n const filter = {\n carrier: new Map<string, any>(),\n filters: [] as { filter: Filter, sw: boolean }[]\n };\n for (let i = 0; this.option.filters && i < this.option.filters.length; i++) {\n const it = this.option.filters[i];\n\n let isSkip = false;\n if (typeof it.isSupport === 'boolean') {\n isSkip = !it.isSupport;\n } else if (typeof it.isSupport === 'object') {\n isSkip = !it.isSupport.test(rr.reqUrlPathName)\n } else if (typeof it.isSupport === 'function') {\n isSkip = !it.isSupport(rr);\n }\n if(isSkip) {\n continue;\n }\n\n let sw = true;\n const itFilter = it.filter;\n const execute = (typeof itFilter === 'function' ? this.simstanceManager.getOrNewSim({target: itFilter}) : itFilter) as Filter;\n if (execute?.proceedBefore) {\n sw = await execute.proceedBefore({rr, app: this, carrier: filter.carrier});\n filter.filters.push({filter: execute, sw});\n }\n if (!sw) {\n break;\n }\n }\n\n // body.. something..\n if (!rr.resIsDone()) {\n const routerModule = await super.routing(rr.reqIntent);\n otherStorage.set(RouterModule, routerModule);\n const moduleInstance = routerModule?.getModuleInstance?.();\n let methods: SaveMappingConfig[] = [];\n if (routerModule && moduleInstance) {\n // router \uD074\uB798\uC2A4 \uB0B4\uBD80\uC5D0\uC11C \uC120\uC5B8\uB41C Route\uC77C\uB54C\n if (routerModule.propertyKeys) {\n const map = routerModule.propertyKeys?.map((it: string | symbol) => {\n return {propertyKey: it, config: getUrlMapping(moduleInstance, it)} as SaveMappingConfig\n });\n methods.push(...(map ?? []));\n } else {\n methods.push(...(getUrlMappings(moduleInstance).filter(it => !getRoute(moduleInstance, it.propertyKey)) ?? []));\n }\n\n // options\uB85C \uC694\uCCAD\uC624\uBA74\uC740 allow\uB85C \uB123\uACE0 \uADF8\uB0E5 200\uCC98\uB9AC\uD574\uC57C\uB428.\n if (rr.reqMethod()?.toUpperCase() === HttpMethod.OPTIONS.toUpperCase()) {\n rr.resSetHeader(HttpHeaders.Allow, methods.map(it => it.config.method).join(', '));\n rr.resStatusCode(HttpStatus.Ok);\n }\n\n // method \uCC3E\uAE30\n methods = methods.filter(it => it && it.propertyKey && it.config && rr.reqMethod()?.toUpperCase() === it.config.method.toUpperCase());\n methods.sort((a, b) => {\n return ((b.config?.req?.contentType?.length ?? 0) + (b.config?.req?.accept?.length ?? 0)) - ((a.config?.req?.contentType?.length ?? 0) + (a.config?.req?.accept?.length ?? 0));\n });\n methods = methods\n .filter(it => it.config?.req?.contentType ? (!!it.config?.req?.contentType?.find(sit => rr.reqHasContentTypeHeader(sit))) : true)\n .filter(it => it.config?.req?.accept ? (!!it.config?.req?.accept?.find(sit => rr.reqHasAcceptHeader(sit))) : true);\n\n if (methods[0]) {\n const it = methods[0];\n const paramTypes = ReflectUtils.getParameterTypes(moduleInstance, it.propertyKey)\n const injects = getInject(moduleInstance, it.propertyKey);\n const validIndexs = getValidIndex(moduleInstance, it.propertyKey);\n if (injects) {\n const isPathData = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_PATH_DATA);\n const isJson = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_JSON_BODY);\n const isSearchParamsObj = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ);\n const isFormUrl = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_FORM_URL_BODY);\n // \uC6B0\uC120 \uB2E4\uC2DC \uC81C\uAC70\uD55C\uB2E4.. \uD2B8\uB79C\uC81D\uC158 \uC5B4\uB5BB\uAC8C \uD560\uC9C0 \uB2E4\uC2DC \uC0DD\uAC01\n // const isTransactionManager = injects.find(it => it.config?.situationType === InjectSituationType.TransactionManager);\n const siturationContainers = new SituationTypeContainers();\n if (isPathData) {\n let data = await routerModule.pathData\n if (isPathData.type) {\n data = Object.assign(new isPathData.type(), data);\n }\n if (validIndexs.includes(isPathData.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_PATH_DATA,\n data\n }));\n }\n if (isJson) {\n let data = await rr.reqBodyJsonData();\n if (data !== null && isJson.type) {\n data = Object.assign(new isJson.type(), data);\n }\n if (validIndexs.includes(isJson.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_JSON_BODY,\n data\n }));\n }\n if (isSearchParamsObj) {\n let data = rr.reqUrlSearchParamsObj\n if (validIndexs.includes(isSearchParamsObj.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({\n situationType: UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ,\n data\n }));\n }\n if (isFormUrl) {\n let data = await rr.reqBodyFormUrlData()\n if (isFormUrl.type) {\n data = Object.assign(new isFormUrl.type(), data);\n }\n if (validIndexs.includes(isFormUrl.index)) {\n const inValid = execValidationInValid(data);\n if ((inValid?.length ?? 0) > 0) {\n throw new ValidException(inValid);\n }\n }\n siturationContainers.push(new SituationTypeContainer({situationType: UrlMappingSituationType.REQ_FORM_URL_BODY, data}));\n }\n // \uD2B8\uB79C\uC81D\uC158 \uC6B0\uC120 \uC81C\uAC70 \uB098\uC911\uC5D0 \uC5B4\uB5BB\uAC8C \uAD6C\uD604\uD560\uC9C0 \uC0DD\uAC01..\n // if (isTransactionManager && isTransactionManager.type && transactionManager && transactionManager.hasTransaction(isTransactionManager.type)) {\n // let data = await transactionManager.getTransaction(isTransactionManager.type);\n // if (data) {\n // data = await data.try(isTransactionManager.config.argument);\n // siturationContainers.push(new SituationTypeContainer({situationType: InjectSituationType.TransactionManager, data, index: isTransactionManager.index}));\n // }\n // }\n if (siturationContainers.length) {\n otherStorage.set(SituationTypeContainers, siturationContainers);\n }\n }\n\n for (const paramType of paramTypes) {\n if (paramType === ReqFormUrlBody) {\n otherStorage.set(ReqFormUrlBody, await rr.reqBodyReqFormUrlBody())\n } else if (paramType === ReqPathData) {\n otherStorage.set(ReqPathData, routerModule.pathData)\n } else if (paramType === ReqJsonBody) {\n otherStorage.set(ReqJsonBody, await rr.reqBodyReqJsonBody())\n } else if (paramType === ReqSearchParamsObj) {\n otherStorage.set(ReqSearchParamsObj, rr.reqUrlSearchParamsObj)\n } else if (paramType === URLSearchParams) {\n otherStorage.set(URLSearchParams, rr.reqUrlSearchParams)\n } else if (paramType === ReqMultipartFormBody) {\n otherStorage.set(ReqMultipartFormBody, rr.reqBodyMultipartFormData())\n } else if (paramType === ReqHeader) {\n otherStorage.set(ReqHeader, rr.reqHeaderObj)\n }\n }\n\n // execute !!!\n let data = await this.simstanceManager.executeBindParameterSimPromise({\n target: moduleInstance,\n targetKey: it.propertyKey\n }, otherStorage);\n /*\n \uC5EC\uAE30\uC5D0\uC11C \uC815\uD574\uC9C4 \uD0C0\uC785 \uB9AC\uD134\uC5D0 \uB530\uB978 \uC870\uCE58\n ...\n */\n const resConfig = it.config?.res;\n if (resConfig?.manual === true) {\n // \uD578\uB4E4\uB7EC\uAC00 ServerResponse\uB97C \uC9C1\uC811 \uC8FC\uC785\uBC1B\uC544 \uC2A4\uC2A4\uB85C write/end\uB97C \uC81C\uC5B4\uD55C\uB2E4 (\uC608: SSE \uC2A4\uD2B8\uB9AC\uBC0D)\n } else {\n if (it.config?.resolver) {\n const execute = typeof it.config.resolver === 'function' ? this.simstanceManager.getOrNewSim({target: it.config.resolver}) : it.config.resolver;\n data = await execute?.resolve?.(data, rr);\n }\n const status = resConfig?.status ?? HttpStatus.Ok;\n const headers = resConfig?.header ?? {};\n if (resConfig?.contentType) {\n headers[HttpHeaders.ContentType] = resConfig.contentType;\n }\n if ((resConfig?.contentType?.toLowerCase().indexOf(Mimes.ApplicationJson.toLowerCase()) ?? -1) > -1) {\n data = JSON.stringify(data);\n } else if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n rr.resSetHeaders(headers)\n rr.resSetStatusCode(status);\n rr.resWrite(data);\n }\n }\n }\n\n if (this.option.noSuchRouteEndPointMappingThrow && methods.length <= 0 && rr.reqMethod()?.toUpperCase() !== HttpMethod.OPTIONS) {\n throw this.option.noSuchRouteEndPointMappingThrow(rr);\n }\n }\n\n // after\n for (const it of filter.filters.reverse()) {\n if (it.filter?.proceedAfter && !await it.filter.proceedAfter({rr, app: this, before: it.sw, carrier: filter.carrier})) {\n break;\n }\n }\n } catch (e) {\n console.error('request error:', e);\n transactionManager?.catch(e);\n rr.resStatusCode(e instanceof HttpError ? e.status : HttpStatus.InternalServerError)\n const execute = typeof this.option.globalAdvice === 'function' ? this.simstanceManager.getOrNewSim(this.option.globalAdvice) : this.option.globalAdvice;\n if (!execute) {\n rr.resEnd();\n // rr.resEnd().catch(e => {\n // });\n return;\n }\n if (e && typeof e === 'object') {\n otherStorage.set(e.constructor as ConstructorType<any>, e);\n otherStorage.set(SituationTypeContainer, new SituationTypeContainer({\n situationType: ExceptionHandlerSituationType.ERROR_OBJECT,\n data: e\n }));\n }\n const target = targetExceptionHandler(execute, e);\n if (target) {\n await this.simstanceManager.executeBindParameterSimPromise({\n target: execute,\n targetKey: target.propertyKey\n }, otherStorage);\n }\n } finally {\n transactionManager?.finally();\n }\n\n if (!rr.resIsDone()) {\n rr.resEnd();\n }\n });\n\n if (this.option.webSocketEndPoints) {\n const webSocketServer = new WebSocketServer({server: this.server});\n const execute = this.option.webSocketEndPoints.map(it => typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it);\n webSocketServer.on('connection', async (ws, request) => {\n this.webSocketClients.set(ws, {request});\n const wsSet = {socket: ws, request};\n execute.forEach(it => it.connect?.(wsSet));\n ws.on('error', err => execute.forEach(it => it.error?.(wsSet, err)));\n ws.on('message', (data, isBinary) => execute.forEach(it => it.message(wsSet, {data, isBinary})));\n ws.on('ping', () => execute.forEach(it => it.ping?.(wsSet)));\n ws.on('close', () => {\n this.webSocketClients.delete(ws);\n execute.forEach(it => it.close?.(wsSet));\n });\n });\n }\n this.server.listen(this.option.listen.port, this.option.listen.hostname, this.option.listen.backlog, () => {\n this.option.listen.listeningListener?.(this, this.server);\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAgC;AAChC,8BAA+B;AAE/B,kBAAoE;AACpE,mBAAoC;AACpC,gBAAyC;AACzC,6BAA8B;AAC9B,2BAAwF;AACxF,wBAAyB;AACzB,yBAA0B;AAC1B,mBAAoB;AAEpB,IAAAA,sBAAoE;AACpE,IAAAA,sBAAyE;AAEzE,IAAAC,eAA2B;AAC3B,4BAA6B;AAC7B,yBAA0B;AAC1B,uBAAwB;AACxB,IAAAD,sBAA2B;AAC3B,kCAAmC;AACnC,IAAAA,sBAAmD;AACnD,IAAAA,sBAA6B;AAC7B,uBAAwB;AACxB,IAAAA,sBAAuB;AAEvB,iBAA8B;AAC9B,wBAAyB;AACzB,4BAA6B;AAE7B,gCAAiC;AAEjC,yBAA0B;AAGnB,MAAM,6BAA6B,qCAAkB;AAAA,EAK1D,YAAmB,SAA2B,IAAI,yCAAiB,GAAG;AACpE,UAAM,MAAM;AADK;AAFnB,SAAQ,mBAAmB,oBAAI,IAA6C;AAI1E,SAAK,iBAAiB,IAAI,qCAAe,KAAK,MAAM;AAAA,EACtD;AAAA,EAGO,IAAI,kBAAmF;AAC5F,yBAAqB,oBAAI,IAA+D;AACxF,qBAAiB,IAAI,sBAAsB,IAAI;AAC/C,UAAM,IAAI,gBAAgB;AA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AK,CAAC;AACzC,WAAG,GAAG,SAAS,SAAO,QAAQ,QAAQ,QAAM,GAAG,QAAQ,OAAO,GAAG,CAAC,CAAC;AACnE,WAAG,GAAG,WAAW,CAAC,MAAM,aAAa,QAAQ,QAAQ,QAAM,GAAG,QAAQ,OAAO,EAAC,MAAM,SAAQ,CAAC,CAAC,CAAC;AAC/F,WAAG,GAAG,QAAQ,MAAM,QAAQ,QAAQ,QAAM,GAAG,OAAO,KAAK,CAAC,CAAC;AAC3D,WAAG,GAAG,SAAS,MAAM;AACnB,eAAK,iBAAiB,OAAO,EAAE;AAC/B,kBAAQ,QAAQ,QAAM,GAAG,QAAQ,KAAK,CAAC;AAAA,QACzC,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AACA,SAAK,OAAO,OAAO,KAAK,OAAO,OAAO,MAAM,KAAK,OAAO,OAAO,UAAU,KAAK,OAAO,OAAO,SAAS,MAAM;AACzG,WAAK,OAAO,OAAO,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": ["import_simple_boot", "import_core", "HttpsServer", "HttpServer", "it", "data"]
|
|
7
7
|
}
|
package/dist/cjs/bundle-entry.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
5
11
|
var __copyProps = (to, from, except, desc) => {
|
|
6
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -11,34 +17,38 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
11
17
|
return to;
|
|
12
18
|
};
|
|
13
19
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
14
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
29
|
var bundle_entry_exports = {};
|
|
30
|
+
__export(bundle_entry_exports, {
|
|
31
|
+
Core: () => Core,
|
|
32
|
+
CoreNode: () => CoreNode,
|
|
33
|
+
CoreWeb: () => CoreWeb,
|
|
34
|
+
DomRender: () => DomRender,
|
|
35
|
+
SimpleBoot: () => SimpleBoot
|
|
36
|
+
});
|
|
16
37
|
module.exports = __toCommonJS(bundle_entry_exports);
|
|
17
|
-
|
|
18
|
-
__reExport(bundle_entry_exports, require("./
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
__reExport(bundle_entry_exports, require("./models"), module.exports);
|
|
25
|
-
__reExport(bundle_entry_exports, require("./option"), module.exports);
|
|
26
|
-
__reExport(bundle_entry_exports, require("./resolvers"), module.exports);
|
|
27
|
-
__reExport(bundle_entry_exports, require("./session"), module.exports);
|
|
28
|
-
__reExport(bundle_entry_exports, require("./SimpleBootHttpServer"), module.exports);
|
|
38
|
+
var import_reflect_metadata = require("reflect-metadata");
|
|
39
|
+
__reExport(bundle_entry_exports, require("./index"), module.exports);
|
|
40
|
+
var Core = __toESM(require("@dooboostore/core"), 1);
|
|
41
|
+
var CoreNode = __toESM(require("@dooboostore/core-node"), 1);
|
|
42
|
+
var CoreWeb = __toESM(require("@dooboostore/core-web"), 1);
|
|
43
|
+
var DomRender = __toESM(require("@dooboostore/dom-render"), 1);
|
|
44
|
+
var SimpleBoot = __toESM(require("@dooboostore/simple-boot"), 1);
|
|
29
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
46
|
0 && (module.exports = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...require("./
|
|
37
|
-
...require("./lifecycle"),
|
|
38
|
-
...require("./models"),
|
|
39
|
-
...require("./option"),
|
|
40
|
-
...require("./resolvers"),
|
|
41
|
-
...require("./session"),
|
|
42
|
-
...require("./SimpleBootHttpServer")
|
|
47
|
+
Core,
|
|
48
|
+
CoreNode,
|
|
49
|
+
CoreWeb,
|
|
50
|
+
DomRender,
|
|
51
|
+
SimpleBoot,
|
|
52
|
+
...require("./index")
|
|
43
53
|
});
|
|
44
54
|
//# sourceMappingURL=bundle-entry.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/bundle-entry.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import 'reflect-metadata';\n\n// simple-boot-http-server itself\nexport * from './index';\n\n// Re-export peer dependencies so bundle consumers can access them\n// without separately importing each package\nexport * as Core from '@dooboostore/core';\nexport * as CoreNode from '@dooboostore/core-node';\nexport * as CoreWeb from '@dooboostore/core-web';\nexport * as DomRender from '@dooboostore/dom-render';\nexport * as SimpleBoot from '@dooboostore/simple-boot';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAO;AAGP,iCAAc,oBAHd;AAOA,WAAsB;AACtB,eAA0B;AAC1B,cAAyB;AACzB,gBAA2B;AAC3B,iBAA4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/codes/Mimes.js
CHANGED
|
@@ -46,6 +46,8 @@ var Mimes = /* @__PURE__ */ ((Mimes2) => {
|
|
|
46
46
|
Mimes2["ImageXpixmap"] = "image/x-xpixmap";
|
|
47
47
|
Mimes2["ImageXxbm"] = "image/x-xbm";
|
|
48
48
|
Mimes2["MultipartFormData"] = "multipart/form-data";
|
|
49
|
+
Mimes2["TextEventStream"] = "text/event-stream";
|
|
50
|
+
Mimes2["ApplicationXndjson"] = "application/x-ndjson";
|
|
49
51
|
Mimes2["ApplicationJsonPostSimpleBootSsrIntentScheme"] = "application/json-post+simple-boot-ssr-intent-scheme";
|
|
50
52
|
Mimes2["Intent"] = "intent";
|
|
51
53
|
return Mimes2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/codes/Mimes.ts"],
|
|
4
|
-
"sourcesContent": ["export enum Mimes {\n ApplicationJson = 'application/json',\n ApplicationOctetStream = 'application/octet-stream',\n ApplicationXml = 'application/xml',\n ApplicationJsonPatch = 'application/json-patch+json',\n ApplicationXWwwFormUrlencoded = 'application/x-www-form-urlencoded',\n TextPlain = 'text/plain',\n TextHtml = 'text/html',\n All = '*/*',\n TextCss = 'text/css',\n TextJavascript = 'text/javascript',\n TextXml = 'text/xml',\n TextXslt = 'text/xslt',\n TextXmlDtd = 'text/xml-dtd',\n TextPlainUtf8 = 'text/plain; charset=utf-8',\n ImagePng = 'image/png',\n ImageGif = 'image/gif',\n ImageJpeg = 'image/jpeg',\n ImageSvg = 'image/svg+xml',\n ImageBmp = 'image/bmp',\n ImageTiff = 'image/tiff',\n ImagePdf = 'application/pdf',\n ImageXBmp = 'image/x-bmp',\n ImageXpixmap = 'image/x-xpixmap',\n ImageXxbm = 'image/x-xbm',\n MultipartFormData = 'multipart/form-data',\n ApplicationJsonPostSimpleBootSsrIntentScheme = 'application/json-post+simple-boot-ssr-intent-scheme',\n Intent = 'intent'\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,QAAL,kBAAKA,WAAL;AACL,EAAAA,OAAA,qBAAkB;AAClB,EAAAA,OAAA,4BAAyB;AACzB,EAAAA,OAAA,oBAAiB;AACjB,EAAAA,OAAA,0BAAuB;AACvB,EAAAA,OAAA,mCAAgC;AAChC,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,aAAU;AACV,EAAAA,OAAA,oBAAiB;AACjB,EAAAA,OAAA,aAAU;AACV,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,gBAAa;AACb,EAAAA,OAAA,mBAAgB;AAChB,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,kBAAe;AACf,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,uBAAoB;AACpB,EAAAA,OAAA,kDAA+C;AAC/C,EAAAA,OAAA,YAAS;
|
|
4
|
+
"sourcesContent": ["export enum Mimes {\n ApplicationJson = 'application/json',\n ApplicationOctetStream = 'application/octet-stream',\n ApplicationXml = 'application/xml',\n ApplicationJsonPatch = 'application/json-patch+json',\n ApplicationXWwwFormUrlencoded = 'application/x-www-form-urlencoded',\n TextPlain = 'text/plain',\n TextHtml = 'text/html',\n All = '*/*',\n TextCss = 'text/css',\n TextJavascript = 'text/javascript',\n TextXml = 'text/xml',\n TextXslt = 'text/xslt',\n TextXmlDtd = 'text/xml-dtd',\n TextPlainUtf8 = 'text/plain; charset=utf-8',\n ImagePng = 'image/png',\n ImageGif = 'image/gif',\n ImageJpeg = 'image/jpeg',\n ImageSvg = 'image/svg+xml',\n ImageBmp = 'image/bmp',\n ImageTiff = 'image/tiff',\n ImagePdf = 'application/pdf',\n ImageXBmp = 'image/x-bmp',\n ImageXpixmap = 'image/x-xpixmap',\n ImageXxbm = 'image/x-xbm',\n MultipartFormData = 'multipart/form-data',\n TextEventStream = 'text/event-stream', // SSE \uC2E4\uC2DC\uAC04 \uD14D\uC2A4\uD2B8 \uC2A4\uD2B8\uB9AC\uBC0D\n ApplicationXndjson = 'application/x-ndjson',\n ApplicationJsonPostSimpleBootSsrIntentScheme = 'application/json-post+simple-boot-ssr-intent-scheme',\n Intent = 'intent'\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,QAAL,kBAAKA,WAAL;AACL,EAAAA,OAAA,qBAAkB;AAClB,EAAAA,OAAA,4BAAyB;AACzB,EAAAA,OAAA,oBAAiB;AACjB,EAAAA,OAAA,0BAAuB;AACvB,EAAAA,OAAA,mCAAgC;AAChC,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,aAAU;AACV,EAAAA,OAAA,oBAAiB;AACjB,EAAAA,OAAA,aAAU;AACV,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,gBAAa;AACb,EAAAA,OAAA,mBAAgB;AAChB,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,cAAW;AACX,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,kBAAe;AACf,EAAAA,OAAA,eAAY;AACZ,EAAAA,OAAA,uBAAoB;AACpB,EAAAA,OAAA,qBAAkB;AAClB,EAAAA,OAAA,wBAAqB;AACrB,EAAAA,OAAA,kDAA+C;AAC/C,EAAAA,OAAA,YAAS;AA7BC,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["Mimes"]
|
|
7
7
|
}
|
|
@@ -172,7 +172,7 @@ const getPATCH = (target, propertyKey) => {
|
|
|
172
172
|
return getUrlMapping(target, propertyKey);
|
|
173
173
|
};
|
|
174
174
|
const getPATCHS = (target) => {
|
|
175
|
-
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === import_HttpMethod.HttpMethod.
|
|
175
|
+
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === import_HttpMethod.HttpMethod.PATCH);
|
|
176
176
|
};
|
|
177
177
|
function OPTIONS(configOrTarget, propertyKey, descriptor) {
|
|
178
178
|
if (propertyKey && descriptor) {
|
|
@@ -204,7 +204,7 @@ const getHEAD = (target, propertyKey) => {
|
|
|
204
204
|
return getUrlMapping(target, propertyKey);
|
|
205
205
|
};
|
|
206
206
|
const getHEADS = (target) => {
|
|
207
|
-
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === import_HttpMethod.HttpMethod.
|
|
207
|
+
return getUrlMappings(target)?.filter((it) => it.config?.method.toUpperCase() === import_HttpMethod.HttpMethod.HEAD);
|
|
208
208
|
};
|
|
209
209
|
function TRACE(configOrTarget, propertyKey, descriptor) {
|
|
210
210
|
if (propertyKey && descriptor) {
|