@adviser/cement 0.2.39 → 0.2.41

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/index.d.cts CHANGED
@@ -4,9 +4,35 @@ import { T as TxtEnDecoder } from './txt-en-decoder-CZYJUju2.cjs';
4
4
  export { U as Utf8EnDecoder, a as Utf8EnDecoderSingleton } from './txt-en-decoder-CZYJUju2.cjs';
5
5
  export { i as utils } from './index-Q3phXzYr.cjs';
6
6
 
7
+ declare abstract class Option<T> {
8
+ static Some<T>(t: T): Option<T>;
9
+ static None<T>(): Option<T>;
10
+ static Is<T>(t: unknown): t is Option<T>;
11
+ static From<T>(t?: T): Option<T>;
12
+ IsNone(): boolean;
13
+ IsSome(): boolean;
14
+ Unwrap(): T;
15
+ abstract is_none(): boolean;
16
+ abstract is_some(): boolean;
17
+ abstract unwrap(): T;
18
+ }
19
+ declare class Some<T> extends Option<T> {
20
+ private _t;
21
+ constructor(_t: T);
22
+ is_none(): boolean;
23
+ is_some(): boolean;
24
+ unwrap(): T;
25
+ }
26
+ declare class None<T> extends Option<T> {
27
+ is_none(): boolean;
28
+ is_some(): boolean;
29
+ unwrap(): T;
30
+ }
31
+ type WithoutOption<T> = T extends Option<infer U> ? U : T;
32
+
7
33
  declare abstract class Result<T, E = Error> {
8
34
  static Ok<T = void>(t: T): Result<T, Error>;
9
- static Err<T, E extends Error = Error>(t: E | string): Result<T, E>;
35
+ static Err<T, E extends Error = Error>(t: E | string | Result<unknown, E>): Result<T, E>;
10
36
  static Is<T>(t: unknown): t is Result<T>;
11
37
  isOk(): boolean;
12
38
  isErr(): boolean;
@@ -42,7 +68,8 @@ type StripCommand = string | RegExp;
42
68
  type NullOrUndef = null | undefined;
43
69
  type OneKey<K extends string, V = string> = Record<K, V>;
44
70
  type MsgFn = (...keys: string[]) => string;
45
- type KeysParam = (string | MsgFn | Record<string, unknown>)[];
71
+ declare const REQUIRED = 4711;
72
+ type KeysParam = (string | MsgFn | Record<string, typeof REQUIRED | unknown>)[];
46
73
  interface URIInterface<R extends URIInterface<R>> {
47
74
  readonly getParams: Iterable<[string, string]>;
48
75
  hasParam(key: string): boolean;
@@ -100,6 +127,7 @@ declare class BuildURI implements URIInterface<BuildURI> {
100
127
  protocol(p: string): BuildURI;
101
128
  pathname(p: string): BuildURI;
102
129
  appendRelative(p: CoerceURI): BuildURI;
130
+ cleanParams(): BuildURI;
103
131
  delParam(key: string): BuildURI;
104
132
  defParam(key: string, str: string): BuildURI;
105
133
  setParam(key: string, str: string): BuildURI;
@@ -160,7 +188,11 @@ declare class LogValue {
160
188
  type LogSerializable = Record<string, LogValue | Promise<LogValue>>;
161
189
  declare function asyncLogValue(val: () => Promise<Serialized>): Promise<LogValue>;
162
190
  type LogValueArg = LogValue | Serialized | Serialized[] | FnSerialized | undefined | null;
163
- declare function logValue(val: LogValueArg, state?: Set<unknown>): LogValue;
191
+ interface LogValueState {
192
+ readonly state?: Set<unknown>;
193
+ readonly ignoreAttr: Option<RegExp>;
194
+ }
195
+ declare function logValue(val: LogValueArg, ctx: LogValueState): LogValue;
164
196
  interface Sized {
165
197
  size: number;
166
198
  }
@@ -175,18 +207,22 @@ interface LevelHandler {
175
207
  enableLevel(level: Level, ...modules: string[]): void;
176
208
  disableLevel(level: Level, ...modules: string[]): void;
177
209
  setExposeStack(enable?: boolean): void;
210
+ setIgnoreAttr(re?: RegExp): void;
211
+ ignoreAttr: Option<RegExp>;
178
212
  isStackExposed: boolean;
179
213
  setDebug(...modules: (string | string[])[]): void;
180
214
  isEnabled(ilevel: unknown, module: unknown): boolean;
181
215
  }
182
216
  type HttpType = Response | Result<Response> | Request | Result<Request>;
183
217
  interface LoggerInterface<R> {
218
+ readonly levelHandler: LevelHandler;
184
219
  TxtEnDe(): TxtEnDecoder;
185
220
  Module(key: string): R;
186
221
  EnableLevel(level: Level, ...modules: string[]): R;
187
222
  DisableLevel(level: Level, ...modules: string[]): R;
188
223
  Attributes(): Record<string, unknown>;
189
224
  SetDebug(...modules: (string | string[])[]): R;
225
+ SetIgnoreAttribute(re?: RegExp): R;
190
226
  SetExposeStack(enable?: boolean): R;
191
227
  SetFormatter(fmt: LogFormatter): R;
192
228
  Ref(key: string, action: {
@@ -263,7 +299,7 @@ declare class LoggerImpl implements Logger {
263
299
  readonly _attributes: LogSerializable;
264
300
  readonly _withAttributes: LogSerializable;
265
301
  readonly _logWriter: LogWriterStream;
266
- readonly _levelHandler: LevelHandler;
302
+ readonly levelHandler: LevelHandler;
267
303
  readonly _txtEnDe: TxtEnDecoder;
268
304
  _formatter: LogFormatter;
269
305
  constructor(params?: LoggerImplParams);
@@ -274,6 +310,7 @@ declare class LoggerImpl implements Logger {
274
310
  DisableLevel(level: Level, ...modules: string[]): Logger;
275
311
  Module(key: string): Logger;
276
312
  SetDebug(...modules: (string | string[])[]): Logger;
313
+ SetIgnoreAttribute(re?: RegExp): Logger;
277
314
  SetFormatter(formatter: LogFormatter): Logger;
278
315
  Timestamp(): Logger;
279
316
  Warn(): Logger;
@@ -352,41 +389,18 @@ declare function MockLogger(params?: {
352
389
  declare class LevelHandlerImpl implements LevelHandler {
353
390
  readonly _globalLevels: Set<Level>;
354
391
  readonly _modules: Map<string, Set<Level>>;
392
+ ignoreAttr: Option<RegExp>;
355
393
  isStackExposed: boolean;
356
394
  enableLevel(level: Level, ...modules: string[]): void;
357
395
  disableLevel(level: Level, ...modules: string[]): void;
358
396
  setExposeStack(enable?: boolean): void;
397
+ setIgnoreAttr(re?: RegExp): void;
359
398
  forModules(level: Level, fnAction: (p: string) => void, ...modules: (string | string[])[]): void;
360
399
  setDebug(...modules: (string | string[])[]): void;
361
400
  isEnabled(ilevel: unknown, module: unknown): boolean;
362
401
  }
363
402
  declare function LevelHandlerSingleton(): LevelHandler;
364
403
 
365
- declare abstract class Option<T> {
366
- static Some<T>(t: T): Option<T>;
367
- static None<T>(): Option<T>;
368
- static Is<T>(t: unknown): t is Option<T>;
369
- IsNone(): boolean;
370
- IsSome(): boolean;
371
- Unwrap(): T;
372
- abstract is_none(): boolean;
373
- abstract is_some(): boolean;
374
- abstract unwrap(): T;
375
- }
376
- declare class Some<T> extends Option<T> {
377
- private _t;
378
- constructor(_t: T);
379
- is_none(): boolean;
380
- is_some(): boolean;
381
- unwrap(): T;
382
- }
383
- declare class None<T> extends Option<T> {
384
- is_none(): boolean;
385
- is_some(): boolean;
386
- unwrap(): T;
387
- }
388
- type WithoutOption<T> = T extends Option<infer U> ? U : T;
389
-
390
404
  type TraceCtx = {
391
405
  readonly spanId: string;
392
406
  readonly time: Time;
@@ -576,4 +590,4 @@ declare function bin2string(hex: ArrayBufferView, size?: number): string;
576
590
 
577
591
  declare const VERSION: string;
578
592
 
579
- export { type AsError, BuildURI, type CTAesKeyAlgorithm, type CTAlgorithm, type CTAlgorithmIdentifier, type CTArrayBufferView, type CTBufferSource, type CTCryptoKey, type CTEcKeyImportParams, type CTHmacImportParams, type CTJsonWebKey, type CTKeyFormat, type CTKeyType, type CTKeyUsage, type CTNamedCurve, type CTRsaHashedImportParams, type CleanCtx, type CoerceURI, type CryptoRuntime, type FnSerialized, Future, type HostURIObject, type HttpType, type Invokaction, IsLogger, JSONFormatter, Keyed, KeyedResolvOnce, KeyedResolvSeq, type KeysParam, type Lengthed, Level, type LevelHandler, LevelHandlerImpl, LevelHandlerSingleton, LogCollector, type LogFormatter, type LogSerializable, LogValue, type LogValueArg, LogWriteStream, type Logger, LoggerImpl, type LoggerImplParams, type LoggerInterface, Metric, type MetricMap, Metrics, MockLogger, type MockLoggerReturn, type MsgFn, MutableURL, None, Option, type PathURIObject, ResolveOnce, ResolveSeq, Result, ResultError, ResultOK, type Runtime, type Serialized, type SizeOrLength, type Sized, Some, SysAbstraction, Time, type TraceCtx, type TraceCtxParam, TraceNode, type TraceNodeMap, TxtEnDecoder, URI, type URIInterface, type URIObject, VERSION, type WithLogger, type WithoutOption, type WithoutResult, YAMLFormatter, asyncLogValue, bin2string, bin2text, exception2Result, hasHostPartProtocols, isURL, logValue, runtimeFn, toCryptoRuntime };
593
+ export { type AsError, BuildURI, type CTAesKeyAlgorithm, type CTAlgorithm, type CTAlgorithmIdentifier, type CTArrayBufferView, type CTBufferSource, type CTCryptoKey, type CTEcKeyImportParams, type CTHmacImportParams, type CTJsonWebKey, type CTKeyFormat, type CTKeyType, type CTKeyUsage, type CTNamedCurve, type CTRsaHashedImportParams, type CleanCtx, type CoerceURI, type CryptoRuntime, type FnSerialized, Future, type HostURIObject, type HttpType, type Invokaction, IsLogger, JSONFormatter, Keyed, KeyedResolvOnce, KeyedResolvSeq, type KeysParam, type Lengthed, Level, type LevelHandler, LevelHandlerImpl, LevelHandlerSingleton, LogCollector, type LogFormatter, type LogSerializable, LogValue, type LogValueArg, type LogValueState, LogWriteStream, type Logger, LoggerImpl, type LoggerImplParams, type LoggerInterface, Metric, type MetricMap, Metrics, MockLogger, type MockLoggerReturn, type MsgFn, MutableURL, None, Option, type PathURIObject, REQUIRED, ResolveOnce, ResolveSeq, Result, ResultError, ResultOK, type Runtime, type Serialized, type SizeOrLength, type Sized, Some, SysAbstraction, Time, type TraceCtx, type TraceCtxParam, TraceNode, type TraceNodeMap, TxtEnDecoder, URI, type URIInterface, type URIObject, VERSION, type WithLogger, type WithoutOption, type WithoutResult, YAMLFormatter, asyncLogValue, bin2string, bin2text, exception2Result, hasHostPartProtocols, isURL, logValue, runtimeFn, toCryptoRuntime };
package/index.d.ts CHANGED
@@ -4,9 +4,35 @@ import { T as TxtEnDecoder } from './txt-en-decoder-CZYJUju2.js';
4
4
  export { U as Utf8EnDecoder, a as Utf8EnDecoderSingleton } from './txt-en-decoder-CZYJUju2.js';
5
5
  export { i as utils } from './index-tIGZMHTc.js';
6
6
 
7
+ declare abstract class Option<T> {
8
+ static Some<T>(t: T): Option<T>;
9
+ static None<T>(): Option<T>;
10
+ static Is<T>(t: unknown): t is Option<T>;
11
+ static From<T>(t?: T): Option<T>;
12
+ IsNone(): boolean;
13
+ IsSome(): boolean;
14
+ Unwrap(): T;
15
+ abstract is_none(): boolean;
16
+ abstract is_some(): boolean;
17
+ abstract unwrap(): T;
18
+ }
19
+ declare class Some<T> extends Option<T> {
20
+ private _t;
21
+ constructor(_t: T);
22
+ is_none(): boolean;
23
+ is_some(): boolean;
24
+ unwrap(): T;
25
+ }
26
+ declare class None<T> extends Option<T> {
27
+ is_none(): boolean;
28
+ is_some(): boolean;
29
+ unwrap(): T;
30
+ }
31
+ type WithoutOption<T> = T extends Option<infer U> ? U : T;
32
+
7
33
  declare abstract class Result<T, E = Error> {
8
34
  static Ok<T = void>(t: T): Result<T, Error>;
9
- static Err<T, E extends Error = Error>(t: E | string): Result<T, E>;
35
+ static Err<T, E extends Error = Error>(t: E | string | Result<unknown, E>): Result<T, E>;
10
36
  static Is<T>(t: unknown): t is Result<T>;
11
37
  isOk(): boolean;
12
38
  isErr(): boolean;
@@ -42,7 +68,8 @@ type StripCommand = string | RegExp;
42
68
  type NullOrUndef = null | undefined;
43
69
  type OneKey<K extends string, V = string> = Record<K, V>;
44
70
  type MsgFn = (...keys: string[]) => string;
45
- type KeysParam = (string | MsgFn | Record<string, unknown>)[];
71
+ declare const REQUIRED = 4711;
72
+ type KeysParam = (string | MsgFn | Record<string, typeof REQUIRED | unknown>)[];
46
73
  interface URIInterface<R extends URIInterface<R>> {
47
74
  readonly getParams: Iterable<[string, string]>;
48
75
  hasParam(key: string): boolean;
@@ -100,6 +127,7 @@ declare class BuildURI implements URIInterface<BuildURI> {
100
127
  protocol(p: string): BuildURI;
101
128
  pathname(p: string): BuildURI;
102
129
  appendRelative(p: CoerceURI): BuildURI;
130
+ cleanParams(): BuildURI;
103
131
  delParam(key: string): BuildURI;
104
132
  defParam(key: string, str: string): BuildURI;
105
133
  setParam(key: string, str: string): BuildURI;
@@ -160,7 +188,11 @@ declare class LogValue {
160
188
  type LogSerializable = Record<string, LogValue | Promise<LogValue>>;
161
189
  declare function asyncLogValue(val: () => Promise<Serialized>): Promise<LogValue>;
162
190
  type LogValueArg = LogValue | Serialized | Serialized[] | FnSerialized | undefined | null;
163
- declare function logValue(val: LogValueArg, state?: Set<unknown>): LogValue;
191
+ interface LogValueState {
192
+ readonly state?: Set<unknown>;
193
+ readonly ignoreAttr: Option<RegExp>;
194
+ }
195
+ declare function logValue(val: LogValueArg, ctx: LogValueState): LogValue;
164
196
  interface Sized {
165
197
  size: number;
166
198
  }
@@ -175,18 +207,22 @@ interface LevelHandler {
175
207
  enableLevel(level: Level, ...modules: string[]): void;
176
208
  disableLevel(level: Level, ...modules: string[]): void;
177
209
  setExposeStack(enable?: boolean): void;
210
+ setIgnoreAttr(re?: RegExp): void;
211
+ ignoreAttr: Option<RegExp>;
178
212
  isStackExposed: boolean;
179
213
  setDebug(...modules: (string | string[])[]): void;
180
214
  isEnabled(ilevel: unknown, module: unknown): boolean;
181
215
  }
182
216
  type HttpType = Response | Result<Response> | Request | Result<Request>;
183
217
  interface LoggerInterface<R> {
218
+ readonly levelHandler: LevelHandler;
184
219
  TxtEnDe(): TxtEnDecoder;
185
220
  Module(key: string): R;
186
221
  EnableLevel(level: Level, ...modules: string[]): R;
187
222
  DisableLevel(level: Level, ...modules: string[]): R;
188
223
  Attributes(): Record<string, unknown>;
189
224
  SetDebug(...modules: (string | string[])[]): R;
225
+ SetIgnoreAttribute(re?: RegExp): R;
190
226
  SetExposeStack(enable?: boolean): R;
191
227
  SetFormatter(fmt: LogFormatter): R;
192
228
  Ref(key: string, action: {
@@ -263,7 +299,7 @@ declare class LoggerImpl implements Logger {
263
299
  readonly _attributes: LogSerializable;
264
300
  readonly _withAttributes: LogSerializable;
265
301
  readonly _logWriter: LogWriterStream;
266
- readonly _levelHandler: LevelHandler;
302
+ readonly levelHandler: LevelHandler;
267
303
  readonly _txtEnDe: TxtEnDecoder;
268
304
  _formatter: LogFormatter;
269
305
  constructor(params?: LoggerImplParams);
@@ -274,6 +310,7 @@ declare class LoggerImpl implements Logger {
274
310
  DisableLevel(level: Level, ...modules: string[]): Logger;
275
311
  Module(key: string): Logger;
276
312
  SetDebug(...modules: (string | string[])[]): Logger;
313
+ SetIgnoreAttribute(re?: RegExp): Logger;
277
314
  SetFormatter(formatter: LogFormatter): Logger;
278
315
  Timestamp(): Logger;
279
316
  Warn(): Logger;
@@ -352,41 +389,18 @@ declare function MockLogger(params?: {
352
389
  declare class LevelHandlerImpl implements LevelHandler {
353
390
  readonly _globalLevels: Set<Level>;
354
391
  readonly _modules: Map<string, Set<Level>>;
392
+ ignoreAttr: Option<RegExp>;
355
393
  isStackExposed: boolean;
356
394
  enableLevel(level: Level, ...modules: string[]): void;
357
395
  disableLevel(level: Level, ...modules: string[]): void;
358
396
  setExposeStack(enable?: boolean): void;
397
+ setIgnoreAttr(re?: RegExp): void;
359
398
  forModules(level: Level, fnAction: (p: string) => void, ...modules: (string | string[])[]): void;
360
399
  setDebug(...modules: (string | string[])[]): void;
361
400
  isEnabled(ilevel: unknown, module: unknown): boolean;
362
401
  }
363
402
  declare function LevelHandlerSingleton(): LevelHandler;
364
403
 
365
- declare abstract class Option<T> {
366
- static Some<T>(t: T): Option<T>;
367
- static None<T>(): Option<T>;
368
- static Is<T>(t: unknown): t is Option<T>;
369
- IsNone(): boolean;
370
- IsSome(): boolean;
371
- Unwrap(): T;
372
- abstract is_none(): boolean;
373
- abstract is_some(): boolean;
374
- abstract unwrap(): T;
375
- }
376
- declare class Some<T> extends Option<T> {
377
- private _t;
378
- constructor(_t: T);
379
- is_none(): boolean;
380
- is_some(): boolean;
381
- unwrap(): T;
382
- }
383
- declare class None<T> extends Option<T> {
384
- is_none(): boolean;
385
- is_some(): boolean;
386
- unwrap(): T;
387
- }
388
- type WithoutOption<T> = T extends Option<infer U> ? U : T;
389
-
390
404
  type TraceCtx = {
391
405
  readonly spanId: string;
392
406
  readonly time: Time;
@@ -576,4 +590,4 @@ declare function bin2string(hex: ArrayBufferView, size?: number): string;
576
590
 
577
591
  declare const VERSION: string;
578
592
 
579
- export { type AsError, BuildURI, type CTAesKeyAlgorithm, type CTAlgorithm, type CTAlgorithmIdentifier, type CTArrayBufferView, type CTBufferSource, type CTCryptoKey, type CTEcKeyImportParams, type CTHmacImportParams, type CTJsonWebKey, type CTKeyFormat, type CTKeyType, type CTKeyUsage, type CTNamedCurve, type CTRsaHashedImportParams, type CleanCtx, type CoerceURI, type CryptoRuntime, type FnSerialized, Future, type HostURIObject, type HttpType, type Invokaction, IsLogger, JSONFormatter, Keyed, KeyedResolvOnce, KeyedResolvSeq, type KeysParam, type Lengthed, Level, type LevelHandler, LevelHandlerImpl, LevelHandlerSingleton, LogCollector, type LogFormatter, type LogSerializable, LogValue, type LogValueArg, LogWriteStream, type Logger, LoggerImpl, type LoggerImplParams, type LoggerInterface, Metric, type MetricMap, Metrics, MockLogger, type MockLoggerReturn, type MsgFn, MutableURL, None, Option, type PathURIObject, ResolveOnce, ResolveSeq, Result, ResultError, ResultOK, type Runtime, type Serialized, type SizeOrLength, type Sized, Some, SysAbstraction, Time, type TraceCtx, type TraceCtxParam, TraceNode, type TraceNodeMap, TxtEnDecoder, URI, type URIInterface, type URIObject, VERSION, type WithLogger, type WithoutOption, type WithoutResult, YAMLFormatter, asyncLogValue, bin2string, bin2text, exception2Result, hasHostPartProtocols, isURL, logValue, runtimeFn, toCryptoRuntime };
593
+ export { type AsError, BuildURI, type CTAesKeyAlgorithm, type CTAlgorithm, type CTAlgorithmIdentifier, type CTArrayBufferView, type CTBufferSource, type CTCryptoKey, type CTEcKeyImportParams, type CTHmacImportParams, type CTJsonWebKey, type CTKeyFormat, type CTKeyType, type CTKeyUsage, type CTNamedCurve, type CTRsaHashedImportParams, type CleanCtx, type CoerceURI, type CryptoRuntime, type FnSerialized, Future, type HostURIObject, type HttpType, type Invokaction, IsLogger, JSONFormatter, Keyed, KeyedResolvOnce, KeyedResolvSeq, type KeysParam, type Lengthed, Level, type LevelHandler, LevelHandlerImpl, LevelHandlerSingleton, LogCollector, type LogFormatter, type LogSerializable, LogValue, type LogValueArg, type LogValueState, LogWriteStream, type Logger, LoggerImpl, type LoggerImplParams, type LoggerInterface, Metric, type MetricMap, Metrics, MockLogger, type MockLoggerReturn, type MsgFn, MutableURL, None, Option, type PathURIObject, REQUIRED, ResolveOnce, ResolveSeq, Result, ResultError, ResultOK, type Runtime, type Serialized, type SizeOrLength, type Sized, Some, SysAbstraction, Time, type TraceCtx, type TraceCtxParam, TraceNode, type TraceNodeMap, TxtEnDecoder, URI, type URIInterface, type URIObject, VERSION, type WithLogger, type WithoutOption, type WithoutResult, YAMLFormatter, asyncLogValue, bin2string, bin2text, exception2Result, hasHostPartProtocols, isURL, logValue, runtimeFn, toCryptoRuntime };