starta.microservice 0.1.5016 → 0.1.5220

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,10 +0,0 @@
1
- import ServerLogger from '../adapters/logger';
2
- declare class ExecutionContext {
3
- private asyncLocalStorage;
4
- setLogger(logger: ServerLogger): ServerLogger;
5
- getLogger(): ServerLogger;
6
- private getContextValue;
7
- private ensureStore;
8
- }
9
- declare const _default: ExecutionContext;
10
- export default _default;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const async_hooks_1 = require("async_hooks");
7
- const logger_1 = __importDefault(require("../adapters/logger"));
8
- class ExecutionContext {
9
- constructor() {
10
- this.asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
11
- }
12
- setLogger(logger) {
13
- const store = this.ensureStore();
14
- store.set('logger', logger);
15
- return logger;
16
- }
17
- getLogger() {
18
- return this.getContextValue('logger')
19
- ?? this.setLogger(new logger_1.default());
20
- }
21
- getContextValue(key) {
22
- const store = this.asyncLocalStorage.getStore();
23
- return store ? store.get(key) : undefined;
24
- }
25
- ensureStore() {
26
- let store = this.asyncLocalStorage.getStore();
27
- if (!store) {
28
- store = new Map();
29
- this.asyncLocalStorage.enterWith(store);
30
- }
31
- return store;
32
- }
33
- }
34
- exports.default = new ExecutionContext();
35
- //# sourceMappingURL=loggerContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loggerContext.js","sourceRoot":"","sources":["../../src/contexts/loggerContext.ts"],"names":[],"mappings":";;;;;AAAA,6CAAgD;AAChD,gEAA8C;AAE9C,MAAM,gBAAgB;IAAtB;QACU,sBAAiB,GAAG,IAAI,+BAAiB,EAAoB,CAAC;IA0BxE,CAAC;IAxBC,SAAS,CAAC,MAAoB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;eAChC,IAAI,CAAC,SAAS,CAAC,IAAI,gBAAY,EAAE,CAAC,CAAC;IAC1C,CAAC;IAEO,eAAe,CAAI,GAAa;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,CAAC;IAEO,WAAW;QACjB,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;QAC9C,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,IAAI,GAAG,EAAe,CAAC;YAC/B,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACzC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,kBAAe,IAAI,gBAAgB,EAAE,CAAC"}