@antelopejs/dms-automation 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -2
- package/dist/data/procedures-table.d.ts +38 -4
- package/dist/data/procedures-table.js +264 -82
- package/dist/data/procedures-table.js.map +1 -1
- package/dist/data/runs-table.d.ts +19 -3
- package/dist/data/runs-table.js +254 -19
- package/dist/data/runs-table.js.map +1 -1
- package/dist/db/index.d.ts +1 -2
- package/dist/db/index.js +1 -2
- package/dist/db/index.js.map +1 -1
- package/dist/db/models/automation_template.model.d.ts +16 -1
- package/dist/db/models/automation_template.model.js +31 -11
- package/dist/db/models/automation_template.model.js.map +1 -1
- package/dist/db/models/index.d.ts +1 -1
- package/dist/db/models/index.js +1 -1
- package/dist/db/models/procedure.model.d.ts +1 -0
- package/dist/db/models/procedure.model.js +7 -0
- package/dist/db/models/procedure.model.js.map +1 -1
- package/dist/db/models/procedure_run.model.d.ts +16 -9
- package/dist/db/models/procedure_run.model.js +96 -17
- package/dist/db/models/procedure_run.model.js.map +1 -1
- package/dist/db/models/stats.model.d.ts +60 -61
- package/dist/db/models/stats.model.js +189 -236
- package/dist/db/models/stats.model.js.map +1 -1
- package/dist/db/models/type_switch.model.d.ts +25 -0
- package/dist/db/models/type_switch.model.js +25 -0
- package/dist/db/models/type_switch.model.js.map +1 -0
- package/dist/db/tables/index.d.ts +1 -2
- package/dist/db/tables/index.js +1 -2
- package/dist/db/tables/index.js.map +1 -1
- package/dist/db/tables/procedure.table.d.ts +6 -0
- package/dist/db/tables/procedure.table.js +24 -0
- package/dist/db/tables/procedure.table.js.map +1 -1
- package/dist/db/tables/procedure_run.table.d.ts +15 -1
- package/dist/db/tables/procedure_run.table.js +54 -0
- package/dist/db/tables/procedure_run.table.js.map +1 -1
- package/dist/db/tables/type_switch.table.d.ts +8 -0
- package/dist/db/tables/{trigger_type_config.table.js → type_switch.table.js} +16 -15
- package/dist/db/tables/type_switch.table.js.map +1 -0
- package/dist/displays/index.d.ts +14 -0
- package/dist/displays/index.js +23 -0
- package/dist/displays/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/builder.d.ts +1 -1
- package/dist/pages/builder.js +10 -3
- package/dist/pages/builder.js.map +1 -1
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +2 -1
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/library.d.ts +2 -1
- package/dist/pages/library.js +54 -4
- package/dist/pages/library.js.map +1 -1
- package/dist/pages/overview.d.ts +6 -1
- package/dist/pages/overview.js +121 -2
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/procedures.js +111 -16
- package/dist/pages/procedures.js.map +1 -1
- package/dist/pages/runs.d.ts +4 -1
- package/dist/pages/runs.js +109 -13
- package/dist/pages/runs.js.map +1 -1
- package/dist/pages/shared.d.ts +18 -0
- package/dist/pages/shared.js +238 -0
- package/dist/pages/shared.js.map +1 -0
- package/dist/pages/trace.d.ts +10 -0
- package/dist/pages/trace.js +41 -0
- package/dist/pages/trace.js.map +1 -0
- package/dist/realtime.d.ts +3 -0
- package/dist/realtime.js +14 -0
- package/dist/realtime.js.map +1 -0
- package/dist/routes/action-types.d.ts +2 -14
- package/dist/routes/action-types.js +2 -32
- package/dist/routes/action-types.js.map +1 -1
- package/dist/routes/deleteConfirm.d.ts +3 -0
- package/dist/routes/deleteConfirm.js +64 -0
- package/dist/routes/deleteConfirm.js.map +1 -0
- package/dist/routes/graphSchema.d.ts +3 -90
- package/dist/routes/graphSchema.js +36 -9
- package/dist/routes/graphSchema.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/library.d.ts +40 -0
- package/dist/routes/library.js +147 -0
- package/dist/routes/library.js.map +1 -0
- package/dist/routes/procedureChecks.d.ts +16 -0
- package/dist/routes/procedureChecks.js +72 -0
- package/dist/routes/procedureChecks.js.map +1 -0
- package/dist/routes/procedureRuns.d.ts +21 -0
- package/dist/routes/procedureRuns.js +45 -0
- package/dist/routes/procedureRuns.js.map +1 -0
- package/dist/routes/procedureSchemas.d.ts +107 -0
- package/dist/routes/procedureSchemas.js +61 -0
- package/dist/routes/procedureSchemas.js.map +1 -0
- package/dist/routes/procedures.d.ts +125 -7
- package/dist/routes/procedures.js +363 -67
- package/dist/routes/procedures.js.map +1 -1
- package/dist/routes/requests.d.ts +15 -0
- package/dist/routes/requests.js +35 -0
- package/dist/routes/requests.js.map +1 -0
- package/dist/routes/runs.d.ts +107 -2
- package/dist/routes/runs.js +340 -37
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/stats.d.ts +19 -1
- package/dist/routes/stats.js +160 -4
- package/dist/routes/stats.js.map +1 -1
- package/dist/routes/templates.d.ts +6 -2
- package/dist/routes/templates.js +106 -36
- package/dist/routes/templates.js.map +1 -1
- package/dist/routes/trigger-types.d.ts +2 -15
- package/dist/routes/trigger-types.js +2 -32
- package/dist/routes/trigger-types.js.map +1 -1
- package/dist/routes/typeConfigShared.d.ts +7 -11
- package/dist/routes/typeConfigShared.js +25 -15
- package/dist/routes/typeConfigShared.js.map +1 -1
- package/dist/runtime/armErrors.d.ts +16 -0
- package/dist/runtime/armErrors.js +69 -0
- package/dist/runtime/armErrors.js.map +1 -0
- package/dist/runtime/boundRunLog.d.ts +24 -0
- package/dist/runtime/boundRunLog.js +202 -10
- package/dist/runtime/boundRunLog.js.map +1 -1
- package/dist/runtime/builtins/actions/http.d.ts +10 -1
- package/dist/runtime/builtins/actions/http.js +306 -19
- package/dist/runtime/builtins/actions/http.js.map +1 -1
- package/dist/runtime/builtins/actions/log.js +2 -2
- package/dist/runtime/builtins/actions/log.js.map +1 -1
- package/dist/runtime/builtins/data/boolean.d.ts +1 -0
- package/dist/runtime/builtins/data/boolean.js +18 -10
- package/dist/runtime/builtins/data/boolean.js.map +1 -1
- package/dist/runtime/builtins/data/compare.js +60 -11
- package/dist/runtime/builtins/data/compare.js.map +1 -1
- package/dist/runtime/builtins/data/constant.js +9 -12
- package/dist/runtime/builtins/data/constant.js.map +1 -1
- package/dist/runtime/builtins/data/json.js +4 -4
- package/dist/runtime/builtins/data/json.js.map +1 -1
- package/dist/runtime/builtins/data/math.js +44 -24
- package/dist/runtime/builtins/data/math.js.map +1 -1
- package/dist/runtime/builtins/data/object.js +10 -10
- package/dist/runtime/builtins/data/object.js.map +1 -1
- package/dist/runtime/builtins/data/string.js +31 -20
- package/dist/runtime/builtins/data/string.js.map +1 -1
- package/dist/runtime/builtins/nodes/action.js +4 -0
- package/dist/runtime/builtins/nodes/action.js.map +1 -1
- package/dist/runtime/builtins/nodes/delay.js +1 -1
- package/dist/runtime/builtins/nodes/delay.js.map +1 -1
- package/dist/runtime/builtins/nodes/forRange.d.ts +1 -1
- package/dist/runtime/builtins/nodes/forRange.js +10 -4
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
- package/dist/runtime/builtins/nodes/if.js +2 -1
- package/dist/runtime/builtins/nodes/if.js.map +1 -1
- package/dist/runtime/builtins/nodes/parallel.js +9 -2
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
- package/dist/runtime/builtins/nodes/retry.js +1 -1
- package/dist/runtime/builtins/nodes/retry.js.map +1 -1
- package/dist/runtime/builtins/nodes/setVariable.js +1 -3
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
- package/dist/runtime/builtins/triggers/cron.d.ts +3 -0
- package/dist/runtime/builtins/triggers/cron.js +21 -7
- package/dist/runtime/builtins/triggers/cron.js.map +1 -1
- package/dist/runtime/builtins/triggers/manual.js +2 -2
- package/dist/runtime/builtins/triggers/manual.js.map +1 -1
- package/dist/runtime/builtins/triggers/webhook.d.ts +14 -1
- package/dist/runtime/builtins/triggers/webhook.js +116 -30
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
- package/dist/runtime/describe.d.ts +23 -0
- package/dist/runtime/describe.js +114 -0
- package/dist/runtime/describe.js.map +1 -0
- package/dist/runtime/executionResult.d.ts +1 -0
- package/dist/runtime/executor.js +82 -5
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/graphIssues.d.ts +20 -0
- package/dist/runtime/graphIssues.js +290 -0
- package/dist/runtime/graphIssues.js.map +1 -0
- package/dist/runtime/graphVersion.d.ts +2 -0
- package/dist/runtime/graphVersion.js +43 -0
- package/dist/runtime/graphVersion.js.map +1 -0
- package/dist/runtime/nodeKinds.d.ts +4 -4
- package/dist/runtime/nodeKinds.js +1 -2
- package/dist/runtime/nodeKinds.js.map +1 -1
- package/dist/runtime/registry.d.ts +2 -1
- package/dist/runtime/registry.js +1 -2
- package/dist/runtime/registry.js.map +1 -1
- package/dist/runtime/resolveInputs.d.ts +3 -1
- package/dist/runtime/resolveInputs.js +12 -2
- package/dist/runtime/resolveInputs.js.map +1 -1
- package/dist/runtime/resolveSubgraph.d.ts +12 -1
- package/dist/runtime/resolveSubgraph.js +36 -0
- package/dist/runtime/resolveSubgraph.js.map +1 -1
- package/dist/runtime/retention.d.ts +6 -0
- package/dist/runtime/retention.js +54 -0
- package/dist/runtime/retention.js.map +1 -0
- package/dist/runtime/runProcedure.d.ts +12 -0
- package/dist/runtime/runProcedure.js +130 -0
- package/dist/runtime/runProcedure.js.map +1 -0
- package/dist/runtime/schedule.d.ts +2 -0
- package/dist/runtime/schedule.js +139 -0
- package/dist/runtime/schedule.js.map +1 -0
- package/dist/runtime/subscriptions.d.ts +11 -1
- package/dist/runtime/subscriptions.js +91 -125
- package/dist/runtime/subscriptions.js.map +1 -1
- package/dist/runtime/subwalk.js +2 -3
- package/dist/runtime/subwalk.js.map +1 -1
- package/dist/runtime/templateUsages.d.ts +4 -0
- package/dist/runtime/templateUsages.js +102 -0
- package/dist/runtime/templateUsages.js.map +1 -0
- package/dist/runtime/topo.d.ts +1 -0
- package/dist/runtime/topo.js +23 -0
- package/dist/runtime/topo.js.map +1 -1
- package/dist/runtime/trace.d.ts +44 -0
- package/dist/runtime/trace.js +240 -0
- package/dist/runtime/trace.js.map +1 -0
- package/dist/runtime/typeSwitches.d.ts +3 -0
- package/dist/runtime/typeSwitches.js +27 -0
- package/dist/runtime/typeSwitches.js.map +1 -0
- package/dist/runtime/validate.d.ts +11 -0
- package/dist/runtime/validate.js +118 -61
- package/dist/runtime/validate.js.map +1 -1
- package/dist/runtime/webhookRoutes.d.ts +4 -0
- package/dist/runtime/webhookRoutes.js +68 -0
- package/dist/runtime/webhookRoutes.js.map +1 -0
- package/dist/runtime/withTimeout.d.ts +1 -0
- package/dist/runtime/withTimeout.js +17 -0
- package/dist/runtime/withTimeout.js.map +1 -0
- package/dist/runtime/wording.d.ts +10 -0
- package/dist/runtime/wording.js +118 -0
- package/dist/runtime/wording.js.map +1 -0
- package/dist/stats/health-banner.d.ts +13 -0
- package/dist/stats/health-banner.js +149 -0
- package/dist/stats/health-banner.js.map +1 -0
- package/dist/stats/health.d.ts +49 -0
- package/dist/stats/health.js +130 -0
- package/dist/stats/health.js.map +1 -0
- package/dist/stats/kpi.d.ts +21 -0
- package/dist/stats/kpi.js +101 -0
- package/dist/stats/kpi.js.map +1 -0
- package/dist/stats/overview.d.ts +94 -0
- package/dist/stats/overview.js +244 -0
- package/dist/stats/overview.js.map +1 -0
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/constants.js +1 -2
- package/dist/types/constants.js.map +1 -1
- package/dist/types/runLog.d.ts +2 -0
- package/dist/types/runLog.js +4 -0
- package/dist/types/runLog.js.map +1 -1
- package/frontend-vue/app/components/AttentionList.vue +276 -0
- package/frontend-vue/app/components/Catalog/SchemaTable.vue +127 -0
- package/frontend-vue/app/components/Catalog.vue +457 -0
- package/frontend-vue/app/components/Editor/BottomDock.vue +188 -0
- package/frontend-vue/app/components/Editor/BuilderPalette.vue +101 -45
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +818 -206
- package/frontend-vue/app/components/Editor/GroupPortEditor.vue +29 -18
- package/frontend-vue/app/components/Editor/JsonField.vue +3 -3
- package/frontend-vue/app/components/Editor/NewProcedureDialog.vue +108 -0
- package/frontend-vue/app/components/Editor/NodeInspector.vue +373 -101
- package/frontend-vue/app/components/Editor/ProcedureSwitcher.vue +147 -0
- package/frontend-vue/app/components/Editor/RunNowDialog.vue +145 -0
- package/frontend-vue/app/components/Editor/WiredField.vue +3 -3
- package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +97 -91
- package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +5 -6
- package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +3 -2
- package/frontend-vue/app/components/Editor/nodes/styles.ts +14 -18
- package/frontend-vue/app/components/Editor.vue +1894 -705
- package/frontend-vue/app/components/IconPicker.vue +122 -0
- package/frontend-vue/app/components/LiveTopics.vue +20 -0
- package/frontend-vue/app/components/Run/RunCompare.vue +115 -0
- package/frontend-vue/app/components/Run/RunFailure.vue +54 -0
- package/frontend-vue/app/components/Run/RunLogList.vue +167 -0
- package/frontend-vue/app/components/Run/RunPathTaken.vue +139 -0
- package/frontend-vue/app/components/Run/RunPayload.vue +85 -0
- package/frontend-vue/app/components/Run/RunWaterfall.vue +374 -0
- package/frontend-vue/app/components/RunPeek.vue +132 -0
- package/frontend-vue/app/components/RunTrace.vue +462 -0
- package/frontend-vue/app/components/Templates.vue +382 -537
- package/frontend-vue/app/components/WebhookEndpoint.vue +81 -0
- package/frontend-vue/app/composables/useAutomationNodeKinds.ts +23 -6
- package/frontend-vue/app/composables/useAutomationRuns.ts +160 -25
- package/frontend-vue/app/composables/useGraphConnect.ts +103 -51
- package/frontend-vue/app/composables/useRunActions.ts +60 -0
- package/frontend-vue/app/plugins/cell-displays.ts +169 -0
- package/frontend-vue/app/utils/automation.ts +4 -36
- package/frontend-vue/app/utils/describe.ts +252 -0
- package/frontend-vue/app/utils/redactedHeaders.ts +31 -0
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +7 -4
- package/frontend-vue/i18n/locales/dms-automation-en-GB.json +1149 -309
- package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +1154 -314
- package/frontend-vue/package.json +1 -1
- package/package.json +8 -6
- package/dist/db/models/type_config.model.d.ts +0 -47
- package/dist/db/models/type_config.model.js +0 -51
- package/dist/db/models/type_config.model.js.map +0 -1
- package/dist/db/tables/action_type_config.table.d.ts +0 -7
- package/dist/db/tables/action_type_config.table.js +0 -35
- package/dist/db/tables/action_type_config.table.js.map +0 -1
- package/dist/db/tables/trigger_type_config.table.d.ts +0 -7
- package/dist/db/tables/trigger_type_config.table.js.map +0 -1
- package/frontend-vue/app/components/Actions.vue +0 -151
- package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +0 -170
- package/frontend-vue/app/components/Catalog/TypeList.vue +0 -203
- package/frontend-vue/app/components/DataNodes.vue +0 -275
- package/frontend-vue/app/components/Editor/ProcedureList.vue +0 -156
- package/frontend-vue/app/components/Editor/RunsDrawer.vue +0 -312
- package/frontend-vue/app/components/Library.vue +0 -69
- package/frontend-vue/app/components/Overview.vue +0 -503
- package/frontend-vue/app/components/RunDetailDrawer.vue +0 -165
- package/frontend-vue/app/components/RunFireTree.vue +0 -170
- package/frontend-vue/app/components/RunTraceDrawer.vue +0 -59
- package/frontend-vue/app/components/RunsStats.vue +0 -126
- package/frontend-vue/app/components/RunsTimelineDisplay.vue +0 -287
- package/frontend-vue/app/components/Triggers.vue +0 -147
- package/frontend-vue/app/plugins/runs-timeline-display.client.ts +0 -16
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTTPResult } from "@antelopejs/interface-api";
|
|
2
|
+
import type { Procedure } from "../db/tables/procedure.table";
|
|
3
|
+
import { type GraphIssue } from "../runtime/graphIssues";
|
|
4
|
+
import type { ProcedureGraph } from "../types/graph";
|
|
5
|
+
export declare function graphRefusal(issues: GraphIssue[]): HTTPResult;
|
|
6
|
+
export declare function issuesOf(graph: ProcedureGraph, enabling: boolean): GraphIssue[];
|
|
7
|
+
export interface SaveTarget {
|
|
8
|
+
procedureId?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function saveIssues(graph: ProcedureGraph, enabled: boolean, { procedureId, name }?: SaveTarget): Promise<GraphIssue[]>;
|
|
12
|
+
export declare function checkSavable(graph: ProcedureGraph, enabled: boolean, target?: SaveTarget): Promise<GraphIssue[]>;
|
|
13
|
+
export declare function nameWarning(name: string): Promise<{
|
|
14
|
+
warning?: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function stale(procedure: Procedure): HTTPResult;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.graphRefusal = graphRefusal;
|
|
4
|
+
exports.issuesOf = issuesOf;
|
|
5
|
+
exports.saveIssues = saveIssues;
|
|
6
|
+
exports.checkSavable = checkSavable;
|
|
7
|
+
exports.nameWarning = nameWarning;
|
|
8
|
+
exports.stale = stale;
|
|
9
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
10
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
11
|
+
const procedure_model_1 = require("../db/models/procedure.model");
|
|
12
|
+
const graphIssues_1 = require("../runtime/graphIssues");
|
|
13
|
+
const subscriptions_1 = require("../runtime/subscriptions");
|
|
14
|
+
const webhookRoutes_1 = require("../runtime/webhookRoutes");
|
|
15
|
+
const constants_1 = require("../types/constants");
|
|
16
|
+
const requests_1 = require("./requests");
|
|
17
|
+
const REFUSAL_OF_ISSUE = {
|
|
18
|
+
noTrigger: `${requests_1.API_MESSAGES}.noTrigger`,
|
|
19
|
+
webhookPathTaken: `${requests_1.API_MESSAGES}.webhookPathTaken`,
|
|
20
|
+
};
|
|
21
|
+
function graphRefusal(issues) {
|
|
22
|
+
const first = issues.find((i) => i.severity === "error");
|
|
23
|
+
const message = REFUSAL_OF_ISSUE[first?.code ?? ""] ?? `${requests_1.API_MESSAGES}.graphHasErrors`;
|
|
24
|
+
return (0, requests_1.invalid)("invalid graph", issues, message);
|
|
25
|
+
}
|
|
26
|
+
function issuesOf(graph, enabling) {
|
|
27
|
+
return (0, graphIssues_1.graphIssues)(graph, {
|
|
28
|
+
enabling,
|
|
29
|
+
templates: { has: (id) => subscriptions_1.subscriptions.hasTemplate(id) },
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const normalName = (name) => name.trim().toLowerCase();
|
|
33
|
+
async function isNameTaken(name, procedureId) {
|
|
34
|
+
const all = await (0, interface_database_decorators_1.GetModel)(procedure_model_1.ProcedureModel, constants_1.DATABASE_NAME).getAll();
|
|
35
|
+
return all.some((p) => p._id !== procedureId && normalName(p.name) === normalName(name));
|
|
36
|
+
}
|
|
37
|
+
function nameTakenIssue(name) {
|
|
38
|
+
return {
|
|
39
|
+
severity: "warning",
|
|
40
|
+
code: "nameTaken",
|
|
41
|
+
params: { name },
|
|
42
|
+
message: `another procedure is already named "${name}"`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async function saveIssues(graph, enabled, { procedureId, name } = {}) {
|
|
46
|
+
const issues = issuesOf(graph, enabled);
|
|
47
|
+
const severity = enabled ? "error" : "warning";
|
|
48
|
+
issues.push(...(await (0, webhookRoutes_1.webhookConflicts)(graph, procedureId, severity)));
|
|
49
|
+
if (name !== undefined && (await isNameTaken(name, procedureId))) {
|
|
50
|
+
issues.push(nameTakenIssue(name));
|
|
51
|
+
}
|
|
52
|
+
return issues;
|
|
53
|
+
}
|
|
54
|
+
async function checkSavable(graph, enabled, target = {}) {
|
|
55
|
+
const issues = await saveIssues(graph, enabled, target);
|
|
56
|
+
if (enabled && (0, graphIssues_1.hasBlockingIssue)(issues))
|
|
57
|
+
throw graphRefusal(issues);
|
|
58
|
+
return issues;
|
|
59
|
+
}
|
|
60
|
+
async function nameWarning(name) {
|
|
61
|
+
return (await isNameTaken(name)) ? { warning: `${requests_1.API_MESSAGES}.nameTaken` } : {};
|
|
62
|
+
}
|
|
63
|
+
function stale(procedure) {
|
|
64
|
+
const { revision, version } = procedure;
|
|
65
|
+
return new interface_api_1.HTTPResult(409, {
|
|
66
|
+
error: "stale",
|
|
67
|
+
message: `${requests_1.API_MESSAGES}.stale`,
|
|
68
|
+
revision,
|
|
69
|
+
version,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=procedureChecks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedureChecks.js","sourceRoot":"","sources":["../../src/routes/procedureChecks.ts"],"names":[],"mappings":";;AAuBA,oCAKC;AAGD,4BAQC;AAsCD,gCAYC;AAQD,oCAQC;AAGD,kCAEC;AAMD,sBAQC;AA5HD,6DAAuD;AACvD,6FAAqE;AACrE,kEAA8D;AAE9D,wDAIgC;AAChC,4DAAyD;AACzD,4DAA4D;AAC5D,kDAAmD;AAEnD,yCAA0D;AAK1D,MAAM,gBAAgB,GAA2B;IAC/C,SAAS,EAAE,GAAG,uBAAG,YAAY;IAC7B,gBAAgB,EAAE,GAAG,uBAAG,mBAAmB;CAC5C,CAAC;AAEF,SAAgB,YAAY,CAAC,MAAoB;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACzD,MAAM,OAAO,GACX,gBAAgB,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,GAAG,uBAAG,iBAAiB,CAAC;IACjE,OAAO,IAAA,kBAAO,EAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAGD,SAAgB,QAAQ,CACtB,KAAqB,EACrB,QAAiB;IAEjB,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE;QACxB,QAAQ;QACR,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,6BAAa,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;KAC1D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAM/D,KAAK,UAAU,WAAW,CACxB,IAAY,EACZ,WAAoB;IAEpB,MAAM,GAAG,GAAG,MAAM,IAAA,wCAAQ,EAAC,gCAAc,EAAE,yBAAa,CAAC,CAAC,MAAM,EAAE,CAAC;IACnE,OAAO,GAAG,CAAC,IAAI,CACb,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO;QACL,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,EAAE,IAAI,EAAE;QAChB,OAAO,EAAE,uCAAuC,IAAI,GAAG;KACxD,CAAC;AACJ,CAAC;AAaM,KAAK,UAAU,UAAU,CAC9B,KAAqB,EACrB,OAAgB,EAChB,EAAE,WAAW,EAAE,IAAI,KAAiB,EAAE;IAEtC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAA,gCAAgB,EAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvE,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQM,KAAK,UAAU,YAAY,CAChC,KAAqB,EACrB,OAAgB,EAChB,SAAqB,EAAE;IAEvB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,OAAO,IAAI,IAAA,8BAAgB,EAAC,MAAM,CAAC;QAAE,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC;AAChB,CAAC;AAGM,KAAK,UAAU,WAAW,CAAC,IAAY;IAC5C,OAAO,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,uBAAG,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC;AAMD,SAAgB,KAAK,CAAC,SAAoB;IACxC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IACxC,OAAO,IAAI,0BAAU,CAAC,GAAG,EAAE;QACzB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,GAAG,uBAAG,QAAQ;QACvB,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function lastPayloadOf(procedureId: string, triggerNodeId?: string): Promise<{
|
|
2
|
+
last: {
|
|
3
|
+
runId: string;
|
|
4
|
+
triggerNodeId: string;
|
|
5
|
+
startedAt: string;
|
|
6
|
+
payload: unknown;
|
|
7
|
+
};
|
|
8
|
+
tooLarge: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
last: null;
|
|
11
|
+
tooLarge: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function runOutcome(runId: string, warnOnFailure: boolean): Promise<{
|
|
14
|
+
runId: string;
|
|
15
|
+
status: string;
|
|
16
|
+
warning: string;
|
|
17
|
+
} | {
|
|
18
|
+
runId: string;
|
|
19
|
+
status: string;
|
|
20
|
+
warning?: undefined;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lastPayloadOf = lastPayloadOf;
|
|
4
|
+
exports.runOutcome = runOutcome;
|
|
5
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
6
|
+
const procedure_run_model_1 = require("../db/models/procedure_run.model");
|
|
7
|
+
const boundRunLog_1 = require("../runtime/boundRunLog");
|
|
8
|
+
const constants_1 = require("../types/constants");
|
|
9
|
+
const requests_1 = require("./requests");
|
|
10
|
+
const PAYLOAD_LOOKBACK = 50;
|
|
11
|
+
async function lastPayloadOf(procedureId, triggerNodeId) {
|
|
12
|
+
const model = (0, interface_database_decorators_1.GetModel)(procedure_run_model_1.ProcedureRunModel, constants_1.DATABASE_NAME);
|
|
13
|
+
let before = new Date();
|
|
14
|
+
let tooLarge = false;
|
|
15
|
+
for (let i = 0; i < PAYLOAD_LOOKBACK; i++) {
|
|
16
|
+
const summary = await model.newest(procedureId, { tests: false, before });
|
|
17
|
+
if (!summary)
|
|
18
|
+
break;
|
|
19
|
+
before = new Date(summary.startedAt);
|
|
20
|
+
if (triggerNodeId && summary.triggerNodeId !== triggerNodeId)
|
|
21
|
+
continue;
|
|
22
|
+
const run = await model.get(summary._id);
|
|
23
|
+
const stored = (0, boundRunLog_1.readTriggerPayload)(run?.triggerPayload);
|
|
24
|
+
if (!stored.kept) {
|
|
25
|
+
tooLarge = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const last = {
|
|
29
|
+
runId: summary._id,
|
|
30
|
+
triggerNodeId: summary.triggerNodeId,
|
|
31
|
+
startedAt: before.toISOString(),
|
|
32
|
+
payload: stored.payload,
|
|
33
|
+
};
|
|
34
|
+
return { last, tooLarge };
|
|
35
|
+
}
|
|
36
|
+
return { last: null, tooLarge };
|
|
37
|
+
}
|
|
38
|
+
async function runOutcome(runId, warnOnFailure) {
|
|
39
|
+
const run = await (0, interface_database_decorators_1.GetModel)(procedure_run_model_1.ProcedureRunModel, constants_1.DATABASE_NAME).get(runId);
|
|
40
|
+
const status = run?.status ?? "ok";
|
|
41
|
+
return status === "failed" && warnOnFailure
|
|
42
|
+
? { runId, status, warning: `${requests_1.API_MESSAGES}.runFailed` }
|
|
43
|
+
: { runId, status };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=procedureRuns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedureRuns.js","sourceRoot":"","sources":["../../src/routes/procedureRuns.ts"],"names":[],"mappings":";;AAaA,sCA2BC;AAMD,gCAMC;AApDD,6FAAqE;AACrE,0EAAqE;AACrE,wDAA4D;AAC5D,kDAAmD;AACnD,yCAA0C;AAG1C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAMrB,KAAK,UAAU,aAAa,CACjC,WAAmB,EACnB,aAAsB;IAEtB,MAAM,KAAK,GAAG,IAAA,wCAAQ,EAAC,uCAAiB,EAAE,yBAAa,CAAC,CAAC;IACzD,IAAI,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO;YAAE,MAAM;QACpB,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa,KAAK,aAAa;YAAE,SAAS;QACvE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,IAAA,gCAAkB,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,QAAQ,GAAG,IAAI,CAAC;YAChB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG;YACX,KAAK,EAAE,OAAO,CAAC,GAAG;YAClB,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAClC,CAAC;AAMM,KAAK,UAAU,UAAU,CAAC,KAAa,EAAE,aAAsB;IACpE,MAAM,GAAG,GAAG,MAAM,IAAA,wCAAQ,EAAC,uCAAiB,EAAE,yBAAa,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC;IACnC,OAAO,MAAM,KAAK,QAAQ,IAAI,aAAa;QACzC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,uBAAY,YAAY,EAAE;QACzD,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MAX_NAME_LENGTH = 200;
|
|
3
|
+
export declare const procedureUpdateSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
enabled: z.ZodBoolean;
|
|
7
|
+
graph: z.ZodType<import("../types/graph").ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
8
|
+
expectedRevision: z.ZodNumber;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
name: string;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
graph: import("../types/graph").ProcedureGraph;
|
|
13
|
+
expectedRevision: number;
|
|
14
|
+
description?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
name: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
expectedRevision: number;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
graph?: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
declare const STARTERS: readonly ["webhook", "schedule.cron", "manual"];
|
|
23
|
+
export type Starter = (typeof STARTERS)[number];
|
|
24
|
+
export declare const newProcedureSchema: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
trigger: z.ZodEnum<["webhook", "schedule.cron", "manual"]>;
|
|
27
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
name: string;
|
|
30
|
+
trigger: "webhook" | "schedule.cron" | "manual";
|
|
31
|
+
description?: string | null | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
name: string;
|
|
34
|
+
trigger: "webhook" | "schedule.cron" | "manual";
|
|
35
|
+
description?: string | null | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const importSchema: z.ZodObject<{
|
|
38
|
+
json: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
json: string;
|
|
41
|
+
}, {
|
|
42
|
+
json: string;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const exportedSchema: z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
description: z.ZodOptional<z.ZodString>;
|
|
47
|
+
graph: z.ZodType<import("../types/graph").ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
name: string;
|
|
50
|
+
graph: import("../types/graph").ProcedureGraph;
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
graph?: unknown;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const enabledSchema: z.ZodObject<{
|
|
58
|
+
enabled: z.ZodBoolean;
|
|
59
|
+
restorePause: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
restorePause?: boolean | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
restorePause?: boolean | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const validateSchema: z.ZodObject<{
|
|
68
|
+
graph: z.ZodType<import("../types/graph").ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
69
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
procedureId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
graph: import("../types/graph").ProcedureGraph;
|
|
74
|
+
name?: string | undefined;
|
|
75
|
+
enabled?: boolean | undefined;
|
|
76
|
+
procedureId?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
name?: string | undefined;
|
|
79
|
+
enabled?: boolean | undefined;
|
|
80
|
+
graph?: unknown;
|
|
81
|
+
procedureId?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const runNowSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
84
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
85
|
+
triggerNodeId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
triggerNodeId?: string | undefined;
|
|
88
|
+
payload?: unknown;
|
|
89
|
+
}, {
|
|
90
|
+
triggerNodeId?: string | undefined;
|
|
91
|
+
payload?: unknown;
|
|
92
|
+
}>>>;
|
|
93
|
+
export declare const testSchema: z.ZodObject<{
|
|
94
|
+
graph: z.ZodType<import("../types/graph").ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
95
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
+
triggerNodeId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
graph: import("../types/graph").ProcedureGraph;
|
|
99
|
+
triggerNodeId?: string | undefined;
|
|
100
|
+
payload?: unknown;
|
|
101
|
+
}, {
|
|
102
|
+
graph?: unknown;
|
|
103
|
+
triggerNodeId?: string | undefined;
|
|
104
|
+
payload?: unknown;
|
|
105
|
+
}>;
|
|
106
|
+
export declare function importErrorOf(issues: z.ZodIssue[]): string;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testSchema = exports.runNowSchema = exports.validateSchema = exports.enabledSchema = exports.exportedSchema = exports.importSchema = exports.newProcedureSchema = exports.procedureUpdateSchema = exports.MAX_NAME_LENGTH = void 0;
|
|
4
|
+
exports.importErrorOf = importErrorOf;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const graphSchema_1 = require("./graphSchema");
|
|
7
|
+
exports.MAX_NAME_LENGTH = 200;
|
|
8
|
+
const MAX_DESCRIPTION_LENGTH = 2000;
|
|
9
|
+
const nameSchema = zod_1.z.string().trim().min(1).max(exports.MAX_NAME_LENGTH);
|
|
10
|
+
const descriptionSchema = zod_1.z.string().max(MAX_DESCRIPTION_LENGTH);
|
|
11
|
+
exports.procedureUpdateSchema = zod_1.z.object({
|
|
12
|
+
name: nameSchema,
|
|
13
|
+
description: descriptionSchema.optional(),
|
|
14
|
+
enabled: zod_1.z.boolean(),
|
|
15
|
+
graph: graphSchema_1.procedureGraphSchema,
|
|
16
|
+
expectedRevision: zod_1.z.number().int(),
|
|
17
|
+
});
|
|
18
|
+
const STARTERS = ["webhook", "schedule.cron", "manual"];
|
|
19
|
+
exports.newProcedureSchema = zod_1.z.object({
|
|
20
|
+
name: nameSchema,
|
|
21
|
+
trigger: zod_1.z.enum(STARTERS),
|
|
22
|
+
description: descriptionSchema.nullish(),
|
|
23
|
+
});
|
|
24
|
+
exports.importSchema = zod_1.z.object({ json: zod_1.z.string().min(1) });
|
|
25
|
+
exports.exportedSchema = zod_1.z.object({
|
|
26
|
+
name: nameSchema,
|
|
27
|
+
description: descriptionSchema.optional(),
|
|
28
|
+
graph: graphSchema_1.procedureGraphSchema,
|
|
29
|
+
});
|
|
30
|
+
exports.enabledSchema = zod_1.z.object({
|
|
31
|
+
enabled: zod_1.z.boolean(),
|
|
32
|
+
restorePause: zod_1.z.boolean().optional(),
|
|
33
|
+
});
|
|
34
|
+
exports.validateSchema = zod_1.z.object({
|
|
35
|
+
graph: graphSchema_1.procedureGraphSchema,
|
|
36
|
+
enabled: zod_1.z.boolean().optional(),
|
|
37
|
+
procedureId: zod_1.z.string().optional(),
|
|
38
|
+
name: zod_1.z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
exports.runNowSchema = zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
payload: zod_1.z.unknown().optional(),
|
|
43
|
+
triggerNodeId: zod_1.z.string().optional(),
|
|
44
|
+
})
|
|
45
|
+
.nullish();
|
|
46
|
+
exports.testSchema = zod_1.z.object({
|
|
47
|
+
graph: graphSchema_1.procedureGraphSchema,
|
|
48
|
+
payload: zod_1.z.unknown().optional(),
|
|
49
|
+
triggerNodeId: zod_1.z.string().optional(),
|
|
50
|
+
});
|
|
51
|
+
const IMPORT = "$dms_automation.importProcedure";
|
|
52
|
+
function importErrorOf(issues) {
|
|
53
|
+
const missing = issues.some((i) => i.path.length === 1 &&
|
|
54
|
+
i.code === "invalid_type" &&
|
|
55
|
+
i.received === "undefined");
|
|
56
|
+
if (missing || issues.length === 0)
|
|
57
|
+
return `${IMPORT}.notProcedure`;
|
|
58
|
+
const unknownKind = issues.some((i) => i.path.at(-1) === "kind");
|
|
59
|
+
return unknownKind ? `${IMPORT}.unknownKind` : `${IMPORT}.invalidGraph`;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=procedureSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedureSchemas.js","sourceRoot":"","sources":["../../src/routes/procedureSchemas.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,22 +1,140 @@
|
|
|
1
1
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
import type { ProcedureGraph } from "../types/graph";
|
|
3
|
+
export declare function savedTriggersOf(graph: ProcedureGraph, from?: Date): {
|
|
4
|
+
nextAt: string | null;
|
|
5
|
+
nodeId: string;
|
|
6
|
+
typeId: string;
|
|
7
|
+
typeName: string;
|
|
8
|
+
method?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
cron?: string;
|
|
11
|
+
timeZone?: string;
|
|
12
|
+
text: import("@antelopejs/interface-dms/base").BlockText;
|
|
13
|
+
}[];
|
|
2
14
|
declare const ProceduresController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
15
|
export declare class ProceduresController extends ProceduresController_base {
|
|
4
|
-
list(_user: User, page?: string, limit?: string): Promise<
|
|
5
|
-
|
|
6
|
-
|
|
16
|
+
list(_user: User, page?: string, limit?: string): Promise<{
|
|
17
|
+
results: {
|
|
18
|
+
graph: ProcedureGraph;
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
version: number;
|
|
23
|
+
revision: number;
|
|
24
|
+
pausedAt?: Date;
|
|
25
|
+
pausedBy?: string;
|
|
26
|
+
attentionDismissedAt?: Date | null;
|
|
27
|
+
armErrors?: string;
|
|
28
|
+
created_at: Date;
|
|
29
|
+
updated_at: Date;
|
|
30
|
+
_id: string;
|
|
31
|
+
}[];
|
|
32
|
+
total: number;
|
|
33
|
+
page: number;
|
|
34
|
+
limit: number;
|
|
7
35
|
}>;
|
|
8
|
-
|
|
9
|
-
|
|
36
|
+
summary(_user: User): Promise<import("../db/models/stats.model").ProcedureSummaryRow[]>;
|
|
37
|
+
validate(_user: User, body: unknown): Promise<{
|
|
38
|
+
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
39
|
+
triggers: (import("../runtime/describe").TriggerSummary & {
|
|
40
|
+
text: import("@antelopejs/interface-dms/base").BlockText;
|
|
41
|
+
})[];
|
|
42
|
+
}>;
|
|
43
|
+
createFromStarter(_user: User, body: unknown): Promise<{
|
|
44
|
+
warning?: string;
|
|
45
|
+
_id: string;
|
|
46
|
+
}>;
|
|
47
|
+
importJson(_user: User, body: unknown): Promise<{
|
|
48
|
+
warning?: string;
|
|
49
|
+
_id: string;
|
|
50
|
+
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
51
|
+
}>;
|
|
52
|
+
getOne(_user: User, id: string): Promise<{
|
|
53
|
+
graph: ProcedureGraph;
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
version: number;
|
|
58
|
+
revision: number;
|
|
59
|
+
pausedAt?: Date;
|
|
60
|
+
pausedBy?: string;
|
|
61
|
+
attentionDismissedAt?: Date | null;
|
|
62
|
+
armErrors?: string;
|
|
63
|
+
created_at: Date;
|
|
64
|
+
updated_at: Date;
|
|
65
|
+
_id: string;
|
|
66
|
+
}>;
|
|
67
|
+
exportJson(_user: User, id: string): Promise<{
|
|
68
|
+
name: string;
|
|
69
|
+
description: string;
|
|
70
|
+
graph: ProcedureGraph;
|
|
71
|
+
}>;
|
|
72
|
+
duplicate(_user: User, id: string): Promise<{
|
|
73
|
+
_id: string;
|
|
74
|
+
}>;
|
|
75
|
+
update(user: User, id: string, body: unknown): Promise<{
|
|
10
76
|
_id: string;
|
|
77
|
+
version: number;
|
|
78
|
+
revision: number;
|
|
79
|
+
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
11
80
|
}>;
|
|
12
|
-
|
|
81
|
+
setEnabled(user: User, id: string, body: unknown): Promise<{
|
|
82
|
+
_id: string;
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
revision: number | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
dismissAttention(_user: User, id: string): Promise<{
|
|
87
|
+
_id: string;
|
|
88
|
+
}>;
|
|
89
|
+
undoDismissAttention(_user: User, id: string): Promise<{
|
|
13
90
|
_id: string;
|
|
14
91
|
}>;
|
|
15
92
|
remove(_user: User, id: string): Promise<{
|
|
16
93
|
_id: string;
|
|
17
94
|
}>;
|
|
18
|
-
|
|
95
|
+
deleteConfirm(_user: User, id: string): Promise<import("@antelopejs/interface-dms/base").ConfirmDialogSerialized>;
|
|
96
|
+
runNow(_user: User, id: string, body: unknown): Promise<{
|
|
97
|
+
runId: string;
|
|
98
|
+
status: string;
|
|
99
|
+
warning: string;
|
|
100
|
+
} | {
|
|
101
|
+
runId: string;
|
|
102
|
+
status: string;
|
|
103
|
+
warning?: undefined;
|
|
104
|
+
}>;
|
|
105
|
+
test(_user: User, id: string, body: unknown): Promise<{
|
|
106
|
+
runId: string;
|
|
107
|
+
status: string;
|
|
108
|
+
warning: string;
|
|
109
|
+
} | {
|
|
19
110
|
runId: string;
|
|
111
|
+
status: string;
|
|
112
|
+
warning?: undefined;
|
|
113
|
+
}>;
|
|
114
|
+
lastPayload(_user: User, id: string, triggerNodeId?: string): Promise<{
|
|
115
|
+
last: {
|
|
116
|
+
runId: string;
|
|
117
|
+
triggerNodeId: string;
|
|
118
|
+
startedAt: string;
|
|
119
|
+
payload: unknown;
|
|
120
|
+
};
|
|
121
|
+
tooLarge: boolean;
|
|
122
|
+
} | {
|
|
123
|
+
last: null;
|
|
124
|
+
tooLarge: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
triggers(_user: User, id: string): Promise<{
|
|
127
|
+
triggers: {
|
|
128
|
+
nextAt: string | null;
|
|
129
|
+
nodeId: string;
|
|
130
|
+
typeId: string;
|
|
131
|
+
typeName: string;
|
|
132
|
+
method?: string;
|
|
133
|
+
path?: string;
|
|
134
|
+
cron?: string;
|
|
135
|
+
timeZone?: string;
|
|
136
|
+
text: import("@antelopejs/interface-dms/base").BlockText;
|
|
137
|
+
}[];
|
|
20
138
|
}>;
|
|
21
139
|
runs(_user: User, id: string, page?: string, limit?: string): Promise<import("../db").RunSummary[]>;
|
|
22
140
|
}
|