@tsed/platform-koa 6.102.7 → 6.102.8

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 (41) hide show
  1. package/lib/cjs/components/PlatformKoa.js +10 -6
  2. package/lib/cjs/components/PlatformKoa.js.map +1 -1
  3. package/lib/cjs/exports.js +7 -0
  4. package/lib/cjs/exports.js.map +1 -0
  5. package/lib/cjs/index.js +19 -11
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/cjs/interfaces/{index.js → interfaces.js} +1 -1
  8. package/lib/cjs/interfaces/interfaces.js.map +1 -0
  9. package/lib/cjs/package.json +3 -0
  10. package/lib/esm/components/PlatformKoa.js +6 -2
  11. package/lib/esm/components/PlatformKoa.js.map +1 -1
  12. package/lib/esm/decorators/caseSensitive.js +1 -1
  13. package/lib/esm/decorators/strict.js +1 -1
  14. package/lib/esm/exports.js +5 -0
  15. package/lib/esm/exports.js.map +1 -0
  16. package/lib/esm/index.js +20 -12
  17. package/lib/esm/index.js.map +1 -1
  18. package/lib/esm/interfaces/interfaces.js +2 -0
  19. package/lib/esm/interfaces/interfaces.js.map +1 -0
  20. package/lib/esm/package.json +3 -0
  21. package/lib/esm/services/PlatformKoaApplication.js +1 -1
  22. package/lib/esm/services/PlatformKoaHandler.js +1 -1
  23. package/lib/esm/services/PlatformKoaRouter.js +2 -2
  24. package/lib/types/components/PlatformKoa.d.ts +5 -1
  25. package/lib/types/exports.d.ts +1 -0
  26. package/lib/types/index.d.ts +19 -3
  27. package/lib/types/interfaces/{index.d.ts → interfaces.d.ts} +0 -0
  28. package/package.json +15 -13
  29. package/lib/cjs/decorators/index.js +0 -9
  30. package/lib/cjs/decorators/index.js.map +0 -1
  31. package/lib/cjs/interfaces/index.js.map +0 -1
  32. package/lib/cjs/services/index.js +0 -9
  33. package/lib/cjs/services/index.js.map +0 -1
  34. package/lib/esm/decorators/index.js +0 -6
  35. package/lib/esm/decorators/index.js.map +0 -1
  36. package/lib/esm/interfaces/index.js +0 -2
  37. package/lib/esm/interfaces/index.js.map +0 -1
  38. package/lib/esm/services/index.js +0 -6
  39. package/lib/esm/services/index.js.map +0 -1
  40. package/lib/types/decorators/index.d.ts +0 -5
  41. package/lib/types/services/index.d.ts +0 -5
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlatformKoa = void 0;
4
4
  const common_1 = require("@tsed/common");
5
5
  const resourceNotFoundMiddleware_1 = require("../middlewares/resourceNotFoundMiddleware");
