@alepha/devtools 0.11.7 → 0.11.10
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.cjs +433 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +252 -0
- package/dist/index.d.cts.map +1 -0
- package/package.json +22 -21
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
let __alepha_core = require("@alepha/core");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_url = require("node:url");
|
|
4
|
+
let __alepha_batch = require("@alepha/batch");
|
|
5
|
+
let __alepha_logger = require("@alepha/logger");
|
|
6
|
+
let __alepha_postgres = require("@alepha/postgres");
|
|
7
|
+
let __alepha_server = require("@alepha/server");
|
|
8
|
+
let __alepha_server_static = require("@alepha/server-static");
|
|
9
|
+
let __alepha_bucket = require("@alepha/bucket");
|
|
10
|
+
let __alepha_cache = require("@alepha/cache");
|
|
11
|
+
let __alepha_queue = require("@alepha/queue");
|
|
12
|
+
let __alepha_scheduler = require("@alepha/scheduler");
|
|
13
|
+
let __alepha_security = require("@alepha/security");
|
|
14
|
+
let __alepha_topic = require("@alepha/topic");
|
|
15
|
+
|
|
16
|
+
//#region src/entities/logs.ts
|
|
17
|
+
const logs = (0, __alepha_postgres.$entity)({
|
|
18
|
+
name: "logs",
|
|
19
|
+
schema: __alepha_core.t.object({
|
|
20
|
+
id: __alepha_postgres.pg.primaryKey(),
|
|
21
|
+
level: __alepha_core.t.enum([
|
|
22
|
+
"TRACE",
|
|
23
|
+
"DEBUG",
|
|
24
|
+
"INFO",
|
|
25
|
+
"WARN",
|
|
26
|
+
"ERROR"
|
|
27
|
+
]),
|
|
28
|
+
message: __alepha_core.t.text({ size: "rich" }),
|
|
29
|
+
service: __alepha_core.t.text(),
|
|
30
|
+
module: __alepha_core.t.text(),
|
|
31
|
+
context: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
32
|
+
app: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
33
|
+
data: __alepha_core.t.optional(__alepha_core.t.json()),
|
|
34
|
+
timestamp: __alepha_core.t.datetime()
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/providers/DevToolsMetadataProvider.ts
|
|
40
|
+
var DevToolsMetadataProvider = class {
|
|
41
|
+
alepha = (0, __alepha_core.$inject)(__alepha_core.Alepha);
|
|
42
|
+
log = (0, __alepha_logger.$logger)();
|
|
43
|
+
getActions() {
|
|
44
|
+
return this.alepha.descriptors(__alepha_server.$action).map((action) => {
|
|
45
|
+
const schema = action.schema;
|
|
46
|
+
const options = action.options;
|
|
47
|
+
return {
|
|
48
|
+
name: action.name,
|
|
49
|
+
group: action.group,
|
|
50
|
+
method: action.method,
|
|
51
|
+
path: action.path,
|
|
52
|
+
prefix: action.prefix,
|
|
53
|
+
fullPath: action.route.path,
|
|
54
|
+
description: action.options.description,
|
|
55
|
+
summary: options.summary,
|
|
56
|
+
disabled: action.options.disabled,
|
|
57
|
+
secure: options.secure,
|
|
58
|
+
hide: options.hide,
|
|
59
|
+
body: schema?.body,
|
|
60
|
+
params: schema?.params,
|
|
61
|
+
query: schema?.query,
|
|
62
|
+
response: schema?.response,
|
|
63
|
+
bodyContentType: action.getBodyContentType()
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
getQueues() {
|
|
68
|
+
return this.alepha.descriptors(__alepha_queue.$queue).map((queue) => ({
|
|
69
|
+
name: queue.name,
|
|
70
|
+
description: queue.options.description,
|
|
71
|
+
schema: queue.options.schema,
|
|
72
|
+
provider: this.getProviderName(queue.options.provider)
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
getSchedulers() {
|
|
76
|
+
return this.alepha.descriptors(__alepha_scheduler.$scheduler).map((scheduler) => ({
|
|
77
|
+
name: scheduler.name,
|
|
78
|
+
description: scheduler.options.description,
|
|
79
|
+
cron: scheduler.options.cron,
|
|
80
|
+
interval: scheduler.options.interval,
|
|
81
|
+
lock: scheduler.options.lock
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
getTopics() {
|
|
85
|
+
return this.alepha.descriptors(__alepha_topic.$topic).map((topic) => ({
|
|
86
|
+
name: topic.name,
|
|
87
|
+
description: topic.options.description,
|
|
88
|
+
schema: topic.options.schema,
|
|
89
|
+
provider: this.getProviderName(topic.options.provider)
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
getBuckets() {
|
|
93
|
+
return this.alepha.descriptors(__alepha_bucket.$bucket).map((bucket) => ({
|
|
94
|
+
name: bucket.name,
|
|
95
|
+
description: bucket.options.description,
|
|
96
|
+
mimeTypes: bucket.options.mimeTypes,
|
|
97
|
+
maxSize: bucket.options.maxSize,
|
|
98
|
+
provider: this.getProviderName(bucket.options.provider)
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
getRealms() {
|
|
102
|
+
return this.alepha.descriptors(__alepha_security.$realm).map((realm) => ({
|
|
103
|
+
name: realm.name,
|
|
104
|
+
description: realm.options.description,
|
|
105
|
+
roles: realm.options.roles,
|
|
106
|
+
type: "secret" in realm.options ? "internal" : "external",
|
|
107
|
+
settings: {
|
|
108
|
+
accessTokenExpiration: realm.options.settings?.accessToken?.expiration,
|
|
109
|
+
refreshTokenExpiration: realm.options.settings?.refreshToken?.expiration,
|
|
110
|
+
hasOnCreateSession: !!realm.options.settings?.onCreateSession,
|
|
111
|
+
hasOnRefreshSession: !!realm.options.settings?.onRefreshSession,
|
|
112
|
+
hasOnDeleteSession: !!realm.options.settings?.onDeleteSession
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
getCaches() {
|
|
117
|
+
return this.alepha.descriptors(__alepha_cache.$cache).map((cache) => ({
|
|
118
|
+
name: cache.container,
|
|
119
|
+
ttl: cache.options.ttl,
|
|
120
|
+
disabled: cache.options.disabled,
|
|
121
|
+
provider: this.getProviderName(cache.options.provider)
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
getPages() {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
getProviders() {
|
|
128
|
+
const graph = this.alepha.graph();
|
|
129
|
+
return Object.entries(graph).map(([name, info]) => ({
|
|
130
|
+
name,
|
|
131
|
+
module: info.module,
|
|
132
|
+
dependencies: info.from,
|
|
133
|
+
aliases: info.as
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
getModules() {
|
|
137
|
+
const graph = this.alepha.graph();
|
|
138
|
+
const moduleMap = /* @__PURE__ */ new Map();
|
|
139
|
+
for (const [providerName, info] of Object.entries(graph)) if (info.module) {
|
|
140
|
+
if (!moduleMap.has(info.module)) moduleMap.set(info.module, /* @__PURE__ */ new Set());
|
|
141
|
+
moduleMap.get(info.module).add(providerName);
|
|
142
|
+
}
|
|
143
|
+
return Array.from(moduleMap.entries()).map(([name, providers]) => ({
|
|
144
|
+
name,
|
|
145
|
+
providers: Array.from(providers)
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
getMetadata() {
|
|
149
|
+
return {
|
|
150
|
+
actions: this.getActions(),
|
|
151
|
+
queues: this.getQueues(),
|
|
152
|
+
schedulers: this.getSchedulers(),
|
|
153
|
+
topics: this.getTopics(),
|
|
154
|
+
buckets: this.getBuckets(),
|
|
155
|
+
realms: this.getRealms(),
|
|
156
|
+
caches: this.getCaches(),
|
|
157
|
+
pages: this.getPages(),
|
|
158
|
+
providers: this.getProviders(),
|
|
159
|
+
modules: this.getModules()
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
getProviderName(provider) {
|
|
163
|
+
if (!provider) return "default";
|
|
164
|
+
if (provider === "memory") return "memory";
|
|
165
|
+
return provider.name || "custom";
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/providers/DevToolsDatabaseProvider.ts
|
|
171
|
+
var DevToolsDatabaseProvider = class extends __alepha_postgres.NodeSqliteProvider {
|
|
172
|
+
get name() {
|
|
173
|
+
return "devtools";
|
|
174
|
+
}
|
|
175
|
+
options = { path: ":memory:" };
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/repositories/LogRepository.ts
|
|
180
|
+
var LogRepository = class extends __alepha_postgres.Repository {
|
|
181
|
+
constructor() {
|
|
182
|
+
super(logs, DevToolsDatabaseProvider);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/schemas/DevActionMetadata.ts
|
|
188
|
+
const devActionMetadataSchema = __alepha_core.t.object({
|
|
189
|
+
name: __alepha_core.t.text(),
|
|
190
|
+
group: __alepha_core.t.text(),
|
|
191
|
+
method: __alepha_core.t.text(),
|
|
192
|
+
path: __alepha_core.t.text(),
|
|
193
|
+
prefix: __alepha_core.t.text(),
|
|
194
|
+
fullPath: __alepha_core.t.text(),
|
|
195
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
196
|
+
summary: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
197
|
+
disabled: __alepha_core.t.optional(__alepha_core.t.boolean()),
|
|
198
|
+
secure: __alepha_core.t.optional(__alepha_core.t.boolean()),
|
|
199
|
+
hide: __alepha_core.t.optional(__alepha_core.t.boolean()),
|
|
200
|
+
body: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
201
|
+
params: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
202
|
+
query: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
203
|
+
response: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
204
|
+
bodyContentType: __alepha_core.t.optional(__alepha_core.t.text())
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/schemas/DevBucketMetadata.ts
|
|
209
|
+
const devBucketMetadataSchema = __alepha_core.t.object({
|
|
210
|
+
name: __alepha_core.t.text(),
|
|
211
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
212
|
+
mimeTypes: __alepha_core.t.optional(__alepha_core.t.array(__alepha_core.t.text())),
|
|
213
|
+
maxSize: __alepha_core.t.optional(__alepha_core.t.number()),
|
|
214
|
+
provider: __alepha_core.t.text()
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/schemas/DevCacheMetadata.ts
|
|
219
|
+
const devCacheMetadataSchema = __alepha_core.t.object({
|
|
220
|
+
name: __alepha_core.t.text(),
|
|
221
|
+
ttl: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
222
|
+
disabled: __alepha_core.t.optional(__alepha_core.t.boolean()),
|
|
223
|
+
provider: __alepha_core.t.text()
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/schemas/DevModuleMetadata.ts
|
|
228
|
+
const devModuleMetadataSchema = __alepha_core.t.object({
|
|
229
|
+
name: __alepha_core.t.text(),
|
|
230
|
+
providers: __alepha_core.t.array(__alepha_core.t.text())
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/schemas/DevPageMetadata.ts
|
|
235
|
+
const devPageMetadataSchema = __alepha_core.t.object({
|
|
236
|
+
name: __alepha_core.t.text(),
|
|
237
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
238
|
+
path: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
239
|
+
params: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
240
|
+
query: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
241
|
+
hasComponent: __alepha_core.t.boolean(),
|
|
242
|
+
hasLazy: __alepha_core.t.boolean(),
|
|
243
|
+
hasResolve: __alepha_core.t.boolean(),
|
|
244
|
+
hasChildren: __alepha_core.t.boolean(),
|
|
245
|
+
hasParent: __alepha_core.t.boolean(),
|
|
246
|
+
hasErrorHandler: __alepha_core.t.boolean(),
|
|
247
|
+
static: __alepha_core.t.optional(__alepha_core.t.boolean()),
|
|
248
|
+
cache: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
249
|
+
client: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
250
|
+
animation: __alepha_core.t.optional(__alepha_core.t.any())
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/schemas/DevProviderMetadata.ts
|
|
255
|
+
const devProviderMetadataSchema = __alepha_core.t.object({
|
|
256
|
+
name: __alepha_core.t.text(),
|
|
257
|
+
module: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
258
|
+
dependencies: __alepha_core.t.array(__alepha_core.t.text()),
|
|
259
|
+
aliases: __alepha_core.t.optional(__alepha_core.t.array(__alepha_core.t.text()))
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/schemas/DevQueueMetadata.ts
|
|
264
|
+
const devQueueMetadataSchema = __alepha_core.t.object({
|
|
265
|
+
name: __alepha_core.t.text(),
|
|
266
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
267
|
+
schema: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
268
|
+
provider: __alepha_core.t.text()
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/schemas/DevRealmMetadata.ts
|
|
273
|
+
const devRealmMetadataSchema = __alepha_core.t.object({
|
|
274
|
+
name: __alepha_core.t.text(),
|
|
275
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
276
|
+
roles: __alepha_core.t.optional(__alepha_core.t.array(__alepha_core.t.any())),
|
|
277
|
+
type: __alepha_core.t.enum(["internal", "external"]),
|
|
278
|
+
settings: __alepha_core.t.optional(__alepha_core.t.object({
|
|
279
|
+
accessTokenExpiration: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
280
|
+
refreshTokenExpiration: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
281
|
+
hasOnCreateSession: __alepha_core.t.boolean(),
|
|
282
|
+
hasOnRefreshSession: __alepha_core.t.boolean(),
|
|
283
|
+
hasOnDeleteSession: __alepha_core.t.boolean()
|
|
284
|
+
}))
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/schemas/DevSchedulerMetadata.ts
|
|
289
|
+
const devSchedulerMetadataSchema = __alepha_core.t.object({
|
|
290
|
+
name: __alepha_core.t.text(),
|
|
291
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
292
|
+
cron: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
293
|
+
interval: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
294
|
+
lock: __alepha_core.t.optional(__alepha_core.t.boolean())
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/schemas/DevTopicMetadata.ts
|
|
299
|
+
const devTopicMetadataSchema = __alepha_core.t.object({
|
|
300
|
+
name: __alepha_core.t.text(),
|
|
301
|
+
description: __alepha_core.t.optional(__alepha_core.t.text()),
|
|
302
|
+
schema: __alepha_core.t.optional(__alepha_core.t.any()),
|
|
303
|
+
provider: __alepha_core.t.text()
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/schemas/DevMetadata.ts
|
|
308
|
+
const devMetadataSchema = __alepha_core.t.object({
|
|
309
|
+
actions: __alepha_core.t.array(devActionMetadataSchema),
|
|
310
|
+
queues: __alepha_core.t.array(devQueueMetadataSchema),
|
|
311
|
+
schedulers: __alepha_core.t.array(devSchedulerMetadataSchema),
|
|
312
|
+
topics: __alepha_core.t.array(devTopicMetadataSchema),
|
|
313
|
+
buckets: __alepha_core.t.array(devBucketMetadataSchema),
|
|
314
|
+
realms: __alepha_core.t.array(devRealmMetadataSchema),
|
|
315
|
+
caches: __alepha_core.t.array(devCacheMetadataSchema),
|
|
316
|
+
pages: __alepha_core.t.array(devPageMetadataSchema),
|
|
317
|
+
providers: __alepha_core.t.array(devProviderMetadataSchema),
|
|
318
|
+
modules: __alepha_core.t.array(devModuleMetadataSchema)
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/DevToolsProvider.ts
|
|
323
|
+
var DevToolsProvider = class {
|
|
324
|
+
log = (0, __alepha_logger.$logger)();
|
|
325
|
+
alepha = (0, __alepha_core.$inject)(__alepha_core.Alepha);
|
|
326
|
+
serverProvider = (0, __alepha_core.$inject)(__alepha_server.ServerProvider);
|
|
327
|
+
jsonFormatter = (0, __alepha_core.$inject)(__alepha_logger.JsonFormatterProvider);
|
|
328
|
+
logs = (0, __alepha_core.$inject)(LogRepository);
|
|
329
|
+
devCollectorProvider = (0, __alepha_core.$inject)(DevToolsMetadataProvider);
|
|
330
|
+
onStart = (0, __alepha_core.$hook)({
|
|
331
|
+
on: "start",
|
|
332
|
+
handler: () => {
|
|
333
|
+
this.log.info(`Devtools available at ${this.serverProvider.hostname}/devtools/`);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
batchLogs = (0, __alepha_batch.$batch)({
|
|
337
|
+
maxSize: 50,
|
|
338
|
+
maxDuration: [10, "seconds"],
|
|
339
|
+
schema: logs.insertSchema,
|
|
340
|
+
handler: async (entries) => {
|
|
341
|
+
await this.logs.createMany(entries);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
onLog = (0, __alepha_core.$hook)({
|
|
345
|
+
on: "log",
|
|
346
|
+
handler: async (ev) => {
|
|
347
|
+
try {
|
|
348
|
+
if (!this.alepha.isStarted()) return;
|
|
349
|
+
if (ev.entry.module === "alepha.devtools") return;
|
|
350
|
+
if (ev.entry.level === "TRACE" && ev.entry.module === "alepha.batch") return;
|
|
351
|
+
if (this.alepha.isProduction() && ev.entry.level === "TRACE") return;
|
|
352
|
+
const entry = {
|
|
353
|
+
...ev.entry,
|
|
354
|
+
data: ev.entry.data instanceof Error ? this.jsonFormatter.formatJsonError(ev.entry.data) : typeof ev.entry.data === "object" && !Array.isArray(ev.entry.data) ? ev.entry.data : { data: ev.entry.data }
|
|
355
|
+
};
|
|
356
|
+
await this.batchLogs.push(entry);
|
|
357
|
+
} catch (error) {
|
|
358
|
+
console.error(error, ev);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
uiRoute = (0, __alepha_server_static.$serve)({
|
|
363
|
+
path: "/devtools",
|
|
364
|
+
root: (0, node_path.join)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href), "../../assets/devtools"),
|
|
365
|
+
historyApiFallback: true
|
|
366
|
+
});
|
|
367
|
+
metadataRoute = (0, __alepha_server.$route)({
|
|
368
|
+
method: "GET",
|
|
369
|
+
path: "/devtools/api/metadata",
|
|
370
|
+
silent: true,
|
|
371
|
+
schema: { response: devMetadataSchema },
|
|
372
|
+
handler: () => {
|
|
373
|
+
return this.devCollectorProvider.getMetadata();
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
logsRoute = (0, __alepha_server.$route)({
|
|
377
|
+
method: "GET",
|
|
378
|
+
path: "/devtools/api/logs",
|
|
379
|
+
silent: true,
|
|
380
|
+
schema: {
|
|
381
|
+
query: __alepha_core.t.extend(__alepha_core.pageQuerySchema, { search: __alepha_core.t.optional(__alepha_core.t.string()) }),
|
|
382
|
+
response: __alepha_core.t.page(__alepha_logger.logEntrySchema)
|
|
383
|
+
},
|
|
384
|
+
handler: ({ query }) => {
|
|
385
|
+
query.sort ??= "-timestamp";
|
|
386
|
+
return this.logs.paginate(query, query.search ? { where: (0, __alepha_postgres.parseQueryString)(query.search) } : {}, { count: true });
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/index.ts
|
|
393
|
+
/**
|
|
394
|
+
* Developer tools module for monitoring and debugging Alepha applications.
|
|
395
|
+
*
|
|
396
|
+
* This module provides comprehensive data collection capabilities for tracking application behavior,
|
|
397
|
+
* performance metrics, and debugging information in real-time.
|
|
398
|
+
*
|
|
399
|
+
* @see {@link DevToolsMetadataProvider}
|
|
400
|
+
* @module alepha.devtools
|
|
401
|
+
*/
|
|
402
|
+
const AlephaDevtools = (0, __alepha_core.$module)({
|
|
403
|
+
name: "alepha.devtools",
|
|
404
|
+
descriptors: [],
|
|
405
|
+
services: [
|
|
406
|
+
DevToolsMetadataProvider,
|
|
407
|
+
DevToolsProvider,
|
|
408
|
+
DevToolsDatabaseProvider,
|
|
409
|
+
LogRepository
|
|
410
|
+
],
|
|
411
|
+
register: (alepha) => {
|
|
412
|
+
alepha.with(DevToolsProvider);
|
|
413
|
+
alepha.with(DevToolsDatabaseProvider);
|
|
414
|
+
alepha.with(DevToolsMetadataProvider);
|
|
415
|
+
alepha.state.push("alepha.build.assets", "@alepha/devtools");
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
//#endregion
|
|
420
|
+
exports.AlephaDevtools = AlephaDevtools;
|
|
421
|
+
exports.DevToolsMetadataProvider = DevToolsMetadataProvider;
|
|
422
|
+
exports.devActionMetadataSchema = devActionMetadataSchema;
|
|
423
|
+
exports.devBucketMetadataSchema = devBucketMetadataSchema;
|
|
424
|
+
exports.devCacheMetadataSchema = devCacheMetadataSchema;
|
|
425
|
+
exports.devMetadataSchema = devMetadataSchema;
|
|
426
|
+
exports.devModuleMetadataSchema = devModuleMetadataSchema;
|
|
427
|
+
exports.devPageMetadataSchema = devPageMetadataSchema;
|
|
428
|
+
exports.devProviderMetadataSchema = devProviderMetadataSchema;
|
|
429
|
+
exports.devQueueMetadataSchema = devQueueMetadataSchema;
|
|
430
|
+
exports.devRealmMetadataSchema = devRealmMetadataSchema;
|
|
431
|
+
exports.devSchedulerMetadataSchema = devSchedulerMetadataSchema;
|
|
432
|
+
exports.devTopicMetadataSchema = devTopicMetadataSchema;
|
|
433
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["t","pg","Alepha","$action","$queue","$scheduler","$topic","$bucket","$realm","$cache","NodeSqliteProvider","Repository","t","t","t","t","t","t","t","t","t","t","t","Alepha","ServerProvider","JsonFormatterProvider","t","pageQuerySchema","logEntrySchema"],"sources":["../src/entities/logs.ts","../src/providers/DevToolsMetadataProvider.ts","../src/providers/DevToolsDatabaseProvider.ts","../src/repositories/LogRepository.ts","../src/schemas/DevActionMetadata.ts","../src/schemas/DevBucketMetadata.ts","../src/schemas/DevCacheMetadata.ts","../src/schemas/DevModuleMetadata.ts","../src/schemas/DevPageMetadata.ts","../src/schemas/DevProviderMetadata.ts","../src/schemas/DevQueueMetadata.ts","../src/schemas/DevRealmMetadata.ts","../src/schemas/DevSchedulerMetadata.ts","../src/schemas/DevTopicMetadata.ts","../src/schemas/DevMetadata.ts","../src/DevToolsProvider.ts","../src/index.ts"],"sourcesContent":["import { type Static, t } from \"@alepha/core\";\nimport { $entity, pg } from \"@alepha/postgres\";\n\nexport const logs = $entity({\n name: \"logs\",\n schema: t.object({\n id: pg.primaryKey(),\n level: t.enum([\"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\"]),\n message: t.text({\n size: \"rich\",\n }),\n service: t.text(),\n module: t.text(),\n context: t.optional(t.text()),\n app: t.optional(t.text()),\n data: t.optional(t.json()),\n timestamp: t.datetime(),\n }),\n});\n\nexport type DevLogEntry = Static<typeof logs.schema>;\n","import { $bucket } from \"@alepha/bucket\";\nimport { $cache } from \"@alepha/cache\";\nimport { $inject, Alepha } from \"@alepha/core\";\nimport { $logger } from \"@alepha/logger\";\nimport { $queue } from \"@alepha/queue\";\nimport { $scheduler } from \"@alepha/scheduler\";\nimport { $realm } from \"@alepha/security\";\nimport { $action } from \"@alepha/server\";\nimport { $topic } from \"@alepha/topic\";\nimport type { DevActionMetadata } from \"../schemas/DevActionMetadata.ts\";\nimport type { DevBucketMetadata } from \"../schemas/DevBucketMetadata.ts\";\nimport type { DevCacheMetadata } from \"../schemas/DevCacheMetadata.ts\";\nimport type { DevMetadata } from \"../schemas/DevMetadata.ts\";\nimport type { DevModuleMetadata } from \"../schemas/DevModuleMetadata.ts\";\nimport type { DevPageMetadata } from \"../schemas/DevPageMetadata.ts\";\nimport type { DevProviderMetadata } from \"../schemas/DevProviderMetadata.ts\";\nimport type { DevQueueMetadata } from \"../schemas/DevQueueMetadata.ts\";\nimport type { DevRealmMetadata } from \"../schemas/DevRealmMetadata.ts\";\nimport type { DevSchedulerMetadata } from \"../schemas/DevSchedulerMetadata.ts\";\nimport type { DevTopicMetadata } from \"../schemas/DevTopicMetadata.ts\";\n\nexport class DevToolsMetadataProvider {\n protected readonly alepha = $inject(Alepha);\n protected readonly log = $logger();\n\n public getActions(): DevActionMetadata[] {\n const actionDescriptors = this.alepha.descriptors($action);\n\n return actionDescriptors.map((action) => {\n const schema = action.schema;\n const options = action.options as any; // Allow accessing augmented properties\n\n return {\n name: action.name,\n group: action.group,\n method: action.method,\n path: action.path,\n prefix: action.prefix,\n fullPath: action.route.path,\n description: action.options.description,\n summary: options.summary,\n disabled: action.options.disabled,\n secure: options.secure,\n hide: options.hide,\n body: schema?.body,\n params: schema?.params,\n query: schema?.query,\n response: schema?.response,\n bodyContentType: action.getBodyContentType(),\n };\n });\n }\n\n public getQueues(): DevQueueMetadata[] {\n const queueDescriptors = this.alepha.descriptors($queue);\n\n return queueDescriptors.map((queue) => ({\n name: queue.name,\n description: queue.options.description,\n schema: queue.options.schema,\n provider: this.getProviderName(queue.options.provider),\n }));\n }\n\n public getSchedulers(): DevSchedulerMetadata[] {\n const schedulerDescriptors = this.alepha.descriptors($scheduler);\n\n return schedulerDescriptors.map((scheduler) => ({\n name: scheduler.name,\n description: scheduler.options.description,\n cron: scheduler.options.cron,\n interval: scheduler.options.interval,\n lock: scheduler.options.lock,\n }));\n }\n\n public getTopics(): DevTopicMetadata[] {\n const topicDescriptors = this.alepha.descriptors($topic);\n\n return topicDescriptors.map((topic) => ({\n name: topic.name,\n description: topic.options.description,\n schema: topic.options.schema,\n provider: this.getProviderName(topic.options.provider),\n }));\n }\n\n public getBuckets(): DevBucketMetadata[] {\n const bucketDescriptors = this.alepha.descriptors($bucket);\n\n return bucketDescriptors.map((bucket) => ({\n name: bucket.name,\n description: bucket.options.description,\n mimeTypes: bucket.options.mimeTypes,\n maxSize: bucket.options.maxSize,\n provider: this.getProviderName(bucket.options.provider),\n }));\n }\n\n public getRealms(): DevRealmMetadata[] {\n const realmDescriptors = this.alepha.descriptors($realm);\n\n return realmDescriptors.map((realm) => ({\n name: realm.name,\n description: realm.options.description,\n roles: realm.options.roles,\n type: \"secret\" in realm.options ? \"internal\" : \"external\",\n settings: {\n accessTokenExpiration: realm.options.settings?.accessToken?.expiration,\n refreshTokenExpiration:\n realm.options.settings?.refreshToken?.expiration,\n hasOnCreateSession: !!realm.options.settings?.onCreateSession,\n hasOnRefreshSession: !!realm.options.settings?.onRefreshSession,\n hasOnDeleteSession: !!realm.options.settings?.onDeleteSession,\n },\n }));\n }\n\n public getCaches(): DevCacheMetadata[] {\n const cacheDescriptors = this.alepha.descriptors($cache);\n\n return cacheDescriptors.map((cache) => ({\n name: cache.container,\n ttl: cache.options.ttl,\n disabled: cache.options.disabled,\n provider: this.getProviderName(cache.options.provider),\n }));\n }\n\n public getPages(): DevPageMetadata[] {\n // const pageDescriptors = this.alepha.descriptors($page);\n //\n // return pageDescriptors.map((page) => ({\n // name: page.name,\n // description: page.options.description,\n // path: page.options.path,\n // params: page.options.schema?.params,\n // query: page.options.schema?.query,\n // hasComponent: !!page.options.component,\n // hasLazy: !!page.options.lazy,\n // hasResolve: !!page.options.resolve,\n // hasChildren: !!page.options.children,\n // hasParent: !!page.options.parent,\n // hasErrorHandler: !!page.options.errorHandler,\n // static:\n // typeof page.options.static === \"boolean\"\n // ? page.options.static\n // : !!page.options.static,\n // cache: page.options.cache,\n // client: page.options.client,\n // animation: page.options.animation,\n // }));\n\n return [];\n }\n\n public getProviders(): DevProviderMetadata[] {\n const graph = this.alepha.graph();\n\n return Object.entries(graph).map(([name, info]) => ({\n name,\n module: info.module,\n dependencies: info.from,\n aliases: info.as,\n }));\n }\n\n public getModules(): DevModuleMetadata[] {\n const graph = this.alepha.graph();\n const moduleMap = new Map<string, Set<string>>();\n\n // Group providers by module\n for (const [providerName, info] of Object.entries(graph)) {\n if (info.module) {\n if (!moduleMap.has(info.module)) {\n moduleMap.set(info.module, new Set());\n }\n moduleMap.get(info.module)!.add(providerName);\n }\n }\n\n return Array.from(moduleMap.entries()).map(([name, providers]) => ({\n name,\n providers: Array.from(providers),\n }));\n }\n\n public getMetadata(): DevMetadata {\n return {\n actions: this.getActions(),\n queues: this.getQueues(),\n schedulers: this.getSchedulers(),\n topics: this.getTopics(),\n buckets: this.getBuckets(),\n realms: this.getRealms(),\n caches: this.getCaches(),\n pages: this.getPages(),\n providers: this.getProviders(),\n modules: this.getModules(),\n };\n }\n\n // -------------------------------------------------------------------------------------------------------------------\n\n protected getProviderName(provider?: \"memory\" | any): string {\n if (!provider) {\n return \"default\";\n }\n if (provider === \"memory\") {\n return \"memory\";\n }\n return provider.name || \"custom\";\n }\n}\n","import { NodeSqliteProvider } from \"@alepha/postgres\";\n\nexport class DevToolsDatabaseProvider extends NodeSqliteProvider {\n public get name() {\n return \"devtools\";\n }\n\n protected readonly options = {\n path: \":memory:\",\n };\n}\n","import { Repository } from \"@alepha/postgres\";\nimport { logs } from \"../entities/logs.ts\";\nimport { DevToolsDatabaseProvider } from \"../providers/DevToolsDatabaseProvider.ts\";\n\nexport class LogRepository extends Repository<typeof logs.schema> {\n constructor() {\n super(logs, DevToolsDatabaseProvider);\n }\n}\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devActionMetadataSchema = t.object({\n name: t.text(),\n group: t.text(),\n method: t.text(),\n path: t.text(),\n prefix: t.text(),\n fullPath: t.text(),\n description: t.optional(t.text()),\n summary: t.optional(t.text()),\n disabled: t.optional(t.boolean()),\n secure: t.optional(t.boolean()),\n hide: t.optional(t.boolean()),\n body: t.optional(t.any()),\n params: t.optional(t.any()),\n query: t.optional(t.any()),\n response: t.optional(t.any()),\n bodyContentType: t.optional(t.text()),\n});\n\nexport type DevActionMetadata = Static<typeof devActionMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devBucketMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n mimeTypes: t.optional(t.array(t.text())),\n maxSize: t.optional(t.number()),\n provider: t.text(),\n});\n\nexport type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devCacheMetadataSchema = t.object({\n name: t.text(),\n ttl: t.optional(t.any()),\n disabled: t.optional(t.boolean()),\n provider: t.text(),\n});\n\nexport type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devModuleMetadataSchema = t.object({\n name: t.text(),\n providers: t.array(t.text()),\n});\n\nexport type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devPageMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n path: t.optional(t.text()),\n params: t.optional(t.any()),\n query: t.optional(t.any()),\n hasComponent: t.boolean(),\n hasLazy: t.boolean(),\n hasResolve: t.boolean(),\n hasChildren: t.boolean(),\n hasParent: t.boolean(),\n hasErrorHandler: t.boolean(),\n static: t.optional(t.boolean()),\n cache: t.optional(t.any()),\n client: t.optional(t.any()),\n animation: t.optional(t.any()),\n});\n\nexport type DevPageMetadata = Static<typeof devPageMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devProviderMetadataSchema = t.object({\n name: t.text(),\n module: t.optional(t.text()),\n dependencies: t.array(t.text()),\n aliases: t.optional(t.array(t.text())),\n});\n\nexport type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devQueueMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n schema: t.optional(t.any()),\n provider: t.text(),\n});\n\nexport type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devRealmMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n roles: t.optional(t.array(t.any())),\n type: t.enum([\"internal\", \"external\"]),\n settings: t.optional(\n t.object({\n accessTokenExpiration: t.optional(t.any()),\n refreshTokenExpiration: t.optional(t.any()),\n hasOnCreateSession: t.boolean(),\n hasOnRefreshSession: t.boolean(),\n hasOnDeleteSession: t.boolean(),\n }),\n ),\n});\n\nexport type DevRealmMetadata = Static<typeof devRealmMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devSchedulerMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n cron: t.optional(t.text()),\n interval: t.optional(t.any()),\n lock: t.optional(t.boolean()),\n});\n\nexport type DevSchedulerMetadata = Static<typeof devSchedulerMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\n\nexport const devTopicMetadataSchema = t.object({\n name: t.text(),\n description: t.optional(t.text()),\n schema: t.optional(t.any()),\n provider: t.text(),\n});\n\nexport type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;\n","import { type Static, t } from \"@alepha/core\";\nimport { devActionMetadataSchema } from \"./DevActionMetadata.ts\";\nimport { devBucketMetadataSchema } from \"./DevBucketMetadata.ts\";\nimport { devCacheMetadataSchema } from \"./DevCacheMetadata.ts\";\nimport { devModuleMetadataSchema } from \"./DevModuleMetadata.ts\";\nimport { devPageMetadataSchema } from \"./DevPageMetadata.ts\";\nimport { devProviderMetadataSchema } from \"./DevProviderMetadata.ts\";\nimport { devQueueMetadataSchema } from \"./DevQueueMetadata.ts\";\nimport { devRealmMetadataSchema } from \"./DevRealmMetadata.ts\";\nimport { devSchedulerMetadataSchema } from \"./DevSchedulerMetadata.ts\";\nimport { devTopicMetadataSchema } from \"./DevTopicMetadata.ts\";\n\nexport const devMetadataSchema = t.object({\n actions: t.array(devActionMetadataSchema),\n queues: t.array(devQueueMetadataSchema),\n schedulers: t.array(devSchedulerMetadataSchema),\n topics: t.array(devTopicMetadataSchema),\n buckets: t.array(devBucketMetadataSchema),\n realms: t.array(devRealmMetadataSchema),\n caches: t.array(devCacheMetadataSchema),\n pages: t.array(devPageMetadataSchema),\n providers: t.array(devProviderMetadataSchema),\n modules: t.array(devModuleMetadataSchema),\n // More metadata will be added here later\n});\n\nexport type DevMetadata = Static<typeof devMetadataSchema>;\n","import { join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { $batch } from \"@alepha/batch\";\nimport { $hook, $inject, Alepha, pageQuerySchema, t } from \"@alepha/core\";\nimport {\n $logger,\n JsonFormatterProvider,\n type LogEntry,\n logEntrySchema,\n} from \"@alepha/logger\";\nimport { parseQueryString } from \"@alepha/postgres\";\nimport { $route, ServerProvider } from \"@alepha/server\";\nimport { $serve } from \"@alepha/server-static\";\nimport { type DevLogEntry, logs } from \"./entities/logs.ts\";\nimport { DevToolsMetadataProvider } from \"./providers/DevToolsMetadataProvider.ts\";\nimport { LogRepository } from \"./repositories/LogRepository.ts\";\nimport { devMetadataSchema } from \"./schemas/DevMetadata.ts\";\n\nexport class DevToolsProvider {\n protected readonly log = $logger();\n protected readonly alepha = $inject(Alepha);\n protected readonly serverProvider = $inject(ServerProvider);\n protected readonly jsonFormatter = $inject(JsonFormatterProvider);\n protected readonly logs = $inject(LogRepository);\n protected readonly devCollectorProvider = $inject(DevToolsMetadataProvider);\n\n protected readonly onStart = $hook({\n on: \"start\",\n handler: () => {\n this.log.info(\n `Devtools available at ${this.serverProvider.hostname}/devtools/`,\n );\n },\n });\n\n protected batchLogs = $batch({\n maxSize: 50,\n maxDuration: [10, \"seconds\"],\n schema: logs.insertSchema,\n handler: async (entries) => {\n await this.logs.createMany(entries);\n },\n });\n\n protected readonly onLog = $hook({\n on: \"log\",\n handler: async (ev: { message?: string; entry: LogEntry }) => {\n // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n // CAUTION: It's very easy to create an infinite loop here.\n // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n try {\n if (!this.alepha.isStarted()) {\n return;\n }\n\n if (ev.entry.module === \"alepha.devtools\") {\n // skip devtools logs to avoid infinite loop\n return;\n }\n\n if (ev.entry.level === \"TRACE\" && ev.entry.module === \"alepha.batch\") {\n // skip batch trace logs to avoid infinite loop\n return;\n }\n\n if (this.alepha.isProduction() && ev.entry.level === \"TRACE\") {\n // skip trace logs in production\n return;\n }\n\n const entry = {\n ...ev.entry,\n data:\n ev.entry.data instanceof Error\n ? this.jsonFormatter.formatJsonError(ev.entry.data)\n : typeof ev.entry.data === \"object\" &&\n !Array.isArray(ev.entry.data)\n ? ev.entry.data\n : { data: ev.entry.data },\n };\n\n await this.batchLogs.push(entry as DevLogEntry);\n } catch (error) {\n // DO TO NOT WITH THE LOGGER HERE TO AVOID INFINITE LOOP\n console.error(error, ev);\n }\n },\n });\n\n protected readonly uiRoute = $serve({\n path: \"/devtools\",\n root: join(fileURLToPath(import.meta.url), \"../../assets/devtools\"),\n historyApiFallback: true,\n });\n\n protected readonly metadataRoute = $route({\n method: \"GET\",\n path: \"/devtools/api/metadata\",\n silent: true,\n schema: {\n response: devMetadataSchema,\n },\n handler: () => {\n return this.devCollectorProvider.getMetadata();\n },\n });\n\n protected readonly logsRoute = $route({\n method: \"GET\",\n path: \"/devtools/api/logs\",\n silent: true,\n schema: {\n query: t.extend(pageQuerySchema, {\n search: t.optional(t.string()),\n }),\n response: t.page(logEntrySchema),\n },\n handler: ({ query }) => {\n query.sort ??= \"-timestamp\";\n return this.logs.paginate(\n query,\n query.search\n ? {\n where: parseQueryString(query.search),\n }\n : {},\n {\n count: true,\n },\n );\n },\n });\n}\n","import { $module } from \"@alepha/core\";\nimport { DevToolsProvider } from \"./DevToolsProvider.ts\";\nimport { DevToolsDatabaseProvider } from \"./providers/DevToolsDatabaseProvider.ts\";\nimport { DevToolsMetadataProvider } from \"./providers/DevToolsMetadataProvider.ts\";\nimport { LogRepository } from \"./repositories/LogRepository.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./providers/DevToolsMetadataProvider.ts\";\nexport * from \"./schemas/DevActionMetadata.ts\";\nexport * from \"./schemas/DevBucketMetadata.ts\";\nexport * from \"./schemas/DevCacheMetadata.ts\";\nexport * from \"./schemas/DevMetadata.ts\";\nexport * from \"./schemas/DevModuleMetadata.ts\";\nexport * from \"./schemas/DevPageMetadata.ts\";\nexport * from \"./schemas/DevProviderMetadata.ts\";\nexport * from \"./schemas/DevQueueMetadata.ts\";\nexport * from \"./schemas/DevRealmMetadata.ts\";\nexport * from \"./schemas/DevSchedulerMetadata.ts\";\nexport * from \"./schemas/DevTopicMetadata.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Developer tools module for monitoring and debugging Alepha applications.\n *\n * This module provides comprehensive data collection capabilities for tracking application behavior,\n * performance metrics, and debugging information in real-time.\n *\n * @see {@link DevToolsMetadataProvider}\n * @module alepha.devtools\n */\nexport const AlephaDevtools = $module({\n name: \"alepha.devtools\",\n descriptors: [],\n services: [\n DevToolsMetadataProvider,\n DevToolsProvider,\n DevToolsDatabaseProvider,\n LogRepository,\n ],\n register: (alepha) => {\n alepha.with(DevToolsProvider);\n alepha.with(DevToolsDatabaseProvider);\n alepha.with(DevToolsMetadataProvider);\n alepha.state.push(\"alepha.build.assets\", \"@alepha/devtools\");\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAa,sCAAe;CAC1B,MAAM;CACN,QAAQA,gBAAE,OAAO;EACf,IAAIC,qBAAG,YAAY;EACnB,OAAOD,gBAAE,KAAK;GAAC;GAAS;GAAS;GAAQ;GAAQ;GAAQ,CAAC;EAC1D,SAASA,gBAAE,KAAK,EACd,MAAM,QACP,CAAC;EACF,SAASA,gBAA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B,EAC/B,QAAQD,gBAAE,SAASA,gBAAE,QAAQ,CAAC,EAC/B,CAAC;GACF,UAAUA,gBAAE,KAAKE,+BAAe;GACjC;EACD,UAAU,EAAE,YAAY;AACtB,SAAM,SAAS;AACf,UAAO,KAAK,KAAK,SACf,OACA,MAAM,SACF,EACE,+CAAwB,MAAM,OAAO,EACtC,GACD,EAAE,EACN,EACE,OAAO,MACR,CACF;;EAEJ,CAAC;;;;;;;;;;;;;;ACpGJ,MAAa,4CAAyB;CACpC,MAAM;CACN,aAAa,EAAE;CACf,UAAU;EACR;EACA;EACA;EACA;EACD;CACD,WAAW,WAAW;AACpB,SAAO,KAAK,iBAAiB;AAC7B,SAAO,KAAK,yBAAyB;AACrC,SAAO,KAAK,yBAAyB;AACrC,SAAO,MAAM,KAAK,uBAAuB,mBAAmB;;CAE/D,CAAC"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import * as _alepha_core0 from "@alepha/core";
|
|
2
|
+
import { Alepha, Static } from "@alepha/core";
|
|
3
|
+
import * as _alepha_logger0 from "@alepha/logger";
|
|
4
|
+
import * as typebox149 from "typebox";
|
|
5
|
+
|
|
6
|
+
//#region src/schemas/DevActionMetadata.d.ts
|
|
7
|
+
declare const devActionMetadataSchema: typebox149.TObject<{
|
|
8
|
+
name: typebox149.TString;
|
|
9
|
+
group: typebox149.TString;
|
|
10
|
+
method: typebox149.TString;
|
|
11
|
+
path: typebox149.TString;
|
|
12
|
+
prefix: typebox149.TString;
|
|
13
|
+
fullPath: typebox149.TString;
|
|
14
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
15
|
+
summary: typebox149.TOptional<typebox149.TString>;
|
|
16
|
+
disabled: typebox149.TOptional<typebox149.TBoolean>;
|
|
17
|
+
secure: typebox149.TOptional<typebox149.TBoolean>;
|
|
18
|
+
hide: typebox149.TOptional<typebox149.TBoolean>;
|
|
19
|
+
body: typebox149.TOptional<typebox149.TAny>;
|
|
20
|
+
params: typebox149.TOptional<typebox149.TAny>;
|
|
21
|
+
query: typebox149.TOptional<typebox149.TAny>;
|
|
22
|
+
response: typebox149.TOptional<typebox149.TAny>;
|
|
23
|
+
bodyContentType: typebox149.TOptional<typebox149.TString>;
|
|
24
|
+
}>;
|
|
25
|
+
type DevActionMetadata = Static<typeof devActionMetadataSchema>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/schemas/DevBucketMetadata.d.ts
|
|
28
|
+
declare const devBucketMetadataSchema: typebox149.TObject<{
|
|
29
|
+
name: typebox149.TString;
|
|
30
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
31
|
+
mimeTypes: typebox149.TOptional<typebox149.TArray<typebox149.TString>>;
|
|
32
|
+
maxSize: typebox149.TOptional<typebox149.TNumber>;
|
|
33
|
+
provider: typebox149.TString;
|
|
34
|
+
}>;
|
|
35
|
+
type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/schemas/DevCacheMetadata.d.ts
|
|
38
|
+
declare const devCacheMetadataSchema: typebox149.TObject<{
|
|
39
|
+
name: typebox149.TString;
|
|
40
|
+
ttl: typebox149.TOptional<typebox149.TAny>;
|
|
41
|
+
disabled: typebox149.TOptional<typebox149.TBoolean>;
|
|
42
|
+
provider: typebox149.TString;
|
|
43
|
+
}>;
|
|
44
|
+
type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/schemas/DevMetadata.d.ts
|
|
47
|
+
declare const devMetadataSchema: typebox149.TObject<{
|
|
48
|
+
actions: typebox149.TArray<typebox149.TObject<{
|
|
49
|
+
name: typebox149.TString;
|
|
50
|
+
group: typebox149.TString;
|
|
51
|
+
method: typebox149.TString;
|
|
52
|
+
path: typebox149.TString;
|
|
53
|
+
prefix: typebox149.TString;
|
|
54
|
+
fullPath: typebox149.TString;
|
|
55
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
56
|
+
summary: typebox149.TOptional<typebox149.TString>;
|
|
57
|
+
disabled: typebox149.TOptional<typebox149.TBoolean>;
|
|
58
|
+
secure: typebox149.TOptional<typebox149.TBoolean>;
|
|
59
|
+
hide: typebox149.TOptional<typebox149.TBoolean>;
|
|
60
|
+
body: typebox149.TOptional<typebox149.TAny>;
|
|
61
|
+
params: typebox149.TOptional<typebox149.TAny>;
|
|
62
|
+
query: typebox149.TOptional<typebox149.TAny>;
|
|
63
|
+
response: typebox149.TOptional<typebox149.TAny>;
|
|
64
|
+
bodyContentType: typebox149.TOptional<typebox149.TString>;
|
|
65
|
+
}>>;
|
|
66
|
+
queues: typebox149.TArray<typebox149.TObject<{
|
|
67
|
+
name: typebox149.TString;
|
|
68
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
69
|
+
schema: typebox149.TOptional<typebox149.TAny>;
|
|
70
|
+
provider: typebox149.TString;
|
|
71
|
+
}>>;
|
|
72
|
+
schedulers: typebox149.TArray<typebox149.TObject<{
|
|
73
|
+
name: typebox149.TString;
|
|
74
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
75
|
+
cron: typebox149.TOptional<typebox149.TString>;
|
|
76
|
+
interval: typebox149.TOptional<typebox149.TAny>;
|
|
77
|
+
lock: typebox149.TOptional<typebox149.TBoolean>;
|
|
78
|
+
}>>;
|
|
79
|
+
topics: typebox149.TArray<typebox149.TObject<{
|
|
80
|
+
name: typebox149.TString;
|
|
81
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
82
|
+
schema: typebox149.TOptional<typebox149.TAny>;
|
|
83
|
+
provider: typebox149.TString;
|
|
84
|
+
}>>;
|
|
85
|
+
buckets: typebox149.TArray<typebox149.TObject<{
|
|
86
|
+
name: typebox149.TString;
|
|
87
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
88
|
+
mimeTypes: typebox149.TOptional<typebox149.TArray<typebox149.TString>>;
|
|
89
|
+
maxSize: typebox149.TOptional<typebox149.TNumber>;
|
|
90
|
+
provider: typebox149.TString;
|
|
91
|
+
}>>;
|
|
92
|
+
realms: typebox149.TArray<typebox149.TObject<{
|
|
93
|
+
name: typebox149.TString;
|
|
94
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
95
|
+
roles: typebox149.TOptional<typebox149.TArray<typebox149.TAny>>;
|
|
96
|
+
type: typebox149.TUnsafe<"internal" | "external">;
|
|
97
|
+
settings: typebox149.TOptional<typebox149.TObject<{
|
|
98
|
+
accessTokenExpiration: typebox149.TOptional<typebox149.TAny>;
|
|
99
|
+
refreshTokenExpiration: typebox149.TOptional<typebox149.TAny>;
|
|
100
|
+
hasOnCreateSession: typebox149.TBoolean;
|
|
101
|
+
hasOnRefreshSession: typebox149.TBoolean;
|
|
102
|
+
hasOnDeleteSession: typebox149.TBoolean;
|
|
103
|
+
}>>;
|
|
104
|
+
}>>;
|
|
105
|
+
caches: typebox149.TArray<typebox149.TObject<{
|
|
106
|
+
name: typebox149.TString;
|
|
107
|
+
ttl: typebox149.TOptional<typebox149.TAny>;
|
|
108
|
+
disabled: typebox149.TOptional<typebox149.TBoolean>;
|
|
109
|
+
provider: typebox149.TString;
|
|
110
|
+
}>>;
|
|
111
|
+
pages: typebox149.TArray<typebox149.TObject<{
|
|
112
|
+
name: typebox149.TString;
|
|
113
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
114
|
+
path: typebox149.TOptional<typebox149.TString>;
|
|
115
|
+
params: typebox149.TOptional<typebox149.TAny>;
|
|
116
|
+
query: typebox149.TOptional<typebox149.TAny>;
|
|
117
|
+
hasComponent: typebox149.TBoolean;
|
|
118
|
+
hasLazy: typebox149.TBoolean;
|
|
119
|
+
hasResolve: typebox149.TBoolean;
|
|
120
|
+
hasChildren: typebox149.TBoolean;
|
|
121
|
+
hasParent: typebox149.TBoolean;
|
|
122
|
+
hasErrorHandler: typebox149.TBoolean;
|
|
123
|
+
static: typebox149.TOptional<typebox149.TBoolean>;
|
|
124
|
+
cache: typebox149.TOptional<typebox149.TAny>;
|
|
125
|
+
client: typebox149.TOptional<typebox149.TAny>;
|
|
126
|
+
animation: typebox149.TOptional<typebox149.TAny>;
|
|
127
|
+
}>>;
|
|
128
|
+
providers: typebox149.TArray<typebox149.TObject<{
|
|
129
|
+
name: typebox149.TString;
|
|
130
|
+
module: typebox149.TOptional<typebox149.TString>;
|
|
131
|
+
dependencies: typebox149.TArray<typebox149.TString>;
|
|
132
|
+
aliases: typebox149.TOptional<typebox149.TArray<typebox149.TString>>;
|
|
133
|
+
}>>;
|
|
134
|
+
modules: typebox149.TArray<typebox149.TObject<{
|
|
135
|
+
name: typebox149.TString;
|
|
136
|
+
providers: typebox149.TArray<typebox149.TString>;
|
|
137
|
+
}>>;
|
|
138
|
+
}>;
|
|
139
|
+
type DevMetadata = Static<typeof devMetadataSchema>;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/schemas/DevModuleMetadata.d.ts
|
|
142
|
+
declare const devModuleMetadataSchema: typebox149.TObject<{
|
|
143
|
+
name: typebox149.TString;
|
|
144
|
+
providers: typebox149.TArray<typebox149.TString>;
|
|
145
|
+
}>;
|
|
146
|
+
type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/schemas/DevPageMetadata.d.ts
|
|
149
|
+
declare const devPageMetadataSchema: typebox149.TObject<{
|
|
150
|
+
name: typebox149.TString;
|
|
151
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
152
|
+
path: typebox149.TOptional<typebox149.TString>;
|
|
153
|
+
params: typebox149.TOptional<typebox149.TAny>;
|
|
154
|
+
query: typebox149.TOptional<typebox149.TAny>;
|
|
155
|
+
hasComponent: typebox149.TBoolean;
|
|
156
|
+
hasLazy: typebox149.TBoolean;
|
|
157
|
+
hasResolve: typebox149.TBoolean;
|
|
158
|
+
hasChildren: typebox149.TBoolean;
|
|
159
|
+
hasParent: typebox149.TBoolean;
|
|
160
|
+
hasErrorHandler: typebox149.TBoolean;
|
|
161
|
+
static: typebox149.TOptional<typebox149.TBoolean>;
|
|
162
|
+
cache: typebox149.TOptional<typebox149.TAny>;
|
|
163
|
+
client: typebox149.TOptional<typebox149.TAny>;
|
|
164
|
+
animation: typebox149.TOptional<typebox149.TAny>;
|
|
165
|
+
}>;
|
|
166
|
+
type DevPageMetadata = Static<typeof devPageMetadataSchema>;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/schemas/DevProviderMetadata.d.ts
|
|
169
|
+
declare const devProviderMetadataSchema: typebox149.TObject<{
|
|
170
|
+
name: typebox149.TString;
|
|
171
|
+
module: typebox149.TOptional<typebox149.TString>;
|
|
172
|
+
dependencies: typebox149.TArray<typebox149.TString>;
|
|
173
|
+
aliases: typebox149.TOptional<typebox149.TArray<typebox149.TString>>;
|
|
174
|
+
}>;
|
|
175
|
+
type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/schemas/DevQueueMetadata.d.ts
|
|
178
|
+
declare const devQueueMetadataSchema: typebox149.TObject<{
|
|
179
|
+
name: typebox149.TString;
|
|
180
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
181
|
+
schema: typebox149.TOptional<typebox149.TAny>;
|
|
182
|
+
provider: typebox149.TString;
|
|
183
|
+
}>;
|
|
184
|
+
type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/schemas/DevRealmMetadata.d.ts
|
|
187
|
+
declare const devRealmMetadataSchema: typebox149.TObject<{
|
|
188
|
+
name: typebox149.TString;
|
|
189
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
190
|
+
roles: typebox149.TOptional<typebox149.TArray<typebox149.TAny>>;
|
|
191
|
+
type: typebox149.TUnsafe<"internal" | "external">;
|
|
192
|
+
settings: typebox149.TOptional<typebox149.TObject<{
|
|
193
|
+
accessTokenExpiration: typebox149.TOptional<typebox149.TAny>;
|
|
194
|
+
refreshTokenExpiration: typebox149.TOptional<typebox149.TAny>;
|
|
195
|
+
hasOnCreateSession: typebox149.TBoolean;
|
|
196
|
+
hasOnRefreshSession: typebox149.TBoolean;
|
|
197
|
+
hasOnDeleteSession: typebox149.TBoolean;
|
|
198
|
+
}>>;
|
|
199
|
+
}>;
|
|
200
|
+
type DevRealmMetadata = Static<typeof devRealmMetadataSchema>;
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/schemas/DevSchedulerMetadata.d.ts
|
|
203
|
+
declare const devSchedulerMetadataSchema: typebox149.TObject<{
|
|
204
|
+
name: typebox149.TString;
|
|
205
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
206
|
+
cron: typebox149.TOptional<typebox149.TString>;
|
|
207
|
+
interval: typebox149.TOptional<typebox149.TAny>;
|
|
208
|
+
lock: typebox149.TOptional<typebox149.TBoolean>;
|
|
209
|
+
}>;
|
|
210
|
+
type DevSchedulerMetadata = Static<typeof devSchedulerMetadataSchema>;
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/schemas/DevTopicMetadata.d.ts
|
|
213
|
+
declare const devTopicMetadataSchema: typebox149.TObject<{
|
|
214
|
+
name: typebox149.TString;
|
|
215
|
+
description: typebox149.TOptional<typebox149.TString>;
|
|
216
|
+
schema: typebox149.TOptional<typebox149.TAny>;
|
|
217
|
+
provider: typebox149.TString;
|
|
218
|
+
}>;
|
|
219
|
+
type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/providers/DevToolsMetadataProvider.d.ts
|
|
222
|
+
declare class DevToolsMetadataProvider {
|
|
223
|
+
protected readonly alepha: Alepha;
|
|
224
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
225
|
+
getActions(): DevActionMetadata[];
|
|
226
|
+
getQueues(): DevQueueMetadata[];
|
|
227
|
+
getSchedulers(): DevSchedulerMetadata[];
|
|
228
|
+
getTopics(): DevTopicMetadata[];
|
|
229
|
+
getBuckets(): DevBucketMetadata[];
|
|
230
|
+
getRealms(): DevRealmMetadata[];
|
|
231
|
+
getCaches(): DevCacheMetadata[];
|
|
232
|
+
getPages(): DevPageMetadata[];
|
|
233
|
+
getProviders(): DevProviderMetadata[];
|
|
234
|
+
getModules(): DevModuleMetadata[];
|
|
235
|
+
getMetadata(): DevMetadata;
|
|
236
|
+
protected getProviderName(provider?: "memory" | any): string;
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/index.d.ts
|
|
240
|
+
/**
|
|
241
|
+
* Developer tools module for monitoring and debugging Alepha applications.
|
|
242
|
+
*
|
|
243
|
+
* This module provides comprehensive data collection capabilities for tracking application behavior,
|
|
244
|
+
* performance metrics, and debugging information in real-time.
|
|
245
|
+
*
|
|
246
|
+
* @see {@link DevToolsMetadataProvider}
|
|
247
|
+
* @module alepha.devtools
|
|
248
|
+
*/
|
|
249
|
+
declare const AlephaDevtools: _alepha_core0.Service<_alepha_core0.Module>;
|
|
250
|
+
//#endregion
|
|
251
|
+
export { AlephaDevtools, DevActionMetadata, DevBucketMetadata, DevCacheMetadata, DevMetadata, DevModuleMetadata, DevPageMetadata, DevProviderMetadata, DevQueueMetadata, DevRealmMetadata, DevSchedulerMetadata, DevToolsMetadataProvider, DevTopicMetadata, devActionMetadataSchema, devBucketMetadataSchema, devCacheMetadataSchema, devMetadataSchema, devModuleMetadataSchema, devPageMetadataSchema, devProviderMetadataSchema, devQueueMetadataSchema, devRealmMetadataSchema, devSchedulerMetadataSchema, devTopicMetadataSchema };
|
|
252
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/schemas/DevActionMetadata.ts","../src/schemas/DevBucketMetadata.ts","../src/schemas/DevCacheMetadata.ts","../src/schemas/DevMetadata.ts","../src/schemas/DevModuleMetadata.ts","../src/schemas/DevPageMetadata.ts","../src/schemas/DevProviderMetadata.ts","../src/schemas/DevQueueMetadata.ts","../src/schemas/DevRealmMetadata.ts","../src/schemas/DevSchedulerMet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,sCAAyB;QAKpC,UAAA,CAAA;;;;ANLF,CAAA,CAAA;AAiBE,KMVU,mBAAA,GAAsB,MNUhC,CAAA,OMV8C,yBNU9C,CAAA;;;cOjBW,mCAAsB;QAKjC,UAAA,CAAA;;;;APLF,CAAA,CAAA;AAiBE,KOVU,gBAAA,GAAmB,MPU7B,CAAA,OOV2C,sBPU3C,CAAA;;;cQjBW,mCAAsB;QAcjC,UAAA,CAAA;;;;ERdW,QAAA,sBAiBX,mBAAA,CAAA;IAAA,qBAAA,sBAAA,iBAAA;;;;;;;KQDU,gBAAA,GAAmB,cAAc;;;cChBhC,uCAA0B;QAMrC,UAAA,CAAA;;;;ETNW,IAAA,sBAiBX,qBAAA;CAAA,CAAA;KSTU,oBAAA,GAAuB,cAAc;;;cCRpC,mCAAsB;QAKjC,UAAA,CAAA;;;;AVLF,CAAA,CAAA;AAiBE,KUVU,gBAAA,GAAmB,MVU7B,CAAA,OUV2C,sBVU3C,CAAA;;;cWEW,wBAAA;6BACc;0BAAA,eAAA,CACH;gBAED;eA4BD;mBAWI;eAYJ;gBAWC;eAYD;eAmBA;cAWD;kBA2BI;gBAWF;iBAoBC;;;;;;;;;;;;;;cC3JX,gBAAc,aAAA,CAAA,QAezB,aAAA,CAfyB,MAAA"}
|
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.11.
|
|
4
|
+
"version": "0.11.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=22.0.0"
|
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alepha/batch": "0.11.
|
|
18
|
-
"@alepha/bucket": "0.11.
|
|
19
|
-
"@alepha/cache": "0.11.
|
|
20
|
-
"@alepha/core": "0.11.
|
|
21
|
-
"@alepha/datetime": "0.11.
|
|
22
|
-
"@alepha/logger": "0.11.
|
|
23
|
-
"@alepha/postgres": "0.11.
|
|
24
|
-
"@alepha/queue": "0.11.
|
|
25
|
-
"@alepha/react": "0.11.
|
|
26
|
-
"@alepha/react-i18n": "0.11.
|
|
27
|
-
"@alepha/scheduler": "0.11.
|
|
28
|
-
"@alepha/security": "0.11.
|
|
29
|
-
"@alepha/server": "0.11.
|
|
30
|
-
"@alepha/server-static": "0.11.
|
|
31
|
-
"@alepha/topic": "0.11.
|
|
17
|
+
"@alepha/batch": "0.11.10",
|
|
18
|
+
"@alepha/bucket": "0.11.10",
|
|
19
|
+
"@alepha/cache": "0.11.10",
|
|
20
|
+
"@alepha/core": "0.11.10",
|
|
21
|
+
"@alepha/datetime": "0.11.10",
|
|
22
|
+
"@alepha/logger": "0.11.10",
|
|
23
|
+
"@alepha/postgres": "0.11.10",
|
|
24
|
+
"@alepha/queue": "0.11.10",
|
|
25
|
+
"@alepha/react": "0.11.10",
|
|
26
|
+
"@alepha/react-i18n": "0.11.10",
|
|
27
|
+
"@alepha/scheduler": "0.11.10",
|
|
28
|
+
"@alepha/security": "0.11.10",
|
|
29
|
+
"@alepha/server": "0.11.10",
|
|
30
|
+
"@alepha/server-static": "0.11.10",
|
|
31
|
+
"@alepha/topic": "0.11.10"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@alepha/
|
|
35
|
-
"@alepha/
|
|
36
|
-
"@alepha/vite": "0.11.7",
|
|
34
|
+
"@alepha/ui": "0.11.10",
|
|
35
|
+
"@alepha/vite": "0.11.10",
|
|
37
36
|
"@biomejs/biome": "^2.3.5",
|
|
38
37
|
"@tabler/icons-react": "^3.35.0",
|
|
38
|
+
"alepha": "0.11.10",
|
|
39
39
|
"react": "^19.2.0",
|
|
40
40
|
"tsdown": "^0.16.4",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"vitest": "^4.0.
|
|
42
|
+
"vitest": "^4.0.9"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"test": "vitest run",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"exports": {
|
|
65
65
|
".": {
|
|
66
66
|
"types": "./dist/index.d.ts",
|
|
67
|
-
"import": "./dist/index.js"
|
|
67
|
+
"import": "./dist/index.js",
|
|
68
|
+
"require": "./dist/index.cjs"
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}
|