@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-automation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"@antelopejs/interface-api": ">=0.0.14 <1.0.0",
|
|
33
33
|
"@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
|
|
34
34
|
"@antelopejs/interface-core": ">=0.1.1 <1.0.0",
|
|
35
|
-
"@antelopejs/interface-data-api": ">=0.
|
|
35
|
+
"@antelopejs/interface-data-api": ">=0.2.0 <1.0.0",
|
|
36
36
|
"@antelopejs/interface-database": ">=0.1.8 <1.0.0",
|
|
37
37
|
"@antelopejs/interface-database-decorators": ">=0.1.7 <1.0.0",
|
|
38
|
-
"@antelopejs/interface-dms": ">=0.
|
|
39
|
-
"@antelopejs/interface-dms-automation": ">=0.
|
|
38
|
+
"@antelopejs/interface-dms": ">=0.6.0 <1.0.0",
|
|
39
|
+
"@antelopejs/interface-dms-automation": ">=0.2.0 <0.3.0",
|
|
40
40
|
"defu": "^6.1.4",
|
|
41
41
|
"node-cron": "^4.2.1",
|
|
42
42
|
"zod": "^3.25.76"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antelopejs/core": "1.
|
|
45
|
+
"@antelopejs/core": "1.13.5",
|
|
46
46
|
"@antelopejs/tooling-configs": ">=0.0.7 <1.0.0",
|
|
47
47
|
"@types/node": "^24.0.0",
|
|
48
48
|
"@types/node-cron": "^3.0.11",
|
|
@@ -66,11 +66,13 @@
|
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "pnpm --filter @antelopejs/interface-dms-automation build && rimraf dist && tsc",
|
|
69
|
+
"test": "pnpm run build && node --test tests/*.test.cjs",
|
|
69
70
|
"test:frontend-registration": "pnpm run build && node --test tests/frontend-registration.test.cjs",
|
|
70
|
-
"test:release-script": "node --test tests/release-script.test.cjs",
|
|
71
71
|
"test:run-storage": "pnpm run build && node --test tests/run-storage.test.cjs",
|
|
72
|
+
"test:runs-display": "pnpm run build && node --test tests/runs-display.test.cjs",
|
|
72
73
|
"test:type-origin": "pnpm run build && node --test tests/type-origin.test.cjs",
|
|
73
74
|
"test:type-display": "node --test tests/type-display.test.cjs",
|
|
75
|
+
"test:unit": "pnpm run build && node --test tests/health.test.cjs tests/kpi.test.cjs tests/graph-issues.test.cjs tests/trace.test.cjs tests/schedule.test.cjs tests/pages.test.cjs tests/procedures-page.test.cjs tests/wording.test.cjs tests/health-banner.test.cjs tests/runtime-nodes.test.cjs tests/runs-api.test.cjs tests/run-detail.test.cjs tests/graph-connect.test.cjs tests/library.test.cjs tests/template-delete.test.cjs tests/overview.test.cjs",
|
|
74
76
|
"dev": "ajs project run -w -p playground",
|
|
75
77
|
"lint": "oxlint && oxfmt --check . && cd frontend-vue && pnpm lint && antelopejs-check-interface-ranges",
|
|
76
78
|
"typecheck": "pnpm --filter @antelopejs/interface-dms-automation typecheck && tsc --noEmit",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ActionTypeConfig } from "../tables/action_type_config.table";
|
|
2
|
-
import { TriggerTypeConfig } from "../tables/trigger_type_config.table";
|
|
3
|
-
declare const TriggerTypeConfigModel_base: {
|
|
4
|
-
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
5
|
-
readonly table: import("@antelopejs/interface-database").Table<TriggerTypeConfig>;
|
|
6
|
-
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
7
|
-
get(id: string): PromiseLike<TriggerTypeConfig | undefined>;
|
|
8
|
-
getBy(index: keyof TriggerTypeConfig, ...keys: any[]): PromiseLike<TriggerTypeConfig[]>;
|
|
9
|
-
getAll(): PromiseLike<TriggerTypeConfig[]>;
|
|
10
|
-
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<TriggerTypeConfig> | import("@antelopejs/interface-database-decorators").DeepPartial<TriggerTypeConfig>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
11
|
-
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<TriggerTypeConfig>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
-
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<TriggerTypeConfig>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
13
|
-
delete(id: string): Promise<number>;
|
|
14
|
-
};
|
|
15
|
-
readonly schemaName: string;
|
|
16
|
-
fromPlainData(obj: any): TriggerTypeConfig;
|
|
17
|
-
fromDatabase(obj: any): TriggerTypeConfig | undefined;
|
|
18
|
-
toDatabase(obj: any): Record<string, any>;
|
|
19
|
-
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
20
|
-
};
|
|
21
|
-
export declare class TriggerTypeConfigModel extends TriggerTypeConfigModel_base {
|
|
22
|
-
getByTypeId(typeId: string): Promise<TriggerTypeConfig | undefined>;
|
|
23
|
-
upsertByTypeId(typeId: string, patch: Partial<Omit<TriggerTypeConfig, "_id" | "typeId">>): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
declare const ActionTypeConfigModel_base: {
|
|
26
|
-
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
27
|
-
readonly table: import("@antelopejs/interface-database").Table<ActionTypeConfig>;
|
|
28
|
-
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
29
|
-
get(id: string): PromiseLike<ActionTypeConfig | undefined>;
|
|
30
|
-
getBy(index: keyof ActionTypeConfig, ...keys: any[]): PromiseLike<ActionTypeConfig[]>;
|
|
31
|
-
getAll(): PromiseLike<ActionTypeConfig[]>;
|
|
32
|
-
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<ActionTypeConfig> | import("@antelopejs/interface-database-decorators").DeepPartial<ActionTypeConfig>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
33
|
-
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<ActionTypeConfig>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
34
|
-
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<ActionTypeConfig>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
35
|
-
delete(id: string): Promise<number>;
|
|
36
|
-
};
|
|
37
|
-
readonly schemaName: string;
|
|
38
|
-
fromPlainData(obj: any): ActionTypeConfig;
|
|
39
|
-
fromDatabase(obj: any): ActionTypeConfig | undefined;
|
|
40
|
-
toDatabase(obj: any): Record<string, any>;
|
|
41
|
-
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
42
|
-
};
|
|
43
|
-
export declare class ActionTypeConfigModel extends ActionTypeConfigModel_base {
|
|
44
|
-
getByTypeId(typeId: string): Promise<ActionTypeConfig | undefined>;
|
|
45
|
-
upsertByTypeId(typeId: string, patch: Partial<Omit<ActionTypeConfig, "_id" | "typeId">>): Promise<void>;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionTypeConfigModel = exports.TriggerTypeConfigModel = void 0;
|
|
4
|
-
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
-
const action_type_config_table_1 = require("../tables/action_type_config.table");
|
|
6
|
-
const trigger_type_config_table_1 = require("../tables/trigger_type_config.table");
|
|
7
|
-
class TriggerTypeConfigModel extends (0, interface_database_decorators_1.BasicDataModel)(trigger_type_config_table_1.TriggerTypeConfig, trigger_type_config_table_1.triggerTypeConfigsTableName) {
|
|
8
|
-
async getByTypeId(typeId) {
|
|
9
|
-
const results = await this.table
|
|
10
|
-
.filter((doc) => doc.key("typeId").eq(typeId))
|
|
11
|
-
.run();
|
|
12
|
-
return results[0];
|
|
13
|
-
}
|
|
14
|
-
async upsertByTypeId(typeId, patch) {
|
|
15
|
-
const existing = await this.getByTypeId(typeId);
|
|
16
|
-
if (existing) {
|
|
17
|
-
await this.update(existing._id, patch);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
await this.insert({
|
|
21
|
-
typeId,
|
|
22
|
-
enabled: patch.enabled ?? false,
|
|
23
|
-
config: patch.config ?? "{}",
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.TriggerTypeConfigModel = TriggerTypeConfigModel;
|
|
29
|
-
class ActionTypeConfigModel extends (0, interface_database_decorators_1.BasicDataModel)(action_type_config_table_1.ActionTypeConfig, action_type_config_table_1.actionTypeConfigsTableName) {
|
|
30
|
-
async getByTypeId(typeId) {
|
|
31
|
-
const results = await this.table
|
|
32
|
-
.filter((doc) => doc.key("typeId").eq(typeId))
|
|
33
|
-
.run();
|
|
34
|
-
return results[0];
|
|
35
|
-
}
|
|
36
|
-
async upsertByTypeId(typeId, patch) {
|
|
37
|
-
const existing = await this.getByTypeId(typeId);
|
|
38
|
-
if (existing) {
|
|
39
|
-
await this.update(existing._id, patch);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
await this.insert({
|
|
43
|
-
typeId,
|
|
44
|
-
enabled: patch.enabled ?? false,
|
|
45
|
-
config: patch.config ?? "{}",
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.ActionTypeConfigModel = ActionTypeConfigModel;
|
|
51
|
-
//# sourceMappingURL=type_config.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type_config.model.js","sourceRoot":"","sources":["../../../src/db/models/type_config.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,iFAG4C;AAC5C,mFAG6C;AAE7C,MAAa,sBAAuB,SAAQ,IAAA,8CAAc,EACxD,6CAAiB,EACjB,uDAA2B,CAC5B;IACC,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK;aAC7B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;aAC7C,GAAG,EAAE,CAAC;QACT,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,MAAc,EACd,KAAyD;QAEzD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,MAAM,CAAC;gBAChB,MAAM;gBACN,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK;gBAC/B,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA1BD,wDA0BC;AAED,MAAa,qBAAsB,SAAQ,IAAA,8CAAc,EACvD,2CAAgB,EAChB,qDAA0B,CAC3B;IACC,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK;aAC7B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;aAC7C,GAAG,EAAE,CAAC;QACT,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,MAAc,EACd,KAAwD;QAExD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,MAAM,CAAC;gBAChB,MAAM;gBACN,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK;gBAC/B,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA1BD,sDA0BC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ActionTypeConfig = exports.actionTypeConfigsTableName = void 0;
|
|
13
|
-
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
-
const constants_1 = require("../../types/constants");
|
|
15
|
-
exports.actionTypeConfigsTableName = "action_type_configs";
|
|
16
|
-
let ActionTypeConfig = class ActionTypeConfig extends interface_database_decorators_1.Table {
|
|
17
|
-
};
|
|
18
|
-
exports.ActionTypeConfig = ActionTypeConfig;
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, interface_database_decorators_1.Index)(),
|
|
21
|
-
(0, interface_database_decorators_1.Field)("string"),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], ActionTypeConfig.prototype, "typeId", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, interface_database_decorators_1.Field)("boolean"),
|
|
26
|
-
__metadata("design:type", Boolean)
|
|
27
|
-
], ActionTypeConfig.prototype, "enabled", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, interface_database_decorators_1.Field)("string"),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], ActionTypeConfig.prototype, "config", void 0);
|
|
32
|
-
exports.ActionTypeConfig = ActionTypeConfig = __decorate([
|
|
33
|
-
(0, interface_database_decorators_1.RegisterTable)(exports.actionTypeConfigsTableName, constants_1.SCHEMA_NAME)
|
|
34
|
-
], ActionTypeConfig);
|
|
35
|
-
//# sourceMappingURL=action_type_config.table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action_type_config.table.js","sourceRoot":"","sources":["../../../src/db/tables/action_type_config.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAKmD;AACnD,qDAAoD;AAEvC,QAAA,0BAA0B,GAAG,qBAAqB,CAAC;AAGzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,qCAAK;CAW1C,CAAA;AAXY,4CAAgB;AAGnB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gDACO;AAGf;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;iDACQ;AAIjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gDACO;2BAVZ,gBAAgB;IAD5B,IAAA,6CAAa,EAAC,kCAA0B,EAAE,uBAAW,CAAC;GAC1C,gBAAgB,CAW5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trigger_type_config.table.js","sourceRoot":"","sources":["../../../src/db/tables/trigger_type_config.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAKmD;AACnD,qDAAoD;AAEvC,QAAA,2BAA2B,GAAG,sBAAsB,CAAC;AAG3D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,qCAAK;CAW3C,CAAA;AAXY,8CAAiB;AAGpB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACO;AAGf;IADP,IAAA,qCAAK,EAAC,SAAS,CAAC;;kDACQ;AAIjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACO;4BAVZ,iBAAiB;IAD7B,IAAA,6CAAa,EAAC,mCAA2B,EAAE,uBAAW,CAAC;GAC3C,iBAAiB,CAW7B"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref } from 'vue'
|
|
3
|
-
import { type ListEnvelope, unwrapList } from '../utils/automation'
|
|
4
|
-
import type { ActionType } from '../composables/useGraphConnect'
|
|
5
|
-
|
|
6
|
-
// Actions list adds per-row catalog state (globalConfig/enabled) on top of
|
|
7
|
-
// the canonical ActionType.
|
|
8
|
-
type ActionTypeItem = ActionType & {
|
|
9
|
-
globalConfig?: string
|
|
10
|
-
enabled?: boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// `embedded` drops the page-head when this catalog is rendered inside a Library tab.
|
|
14
|
-
defineProps<{ embedded?: boolean }>()
|
|
15
|
-
|
|
16
|
-
const { $authFetch } = useAuthFetch()
|
|
17
|
-
const toast = useToast()
|
|
18
|
-
|
|
19
|
-
const items = ref<ActionTypeItem[]>([])
|
|
20
|
-
const loading = ref(false)
|
|
21
|
-
const loadError = ref<string | null>(null)
|
|
22
|
-
|
|
23
|
-
async function loadList() {
|
|
24
|
-
loading.value = true
|
|
25
|
-
loadError.value = null
|
|
26
|
-
try {
|
|
27
|
-
const data = await $authFetch<ActionTypeItem[] | ListEnvelope<ActionTypeItem>>(
|
|
28
|
-
'/api/automation/action-types',
|
|
29
|
-
)
|
|
30
|
-
items.value = unwrapList<ActionTypeItem>(data)
|
|
31
|
-
} catch (e) {
|
|
32
|
-
loadError.value = (e as Error).message ?? 'Failed to load action types'
|
|
33
|
-
} finally {
|
|
34
|
-
loading.value = false
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
await loadList()
|
|
39
|
-
|
|
40
|
-
const selectedId = ref<string | null>(items.value[0]?.id ?? null)
|
|
41
|
-
|
|
42
|
-
const selectedType = computed<ActionTypeItem | null>(
|
|
43
|
-
() => items.value.find((t) => t.id === selectedId.value) ?? null,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
const selectedConfig = computed(() => selectedType.value?.globalConfig ?? '{}')
|
|
47
|
-
const selectedEnabled = computed(() => selectedType.value?.enabled ?? true)
|
|
48
|
-
|
|
49
|
-
async function onSave(payload: { enabled: boolean; config: string }) {
|
|
50
|
-
if (!selectedType.value) return
|
|
51
|
-
const id = selectedType.value.id
|
|
52
|
-
try {
|
|
53
|
-
await $authFetch(`/api/automation/action-types/${id}/config`, {
|
|
54
|
-
method: 'PUT',
|
|
55
|
-
body: payload,
|
|
56
|
-
})
|
|
57
|
-
const idx = items.value.findIndex((t) => t.id === id)
|
|
58
|
-
if (idx >= 0) {
|
|
59
|
-
const current = items.value[idx]
|
|
60
|
-
if (current) {
|
|
61
|
-
items.value[idx] = {
|
|
62
|
-
...current,
|
|
63
|
-
enabled: payload.enabled,
|
|
64
|
-
globalConfig: payload.config,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
toast.add({
|
|
69
|
-
title: 'Action saved',
|
|
70
|
-
description: id,
|
|
71
|
-
color: 'success',
|
|
72
|
-
icon: 'i-ph-check-circle',
|
|
73
|
-
})
|
|
74
|
-
} catch (e) {
|
|
75
|
-
toast.add({
|
|
76
|
-
title: 'Failed to save action',
|
|
77
|
-
description: (e as Error).message ?? id,
|
|
78
|
-
color: 'error',
|
|
79
|
-
icon: 'i-ph-warning',
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<template>
|
|
86
|
-
<!-- Embedded in the library page, which fills the panel: from `lg` up the
|
|
87
|
-
list and the detail share the height and scroll inside; below, where
|
|
88
|
-
they stack, the catalog scrolls as a whole. -->
|
|
89
|
-
<div
|
|
90
|
-
:class="
|
|
91
|
-
embedded
|
|
92
|
-
? 'flex min-h-0 flex-1 flex-col gap-5 max-lg:overflow-y-auto'
|
|
93
|
-
: 'flex flex-col gap-6 p-4 sm:p-6'
|
|
94
|
-
"
|
|
95
|
-
>
|
|
96
|
-
<section v-if="!embedded" class="flex flex-wrap items-center gap-4">
|
|
97
|
-
<div
|
|
98
|
-
class="grid size-11 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary ring ring-primary/20"
|
|
99
|
-
>
|
|
100
|
-
<UIcon name="i-ph-gear" class="size-6" />
|
|
101
|
-
</div>
|
|
102
|
-
<div class="min-w-0 flex-1">
|
|
103
|
-
<h1 class="text-2xl font-semibold tracking-tight text-highlighted">
|
|
104
|
-
{{ $t('dms_automation.actions.title') }}
|
|
105
|
-
</h1>
|
|
106
|
-
<p class="text-sm text-muted">
|
|
107
|
-
{{ $t('dms_automation.actions.description') }}
|
|
108
|
-
</p>
|
|
109
|
-
</div>
|
|
110
|
-
<UButton
|
|
111
|
-
class="ml-auto"
|
|
112
|
-
color="neutral"
|
|
113
|
-
variant="outline"
|
|
114
|
-
icon="i-ph-arrows-clockwise"
|
|
115
|
-
:loading="loading"
|
|
116
|
-
@click="loadList"
|
|
117
|
-
>
|
|
118
|
-
{{ $t('dms_automation.common.refresh') }}
|
|
119
|
-
</UButton>
|
|
120
|
-
</section>
|
|
121
|
-
|
|
122
|
-
<UAlert
|
|
123
|
-
v-if="loadError"
|
|
124
|
-
color="error"
|
|
125
|
-
variant="subtle"
|
|
126
|
-
icon="i-ph-warning"
|
|
127
|
-
:title="$t('dms_automation.actions.loadError')"
|
|
128
|
-
:description="loadError"
|
|
129
|
-
/>
|
|
130
|
-
|
|
131
|
-
<div
|
|
132
|
-
class="grid grid-cols-1 gap-5 lg:min-h-0 lg:flex-1 lg:grid-cols-[minmax(280px,340px)_1fr]"
|
|
133
|
-
>
|
|
134
|
-
<DmsAutomationTypeList
|
|
135
|
-
:types="items"
|
|
136
|
-
:model-value="selectedId"
|
|
137
|
-
:title="$t('dms_automation.actions.listLabel')"
|
|
138
|
-
class="lg:min-h-0"
|
|
139
|
-
@update:model-value="selectedId = $event"
|
|
140
|
-
/>
|
|
141
|
-
<DmsAutomationTypeConfigForm
|
|
142
|
-
class="lg:min-h-0 lg:overflow-y-auto"
|
|
143
|
-
:type="selectedType"
|
|
144
|
-
:schema="selectedType?.inputSchema"
|
|
145
|
-
:saved-config="selectedConfig"
|
|
146
|
-
:saved-enabled="selectedEnabled"
|
|
147
|
-
@save="onSave"
|
|
148
|
-
/>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
</template>
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
import type { JsonSchema } from '../../composables/useGraphConnect'
|
|
4
|
-
|
|
5
|
-
interface CatalogType {
|
|
6
|
-
id: string
|
|
7
|
-
name: string
|
|
8
|
-
description?: string
|
|
9
|
-
icon?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// `schema` is the JSON schema of the selected type's configuration, read from
|
|
13
|
-
// whichever field the catalog exposes it under (trigger types: `configSchema`,
|
|
14
|
-
// action types: `inputSchema`). Rendered read-only next to the config editor.
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
type: CatalogType | null
|
|
17
|
-
schema?: JsonSchema
|
|
18
|
-
savedConfig: string | null
|
|
19
|
-
savedEnabled: boolean
|
|
20
|
-
}>()
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
(e: 'save', payload: { enabled: boolean; config: string }): void
|
|
24
|
-
}>()
|
|
25
|
-
|
|
26
|
-
// A type's `name` / `description` may be a `$`-prefixed DMS i18n key shipped
|
|
27
|
-
// in the declaring module's locales; plain text is shown as written.
|
|
28
|
-
const { processI18n } = useTranslation()
|
|
29
|
-
|
|
30
|
-
const enabled = ref<boolean>(props.savedEnabled)
|
|
31
|
-
const configText = ref<string>(props.savedConfig ?? '{}')
|
|
32
|
-
const parseError = ref<string | null>(null)
|
|
33
|
-
|
|
34
|
-
watch(
|
|
35
|
-
() => props.type?.id,
|
|
36
|
-
() => {
|
|
37
|
-
enabled.value = props.savedEnabled
|
|
38
|
-
configText.value = props.savedConfig ?? '{}'
|
|
39
|
-
parseError.value = null
|
|
40
|
-
},
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
watch(
|
|
44
|
-
() => props.savedConfig,
|
|
45
|
-
(v) => {
|
|
46
|
-
if (v !== null && v !== undefined) {
|
|
47
|
-
configText.value = v
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
watch(
|
|
53
|
-
() => props.savedEnabled,
|
|
54
|
-
(v) => {
|
|
55
|
-
enabled.value = v
|
|
56
|
-
},
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
function validate() {
|
|
60
|
-
try {
|
|
61
|
-
JSON.parse(configText.value || '{}')
|
|
62
|
-
parseError.value = null
|
|
63
|
-
return true
|
|
64
|
-
} catch (e) {
|
|
65
|
-
parseError.value = (e as Error).message
|
|
66
|
-
return false
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const schemaPretty = computed(() =>
|
|
71
|
-
props.schema ? JSON.stringify(props.schema, null, 2) : '',
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
function onSave() {
|
|
75
|
-
if (!validate()) return
|
|
76
|
-
emit('save', {
|
|
77
|
-
enabled: enabled.value,
|
|
78
|
-
config: configText.value || '{}',
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
</script>
|
|
82
|
-
|
|
83
|
-
<template>
|
|
84
|
-
<DmsCard
|
|
85
|
-
v-if="!type"
|
|
86
|
-
class="flex min-h-[16rem] items-center justify-center text-center"
|
|
87
|
-
>
|
|
88
|
-
<div class="flex flex-col items-center gap-3 text-dimmed">
|
|
89
|
-
<UIcon name="i-ph-faders" class="size-8" />
|
|
90
|
-
<p class="max-w-xs text-sm">
|
|
91
|
-
{{ $t('dms_automation.catalog.selectPrompt') }}
|
|
92
|
-
</p>
|
|
93
|
-
</div>
|
|
94
|
-
</DmsCard>
|
|
95
|
-
|
|
96
|
-
<DmsCard v-else :padded="false" class="flex flex-col">
|
|
97
|
-
<div class="flex items-start gap-3 border-b border-default px-5 py-4 sm:px-6">
|
|
98
|
-
<div
|
|
99
|
-
class="grid size-10 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary ring ring-primary/20"
|
|
100
|
-
>
|
|
101
|
-
<UIcon :name="type.icon || 'i-ph-puzzle-piece'" class="size-5" />
|
|
102
|
-
</div>
|
|
103
|
-
<div class="min-w-0 flex-1">
|
|
104
|
-
<h2 class="truncate text-lg font-semibold text-highlighted">
|
|
105
|
-
{{ processI18n(type.name) }}
|
|
106
|
-
</h2>
|
|
107
|
-
<p v-if="type.description" class="text-sm text-muted">
|
|
108
|
-
{{ processI18n(type.description) }}
|
|
109
|
-
</p>
|
|
110
|
-
<p class="mt-1 font-mono text-xs text-dimmed">{{ type.id }}</p>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<div class="flex flex-col gap-5 px-5 py-4 sm:px-6">
|
|
115
|
-
<div class="flex items-center justify-between gap-4">
|
|
116
|
-
<div>
|
|
117
|
-
<div class="text-sm font-medium text-highlighted">
|
|
118
|
-
{{ $t('dms_automation.catalog.enabled') }}
|
|
119
|
-
</div>
|
|
120
|
-
<div class="text-xs text-muted">
|
|
121
|
-
{{ $t('dms_automation.catalog.enabledHelp') }}
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
<USwitch v-model="enabled" />
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div v-if="schemaPretty" class="flex flex-col gap-1.5">
|
|
128
|
-
<div class="text-sm font-medium text-highlighted">
|
|
129
|
-
{{ $t('dms_automation.catalog.configSchema') }}
|
|
130
|
-
</div>
|
|
131
|
-
<pre
|
|
132
|
-
class="max-h-48 overflow-auto rounded-lg border border-default bg-muted p-3 font-mono text-xs text-toned"
|
|
133
|
-
>{{ schemaPretty }}</pre>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<div class="flex flex-col gap-1.5">
|
|
137
|
-
<div class="text-sm font-medium text-highlighted">
|
|
138
|
-
{{ $t('dms_automation.catalog.globalConfig') }}
|
|
139
|
-
</div>
|
|
140
|
-
<UTextarea
|
|
141
|
-
v-model="configText"
|
|
142
|
-
:rows="10"
|
|
143
|
-
class="w-full font-mono"
|
|
144
|
-
autoresize
|
|
145
|
-
@blur="validate"
|
|
146
|
-
/>
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<UAlert
|
|
150
|
-
v-if="parseError"
|
|
151
|
-
color="error"
|
|
152
|
-
variant="subtle"
|
|
153
|
-
icon="i-ph-warning"
|
|
154
|
-
:title="$t('dms_automation.catalog.invalidJson')"
|
|
155
|
-
:description="parseError"
|
|
156
|
-
/>
|
|
157
|
-
|
|
158
|
-
<div class="flex justify-end">
|
|
159
|
-
<UButton
|
|
160
|
-
color="primary"
|
|
161
|
-
icon="i-ph-floppy-disk"
|
|
162
|
-
:disabled="!!parseError"
|
|
163
|
-
@click="onSave"
|
|
164
|
-
>
|
|
165
|
-
{{ $t('dms_automation.catalog.save') }}
|
|
166
|
-
</UButton>
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
</DmsCard>
|
|
170
|
-
</template>
|