nestjs-backend-common 0.0.2 → 0.0.4
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/dist/jest-setup-after-env.js +38 -0
- package/dist/jest-setup-after-env.js.map +1 -0
- package/dist/jest.config.js +10 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/src/correlation-id/correlation-id.constant.js +6 -0
- package/dist/src/correlation-id/correlation-id.constant.js.map +1 -0
- package/dist/src/correlation-id/correlation-id.interceptor.js +63 -0
- package/dist/src/correlation-id/correlation-id.interceptor.js.map +1 -0
- package/dist/src/correlation-id/correlation-id.module.d.ts +1 -1
- package/dist/src/correlation-id/correlation-id.module.d.ts.map +1 -1
- package/dist/src/correlation-id/correlation-id.module.js +37 -0
- package/dist/src/correlation-id/correlation-id.module.js.map +1 -0
- package/dist/src/correlation-id/correlation-id.service.js +28 -0
- package/dist/src/correlation-id/correlation-id.service.js.map +1 -0
- package/dist/src/correlation-id/correlation-id.type.js +3 -0
- package/dist/src/correlation-id/correlation-id.type.js.map +1 -0
- package/dist/src/correlation-id/index.js +21 -0
- package/dist/src/correlation-id/index.js.map +1 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/index.js +3 -0
- package/dist/src/types/index.js.map +1 -0
- package/package.json +1 -1
- package/src/correlation-id/correlation-id.module.ts +3 -1
- package/tsconfig.build.json +1 -2
|
@@ -0,0 +1,38 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const matchers = __importStar(require("jest-extended"));
|
|
37
|
+
expect.extend(matchers);
|
|
38
|
+
//# sourceMappingURL=jest-setup-after-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest-setup-after-env.js","sourceRoot":"","sources":["../jest-setup-after-env.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA0C;AAE1C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
testEnvironment: 'node',
|
|
5
|
+
transform: {
|
|
6
|
+
'^.+.tsx?$': ['ts-jest', {}],
|
|
7
|
+
},
|
|
8
|
+
setupFilesAfterEnv: ['./jest-setup-after-env.ts'],
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=jest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACb,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE;QACT,WAAW,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;KAC7B;IACD,kBAAkB,EAAE,CAAC,2BAA2B,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CORRELATION_ID_CLS_KEY = exports.CORRELATION_ID_HEADER_NAME = void 0;
|
|
4
|
+
exports.CORRELATION_ID_HEADER_NAME = 'correlation-id';
|
|
5
|
+
exports.CORRELATION_ID_CLS_KEY = 'CORRELATION_ID_CLS_KEY';
|
|
6
|
+
//# sourceMappingURL=correlation-id.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.constant.js","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,gBAAgB,CAAC;AAC9C,QAAA,sBAAsB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var CorrelationIdInterceptor_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CorrelationIdInterceptor = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
13
|
+
const crypto_1 = require("crypto");
|
|
14
|
+
const correlation_id_constant_1 = require("./correlation-id.constant");
|
|
15
|
+
let CorrelationIdInterceptor = CorrelationIdInterceptor_1 = class CorrelationIdInterceptor {
|
|
16
|
+
clsService;
|
|
17
|
+
logger = new common_1.Logger(CorrelationIdInterceptor_1.name);
|
|
18
|
+
constructor(clsService) {
|
|
19
|
+
this.clsService = clsService;
|
|
20
|
+
}
|
|
21
|
+
intercept(executionContext, next) {
|
|
22
|
+
let correlationId;
|
|
23
|
+
switch (executionContext.getType()) {
|
|
24
|
+
case 'http': {
|
|
25
|
+
const request = executionContext
|
|
26
|
+
.switchToHttp()
|
|
27
|
+
.getRequest();
|
|
28
|
+
const correlationIdHeader = request.headers[correlation_id_constant_1.CORRELATION_ID_HEADER_NAME];
|
|
29
|
+
const correlationIdValue = Array.isArray(correlationIdHeader)
|
|
30
|
+
? correlationIdHeader[0]
|
|
31
|
+
: correlationIdHeader;
|
|
32
|
+
correlationId = correlationIdValue ?? (0, crypto_1.randomUUID)();
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case 'graphql': {
|
|
36
|
+
const ctx = graphql_1.GqlExecutionContext.create(executionContext);
|
|
37
|
+
const request = ctx.getContext().req;
|
|
38
|
+
const correlationIdHeader = request.headers[correlation_id_constant_1.CORRELATION_ID_HEADER_NAME];
|
|
39
|
+
const correlationIdValue = Array.isArray(correlationIdHeader)
|
|
40
|
+
? correlationIdHeader[0]
|
|
41
|
+
: correlationIdHeader;
|
|
42
|
+
correlationId = correlationIdValue ?? (0, crypto_1.randomUUID)();
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'rpc': {
|
|
46
|
+
const { correlationId: correlationIdValue } = executionContext
|
|
47
|
+
.switchToRpc()
|
|
48
|
+
.getContext();
|
|
49
|
+
correlationId = correlationIdValue ?? (0, crypto_1.randomUUID)();
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
default:
|
|
53
|
+
throw new Error('Unimplemented request type');
|
|
54
|
+
}
|
|
55
|
+
this.clsService.set(correlation_id_constant_1.CORRELATION_ID_CLS_KEY, correlationId);
|
|
56
|
+
return next.handle();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.CorrelationIdInterceptor = CorrelationIdInterceptor;
|
|
60
|
+
exports.CorrelationIdInterceptor = CorrelationIdInterceptor = CorrelationIdInterceptor_1 = __decorate([
|
|
61
|
+
(0, common_1.Injectable)()
|
|
62
|
+
], CorrelationIdInterceptor);
|
|
63
|
+
//# sourceMappingURL=correlation-id.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.interceptor.js","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;AAGA,2CAMwB;AACxB,6CAAsD;AACtD,mCAAoC;AAIpC,uEAGmC;AAG5B,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAGN;IAFrB,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;IAE3D,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEvD,SAAS,CACP,gBAAkC,EAClC,IAAiB;QAEjB,IAAI,aAAqB,CAAC;QAE1B,QAAQ,gBAAgB,CAAC,OAAO,EAA0B,EAAE,CAAC;YAC3D,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,OAAO,GAAY,gBAAgB;qBACtC,YAAY,EAAE;qBACd,UAAU,EAAE,CAAC;gBAChB,MAAM,mBAAmB,GACvB,OAAO,CAAC,OAAO,CAAC,oDAA0B,CAAC,CAAC;gBAC9C,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC;oBAC3D,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;oBACxB,CAAC,CAAC,mBAAmB,CAAC;gBAExB,aAAa,GAAG,kBAAkB,IAAI,IAAA,mBAAU,GAAE,CAAC;gBAEnD,MAAM;YACR,CAAC;YACD,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,MAAM,GAAG,GAAG,6BAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;gBACzD,MAAM,OAAO,GAAY,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC;gBAC9C,MAAM,mBAAmB,GACvB,OAAO,CAAC,OAAO,CAAC,oDAA0B,CAAC,CAAC;gBAC9C,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC;oBAC3D,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;oBACxB,CAAC,CAAC,mBAAmB,CAAC;gBAExB,aAAa,GAAG,kBAAkB,IAAI,IAAA,mBAAU,GAAE,CAAC;gBAEnD,MAAM;YACR,CAAC;YACD,KAAK,KAAK,CAAC,CAAC,CAAC;gBACX,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,gBAAgB;qBAC3D,WAAW,EAAE;qBACb,UAAU,EAA8B,CAAC;gBAE5C,aAAa,GAAG,kBAAkB,IAAI,IAAA,mBAAU,GAAE,CAAC;gBAEnD,MAAM;YACR,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,gDAAsB,EAAE,aAAa,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AAxDY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;GACA,wBAAwB,CAwDpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { CorrelationIdModuleOptions } from './correlation-id.type';
|
|
3
3
|
export declare class CorrelationIdModule {
|
|
4
|
-
forRoot(options?: CorrelationIdModuleOptions): DynamicModule;
|
|
4
|
+
static forRoot(options?: CorrelationIdModuleOptions): DynamicModule;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=correlation-id.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlation-id.module.d.ts","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAMvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,qBACa,mBAAmB;IAC9B,
|
|
1
|
+
{"version":3,"file":"correlation-id.module.d.ts","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAMvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,qBACa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CACZ,OAAO,CAAC,EAAE,0BAA0B,GACnC,aAAa;CAejB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var CorrelationIdModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CorrelationIdModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const core_1 = require("@nestjs/core");
|
|
13
|
+
const nestjs_cls_1 = require("nestjs-cls");
|
|
14
|
+
const correlation_id_interceptor_1 = require("./correlation-id.interceptor");
|
|
15
|
+
const correlation_id_service_1 = require("./correlation-id.service");
|
|
16
|
+
let CorrelationIdModule = CorrelationIdModule_1 = class CorrelationIdModule {
|
|
17
|
+
static forRoot(options) {
|
|
18
|
+
return {
|
|
19
|
+
global: options?.isGlobal ?? false,
|
|
20
|
+
module: CorrelationIdModule_1,
|
|
21
|
+
imports: [nestjs_cls_1.ClsModule],
|
|
22
|
+
providers: [
|
|
23
|
+
{
|
|
24
|
+
provide: core_1.APP_INTERCEPTOR,
|
|
25
|
+
useClass: correlation_id_interceptor_1.CorrelationIdInterceptor,
|
|
26
|
+
},
|
|
27
|
+
correlation_id_service_1.CorrelationIdService,
|
|
28
|
+
],
|
|
29
|
+
exports: [correlation_id_service_1.CorrelationIdService],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.CorrelationIdModule = CorrelationIdModule;
|
|
34
|
+
exports.CorrelationIdModule = CorrelationIdModule = CorrelationIdModule_1 = __decorate([
|
|
35
|
+
(0, common_1.Module)({})
|
|
36
|
+
], CorrelationIdModule);
|
|
37
|
+
//# sourceMappingURL=correlation-id.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.module.js","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,uCAA+C;AAC/C,2CAAuC;AAEvC,6EAAwE;AACxE,qEAAgE;AAIzD,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CACZ,OAAoC;QAEpC,OAAO;YACL,MAAM,EAAE,OAAO,EAAE,QAAQ,IAAI,KAAK;YAClC,MAAM,EAAE,qBAAmB;YAC3B,OAAO,EAAE,CAAC,sBAAS,CAAC;YACpB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,sBAAe;oBACxB,QAAQ,EAAE,qDAAwB;iBACnC;gBACD,6CAAoB;aACrB;YACD,OAAO,EAAE,CAAC,6CAAoB,CAAC;SAChC,CAAC;IACJ,CAAC;CACF,CAAA;AAlBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,mBAAmB,CAkB/B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var CorrelationIdService_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CorrelationIdService = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const correlation_id_constant_1 = require("./correlation-id.constant");
|
|
14
|
+
let CorrelationIdService = CorrelationIdService_1 = class CorrelationIdService {
|
|
15
|
+
clsService;
|
|
16
|
+
logger = new common_1.Logger(CorrelationIdService_1.name);
|
|
17
|
+
constructor(clsService) {
|
|
18
|
+
this.clsService = clsService;
|
|
19
|
+
}
|
|
20
|
+
get correlationId() {
|
|
21
|
+
return (this.clsService.get(correlation_id_constant_1.CORRELATION_ID_CLS_KEY) ?? (0, crypto_1.randomUUID)());
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.CorrelationIdService = CorrelationIdService;
|
|
25
|
+
exports.CorrelationIdService = CorrelationIdService = CorrelationIdService_1 = __decorate([
|
|
26
|
+
(0, common_1.Injectable)()
|
|
27
|
+
], CorrelationIdService);
|
|
28
|
+
//# sourceMappingURL=correlation-id.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.service.js","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAoD;AACpD,mCAAoC;AAGpC,uEAAmE;AAG5D,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAGF;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAEvD,IAAI,aAAa;QACf,OAAO,CACL,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,gDAAsB,CAAC,IAAI,IAAA,mBAAU,GAAE,CAC5D,CAAC;IACJ,CAAC;CACF,CAAA;AAVY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CAUhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation-id.type.js","sourceRoot":"","sources":["../../../src/correlation-id/correlation-id.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./correlation-id.constant"), exports);
|
|
18
|
+
__exportStar(require("./correlation-id.module"), exports);
|
|
19
|
+
__exportStar(require("./correlation-id.service"), exports);
|
|
20
|
+
__exportStar(require("./correlation-id.type"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/correlation-id/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,0DAAwC;AACxC,2DAAyC;AACzC,wDAAsC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./correlation-id"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -8,7 +8,9 @@ import { CorrelationIdModuleOptions } from './correlation-id.type';
|
|
|
8
8
|
|
|
9
9
|
@Module({})
|
|
10
10
|
export class CorrelationIdModule {
|
|
11
|
-
forRoot(
|
|
11
|
+
static forRoot(
|
|
12
|
+
options?: CorrelationIdModuleOptions,
|
|
13
|
+
): DynamicModule {
|
|
12
14
|
return {
|
|
13
15
|
global: options?.isGlobal ?? false,
|
|
14
16
|
module: CorrelationIdModule,
|