@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/dist/db/models/index.js
CHANGED
|
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./procedure.model"), exports);
|
|
18
18
|
__exportStar(require("./procedure_run.model"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./type_switch.model"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -20,6 +20,7 @@ declare const ProcedureModel_base: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare class ProcedureModel extends ProcedureModel_base {
|
|
22
22
|
listEnabled(): Promise<Procedure[]>;
|
|
23
|
+
updateAtRevision(id: string, revision: number, patch: Partial<Procedure>): Promise<boolean>;
|
|
23
24
|
list(options: PageParams): Promise<Paginated<Procedure>>;
|
|
24
25
|
}
|
|
25
26
|
export {};
|
|
@@ -7,6 +7,13 @@ class ProcedureModel extends (0, interface_database_decorators_1.BasicDataModel)
|
|
|
7
7
|
async listEnabled() {
|
|
8
8
|
return await this.table.filter((doc) => doc.key("enabled").eq(true)).run();
|
|
9
9
|
}
|
|
10
|
+
async updateAtRevision(id, revision, patch) {
|
|
11
|
+
const updated = await this.table
|
|
12
|
+
.filter((doc) => doc.key("_id").eq(id).and(doc.key("revision").eq(revision)))
|
|
13
|
+
.update(patch)
|
|
14
|
+
.run();
|
|
15
|
+
return updated > 0;
|
|
16
|
+
}
|
|
10
17
|
async list(options) {
|
|
11
18
|
const totalReq = this.table.count();
|
|
12
19
|
const finalReq = this.table
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedure.model.js","sourceRoot":"","sources":["../../../src/db/models/procedure.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAE3E,+DAA2E;AAE3E,MAAa,cAAe,SAAQ,IAAA,8CAAc,EAChD,2BAAS,EACT,qCAAmB,CACpB;IACC,KAAK,CAAC,WAAW;QACf,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAmB;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC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,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAmB;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK;aACxB,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;aAC7B,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEtD,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACzC,QAAQ,CAAC,GAAG,EAAE;YACd,QAAQ,CAAC,GAAG,EAAE;SACf,CAAC,CAAC;QAEH,OAAO;YACL,OAAO;YACP,KAAK;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC;IACJ,CAAC;CACF;AA7CD,wCA6CC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ProcedureRun } from "../tables/procedure_run.table";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export type StatsRun = Pick<ProcedureRun, "_id" | "procedureId" | "procedureName" | "startedAt" | "endedAt" | "status" | "errorMessage" | "kind" | "failedNodeId" | "triggerNodeId">;
|
|
3
|
+
export type RunSummary = Pick<ProcedureRun, "_id" | "procedureId" | "procedureName" | "startedAt" | "endedAt" | "status" | "errorMessage" | "triggerNodeId" | "kind" | "failedNodeId" | "rerunOf">;
|
|
4
|
+
export interface HistoryQuery {
|
|
5
|
+
tests: boolean;
|
|
6
|
+
after?: Date;
|
|
7
|
+
before?: Date;
|
|
6
8
|
status?: string;
|
|
7
|
-
since?: Date;
|
|
8
|
-
peek?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
11
|
-
export type RunSummary = Pick<ProcedureRun, "_id" | "procedureId" | "startedAt" | "endedAt" | "status" | "errorMessage" | "triggerNodeId">;
|
|
10
|
+
export type RunTiming = Pick<ProcedureRun, "_id" | "procedureId" | "startedAt" | "endedAt" | "status" | "durationMs">;
|
|
12
11
|
declare const ProcedureRunModel_base: {
|
|
13
12
|
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
14
13
|
readonly table: import("@antelopejs/interface-database").Table<ProcedureRun>;
|
|
@@ -29,7 +28,15 @@ declare const ProcedureRunModel_base: {
|
|
|
29
28
|
};
|
|
30
29
|
export declare class ProcedureRunModel extends ProcedureRunModel_base {
|
|
31
30
|
listForStats(since: Date): Promise<StatsRun[]>;
|
|
31
|
+
renameProcedure(procedureId: string, name: string): Promise<number>;
|
|
32
|
+
markOlderVersions(procedureId: string, version: number): Promise<number>;
|
|
33
|
+
newest(procedureId: string, query: HistoryQuery): Promise<RunSummary | undefined>;
|
|
34
|
+
oldest(procedureId: string, query: HistoryQuery): Promise<RunSummary | undefined>;
|
|
35
|
+
countHistory(procedureId: string, query: HistoryQuery): Promise<number>;
|
|
36
|
+
successTimings(procedureId: string, query: HistoryQuery, limit: number): Promise<RunTiming[]>;
|
|
37
|
+
private history;
|
|
38
|
+
hasRunBefore(date: Date): Promise<boolean>;
|
|
39
|
+
purgeBefore(before: Date): Promise<number>;
|
|
32
40
|
listByProcedure(procedureId: string, page: number, limit: number, peek?: boolean): Promise<RunSummary[]>;
|
|
33
|
-
listAll({ page, limit, procedureId, status, since, peek, }: RunListQuery): Promise<RunSummary[]>;
|
|
34
41
|
}
|
|
35
42
|
export {};
|
|
@@ -3,43 +3,122 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProcedureRunModel = void 0;
|
|
4
4
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
5
|
const procedure_run_table_1 = require("../tables/procedure_run.table");
|
|
6
|
+
const STATS_FIELDS = [
|
|
7
|
+
"_id",
|
|
8
|
+
"procedureId",
|
|
9
|
+
"procedureName",
|
|
10
|
+
"startedAt",
|
|
11
|
+
"endedAt",
|
|
12
|
+
"status",
|
|
13
|
+
"errorMessage",
|
|
14
|
+
"kind",
|
|
15
|
+
"failedNodeId",
|
|
16
|
+
"triggerNodeId",
|
|
17
|
+
];
|
|
6
18
|
const RUN_SUMMARY_FIELDS = [
|
|
7
19
|
"_id",
|
|
8
20
|
"procedureId",
|
|
21
|
+
"procedureName",
|
|
9
22
|
"startedAt",
|
|
10
23
|
"endedAt",
|
|
11
24
|
"status",
|
|
12
25
|
"errorMessage",
|
|
13
26
|
"triggerNodeId",
|
|
27
|
+
"kind",
|
|
28
|
+
"failedNodeId",
|
|
29
|
+
"rerunOf",
|
|
30
|
+
];
|
|
31
|
+
const RUN_TIMING_FIELDS = [
|
|
32
|
+
"_id",
|
|
33
|
+
"procedureId",
|
|
34
|
+
"startedAt",
|
|
35
|
+
"endedAt",
|
|
36
|
+
"status",
|
|
37
|
+
"durationMs",
|
|
14
38
|
];
|
|
15
39
|
class ProcedureRunModel extends (0, interface_database_decorators_1.BasicDataModel)(procedure_run_table_1.ProcedureRun, procedure_run_table_1.procedureRunsTableName) {
|
|
16
40
|
async listForStats(since) {
|
|
17
41
|
return this.table
|
|
18
42
|
.filter((row) => row.key("startedAt").ge(since))
|
|
19
43
|
.orderBy("startedAt", "desc")
|
|
20
|
-
.pluck(
|
|
44
|
+
.pluck(...STATS_FIELDS)
|
|
21
45
|
.run();
|
|
22
46
|
}
|
|
23
|
-
async
|
|
24
|
-
return
|
|
25
|
-
.filter((
|
|
47
|
+
async renameProcedure(procedureId, name) {
|
|
48
|
+
return await this.table
|
|
49
|
+
.filter((row) => row
|
|
50
|
+
.key("procedureId")
|
|
51
|
+
.eq(procedureId)
|
|
52
|
+
.and(row.key("procedureName").ne(name)))
|
|
53
|
+
.update({ procedureName: name })
|
|
54
|
+
.run();
|
|
55
|
+
}
|
|
56
|
+
async markOlderVersions(procedureId, version) {
|
|
57
|
+
return await this.table
|
|
58
|
+
.filter((row) => row
|
|
59
|
+
.key("procedureId")
|
|
60
|
+
.eq(procedureId)
|
|
61
|
+
.and(row.key("procedureVersion").default(version).lt(version))
|
|
62
|
+
.and(row.key("procedureCurrentVersion").default(0).ne(version)))
|
|
63
|
+
.update({ procedureCurrentVersion: version })
|
|
64
|
+
.run();
|
|
65
|
+
}
|
|
66
|
+
async newest(procedureId, query) {
|
|
67
|
+
const [run] = (await this.history(procedureId, query)
|
|
26
68
|
.orderBy("startedAt", "desc")
|
|
27
|
-
.slice(
|
|
69
|
+
.slice(0, 1)
|
|
28
70
|
.pluck(...RUN_SUMMARY_FIELDS)
|
|
29
71
|
.run());
|
|
72
|
+
return run;
|
|
73
|
+
}
|
|
74
|
+
async oldest(procedureId, query) {
|
|
75
|
+
const [run] = (await this.history(procedureId, query)
|
|
76
|
+
.orderBy("startedAt", "asc")
|
|
77
|
+
.slice(0, 1)
|
|
78
|
+
.pluck(...RUN_SUMMARY_FIELDS)
|
|
79
|
+
.run());
|
|
80
|
+
return run;
|
|
81
|
+
}
|
|
82
|
+
async countHistory(procedureId, query) {
|
|
83
|
+
return await this.history(procedureId, query).count().run();
|
|
84
|
+
}
|
|
85
|
+
async successTimings(procedureId, query, limit) {
|
|
86
|
+
return (await this.history(procedureId, { ...query, status: "ok" })
|
|
87
|
+
.orderBy("startedAt", "desc")
|
|
88
|
+
.slice(0, limit)
|
|
89
|
+
.pluck(...RUN_TIMING_FIELDS)
|
|
90
|
+
.run());
|
|
91
|
+
}
|
|
92
|
+
history(procedureId, { tests, after, before, status }) {
|
|
93
|
+
let query = this.table.filter((row) => row
|
|
94
|
+
.key("procedureId")
|
|
95
|
+
.eq(procedureId)
|
|
96
|
+
.and(tests ? row.key("kind").eq("test") : row.key("kind").ne("test")));
|
|
97
|
+
if (after)
|
|
98
|
+
query = query.filter((row) => row.key("startedAt").gt(after));
|
|
99
|
+
if (before)
|
|
100
|
+
query = query.filter((row) => row.key("startedAt").lt(before));
|
|
101
|
+
if (status)
|
|
102
|
+
query = query.filter((row) => row.key("status").eq(status));
|
|
103
|
+
return query;
|
|
30
104
|
}
|
|
31
|
-
async
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
105
|
+
async hasRunBefore(date) {
|
|
106
|
+
const older = await this.table
|
|
107
|
+
.filter((row) => row.key("startedAt").lt(date))
|
|
108
|
+
.slice(0, 1)
|
|
109
|
+
.pluck("_id")
|
|
110
|
+
.run();
|
|
111
|
+
return older.length > 0;
|
|
112
|
+
}
|
|
113
|
+
async purgeBefore(before) {
|
|
114
|
+
return await this.table
|
|
115
|
+
.filter((row) => row.key("startedAt").lt(before))
|
|
116
|
+
.delete()
|
|
117
|
+
.run();
|
|
118
|
+
}
|
|
119
|
+
async listByProcedure(procedureId, page, limit, peek = false) {
|
|
120
|
+
return (await this.table
|
|
121
|
+
.filter((doc) => doc.key("procedureId").eq(procedureId))
|
|
43
122
|
.orderBy("startedAt", "desc")
|
|
44
123
|
.slice(page * limit, peek ? limit + 1 : limit)
|
|
45
124
|
.pluck(...RUN_SUMMARY_FIELDS)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedure_run.model.js","sourceRoot":"","sources":["../../../src/db/models/procedure_run.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,uEAGuC;
|
|
1
|
+
{"version":3,"file":"procedure_run.model.js","sourceRoot":"","sources":["../../../src/db/models/procedure_run.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,uEAGuC;AAgBvC,MAAM,YAAY,GAAG;IACnB,KAAK;IACL,aAAa;IACb,eAAe;IACf,WAAW;IACX,SAAS;IACT,QAAQ;IACR,cAAc;IACd,MAAM;IACN,cAAc;IACd,eAAe;CACP,CAAC;AAqBX,MAAM,kBAAkB,GAAG;IACzB,KAAK;IACL,aAAa;IACb,e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7
|
-
|
|
1
|
+
import type { CellSublineValue } from "@antelopejs/interface-dms/base/table-view";
|
|
2
|
+
import type { BlockText } from "@antelopejs/interface-dms/base/types";
|
|
3
|
+
import { type StepName, type TriggerSummary } from "../../runtime/describe";
|
|
4
|
+
import { type ProcedureHealth, type ProcedureState } from "../../stats/health";
|
|
5
|
+
import type { ProcedureGraph } from "../../types/graph";
|
|
6
|
+
import type { Procedure } from "../tables/procedure.table";
|
|
7
|
+
import { type StatsRun } from "./procedure_run.model";
|
|
8
|
+
export interface StatsWindow {
|
|
9
|
+
from: Date;
|
|
10
|
+
to: Date;
|
|
11
|
+
compareFrom?: Date;
|
|
12
|
+
compareTo?: Date;
|
|
13
|
+
}
|
|
14
|
+
export interface PeriodQuery {
|
|
15
|
+
from?: string;
|
|
16
|
+
to?: string;
|
|
17
|
+
compareFrom?: string;
|
|
18
|
+
compareTo?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function windowOf(query: PeriodQuery, now?: Date): StatsWindow;
|
|
21
|
+
interface ProcedureFacts {
|
|
22
|
+
procedure: Procedure;
|
|
23
|
+
graph: ProcedureGraph | undefined;
|
|
24
|
+
triggers: TriggerSummary[];
|
|
8
25
|
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
runsPerDay7d: Array<{
|
|
26
|
-
day: string;
|
|
27
|
-
ok: number;
|
|
28
|
-
failed: number;
|
|
29
|
-
}>;
|
|
30
|
-
recentFailures: Array<{
|
|
31
|
-
runId: string;
|
|
32
|
-
procedureId: string;
|
|
33
|
-
procedureName: string;
|
|
34
|
-
startedAt: string;
|
|
35
|
-
errorMessage: string;
|
|
36
|
-
}>;
|
|
37
|
-
topProcedures7d: Array<{
|
|
38
|
-
procedureId: string;
|
|
39
|
-
name: string;
|
|
40
|
-
runs: number;
|
|
41
|
-
ok: number;
|
|
42
|
-
failed: number;
|
|
43
|
-
}>;
|
|
44
|
-
recentRuns: Array<{
|
|
45
|
-
runId: string;
|
|
46
|
-
procedureId: string;
|
|
47
|
-
procedureName: string;
|
|
48
|
-
status: string;
|
|
49
|
-
startedAt: string;
|
|
50
|
-
durationMs: number | null;
|
|
51
|
-
}>;
|
|
52
|
-
needsAttention: Array<{
|
|
53
|
-
procedureId: string;
|
|
54
|
-
name: string;
|
|
55
|
-
kind: "paused" | "failing";
|
|
56
|
-
failed: number;
|
|
57
|
-
lastRunAt: string | null;
|
|
58
|
-
}>;
|
|
26
|
+
export interface StatsContext {
|
|
27
|
+
now: Date;
|
|
28
|
+
procedures: ProcedureFacts[];
|
|
29
|
+
byId: Map<string, ProcedureFacts>;
|
|
30
|
+
runs: StatsRun[];
|
|
31
|
+
}
|
|
32
|
+
export declare function loadStatsContext(earliest?: Date, now?: Date): Promise<StatsContext>;
|
|
33
|
+
export declare function healthByProcedure(ctx: StatsContext, since?: Date): Map<string, ProcedureHealth>;
|
|
34
|
+
export declare function failedStepOf(ctx: StatsContext, run: Pick<StatsRun, "procedureId" | "failedNodeId">): StepName | undefined;
|
|
35
|
+
export declare function procedureNameOf(ctx: StatsContext, procedureId: string): string | undefined;
|
|
36
|
+
export declare function windowRuns(ctx: StatsContext, window: StatsWindow): StatsRun[];
|
|
37
|
+
interface RecentRunCell {
|
|
38
|
+
runId: string;
|
|
39
|
+
status: string;
|
|
40
|
+
startedAt: string;
|
|
41
|
+
errorMessage: string | null;
|
|
59
42
|
}
|
|
60
|
-
export declare function getStatsSnapshot(now?: Date): Promise<StatsSnapshot>;
|
|
61
43
|
export interface ProcedureSummaryRow {
|
|
62
44
|
procedureId: string;
|
|
63
45
|
name: string;
|
|
46
|
+
description: string;
|
|
64
47
|
enabled: boolean;
|
|
65
48
|
trigger: string | null;
|
|
66
|
-
|
|
49
|
+
triggerTypes: string[];
|
|
50
|
+
triggerSummary: TriggerSummary | null;
|
|
51
|
+
triggers: TriggerSummary[];
|
|
52
|
+
triggerText: BlockText;
|
|
53
|
+
triggerTypeText: BlockText | null;
|
|
54
|
+
triggerCount: number;
|
|
55
|
+
status: ProcedureState;
|
|
56
|
+
statusDetail: CellSublineValue | null;
|
|
57
|
+
lastError: string | null;
|
|
67
58
|
lastRunAt: string | null;
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
lastRunId: string | null;
|
|
60
|
+
lastRuns: RecentRunCell[];
|
|
61
|
+
successRate: number | null;
|
|
62
|
+
avgDurationMs: number | null;
|
|
70
63
|
runs: number;
|
|
64
|
+
failed: number;
|
|
65
|
+
failingSince: string | null;
|
|
66
|
+
failedStep: StepName | null;
|
|
67
|
+
version: number;
|
|
68
|
+
updatedAt: string | null;
|
|
71
69
|
}
|
|
72
70
|
export declare function getProceduresSummary(now?: Date): Promise<ProcedureSummaryRow[]>;
|
|
71
|
+
export declare function getProcedureSummary(procedureId: string, now?: Date): Promise<ProcedureSummaryRow | undefined>;
|
|
73
72
|
export {};
|