@lark-apaas/nestjs-logger 1.0.3-alpha.3 → 1.0.3-alpha.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/index.js CHANGED
@@ -2357,20 +2357,20 @@ var require_Observable = __commonJS({
2357
2357
  var config_1 = require_config();
2358
2358
  var isFunction_1 = require_isFunction2();
2359
2359
  var errorContext_1 = require_errorContext();
2360
- var Observable = (function() {
2361
- function Observable2(subscribe) {
2360
+ var Observable2 = (function() {
2361
+ function Observable3(subscribe) {
2362
2362
  if (subscribe) {
2363
2363
  this._subscribe = subscribe;
2364
2364
  }
2365
2365
  }
2366
- __name(Observable2, "Observable");
2367
- Observable2.prototype.lift = function(operator) {
2368
- var observable = new Observable2();
2366
+ __name(Observable3, "Observable");
2367
+ Observable3.prototype.lift = function(operator) {
2368
+ var observable = new Observable3();
2369
2369
  observable.source = this;
2370
2370
  observable.operator = operator;
2371
2371
  return observable;
2372
2372
  };
2373
- Observable2.prototype.subscribe = function(observerOrNext, error, complete) {
2373
+ Observable3.prototype.subscribe = function(observerOrNext, error, complete) {
2374
2374
  var _this = this;
2375
2375
  var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new Subscriber_1.SafeSubscriber(observerOrNext, error, complete);
2376
2376
  errorContext_1.errorContext(function() {
@@ -2379,14 +2379,14 @@ var require_Observable = __commonJS({
2379
2379
  });
2380
2380
  return subscriber;
2381
2381
  };
2382
- Observable2.prototype._trySubscribe = function(sink) {
2382
+ Observable3.prototype._trySubscribe = function(sink) {
2383
2383
  try {
2384
2384
  return this._subscribe(sink);
2385
2385
  } catch (err) {
2386
2386
  sink.error(err);
2387
2387
  }
2388
2388
  };
2389
- Observable2.prototype.forEach = function(next, promiseCtor) {
2389
+ Observable3.prototype.forEach = function(next, promiseCtor) {
2390
2390
  var _this = this;
2391
2391
  promiseCtor = getPromiseCtor(promiseCtor);
2392
2392
  return new promiseCtor(function(resolve, reject) {
@@ -2405,21 +2405,21 @@ var require_Observable = __commonJS({
2405
2405
  _this.subscribe(subscriber);
2406
2406
  });
2407
2407
  };
2408
- Observable2.prototype._subscribe = function(subscriber) {
2408
+ Observable3.prototype._subscribe = function(subscriber) {
2409
2409
  var _a;
2410
2410
  return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
2411
2411
  };
2412
- Observable2.prototype[observable_1.observable] = function() {
2412
+ Observable3.prototype[observable_1.observable] = function() {
2413
2413
  return this;
2414
2414
  };
2415
- Observable2.prototype.pipe = function() {
2415
+ Observable3.prototype.pipe = function() {
2416
2416
  var operations = [];
2417
2417
  for (var _i = 0; _i < arguments.length; _i++) {
2418
2418
  operations[_i] = arguments[_i];
2419
2419
  }
2420
2420
  return pipe_1.pipeFromArray(operations)(this);
2421
2421
  };
2422
- Observable2.prototype.toPromise = function(promiseCtor) {
2422
+ Observable3.prototype.toPromise = function(promiseCtor) {
2423
2423
  var _this = this;
2424
2424
  promiseCtor = getPromiseCtor(promiseCtor);
2425
2425
  return new promiseCtor(function(resolve, reject) {
@@ -2433,12 +2433,12 @@ var require_Observable = __commonJS({
2433
2433
  });
2434
2434
  });
2435
2435
  };
2436
- Observable2.create = function(subscribe) {
2437
- return new Observable2(subscribe);
2436
+ Observable3.create = function(subscribe) {
2437
+ return new Observable3(subscribe);
2438
2438
  };
2439
- return Observable2;
2439
+ return Observable3;
2440
2440
  })();
2441
- exports.Observable = Observable;
2441
+ exports.Observable = Observable2;
2442
2442
  function getPromiseCtor(promiseCtor) {
2443
2443
  var _a;
2444
2444
  return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config_1.config.Promise) !== null && _a !== void 0 ? _a : Promise;
@@ -14738,6 +14738,7 @@ var import_config3 = __toESM(require_config2(), 1);
14738
14738
  import { Global, Module } from "@nestjs/common";
14739
14739
  import { APP_INTERCEPTOR } from "@nestjs/core";
14740
14740
  import { OBSERVABLE_SERVICE as OBSERVABLE_SERVICE2, RequestContextService as RequestContextService4, CommonModule } from "@lark-apaas/nestjs-common";
14741
+ import { Observable } from "@lark-apaas/nestjs-observable";
14741
14742
 
14742
14743
  // src/config/logger.config.ts
14743
14744
  var import_config = __toESM(require_config2(), 1);
@@ -15052,6 +15053,23 @@ function _ts_decorate4(decorators, target, key, desc) {
15052
15053
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15053
15054
  }
15054
15055
  __name(_ts_decorate4, "_ts_decorate");
15056
+ var ObservableServiceProvider = {
15057
+ provide: OBSERVABLE_SERVICE2,
15058
+ inject: [
15059
+ RequestContextService4,
15060
+ {
15061
+ token: OBSERVABLE_SERVICE2,
15062
+ optional: true
15063
+ }
15064
+ ],
15065
+ useFactory: /* @__PURE__ */ __name((parentInstance, reqCtx) => {
15066
+ console.log("csh parentInstance", parentInstance);
15067
+ if (parentInstance) {
15068
+ return parentInstance;
15069
+ }
15070
+ return new Observable(reqCtx);
15071
+ }, "useFactory")
15072
+ };
15055
15073
  var LoggerModule = class {
15056
15074
  static {
15057
15075
  __name(this, "LoggerModule");
@@ -15066,6 +15084,11 @@ LoggerModule = _ts_decorate4([
15066
15084
  ],
15067
15085
  providers: [
15068
15086
  LoggerContextMiddleware,
15087
+ ObservableServiceProvider,
15088
+ {
15089
+ provide: OBSERVABLE_SERVICE2,
15090
+ useClass: Observable
15091
+ },
15069
15092
  {
15070
15093
  provide: PINO_ROOT_LOGGER,
15071
15094
  useFactory: /* @__PURE__ */ __name((config) => {