@hg-ts/http-controller 0.2.13 → 0.2.15

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,3 +1,9 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ type HttpControllerModuleOptions = {
3
+ disableTransactions?: boolean;
4
+ };
1
5
  export declare class HttpControllerModule {
6
+ static forRoot(options?: HttpControllerModuleOptions): DynamicModule;
2
7
  }
8
+ export {};
3
9
  //# sourceMappingURL=http-controller.module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-controller.module.d.ts","sourceRoot":"","sources":["../src/http-controller.module.ts"],"names":[],"mappings":"AAaA,qBAiBa,oBAAoB;CAAG"}
1
+ {"version":3,"file":"http-controller.module.d.ts","sourceRoot":"","sources":["../src/http-controller.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EAEb,MAAM,gBAAgB,CAAC;AAaxB,KAAK,2BAA2B,GAAG;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,qBAaa,oBAAoB;WAClB,OAAO,CAAC,OAAO,GAAE,2BAAgC,GAAG,aAAa;CAc/E"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var HttpControllerModule_1;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.HttpControllerModule = void 0;
4
5
  const tslib_1 = require("tslib");
@@ -6,10 +7,24 @@ const common_1 = require("@nestjs/common");
6
7
  const core_1 = require("@nestjs/core");
7
8
  const middlewares_1 = require("./middlewares");
8
9
  const services_1 = require("./services");
9
- let HttpControllerModule = class HttpControllerModule {
10
+ let HttpControllerModule = HttpControllerModule_1 = class HttpControllerModule {
11
+ static forRoot(options = {}) {
12
+ const { disableTransactions = false } = options;
13
+ return {
14
+ module: HttpControllerModule_1,
15
+ providers: disableTransactions
16
+ ? []
17
+ : [
18
+ {
19
+ provide: core_1.APP_INTERCEPTOR,
20
+ useClass: middlewares_1.DatabaseInterceptor,
21
+ },
22
+ ],
23
+ };
24
+ }
10
25
  };
11
26
  exports.HttpControllerModule = HttpControllerModule;
12
- exports.HttpControllerModule = HttpControllerModule = tslib_1.__decorate([
27
+ exports.HttpControllerModule = HttpControllerModule = HttpControllerModule_1 = tslib_1.__decorate([
13
28
  (0, common_1.Module)({
14
29
  providers: [
15
30
  services_1.SwaggerService,
@@ -17,10 +32,6 @@ exports.HttpControllerModule = HttpControllerModule = tslib_1.__decorate([
17
32
  provide: core_1.APP_INTERCEPTOR,
18
33
  useClass: middlewares_1.ExceptionMapperInterceptor,
19
34
  },
20
- {
21
- provide: core_1.APP_INTERCEPTOR,
22
- useClass: middlewares_1.DatabaseInterceptor,
23
- },
24
35
  {
25
36
  provide: core_1.APP_PIPE,
26
37
  useClass: middlewares_1.ValidationPipe,
@@ -1 +1 @@
1
- {"version":3,"file":"http-controller.module.js","sourceRoot":"","sources":["../src/http-controller.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,uCAGsB;AACtB,+CAIuB;AAEvB,yCAA4C;AAmBrC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IAjBhC,IAAA,eAAM,EAAC;QACP,SAAS,EAAE;YACV,yBAAc;YACd;gBACC,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,wCAA0B;aACpC;YACD;gBACC,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,iCAAmB;aAC7B;YACD;gBACC,OAAO,EAAE,eAAQ;gBACjB,QAAQ,EAAE,4BAAc;aACxB;SACD;KACD,CAAC;GACW,oBAAoB,CAAG"}
1
+ {"version":3,"file":"http-controller.module.js","sourceRoot":"","sources":["../src/http-controller.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAGwB;AACxB,uCAGsB;AACtB,+CAIuB;AAEvB,yCAA4C;AAmBrC,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IACzB,MAAM,CAAC,OAAO,CAAC,UAAuC,EAAE;QAC9D,MAAM,EAAE,mBAAmB,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAChD,OAAO;YACN,MAAM,EAAE,sBAAoB;YAC5B,SAAS,EAAE,mBAAmB;gBAC7B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACD;wBACC,OAAO,EAAE,sBAAe;wBACxB,QAAQ,EAAE,iCAAmB;qBAC7B;iBACD;SACF,CAAC;IACH,CAAC;CACD,CAAA;AAfY,oDAAoB;+BAApB,oBAAoB;IAbhC,IAAA,eAAM,EAAC;QACP,SAAS,EAAE;YACV,yBAAc;YACd;gBACC,OAAO,EAAE,sBAAe;gBACxB,QAAQ,EAAE,wCAA0B;aACpC;YACD;gBACC,OAAO,EAAE,eAAQ;gBACjB,QAAQ,EAAE,4BAAc;aACxB;SACD;KACD,CAAC;GACW,oBAAoB,CAehC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hg-ts/http-controller",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"
@@ -17,15 +17,15 @@
17
17
  "test:dev": "yarn build:dev --onSuccess \"yarn test\""
18
18
  },
19
19
  "devDependencies": {
20
- "@hg-ts-config/typescript": "0.2.13",
21
- "@hg-ts/exception": "0.2.13",
22
- "@hg-ts/execution-mode": "0.2.13",
23
- "@hg-ts/knex": "0.2.13",
24
- "@hg-ts/linter": "0.2.13",
25
- "@hg-ts/logger": "0.2.13",
26
- "@hg-ts/tests": "0.2.13",
27
- "@hg-ts/types": "0.2.13",
28
- "@hg-ts/validation": "0.2.13",
20
+ "@hg-ts-config/typescript": "0.2.15",
21
+ "@hg-ts/exception": "0.2.15",
22
+ "@hg-ts/execution-mode": "0.2.15",
23
+ "@hg-ts/knex": "0.2.15",
24
+ "@hg-ts/linter": "0.2.15",
25
+ "@hg-ts/logger": "0.2.15",
26
+ "@hg-ts/tests": "0.2.15",
27
+ "@hg-ts/types": "0.2.15",
28
+ "@hg-ts/validation": "0.2.15",
29
29
  "@nestjs/common": "11.1.0",
30
30
  "@nestjs/core": "11.1.0",
31
31
  "@nestjs/platform-fastify": "11.1.0",
@@ -44,11 +44,11 @@
44
44
  "typescript": "5.7.3"
45
45
  },
46
46
  "peerDependencies": {
47
- "@hg-ts/exception": "0.2.13",
48
- "@hg-ts/execution-mode": "0.2.13",
49
- "@hg-ts/knex": "0.2.13",
50
- "@hg-ts/logger": "0.2.13",
51
- "@hg-ts/validation": "0.2.13",
47
+ "@hg-ts/exception": "0.2.15",
48
+ "@hg-ts/execution-mode": "0.2.15",
49
+ "@hg-ts/knex": "0.2.15",
50
+ "@hg-ts/logger": "0.2.15",
51
+ "@hg-ts/validation": "0.2.15",
52
52
  "@nestjs/common": "*",
53
53
  "@nestjs/core": "*",
54
54
  "@nestjs/platform-fastify": "*",