@dooboostore/simple-boot-http-server 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.MD +1 -3
  2. package/dist/cjs/SimpleBootHttpServer.js +17 -0
  3. package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
  4. package/dist/cjs/codes/HttpStatus.js +1 -0
  5. package/dist/cjs/codes/HttpStatus.js.map +2 -2
  6. package/dist/cjs/decorators/MethodMapping.js +1 -0
  7. package/dist/cjs/decorators/MethodMapping.js.map +2 -2
  8. package/dist/cjs/filters/ResourceFilter.js +59 -19
  9. package/dist/cjs/filters/ResourceFilter.js.map +2 -2
  10. package/dist/cjs/models/RequestResponse.js +29 -2
  11. package/dist/cjs/models/RequestResponse.js.map +2 -2
  12. package/dist/cjs/models/datas/search/ReqSearchParamsObj.js +29 -0
  13. package/dist/cjs/models/datas/search/ReqSearchParamsObj.js.map +7 -0
  14. package/dist/esm/SimpleBootHttpServer.js +17 -0
  15. package/dist/esm/SimpleBootHttpServer.js.map +2 -2
  16. package/dist/esm/codes/HttpStatus.js +1 -0
  17. package/dist/esm/codes/HttpStatus.js.map +2 -2
  18. package/dist/esm/decorators/MethodMapping.js +1 -0
  19. package/dist/esm/decorators/MethodMapping.js.map +2 -2
  20. package/dist/esm/filters/ResourceFilter.js +56 -18
  21. package/dist/esm/filters/ResourceFilter.js.map +2 -2
  22. package/dist/esm/models/RequestResponse.js +29 -2
  23. package/dist/esm/models/RequestResponse.js.map +2 -2
  24. package/dist/esm/models/datas/search/ReqSearchParamsObj.js +6 -0
  25. package/dist/esm/models/datas/search/ReqSearchParamsObj.js.map +7 -0
  26. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +437 -231
  27. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
  28. package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
  29. package/dist/types/codes/HttpStatus.d.ts +13 -1
  30. package/dist/types/codes/HttpStatus.d.ts.map +1 -1
  31. package/dist/types/decorators/MethodMapping.d.ts +1 -0
  32. package/dist/types/decorators/MethodMapping.d.ts.map +1 -1
  33. package/dist/types/filters/ResourceFilter.d.ts +16 -6
  34. package/dist/types/filters/ResourceFilter.d.ts.map +1 -1
  35. package/dist/types/index.d.ts +0 -38
  36. package/dist/types/models/RequestResponse.d.ts +3 -1
  37. package/dist/types/models/RequestResponse.d.ts.map +1 -1
  38. package/dist/types/models/datas/search/ReqSearchParamsObj.d.ts +4 -0
  39. package/dist/types/models/datas/search/ReqSearchParamsObj.d.ts.map +1 -0
  40. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +444 -238
  41. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
  42. package/package.json +14 -14
  43. package/src/SimpleBootHttpServer.ts +18 -1
  44. package/src/codes/HttpStatus.ts +19 -1
  45. package/src/decorators/MethodMapping.ts +2 -0
  46. package/src/filters/ResourceFilter.ts +68 -20
  47. package/src/models/RequestResponse.ts +32 -3
  48. package/src/models/datas/search/ReqSearchParamsObj.ts +3 -0
