@atolis-hq/wake 0.4.71 → 0.4.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/bootstrap/surface-api-trigger-applications.js +22 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/trigger-diagnostics.d.ts +4 -0
- package/dist/src/control-plane/application/trigger-facts.d.ts +7 -1
- package/dist/src/control-plane/application/trigger-facts.js +20 -2
- package/dist/src/control-plane/application/trigger-manual-request.d.ts +19 -0
- package/dist/src/control-plane/application/trigger-manual-request.js +125 -0
- package/dist/src/control-plane/application/trigger-projection.js +3 -1
- package/dist/src/control-plane/application/trigger-service.d.ts +5 -4
- package/dist/src/control-plane/application/trigger-service.js +31 -33
- package/dist/src/control-plane/contracts/events.d.ts +33 -0
- package/dist/src/control-plane/contracts/events.js +41 -2
- package/dist/src/control-plane/contracts/trigger-diagnostics.d.ts +9 -10
- package/dist/src/control-plane/contracts/trigger-diagnostics.js +2 -8
- package/dist/src/control-plane/contracts/trigger-skip-reason.d.ts +10 -0
- package/dist/src/control-plane/contracts/trigger-skip-reason.js +8 -0
- package/dist/src/surfaces/api/contracts/control-plane.d.ts +2 -0
- package/dist/src/surfaces/api/contracts/transport-values.d.ts +4 -1
- package/dist/src/surfaces/api/contracts/transport-values.js +15 -0
- package/dist/src/surfaces/api/contracts/triggers.d.ts +6 -0
- package/dist/src/surfaces/api/contracts/triggers.js +7 -0
- package/dist/src/surfaces/api/routes/applications.d.ts +1 -0
- package/dist/src/surfaces/api/routes/commands.js +9 -2
- package/dist/src/surfaces/web-assets/assets/index-CxURzTmR.js +1192 -0
- package/dist/src/surfaces/web-assets/index.html +1 -1
- package/package.json +1 -1
- package/dist/src/surfaces/web-assets/assets/index-DVapiQjj.js +0 -1192
|
@@ -62,8 +62,11 @@ export const TranscriptGroupKindValue = {
|
|
|
62
62
|
export const TriggerSourceKindValue = {
|
|
63
63
|
Event: 'event',
|
|
64
64
|
Cron: 'cron',
|
|
65
|
+
Manual: 'manual',
|
|
65
66
|
};
|
|
67
|
+
const manualStartedShape = { started: true };
|
|
66
68
|
export const TriggerRequestDispositionValue = {
|
|
69
|
+
Started: Object.keys(manualStartedShape)[0],
|
|
67
70
|
Coalesced: 'coalesced',
|
|
68
71
|
Skipped: 'skipped',
|
|
69
72
|
};
|
|
@@ -81,3 +84,15 @@ export const TriggerFinishedStatusValue = {
|
|
|
81
84
|
Completed: triggerFinishedStatuses[0],
|
|
82
85
|
Superseded: triggerFinishedStatuses[1],
|
|
83
86
|
};
|
|
87
|
+
export const ManualTriggerDispositionValue = {
|
|
88
|
+
Started: Object.keys(manualStartedShape)[0],
|
|
89
|
+
Coalesced: TriggerRequestDispositionValue.Coalesced,
|
|
90
|
+
Skipped: TriggerRequestDispositionValue.Skipped,
|
|
91
|
+
};
|
|
92
|
+
const triggerCommandShape = { pause: true, resume: true, run: true };
|
|
93
|
+
const triggerCommands = Object.keys(triggerCommandShape);
|
|
94
|
+
export const TriggerCommandNameValue = {
|
|
95
|
+
Pause: triggerCommands[0],
|
|
96
|
+
Resume: triggerCommands[1],
|
|
97
|
+
Run: triggerCommands[2],
|
|
98
|
+
};
|
|
@@ -34,3 +34,9 @@ export interface OrphanedInstructionsResponse {
|
|
|
34
34
|
readonly author: string;
|
|
35
35
|
readonly occurredAt: string;
|
|
36
36
|
}
|
|
37
|
+
export declare const TriggerCommandName: {
|
|
38
|
+
readonly Pause: "run" | "resume" | "pause";
|
|
39
|
+
readonly Resume: "run" | "resume" | "pause";
|
|
40
|
+
readonly Run: "run" | "resume" | "pause";
|
|
41
|
+
};
|
|
42
|
+
export type TriggerCommandName = ValueOf<typeof TriggerCommandName>;
|
|
@@ -6,3 +6,10 @@ export const TriggerStatus = {
|
|
|
6
6
|
Running: triggerStatuses[2],
|
|
7
7
|
Removed: triggerStatuses[3],
|
|
8
8
|
};
|
|
9
|
+
const triggerCommandShape = { pause: true, resume: true, run: true };
|
|
10
|
+
const triggerCommands = Object.keys(triggerCommandShape);
|
|
11
|
+
export const TriggerCommandName = {
|
|
12
|
+
Pause: triggerCommands[0],
|
|
13
|
+
Resume: triggerCommands[1],
|
|
14
|
+
Run: triggerCommands[2],
|
|
15
|
+
};
|
|
@@ -63,6 +63,7 @@ export interface ApiApplications {
|
|
|
63
63
|
readonly content: string;
|
|
64
64
|
readonly expectedRevisionId: string | null;
|
|
65
65
|
}): Promise<ApiCommandResult>;
|
|
66
|
+
run?(id: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
|
|
66
67
|
pause(id: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
|
|
67
68
|
resume(id: string, command: ApiCommandRequest): Promise<ApiCommandResult>;
|
|
68
69
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RunStatus } from '../../../execution/index.js';
|
|
2
|
+
import { TriggerCommandName } from '../contracts/index.js';
|
|
2
3
|
import { normalizePage } from './pagination.js';
|
|
3
4
|
import { accepted, ApiPathError, decodePathSegment, invalidPath, invalidQuery, invalidRequest, isObject, problem, unavailable, } from './responses.js';
|
|
4
5
|
export async function dispatchCommand(applications, url, body) {
|
|
@@ -236,14 +237,20 @@ async function dispatchInstructions(applications, pathname, body) {
|
|
|
236
237
|
return undefined;
|
|
237
238
|
}
|
|
238
239
|
async function dispatchTriggerCommand(applications, pathname, request) {
|
|
239
|
-
const trigger = /^\/api\/v1\/triggers\/([^/]+)\/commands\/(pause|resume)$/.exec(pathname);
|
|
240
|
+
const trigger = /^\/api\/v1\/triggers\/([^/]+)\/commands\/(pause|resume|run)$/.exec(pathname);
|
|
240
241
|
if (trigger !== null) {
|
|
241
242
|
const id = decodePathSegment(trigger[1]);
|
|
242
243
|
if (id instanceof ApiPathError)
|
|
243
244
|
return invalidPath(id.message);
|
|
244
245
|
if (applications.triggers === undefined)
|
|
245
246
|
return unavailable('triggers');
|
|
246
|
-
const operation = trigger[2] ===
|
|
247
|
+
const operation = trigger[2] === TriggerCommandName.Run
|
|
248
|
+
? applications.triggers.run
|
|
249
|
+
: trigger[2] === TriggerCommandName.Pause
|
|
250
|
+
? applications.triggers.pause
|
|
251
|
+
: applications.triggers.resume;
|
|
252
|
+
if (operation === undefined)
|
|
253
|
+
return unavailable('trigger-run');
|
|
247
254
|
return accepted(await operation(id, request), applications.now(), 200);
|
|
248
255
|
}
|
|
249
256
|
return undefined;
|