@plyaz/types 1.14.3 → 1.14.5
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/db/index.cjs.map +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/index.cjs +61 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +58 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/types.d.ts +3 -0
- package/dist/utils/enums.d.ts +69 -0
- package/dist/utils/types.d.ts +24 -0
- package/package.json +1 -1
package/dist/logger/types.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface LoggerInterface {
|
|
|
21
21
|
}
|
|
22
22
|
export type LoggerMethodTypes = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
23
23
|
export type LoggerEnvironment = 'development' | 'production' | 'staging';
|
|
24
|
+
export type LoggerTransport = 'pino' | 'console';
|
|
24
25
|
/**
|
|
25
26
|
* Configuration for PackageLogger instances
|
|
26
27
|
*/
|
|
@@ -35,6 +36,8 @@ export interface PackageLoggerConfig {
|
|
|
35
36
|
correlationId?: string;
|
|
36
37
|
/** Minimum log level to output */
|
|
37
38
|
minLevel?: LoggerMethodTypes;
|
|
39
|
+
/** Transport type: 'pino' (structured JSON) or 'console' (formatted output with ANSI colors). Default: 'pino' */
|
|
40
|
+
transport?: LoggerTransport;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Extended logger interface with package context support
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media file extensions
|
|
3
|
+
*/
|
|
4
|
+
export declare const MEDIA_EXTENSIONS: {
|
|
5
|
+
readonly IMAGE: readonly ["jpg", "jpeg", "png", "gif", "webp", "svg", "ico", "bmp", "tiff"];
|
|
6
|
+
readonly VIDEO: readonly ["mp4", "webm", "avi", "mov", "wmv", "flv", "mkv", "3gp"];
|
|
7
|
+
readonly AUDIO: readonly ["mp3", "wav", "ogg", "aac", "flac", "m4a", "wma"];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Media MIME type prefixes
|
|
11
|
+
*/
|
|
12
|
+
export declare const MEDIA_MIME_PREFIXES: readonly ["image/", "video/", "audio/"];
|
|
13
|
+
/**
|
|
14
|
+
* ANSI color codes
|
|
15
|
+
*/
|
|
16
|
+
export declare const COLORS: {
|
|
17
|
+
readonly reset: "\u001B[0m";
|
|
18
|
+
readonly black: "\u001B[30m";
|
|
19
|
+
readonly red: "\u001B[31m";
|
|
20
|
+
readonly green: "\u001B[32m";
|
|
21
|
+
readonly yellow: "\u001B[33m";
|
|
22
|
+
readonly blue: "\u001B[34m";
|
|
23
|
+
readonly magenta: "\u001B[35m";
|
|
24
|
+
readonly cyan: "\u001B[36m";
|
|
25
|
+
readonly white: "\u001B[37m";
|
|
26
|
+
readonly gray: "\u001B[90m";
|
|
27
|
+
readonly brightRed: "\u001B[91m";
|
|
28
|
+
readonly brightGreen: "\u001B[92m";
|
|
29
|
+
readonly brightYellow: "\u001B[93m";
|
|
30
|
+
readonly brightBlue: "\u001B[94m";
|
|
31
|
+
readonly brightMagenta: "\u001B[95m";
|
|
32
|
+
readonly brightCyan: "\u001B[96m";
|
|
33
|
+
readonly brightWhite: "\u001B[97m";
|
|
34
|
+
readonly bgRed: "\u001B[41m";
|
|
35
|
+
readonly bgGreen: "\u001B[42m";
|
|
36
|
+
readonly bgYellow: "\u001B[43m";
|
|
37
|
+
readonly bgBlue: "\u001B[44m";
|
|
38
|
+
readonly bgMagenta: "\u001B[45m";
|
|
39
|
+
readonly bgCyan: "\u001B[46m";
|
|
40
|
+
readonly bgWhite: "\u001B[47m";
|
|
41
|
+
readonly bold: "\u001B[1m";
|
|
42
|
+
readonly dim: "\u001B[2m";
|
|
43
|
+
readonly italic: "\u001B[3m";
|
|
44
|
+
readonly underline: "\u001B[4m";
|
|
45
|
+
readonly blink: "\u001B[5m";
|
|
46
|
+
readonly reverse: "\u001B[7m";
|
|
47
|
+
readonly hidden: "\u001B[8m";
|
|
48
|
+
readonly strikethrough: "\u001B[9m";
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Correlation ID types for different contexts
|
|
52
|
+
* Used across packages for distributed tracing and event correlation
|
|
53
|
+
*/
|
|
54
|
+
export declare enum CORRELATION_TYPE {
|
|
55
|
+
/** Network event correlation */
|
|
56
|
+
NETWORK = "net",
|
|
57
|
+
/** API request correlation */
|
|
58
|
+
API = "api",
|
|
59
|
+
/** User session correlation */
|
|
60
|
+
SESSION = "session",
|
|
61
|
+
/** Transaction correlation */
|
|
62
|
+
TRANSACTION = "txn",
|
|
63
|
+
/** Event correlation */
|
|
64
|
+
EVENT = "evt",
|
|
65
|
+
/** Trace correlation */
|
|
66
|
+
TRACE = "trace",
|
|
67
|
+
/** Generic correlation */
|
|
68
|
+
GENERIC = "corr"
|
|
69
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Types
|
|
3
|
+
* Common types used across packages
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* ID generation options
|
|
7
|
+
* Used for generating unique identifiers across packages
|
|
8
|
+
*/
|
|
9
|
+
export interface IdGenerationOptions {
|
|
10
|
+
/** Prefix for the ID */
|
|
11
|
+
prefix?: string;
|
|
12
|
+
/** Suffix for the ID */
|
|
13
|
+
suffix?: string;
|
|
14
|
+
/** Use timestamp-based ID instead of UUID */
|
|
15
|
+
useTimestamp?: boolean;
|
|
16
|
+
/** Separator for components */
|
|
17
|
+
separator?: string;
|
|
18
|
+
/** Include random component for timestamp IDs */
|
|
19
|
+
includeRandom?: boolean;
|
|
20
|
+
/** Radix for number conversion (2-36) */
|
|
21
|
+
radix?: number;
|
|
22
|
+
/** Length of random component */
|
|
23
|
+
randomLength?: number;
|
|
24
|
+
}
|
package/package.json
CHANGED