@alepha/devtools 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/dist/index.d.ts +251 -253
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -46
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/DevCollectorProvider.ts +19 -4
- package/src/schemas/DevActionMetadata.ts +9 -9
- package/src/schemas/DevBucketMetadata.ts +4 -4
- package/src/schemas/DevCacheMetadata.ts +2 -2
- package/src/schemas/DevLogEntry.ts +1 -1
- package/src/schemas/DevMetadata.ts +0 -2
- package/src/schemas/DevModuleMetadata.ts +2 -2
- package/src/schemas/DevPageMetadata.ts +3 -3
- package/src/schemas/DevProviderMetadata.ts +4 -4
- package/src/schemas/DevQueueMetadata.ts +3 -3
- package/src/schemas/DevRealmMetadata.ts +2 -2
- package/src/schemas/DevSchedulerMetadata.ts +3 -3
- package/src/schemas/DevTopicMetadata.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alepha/devtools",
|
|
3
3
|
"description": "Developer tools for monitoring and debugging Alepha applications.",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=22.0.0"
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alepha/bucket": "0.10.
|
|
18
|
-
"@alepha/cache": "0.10.
|
|
19
|
-
"@alepha/core": "0.10.
|
|
20
|
-
"@alepha/logger": "0.10.
|
|
21
|
-
"@alepha/queue": "0.10.
|
|
22
|
-
"@alepha/react": "0.10.
|
|
23
|
-
"@alepha/scheduler": "0.10.
|
|
24
|
-
"@alepha/security": "0.10.
|
|
25
|
-
"@alepha/server": "0.10.
|
|
26
|
-
"@alepha/topic": "0.10.
|
|
17
|
+
"@alepha/bucket": "0.10.5",
|
|
18
|
+
"@alepha/cache": "0.10.5",
|
|
19
|
+
"@alepha/core": "0.10.5",
|
|
20
|
+
"@alepha/logger": "0.10.5",
|
|
21
|
+
"@alepha/queue": "0.10.5",
|
|
22
|
+
"@alepha/react": "0.10.5",
|
|
23
|
+
"@alepha/scheduler": "0.10.5",
|
|
24
|
+
"@alepha/security": "0.10.5",
|
|
25
|
+
"@alepha/server": "0.10.5",
|
|
26
|
+
"@alepha/topic": "0.10.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@biomejs/biome": "^2.2.5",
|
|
@@ -25,7 +25,7 @@ import type { DevTopicMetadata } from "./schemas/DevTopicMetadata.ts";
|
|
|
25
25
|
export class DevCollectorProvider {
|
|
26
26
|
protected readonly alepha = $inject(Alepha);
|
|
27
27
|
protected readonly logs: DevLogEntry[] = [];
|
|
28
|
-
protected readonly maxLogs =
|
|
28
|
+
protected readonly maxLogs = 10000;
|
|
29
29
|
|
|
30
30
|
protected readonly onLog = $hook({
|
|
31
31
|
on: "log",
|
|
@@ -35,7 +35,7 @@ export class DevCollectorProvider {
|
|
|
35
35
|
entry: ev.entry,
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
// Keep only the last
|
|
38
|
+
// Keep only the last 10000 logs
|
|
39
39
|
if (this.logs.length > this.maxLogs) {
|
|
40
40
|
this.logs.shift();
|
|
41
41
|
}
|
|
@@ -46,7 +46,7 @@ export class DevCollectorProvider {
|
|
|
46
46
|
method: "GET",
|
|
47
47
|
path: "/devtools",
|
|
48
48
|
schema: {
|
|
49
|
-
response: t.
|
|
49
|
+
response: t.text(),
|
|
50
50
|
},
|
|
51
51
|
handler: () => {
|
|
52
52
|
return ui;
|
|
@@ -64,6 +64,22 @@ export class DevCollectorProvider {
|
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
protected readonly logsRoute = $route({
|
|
68
|
+
method: "GET",
|
|
69
|
+
path: "/devtools/logs",
|
|
70
|
+
schema: {
|
|
71
|
+
response: t.array(
|
|
72
|
+
t.object({
|
|
73
|
+
formatted: t.text(),
|
|
74
|
+
entry: t.any(),
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
77
|
+
},
|
|
78
|
+
handler: () => {
|
|
79
|
+
return this.getLogs();
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
67
83
|
public getLogs(): DevLogEntry[] {
|
|
68
84
|
return this.logs;
|
|
69
85
|
}
|
|
@@ -230,7 +246,6 @@ export class DevCollectorProvider {
|
|
|
230
246
|
|
|
231
247
|
public getMetadata(): DevMetadata {
|
|
232
248
|
return {
|
|
233
|
-
logs: this.getLogs(),
|
|
234
249
|
actions: this.getActions(),
|
|
235
250
|
queues: this.getQueues(),
|
|
236
251
|
schedulers: this.getSchedulers(),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devActionMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
group: t.
|
|
6
|
-
method: t.
|
|
7
|
-
path: t.
|
|
8
|
-
prefix: t.
|
|
9
|
-
fullPath: t.
|
|
10
|
-
description: t.optional(t.
|
|
11
|
-
summary: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
group: t.text(),
|
|
6
|
+
method: t.text(),
|
|
7
|
+
path: t.text(),
|
|
8
|
+
prefix: t.text(),
|
|
9
|
+
fullPath: t.text(),
|
|
10
|
+
description: t.optional(t.text()),
|
|
11
|
+
summary: t.optional(t.text()),
|
|
12
12
|
disabled: t.optional(t.boolean()),
|
|
13
13
|
secure: t.optional(t.boolean()),
|
|
14
14
|
hide: t.optional(t.boolean()),
|
|
@@ -16,7 +16,7 @@ export const devActionMetadataSchema = t.object({
|
|
|
16
16
|
params: t.optional(t.any()),
|
|
17
17
|
query: t.optional(t.any()),
|
|
18
18
|
response: t.optional(t.any()),
|
|
19
|
-
bodyContentType: t.optional(t.
|
|
19
|
+
bodyContentType: t.optional(t.text()),
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
export type DevActionMetadata = Static<typeof devActionMetadataSchema>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devBucketMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
6
|
-
mimeTypes: t.optional(t.array(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
|
+
mimeTypes: t.optional(t.array(t.text())),
|
|
7
7
|
maxSize: t.optional(t.number()),
|
|
8
|
-
provider: t.
|
|
8
|
+
provider: t.text(),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devCacheMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
4
|
+
name: t.text(),
|
|
5
5
|
ttl: t.optional(t.any()),
|
|
6
6
|
disabled: t.optional(t.boolean()),
|
|
7
|
-
provider: t.
|
|
7
|
+
provider: t.text(),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;
|
|
@@ -2,7 +2,7 @@ import { type Static, t } from "@alepha/core";
|
|
|
2
2
|
import type { LogEntry } from "@alepha/logger";
|
|
3
3
|
|
|
4
4
|
export const devLogEntrySchema = t.object({
|
|
5
|
-
formatted: t.
|
|
5
|
+
formatted: t.text(),
|
|
6
6
|
entry: t.any(), // Use any since LogEntry has Date instead of string for timestamp
|
|
7
7
|
});
|
|
8
8
|
|
|
@@ -2,7 +2,6 @@ import { type Static, t } from "@alepha/core";
|
|
|
2
2
|
import { devActionMetadataSchema } from "./DevActionMetadata.ts";
|
|
3
3
|
import { devBucketMetadataSchema } from "./DevBucketMetadata.ts";
|
|
4
4
|
import { devCacheMetadataSchema } from "./DevCacheMetadata.ts";
|
|
5
|
-
import { devLogEntrySchema } from "./DevLogEntry.ts";
|
|
6
5
|
import { devModuleMetadataSchema } from "./DevModuleMetadata.ts";
|
|
7
6
|
import { devPageMetadataSchema } from "./DevPageMetadata.ts";
|
|
8
7
|
import { devProviderMetadataSchema } from "./DevProviderMetadata.ts";
|
|
@@ -12,7 +11,6 @@ import { devSchedulerMetadataSchema } from "./DevSchedulerMetadata.ts";
|
|
|
12
11
|
import { devTopicMetadataSchema } from "./DevTopicMetadata.ts";
|
|
13
12
|
|
|
14
13
|
export const devMetadataSchema = t.object({
|
|
15
|
-
logs: t.array(devLogEntrySchema),
|
|
16
14
|
actions: t.array(devActionMetadataSchema),
|
|
17
15
|
queues: t.array(devQueueMetadataSchema),
|
|
18
16
|
schedulers: t.array(devSchedulerMetadataSchema),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devModuleMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
providers: t.array(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
providers: t.array(t.text()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
export type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devPageMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
6
|
-
path: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
|
+
path: t.optional(t.text()),
|
|
7
7
|
params: t.optional(t.any()),
|
|
8
8
|
query: t.optional(t.any()),
|
|
9
9
|
hasComponent: t.boolean(),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devProviderMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
module: t.optional(t.
|
|
6
|
-
dependencies: t.array(t.
|
|
7
|
-
aliases: t.optional(t.array(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
module: t.optional(t.text()),
|
|
6
|
+
dependencies: t.array(t.text()),
|
|
7
|
+
aliases: t.optional(t.array(t.text())),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devQueueMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
6
|
schema: t.optional(t.any()),
|
|
7
|
-
provider: t.
|
|
7
|
+
provider: t.text(),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devRealmMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
6
|
roles: t.optional(t.array(t.any())),
|
|
7
7
|
type: t.enum(["internal", "external"]),
|
|
8
8
|
settings: t.optional(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devSchedulerMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
6
|
-
cron: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
|
+
cron: t.optional(t.text()),
|
|
7
7
|
interval: t.optional(t.any()),
|
|
8
8
|
lock: t.optional(t.boolean()),
|
|
9
9
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Static, t } from "@alepha/core";
|
|
2
2
|
|
|
3
3
|
export const devTopicMetadataSchema = t.object({
|
|
4
|
-
name: t.
|
|
5
|
-
description: t.optional(t.
|
|
4
|
+
name: t.text(),
|
|
5
|
+
description: t.optional(t.text()),
|
|
6
6
|
schema: t.optional(t.any()),
|
|
7
|
-
provider: t.
|
|
7
|
+
provider: t.text(),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
|