package/README.MD CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Build and Test](https://github.com/dooboostore-develop/packages/actions/workflows/main.yaml/badge.svg?branch=main)](https://github.com/dooboostore-develop/packages/actions/workflows/main.yaml)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
6
6
 
7
- **Full Documentation:** [https://dooboostore-develop.github.io/packages/simple-boot-http-server](https://dooboostore-develop.github.io/packages/simple-boot-http-server)
7
+ **Full Documentation:** [https://dooboostore-develop.github.io/@dooboostore/simple-boot-http-server](https://dooboostore-develop.github.io/@dooboostore/simple-boot-http-server)
8
8
 
9
9
  A lightweight and powerful HTTP web server framework for Node.js, built on `@dooboostore/simple-boot`.
10
10
 
@@ -31,8 +31,6 @@ npm start
31
31
 
32
32
  The detailed API documentation, including all decorators and usage examples, is available on our documentation website.
33
33
 
34
- **[Explore the full @dooboostore/simple-boot-http-server documentation »](https://dooboostore-develop.github.io/packages/simple-boot-http-server)**
35
-
36
34
  ## License
37
35
 
38
36
  This package is licensed under the [MIT License](https://opensource.org/licenses/MIT).
@@ -45,6 +45,7 @@ var import_url = require("url");
45
45
  var import_HttpMethod = require("./codes/HttpMethod");
46
46
  var import_SessionManager = require("./session/SessionManager");
47
47
  var import_InjectSituationType = require("./inject/InjectSituationType");
48
+ var import_ReqSearchParamsObj = require("./models/datas/search/ReqSearchParamsObj");
48
49
  class SimpleBootHttpServer extends import_SimpleApplication.SimpleApplication {
49
50
  constructor(option = new import_HttpServerOption.HttpServerOption()) {
50
51
  super(option);
@@ -179,6 +180,7 @@ class SimpleBootHttpServer extends import_SimpleApplication.SimpleApplication {
179
180
  const validIndexs = (0, import_Validation.getValidIndex)(moduleInstance, it.propertyKey);
180
181
  if (injects) {
181
182
  const isJson = injects.find((it2) => it2.config?.situationType === import_MethodMapping.UrlMappingSituationType.REQ_JSON_BODY);
183
+ const isSearchParamsObj = injects.find((it2) => it2.config?.situationType === import_MethodMapping.UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ);
182
184
  const isFormUrl = injects.find((it2) => it2.config?.situationType === import_MethodMapping.UrlMappingSituationType.REQ_FORM_URL_BODY);
183
185
  const isTransactionManager = injects.find((it2) => it2.config?.situationType === import_InjectSituationType.InjectSituationType.TransactionManager);
184
186
  const siturationContainers = new import_Inject.SituationTypeContainers();
@@ -198,6 +200,19 @@ class SimpleBootHttpServer extends import_SimpleApplication.SimpleApplication {
198
200
  data: data2
199
201
  }));
200
202
  }
203
+ if (isSearchParamsObj) {
204
+ let data2 = rr.reqUrlSearchParamsObj;
205
+ if (validIndexs.includes(isSearchParamsObj.index)) {
206
+ const inValid = (0, import_Validation.execValidationInValid)(data2);
207
+ if ((inValid?.length ?? 0) > 0) {
208
+ throw new import_ValidException.ValidException(inValid);
209
+ }
210
+ }
211
+ siturationContainers.push(new import_Inject.SituationTypeContainer({
212
+ situationType: import_MethodMapping.UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ,
213
+ data: data2
214
+ }));
215
+ }
201
216
  if (isFormUrl) {
202
217
  let data2 = await rr.reqBodyFormUrlData();
203
218
  if (isFormUrl.type) {
@@ -227,6 +242,8 @@ class SimpleBootHttpServer extends import_SimpleApplication.SimpleApplication {
227
242
  otherStorage.set(import_ReqFormUrlBody.ReqFormUrlBody, await rr.reqBodyReqFormUrlBody());
228
243
  } else if (paramType === import_ReqJsonBody.ReqJsonBody) {
229
244
  otherStorage.set(import_ReqJsonBody.ReqJsonBody, await rr.reqBodyReqJsonBody());
245
+ } else if (paramType === import_ReqSearchParamsObj.ReqSearchParamsObj) {
246
+ otherStorage.set(import_ReqSearchParamsObj.ReqSearchParamsObj, rr.reqUrlSearchParamsObj);
230
247
  } else if (paramType === import_url.URLSearchParams) {
231
248
  otherStorage.set(import_url.URLSearchParams, rr.reqUrlSearchParams);
232
249
  } else if (paramType === import_ReqMultipartFormBody.ReqMultipartFormBody) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/SimpleBootHttpServer.ts"],
4
- "sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { HttpServerOption } from './option/HttpServerOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { IncomingMessage, Server as HttpServer, ServerResponse } from 'http'\nimport { Server as HttpsServer } from 'https'; // Add HTTPS support\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/decorators/exception/ExceptionDecorator';\nimport { getInject, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { EndPoint } from './endpoints/EndPoint';\nimport { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\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/route/RouterModule';\nimport { ReqMultipartFormBody } from './models/datas/body/ReqMultipartFormBody';\nimport { execValidationInValid, getValidIndex } from '@dooboostore/simple-boot/decorators/validate/Validation';\nimport { ValidException } from '@dooboostore/simple-boot/errors/ValidException';\nimport { HttpError } from './errors/HttpError';\nimport { getRoute } from '@dooboostore/simple-boot/decorators/route/Router';\nimport { OnInit } from './lifecycle/OnInit';\nimport { URLSearchParams } from 'url';\nimport { HttpMethod } from './codes/HttpMethod';\nimport { SessionManager } from './session/SessionManager';\nimport { InjectSituationType } from './inject/InjectSituationType';\n\nexport class SimpleBootHttpServer extends SimpleApplication {\n public server?: HttpServer | HttpsServer;\n private sessionManager: SessionManager;\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>, any>) {\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 rr.resSetHeader(HttpHeaders.SetCookie, `${this.option.sessionOption.key}=${session.uuid}; Path=/; HttpOnly`);\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 isJson = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_JSON_BODY);\n const isFormUrl = injects.find(it => it.config?.situationType === UrlMappingSituationType.REQ_FORM_URL_BODY);\n const isTransactionManager = injects.find(it => it.config?.situationType === InjectSituationType.TransactionManager);\n const siturationContainers = new SituationTypeContainers();\n if (isJson) {\n let data = await rr.reqBodyJsonData()\n if (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 (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\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 === ReqJsonBody) {\n otherStorage.set(ReqJsonBody, await rr.reqBodyReqJsonBody())\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 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 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,+BAAkC;AAClC,8BAAiC;AAEjC,kBAAsE;AACtE,mBAAsC;AACtC,6BAAgC;AAChC,2BAA0F;AAC1F,wBAA2B;AAC3B,yBAA4B;AAC5B,mBAAsB;AAEtB,gCAAsE;AACtE,oBAA2E;AAE3E,0BAA6B;AAC7B,4BAA+B;AAC/B,yBAA4B;AAC5B,uBAA0B;AAC1B,0BAA6B;AAC7B,kCAAqC;AACrC,wBAAqD;AACrD,4BAA+B;AAC/B,uBAA0B;AAC1B,oBAAyB;AAEzB,iBAAgC;AAChC,wBAA2B;AAC3B,4BAA+B;AAC/B,iCAAoC;AAE7B,MAAM,6BAA6B,2CAAkB;AAAA,EAG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AACnF,cAAM,UAAU,OAAO,KAAK,OAAO,iBAAiB,aAAa,KAAK,iBAAiB,YAAY,KAAK,OAAO,YAAY,IAAI,KAAK,OAAO;AAC3I,YAAI,CAAC,SAAS;AACV,aAAG,OAAO;AAGV;AAAA,QACJ;AACA,YAAI,KAAK,OAAO,MAAM,UAAU;AAC5B,uBAAa,IAAI,EAAE,aAAqC,CAAC;AACzD,uBAAa,IAAI,sCAAwB,IAAI,qCAAuB;AAAA,YAChE,eAAe,wDAA8B;AAAA,YAC7C,MAAM;AAAA,UACV,CAAC,CAAC;AAAA,QACN;AACA,cAAM,aAAS,kDAAuB,SAAS,CAAC;AAChD,YAAI,QAAQ;AACR,gBAAM,KAAK,iBAAiB,+BAA+B;AAAA,YACvD,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,UACtB,GAAG,YAAY;AAAA,QACnB;AAAA,MACJ,UAAE;AACE,4BAAoB,QAAQ;AAAA,MAChC;AAEA,UAAI,CAAC,GAAG,UAAU,GAAG;AACjB,WAAG,OAAO;AAAA,MACd;AAAA,IACJ,CAAC;AAED,SAAK,OAAO,OAAO,KAAK,OAAO,OAAO,MAAM,KAAK,OAAO,OAAO,UAAU,KAAK,OAAO,OAAO,SAAS,MAAM;AACvG,WAAK,OAAO,OAAO,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC5D,CAAC;AAAA,EACL;AACJ;",
4
+ "sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { HttpServerOption } from './option/HttpServerOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { IncomingMessage, Server as HttpServer, ServerResponse } from 'http'\nimport { Server as HttpsServer } from 'https'; // Add HTTPS support\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/decorators/exception/ExceptionDecorator';\nimport { getInject, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { EndPoint } from './endpoints/EndPoint';\nimport { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\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/route/RouterModule';\nimport { ReqMultipartFormBody } from './models/datas/body/ReqMultipartFormBody';\nimport { execValidationInValid, getValidIndex } from '@dooboostore/simple-boot/decorators/validate/Validation';\nimport { ValidException } from '@dooboostore/simple-boot/errors/ValidException';\nimport { HttpError } from './errors/HttpError';\nimport { getRoute } from '@dooboostore/simple-boot/decorators/route/Router';\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/search/ReqSearchParamsObj\";\n\nexport class SimpleBootHttpServer extends SimpleApplication {\n public server?: HttpServer | HttpsServer;\n private sessionManager: SessionManager;\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>, any>) {\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 rr.resSetHeader(HttpHeaders.SetCookie, `${this.option.sessionOption.key}=${session.uuid}; Path=/; HttpOnly`);\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 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 const isTransactionManager = injects.find(it => it.config?.situationType === InjectSituationType.TransactionManager);\n const siturationContainers = new SituationTypeContainers();\n if (isJson) {\n let data = await rr.reqBodyJsonData()\n if (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\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 === 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 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 this.server.listen(this.option.listen.port, this.option.listen.hostname, this.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J;AACA,YAAI,KAAK,OAAO,MAAM,UAAU;AAC5B,uBAAa,IAAI,EAAE,aAAqC,CAAC;AACzD,uBAAa,IAAI,sCAAwB,IAAI,qCAAuB;AAAA,YAChE,eAAe,wDAA8B;AAAA,YAC7C,MAAM;AAAA,UACV,CAAC,CAAC;AAAA,QACN;AACA,cAAM,aAAS,kDAAuB,SAAS,CAAC;AAChD,YAAI,QAAQ;AACR,gBAAM,KAAK,iBAAiB,+BAA+B;AAAA,YACvD,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,UACtB,GAAG,YAAY;AAAA,QACnB;AAAA,MACJ,UAAE;AACE,4BAAoB,QAAQ;AAAA,MAChC;AAEA,UAAI,CAAC,GAAG,UAAU,GAAG;AACjB,WAAG,OAAO;AAAA,MACd;AAAA,IACJ,CAAC;AAED,SAAK,OAAO,OAAO,KAAK,OAAO,OAAO,MAAM,KAAK,OAAO,OAAO,UAAU,KAAK,OAAO,OAAO,SAAS,MAAM;AACvG,WAAK,OAAO,OAAO,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC5D,CAAC;AAAA,EACL;AACJ;",
6
6
  "names": ["HttpsServer", "HttpServer", "it", "data"]
7
7
  }
@@ -22,6 +22,7 @@ __export(HttpStatus_exports, {
22
22
  module.exports = __toCommonJS(HttpStatus_exports);
23
23
  var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
24
24
  HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
25
+ HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
25
26
  HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
26
27
  HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
27
28
  HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/codes/HttpStatus.ts"],
4
- "sourcesContent": ["export enum HttpStatus {\n Ok = 200,\n\n /**\n * HTTP 301 Moved Permanently \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC8FC\uC5B4\uC9C4 URL\uB85C \uC644\uC804\uD788 \uC62E\uACA8\uC84C\uB2E4\uB294 \uAC83\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uB294 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uD2B8\uD558\uACE0, \uAC80\uC0C9 \uC5D4\uC9C4\uC740 \uD574\uB2F9 \uB9AC\uC18C\uC2A4\uB85C \uC5F0\uACB0\uB418\uB294 \uB9C1\uD06C\uB97C \uAC31\uC2E0\uD569\uB2C8\uB2E4.\n */\n MovedPermanently = 301,\n /**\n * https://developer.mozilla.org/ko/docs/Web/HTTP/Reference/Status/302\n * HTTP(HyperText Transfer Protocol) 302 Found \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC9C0\uC815\uB41C URL\uB85C \uC77C\uC2DC\uC801\uC73C\uB85C \uC774\uB3D9\uB418\uC5C8\uC74C\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uB294 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uC158\uB418\uC9C0\uB9CC \uAC80\uC0C9 \uC5D4\uC9C4\uC740 \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uB9C1\uD06C\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4('SEO-speak'\uC5D0\uC11C\uB294 'link-juice'\uAC00 \uC0C8 URL\uB85C \uC804\uC1A1\uB418\uC9C0 \uC54A\uB294\uB2E4\uACE0 \uD569\uB2C8\uB2E4).\n * \uBA85\uC138\uC11C\uC5D0\uC11C \uB9AC\uB514\uB809\uC158\uC774 \uC218\uD589\uB420 \uB54C \uBA54\uC11C\uB4DC(\uBC0F \uBCF8\uBB38)\uAC00 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uB3C4\uB85D \uC694\uAD6C\uD558\uB354\uB77C\uB3C4 \uBAA8\uB4E0 \uC0AC\uC6A9\uC790 \uC5D0\uC774\uC804\uD2B8\uAC00 \uC774\uB97C \uC900\uC218\uD558\uB294 \uAC83\uC740 \uC544\uB2D9\uB2C8\uB2E4. \uC5EC\uB7EC\uBD84\uC740 \uC5EC\uC804\uD788 \uC774\uB7EC\uD55C \uC720\uD615\uC758 \uBC84\uADF8\uAC00 \uC788\uB294 \uC18C\uD504\uD2B8\uC6E8\uC5B4\uB97C \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C \uB530\uB77C\uC11C 302 \uCF54\uB4DC\uB294 GET \uB610\uB294 HEAD \uBA54\uC11C\uB4DC\uC5D0 \uB300\uD55C \uC751\uB2F5\uC73C\uB85C\uB9CC \uC124\uC815\uD558\uACE0 \uC774 \uACBD\uC6B0 \uBA54\uC11C\uB4DC \uBCC0\uACBD\uC774 \uBA85\uC2DC\uC801\uC73C\uB85C \uAE08\uC9C0\uB418\uBBC0\uB85C 307 Temporary Redirect \uB97C \uB300\uC2E0 \uC0AC\uC6A9\uD558\uB294 \uAC83\uC774 \uC88B\uC2B5\uB2C8\uB2E4.\n * \uC0AC\uC6A9\uD558\uB358 \uBA54\uC11C\uB4DC\uB97C GET\uC73C\uB85C \uBCC0\uACBD\uD558\uB824\uB294 \uACBD\uC6B0, 303 See Other\uC744 \uB300\uC2E0 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. PUT \uBA54\uC11C\uB4DC\uC5D0 \uB300\uD55C \uC751\uB2F5\uC744 \uC5C5\uB85C\uB4DC\uB41C \uB9AC\uC18C\uC2A4\uAC00 \uC544\uB2C8\uB77C 'You successfully updown XYZ'\uC640 \uAC19\uC740 \uD655\uC778 \uBA54\uC2DC\uC9C0\uB85C \uC8FC\uACE0 \uC2F6\uC744\uB54C \uC720\uC6A9\uD569\uB2C8\uB2E4.\n */\n Found = 302,\n /**\n * HTTP(HyperText Transfer Protocol) 303 See Other \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uB9AC\uB514\uB809\uC158\uC774 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4 \uC790\uCCB4\uC5D0 \uC5F0\uACB0\uB418\uC9C0 \uC54A\uACE0 \uB2E4\uB978 \uD398\uC774\uC9C0(\uC608: \uD655\uC778 \uD398\uC774\uC9C0, \uC2E4\uC81C \uAC1C\uCCB4 \uD45C\uC2DC(HTTP range-14 \uCC38\uC870) \uB610\uB294 \uC5C5\uB85C\uB4DC \uC9C4\uD589\uB960 \uD398\uC774\uC9C0)\uC5D0 \uC5F0\uACB0\uB428\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uC774 \uC751\uB2F5 \uCF54\uB4DC\uB294 PUT \uB610\uB294 POST\uC758 \uACB0\uACFC\uB85C \uB2E4\uC2DC \uC804\uC1A1\uB418\uB294 \uACBD\uC6B0\uAC00 \uB9CE\uC2B5\uB2C8\uB2E4. \uC774 \uB9AC\uB514\uB809\uC158 \uD398\uC774\uC9C0\uB97C \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uB294 \uBC29\uBC95\uC740 \uD56D\uC0C1 GET\uC785\uB2C8\uB2E4.\n */\n SeeOther = 303,\n /**\n * \uD074\uB77C\uC774\uC5B8\uD2B8 \uB9AC\uB514\uB809\uC158 \uC751\uB2F5 \uCF54\uB4DC 304 Not Modified \uB294 \uC694\uCCAD\uB41C \uB9AC\uC18C\uC2A4\uB97C \uC7AC\uC804\uC1A1\uD560 \uD544\uC694\uAC00 \uC5C6\uC74C\uC744 \uB098\uD0C0\uB0B8\uB2E4. \uCE90\uC2DC\uB41C \uC790\uC6D0\uC73C\uB85C\uC758 \uC554\uBB35\uC801\uC778 \uB9AC\uB514\uB809\uC158\uC774\uB2E4. \uC774 \uB294 GET \uB098 HEAD \uC694\uCCAD\uCC98\uB7FC \uC694\uCCAD \uBC29\uBC95\uC774 \uC548\uC804 \uD55C \uACBD\uC6B0 \uB610\uB294 \uC694\uCCAD\uC774 \uC870\uAC74\uBD80\uB85C If-None-Match \uB610\uB294 If-Modified-Since \uD5E4\uB354\uB97C \uC0AC\uC6A9\uD560 \uB54C \uC751\uB2F5 \uB41C\uB2E4.\n * \uC774\uC5D0 \uC0C1\uC751\uD558\uB294 200 OK \uC751\uB2F5\uC5D0\uB294 Cache-Control, Content-Location, Date, ETag, Expires, \uADF8\uB9AC\uACE0 Vary \uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC5C8\uC744 \uAC83\uC774\uB2E4.\n */\n NotModified = 304,\n /**\n * HTTP 307 Temporary Redirect \uB9AC\uB2E4\uC774\uB809\uD2B8 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC8FC\uC5B4\uC9C4 URL \uB85C \uC784\uC2DC\uB85C \uC62E\uACA8\uC84C\uB2E4\uB294 \uAC83\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4.\n * \uC6D0\uB798 \uC694\uCCAD\uD55C \uBA54\uC18C\uB4DC\uC640 Body \uB97C \uC7AC\uC0AC\uC6A9\uD558\uC5EC \uC694\uCCAD\uC744 \uB9AC\uB2E4\uC774\uB809\uD2B8 \uD569\uB2C8\uB2E4. \uC5EC\uAE30\uC11C \uBA54\uC18C\uB4DC\uB97C GET\uC73C\uB85C \uBC14\uAFB8\uAE30 \uC704\uD574\uC11C 303 See Other\uB97C \uC0AC\uC6A9\uD558\uC2DC\uBA74 \uB429\uB2C8\uB2E4. \uC774\uAC83\uC740 PUT\uC694\uCCAD\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uB9AC\uC18C\uC2A4\uAC00 \uC544\uB2CC \"You successfully uploaded XYZ\"\uC640 \uAC19\uC740 \uD655\uC778\uBA54\uC2DC\uC9C0 \uC751\uB2F5\uC744 \uC81C\uACF5 \uD558\uB294\uB370\uC5D0 \uC720\uC6A9\uD569\uB2C8\uB2E4.\n * 307\uACFC 302\uAC00 \uC720\uC77C\uD558\uAC8C \uB2E4\uB978\uC810\uC740 307\uC740 Method \uC640 Body \uB97C \uBCC0\uACBD\uD558\uC9C0 \uC54A\uACE0 \uB9AC\uB2E4\uC774\uB809\uD2B8 \uC694\uCCAD\uC744 \uD558\uB3C4\uB85D \uBCF4\uC7A5\uD569\uB2C8\uB2E4. 302\uC751\uB2F5\uC73C\uB85C \uC778\uD558\uC5EC \uC77C\uBD80 \uC624\uB798\uB41C \uD074\uB77C\uC774\uC5B8\uD2B8\uB4E4\uC740 \uBA54\uC18C\uB4DC\uB97C GET\uC73C\uB85C \uD2C0\uB9AC\uAC8C \uBCC0\uACBD\uD558\uC600\uC2B5\uB2C8\uB2E4. GET\uC774 \uC544\uB2CC \uB2E4\uB978 \uBA54\uC18C\uB4DC\uC5D0 302\uB3D9\uC791\uC740 \uC6F9\uC5D0\uC11C \uC608\uC0C1\uB418\uC9C0 \uC54A\uC9C0\uB9CC 307 \uB3D9\uC791\uC740 \uC608\uC0C1\uD560\uC218 \uC788\uC2B5\uB2C8\uB2E4. GET \uC694\uCCAD\uC5D0 \uB300\uD574\uC11C\uB294 \uB3D9\uC77C\uD558\uAC8C \uB3D9\uC791 \uD569\uB2C8\uB2E4.\n */\n TemporaryRedirect = 307,\n /**\n * \uD558\uC774\uD37C\uD14D\uC2A4\uD2B8 \uC804\uC1A1 \uD504\uB85C\uD1A0\uCF5C (HTTP) 308 Permanent Redirect \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uB41C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC9C0\uC815\uB41C URL\uB85C \uD655\uC2E4\uD788 \uC774\uB3D9\uB418\uC5C8\uC74C\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uAC00 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uC158\uB418\uACE0 \uAC80\uC0C9\uC5D4\uC9C4\uC740 \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uB9C1\uD06C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4('SEO-speak'\uC5D0\uC11C\uB294 'link-juice'\uAC00 \uC0C8 URL\uB85C \uC804\uC1A1\uB429\uB2C8\uB2E4).\n * \uC694\uCCAD \uBA54\uC11C\uB4DC\uC640 \uBCF8\uBB38\uC740 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC9C0\uB9CC, 301\uC740 \uB54C\uB54C\uB85C GET \uBA54\uC11C\uB4DC\uB85C \uC798\uBABB \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n */\n PermanentRedirect = 308,\n BadRequest = 400,\n Unauthorized = 401,\n Forbidden = 403,\n NotFound = 404,\n InternalServerError = 500,\n NotImplemented = 501,\n BadGateway = 502,\n ServiceUnavailable = 503,\n GatewayTimeout = 504,\n HttpVersionNotSupported = 505\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,aAAL,kBAAKA,gBAAL;AACH,EAAAA,wBAAA,QAAK,OAAL;AAKA,EAAAA,wBAAA,sBAAmB,OAAnB;AAOA,EAAAA,wBAAA,WAAQ,OAAR;AAIA,EAAAA,wBAAA,cAAW,OAAX;AAKA,EAAAA,wBAAA,iBAAc,OAAd;AAMA,EAAAA,wBAAA,uBAAoB,OAApB;AAKA,EAAAA,wBAAA,uBAAoB,OAApB;AACA,EAAAA,wBAAA,gBAAa,OAAb;AACA,EAAAA,wBAAA,kBAAe,OAAf;AACA,EAAAA,wBAAA,eAAY,OAAZ;AACA,EAAAA,wBAAA,cAAW,OAAX;AACA,EAAAA,wBAAA,yBAAsB,OAAtB;AACA,EAAAA,wBAAA,oBAAiB,OAAjB;AACA,EAAAA,wBAAA,gBAAa,OAAb;AACA,EAAAA,wBAAA,wBAAqB,OAArB;AACA,EAAAA,wBAAA,oBAAiB,OAAjB;AACA,EAAAA,wBAAA,6BAA0B,OAA1B;AA3CQ,SAAAA;AAAA,GAAA;",
4
+ "sourcesContent": ["export enum HttpStatus {\n Ok = 200,\n\n /**\n * Multiple Choices\u00A0\u21E2 \uC694\uCCAD\uC5D0 \uB300\uD574\uC11C \uB458 \uC774\uC0C1\uC758 \uAC00\uB2A5\uD55C \uC751\uB2F5\uC774 \uC788\uC74C\uC744 \uB098\uD0C0\uB0B8\uB2E4.\n * \uD074\uB77C\uC774\uC5B8\uD2B8\uAC00 \uB3D9\uC2DC\uC5D0 \uC5EC\uB7EC \uB9AC\uC18C\uC2A4\uB97C \uAC00\uB9AC\uD0A4\uB294 URL\uC744 \uC694\uCCAD\uD55C \uACBD\uC6B0, \uADF8 \uB9AC\uC18C\uC2A4\uC758 \uBAA9\uB85D\uACFC \uD568\uAED8 \uBC18\uD658\uB41C\uB2E4.\n * \uC5B4\uB5A4 \uC11C\uBC84\uAC00 \uD558\uB098\uC758 HTML \uBB38\uC11C\uB97C \uC601\uC5B4\uC640 \uD504\uB791\uC2A4\uC5B4 \uBAA8\uB450\uB85C \uC81C\uACF5\uD558\uB294 \uACBD\uC6B0 \uB4F1\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB2E4.\n * \uADF8\uB7EC\uB098 \uC751\uB2F5 \uC911 \uD558\uB098\uB97C \uC120\uD0DD\uD558\uB294 \uD45C\uC900\uD654\uB41C \uBC29\uBC95\uC774 \uC5C6\uAE30 \uB54C\uBB38\uC5D0, \uC774 \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC2E4\uBB34\uC5D0\uC120 \uAC70\uC758 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294\uB2E4.\n */\n MultipleChoices = 300,\n\n /**\n * \uC601\uAD6C\n * HTTP 301 Moved Permanently \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC8FC\uC5B4\uC9C4 URL\uB85C \uC644\uC804\uD788 \uC62E\uACA8\uC84C\uB2E4\uB294 \uAC83\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uB294 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uD2B8\uD558\uACE0, \uAC80\uC0C9 \uC5D4\uC9C4\uC740 \uD574\uB2F9 \uB9AC\uC18C\uC2A4\uB85C \uC5F0\uACB0\uB418\uB294 \uB9C1\uD06C\uB97C \uAC31\uC2E0\uD569\uB2C8\uB2E4.\n * Moved Permanently \u21E2 \uC601\uAD6C\uC801\uC73C\uB85C \uC774\uB3D9 (\uC601\uAD6C \uB9AC\uB2E4\uC774\uB809\uC158)\n * \uC694\uCCAD\uB41C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uAC00 \uC9C0\uC815\uD55C URL\uB85C \uC774\uB3D9\uB418\uC5C8\uC74C\uC744 \uB098\uD0C0\uB0B8\uB2E4.\n * \uD574\uB2F9 URL\uB85C \uB9AC\uB2E4\uC774\uB809\uC158 \uB418\uBA74, \uC694\uCCAD \uBA54\uC11C\uB4DC\uAC00 GET\uC73C\uB85C \uBCC0\uD558\uACE0 \uBCF8\uBB38\uC774 \uC81C\uAC70\uB420\uC218 \uC788\uB2E4.\n * \uB530\uB77C\uC11C 301 \uCF54\uB4DC\uB294\u00A0GET\u00A0\uB610\uB294\u00A0HEAD\u00A0\uBC29\uBC95\uC5D0 \uB300\uD55C \uC751\uB2F5\uC73C\uB85C\uB9CC \uC0AC\uC6A9\uD558\uACE0, \uB300\uC2E0 POST, PUT \uAC19\uC740 \uACBD\uC6B0\uB294 \uAC19\uC740 \uC601\uAD6C \uB9AC\uB514\uB809\uC158\uC778 308 Permanent Redirect \uC744 \uC0AC\uC6A9\uD558\uB294 \uAC83\uC774 \uC88B\uB2E4.\n */\n MovedPermanently = 301,\n\n /** \uC784\uC2DC\n * https://developer.mozilla.org/ko/docs/Web/HTTP/Reference/Status/302\n * HTTP(HyperText Transfer Protocol) 302 Found \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC9C0\uC815\uB41C URL\uB85C \uC77C\uC2DC\uC801\uC73C\uB85C \uC774\uB3D9\uB418\uC5C8\uC74C\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uB294 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uC158\uB418\uC9C0\uB9CC \uAC80\uC0C9 \uC5D4\uC9C4\uC740 \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uB9C1\uD06C\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4('SEO-speak'\uC5D0\uC11C\uB294 'link-juice'\uAC00 \uC0C8 URL\uB85C \uC804\uC1A1\uB418\uC9C0 \uC54A\uB294\uB2E4\uACE0 \uD569\uB2C8\uB2E4).\n * \uBA85\uC138\uC11C\uC5D0\uC11C \uB9AC\uB514\uB809\uC158\uC774 \uC218\uD589\uB420 \uB54C \uBA54\uC11C\uB4DC(\uBC0F \uBCF8\uBB38)\uAC00 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uB3C4\uB85D \uC694\uAD6C\uD558\uB354\uB77C\uB3C4 \uBAA8\uB4E0 \uC0AC\uC6A9\uC790 \uC5D0\uC774\uC804\uD2B8\uAC00 \uC774\uB97C \uC900\uC218\uD558\uB294 \uAC83\uC740 \uC544\uB2D9\uB2C8\uB2E4. \uC5EC\uB7EC\uBD84\uC740 \uC5EC\uC804\uD788 \uC774\uB7EC\uD55C \uC720\uD615\uC758 \uBC84\uADF8\uAC00 \uC788\uB294 \uC18C\uD504\uD2B8\uC6E8\uC5B4\uB97C \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uB530\uB77C\uC11C \uB530\uB77C\uC11C 302 \uCF54\uB4DC\uB294 GET \uB610\uB294 HEAD \uBA54\uC11C\uB4DC\uC5D0 \uB300\uD55C \uC751\uB2F5\uC73C\uB85C\uB9CC \uC124\uC815\uD558\uACE0 \uC774 \uACBD\uC6B0 \uBA54\uC11C\uB4DC \uBCC0\uACBD\uC774 \uBA85\uC2DC\uC801\uC73C\uB85C \uAE08\uC9C0\uB418\uBBC0\uB85C 307 Temporary Redirect \uB97C \uB300\uC2E0 \uC0AC\uC6A9\uD558\uB294 \uAC83\uC774 \uC88B\uC2B5\uB2C8\uB2E4.\n * \uC0AC\uC6A9\uD558\uB358 \uBA54\uC11C\uB4DC\uB97C GET\uC73C\uB85C \uBCC0\uACBD\uD558\uB824\uB294 \uACBD\uC6B0, 303 See Other\uC744 \uB300\uC2E0 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. PUT \uBA54\uC11C\uB4DC\uC5D0 \uB300\uD55C \uC751\uB2F5\uC744 \uC5C5\uB85C\uB4DC\uB41C \uB9AC\uC18C\uC2A4\uAC00 \uC544\uB2C8\uB77C 'You successfully updown XYZ'\uC640 \uAC19\uC740 \uD655\uC778 \uBA54\uC2DC\uC9C0\uB85C \uC8FC\uACE0 \uC2F6\uC744\uB54C \uC720\uC6A9\uD569\uB2C8\uB2E4.\n */\n Found = 302,\n\n /**\n * HTTP(HyperText Transfer Protocol) 303 See Other \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uB9AC\uB514\uB809\uC158\uC774 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4 \uC790\uCCB4\uC5D0 \uC5F0\uACB0\uB418\uC9C0 \uC54A\uACE0 \uB2E4\uB978 \uD398\uC774\uC9C0(\uC608: \uD655\uC778 \uD398\uC774\uC9C0, \uC2E4\uC81C \uAC1C\uCCB4 \uD45C\uC2DC(HTTP range-14 \uCC38\uC870) \uB610\uB294 \uC5C5\uB85C\uB4DC \uC9C4\uD589\uB960 \uD398\uC774\uC9C0)\uC5D0 \uC5F0\uACB0\uB428\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uC774 \uC751\uB2F5 \uCF54\uB4DC\uB294 PUT \uB610\uB294 POST\uC758 \uACB0\uACFC\uB85C \uB2E4\uC2DC \uC804\uC1A1\uB418\uB294 \uACBD\uC6B0\uAC00 \uB9CE\uC2B5\uB2C8\uB2E4. \uC774 \uB9AC\uB514\uB809\uC158 \uD398\uC774\uC9C0\uB97C \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uB294 \uBC29\uBC95\uC740 \uD56D\uC0C1 GET\uC785\uB2C8\uB2E4.\n */\n SeeOther = 303,\n\n /**\n * \uD074\uB77C\uC774\uC5B8\uD2B8 \uB9AC\uB514\uB809\uC158 \uC751\uB2F5 \uCF54\uB4DC 304 Not Modified \uB294 \uC694\uCCAD\uB41C \uB9AC\uC18C\uC2A4\uB97C \uC7AC\uC804\uC1A1\uD560 \uD544\uC694\uAC00 \uC5C6\uC74C\uC744 \uB098\uD0C0\uB0B8\uB2E4. \uCE90\uC2DC\uB41C \uC790\uC6D0\uC73C\uB85C\uC758 \uC554\uBB35\uC801\uC778 \uB9AC\uB514\uB809\uC158\uC774\uB2E4. \uC774 \uB294 GET \uB098 HEAD \uC694\uCCAD\uCC98\uB7FC \uC694\uCCAD \uBC29\uBC95\uC774 \uC548\uC804 \uD55C \uACBD\uC6B0 \uB610\uB294 \uC694\uCCAD\uC774 \uC870\uAC74\uBD80\uB85C If-None-Match \uB610\uB294 If-Modified-Since \uD5E4\uB354\uB97C \uC0AC\uC6A9\uD560 \uB54C \uC751\uB2F5 \uB41C\uB2E4.\n * \uC774\uC5D0 \uC0C1\uC751\uD558\uB294 200 OK \uC751\uB2F5\uC5D0\uB294 Cache-Control, Content-Location, Date, ETag, Expires, \uADF8\uB9AC\uACE0 Vary \uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC5C8\uC744 \uAC83\uC774\uB2E4.\n */\n NotModified = 304,\n\n /**\n * HTTP 307 Temporary Redirect \uB9AC\uB2E4\uC774\uB809\uD2B8 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uD55C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC8FC\uC5B4\uC9C4 URL \uB85C \uC784\uC2DC\uB85C \uC62E\uACA8\uC84C\uB2E4\uB294 \uAC83\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4.\n * \uC6D0\uB798 \uC694\uCCAD\uD55C \uBA54\uC18C\uB4DC\uC640 Body \uB97C \uC7AC\uC0AC\uC6A9\uD558\uC5EC \uC694\uCCAD\uC744 \uB9AC\uB2E4\uC774\uB809\uD2B8 \uD569\uB2C8\uB2E4. \uC5EC\uAE30\uC11C \uBA54\uC18C\uB4DC\uB97C GET\uC73C\uB85C \uBC14\uAFB8\uAE30 \uC704\uD574\uC11C 303 See Other\uB97C \uC0AC\uC6A9\uD558\uC2DC\uBA74 \uB429\uB2C8\uB2E4. \uC774\uAC83\uC740 PUT\uC694\uCCAD\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uB9AC\uC18C\uC2A4\uAC00 \uC544\uB2CC \"You successfully uploaded XYZ\"\uC640 \uAC19\uC740 \uD655\uC778\uBA54\uC2DC\uC9C0 \uC751\uB2F5\uC744 \uC81C\uACF5 \uD558\uB294\uB370\uC5D0 \uC720\uC6A9\uD569\uB2C8\uB2E4.\n * 307\uACFC 302\uAC00 \uC720\uC77C\uD558\uAC8C \uB2E4\uB978\uC810\uC740 307\uC740 Method \uC640 Body \uB97C \uBCC0\uACBD\uD558\uC9C0 \uC54A\uACE0 \uB9AC\uB2E4\uC774\uB809\uD2B8 \uC694\uCCAD\uC744 \uD558\uB3C4\uB85D \uBCF4\uC7A5\uD569\uB2C8\uB2E4. 302\uC751\uB2F5\uC73C\uB85C \uC778\uD558\uC5EC \uC77C\uBD80 \uC624\uB798\uB41C \uD074\uB77C\uC774\uC5B8\uD2B8\uB4E4\uC740 \uBA54\uC18C\uB4DC\uB97C GET\uC73C\uB85C \uD2C0\uB9AC\uAC8C \uBCC0\uACBD\uD558\uC600\uC2B5\uB2C8\uB2E4. GET\uC774 \uC544\uB2CC \uB2E4\uB978 \uBA54\uC18C\uB4DC\uC5D0 302\uB3D9\uC791\uC740 \uC6F9\uC5D0\uC11C \uC608\uC0C1\uB418\uC9C0 \uC54A\uC9C0\uB9CC 307 \uB3D9\uC791\uC740 \uC608\uC0C1\uD560\uC218 \uC788\uC2B5\uB2C8\uB2E4. GET \uC694\uCCAD\uC5D0 \uB300\uD574\uC11C\uB294 \uB3D9\uC77C\uD558\uAC8C \uB3D9\uC791 \uD569\uB2C8\uB2E4.\n */\n TemporaryRedirect = 307,\n\n /**\n * \uD558\uC774\uD37C\uD14D\uC2A4\uD2B8 \uC804\uC1A1 \uD504\uB85C\uD1A0\uCF5C (HTTP) 308 Permanent Redirect \uB9AC\uB514\uB809\uC158 \uC0C1\uD0DC \uC751\uB2F5 \uCF54\uB4DC\uB294 \uC694\uCCAD\uB41C \uB9AC\uC18C\uC2A4\uAC00 Location \uD5E4\uB354\uC5D0 \uC9C0\uC815\uB41C URL\uB85C \uD655\uC2E4\uD788 \uC774\uB3D9\uB418\uC5C8\uC74C\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800\uAC00 \uC774 \uD398\uC774\uC9C0\uB85C \uB9AC\uB514\uB809\uC158\uB418\uACE0 \uAC80\uC0C9\uC5D4\uC9C4\uC740 \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uB9C1\uD06C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4('SEO-speak'\uC5D0\uC11C\uB294 'link-juice'\uAC00 \uC0C8 URL\uB85C \uC804\uC1A1\uB429\uB2C8\uB2E4).\n * \uC694\uCCAD \uBA54\uC11C\uB4DC\uC640 \uBCF8\uBB38\uC740 \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC9C0\uB9CC, 301\uC740 \uB54C\uB54C\uB85C GET \uBA54\uC11C\uB4DC\uB85C \uC798\uBABB \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n */\n PermanentRedirect = 308,\n BadRequest = 400,\n Unauthorized = 401,\n Forbidden = 403,\n NotFound = 404,\n InternalServerError = 500,\n NotImplemented = 501,\n BadGateway = 502,\n ServiceUnavailable = 503,\n GatewayTimeout = 504,\n HttpVersionNotSupported = 505\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,aAAL,kBAAKA,gBAAL;AACH,EAAAA,wBAAA,QAAK,OAAL;AAQA,EAAAA,wBAAA,qBAAkB,OAAlB;AAUA,EAAAA,wBAAA,sBAAmB,OAAnB;AAQA,EAAAA,wBAAA,WAAQ,OAAR;AAKA,EAAAA,wBAAA,cAAW,OAAX;AAMA,EAAAA,wBAAA,iBAAc,OAAd;AAOA,EAAAA,wBAAA,uBAAoB,OAApB;AAMA,EAAAA,wBAAA,uBAAoB,OAApB;AACA,EAAAA,wBAAA,gBAAa,OAAb;AACA,EAAAA,wBAAA,kBAAe,OAAf;AACA,EAAAA,wBAAA,eAAY,OAAZ;AACA,EAAAA,wBAAA,cAAW,OAAX;AACA,EAAAA,wBAAA,yBAAsB,OAAtB;AACA,EAAAA,wBAAA,oBAAiB,OAAjB;AACA,EAAAA,wBAAA,gBAAa,OAAb;AACA,EAAAA,wBAAA,wBAAqB,OAArB;AACA,EAAAA,wBAAA,oBAAiB,OAAjB;AACA,EAAAA,wBAAA,6BAA0B,OAA1B;AA7DQ,SAAAA;AAAA,GAAA;",
6
6
  "names": ["HttpStatus"]
7
7
  }
@@ -54,6 +54,7 @@ var import_ReflectUtils = require("@dooboostore/core/reflect/ReflectUtils");
54
54
  var import_HttpMethod = require("../codes/HttpMethod");
55
55
  var UrlMappingSituationType = /* @__PURE__ */ ((UrlMappingSituationType2) => {
56
56
  UrlMappingSituationType2["REQ_JSON_BODY"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_JSON_BODY";
57
+ UrlMappingSituationType2["REQ_URL_SEARCH_PARAMS_OBJ"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_URL_SEARCH_PARAMS_OBJ";
57
58
  UrlMappingSituationType2["REQ_FORM_URL_BODY"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_FORM_URL_BODY";
58
59
  return UrlMappingSituationType2;
59
60
  })(UrlMappingSituationType || {});
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/MethodMapping.ts"],
4
- "sourcesContent": ["import { ConstructorType } from '@dooboostore/core/types';\nimport { ReflectMethod } from '@dooboostore/simple-boot/types/Types';\nimport { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { Resolver } from '../resolvers/Resolver';\nimport { Mimes } from '../codes/Mimes';\nimport { HttpMethod } from '../codes/HttpMethod';\n\nexport enum UrlMappingSituationType {\n REQ_JSON_BODY = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_JSON_BODY',\n REQ_FORM_URL_BODY = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_FORM_URL_BODY'\n}\nexport type MappingConfig = {\n method: HttpMethod | string,\n description?: {\n name?: string;\n detail?: string;\n };\n\n req?: {\n contentType?: (Mimes|string)[];\n accept?: (Mimes|string)[];\n };\n\n res?: {\n status?: number;\n header?: {[key: string]: string};\n contentType?: Mimes | string;\n }\n resolver?: Resolver|ConstructorType<Resolver>;\n}\nexport type SaveMappingConfig = {propertyKey: string | symbol; config: MappingConfig}\nconst MappingMetadataKey = Symbol('MappingMetadataKey');\n// const GETSMappingMetadataKey = Symbol('GET_METHODS');\n// const GETMappingMetadataKey = Symbol('GET_METHOD');\n\nconst process = (config: MappingConfig, target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const saveMappingConfigs = (ReflectUtils.getMetadata(MappingMetadataKey, target.constructor) ?? []) as SaveMappingConfig[];\n saveMappingConfigs.push({propertyKey, config});\n ReflectUtils.defineMetadata(MappingMetadataKey, saveMappingConfigs, target.constructor);\n ReflectUtils.defineMetadata(MappingMetadataKey, config, target, propertyKey);\n}\nexport function UrlMapping(config: MappingConfig): ReflectMethod;\nexport function UrlMapping(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function UrlMapping(configOrtarget?: MappingConfig | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.GET}, configOrtarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n process(configOrtarget, target, propertyKey, descriptor);\n }\n }\n}\nexport const getUrlMapping = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return ReflectUtils.getMetadata(MappingMetadataKey, target, propertyKey);\n}\n\nexport const getUrlMappings = (target: any): SaveMappingConfig[] => {\n if (target !== null && undefined !== target && typeof target === 'object') {\n target = target.constructor;\n }\n return ReflectUtils.getMetadata(MappingMetadataKey, target);\n}\nexport function GET(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function GET(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function GET(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.GET}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.GET;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getGET = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getGETS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function POST(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function POST(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function POST(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.POST}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.POST;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPOST = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPOSTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.POST);\n}\nexport function DELETE(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function DELETE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function DELETE(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.DELETE}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.DELETE;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getDELETE = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getDELETES = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.DELETE);\n}\nexport function PUT(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function PUT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function PUT(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.PUT}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.PUT;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPUT = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPUTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.PUT);\n}\nexport function PATCH(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function PATCH(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function PATCH(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.PATCH}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.PATCH;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPATCH = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPATCHS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function OPTIONS(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function OPTIONS(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function OPTIONS(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.OPTIONS}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.OPTIONS;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getOPTIONS = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getOPTIONSS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.OPTIONS);\n}\nexport function HEAD(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function HEAD(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function HEAD(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.HEAD}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.HEAD;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getHEAD = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getHEADS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function TRACE(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function TRACE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function TRACE(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.TRACE}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.TRACE;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getTRACE = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getTRACES = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.TRACE);\n}\nexport function CONNECT(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function CONNECT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function CONNECT(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.CONNECT}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.CONNECT;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getCONNECT = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getCONNECTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.CONNECT);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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Aa,gBAA4D;AAC9F,SAAO,cAAc,QAAQ,WAAW;AAC5C;AACO,MAAM,YAAY,CAAC,WAAqC;AAC3D,SAAO,eAAe,MAAM,GAAG,OAAO,QAAM,GAAG,QAAQ,OAAO,YAAY,MAAM,6BAAW,KAAK;AACpG;AAGO,SAAS,QAAQ,gBAAsD,aAA+B,YAAuD;AAChK,MAAI,eAAe,YAAY;AAC3B,YAAQ,EAAC,QAAQ,6BAAW,QAAO,GAAG,gBAAgB,aAAa,UAAU;AAAA,EACjF,OAAO;AACH,WAAO,CAAC,QAAaD,cAA8BC,gBAAmC;AAClF,qBAAe,SAAS,6BAAW;AACnC,cAAQ,gBAAgB,QAAQD,cAAaC,WAAU;AAAA,IAC3D;AAAA,EACJ;AACJ;AAEO,MAAM,aAAa,CAAC,QAAa,gBAA4D;AAChG,SAAO,cAAc,QAAQ,WAAW;AAC5C;AACO,MAAM,cAAc,CAAC,WAAqC;AAC7D,SAAO,eAAe,MAAM,GAAG,OAAO,QAAM,GAAG,QAAQ,OAAO,YAAY,MAAM,6BAAW,OAAO;AACtG;",
4
+ "sourcesContent": ["import { ConstructorType } from '@dooboostore/core/types';\nimport { ReflectMethod } from '@dooboostore/simple-boot/types/Types';\nimport { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { Resolver } from '../resolvers/Resolver';\nimport { Mimes } from '../codes/Mimes';\nimport { HttpMethod } from '../codes/HttpMethod';\n\nexport enum UrlMappingSituationType {\n REQ_JSON_BODY = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_JSON_BODY',\n // REQ_URL_SEARCH_PARAMS = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_URL_SEARCH_PARAMS',\n REQ_URL_SEARCH_PARAMS_OBJ = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_URL_SEARCH_PARAMS_OBJ',\n REQ_FORM_URL_BODY = 'SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_FORM_URL_BODY'\n}\nexport type MappingConfig = {\n method: HttpMethod | string,\n description?: {\n name?: string;\n detail?: string;\n };\n\n req?: {\n contentType?: (Mimes|string)[];\n accept?: (Mimes|string)[];\n };\n\n res?: {\n status?: number;\n header?: {[key: string]: string};\n contentType?: Mimes | string;\n }\n resolver?: Resolver|ConstructorType<Resolver>;\n}\nexport type SaveMappingConfig = {propertyKey: string | symbol; config: MappingConfig}\nconst MappingMetadataKey = Symbol('MappingMetadataKey');\n// const GETSMappingMetadataKey = Symbol('GET_METHODS');\n// const GETMappingMetadataKey = Symbol('GET_METHOD');\n\nconst process = (config: MappingConfig, target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const saveMappingConfigs = (ReflectUtils.getMetadata(MappingMetadataKey, target.constructor) ?? []) as SaveMappingConfig[];\n saveMappingConfigs.push({propertyKey, config});\n ReflectUtils.defineMetadata(MappingMetadataKey, saveMappingConfigs, target.constructor);\n ReflectUtils.defineMetadata(MappingMetadataKey, config, target, propertyKey);\n}\nexport function UrlMapping(config: MappingConfig): ReflectMethod;\nexport function UrlMapping(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function UrlMapping(configOrtarget?: MappingConfig | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.GET}, configOrtarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n process(configOrtarget, target, propertyKey, descriptor);\n }\n }\n}\nexport const getUrlMapping = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return ReflectUtils.getMetadata(MappingMetadataKey, target, propertyKey);\n}\n\nexport const getUrlMappings = (target: any): SaveMappingConfig[] => {\n if (target !== null && undefined !== target && typeof target === 'object') {\n target = target.constructor;\n }\n return ReflectUtils.getMetadata(MappingMetadataKey, target);\n}\nexport function GET(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function GET(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function GET(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.GET}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.GET;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getGET = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getGETS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function POST(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function POST(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function POST(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.POST}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.POST;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPOST = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPOSTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.POST);\n}\nexport function DELETE(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function DELETE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function DELETE(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.DELETE}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.DELETE;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getDELETE = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getDELETES = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.DELETE);\n}\nexport function PUT(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function PUT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function PUT(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.PUT}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.PUT;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPUT = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPUTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.PUT);\n}\nexport function PATCH(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function PATCH(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function PATCH(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.PATCH}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.PATCH;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getPATCH = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getPATCHS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function OPTIONS(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function OPTIONS(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function OPTIONS(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.OPTIONS}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.OPTIONS;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getOPTIONS = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getOPTIONSS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.OPTIONS);\n}\nexport function HEAD(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function HEAD(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function HEAD(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.HEAD}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.HEAD;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getHEAD = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getHEADS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.GET);\n}\nexport function TRACE(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function TRACE(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function TRACE(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.TRACE}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.TRACE;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getTRACE = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getTRACES = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.TRACE);\n}\nexport function CONNECT(config: Omit<MappingConfig, 'method'>): ReflectMethod;\nexport function CONNECT(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function CONNECT(configOrTarget?: Omit<MappingConfig, 'method'> | any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): ReflectMethod | void {\n if (propertyKey && descriptor) {\n process({method: HttpMethod.CONNECT}, configOrTarget, propertyKey, descriptor);\n } else {\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n configOrTarget.method = HttpMethod.CONNECT;\n process(configOrTarget, target, propertyKey, descriptor);\n }\n }\n}\n\nexport const getCONNECT = (target: any, propertyKey: string | symbol): MappingConfig | undefined => {\n return getUrlMapping(target, propertyKey);\n}\nexport const getCONNECTS = (target: any): SaveMappingConfig[] => {\n return getUrlMappings(target)?.filter(it => it.config?.method.toUpperCase() === HttpMethod.CONNECT);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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SAAO,cAAc,QAAQ,WAAW;AAC5C;AACO,MAAM,YAAY,CAAC,WAAqC;AAC3D,SAAO,eAAe,MAAM,GAAG,OAAO,QAAM,GAAG,QAAQ,OAAO,YAAY,MAAM,6BAAW,KAAK;AACpG;AAGO,SAAS,QAAQ,gBAAsD,aAA+B,YAAuD;AAChK,MAAI,eAAe,YAAY;AAC3B,YAAQ,EAAC,QAAQ,6BAAW,QAAO,GAAG,gBAAgB,aAAa,UAAU;AAAA,EACjF,OAAO;AACH,WAAO,CAAC,QAAaD,cAA8BC,gBAAmC;AAClF,qBAAe,SAAS,6BAAW;AACnC,cAAQ,gBAAgB,QAAQD,cAAaC,WAAU;AAAA,IAC3D;AAAA,EACJ;AACJ;AAEO,MAAM,aAAa,CAAC,QAAa,gBAA4D;AAChG,SAAO,cAAc,QAAQ,WAAW;AAC5C;AACO,MAAM,cAAc,CAAC,WAAqC;AAC7D,SAAO,eAAe,MAAM,GAAG,OAAO,QAAM,GAAG,QAAQ,OAAO,YAAY,MAAM,6BAAW,OAAO;AACtG;",
6
6
  "names": ["UrlMappingSituationType", "propertyKey", "descriptor"]
7
7
  }
@@ -27,26 +27,41 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
  var ResourceFilter_exports = {};
29
29
  __export(ResourceFilter_exports, {
30
- ResourceFilter: () => ResourceFilter
30
+ ResourceFilter: () => ResourceFilter,
31
+ isDataDist: () => isDataDist,
32
+ isPathDist: () => isPathDist
31
33
  });
32
34
  module.exports = __toCommonJS(ResourceFilter_exports);
33
- var import_fs = __toESM(require("fs"), 1);
34
- var import_path = __toESM(require("path"), 1);
35
+ var import_node_fs = __toESM(require("node:fs"), 1);
36
+ var import_node_path = __toESM(require("node:path"), 1);
35
37
  var import_mime_types = __toESM(require("mime-types"), 1);
36
38
  var import_HttpHeaders = require("../codes/HttpHeaders");
37
39
  var import_HttpStatus = require("../codes/HttpStatus");
40
+ var import_node_buffer = require("node:buffer");
41
+ const isPathDist = (item) => {
42
+ return typeof item === "object" && "request" in item && "dist" in item;
43
+ };
44
+ const isDataDist = (item) => {
45
+ return typeof item === "object" && "request" in item && "response" in item;
46
+ };
38
47
  class ResourceFilter {
39
- constructor(resourceDistPath, resourceRegex = []) {
40
- this.resourceDistPath = resourceDistPath;
41
- this.resourceRegex = resourceRegex;
48
+ constructor(resourceDistPathOrResourceRegex, resourceRegex) {
49
+ if (typeof resourceDistPathOrResourceRegex === "string") {
50
+ this.resourceDistPath = resourceDistPathOrResourceRegex;
51
+ this.resources = resourceRegex;
52
+ } else {
53
+ this.resources = resourceDistPathOrResourceRegex;
54
+ }
42
55
  }
56
+ // constructor(private resourceDistPath: string, private resourceRegex: (RequestFilterType | { request: RequestFilterType, dist: string | ((rr: RequestResponse, app: SimpleBootHttpServer) => (string|Promise<Blob |ArrayBuffer| Response>)) })[] = []) {
57
+ // }
43
58
  async onInit(app) {
44
59
  }
45
60
  async proceedBefore({ rr, app }) {
46
61
  const url = (rr.reqUrlPathName ?? "").replace(/\.\./g, "");
47
62
  const urlObj = rr.reqUrlObject;
48
63
  let sw = true;
49
- const regExps = this.resourceRegex.filter((it) => {
64
+ const regExps = this.resources?.filter((it) => {
50
65
  if (it instanceof RegExp) {
51
66
  return it.test(url);
52
67
  }
@@ -62,21 +77,44 @@ class ResourceFilter {
62
77
  }
63
78
  return RegExp(it.request).test(url);
64
79
  }
65
- });
80
+ }) ?? [];
66
81
  for (const it of regExps) {
67
- const resourcePath = import_path.default.join(this.resourceDistPath, typeof it === "object" && "dist" in it ? it.dist : urlObj.pathname);
68
82
  sw = false;
69
- if (import_fs.default.existsSync(resourcePath)) {
70
- rr.resStatusCode(import_HttpStatus.HttpStatus.Ok);
71
- rr.resSetHeader(import_HttpHeaders.HttpHeaders.ContentType, import_mime_types.default.lookup(resourcePath).toString());
72
- await rr.resEnd(import_fs.default.readFileSync(resourcePath));
73
- break;
83
+ if (isDataDist(it)) {
84
+ let distValue = typeof it.response === "function" ? it.response(rr, app) : it.response;
85
+ if (distValue instanceof Promise) {
86
+ const result = await distValue;
87
+ if (result instanceof Response) {
88
+ await rr.resEnd(result);
89
+ break;
90
+ } else if (result instanceof import_node_buffer.Blob) {
91
+ rr.resStatusCode(import_HttpStatus.HttpStatus.Ok);
92
+ await rr.resEnd(result);
93
+ break;
94
+ }
95
+ }
74
96
  } else {
75
- rr.resStatusCode(import_HttpStatus.HttpStatus.NotFound);
76
- await rr.resEnd();
77
- break;
97
+ const dist = typeof it === "object" && "dist" in it ? it.dist : urlObj.pathname;
98
+ let distValue = typeof dist === "function" ? dist(rr, app) : dist;
99
+ if (this.resourceDistPath) {
100
+ const resourcePath = import_node_path.default.join(this.resourceDistPath, distValue);
101
+ if (import_node_fs.default.existsSync(resourcePath)) {
102
+ rr.resStatusCode(import_HttpStatus.HttpStatus.Ok);
103
+ rr.resSetHeader(import_HttpHeaders.HttpHeaders.ContentType, import_mime_types.default.lookup(resourcePath).toString());
104
+ await rr.resEnd(import_node_fs.default.readFileSync(resourcePath));
105
+ break;
106
+ } else {
107
+ rr.resStatusCode(import_HttpStatus.HttpStatus.NotFound);
108
+ await rr.resEnd();
109
+ break;
110
+ }
111
+ } else {
112
+ rr.resStatusCode(import_HttpStatus.HttpStatus.InternalServerError);
113
+ await rr.resEnd();
114
+ break;
115
+ }
78
116
  }
79
- sw = false;
117
+ sw = true;
80
118
  }
81
119
  return sw;
82
120
  }
@@ -86,6 +124,8 @@ class ResourceFilter {
86
124
  }
87
125
  // Annotate the CommonJS export names for ESM import in node:
88
126
  0 && (module.exports = {
89
- ResourceFilter
127
+ ResourceFilter,
128
+ isDataDist,
129
+ isPathDist
90
130
  });
91
131
  //# sourceMappingURL=ResourceFilter.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/filters/ResourceFilter.ts"],
4
- "sourcesContent": ["import { Filter } from '../filters/Filter';\nimport fs from 'fs';\nimport path from 'path';\nimport mime from 'mime-types';\nimport { HttpHeaders } from '../codes/HttpHeaders';\nimport { HttpStatus } from '../codes/HttpStatus';\nimport { SimpleBootHttpServer } from '../SimpleBootHttpServer';\nimport { RequestResponse } from '../models/RequestResponse';\n\nexport type RequestFilterType = string | RegExp | ((rr: RequestResponse, app: SimpleBootHttpServer) => boolean) | ((rr: RequestResponse, app: SimpleBootHttpServer) => Promise<boolean>);\n\nexport class ResourceFilter implements Filter {\n constructor(private resourceDistPath: string, private resourceRegex: (RequestFilterType | { request: RequestFilterType, dist: string })[] = []) {\n }\n\n async onInit(app: SimpleBootHttpServer) {\n }\n\n async proceedBefore({rr, app}: {rr: RequestResponse, app: SimpleBootHttpServer, carrier: Map<string, any>}) {\n const url = (rr.reqUrlPathName ?? '').replace(/\\.\\./g, '');\n const urlObj = rr.reqUrlObject;\n // const requestUrl = parse(rr.reqUrl ?? '', true);\n let sw = true;\n const regExps = this.resourceRegex.filter(it => {\n if (it instanceof RegExp) {\n return it.test(url);\n }\n\n if (typeof it === 'string') {\n return RegExp(it).test(url);\n }\n\n if (typeof it === 'function') {\n return it(rr, app);\n }\n\n if (typeof it === 'object' && 'request' in it) {\n if (typeof it.request === 'function') {\n return it.request(rr, app);\n }\n return RegExp(it.request).test(url);\n }\n })\n // console.log('regExps', regExps, url, this.resourceRegex);\n // eslint-disable-next-line no-unused-vars\n for (const it of regExps) {\n const resourcePath = path.join(this.resourceDistPath, typeof it === 'object' && 'dist' in it ? it.dist : urlObj.pathname);\n // console.log('ResourceFilter', resourcePath, it, urlObj.pathname, url);\n sw = false;\n // console.log('-----', resourcePath);\n if (fs.existsSync(resourcePath)) {\n // const header = {} as any;\n // header[HttpHeaders.ContentType] = mime.lookup(resourcePath);\n // res.writeHead(HttpStatus.Ok, header);\n rr.resStatusCode(HttpStatus.Ok);\n rr.resSetHeader(HttpHeaders.ContentType, mime.lookup(resourcePath).toString());\n await rr.resEnd(fs.readFileSync(resourcePath));\n break;\n } else {\n rr.resStatusCode(HttpStatus.NotFound)\n await rr.resEnd();\n break;\n }\n sw = false;\n }\n return sw;\n }\n\n async proceedAfter({rr, app}: {rr: RequestResponse, app: SimpleBootHttpServer, carrier: Map<string, any>}) {\n return true;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAAe;AACf,kBAAiB;AACjB,wBAAiB;AACjB,yBAA4B;AAC5B,wBAA2B;AAMpB,MAAM,eAAiC;AAAA,EAC1C,YAAoB,kBAAkC,gBAAsF,CAAC,GAAG;AAA5H;AAAkC;AAAA,EACtD;AAAA,EAEA,MAAM,OAAO,KAA2B;AAAA,EACxC;AAAA,EAEA,MAAM,cAAc,EAAC,IAAI,IAAG,GAAgF;AACxG,UAAM,OAAO,GAAG,kBAAkB,IAAI,QAAQ,SAAS,EAAE;AACzD,UAAM,SAAS,GAAG;AAElB,QAAI,KAAK;AACT,UAAM,UAAU,KAAK,cAAc,OAAO,QAAM;AAC5C,UAAI,cAAc,QAAQ;AACtB,eAAO,GAAG,KAAK,GAAG;AAAA,MACtB;AAEA,UAAI,OAAO,OAAO,UAAU;AACxB,eAAO,OAAO,EAAE,EAAE,KAAK,GAAG;AAAA,MAC9B;AAEA,UAAI,OAAO,OAAO,YAAY;AAC1B,eAAO,GAAG,IAAI,GAAG;AAAA,MACrB;AAEA,UAAI,OAAO,OAAO,YAAY,aAAa,IAAI;AAC3C,YAAI,OAAO,GAAG,YAAY,YAAY;AAClC,iBAAO,GAAG,QAAQ,IAAI,GAAG;AAAA,QAC7B;AACA,eAAO,OAAO,GAAG,OAAO,EAAE,KAAK,GAAG;AAAA,MACtC;AAAA,IACJ,CAAC;AAGD,eAAW,MAAM,SAAS;AACtB,YAAM,eAAe,YAAAA,QAAK,KAAK,KAAK,kBAAkB,OAAO,OAAO,YAAY,UAAU,KAAK,GAAG,OAAO,OAAO,QAAQ;AAExH,WAAK;AAEL,UAAI,UAAAC,QAAG,WAAW,YAAY,GAAG;AAI7B,WAAG,cAAc,6BAAW,EAAE;AAC9B,WAAG,aAAa,+BAAY,aAAa,kBAAAC,QAAK,OAAO,YAAY,EAAE,SAAS,CAAC;AAC7E,cAAM,GAAG,OAAO,UAAAD,QAAG,aAAa,YAAY,CAAC;AAC7C;AAAA,MACJ,OAAO;AACH,WAAG,cAAc,6BAAW,QAAQ;AACpC,cAAM,GAAG,OAAO;AAChB;AAAA,MACJ;AACA,WAAK;AAAA,IACT;AACA,WAAO;AAAA,EACX;AAAA,EAEA,MAAM,aAAa,EAAC,IAAI,IAAG,GAAgF;AACvG,WAAO;AAAA,EACX;AACJ;",
4
+ "sourcesContent": ["import { Filter } from '../filters/Filter';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport mime from 'mime-types';\nimport { HttpHeaders } from '../codes/HttpHeaders';\nimport { HttpStatus } from '../codes/HttpStatus';\nimport { SimpleBootHttpServer } from '../SimpleBootHttpServer';\nimport { RequestResponse } from '../models/RequestResponse';\nimport { Blob } from 'node:buffer';\n\nexport type RequestFilterType = string | RegExp | ((rr: RequestResponse, app: SimpleBootHttpServer) => boolean) | ((rr: RequestResponse, app: SimpleBootHttpServer) => Promise<boolean>);\n\ntype PathDist = RequestFilterType|{request: RequestFilterType, dist: string | ((rr: RequestResponse, app: SimpleBootHttpServer) => string)};\n\ntype DataDist = {request: RequestFilterType, response: (rr: RequestResponse, app: SimpleBootHttpServer) => (string | Promise<Blob | ArrayBuffer | Response>)};\nexport const isPathDist = (item: any): item is PathDist => {\n return typeof item === 'object' && ('request' in item) && ('dist' in item);\n};\nexport const isDataDist = (item: any): item is DataDist => {\n return typeof item === 'object' && ('request' in item) && ('response' in item);\n};\nexport class ResourceFilter implements Filter {\n // private requestFilter: RequestFilterType;\n private resourceDistPath?: string;\n private resources?: (DataDist|PathDist)[];\n constructor(resourceDistPath: string, resourceRegex: PathDist[]);\n constructor(resourceRegex: DataDist[]);\n constructor(resourceDistPathOrResourceRegex: string | DataDist[], resourceRegex?: PathDist[]) {\n if (typeof resourceDistPathOrResourceRegex === 'string') {\n this.resourceDistPath = resourceDistPathOrResourceRegex;\n this.resources = resourceRegex;\n } else {\n this.resources = resourceDistPathOrResourceRegex;\n // this.requestFilter = resourceDistPathOrResourceRegex\n }\n }\n // constructor(private resourceDistPath: string, private resourceRegex: (RequestFilterType | { request: RequestFilterType, dist: string | ((rr: RequestResponse, app: SimpleBootHttpServer) => (string|Promise<Blob |ArrayBuffer| Response>)) })[] = []) {\n // }\n\n async onInit(app: SimpleBootHttpServer) {\n }\n\n async proceedBefore({rr, app}: {rr: RequestResponse, app: SimpleBootHttpServer, carrier: Map<string, any>}) {\n const url = (rr.reqUrlPathName ?? '').replace(/\\.\\./g, '');\n const urlObj = rr.reqUrlObject;\n // const requestUrl = parse(rr.reqUrl ?? '', true);\n // console.log('resource filter!!**-------', url);\n let sw = true;\n const regExps = this.resources?.filter(it => {\n if (it instanceof RegExp) {\n return it.test(url);\n }\n\n if (typeof it === 'string') {\n return RegExp(it).test(url);\n }\n\n if (typeof it === 'function') {\n return it(rr, app);\n }\n\n if (typeof it === 'object' && 'request' in it) {\n if (typeof it.request === 'function') {\n return it.request(rr, app);\n }\n return RegExp(it.request).test(url);\n }\n })??[]\n // console.log('regExps', regExps, url);\n // eslint-disable-next-line no-unused-vars\n for (const it of regExps) {\n sw = false;\n //DataDist\n if (isDataDist(it)) {\n let distValue = typeof it.response === 'function' ? it.response(rr,app) : it.response;\n if (distValue instanceof Promise) {\n const result = await distValue;\n if (result instanceof Response) {\n await rr.resEnd(result);\n break;\n } else if (result instanceof Blob) {\n rr.resStatusCode(HttpStatus.Ok);\n await rr.resEnd(result);\n break;\n }\n }\n } else {\n //PathDist or undefined\n const dist = typeof it === 'object' && 'dist' in it ? it.dist : urlObj.pathname;\n let distValue = typeof dist === 'function' ? dist(rr, app) : dist;\n if (this.resourceDistPath) {\n // It's a string path\n const resourcePath = path.join(this.resourceDistPath, distValue);\n // console.log('-----------',this.resourceDistPath, resourcePath);\n if (fs.existsSync(resourcePath)) {\n rr.resStatusCode(HttpStatus.Ok);\n rr.resSetHeader(HttpHeaders.ContentType, mime.lookup(resourcePath).toString());\n await rr.resEnd(fs.readFileSync(resourcePath));\n break;\n } else {\n rr.resStatusCode(HttpStatus.NotFound);\n await rr.resEnd();\n break;\n }\n } else {\n rr.resStatusCode(HttpStatus.InternalServerError);\n await rr.resEnd();\n break;\n }\n }\n sw = true;\n }\n return sw;\n }\n\n async proceedAfter({rr, app}: {rr: RequestResponse, app: SimpleBootHttpServer, carrier: Map<string, any>}) {\n // console.log('resource filter!!end@@**-------');\n return true;\n }\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAe;AACf,uBAAiB;AACjB,wBAAiB;AACjB,yBAA4B;AAC5B,wBAA2B;AAG3B,yBAAqB;AAOd,MAAM,aAAa,CAAC,SAAgC;AACvD,SAAO,OAAO,SAAS,YAAa,aAAa,QAAU,UAAU;AACzE;AACO,MAAM,aAAa,CAAC,SAAgC;AACvD,SAAO,OAAO,SAAS,YAAa,aAAa,QAAU,cAAc;AAC7E;AACO,MAAM,eAAiC;AAAA,EAM5C,YAAY,iCAAuD,eAA4B;AAC7F,QAAI,OAAO,oCAAoC,UAAU;AACvD,WAAK,mBAAmB;AACxB,WAAK,YAAY;AAAA,IACnB,OAAO;AACL,WAAK,YAAY;AAAA,IAEnB;AAAA,EACF;AAAA;AAAA;AAAA,EAIE,MAAM,OAAO,KAA2B;AAAA,EACxC;AAAA,EAEA,MAAM,cAAc,EAAC,IAAI,IAAG,GAAgF;AACxG,UAAM,OAAO,GAAG,kBAAkB,IAAI,QAAQ,SAAS,EAAE;AACzD,UAAM,SAAS,GAAG;AAGlB,QAAI,KAAK;AACT,UAAM,UAAU,KAAK,WAAW,OAAO,QAAM;AACzC,UAAI,cAAc,QAAQ;AACtB,eAAO,GAAG,KAA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C7C;AAAA,UACF,OAAO;AACL,eAAG,cAAc,6BAAW,QAAQ;AACpC,kBAAM,GAAG,OAAO;AAChB;AAAA,UACF;AAAA,QACF,OAAO;AACL,aAAG,cAAc,6BAAW,mBAAmB;AAC/C,gBAAM,GAAG,OAAO;AAChB;AAAA,QACF;AAAA,MACF;AACF,WAAK;AAAA,IACP;AACA,WAAO;AAAA,EACX;AAAA,EAEA,MAAM,aAAa,EAAC,IAAI,IAAG,GAAgF;AAEvG,WAAO;AAAA,EACX;AACJ;",
6
6
  "names": ["path", "fs", "mime"]
7
7
  }
@@ -29,6 +29,7 @@ var import_ReqFormUrlBody = require("./datas/body/ReqFormUrlBody");
29
29
  var import_ReqJsonBody = require("./datas/body/ReqJsonBody");
30
30
  var import_ReqHeader = require("./datas/ReqHeader");
31
31
  var import_node_gzip = require("node-gzip");
32
+ var import_node_buffer = require("node:buffer");
32
33
  var import_FileUtils = require("@dooboostore/core-node/file/FileUtils");
33
34
  var import_ConvertUtils = require("@dooboostore/core/convert/ConvertUtils");
34
35
  var import_ConvertUtils2 = require("@dooboostore/core-node/convert/ConvertUtils");
@@ -149,7 +150,7 @@ class RequestResponse {
149
150
  const formData = {};
150
151
  for (const it of m) {
151
152
  if (it.isFile) {
152
- formData[it.name] = await import_FileUtils.FileUtils.writeFile(it.value, { originalName: it.filename });
153
+ formData[it.name] = await import_FileUtils.FileUtils.writeFile(it.value, { originalName: it.filename, etcData: it });
153
154
  } else {
154
155
  const target = formData[it.name];
155
156
  if (Array.isArray(target)) {
@@ -427,7 +428,28 @@ class RequestResponse {
427
428
  this.res.end(data);
428
429
  }
429
430
  async resEnd(chunk) {
430
- this.resWriteChunk = chunk ?? this.resWriteChunk;
431
+ if (chunk instanceof Response) {
432
+ chunk.headers.forEach((value, key) => {
433
+ this.res.setHeader(`ORIGIN-${key}`, value);
434
+ });
435
+ if (!this.resHeader(import_HttpHeaders.HttpHeaders.ContentType)) {
436
+ const contentType = chunk.headers.get(import_HttpHeaders.HttpHeaders.ContentType);
437
+ if (contentType) {
438
+ this.res.setHeader(import_HttpHeaders.HttpHeaders.ContentType, contentType);
439
+ }
440
+ }
441
+ this.res.statusCode = chunk.status;
442
+ this.resWriteChunk = import_buffer.Buffer.from(await chunk.arrayBuffer());
443
+ } else if (chunk instanceof import_node_buffer.Blob) {
444
+ this.resWriteChunk = import_buffer.Buffer.from(await chunk.arrayBuffer());
445
+ if (!this.resHeader(import_HttpHeaders.HttpHeaders.ContentType)) {
446
+ this.res.setHeader(import_HttpHeaders.HttpHeaders.ContentType, chunk.type);
447
+ }
448
+ } else if (chunk instanceof ArrayBuffer) {
449
+ this.resWriteChunk = import_buffer.Buffer.from(chunk);
450
+ } else {
451
+ this.resWriteChunk = chunk ?? this.resWriteChunk;
452
+ }
431
453
  if (this.req.readable) {
432
454
  await this.reqBodyData();
433
455
  await this.resEndChunk();
@@ -444,6 +466,11 @@ class RequestResponse {
444
466
  // // this.res.write(chunk);
445
467
  // return this.createRequestResponseChain();
446
468
  // }
469
+ resRedirect(statusCode, location) {
470
+ this.res.statusCode = statusCode;
471
+ this.res.setHeader(import_HttpHeaders.HttpHeaders.Location, location);
472
+ this.res.end();
473
+ }
447
474
  resWriteHead(statusCode, headers) {
448
475
  return this.createRequestResponseChain(this.res.writeHead(statusCode, headers));
449
476
  }