@atolis-hq/wake 0.4.71 → 0.4.72
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 +19 -2
- package/dist/src/control-plane/application/trigger-manual-request.d.ts +19 -0
- package/dist/src/control-plane/application/trigger-manual-request.js +95 -0
- 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 +30 -0
- package/dist/src/control-plane/contracts/events.js +26 -1
- 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 +14 -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-KgkqaRO6.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
|
@@ -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;
|