6
- const services_1 = require("../services");
6
+ const PlatformKoaResponse_1 = require("../services/PlatformKoaResponse");
7
+ const PlatformKoaRequest_1 = require("../services/PlatformKoaRequest");
8
+ const PlatformKoaHandler_1 = require("../services/PlatformKoaHandler");
9
+ const PlatformKoaRouter_1 = require("../services/PlatformKoaRouter");
10
+ const PlatformKoaApplication_1 = require("../services/PlatformKoaApplication");
7
11
  /**
8
12
  * @platform
9
13
  * @koa
@@ -14,23 +18,23 @@ class PlatformKoa {
14
18
  this.providers = [
15
19
  {
16
20
  provide: common_1.PlatformResponse,
17
- useClass: services_1.PlatformKoaResponse
21
+ useClass: PlatformKoaResponse_1.PlatformKoaResponse
18
22
  },
19
23
  {
20
24
  provide: common_1.PlatformRequest,
21
- useClass: services_1.PlatformKoaRequest
25
+ useClass: PlatformKoaRequest_1.PlatformKoaRequest
22
26
  },
23
27
  {
24
28
  provide: common_1.PlatformHandler,
25
- useClass: services_1.PlatformKoaHandler
29
+ useClass: PlatformKoaHandler_1.PlatformKoaHandler
26
30
  },
27
31
  {
28
32
  provide: common_1.PlatformRouter,
29
- useClass: services_1.PlatformKoaRouter
33
+ useClass: PlatformKoaRouter_1.PlatformKoaRouter
30
34
  },
31
35
  {
32
36
  provide: common_1.PlatformApplication,
33
- useClass: services_1.PlatformKoaApplication
37
+ useClass: PlatformKoaApplication_1.PlatformKoaApplication
34
38
  }
35
39
  ];
36
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformKoa.js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AAC,CAAC;QACvF,CAAC,CAAC;QAEF,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC;QAC3B,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,SAAS;QACP,MAAM,EAAC,GAAG,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,uDAA0B,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;QAEjH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU;QACR,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,QAAQ,CAAC,CAAC;QAEvC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,GAAY,EAAE,IAAU,EAAE,EAAE;YAClD,MAAM,MAAM,CAAC;gBACX,OAAO,EAAE,GAAG,CAAC,OAAc;gBAC3B,QAAQ,EAAE,GAAG,CAAC,QAAe;gBAC7B,GAAG;aACJ,CAAC,CAAC;YAEH,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtFD,kCAsFC","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Type} from \"@tsed/core\";\nimport Koa, {Context, Next} from \"koa\";\nimport {resourceNotFoundMiddleware} from \"../middlewares/resourceNotFoundMiddleware\";\nimport {PlatformKoaApplication, PlatformKoaHandler, PlatformKoaRequest, PlatformKoaResponse, PlatformKoaRouter} from \"../services\";\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa, KoaRouter> {\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 provide: PlatformRouter,\n useClass: PlatformKoaRouter\n },\n {\n provide: PlatformApplication,\n useClass: PlatformKoaApplication\n }\n ];\n\n constructor(private platform: PlatformBuilder<Koa, KoaRouter>) {}\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, KoaRouter>(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, KoaRouter>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const {injector, app} = this.platform;\n\n const listener: any = (error: any, ctx: Koa.Context) => {\n injector.get<PlatformExceptions>(PlatformExceptions)?.catch(error, ctx.request.$ctx);\n };\n\n app.getApp().silent = true;\n app.getApp().on(\"error\", listener);\n }\n\n useRouter(): this {\n const {app} = this.platform;\n app.getApp().use(resourceNotFoundMiddleware).use(app.getRouter().routes()).use(app.getRouter().allowedMethods());\n\n return this;\n }\n\n useContext(): this {\n const {injector, app, logger} = this.platform;\n logger.info(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (ctx: Context, next: Next) => {\n await invoke({\n request: ctx.request as any,\n response: ctx.response as any,\n ctx\n });\n\n return next();\n });\n\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src/components/PlatformKoa.ts"],"names":[],"mappings":";;;AACA,yCAUsB;AAGtB,0FAAqF;AACrF,yEAAoE;AACpE,uEAAkE;AAClE,uEAAkE;AAClE,qEAAgE;AAChE,+EAA0E;AAE1E;;;GAGG;AACH,MAAa,WAAW;IAwBtB,YAAoB,QAAyC;QAAzC,aAAQ,GAAR,QAAQ,CAAiC;QAvBpD,cAAS,GAAG;YACnB;gBACE,OAAO,EAAE,yBAAgB;gBACzB,QAAQ,EAAE,yCAAmB;aAC9B;YACD;gBACE,OAAO,EAAE,wBAAe;gBACxB,QAAQ,EAAE,uCAAkB;aAC7B;YACD;gBACE,OAAO,EAAE,wBAAe;gBACxB,QAAQ,EAAE,uCAAkB;aAC7B;YACD;gBACE,OAAO,EAAE,uBAAc;gBACvB,QAAQ,EAAE,qCAAiB;aAC5B;YACD;gBACE,OAAO,EAAE,4BAAmB;gBAC5B,QAAQ,EAAE,+CAAsB;aACjC;SACF,CAAC;IAE8D,CAAC;IAEjE;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,MAAiB,EAAE,WAAwC,EAAE;QACzE,OAAO,wBAAe,CAAC,MAAM,CAAiB,MAAM,EAAE;YACpD,GAAG,QAAQ;YACX,OAAO,EAAE,WAAW;SACrB,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAiB,EAAE,WAAwC,EAAE;QAClF,OAAO,wBAAe,CAAC,SAAS,CAAiB,MAAM,EAAE;YACvD,GAAG,QAAQ;YACX,OAAO,EAAE,WAAW;SACrB,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAEtC,MAAM,QAAQ,GAAQ,CAAC,KAAU,EAAE,GAAgB,EAAE,EAAE;;YACr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PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Type} from \"@tsed/core\";\nimport Koa, {Context, Next} from \"koa\";\nimport {resourceNotFoundMiddleware} from \"../middlewares/resourceNotFoundMiddleware\";\nimport {PlatformKoaResponse} from \"../services/PlatformKoaResponse\";\nimport {PlatformKoaRequest} from \"../services/PlatformKoaRequest\";\nimport {PlatformKoaHandler} from \"../services/PlatformKoaHandler\";\nimport {PlatformKoaRouter} from \"../services/PlatformKoaRouter\";\nimport {PlatformKoaApplication} from \"../services/PlatformKoaApplication\";\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa, KoaRouter> {\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 provide: PlatformRouter,\n useClass: PlatformKoaRouter\n },\n {\n provide: PlatformApplication,\n useClass: PlatformKoaApplication\n }\n ];\n\n constructor(private platform: PlatformBuilder<Koa, KoaRouter>) {}\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, KoaRouter>(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, KoaRouter>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const {injector, app} = this.platform;\n\n const listener: any = (error: any, ctx: Koa.Context) => {\n injector.get<PlatformExceptions>(PlatformExceptions)?.catch(error, ctx.request.$ctx);\n };\n\n app.getApp().silent = true;\n app.getApp().on(\"error\", listener);\n }\n\n useRouter(): this {\n const {app} = this.platform;\n app.getApp().use(resourceNotFoundMiddleware).use(app.getRouter().routes()).use(app.getRouter().allowedMethods());\n\n return this;\n }\n\n useContext(): this {\n const {injector, app, logger} = this.platform;\n logger.info(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (ctx: Context, next: Next) => {\n await invoke({\n request: ctx.request as any,\n response: ctx.response as any,\n ctx\n });\n\n return next();\n });\n\n return this;\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("@tsed/common");
4
+ const PlatformKoa_1 = require("./components/PlatformKoa");
5
+ common_1.PlatformTest.adapter = PlatformKoa_1.PlatformKoa;
6
+ common_1.PlatformBuilder.adapter = PlatformKoa_1.PlatformKoa;
7
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":";;AAAA,yCAA2D;AAC3D,0DAAqD;AAErD,qBAAY,CAAC,OAAO,GAAG,yBAAW,CAAC;AACnC,wBAAe,CAAC,OAAO,GAAG,yBAAW,CAAC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\nimport {PlatformKoa} from \"./components/PlatformKoa\";\n\nPlatformTest.adapter = PlatformKoa;\nPlatformBuilder.adapter = PlatformKoa;\n"]}
package/lib/cjs/index.js CHANGED
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
+ /**
3
+ * @file Automatically generated by barrelsby.
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const tslib_1 = require("tslib");
4
- const common_1 = require("@tsed/common");
5
- const PlatformKoa_1 = require("./components/PlatformKoa");
6
- common_1.PlatformTest.adapter = PlatformKoa_1.PlatformKoa;
7
- common_1.PlatformBuilder.adapter = PlatformKoa_1.PlatformKoa;
8
- // interfaces
9
- (0, tslib_1.__exportStar)(require("./interfaces"), exports);
10
- // decorators
11
- (0, tslib_1.__exportStar)(require("./decorators"), exports);
12
- // services
13
- (0, tslib_1.__exportStar)(require("./services"), exports);
14
- // components
7
+ (0, tslib_1.__exportStar)(require("./exports"), exports);
15
8
  (0, tslib_1.__exportStar)(require("./components/PlatformKoa"), exports);
9
+ (0, tslib_1.__exportStar)(require("./decorators/caseSensitive"), exports);
10
+ (0, tslib_1.__exportStar)(require("./decorators/ctx"), exports);
11
+ (0, tslib_1.__exportStar)(require("./decorators/routerSettings"), exports);
12
+ (0, tslib_1.__exportStar)(require("./decorators/state"), exports);
13
+ (0, tslib_1.__exportStar)(require("./decorators/strict"), exports);
14
+ (0, tslib_1.__exportStar)(require("./interfaces/PlatformKoaSettings"), exports);
15
+ (0, tslib_1.__exportStar)(require("./interfaces/interfaces"), exports);
16
+ (0, tslib_1.__exportStar)(require("./middlewares/resourceNotFoundMiddleware"), exports);
17
+ (0, tslib_1.__exportStar)(require("./middlewares/staticsMiddleware"), exports);
18
+ (0, tslib_1.__exportStar)(require("./services/PlatformKoaApplication"), exports);
19
+ (0, tslib_1.__exportStar)(require("./services/PlatformKoaHandler"), exports);
20
+ (0, tslib_1.__exportStar)(require("./services/PlatformKoaRequest"), exports);
21
+ (0, tslib_1.__exportStar)(require("./services/PlatformKoaResponse"), exports);
22
+ (0, tslib_1.__exportStar)(require("./services/PlatformKoaRouter"), exports);
23
+ (0, tslib_1.__exportStar)(require("./utils/multer"), exports);
16
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAC3D,0DAAqD;AAErD,qBAAY,CAAC,OAAO,GAAG,yBAAW,CAAC;AACnC,wBAAe,CAAC,OAAO,GAAG,yBAAW,CAAC;AAEtC,aAAa;AACb,4DAA6B;AAE7B,aAAa;AACb,4DAA6B;AAE7B,WAAW;AACX,0DAA2B;AAE3B,aAAa;AACb,wEAAyC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\nimport {PlatformKoa} from \"./components/PlatformKoa\";\n\nPlatformTest.adapter = PlatformKoa;\nPlatformBuilder.adapter = PlatformKoa;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformKoa\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAA0B;AAC1B,wEAAyC;AACzC,0EAA2C;AAC3C,gEAAiC;AACjC,2EAA4C;AAC5C,kEAAmC;AACnC,mEAAoC;AACpC,gFAAiD;AACjD,uEAAwC;AACxC,wFAAyD;AACzD,+EAAgD;AAChD,iFAAkD;AAClD,6EAA8C;AAC9C,6EAA8C;AAC9C,8EAA+C;AAC/C,4EAA6C;AAC7C,8DAA+B","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./components/PlatformKoa\";\nexport * from \"./decorators/caseSensitive\";\nexport * from \"./decorators/ctx\";\nexport * from \"./decorators/routerSettings\";\nexport * from \"./decorators/state\";\nexport * from \"./decorators/strict\";\nexport * from \"./interfaces/PlatformKoaSettings\";\nexport * from \"./interfaces/interfaces\";\nexport * from \"./middlewares/resourceNotFoundMiddleware\";\nexport * from \"./middlewares/staticsMiddleware\";\nexport * from \"./services/PlatformKoaApplication\";\nexport * from \"./services/PlatformKoaHandler\";\nexport * from \"./services/PlatformKoaRequest\";\nexport * from \"./services/PlatformKoaResponse\";\nexport * from \"./services/PlatformKoaRouter\";\nexport * from \"./utils/multer\";\n"]}
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  (0, tslib_1.__exportStar)(require("./PlatformKoaSettings"), exports);
5
- //# sourceMappingURL=index.js.map
5
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;AAGA,qEAAsC","sourcesContent":["import Koa from \"koa\";\nimport {PlatformKoaSettings} from \"./PlatformKoaSettings\";\n\nexport * from \"./PlatformKoaSettings\";\n\ndeclare global {\n namespace TsED {\n export interface Configuration {\n /**\n * Configuration related to Koa platform application.\n */\n koa: PlatformKoaSettings;\n }\n\n export interface NextFunction extends Koa.Next {}\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1,6 +1,10 @@
1
1
  import { createContext, PlatformApplication, PlatformBuilder, PlatformExceptions, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
2
- import { resourceNotFoundMiddleware } from "../middlewares/resourceNotFoundMiddleware";
3
- import { PlatformKoaApplication, PlatformKoaHandler, PlatformKoaRequest, PlatformKoaResponse, PlatformKoaRouter } from "../services";
2
+ import { resourceNotFoundMiddleware } from "../middlewares/resourceNotFoundMiddleware.js";
3
+ import { PlatformKoaResponse } from "../services/PlatformKoaResponse.js";
4
+ import { PlatformKoaRequest } from "../services/PlatformKoaRequest.js";
5
+ import { PlatformKoaHandler } from "../services/PlatformKoaHandler.js";
6
+ import { PlatformKoaRouter } from "../services/PlatformKoaRouter.js";
7
+ import { PlatformKoaApplication } from "../services/PlatformKoaApplication.js";
4
8
  /**
5
9
  * @platform
6
10
  * @koa
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src/components/PlatformKoa.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAEb,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAC,0BAA0B,EAAC,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,m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EAAE,CAAC,MAAM,GAAG,IAAI,CAAC;QAC3B,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,SAAS;QACP,MAAM,EAAC,GAAG,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;QAEjH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU;QACR,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QAEvC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,GAAY,EAAE,IAAU,EAAE,EAAE;YAClD,MAAM,MAAM,CAAC;gBACX,OAAO,EAAE,GAAG,CAAC,OAAc;gBAC3B,QAAQ,EAAE,GAAG,CAAC,QAAe;gBAC7B,GAAG;aACJ,CAAC,CAAC;YAEH,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Type} from \"@tsed/core\";\nimport Koa, {Context, Next} from \"koa\";\nimport {resourceNotFoundMiddleware} from \"../middlewares/resourceNotFoundMiddleware\";\nimport {PlatformKoaApplication, PlatformKoaHandler, PlatformKoaRequest, PlatformKoaResponse, PlatformKoaRouter} from \"../services\";\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa, KoaRouter> {\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 provide: PlatformRouter,\n useClass: PlatformKoaRouter\n },\n {\n provide: PlatformApplication,\n useClass: PlatformKoaApplication\n }\n ];\n\n constructor(private platform: PlatformBuilder<Koa, KoaRouter>) {}\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, KoaRouter>(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, KoaRouter>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const {injector, app} = this.platform;\n\n const listener: any = (error: any, ctx: Koa.Context) => {\n injector.get<PlatformExceptions>(PlatformExceptions)?.catch(error, ctx.request.$ctx);\n };\n\n app.getApp().silent = true;\n app.getApp().on(\"error\", listener);\n }\n\n useRouter(): this {\n const {app} = this.platform;\n app.getApp().use(resourceNotFoundMiddleware).use(app.getRouter().routes()).use(app.getRouter().allowedMethods());\n\n return this;\n }\n\n useContext(): this {\n const {injector, app, logger} = this.platform;\n logger.info(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (ctx: Context, next: Next) => {\n await invoke({\n request: ctx.request as any,\n response: ctx.response as any,\n ctx\n });\n\n return next();\n });\n\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformKoa.js","sourceRoot":"","sources":["../../../src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BAC3B,QAAQ,EAAE,GAAG,CAAC,QAAe;gBAC7B,GAAG;aACJ,CAAC,CAAC;YAEH,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import KoaRouter from \"@koa/router\";\nimport {\n createContext,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Type} from \"@tsed/core\";\nimport Koa, {Context, Next} from \"koa\";\nimport {resourceNotFoundMiddleware} from \"../middlewares/resourceNotFoundMiddleware\";\nimport {PlatformKoaResponse} from \"../services/PlatformKoaResponse\";\nimport {PlatformKoaRequest} from \"../services/PlatformKoaRequest\";\nimport {PlatformKoaHandler} from \"../services/PlatformKoaHandler\";\nimport {PlatformKoaRouter} from \"../services/PlatformKoaRouter\";\nimport {PlatformKoaApplication} from \"../services/PlatformKoaApplication\";\n\n/**\n * @platform\n * @koa\n */\nexport class PlatformKoa implements PlatformAdapter<Koa, KoaRouter> {\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 provide: PlatformRouter,\n useClass: PlatformKoaRouter\n },\n {\n provide: PlatformApplication,\n useClass: PlatformKoaApplication\n }\n ];\n\n constructor(private platform: PlatformBuilder<Koa, KoaRouter>) {}\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, KoaRouter>(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, KoaRouter>(module, {\n ...settings,\n adapter: PlatformKoa\n });\n }\n\n onInit() {\n const {injector, app} = this.platform;\n\n const listener: any = (error: any, ctx: Koa.Context) => {\n injector.get<PlatformExceptions>(PlatformExceptions)?.catch(error, ctx.request.$ctx);\n };\n\n app.getApp().silent = true;\n app.getApp().on(\"error\", listener);\n }\n\n useRouter(): this {\n const {app} = this.platform;\n app.getApp().use(resourceNotFoundMiddleware).use(app.getRouter().routes()).use(app.getRouter().allowedMethods());\n\n return this;\n }\n\n useContext(): this {\n const {injector, app, logger} = this.platform;\n logger.info(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (ctx: Context, next: Next) => {\n await invoke({\n request: ctx.request as any,\n response: ctx.response as any,\n ctx\n });\n\n return next();\n });\n\n return this;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { RouterSettings } from "./routerSettings";
1
+ import { RouterSettings } from "./routerSettings.js";
2
2
  /**
3
3
  * Specify the behavior of the router controller.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { RouterSettings } from "./routerSettings";
1
+ import { RouterSettings } from "./routerSettings.js";
2
2
  /**
3
3
  * Specify the behavior of the router controller.
4
4
  *
@@ -0,0 +1,5 @@
1
+ import { PlatformBuilder, PlatformTest } from "@tsed/common";
2
+ import { PlatformKoa } from "./components/PlatformKoa.js";
3
+ PlatformTest.adapter = PlatformKoa;
4
+ PlatformBuilder.adapter = PlatformKoa;
5
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,YAAY,CAAC,OAAO,GAAG,WAAW,CAAC;AACnC,eAAe,CAAC,OAAO,GAAG,WAAW,CAAC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\nimport {PlatformKoa} from \"./components/PlatformKoa\";\n\nPlatformTest.adapter = PlatformKoa;\nPlatformBuilder.adapter = PlatformKoa;\n"]}
package/lib/esm/index.js CHANGED
@@ -1,13 +1,21 @@
1
- import { PlatformBuilder, PlatformTest } from "@tsed/common";
2
- import { PlatformKoa } from "./components/PlatformKoa";
3
- PlatformTest.adapter = PlatformKoa;
4
- PlatformBuilder.adapter = PlatformKoa;
5
- // interfaces
6
- export * from "./interfaces";
7
- // decorators
8
- export * from "./decorators";
9
- // services
10
- export * from "./services";
11
- // components
12
- export * from "./components/PlatformKoa";
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from "./exports.js";
5
+ export * from "./components/PlatformKoa.js";
6
+ export * from "./decorators/caseSensitive.js";
7
+ export * from "./decorators/ctx.js";
8
+ export * from "./decorators/routerSettings.js";
9
+ export * from "./decorators/state.js";
10
+ export * from "./decorators/strict.js";
11
+ export * from "./interfaces/PlatformKoaSettings.js";
12
+ export * from "./interfaces/interfaces.js";
13
+ export * from "./middlewares/resourceNotFoundMiddleware.js";
14
+ export * from "./middlewares/staticsMiddleware.js";
15
+ export * from "./services/PlatformKoaApplication.js";
16
+ export * from "./services/PlatformKoaHandler.js";
17
+ export * from "./services/PlatformKoaRequest.js";
18
+ export * from "./services/PlatformKoaResponse.js";
19
+ export * from "./services/PlatformKoaRouter.js";
20
+ export * from "./utils/multer.js";
13
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErD,YAAY,CAAC,OAAO,GAAG,WAAW,CAAC;AACnC,eAAe,CAAC,OAAO,GAAG,WAAW,CAAC;AAEtC,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,YAAY,CAAC;AAE3B,aAAa;AACb,cAAc,0BAA0B,CAAC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\nimport {PlatformKoa} from \"./components/PlatformKoa\";\n\nPlatformTest.adapter = PlatformKoa;\nPlatformBuilder.adapter = PlatformKoa;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformKoa\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./components/PlatformKoa\";\nexport * from \"./decorators/caseSensitive\";\nexport * from \"./decorators/ctx\";\nexport * from \"./decorators/routerSettings\";\nexport * from \"./decorators/state\";\nexport * from \"./decorators/strict\";\nexport * from \"./interfaces/PlatformKoaSettings\";\nexport * from \"./interfaces/interfaces\";\nexport * from \"./middlewares/resourceNotFoundMiddleware\";\nexport * from \"./middlewares/staticsMiddleware\";\nexport * from \"./services/PlatformKoaApplication\";\nexport * from \"./services/PlatformKoaHandler\";\nexport * from \"./services/PlatformKoaRequest\";\nexport * from \"./services/PlatformKoaResponse\";\nexport * from \"./services/PlatformKoaRouter\";\nexport * from \"./utils/multer\";\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./PlatformKoaSettings.js";
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC","sourcesContent":["import Koa from \"koa\";\nimport {PlatformKoaSettings} from \"./PlatformKoaSettings\";\n\nexport * from \"./PlatformKoaSettings\";\n\ndeclare global {\n namespace TsED {\n export interface Configuration {\n /**\n * Configuration related to Koa platform application.\n */\n koa: PlatformKoaSettings;\n }\n\n export interface NextFunction extends Koa.Next {}\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata, __param } from "tslib";
2
2
  import { Configuration, Inject, PlatformHandler } from "@tsed/common";
