@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,74 @@
|
|
|
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, RunFilterCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { renderRunsTable } from '../src/commands/runs.js';
|
|
10
|
+
import { bulkAction, listRuns } from '../src/dashboard/handlers.js';
|
|
11
|
+
/** The bulk action acts on at most this many matching runs (the console's cap). */
|
|
12
|
+
const BULK_CAP = 500;
|
|
13
|
+
/**
|
|
14
|
+
* `node ace durable:runs:bulk <retry|cancel> [filters]` — retry or cancel every run matching the
|
|
15
|
+
* filters (at most 500), through the console's `POST /bulk/:action`. A run that cannot take the
|
|
16
|
+
* action is skipped. `--dry-run` lists what would be acted on; otherwise it asks first (`--force`
|
|
17
|
+
* skips).
|
|
18
|
+
*/
|
|
19
|
+
export default class DurableRunsBulk extends RunFilterCommand {
|
|
20
|
+
static commandName = 'durable:runs:bulk';
|
|
21
|
+
static description = 'Retry or cancel every run matching a filter (at most 500)';
|
|
22
|
+
async perform() {
|
|
23
|
+
if (this.action !== 'retry' && this.action !== 'cancel') {
|
|
24
|
+
throw new CliRefusal('action must be retry or cancel.');
|
|
25
|
+
}
|
|
26
|
+
if (this.compensate && this.action !== 'cancel') {
|
|
27
|
+
throw new CliRefusal('--compensate goes with cancel.');
|
|
28
|
+
}
|
|
29
|
+
const query = this.runFilter();
|
|
30
|
+
const deps = await this.deps();
|
|
31
|
+
const preview = await this.call(listRuns, { query: { ...query, size: '200' } }, deps);
|
|
32
|
+
const matched = preview.meta.total;
|
|
33
|
+
const acting = Math.min(matched, BULK_CAP);
|
|
34
|
+
const scope = Object.keys(query).length > 0 ? 'matching the filter' : 'of every run (no filter)';
|
|
35
|
+
if (this.dryRun) {
|
|
36
|
+
if (this.json) {
|
|
37
|
+
this.printJson({ action: this.action, matched, wouldApply: acting, data: preview.data });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const rows = preview.data.map((row) => ({
|
|
41
|
+
run: { ...row, updatedAt: new Date(row.updatedAt) },
|
|
42
|
+
ageMs: Date.now() - new Date(row.updatedAt).getTime(),
|
|
43
|
+
recoveryAttempts: Number(row.recoveryAttempts ?? 0),
|
|
44
|
+
stalePending: null,
|
|
45
|
+
}));
|
|
46
|
+
this.logger.log(renderRunsTable(rows));
|
|
47
|
+
this.logger.info(`Dry run: ${this.action} would act on ${acting} run(s) ${scope} (${matched} matched${matched > BULK_CAP ? `, capped at ${BULK_CAP}` : ''}).`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
await this.confirm(this.force, `${this.action === 'retry' ? 'Retry' : 'Cancel'} up to ${acting} run(s) ${scope}${this.compensate ? ' and run their compensations' : ''}?`);
|
|
51
|
+
this.audit(`${this.action} ${JSON.stringify(query.filter ?? {})}`);
|
|
52
|
+
const body = await this.call(bulkAction, {
|
|
53
|
+
params: { action: this.action },
|
|
54
|
+
query,
|
|
55
|
+
...(this.compensate ? { body: { compensate: true } } : {}),
|
|
56
|
+
}, deps);
|
|
57
|
+
if (this.json)
|
|
58
|
+
return this.printJson(body);
|
|
59
|
+
this.logger.success(`${this.action}: applied to ${body.applied} of ${body.matched} matching run(s).`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
__decorate([
|
|
63
|
+
args.string({ description: 'retry | cancel' })
|
|
64
|
+
], DurableRunsBulk.prototype, "action", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
flags.boolean({ description: 'With cancel: also run each run’s compensations (saga undo)' })
|
|
67
|
+
], DurableRunsBulk.prototype, "compensate", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
flags.boolean({ description: 'List the matching runs and stop' })
|
|
70
|
+
], DurableRunsBulk.prototype, "dryRun", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
flags.boolean({ description: 'Do not ask for confirmation' })
|
|
73
|
+
], DurableRunsBulk.prototype, "force", void 0);
|
|
74
|
+
//# sourceMappingURL=runs_bulk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_bulk.js","sourceRoot":"","sources":["../../commands/runs_bulk.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGpE,mFAAmF;AACnF,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,gBAAgB;IAC3D,MAAM,C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IAAI,CAAC,MAAM,EAAE;YAC/B,KAAK;YACL,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D,EACD,IAAI,CACL,CAAC;QACF,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CACjB,GAAG,IAAI,CAAC,MAAM,gBAAgB,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,OAAO,mBAAmB,CACjF,CAAC;IACJ,CAAC;CACF;AAlES;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;+CACxB;AAGf;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;mDACjE;AAGpB;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;+CAC1C;AAGhB;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;8CACvC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:cancel <id> [--compensate]` — cancel a run through the console's
|
|
4
|
+
* `POST /runs/:id/cancel`; `--compensate` also runs the saga undo of its completed steps. Asks first
|
|
5
|
+
* (`--force` skips).
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsCancel extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
compensate: boolean;
|
|
12
|
+
force: boolean;
|
|
13
|
+
protected perform(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runs_cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_cancel.d.ts","sourceRoot":"","sources":["../../commands/runs_cancel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SAAyD;IAG5E,EAAE,EAAE,MAAM,CAAC;IAGX,UAAU,EAAE,OAAO,CAAC;IAGpB,KAAK,EAAE,OAAO,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAYvC;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 } from '../src/commands/console_command.js';
|
|
9
|
+
import { cancelRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:cancel <id> [--compensate]` — cancel a run through the console's
|
|
12
|
+
* `POST /runs/:id/cancel`; `--compensate` also runs the saga undo of its completed steps. Asks first
|
|
13
|
+
* (`--force` skips).
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsCancel extends DurableConsoleCommand {
|
|
16
|
+
static commandName = 'durable:runs:cancel';
|
|
17
|
+
static description = 'Cancel a run (--compensate also runs its saga undo)';
|
|
18
|
+
async perform() {
|
|
19
|
+
await this.confirm(this.force, this.compensate ? `Cancel ${this.id} and run its compensations?` : `Cancel ${this.id}?`);
|
|
20
|
+
this.audit(this.id);
|
|
21
|
+
const body = await this.call(cancelRun, {
|
|
22
|
+
params: { id: this.id },
|
|
23
|
+
body: { compensate: this.compensate === true },
|
|
24
|
+
});
|
|
25
|
+
if (this.json)
|
|
26
|
+
return this.printJson(body);
|
|
27
|
+
this.logger.success(`Run ${this.id} cancelled (status: ${body.result.status}).`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
args.string({ description: 'Run id' })
|
|
32
|
+
], DurableRunsCancel.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
flags.boolean({ description: 'Also run the compensations of its completed steps (saga undo)' })
|
|
35
|
+
], DurableRunsCancel.prototype, "compensate", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
flags.boolean({ description: 'Do not ask for confirmation' })
|
|
38
|
+
], DurableRunsCancel.prototype, "force", void 0);
|
|
39
|
+
//# sourceMappingURL=runs_cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_cancel.js","sourceRoot":"","sources":["../../commands/runs_cancel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,MAAM,CAAU,WAAW,GAAG,qBAAqB,CAAC;IACpD,MAAM,CAAU,WAAW,GAAG,qDAAqD,CAAC;IAW1E,KAAK,CAAC,OAAO;QACrB,MAAM,IAAI,CAAC,OAAO,CAChB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,EAAE,6BAA6B,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,EAAE,GAAG,CACxF,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,SAAS,EAAE;YAC7D,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE;SAC/C,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,EAAE,uBAAuB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACnF,CAAC;CACF;AArBS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;6CACpB;AAGX;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;qDACpE;AAGpB;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;gDACvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:continue <id>` — resume a run paused at a `ctx.breakpoint()`, through the
|
|
4
|
+
* console's `POST /runs/:id/continue`. Fails when the run is not paused at one.
|
|
5
|
+
*/
|
|
6
|
+
export default class DurableRunsContinue extends DurableConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
id: string;
|
|
10
|
+
protected perform(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=runs_continue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_continue.d.ts","sourceRoot":"","sources":["../../commands/runs_continue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,qBAAqB;IACpE,OAAgB,WAAW,SAA2B;IACtD,OAAgB,WAAW,SAA+C;IAGlE,EAAE,EAAE,MAAM,CAAC;IAEnB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAKvC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { continueRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:continue <id>` — resume a run paused at a `ctx.breakpoint()`, through the
|
|
12
|
+
* console's `POST /runs/:id/continue`. Fails when the run is not paused at one.
|
|
13
|
+
*/
|
|
14
|
+
export default class DurableRunsContinue extends DurableConsoleCommand {
|
|
15
|
+
static commandName = 'durable:runs:continue';
|
|
16
|
+
static description = 'Resume a run paused at a ctx.breakpoint()';
|
|
17
|
+
async perform() {
|
|
18
|
+
this.audit(this.id);
|
|
19
|
+
const body = await this.call(continueRun, { params: { id: this.id } });
|
|
20
|
+
if (this.json)
|
|
21
|
+
return this.printJson(body);
|
|
22
|
+
this.logger.success(`Run ${this.id} continued (status: ${body.result.status}).`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
args.string({ description: 'Run id' })
|
|
27
|
+
], DurableRunsContinue.prototype, "id", void 0);
|
|
28
|
+
//# sourceMappingURL=runs_continue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_continue.js","sourceRoot":"","sources":["../../commands/runs_continue.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,qBAAqB;IACpE,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAC;IACtD,MAAM,CAAU,WAAW,GAAG,2CAA2C,CAAC;IAKhE,KAAK,CAAC,OAAO;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9F,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,EAAE,uBAAuB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACnF,CAAC;CACF;AARS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;+CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:event <id> <key>` — the latest value a run published for `key` with
|
|
4
|
+
* `ctx.setEvent`, through the console's `GET /runs/:id/events/:key` (a live query, no side effect).
|
|
5
|
+
*/
|
|
6
|
+
export default class DurableRunsEvent extends DurableConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
id: string;
|
|
10
|
+
key: string;
|
|
11
|
+
protected perform(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=runs_event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_event.d.ts","sourceRoot":"","sources":["../../commands/runs_event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,qBAAqB;IACjE,OAAgB,WAAW,SAAwB;IACnD,OAAgB,WAAW,SAA6D;IAGhF,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAEpB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAGvC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { getRunEvent } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:event <id> <key>` — the latest value a run published for `key` with
|
|
12
|
+
* `ctx.setEvent`, through the console's `GET /runs/:id/events/:key` (a live query, no side effect).
|
|
13
|
+
*/
|
|
14
|
+
export default class DurableRunsEvent extends DurableConsoleCommand {
|
|
15
|
+
static commandName = 'durable:runs:event';
|
|
16
|
+
static description = 'Read the latest value a run published with ctx.setEvent';
|
|
17
|
+
async perform() {
|
|
18
|
+
const body = await this.call(getRunEvent, { params: { id: this.id, key: this.key } });
|
|
19
|
+
this.printJson(this.json ? body : body.value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
args.string({ description: 'Run id' })
|
|
24
|
+
], DurableRunsEvent.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
args.string({ description: 'Event key' })
|
|
27
|
+
], DurableRunsEvent.prototype, "key", void 0);
|
|
28
|
+
//# sourceMappingURL=runs_event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_event.js","sourceRoot":"","sources":["../../commands/runs_event.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,qBAAqB;IACjE,MAAM,CAAU,WAAW,GAAG,oBAAoB,CAAC;IACnD,MAAM,CAAU,WAAW,GAAG,yDAAyD,CAAC;IAQ9E,KAAK,CAAC,OAAO;QACrB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AATS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;4CACpB;AAGX;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;6CACtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:fan <id> <group>` — one page of a wide fan's member steps (a fan
|
|
4
|
+
* `durable:runs:show` summarized), through the console's `GET /runs/:id/fans/:group`.
|
|
5
|
+
*/
|
|
6
|
+
export default class DurableRunsFan extends DurableConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
id: string;
|
|
10
|
+
group: string;
|
|
11
|
+
failed: boolean;
|
|
12
|
+
page?: number;
|
|
13
|
+
size?: number;
|
|
14
|
+
protected perform(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=runs_fan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_fan.d.ts","sourceRoot":"","sources":["../../commands/runs_fan.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,EAGtB,MAAM,oCAAoC,CAAC;AAG5C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,qBAAqB;IAC/D,OAAgB,WAAW,SAAsB;IACjD,OAAgB,WAAW,SAAkD;IAGrE,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,OAAO,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEtB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCvC;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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, DurableConsoleCommand, pageFooter, renderTable, } from '../src/commands/console_command.js';
|
|
9
|
+
import { getFanMembers } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:fan <id> <group>` — one page of a wide fan's member steps (a fan
|
|
12
|
+
* `durable:runs:show` summarized), through the console's `GET /runs/:id/fans/:group`.
|
|
13
|
+
*/
|
|
14
|
+
export default class DurableRunsFan extends DurableConsoleCommand {
|
|
15
|
+
static commandName = 'durable:runs:fan';
|
|
16
|
+
static description = "List a run's fan members, one page at a time";
|
|
17
|
+
async perform() {
|
|
18
|
+
const body = await this.call(getFanMembers, {
|
|
19
|
+
params: { id: this.id, group: this.group },
|
|
20
|
+
query: {
|
|
21
|
+
...(this.failed ? { filter: { status: 'failed' } } : {}),
|
|
22
|
+
...(this.page !== undefined ? { page: String(this.page) } : {}),
|
|
23
|
+
...(this.size !== undefined ? { size: String(this.size) } : {}),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
if (this.json) {
|
|
27
|
+
this.printJson(body);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.logger.log(body.data.length === 0
|
|
31
|
+
? 'No members.'
|
|
32
|
+
: renderTable(['SEQ', 'STEP', 'STATUS', 'ATTEMPTS', 'DURATION', 'ERROR'], body.data.map((s) => [
|
|
33
|
+
cell(s.seq),
|
|
34
|
+
cell(s.name),
|
|
35
|
+
cell(s.status),
|
|
36
|
+
cell(s.attempts),
|
|
37
|
+
`${cell(s.durationMs)}ms`,
|
|
38
|
+
s.error === undefined || s.error === null ? '-' : cell(s.error).slice(0, 80),
|
|
39
|
+
])));
|
|
40
|
+
this.logger.log(pageFooter(body.meta));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
__decorate([
|
|
44
|
+
args.string({ description: 'Run id' })
|
|
45
|
+
], DurableRunsFan.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
args.string({ description: 'Fan group, from durable:runs:show' })
|
|
48
|
+
], DurableRunsFan.prototype, "group", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
flags.boolean({ description: 'Only failed members' })
|
|
51
|
+
], DurableRunsFan.prototype, "failed", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
flags.number({ description: 'Page, 1-based (default 1)' })
|
|
54
|
+
], DurableRunsFan.prototype, "page", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
flags.number({ description: 'Rows per page (default 100, at most 500)' })
|
|
57
|
+
], DurableRunsFan.prototype, "size", void 0);
|
|
58
|
+
//# sourceMappingURL=runs_fan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_fan.js","sourceRoot":"","sources":["../../commands/runs_fan.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;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id>` — send a run's pending remote steps to their workers
|
|
4
|
+
* again, through the console's `POST /runs/:id/redispatch`. For a step whose job was lost; on a step
|
|
5
|
+
* a worker is still running it runs the step twice, so it asks first (`--force` skips).
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsRedispatch extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
force: boolean;
|
|
12
|
+
protected perform(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=runs_redispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_redispatch.d.ts","sourceRoot":"","sources":["../../commands/runs_redispatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,qBAAqB;IACtE,OAAgB,WAAW,SAA6B;IACxD,OAAgB,WAAW,SAA4D;IAG/E,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,OAAO,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAWvC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 } from '../src/commands/console_command.js';
|
|
9
|
+
import { redispatchPendingRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:redispatch <id>` — send a run's pending remote steps to their workers
|
|
12
|
+
* again, through the console's `POST /runs/:id/redispatch`. For a step whose job was lost; on a step
|
|
13
|
+
* a worker is still running it runs the step twice, so it asks first (`--force` skips).
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsRedispatch extends DurableConsoleCommand {
|
|
16
|
+
static commandName = 'durable:runs:redispatch';
|
|
17
|
+
static description = "Re-send a run's pending remote steps (a lost dispatch)";
|
|
18
|
+
async perform() {
|
|
19
|
+
await this.confirm(this.force, `Re-send the pending remote steps of ${this.id}? A step a worker is still running runs twice.`);
|
|
20
|
+
this.audit(this.id);
|
|
21
|
+
const body = await this.call(redispatchPendingRun, {
|
|
22
|
+
params: { id: this.id },
|
|
23
|
+
});
|
|
24
|
+
if (this.json)
|
|
25
|
+
return this.printJson(body);
|
|
26
|
+
this.logger.success(`Run ${this.id}: pending steps re-sent (status: ${body.result.status}).`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
args.string({ description: 'Run id' })
|
|
31
|
+
], DurableRunsRedispatch.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
flags.boolean({ description: 'Do not ask for confirmation' })
|
|
34
|
+
], DurableRunsRedispatch.prototype, "force", void 0);
|
|
35
|
+
//# sourceMappingURL=runs_redispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_redispatch.js","sourceRoot":"","sources":["../../commands/runs_redispatch.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,qBAAqB;IACtE,MAAM,CAAU,WAAW,GAAG,yBAAyB,CAAC;IACxD,MAAM,CAAU,WAAW,GAAG,wDAAwD,CAAC;IAQ7E,KAAK,CAAC,OAAO;QACrB,MAAM,IAAI,CAAC,OAAO,CAChB,IAAI,CAAC,KAAK,EACV,uCAAuC,IAAI,CAAC,EAAE,gDAAgD,CAC/F,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,oBAAoB,EAAE;YACxE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;SACxB,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,EAAE,oCAAoC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAChG,CAAC;CACF;AAjBS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;iDACpB;AAGX;IADP,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;oDACvC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:replay <id> --input '<json>'` — fix-and-replay, through the console's
|
|
4
|
+
* `POST /runs/:id/retry-with-input`: start a fresh linked run of the same workflow with a corrected
|
|
5
|
+
* input. The original run is left as it is.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsReplay extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
input?: string;
|
|
12
|
+
protected perform(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=runs_replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_replay.d.ts","sourceRoot":"","sources":["../../commands/runs_replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,qBAAqB,EAAY,MAAM,oCAAoC,CAAC;AAGjG;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SAAkE;IAGrF,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,CAAC,EAAE,MAAM,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAUvC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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, DurableConsoleCommand, jsonFlag } from '../src/commands/console_command.js';
|
|
9
|
+
import { retryWithInputRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:replay <id> --input '<json>'` — fix-and-replay, through the console's
|
|
12
|
+
* `POST /runs/:id/retry-with-input`: start a fresh linked run of the same workflow with a corrected
|
|
13
|
+
* input. The original run is left as it is.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsReplay extends DurableConsoleCommand {
|
|
16
|
+
static commandName = 'durable:runs:replay';
|
|
17
|
+
static description = "Start a fresh run of a run's workflow with a corrected input";
|
|
18
|
+
async perform() {
|
|
19
|
+
if (this.input === undefined)
|
|
20
|
+
throw new CliRefusal('--input is required (JSON).');
|
|
21
|
+
const input = jsonFlag('input', this.input);
|
|
22
|
+
this.audit(this.id);
|
|
23
|
+
const body = await this.call(retryWithInputRun, {
|
|
24
|
+
params: { id: this.id },
|
|
25
|
+
body: { input },
|
|
26
|
+
});
|
|
27
|
+
if (this.json)
|
|
28
|
+
return this.printJson(body);
|
|
29
|
+
this.logger.success(`Started ${body.result.runId} from ${this.id} with the corrected input.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
args.string({ description: 'Run id' })
|
|
34
|
+
], DurableRunsReplay.prototype, "id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
flags.string({ description: 'The corrected input, as JSON' })
|
|
37
|
+
], DurableRunsReplay.prototype, "input", void 0);
|
|
38
|
+
//# sourceMappingURL=runs_replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_replay.js","sourceRoot":"","sources":["../../commands/runs_replay.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,MAAM,CAAU,WAAW,GAAG,qBAAqB,CAAC;IACpD,MAAM,CAAU,WAAW,GAAG,8DAA8D,CAAC;IAQnF,KAAK,CAAC,OAAO;QACrB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,CAAC,CAAC;QAClF,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAgC,iBAAiB,EAAE;YAC7E,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;YACvB,IAAI,EAAE,EAAE,KAAK,EAAE;SAChB,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,IAAI,CAAC,EAAE,4BAA4B,CAAC,CAAC;IAChG,CAAC;CACF;AAhBS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;6CACpB;AAGX;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;gDACvC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:retry <id>` — re-enqueue a failed or stuck run, through the console's
|
|
4
|
+
* `POST /runs/:id/retry`: it goes back to `pending` and a worker resumes it, replaying completed
|
|
5
|
+
* steps from their checkpoints and re-attempting the failed one.
|
|
6
|
+
*/
|
|
7
|
+
export default class DurableRunsRetry extends DurableConsoleCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
protected perform(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=runs_retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_retry.d.ts","sourceRoot":"","sources":["../../commands/runs_retry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,qBAAqB;IACjE,OAAgB,WAAW,SAAwB;IACnD,OAAgB,WAAW,SAA8C;IAGjE,EAAE,EAAE,MAAM,CAAC;IAEnB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAKvC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
9
|
+
import { retryRun } from '../src/dashboard/handlers.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace durable:runs:retry <id>` — re-enqueue a failed or stuck run, through the console's
|
|
12
|
+
* `POST /runs/:id/retry`: it goes back to `pending` and a worker resumes it, replaying completed
|
|
13
|
+
* steps from their checkpoints and re-attempting the failed one.
|
|
14
|
+
*/
|
|
15
|
+
export default class DurableRunsRetry extends DurableConsoleCommand {
|
|
16
|
+
static commandName = 'durable:runs:retry';
|
|
17
|
+
static description = 'Re-enqueue (retry) a failed or stuck run';
|
|
18
|
+
async perform() {
|
|
19
|
+
this.audit(this.id);
|
|
20
|
+
const body = await this.call(retryRun, { params: { id: this.id } });
|
|
21
|
+
if (this.json)
|
|
22
|
+
return this.printJson(body);
|
|
23
|
+
this.logger.success(`Run ${this.id} re-enqueued (status: ${body.result.status}).`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
__decorate([
|
|
27
|
+
args.string({ description: 'Run id' })
|
|
28
|
+
], DurableRunsRetry.prototype, "id", void 0);
|
|
29
|
+
//# sourceMappingURL=runs_retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_retry.js","sourceRoot":"","sources":["../../commands/runs_retry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,qBAAqB;IACjE,MAAM,CAAU,WAAW,GAAG,oBAAoB,CAAC;IACnD,MAAM,CAAU,WAAW,GAAG,0CAA0C,CAAC;IAK/D,KAAK,CAAC,OAAO;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAwB,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3F,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,EAAE,yBAAyB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACrF,CAAC;CACF;AARS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;4CACpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DurableConsoleCommand } from '../src/commands/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace durable:runs:show <id>` — one run's detail through the console's `GET /runs/:id`: the
|
|
4
|
+
* run, its step timeline, children and fans. `--field run.output` prints one value in full.
|
|
5
|
+
*/
|
|
6
|
+
export default class DurableRunsShow extends DurableConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
id: string;
|
|
10
|
+
full: boolean;
|
|
11
|
+
field?: string;
|
|
12
|
+
protected perform(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=runs_show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs_show.d.ts","sourceRoot":"","sources":["../../commands/runs_show.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,qBAAqB,EAEtB,MAAM,oCAAoC,CAAC;AAoB5C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,qBAAqB;IAChE,OAAgB,WAAW,SAAuB;IAClD,OAAgB,WAAW,SAAoE;IAGvF,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,OAAO,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,CAAC;IAEvB,UAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CA2DvC;CACF"}
|