alepha 0.10.3 → 0.10.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/logger.d.ts CHANGED
@@ -1,7 +1,21 @@
1
1
  import * as _alepha_core0 from "alepha";
2
2
  import { Alepha, KIND, LogLevel, LoggerInterface, Static } from "alepha";
3
+ import { DateTimeProvider } from "alepha/datetime";
3
4
  import * as typebox0 from "typebox";
4
5
 
6
+ //#region src/schemas/logEntrySchema.d.ts
7
+ declare const logEntrySchema: typebox0.TObject<{
8
+ level: typebox0.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
9
+ message: typebox0.TString;
10
+ service: typebox0.TString;
11
+ module: typebox0.TString;
12
+ context: typebox0.TOptional<typebox0.TString>;
13
+ app: typebox0.TOptional<typebox0.TString>;
14
+ data: typebox0.TOptional<typebox0.TAny>;
15
+ timestamp: typebox0.TString;
16
+ }>;
17
+ type LogEntry = Static<typeof logEntrySchema>;
18
+ //#endregion
5
19
  //#region src/providers/LogDestinationProvider.d.ts
6
20
  declare abstract class LogDestinationProvider {
7
21
  abstract write(message: string, entry: LogEntry): void;
@@ -17,6 +31,7 @@ declare class Logger implements LoggerInterface {
17
31
  protected readonly alepha: Alepha;
18
32
  protected readonly formatter: LogFormatterProvider;
19
33
  protected readonly destination: LogDestinationProvider;
34
+ protected readonly dateTimeProvider: DateTimeProvider;
20
35
  protected readonly levels: Record<string, number>;
21
36
  protected readonly service: string;
22
37
  protected readonly module: string;
@@ -36,16 +51,6 @@ declare class Logger implements LoggerInterface {
36
51
  trace(message: string, data?: unknown): void;
37
52
  protected log(level: LogLevel, message: string, data?: unknown): void;
38
53
  }
39
- interface LogEntry {
40
- level: LogLevel;
41
- message: string;
42
- service: string;
43
- module: string;
44
- context?: string;
45
- data?: object | Error | string;
46
- app?: string;
47
- timestamp: Date;
48
- }
49
54
  //#endregion
50
55
  //#region src/descriptors/$logger.d.ts
51
56
  /**
@@ -78,21 +83,21 @@ interface LoggerDescriptorOptions {
78
83
  //#region src/providers/ConsoleColorProvider.d.ts
79
84
  declare class ConsoleColorProvider {
80
85
  static readonly COLORS: {
81
- reset: string;
82
- grey: string;
83
- red: string;
84
- orange: string;
85
- green: string;
86
- blue: string;
87
- white: string;
88
- cyan: string;
89
- darkGrey: string;
90
- silent: string;
91
- error: string;
92
- warn: string;
93
- info: string;
94
- debug: string;
95
- trace: string;
86
+ RESET: string;
87
+ GREY: string;
88
+ RED: string;
89
+ ORANGE: string;
90
+ GREEN: string;
91
+ BLUE: string;
92
+ WHITE: string;
93
+ CYAN: string;
94
+ DARK_GREY: string;
95
+ SILENT: string;
96
+ ERROR: string;
97
+ WARN: string;
98
+ INFO: string;
99
+ DEBUG: string;
100
+ TRACE: string;
96
101
  };
97
102
  protected readonly env: {
98
103
  NO_COLOR?: string | undefined;
@@ -102,7 +107,7 @@ declare class ConsoleColorProvider {
102
107
  protected enabled: boolean;
103
108
  constructor();
104
109
  isEnabled(): boolean;
105
- colorize(color: keyof typeof ConsoleColorProvider.COLORS, text: string, reset?: string): string;
110
+ set(color: keyof typeof ConsoleColorProvider.COLORS, text: string, reset?: string): string;
106
111
  }
107
112
  //#endregion
108
113
  //#region src/providers/ConsoleDestinationProvider.d.ts
@@ -125,7 +130,16 @@ declare class MemoryDestinationProvider extends LogDestinationProvider {
125
130
  maxEntries: number;
126
131
  };
127
132
  write(formatted: string, entry: LogEntry): void;
128
- get logs(): (LogEntry & {
133
+ get logs(): ({
134
+ context?: string | undefined;
135
+ app?: string | undefined;
136
+ data?: any;
137
+ level: "SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
138
+ message: string;
139
+ service: string;
140
+ module: string;
141
+ timestamp: string;
142
+ } & {
129
143
  formatted: string;
130
144
  })[];
131
145
  clear(): void;
@@ -136,7 +150,7 @@ declare class SimpleFormatterProvider extends LogFormatterProvider {
136
150
  protected color: ConsoleColorProvider;
137
151
  protected alepha: Alepha;
138
152
  format(entry: LogEntry): string;
139
- formatTimestamp(d: Date): string;
153
+ formatTimestamp(iso: string): string;
140
154
  protected pad2: (n: number) => string;
141
155
  protected pad3: (n: number) => string;
142
156
  protected formatError(error: Error): string;
@@ -255,6 +269,7 @@ declare module "alepha" {
255
269
  }
256
270
  }
257
271
  //# sourceMappingURL=index.d.ts.map
272
+
258
273
  //#endregion
259
- export { $logger, AlephaLogger, ConsoleColorProvider, ConsoleDestinationProvider, JsonFormatterProvider, LogDestinationProvider, LogEntry, LogFormatterProvider, Logger, LoggerDescriptorOptions, MemoryDestinationProvider, SimpleFormatterProvider };
274
+ export { $logger, AlephaLogger, ConsoleColorProvider, ConsoleDestinationProvider, JsonFormatterProvider, LogDestinationProvider, LogEntry, LogFormatterProvider, Logger, LoggerDescriptorOptions, MemoryDestinationProvider, SimpleFormatterProvider, logEntrySchema };
260
275
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alepha",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -15,48 +15,52 @@
15
15
  "main": "./core.js",
16
16
  "types": "./core.d.ts",
17
17
  "dependencies": {
18
- "@alepha/batch": "0.10.3",
19
- "@alepha/bucket": "0.10.3",
20
- "@alepha/cache": "0.10.3",
21
- "@alepha/cache-redis": "0.10.3",
22
- "@alepha/command": "0.10.3",
23
- "@alepha/core": "0.10.3",
24
- "@alepha/datetime": "0.10.3",
25
- "@alepha/email": "0.10.3",
26
- "@alepha/file": "0.10.3",
27
- "@alepha/lock": "0.10.3",
28
- "@alepha/lock-redis": "0.10.3",
29
- "@alepha/logger": "0.10.3",
30
- "@alepha/postgres": "0.10.3",
31
- "@alepha/queue": "0.10.3",
32
- "@alepha/queue-redis": "0.10.3",
33
- "@alepha/react": "0.10.3",
34
- "@alepha/react-auth": "0.10.3",
35
- "@alepha/react-form": "0.10.3",
36
- "@alepha/react-head": "0.10.3",
37
- "@alepha/react-i18n": "0.10.3",
38
- "@alepha/redis": "0.10.3",
39
- "@alepha/retry": "0.10.3",
40
- "@alepha/router": "0.10.3",
41
- "@alepha/scheduler": "0.10.3",
42
- "@alepha/security": "0.10.3",
43
- "@alepha/server": "0.10.3",
44
- "@alepha/server-cache": "0.10.3",
45
- "@alepha/server-compress": "0.10.3",
46
- "@alepha/server-cookies": "0.10.3",
47
- "@alepha/server-cors": "0.10.3",
48
- "@alepha/server-health": "0.10.3",
49
- "@alepha/server-helmet": "0.10.3",
50
- "@alepha/server-links": "0.10.3",
51
- "@alepha/server-metrics": "0.10.3",
52
- "@alepha/server-multipart": "0.10.3",
53
- "@alepha/server-proxy": "0.10.3",
54
- "@alepha/server-security": "0.10.3",
55
- "@alepha/server-static": "0.10.3",
56
- "@alepha/server-swagger": "0.10.3",
57
- "@alepha/topic": "0.10.3",
58
- "@alepha/topic-redis": "0.10.3",
59
- "@alepha/vite": "0.10.3"
18
+ "@alepha/api-files": "0.10.5",
19
+ "@alepha/api-jobs": "0.10.5",
20
+ "@alepha/api-users": "0.10.5",
21
+ "@alepha/batch": "0.10.5",
22
+ "@alepha/bucket": "0.10.5",
23
+ "@alepha/cache": "0.10.5",
24
+ "@alepha/cache-redis": "0.10.5",
25
+ "@alepha/command": "0.10.5",
26
+ "@alepha/core": "0.10.5",
27
+ "@alepha/datetime": "0.10.5",
28
+ "@alepha/devtools": "0.10.5",
29
+ "@alepha/email": "0.10.5",
30
+ "@alepha/file": "0.10.5",
31
+ "@alepha/lock": "0.10.5",
32
+ "@alepha/lock-redis": "0.10.5",
33
+ "@alepha/logger": "0.10.5",
34
+ "@alepha/postgres": "0.10.5",
35
+ "@alepha/queue": "0.10.5",
36
+ "@alepha/queue-redis": "0.10.5",
37
+ "@alepha/react": "0.10.5",
38
+ "@alepha/react-auth": "0.10.5",
39
+ "@alepha/react-form": "0.10.5",
40
+ "@alepha/react-head": "0.10.5",
41
+ "@alepha/react-i18n": "0.10.5",
42
+ "@alepha/redis": "0.10.5",
43
+ "@alepha/retry": "0.10.5",
44
+ "@alepha/router": "0.10.5",
45
+ "@alepha/scheduler": "0.10.5",
46
+ "@alepha/security": "0.10.5",
47
+ "@alepha/server": "0.10.5",
48
+ "@alepha/server-cache": "0.10.5",
49
+ "@alepha/server-compress": "0.10.5",
50
+ "@alepha/server-cookies": "0.10.5",
51
+ "@alepha/server-cors": "0.10.5",
52
+ "@alepha/server-health": "0.10.5",
53
+ "@alepha/server-helmet": "0.10.5",
54
+ "@alepha/server-links": "0.10.5",
55
+ "@alepha/server-metrics": "0.10.5",
56
+ "@alepha/server-multipart": "0.10.5",
57
+ "@alepha/server-proxy": "0.10.5",
58
+ "@alepha/server-security": "0.10.5",
59
+ "@alepha/server-static": "0.10.5",
60
+ "@alepha/server-swagger": "0.10.5",
61
+ "@alepha/topic": "0.10.5",
62
+ "@alepha/topic-redis": "0.10.5",
63
+ "@alepha/vite": "0.10.5"
60
64
  },
61
65
  "devDependencies": {
62
66
  "tsdown": "^0.15.6"
@@ -87,6 +91,21 @@
87
91
  "require": "./core.cjs",
88
92
  "types": "./core.d.ts"
89
93
  },
94
+ "./api/files": {
95
+ "import": "./api/files.js",
96
+ "require": "./api/files.cjs",
97
+ "types": "./api/files.d.ts"
98
+ },
99
+ "./api/jobs": {
100
+ "import": "./api/jobs.js",
101
+ "require": "./api/jobs.cjs",
102
+ "types": "./api/jobs.d.ts"
103
+ },
104
+ "./api/users": {
105
+ "import": "./api/users.js",
106
+ "require": "./api/users.cjs",
107
+ "types": "./api/users.d.ts"
108
+ },
90
109
  "./batch": {
91
110
  "import": "./batch.js",
92
111
  "require": "./batch.cjs",
@@ -122,6 +141,11 @@
122
141
  "require": "./datetime.cjs",
123
142
  "types": "./datetime.d.ts"
124
143
  },
144
+ "./devtools": {
145
+ "import": "./devtools.js",
146
+ "require": "./devtools.cjs",
147
+ "types": "./devtools.d.ts"
148
+ },
125
149
  "./email": {
126
150
  "import": "./email.js",
127
151
  "require": "./email.cjs",
@@ -300,6 +324,9 @@
300
324
  },
301
325
  "keywords": [
302
326
  "alepha",
327
+ "api-files",
328
+ "api-jobs",
329
+ "api-users",
303
330
  "batch",
304
331
  "bucket",
305
332
  "cache",
@@ -307,6 +334,7 @@
307
334
  "command",
308
335
  "core",
309
336
  "datetime",
337
+ "devtools",
310
338
  "email",
311
339
  "file",
312
340
  "lock",