3
3
  import Koa from "koa";
4
- import { PlatformKoaRouter } from "./PlatformKoaRouter";
4
+ import { PlatformKoaRouter } from "./PlatformKoaRouter.js";
5
5
  const koaQs = require("koa-qs");
6
6
  /**
7
7
  * @platform
@@ -1,5 +1,5 @@
1
1
  import { HandlerType, PlatformHandler } from "@tsed/common";
2
- import "./PlatformKoaRequest";
2
+ import "./PlatformKoaRequest.js";
3
3
  const OVERRIDE_TYPES = [HandlerType.ENDPOINT, HandlerType.MIDDLEWARE, HandlerType.ERR_MIDDLEWARE, HandlerType.CTX_FN];
4
4
  export class PlatformKoaHandler extends PlatformHandler {
5
5
  async flush(data, ctx) {
@@ -2,8 +2,8 @@ import { __decorate, __metadata, __param } from "tslib";
2
2
  import KoaRouter from "@koa/router";
3
3
  import { PLATFORM_ROUTER_OPTIONS, PlatformHandler, PlatformRouter } from "@tsed/common";
4
4
  import { Configuration, Inject } from "@tsed/di";
5
- import { staticsMiddleware } from "../middlewares/staticsMiddleware";
6
- import { getMulter } from "../utils/multer";
5
+ import { staticsMiddleware } from "../middlewares/staticsMiddleware.js";
6
+ import { getMulter } from "../utils/multer.js";
7
7
  // @ts-ignore
8
8
  KoaRouter.prototype.$$match = KoaRouter.prototype.match;
9
9
  KoaRouter.prototype.match = function match(...args) {
@@ -3,7 +3,11 @@ import KoaRouter from "@koa/router";
3
3
  import { PlatformAdapter, PlatformApplication, PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
4
4
  import { Type } from "@tsed/core";
5
5
  import Koa from "koa";
6
- import { PlatformKoaApplication, PlatformKoaHandler, PlatformKoaRequest, PlatformKoaResponse, PlatformKoaRouter } from "../services";
6
+ import { PlatformKoaResponse } from "../services/PlatformKoaResponse";
7
+ import { PlatformKoaRequest } from "../services/PlatformKoaRequest";
8
+ import { PlatformKoaHandler } from "../services/PlatformKoaHandler";
9
+ import { PlatformKoaRouter } from "../services/PlatformKoaRouter";
10
+ import { PlatformKoaApplication } from "../services/PlatformKoaApplication";
7
11
  /**
8
12
  * @platform
9
13
  * @koa
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,20 @@
1
- export * from "./interfaces";
2
- export * from "./decorators";
3
- export * from "./services";
1
+ /**
2
+ * @file Automatically generated by barrelsby.
3
+ */
4
+ export * from "./exports";
4
5
  export * from "./components/PlatformKoa";
