@globalart/nestjs-logger 1.1.0 → 1.2.0

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.d.cts CHANGED
@@ -1,8 +1,356 @@
1
+ /// <reference path="operators/index.d.ts" />
2
+ /// <reference path="testing/index.d.ts" />
1
3
  import * as _nestjs_common0 from "@nestjs/common";
2
4
  import { CallHandler, DynamicModule, ExecutionContext, LoggerService as LoggerService$1, NestInterceptor, RequestMethod } from "@nestjs/common";
3
5
  import { Reflector } from "@nestjs/core";
4
- import { Observable } from "rxjs";
5
6
 
7
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscription.d.ts
8
+ /**
9
+ * Represents a disposable resource, such as the execution of an Observable. A
10
+ * Subscription has one important method, `unsubscribe`, that takes no argument
11
+ * and just disposes the resource held by the subscription.
12
+ *
13
+ * Additionally, subscriptions may be grouped together through the `add()`
14
+ * method, which will attach a child Subscription to the current Subscription.
15
+ * When a Subscription is unsubscribed, all its children (and its grandchildren)
16
+ * will be unsubscribed as well.
17
+ */
18
+ declare class Subscription implements SubscriptionLike {
19
+ private initialTeardown?;
20
+ static EMPTY: Subscription;
21
+ /**
22
+ * A flag to indicate whether this Subscription has already been unsubscribed.
23
+ */
24
+ closed: boolean;
25
+ private _parentage;
26
+ /**
27
+ * The list of registered finalizers to execute upon unsubscription. Adding and removing from this
28
+ * list occurs in the {@link #add} and {@link #remove} methods.
29
+ */
30
+ private _finalizers;
31
+ /**
32
+ * @param initialTeardown A function executed first as part of the finalization
33
+ * process that is kicked off when {@link #unsubscribe} is called.
34
+ */
35
+ constructor(initialTeardown?: (() => void) | undefined);
36
+ /**
37
+ * Disposes the resources held by the subscription. May, for instance, cancel
38
+ * an ongoing Observable execution or cancel any other type of work that
39
+ * started when the Subscription was created.
40
+ */
41
+ unsubscribe(): void;
42
+ /**
43
+ * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called
44
+ * when this subscription is unsubscribed. If this subscription is already {@link #closed},
45
+ * because it has already been unsubscribed, then whatever finalizer is passed to it
46
+ * will automatically be executed (unless the finalizer itself is also a closed subscription).
47
+ *
48
+ * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed
49
+ * subscription to a any subscription will result in no operation. (A noop).
50
+ *
51
+ * Adding a subscription to itself, or adding `null` or `undefined` will not perform any
52
+ * operation at all. (A noop).
53
+ *
54
+ * `Subscription` instances that are added to this instance will automatically remove themselves
55
+ * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove
56
+ * will need to be removed manually with {@link #remove}
57
+ *
58
+ * @param teardown The finalization logic to add to this subscription.
59
+ */
60
+ add(teardown: TeardownLogic): void;
61
+ /**
62
+ * Checks to see if a this subscription already has a particular parent.
63
+ * This will signal that this subscription has already been added to the parent in question.
64
+ * @param parent the parent to check for
65
+ */
66
+ private _hasParent;
67
+ /**
68
+ * Adds a parent to this subscription so it can be removed from the parent if it
69
+ * unsubscribes on it's own.
70
+ *
71
+ * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.
72
+ * @param parent The parent subscription to add
73
+ */
74
+ private _addParent;
75
+ /**
76
+ * Called on a child when it is removed via {@link #remove}.
77
+ * @param parent The parent to remove
78
+ */
79
+ private _removeParent;
80
+ /**
81
+ * Removes a finalizer from this subscription that was previously added with the {@link #add} method.
82
+ *
83
+ * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves
84
+ * from every other `Subscription` they have been added to. This means that using the `remove` method
85
+ * is not a common thing and should be used thoughtfully.
86
+ *
87
+ * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance
88
+ * more than once, you will need to call `remove` the same number of times to remove all instances.
89
+ *
90
+ * All finalizer instances are removed to free up memory upon unsubscription.
91
+ *
92
+ * @param teardown The finalizer to remove from this subscription
93
+ */
94
+ remove(teardown: Exclude<TeardownLogic, void>): void;
95
+ }
96
+ //#endregion
97
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/types.d.ts
98
+ /**
99
+ * Note: This will add Symbol.observable globally for all TypeScript users,
100
+ * however, we are no longer polyfilling Symbol.observable
101
+ */
102
+ declare global {
103
+ interface SymbolConstructor {
104
+ readonly observable: symbol;
105
+ }
106
+ }
107
+ /**
108
+ * A function type interface that describes a function that accepts one parameter `T`
109
+ * and returns another parameter `R`.
110
+ *
111
+ * Usually used to describe {@link OperatorFunction} - it always takes a single
112
+ * parameter (the source Observable) and returns another Observable.
113
+ */
114
+ interface UnaryFunction<T, R> {
115
+ (source: T): R;
116
+ }
117
+ interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> {}
118
+ interface Unsubscribable {
119
+ unsubscribe(): void;
120
+ }
121
+ declare type TeardownLogic = Subscription | Unsubscribable | (() => void) | void;
122
+ interface SubscriptionLike extends Unsubscribable {
123
+ unsubscribe(): void;
124
+ readonly closed: boolean;
125
+ }
126
+ /** OBSERVABLE INTERFACES */
127
+ interface Subscribable<T> {
128
+ subscribe(observer: Partial<Observer<T>>): Unsubscribable;
129
+ }
130
+ /**
131
+ * An object interface that defines a set of callback functions a user can use to get
132
+ * notified of any set of {@link Observable}
133
+ * {@link guide/glossary-and-semantics#notification notification} events.
134
+ *
135
+ * For more info, please refer to {@link guide/observer this guide}.
136
+ */
137
+ interface Observer<T> {
138
+ /**
139
+ * A callback function that gets called by the producer during the subscription when
140
+ * the producer "has" the `value`. It won't be called if `error` or `complete` callback
141
+ * functions have been called, nor after the consumer has unsubscribed.
142
+ *
143
+ * For more info, please refer to {@link guide/glossary-and-semantics#next this guide}.
144
+ */
145
+ next: (value: T) => void;
146
+ /**
147
+ * A callback function that gets called by the producer if and when it encountered a
148
+ * problem of any kind. The errored value will be provided through the `err` parameter.
149
+ * This callback can't be called more than one time, it can't be called if the
150
+ * `complete` callback function have been called previously, nor it can't be called if
151
+ * the consumer has unsubscribed.
152
+ *
153
+ * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}.
154
+ */
155
+ error: (err: any) => void;
156
+ /**
157
+ * A callback function that gets called by the producer if and when it has no more
158
+ * values to provide (by calling `next` callback function). This means that no error
159
+ * has happened. This callback can't be called more than one time, it can't be called
160
+ * if the `error` callback function have been called previously, nor it can't be called
161
+ * if the consumer has unsubscribed.
162
+ *
163
+ * For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}.
164
+ */
165
+ complete: () => void;
166
+ }
167
+ //#endregion
168
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Subscriber.d.ts
169
+ /**
170
+ * Implements the {@link Observer} interface and extends the
171
+ * {@link Subscription} class. While the {@link Observer} is the public API for
172
+ * consuming the values of an {@link Observable}, all Observers get converted to
173
+ * a Subscriber, in order to provide Subscription-like capabilities such as
174
+ * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
175
+ * implementing operators, but it is rarely used as a public API.
176
+ */
177
+ declare class Subscriber<T> extends Subscription implements Observer<T> {
178
+ /**
179
+ * A static factory for a Subscriber, given a (potentially partial) definition
180
+ * of an Observer.
181
+ * @param next The `next` callback of an Observer.
182
+ * @param error The `error` callback of an
183
+ * Observer.
184
+ * @param complete The `complete` callback of an
185
+ * Observer.
186
+ * @return A Subscriber wrapping the (partially defined)
187
+ * Observer represented by the given arguments.
188
+ * @deprecated Do not use. Will be removed in v8. There is no replacement for this
189
+ * method, and there is no reason to be creating instances of `Subscriber` directly.
190
+ * If you have a specific use case, please file an issue.
191
+ */
192
+ static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
193
+ /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
194
+ protected isStopped: boolean;
195
+ /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
196
+ protected destination: Subscriber<any> | Observer<any>;
197
+ /**
198
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
199
+ * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.
200
+ */
201
+ constructor(destination?: Subscriber<any> | Observer<any>);
202
+ /**
203
+ * The {@link Observer} callback to receive notifications of type `next` from
204
+ * the Observable, with a value. The Observable may call this method 0 or more
205
+ * times.
206
+ * @param value The `next` value.
207
+ */
208
+ next(value: T): void;
209
+ /**
210
+ * The {@link Observer} callback to receive notifications of type `error` from
211
+ * the Observable, with an attached `Error`. Notifies the Observer that
212
+ * the Observable has experienced an error condition.
213
+ * @param err The `error` exception.
214
+ */
215
+ error(err?: any): void;
216
+ /**
217
+ * The {@link Observer} callback to receive a valueless notification of type
218
+ * `complete` from the Observable. Notifies the Observer that the Observable
219
+ * has finished sending push-based notifications.
220
+ */
221
+ complete(): void;
222
+ unsubscribe(): void;
223
+ protected _next(value: T): void;
224
+ protected _error(err: any): void;
225
+ protected _complete(): void;
226
+ }
227
+ //#endregion
228
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Operator.d.ts
229
+ /***
230
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
231
+ */
232
+ interface Operator<T, R> {
233
+ call(subscriber: Subscriber<R>, source: any): TeardownLogic;
234
+ }
235
+ //#endregion
236
+ //#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/types/internal/Observable.d.ts
237
+ /**
238
+ * A representation of any set of values over any amount of time. This is the most basic building block
239
+ * of RxJS.
240
+ */
241
+ declare class Observable<T> implements Subscribable<T> {
242
+ /**
243
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
244
+ */
245
+ source: Observable<any> | undefined;
246
+ /**
247
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
248
+ */
249
+ operator: Operator<any, T> | undefined;
250
+ /**
251
+ * @param subscribe The function that is called when the Observable is
252
+ * initially subscribed to. This function is given a Subscriber, to which new values
253
+ * can be `next`ed, or an `error` method can be called to raise an error, or
254
+ * `complete` can be called to notify of a successful completion.
255
+ */
256
+ constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
257
+ /**
258
+ * Creates a new Observable by calling the Observable constructor
259
+ * @param subscribe the subscriber function to be passed to the Observable constructor
260
+ * @return A new observable.
261
+ * @deprecated Use `new Observable()` instead. Will be removed in v8.
262
+ */
263
+ static create: (...args: any[]) => any;
264
+ /**
265
+ * Creates a new Observable, with this Observable instance as the source, and the passed
266
+ * operator defined as the new observable's operator.
267
+ * @param operator the operator defining the operation to take on the observable
268
+ * @return A new observable with the Operator applied.
269
+ * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
270
+ * If you have implemented an operator using `lift`, it is recommended that you create an
271
+ * operator by simply returning `new Observable()` directly. See "Creating new operators from
272
+ * scratch" section here: https://rxjs.dev/guide/operators
273
+ */
274
+ lift<R>(operator?: Operator<T, R>): Observable<R>;
275
+ subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;
276
+ /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */
277
+ subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;
278
+ /**
279
+ * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with
280
+ * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.
281
+ *
282
+ * **WARNING**: Only use this with observables you *know* will complete. If the source
283
+ * observable does not complete, you will end up with a promise that is hung up, and
284
+ * potentially all of the state of an async function hanging out in memory. To avoid
285
+ * this situation, look into adding something like {@link timeout}, {@link take},
286
+ * {@link takeWhile}, or {@link takeUntil} amongst others.
287
+ *
288
+ * #### Example
289
+ *
290
+ * ```ts
291
+ * import { interval, take } from 'rxjs';
292
+ *
293
+ * const source$ = interval(1000).pipe(take(4));
294
+ *
295
+ * async function getTotal() {
296
+ * let total = 0;
297
+ *
298
+ * await source$.forEach(value => {
299
+ * total += value;
300
+ * console.log('observable -> ' + value);
301
+ * });
302
+ *
303
+ * return total;
304
+ * }
305
+ *
306
+ * getTotal().then(
307
+ * total => console.log('Total: ' + total)
308
+ * );
309
+ *
310
+ * // Expected:
311
+ * // 'observable -> 0'
312
+ * // 'observable -> 1'
313
+ * // 'observable -> 2'
314
+ * // 'observable -> 3'
315
+ * // 'Total: 6'
316
+ * ```
317
+ *
318
+ * @param next A handler for each value emitted by the observable.
319
+ * @return A promise that either resolves on observable completion or
320
+ * rejects with the handled error.
321
+ */
322
+ forEach(next: (value: T) => void): Promise<void>;
323
+ /**
324
+ * @param next a handler for each value emitted by the observable
325
+ * @param promiseCtor a constructor function used to instantiate the Promise
326
+ * @return a promise that either resolves on observable completion or
327
+ * rejects with the handled error
328
+ * @deprecated Passing a Promise constructor will no longer be available
329
+ * in upcoming versions of RxJS. This is because it adds weight to the library, for very
330
+ * little benefit. If you need this functionality, it is recommended that you either
331
+ * polyfill Promise, or you create an adapter to convert the returned native promise
332
+ * to whatever promise implementation you wanted. Will be removed in v8.
333
+ */
334
+ forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;
335
+ pipe(): Observable<T>;
336
+ pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
337
+ pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
338
+ pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
339
+ pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
340
+ pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;
341
+ pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;
342
+ pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
343
+ pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
344
+ pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
345
+ pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<unknown>;
346
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
347
+ toPromise(): Promise<T | undefined>;
348
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
349
+ toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;
350
+ /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */
351
+ toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;
352
+ }
353
+ //#endregion
6
354
  //#region src/types/index.d.ts
7
355
  type LogLevel = "error" | "warn" | "info" | "debug" | "verbose";
8
356
  type LogFormat = "json" | "text" | "pino";