@bymax-one/nest-logger 1.4.29 → 1.4.30

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/CHANGELOG.md CHANGED
@@ -12,6 +12,98 @@ heading here.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ## [1.4.30] - 2026-11-24
16
+
17
+ ### Breaking
18
+
19
+ - **`LoggerHealthIndicator.check()` answers a frozen verdict.** The result and its `details` are
20
+ frozen, so code that adds or changes a field on the result that `check()` resolves to throws a `TypeError` in strict
21
+ mode (and drops the write silently in sloppy mode). Migration: copy before you mutate, for example
22
+ `const verdict = { ...result, details: { ...result.details } }`, and change the copy.
23
+ The result also has no prototype, so `result.hasOwnProperty(...)` and a template string of it throw
24
+ a `TypeError`, and `assert.deepStrictEqual` against a plain object fails; the same spread copy is a
25
+ plain object, so compare or call methods on the copy. `details` is an ordinary frozen object.
26
+
27
+ ### Fixed
28
+
29
+ - **A replaced `Promise.resolve`, a replaced `Promise.prototype.constructor` and a `then` planted on a
30
+ prototype root no longer decide what the logger awaits, in the cases measured here.** Measured: with `Promise.resolve` replaced after
31
+ the import, the health indicator answered `up` for a delivery with no healthy sink, `withTimeout` settled a
32
+ hook that had rejected, a failed destination write was not recorded for readiness, and a late rejection of a
33
+ tenant resolver reached the process. The sites no longer read a static of `Promise`: a promise the
34
+ library builds comes from the intrinsic constructor (taken from an async function, so a `globalThis.Promise`
35
+ set before the load is not it), a wait is an `await`, and the outcome of a wait is a box with no prototype.
36
+ Before each `await` that feeds a verdict the baseline is asserted, with no call of the host between the
37
+ check and the wait: `Promise.prototype.constructor` is the intrinsic one and no `then` sits on
38
+ `Object.prototype`, `Array.prototype` or `Function.prototype`. A failed assertion refuses the verdict: a
39
+ hook is reported as failed, a write is recorded as failed and reported on stderr. A `then` of
40
+ `Promise.prototype` that a runtime wraps (a context manager) is allowed. `withTimeout` now resolves with
41
+ nothing. A source scan fails for a new read of a static, a
42
+ `new Promise`, `.then(`, `.catch(` or `.finally(` in `src`.
43
+ A native promise a hook or a destination returns is waited for through the intrinsic constructor, for the
44
+ length of one synchronous call, and is refused when it already carries its own `constructor` or `then`
45
+ or cannot take that slot.
46
+ Known limits: a frozen, sealed or non-extensible native promise cannot take a handler under a replaced
47
+ `Promise.prototype.constructor` whose species throws, so a rejection of it can reach the process (a
48
+ waited-for promise of that shape is refused instead); while a rejection is absorbed, the temporary
49
+ `constructor` of the promise can stay if a species getter makes it non-configurable inside that window;
50
+ code running concurrently that plants a `then` and erases it again between the check and the
51
+ work's own settlement cannot be seen afterwards, and a dependency that reads a static inside itself is code
52
+ aimed at that dependency, not at the logger. Code that replaces the `constructor` of `Promise.prototype`
53
+ before this package is loaded is not detected either: the intrinsic is read from that slot at load, so
54
+ the baseline is the replacement. These guards are best-effort hardening, not a security
55
+ boundary: code running inside the host process is trusted (SECURITY.md, "Threat model: same-process
56
+ code"). A descriptor read by these guards, and by the `toJSON` lookup outside `errorOwnFields: 'safe'` and the options filter, is read for
57
+ its own `get` and `value` only, so a field planted on `Object.prototype` is not taken for one.
58
+ - **A key planted on `Object.prototype` is no option.** The options were read by property access through
59
+ the prototype chain, so a `shouldDisableDefaultRedact: true` planted on `Object.prototype` (by a
60
+ dependency with a prototype-pollution flaw) turned the default redact paths off, and `redactCensor`,
61
+ `level` and the rest were read the same way. A value that only a root prototype (one with no prototype of its own, such as the
62
+ `Object.prototype` of any realm) holds is now skipped, the options and their groups are kept in objects
63
+ with no prototype, and so is the `service` metadata; a key the object has itself, and a getter a class
64
+ prototype defines, still count. A built-in that the redaction reads and a program replaces after the import drops the record and redacts a URL path whole: each one in the table (`GUARDED_BUILTINS` in `src/server/utils/captured-builtins.util.ts`, held by a spec to the calls of five files: `fold-key`, `normalize-url`, `matches-exclude-path`, `sanitize-error` and `pino-factory`) is compared with the one the module loaded with. What `redact-by-name`, the error-text exemption, `redact-error-parts`, the mixin merge, the truncation and `bounded-text` call is outside the table. A value whose prototype chain does not end within the bound in `resolve-to-json.util.ts` is written as the censor. What was replaced before the import is outside this. A `get` or `set` installed with `Object.defineProperty` (an accessor, which plain assignment cannot make) is outside what this guards. A `get` or a `set` planted there no longer reaches a descriptor the logger
65
+ defines, and options read through a Proxy under a planted accessor of the same name are refused. Pino got the same: it is handed an own value for each option it reads
66
+ and the library does not set, and so is each entry handed to its multistream, so a planted one is not
67
+ seen. Out of scope, because Node and Pino read them off objects this library does
68
+ not build: keys such as `message` and `toJSON`, which the emit and `JSON.stringify` read.
69
+ A key planted by plain assignment, so that it is enumerable, under `level`, `msgPrefix` or `levelVal`
70
+ makes Pino throw while the logger is built, and under `levels` at the first Nest-style log call, since
71
+ Pino assigns to its instance every key a `for...in` over its level table finds, inherited ones included;
72
+ no option can shadow that.
73
+ - **A name spelled with symbol glyphs is read as the name.** The negative circled letters
74
+ (`U+1F150`..), the negative squared letters (`U+1F170`..) and the regional indicators (`U+1F1E6`..)
75
+ have no compatibility form, so the fold dropped them as punctuation and `🆃🅾🅺🅴🅽` folded to nothing
76
+ and kept its value in clear, at every depth, in a flat header array and as a property of an `Error`.
77
+ Each is now read as the Latin letter its Unicode name ends in. The table is generated from the
78
+ Unicode Character Database names (`scripts/generate-glyph-letters.mjs`, with a test that holds the
79
+ generated file to its input).
80
+ - **A key that only spells `stack` is written as a stack at the root of an entry too.** The message the
81
+ options hide is hidden in the header of a `Stack`, `STACK` or zero-width spelling of the stack of an
82
+ object message, as it is below the root, and in the same kind of own property of an `Error`.
83
+ - **The stack of a plain object is bounded whatever its message.** A message longer than the text limit
84
+ made the part of the stack that is searched as long as the message, and buffering one span for every
85
+ place a dense run matched cost memory out of proportion to the stack. A message longer than the text limit is no longer searched for:
86
+ the stack is written as the censor, as it is for more than eight messages, and a run of overlapping
87
+ matches is one span again.
88
+ - **A symbol that is not ASCII stands for a letter in a key.** A copyright sign, a sound recording sign,
89
+ a multiplication sign or any other symbol of the categories `So`, `Sm` and `Sk` was dropped as
90
+ punctuation, so `℗assword`, `©ookie` and `tok℮n` kept their value in clear. Each now stands for nothing,
91
+ one or two characters of a name, where a value is hidden, which hides the value of those keys and of a
92
+ short key that holds such a symbol (over-hiding is the price, as for a letter of another script). Dashes
93
+ and spaces are still dropped, and the keys the entry owns are still compared exactly.
94
+ - **An own enumerable `stack` of an `Error` is written as a stack.** The message the options hide is hidden
95
+ in it like in any key that spells `stack`.
96
+ - **The stack keys at the root of an entry are capped like those below it,** and the positional stack of
97
+ `error(object, stack)` has the message hidden: it was attached after the message was hidden.
98
+
99
+ ### Changed
100
+
101
+ - **A `redactPaths` entry is at most 256 characters.** A longer one is refused at startup by the name
102
+ of the option and its index (`options.redactPaths[i] must be at most 256 characters`), without echoing
103
+ it, where earlier releases accepted it and the application started. This holds for every strategy.
104
+ **Apply to a consumer:** an
105
+ entry over 256 characters now refuses boot; shorten it.
106
+
15
107
  ## [1.4.29] - 2026-11-21
16
108
 
17
109
  ### Fixed
@@ -3469,7 +3561,8 @@ published `dist/` is identical — no runtime behaviour changes for consumers.
3469
3561
  - Professional CI suite: `ci.yml`, `bench.yml`, `codeql.yml`, `scorecard.yml`,
3470
3562
  `release.yml`, Dependabot, and issue templates
3471
3563
 
3472
- [Unreleased]: https://github.com/bymaxone/nest-logger/compare/v1.4.29...HEAD
3564
+ [Unreleased]: https://github.com/bymaxone/nest-logger/compare/v1.4.30...HEAD
3565
+ [1.4.30]: https://github.com/bymaxone/nest-logger/compare/v1.4.29...v1.4.30
3473
3566
  [1.4.29]: https://github.com/bymaxone/nest-logger/compare/v1.4.28...v1.4.29
3474
3567
  [1.4.28]: https://github.com/bymaxone/nest-logger/compare/v1.4.27...v1.4.28
3475
3568
  [1.4.27]: https://github.com/bymaxone/nest-logger/compare/v1.4.26...v1.4.27
package/README.md CHANGED
@@ -879,7 +879,7 @@ The library censors **62 sensitive field names** wherever they appear in a recor
879
879
  | Other spellings | `access_token`, `refresh_token`, `id_token`, `api_key`, `apikey`, `api_secret`, `client_secret`, `signing_secret`, `private_key`, `secret_key`, `secretKey`, `access-token`, `refresh-token`, `id-token`, `api-key`, `client-secret`, `private-key`, `proxy-authorization`, `session_token`, `sessionToken`, `sessiontoken`, `session-token`, `x-csrf-token`, `x-xsrf-token`, `csrf_token`, `csrfToken`, `csrf-token`, `password_hash`, `new_password`, `old_password` |
880
880
  | HTTP headers (absolute) | `req.headers.authorization`, `req.headers.cookie`, `req.headers["x-api-key"]`, `req.headers["x-auth-token"]`, `res.headers["set-cookie"]` — retained for the legacy `'paths'` strategy; the by-name row above already covers these shapes and every other |
881
881
 
882
- Redaction is one **recursive, snapshotting walk**: a value is censored when its key name is in the set, wherever it sits. A name and a key are compared in one folded form: the case, every character that is not a letter or a digit (the separators `_`, `.` and `-` and every other dash, mark and punctuation), white space, control and zero-width characters, combining marks, the compatibility forms Unicode defines and a list of letters drawn like a Latin one are read through, and a letter that is not ASCII and that the list does not read as one Latin letter stands for one or two letters (in a key no longer than the longest name; a key longer than every name is never taken for one, so a field of another script is hidden when it is short, which is the price of never letting a spelling of a name through, and kept when it is long), so a key that has one is hidden by a name it matches everywhere else; the keys the entry owns are compared exactly after folding, so a caller field is never dropped for looking like one, so a key that has one is hidden by a name of a compatible length that matches it everywhere else (`autһorization` is hidden by `authorization`, and a key of the same length that only shares its ASCII letters is hidden too), so `apiKey` also hides `api_key`, `API-KEY`, `api\u200bKey` and `\u0430piKey`, and a name hides the field however an untrusted payload spells it. A key that spells a configured name another way is the same name, so a field whose name only differs in those ways is hidden too. Under `redactStrategy: 'paths'` the paths are matched exactly by `fast-redact`: literally, with no folding of case, separators or look-alikes, and none of this applies. Nothing the caller passed is mutated, and every value is read once and pinned into a fresh structure, so what reaches the sink is what was inspected even when the payload carries accessors or a `toJSON` that could answer differently on a second read. A value with a `toJSON` is inspected through that method's output; when the source object itself carries a sensitive key, the method is not trusted and the whole value is censored, because a method could rename what it exposes. `DEFAULT_REDACT_PATHS` is still exported at full fidelity, and `redactStrategy: 'paths'` feeds it to `fast-redact` for anyone depending on exact path semantics, with a four-level ceiling and a much higher cost.
882
+ Redaction is one **recursive, snapshotting walk**: a value is censored when its key name is in the set, wherever it sits. A name and a key are compared in one folded form: the case, every character that is not a letter or a digit (the separators `_`, `.` and `-` and every other dash, mark and punctuation), white space, control and zero-width characters, combining marks, the compatibility forms Unicode defines, the negative circled and squared letters and the regional indicators (read as their Latin letter), a symbol that is not ASCII and is no letter (read as a character that stands for nothing, one or two characters of a name) and a list of letters drawn like a Latin one are read through, and a letter that is not ASCII and that the list does not read as one Latin letter stands for one or two letters (in a key no longer than the longest name; a key longer than every name is never taken for one, so a field of another script is hidden when it is short, which is the price of never letting a spelling of a name through, and kept when it is long), so a key that has one is hidden by a name it matches everywhere else; the keys the entry owns are compared exactly after folding, so a caller field is never dropped for looking like one, so a key that has one is hidden by a name of a compatible length that matches it everywhere else (`autһorization` is hidden by `authorization`, and a key of the same length that only shares its ASCII letters is hidden too), so `apiKey` also hides `api_key`, `API-KEY`, `api\u200bKey` and `\u0430piKey`, and a name hides the field however an untrusted payload spells it. A `redactPaths` entry is at most 256 characters (a longer one is refused at startup by option name, without its value). A key that spells a configured name another way is the same name, so a field whose name only differs in those ways is hidden too. Under `redactStrategy: 'paths'` the paths are matched exactly by `fast-redact`: literally, with no folding of case, separators or look-alikes, and none of this applies. Nothing the caller passed is mutated, and every value is read once and pinned into a fresh structure, so what reaches the sink is what was inspected even when the payload carries accessors or a `toJSON` that could answer differently on a second read. A value with a `toJSON` is inspected through that method's output; when the source object itself carries a sensitive key, the method is not trusted and the whole value is censored, because a method could rename what it exposes. `DEFAULT_REDACT_PATHS` is still exported at full fidelity, and `redactStrategy: 'paths'` feeds it to `fast-redact` for anyone depending on exact path semantics, with a four-level ceiling and a much higher cost.
883
883
 
884
884
  > [!NOTE]
885
885
  > A bare `sessionId`, `session_id` or `session-id` is **not** on the list: many applications carry one as a correlation key, and a name cannot be switched off one at a time. A session id that is itself a bearer credential in your system must be added to your own `redactPaths` (`redactPaths: ['sessionId']` censors it at any depth under the default strategy).
@@ -964,6 +964,10 @@ logger.warnStructured('AUTH_REUSE_DETECTED', 'token family revoked after reuse d
964
964
 
965
965
  An interpolated value has no name, so no configuration can redact it. **A value that matters is a field, not text.** A field can be redacted, queried and correlated; inside `msg` it can only be read by a human. The library cannot enforce this, because the decision is made at the call site.
966
966
 
967
+ **A key planted on `Object.prototype` is no option.** The options are read as you set them: a value that only the root of a prototype chain holds is skipped, so a pollution cannot turn default redaction off or change the censor. One limit stays, and it is Pino's: a key planted by plain assignment (so it is enumerable) under `level`, `levels`, `msgPrefix` or `levelVal` makes Pino throw: under `level`, `msgPrefix` or `levelVal` (which is read-only) **while the logger is built**, at startup, and under `levels` at the first call of the Nest-style methods (`log`, `warn`, `error`...), because Pino assigns every key a `for...in` over its level table finds to its instance. Others are Pino's and Node's own: a `hasOwnProperty` planted as something that is not a function makes Pino throw while it is built, and so does a `message` that is not a function, which Node's event emitter reaches through the destination streams. All of them fail loudly, write nothing and un-redact nothing. A built-in that the redaction reads and that a program replaces after the import drops the record, and redacts a URL path whole: before each record each one in the table (`GUARDED_BUILTINS` in `src/server/utils/captured-builtins.util.ts`, which a spec holds to the calls of `fold-key`, `normalize-url`, `matches-exclude-path`, `sanitize-error` and `pino-factory`) is compared with the one the module loaded with, and a logger is not built, nor its options resolved, while one differs. The table does not cover what `redact-by-name`, the error-text exemption, `redact-error-parts`, the mixin merge, the truncation and `bounded-text` call (`Object.assign`, `Function.prototype.call`, `Set.prototype.delete`, `charCodeAt`...); a program that replaces those can make a log call throw into the host, and none was found to let a value through. A value whose prototype chain does not end within the bound in `resolve-to-json.util.ts` is written as the censor. An error stack fails closed too, since the message would stay in its first line. What a program replaced **before** it imported the logger is what the logger loads with, and is outside the guard. The guard is against a pollution done by assignment, which plants data; a getter or a setter installed with `Object.defineProperty`, and a property made read-only, are outside it.
968
+
969
+ These guards are best-effort hardening against prototype pollution and replaced built-ins, not a security boundary: code running inside the host process is trusted, as in Node's own threat model. See [SECURITY.md](./SECURITY.md#threat-model-same-process-code).
970
+
967
971
  ### A closed pipe does not kill the process
968
972
 
969
973
  `node app | head` closes the read end of stdout while the application is still writing. Node reports the `EPIPE` asynchronously through the stream's `'error'` event, after `write()` returned, and attaches no default handler to `process.stdout`, so the emit becomes an uncaught exception and the process dies. Every write the library makes to a process stream (default stdout sink, last-resort rescue, pre-init drain, `stderr` reports) installs a swallowing `'error'` listener on first use. The one exception is the stream `pino-pretty` writes through, which attaches listeners of its own. The side effect: the listener sits on the shared `process.stdout`, so an EPIPE raised by your own writes stops being an uncaught exception too. Your own `'error'` listener is never removed or replaced. A custom `ILogDestination` that writes to `process.stdout` should do the same; the [destinations guide](./docs/guidelines/DESTINATIONS-IMPLEMENTATION-GUIDELINES.md) has the pattern.
@@ -1237,20 +1241,20 @@ Two kinds of failure, and they surface differently. A **thrown `Error`** carries
1237
1241
 
1238
1242
  ### Thrown errors
1239
1243
 
1240
- | Message starts with | Thrown from | When | Action |
1241
- | -------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
1242
- | `[BymaxLoggerModule] options.` | `forRoot` / `forRootAsync`, at module setup | any option fails validation: a missing `service`, a `level` outside the set, a bad type | Fix the option the message names; it prints the path and what it received |
1243
- | `[BymaxLoggerModule] options could not be read` | `forRoot` / `forRootAsync`, at module setup | an option the host supplies threw when it was read (a getter or a Proxy trap) | Fix the option; the error the host threw is the `cause` |
1244
- | `holds more than` | `forRoot` / `forRootAsync`, at module setup | a list option (`redactPaths`, `errorOwnFieldNames`, `destinations`, `http.excludePaths`, `http.secretPathSegments`) is longer than 10,000 entries | Shorten the list; it is refused before any element is read |
1245
- | `has a length that is not a count` | `forRoot` / `forRootAsync`, at module setup | a list option reports a length that is negative, fractional, `NaN` or infinite (a Proxy; an array never does) | Fix the option; it is refused before any element is read |
1246
- | `[BymaxLoggerModule] useNestLogger(app) called but` | `BymaxLoggerModule.useNestLogger` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1247
- | `[BymaxLoggerModule] applyAccessLog(app) called but` | `applyAccessLog` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1248
- | `[BymaxLoggerModule] useRequestContext(app) called but` | `useRequestContext` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1249
- | `[PrettyDevDestination] pino-pretty is not installed` | `PrettyDevDestination.onInit` | the destination is registered and resolving `pino-pretty` itself fails | Install `pino-pretty` or drop the destination |
1250
- | `[PrettyDevDestination] pino-pretty failed to start` | `PrettyDevDestination.onInit` | `pino-pretty` is found but importing it or building the transform throws | Read the message and the error's `cause`: it is the real failure |
1251
- | `[PrettyDevDestination] refused in production` | `PrettyDevDestination.onInit` | `NODE_ENV` is exactly `production` | Use `DefaultStdoutDestination` in production |
1252
- | `[LogContextService] set() called outside run() scope` | `LogContextService.set` | called with no active `run()` | Wrap the work in `logContext.run({ ... }, () => ...)` |
1253
- | `[LogContextService] Refusing to set unsafe context key` | `LogContextService.set` | the key is `__proto__`, `constructor` or `prototype` | Use an ordinary key |
1244
+ | Message starts with | Thrown from | When | Action |
1245
+ | -------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
1246
+ | `[BymaxLoggerModule] options.` | `forRoot` / `forRootAsync`, at module setup | any option fails validation: a missing `service`, a `level` outside the set, a bad type | Fix the option the message names; it prints the path and what it received |
1247
+ | `[BymaxLoggerModule] options could not be read` | `forRoot` / `forRootAsync`, at module setup | an option the host supplies threw when it was read (a getter or a Proxy trap) | Fix the option; the error the host threw is the `cause` |
1248
+ | `holds more than` | `forRoot` / `forRootAsync`, at module setup | a list option is longer than the entry cap (`MAX_LIST_ENTRIES`) | Shorten the list; it is refused before any element is read |
1249
+ | `has a length that is not a count` | `forRoot` / `forRootAsync`, at module setup | a list option reports a length that is negative, fractional, `NaN` or infinite (a Proxy; an array never does) | Fix the option; it is refused before any element is read |
1250
+ | `[BymaxLoggerModule] useNestLogger(app) called but` | `BymaxLoggerModule.useNestLogger` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1251
+ | `[BymaxLoggerModule] applyAccessLog(app) called but` | `applyAccessLog` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1252
+ | `[BymaxLoggerModule] useRequestContext(app) called but` | `useRequestContext` | the module was never imported into the application | Import `BymaxLoggerModule` before calling it |
1253
+ | `[PrettyDevDestination] pino-pretty is not installed` | `PrettyDevDestination.onInit` | the destination is registered and resolving `pino-pretty` itself fails | Install `pino-pretty` or drop the destination |
1254
+ | `[PrettyDevDestination] pino-pretty failed to start` | `PrettyDevDestination.onInit` | `pino-pretty` is found but importing it or building the transform throws | Read the message and the error's `cause`: it is the real failure |
1255
+ | `[PrettyDevDestination] refused in production` | `PrettyDevDestination.onInit` | `NODE_ENV` is exactly `production` | Use `DefaultStdoutDestination` in production |
1256
+ | `[LogContextService] set() called outside run() scope` | `LogContextService.set` | called with no active `run()` | Wrap the work in `logContext.run({ ... }, () => ...)` |
1257
+ | `[LogContextService] Refusing to set unsafe context key` | `LogContextService.set` | the key is `__proto__`, `constructor` or `prototype` | Use an ordinary key |
1254
1258
 
1255
1259
  The `PrettyDevDestination` errors are thrown inside `onInit`, which the registry contains: the boot continues and the failure is reported as `LOGGER_DESTINATION_INIT_FAILED` below.
1256
1260
 
@@ -15,6 +15,8 @@ var __decorateClass = (decorators, target, key, kind) => {
15
15
  return result;
16
16
  };
17
17
  var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
18
+ var IntrinsicPromise = Object.getPrototypeOf((async () => void 0)()).constructor;
19
+ var define = Object.defineProperty;
18
20
  var LOGGER_HEALTH_INDICATOR_NAME = "logger";
19
21
  exports.LoggerHealthIndicator = class LoggerHealthIndicator {
20
22
  /**
@@ -31,10 +33,21 @@ exports.LoggerHealthIndicator = class LoggerHealthIndicator {
31
33
  */
32
34
  check() {
33
35
  const { destinations, failedInit, writeFailing, hasHealthySink } = this.observability.deliveryState();
34
- return Promise.resolve({
36
+ const verdict = Object.freeze({
37
+ __proto__: null,
35
38
  status: hasHealthySink ? "up" : "down",
36
- details: { destinations, failedInit, writeFailing }
39
+ details: Object.freeze({ destinations, failedInit, writeFailing })
37
40
  });
41
+ const answer = new IntrinsicPromise((resolve) => {
42
+ resolve(verdict);
43
+ });
44
+ define(answer, "constructor", {
45
+ __proto__: null,
46
+ value: IntrinsicPromise,
47
+ writable: false,
48
+ configurable: false
49
+ });
50
+ return answer;
38
51
  }
39
52
  };
40
53
  exports.LoggerHealthIndicator = __decorateClass([
@@ -13,6 +13,8 @@ var __decorateClass = (decorators, target, key, kind) => {
13
13
  return result;
14
14
  };
15
15
  var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
16
+ var IntrinsicPromise = Object.getPrototypeOf((async () => void 0)()).constructor;
17
+ var define = Object.defineProperty;
16
18
  var LOGGER_HEALTH_INDICATOR_NAME = "logger";
17
19
  var LoggerHealthIndicator = class {
18
20
  /**
@@ -29,10 +31,21 @@ var LoggerHealthIndicator = class {
29
31
  */
30
32
  check() {
31
33
  const { destinations, failedInit, writeFailing, hasHealthySink } = this.observability.deliveryState();
32
- return Promise.resolve({
34
+ const verdict = Object.freeze({
35
+ __proto__: null,
33
36
  status: hasHealthySink ? "up" : "down",
34
- details: { destinations, failedInit, writeFailing }
37
+ details: Object.freeze({ destinations, failedInit, writeFailing })
35
38
  });
39
+ const answer = new IntrinsicPromise((resolve) => {
40
+ resolve(verdict);
41
+ });
42
+ define(answer, "constructor", {
43
+ __proto__: null,
44
+ value: IntrinsicPromise,
45
+ writable: false,
46
+ configurable: false
47
+ });
48
+ return answer;
36
49
  }
37
50
  };
38
51
  LoggerHealthIndicator = __decorateClass([