6
+ export * from "./decorators/caseSensitive";
7
+ export * from "./decorators/ctx";
8
+ export * from "./decorators/routerSettings";
9
+ export * from "./decorators/state";
10
+ export * from "./decorators/strict";
11
+ export * from "./interfaces/PlatformKoaSettings";
12
+ export * from "./interfaces/interfaces";
13
+ export * from "./middlewares/resourceNotFoundMiddleware";
14
+ export * from "./middlewares/staticsMiddleware";
15
+ export * from "./services/PlatformKoaApplication";
16
+ export * from "./services/PlatformKoaHandler";
17
+ export * from "./services/PlatformKoaRequest";
18
+ export * from "./services/PlatformKoaResponse";
19
+ export * from "./services/PlatformKoaRouter";
20
+ export * from "./utils/multer";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/platform-koa",
3
- "version": "6.102.7",
3
+ "version": "6.102.8",
4
4
  "description": "Koa package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
11
  "types": "./lib/types/index.d.ts",
@@ -13,9 +14,10 @@
13
14
  "default": "./lib/esm/index.js"
14
15
  },
15
16
  "scripts": {
16
- "build": "yarn run build:esm && yarn run build:cjs",
17
+ "build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
17
18
  "build:cjs": "tsc --build tsconfig.compile.json",
18
19
  "build:esm": "tsc --build tsconfig.compile.esm.json",
20
+ "barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
19
21
  "start": "ts-node -r tsconfig-paths/register test/app/index.ts"
20
22
  },
