@adonis-agora/durable 1.0.0-rc.19 → 1.0.0-rc.20
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 +8 -0
- package/dist/commands/health.d.ts +12 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +34 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/lifecycle_republish.d.ts +8 -9
- package/dist/commands/lifecycle_republish.d.ts.map +1 -1
- package/dist/commands/lifecycle_republish.js +29 -16
- package/dist/commands/lifecycle_republish.js.map +1 -1
- package/dist/commands/main.d.ts +24 -5
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +50 -7
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/runs.d.ts +9 -16
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +60 -49
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/runs_bulk.d.ts +17 -0
- package/dist/commands/runs_bulk.d.ts.map +1 -0
- package/dist/commands/runs_bulk.js +74 -0
- package/dist/commands/runs_bulk.js.map +1 -0
- package/dist/commands/runs_cancel.d.ts +15 -0
- package/dist/commands/runs_cancel.d.ts.map +1 -0
- package/dist/commands/runs_cancel.js +39 -0
- package/dist/commands/runs_cancel.js.map +1 -0
- package/dist/commands/runs_continue.d.ts +12 -0
- package/dist/commands/runs_continue.d.ts.map +1 -0
- package/dist/commands/runs_continue.js +28 -0
- package/dist/commands/runs_continue.js.map +1 -0
- package/dist/commands/runs_event.d.ts +13 -0
- package/dist/commands/runs_event.d.ts.map +1 -0
- package/dist/commands/runs_event.js +28 -0
- package/dist/commands/runs_event.js.map +1 -0
- package/dist/commands/runs_fan.d.ts +16 -0
- package/dist/commands/runs_fan.d.ts.map +1 -0
- package/dist/commands/runs_fan.js +58 -0
- package/dist/commands/runs_fan.js.map +1 -0
- package/dist/commands/runs_redispatch.d.ts +14 -0
- package/dist/commands/runs_redispatch.d.ts.map +1 -0
- package/dist/commands/runs_redispatch.js +35 -0
- package/dist/commands/runs_redispatch.js.map +1 -0
- package/dist/commands/runs_replay.d.ts +14 -0
- package/dist/commands/runs_replay.d.ts.map +1 -0
- package/dist/commands/runs_replay.js +38 -0
- package/dist/commands/runs_replay.js.map +1 -0
- package/dist/commands/runs_retry.d.ts +13 -0
- package/dist/commands/runs_retry.d.ts.map +1 -0
- package/dist/commands/runs_retry.js +29 -0
- package/dist/commands/runs_retry.js.map +1 -0
- package/dist/commands/runs_show.d.ts +14 -0
- package/dist/commands/runs_show.d.ts.map +1 -0
- package/dist/commands/runs_show.js +96 -0
- package/dist/commands/runs_show.js.map +1 -0
- package/dist/commands/runs_signal.d.ts +17 -0
- package/dist/commands/runs_signal.d.ts.map +1 -0
- package/dist/commands/runs_signal.js +49 -0
- package/dist/commands/runs_signal.js.map +1 -0
- package/dist/commands/runs_update.d.ts +15 -0
- package/dist/commands/runs_update.d.ts.map +1 -0
- package/dist/commands/runs_update.js +39 -0
- package/dist/commands/runs_update.js.map +1 -0
- package/dist/commands/runs_values.d.ts +15 -0
- package/dist/commands/runs_values.d.ts.map +1 -0
- package/dist/commands/runs_values.js +45 -0
- package/dist/commands/runs_values.js.map +1 -0
- package/dist/commands/schedules.d.ts +18 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +70 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/schedules_pause.d.ts +16 -0
- package/dist/commands/schedules_pause.d.ts.map +1 -0
- package/dist/commands/schedules_pause.js +40 -0
- package/dist/commands/schedules_pause.js.map +1 -0
- package/dist/commands/schedules_resume.d.ts +8 -0
- package/dist/commands/schedules_resume.d.ts.map +1 -0
- package/dist/commands/schedules_resume.js +8 -0
- package/dist/commands/schedules_resume.js.map +1 -0
- package/dist/commands/schedules_trigger.d.ts +13 -0
- package/dist/commands/schedules_trigger.d.ts.map +1 -0
- package/dist/commands/schedules_trigger.js +32 -0
- package/dist/commands/schedules_trigger.js.map +1 -0
- package/dist/commands/tasks_complete.d.ts +15 -0
- package/dist/commands/tasks_complete.d.ts.map +1 -0
- package/dist/commands/tasks_complete.js +41 -0
- package/dist/commands/tasks_complete.js.map +1 -0
- package/dist/commands/tasks_fail.d.ts +16 -0
- package/dist/commands/tasks_fail.d.ts.map +1 -0
- package/dist/commands/tasks_fail.js +47 -0
- package/dist/commands/tasks_fail.js.map +1 -0
- package/dist/commands/workers.d.ts +11 -0
- package/dist/commands/workers.d.ts.map +1 -0
- package/dist/commands/workers.js +35 -0
- package/dist/commands/workers.js.map +1 -0
- package/dist/commands/workflows_lifecycle.d.ts +12 -0
- package/dist/commands/workflows_lifecycle.d.ts.map +1 -0
- package/dist/commands/workflows_lifecycle.js +37 -0
- package/dist/commands/workflows_lifecycle.js.map +1 -0
- package/dist/configure.d.ts +1 -1
- package/dist/configure.js +1 -1
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +2 -18
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/commands/console_command.d.ts +82 -0
- package/dist/src/commands/console_command.d.ts.map +1 -0
- package/dist/src/commands/console_command.js +238 -0
- package/dist/src/commands/console_command.js.map +1 -0
- package/dist/src/commands/runs.js +1 -1
- package/dist/src/commands/runs.js.map +1 -1
- package/dist/src/dashboard/audit.d.ts +14 -0
- package/dist/src/dashboard/audit.d.ts.map +1 -0
- package/dist/src/dashboard/audit.js +36 -0
- package/dist/src/dashboard/audit.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +7 -3
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/dev_tools.d.ts.map +1 -1
- package/dist/src/dashboard/dev_tools.js +4 -11
- package/dist/src/dashboard/dev_tools.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +17 -0
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +14 -0
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/engine.d.ts +6 -0
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +16 -3
- package/dist/src/engine.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/durable-reliability/SKILL.md +11 -5
- package/dist/commands/retry.d.ts +0 -16
- package/dist/commands/retry.d.ts.map +0 -1
- package/dist/commands/retry.js +0 -34
- package/dist/commands/retry.js.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { CliRefusal, cell, DurableConsoleCommand, renderTable, } from '../src/commands/console_command.js';
|
|
9
|
+
import { getRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/** Read a dotted path (`run.input`, `timeline.2.output`) out of a run detail. */
|
|
11
|
+
function pick(body, path) {
|
|
12
|
+
let cursor = body;
|
|
13
|
+
for (const part of path.split('.')) {
|
|
14
|
+
if (cursor === null || typeof cursor !== 'object' || !Object.hasOwn(cursor, part)) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
cursor = cursor[part];
|
|
18
|
+
}
|
|
19
|
+
return cursor;
|
|
20
|
+
}
|
|
21
|
+
/** A step's error, cut for a table cell. */
|
|
22
|
+
function errorCell(error) {
|
|
23
|
+
return error === undefined || error === null ? '-' : cell(error).slice(0, 80);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `node ace durable:runs:show <id>` — one run's detail through the console's `GET /runs/:id`: the
|
|
27
|
+
* run, its step timeline, children and fans. `--field run.output` prints one value in full.
|
|
28
|
+
*/
|
|
29
|
+
export default class DurableRunsShow extends DurableConsoleCommand {
|
|
30
|
+
static commandName = 'durable:runs:show';
|
|
31
|
+
static description = 'Show one run: status, input/output/error and its step timeline';
|
|
32
|
+
async perform() {
|
|
33
|
+
const body = await this.call(getRun, {
|
|
34
|
+
params: { id: this.id },
|
|
35
|
+
query: this.full ? { full: 'true' } : {},
|
|
36
|
+
});
|
|
37
|
+
if (this.field !== undefined) {
|
|
38
|
+
const value = pick(body, this.field);
|
|
39
|
+
if (value === undefined)
|
|
40
|
+
throw new CliRefusal(`run ${this.id} has no field "${this.field}"`);
|
|
41
|
+
this.printJson(this.json ? { id: this.id, field: this.field, value } : value);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (this.json) {
|
|
45
|
+
this.printJson(body);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const run = body.run;
|
|
49
|
+
const lines = [
|
|
50
|
+
`Run ${cell(run.id)}`,
|
|
51
|
+
`Workflow ${cell(run.workflow)}@${cell(run.workflowVersion)}`,
|
|
52
|
+
`Status ${cell(run.status)}`,
|
|
53
|
+
`Namespace ${cell(run.namespace)}`,
|
|
54
|
+
...(run.tenantId !== undefined ? [`Tenant ${cell(run.tenantId)}`] : []),
|
|
55
|
+
`Tags ${Array.isArray(run.tags) && run.tags.length > 0 ? run.tags.join(', ') : '-'}`,
|
|
56
|
+
`Created ${cell(run.createdAt)}`,
|
|
57
|
+
`Updated ${cell(run.updatedAt)}`,
|
|
58
|
+
...(run.waiting !== undefined ? [`Waiting ${cell(run.waiting)}`] : []),
|
|
59
|
+
`Input ${cell(run.input)}`,
|
|
60
|
+
`Output ${cell(run.output)}`,
|
|
61
|
+
...(run.error !== undefined && run.error !== null ? [`Error ${cell(run.error)}`] : []),
|
|
62
|
+
];
|
|
63
|
+
this.logger.log(lines.join('\n'));
|
|
64
|
+
const timeline = body.timeline ?? [];
|
|
65
|
+
this.logger.log(timeline.length === 0
|
|
66
|
+
? '\nNo steps.'
|
|
67
|
+
: `\n${renderTable(['SEQ', 'STEP', 'KIND', 'STATUS', 'ATTEMPTS', 'DURATION', 'ERROR'], timeline.map((s) => [
|
|
68
|
+
cell(s.seq),
|
|
69
|
+
cell(s.name),
|
|
70
|
+
cell(s.kind),
|
|
71
|
+
cell(s.status),
|
|
72
|
+
cell(s.attempts),
|
|
73
|
+
`${cell(s.durationMs)}ms`,
|
|
74
|
+
errorCell(s.error),
|
|
75
|
+
]))}`);
|
|
76
|
+
for (const fan of body.fans ?? []) {
|
|
77
|
+
const counts = fan.counts ?? {};
|
|
78
|
+
this.logger.log(`fan ${cell(fan.group)} (${cell(fan.label)}): ${cell(fan.size)} member(s), ${counts.failed ?? 0} failed; list them with durable:runs:fan ${this.id} ${cell(fan.group)}`);
|
|
79
|
+
}
|
|
80
|
+
const children = body.children ?? [];
|
|
81
|
+
if (children.length > 0) {
|
|
82
|
+
const count = typeof body.childCount === 'number' ? body.childCount : children.length;
|
|
83
|
+
this.logger.log(`children (${count}): ${children.join(', ')}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
__decorate([
|
|
88
|
+
args.string({ description: 'Run id' })
|
|
89
|
+
], DurableRunsShow.prototype, "id", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
flags.boolean({ description: 'List every member of wide fans instead of fan summaries' })
|
|
92
|
+
], DurableRunsShow.prototype, "full", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
flags.string({ description: 'Print one dotted path of the detail in full, e.g. run.output' })
|
|
95
|
+
], DurableRunsShow.prototype, "field", void 0);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CACF;AApES;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;2CACpB;AAGX;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;6CACpE;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;8CACvE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:signal <id> <token> [--payload '<json>']` — deliver a signal to a run
|
|
4
|
+
* waiting on `token` (`ctx.waitForSignal`), through the console's `POST /runs/:id/signal`. Refused
|
|
5
|
+
* when the run is not waiting on that token (the error lists the ones it waits on) unless
|
|
6
|
+
* `--buffer`, which keeps it for the run's next wait.
|
|
7
|
+
*/
|
|
8
|
+
export default class DurableRunsSignal extends DurableConsoleCommand {
|
|
9
|
+
static commandName: string;
|
|
10
|
+
static description: string;
|
|
11
|
+
id: string;
|
|
12
|
+
token: string;
|
|
13
|
+
payload?: string;
|
|
14
|
+
buffer: boolean;
|
|
15
|
+
protected perform(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=runs_signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_signal.d.ts","sourceRoot":"","sources":["../../commands/runs_signal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAY,MAAM,oCAAoC,CAAC;AAIrF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SAAkD;IAGrE,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,OAAO,CAAC;IAExB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBvC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { DurableConsoleCommand, jsonFlag } from '../src/commands/console_command.js';
|
|
9
|
+
import { signalRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:signal <id> <token> [--payload '<json>']` — deliver a signal to a run
|
|
12
|
+
* waiting on `token` (`ctx.waitForSignal`), through the console's `POST /runs/:id/signal`. Refused
|
|
13
|
+
* when the run is not waiting on that token (the error lists the ones it waits on) unless
|
|
14
|
+
* `--buffer`, which keeps it for the run's next wait.
|
|
15
|
+
*/
|
|
16
|
+
export default class DurableRunsSignal extends DurableConsoleCommand {
|
|
17
|
+
static commandName = 'durable:runs:signal';
|
|
18
|
+
static description = 'Deliver a signal to a run waiting on a token';
|
|
19
|
+
async perform() {
|
|
20
|
+
const payload = jsonFlag('payload', this.payload);
|
|
21
|
+
this.audit(`${this.id} ${this.token}`);
|
|
22
|
+
const body = await this.call(signalRun, {
|
|
23
|
+
params: { id: this.id },
|
|
24
|
+
body: {
|
|
25
|
+
token: this.token,
|
|
26
|
+
...(payload !== undefined ? { payload } : {}),
|
|
27
|
+
force: this.buffer === true,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
if (this.json)
|
|
31
|
+
return this.printJson(body);
|
|
32
|
+
this.logger.success(body.result
|
|
33
|
+
? `Signal ${this.token} delivered to ${this.id} (status: ${body.result.status}).`
|
|
34
|
+
: `Signal ${this.token} buffered for ${this.id}'s next wait.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
args.string({ description: 'Run id' })
|
|
39
|
+
], DurableRunsSignal.prototype, "id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
args.string({ description: 'The signal token the run waits on' })
|
|
42
|
+
], DurableRunsSignal.prototype, "token", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
flags.string({ description: 'The payload, as JSON' })
|
|
45
|
+
], DurableRunsSignal.prototype, "payload", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
flags.boolean({ description: 'Buffer it even when the run is not waiting on the token yet' })
|
|
48
|
+
], DurableRunsSignal.prototype, "buffer", void 0);
|
|
49
|
+
//# sourceMappingURL=runs_signal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_signal.js","sourceRoot":"","sources":["../../commands/runs_signal.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,MAAM,CAAU,WAAW,GAAG,qBAAqB,CAAC;IACpD,MAAM,CAAU,WAAW,GAAG,8CAA8C,CAAC;IAcnE,KAAK,CAAC,OAAO;QACrB,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAA+B,SAAS,EAAE;YACpE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,IAAI,EAAE;gBACJ,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7C,KAAK,EAAE,IAAI,CAAC,MAAM,KAAK,IAAI;aAC5B;SACF,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CACjB,IAAI,CAAC,MAAM;YACT,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,iBAAiB,IAAI,CAAC,EAAE,aAAa,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI;YACjF,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,iBAAiB,IAAI,CAAC,EAAE,eAAe,CAChE,CAAC;IACJ,CAAC;CACF;AA7BS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;6CACpB;AAGX;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;gDAC5C;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;kDAC7B;AAGjB;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;iDACtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:update <id> <name> [--arg '<json>']` — deliver an update to a run's
|
|
4
|
+
* `ctx.onUpdate(name)` point, through the console's `POST /runs/:id/updates/:name`. The workflow's
|
|
5
|
+
* validator decides; a rejection fails with its reason and nothing is delivered.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsUpdate extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
arg?: string;
|
|
13
|
+
protected perform(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runs_update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_update.d.ts","sourceRoot":"","sources":["../../commands/runs_update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAY,MAAM,oCAAoC,CAAC;AAGrF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SAAqD;IAGxE,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,GAAG,CAAC,EAAE,MAAM,CAAC;IAErB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CASvC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { DurableConsoleCommand, jsonFlag } from '../src/commands/console_command.js';
|
|
9
|
+
import { updateRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:update <id> <name> [--arg '<json>']` — deliver an update to a run's
|
|
12
|
+
* `ctx.onUpdate(name)` point, through the console's `POST /runs/:id/updates/:name`. The workflow's
|
|
13
|
+
* validator decides; a rejection fails with its reason and nothing is delivered.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsUpdate extends DurableConsoleCommand {
|
|
16
|
+
static commandName = 'durable:runs:update';
|
|
17
|
+
static description = "Deliver an update to a run's ctx.onUpdate point";
|
|
18
|
+
async perform() {
|
|
19
|
+
const arg = jsonFlag('arg', this.arg);
|
|
20
|
+
this.audit(`${this.id} ${this.name}`);
|
|
21
|
+
const body = await this.call(updateRun, {
|
|
22
|
+
params: { id: this.id, name: this.name },
|
|
23
|
+
body: arg !== undefined ? { arg } : {},
|
|
24
|
+
});
|
|
25
|
+
if (this.json)
|
|
26
|
+
return this.printJson(body);
|
|
27
|
+
this.logger.success(`Update ${this.name} accepted by ${this.id}.`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
args.string({ description: 'Run id' })
|
|
32
|
+
], DurableRunsUpdate.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
args.string({ description: 'Update name' })
|
|
35
|
+
], DurableRunsUpdate.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
flags.string({ description: 'The update argument, as JSON' })
|
|
38
|
+
], DurableRunsUpdate.prototype, "arg", void 0);
|
|
39
|
+
//# sourceMappingURL=runs_update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_update.js","sourceRoot":"","sources":["../../commands/runs_update.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBA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Command } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:values <field>` — count the runs matching the filters by one field
|
|
4
|
+
* (`status`, `workflow`, `namespace`, `tag`, `attr` for search-attribute keys, `attr.<key>` for one
|
|
5
|
+
* key's values), through the console's `GET /runs/values`.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsValues extends RunFilterCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
field: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
search?: string;
|
|
13
|
+
protected perform(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runs_values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_values.d.ts","sourceRoot":"","sources":["../../commands/runs_values.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,gBAAgB,EAAe,MAAM,oCAAoC,CAAC;AAGzF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,gBAAgB;IAC7D,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SAAiE;IAGpF,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE,MAAM,CAAC;IAExB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAqBvC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { cell, RunFilterCommand, renderTable } from '../src/commands/console_command.js';
|
|
9
|
+
import { runValues } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:values <field>` — count the runs matching the filters by one field
|
|
12
|
+
* (`status`, `workflow`, `namespace`, `tag`, `attr` for search-attribute keys, `attr.<key>` for one
|
|
13
|
+
* key's values), through the console's `GET /runs/values`.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsValues extends RunFilterCommand {
|
|
16
|
+
static commandName = 'durable:runs:values';
|
|
17
|
+
static description = 'Count runs by status, workflow, namespace, tag or attribute';
|
|
18
|
+
async perform() {
|
|
19
|
+
const values = await this.call(runValues, {
|
|
20
|
+
query: {
|
|
21
|
+
...this.runFilter(),
|
|
22
|
+
field: this.field,
|
|
23
|
+
...(this.limit !== undefined ? { limit: String(this.limit) } : {}),
|
|
24
|
+
...(this.search ? { search: this.search } : {}),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
if (this.json) {
|
|
28
|
+
this.printJson({ field: this.field, data: values });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.logger.log(values.length === 0
|
|
32
|
+
? 'No values.'
|
|
33
|
+
: renderTable([this.field.toUpperCase(), 'RUNS'], values.map((v) => [cell(v.value), String(v.count)])));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
__decorate([
|
|
37
|
+
args.string({ description: 'status | workflow | namespace | tag | attr | attr.<key>' })
|
|
38
|
+
], DurableRunsValues.prototype, "field", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
flags.number({ description: 'At most this many values (default 20)' })
|
|
41
|
+
], DurableRunsValues.prototype, "limit", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
flags.string({ description: 'Only values containing this text' })
|
|
44
|
+
], DurableRunsValues.prototype, "search", void 0);
|
|
45
|
+
//# sourceMappingURL=runs_values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_values.js","sourceRoot":"","sources":["../../commands/runs_values.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,gBAAgB;IAC7D,MAAM,CAAU,WAAW,GAAG,qBAAqB,CAAC;IACpD,MAAM,CAAU,WAAW,GAAG,6DAA6D,CAAC;IAWlF,KAAK,CAAC,OAAO;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAA2C,SAAS,EAAE;YAClF,KAAK,EAAE;gBACL,GAAG,IAAI,CAAC,SAAS,EAAE;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChD;SACF,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACpD,OAAO;QACT,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,MAAM,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,WAAW,CACT,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,EAClC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACpD,CACN,CAAC;IACJ,CAAC;CACF;AA9BS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;gDAClE;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;gDAChD;AAGf;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;iDAC1C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScheduleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:schedules` — the schedules the worker ticks, with their cadence, pause state and
|
|
4
|
+
* current window, through the console's `GET /schedules` (same filters, sort and paging). A pause
|
|
5
|
+
* set at runtime lives in the running workers, so this one-off process shows the configured state.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableSchedules extends ScheduleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
workflow?: string;
|
|
11
|
+
namespace?: string;
|
|
12
|
+
paused?: string;
|
|
13
|
+
sort?: string;
|
|
14
|
+
page?: number;
|
|
15
|
+
size?: number;
|
|
16
|
+
protected perform(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../commands/schedules.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAI5C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAC3D,OAAgB,WAAW,SAAuB;IAClD,OAAgB,WAAW,SAAyD;IAG5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEtB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAmCvC;CACF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { cell, isoCell, pageFooter, renderTable, ScheduleCommand, } from '../src/commands/console_command.js';
|
|
9
|
+
import { listSchedules } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:schedules` — the schedules the worker ticks, with their cadence, pause state and
|
|
12
|
+
* current window, through the console's `GET /schedules` (same filters, sort and paging). A pause
|
|
13
|
+
* set at runtime lives in the running workers, so this one-off process shows the configured state.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableSchedules extends ScheduleCommand {
|
|
16
|
+
static commandName = 'durable:schedules';
|
|
17
|
+
static description = 'List schedules: cadence, paused, last and next fire';
|
|
18
|
+
async perform() {
|
|
19
|
+
await this.scheduleEngine();
|
|
20
|
+
const filter = {};
|
|
21
|
+
if (this.workflow)
|
|
22
|
+
filter.workflow = this.workflow;
|
|
23
|
+
if (this.namespace)
|
|
24
|
+
filter.namespace = this.namespace;
|
|
25
|
+
if (this.paused !== undefined)
|
|
26
|
+
filter.paused = this.paused;
|
|
27
|
+
const body = await this.call(listSchedules, {
|
|
28
|
+
query: {
|
|
29
|
+
...(Object.keys(filter).length > 0 ? { filter } : {}),
|
|
30
|
+
...(this.sort ? { sort: this.sort } : {}),
|
|
31
|
+
...(this.page !== undefined ? { page: String(this.page) } : {}),
|
|
32
|
+
...(this.size !== undefined ? { size: String(this.size) } : {}),
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
if (this.json)
|
|
36
|
+
return this.printJson(body);
|
|
37
|
+
this.logger.log(body.data.length === 0
|
|
38
|
+
? 'No schedules.'
|
|
39
|
+
: renderTable(['KEY', 'WORKFLOW', 'CADENCE', 'PAUSED', 'LAST FIRE', 'NEXT FIRE', 'LAST RUN'], body.data.map((s) => [
|
|
40
|
+
s.key,
|
|
41
|
+
s.workflow,
|
|
42
|
+
s.cron ? `${s.cron}${s.timezone ? ` (${s.timezone})` : ''}` : `every ${s.everyMs}ms`,
|
|
43
|
+
s.paused ? 'yes' : 'no',
|
|
44
|
+
isoCell(s.lastFireAt),
|
|
45
|
+
isoCell(s.nextFireAt),
|
|
46
|
+
cell(s.lastRunStatus),
|
|
47
|
+
])));
|
|
48
|
+
if (body.meta.total > 0)
|
|
49
|
+
this.logger.log(pageFooter(body.meta));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
__decorate([
|
|
53
|
+
flags.string({ description: 'Only this workflow' })
|
|
54
|
+
], DurableSchedules.prototype, "workflow", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
flags.string({ description: 'Only this namespace' })
|
|
57
|
+
], DurableSchedules.prototype, "namespace", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
flags.string({ description: 'Only paused (true) or active (false) schedules' })
|
|
60
|
+
], DurableSchedules.prototype, "paused", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
flags.string({ description: 'Sort: key, workflow, nextFireAt or lastFireAt (- for descending)' })
|
|
63
|
+
], DurableSchedules.prototype, "sort", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
flags.number({ description: 'Page, 1-based (default 1)' })
|
|
66
|
+
], DurableSchedules.prototype, "page", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
flags.number({ description: 'Rows per page (default 100, at most 200)' })
|
|
69
|
+
], DurableSchedules.prototype, "size", void 0);
|
|
70
|
+
//# sourceMappingURL=schedules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../commands/schedules.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,eAAe,GAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAC3D,MAAM,CAAU,WAAW,GAAG,mBAAmB,CAAC;IAClD,MAAM,CAAU,WAAW,GAAG,qDAAqD,CAAC;IAoB1E,KAAK,CAAC,OAAO;QACrB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnD,IAAI,IAAI,CAAC,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM,KAAK,SA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,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI;gBACpF,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;gBACvB,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;gBACrB,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;gBACrB,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;aACtB,CAAC,CACH,CACN,CAAC;QACF,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,CAAC;CACF;AArDS;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;kDAC1B;AAGlB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;mDAC1B;AAGnB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;gDACxD;AAGhB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kEAAkE,EAAE,CAAC;8CAC5E;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;8CACrC;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;8CACpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScheduleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:schedules:pause <key>` — pause a schedule fleet-wide through the console's
|
|
4
|
+
* `POST /schedules/:key/pause`: broadcast on the control plane to every ticking worker. A runtime
|
|
5
|
+
* override: the next deploy goes back to the config. Needs a control plane, since this process
|
|
6
|
+
* exits right after.
|
|
7
|
+
*/
|
|
8
|
+
export default class DurableSchedulesPause extends ScheduleCommand {
|
|
9
|
+
static commandName: string;
|
|
10
|
+
static description: string;
|
|
11
|
+
/** `pause` here, `resume` in the subclass. */
|
|
12
|
+
protected readonly verb: 'pause' | 'resume';
|
|
13
|
+
key: string;
|
|
14
|
+
protected perform(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=schedules_pause.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_pause.d.ts","sourceRoot":"","sources":["../../commands/schedules_pause.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGjF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,eAAe;IAChE,OAAgB,WAAW,SAA6B;IACxD,OAAgB,WAAW,SAA+D;IAE1F,8CAA8C;IAC9C,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAW;IAG9C,GAAG,EAAE,MAAM,CAAC;IAEpB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAevC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args } from '@adonisjs/core/ace';
|
|
8
|
+
import { CliRefusal, ScheduleCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { scheduleAction } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:schedules:pause <key>` — pause a schedule fleet-wide through the console's
|
|
12
|
+
* `POST /schedules/:key/pause`: broadcast on the control plane to every ticking worker. A runtime
|
|
13
|
+
* override: the next deploy goes back to the config. Needs a control plane, since this process
|
|
14
|
+
* exits right after.
|
|
15
|
+
*/
|
|
16
|
+
export default class DurableSchedulesPause extends ScheduleCommand {
|
|
17
|
+
static commandName = 'durable:schedules:pause';
|
|
18
|
+
static description = 'Pause a schedule fleet-wide (until resumed or redeployed)';
|
|
19
|
+
/** `pause` here, `resume` in the subclass. */
|
|
20
|
+
verb = 'pause';
|
|
21
|
+
async perform() {
|
|
22
|
+
const engine = await this.scheduleEngine();
|
|
23
|
+
if (engine && !(await engine.flushControl())) {
|
|
24
|
+
throw new CliRefusal(`No control plane is configured, so a ${this.verb} from this process would reach no worker. ` +
|
|
25
|
+
'Configure one in config/durable.ts, or use the console.');
|
|
26
|
+
}
|
|
27
|
+
this.audit(this.key);
|
|
28
|
+
const body = await this.call(scheduleAction, {
|
|
29
|
+
params: { key: this.key, action: this.verb },
|
|
30
|
+
});
|
|
31
|
+
await engine?.flushControl();
|
|
32
|
+
if (this.json)
|
|
33
|
+
return this.printJson(body);
|
|
34
|
+
this.logger.success(`Schedule ${this.key} ${body.paused ? 'paused' : 'resumed'} fleet-wide.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
args.string({ description: 'Schedule key' })
|
|
39
|
+
], DurableSchedulesPause.prototype, "key", void 0);
|
|
40
|
+
//# sourceMappingURL=schedules_pause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_pause.js","sourceRoot":"","sources":["../../commands/schedules_pause.ts"],"names":[],"mappings":";;;;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,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;kDACzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import DurableSchedulesPause from './schedules_pause.js';
|
|
2
|
+
/** `node ace durable:schedules:resume <key>` — resume a paused schedule fleet-wide. */
|
|
3
|
+
export default class DurableSchedulesResume extends DurableSchedulesPause {
|
|
4
|
+
static commandName: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
protected readonly verb: 'resume';
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=schedules_resume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_resume.d.ts","sourceRoot":"","sources":["../../commands/schedules_resume.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AAEzD,uFAAuF;AACvF,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,qBAAqB;IACvE,OAAgB,WAAW,SAA8B;IACzD,OAAgB,WAAW,SAAyC;IACpE,mBAA4B,IAAI,EAAG,QAAQ,CAAU;CACtD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import DurableSchedulesPause from './schedules_pause.js';
|
|
2
|
+
/** `node ace durable:schedules:resume <key>` — resume a paused schedule fleet-wide. */
|
|
3
|
+
export default class DurableSchedulesResume extends DurableSchedulesPause {
|
|
4
|
+
static commandName = 'durable:schedules:resume';
|
|
5
|
+
static description = 'Resume a paused schedule fleet-wide';
|
|
6
|
+
verb = 'resume';
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=schedules_resume.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_resume.js","sourceRoot":"","sources":["../../commands/schedules_resume.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AAEzD,uFAAuF;AACvF,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,qBAAqB;IACvE,MAAM,CAAU,WAAW,GAAG,0BAA0B,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,qCAAqC,CAAC;IACxC,IAAI,GAAG,QAAiB,CAAC;CACtD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScheduleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:schedules:trigger <key>` — fire a schedule's current window now, through the
|
|
4
|
+
* console's `POST /schedules/:key/trigger`. Idempotent: the window's run id is fixed, so a window
|
|
5
|
+
* that already fired answers its existing run.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableSchedulesTrigger extends ScheduleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
key: string;
|
|
11
|
+
protected perform(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=schedules_trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_trigger.d.ts","sourceRoot":"","sources":["../../commands/schedules_trigger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAIrE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,eAAe;IAClE,OAAgB,WAAW,SAA+B;IAC1D,OAAgB,WAAW,SAAuD;IAG1E,GAAG,EAAE,MAAM,CAAC;IAEpB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAUvC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args } from '@adonisjs/core/ace';
|
|
8
|
+
import { ScheduleCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { scheduleAction } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:schedules:trigger <key>` — fire a schedule's current window now, through the
|
|
12
|
+
* console's `POST /schedules/:key/trigger`. Idempotent: the window's run id is fixed, so a window
|
|
13
|
+
* that already fired answers its existing run.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableSchedulesTrigger extends ScheduleCommand {
|
|
16
|
+
static commandName = 'durable:schedules:trigger';
|
|
17
|
+
static description = "Fire a schedule's current window now (idempotent)";
|
|
18
|
+
async perform() {
|
|
19
|
+
await this.scheduleEngine();
|
|
20
|
+
this.audit(this.key);
|
|
21
|
+
const body = await this.call(scheduleAction, {
|
|
22
|
+
params: { key: this.key, action: 'trigger' },
|
|
23
|
+
});
|
|
24
|
+
if (this.json)
|
|
25
|
+
return this.printJson(body);
|
|
26
|
+
this.logger.success(`Schedule ${this.key} fired: run ${body.result.runId} (status: ${body.result.status}).`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
args.string({ description: 'Schedule key' })
|
|
31
|
+
], DurableSchedulesTrigger.prototype, "key", void 0);
|
|
32
|
+
//# sourceMappingURL=schedules_trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules_trigger.js","sourceRoot":"","sources":["../../commands/schedules_trigger.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,eAAe;IAClE,MAAM,CAAU,WAAW,GAAG,2BAA2B,CAAC;IAC1D,MAAM,CAAU,WAAW,GAAG,mDAAmD,CAAC;IAKxE,KAAK,CAAC,OAAO;QACrB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,cAAc,EAAE;YAClE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE;SAC7C,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CACjB,YAAY,IAAI,CAAC,GAAG,eAAe,IAAI,CAAC,MAAM,CAAC,KAAK,aAAa,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CACxF,CAAC;IACJ,CAAC;CACF;AAbS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;oDACzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:tasks:complete <runId> <name> [--result '<json>']` — complete a `ctx.task` the
|
|
4
|
+
* run handed to an external system, through the console's `POST /runs/:id/tasks/:name/complete`.
|
|
5
|
+
* When the run is not waiting on the task yet, the completion is kept for when it is.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableTasksComplete extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
runId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
taskResult?: string;
|
|
13
|
+
protected perform(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=tasks_complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks_complete.d.ts","sourceRoot":"","sources":["../../commands/tasks_complete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAY,MAAM,oCAAoC,CAAC;AAGrF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,qBAAqB;IACrE,OAAgB,WAAW,SAA4B;IACvD,OAAgB,WAAW,SAAwC;IAG3D,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;IAIb,UAAU,CAAC,EAAE,MAAM,CAAC;IAE5B,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAavC;CACF"}
|