@antelopejs/dms-automation 0.7.0 → 0.9.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 +33 -22
- package/dist/cluster/bus.js +8 -6
- package/dist/cluster/bus.js.map +1 -1
- package/dist/cluster/leader.js.map +1 -1
- package/dist/data/procedures-query.d.ts +19 -0
- package/dist/data/procedures-query.js +105 -0
- package/dist/data/procedures-query.js.map +1 -0
- package/dist/data/procedures-table.d.ts +5 -20
- package/dist/data/procedures-table.js +10 -106
- package/dist/data/procedures-table.js.map +1 -1
- package/dist/data/runs-table.d.ts +3 -3
- package/dist/data/runs-table.js.map +1 -1
- package/dist/db/models/automation_template.model.d.ts +13 -13
- package/dist/db/models/automation_template.model.js +13 -14
- package/dist/db/models/automation_template.model.js.map +1 -1
- package/dist/db/models/procedure.model.d.ts +7 -5
- package/dist/db/models/procedure_run.model.d.ts +9 -6
- package/dist/db/models/procedure_run.model.js +8 -8
- package/dist/db/models/procedure_run.model.js.map +1 -1
- package/dist/db/models/stats.model.js.map +1 -1
- package/dist/db/models/type_switch.model.d.ts +7 -5
- package/dist/db/tables/procedure_run.table.d.ts +2 -1
- package/dist/db/tables/procedure_run.table.js.map +1 -1
- package/dist/implementations/dms-automation/index.d.ts +2 -2
- package/dist/implementations/dms-automation/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/category.js.map +1 -1
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/procedures.js.map +1 -1
- package/dist/pages/runs.js.map +1 -1
- package/dist/pages/shared.js +1 -1
- package/dist/pages/shared.js.map +1 -1
- package/dist/realtime.d.ts +2 -1
- package/dist/realtime.js.map +1 -1
- package/dist/routes/action-types.d.ts +3 -2
- package/dist/routes/action-types.js.map +1 -1
- package/dist/routes/data-node-types.d.ts +1 -1
- package/dist/routes/deleteConfirm.js +4 -3
- package/dist/routes/deleteConfirm.js.map +1 -1
- package/dist/routes/graphSchema.d.ts +2 -1
- package/dist/routes/graphSchema.js +13 -10
- package/dist/routes/graphSchema.js.map +1 -1
- package/dist/routes/library.d.ts +12 -1
- package/dist/routes/library.js +38 -34
- package/dist/routes/library.js.map +1 -1
- package/dist/routes/procedureChecks.js +5 -5
- package/dist/routes/procedureChecks.js.map +1 -1
- package/dist/routes/procedureRuns.d.ts +3 -3
- package/dist/routes/procedureRuns.js +1 -1
- package/dist/routes/procedureRuns.js.map +1 -1
- package/dist/routes/procedureSchemas.d.ts +7 -6
- package/dist/routes/procedureSchemas.js +4 -2
- package/dist/routes/procedureSchemas.js.map +1 -1
- package/dist/routes/procedures.d.ts +15 -14
- package/dist/routes/procedures.js +2 -1
- package/dist/routes/procedures.js.map +1 -1
- package/dist/routes/requests.d.ts +12 -6
- package/dist/routes/requests.js +2 -1
- package/dist/routes/requests.js.map +1 -1
- package/dist/routes/runs.d.ts +9 -8
- package/dist/routes/runs.js +5 -3
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/stats.js.map +1 -1
- package/dist/routes/templates.d.ts +5 -4
- package/dist/routes/templates.js +2 -1
- package/dist/routes/templates.js.map +1 -1
- package/dist/routes/trigger-types.d.ts +3 -2
- package/dist/routes/trigger-types.js.map +1 -1
- package/dist/routes/typeConfigShared.d.ts +2 -1
- package/dist/routes/typeConfigShared.js.map +1 -1
- package/dist/routes/zodJson.d.ts +3 -0
- package/dist/routes/zodJson.js +21 -0
- package/dist/routes/zodJson.js.map +1 -0
- package/dist/runtime/armErrors.d.ts +0 -1
- package/dist/runtime/armErrors.js +5 -12
- package/dist/runtime/armErrors.js.map +1 -1
- package/dist/runtime/boundRunLog.d.ts +7 -5
- package/dist/runtime/boundRunLog.js +24 -20
- package/dist/runtime/boundRunLog.js.map +1 -1
- package/dist/runtime/builtins/actions/http.d.ts +7 -3
- package/dist/runtime/builtins/actions/http.js +33 -22
- package/dist/runtime/builtins/actions/http.js.map +1 -1
- package/dist/runtime/builtins/actions/log.d.ts +5 -4
- package/dist/runtime/builtins/actions/log.js.map +1 -1
- package/dist/runtime/builtins/data/boolean.d.ts +2 -1
- package/dist/runtime/builtins/data/boolean.js +4 -5
- package/dist/runtime/builtins/data/boolean.js.map +1 -1
- package/dist/runtime/builtins/data/compare.js +8 -10
- package/dist/runtime/builtins/data/compare.js.map +1 -1
- package/dist/runtime/builtins/data/constant.js +1 -1
- package/dist/runtime/builtins/data/constant.js.map +1 -1
- package/dist/runtime/builtins/data/json.js +4 -5
- package/dist/runtime/builtins/data/json.js.map +1 -1
- package/dist/runtime/builtins/data/math.js +4 -4
- package/dist/runtime/builtins/data/math.js.map +1 -1
- package/dist/runtime/builtins/data/object.js +27 -27
- package/dist/runtime/builtins/data/object.js.map +1 -1
- package/dist/runtime/builtins/data/string.js +13 -18
- package/dist/runtime/builtins/data/string.js.map +1 -1
- package/dist/runtime/builtins/nodes/action.js +16 -5
- package/dist/runtime/builtins/nodes/action.js.map +1 -1
- package/dist/runtime/builtins/nodes/data.js +2 -2
- package/dist/runtime/builtins/nodes/data.js.map +1 -1
- package/dist/runtime/builtins/nodes/delay.js +2 -2
- package/dist/runtime/builtins/nodes/delay.js.map +1 -1
- package/dist/runtime/builtins/nodes/forRange.js +2 -2
- package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
- package/dist/runtime/builtins/nodes/foreach.js +2 -2
- package/dist/runtime/builtins/nodes/foreach.js.map +1 -1
- package/dist/runtime/builtins/nodes/groupInput.js +2 -2
- package/dist/runtime/builtins/nodes/groupInput.js.map +1 -1
- package/dist/runtime/builtins/nodes/groupOutput.js +2 -2
- package/dist/runtime/builtins/nodes/groupOutput.js.map +1 -1
- package/dist/runtime/builtins/nodes/if.js +2 -2
- package/dist/runtime/builtins/nodes/if.js.map +1 -1
- package/dist/runtime/builtins/nodes/parallel.js +2 -2
- package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
- package/dist/runtime/builtins/nodes/retry.js +13 -5
- package/dist/runtime/builtins/nodes/retry.js.map +1 -1
- package/dist/runtime/builtins/nodes/setVariable.js +2 -2
- package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
- package/dist/runtime/builtins/nodes/switch.js +8 -3
- package/dist/runtime/builtins/nodes/switch.js.map +1 -1
- package/dist/runtime/builtins/nodes/trigger.js +2 -2
- package/dist/runtime/builtins/nodes/trigger.js.map +1 -1
- package/dist/runtime/builtins/nodes/tryCatch.js +2 -2
- package/dist/runtime/builtins/nodes/tryCatch.js.map +1 -1
- package/dist/runtime/builtins/triggers/cron.d.ts +4 -3
- package/dist/runtime/builtins/triggers/cron.js +5 -7
- package/dist/runtime/builtins/triggers/cron.js.map +1 -1
- package/dist/runtime/builtins/triggers/webhook.d.ts +11 -7
- package/dist/runtime/builtins/triggers/webhook.js +15 -12
- package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
- package/dist/runtime/declaredProcedures.d.ts +2 -2
- package/dist/runtime/declaredProcedures.js +3 -2
- package/dist/runtime/declaredProcedures.js.map +1 -1
- package/dist/runtime/describe.d.ts +3 -1
- package/dist/runtime/describe.js +14 -13
- package/dist/runtime/describe.js.map +1 -1
- package/dist/runtime/executor.d.ts +2 -1
- package/dist/runtime/executor.js +18 -13
- package/dist/runtime/executor.js.map +1 -1
- package/dist/runtime/flatten.d.ts +1 -1
- package/dist/runtime/flatten.js +1 -1
- package/dist/runtime/flatten.js.map +1 -1
- package/dist/runtime/graphIssues.d.ts +2 -2
- package/dist/runtime/graphIssues.js +39 -32
- package/dist/runtime/graphIssues.js.map +1 -1
- package/dist/runtime/graphVersion.d.ts +1 -1
- package/dist/runtime/graphVersion.js +4 -3
- package/dist/runtime/graphVersion.js.map +1 -1
- package/dist/runtime/nodeKinds.d.ts +6 -5
- package/dist/runtime/nodeKinds.js.map +1 -1
- package/dist/runtime/reconcile.d.ts +3 -0
- package/dist/runtime/reconcile.js +178 -0
- package/dist/runtime/reconcile.js.map +1 -0
- package/dist/runtime/registry.d.ts +3 -3
- package/dist/runtime/resolveInputs.d.ts +13 -8
- package/dist/runtime/resolveInputs.js +18 -18
- package/dist/runtime/resolveInputs.js.map +1 -1
- package/dist/runtime/resolveSubgraph.js +4 -5
- package/dist/runtime/resolveSubgraph.js.map +1 -1
- package/dist/runtime/retention.js.map +1 -1
- package/dist/runtime/runProcedure.d.ts +3 -2
- package/dist/runtime/runProcedure.js +2 -1
- package/dist/runtime/runProcedure.js.map +1 -1
- package/dist/runtime/schedule.js +3 -0
- package/dist/runtime/schedule.js.map +1 -1
- package/dist/runtime/schemaProperties.d.ts +3 -0
- package/dist/runtime/schemaProperties.js +7 -0
- package/dist/runtime/schemaProperties.js.map +1 -0
- package/dist/runtime/serialQueue.d.ts +1 -1
- package/dist/runtime/serialQueue.js +4 -4
- package/dist/runtime/serialQueue.js.map +1 -1
- package/dist/runtime/sideEffects.d.ts +2 -2
- package/dist/runtime/subscriptions.d.ts +6 -4
- package/dist/runtime/subscriptions.js +21 -180
- package/dist/runtime/subscriptions.js.map +1 -1
- package/dist/runtime/subwalk.js.map +1 -1
- package/dist/runtime/templateCacheState.d.ts +6 -0
- package/dist/runtime/templateCacheState.js +10 -0
- package/dist/runtime/templateCacheState.js.map +1 -0
- package/dist/runtime/templateUsages.js +4 -5
- package/dist/runtime/templateUsages.js.map +1 -1
- package/dist/runtime/topo.js +2 -4
- package/dist/runtime/topo.js.map +1 -1
- package/dist/runtime/trace.d.ts +5 -2
- package/dist/runtime/trace.js +27 -17
- package/dist/runtime/trace.js.map +1 -1
- package/dist/runtime/triggerHandles.d.ts +4 -3
- package/dist/runtime/triggerHandles.js +9 -1
- package/dist/runtime/triggerHandles.js.map +1 -1
- package/dist/runtime/typeOrigin.js +12 -1
- package/dist/runtime/typeOrigin.js.map +1 -1
- package/dist/runtime/validate.js.map +1 -1
- package/dist/runtime/validateTemplate.js.map +1 -1
- package/dist/runtime/withTimeout.js.map +1 -1
- package/dist/runtime/wording.js +12 -8
- package/dist/runtime/wording.js.map +1 -1
- package/dist/stats/health-banner.js.map +1 -1
- package/dist/stats/health.js.map +1 -1
- package/dist/stats/kpi.js +1 -1
- package/dist/stats/kpi.js.map +1 -1
- package/dist/stats/overview.js +2 -1
- package/dist/stats/overview.js.map +1 -1
- package/dist/types/dataValue.d.ts +7 -0
- package/dist/types/dataValue.js +56 -0
- package/dist/types/dataValue.js.map +1 -0
- package/dist/types/graph.d.ts +19 -13
- package/dist/types/graph.js +8 -0
- package/dist/types/graph.js.map +1 -1
- package/dist/types/guards.d.ts +8 -0
- package/dist/types/guards.js +35 -0
- package/dist/types/guards.js.map +1 -0
- package/dist/types/runLog.d.ts +8 -7
- package/dist/types/runLog.js.map +1 -1
- package/frontend-vue/app/build/components/editor/EditorBanners.vue +120 -0
- package/frontend-vue/app/build/components/editor/EditorChoiceModal.vue +44 -0
- package/frontend-vue/app/build/components/editor/EditorForkModal.vue +51 -0
- package/frontend-vue/app/build/components/editor/EditorHeader.vue +146 -0
- package/frontend-vue/app/build/components/editor/EditorSaveTemplateModal.vue +105 -0
- package/frontend-vue/app/build/components/editor/NodeInspectorDocs.vue +28 -0
- package/frontend-vue/app/build/components/editor/NodeInspectorRun.vue +48 -0
- package/frontend-vue/app/build/composables/editor/useBuilderMount.ts +129 -0
- package/frontend-vue/app/build/composables/editor/useBuilderSave.ts +256 -0
- package/frontend-vue/app/build/composables/editor/useBuilderShortcuts.ts +270 -0
- package/frontend-vue/app/build/composables/editor/useDraftProblems.ts +288 -0
- package/frontend-vue/app/build/composables/editor/useEditorContext.ts +388 -0
- package/frontend-vue/app/build/composables/editor/useEditorLoad.ts +158 -0
- package/frontend-vue/app/build/composables/editor/useForkToLocal.ts +193 -0
- package/frontend-vue/app/build/composables/editor/useGraphHistory.ts +113 -0
- package/frontend-vue/app/build/composables/editor/useGroupEditing.ts +445 -0
- package/frontend-vue/app/build/composables/editor/usePalette.ts +41 -0
- package/frontend-vue/app/build/composables/editor/useProcedureActions.ts +96 -0
- package/frontend-vue/app/build/composables/editor/useRunOverlay.ts +466 -0
- package/frontend-vue/app/build/composables/editor/useSaveAsTemplate.ts +172 -0
- package/frontend-vue/app/build/composables/editor/useSavedTriggers.ts +100 -0
- package/frontend-vue/app/build/composables/editor/useSubgraphNavigation.ts +270 -0
- package/frontend-vue/app/build/composables/editor/useUnsavedGuards.ts +233 -0
- package/frontend-vue/app/build/composables/graphCanvas/connect.ts +273 -0
- package/frontend-vue/app/build/composables/graphCanvas/edgeEvents.ts +172 -0
- package/frontend-vue/app/build/composables/graphCanvas/edges.ts +55 -0
- package/frontend-vue/app/build/composables/graphCanvas/handles.ts +181 -0
- package/frontend-vue/app/build/composables/graphCanvas/linkMenu.ts +123 -0
- package/frontend-vue/app/build/composables/graphCanvas/nodeData.ts +222 -0
- package/frontend-vue/app/build/composables/graphCanvas/placement.ts +248 -0
- package/frontend-vue/app/build/composables/graphCanvas/selection.ts +150 -0
- package/frontend-vue/app/build/composables/graphCanvas/types.ts +188 -0
- package/frontend-vue/app/build/composables/graphCanvas/view.ts +230 -0
- package/frontend-vue/app/build/types/editor.ts +94 -0
- package/frontend-vue/app/build/utils/editor/apiErrors.ts +74 -0
- package/frontend-vue/app/build/utils/editor/graphShape.ts +68 -0
- package/frontend-vue/app/build/utils/editor/groupPlan.ts +322 -0
- package/frontend-vue/app/build/utils/editor/groupPorts.ts +210 -0
- package/frontend-vue/app/build/utils/editor/keyboard.ts +22 -0
- package/frontend-vue/app/build/utils/inspectorFields.ts +117 -0
- package/frontend-vue/app/build/utils/templates.ts +88 -0
- package/frontend-vue/app/components/AttentionList.vue +2 -6
- package/frontend-vue/app/components/Catalog.vue +2 -1
- package/frontend-vue/app/components/Editor/GraphCanvas.vue +78 -1337
- package/frontend-vue/app/components/Editor/NodeInspector.vue +31 -123
- package/frontend-vue/app/components/Editor.vue +134 -3484
- package/frontend-vue/app/components/Templates.vue +14 -84
- package/frontend-vue/build/backend-boundary.ts +122 -0
- package/frontend-vue/dms.frontend.build.ts +2 -0
- package/frontend-vue/eslint-rules/index.mjs +103 -0
- package/frontend-vue/eslint.config.mjs +15 -0
- package/frontend-vue/package.json +8 -5
- package/frontend-vue/pnpm-lock.yaml +168 -139
- package/frontend-vue/tests/api-error-presentation.test.cjs +254 -0
- package/frontend-vue/tests/helpers/setup.cjs +44 -0
- package/package.json +18 -15
- package/skills/dms-automation/SKILL.md +2 -2
- package/skills/dms-automation/cases.json +58 -0
package/dist/realtime.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataRecord } from "./types/dataValue";
|
|
1
2
|
export declare const RUNS_TOPIC = "automation.runs";
|
|
2
3
|
export declare const PROCEDURES_TOPIC = "automation.procedures";
|
|
3
|
-
export declare function notifyTopic(topic: string, type: string, payload?:
|
|
4
|
+
export declare function notifyTopic(topic: string, type: string, payload?: DataRecord): void;
|
package/dist/realtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":";;;AAoBA,kCAUC;AA9BD,gEAA6D;AAC7D,6DAA2D;AAU9C,QAAA,UAAU,GAAG,iBAAiB,CAAC;AAG/B,QAAA,gBAAgB,GAAG,uBAAuB,CAAC;AAMxD,SAAgB,WAAW,CACzB,KAAa,EACb,IAAY,EACZ,OAAoB;IAEpB,IAAA,8BAAc,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAClE,CAAC,GAAY,EAAE,EAAE;QACf,iBAAO,CAAC,IAAI,CAAC,yCAAyC,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
import type { DataValue } from "../types/dataValue";
|
|
2
3
|
declare const ActionTypesController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
4
|
export declare class ActionTypesController extends ActionTypesController_base {
|
|
4
|
-
list(_user: User): Promise<(Omit<import("@antelopejs/interface-dms-automation").ActionType<unknown,
|
|
5
|
+
list(_user: User): Promise<(Omit<import("@antelopejs/interface-dms-automation").ActionType<unknown, void | import("@antelopejs/interface-dms-automation").JsonObject>, "execute"> & import("../runtime/typeOrigin").TypeOrigin & {
|
|
5
6
|
enabled: boolean;
|
|
6
7
|
})[]>;
|
|
7
|
-
setConfig(_user: User, id: string, body:
|
|
8
|
+
setConfig(_user: User, id: string, body: DataValue): Promise<{
|
|
8
9
|
id: string;
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-types.js","sourceRoot":"","sources":["../../src/routes/action-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAMmC;AACnC,6DAA0E;AAC1E,yDAA4E;AAE5E,8CAAyD;AACzD,kDAA+C;AAC/C,yDAI4B;
|
|
1
|
+
{"version":3,"file":"action-types.js","sourceRoot":"","sources":["../../src/routes/action-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAMmC;AACnC,6DAA0E;AAC1E,yDAA4E;AAE5E,8CAAyD;AACzD,kDAA+C;AAC/C,yDAI4B;AAIrB,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,IAAA,0BAAU,EACnD,8BAA8B,CAC/B;IAEO,AAAN,KAAK,CAAC,IAAI,CAAgB,KAAW;QACnC,OAAO,MAAM,IAAA,mCAAgB,EAC3B,QAAQ,EACR,mBAAQ,CAAC,WAAW,EAAE,EACtB,kCAAe,CAChB,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CACkC,KAAW,EAChC,EAAU,EACxB,IAAe;QAE3B,OAAO,MAAM,IAAA,6BAAU,EAAC,QAAQ,EAAE,mBAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AApBY,sDAAqB;AAI1B;IADL,IAAA,mBAAG,EAAC,EAAE,CAAC;IACI,WAAA,IAAA,kBAAW,GAAE,CAAA;;;;iDAMxB;AAGK;IADL,IAAA,mBAAG,EAAC,aAAa,CAAC;IAEhB,WAAA,IAAA,+BAAsB,EAAC,+BAAqB,CAAC,CAAA;IAC7C,WAAA,IAAA,yBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACxB,WAAA,IAAA,wBAAQ,GAAE,CAAA;;;;sDAGZ;gCAnBU,qBAAqB;IADjC,IAAA,oBAAa,GAAE;GACH,qBAAqB,CAoBjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
2
|
declare const DataNodeTypesController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
3
|
export declare class DataNodeTypesController extends DataNodeTypesController_base {
|
|
4
|
-
list(_user: User): Promise<(Omit<import("@antelopejs/interface-dms-automation").DataNodeType<unknown,
|
|
4
|
+
list(_user: User): Promise<(Omit<import("@antelopejs/interface-dms-automation").DataNodeType<unknown, import("@antelopejs/interface-dms-automation").JsonObject>, "evaluate"> & import("../runtime/typeOrigin").TypeOrigin)[]>;
|
|
5
5
|
}
|
|
6
6
|
export {};
|
|
@@ -4,16 +4,17 @@ exports.deleteDialogOf = deleteDialogOf;
|
|
|
4
4
|
const describe_1 = require("../runtime/describe");
|
|
5
5
|
const wording_1 = require("../runtime/wording");
|
|
6
6
|
const requests_1 = require("./requests");
|
|
7
|
+
const guards_1 = require("../types/guards");
|
|
7
8
|
const WEEKDAY_KEY = /\.days\.(\w+)$/;
|
|
8
9
|
function scheduleImpact(cron, params) {
|
|
9
10
|
const text = (0, wording_1.cronText)(cron);
|
|
10
|
-
if (
|
|
11
|
+
if ((0, guards_1.isString)(text))
|
|
11
12
|
return text;
|
|
12
13
|
const own = { ...text.params };
|
|
13
14
|
let key = text.key;
|
|
14
15
|
const day = own.day;
|
|
15
|
-
if (
|
|
16
|
-
const weekday = WEEKDAY_KEY.exec(day.key
|
|
16
|
+
if ((0, guards_1.isObject)(day)) {
|
|
17
|
+
const weekday = WEEKDAY_KEY.exec("key" in day ? day.key : "")?.[1];
|
|
17
18
|
if (!weekday)
|
|
18
19
|
return cron;
|
|
19
20
|
key = `${requests_1.API_MESSAGES.slice(1)}.weekly.${weekday}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteConfirm.js","sourceRoot":"","sources":["../../src/routes/deleteConfirm.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deleteConfirm.js","sourceRoot":"","sources":["../../src/routes/deleteConfirm.ts"],"names":[],"mappings":";;AAoEA,wCAuBC;AAtFD,kDAAiE;AACjE,gDAA8C;AAE9C,yCAA0C;AAC1C,4CAAqD;AAErD,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAWrC,SAAS,cAAc,CAAC,IAAY,EAAE,MAAoB;IACxD,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,IAAA,iBAAQ,EAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACnB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpB,IAAI,IAAA,iBAAQ,EAAC,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO;YAAE,OAAO,I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EAAE,wCAAwC;QAC/C,WAAW,EAAE,SAAS,CAAC,OAAO;YAC5B,CAAC,CAAC,GAAG,uBAAY,2BAA2B;YAC5C,CAAC,CAAC,GAAG,uBAAY,oBAAoB;QACvC,MAAM;QACN,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,0CAA0C;QACxD,MAAM,EAAE,SAAS,CAAC,OAAO;YACvB,CAAC,CAAC,UAAU,CAAC,IAAA,yBAAc,EAAC,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YACrD,CAAC,CAAC,EAAE;KACP,CAAC;IACF,IAAI,SAAS,CAAC,OAAO;QAAE,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IAC3D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type DataValue } from "../types/dataValue";
|
|
2
3
|
import type { GroupPort, ProcedureGraph } from "../types/graph";
|
|
3
4
|
export declare const groupPortSchema: z.ZodType<GroupPort>;
|
|
4
5
|
export declare const procedureGraphSchema: z.ZodType<ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
5
|
-
export declare function parseAndValidate<T>(schema: z.ZodType<T, z.ZodTypeDef, unknown>, body:
|
|
6
|
+
export declare function parseAndValidate<T>(schema: z.ZodType<T, z.ZodTypeDef, unknown>, body: DataValue, graphSelector: (data: T) => ProcedureGraph): T;
|
|
@@ -6,6 +6,9 @@ const interface_api_1 = require("@antelopejs/interface-api");
|
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
const nodeKinds_1 = require("../runtime/nodeKinds");
|
|
8
8
|
const validate_1 = require("../runtime/validate");
|
|
9
|
+
const dataValue_1 = require("../types/dataValue");
|
|
10
|
+
const guards_1 = require("../types/guards");
|
|
11
|
+
const zodJson_1 = require("./zodJson");
|
|
9
12
|
const nodeKindSchema = (0, nodeKinds_1.nodeKindZodSchema)();
|
|
10
13
|
exports.groupPortSchema = zod_1.z.object({
|
|
11
14
|
name: zod_1.z.string().min(1),
|
|
@@ -28,43 +31,43 @@ function groupDepthOf(value, max) {
|
|
|
28
31
|
const pending = [
|
|
29
32
|
{ graph: value, depth: 0 },
|
|
30
33
|
];
|
|
31
|
-
|
|
32
|
-
const { graph, depth } =
|
|
34
|
+
for (let item = pending.pop(); item; item = pending.pop()) {
|
|
35
|
+
const { graph, depth } = item;
|
|
33
36
|
deepest = Math.max(deepest, depth);
|
|
34
37
|
if (deepest > max)
|
|
35
38
|
return deepest;
|
|
36
|
-
const nodes = graph
|
|
39
|
+
const nodes = (0, guards_1.isObject)(graph) && "nodes" in graph ? graph.nodes : undefined;
|
|
37
40
|
if (!Array.isArray(nodes))
|
|
38
41
|
continue;
|
|
39
42
|
for (const node of nodes) {
|
|
40
|
-
const subgraph = node
|
|
43
|
+
const subgraph = (0, guards_1.isObject)(node) && "subgraph" in node ? node.subgraph : undefined;
|
|
41
44
|
if (subgraph)
|
|
42
45
|
pending.push({ graph: subgraph, depth: depth + 1 });
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
return deepest;
|
|
46
49
|
}
|
|
47
|
-
const
|
|
50
|
+
const graphBodySchema = zod_1.z.lazy(() => zod_1.z.object({
|
|
48
51
|
nodes: zod_1.z.array(graphNodeSchema),
|
|
49
52
|
triggerEdges: zod_1.z.array(triggerEdgeSchema),
|
|
50
53
|
dataEdges: zod_1.z.array(dataEdgeSchema),
|
|
51
54
|
}));
|
|
52
55
|
exports.procedureGraphSchema = zod_1.z
|
|
53
|
-
.
|
|
56
|
+
.custom(dataValue_1.isDataValue)
|
|
54
57
|
.refine((graph) => groupDepthOf(graph, validate_1.MAX_GROUP_DEPTH) <= validate_1.MAX_GROUP_DEPTH, {
|
|
55
58
|
message: `groups are nested more than ${validate_1.MAX_GROUP_DEPTH} levels deep`,
|
|
56
59
|
})
|
|
57
|
-
.pipe(
|
|
60
|
+
.pipe(graphBodySchema);
|
|
58
61
|
const graphNodeSchema = zod_1.z.lazy(() => zod_1.z
|
|
59
62
|
.object({
|
|
60
63
|
id: zod_1.z.string(),
|
|
61
64
|
kind: nodeKindSchema,
|
|
62
65
|
typeId: zod_1.z.string().optional(),
|
|
63
|
-
config: zod_1.z.record(zod_1.z.
|
|
66
|
+
config: zod_1.z.record(zod_1.z.custom(dataValue_1.isDataValue)),
|
|
64
67
|
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number() }),
|
|
65
68
|
templateId: zod_1.z.string().optional(),
|
|
66
69
|
ports: zod_1.z.array(zod_1.z.lazy(() => exports.groupPortSchema)).optional(),
|
|
67
|
-
subgraph:
|
|
70
|
+
subgraph: graphBodySchema.optional(),
|
|
68
71
|
})
|
|
69
72
|
.passthrough());
|
|
70
73
|
function parseAndValidate(schema, body, graphSelector) {
|
|
@@ -72,7 +75,7 @@ function parseAndValidate(schema, body, graphSelector) {
|
|
|
72
75
|
if (!parsed.success) {
|
|
73
76
|
throw new interface_api_1.HTTPResult(400, {
|
|
74
77
|
error: "invalid body",
|
|
75
|
-
issues: parsed.error.issues,
|
|
78
|
+
issues: (0, zodJson_1.zodIssuesJson)(parsed.error.issues),
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
81
|
const verdict = (0, validate_1.validateGraph)(graphSelector(parsed.data));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphSchema.js","sourceRoot":"","sources":["../../src/routes/graphSchema.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"graphSchema.js","sourceRoot":"","sources":["../../src/routes/graphSchema.ts"],"names":[],"mappings":";;;AAoHA,4CAoBC;AAxID,6DAAuD;AACvD,6BAAwB;AACxB,oDAAyD;AACzD,kDAI6B;AAC7B,kDAAiE;AAEjE,4CAA2C;AAC3C,uCAA0C;AAU1C,MAAM,cAAc,GAAG,IAAA,6BAAiB,GAAE,CAAC;AAE9B,QAAA,eAAe,GAAyB,OAAC,CAAC,MAAM,CA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AAG,EAAE;YACxB,KAAK,EAAE,cAAc;YACrB,MAAM,EAAE,IAAA,uBAAa,EAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC;IACD,MAAM,OAAO,GAAmB,IAAA,wBAAa,EAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,0BAAU,CAAC,GAAG,EAAE;YACxB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
package/dist/routes/library.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type RequestContext } from "@antelopejs/interface-api";
|
|
2
2
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
3
3
|
import type { BlockText } from "@antelopejs/interface-dms/base/types";
|
|
4
|
-
import type
|
|
4
|
+
import { type StatsContext } from "../db/models/stats.model";
|
|
5
|
+
import type { GraphNode, ProcedureGraph } from "../types/graph";
|
|
5
6
|
interface TypeUsage {
|
|
6
7
|
procedureId: string;
|
|
7
8
|
procedureName: string;
|
|
@@ -22,6 +23,16 @@ interface TypeUsage {
|
|
|
22
23
|
cronText?: BlockText;
|
|
23
24
|
}
|
|
24
25
|
export declare function triggerUsageOf(node: GraphNode): Pick<TypeUsage, "method" | "path" | "cron" | "timeZone" | "cronText">;
|
|
26
|
+
interface UsageTemplate {
|
|
27
|
+
_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
subgraph: ProcedureGraph;
|
|
30
|
+
}
|
|
31
|
+
export declare function usageByEntry(procedures: StatsContext["procedures"], templateById: ReadonlyMap<string, UsageTemplate>, health: ReadonlyMap<string, {
|
|
32
|
+
state: string;
|
|
33
|
+
}>, entryOf: (node: GraphNode) => string | undefined): {
|
|
34
|
+
[k: string]: TypeUsage[];
|
|
35
|
+
};
|
|
25
36
|
declare const LibraryController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
26
37
|
export declare class LibraryController extends LibraryController_base {
|
|
27
38
|
counts(_user: User): Promise<{
|
package/dist/routes/library.js
CHANGED
|
@@ -14,6 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.LibraryController = void 0;
|
|
16
16
|
exports.triggerUsageOf = triggerUsageOf;
|
|
17
|
+
exports.usageByEntry = usageByEntry;
|
|
17
18
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
18
19
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
19
20
|
const api_base_url_1 = require("@antelopejs/interface-dms/api-base-url");
|
|
@@ -47,6 +48,42 @@ function triggerUsageOf(node) {
|
|
|
47
48
|
cronText: cron ? (0, wording_1.cronText)(cron, timeZone) : undefined,
|
|
48
49
|
};
|
|
49
50
|
}
|
|
51
|
+
function usageByEntry(procedures, templateById, health, entryOf) {
|
|
52
|
+
const out = new Map();
|
|
53
|
+
for (const { procedure, graph } of procedures) {
|
|
54
|
+
if (!graph)
|
|
55
|
+
continue;
|
|
56
|
+
for (const { node, groups, viaTemplate } of (0, resolveSubgraph_1.walkPlacedNodes)(graph, templateById)) {
|
|
57
|
+
const entry = entryOf(node);
|
|
58
|
+
if (!entry)
|
|
59
|
+
continue;
|
|
60
|
+
const group = groups.at(-1);
|
|
61
|
+
const template = viaTemplate?.templateId
|
|
62
|
+
? templateById.get(viaTemplate.templateId)
|
|
63
|
+
: undefined;
|
|
64
|
+
const usage = {
|
|
65
|
+
procedureId: procedure._id,
|
|
66
|
+
procedureName: procedure.name,
|
|
67
|
+
enabled: procedure.enabled,
|
|
68
|
+
state: health.get(procedure._id)?.state ?? "draft",
|
|
69
|
+
nodeId: viaTemplate?.id ?? node.id,
|
|
70
|
+
nodeLabel: (0, describe_1.labelOf)(node) ?? null,
|
|
71
|
+
groupPath: groups.map((g) => g.id),
|
|
72
|
+
groupLabel: group ? ((0, describe_1.labelOf)(group) ?? null) : null,
|
|
73
|
+
viaTemplate: template
|
|
74
|
+
? { id: template._id, name: template.name }
|
|
75
|
+
: null,
|
|
76
|
+
};
|
|
77
|
+
if (node.kind === "trigger") {
|
|
78
|
+
Object.assign(usage, triggerUsageOf(node));
|
|
79
|
+
}
|
|
80
|
+
const usages = out.get(entry) ?? [];
|
|
81
|
+
usages.push(usage);
|
|
82
|
+
out.set(entry, usages);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return Object.fromEntries(out);
|
|
86
|
+
}
|
|
50
87
|
let LibraryController = class LibraryController extends (0, interface_api_1.Controller)("/api/automation/library") {
|
|
51
88
|
async counts(_user) {
|
|
52
89
|
const templates = await (0, interface_database_decorators_1.GetModel)(automation_template_model_1.AutomationTemplateModel, constants_1.DATABASE_NAME)
|
|
@@ -75,40 +112,7 @@ let LibraryController = class LibraryController extends (0, interface_api_1.Cont
|
|
|
75
112
|
(0, stats_model_1.loadStatsContext)(),
|
|
76
113
|
(0, interface_database_decorators_1.GetModel)(automation_template_model_1.AutomationTemplateModel, constants_1.DATABASE_NAME).listAll(),
|
|
77
114
|
]);
|
|
78
|
-
|
|
79
|
-
const health = (0, stats_model_1.healthByProcedure)(ctx);
|
|
80
|
-
const out = {};
|
|
81
|
-
for (const { procedure, graph } of ctx.procedures) {
|
|
82
|
-
if (!graph)
|
|
83
|
-
continue;
|
|
84
|
-
for (const { node, groups, viaTemplate } of (0, resolveSubgraph_1.walkPlacedNodes)(graph, templateById)) {
|
|
85
|
-
const entry = entryOf(node);
|
|
86
|
-
if (!entry)
|
|
87
|
-
continue;
|
|
88
|
-
const group = groups.at(-1);
|
|
89
|
-
const template = viaTemplate?.templateId
|
|
90
|
-
? templateById.get(viaTemplate.templateId)
|
|
91
|
-
: undefined;
|
|
92
|
-
const usage = {
|
|
93
|
-
procedureId: procedure._id,
|
|
94
|
-
procedureName: procedure.name,
|
|
95
|
-
enabled: procedure.enabled,
|
|
96
|
-
state: health.get(procedure._id)?.state ?? "draft",
|
|
97
|
-
nodeId: viaTemplate?.id ?? node.id,
|
|
98
|
-
nodeLabel: (0, describe_1.labelOf)(node) ?? null,
|
|
99
|
-
groupPath: groups.map((g) => g.id),
|
|
100
|
-
groupLabel: group ? ((0, describe_1.labelOf)(group) ?? null) : null,
|
|
101
|
-
viaTemplate: template
|
|
102
|
-
? { id: template._id, name: template.name }
|
|
103
|
-
: null,
|
|
104
|
-
};
|
|
105
|
-
if (node.kind === "trigger") {
|
|
106
|
-
Object.assign(usage, triggerUsageOf(node));
|
|
107
|
-
}
|
|
108
|
-
(out[entry] ??= []).push(usage);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return out;
|
|
115
|
+
return usageByEntry(ctx.procedures, new Map(templates.map((t) => [t._id, t])), (0, stats_model_1.healthByProcedure)(ctx), entryOf);
|
|
112
116
|
}
|
|
113
117
|
};
|
|
114
118
|
exports.LibraryController = LibraryController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/routes/library.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/routes/library.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4EA,wCAWC;AAcD,oCAyCC;AA9ID,6DAOmC;AACnC,6FAAqE;AACrE,yEAAuE;AACvE,yDAA4E;AAG5E,sFAAiF;AACjF,0DAIkC;AAClC,kDAAgE;AAChE,oDAAiD;AACjD,kDAA+C;AAC/C,gEAA6D;AAC7D,gDAA8C;AAC9C,kDAAmD;AAInD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEpD,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,QAAQ,GAAG,q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AAe,CAAC;IAElB,WAAA,IAAA,kBAAW,GAAE,CAAA;IACb,WAAA,IAAA,uBAAO,GAAE,CAAA;;;;oDAKX;AAQK;IADL,IAAA,mBAAG,EAAC,iBAAiB,CAAC;IAEpB,WAAA,IAAA,kBAAW,GAAE,CAAA;IACb,WAAA,IAAA,yBAAS,EAAC,SAAS,EAAE,OAAO,CAAC,CAAA;;;;8CAgB/B;4BAvDU,iBAAiB;IAD7B,IAAA,oBAAa,GAAE;GACH,iBAAiB,CAwD7B;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,CACL,QAAQ,KAAK,WAAW;QACxB,QAAQ,KAAK,OAAO;QACpB,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -14,13 +14,13 @@ const subscriptions_1 = require("../runtime/subscriptions");
|
|
|
14
14
|
const webhookRoutes_1 = require("../runtime/webhookRoutes");
|
|
15
15
|
const constants_1 = require("../types/constants");
|
|
16
16
|
const requests_1 = require("./requests");
|
|
17
|
-
const REFUSAL_OF_ISSUE =
|
|
18
|
-
noTrigger
|
|
19
|
-
webhookPathTaken
|
|
20
|
-
|
|
17
|
+
const REFUSAL_OF_ISSUE = new Map([
|
|
18
|
+
["noTrigger", `${requests_1.API_MESSAGES}.noTrigger`],
|
|
19
|
+
["webhookPathTaken", `${requests_1.API_MESSAGES}.webhookPathTaken`],
|
|
20
|
+
]);
|
|
21
21
|
function graphRefusal(issues) {
|
|
22
22
|
const first = issues.find((i) => i.severity === "error");
|
|
23
|
-
const message = REFUSAL_OF_ISSUE
|
|
23
|
+
const message = REFUSAL_OF_ISSUE.get(first?.code ?? "") ?? `${requests_1.API_MESSAGES}.graphHasErrors`;
|
|
24
24
|
return (0, requests_1.invalid)("invalid graph", issues, message);
|
|
25
25
|
}
|
|
26
26
|
function issuesOf(graph, enabling) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedureChecks.js","sourceRoot":"","sources":["../../src/routes/procedureChecks.ts"],"names":[],"mappings":";;AAuBA,oCAKC;AAGD,4BAQC;AAsCD,gCAYC;AAQD,oCAQC;AAGD,kCAEC;AAMD,sBAQC;AA5HD,6DAAuD;AACvD,6FAAqE;AACrE,kEAA8D;AAE9D,wDAIgC;AAChC,4DAAyD;AACzD,4DAA4D;AAC5D,kDAAmD;AAEnD,yCAA0D;AAK1D,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"procedureChecks.js","sourceRoot":"","sources":["../../src/routes/procedureChecks.ts"],"names":[],"mappings":";;AAuBA,oCAKC;AAGD,4BAQC;AAsCD,gCAYC;AAQD,oCAQC;AAGD,kCAEC;AAMD,sBAQC;AA5HD,6DAAuD;AACvD,6FAAqE;AACrE,kEAA8D;AAE9D,wDAIgC;AAChC,4DAAyD;AACzD,4DAA4D;AAC5D,kDAAmD;AAEnD,yCAA0D;AAK1D,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,CAAC,WAAW,EAAE,GAAG,uBAAG,YAAY,CAAC;IACjC,CAAC,kBAAkB,EAAE,GAAG,uBAAG,mBAAmB,CAAC;CAChD,CAAC,CAAC;AAEH,SAAgB,YAAY,CAAC,MAAoB;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACzD,MAAM,OAAO,GACX,gBAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,GAAG,uBAAG,iBAAiB,CAAC;IACrE,OAAO,IAAA,kBAAO,EAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAGD,SAAgB,QAAQ,CACtB,KAAqB,EACrB,QAAiB;IAEjB,OAAO,IAAA,yBAAW,EAAC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IAAI,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQM,KAAK,UAAU,YAAY,CAChC,KAAqB,EACrB,OAAgB,EAChB,SAAqB,EAAE;IAEvB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,OAAO,IAAI,IAAA,8BAAgB,EAAC,MAAM,CAAC;QAAE,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC;AAChB,CAAC;AAGM,KAAK,UAAU,WAAW,CAAC,IAAY;IAC5C,OAAO,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,uBAAG,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC;AAMD,SAAgB,KAAK,CAAC,SAAoB;IACxC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IACxC,OAAO,IAAI,0BAAU,CAAC,GAAG,EAAE;QACzB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,GAAG,uBAAG,QAAQ;QACvB,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -5,7 +5,7 @@ export declare function lastPayloadOf(procedureId: string, triggerNodeId?: strin
|
|
|
5
5
|
runId: string;
|
|
6
6
|
triggerNodeId: string;
|
|
7
7
|
startedAt: string;
|
|
8
|
-
payload:
|
|
8
|
+
payload: import("../types/dataValue").DataValue;
|
|
9
9
|
};
|
|
10
10
|
tooLarge: boolean;
|
|
11
11
|
} | {
|
|
@@ -14,11 +14,11 @@ export declare function lastPayloadOf(procedureId: string, triggerNodeId?: strin
|
|
|
14
14
|
}>;
|
|
15
15
|
export declare function runOutcome(runId: string, warnOnFailure: boolean): Promise<{
|
|
16
16
|
runId: string;
|
|
17
|
-
status:
|
|
17
|
+
status: "failed";
|
|
18
18
|
warning: string;
|
|
19
19
|
} | {
|
|
20
20
|
runId: string;
|
|
21
|
-
status:
|
|
21
|
+
status: import("@antelopejs/interface-dms-automation").ProcedureRunStatus;
|
|
22
22
|
warning?: undefined;
|
|
23
23
|
}>;
|
|
24
24
|
export declare function runNow(procedureId: string, graph: ProcedureGraph, { triggerNodeId, ...request }: RunProcedureOptions): Promise<string>;
|
|
@@ -60,7 +60,7 @@ async function runResult(runId) {
|
|
|
60
60
|
const run = await (0, interface_database_decorators_1.GetModel)(procedure_run_model_1.ProcedureRunModel, constants_1.DATABASE_NAME).get(runId);
|
|
61
61
|
const outcome = {
|
|
62
62
|
runId,
|
|
63
|
-
status:
|
|
63
|
+
status: run?.status ?? "ok",
|
|
64
64
|
};
|
|
65
65
|
if (run?.errorMessage)
|
|
66
66
|
outcome.errorMessage = run.errorMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedureRuns.js","sourceRoot":"","sources":["../../src/routes/procedureRuns.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"procedureRuns.js","sourceRoot":"","sources":["../../src/routes/procedureRuns.ts"],"names":[],"mappings":";;AAqBA,sCA2BC;AAMD,gCAMC;AASD,wBAWC;AAGD,8BAQC;AA3FD,6FAAqE;AAKrE,0EAAqE;AACrE,wDAA4D;AAC5D,wDAA0D;AAC1D,4DAAyD;AACzD,kDAAmD;AAEnD,uDAA2D;AAC3D,yCAA0C;AAG1C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAMrB,KAAK,UAAU,aAAa,CACjC,WAAmB,EACnB,aAAsB;IAEtB,MAAM,KAAK,GAAG,IAAA,wCAAQ,EAAC,uCAAiB,EAAE,yBAAa,CAAC,CAAC;IACzD,IAAI,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,QAAQ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
|
export declare const MAX_NAME_LENGTH = 200;
|
|
3
4
|
export declare const procedureUpdateSchema: z.ZodObject<{
|
|
4
5
|
name: z.ZodString;
|
|
@@ -81,29 +82,29 @@ export declare const validateSchema: z.ZodObject<{
|
|
|
81
82
|
procedureId?: string | undefined;
|
|
82
83
|
}>;
|
|
83
84
|
export declare const runNowSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
84
|
-
payload: z.ZodOptional<z.
|
|
85
|
+
payload: z.ZodOptional<z.ZodType<DataValue, z.ZodTypeDef, DataValue>>;
|
|
85
86
|
triggerNodeId: z.ZodOptional<z.ZodString>;
|
|
86
87
|
}, "strip", z.ZodTypeAny, {
|
|
87
88
|
triggerNodeId?: string | undefined;
|
|
88
|
-
payload?:
|
|
89
|
+
payload?: DataValue;
|
|
89
90
|
}, {
|
|
90
91
|
triggerNodeId?: string | undefined;
|
|
91
|
-
payload?:
|
|
92
|
+
payload?: DataValue;
|
|
92
93
|
}>>>;
|
|
93
94
|
export declare const testSchema: z.ZodObject<{
|
|
94
95
|
graph: z.ZodType<import("../types/graph").ProcedureGraph, z.ZodTypeDef, unknown>;
|
|
95
|
-
payload: z.ZodOptional<z.
|
|
96
|
+
payload: z.ZodOptional<z.ZodType<DataValue, z.ZodTypeDef, DataValue>>;
|
|
96
97
|
triggerNodeId: z.ZodOptional<z.ZodString>;
|
|
97
98
|
confirmRealEffects: z.ZodOptional<z.ZodBoolean>;
|
|
98
99
|
}, "strip", z.ZodTypeAny, {
|
|
99
100
|
graph: import("../types/graph").ProcedureGraph;
|
|
100
101
|
triggerNodeId?: string | undefined;
|
|
101
|
-
payload?:
|
|
102
|
+
payload?: DataValue;
|
|
102
103
|
confirmRealEffects?: boolean | undefined;
|
|
103
104
|
}, {
|
|
104
105
|
graph?: unknown;
|
|
105
106
|
triggerNodeId?: string | undefined;
|
|
106
|
-
payload?:
|
|
107
|
+
payload?: DataValue;
|
|
107
108
|
confirmRealEffects?: boolean | undefined;
|
|
108
109
|
}>;
|
|
109
110
|
export declare const testEffectsSchema: z.ZodObject<{
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.testEffectsSchema = exports.testSchema = exports.runNowSchema = exports.validateSchema = exports.enabledSchema = exports.exportedSchema = exports.importSchema = exports.newProcedureSchema = exports.procedureUpdateSchema = exports.MAX_NAME_LENGTH = void 0;
|
|
4
4
|
exports.importErrorOf = importErrorOf;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
+
const dataValue_1 = require("../types/dataValue");
|
|
6
7
|
const graphSchema_1 = require("./graphSchema");
|
|
8
|
+
const payloadSchema = zod_1.z.custom(dataValue_1.isDataValue);
|
|
7
9
|
exports.MAX_NAME_LENGTH = 200;
|
|
8
10
|
const MAX_DESCRIPTION_LENGTH = 2000;
|
|
9
11
|
const nameSchema = zod_1.z.string().trim().min(1).max(exports.MAX_NAME_LENGTH);
|
|
@@ -39,13 +41,13 @@ exports.validateSchema = zod_1.z.object({
|
|
|
39
41
|
});
|
|
40
42
|
exports.runNowSchema = zod_1.z
|
|
41
43
|
.object({
|
|
42
|
-
payload:
|
|
44
|
+
payload: payloadSchema.optional(),
|
|
43
45
|
triggerNodeId: zod_1.z.string().optional(),
|
|
44
46
|
})
|
|
45
47
|
.nullish();
|
|
46
48
|
exports.testSchema = zod_1.z.object({
|
|
47
49
|
graph: graphSchema_1.procedureGraphSchema,
|
|
48
|
-
payload:
|
|
50
|
+
payload: payloadSchema.optional(),
|
|
49
51
|
triggerNodeId: zod_1.z.string().optional(),
|
|
50
52
|
confirmRealEffects: zod_1.z.boolean().optional(),
|
|
51
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedureSchemas.js","sourceRoot":"","sources":["../../src/routes/procedureSchemas.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"procedureSchemas.js","sourceRoot":"","sources":["../../src/routes/procedureSchemas.ts"],"names":[],"mappings":";;;AA0FA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C,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,QAAQ,KAAK,WAAW,CAC7B,CAAC;IACF,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,MAAM,eAAe,CAAC;IACpE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;IACjE,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,eAAe,CAAC;AAC1E,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
-
import type
|
|
2
|
+
import { type ProcedureGraph } from "../types/graph";
|
|
3
|
+
import type { DataValue } from "../types/dataValue";
|
|
3
4
|
export declare function savedTriggersOf(graph: ProcedureGraph, from?: Date): {
|
|
4
5
|
nextAt: string | null;
|
|
5
6
|
nodeId: string;
|
|
@@ -34,17 +35,17 @@ export declare class ProceduresController extends ProceduresController_base {
|
|
|
34
35
|
limit: number;
|
|
35
36
|
}>;
|
|
36
37
|
summary(_user: User): Promise<import("../db/models/stats.model").ProcedureSummaryRow[]>;
|
|
37
|
-
validate(_user: User, body:
|
|
38
|
+
validate(_user: User, body: DataValue): Promise<{
|
|
38
39
|
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
39
40
|
triggers: (import("../runtime/describe").TriggerSummary & {
|
|
40
41
|
text: import("@antelopejs/interface-dms/base").BlockText;
|
|
41
42
|
})[];
|
|
42
43
|
}>;
|
|
43
|
-
createFromStarter(_user: User, body:
|
|
44
|
+
createFromStarter(_user: User, body: DataValue): Promise<{
|
|
44
45
|
warning?: string;
|
|
45
46
|
_id: string;
|
|
46
47
|
}>;
|
|
47
|
-
importJson(_user: User, body:
|
|
48
|
+
importJson(_user: User, body: DataValue): Promise<{
|
|
48
49
|
warning?: string;
|
|
49
50
|
_id: string;
|
|
50
51
|
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
@@ -72,13 +73,13 @@ export declare class ProceduresController extends ProceduresController_base {
|
|
|
72
73
|
duplicate(_user: User, id: string): Promise<{
|
|
73
74
|
_id: string;
|
|
74
75
|
}>;
|
|
75
|
-
update(user: User, id: string, body:
|
|
76
|
+
update(user: User, id: string, body: DataValue): Promise<{
|
|
76
77
|
_id: string;
|
|
77
78
|
version: number;
|
|
78
79
|
revision: number;
|
|
79
80
|
issues: import("../runtime/graphIssues").GraphIssue[];
|
|
80
81
|
}>;
|
|
81
|
-
setEnabled(user: User, id: string, body:
|
|
82
|
+
setEnabled(user: User, id: string, body: DataValue): Promise<{
|
|
82
83
|
_id: string;
|
|
83
84
|
enabled: boolean;
|
|
84
85
|
revision: number | undefined;
|
|
@@ -93,25 +94,25 @@ export declare class ProceduresController extends ProceduresController_base {
|
|
|
93
94
|
_id: string;
|
|
94
95
|
}>;
|
|
95
96
|
deleteConfirm(_user: User, id: string): Promise<import("@antelopejs/interface-dms/base").ConfirmDialogSerialized>;
|
|
96
|
-
runNow(_user: User, id: string, body:
|
|
97
|
+
runNow(_user: User, id: string, body: DataValue): Promise<{
|
|
97
98
|
runId: string;
|
|
98
|
-
status:
|
|
99
|
+
status: "failed";
|
|
99
100
|
warning: string;
|
|
100
101
|
} | {
|
|
101
102
|
runId: string;
|
|
102
|
-
status:
|
|
103
|
+
status: import("@antelopejs/interface-dms-automation").ProcedureRunStatus;
|
|
103
104
|
warning?: undefined;
|
|
104
105
|
}>;
|
|
105
|
-
test(_user: User, id: string, body:
|
|
106
|
+
test(_user: User, id: string, body: DataValue): Promise<{
|
|
106
107
|
runId: string;
|
|
107
|
-
status:
|
|
108
|
+
status: "failed";
|
|
108
109
|
warning: string;
|
|
109
110
|
} | {
|
|
110
111
|
runId: string;
|
|
111
|
-
status:
|
|
112
|
+
status: import("@antelopejs/interface-dms-automation").ProcedureRunStatus;
|
|
112
113
|
warning?: undefined;
|
|
113
114
|
}>;
|
|
114
|
-
testEffects(_user: User, id: string, body:
|
|
115
|
+
testEffects(_user: User, id: string, body: DataValue): Promise<{
|
|
115
116
|
realEffects: import("../runtime/sideEffects").RealEffectStep[];
|
|
116
117
|
}>;
|
|
117
118
|
lastPayload(_user: User, id: string, triggerNodeId?: string): Promise<{
|
|
@@ -119,7 +120,7 @@ export declare class ProceduresController extends ProceduresController_base {
|
|
|
119
120
|
runId: string;
|
|
120
121
|
triggerNodeId: string;
|
|
121
122
|
startedAt: string;
|
|
122
|
-
payload:
|
|
123
|
+
payload: DataValue;
|
|
123
124
|
};
|
|
124
125
|
tooLarge: boolean;
|
|
125
126
|
} | {
|
|
@@ -32,6 +32,7 @@ const subscriptions_1 = require("../runtime/subscriptions");
|
|
|
32
32
|
const webhookRoutes_1 = require("../runtime/webhookRoutes");
|
|
33
33
|
const wording_1 = require("../runtime/wording");
|
|
34
34
|
const constants_1 = require("../types/constants");
|
|
35
|
+
const graph_1 = require("../types/graph");
|
|
35
36
|
const runLog_1 = require("../types/runLog");
|
|
36
37
|
const deleteConfirm_1 = require("./deleteConfirm");
|
|
37
38
|
const procedureChecks_1 = require("./procedureChecks");
|
|
@@ -108,7 +109,7 @@ async function insertDraft(name, description, graph) {
|
|
|
108
109
|
}
|
|
109
110
|
function served(procedure) {
|
|
110
111
|
const { graph, ...fields } = procedure;
|
|
111
|
-
return { ...fields, graph:
|
|
112
|
+
return { ...fields, graph: (0, graph_1.parseGraph)(graph) };
|
|
112
113
|
}
|
|
113
114
|
function copyNameOf(name) {
|
|
114
115
|
const suffix = " (copy)";
|