21
23
  "keywords": [
@@ -49,10 +51,10 @@
49
51
  "repository": "https://github.com/tsedio/tsed",
50
52
  "devDependencies": {
51
53
  "@koa/cors": "3.1.0",
52
- "@tsed/common": "6.102.7",
53
- "@tsed/core": "6.102.7",
54
- "@tsed/di": "6.102.7",
55
- "@tsed/platform-test-utils": "6.102.7",
54
+ "@tsed/common": "6.102.8",
55
+ "@tsed/core": "6.102.8",
56
+ "@tsed/di": "6.102.8",
57
+ "@tsed/platform-test-utils": "6.102.8",
56
58
  "@types/koa": "2.11.3",
57
59
  "@types/koa-bodyparser": "4.3.0",
58
60
  "@types/koa-compose": "3.2.5",
@@ -77,13 +79,13 @@
77
79
  "tslib": "2.2.0"
78
80
  },
79
81
  "peerDependencies": {
80
- "@tsed/common": "^6.102.7",
81
- "@tsed/core": "^6.102.7",
82
- "@tsed/di": "^6.102.7",
83
- "@tsed/json-mapper": "^6.102.7",
84
- "@tsed/logger": ">=6.0.2",
85
- "@tsed/openspec": "^6.102.7",
86
- "@tsed/schema": "^6.102.7",
82
+ "@tsed/common": "^6.102.8",
83
+ "@tsed/core": "^6.102.8",
84
+ "@tsed/di": "^6.102.8",
85
+ "@tsed/json-mapper": "^6.102.8",
86
+ "@tsed/logger": ">=6.1.0",
87
+ "@tsed/openspec": "^6.102.8",
88
+ "@tsed/schema": "^6.102.8",
87
89
  "koa": ">=2.13.0",
88
90
  "koa-bodyparser": ">=4.3.0",
89
91
  "koa-compress": ">=5.0.1",
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./routerSettings"), exports);
5
- (0, tslib_1.__exportStar)(require("./caseSensitive"), exports);
6
- (0, tslib_1.__exportStar)(require("./strict"), exports);
7
- (0, tslib_1.__exportStar)(require("./state"), exports);
8
- (0, tslib_1.__exportStar)(require("./ctx"), exports);
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,+DAAgC;AAChC,wDAAyB;AACzB,uDAAwB;AACxB,qDAAsB","sourcesContent":["export * from \"./routerSettings\";\nexport * from \"./caseSensitive\";\nexport * from \"./strict\";\nexport * from \"./state\";\nexport * from \"./ctx\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAGA,qEAAsC","sourcesContent":["import Koa from \"koa\";\nimport {PlatformKoaSettings} from \"./PlatformKoaSettings\";\n\nexport * from \"./PlatformKoaSettings\";\n\ndeclare global {\n namespace TsED {\n export interface Configuration {\n /**\n * Configuration related to Koa platform application.\n */\n koa: PlatformKoaSettings;\n }\n\n export interface NextFunction extends Koa.Next {}\n }\n}\n"]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./PlatformKoaApplication"), exports);
5
- (0, tslib_1.__exportStar)(require("./PlatformKoaHandler"), exports);
6
- (0, tslib_1.__exportStar)(require("./PlatformKoaRouter"), exports);
7
- (0, tslib_1.__exportStar)(require("./PlatformKoaRequest"), exports);
8
- (0, tslib_1.__exportStar)(require("./PlatformKoaResponse"), exports);
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,wEAAyC;AACzC,oEAAqC;AACrC,mEAAoC;AACpC,oEAAqC;AACrC,qEAAsC","sourcesContent":["export * from \"./PlatformKoaApplication\";\nexport * from \"./PlatformKoaHandler\";\nexport * from \"./PlatformKoaRouter\";\nexport * from \"./PlatformKoaRequest\";\nexport * from \"./PlatformKoaResponse\";\n"]}
@@ -1,6 +0,0 @@
1
- export * from "./routerSettings";
2
- export * from "./caseSensitive";
3
- export * from "./strict";
4
- export * from "./state";
5
- export * from "./ctx";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC","sourcesContent":["export * from \"./routerSettings\";\nexport * from \"./caseSensitive\";\nexport * from \"./strict\";\nexport * from \"./state\";\nexport * from \"./ctx\";\n"]}
@@ -1,2 +0,0 @@
1
- export * from "./PlatformKoaSettings";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC","sourcesContent":["import Koa from \"koa\";\nimport {PlatformKoaSettings} from \"./PlatformKoaSettings\";\n\nexport * from \"./PlatformKoaSettings\";\n\ndeclare global {\n namespace TsED {\n export interface Configuration {\n /**\n * Configuration related to Koa platform application.\n */\n koa: PlatformKoaSettings;\n }\n\n export interface NextFunction extends Koa.Next {}\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- export * from "./PlatformKoaApplication";
2
- export * from "./PlatformKoaHandler";
3
- export * from "./PlatformKoaRouter";
4
- export * from "./PlatformKoaRequest";
5
- export * from "./PlatformKoaResponse";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./PlatformKoaApplication\";\nexport * from \"./PlatformKoaHandler\";\nexport * from \"./PlatformKoaRouter\";\nexport * from \"./PlatformKoaRequest\";\nexport * from \"./PlatformKoaResponse\";\n"]}
@@ -1,5 +0,0 @@
1
- export * from "./routerSettings";
2
- export * from "./caseSensitive";
3
- export * from "./strict";
4
- export * from "./state";
5
- export * from "./ctx";
@@ -1,5 +0,0 @@
1
- export * from "./PlatformKoaApplication";
2
- export * from "./PlatformKoaHandler";
3
- export * from "./PlatformKoaRouter";
4
- export * from "./PlatformKoaRequest";
5
- export * from "./PlatformKoaResponse";