@expressots/core 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -41
- package/lib/CHANGELOG.md +29 -0
- package/lib/README.md +87 -41
- package/lib/cjs/application/app-container.js +24 -7
- package/lib/cjs/application/application.js +15 -2
- package/lib/cjs/console/console.js +3 -1
- package/lib/cjs/container-module/container-module.js +2 -0
- package/lib/cjs/decorator/scope-binding.js +2 -0
- package/lib/cjs/environment/env-validator.js +1 -0
- package/lib/cjs/error/error-handler-middleware.js +1 -1
- package/lib/cjs/logger/general-logger.js +2 -2
- package/lib/cjs/types/application/app-container.d.ts +96 -2
- package/lib/cjs/types/application/app-container.d.ts.map +1 -1
- package/lib/cjs/types/application/application.d.ts +5 -1
- package/lib/cjs/types/application/application.d.ts.map +1 -1
- package/lib/cjs/types/common/project-config.provider.d.ts.map +1 -1
- package/lib/cjs/types/console/console.d.ts.map +1 -1
- package/lib/cjs/types/container-module/container-module.d.ts +1 -1
- package/lib/cjs/types/container-module/container-module.d.ts.map +1 -1
- package/lib/cjs/types/controller/base-controller.d.ts.map +1 -1
- package/lib/cjs/types/decorator/scope-binding.d.ts.map +1 -1
- package/lib/cjs/types/environment/env-validator.d.ts.map +1 -1
- package/lib/cjs/types/error/error-handler-middleware.d.ts +2 -2
- package/lib/cjs/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/cjs/types/logger/general-logger.d.ts.map +1 -1
- package/lib/esm/application/app-container.js +38 -11
- package/lib/esm/application/application.js +38 -18
- package/lib/esm/application/index.js +9 -2
- package/lib/esm/common/index.js +2 -1
- package/lib/esm/common/project-config.provider.js +2 -1
- package/lib/esm/console/console.js +18 -10
- package/lib/esm/console/index.js +5 -1
- package/lib/esm/container-module/container-module.js +23 -17
- package/lib/esm/container-module/index.js +6 -1
- package/lib/esm/controller/base-controller.js +9 -6
- package/lib/esm/controller/index.js +5 -1
- package/lib/esm/decorator/index.js +17 -1
- package/lib/esm/decorator/scope-binding.js +10 -4
- package/lib/esm/environment/env-validator.js +20 -13
- package/lib/esm/environment/index.js +5 -1
- package/lib/esm/error/error-handler-middleware.js +6 -4
- package/lib/esm/error/index.js +7 -2
- package/lib/esm/error/report.js +9 -6
- package/lib/esm/error/status-code.js +4 -1
- package/lib/esm/index.mjs +26 -10
- package/lib/esm/logger/general-logger.js +20 -13
- package/lib/esm/logger/index.js +7 -1
- package/lib/esm/render/handlebars.interface.js +2 -1
- package/lib/esm/render/index.js +2 -1
- package/lib/esm/render/render.type.js +2 -1
- package/lib/esm/types/application/app-container.d.ts +96 -2
- package/lib/esm/types/application/app-container.d.ts.map +1 -1
- package/lib/esm/types/application/application.d.ts +5 -1
- package/lib/esm/types/application/application.d.ts.map +1 -1
- package/lib/esm/types/common/project-config.provider.d.ts.map +1 -1
- package/lib/esm/types/console/console.d.ts.map +1 -1
- package/lib/esm/types/container-module/container-module.d.ts +1 -1
- package/lib/esm/types/container-module/container-module.d.ts.map +1 -1
- package/lib/esm/types/controller/base-controller.d.ts.map +1 -1
- package/lib/esm/types/decorator/scope-binding.d.ts.map +1 -1
- package/lib/esm/types/environment/env-validator.d.ts.map +1 -1
- package/lib/esm/types/error/error-handler-middleware.d.ts +2 -2
- package/lib/esm/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/esm/types/logger/general-logger.d.ts.map +1 -1
- package/lib/package.json +16 -10
- package/package.json +16 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAW,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAe,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE/D;;GAEG;AACH,aAAK,iBAAiB;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,cACM,WAAW;IACf,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,WAAW,CAAoB;IAEvC;;OAEG;;IAGH;;OAEG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAEnC;;OAEG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAE1C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAW,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAe,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE/D;;GAEG;AACH,aAAK,iBAAiB;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,cACM,WAAW;IACf,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,WAAW,CAAoB;IAEvC;;OAEG;;IAGH;;OAEG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAEnC;;OAEG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAE1C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI;IAEhC;;OAEG;IACH,OAAO,CAAC,UAAU;IAKlB;;;;;OAKG;IACI,MAAM,CACX,SAAS,EAAE,SAAS,EACpB,WAAW,GAAE,KAAK,CAAC,OAAO,CAAC,cAAc,CAAM,GAC9C,WAAW;IAoCd;;;;;OAKG;IACI,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,EAC9B,cAAc,CAAC,EAAE,4BAA4B,GAC5C,IAAI;IAuBP;;;;;;;;;;OAUG;IACI,SAAS,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;CAQpE;AAED,QAAA,MAAM,iBAAiB,EAAE,WAA+B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mBAAW,OAAO;IAChB,UAAU,cAAc;IACxB,UAAU,eAAe;IACzB,WAAW,eAAe;IAC1B,UAAU,cAAc;CACzB;AAED;;;;;;;GAOG;AACH,UAAU,UAAU;
|
|
1
|
+
{"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mBAAW,OAAO;IAChB,UAAU,cAAc;IACxB,UAAU,eAAe;IACzB,WAAW,eAAe;IAC1B,UAAU,cAAc;CACzB;AAED;;;;;;;GAOG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;;;;GASG;AACH,UAAU,cAAc;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,cACM,OAAO;IACX;;;;OAIG;YACW,UAAU;IAgBxB;;;;;OAKG;IACU,aAAa,
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,cACM,OAAO;IACX;;;;OAIG;YACW,UAAU;IAgBxB;;;;;OAKG;IACU,aAAa,CAExB,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,4BAA4B,GAC5C,OAAO,CAAC,IAAI,CAAC;CA6BjB;AAED,OAAO,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -22,7 +22,7 @@ declare class BaseModule {
|
|
|
22
22
|
* @param scope - An optional binding scope to be used for all controllers.
|
|
23
23
|
* @returns A ContainerModule with the controller bindings.
|
|
24
24
|
*/
|
|
25
|
-
static createContainerModule(controllers: any
|
|
25
|
+
static createContainerModule(controllers: Array<any>, scope?: interfaces.BindingScope): ContainerModule;
|
|
26
26
|
}
|
|
27
27
|
declare const CreateModule: typeof BaseModule.createContainerModule;
|
|
28
28
|
export { CreateModule, scope };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS1E;;;;GAIG;AACH,QAAA,MAAM,KAAK,YAAa,WAAW,YAAY,cACpB,GAAG,SAiB7B,CAAC;AAOF;;;GAGG;AACH,cACM,UAAU;IACd;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B;;;;;OAKG;WACW,qBAAqB,CACjC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,EACvB,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,GAC9B,eAAe;CAyCnB;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-controller.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/controller/base-controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-controller.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/controller/base-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD;;;;GAIG;AACH,uBACe,cAAe,YAAW,UAAU,CAAC,UAAU;IAC5D,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;gBACS,WAAW,GAAE,MAAW;IAIpC;;;;;OAKG;cACa,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,MAAM;IAK3B;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM;IAIvE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,KAAK,GAAG,IAAI;IAI5E;;;;;;;;;;OAUG;IACH,SAAS,CAAC,kBAAkB,CAC1B,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;CAWnB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,cACM,oBAAoB;IACxB;;;;;OAKG;
|
|
1
|
+
{"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,cACM,oBAAoB;IACxB;;;;;OAKG;WAEW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,GAAe,GAAG,GAAG;IAIlE;;;OAGG;WACW,QAAQ,IAAI,IAAI;CAsC/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;QACjC,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;QAC/B,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;KAChC;CACF;AAyBD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Request, Response } from "express";
|
|
2
2
|
import { IAppError } from "./report";
|
|
3
3
|
/**
|
|
4
4
|
* errorHandler is a custom Express error-handling middleware function.
|
|
@@ -8,6 +8,6 @@ import { IAppError } from "./report";
|
|
|
8
8
|
* @param res - The Express response object.
|
|
9
9
|
* @param next - The Express next function for passing control to the next middleware function.
|
|
10
10
|
*/
|
|
11
|
-
declare function errorHandler(error: IAppError, req: Request, res: Response
|
|
11
|
+
declare function errorHandler(error: IAppError, req: Request, res: Response): void;
|
|
12
12
|
export default errorHandler;
|
|
13
13
|
//# sourceMappingURL=error-handler-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler-middleware.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/error-handler-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"error-handler-middleware.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/error-handler-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC;;;;;;;GAOG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAIzE;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,aAAK,QAAQ;IACX,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACL;AAED;;GAEG;AACH,cACM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAS;;IAMvB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAcrC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;OAKG;IACI,GAAG,
|
|
1
|
+
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,aAAK,QAAQ;IACX,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACL;AAED;;GAEG;AACH,cACM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAS;;IAMvB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAcrC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;OAKG;IACI,GAAG,CACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,GAAG,MAAM,EACvB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;CAyBR;AAGD,QAAA,MAAM,GAAG,aA/BK,QAAQ,WACT,KAAK,GAAG,MAAM,YACb,MAAM,KACf,IA4BwB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,30 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
7
11
|
var AppContainer_1;
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AppContainer = void 0;
|
|
14
|
+
const inversify_1 = require("inversify");
|
|
15
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
10
16
|
/**
|
|
11
17
|
* The AppContainer class provides a container for managing dependency injection.
|
|
18
|
+
* It allows the creation of a container with custom options, including default binding scope
|
|
19
|
+
* and the ability to skip base class checks. The container can be loaded with multiple
|
|
20
|
+
* ContainerModule instances, facilitating modular and organized code.
|
|
21
|
+
*
|
|
22
|
+
* Usage:
|
|
23
|
+
* const appContainer = new AppContainer(options);
|
|
24
|
+
* const container = appContainer.create(modules);
|
|
25
|
+
*
|
|
12
26
|
* @provide AppContainer
|
|
13
27
|
*/
|
|
14
28
|
let AppContainer = AppContainer_1 = class AppContainer {
|
|
15
29
|
container;
|
|
30
|
+
options;
|
|
31
|
+
/**
|
|
32
|
+
* Constructs the AppContainer instance.
|
|
33
|
+
* @param options - The options for creating the container. Can include custom default scope and skip base class checks setting.
|
|
34
|
+
*/
|
|
35
|
+
constructor(options) {
|
|
36
|
+
this.options = {
|
|
37
|
+
defaultScope: inversify_1.BindingScopeEnum.Request,
|
|
38
|
+
...options,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
16
41
|
/**
|
|
17
42
|
* Creates and configures a new dependency injection container.
|
|
18
43
|
* @param modules - An array of ContainerModule instances to load into the container.
|
|
19
44
|
* @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
|
|
20
45
|
* @returns The configured dependency injection container.
|
|
21
46
|
*/
|
|
22
|
-
create(modules
|
|
23
|
-
|
|
47
|
+
create(modules) {
|
|
48
|
+
const containerOptions = {
|
|
24
49
|
autoBindInjectable: true,
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
this.container.
|
|
50
|
+
...this.options,
|
|
51
|
+
};
|
|
52
|
+
this.container = new inversify_1.Container(containerOptions);
|
|
53
|
+
this.container.load((0, inversify_binding_decorators_1.buildProviderModule)(), ...modules);
|
|
28
54
|
return this.container;
|
|
29
55
|
}
|
|
30
56
|
/**
|
|
@@ -39,7 +65,7 @@ let AppContainer = AppContainer_1 = class AppContainer {
|
|
|
39
65
|
* @returns The container options.
|
|
40
66
|
*/
|
|
41
67
|
getContainerOptions() {
|
|
42
|
-
return this.container
|
|
68
|
+
return this.container.options;
|
|
43
69
|
}
|
|
44
70
|
/**
|
|
45
71
|
* Retrieves the container.
|
|
@@ -49,7 +75,8 @@ let AppContainer = AppContainer_1 = class AppContainer {
|
|
|
49
75
|
return this.container;
|
|
50
76
|
}
|
|
51
77
|
};
|
|
52
|
-
AppContainer =
|
|
53
|
-
|
|
78
|
+
exports.AppContainer = AppContainer;
|
|
79
|
+
exports.AppContainer = AppContainer = AppContainer_1 = __decorate([
|
|
80
|
+
(0, inversify_binding_decorators_1.provide)(AppContainer_1),
|
|
81
|
+
__metadata("design:paramtypes", [Object])
|
|
54
82
|
], AppContainer);
|
|
55
|
-
export { AppContainer };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7,13 +8,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
10
14
|
var Application_1;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ServerEnvironment = exports.Application = exports.AppInstance = void 0;
|
|
17
|
+
const process_1 = __importDefault(require("process"));
|
|
18
|
+
const express_1 = __importDefault(require("express"));
|
|
19
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
20
|
+
const inversify_express_utils_1 = require("inversify-express-utils");
|
|
21
|
+
const console_1 = require("../console/console");
|
|
22
|
+
const error_handler_middleware_1 = __importDefault(require("../error/error-handler-middleware"));
|
|
17
23
|
/**
|
|
18
24
|
* Enum representing possible server environments.
|
|
19
25
|
*/
|
|
@@ -22,7 +28,7 @@ var ServerEnvironment;
|
|
|
22
28
|
ServerEnvironment["Development"] = "development";
|
|
23
29
|
ServerEnvironment["Staging"] = "staging";
|
|
24
30
|
ServerEnvironment["Production"] = "production";
|
|
25
|
-
})(ServerEnvironment || (ServerEnvironment = {}));
|
|
31
|
+
})(ServerEnvironment || (exports.ServerEnvironment = ServerEnvironment = {}));
|
|
26
32
|
/**
|
|
27
33
|
* The Application class provides a way to configure and manage an Express application.
|
|
28
34
|
* @provide Application
|
|
@@ -46,8 +52,13 @@ let Application = Application_1 = class Application {
|
|
|
46
52
|
/**
|
|
47
53
|
* Perform actions or cleanup after the server is shutdown.
|
|
48
54
|
*/
|
|
49
|
-
serverShutdown() {
|
|
50
|
-
|
|
55
|
+
serverShutdown() { }
|
|
56
|
+
/**
|
|
57
|
+
* Handles process exit by calling serverShutdown and then exiting the process.
|
|
58
|
+
*/
|
|
59
|
+
handleExit() {
|
|
60
|
+
this.serverShutdown();
|
|
61
|
+
process_1.default.exit(0);
|
|
51
62
|
}
|
|
52
63
|
/**
|
|
53
64
|
* Create and configure the Express application.
|
|
@@ -57,7 +68,7 @@ let Application = Application_1 = class Application {
|
|
|
57
68
|
*/
|
|
58
69
|
create(container, middlewares = []) {
|
|
59
70
|
this.configureServices();
|
|
60
|
-
const expressServer = new InversifyExpressServer(container);
|
|
71
|
+
const expressServer = new inversify_express_utils_1.InversifyExpressServer(container);
|
|
61
72
|
expressServer.setConfig((app) => {
|
|
62
73
|
// Detect if a middleware in the array has a body parser. If so, replace the default body parser.
|
|
63
74
|
const hasCustomBodyParser = middlewares.some((middleware) => {
|
|
@@ -67,9 +78,9 @@ let Application = Application_1 = class Application {
|
|
|
67
78
|
});
|
|
68
79
|
if (!hasCustomBodyParser) {
|
|
69
80
|
/* Default body parser application/json */
|
|
70
|
-
app.use(
|
|
81
|
+
app.use(express_1.default.json());
|
|
71
82
|
/* Default body parser application/x-www-form-urlencoded */
|
|
72
|
-
app.use(
|
|
83
|
+
app.use(express_1.default.urlencoded({ extended: true }));
|
|
73
84
|
}
|
|
74
85
|
middlewares.forEach((middleware) => {
|
|
75
86
|
app.use(middleware);
|
|
@@ -77,7 +88,7 @@ let Application = Application_1 = class Application {
|
|
|
77
88
|
});
|
|
78
89
|
this.app = expressServer.build();
|
|
79
90
|
/* Add the error handler middleware */
|
|
80
|
-
this.app.use(
|
|
91
|
+
this.app.use(error_handler_middleware_1.default);
|
|
81
92
|
return this;
|
|
82
93
|
}
|
|
83
94
|
/**
|
|
@@ -90,8 +101,16 @@ let Application = Application_1 = class Application {
|
|
|
90
101
|
this.port = port;
|
|
91
102
|
this.environment = environment;
|
|
92
103
|
this.app.listen(this.port, () => {
|
|
93
|
-
new Console().messageServer(this.port, this.environment, consoleMessage);
|
|
94
|
-
|
|
104
|
+
new console_1.Console().messageServer(this.port, this.environment, consoleMessage);
|
|
105
|
+
[
|
|
106
|
+
"SIGTERM",
|
|
107
|
+
"SIGHUP",
|
|
108
|
+
"SIGBREAK",
|
|
109
|
+
"SIGQUIT",
|
|
110
|
+
"SIGINT",
|
|
111
|
+
].forEach((signal) => {
|
|
112
|
+
process_1.default.on(signal, this.handleExit.bind(this));
|
|
113
|
+
});
|
|
95
114
|
});
|
|
96
115
|
this.postServerInitialization();
|
|
97
116
|
}
|
|
@@ -115,9 +134,10 @@ let Application = Application_1 = class Application {
|
|
|
115
134
|
}
|
|
116
135
|
}
|
|
117
136
|
};
|
|
118
|
-
Application =
|
|
119
|
-
|
|
137
|
+
exports.Application = Application;
|
|
138
|
+
exports.Application = Application = Application_1 = __decorate([
|
|
139
|
+
(0, inversify_binding_decorators_1.provide)(Application_1),
|
|
120
140
|
__metadata("design:paramtypes", [])
|
|
121
141
|
], Application);
|
|
122
142
|
const appServerInstance = new Application();
|
|
123
|
-
|
|
143
|
+
exports.AppInstance = appServerInstance;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppContainer = exports.ServerEnvironment = exports.Application = exports.AppInstance = void 0;
|
|
4
|
+
var application_1 = require("./application");
|
|
5
|
+
Object.defineProperty(exports, "AppInstance", { enumerable: true, get: function () { return application_1.AppInstance; } });
|
|
6
|
+
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_1.Application; } });
|
|
7
|
+
Object.defineProperty(exports, "ServerEnvironment", { enumerable: true, get: function () { return application_1.ServerEnvironment; } });
|
|
8
|
+
var app_container_1 = require("./app-container");
|
|
9
|
+
Object.defineProperty(exports, "AppContainer", { enumerable: true, get: function () { return app_container_1.AppContainer; } });
|
package/lib/esm/common/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
7
11
|
var Console_1;
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Console = void 0;
|
|
14
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
10
16
|
/**
|
|
11
17
|
* Enum representing possible color styles for console output.
|
|
12
18
|
*/
|
|
@@ -31,13 +37,13 @@ let Console = Console_1 = class Console {
|
|
|
31
37
|
async printColor(message, colorStyle) {
|
|
32
38
|
switch (colorStyle) {
|
|
33
39
|
case ColorStyle.Yellow:
|
|
34
|
-
return console.log(
|
|
40
|
+
return console.log(chalk_1.default.bgYellow.black(message));
|
|
35
41
|
case ColorStyle.Blue:
|
|
36
|
-
return console.log(
|
|
42
|
+
return console.log(chalk_1.default.bgBlue.black(message));
|
|
37
43
|
case ColorStyle.Green:
|
|
38
|
-
return console.log(
|
|
44
|
+
return console.log(chalk_1.default.bgGreen.black(message));
|
|
39
45
|
case ColorStyle.Red:
|
|
40
|
-
return console.log(
|
|
46
|
+
return console.log(chalk_1.default.bgRed.black(message));
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
/**
|
|
@@ -46,7 +52,9 @@ let Console = Console_1 = class Console {
|
|
|
46
52
|
* @param environment - The server environment.
|
|
47
53
|
* @param consoleMessage - Optional application message details for console output.
|
|
48
54
|
*/
|
|
49
|
-
async messageServer(
|
|
55
|
+
async messageServer(
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
port, environment, consoleMessage) {
|
|
50
58
|
const appConsoleMessage = {
|
|
51
59
|
appName: consoleMessage?.appName || "Application",
|
|
52
60
|
appVersion: consoleMessage?.appVersion || "not provided",
|
|
@@ -70,7 +78,7 @@ let Console = Console_1 = class Console {
|
|
|
70
78
|
`port ${port} - Environment: ${environment}`, terminalColor);
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
|
-
Console =
|
|
74
|
-
|
|
81
|
+
exports.Console = Console;
|
|
82
|
+
exports.Console = Console = Console_1 = __decorate([
|
|
83
|
+
(0, inversify_binding_decorators_1.provide)(Console_1)
|
|
75
84
|
], Console);
|
|
76
|
-
export { Console };
|
package/lib/esm/console/index.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Console = void 0;
|
|
4
|
+
var console_1 = require("./console");
|
|
5
|
+
Object.defineProperty(exports, "Console", { enumerable: true, get: function () { return console_1.Console; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -5,9 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
};
|
|
7
8
|
var BaseModule_1;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.scope = exports.CreateModule = void 0;
|
|
11
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
12
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
15
|
+
const decorator_1 = require("../decorator");
|
|
11
16
|
/**
|
|
12
17
|
* Key to be used for storing and retrieving binding type metadata.
|
|
13
18
|
*/
|
|
@@ -22,19 +27,20 @@ const scope = (binding) => {
|
|
|
22
27
|
if (!Reflect.hasMetadata(BINDING_TYPE_METADATA_KEY, target)) {
|
|
23
28
|
Reflect.defineMetadata(BINDING_TYPE_METADATA_KEY, binding, target);
|
|
24
29
|
switch (binding) {
|
|
25
|
-
case BindingScopeEnum.Singleton:
|
|
26
|
-
provideSingleton(target);
|
|
30
|
+
case inversify_1.BindingScopeEnum.Singleton:
|
|
31
|
+
(0, decorator_1.provideSingleton)(target);
|
|
27
32
|
break;
|
|
28
|
-
case BindingScopeEnum.Transient:
|
|
29
|
-
provideTransient(target);
|
|
33
|
+
case inversify_1.BindingScopeEnum.Transient:
|
|
34
|
+
(0, decorator_1.provideTransient)(target);
|
|
30
35
|
break;
|
|
31
36
|
default:
|
|
32
|
-
provide(target);
|
|
37
|
+
(0, inversify_binding_decorators_1.provide)(target);
|
|
33
38
|
break;
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
};
|
|
43
|
+
exports.scope = scope;
|
|
38
44
|
/**
|
|
39
45
|
* The BaseModule class provides methods for creating InversifyJS container modules.
|
|
40
46
|
* @provide BaseModule
|
|
@@ -62,17 +68,17 @@ let BaseModule = BaseModule_1 = class BaseModule {
|
|
|
62
68
|
*/
|
|
63
69
|
static createContainerModule(controllers, scope) {
|
|
64
70
|
const symbols = BaseModule_1.createSymbols(controllers);
|
|
65
|
-
return new ContainerModule((bind) => {
|
|
71
|
+
return new inversify_1.ContainerModule((bind) => {
|
|
66
72
|
for (const [symbol, target] of symbols) {
|
|
67
73
|
if (scope) {
|
|
68
74
|
switch (scope) {
|
|
69
|
-
case BindingScopeEnum.Singleton:
|
|
75
|
+
case inversify_1.BindingScopeEnum.Singleton:
|
|
70
76
|
bind(symbol).to(target).inSingletonScope();
|
|
71
77
|
break;
|
|
72
|
-
case BindingScopeEnum.Transient:
|
|
78
|
+
case inversify_1.BindingScopeEnum.Transient:
|
|
73
79
|
bind(symbol).to(target).inTransientScope();
|
|
74
80
|
break;
|
|
75
|
-
case BindingScopeEnum.Request:
|
|
81
|
+
case inversify_1.BindingScopeEnum.Request:
|
|
76
82
|
bind(symbol).to(target).inRequestScope();
|
|
77
83
|
break;
|
|
78
84
|
}
|
|
@@ -80,13 +86,13 @@ let BaseModule = BaseModule_1 = class BaseModule {
|
|
|
80
86
|
else {
|
|
81
87
|
const bindingType = Reflect.getMetadata(BINDING_TYPE_METADATA_KEY, target);
|
|
82
88
|
switch (bindingType) {
|
|
83
|
-
case BindingScopeEnum.Singleton:
|
|
89
|
+
case inversify_1.BindingScopeEnum.Singleton:
|
|
84
90
|
bind(symbol).to(target).inSingletonScope();
|
|
85
91
|
break;
|
|
86
|
-
case BindingScopeEnum.Transient:
|
|
92
|
+
case inversify_1.BindingScopeEnum.Transient:
|
|
87
93
|
bind(symbol).to(target).inTransientScope();
|
|
88
94
|
break;
|
|
89
|
-
case BindingScopeEnum.Request:
|
|
95
|
+
case inversify_1.BindingScopeEnum.Request:
|
|
90
96
|
bind(symbol).to(target).inRequestScope();
|
|
91
97
|
break;
|
|
92
98
|
default:
|
|
@@ -99,7 +105,7 @@ let BaseModule = BaseModule_1 = class BaseModule {
|
|
|
99
105
|
}
|
|
100
106
|
};
|
|
101
107
|
BaseModule = BaseModule_1 = __decorate([
|
|
102
|
-
provide(BaseModule_1)
|
|
108
|
+
(0, inversify_binding_decorators_1.provide)(BaseModule_1)
|
|
103
109
|
], BaseModule);
|
|
104
110
|
const CreateModule = BaseModule.createContainerModule;
|
|
105
|
-
|
|
111
|
+
exports.CreateModule = CreateModule;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scope = exports.CreateModule = void 0;
|
|
4
|
+
var container_module_1 = require("./container-module");
|
|
5
|
+
Object.defineProperty(exports, "CreateModule", { enumerable: true, get: function () { return container_module_1.CreateModule; } });
|
|
6
|
+
Object.defineProperty(exports, "scope", { enumerable: true, get: function () { return container_module_1.scope; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,8 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
10
|
};
|
|
10
11
|
var BaseController_1;
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.BaseController = void 0;
|
|
14
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
15
|
+
const logger_1 = require("../logger");
|
|
13
16
|
/**
|
|
14
17
|
* The BaseController class is an abstract base class for controllers.
|
|
15
18
|
* It provides methods for handling use case calls and sending appropriate responses.
|
|
@@ -71,7 +74,7 @@ let BaseController = BaseController_1 = class BaseController {
|
|
|
71
74
|
return new Promise((resolve, reject) => {
|
|
72
75
|
res.render(template, options, (err, compiled) => {
|
|
73
76
|
if (err) {
|
|
74
|
-
log(LogLevel.Error, err.message, "base-controller");
|
|
77
|
+
(0, logger_1.log)(logger_1.LogLevel.Error, err.message, "base-controller");
|
|
75
78
|
reject(err);
|
|
76
79
|
}
|
|
77
80
|
resolve(compiled);
|
|
@@ -79,8 +82,8 @@ let BaseController = BaseController_1 = class BaseController {
|
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
84
|
};
|
|
82
|
-
BaseController =
|
|
83
|
-
|
|
85
|
+
exports.BaseController = BaseController;
|
|
86
|
+
exports.BaseController = BaseController = BaseController_1 = __decorate([
|
|
87
|
+
(0, inversify_binding_decorators_1.provide)(BaseController_1),
|
|
84
88
|
__metadata("design:paramtypes", [String])
|
|
85
89
|
], BaseController);
|
|
86
|
-
export { BaseController };
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseController = void 0;
|
|
4
|
+
var base_controller_1 = require("./base-controller");
|
|
5
|
+
Object.defineProperty(exports, "BaseController", { enumerable: true, get: function () { return base_controller_1.BaseController; } });
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./scope-binding"), exports);
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.provideTransient = exports.provideSingleton = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
2
7
|
const provideSingleton = (identifier) => {
|
|
3
|
-
return fluentProvide(identifier).inSingletonScope().done();
|
|
8
|
+
return (0, inversify_binding_decorators_1.fluentProvide)(identifier).inSingletonScope().done();
|
|
4
9
|
};
|
|
10
|
+
exports.provideSingleton = provideSingleton;
|
|
5
11
|
const provideTransient = (identifier) => {
|
|
6
|
-
return fluentProvide(identifier).inTransientScope().done();
|
|
12
|
+
return (0, inversify_binding_decorators_1.fluentProvide)(identifier).inTransientScope().done();
|
|
7
13
|
};
|
|
8
|
-
|
|
14
|
+
exports.provideTransient = provideTransient;
|