@tsed/platform-koa 7.0.0-rc.4 → 7.0.0-rc.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src/components/PlatformKoa.ts"],"names":[],"mappings":";;;;AAAA,iEAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src/components/PlatformKoa.ts"],"names":[],"mappings":";;;;AAAA,iEAAoC;AACpC,yCAcsB;AACtB,qCAA4C;AAC5C,mEAA6D;AAE7D,sDAAuC;AACvC,4EAAsD;AACtD,aAAa;AACb,4DAA2B;AAE3B,wEAAmE;AACnE,uEAAkE;AAClE,uEAAkE;AAClE,yEAAoE;AACpE,4CAA0C;AAY1C,aAAa;AACb,gBAAS,CAAC,SAAS,CAAC,OAAO,GAAG,gBAAS,CAAC,SAAS,CAAC,KAAK,CAAC;AACxD,gBAAS,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YACvB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAa,WAAW;IAgBF;IAfX,SAAS,GAAG;QACnB;YACE,OAAO,EAAE,yBAAgB;YACzB,QAAQ,EAAE,yCAAmB;SAC9B;QACD;YACE,OAAO,EAAE,wBAAe;YACxB,QAAQ,EAAE,uCAAkB;SAC7B;QACD;YACE,OAAO,EAAE,wBAAe;YACxB,QAAQ,EAAE,uCAAkB;SAC7B;KACF,CAAC;IAEF,YAAoB,QAAyB;QAAzB,aAA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AG,OAAO,EAAE,GAAG,iBAAiB,EAAC,CAAC,CAAC;IACpD,CAAC;IAEO,sBAAsB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA2B,4BAAmB,CAAE,CAAC;IAC3E,CAAC;CACF;AAxJD,kCAwJC","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n getContext,\n InjectorService,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformHandler,\n PlatformMulter,\n PlatformMulterSettings,\n PlatformRequest,\n PlatformResponse,\n PlatformStaticsOptions,\n runInContext\n} from \"@tsed/common\";\nimport {isFunction, Type} from \"@tsed/core\";\nimport {PlatformExceptions} from \"@tsed/platform-exceptions\";\nimport {PlatformHandlerMetadata, PlatformLayer} from \"@tsed/platform-router\";\nimport Koa, {Context, Next} from \"koa\";\nimport koaBodyParser, {Options} from \"koa-bodyparser\";\n// @ts-ignore\nimport koaQs from \"koa-qs\";\nimport send from \"koa-send\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\nimport {PlatformKoaHandler} from \"../services/PlatformKoaHandler\";\nimport {PlatformKoaRequest} from \"../services/PlatformKoaRequest\";\nimport {PlatformKoaResponse} from \"../services/PlatformKoaResponse\";\nimport {getMulter} from \"../utils/multer\";\n\ndeclare global {\n namespace TsED {\n export interface Application extends Koa {}\n }\n\n namespace TsED {\n export interface StaticsOptions extends send.SendOptions {}\n }\n}\n\n// @ts-ignore\nKoaRouter.prototype.$$match = KoaRouter.prototype.match;\nKoaRouter.prototype.match = function match(...args: any[]) {\n const matched = this.$$match(...args);\n if (matched) {\n if (matched.path.length) {\n matched.route = true;\n }\n }\n\n return matched;\n};\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa> {\n readonly providers = [\n {\n provide: PlatformResponse,\n useClass: PlatformKoaResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformKoaRequest\n },\n {\n provide: PlatformHandler,\n useClass: PlatformKoaHandler\n }\n ];\n\n constructor(private injector: InjectorService) {}\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.create<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.bootstrap<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const app = this.getPlatformApplication();\n\n app.getApp().silent = true;\n }\n\n mapLayers(layers: PlatformLayer[]) {\n const {settings} = this.injector;\n const app = this.getPlatformApplication();\n const options = settings.get(\"koa.router\", {});\n const rawRouter = new KoaRouter(options) as any;\n\n layers.forEach((layer) => {\n switch (layer.method) {\n case \"statics\":\n rawRouter.use(layer.path, this.statics(layer.path as string, layer.opts as any));\n break;\n\n default:\n rawRouter[layer.method](...layer.getArgs());\n }\n });\n\n app.getApp().use(rawRouter.routes()).use(rawRouter.allowedMethods());\n }\n\n mapHandler(handler: Function, metadata: PlatformHandlerMetadata) {\n if (metadata.isRawMiddleware()) {\n return handler;\n }\n\n return async (koaContext: Koa.Context, next: Koa.Next) => {\n const {$ctx} = koaContext.request;\n $ctx.next = next;\n\n await handler($ctx);\n };\n }\n\n useContext(): this {\n const app = this.getPlatformApplication();\n const invoke = createContext(this.injector);\n const platformExceptions = this.injector.get<PlatformExceptions>(PlatformExceptions);\n\n this.injector.logger.debug(\"Mount app context\");\n\n app.use(async (koaContext: Context, next: Next) => {\n const $ctx = await invoke({\n request: koaContext.request as any,\n response: koaContext.response as any,\n koaContext\n });\n\n return runInContext($ctx, async () => {\n try {\n await $ctx.start();\n await next();\n const status = koaContext.status || 404;\n\n if (status === 404 && !$ctx.isDone()) {\n platformExceptions?.resourceNotFound($ctx);\n }\n } catch (error) {\n platformExceptions?.catch(error, $ctx);\n } finally {\n await $ctx.finish();\n }\n });\n });\n\n return this;\n }\n\n app() {\n const app = this.injector.settings.get(\"koa.app\") || new Koa();\n koaQs(app, \"extended\");\n\n return {\n app,\n callback() {\n return app.callback();\n }\n };\n }\n\n multipart(options: PlatformMulterSettings): PlatformMulter {\n return getMulter(options);\n }\n\n statics(endpoint: string, options: PlatformStaticsOptions) {\n return staticsMiddleware(options);\n }\n\n bodyParser(type: \"json\" | \"urlencoded\" | \"raw\" | \"text\", additionalOptions: any = {}): any {\n const opts = this.injector.settings.get(`koa.bodyParser`);\n let parser: any = koaBodyParser;\n\n let options: Options = {};\n\n if (isFunction(opts)) {\n parser = opts;\n options = {};\n }\n\n return parser({...options, ...additionalOptions});\n }\n\n private getPlatformApplication() {\n return this.injector.get<PlatformApplication<Koa>>(PlatformApplication)!;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src/components/PlatformKoa.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,aAAa,EAGb,mBAAmB,EACnB,eAAe,EACf,eAAe,EAGf,eAAe,EACf,gBAAgB,EAEhB,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,UAAU,EAAO,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,OAAO,GAAoB,MAAM,KAAK,CAAC;AACvC,OAAO,aAAwB,MAAM,gBAAgB,CAAC;AACtD,aAAa;AACb,OAAO,KAAK,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO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C/D,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAEvB,OAAO;YACL,GAAG;YACH,QAAQ;gBACN,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;SACF,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,OAA+B;QACvC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,OAA+B;QACvD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,UAAU,CAAC,IAA4C,EAAE,oBAAyB,EAAE;QAClF,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,MAAM,GAAQ,aAAa,CAAC;QAEhC,IAAI,OAAO,GAAY,EAAE,CAAC;QAE1B,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;YACpB,MAAM,GAAG,IAAI,CAAC;YACd,OAAO,GAAG,EAAE,CAAC;SACd;QAED,OAAO,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,GAAG,iBAAiB,EAAC,CAAC,CAAC;IACpD,CAAC;IAEO,sBAAsB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA2B,mBAAmB,CAAE,CAAC;IAC3E,CAAC;CACF","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n InjectorService,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformHandler,\n PlatformMulter,\n PlatformMulterSettings,\n PlatformRequest,\n PlatformResponse,\n PlatformStaticsOptions,\n runInContext\n} from \"@tsed/common\";\nimport {isFunction, Type} from \"@tsed/core\";\nimport {PlatformExceptions} from \"@tsed/platform-exceptions\";\nimport {PlatformHandlerMetadata, PlatformLayer} from \"@tsed/platform-router\";\nimport Koa, {Context, Next} from \"koa\";\nimport koaBodyParser, {Options} from \"koa-bodyparser\";\n// @ts-ignore\nimport koaQs from \"koa-qs\";\nimport send from \"koa-send\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\nimport {PlatformKoaHandler} from \"../services/PlatformKoaHandler\";\nimport {PlatformKoaRequest} from \"../services/PlatformKoaRequest\";\nimport {PlatformKoaResponse} from \"../services/PlatformKoaResponse\";\nimport {getMulter} from \"../utils/multer\";\n\ndeclare global {\n namespace TsED {\n export interface Application extends Koa {}\n }\n\n namespace TsED {\n export interface StaticsOptions extends send.SendOptions {}\n }\n}\n\n// @ts-ignore\nKoaRouter.prototype.$$match = KoaRouter.prototype.match;\nKoaRouter.prototype.match = function match(...args: any[]) {\n const matched = this.$$match(...args);\n if (matched) {\n if (matched.path.length) {\n matched.route = true;\n }\n }\n\n return matched;\n};\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa> {\n readonly providers = [\n {\n provide: PlatformResponse,\n useClass: PlatformKoaResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformKoaRequest\n },\n {\n provide: PlatformHandler,\n useClass: PlatformKoaHandler\n }\n ];\n\n constructor(private injector: InjectorService) {}\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.create<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.bootstrap<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const app = this.getPlatformApplication();\n\n app.getApp().silent = true;\n }\n\n mapLayers(layers: PlatformLayer[]) {\n const {settings} = this.injector;\n const app = this.getPlatformApplication();\n const options = settings.get(\"koa.router\", {});\n const rawRouter = new KoaRouter(options) as any;\n\n layers.forEach((layer) => {\n switch (layer.method) {\n case \"statics\":\n rawRouter.use(layer.path, this.statics(layer.path as string, layer.opts as any));\n break;\n\n default:\n rawRouter[layer.method](...layer.getArgs());\n }\n });\n\n app.getApp().use(rawRouter.routes()).use(rawRouter.allowedMethods());\n }\n\n mapHandler(handler: Function, metadata: PlatformHandlerMetadata) {\n if (metadata.isRawMiddleware()) {\n return handler;\n }\n\n return async (koaContext: Koa.Context, next: Koa.Next) => {\n const {$ctx} = koaContext.request;\n $ctx.next = next;\n\n await handler($ctx);\n };\n }\n\n useContext(): this {\n const app = this.getPlatformApplication();\n const invoke = createContext(this.injector);\n const platformExceptions = this.injector.get<PlatformExceptions>(PlatformExceptions);\n\n this.injector.logger.debug(\"Mount app context\");\n\n app.use(async (koaContext: Context, next: Next) => {\n const $ctx = await invoke({\n request: koaContext.request as any,\n response: koaContext.response as any,\n koaContext\n });\n\n return runInContext($ctx, async () => {\n try {\n await $ctx.start();\n await next();\n const status = koaContext.status || 404;\n\n if (status === 404 && !$ctx.isDone()) {\n platformExceptions?.resourceNotFound($ctx);\n }\n } catch (error) {\n platformExceptions?.catch(error, $ctx);\n } finally {\n await $ctx.finish();\n }\n });\n });\n\n return this;\n }\n\n app() {\n const app = this.injector.settings.get(\"koa.app\") || new Koa();\n koaQs(app, \"extended\");\n\n return {\n app,\n callback() {\n return app.callback();\n }\n };\n }\n\n multipart(options: PlatformMulterSettings): PlatformMulter {\n return getMulter(options);\n }\n\n statics(endpoint: string, options: PlatformStaticsOptions) {\n return staticsMiddleware(options);\n }\n\n bodyParser(type: \"json\" | \"urlencoded\" | \"raw\" | \"text\", additionalOptions: any = {}): any {\n const opts = this.injector.settings.get(`koa.bodyParser`);\n let parser: any = koaBodyParser;\n\n let options: Options = {};\n\n if (isFunction(opts)) {\n parser = opts;\n options = {};\n }\n\n return parser({...options, ...additionalOptions});\n }\n\n private getPlatformApplication() {\n return this.injector.get<PlatformApplication<Koa>>(PlatformApplication)!;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../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AAE;YACpB,MAAM,GAAG,IAAI,CAAC;YACd,OAAO,GAAG,EAAE,CAAC;SACd;QAED,OAAO,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,GAAG,iBAAiB,EAAC,CAAC,CAAC;IACpD,CAAC;IAEO,sBAAsB;QAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA2B,mBAAmB,CAAE,CAAC;IAC3E,CAAC;CACF","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n getContext,\n InjectorService,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformHandler,\n PlatformMulter,\n PlatformMulterSettings,\n PlatformRequest,\n PlatformResponse,\n PlatformStaticsOptions,\n runInContext\n} from \"@tsed/common\";\nimport {isFunction, Type} from \"@tsed/core\";\nimport {PlatformExceptions} from \"@tsed/platform-exceptions\";\nimport {PlatformHandlerMetadata, PlatformLayer} from \"@tsed/platform-router\";\nimport Koa, {Context, Next} from \"koa\";\nimport koaBodyParser, {Options} from \"koa-bodyparser\";\n// @ts-ignore\nimport koaQs from \"koa-qs\";\nimport send from \"koa-send\";\nimport {staticsMiddleware} from \"../middlewares/staticsMiddleware\";\nimport {PlatformKoaHandler} from \"../services/PlatformKoaHandler\";\nimport {PlatformKoaRequest} from \"../services/PlatformKoaRequest\";\nimport {PlatformKoaResponse} from \"../services/PlatformKoaResponse\";\nimport {getMulter} from \"../utils/multer\";\n\ndeclare global {\n namespace TsED {\n export interface Application extends Koa {}\n }\n\n namespace TsED {\n export interface StaticsOptions extends send.SendOptions {}\n }\n}\n\n// @ts-ignore\nKoaRouter.prototype.$$match = KoaRouter.prototype.match;\nKoaRouter.prototype.match = function match(...args: any[]) {\n const matched = this.$$match(...args);\n if (matched) {\n if (matched.path.length) {\n matched.route = true;\n }\n }\n\n return matched;\n};\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa> {\n readonly providers = [\n {\n provide: PlatformResponse,\n useClass: PlatformKoaResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformKoaRequest\n },\n {\n provide: PlatformHandler,\n useClass: PlatformKoaHandler\n }\n ];\n\n constructor(private injector: InjectorService) {}\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.create<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.bootstrap<Koa>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const app = this.getPlatformApplication();\n\n app.getApp().silent = true;\n }\n\n mapLayers(layers: PlatformLayer[]) {\n const {settings} = this.injector;\n const app = this.getPlatformApplication();\n const options = settings.get(\"koa.router\", {});\n const rawRouter = new KoaRouter(options) as any;\n\n layers.forEach((layer) => {\n switch (layer.method) {\n case \"statics\":\n rawRouter.use(layer.path, this.statics(layer.path as string, layer.opts as any));\n break;\n\n default:\n rawRouter[layer.method](...layer.getArgs());\n }\n });\n\n app.getApp().use(rawRouter.routes()).use(rawRouter.allowedMethods());\n }\n\n mapHandler(handler: Function, metadata: PlatformHandlerMetadata) {\n if (metadata.isRawMiddleware()) {\n return handler;\n }\n\n return async (koaContext: Koa.Context, next: Koa.Next) => {\n const {$ctx} = koaContext.request;\n $ctx.next = next;\n\n await handler($ctx);\n };\n }\n\n useContext(): this {\n const app = this.getPlatformApplication();\n const invoke = createContext(this.injector);\n const platformExceptions = this.injector.get<PlatformExceptions>(PlatformExceptions);\n\n this.injector.logger.debug(\"Mount app context\");\n\n app.use(async (koaContext: Context, next: Next) => {\n const $ctx = await invoke({\n request: koaContext.request as any,\n response: koaContext.response as any,\n koaContext\n });\n\n return runInContext($ctx, async () => {\n try {\n await $ctx.start();\n await next();\n const status = koaContext.status || 404;\n\n if (status === 404 && !$ctx.isDone()) {\n platformExceptions?.resourceNotFound($ctx);\n }\n } catch (error) {\n platformExceptions?.catch(error, $ctx);\n } finally {\n await $ctx.finish();\n }\n });\n });\n\n return this;\n }\n\n app() {\n const app = this.injector.settings.get(\"koa.app\") || new Koa();\n koaQs(app, \"extended\");\n\n return {\n app,\n callback() {\n return app.callback();\n }\n };\n }\n\n multipart(options: PlatformMulterSettings): PlatformMulter {\n return getMulter(options);\n }\n\n statics(endpoint: string, options: PlatformStaticsOptions) {\n return staticsMiddleware(options);\n }\n\n bodyParser(type: \"json\" | \"urlencoded\" | \"raw\" | \"text\", additionalOptions: any = {}): any {\n const opts = this.injector.settings.get(`koa.bodyParser`);\n let parser: any = koaBodyParser;\n\n let options: Options = {};\n\n if (isFunction(opts)) {\n parser = opts;\n options = {};\n }\n\n return parser({...options, ...additionalOptions});\n }\n\n private getPlatformApplication() {\n return this.injector.get<PlatformApplication<Koa>>(PlatformApplication)!;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-koa",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.6",
|
|
4
4
|
"description": "Koa package for Ts.ED framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"repository": "https://github.com/tsedio/tsed",
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@koa/cors": "3.3.0",
|
|
55
|
-
"@tsed/common": "7.0.0-rc.
|
|
56
|
-
"@tsed/core": "7.0.0-rc.
|
|
57
|
-
"@tsed/di": "7.0.0-rc.
|
|
58
|
-
"@tsed/platform-test-utils": "7.0.0-rc.
|
|
55
|
+
"@tsed/common": "7.0.0-rc.6",
|
|
56
|
+
"@tsed/core": "7.0.0-rc.6",
|
|
57
|
+
"@tsed/di": "7.0.0-rc.6",
|
|
58
|
+
"@tsed/platform-test-utils": "7.0.0-rc.6",
|
|
59
59
|
"@types/koa": "2.13.4",
|
|
60
60
|
"@types/koa-bodyparser": "4.3.7",
|
|
61
61
|
"@types/koa-compose": "3.2.5",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"tslib": "2.4.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@tsed/common": "^7.0.0-rc.
|
|
84
|
-
"@tsed/core": "^7.0.0-rc.
|
|
85
|
-
"@tsed/di": "^7.0.0-rc.
|
|
86
|
-
"@tsed/json-mapper": "^7.0.0-rc.
|
|
83
|
+
"@tsed/common": "^7.0.0-rc.6",
|
|
84
|
+
"@tsed/core": "^7.0.0-rc.6",
|
|
85
|
+
"@tsed/di": "^7.0.0-rc.6",
|
|
86
|
+
"@tsed/json-mapper": "^7.0.0-rc.6",
|
|
87
87
|
"@tsed/logger": ">=6.2.2",
|
|
88
|
-
"@tsed/openspec": "^7.0.0-rc.
|
|
89
|
-
"@tsed/schema": "^7.0.0-rc.
|
|
88
|
+
"@tsed/openspec": "^7.0.0-rc.6",
|
|
89
|
+
"@tsed/schema": "^7.0.0-rc.6",
|
|
90
90
|
"koa": ">=2.13.0",
|
|
91
91
|
"koa-bodyparser": ">=4.3.0",
|
|
92
92
|
"koa-compress": ">=5.0.1",
|