@tsed/common 6.97.2 → 7.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/builder/PlatformBuilder.js +1 -5
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.js +3 -0
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/cjs/decorators/index.js +0 -2
- package/lib/cjs/decorators/index.js.map +1 -1
- package/lib/cjs/domain/index.js +0 -1
- package/lib/cjs/domain/index.js.map +1 -1
- package/lib/cjs/index.js +0 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/middlewares/index.js +0 -2
- package/lib/cjs/middlewares/index.js.map +1 -1
- package/lib/cjs/services/PlatformResponse.js.map +1 -1
- package/lib/cjs/utils/index.js +0 -1
- package/lib/cjs/utils/index.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +1 -5
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/config/services/PlatformConfiguration.js +3 -0
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/esm/decorators/index.js +0 -2
- package/lib/esm/decorators/index.js.map +1 -1
- package/lib/esm/domain/index.js +0 -1
- package/lib/esm/domain/index.js.map +1 -1
- package/lib/esm/index.js +0 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/middlewares/index.js +0 -2
- package/lib/esm/middlewares/index.js.map +1 -1
- package/lib/esm/services/PlatformResponse.js.map +1 -1
- package/lib/esm/utils/index.js +0 -1
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/types/config/services/PlatformConfiguration.d.ts +1 -0
- package/lib/types/decorators/index.d.ts +0 -2
- package/lib/types/domain/index.d.ts +0 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/middlewares/index.d.ts +0 -2
- package/lib/types/utils/index.d.ts +0 -1
- package/package.json +16 -16
- package/lib/cjs/PlatformModule.js +0 -11
- package/lib/cjs/PlatformModule.js.map +0 -1
- package/lib/cjs/decorators/params/endpointInfo.js +0 -21
- package/lib/cjs/decorators/params/endpointInfo.js.map +0 -1
- package/lib/cjs/decorators/params/responseData.js +0 -21
- package/lib/cjs/decorators/params/responseData.js.map +0 -1
- package/lib/cjs/domain/PropertyMetadata.js +0 -28
- package/lib/cjs/domain/PropertyMetadata.js.map +0 -1
- package/lib/cjs/middlewares/AcceptMimesMiddleware.js +0 -27
- package/lib/cjs/middlewares/AcceptMimesMiddleware.js.map +0 -1
- package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js +0 -26
- package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js.map +0 -1
- package/lib/cjs/utils/loadInjector.js +0 -14
- package/lib/cjs/utils/loadInjector.js.map +0 -1
- package/lib/esm/PlatformModule.js +0 -7
- package/lib/esm/PlatformModule.js.map +0 -1
- package/lib/esm/decorators/params/endpointInfo.js +0 -17
- package/lib/esm/decorators/params/endpointInfo.js.map +0 -1
- package/lib/esm/decorators/params/responseData.js +0 -17
- package/lib/esm/decorators/params/responseData.js.map +0 -1
- package/lib/esm/domain/PropertyMetadata.js +0 -25
- package/lib/esm/domain/PropertyMetadata.js.map +0 -1
- package/lib/esm/middlewares/AcceptMimesMiddleware.js +0 -24
- package/lib/esm/middlewares/AcceptMimesMiddleware.js.map +0 -1
- package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.js +0 -23
- package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.js.map +0 -1
- package/lib/esm/utils/loadInjector.js +0 -10
- package/lib/esm/utils/loadInjector.js.map +0 -1
- package/lib/types/PlatformModule.d.ts +0 -6
- package/lib/types/decorators/params/endpointInfo.d.ts +0 -13
- package/lib/types/decorators/params/responseData.d.ts +0 -9
- package/lib/types/domain/PropertyMetadata.d.ts +0 -17
- package/lib/types/middlewares/AcceptMimesMiddleware.d.ts +0 -10
- package/lib/types/middlewares/GlobalAcceptMimesMiddleware.d.ts +0 -9
- package/lib/types/utils/loadInjector.d.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"./bindEndpointMiddleware\";\nexport * from \"./PlatformMulterMiddleware\";\nexport * from \"./PlatformAcceptMimesMiddleware\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformResponse.js","sourceRoot":"","sources":["../../../src/services/PlatformResponse.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnE,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;AAM1D,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAa1C;;;GAGG;AAGH,IAAa,gBAAgB,wBAA7B,MAAa,gBAAgB;IAU3B,YAAY,EAAC,QAAQ,EAAgB,EAAY,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;QACpE,IAAI,CAAC,GAAG,GAAG,QAAe,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,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SACb;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,EAAY;QAChB,kBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YACb,OAAO,IAAI,CAAC;SACb;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAE1B,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACpF,CAAC;IAED,OAAO;QACL,aAAa;QACb,OAAO,IAAI,CAAC,GAAG,CAAC;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC;QACjB,aAAa;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;QACpB,aAAa;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC;IACnC,CAAC;CACF,CAAA;AArTY,gBAAgB;IAF5B,UAAU,EAAE;IACZ,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC;;GACjB,gBAAgB,CAqT5B;SArTY,gBAAgB","sourcesContent":["import {isBoolean, isNumber, isStream, isString} from \"@tsed/core\";\nimport {Injectable, ProviderScope, Scope} from \"@tsed/di\";\nimport {ServerResponse} from \"http\";\nimport {IncomingEvent} from \"../interfaces/IncomingEvent\";\nimport type {PlatformRequest} from \"./PlatformRequest\";\nimport type {PlatformContext} from \"../domain/PlatformContext\";\n\nconst onFinished = require(\"on-finished\");\n\ndeclare global {\n namespace TsED {\n // @ts-ignore\n export interface Response {\n // req: any;\n }\n }\n}\n\nexport type HeaderValue = Array<boolean | number | string> | boolean | number | string;\n\n/**\n * Platform Response abstraction layer.\n * @platform\n */\n@Injectable()\n@Scope(ProviderScope.INSTANCE)\nexport class PlatformResponse<T extends Record<string, any> = any> {\n /**\n * The current @@PlatformRequest@@.\n */\n public request: PlatformRequest;\n\n data: any;\n\n raw: T;\n\n constructor({response}: IncomingEvent, protected $ctx: PlatformContext) {\n this.raw = response as any;\n }\n\n /**\n * Get the current statusCode\n */\n get statusCode() {\n return this.raw.statusCode;\n }\n\n /**\n * An object that contains response local variables scoped to the request, and therefore available only to the view(s) rendered during that request / response cycle (if any). Otherwise, this property is identical to app.locals.\n *\n * This property is useful for exposing request-level information such as the request path name, authenticated user, user settings, and so on.\n */\n get locals() {\n return this.raw.locals;\n }\n\n /**\n * Return the original response framework instance\n */\n get response() {\n return this.getResponse();\n }\n\n /**\n * Return the original response node.js instance\n */\n get res() {\n return this.getRes();\n }\n\n static onFinished(res: any, cb: Function) {\n onFinished(res, cb);\n }\n\n /**\n * Returns the HTTP response header specified by field. The match is case-insensitive.\n *\n * ```typescript\n * response.get('Content-Type') // => \"text/plain\"\n * ```\n *\n * @param name\n */\n get(name: string) {\n return this.raw.get(name);\n }\n\n getHeaders(): Record<string, HeaderValue> {\n return this.raw.getHeaders();\n }\n\n /**\n * Return the Framework response object (express, koa, etc...)\n */\n getResponse<Res = T>(): Res {\n return this.raw as any;\n }\n\n /**\n * Return the Node.js response object\n */\n getRes(): ServerResponse {\n return this.raw as any;\n }\n\n hasStatus() {\n return this.statusCode !== 200;\n }\n\n /**\n * Sets the HTTP status for the response.\n *\n * @param status\n */\n status(status: number) {\n this.raw.status(status);\n\n return this;\n }\n\n /**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n * ```typescript\n * response.setHeaders({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n * ```\n *\n * Aliased as `res.header()`.\n */\n setHeaders(headers: Record<string, HeaderValue>) {\n // apply headers\n Object.entries(headers).forEach(([key, item]) => {\n this.setHeader(key, item);\n });\n\n return this;\n }\n\n setHeader(key: string, item: any) {\n if (key.toLowerCase() === \"location\") {\n return this.location(String(item));\n }\n\n this.raw.set(key, item);\n\n return this;\n }\n\n /**\n * Set `Content-Type` response header with `type` through `mime.lookup()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n */\n contentType(contentType: string) {\n this.raw.contentType(contentType);\n\n return this;\n }\n\n contentLength(length: number) {\n this.setHeader(\"Content-Length\", length);\n return this;\n }\n\n getContentLength() {\n if (this.get(\"Content-Length\")) {\n return parseInt(this.get(\"Content-Length\"), 10) || 0;\n }\n }\n\n getContentType() {\n return (this.get(\"Content-Type\") || \"\").split(\";\")[0];\n }\n\n /**\n * Sets the HTTP response Content-Disposition header field to “attachment”.\n * If a filename is given, then it sets the Content-Type based on the extension name via res.type(), and sets the Content-Disposition “filename=” parameter.\n *\n * ```typescript\n * res.attachment()\n * // Content-Disposition: attachment\n *\n * res.attachment('path/to/logo.png')\n * // Content-Disposition: attachment; filename=\"logo.png\"\n * // Content-Type: image/png\n * ```\n *\n * @param filename\n */\n attachment(filename: string) {\n this.raw.attachment(filename);\n return this;\n }\n\n /**\n * Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an [HTTP status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).\n * If not specified, status defaults to `302 Found`.\n *\n * @param status\n * @param url\n */\n redirect(status: number, url: string) {\n this.raw.redirect(status, url);\n\n return this;\n }\n\n /**\n * Sets the response Location HTTP header to the specified path parameter.\n *\n * @param location\n */\n location(location: string) {\n this.raw.location(location);\n\n return this;\n }\n\n /**\n * Stream the given data.\n *\n * @param data\n */\n stream(data: ReadableStream | any) {\n data.pipe(this.raw);\n\n return this;\n }\n\n /**\n * Renders a view and sends the rendered HTML string to the client.\n *\n * @param path\n * @param options\n */\n async render(path: string, options: any = {}) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = await this.$ctx.injector.lazyInvoke(PlatformViews);\n\n return platformViews.render(path, {\n ...this.locals,\n ...options\n });\n }\n\n /**\n * Send any data to your consumer.\n *\n * This method accept a ReadableStream, a plain object, boolean, string, number, null and undefined data.\n * It choose the better way to send the data.\n *\n * @param data\n */\n body(data: any) {\n this.data = data;\n if (data === undefined) {\n this.raw.send();\n\n return this;\n }\n\n if (isStream(data)) {\n this.stream(data);\n\n return this;\n }\n\n if (Buffer.isBuffer(data)) {\n if (!this.getContentType()) {\n this.contentType(\"application/octet-stream\");\n }\n\n this.contentLength(data.length);\n this.raw.send(data);\n\n return this;\n }\n\n if (isBoolean(data) || isNumber(data) || isString(data) || data === null) {\n this.raw.send(data);\n\n return this;\n }\n\n this.raw.json(data);\n\n return this;\n }\n\n getBody() {\n return this.data;\n }\n\n /**\n * Add a listener to handler the end of the request/response.\n * @param cb\n */\n onEnd(cb: Function): this {\n PlatformResponse.onFinished(this.getRes(), cb);\n\n return this;\n }\n\n isDone(): boolean {\n if (!this.raw) {\n return true;\n }\n\n const res = this.getRes();\n\n return Boolean(this.isHeadersSent() || res.writableEnded || res.writableFinished);\n }\n\n destroy() {\n // @ts-ignore\n delete this.raw;\n delete this.data;\n // @ts-ignore\n delete this.request;\n // @ts-ignore\n delete this.$ctx;\n }\n\n isHeadersSent() {\n return this.getRes().headersSent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlatformResponse.js","sourceRoot":"","sources":["../../../src/services/PlatformResponse.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnE,OAAO,EAAC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;AAM1D,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,C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Aa;QACX,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC;IACnC,CAAC;CACF,CAAA;AAtTY,gBAAgB;IAF5B,UAAU,EAAE;IACZ,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC;;GACjB,gBAAgB,CAsT5B;SAtTY,gBAAgB","sourcesContent":["import {isBoolean, isNumber, isStream, isString} from \"@tsed/core\";\nimport {Injectable, ProviderScope, Scope} from \"@tsed/di\";\nimport {ServerResponse} from \"http\";\nimport {IncomingEvent} from \"../interfaces/IncomingEvent\";\nimport type {PlatformRequest} from \"./PlatformRequest\";\nimport type {PlatformContext} from \"../domain/PlatformContext\";\n\nconst onFinished = require(\"on-finished\");\n\ndeclare global {\n namespace TsED {\n // @ts-ignore\n export interface Response {\n // req: any;\n }\n }\n}\n\nexport type HeaderValue = Array<boolean | number | string> | boolean | number | string;\n\n/**\n * Platform Response abstraction layer.\n * @platform\n */\n@Injectable()\n@Scope(ProviderScope.INSTANCE)\nexport class PlatformResponse<T extends Record<string, any> = any> {\n /**\n * The current @@PlatformRequest@@.\n */\n public request: PlatformRequest;\n\n data: any;\n\n raw: T;\n\n constructor({response}: IncomingEvent, protected $ctx: PlatformContext) {\n this.raw = response as any;\n }\n\n /**\n * Get the current statusCode\n */\n get statusCode() {\n return this.raw.statusCode;\n }\n\n /**\n * An object that contains response local variables scoped to the request, and therefore available only to the view(s) rendered during that request / response cycle (if any). Otherwise, this property is identical to app.locals.\n *\n * This property is useful for exposing request-level information such as the request path name, authenticated user, user settings, and so on.\n */\n get locals() {\n return this.raw.locals;\n }\n\n /**\n * Return the original response framework instance\n */\n get response() {\n return this.getResponse();\n }\n\n /**\n * Return the original response node.js instance\n */\n get res() {\n return this.getRes();\n }\n\n static onFinished(res: any, cb: Function) {\n onFinished(res, cb);\n }\n\n /**\n * Returns the HTTP response header specified by field. The match is case-insensitive.\n *\n * ```typescript\n * response.get('Content-Type') // => \"text/plain\"\n * ```\n *\n * @param name\n */\n get(name: string) {\n return this.raw.get(name);\n }\n\n getHeaders(): Record<string, HeaderValue> {\n return this.raw.getHeaders();\n }\n\n /**\n * Return the Framework response object (express, koa, etc...)\n */\n getResponse<Res = T>(): Res {\n return this.raw as any;\n }\n\n /**\n * Return the Node.js response object\n */\n getRes(): ServerResponse {\n return this.raw as any;\n }\n\n hasStatus() {\n return this.statusCode !== 200;\n }\n\n /**\n * Sets the HTTP status for the response.\n *\n * @param status\n */\n status(status: number) {\n this.raw.status(status);\n\n return this;\n }\n\n /**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n * ```typescript\n * response.setHeaders({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n * ```\n *\n * Aliased as `res.header()`.\n */\n setHeaders(headers: Record<string, HeaderValue>) {\n // apply headers\n Object.entries(headers).forEach(([key, item]) => {\n this.setHeader(key, item);\n });\n\n return this;\n }\n\n setHeader(key: string, item: any) {\n if (key.toLowerCase() === \"location\") {\n return this.location(String(item));\n }\n\n this.raw.set(key, item);\n\n return this;\n }\n\n /**\n * Set `Content-Type` response header with `type` through `mime.lookup()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n */\n contentType(contentType: string) {\n this.raw.contentType(contentType);\n\n return this;\n }\n\n contentLength(length: number) {\n this.setHeader(\"Content-Length\", length);\n return this;\n }\n\n getContentLength() {\n if (this.get(\"Content-Length\")) {\n return parseInt(this.get(\"Content-Length\"), 10) || 0;\n }\n }\n\n getContentType() {\n return (this.get(\"Content-Type\") || \"\").split(\";\")[0];\n }\n\n /**\n * Sets the HTTP response Content-Disposition header field to “attachment”.\n * If a filename is given, then it sets the Content-Type based on the extension name via res.type(), and sets the Content-Disposition “filename=” parameter.\n *\n * ```typescript\n * res.attachment()\n * // Content-Disposition: attachment\n *\n * res.attachment('path/to/logo.png')\n * // Content-Disposition: attachment; filename=\"logo.png\"\n * // Content-Type: image/png\n * ```\n *\n * @param filename\n */\n attachment(filename: string) {\n this.raw.attachment(filename);\n return this;\n }\n\n /**\n * Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an [HTTP status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).\n * If not specified, status defaults to `302 Found`.\n *\n * @param status\n * @param url\n */\n redirect(status: number, url: string) {\n this.raw.redirect(status, url);\n\n return this;\n }\n\n /**\n * Sets the response Location HTTP header to the specified path parameter.\n *\n * @param location\n */\n location(location: string) {\n this.raw.location(location);\n\n return this;\n }\n\n /**\n * Stream the given data.\n *\n * @param data\n */\n stream(data: ReadableStream | any) {\n data.pipe(this.raw);\n\n return this;\n }\n\n /**\n * Renders a view and sends the rendered HTML string to the client.\n *\n * @param path\n * @param options\n */\n async render(path: string, options: any = {}) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = await this.$ctx.injector.lazyInvoke(PlatformViews);\n\n return platformViews.render(path, {\n ...this.locals,\n ...options\n });\n }\n\n /**\n * Send any data to your consumer.\n *\n * This method accept a ReadableStream, a plain object, boolean, string, number, null and undefined data.\n * It choose the better way to send the data.\n *\n * @param data\n */\n body(data: any) {\n this.data = data;\n\n if (data === undefined) {\n this.raw.send();\n\n return this;\n }\n\n if (isStream(data)) {\n this.stream(data);\n\n return this;\n }\n\n if (Buffer.isBuffer(data)) {\n if (!this.getContentType()) {\n this.contentType(\"application/octet-stream\");\n }\n\n this.contentLength(data.length);\n this.raw.send(data);\n\n return this;\n }\n\n if (isBoolean(data) || isNumber(data) || isString(data) || data === null) {\n this.raw.send(data);\n\n return this;\n }\n\n this.raw.json(data);\n\n return this;\n }\n\n getBody() {\n return this.data;\n }\n\n /**\n * Add a listener to handler the end of the request/response.\n * @param cb\n */\n onEnd(cb: Function): this {\n PlatformResponse.onFinished(this.getRes(), cb);\n\n return this;\n }\n\n isDone(): boolean {\n if (!this.raw) {\n return true;\n }\n\n const res = this.getRes();\n\n return Boolean(this.isHeadersSent() || res.writableEnded || res.writableFinished);\n }\n\n destroy() {\n // @ts-ignore\n delete this.raw;\n delete this.data;\n // @ts-ignore\n delete this.request;\n // @ts-ignore\n delete this.$ctx;\n }\n\n isHeadersSent() {\n return this.getRes().headersSent;\n }\n}\n"]}
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./createInjector\";\nexport * from \"./createHttpServer\";\nexport * from \"./createHttpsServer\";\nexport * from \"./printRoutes\";\nexport * from \"./listenServer\";\nexport * from \"./createContext\";\nexport * from \"./useCtxHandler\";\n"]}
|
|
@@ -39,6 +39,7 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
39
39
|
set logger(value: Partial<PlatformLoggerSettings>);
|
|
40
40
|
get exclude(): string[];
|
|
41
41
|
set exclude(exclude: string[]);
|
|
42
|
+
get additionalProperties(): boolean;
|
|
42
43
|
/**
|
|
43
44
|
*
|
|
44
45
|
* @returns {string|number}
|
|
@@ -7,10 +7,8 @@ export * from "./method/location";
|
|
|
7
7
|
export * from "./method/redirect";
|
|
8
8
|
export * from "./method/endpointFn";
|
|
9
9
|
export * from "./method/view";
|
|
10
|
-
export * from "./params/responseData";
|
|
11
10
|
export * from "./params/response";
|
|
12
11
|
export * from "./params/request";
|
|
13
12
|
export * from "./params/next";
|
|
14
13
|
export * from "./params/error";
|
|
15
|
-
export * from "./params/endpointInfo";
|
|
16
14
|
export * from "../utils/mapReturnedResponse";
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "@tsed/logger";
|
|
2
|
-
import "@tsed/logger-file";
|
|
3
2
|
export * from "@tsed/di";
|
|
4
3
|
export * from "@tsed/platform-params";
|
|
5
4
|
export * from "@tsed/platform-exceptions";
|
|
@@ -19,4 +18,3 @@ export * from "./middlewares";
|
|
|
19
18
|
export * from "./domain";
|
|
20
19
|
export * from "./services";
|
|
21
20
|
export * from "./utils";
|
|
22
|
-
export * from "./PlatformModule";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.2",
|
|
4
4
|
"description": "A TypeScript Framework on top of Express",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"bugs": {
|
|
47
47
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
48
48
|
},
|
|
49
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
49
|
+
"homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/platform/common",
|
|
50
50
|
"repository": "https://github.com/tsedio/tsed",
|
|
51
51
|
"funding": [
|
|
52
52
|
{
|
|
@@ -59,22 +59,22 @@
|
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@tsed/components-scan": "
|
|
63
|
-
"@tsed/core": "
|
|
64
|
-
"@tsed/di": "
|
|
65
|
-
"@tsed/exceptions": "
|
|
66
|
-
"@tsed/json-mapper": "
|
|
62
|
+
"@tsed/components-scan": "7.0.0-beta.2",
|
|
63
|
+
"@tsed/core": "7.0.0-beta.2",
|
|
64
|
+
"@tsed/di": "7.0.0-beta.2",
|
|
65
|
+
"@tsed/exceptions": "7.0.0-beta.2",
|
|
66
|
+
"@tsed/json-mapper": "7.0.0-beta.2",
|
|
67
67
|
"@tsed/logger": "^6.0.0",
|
|
68
68
|
"@tsed/logger-file": "^6.0.0",
|
|
69
|
-
"@tsed/perf": "
|
|
70
|
-
"@tsed/platform-cache": "
|
|
71
|
-
"@tsed/platform-exceptions": "
|
|
72
|
-
"@tsed/platform-log-middleware": "
|
|
73
|
-
"@tsed/platform-middlewares": "
|
|
74
|
-
"@tsed/platform-params": "
|
|
75
|
-
"@tsed/platform-response-filter": "
|
|
76
|
-
"@tsed/platform-views": "
|
|
77
|
-
"@tsed/schema": "
|
|
69
|
+
"@tsed/perf": "7.0.0-beta.2",
|
|
70
|
+
"@tsed/platform-cache": "7.0.0-beta.2",
|
|
71
|
+
"@tsed/platform-exceptions": "7.0.0-beta.2",
|
|
72
|
+
"@tsed/platform-log-middleware": "7.0.0-beta.2",
|
|
73
|
+
"@tsed/platform-middlewares": "7.0.0-beta.2",
|
|
74
|
+
"@tsed/platform-params": "7.0.0-beta.2",
|
|
75
|
+
"@tsed/platform-response-filter": "7.0.0-beta.2",
|
|
76
|
+
"@tsed/platform-views": "7.0.0-beta.2",
|
|
77
|
+
"@tsed/schema": "7.0.0-beta.2",
|
|
78
78
|
"@types/json-schema": "7.0.7",
|
|
79
79
|
"on-finished": "2.3.0",
|
|
80
80
|
"tslib": "2.2.0",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformModule = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
* @deprecated Will be removed in v7
|
|
7
|
-
*/
|
|
8
|
-
class PlatformModule {
|
|
9
|
-
}
|
|
10
|
-
exports.PlatformModule = PlatformModule;
|
|
11
|
-
//# sourceMappingURL=PlatformModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformModule.js","sourceRoot":"","sources":["../../src/PlatformModule.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,cAAc;CAAG;AAA9B,wCAA8B","sourcesContent":["/**\n * @ignore\n * @deprecated Will be removed in v7\n */\nexport class PlatformModule {}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EndpointInfo = void 0;
|
|
4
|
-
const platform_params_1 = require("@tsed/platform-params");
|
|
5
|
-
/**
|
|
6
|
-
* Get the current endpoint metadata.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @operation
|
|
9
|
-
* @input
|
|
10
|
-
* @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
|
|
11
|
-
*/
|
|
12
|
-
function EndpointInfo() {
|
|
13
|
-
return (0, platform_params_1.UseParam)({
|
|
14
|
-
paramType: platform_params_1.ParamTypes.$CTX,
|
|
15
|
-
dataPath: "$ctx.endpoint",
|
|
16
|
-
useConverter: false,
|
|
17
|
-
useValidation: false
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.EndpointInfo = EndpointInfo;
|
|
21
|
-
//# sourceMappingURL=endpointInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpointInfo.js","sourceRoot":"","sources":["../../../../src/decorators/params/endpointInfo.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAG3D;;;;;;GAMG;AACH,SAAgB,YAAY;IAC1B,OAAO,IAAA,0BAAQ,EAAC;QACd,SAAS,EAAE,4BAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,eAAe;QACzB,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAPD,oCAOC","sourcesContent":["import {ParamTypes, UseParam} from \"@tsed/platform-params\";\nimport {EndpointMetadata} from \"../../domain/EndpointMetadata\";\n\n/**\n * Get the current endpoint metadata.\n * @decorator\n * @operation\n * @input\n * @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.\n */\nexport function EndpointInfo(): Function {\n return UseParam({\n paramType: ParamTypes.$CTX,\n dataPath: \"$ctx.endpoint\",\n useConverter: false,\n useValidation: false\n });\n}\n/**\n * @deprecated\n */\nexport type EndpointInfo = EndpointMetadata;\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResponseData = void 0;
|
|
4
|
-
const platform_params_1 = require("@tsed/platform-params");
|
|
5
|
-
const platform_params_2 = require("@tsed/platform-params");
|
|
6
|
-
/**
|
|
7
|
-
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
8
|
-
*
|
|
9
|
-
* @decorator
|
|
10
|
-
* @operation
|
|
11
|
-
* @input
|
|
12
|
-
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
13
|
-
*/
|
|
14
|
-
function ResponseData() {
|
|
15
|
-
return (0, platform_params_2.UseParam)({
|
|
16
|
-
paramType: platform_params_1.ParamTypes.$CTX,
|
|
17
|
-
dataPath: "$ctx.data"
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.ResponseData = ResponseData;
|
|
21
|
-
//# sourceMappingURL=responseData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseData.js","sourceRoot":"","sources":["../../../../src/decorators/params/responseData.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AACjD,2DAA+C;AAE/C;;;;;;;GAOG;AACH,SAAgB,YAAY;IAC1B,OAAO,IAAA,0BAAQ,EAAC;QACd,SAAS,EAAE,4BAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,WAAW;KACtB,CAAC,CAAC;AACL,CAAC;AALD,oCAKC","sourcesContent":["import {ParamTypes} from \"@tsed/platform-params\";\nimport {UseParam} from \"@tsed/platform-params\";\n\n/**\n * Return the current response data. Prefer the @@Context@@ decorator to get or set data.\n *\n * @decorator\n * @operation\n * @input\n * @deprecated Use `@Context() $ctx: Context` then $ctx.data.\n */\nexport function ResponseData(): ParameterDecorator {\n return UseParam({\n paramType: ParamTypes.$CTX,\n dataPath: \"$ctx.data\"\n });\n}\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PropertyMetadata = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const schema_1 = require("@tsed/schema");
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
9
|
-
*/
|
|
10
|
-
let PropertyMetadata = class PropertyMetadata extends schema_1.JsonPropertyStore {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
13
|
-
*/
|
|
14
|
-
static get(target, propertyKey) {
|
|
15
|
-
return schema_1.JsonEntityStore.from((0, core_1.prototypeOf)(target), propertyKey);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
19
|
-
*/
|
|
20
|
-
static getProperties(target, options = {}) {
|
|
21
|
-
return (0, schema_1.getProperties)(target, options);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
PropertyMetadata = (0, tslib_1.__decorate)([
|
|
25
|
-
(0, schema_1.JsonEntityComponent)(core_1.DecoratorTypes.PROP)
|
|
26
|
-
], PropertyMetadata);
|
|
27
|
-
exports.PropertyMetadata = PropertyMetadata;
|
|
28
|
-
//# sourceMappingURL=PropertyMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMetadata.js","sourceRoot":"","sources":["../../../src/domain/PropertyMetadata.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,yCAAoG;AAEpG;;GAEG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,0BAAiB;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB,EAAE,WAA4B;QACxD,OAAO,wBAAe,CAAC,IAAI,CAAmB,IAAA,kBAAW,EAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAiB,EAAE,UAAgD,EAAE;QACxF,OAAO,IAAA,sBAAa,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAdY,gBAAgB;IAD5B,IAAA,4BAAmB,EAAC,qBAAc,CAAC,IAAI,CAAC;GAC5B,gBAAgB,CAc5B;AAdY,4CAAgB","sourcesContent":["import {DecoratorTypes, prototypeOf, Type} from \"@tsed/core\";\nimport {getProperties, JsonEntityComponent, JsonEntityStore, JsonPropertyStore} from \"@tsed/schema\";\n\n/**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n@JsonEntityComponent(DecoratorTypes.PROP)\nexport class PropertyMetadata extends JsonPropertyStore {\n /**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n static get(target: Type<any>, propertyKey: string | symbol) {\n return JsonEntityStore.from<PropertyMetadata>(prototypeOf(target), propertyKey);\n }\n\n /**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n static getProperties(target: Type<any>, options: Partial<{withIgnoredProps: boolean}> = {}) {\n return getProperties(target, options);\n }\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AcceptMimesMiddleware = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const platform_params_1 = require("@tsed/platform-params");
|
|
6
|
-
const platform_middlewares_1 = require("@tsed/platform-middlewares");
|
|
7
|
-
/**
|
|
8
|
-
* @middleware
|
|
9
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
10
|
-
* @ignore
|
|
11
|
-
*/
|
|
12
|
-
let AcceptMimesMiddleware = class AcceptMimesMiddleware {
|
|
13
|
-
use(ctx) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
(0, tslib_1.__decorate)([
|
|
18
|
-
(0, tslib_1.__param)(0, (0, platform_params_1.Context)()),
|
|
19
|
-
(0, tslib_1.__metadata)("design:type", Function),
|
|
20
|
-
(0, tslib_1.__metadata)("design:paramtypes", [Object]),
|
|
21
|
-
(0, tslib_1.__metadata)("design:returntype", void 0)
|
|
22
|
-
], AcceptMimesMiddleware.prototype, "use", null);
|
|
23
|
-
AcceptMimesMiddleware = (0, tslib_1.__decorate)([
|
|
24
|
-
(0, platform_middlewares_1.Middleware)()
|
|
25
|
-
], AcceptMimesMiddleware);
|
|
26
|
-
exports.AcceptMimesMiddleware = AcceptMimesMiddleware;
|
|
27
|
-
//# sourceMappingURL=AcceptMimesMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/AcceptMimesMiddleware.ts"],"names":[],"mappings":";;;;AAAA,2DAA8C;AAC9C,qEAAyE;AAEzE;;;;GAIG;AAEH,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IACzB,GAAG,CAAY,GAAY;QAChC,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAY,wBAAA,IAAA,yBAAO,GAAE,CAAA;;;;gDAEpB;AAHU,qBAAqB;IADjC,IAAA,iCAAU,GAAE;GACA,qBAAqB,CAIjC;AAJY,sDAAqB","sourcesContent":["import {Context} from \"@tsed/platform-params\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\n\n/**\n * @middleware\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class AcceptMimesMiddleware implements MiddlewareMethods {\n public use(@Context() ctx: Context): void {\n return;\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalAcceptMimesMiddleware = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const platform_middlewares_1 = require("@tsed/platform-middlewares");
|
|
6
|
-
const platform_params_1 = require("@tsed/platform-params");
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
9
|
-
* @ignore
|
|
10
|
-
*/
|
|
11
|
-
let GlobalAcceptMimesMiddleware = class GlobalAcceptMimesMiddleware {
|
|
12
|
-
use(ctx) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
(0, tslib_1.__decorate)([
|
|
17
|
-
(0, tslib_1.__param)(0, (0, platform_params_1.Context)()),
|
|
18
|
-
(0, tslib_1.__metadata)("design:type", Function),
|
|
19
|
-
(0, tslib_1.__metadata)("design:paramtypes", [Object]),
|
|
20
|
-
(0, tslib_1.__metadata)("design:returntype", void 0)
|
|
21
|
-
], GlobalAcceptMimesMiddleware.prototype, "use", null);
|
|
22
|
-
GlobalAcceptMimesMiddleware = (0, tslib_1.__decorate)([
|
|
23
|
-
(0, platform_middlewares_1.Middleware)()
|
|
24
|
-
], GlobalAcceptMimesMiddleware);
|
|
25
|
-
exports.GlobalAcceptMimesMiddleware = GlobalAcceptMimesMiddleware;
|
|
26
|
-
//# sourceMappingURL=GlobalAcceptMimesMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/GlobalAcceptMimesMiddleware.ts"],"names":[],"mappings":";;;;AAAA,qEAAyE;AACzE,2DAA8C;AAE9C;;;GAGG;AAEH,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IACtC,GAAG,CAAY,GAAY;QACzB,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAK,wBAAA,IAAA,yBAAO,GAAE,CAAA;;;;sDAEb;AAHU,2BAA2B;IADvC,IAAA,iCAAU,GAAE;GACA,2BAA2B,CAIvC;AAJY,kEAA2B","sourcesContent":["import {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\n\n/**\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class GlobalAcceptMimesMiddleware implements MiddlewareMethods {\n use(@Context() ctx: Context) {\n return;\n }\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadInjector = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
/**
|
|
6
|
-
* @ignore
|
|
7
|
-
* @deprecated User injector.load(container, module) instead
|
|
8
|
-
*/
|
|
9
|
-
async function loadInjector(injector, container = (0, di_1.createContainer)()) {
|
|
10
|
-
injector.bootstrap(container);
|
|
11
|
-
return injector.load(container);
|
|
12
|
-
}
|
|
13
|
-
exports.loadInjector = loadInjector;
|
|
14
|
-
//# sourceMappingURL=loadInjector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadInjector.js","sourceRoot":"","sources":["../../../src/utils/loadInjector.ts"],"names":[],"mappings":";;;AAAA,iCAAsF;AAEtF;;;GAGG;AACI,KAAK,UAAU,YAAY,CAAC,QAAyB,EAAE,YAAuB,IAAA,oBAAe,GAAE;IACpG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAHD,oCAGC","sourcesContent":["import {Container, createContainer, InjectorService, LocalsContainer} from \"@tsed/di\";\n\n/**\n * @ignore\n * @deprecated User injector.load(container, module) instead\n */\nexport async function loadInjector(injector: InjectorService, container: Container = createContainer()): Promise<LocalsContainer<any>> {\n injector.bootstrap(container);\n return injector.load(container);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformModule.js","sourceRoot":"","sources":["../../src/PlatformModule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,cAAc;CAAG","sourcesContent":["/**\n * @ignore\n * @deprecated Will be removed in v7\n */\nexport class PlatformModule {}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ParamTypes, UseParam } from "@tsed/platform-params";
|
|
2
|
-
/**
|
|
3
|
-
* Get the current endpoint metadata.
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
|
|
8
|
-
*/
|
|
9
|
-
export function EndpointInfo() {
|
|
10
|
-
return UseParam({
|
|
11
|
-
paramType: ParamTypes.$CTX,
|
|
12
|
-
dataPath: "$ctx.endpoint",
|
|
13
|
-
useConverter: false,
|
|
14
|
-
useValidation: false
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=endpointInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpointInfo.js","sourceRoot":"","sources":["../../../../src/decorators/params/endpointInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAG3D;;;;;;GAMG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,eAAe;QACzB,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamTypes, UseParam} from \"@tsed/platform-params\";\nimport {EndpointMetadata} from \"../../domain/EndpointMetadata\";\n\n/**\n * Get the current endpoint metadata.\n * @decorator\n * @operation\n * @input\n * @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.\n */\nexport function EndpointInfo(): Function {\n return UseParam({\n paramType: ParamTypes.$CTX,\n dataPath: \"$ctx.endpoint\",\n useConverter: false,\n useValidation: false\n });\n}\n/**\n * @deprecated\n */\nexport type EndpointInfo = EndpointMetadata;\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ParamTypes } from "@tsed/platform-params";
|
|
2
|
-
import { UseParam } from "@tsed/platform-params";
|
|
3
|
-
/**
|
|
4
|
-
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
5
|
-
*
|
|
6
|
-
* @decorator
|
|
7
|
-
* @operation
|
|
8
|
-
* @input
|
|
9
|
-
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
10
|
-
*/
|
|
11
|
-
export function ResponseData() {
|
|
12
|
-
return UseParam({
|
|
13
|
-
paramType: ParamTypes.$CTX,
|
|
14
|
-
dataPath: "$ctx.data"
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=responseData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseData.js","sourceRoot":"","sources":["../../../../src/decorators/params/responseData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,WAAW;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamTypes} from \"@tsed/platform-params\";\nimport {UseParam} from \"@tsed/platform-params\";\n\n/**\n * Return the current response data. Prefer the @@Context@@ decorator to get or set data.\n *\n * @decorator\n * @operation\n * @input\n * @deprecated Use `@Context() $ctx: Context` then $ctx.data.\n */\nexport function ResponseData(): ParameterDecorator {\n return UseParam({\n paramType: ParamTypes.$CTX,\n dataPath: \"$ctx.data\"\n });\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { DecoratorTypes, prototypeOf } from "@tsed/core";
|
|
3
|
-
import { getProperties, JsonEntityComponent, JsonEntityStore, JsonPropertyStore } from "@tsed/schema";
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
6
|
-
*/
|
|
7
|
-
let PropertyMetadata = class PropertyMetadata extends JsonPropertyStore {
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
10
|
-
*/
|
|
11
|
-
static get(target, propertyKey) {
|
|
12
|
-
return JsonEntityStore.from(prototypeOf(target), propertyKey);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
16
|
-
*/
|
|
17
|
-
static getProperties(target, options = {}) {
|
|
18
|
-
return getProperties(target, options);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
PropertyMetadata = __decorate([
|
|
22
|
-
JsonEntityComponent(DecoratorTypes.PROP)
|
|
23
|
-
], PropertyMetadata);
|
|
24
|
-
export { PropertyMetadata };
|
|
25
|
-
//# sourceMappingURL=PropertyMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMetadata.js","sourceRoot":"","sources":["../../../src/domain/PropertyMetadata.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAE,WAAW,EAAO,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpG;;GAEG;AAEH,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,iBAAiB;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB,EAAE,WAA4B;QACxD,OAAO,eAAe,CAAC,IAAI,CAAmB,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,MAAiB,EAAE,UAAgD,EAAE;QACxF,OAAO,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAdY,gBAAgB;IAD5B,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC;GAC5B,gBAAgB,CAc5B;SAdY,gBAAgB","sourcesContent":["import {DecoratorTypes, prototypeOf, Type} from \"@tsed/core\";\nimport {getProperties, JsonEntityComponent, JsonEntityStore, JsonPropertyStore} from \"@tsed/schema\";\n\n/**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n@JsonEntityComponent(DecoratorTypes.PROP)\nexport class PropertyMetadata extends JsonPropertyStore {\n /**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n static get(target: Type<any>, propertyKey: string | symbol) {\n return JsonEntityStore.from<PropertyMetadata>(prototypeOf(target), propertyKey);\n }\n\n /**\n * @deprecated Since 2020-11-11. Use getProperties from @tsed/schema\n */\n static getProperties(target: Type<any>, options: Partial<{withIgnoredProps: boolean}> = {}) {\n return getProperties(target, options);\n }\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { Context } from "@tsed/platform-params";
|
|
3
|
-
import { Middleware } from "@tsed/platform-middlewares";
|
|
4
|
-
/**
|
|
5
|
-
* @middleware
|
|
6
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
let AcceptMimesMiddleware = class AcceptMimesMiddleware {
|
|
10
|
-
use(ctx) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
__decorate([
|
|
15
|
-
__param(0, Context()),
|
|
16
|
-
__metadata("design:type", Function),
|
|
17
|
-
__metadata("design:paramtypes", [Object]),
|
|
18
|
-
__metadata("design:returntype", void 0)
|
|
19
|
-
], AcceptMimesMiddleware.prototype, "use", null);
|
|
20
|
-
AcceptMimesMiddleware = __decorate([
|
|
21
|
-
Middleware()
|
|
22
|
-
], AcceptMimesMiddleware);
|
|
23
|
-
export { AcceptMimesMiddleware };
|
|
24
|
-
//# sourceMappingURL=AcceptMimesMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/AcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AAEzE;;;;GAIG;AAEH,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IACzB,GAAG,CAAY,GAAY;QAChC,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAY,WAAA,OAAO,EAAE,CAAA;;;;gDAEpB;AAHU,qBAAqB;IADjC,UAAU,EAAE;GACA,qBAAqB,CAIjC;SAJY,qBAAqB","sourcesContent":["import {Context} from \"@tsed/platform-params\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\n\n/**\n * @middleware\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class AcceptMimesMiddleware implements MiddlewareMethods {\n public use(@Context() ctx: Context): void {\n return;\n }\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { Middleware } from "@tsed/platform-middlewares";
|
|
3
|
-
import { Context } from "@tsed/platform-params";
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
let GlobalAcceptMimesMiddleware = class GlobalAcceptMimesMiddleware {
|
|
9
|
-
use(ctx) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
__decorate([
|
|
14
|
-
__param(0, Context()),
|
|
15
|
-
__metadata("design:type", Function),
|
|
16
|
-
__metadata("design:paramtypes", [Object]),
|
|
17
|
-
__metadata("design:returntype", void 0)
|
|
18
|
-
], GlobalAcceptMimesMiddleware.prototype, "use", null);
|
|
19
|
-
GlobalAcceptMimesMiddleware = __decorate([
|
|
20
|
-
Middleware()
|
|
21
|
-
], GlobalAcceptMimesMiddleware);
|
|
22
|
-
export { GlobalAcceptMimesMiddleware };
|
|
23
|
-
//# sourceMappingURL=GlobalAcceptMimesMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/GlobalAcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C;;;GAGG;AAEH,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IACtC,GAAG,CAAY,GAAY;QACzB,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAK,WAAA,OAAO,EAAE,CAAA;;;;sDAEb;AAHU,2BAA2B;IADvC,UAAU,EAAE;GACA,2BAA2B,CAIvC;SAJY,2BAA2B","sourcesContent":["import {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\n\n/**\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class GlobalAcceptMimesMiddleware implements MiddlewareMethods {\n use(@Context() ctx: Context) {\n return;\n }\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createContainer } from "@tsed/di";
|
|
2
|
-
/**
|
|
3
|
-
* @ignore
|
|
4
|
-
* @deprecated User injector.load(container, module) instead
|
|
5
|
-
*/
|
|
6
|
-
export async function loadInjector(injector, container = createContainer()) {
|
|
7
|
-
injector.bootstrap(container);
|
|
8
|
-
return injector.load(container);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=loadInjector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadInjector.js","sourceRoot":"","sources":["../../../src/utils/loadInjector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAmC,MAAM,UAAU,CAAC;AAEtF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAyB,EAAE,YAAuB,eAAe,EAAE;IACpG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import {Container, createContainer, InjectorService, LocalsContainer} from \"@tsed/di\";\n\n/**\n * @ignore\n * @deprecated User injector.load(container, module) instead\n */\nexport async function loadInjector(injector: InjectorService, container: Container = createContainer()): Promise<LocalsContainer<any>> {\n injector.bootstrap(container);\n return injector.load(container);\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EndpointMetadata } from "../../domain/EndpointMetadata";
|
|
2
|
-
/**
|
|
3
|
-
* Get the current endpoint metadata.
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare function EndpointInfo(): Function;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export declare type EndpointInfo = EndpointMetadata;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
3
|
-
*
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ResponseData(): ParameterDecorator;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonPropertyStore } from "@tsed/schema";
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
5
|
-
*/
|
|
6
|
-
export declare class PropertyMetadata extends JsonPropertyStore {
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
9
|
-
*/
|
|
10
|
-
static get(target: Type<any>, propertyKey: string | symbol): PropertyMetadata;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
13
|
-
*/
|
|
14
|
-
static getProperties(target: Type<any>, options?: Partial<{
|
|
15
|
-
withIgnoredProps: boolean;
|
|
16
|
-
}>): Map<string | number | symbol, JsonPropertyStore>;
|
|
17
|
-
}
|