@adonis-agora/telescope 0.6.0 → 0.7.1
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/CHANGELOG.md +28 -0
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +6 -0
- package/dist/configure.js.map +1 -1
- package/dist/providers/telescope_cpu_profiling_provider.d.ts +28 -0
- package/dist/providers/telescope_cpu_profiling_provider.d.ts.map +1 -0
- package/dist/providers/telescope_cpu_profiling_provider.js +45 -0
- package/dist/providers/telescope_cpu_profiling_provider.js.map +1 -0
- package/dist/providers/telescope_ui_provider.d.ts.map +1 -1
- package/dist/providers/telescope_ui_provider.js +163 -12
- package/dist/providers/telescope_ui_provider.js.map +1 -1
- package/dist/providers/telescope_watchers_provider.d.ts +10 -0
- package/dist/providers/telescope_watchers_provider.d.ts.map +1 -1
- package/dist/providers/telescope_watchers_provider.js +32 -0
- package/dist/providers/telescope_watchers_provider.js.map +1 -1
- package/dist/src/ai/index.d.ts +1 -1
- package/dist/src/ai/index.js +1 -1
- package/dist/src/alerts/index.d.ts +1 -1
- package/dist/src/alerts/index.js +1 -1
- package/dist/src/entry.d.ts +8 -0
- package/dist/src/entry.d.ts.map +1 -1
- package/dist/src/entry.js +8 -0
- package/dist/src/entry.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/mcp/index.d.ts +1 -1
- package/dist/src/mcp/index.js +1 -1
- package/dist/src/profiling/aggregate-profile.d.ts +21 -0
- package/dist/src/profiling/aggregate-profile.d.ts.map +1 -0
- package/dist/src/profiling/aggregate-profile.js +124 -0
- package/dist/src/profiling/aggregate-profile.js.map +1 -0
- package/dist/src/profiling/cpu-profiler.d.ts +59 -0
- package/dist/src/profiling/cpu-profiler.d.ts.map +1 -0
- package/dist/src/profiling/cpu-profiler.js +94 -0
- package/dist/src/profiling/cpu-profiler.js.map +1 -0
- package/dist/src/profiling/define_config.d.ts +38 -0
- package/dist/src/profiling/define_config.d.ts.map +1 -0
- package/dist/src/profiling/define_config.js +23 -0
- package/dist/src/profiling/define_config.js.map +1 -0
- package/dist/src/profiling/index.d.ts +11 -0
- package/dist/src/profiling/index.d.ts.map +1 -0
- package/dist/src/profiling/index.js +7 -0
- package/dist/src/profiling/index.js.map +1 -0
- package/dist/src/profiling/profiler_service.d.ts +100 -0
- package/dist/src/profiling/profiler_service.d.ts.map +1 -0
- package/dist/src/profiling/profiler_service.js +162 -0
- package/dist/src/profiling/profiler_service.js.map +1 -0
- package/dist/src/profiling/types.d.ts +86 -0
- package/dist/src/profiling/types.d.ts.map +1 -0
- package/dist/src/profiling/types.js +5 -0
- package/dist/src/profiling/types.js.map +1 -0
- package/dist/src/registry.d.ts +28 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +20 -0
- package/dist/src/registry.js.map +1 -1
- package/dist/src/telescope_middleware.d.ts.map +1 -1
- package/dist/src/telescope_middleware.js +25 -0
- package/dist/src/telescope_middleware.js.map +1 -1
- package/dist/src/ui/api.d.ts +41 -1
- package/dist/src/ui/api.d.ts.map +1 -1
- package/dist/src/ui/api.js +27 -1
- package/dist/src/ui/api.js.map +1 -1
- package/dist/src/ui/define_config.d.ts +26 -0
- package/dist/src/ui/define_config.d.ts.map +1 -1
- package/dist/src/ui/define_config.js +8 -0
- package/dist/src/ui/define_config.js.map +1 -1
- package/dist/src/ui/diagnosis_api.d.ts +33 -0
- package/dist/src/ui/diagnosis_api.d.ts.map +1 -0
- package/dist/src/ui/diagnosis_api.js +60 -0
- package/dist/src/ui/diagnosis_api.js.map +1 -0
- package/dist/src/ui/extension_api.d.ts +6 -2
- package/dist/src/ui/extension_api.d.ts.map +1 -1
- package/dist/src/ui/extension_api.js +7 -2
- package/dist/src/ui/extension_api.js.map +1 -1
- package/dist/src/ui/guard.d.ts +7 -0
- package/dist/src/ui/guard.d.ts.map +1 -1
- package/dist/src/ui/guard.js +9 -0
- package/dist/src/ui/guard.js.map +1 -1
- package/dist/src/ui/http.d.ts +7 -0
- package/dist/src/ui/http.d.ts.map +1 -1
- package/dist/src/ui/http.js +3 -0
- package/dist/src/ui/http.js.map +1 -1
- package/dist/src/ui/index.d.ts +8 -2
- package/dist/src/ui/index.d.ts.map +1 -1
- package/dist/src/ui/index.js +7 -1
- package/dist/src/ui/index.js.map +1 -1
- package/dist/src/ui/profiles_api.d.ts +48 -0
- package/dist/src/ui/profiles_api.d.ts.map +1 -0
- package/dist/src/ui/profiles_api.js +94 -0
- package/dist/src/ui/profiles_api.js.map +1 -0
- package/dist/src/ui/queue_manager_api.d.ts +46 -0
- package/dist/src/ui/queue_manager_api.d.ts.map +1 -0
- package/dist/src/ui/queue_manager_api.js +118 -0
- package/dist/src/ui/queue_manager_api.js.map +1 -0
- package/dist/src/ui/schedules_api.d.ts +43 -0
- package/dist/src/ui/schedules_api.d.ts.map +1 -0
- package/dist/src/ui/schedules_api.js +46 -0
- package/dist/src/ui/schedules_api.js.map +1 -0
- package/dist/src/watchers/cron_next_run.d.ts +8 -0
- package/dist/src/watchers/cron_next_run.d.ts.map +1 -0
- package/dist/src/watchers/cron_next_run.js +67 -0
- package/dist/src/watchers/cron_next_run.js.map +1 -0
- package/dist/src/watchers/define_config.d.ts +28 -1
- package/dist/src/watchers/define_config.d.ts.map +1 -1
- package/dist/src/watchers/define_config.js +5 -0
- package/dist/src/watchers/define_config.js.map +1 -1
- package/dist/src/watchers/index.d.ts +7 -4
- package/dist/src/watchers/index.d.ts.map +1 -1
- package/dist/src/watchers/index.js +5 -2
- package/dist/src/watchers/index.js.map +1 -1
- package/dist/src/watchers/queue_manager.d.ts +229 -0
- package/dist/src/watchers/queue_manager.d.ts.map +1 -0
- package/dist/src/watchers/queue_manager.js +223 -0
- package/dist/src/watchers/queue_manager.js.map +1 -0
- package/dist/src/watchers/schedule_watcher.d.ts +94 -1
- package/dist/src/watchers/schedule_watcher.d.ts.map +1 -1
- package/dist/src/watchers/schedule_watcher.js +83 -1
- package/dist/src/watchers/schedule_watcher.js.map +1 -1
- package/dist/stubs/config/telescope_cpu_profiling.stub +0 -0
- package/package.json +31 -16
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { QueueManager } from '../watchers/queue_manager.js';
|
|
2
|
+
import type { UiHttpContext } from './http.js';
|
|
3
|
+
/** `POST <path>/api/queues/live/:queue/enqueue` request body. */
|
|
4
|
+
export interface EnqueueBody {
|
|
5
|
+
name?: unknown;
|
|
6
|
+
payload?: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `GET/POST <path>/api/queues/live*` handlers over the OPTIONAL `queue-manager` watcher capability
|
|
10
|
+
* (`src/watchers/queue_manager.ts`). Mirrors the shape of {@link ProfilesApi}/{@link DiagnosisApi}:
|
|
11
|
+
* constructed from the runtime slot (`getTelescopeRuntime().queueManager`), degrading every route to
|
|
12
|
+
* `404` when it's `null` (capability not enabled / `@adonisjs/queue` not installed).
|
|
13
|
+
*
|
|
14
|
+
* Unlike `nestjs-telescope`'s `TelescopeController` (which addresses N queue-manager DRIVERS by a
|
|
15
|
+
* `:driver` route segment, since a Nest app can register several `QueueManager`s), AdonisJS has
|
|
16
|
+
* exactly ONE `@adonisjs/queue` install per app, so there is exactly one {@link QueueManager} and no
|
|
17
|
+
* `:driver` segment — `<path>/api/queues/live/:queue/...` rather than
|
|
18
|
+
* `<path>/api/queues/live/:driver/:queue/...`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class QueueManagerApi {
|
|
21
|
+
private readonly manager;
|
|
22
|
+
constructor(manager: QueueManager | null);
|
|
23
|
+
/** Whether the capability is enabled at all — surfaced on `GET <path>/api/meta`. */
|
|
24
|
+
isConfigured(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the manager can perform `action` — prefers the precise `capabilities` advertisement
|
|
27
|
+
* (see the {@link QueueManager} doc) and falls back to plain method presence when the driver
|
|
28
|
+
* doesn't expose it.
|
|
29
|
+
*/
|
|
30
|
+
private supports;
|
|
31
|
+
/** `GET <path>/api/queues/live` — configured queues (with counts) + capabilities. */
|
|
32
|
+
list(ctx: UiHttpContext, mutationsEnabled: boolean): Promise<unknown>;
|
|
33
|
+
/** `GET <path>/api/queues/live/:queue/jobs/:id` — one job, or 404. */
|
|
34
|
+
job(ctx: UiHttpContext, queue: string, id: string): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* `POST <path>/api/queues/live/:queue/jobs/:id/retry` — a MUTATION, so the caller (the provider)
|
|
37
|
+
* must have already confirmed `queueActions.enabled`, mirroring `replayRequest`'s convention of
|
|
38
|
+
* the provider owning the gate, not this class. `501` when the driver has no `retry` (mirrors the
|
|
39
|
+
* NestJS sibling's `MethodNotAllowedException` for an unsupported action, without depending on an
|
|
40
|
+
* HTTP-framework-specific exception type here).
|
|
41
|
+
*/
|
|
42
|
+
retry(ctx: UiHttpContext, queue: string, id: string): Promise<unknown>;
|
|
43
|
+
/** `POST <path>/api/queues/live/:queue/enqueue` — dispatch a new job. `501` when unsupported. */
|
|
44
|
+
enqueue(ctx: UiHttpContext, queue: string, body: EnqueueBody): Promise<unknown>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=queue_manager_api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue_manager_api.d.ts","sourceRoot":"","sources":["../../../src/ui/queue_manager_api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,YAAY,EAEb,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY,GAAG,IAAI;IAEzD,oFAAoF;IACpF,YAAY,IAAI,OAAO;IAIvB;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAShB,qFAAqF;IAC/E,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAY3E,sEAAsE;IAChE,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO1E;;;;;;OAMG;IACG,KAAK,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkB5E,iGAAiG;IAC3F,OAAO,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAsBtF"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GET/POST <path>/api/queues/live*` handlers over the OPTIONAL `queue-manager` watcher capability
|
|
3
|
+
* (`src/watchers/queue_manager.ts`). Mirrors the shape of {@link ProfilesApi}/{@link DiagnosisApi}:
|
|
4
|
+
* constructed from the runtime slot (`getTelescopeRuntime().queueManager`), degrading every route to
|
|
5
|
+
* `404` when it's `null` (capability not enabled / `@adonisjs/queue` not installed).
|
|
6
|
+
*
|
|
7
|
+
* Unlike `nestjs-telescope`'s `TelescopeController` (which addresses N queue-manager DRIVERS by a
|
|
8
|
+
* `:driver` route segment, since a Nest app can register several `QueueManager`s), AdonisJS has
|
|
9
|
+
* exactly ONE `@adonisjs/queue` install per app, so there is exactly one {@link QueueManager} and no
|
|
10
|
+
* `:driver` segment — `<path>/api/queues/live/:queue/...` rather than
|
|
11
|
+
* `<path>/api/queues/live/:driver/:queue/...`.
|
|
12
|
+
*/
|
|
13
|
+
export class QueueManagerApi {
|
|
14
|
+
manager;
|
|
15
|
+
constructor(manager) {
|
|
16
|
+
this.manager = manager;
|
|
17
|
+
}
|
|
18
|
+
/** Whether the capability is enabled at all — surfaced on `GET <path>/api/meta`. */
|
|
19
|
+
isConfigured() {
|
|
20
|
+
return this.manager !== null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Whether the manager can perform `action` — prefers the precise `capabilities` advertisement
|
|
24
|
+
* (see the {@link QueueManager} doc) and falls back to plain method presence when the driver
|
|
25
|
+
* doesn't expose it.
|
|
26
|
+
*/
|
|
27
|
+
supports(action) {
|
|
28
|
+
if (this.manager === null)
|
|
29
|
+
return false;
|
|
30
|
+
if (this.manager.capabilities !== undefined)
|
|
31
|
+
return this.manager.capabilities.includes(action);
|
|
32
|
+
// `QueueActionName` names exactly the `QueueManager` method that implements it (`'retry'` →
|
|
33
|
+
// `.retry`, …), so this is the same "presence advertises capability" check the NestJS
|
|
34
|
+
// `BullMqQueueManager`-shaped SPI uses — the fallback for a driver with no `capabilities` getter.
|
|
35
|
+
return typeof this.manager[action] === 'function';
|
|
36
|
+
}
|
|
37
|
+
/** `GET <path>/api/queues/live` — configured queues (with counts) + capabilities. */
|
|
38
|
+
async list(ctx, mutationsEnabled) {
|
|
39
|
+
if (this.manager === null)
|
|
40
|
+
return notConfigured(ctx);
|
|
41
|
+
const queues = await this.manager.listQueues();
|
|
42
|
+
const actions = new Set();
|
|
43
|
+
for (const summary of queues)
|
|
44
|
+
for (const action of summary.actions)
|
|
45
|
+
actions.add(action);
|
|
46
|
+
const capabilities = { mutationsEnabled, actions: [...actions] };
|
|
47
|
+
return ctx.response
|
|
48
|
+
.status(200)
|
|
49
|
+
.header('content-type', 'application/json')
|
|
50
|
+
.send({ data: { queues, capabilities } });
|
|
51
|
+
}
|
|
52
|
+
/** `GET <path>/api/queues/live/:queue/jobs/:id` — one job, or 404. */
|
|
53
|
+
async job(ctx, queue, id) {
|
|
54
|
+
if (this.manager === null)
|
|
55
|
+
return notConfigured(ctx);
|
|
56
|
+
const job = await this.manager.getJob(queue, id);
|
|
57
|
+
if (job === null)
|
|
58
|
+
return ctx.response.status(404).send({ error: 'No job with that id.' });
|
|
59
|
+
return ctx.response.status(200).header('content-type', 'application/json').send({ data: job });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `POST <path>/api/queues/live/:queue/jobs/:id/retry` — a MUTATION, so the caller (the provider)
|
|
63
|
+
* must have already confirmed `queueActions.enabled`, mirroring `replayRequest`'s convention of
|
|
64
|
+
* the provider owning the gate, not this class. `501` when the driver has no `retry` (mirrors the
|
|
65
|
+
* NestJS sibling's `MethodNotAllowedException` for an unsupported action, without depending on an
|
|
66
|
+
* HTTP-framework-specific exception type here).
|
|
67
|
+
*/
|
|
68
|
+
async retry(ctx, queue, id) {
|
|
69
|
+
if (this.manager === null)
|
|
70
|
+
return notConfigured(ctx);
|
|
71
|
+
if (!this.supports('retry') || !this.manager.retry) {
|
|
72
|
+
return ctx.response
|
|
73
|
+
.status(501)
|
|
74
|
+
.send({ error: 'This queue adapter does not support retrying a job.' });
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
await this.manager.retry(queue, id);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
return ctx.response.status(400).send({ error: asMessage(err) });
|
|
81
|
+
}
|
|
82
|
+
return ctx.response
|
|
83
|
+
.status(200)
|
|
84
|
+
.header('content-type', 'application/json')
|
|
85
|
+
.send({ data: { ok: true } });
|
|
86
|
+
}
|
|
87
|
+
/** `POST <path>/api/queues/live/:queue/enqueue` — dispatch a new job. `501` when unsupported. */
|
|
88
|
+
async enqueue(ctx, queue, body) {
|
|
89
|
+
if (this.manager === null)
|
|
90
|
+
return notConfigured(ctx);
|
|
91
|
+
if (!this.supports('enqueue') || !this.manager.enqueue) {
|
|
92
|
+
return ctx.response
|
|
93
|
+
.status(501)
|
|
94
|
+
.send({ error: 'This queue adapter does not support enqueueing a job.' });
|
|
95
|
+
}
|
|
96
|
+
if (body === undefined || body === null || !('payload' in body)) {
|
|
97
|
+
return ctx.response.status(400).send({ error: 'Body must include a "payload".' });
|
|
98
|
+
}
|
|
99
|
+
const name = typeof body.name === 'string' && body.name !== '' ? body.name : undefined;
|
|
100
|
+
try {
|
|
101
|
+
const data = await this.manager.enqueue(queue, body.payload, name !== undefined ? { name } : {});
|
|
102
|
+
return ctx.response.status(200).header('content-type', 'application/json').send({ data });
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
return ctx.response.status(400).send({ error: asMessage(err) });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function notConfigured(ctx) {
|
|
110
|
+
return ctx.response.status(404).send({
|
|
111
|
+
error: 'The live queue manager is not configured (enable the "queue-manager" watcher and set ' +
|
|
112
|
+
'telescope_watchers.queueManager.queues).',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function asMessage(err) {
|
|
116
|
+
return err instanceof Error ? err.message : String(err);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=queue_manager_api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue_manager_api.js","sourceRoot":"","sources":["../../../src/ui/queue_manager_api.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAAG,CAAC;IAE7D,oFAAoF;IACpF,YAAY;QACV,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACK,QAAQ,CAAC,MAAuB;QACtC,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QACxC,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/F,4FAA4F;QAC5F,sFAAsF;QACtF,kGAAkG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OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QACnC,KAAK,EACH,uFAAuF;YACvF,0CAA0C;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { TelescopeService } from '../service.js';
|
|
2
|
+
import type { ScheduleRunStatus } from '../watchers/schedule_watcher.js';
|
|
3
|
+
import { type RegisteredSchedule } from '../watchers/schedule_watcher.js';
|
|
4
|
+
import type { UiHttpContext } from './http.js';
|
|
5
|
+
/**
|
|
6
|
+
* One row of the Live Schedules view: a {@link RegisteredSchedule} (name/kind/expression/`nextRunAt`
|
|
7
|
+
* — what `registerSchedule()` told us EXISTS) joined against its most recent `scheduled_task` entry
|
|
8
|
+
* (what the schedule watcher recorded ACTUALLY ran). Mirrors the shape of `nestjs-telescope`'s
|
|
9
|
+
* `ScheduledTask` closely enough for the two dashboards' schedule views to share a component shape,
|
|
10
|
+
* MINUS `running`: AdonisJS has no object to read a running/stopped flag off (see
|
|
11
|
+
* `schedule_watcher.ts`'s module doc), so that field is simply omitted rather than faked as `null`
|
|
12
|
+
* everywhere (which the NestJS type uses for "unknowable" — here it would be "always unknowable",
|
|
13
|
+
* which isn't worth a column).
|
|
14
|
+
*/
|
|
15
|
+
export interface LiveScheduledTask {
|
|
16
|
+
name: string;
|
|
17
|
+
kind: RegisteredSchedule['kind'];
|
|
18
|
+
schedule: string | null;
|
|
19
|
+
nextRunAt: string | null;
|
|
20
|
+
lastRunAt: string | null;
|
|
21
|
+
lastDurationMs: number | null;
|
|
22
|
+
lastStatus: ScheduleRunStatus | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `GET <path>/api/schedules/live` handler over the registry `registerSchedule()` maintains (see
|
|
26
|
+
* `schedule_watcher.ts`'s module doc for the full design rationale — there is no scanning mechanism
|
|
27
|
+
* to build this from, so it is populated by explicit registration). Kept in its own class mirroring
|
|
28
|
+
* {@link ProfilesApi}/{@link QueueManagerApi} for the same reason: it reads a registry the provider
|
|
29
|
+
* doesn't hand to {@link TelescopeApi}'s constructor.
|
|
30
|
+
*
|
|
31
|
+
* Unlike those two, there is no "not configured" 404 here: {@link listRegisteredSchedules} already
|
|
32
|
+
* degrades to `[]` when the schedule watcher isn't started, and an EMPTY schedules list is a normal,
|
|
33
|
+
* renderable state (not an error) — mirroring `nestjs-telescope`'s `schedules/live` route, which
|
|
34
|
+
* likewise just returns `{ tasks: [] }` when nothing is registered yet.
|
|
35
|
+
*/
|
|
36
|
+
export declare class SchedulesApi {
|
|
37
|
+
private readonly service;
|
|
38
|
+
constructor(service: TelescopeService);
|
|
39
|
+
/** `GET <path>/api/schedules/live` — every registered schedule, joined with its last run. */
|
|
40
|
+
live(ctx: UiHttpContext): Promise<unknown>;
|
|
41
|
+
private withLastRun;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=schedules_api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_api.d.ts","sourceRoot":"","sources":["../../../src/ui/schedules_api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAwB,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,KAAK,kBAAkB,EAA2B,MAAM,iCAAiC,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,gBAAgB;IAEtD,6FAA6F;IACvF,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;YASlC,WAAW;CAc1B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { listRegisteredSchedules } from '../watchers/schedule_watcher.js';
|
|
2
|
+
/**
|
|
3
|
+
* `GET <path>/api/schedules/live` handler over the registry `registerSchedule()` maintains (see
|
|
4
|
+
* `schedule_watcher.ts`'s module doc for the full design rationale — there is no scanning mechanism
|
|
5
|
+
* to build this from, so it is populated by explicit registration). Kept in its own class mirroring
|
|
6
|
+
* {@link ProfilesApi}/{@link QueueManagerApi} for the same reason: it reads a registry the provider
|
|
7
|
+
* doesn't hand to {@link TelescopeApi}'s constructor.
|
|
8
|
+
*
|
|
9
|
+
* Unlike those two, there is no "not configured" 404 here: {@link listRegisteredSchedules} already
|
|
10
|
+
* degrades to `[]` when the schedule watcher isn't started, and an EMPTY schedules list is a normal,
|
|
11
|
+
* renderable state (not an error) — mirroring `nestjs-telescope`'s `schedules/live` route, which
|
|
12
|
+
* likewise just returns `{ tasks: [] }` when nothing is registered yet.
|
|
13
|
+
*/
|
|
14
|
+
export class SchedulesApi {
|
|
15
|
+
service;
|
|
16
|
+
constructor(service) {
|
|
17
|
+
this.service = service;
|
|
18
|
+
}
|
|
19
|
+
/** `GET <path>/api/schedules/live` — every registered schedule, joined with its last run. */
|
|
20
|
+
async live(ctx) {
|
|
21
|
+
const registered = listRegisteredSchedules();
|
|
22
|
+
const tasks = await Promise.all(registered.map((reg) => this.withLastRun(reg)));
|
|
23
|
+
return ctx.response
|
|
24
|
+
.status(200)
|
|
25
|
+
.header('content-type', 'application/json')
|
|
26
|
+
.send({ data: { tasks } });
|
|
27
|
+
}
|
|
28
|
+
async withLastRun(reg) {
|
|
29
|
+
// Newest-first + familyHash exact match + limit 1 ⇒ the single most recent run of this task.
|
|
30
|
+
const [last] = await this.service.list({ familyHash: `schedule:${reg.name}`, limit: 1 });
|
|
31
|
+
const content = last?.content;
|
|
32
|
+
return {
|
|
33
|
+
name: reg.name,
|
|
34
|
+
kind: reg.kind,
|
|
35
|
+
schedule: reg.schedule,
|
|
36
|
+
nextRunAt: reg.nextRunAt,
|
|
37
|
+
lastRunAt: last ? toIso(last.createdAt) : null,
|
|
38
|
+
lastDurationMs: content?.durationMs ?? last?.durationMs ?? null,
|
|
39
|
+
lastStatus: content?.status ?? null,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function toIso(value) {
|
|
44
|
+
return value instanceof Date ? value.toISOString() : String(value);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=schedules_api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_api.js","sourceRoot":"","sources":["../../../src/ui/schedules_api.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAuBnG;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAE1D,6FAA6F;IAC7F,KAAK,CAAC,IAAI,CAAC,GAAkB;QAC3B,MAAM,UAAU,GAAG,uBAAuB,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChF,OAAO,GAAG,CAAC,QAAQ;aAChB,MAAM,CAAC,GAAG,CAAC;aACX,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC;aAC1C,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,GAAuB;QAC/C,6FAA6F;QAC7F,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,IAAI,EAAE,OAA2C,CAAC;QAClE,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;YAC9C,cAAc,EAAE,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,UAAU,IAAI,IAAI;YAC/D,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,IAAI;SACpC,CAAC;IACJ,CAAC;CACF;AAED,SAAS,KAAK,CAAC,KAAoB;IACjC,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The next fire time (epoch ms) for a cron expression, strictly after `fromMs`. Returns `null` when
|
|
3
|
+
* `cron-parser` isn't installed, or the expression fails to parse (never throws).
|
|
4
|
+
*/
|
|
5
|
+
export declare function nextCronRunMs(expression: string, fromMs: number, timezone?: string | null): number | null;
|
|
6
|
+
/** Exposed for tests that need to reset the module-level cache between "peer present/absent" cases. */
|
|
7
|
+
export declare function __resetCronParserCacheForTests(): void;
|
|
8
|
+
//# sourceMappingURL=cron_next_run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron_next_run.d.ts","sourceRoot":"","sources":["../../../src/watchers/cron_next_run.ts"],"names":[],"mappings":"AAoDA;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,MAAM,GAAG,IAAI,CAaf;AAED,uGAAuG;AACvG,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
/**
|
|
3
|
+
* Cache the resolved parse function (or `null` when the peer is absent/broken) so we only
|
|
4
|
+
* `require('cron-parser')` once per process, and only when a `cron`-kind schedule is actually
|
|
5
|
+
* registered — mirroring the rest of this package's "never import an optional peer eagerly" stance.
|
|
6
|
+
*/
|
|
7
|
+
let cached;
|
|
8
|
+
/**
|
|
9
|
+
* Lazily load `cron-parser`'s expression parser, tolerating BOTH shapes the library has shipped:
|
|
10
|
+
*
|
|
11
|
+
* - **v4** (`cron-parser@4.x`, what `@adonis-agora/durable` pins in its devDependencies and what
|
|
12
|
+
* this package's peer range was chosen to match): a top-level `parseExpression(expr, opts)`.
|
|
13
|
+
* - **v5** (`cron-parser@5.x`): `parseExpression` was REMOVED from the top level; the equivalent
|
|
14
|
+
* is the static `CronExpressionParser.parse(expr, opts)`.
|
|
15
|
+
*
|
|
16
|
+
* `@adonis-agora/durable`'s own `scheduler.ts` peer range (`^4.0.0 || ^5.0.0`) claims both are
|
|
17
|
+
* supported but its code only calls the v4-shaped `parser.parseExpression` — under a real
|
|
18
|
+
* `cron-parser@5.x` install that throws (confirmed against the published v5 `dist/index.js`, which
|
|
19
|
+
* exports no top-level `parseExpression`). This loader fixes that gap for OUR peer range rather than
|
|
20
|
+
* repeating it: it tries the v4 shape, then the v5 shape, so `nextCronRunMs` genuinely works under
|
|
21
|
+
* either major version we advertise support for.
|
|
22
|
+
*
|
|
23
|
+
* Returns `null` when `cron-parser` is not installed (or exposes neither shape) — the OPTIONAL peer
|
|
24
|
+
* is genuinely optional: without it, `nextRunAt` for `cron`-kind schedules is `null` ("unknown")
|
|
25
|
+
* rather than the registry throwing or the whole feature refusing to boot.
|
|
26
|
+
*/
|
|
27
|
+
function loadCronParse() {
|
|
28
|
+
if (cached !== undefined)
|
|
29
|
+
return cached;
|
|
30
|
+
try {
|
|
31
|
+
const requireFn = createRequire(import.meta.url);
|
|
32
|
+
const mod = requireFn('cron-parser');
|
|
33
|
+
const v4 = mod.parseExpression;
|
|
34
|
+
const v5Class = mod.CronExpressionParser;
|
|
35
|
+
const v5 = typeof v5Class?.parse === 'function' ? v5Class.parse.bind(v5Class) : undefined;
|
|
36
|
+
cached = v4 ?? v5 ?? null;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
cached = null;
|
|
40
|
+
}
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The next fire time (epoch ms) for a cron expression, strictly after `fromMs`. Returns `null` when
|
|
45
|
+
* `cron-parser` isn't installed, or the expression fails to parse (never throws).
|
|
46
|
+
*/
|
|
47
|
+
export function nextCronRunMs(expression, fromMs, timezone) {
|
|
48
|
+
const parse = loadCronParse();
|
|
49
|
+
if (parse === null)
|
|
50
|
+
return null;
|
|
51
|
+
try {
|
|
52
|
+
const interval = parse(expression, {
|
|
53
|
+
// +1ms so a `fromMs` that lands exactly on a fire time still returns the NEXT one, not itself.
|
|
54
|
+
currentDate: new Date(fromMs + 1),
|
|
55
|
+
...(timezone ? { tz: timezone } : {}),
|
|
56
|
+
});
|
|
57
|
+
return interval.next().toDate().getTime();
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Exposed for tests that need to reset the module-level cache between "peer present/absent" cases. */
|
|
64
|
+
export function __resetCronParserCacheForTests() {
|
|
65
|
+
cached = undefined;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=cron_next_run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron_next_run.js","sourceRoot":"","sources":["../../../src/watchers/cron_next_run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C;;;;GAIG;AACH,IAAI,MAAsC,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,aAAa;IACpB,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,CAA4B,CAAC;QAChE,MAAM,EAAE,GAAG,GAAG,CAAC,eAA0C,CAAC;QAC1D,MAAM,OAAO,GAAG,GAAG,CAAC,oBAA2D,CAAC;QAChF,MAAM,EAAE,GAAG,OAAO,OAAO,EAAE,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1F,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAkB,EAClB,MAAc,EACd,QAAwB;IAExB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,EAAE;YACjC,+FAA+F;YAC/F,WAAW,EAAE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,8BAA8B;IAC5C,MAAM,GAAG,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* helpers are a zero-cost no-op.
|
|
19
19
|
*/
|
|
20
20
|
/** The per-technology watchers this package ships. */
|
|
21
|
-
export type WatcherName = 'query' | 'mail' | 'cache' | 'http-client' | 'logs' | 'queue' | 'events' | 'redis' | 'profiling' | 'schedule';
|
|
21
|
+
export type WatcherName = 'query' | 'mail' | 'cache' | 'http-client' | 'logs' | 'queue' | 'events' | 'redis' | 'profiling' | 'schedule' | 'queue-manager';
|
|
22
22
|
/**
|
|
23
23
|
* Tuning for the `http-client` (outbound) watcher. Outbound HTTP is opt-in
|
|
24
24
|
* instrumentation (Adonis has no single built-in client, so nothing is
|
|
@@ -102,6 +102,29 @@ export interface ScheduleWatcherConfig {
|
|
|
102
102
|
export interface ResolvedScheduleWatcherConfig {
|
|
103
103
|
slowMs: number;
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Config for the `'queue-manager'` capability — the Live Queue Manager driver
|
|
107
|
+
* (`src/watchers/queue_manager.ts`) over the OPTIONAL `@adonisjs/queue` peer. Distinct from the
|
|
108
|
+
* `'queue'` watcher (which records past job EXECUTIONS as `job` entries): this is a live
|
|
109
|
+
* list/inspect/retry/enqueue control surface, not an entry watcher — see `queue_manager.ts`'s module
|
|
110
|
+
* doc for exactly what `@boringnode/queue`'s public API does and doesn't support.
|
|
111
|
+
*/
|
|
112
|
+
export interface QueueManagerWatcherConfig {
|
|
113
|
+
/**
|
|
114
|
+
* Explicit queue names to surface. REQUIRED to get anything: `@boringnode/queue` has no
|
|
115
|
+
* queue-enumeration API (queue names only exist as strings at dispatch time), so there is nothing
|
|
116
|
+
* to auto-discover. Default `[]` (the driver constructs but reports `configured: false`).
|
|
117
|
+
*/
|
|
118
|
+
queues?: string[];
|
|
119
|
+
/** Which configured `@boringnode/queue` adapter to resolve via `queue.use(name)`. Omit to use the
|
|
120
|
+
* manager's own default adapter. */
|
|
121
|
+
adapter?: string;
|
|
122
|
+
}
|
|
123
|
+
/** The fully-resolved `queue-manager` config (no optionals). */
|
|
124
|
+
export interface ResolvedQueueManagerWatcherConfig {
|
|
125
|
+
queues: string[];
|
|
126
|
+
adapter: string | undefined;
|
|
127
|
+
}
|
|
105
128
|
/**
|
|
106
129
|
* The shape of `config/telescope_watchers.ts`. Everything is optional: by default
|
|
107
130
|
* only the Lucid `query` watcher is enabled (it is the one whose events are
|
|
@@ -125,6 +148,7 @@ export interface TelescopeWatchersConfig {
|
|
|
125
148
|
* - `'redis'` — records `@adonisjs/redis` commands (optional peer).
|
|
126
149
|
* - `'profiling'` — publishes the `profile()`/`startProfile()` span helpers.
|
|
127
150
|
* - `'schedule'` — publishes the `scheduleTask()`/`recordScheduledRun()` helpers.
|
|
151
|
+
* - `'queue-manager'` — publishes the Live Queue Manager driver (list/inspect/retry/enqueue).
|
|
128
152
|
*/
|
|
129
153
|
watchers?: WatcherName[];
|
|
130
154
|
/** Tuning for the Lucid `query` watcher (slow threshold, bindings, ignore-connections, normalize). */
|
|
@@ -135,6 +159,8 @@ export interface TelescopeWatchersConfig {
|
|
|
135
159
|
profiling?: ProfilingWatcherConfig;
|
|
136
160
|
/** Tuning for the `schedule` watcher (slow-run threshold). */
|
|
137
161
|
schedule?: ScheduleWatcherConfig;
|
|
162
|
+
/** Config for the `queue-manager` capability (explicit queue names, adapter selection). */
|
|
163
|
+
queueManager?: QueueManagerWatcherConfig;
|
|
138
164
|
}
|
|
139
165
|
/** The fully-resolved watchers config the provider acts on (no optionals). */
|
|
140
166
|
export interface ResolvedTelescopeWatchersConfig {
|
|
@@ -144,6 +170,7 @@ export interface ResolvedTelescopeWatchersConfig {
|
|
|
144
170
|
httpClient: ResolvedHttpClientWatcherConfig;
|
|
145
171
|
profiling: ResolvedProfilingWatcherConfig;
|
|
146
172
|
schedule: ResolvedScheduleWatcherConfig;
|
|
173
|
+
queueManager: ResolvedQueueManagerWatcherConfig;
|
|
147
174
|
}
|
|
148
175
|
/** The default set of enabled watchers — the verified Lucid query watcher only. */
|
|
149
176
|
export declare const DEFAULT_WATCHERS: WatcherName[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../../src/watchers/define_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sDAAsD;AACtD,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,MAAM,GACN,OAAO,GACP,aAAa,GACb,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,GACP,WAAW,GACX,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../../../src/watchers/define_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,sDAAsD;AACtD,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,MAAM,GACN,OAAO,GACP,aAAa,GACb,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,GACP,WAAW,GACX,UAAU,GACV,eAAe,CAAC;AAEpB;;;;;G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41,7 @@ export function resolveConfig(config = {}) {
|
|
|
41
41
|
const httpClient = config.httpClient ?? {};
|
|
42
42
|
const profiling = config.profiling ?? {};
|
|
43
43
|
const schedule = config.schedule ?? {};
|
|
44
|
+
const queueManager = config.queueManager ?? {};
|
|
44
45
|
return {
|
|
45
46
|
enabled: config.enabled ?? true,
|
|
46
47
|
watchers: new Set(config.watchers ?? DEFAULT_WATCHERS),
|
|
@@ -62,6 +63,10 @@ export function resolveConfig(config = {}) {
|
|
|
62
63
|
schedule: {
|
|
63
64
|
slowMs: schedule.slowMs ?? DEFAULT_SCHEDULE_SLOW_MS,
|
|
64
65
|
},
|
|
66
|
+
queueManager: {
|
|
67
|
+
queues: queueManager.queues ?? [],
|
|
68
|
+
adapter: queueManager.adapter,
|
|
69
|
+
},
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
//# sourceMappingURL=define_config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../../src/watchers/define_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"define_config.js","sourceRoot":"","sources":["../../../src/watchers/define_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAsCH,iDAAiD;AACjD,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAsCzC;kDACkD;AAClD,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAoBlC,sDAAsD;AACtD,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAiBtC,2DAA2D;AAC3D,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAkFtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAkB,CAAC,OAAO,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAA+B;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,aAAa,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
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.7.1";
|
|
3
3
|
export type { EmitterLike, Watcher } from './emitter.js';
|
|
4
4
|
export { resolveStore, safeRecord } from './record.js';
|
|
5
5
|
export { buildQueryEntry, DB_QUERY_EVENT, LucidQueryWatcher } from './lucid_query_watcher.js';
|
|
@@ -22,8 +22,11 @@ export { buildRedisEntry, RedisWatcher } from './redis_watcher.js';
|
|
|
22
22
|
export type { RedisClientLike, RedisCommandLike, RedisConnectionLike, RedisEntryContent, RedisManagerLike, } from './redis_watcher.js';
|
|
23
23
|
export { buildProfileEntry, PROFILE_ENTRY_TYPE, profile, ProfilingWatcher, startProfile, } from './profiling_watcher.js';
|
|
24
24
|
export type { CompletedProfile, ProfileEntryContent, ProfileMark, ProfileSession, ProfileStatus, ProfilingWatcherOptions, } from './profiling_watcher.js';
|
|
25
|
-
export { buildScheduleEntry, recordScheduledRun, SCHEDULED_TASK_ENTRY_TYPE, ScheduleWatcher, scheduleTask, } from './schedule_watcher.js';
|
|
26
|
-
export type { ScheduleEntryContent, ScheduledRun, ScheduledTaskOptions, ScheduleKind, ScheduleRunStatus, ScheduleWatcherOptions, } from './schedule_watcher.js';
|
|
25
|
+
export { buildScheduleEntry, listRegisteredSchedules, recordScheduledRun, registerSchedule, SCHEDULED_TASK_ENTRY_TYPE, ScheduleWatcher, scheduleTask, toRegisteredSchedule, unregisterSchedule, } from './schedule_watcher.js';
|
|
26
|
+
export type { RegisteredSchedule, ScheduleEntryContent, ScheduledRun, ScheduledTaskOptions, ScheduleKind, ScheduleRegistration, ScheduleRunStatus, ScheduleWatcherOptions, } from './schedule_watcher.js';
|
|
27
|
+
export { nextCronRunMs } from './cron_next_run.js';
|
|
28
|
+
export { isQueueAction, isQueueState, QUEUE_ACTIONS, QUEUE_STATES, QueueManagerDriver, } from './queue_manager.js';
|
|
29
|
+
export type { JobPage, QueueActionName, QueueAdapterLike, QueueCapabilities, QueueCounts, QueueJob, QueueJobDetail, QueueJobRecordLike, QueueLike, QueueManager, QueueManagerDriverOptions, QueueState, QueueSummary, } from './queue_manager.js';
|
|
27
30
|
export { DEFAULT_WATCHERS, defineConfig, resolveConfig, } from './define_config.js';
|
|
28
|
-
export type { HttpClientWatcherConfig, ProfilingWatcherConfig, QueryWatcherConfig, ResolvedHttpClientWatcherConfig, ResolvedProfilingWatcherConfig, ResolvedQueryWatcherConfig, ResolvedScheduleWatcherConfig, ResolvedTelescopeWatchersConfig, ScheduleWatcherConfig, TelescopeWatchersConfig, WatcherName, } from './define_config.js';
|
|
31
|
+
export type { HttpClientWatcherConfig, ProfilingWatcherConfig, QueryWatcherConfig, QueueManagerWatcherConfig, ResolvedHttpClientWatcherConfig, ResolvedProfilingWatcherConfig, ResolvedQueryWatcherConfig, ResolvedQueueManagerWatcherConfig, ResolvedScheduleWatcherConfig, ResolvedTelescopeWatchersConfig, ScheduleWatcherConfig, TelescopeWatchersConfig, WatcherName, } from './define_config.js';
|
|
29
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/watchers/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,YAAY,EACV,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW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,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,yBAAyB,EACzB,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,GACZ,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Keep in sync with this package's `version` in package.json. */
|
|
2
|
-
export const VERSION = '0.
|
|
2
|
+
export const VERSION = '0.7.1';
|
|
3
3
|
// — runtime recording (advanced) —
|
|
4
4
|
export { resolveStore, safeRecord } from './record.js';
|
|
5
5
|
// — Lucid query watcher (the headline watcher) —
|
|
@@ -23,7 +23,10 @@ export { buildRedisEntry, RedisWatcher } from './redis_watcher.js';
|
|
|
23
23
|
// — profiling watcher (user-driven timing spans; opt-in helpers) —
|
|
24
24
|
export { buildProfileEntry, PROFILE_ENTRY_TYPE, profile, ProfilingWatcher, startProfile, } from './profiling_watcher.js';
|
|
25
25
|
// — schedule watcher (scheduled-task runs; explicit wrapper integration) —
|
|
26
|
-
export { buildScheduleEntry, recordScheduledRun, SCHEDULED_TASK_ENTRY_TYPE, ScheduleWatcher, scheduleTask, } from './schedule_watcher.js';
|
|
26
|
+
export { buildScheduleEntry, listRegisteredSchedules, recordScheduledRun, registerSchedule, SCHEDULED_TASK_ENTRY_TYPE, ScheduleWatcher, scheduleTask, toRegisteredSchedule, unregisterSchedule, } from './schedule_watcher.js';
|
|
27
|
+
export { nextCronRunMs } from './cron_next_run.js';
|
|
28
|
+
// — live queue manager (optional peer: @adonisjs/queue / @boringnode/queue) —
|
|
29
|
+
export { isQueueAction, isQueueState, QUEUE_ACTIONS, QUEUE_STATES, QueueManagerDriver, } from './queue_manager.js';
|
|
27
30
|
// — config —
|
|
28
31
|
export { DEFAULT_WATCHERS, defineConfig, resolveConfig, } from './define_config.js';
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/watchers/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAK/B,mCAAmC;AACnC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvD,iDAAiD;AACjD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAM9F,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,mBAAmB;AACnB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGjF,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjF,qCAAqC;AACrC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQvF,0DAA0D;AAC1D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAA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