@antelopejs/dms-automation 0.7.0 → 0.8.0
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 +19 -5
- package/dist/cluster/bus.js +8 -6
- package/dist/cluster/bus.js.map +1 -1
- package/dist/cluster/leader.js.map +1 -1
- package/dist/data/procedures-query.d.ts +19 -0
- package/dist/data/procedures-query.js +105 -0
- package/dist/data/procedures-query.js.map +1 -0
- package/dist/data/procedures-table.d.ts +4 -20
- package/dist/data/procedures-table.js +10 -106
- package/dist/data/procedures-table.js.map +1 -1
- package/dist/data/runs-table.js.map +1 -1
- package/dist/db/models/automation_template.model.d.ts +2 -4
- package/dist/db/models/automation_template.model.js +13 -14
- package/dist/db/models/automation_template.model.js.map +1 -1
- package/dist/db/models/procedure_run.model.js.map +1 -1
- package/dist/db/models/stats.model.js.map +1 -1
- package/dist/db/tables/procedure_run.table.d.ts +2 -1
- package/dist/db/tables/procedure_run.table.js.map +1 -1
- package/dist/implementations/dms-automation/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/category.js.map +1 -1
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/procedures.js.map +1 -1
- package/dist/pages/runs.js.map +1 -1
- package/dist/pages/shared.js +1 -1
- package/dist/pages/shared.js.map +1 -1
- package/dist/realtime.d.ts +2 -1
- package/dist/realtime.js.map +1 -1
- package/dist/routes/action-types.d.ts +2 -1
- package/dist/routes/action-types.js.map +1 -1
- package/dist/routes/deleteConfirm.js +4 -3
- package/dist/routes/deleteConfirm.js.map +1 -1
- package/dist/routes/graphSchema.d.ts +2 -1
- package/dist/routes/graphSchema.js +8 -7
- package/dist/routes/graphSchema.js.map +1 -1
- package/dist/routes/procedureChecks.js +5 -5
- package/dist/routes/procedureChecks.js.map +1 -1
- package/dist/routes/procedureRuns.d.ts +2 -2
- package/dist/routes/procedureRuns.js +1 -1
- package/dist/routes/procedureRuns.js.map +1 -1
- package/dist/routes/procedures.d.ts +14 -13
- package/dist/routes/procedures.js +2 -1
- package/dist/routes/procedures.js.map +1 -1
- package/dist/routes/requests.d.ts +11 -5
- package/dist/routes/requests.js.map +1 -1
- package/dist/routes/runs.d.ts +7 -7
- package/dist/routes/runs.js +5 -3
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/stats.js.map +1 -1
- package/dist/routes/templates.d.ts +3 -2
- package/dist/routes/templates.js +2 -1
- package/dist/routes/templates.js.map +1 -1
- package/dist/routes/trigger-types.d.ts +2 -1
- package/dist/routes/trigger-types.js.map +1 -1
- package/dist/routes/typeConfigShared.d.ts +2 -1
- package/dist/routes/typeConfigShared.js.map +1 -1
- package/dist/runtime/armErrors.d.ts +0 -1
- package/dist/runtime/armErrors.js +0 -7
- package/dist/runtime/armErrors.js.map +1 -1
- package/dist/runtime/boundRunLog.d.ts +1 -0
- package/dist/runtime/boundRunLog.js +11 -11
- package/dist/runtime/boundRunLog.js.map +1 -1
- package/dist/runtime/builtins/actions/http.js +16 -9
- package/dist/runtime/builtins/actions/http.js.map +1 -1
- package/dist/runtime/builtins/actions/log.js.map +1 -1
- package/dist/runtime/builtins/data/boolean.js +4 -5
- package/dist/runtime/builtins/data/boolean.js.map +1 -1
- package/dist/runtime/builtins/data/compare.js +8 -10
- package/dist/runtime/builtins/data/compare.js.map +1 -1
- package/dist/runtime/builtins/data/constant.js +1 -1
- package/dist/runtime/builtins/data/constant.js.map +1 -1
- package/dist/runtime/builtins/data/json.js +4 -5
- package/dist/runtime/builtins/data/json.js.map +1 -1
- package/dist/runtime/builtins/data/math.js +4 -4
- package/dist/runtime/builtins/data/math.js.map +1 -1
- package/dist/runtime/builtins/data/object.js +12 -17
- package/dist/runtime/builtins/data/object.js.map +1 -1
- package/dist/runtime/builtins/data/string.js +13 -18
- package/dist/runtime/builtins/data/string.js.map +1 -1
- package/dist/runtime/builtins/nodes/action.js +5 -2
- package/dist/runtime/builtins/nodes/action.js.map +1 -1
- package/dist/runtime/builtins/nodes/data.js +2 -2
- package/dist/runtime/builtins/nodes/data.js.map +1 -1
- package/dist/runtime/builtins/nodes/delay.js +2 -2
- package/dist/runtime/builtins/nodes/delay.js.map +1 -1
- package/dist/runtime/builtins/nodes/forRange.js +2 -2
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
- package/dist/runtime/builtins/nodes/foreach.js +2 -2
- package/dist/runtime/builtins/nodes/foreach.js.map +1 -1
- package/dist/runtime/builtins/nodes/groupInput.js +2 -2
- package/dist/runtime/builtins/nodes/groupInput.js.map +1 -1
- package/dist/runtime/builtins/nodes/groupOutput.js +2 -2
- package/dist/runtime/builtins/nodes/groupOutput.js.map +1 -1
- package/dist/runtime/builtins/nodes/if.js +2 -2
- package/dist/runtime/builtins/nodes/if.js.map +1 -1
- package/dist/runtime/builtins/nodes/parallel.js +2 -2
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
- package/dist/runtime/builtins/nodes/retry.js +5 -4
- package/dist/runtime/builtins/nodes/retry.js.map +1 -1
- package/dist/runtime/builtins/nodes/setVariable.js +2 -2
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
- package/dist/runtime/builtins/nodes/switch.js +2 -2
- package/dist/runtime/builtins/nodes/switch.js.map +1 -1
- package/dist/runtime/builtins/nodes/trigger.js +2 -2
- package/dist/runtime/builtins/nodes/trigger.js.map +1 -1
- package/dist/runtime/builtins/nodes/tryCatch.js +2 -2
- package/dist/runtime/builtins/nodes/tryCatch.js.map +1 -1
- package/dist/runtime/builtins/triggers/cron.d.ts +2 -1
- package/dist/runtime/builtins/triggers/cron.js +5 -7
- package/dist/runtime/builtins/triggers/cron.js.map +1 -1
- package/dist/runtime/builtins/triggers/webhook.d.ts +6 -5
- package/dist/runtime/builtins/triggers/webhook.js +9 -6
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
- package/dist/runtime/declaredProcedures.d.ts +2 -2
- package/dist/runtime/declaredProcedures.js +3 -2
- package/dist/runtime/declaredProcedures.js.map +1 -1
- package/dist/runtime/describe.js +11 -10
- package/dist/runtime/describe.js.map +1 -1
- package/dist/runtime/executor.js +10 -7
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/flatten.d.ts +1 -1
- package/dist/runtime/flatten.js +1 -1
- package/dist/runtime/flatten.js.map +1 -1
- package/dist/runtime/graphIssues.js +24 -22
- package/dist/runtime/graphIssues.js.map +1 -1
- package/dist/runtime/graphVersion.d.ts +1 -1
- package/dist/runtime/graphVersion.js +2 -1
- package/dist/runtime/graphVersion.js.map +1 -1
- package/dist/runtime/nodeKinds.d.ts +3 -2
- package/dist/runtime/nodeKinds.js.map +1 -1
- package/dist/runtime/reconcile.d.ts +3 -0
- package/dist/runtime/reconcile.js +178 -0
- package/dist/runtime/reconcile.js.map +1 -0
- package/dist/runtime/resolveInputs.d.ts +4 -2
- package/dist/runtime/resolveInputs.js +13 -12
- package/dist/runtime/resolveInputs.js.map +1 -1
- package/dist/runtime/resolveSubgraph.js +4 -5
- package/dist/runtime/resolveSubgraph.js.map +1 -1
- package/dist/runtime/retention.js.map +1 -1
- package/dist/runtime/runProcedure.d.ts +1 -1
- package/dist/runtime/runProcedure.js +2 -1
- package/dist/runtime/runProcedure.js.map +1 -1
- package/dist/runtime/schedule.js +3 -0
- package/dist/runtime/schedule.js.map +1 -1
- package/dist/runtime/schemaProperties.d.ts +11 -0
- package/dist/runtime/schemaProperties.js +7 -0
- package/dist/runtime/schemaProperties.js.map +1 -0
- package/dist/runtime/serialQueue.d.ts +1 -1
- package/dist/runtime/serialQueue.js +4 -4
- package/dist/runtime/serialQueue.js.map +1 -1
- package/dist/runtime/subscriptions.js +21 -180
- package/dist/runtime/subscriptions.js.map +1 -1
- package/dist/runtime/subwalk.js.map +1 -1
- package/dist/runtime/templateCacheState.d.ts +6 -0
- package/dist/runtime/templateCacheState.js +10 -0
- package/dist/runtime/templateCacheState.js.map +1 -0
- package/dist/runtime/templateUsages.js +4 -5
- package/dist/runtime/templateUsages.js.map +1 -1
- package/dist/runtime/topo.js +2 -4
- package/dist/runtime/topo.js.map +1 -1
- package/dist/runtime/trace.js +12 -9
- package/dist/runtime/trace.js.map +1 -1
- package/dist/runtime/triggerHandles.d.ts +3 -0
- package/dist/runtime/triggerHandles.js +8 -0
- package/dist/runtime/triggerHandles.js.map +1 -1
- package/dist/runtime/typeOrigin.js +12 -1
- package/dist/runtime/typeOrigin.js.map +1 -1
- package/dist/runtime/validate.js.map +1 -1
- package/dist/runtime/validateTemplate.js.map +1 -1
- package/dist/runtime/withTimeout.js.map +1 -1
- package/dist/runtime/wording.js +12 -8
- package/dist/runtime/wording.js.map +1 -1
- package/dist/stats/health-banner.js.map +1 -1
- package/dist/stats/health.js.map +1 -1
- package/dist/stats/kpi.js +1 -1
- package/dist/stats/kpi.js.map +1 -1
- package/dist/stats/overview.js +2 -1
- package/dist/stats/overview.js.map +1 -1
- package/dist/types/dataValue.d.ts +8 -0
- package/dist/types/dataValue.js +36 -0
- package/dist/types/dataValue.js.map +1 -0
- package/dist/types/graph.d.ts +8 -1
- package/dist/types/graph.js +8 -0
- package/dist/types/graph.js.map +1 -1
- package/dist/types/guards.d.ts +8 -0
- package/dist/types/guards.js +35 -0
- package/dist/types/guards.js.map +1 -0
- package/frontend-vue/app/build/components/editor/EditorBanners.vue +120 -0
- package/frontend-vue/app/build/components/editor/EditorChoiceModal.vue +44 -0
- package/frontend-vue/app/build/components/editor/EditorForkModal.vue +51 -0
- package/frontend-vue/app/build/components/editor/EditorHeader.vue +146 -0
- package/frontend-vue/app/build/components/editor/EditorSaveTemplateModal.vue +105 -0
- package/frontend-vue/app/build/components/editor/NodeInspectorDocs.vue +28 -0
- package/frontend-vue/app/build/components/editor/NodeInspectorRun.vue +48 -0
- package/frontend-vue/app/build/composables/editor/useBuilderMount.ts +129 -0
- package/frontend-vue/app/build/composables/editor/useBuilderSave.ts +256 -0
- package/frontend-vue/app/build/composables/editor/useBuilderShortcuts.ts +270 -0
- package/frontend-vue/app/build/composables/editor/useDraftProblems.ts +288 -0
- package/frontend-vue/app/build/composables/editor/useEditorContext.ts +388 -0
- package/frontend-vue/app/build/composables/editor/useEditorLoad.ts +158 -0
- package/frontend-vue/app/build/composables/editor/useForkToLocal.ts +193 -0
- package/frontend-vue/app/build/composables/editor/useGraphHistory.ts +113 -0
- package/frontend-vue/app/build/composables/editor/useGroupEditing.ts +445 -0
- package/frontend-vue/app/build/composables/editor/usePalette.ts +41 -0
- package/frontend-vue/app/build/composables/editor/useProcedureActions.ts +96 -0
- package/frontend-vue/app/build/composables/editor/useRunOverlay.ts +466 -0
- package/frontend-vue/app/build/composables/editor/useSaveAsTemplate.ts +172 -0
- package/frontend-vue/app/build/composables/editor/useSavedTriggers.ts +100 -0
- package/frontend-vue/app/build/composables/editor/useSubgraphNavigation.ts +270 -0
- package/frontend-vue/app/build/composables/editor/useUnsavedGuards.ts +233 -0
- package/frontend-vue/app/build/composables/graphCanvas/connect.ts +273 -0
- package/frontend-vue/app/build/composables/graphCanvas/edgeEvents.ts +172 -0
- package/frontend-vue/app/build/composables/graphCanvas/edges.ts +55 -0
- package/frontend-vue/app/build/composables/graphCanvas/handles.ts +181 -0
- package/frontend-vue/app/build/composables/graphCanvas/linkMenu.ts +123 -0
- package/frontend-vue/app/build/composables/graphCanvas/nodeData.ts +222 -0
- package/frontend-vue/app/build/composables/graphCanvas/placement.ts +248 -0
- package/frontend-vue/app/build/composables/graphCanvas/selection.ts +150 -0
- package/frontend-vue/app/build/composables/graphCanvas/types.ts +188 -0
- package/frontend-vue/app/build/composables/graphCanvas/view.ts +230 -0
- package/frontend-vue/app/build/types/editor.ts +94 -0
- package/frontend-vue/app/build/utils/editor/apiErrors.ts +74 -0
- package/frontend-vue/app/build/utils/editor/graphShape.ts +68 -0
- package/frontend-vue/app/build/utils/editor/groupPlan.ts +322 -0
- package/frontend-vue/app/build/utils/editor/groupPorts.ts +210 -0
- package/frontend-vue/app/build/utils/editor/keyboard.ts +22 -0
- package/frontend-vue/app/build/utils/inspectorFields.ts +117 -0
- package/frontend-vue/app/build/utils/templates.ts +88 -0
- package/frontend-vue/app/components/AttentionList.vue +2 -6
- package/frontend-vue/app/components/Catalog.vue +2 -1
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +78 -1337
- package/frontend-vue/app/components/Editor/NodeInspector.vue +31 -123
- package/frontend-vue/app/components/Editor.vue +134 -3484
- package/frontend-vue/app/components/Templates.vue +14 -84
- package/frontend-vue/build/backend-boundary.ts +122 -0
- package/frontend-vue/dms.frontend.build.ts +2 -0
- package/frontend-vue/eslint-rules/index.mjs +103 -0
- package/frontend-vue/eslint.config.mjs +15 -0
- package/frontend-vue/package.json +7 -4
- package/frontend-vue/pnpm-lock.yaml +73 -59
- package/frontend-vue/tests/api-error-presentation.test.cjs +257 -0
- package/frontend-vue/tests/helpers/setup.cjs +44 -0
- package/package.json +4 -4
- package/skills/dms-automation/SKILL.md +2 -2
- package/skills/dms-automation/cases.json +58 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DataNodeType,
|
|
3
|
+
JsonSchema,
|
|
4
|
+
JsonSchemaProperty,
|
|
5
|
+
} from "../../composables/useGraphConnect";
|
|
6
|
+
|
|
7
|
+
export function portsSchema(
|
|
8
|
+
ports: Array<{ name: string; type?: string }>,
|
|
9
|
+
): JsonSchema {
|
|
10
|
+
return {
|
|
11
|
+
properties: Object.fromEntries(
|
|
12
|
+
ports.map((p) => [p.name, p.type ? { type: p.type } : {}]),
|
|
13
|
+
),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function asString(v: unknown): string {
|
|
18
|
+
if (v === undefined || v === null) return "";
|
|
19
|
+
if (typeof v === "string") return v;
|
|
20
|
+
return String(v);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function asNumber(v: unknown): number | undefined {
|
|
24
|
+
if (v === undefined || v === null || v === "") return undefined;
|
|
25
|
+
const n = Number(v);
|
|
26
|
+
return Number.isNaN(n) ? undefined : n;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function asBool(v: unknown): boolean {
|
|
30
|
+
return !!v;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Returns true if `prop.type` is `"string"` OR an array of scalar types that
|
|
34
|
+
// includes `"string"`. Used to render a plain string input instead of a JSON
|
|
35
|
+
// textarea for multi-type fields like compare-node ports. A type that also
|
|
36
|
+
// takes an object or an array (an HTTP body) keeps the JSON editor, which
|
|
37
|
+
// still accepts plain text.
|
|
38
|
+
export function isStringish(prop: JsonSchemaProperty): boolean {
|
|
39
|
+
const t = prop.type;
|
|
40
|
+
if (t === "string") return true;
|
|
41
|
+
if (Array.isArray(t))
|
|
42
|
+
return (
|
|
43
|
+
t.includes("string") && !t.includes("object") && !t.includes("array")
|
|
44
|
+
);
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function isNumberish(prop: JsonSchemaProperty): boolean {
|
|
49
|
+
const t = prop.type;
|
|
50
|
+
if (t === "number" || t === "integer") return true;
|
|
51
|
+
if (
|
|
52
|
+
Array.isArray(t) &&
|
|
53
|
+
(t.includes("number") || t.includes("integer")) &&
|
|
54
|
+
!t.includes("string")
|
|
55
|
+
)
|
|
56
|
+
return true;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isBoolish(prop: JsonSchemaProperty): boolean {
|
|
61
|
+
const t = prop.type;
|
|
62
|
+
if (t === "boolean") return true;
|
|
63
|
+
if (
|
|
64
|
+
Array.isArray(t) &&
|
|
65
|
+
t.includes("boolean") &&
|
|
66
|
+
!t.includes("string") &&
|
|
67
|
+
!t.includes("number")
|
|
68
|
+
)
|
|
69
|
+
return true;
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function arrayToText(v: unknown): string {
|
|
74
|
+
if (Array.isArray(v)) return v.map((x) => String(x)).join("\n");
|
|
75
|
+
if (typeof v === "string") return v;
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function textToArray(s: string): string[] {
|
|
80
|
+
return s
|
|
81
|
+
.split("\n")
|
|
82
|
+
.map((x) => x.trim())
|
|
83
|
+
.filter((x) => x.length > 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* A data node's form: its input schema (wired-port fields) merged with its
|
|
88
|
+
* config schema (in-place config fields, e.g. a constant's value). The config
|
|
89
|
+
* schema wins on key collisions; a node declaring only one schema is unaffected.
|
|
90
|
+
*/
|
|
91
|
+
export function dataNodeSchema(t: DataNodeType): JsonSchema | null {
|
|
92
|
+
if (!t.configSchema) return t.inputSchema ?? null;
|
|
93
|
+
return {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
...(t.inputSchema?.properties ?? {}),
|
|
97
|
+
...(t.configSchema.properties ?? {}),
|
|
98
|
+
},
|
|
99
|
+
required: [
|
|
100
|
+
...(t.inputSchema?.required ?? []),
|
|
101
|
+
...(t.configSchema.required ?? []),
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** A field key in words: "maxAttempts" becomes "Max attempts". */
|
|
107
|
+
export function nameInWords(name: string): string {
|
|
108
|
+
const words = name
|
|
109
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
110
|
+
.replace(/[_-]+/g, " ")
|
|
111
|
+
.toLowerCase()
|
|
112
|
+
.replace(
|
|
113
|
+
/\b(id|url)(s?)\b/g,
|
|
114
|
+
(_, word: string, plural: string) => word.toUpperCase() + plural,
|
|
115
|
+
);
|
|
116
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
117
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface JsonSchema {
|
|
2
|
+
type?: string | string[];
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface TemplatePort {
|
|
7
|
+
name: string;
|
|
8
|
+
kind: "data" | "trigger";
|
|
9
|
+
direction: "in" | "out";
|
|
10
|
+
schema?: JsonSchema;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TemplateRow {
|
|
14
|
+
_id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
ports: TemplatePort[];
|
|
19
|
+
subgraph: unknown;
|
|
20
|
+
usageCount?: number;
|
|
21
|
+
updated_at?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TemplateUsage {
|
|
25
|
+
procedureId: string;
|
|
26
|
+
nodeId: string;
|
|
27
|
+
groupPath: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TemplateNesting {
|
|
31
|
+
templateId: string;
|
|
32
|
+
nodeId: string;
|
|
33
|
+
groupPath: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TemplateUsages {
|
|
37
|
+
procedures: TemplateUsage[];
|
|
38
|
+
templates: TemplateNesting[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ProcedureSummary {
|
|
42
|
+
procedureId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
status: "failing" | "degraded" | "healthy" | "paused" | "draft";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface UsageRow {
|
|
48
|
+
kind: "procedure" | "template";
|
|
49
|
+
id: string;
|
|
50
|
+
first: TemplateUsage | TemplateNesting;
|
|
51
|
+
count: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** One line per procedure or template placing it, with how many times. */
|
|
55
|
+
export function usageRowsOf(usages: TemplateUsages): UsageRow[] {
|
|
56
|
+
const rows = new Map<string, UsageRow>();
|
|
57
|
+
for (const usage of usages.procedures) {
|
|
58
|
+
const row = rows.get(`p:${usage.procedureId}`);
|
|
59
|
+
if (row) row.count++;
|
|
60
|
+
else
|
|
61
|
+
rows.set(`p:${usage.procedureId}`, {
|
|
62
|
+
kind: "procedure",
|
|
63
|
+
id: usage.procedureId,
|
|
64
|
+
first: usage,
|
|
65
|
+
count: 1,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
for (const nesting of usages.templates) {
|
|
69
|
+
const row = rows.get(`t:${nesting.templateId}`);
|
|
70
|
+
if (row) row.count++;
|
|
71
|
+
else
|
|
72
|
+
rows.set(`t:${nesting.templateId}`, {
|
|
73
|
+
kind: "template",
|
|
74
|
+
id: nesting.templateId,
|
|
75
|
+
first: nesting,
|
|
76
|
+
count: 1,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return [...rows.values()];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function schemaTypeOf(p: TemplatePort): string {
|
|
83
|
+
if (p.kind !== "data") return "—";
|
|
84
|
+
const type = p.schema?.type;
|
|
85
|
+
if (typeof type === "string") return type;
|
|
86
|
+
if (Array.isArray(type)) return type.join(" | ");
|
|
87
|
+
return "any";
|
|
88
|
+
}
|
|
@@ -46,6 +46,7 @@ const { processI18n } = useTranslation()
|
|
|
46
46
|
const { t, te } = useI18n()
|
|
47
47
|
const { dateTimeFormat } = useRegionalFormat()
|
|
48
48
|
const toast = useToast()
|
|
49
|
+
const { presentError } = useApiErrorPresenter()
|
|
49
50
|
|
|
50
51
|
// Read like the DMS cards: over the page's period, on its refreshes, through
|
|
51
52
|
// its Live / Pause.
|
|
@@ -108,12 +109,7 @@ interface Change {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
function failed(e: unknown) {
|
|
111
|
-
|
|
112
|
-
title: processI18n('$dms_automation.common.actionFailed'),
|
|
113
|
-
description: describeApiError(e),
|
|
114
|
-
color: 'error',
|
|
115
|
-
icon: 'i-ph-warning',
|
|
116
|
-
})
|
|
112
|
+
presentError(e, { fallbackKey: 'dms_automation.common.actionFailed' })
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
/**
|
|
@@ -80,6 +80,7 @@ const { processI18n } = useTranslation()
|
|
|
80
80
|
const { processText } = useComposedText()
|
|
81
81
|
const { t, te } = useI18n()
|
|
82
82
|
const toast = useToast()
|
|
83
|
+
const { presentError } = useApiErrorPresenter()
|
|
83
84
|
const { confirm } = useConfirm()
|
|
84
85
|
const route = useDmsRoute()
|
|
85
86
|
const router = useDmsRouter()
|
|
@@ -256,7 +257,7 @@ async function setEnabled(enabled: boolean) {
|
|
|
256
257
|
icon: 'i-ph-check-circle',
|
|
257
258
|
})
|
|
258
259
|
} catch (e) {
|
|
259
|
-
|
|
260
|
+
presentError(e, { fallbackKey: 'dms_automation.common.actionFailed' })
|
|
260
261
|
} finally {
|
|
261
262
|
saving.value = false
|
|
262
263
|
}
|