@antelopejs/dms-automation 0.2.6 → 0.3.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 +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 +106 -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 +105 -44
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +822 -207
- 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 +382 -104
- 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 -5
- 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 -166
- package/frontend-vue/app/components/Catalog/TypeList.vue +0 -198
- package/frontend-vue/app/components/DataNodes.vue +0 -272
- 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/README.md
CHANGED
|
@@ -6,11 +6,55 @@
|
|
|
6
6
|
<a href="https://antelopejs.com"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
AntelopeJS DMS module that provides a visual automation builder under `/
|
|
9
|
+
AntelopeJS DMS module that provides a visual automation builder under `/modules/automation`. Author procedures as node graphs (triggers, actions, data nodes), wire trigger and data edges, and run them in response to events such as cron schedules and webhooks.
|
|
10
|
+
|
|
11
|
+
It runs on `@antelopejs/dms` 0.7.21 (`@antelopejs/interface-dms` 0.5.13) and `@antelopejs/dms-frontend` 0.5.
|
|
12
|
+
|
|
13
|
+
## Pages
|
|
14
|
+
|
|
15
|
+
| Page | What it shows |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Overview | The health of every procedure in one line, KPIs over 24 h / 7 d / 30 d, what needs attention and why, the latest runs |
|
|
18
|
+
| Run history | Every run grouped by day, with KPIs; one click opens a run in the side panel (failure, path taken, payload, log; J / K to step), re-runs with its own payload |
|
|
19
|
+
| Run trace | One run, linkable (`/modules/automation/trace?run=<id>`): its steps on a time line, where and why it failed, compared with the last success |
|
|
20
|
+
| Procedures | Every procedure with its state (failing, degraded, healthy, paused, draft), its last 12 runs, success rate and duration; import and new-procedure dialogs |
|
|
21
|
+
| Builder | The graph editor: test runs of the draft overlaid on the canvas, problems mapped onto nodes, Run now with an editable payload |
|
|
22
|
+
| Library | Triggers, actions, data nodes and templates, each with where it is used |
|
|
23
|
+
|
|
24
|
+
The pages are DMS blocks (KPI and chart cards, period selector, activity feed, table views with the grouped display and module cell displays) around a few module components, each named for the roles screen with `meta()`. Module pages are the platform owner's, like every DMS module, and so is the module's API.
|
|
25
|
+
|
|
26
|
+
A procedure is **failing** when its last run failed, **degraded** when runs failed in the last 7 days but the last one succeeded, **healthy** otherwise; a disabled one is **paused**, and one that has no trigger, or was never enabled nor run, is a **draft**. Test runs from the builder are kept (they have a trace) but never count in these states or in any figure. A procedure whose trigger cannot be armed (an invalid schedule, a webhook path already taken) is **failing**, with the reason under its state.
|
|
27
|
+
|
|
28
|
+
Webhooks are served by the API server, under the path set on the trigger. A path cannot overlap a route the server already serves, nor start with `/api`, `/auth`, `/dms`, `/modules` or `/settings`, and two enabled procedures cannot share the same method and path. A run keeps the request it received, with credentials replaced by `[redacted]` (see `runs.sensitiveNames`): a re-run therefore sends `[redacted]` in their place, and its confirmation says so. The library and the builder show each webhook's full URL on the DMS `apiBaseUrl`.
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
| Key | Default | |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `runs.retentionDays` | `30` | Days a run is kept; older runs are deleted every hour by the leader instance. `0` keeps every run. |
|
|
35
|
+
| `runs.sensitiveNames` | `[]` | More header and query parameter names whose value is a credential, matched case-insensitively as part of the name. They are added to the built-in list (`Authorization`, `Cookie`, `*token*`, `*secret*`, `*signature*`, `*hmac*`, `*-key`…). A run stores, shows and replays these values as `[redacted]`. |
|
|
36
|
+
| `httpRequest.blockPrivateNetwork` | `false` | Refuse HTTP requests to this server's network. See [HTTP request: private network](#http-request-private-network). |
|
|
37
|
+
| `cluster.driver` | `auto` | See [Clustering](#clustering). |
|
|
38
|
+
|
|
39
|
+
### HTTP request: private network
|
|
40
|
+
|
|
41
|
+
The built-in **HTTP request** action can call any address the server can reach, including its own network. When procedures are built by people you do not fully trust, or when a URL can come from a webhook payload, turn on `blockPrivateNetwork`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
"dms-automation": {
|
|
45
|
+
config: {
|
|
46
|
+
httpRequest: { blockPrivateNetwork: true },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The step then fails when the host resolves to a loopback (127.0.0.0/8, ::1), private (10/8, 172.16/12, 192.168/16, fc00::/7), carrier-grade NAT (100.64/10), link-local (169.254/16, fe80::/10, cloud metadata endpoints included), multicast or reserved address, or to a NAT64 address embedding one of them. Each redirect is checked too. DNS rebinding between the check and the connection is not covered. The option is off by default, so procedures that call services on the same machine or network keep working.
|
|
52
|
+
|
|
53
|
+
Every request also has a timeout (`timeoutMs`, 30 seconds by default, at most 5 minutes, set per step), and a response larger than 2 MB is refused.
|
|
10
54
|
|
|
11
55
|
## Vue frontend
|
|
12
56
|
|
|
13
|
-
The module registers `frontend-vue` through `AddFrontendModule` with the Vue 3 renderer. `dms.frontend.ts` registers the Automation components and the
|
|
57
|
+
The module registers `frontend-vue` through `AddFrontendModule` with the Vue 3 renderer. `dms.frontend.ts` declares the `DmsAutomation` component prefix, registers the Automation components, and a universal plugin registering the `automation:last-runs` cell display of the procedures table. The trigger and failed-step cells use the DMS `two_line` display over texts the server composes (`src/runtime/wording.ts`). `dms.frontend.build.ts` lists the folders the layer auto-imports (`app/composables`, `app/utils`). The generated Inertia application discovers the English and French locale files, while the host DMS provides shared composables and UI components.
|
|
14
58
|
|
|
15
59
|
The playground uses the published DMS and Inertia frontend packages. To build or typecheck the module frontend directly, first generate an Inertia workspace, set `DMS_FRONTEND_WORKSPACE` to its absolute path, then run:
|
|
16
60
|
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
import type { BlockText } from "@antelopejs/interface-dms/base/types";
|
|
3
|
+
import { type CellSublineValue } from "@antelopejs/interface-dms/base/table-view";
|
|
2
4
|
import { ProcedureModel } from "../db/models/procedure.model";
|
|
3
5
|
import { type ProcedureSummaryRow } from "../db/models/stats.model";
|
|
4
6
|
import { Procedure } from "../db/tables/procedure.table";
|
|
7
|
+
export interface ProceduresQuery {
|
|
8
|
+
search?: unknown;
|
|
9
|
+
filter_status?: unknown;
|
|
10
|
+
filter_triggerTypes?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export declare function applyQuery(rows: ProcedureSummaryRow[], query: ProceduresQuery): ProcedureSummaryRow[];
|
|
13
|
+
export declare function sortRows(rows: ProcedureSummaryRow[], sortKey?: unknown, sortDirection?: unknown): ProcedureSummaryRow[];
|
|
14
|
+
interface CountBatchBody {
|
|
15
|
+
queries?: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
query?: ProceduresQuery;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
5
20
|
declare const ProceduresTableAPI_base: import("@antelopejs/interface-core/decorators").Class<import("@antelopejs/interface-data-api").ExtractDefCallbacks<{
|
|
6
21
|
select: {
|
|
7
22
|
method: string;
|
|
@@ -9,6 +24,7 @@ declare const ProceduresTableAPI_base: import("@antelopejs/interface-core/decora
|
|
|
9
24
|
func: (_user: User, search?: string, offset?: string, limit?: string) => Promise<{
|
|
10
25
|
results: {
|
|
11
26
|
procedureId: string;
|
|
27
|
+
_id: string;
|
|
12
28
|
name: string;
|
|
13
29
|
}[];
|
|
14
30
|
total: number;
|
|
@@ -26,7 +42,7 @@ declare const ProceduresTableAPI_base: import("@antelopejs/interface-core/decora
|
|
|
26
42
|
list: {
|
|
27
43
|
method: string;
|
|
28
44
|
args: (import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator)[];
|
|
29
|
-
func: (_user: User, offset?: string, limit?: string, sortKey?: string, sortDirection?: string, search?: string, filterStatus?: string) => Promise<{
|
|
45
|
+
func: (_user: User, offset?: string, limit?: string, sortKey?: string, sortDirection?: string, search?: string, filterStatus?: string, filterTriggerTypes?: string) => Promise<{
|
|
30
46
|
results: ProcedureSummaryRow[];
|
|
31
47
|
total: number;
|
|
32
48
|
offset: number;
|
|
@@ -36,10 +52,20 @@ declare const ProceduresTableAPI_base: import("@antelopejs/interface-core/decora
|
|
|
36
52
|
count: {
|
|
37
53
|
method: string;
|
|
38
54
|
args: (import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator)[];
|
|
39
|
-
func: (_user: User, search?: string, filterStatus?: string) => Promise<{
|
|
55
|
+
func: (_user: User, search?: string, filterStatus?: string, filterTriggerTypes?: string) => Promise<{
|
|
40
56
|
total: number;
|
|
41
57
|
}>;
|
|
42
58
|
};
|
|
59
|
+
countBatch: {
|
|
60
|
+
endpoint: string;
|
|
61
|
+
callback: {
|
|
62
|
+
method: string;
|
|
63
|
+
args: (import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator)[];
|
|
64
|
+
func: (_user: User, body: CountBatchBody) => Promise<{
|
|
65
|
+
[k: string]: number;
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
43
69
|
delete: {
|
|
44
70
|
method: string;
|
|
45
71
|
args: (import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator)[];
|
|
@@ -56,11 +82,19 @@ declare const ProceduresTableAPI_base: import("@antelopejs/interface-core/decora
|
|
|
56
82
|
export declare class ProceduresTableAPI extends ProceduresTableAPI_base {
|
|
57
83
|
model: ProcedureModel;
|
|
58
84
|
name: string;
|
|
59
|
-
|
|
85
|
+
description: string;
|
|
86
|
+
triggerSummary: string;
|
|
87
|
+
triggerText: BlockText;
|
|
88
|
+
triggerTypeText: BlockText | null;
|
|
89
|
+
triggerTypes: string[];
|
|
60
90
|
status: string;
|
|
91
|
+
statusDetail: CellSublineValue | null;
|
|
92
|
+
lastError: string;
|
|
61
93
|
lastRunAt: string;
|
|
94
|
+
lastRunId: string | null;
|
|
95
|
+
lastRuns: string;
|
|
62
96
|
successRate: number;
|
|
63
97
|
avgDurationMs: number;
|
|
64
|
-
|
|
98
|
+
enabled: boolean;
|
|
65
99
|
}
|
|
66
100
|
export {};
|
|
@@ -10,12 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProceduresTableAPI = void 0;
|
|
13
|
+
exports.applyQuery = applyQuery;
|
|
14
|
+
exports.sortRows = sortRows;
|
|
13
15
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
14
16
|
const interface_data_api_1 = require("@antelopejs/interface-data-api");
|
|
15
17
|
const components_1 = require("@antelopejs/interface-data-api/components");
|
|
16
18
|
const metadata_1 = require("@antelopejs/interface-data-api/metadata");
|
|
17
19
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
18
|
-
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
19
20
|
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
20
21
|
const data_types_1 = require("@antelopejs/interface-dms/base/data-types");
|
|
21
22
|
const searchable_1 = require("@antelopejs/interface-dms/base/searchable");
|
|
@@ -23,36 +24,55 @@ const table_view_1 = require("@antelopejs/interface-dms/base/table-view");
|
|
|
23
24
|
const procedure_model_1 = require("../db/models/procedure.model");
|
|
24
25
|
const stats_model_1 = require("../db/models/stats.model");
|
|
25
26
|
const procedure_table_1 = require("../db/tables/procedure.table");
|
|
26
|
-
const
|
|
27
|
+
const displays_1 = require("../displays");
|
|
28
|
+
const shared_1 = require("../pages/shared");
|
|
29
|
+
const triggers_1 = require("../runtime/builtins/triggers");
|
|
30
|
+
const health_1 = require("../stats/health");
|
|
27
31
|
const subscriptions_1 = require("../runtime/subscriptions");
|
|
28
32
|
const constants_1 = require("../types/constants");
|
|
33
|
+
function queryText(raw) {
|
|
34
|
+
return typeof raw === "string" ? raw.trim() : "";
|
|
35
|
+
}
|
|
36
|
+
function folded(text) {
|
|
37
|
+
return text
|
|
38
|
+
.normalize("NFD")
|
|
39
|
+
.replace(/\p{Diacritic}/gu, "")
|
|
40
|
+
.toLowerCase();
|
|
41
|
+
}
|
|
29
42
|
function parseFilter(raw) {
|
|
30
|
-
|
|
43
|
+
const text = queryText(raw);
|
|
44
|
+
if (!text)
|
|
31
45
|
return undefined;
|
|
32
|
-
const idx =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
const idx = text.indexOf(":");
|
|
47
|
+
const [mode, value] = idx < 0 ? ["is", text] : [text.slice(0, idx), text.slice(idx + 1)];
|
|
48
|
+
const values = value
|
|
49
|
+
.split(",")
|
|
50
|
+
.map((v) => v.trim())
|
|
51
|
+
.filter(Boolean);
|
|
52
|
+
return values.length ? { mode, values } : undefined;
|
|
53
|
+
}
|
|
54
|
+
const NEGATED_MODES = new Set(["is_not", "exclude"]);
|
|
55
|
+
function passes(values, filter) {
|
|
56
|
+
if (!filter)
|
|
57
|
+
return true;
|
|
58
|
+
const hit = values.some((v) => filter.values.includes(v));
|
|
59
|
+
return NEGATED_MODES.has(filter.mode) ? !hit : hit;
|
|
60
|
+
}
|
|
61
|
+
function searchedText(row) {
|
|
62
|
+
return folded([
|
|
63
|
+
row.name,
|
|
64
|
+
row.description,
|
|
65
|
+
row.lastError ?? "",
|
|
66
|
+
...row.triggers.flatMap((t) => [t.path ?? "", t.cron ?? ""]),
|
|
67
|
+
].join("\n"));
|
|
36
68
|
}
|
|
37
|
-
function applyQuery(rows,
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const wanted = sf.value
|
|
45
|
-
.split(",")
|
|
46
|
-
.map((v) => v.trim())
|
|
47
|
-
.filter(Boolean);
|
|
48
|
-
if (wanted.length) {
|
|
49
|
-
out =
|
|
50
|
-
sf.mode === "is_not"
|
|
51
|
-
? out.filter((r) => !wanted.includes(r.status))
|
|
52
|
-
: out.filter((r) => wanted.includes(r.status));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return out;
|
|
69
|
+
function applyQuery(rows, query) {
|
|
70
|
+
const q = folded(queryText(query.search));
|
|
71
|
+
const status = parseFilter(query.filter_status);
|
|
72
|
+
const triggerTypes = parseFilter(query.filter_triggerTypes);
|
|
73
|
+
return rows.filter((r) => (!q || searchedText(r).includes(q)) &&
|
|
74
|
+
passes([r.status], status) &&
|
|
75
|
+
passes(r.triggerTypes, triggerTypes));
|
|
56
76
|
}
|
|
57
77
|
const SORTABLE_KEYS = new Set([
|
|
58
78
|
"name",
|
|
@@ -63,49 +83,57 @@ const SORTABLE_KEYS = new Set([
|
|
|
63
83
|
"avgDurationMs",
|
|
64
84
|
"runs",
|
|
65
85
|
]);
|
|
86
|
+
function sortText(value) {
|
|
87
|
+
return typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
88
|
+
}
|
|
89
|
+
function compareValues(a, b, dir) {
|
|
90
|
+
if (a == null && b == null)
|
|
91
|
+
return 0;
|
|
92
|
+
if (a == null)
|
|
93
|
+
return 1;
|
|
94
|
+
if (b == null)
|
|
95
|
+
return -1;
|
|
96
|
+
if (typeof a === "number" && typeof b === "number")
|
|
97
|
+
return (a - b) * dir;
|
|
98
|
+
return sortText(a).localeCompare(sortText(b)) * dir;
|
|
99
|
+
}
|
|
100
|
+
function byState(a, b, dir = 1) {
|
|
101
|
+
return (((0, health_1.stateRank)(a.status) - (0, health_1.stateRank)(b.status)) * dir ||
|
|
102
|
+
a.name.localeCompare(b.name));
|
|
103
|
+
}
|
|
66
104
|
function sortRows(rows, sortKey, sortDirection) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const k = sortKey;
|
|
105
|
+
const k = queryText(sortKey);
|
|
106
|
+
if (!SORTABLE_KEYS.has(k))
|
|
107
|
+
return [...rows].sort((a, b) => byState(a, b));
|
|
71
108
|
const dir = sortDirection === "desc" ? -1 : 1;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (av == null && bv == null)
|
|
76
|
-
return 0;
|
|
77
|
-
if (av == null)
|
|
78
|
-
return 1;
|
|
79
|
-
if (bv == null)
|
|
80
|
-
return -1;
|
|
81
|
-
if (typeof av === "number" && typeof bv === "number") {
|
|
82
|
-
return (av - bv) * dir;
|
|
83
|
-
}
|
|
84
|
-
return String(av).localeCompare(String(bv)) * dir;
|
|
85
|
-
});
|
|
109
|
+
if (k === "status")
|
|
110
|
+
return [...rows].sort((a, b) => byState(a, b, dir));
|
|
111
|
+
return [...rows].sort((a, b) => compareValues(a[k], b[k], dir));
|
|
86
112
|
}
|
|
87
|
-
function
|
|
113
|
+
function toInt(raw, fallback, min) {
|
|
88
114
|
const n = Math.trunc(Number(raw));
|
|
89
|
-
return Number.isFinite(n) && n
|
|
115
|
+
return Number.isFinite(n) && n >= min ? n : fallback;
|
|
90
116
|
}
|
|
117
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
118
|
+
const MAX_COUNT_QUERIES = 50;
|
|
91
119
|
const procedureSummaryRoutes = {
|
|
92
120
|
select: {
|
|
93
121
|
method: "GET",
|
|
94
122
|
args: [
|
|
95
|
-
(0, auth_1.
|
|
123
|
+
(0, auth_1.AuthOwnerOnly)(),
|
|
96
124
|
(0, interface_api_1.Parameter)("search", "query"),
|
|
97
125
|
(0, interface_api_1.Parameter)("offset", "query"),
|
|
98
126
|
(0, interface_api_1.Parameter)("limit", "query"),
|
|
99
127
|
],
|
|
100
128
|
func: async (_user, search, offset, limit) => {
|
|
101
|
-
const q =
|
|
129
|
+
const q = folded(queryText(search));
|
|
102
130
|
const procedures = await (0, interface_database_decorators_1.GetModel)(procedure_model_1.ProcedureModel, constants_1.DATABASE_NAME).getAll();
|
|
103
131
|
const options = procedures
|
|
104
|
-
.map((p) => ({ procedureId: p._id, name: p.name }))
|
|
105
|
-
.filter((p) =>
|
|
132
|
+
.map((p) => ({ procedureId: p._id, _id: p._id, name: p.name }))
|
|
133
|
+
.filter((p) => !q || folded(p.name).includes(q))
|
|
106
134
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
107
|
-
const off =
|
|
108
|
-
const lim =
|
|
135
|
+
const off = toInt(offset, 0, 0);
|
|
136
|
+
const lim = toInt(limit, DEFAULT_PAGE_SIZE, 1);
|
|
109
137
|
return {
|
|
110
138
|
results: options.slice(off, off + lim),
|
|
111
139
|
total: options.length,
|
|
@@ -116,10 +144,9 @@ const procedureSummaryRoutes = {
|
|
|
116
144
|
},
|
|
117
145
|
get: {
|
|
118
146
|
method: "GET",
|
|
119
|
-
args: [(0, auth_1.
|
|
147
|
+
args: [(0, auth_1.AuthOwnerOnly)(), components_1.Parameters.Get()],
|
|
120
148
|
func: async (_user, params) => {
|
|
121
|
-
const
|
|
122
|
-
const found = rows.find((r) => r.procedureId === params.id);
|
|
149
|
+
const found = await (0, stats_model_1.getProcedureSummary)(params.id);
|
|
123
150
|
if (!found) {
|
|
124
151
|
throw new interface_api_1.HTTPResult(404, {
|
|
125
152
|
error: `procedure "${params.id}" not found`,
|
|
@@ -131,19 +158,24 @@ const procedureSummaryRoutes = {
|
|
|
131
158
|
list: {
|
|
132
159
|
method: "GET",
|
|
133
160
|
args: [
|
|
134
|
-
(0, auth_1.
|
|
161
|
+
(0, auth_1.AuthOwnerOnly)(),
|
|
135
162
|
(0, interface_api_1.Parameter)("offset", "query"),
|
|
136
163
|
(0, interface_api_1.Parameter)("limit", "query"),
|
|
137
164
|
(0, interface_api_1.Parameter)("sortKey", "query"),
|
|
138
165
|
(0, interface_api_1.Parameter)("sortDirection", "query"),
|
|
139
166
|
(0, interface_api_1.Parameter)("search", "query"),
|
|
140
167
|
(0, interface_api_1.Parameter)("filter_status", "query"),
|
|
168
|
+
(0, interface_api_1.Parameter)("filter_triggerTypes", "query"),
|
|
141
169
|
],
|
|
142
|
-
func: async (_user, offset, limit, sortKey, sortDirection, search, filterStatus) => {
|
|
143
|
-
const filtered = applyQuery(await (0, stats_model_1.getProceduresSummary)(),
|
|
170
|
+
func: async (_user, offset, limit, sortKey, sortDirection, search, filterStatus, filterTriggerTypes) => {
|
|
171
|
+
const filtered = applyQuery(await (0, stats_model_1.getProceduresSummary)(), {
|
|
172
|
+
search,
|
|
173
|
+
filter_status: filterStatus,
|
|
174
|
+
filter_triggerTypes: filterTriggerTypes,
|
|
175
|
+
});
|
|
144
176
|
const sorted = sortRows(filtered, sortKey, sortDirection);
|
|
145
|
-
const off =
|
|
146
|
-
const lim =
|
|
177
|
+
const off = toInt(offset, 0, 0);
|
|
178
|
+
const lim = toInt(limit, DEFAULT_PAGE_SIZE, 1);
|
|
147
179
|
return {
|
|
148
180
|
results: sorted.slice(off, off + lim),
|
|
149
181
|
total: filtered.length,
|
|
@@ -155,18 +187,43 @@ const procedureSummaryRoutes = {
|
|
|
155
187
|
count: {
|
|
156
188
|
method: "GET",
|
|
157
189
|
args: [
|
|
158
|
-
(0, auth_1.
|
|
190
|
+
(0, auth_1.AuthOwnerOnly)(),
|
|
159
191
|
(0, interface_api_1.Parameter)("search", "query"),
|
|
160
192
|
(0, interface_api_1.Parameter)("filter_status", "query"),
|
|
193
|
+
(0, interface_api_1.Parameter)("filter_triggerTypes", "query"),
|
|
161
194
|
],
|
|
162
|
-
func: async (_user, search, filterStatus) => {
|
|
163
|
-
const filtered = applyQuery(await (0, stats_model_1.getProceduresSummary)(),
|
|
195
|
+
func: async (_user, search, filterStatus, filterTriggerTypes) => {
|
|
196
|
+
const filtered = applyQuery(await (0, stats_model_1.getProceduresSummary)(), {
|
|
197
|
+
search,
|
|
198
|
+
filter_status: filterStatus,
|
|
199
|
+
filter_triggerTypes: filterTriggerTypes,
|
|
200
|
+
});
|
|
164
201
|
return { total: filtered.length };
|
|
165
202
|
},
|
|
166
203
|
},
|
|
204
|
+
countBatch: {
|
|
205
|
+
endpoint: "/count/batch",
|
|
206
|
+
callback: {
|
|
207
|
+
method: "POST",
|
|
208
|
+
args: [(0, auth_1.AuthOwnerOnly)(), (0, interface_api_1.JSONBody)()],
|
|
209
|
+
func: async (_user, body) => {
|
|
210
|
+
const queries = Array.isArray(body?.queries) ? body.queries : [];
|
|
211
|
+
if (queries.length > MAX_COUNT_QUERIES) {
|
|
212
|
+
throw new interface_api_1.HTTPResult(400, {
|
|
213
|
+
error: "Too many count batch queries.",
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const rows = await (0, stats_model_1.getProceduresSummary)();
|
|
217
|
+
return Object.fromEntries(queries.map(({ id, query }) => [
|
|
218
|
+
id,
|
|
219
|
+
applyQuery(rows, query ?? {}).length,
|
|
220
|
+
]));
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
167
224
|
delete: {
|
|
168
225
|
method: "DELETE",
|
|
169
|
-
args: [(0,
|
|
226
|
+
args: [(0, auth_1.AuthOwnerOnly)(), components_1.Parameters.Delete()],
|
|
170
227
|
func: async (_user, params) => {
|
|
171
228
|
const ids = Array.isArray(params.id) ? params.id : [params.id];
|
|
172
229
|
const model = (0, interface_database_decorators_1.GetModel)(procedure_model_1.ProcedureModel, constants_1.DATABASE_NAME);
|
|
@@ -178,12 +235,44 @@ const procedureSummaryRoutes = {
|
|
|
178
235
|
},
|
|
179
236
|
},
|
|
180
237
|
};
|
|
238
|
+
const STATUS_ITEMS = [
|
|
239
|
+
{
|
|
240
|
+
value: "failing",
|
|
241
|
+
label: "$dms_automation.procedures.status.failing",
|
|
242
|
+
icon: "i-ph-x-circle",
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
value: "degraded",
|
|
246
|
+
label: "$dms_automation.procedures.status.degraded",
|
|
247
|
+
icon: "i-ph-warning",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
value: "healthy",
|
|
251
|
+
label: "$dms_automation.procedures.status.healthy",
|
|
252
|
+
icon: "i-ph-check-circle",
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
value: "paused",
|
|
256
|
+
label: "$dms_automation.procedures.status.paused",
|
|
257
|
+
icon: "i-ph-pause-circle",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
value: "draft",
|
|
261
|
+
label: "$dms_automation.procedures.status.draft",
|
|
262
|
+
icon: "i-ph-pencil-simple-line",
|
|
263
|
+
},
|
|
264
|
+
];
|
|
265
|
+
const TRIGGER_TYPE_ITEMS = triggers_1.builtinTriggers.map((t) => ({
|
|
266
|
+
value: t.id,
|
|
267
|
+
label: t.name,
|
|
268
|
+
icon: t.icon,
|
|
269
|
+
}));
|
|
181
270
|
let ProceduresTableAPI = class ProceduresTableAPI extends (0, interface_data_api_1.DataController)(procedure_table_1.Procedure, procedureSummaryRoutes, (0, interface_api_1.Controller)("/api/automation/tables/procedures")) {
|
|
182
271
|
};
|
|
183
272
|
exports.ProceduresTableAPI = ProceduresTableAPI;
|
|
184
273
|
__decorate([
|
|
185
274
|
(0, metadata_1.ModelReference)(),
|
|
186
|
-
(0, interface_database_decorators_1.Model)(procedure_model_1.ProcedureModel),
|
|
275
|
+
(0, interface_database_decorators_1.Model)(procedure_model_1.ProcedureModel, constants_1.DATABASE_NAME),
|
|
187
276
|
__metadata("design:type", procedure_model_1.ProcedureModel)
|
|
188
277
|
], ProceduresTableAPI.prototype, "model", void 0);
|
|
189
278
|
__decorate([
|
|
@@ -192,55 +281,144 @@ __decorate([
|
|
|
192
281
|
(0, metadata_1.Listable)(),
|
|
193
282
|
(0, table_view_1.Column)({
|
|
194
283
|
name: "$dms_automation.procedures.cols.procedure",
|
|
284
|
+
size: 160,
|
|
195
285
|
type: new data_types_1.DefaultDataTypes.StringType(),
|
|
286
|
+
display: new displays_1.ProcedureLinkDisplay({
|
|
287
|
+
icon: "i-ph-flow-arrow",
|
|
288
|
+
subtitleField: "description",
|
|
289
|
+
url: `${shared_1.BUILDER_URL}?selected={procedureId}`,
|
|
290
|
+
}),
|
|
291
|
+
order: 1,
|
|
196
292
|
}),
|
|
197
293
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
198
294
|
__metadata("design:type", String)
|
|
199
295
|
], ProceduresTableAPI.prototype, "name", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
(0, metadata_1.Listable)(),
|
|
298
|
+
(0, table_view_1.Column)({
|
|
299
|
+
name: "$dms_automation.procedures.cols.description",
|
|
300
|
+
type: new data_types_1.DefaultDataTypes.StringType(),
|
|
301
|
+
isVisible: false,
|
|
302
|
+
order: 10,
|
|
303
|
+
}),
|
|
304
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
305
|
+
__metadata("design:type", String)
|
|
306
|
+
], ProceduresTableAPI.prototype, "description", void 0);
|
|
200
307
|
__decorate([
|
|
201
308
|
(0, metadata_1.Listable)(),
|
|
202
309
|
(0, table_view_1.Column)({
|
|
203
310
|
name: "$dms_automation.procedures.cols.trigger",
|
|
311
|
+
size: 120,
|
|
204
312
|
type: new data_types_1.DefaultDataTypes.StringType(),
|
|
313
|
+
display: new table_view_1.DefaultDisplays.TwoLineDisplay({
|
|
314
|
+
primaryField: "triggerText",
|
|
315
|
+
subField: "triggerTypeText",
|
|
316
|
+
}),
|
|
317
|
+
order: 3,
|
|
205
318
|
}),
|
|
206
319
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
207
320
|
__metadata("design:type", String)
|
|
208
|
-
], ProceduresTableAPI.prototype, "
|
|
321
|
+
], ProceduresTableAPI.prototype, "triggerSummary", void 0);
|
|
322
|
+
__decorate([
|
|
323
|
+
(0, metadata_1.Listable)(),
|
|
324
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
325
|
+
__metadata("design:type", Object)
|
|
326
|
+
], ProceduresTableAPI.prototype, "triggerText", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
(0, metadata_1.Listable)(),
|
|
329
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
330
|
+
__metadata("design:type", Object)
|
|
331
|
+
], ProceduresTableAPI.prototype, "triggerTypeText", void 0);
|
|
209
332
|
__decorate([
|
|
210
333
|
(0, metadata_1.Listable)(),
|
|
211
334
|
(0, table_view_1.Column)({
|
|
212
|
-
name: "$dms_automation.procedures.cols.
|
|
335
|
+
name: "$dms_automation.procedures.cols.triggerTypes",
|
|
213
336
|
type: new data_types_1.DefaultDataTypes.SelectType({
|
|
214
|
-
items:
|
|
215
|
-
|
|
216
|
-
{ value: "paused", label: "$dms_automation.procedures.status.paused" },
|
|
217
|
-
{
|
|
218
|
-
value: "failing",
|
|
219
|
-
label: "$dms_automation.procedures.status.failing",
|
|
220
|
-
},
|
|
221
|
-
],
|
|
337
|
+
items: TRIGGER_TYPE_ITEMS,
|
|
338
|
+
multiple: true,
|
|
222
339
|
}),
|
|
340
|
+
isVisible: false,
|
|
223
341
|
filterable: true,
|
|
342
|
+
order: 13,
|
|
343
|
+
}),
|
|
344
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
345
|
+
__metadata("design:type", Array)
|
|
346
|
+
], ProceduresTableAPI.prototype, "triggerTypes", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
(0, metadata_1.Listable)(),
|
|
349
|
+
(0, metadata_1.Sortable)({ noIndex: true }),
|
|
350
|
+
(0, table_view_1.Column)({
|
|
351
|
+
name: "$dms_automation.procedures.cols.status",
|
|
352
|
+
size: 125,
|
|
353
|
+
type: new data_types_1.DefaultDataTypes.SelectType({ items: STATUS_ITEMS }),
|
|
354
|
+
display: new table_view_1.DefaultDisplays.StatusPillDisplay({
|
|
355
|
+
tones: {
|
|
356
|
+
failing: "error",
|
|
357
|
+
degraded: "warning",
|
|
358
|
+
healthy: "success",
|
|
359
|
+
paused: "neutral",
|
|
360
|
+
draft: "info",
|
|
361
|
+
},
|
|
362
|
+
subField: "statusDetail",
|
|
363
|
+
}),
|
|
364
|
+
filterable: true,
|
|
365
|
+
order: 2,
|
|
224
366
|
}),
|
|
225
367
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
226
368
|
__metadata("design:type", String)
|
|
227
369
|
], ProceduresTableAPI.prototype, "status", void 0);
|
|
370
|
+
__decorate([
|
|
371
|
+
(0, metadata_1.Listable)(),
|
|
372
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
373
|
+
__metadata("design:type", Object)
|
|
374
|
+
], ProceduresTableAPI.prototype, "statusDetail", void 0);
|
|
375
|
+
__decorate([
|
|
376
|
+
(0, metadata_1.Listable)(),
|
|
377
|
+
(0, table_view_1.Column)({
|
|
378
|
+
name: "$dms_automation.procedures.cols.statusDetail",
|
|
379
|
+
type: new data_types_1.DefaultDataTypes.StringType(),
|
|
380
|
+
isVisible: false,
|
|
381
|
+
order: 11,
|
|
382
|
+
}),
|
|
383
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
384
|
+
__metadata("design:type", String)
|
|
385
|
+
], ProceduresTableAPI.prototype, "lastError", void 0);
|
|
228
386
|
__decorate([
|
|
229
387
|
(0, metadata_1.Listable)(),
|
|
230
388
|
(0, metadata_1.Sortable)({ noIndex: true }),
|
|
231
389
|
(0, table_view_1.Column)({
|
|
232
|
-
name: "$dms_automation.procedures.cols.
|
|
390
|
+
name: "$dms_automation.procedures.cols.recentRuns",
|
|
391
|
+
size: 120,
|
|
233
392
|
type: new data_types_1.DefaultDataTypes.DateType(),
|
|
393
|
+
display: new displays_1.LastRunsDisplay({
|
|
394
|
+
limit: 12,
|
|
395
|
+
runsField: "lastRuns",
|
|
396
|
+
runUrl: `${shared_1.TRACE_URL}?run={runId}`,
|
|
397
|
+
emptyLabel: "$dms_automation.procedures.never",
|
|
398
|
+
}),
|
|
399
|
+
order: 4,
|
|
234
400
|
}),
|
|
235
401
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
236
402
|
__metadata("design:type", String)
|
|
237
403
|
], ProceduresTableAPI.prototype, "lastRunAt", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
(0, metadata_1.Listable)(),
|
|
406
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
407
|
+
__metadata("design:type", Object)
|
|
408
|
+
], ProceduresTableAPI.prototype, "lastRunId", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
(0, metadata_1.Listable)(),
|
|
411
|
+
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
412
|
+
__metadata("design:type", String)
|
|
413
|
+
], ProceduresTableAPI.prototype, "lastRuns", void 0);
|
|
238
414
|
__decorate([
|
|
239
415
|
(0, metadata_1.Listable)(),
|
|
240
416
|
(0, metadata_1.Sortable)({ noIndex: true }),
|
|
241
417
|
(0, table_view_1.Column)({
|
|
242
|
-
name: "$dms_automation.procedures.cols.
|
|
418
|
+
name: "$dms_automation.procedures.cols.successRate",
|
|
419
|
+
size: 118,
|
|
243
420
|
type: new data_types_1.DefaultDataTypes.PercentageType({ min: 0, max: 1, step: 0.01 }),
|
|
421
|
+
order: 5,
|
|
244
422
|
}),
|
|
245
423
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
246
424
|
__metadata("design:type", Number)
|
|
@@ -251,20 +429,24 @@ __decorate([
|
|
|
251
429
|
(0, table_view_1.Column)({
|
|
252
430
|
name: "$dms_automation.procedures.cols.avg",
|
|
253
431
|
type: new data_types_1.DefaultDataTypes.NumberType(),
|
|
432
|
+
display: new table_view_1.DefaultDisplays.DurationDisplay({ unit: "ms" }),
|
|
433
|
+
isVisible: false,
|
|
434
|
+
order: 14,
|
|
254
435
|
}),
|
|
255
436
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
256
437
|
__metadata("design:type", Number)
|
|
257
438
|
], ProceduresTableAPI.prototype, "avgDurationMs", void 0);
|
|
258
439
|
__decorate([
|
|
259
440
|
(0, metadata_1.Listable)(),
|
|
260
|
-
(0, metadata_1.Sortable)({ noIndex: true }),
|
|
261
441
|
(0, table_view_1.Column)({
|
|
262
|
-
name: "$dms_automation.procedures.cols.
|
|
263
|
-
type: new data_types_1.DefaultDataTypes.
|
|
442
|
+
name: "$dms_automation.procedures.cols.enabled",
|
|
443
|
+
type: new data_types_1.DefaultDataTypes.BooleanType(),
|
|
444
|
+
isVisible: false,
|
|
445
|
+
order: 12,
|
|
264
446
|
}),
|
|
265
447
|
(0, metadata_1.Access)(metadata_1.AccessMode.ReadOnly),
|
|
266
|
-
__metadata("design:type",
|
|
267
|
-
], ProceduresTableAPI.prototype, "
|
|
448
|
+
__metadata("design:type", Boolean)
|
|
449
|
+
], ProceduresTableAPI.prototype, "enabled", void 0);
|
|
268
450
|
exports.ProceduresTableAPI = ProceduresTableAPI = __decorate([
|
|
269
451
|
(0, interface_data_api_1.RegisterDataController)()
|
|
270
452
|
], ProceduresTableAPI);
|