@dxos/plugin-automation 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
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/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
- package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
- package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +138 -133
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
- package/dist/lib/{browser/chunk-QNEQ23BF.mjs → neutral/FunctionsPanel-GLCUBEDT.mjs} +23 -25
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
- package/dist/lib/{browser/FunctionsContainer-5NHAAP5H.mjs → neutral/FunctionsRegistry-VRU4FBVH.mjs} +23 -54
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +13 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-PZNBEKO5.mjs → neutral/chunk-ATECY555.mjs} +7 -4
- package/dist/lib/{browser/chunk-PZNBEKO5.mjs.map → neutral/chunk-ATECY555.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
- package/dist/lib/{browser/chunk-C273ZYLE.mjs → neutral/chunk-FKFFU54G.mjs} +53 -41
- package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{node-esm/chunk-EJPZWAGR.mjs → neutral/chunk-N735CP33.mjs} +69 -41
- package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +16 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +129 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +20 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +47 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/types/src/AutomationPlugin.d.ts +1 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +6 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +7 -7
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/util.d.ts +4 -4
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -31
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +96 -92
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +78 -76
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +32 -32
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationEvents.d.ts +3 -0
- package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +19 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +9 -30
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +115 -65
- package/src/AutomationPlugin.node.ts +29 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +11 -9
- package/src/capabilities/app-graph-builder.ts +66 -0
- package/src/capabilities/compute-runtime.ts +325 -0
- package/src/capabilities/index.ts +10 -4
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/{cli/commands → commands}/trigger/create/queue.ts +6 -9
- package/src/{cli/commands → commands}/trigger/create/subscription.ts +10 -13
- package/src/{cli/commands → commands}/trigger/create/timer.ts +6 -9
- package/src/{cli/commands → commands}/trigger/list.ts +7 -4
- package/src/{cli/commands → commands}/trigger/remove.ts +1 -1
- package/src/{cli/commands → commands}/trigger/update/queue.ts +18 -19
- package/src/{cli/commands → commands}/trigger/update/subscription.ts +17 -17
- package/src/{cli/commands → commands}/trigger/update/timer.ts +18 -18
- package/src/{cli/commands → commands}/trigger/util.ts +39 -24
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +8 -7
- package/src/components/AutomationPanel/AutomationPanel.tsx +76 -66
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +31 -27
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +25 -21
- package/src/components/FunctionsRegistry/index.ts +4 -1
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +6 -6
- package/src/components/TriggerEditor/SpecSelector.tsx +17 -13
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +54 -12
- package/src/components/TriggerEditor/TriggerEditor.tsx +45 -17
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
- package/src/containers/FunctionsContainer/index.ts +5 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useComputeRuntime.ts +30 -0
- package/src/hooks/useComputeRuntimeCallback.ts +4 -39
- package/src/hooks/useComputeRuntimeService.ts +64 -0
- package/src/hooks/useTriggerRuntimeControls.ts +6 -3
- package/src/index.ts +0 -4
- package/src/meta.ts +3 -2
- package/src/operations/create-trigger-from-template.ts +72 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/testing/test-functions.ts +11 -8
- package/src/translations.ts +39 -38
- package/src/types/AutomationCapabilities.ts +48 -0
- package/src/types/AutomationEvents.ts +11 -0
- package/src/types/AutomationOperation.ts +30 -0
- package/src/types/index.ts +4 -2
- package/src/types/schema.ts +3 -24
- package/dist/lib/browser/AutomationPanel-C6MZ22CB.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs +0 -57
- package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-5NHAAP5H.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-RD22LYMR.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +0 -85
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +0 -7
- package/dist/lib/browser/chunk-C273ZYLE.mjs.map +0 -7
- package/dist/lib/browser/chunk-JFBUK3WR.mjs +0 -14
- package/dist/lib/browser/chunk-JFBUK3WR.mjs.map +0 -7
- package/dist/lib/browser/chunk-JN7QRQQX.mjs +0 -256
- package/dist/lib/browser/chunk-JN7QRQQX.mjs.map +0 -7
- package/dist/lib/browser/chunk-JOXPQ27I.mjs +0 -83
- package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
- package/dist/lib/browser/chunk-O5Y2F33G.mjs +0 -8
- package/dist/lib/browser/chunk-O5Y2F33G.mjs.map +0 -7
- package/dist/lib/browser/chunk-P5AEO35Y.mjs +0 -93
- package/dist/lib/browser/chunk-P5AEO35Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-QNEQ23BF.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs +0 -119
- package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -13
- package/dist/lib/browser/index.mjs +0 -123
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs +0 -83
- package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-246NXXJR.mjs +0 -66
- package/dist/lib/browser/react-surface-246NXXJR.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/AutomationPanel-RTBY7YFM.mjs +0 -12
- package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs +0 -58
- package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs +0 -126
- package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-V2DKWYMU.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +0 -86
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AENSLAVD.mjs +0 -99
- package/dist/lib/node-esm/chunk-AENSLAVD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EJPZWAGR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs +0 -16
- package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-M3UPTGXF.mjs +0 -10
- package/dist/lib/node-esm/chunk-M3UPTGXF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OJEFRZEV.mjs +0 -259
- package/dist/lib/node-esm/chunk-OJEFRZEV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs +0 -94
- package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs +0 -84
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -1109
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs +0 -120
- package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs +0 -124
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs +0 -84
- package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-U6762KPI.mjs +0 -67
- package/dist/lib/node-esm/react-surface-U6762KPI.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/commands/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/components/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/TriggerSettings.d.ts +0 -6
- package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -22
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -72
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/compute-runtime/compute-runtime.ts +0 -140
- package/src/capabilities/compute-runtime/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -61
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -24
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -36
- package/src/components/TriggerSettings.tsx +0 -26
- package/src/types/capabilities.ts +0 -42
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/AutomationPanel-C6MZ22CB.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-RD22LYMR.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-RTBY7YFM.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-V2DKWYMU.mjs.map → neutral/types/index.mjs.map} +0 -0
- /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
- /package/src/{cli/commands → commands}/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/options.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
ComputeRuntime
|
|
3
|
-
} from "../chunk-O5Y2F33G.mjs";
|
|
4
|
-
import {
|
|
5
|
-
AutomationEvents
|
|
6
|
-
} from "../chunk-JOXPQ27I.mjs";
|
|
7
|
-
import {
|
|
8
|
-
meta
|
|
9
|
-
} from "../chunk-PZNBEKO5.mjs";
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
10
2
|
|
|
11
|
-
// src/
|
|
3
|
+
// src/AutomationPlugin.node.ts
|
|
12
4
|
import { Plugin } from "@dxos/app-framework";
|
|
13
5
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
14
|
-
import {
|
|
6
|
+
import { Operation as Operation8, Trace, Trigger as Trigger10 } from "@dxos/compute";
|
|
7
|
+
import { ClientEvents } from "@dxos/plugin-client";
|
|
8
|
+
import { AppGraphBuilder, ComputeRuntime, OperationHandler } from "#capabilities";
|
|
9
|
+
import { meta } from "#meta";
|
|
10
|
+
import { AutomationEvents } from "#types";
|
|
15
11
|
|
|
16
|
-
// src/
|
|
12
|
+
// src/commands/trigger/index.ts
|
|
17
13
|
import * as Command11 from "@effect/cli/Command";
|
|
18
14
|
|
|
19
|
-
// src/
|
|
15
|
+
// src/commands/trigger/create/index.ts
|
|
20
16
|
import * as Command4 from "@effect/cli/Command";
|
|
21
17
|
|
|
22
|
-
// src/
|
|
18
|
+
// src/commands/trigger/create/queue.ts
|
|
23
19
|
import * as Command from "@effect/cli/Command";
|
|
24
20
|
import * as Options2 from "@effect/cli/Options";
|
|
25
21
|
import * as Prompt2 from "@effect/cli/Prompt";
|
|
@@ -30,10 +26,10 @@ import * as Option2 from "effect/Option";
|
|
|
30
26
|
import { CommandConfig } from "@dxos/cli-util";
|
|
31
27
|
import { flushAndSync, print, spaceLayer, withTypes } from "@dxos/cli-util";
|
|
32
28
|
import { Common } from "@dxos/cli-util";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
29
|
+
import { Operation as Operation2, Trigger as Trigger2 } from "@dxos/compute";
|
|
30
|
+
import { Database as Database2, Filter as Filter2, JsonSchema, Ref as Ref2 } from "@dxos/echo";
|
|
35
31
|
|
|
36
|
-
// src/
|
|
32
|
+
// src/commands/trigger/options.ts
|
|
37
33
|
import * as Options from "@effect/cli/Options";
|
|
38
34
|
import * as Schema from "effect/Schema";
|
|
39
35
|
import { DXN } from "@dxos/keys";
|
|
@@ -54,7 +50,7 @@ var DXNSchema = Schema.String.pipe(Schema.transform(Schema.instanceOf(DXN), {
|
|
|
54
50
|
}));
|
|
55
51
|
var Queue = Options.text("queue").pipe(Options.withDescription("The DXN of the queue for the queue trigger."), Options.withSchema(DXNSchema));
|
|
56
52
|
|
|
57
|
-
// src/
|
|
53
|
+
// src/commands/trigger/util.ts
|
|
58
54
|
import * as Prompt from "@effect/cli/Prompt";
|
|
59
55
|
import * as Ansi from "@effect/printer-ansi/Ansi";
|
|
60
56
|
import * as Console from "effect/Console";
|
|
@@ -63,10 +59,10 @@ import * as Match from "effect/Match";
|
|
|
63
59
|
import * as Option from "effect/Option";
|
|
64
60
|
import * as SchemaAST from "effect/SchemaAST";
|
|
65
61
|
import { FormBuilder } from "@dxos/cli-util";
|
|
66
|
-
import {
|
|
62
|
+
import { Operation, Trigger } from "@dxos/compute";
|
|
63
|
+
import { Annotation, Database, Entity, Feed, Filter, Obj, Query, Ref, Type } from "@dxos/echo";
|
|
67
64
|
import { getProperties } from "@dxos/effect";
|
|
68
|
-
import {
|
|
69
|
-
import { QueueAnnotation } from "@dxos/schema";
|
|
65
|
+
import { FeedAnnotation } from "@dxos/schema";
|
|
70
66
|
var getTriggerRemoteStatus = (trigger2, remoteCronIds) => {
|
|
71
67
|
if (trigger2.spec?.kind !== "timer") {
|
|
72
68
|
return "n/a";
|
|
@@ -77,7 +73,7 @@ var printTrigger = Effect.fn(function* (trigger2, remoteStatus) {
|
|
|
77
73
|
const fn6 = trigger2.function && (yield* Database.load(trigger2.function));
|
|
78
74
|
return FormBuilder.make({
|
|
79
75
|
title: trigger2.id
|
|
80
|
-
}).pipe(FormBuilder.set("status", trigger2.enabled ? "enabled" : "disabled", trigger2.enabled ? Ansi.green : Ansi.blackBright), FormBuilder.option("kind", Option.fromNullable(trigger2.spec?.kind)), FormBuilder.option("remote", Option.fromNullable(remoteStatus), Match.type().pipe(Match.withReturnType(), Match.when("available", () => Ansi.green), Match.when("not available", () => Ansi.yellow), Match.when("n/a", () => Ansi.blackBright), Match.exhaustive)), FormBuilder.when(fn6, FormBuilder.nest("function", FormBuilder.make().pipe(FormBuilder.set("key", fn6.key), FormBuilder.set("dxn", fn6.
|
|
76
|
+
}).pipe(FormBuilder.set("status", trigger2.enabled ? "enabled" : "disabled", trigger2.enabled ? Ansi.green : Ansi.blackBright), FormBuilder.option("kind", Option.fromNullable(trigger2.spec?.kind)), FormBuilder.option("remote", Option.fromNullable(remoteStatus), Match.type().pipe(Match.withReturnType(), Match.when("available", () => Ansi.green), Match.when("not available", () => Ansi.yellow), Match.when("n/a", () => Ansi.blackBright), Match.exhaustive)), FormBuilder.when(fn6, FormBuilder.nest("function", FormBuilder.make().pipe(FormBuilder.set("key", fn6.key), FormBuilder.set("dxn", Obj.getDXN(fn6).toString())))), FormBuilder.nestedOption("spec", Option.fromNullable(trigger2.spec).pipe(Option.map(printSpec))), FormBuilder.build);
|
|
81
77
|
});
|
|
82
78
|
var printSpec = (spec) => {
|
|
83
79
|
switch (spec.kind) {
|
|
@@ -229,7 +225,7 @@ var promptForSchemaInput = Effect.fn(function* (schema, defaults) {
|
|
|
229
225
|
return inputObj;
|
|
230
226
|
});
|
|
231
227
|
var selectFunction = Effect.fn(function* () {
|
|
232
|
-
const functions = yield* Database.runQuery(Filter.type(
|
|
228
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
233
229
|
if (functions.length === 0) {
|
|
234
230
|
return yield* Effect.fail(new Error("No functions available"));
|
|
235
231
|
}
|
|
@@ -244,14 +240,14 @@ var selectFunction = Effect.fn(function* () {
|
|
|
244
240
|
return String(selected);
|
|
245
241
|
});
|
|
246
242
|
var selectTrigger = Effect.fn(function* (kind) {
|
|
247
|
-
const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
|
|
243
|
+
const triggers = yield* Database.runQuery(Query.select(Filter.type(Trigger.Trigger)).debugLabel("cli.trigger.selectTrigger"));
|
|
248
244
|
const filteredTriggers = kind ? triggers.filter((trigger2) => trigger2.spec?.kind === kind) : triggers;
|
|
249
245
|
if (filteredTriggers.length === 0) {
|
|
250
246
|
return yield* Effect.fail(new Error(kind ? `No ${kind} triggers available` : "No triggers available"));
|
|
251
247
|
}
|
|
252
248
|
const choices = yield* Effect.all(filteredTriggers.map((trigger2) => Effect.gen(function* () {
|
|
253
249
|
const fn6 = trigger2.function ? yield* Database.load(trigger2.function) : void 0;
|
|
254
|
-
const functionName = fn6 && Obj.instanceOf(
|
|
250
|
+
const functionName = fn6 && Obj.instanceOf(Operation.PersistentOperation, fn6) ? fn6.name ?? fn6.key ?? fn6.id : void 0;
|
|
255
251
|
const title = functionName ?? trigger2.id;
|
|
256
252
|
const description = `${trigger2.enabled ? "enabled" : "disabled"} - ${trigger2.spec?.kind ?? "unknown"}`;
|
|
257
253
|
return {
|
|
@@ -273,29 +269,36 @@ var selectQueue = Effect.fn(function* () {
|
|
|
273
269
|
"runtime"
|
|
274
270
|
]
|
|
275
271
|
});
|
|
276
|
-
const
|
|
277
|
-
const annotation =
|
|
272
|
+
const feedSchemas = schemas.filter((schema) => {
|
|
273
|
+
const annotation = FeedAnnotation.get(schema);
|
|
278
274
|
return Option.isSome(annotation) && annotation.value === true;
|
|
279
275
|
});
|
|
280
|
-
if (
|
|
281
|
-
return yield* Effect.fail(new Error("No schemas with
|
|
276
|
+
if (feedSchemas.length === 0) {
|
|
277
|
+
return yield* Effect.fail(new Error("No schemas with Feed annotation found"));
|
|
282
278
|
}
|
|
283
279
|
const queueChoices = [];
|
|
284
|
-
for (const schema of
|
|
280
|
+
for (const schema of feedSchemas) {
|
|
285
281
|
yield* Effect.gen(function* () {
|
|
286
282
|
const typename = Type.getTypename(schema);
|
|
287
283
|
const objects = yield* Database.runQuery(Filter.type(typename));
|
|
288
284
|
for (const obj of objects) {
|
|
289
|
-
const
|
|
290
|
-
if (!
|
|
285
|
+
const feedRef = obj.feed;
|
|
286
|
+
if (!feedRef) {
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
const feedObj = yield* Effect.promise(() => feedRef.tryLoad());
|
|
290
|
+
if (!feedObj || !Obj.instanceOf(Feed.Feed, feedObj)) {
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
const queueDxn = Feed.getQueueDxn(feedObj);
|
|
294
|
+
if (!queueDxn) {
|
|
291
295
|
continue;
|
|
292
296
|
}
|
|
293
|
-
const queueDxn = queueRef.dxn.toString();
|
|
294
297
|
const label = Obj.getLabel(obj) ?? obj.id;
|
|
295
298
|
const description = Obj.getTypename(obj);
|
|
296
299
|
queueChoices.push({
|
|
297
300
|
title: label,
|
|
298
|
-
value: queueDxn,
|
|
301
|
+
value: queueDxn.toString(),
|
|
299
302
|
description
|
|
300
303
|
});
|
|
301
304
|
}
|
|
@@ -314,7 +317,7 @@ var printTriggerRemoved = (id) => FormBuilder.make({
|
|
|
314
317
|
title: "Trigger removed"
|
|
315
318
|
}).pipe(FormBuilder.set("id", id), FormBuilder.build);
|
|
316
319
|
|
|
317
|
-
// src/
|
|
320
|
+
// src/commands/trigger/create/queue.ts
|
|
318
321
|
var queue = Command.make("queue", {
|
|
319
322
|
spaceId: Common.spaceId.pipe(Options2.optional),
|
|
320
323
|
enabled: Enabled,
|
|
@@ -327,7 +330,7 @@ var queue = Command.make("queue", {
|
|
|
327
330
|
onNone: () => selectFunction(),
|
|
328
331
|
onSome: (id) => Effect2.succeed(id)
|
|
329
332
|
});
|
|
330
|
-
const functions = yield* Database2.runQuery(Filter2.type(
|
|
333
|
+
const functions = yield* Database2.runQuery(Filter2.type(Operation2.PersistentOperation));
|
|
331
334
|
const fn6 = functions.find((fn7) => fn7.id === functionId);
|
|
332
335
|
if (!fn6) {
|
|
333
336
|
return yield* Effect2.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -337,7 +340,7 @@ var queue = Command.make("queue", {
|
|
|
337
340
|
onSome: (dxn) => Effect2.succeed(dxn.toString())
|
|
338
341
|
});
|
|
339
342
|
const input = yield* Option2.match(options.input, {
|
|
340
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
343
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema.toEffectSchema(fn6.inputSchema) : void 0),
|
|
341
344
|
onSome: (value2) => Effect2.succeed(Object.fromEntries(HashMap.toEntries(value2)))
|
|
342
345
|
});
|
|
343
346
|
const enabled = yield* Option2.match(options.functionId, {
|
|
@@ -350,10 +353,7 @@ var queue = Command.make("queue", {
|
|
|
350
353
|
const trigger2 = Trigger2.make({
|
|
351
354
|
function: Ref2.make(fn6),
|
|
352
355
|
enabled,
|
|
353
|
-
spec:
|
|
354
|
-
kind: "queue",
|
|
355
|
-
queue: queueDxn
|
|
356
|
-
},
|
|
356
|
+
spec: Trigger2.specQueue(queueDxn),
|
|
357
357
|
input
|
|
358
358
|
});
|
|
359
359
|
yield* Database2.add(trigger2);
|
|
@@ -365,9 +365,9 @@ var queue = Command.make("queue", {
|
|
|
365
365
|
yield* flushAndSync({
|
|
366
366
|
indexes: true
|
|
367
367
|
});
|
|
368
|
-
})).pipe(Command.withDescription("Create a queue trigger."), Command.provide(({ spaceId }) => spaceLayer(spaceId, true)), Command.provideEffectDiscard(() => withTypes(
|
|
368
|
+
})).pipe(Command.withDescription("Create a queue trigger."), Command.provide(({ spaceId }) => spaceLayer(spaceId, true)), Command.provideEffectDiscard(() => withTypes(Operation2.PersistentOperation, Trigger2.Trigger)));
|
|
369
369
|
|
|
370
|
-
// src/
|
|
370
|
+
// src/commands/trigger/create/subscription.ts
|
|
371
371
|
import * as Command2 from "@effect/cli/Command";
|
|
372
372
|
import * as Options3 from "@effect/cli/Options";
|
|
373
373
|
import * as Prompt3 from "@effect/cli/Prompt";
|
|
@@ -378,8 +378,8 @@ import * as Option3 from "effect/Option";
|
|
|
378
378
|
import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
|
|
379
379
|
import { flushAndSync as flushAndSync2, print as print2, spaceLayer as spaceLayer2, withTypes as withTypes2 } from "@dxos/cli-util";
|
|
380
380
|
import { Common as Common2 } from "@dxos/cli-util";
|
|
381
|
-
import {
|
|
382
|
-
import {
|
|
381
|
+
import { Operation as Operation3, Trigger as Trigger3 } from "@dxos/compute";
|
|
382
|
+
import { Database as Database3, Filter as Filter3, JsonSchema as JsonSchema2, Query as Query2, Ref as Ref3 } from "@dxos/echo";
|
|
383
383
|
var subscription = Command2.make("subscription", {
|
|
384
384
|
spaceId: Common2.spaceId.pipe(Options3.optional),
|
|
385
385
|
enabled: Enabled,
|
|
@@ -394,7 +394,7 @@ var subscription = Command2.make("subscription", {
|
|
|
394
394
|
onNone: () => selectFunction(),
|
|
395
395
|
onSome: (id) => Effect3.succeed(id)
|
|
396
396
|
});
|
|
397
|
-
const functions = yield* Database3.runQuery(Filter3.type(
|
|
397
|
+
const functions = yield* Database3.runQuery(Filter3.type(Operation3.PersistentOperation));
|
|
398
398
|
const fn6 = functions.find((fn7) => fn7.id === functionId);
|
|
399
399
|
if (!fn6) {
|
|
400
400
|
return yield* Effect3.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -405,7 +405,7 @@ var subscription = Command2.make("subscription", {
|
|
|
405
405
|
}).pipe(Prompt3.run),
|
|
406
406
|
onSome: (value2) => Effect3.succeed(value2)
|
|
407
407
|
});
|
|
408
|
-
const
|
|
408
|
+
const subscriptionQuery = Query2.select(Filter3.type(typename));
|
|
409
409
|
const deepOption = yield* Option3.match(options.deep, {
|
|
410
410
|
onNone: () => Prompt3.confirm({
|
|
411
411
|
message: "Watch changes to nested properties (deep)?",
|
|
@@ -430,7 +430,7 @@ var subscription = Command2.make("subscription", {
|
|
|
430
430
|
subscriptionOptions.delay = delayOption.value;
|
|
431
431
|
}
|
|
432
432
|
const input = yield* Option3.match(options.input, {
|
|
433
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
433
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema2.toEffectSchema(fn6.inputSchema) : void 0),
|
|
434
434
|
onSome: (value2) => Effect3.succeed(Object.fromEntries(HashMap2.toEntries(value2)))
|
|
435
435
|
});
|
|
436
436
|
const enabled = yield* Option3.match(options.functionId, {
|
|
@@ -443,13 +443,7 @@ var subscription = Command2.make("subscription", {
|
|
|
443
443
|
const trigger2 = Trigger3.make({
|
|
444
444
|
function: Ref3.make(fn6),
|
|
445
445
|
enabled,
|
|
446
|
-
spec:
|
|
447
|
-
kind: "subscription",
|
|
448
|
-
query: {
|
|
449
|
-
ast: queryAst
|
|
450
|
-
},
|
|
451
|
-
options: Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : void 0
|
|
452
|
-
},
|
|
446
|
+
spec: Trigger3.specSubscription(subscriptionQuery, Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : void 0),
|
|
453
447
|
input
|
|
454
448
|
});
|
|
455
449
|
yield* Database3.add(trigger2);
|
|
@@ -461,9 +455,9 @@ var subscription = Command2.make("subscription", {
|
|
|
461
455
|
yield* flushAndSync2({
|
|
462
456
|
indexes: true
|
|
463
457
|
});
|
|
464
|
-
})).pipe(Command2.withDescription("Create a subscription trigger."), Command2.provide(({ spaceId }) => spaceLayer2(spaceId, true)), Command2.provideEffectDiscard(() => withTypes2(
|
|
458
|
+
})).pipe(Command2.withDescription("Create a subscription trigger."), Command2.provide(({ spaceId }) => spaceLayer2(spaceId, true)), Command2.provideEffectDiscard(() => withTypes2(Operation3.PersistentOperation, Trigger3.Trigger)));
|
|
465
459
|
|
|
466
|
-
// src/
|
|
460
|
+
// src/commands/trigger/create/timer.ts
|
|
467
461
|
import * as Command3 from "@effect/cli/Command";
|
|
468
462
|
import * as Options4 from "@effect/cli/Options";
|
|
469
463
|
import * as Prompt4 from "@effect/cli/Prompt";
|
|
@@ -474,8 +468,8 @@ import * as Option4 from "effect/Option";
|
|
|
474
468
|
import { CommandConfig as CommandConfig3 } from "@dxos/cli-util";
|
|
475
469
|
import { flushAndSync as flushAndSync3, print as print3, spaceLayer as spaceLayer3, withTypes as withTypes3 } from "@dxos/cli-util";
|
|
476
470
|
import { Common as Common3 } from "@dxos/cli-util";
|
|
477
|
-
import {
|
|
478
|
-
import {
|
|
471
|
+
import { Operation as Operation4, Trigger as Trigger4 } from "@dxos/compute";
|
|
472
|
+
import { Database as Database4, Filter as Filter4, JsonSchema as JsonSchema3, Ref as Ref4 } from "@dxos/echo";
|
|
479
473
|
var timer = Command3.make("timer", {
|
|
480
474
|
spaceId: Common3.spaceId.pipe(Options4.optional),
|
|
481
475
|
enabled: Enabled,
|
|
@@ -488,7 +482,7 @@ var timer = Command3.make("timer", {
|
|
|
488
482
|
onNone: () => selectFunction(),
|
|
489
483
|
onSome: (id) => Effect4.succeed(id)
|
|
490
484
|
});
|
|
491
|
-
const functions = yield* Database4.runQuery(Filter4.type(
|
|
485
|
+
const functions = yield* Database4.runQuery(Filter4.type(Operation4.PersistentOperation));
|
|
492
486
|
const fn6 = functions.find((fn7) => fn7.id === functionId);
|
|
493
487
|
if (!fn6) {
|
|
494
488
|
return yield* Effect4.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -500,7 +494,7 @@ var timer = Command3.make("timer", {
|
|
|
500
494
|
onSome: (value2) => Effect4.succeed(value2)
|
|
501
495
|
});
|
|
502
496
|
const input = yield* Option4.match(options.input, {
|
|
503
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
497
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema3.toEffectSchema(fn6.inputSchema) : void 0),
|
|
504
498
|
onSome: (value2) => Effect4.succeed(Object.fromEntries(HashMap3.toEntries(value2)))
|
|
505
499
|
});
|
|
506
500
|
const enabled = yield* Option4.match(options.functionId, {
|
|
@@ -513,10 +507,7 @@ var timer = Command3.make("timer", {
|
|
|
513
507
|
const trigger2 = Trigger4.make({
|
|
514
508
|
function: Ref4.make(fn6),
|
|
515
509
|
enabled,
|
|
516
|
-
spec:
|
|
517
|
-
kind: "timer",
|
|
518
|
-
cron
|
|
519
|
-
},
|
|
510
|
+
spec: Trigger4.specTimer(cron),
|
|
520
511
|
input
|
|
521
512
|
});
|
|
522
513
|
yield* Database4.add(trigger2);
|
|
@@ -528,33 +519,35 @@ var timer = Command3.make("timer", {
|
|
|
528
519
|
yield* flushAndSync3({
|
|
529
520
|
indexes: true
|
|
530
521
|
});
|
|
531
|
-
})).pipe(Command3.withDescription("Create a timer trigger."), Command3.provide(({ spaceId }) => spaceLayer3(spaceId, true)), Command3.provideEffectDiscard(() => withTypes3(
|
|
522
|
+
})).pipe(Command3.withDescription("Create a timer trigger."), Command3.provide(({ spaceId }) => spaceLayer3(spaceId, true)), Command3.provideEffectDiscard(() => withTypes3(Operation4.PersistentOperation, Trigger4.Trigger)));
|
|
532
523
|
|
|
533
|
-
// src/
|
|
524
|
+
// src/commands/trigger/create/index.ts
|
|
534
525
|
var create = Command4.make("create").pipe(Command4.withDescription("Create a trigger."), Command4.withSubcommands([
|
|
535
526
|
subscription,
|
|
536
527
|
timer,
|
|
537
528
|
queue
|
|
538
529
|
]));
|
|
539
530
|
|
|
540
|
-
// src/
|
|
531
|
+
// src/commands/trigger/list.ts
|
|
541
532
|
import * as Command5 from "@effect/cli/Command";
|
|
542
533
|
import * as Options5 from "@effect/cli/Options";
|
|
543
534
|
import * as Console5 from "effect/Console";
|
|
544
535
|
import * as Effect5 from "effect/Effect";
|
|
545
536
|
import { CommandConfig as CommandConfig4, Common as Common4, printList, spaceIdWithDefault, spaceLayer as spaceLayer4 } from "@dxos/cli-util";
|
|
546
537
|
import { ClientService } from "@dxos/client";
|
|
547
|
-
import {
|
|
548
|
-
import {
|
|
538
|
+
import { Trigger as Trigger5 } from "@dxos/compute";
|
|
539
|
+
import { Context } from "@dxos/context";
|
|
540
|
+
import { Database as Database5, Filter as Filter5, Query as Query3 } from "@dxos/echo";
|
|
541
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/commands/trigger/list.ts";
|
|
549
542
|
var list = Command5.make("list", {
|
|
550
543
|
spaceId: Common4.spaceId.pipe(Options5.optional)
|
|
551
544
|
}, Effect5.fn(function* ({ spaceId: spaceIdOption }) {
|
|
552
545
|
const { json } = yield* CommandConfig4;
|
|
553
|
-
const triggers = yield* Database5.runQuery(Filter5.type(Trigger5.Trigger));
|
|
546
|
+
const triggers = yield* Database5.runQuery(Query3.select(Filter5.type(Trigger5.Trigger)).debugLabel("cli.trigger.list"));
|
|
554
547
|
const remoteCronIds = yield* Effect5.gen(function* () {
|
|
555
548
|
const client = yield* ClientService;
|
|
556
549
|
const spaceId = yield* spaceIdWithDefault(spaceIdOption);
|
|
557
|
-
const result = yield* Effect5.promise(() => client.edge.getCronTriggers(spaceId)).pipe(Effect5.catchAll(() => Effect5.succeed({
|
|
550
|
+
const result = yield* Effect5.promise(() => client.edge.http.getCronTriggers(Context.default(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 24 }), spaceId)).pipe(Effect5.catchAll(() => Effect5.succeed({
|
|
558
551
|
cronIds: []
|
|
559
552
|
})));
|
|
560
553
|
return result.cronIds;
|
|
@@ -578,16 +571,16 @@ var list = Command5.make("list", {
|
|
|
578
571
|
}
|
|
579
572
|
})).pipe(Command5.withDescription("List triggers configured on EDGE."), Command5.provide(({ spaceId }) => spaceLayer4(spaceId, true)));
|
|
580
573
|
|
|
581
|
-
// src/
|
|
574
|
+
// src/commands/trigger/remove.ts
|
|
582
575
|
import * as Command6 from "@effect/cli/Command";
|
|
583
576
|
import * as Options6 from "@effect/cli/Options";
|
|
584
577
|
import * as Console6 from "effect/Console";
|
|
585
578
|
import * as Effect6 from "effect/Effect";
|
|
586
579
|
import * as Option5 from "effect/Option";
|
|
587
580
|
import { CommandConfig as CommandConfig5, Common as Common5, print as print4, spaceLayer as spaceLayer5, withTypes as withTypes4 } from "@dxos/cli-util";
|
|
581
|
+
import { Trigger as Trigger6 } from "@dxos/compute";
|
|
588
582
|
import { DXN as DXN2 } from "@dxos/echo";
|
|
589
583
|
import { Database as Database6 } from "@dxos/echo";
|
|
590
|
-
import { Trigger as Trigger6 } from "@dxos/functions";
|
|
591
584
|
var remove = Command6.make("remove", {
|
|
592
585
|
spaceId: Common5.spaceId.pipe(Options6.optional),
|
|
593
586
|
id: TriggerId.pipe(Options6.optional)
|
|
@@ -610,10 +603,10 @@ var remove = Command6.make("remove", {
|
|
|
610
603
|
}
|
|
611
604
|
})).pipe(Command6.withDescription("Remove a trigger."), Command6.provide(({ spaceId }) => spaceLayer5(spaceId, true)), Command6.provideEffectDiscard(() => withTypes4(Trigger6.Trigger)));
|
|
612
605
|
|
|
613
|
-
// src/
|
|
606
|
+
// src/commands/trigger/update/index.ts
|
|
614
607
|
import * as Command10 from "@effect/cli/Command";
|
|
615
608
|
|
|
616
|
-
// src/
|
|
609
|
+
// src/commands/trigger/update/queue.ts
|
|
617
610
|
import * as Command7 from "@effect/cli/Command";
|
|
618
611
|
import * as Options7 from "@effect/cli/Options";
|
|
619
612
|
import * as Prompt5 from "@effect/cli/Prompt";
|
|
@@ -623,8 +616,8 @@ import * as Option6 from "effect/Option";
|
|
|
623
616
|
import { CommandConfig as CommandConfig6 } from "@dxos/cli-util";
|
|
624
617
|
import { flushAndSync as flushAndSync4, print as print5, spaceLayer as spaceLayer6, withTypes as withTypes5 } from "@dxos/cli-util";
|
|
625
618
|
import { Common as Common6 } from "@dxos/cli-util";
|
|
626
|
-
import {
|
|
627
|
-
import {
|
|
619
|
+
import { Operation as Operation5, Trigger as Trigger7 } from "@dxos/compute";
|
|
620
|
+
import { DXN as DXN3, Database as Database7, Filter as Filter6, JsonSchema as JsonSchema4, Obj as Obj2, Ref as Ref5 } from "@dxos/echo";
|
|
628
621
|
var queue2 = Command7.make("queue", {
|
|
629
622
|
spaceId: Common6.spaceId.pipe(Options7.optional),
|
|
630
623
|
id: TriggerId.pipe(Options7.optional),
|
|
@@ -655,10 +648,10 @@ var queue2 = Command7.make("queue", {
|
|
|
655
648
|
yield* flushAndSync4({
|
|
656
649
|
indexes: true
|
|
657
650
|
});
|
|
658
|
-
})).pipe(Command7.withDescription("Update a queue trigger."), Command7.provide(({ spaceId }) => spaceLayer6(spaceId, true)), Command7.provideEffectDiscard(() => withTypes5(
|
|
651
|
+
})).pipe(Command7.withDescription("Update a queue trigger."), Command7.provide(({ spaceId }) => spaceLayer6(spaceId, true)), Command7.provideEffectDiscard(() => withTypes5(Operation5.PersistentOperation, Trigger7.Trigger)));
|
|
659
652
|
var updateFunction = Effect7.fn(function* (trigger2, functionIdOption) {
|
|
660
653
|
let currentFn = trigger2.function ? yield* Database7.load(trigger2.function) : void 0;
|
|
661
|
-
if (currentFn && !Obj2.instanceOf(
|
|
654
|
+
if (currentFn && !Obj2.instanceOf(Operation5.PersistentOperation, currentFn)) {
|
|
662
655
|
currentFn = void 0;
|
|
663
656
|
}
|
|
664
657
|
const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
|
|
@@ -674,13 +667,13 @@ var updateFunction = Effect7.fn(function* (trigger2, functionIdOption) {
|
|
|
674
667
|
onNone: () => selectFunction(),
|
|
675
668
|
onSome: (id) => Effect7.succeed(id)
|
|
676
669
|
});
|
|
677
|
-
const functions = yield* Database7.runQuery(Filter6.type(
|
|
670
|
+
const functions = yield* Database7.runQuery(Filter6.type(Operation5.PersistentOperation));
|
|
678
671
|
const foundFn = functions.find((fn6) => fn6.id === functionId);
|
|
679
|
-
if (!foundFn || !Obj2.instanceOf(
|
|
672
|
+
if (!foundFn || !Obj2.instanceOf(Operation5.PersistentOperation, foundFn)) {
|
|
680
673
|
return yield* Effect7.fail(new Error(`Function not found: ${functionId}`));
|
|
681
674
|
}
|
|
682
|
-
Obj2.
|
|
683
|
-
|
|
675
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
676
|
+
trigger3.function = Ref5.make(foundFn);
|
|
684
677
|
});
|
|
685
678
|
currentFn = foundFn;
|
|
686
679
|
}
|
|
@@ -705,9 +698,9 @@ var updateQueue = Effect7.fn(function* (trigger2, queueOption) {
|
|
|
705
698
|
onNone: () => selectQueue(),
|
|
706
699
|
onSome: (dxn) => Effect7.succeed(dxn.toString())
|
|
707
700
|
});
|
|
708
|
-
Obj2.
|
|
709
|
-
if (
|
|
710
|
-
|
|
701
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
702
|
+
if (trigger3.spec?.kind === "queue") {
|
|
703
|
+
trigger3.spec.queue = queueDxn;
|
|
711
704
|
}
|
|
712
705
|
});
|
|
713
706
|
}
|
|
@@ -727,11 +720,11 @@ var updateInput = Effect7.fn(function* (trigger2, fn6, inputOption) {
|
|
|
727
720
|
});
|
|
728
721
|
if (shouldChangeInput) {
|
|
729
722
|
const inputObj = yield* Option6.match(inputOption, {
|
|
730
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
723
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema4.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
731
724
|
onSome: (value2) => Effect7.succeed(value2)
|
|
732
725
|
});
|
|
733
|
-
Obj2.
|
|
734
|
-
|
|
726
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
727
|
+
trigger3.input = inputObj;
|
|
735
728
|
});
|
|
736
729
|
}
|
|
737
730
|
});
|
|
@@ -743,12 +736,12 @@ var updateEnabled = Effect7.fn(function* (trigger2, idOption, enabled) {
|
|
|
743
736
|
}).pipe(Prompt5.run),
|
|
744
737
|
onSome: () => Effect7.succeed(enabled)
|
|
745
738
|
});
|
|
746
|
-
Obj2.
|
|
747
|
-
|
|
739
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
740
|
+
trigger3.enabled = enabledValue;
|
|
748
741
|
});
|
|
749
742
|
});
|
|
750
743
|
|
|
751
|
-
// src/
|
|
744
|
+
// src/commands/trigger/update/subscription.ts
|
|
752
745
|
import * as Command8 from "@effect/cli/Command";
|
|
753
746
|
import * as Options8 from "@effect/cli/Options";
|
|
754
747
|
import * as Prompt6 from "@effect/cli/Prompt";
|
|
@@ -759,8 +752,8 @@ import * as Option7 from "effect/Option";
|
|
|
759
752
|
import { CommandConfig as CommandConfig7 } from "@dxos/cli-util";
|
|
760
753
|
import { flushAndSync as flushAndSync5, print as print6, spaceLayer as spaceLayer7, withTypes as withTypes6 } from "@dxos/cli-util";
|
|
761
754
|
import { Common as Common7 } from "@dxos/cli-util";
|
|
762
|
-
import {
|
|
763
|
-
import {
|
|
755
|
+
import { Operation as Operation6, Trigger as Trigger8 } from "@dxos/compute";
|
|
756
|
+
import { DXN as DXN4, Database as Database8, Filter as Filter7, JsonSchema as JsonSchema5, Obj as Obj3, Query as Query4, Ref as Ref6 } from "@dxos/echo";
|
|
764
757
|
var subscription2 = Command8.make("subscription", {
|
|
765
758
|
spaceId: Common7.spaceId.pipe(Options8.optional),
|
|
766
759
|
id: TriggerId.pipe(Options8.optional),
|
|
@@ -793,7 +786,7 @@ var subscription2 = Command8.make("subscription", {
|
|
|
793
786
|
yield* flushAndSync5({
|
|
794
787
|
indexes: true
|
|
795
788
|
});
|
|
796
|
-
})).pipe(Command8.withDescription("Update a subscription trigger."), Command8.provide(({ spaceId }) => spaceLayer7(spaceId, true)), Command8.provideEffectDiscard(() => withTypes6(
|
|
789
|
+
})).pipe(Command8.withDescription("Update a subscription trigger."), Command8.provide(({ spaceId }) => spaceLayer7(spaceId, true)), Command8.provideEffectDiscard(() => withTypes6(Operation6.PersistentOperation, Trigger8.Trigger)));
|
|
797
790
|
var extractCurrentTypename = (spec) => {
|
|
798
791
|
if (!spec?.query?.ast) {
|
|
799
792
|
return Option7.none();
|
|
@@ -806,7 +799,7 @@ var extractCurrentTypename = (spec) => {
|
|
|
806
799
|
};
|
|
807
800
|
var updateFunction2 = Effect8.fn(function* (trigger2, functionIdOption) {
|
|
808
801
|
let currentFn = trigger2.function ? yield* Database8.load(trigger2.function) : void 0;
|
|
809
|
-
if (currentFn && !Obj3.instanceOf(
|
|
802
|
+
if (currentFn && !Obj3.instanceOf(Operation6.PersistentOperation, currentFn)) {
|
|
810
803
|
currentFn = void 0;
|
|
811
804
|
}
|
|
812
805
|
const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
|
|
@@ -822,13 +815,13 @@ var updateFunction2 = Effect8.fn(function* (trigger2, functionIdOption) {
|
|
|
822
815
|
onNone: () => selectFunction(),
|
|
823
816
|
onSome: (id) => Effect8.succeed(id)
|
|
824
817
|
});
|
|
825
|
-
const functions = yield* Database8.runQuery(Filter7.type(
|
|
818
|
+
const functions = yield* Database8.runQuery(Filter7.type(Operation6.PersistentOperation));
|
|
826
819
|
const foundFn = functions.find((fn6) => fn6.id === functionId);
|
|
827
|
-
if (!foundFn || !Obj3.instanceOf(
|
|
820
|
+
if (!foundFn || !Obj3.instanceOf(Operation6.PersistentOperation, foundFn)) {
|
|
828
821
|
return yield* Effect8.fail(new Error(`Function not found: ${functionId}`));
|
|
829
822
|
}
|
|
830
|
-
Obj3.
|
|
831
|
-
|
|
823
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
824
|
+
trigger3.function = Ref6.make(foundFn);
|
|
832
825
|
});
|
|
833
826
|
currentFn = foundFn;
|
|
834
827
|
}
|
|
@@ -867,7 +860,7 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
|
|
|
867
860
|
}).pipe(Prompt6.run),
|
|
868
861
|
onSome: (value2) => Effect8.succeed(value2)
|
|
869
862
|
});
|
|
870
|
-
const queryAst =
|
|
863
|
+
const queryAst = Query4.select(Filter7.type(typename)).ast;
|
|
871
864
|
const deepOptionValue = yield* Option7.match(deepOption, {
|
|
872
865
|
onNone: () => Prompt6.confirm({
|
|
873
866
|
message: "Watch changes to nested properties (deep)?",
|
|
@@ -892,8 +885,8 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
|
|
|
892
885
|
if (Option7.isSome(delayOptionValue)) {
|
|
893
886
|
subscriptionOptions.delay = delayOptionValue.value;
|
|
894
887
|
}
|
|
895
|
-
Obj3.
|
|
896
|
-
const spec =
|
|
888
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
889
|
+
const spec = trigger3.spec;
|
|
897
890
|
if (spec?.kind === "subscription") {
|
|
898
891
|
spec.query = {
|
|
899
892
|
ast: queryAst
|
|
@@ -918,11 +911,11 @@ var updateInput2 = Effect8.fn(function* (trigger2, fn6, inputOption) {
|
|
|
918
911
|
});
|
|
919
912
|
if (shouldChangeInput) {
|
|
920
913
|
const inputObj = yield* Option7.match(inputOption, {
|
|
921
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
914
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema5.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
922
915
|
onSome: (value2) => Effect8.succeed(value2)
|
|
923
916
|
});
|
|
924
|
-
Obj3.
|
|
925
|
-
|
|
917
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
918
|
+
trigger3.input = inputObj;
|
|
926
919
|
});
|
|
927
920
|
}
|
|
928
921
|
});
|
|
@@ -934,12 +927,12 @@ var updateEnabled2 = Effect8.fn(function* (trigger2, idOption, enabled) {
|
|
|
934
927
|
}).pipe(Prompt6.run),
|
|
935
928
|
onSome: () => Effect8.succeed(enabled)
|
|
936
929
|
});
|
|
937
|
-
Obj3.
|
|
938
|
-
|
|
930
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
931
|
+
trigger3.enabled = enabledValue;
|
|
939
932
|
});
|
|
940
933
|
});
|
|
941
934
|
|
|
942
|
-
// src/
|
|
935
|
+
// src/commands/trigger/update/timer.ts
|
|
943
936
|
import * as Command9 from "@effect/cli/Command";
|
|
944
937
|
import * as Options9 from "@effect/cli/Options";
|
|
945
938
|
import * as Prompt7 from "@effect/cli/Prompt";
|
|
@@ -949,8 +942,8 @@ import * as Option8 from "effect/Option";
|
|
|
949
942
|
import { CommandConfig as CommandConfig8 } from "@dxos/cli-util";
|
|
950
943
|
import { flushAndSync as flushAndSync6, print as print7, spaceLayer as spaceLayer8, withTypes as withTypes7 } from "@dxos/cli-util";
|
|
951
944
|
import { Common as Common8 } from "@dxos/cli-util";
|
|
952
|
-
import {
|
|
953
|
-
import {
|
|
945
|
+
import { Operation as Operation7, Trigger as Trigger9 } from "@dxos/compute";
|
|
946
|
+
import { DXN as DXN5, Database as Database9, Filter as Filter8, JsonSchema as JsonSchema6, Obj as Obj4, Ref as Ref7 } from "@dxos/echo";
|
|
954
947
|
var timer2 = Command9.make("timer", {
|
|
955
948
|
spaceId: Common8.spaceId.pipe(Options9.optional),
|
|
956
949
|
id: TriggerId.pipe(Options9.optional),
|
|
@@ -981,10 +974,10 @@ var timer2 = Command9.make("timer", {
|
|
|
981
974
|
yield* flushAndSync6({
|
|
982
975
|
indexes: true
|
|
983
976
|
});
|
|
984
|
-
})).pipe(Command9.withDescription("Update a timer trigger."), Command9.provide(({ spaceId }) => spaceLayer8(spaceId, true)), Command9.provideEffectDiscard(() => withTypes7(
|
|
977
|
+
})).pipe(Command9.withDescription("Update a timer trigger."), Command9.provide(({ spaceId }) => spaceLayer8(spaceId, true)), Command9.provideEffectDiscard(() => withTypes7(Operation7.PersistentOperation, Trigger9.Trigger)));
|
|
985
978
|
var updateFunction3 = Effect9.fn(function* (trigger2, functionIdOption) {
|
|
986
979
|
let currentFn = trigger2.function ? yield* Database9.load(trigger2.function) : void 0;
|
|
987
|
-
if (currentFn && !Obj4.instanceOf(
|
|
980
|
+
if (currentFn && !Obj4.instanceOf(Operation7.PersistentOperation, currentFn)) {
|
|
988
981
|
currentFn = void 0;
|
|
989
982
|
}
|
|
990
983
|
const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
|
|
@@ -1000,13 +993,13 @@ var updateFunction3 = Effect9.fn(function* (trigger2, functionIdOption) {
|
|
|
1000
993
|
onNone: () => selectFunction(),
|
|
1001
994
|
onSome: (id) => Effect9.succeed(id)
|
|
1002
995
|
});
|
|
1003
|
-
const functions = yield* Database9.runQuery(Filter8.type(
|
|
996
|
+
const functions = yield* Database9.runQuery(Filter8.type(Operation7.PersistentOperation));
|
|
1004
997
|
const foundFn = functions.find((fn6) => fn6.id === functionId);
|
|
1005
|
-
if (!foundFn || !Obj4.instanceOf(
|
|
998
|
+
if (!foundFn || !Obj4.instanceOf(Operation7.PersistentOperation, foundFn)) {
|
|
1006
999
|
return yield* Effect9.fail(new Error(`Function not found: ${functionId}`));
|
|
1007
1000
|
}
|
|
1008
|
-
Obj4.
|
|
1009
|
-
|
|
1001
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1002
|
+
trigger3.function = Ref7.make(foundFn);
|
|
1010
1003
|
});
|
|
1011
1004
|
currentFn = foundFn;
|
|
1012
1005
|
}
|
|
@@ -1032,9 +1025,9 @@ var updateCron = Effect9.fn(function* (trigger2, cronOption) {
|
|
|
1032
1025
|
}).pipe(Prompt7.run),
|
|
1033
1026
|
onSome: (value2) => Effect9.succeed(value2)
|
|
1034
1027
|
});
|
|
1035
|
-
Obj4.
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1028
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1029
|
+
if (trigger3.spec?.kind === "timer") {
|
|
1030
|
+
trigger3.spec.cron = cron;
|
|
1038
1031
|
}
|
|
1039
1032
|
});
|
|
1040
1033
|
}
|
|
@@ -1054,11 +1047,11 @@ var updateInput3 = Effect9.fn(function* (trigger2, fn6, inputOption) {
|
|
|
1054
1047
|
});
|
|
1055
1048
|
if (shouldChangeInput) {
|
|
1056
1049
|
const inputObj = yield* Option8.match(inputOption, {
|
|
1057
|
-
onNone: () => promptForSchemaInput(fn6.inputSchema ?
|
|
1050
|
+
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema6.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
1058
1051
|
onSome: (value2) => Effect9.succeed(value2)
|
|
1059
1052
|
});
|
|
1060
|
-
Obj4.
|
|
1061
|
-
|
|
1053
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1054
|
+
trigger3.input = inputObj;
|
|
1062
1055
|
});
|
|
1063
1056
|
}
|
|
1064
1057
|
});
|
|
@@ -1070,19 +1063,19 @@ var updateEnabled3 = Effect9.fn(function* (trigger2, idOption, enabled) {
|
|
|
1070
1063
|
}).pipe(Prompt7.run),
|
|
1071
1064
|
onSome: () => Effect9.succeed(enabled)
|
|
1072
1065
|
});
|
|
1073
|
-
Obj4.
|
|
1074
|
-
|
|
1066
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1067
|
+
trigger3.enabled = enabledValue;
|
|
1075
1068
|
});
|
|
1076
1069
|
});
|
|
1077
1070
|
|
|
1078
|
-
// src/
|
|
1071
|
+
// src/commands/trigger/update/index.ts
|
|
1079
1072
|
var update = Command10.make("update").pipe(Command10.withDescription("Update a trigger."), Command10.withSubcommands([
|
|
1080
1073
|
subscription2,
|
|
1081
1074
|
timer2,
|
|
1082
1075
|
queue2
|
|
1083
1076
|
]));
|
|
1084
1077
|
|
|
1085
|
-
// src/
|
|
1078
|
+
// src/commands/trigger/index.ts
|
|
1086
1079
|
var trigger = Command11.make("trigger").pipe(Command11.withDescription("Manage EDGE triggers."), Command11.withSubcommands([
|
|
1087
1080
|
create,
|
|
1088
1081
|
list,
|
|
@@ -1090,19 +1083,31 @@ var trigger = Command11.make("trigger").pipe(Command11.withDescription("Manage E
|
|
|
1090
1083
|
update
|
|
1091
1084
|
]));
|
|
1092
1085
|
|
|
1093
|
-
// src/
|
|
1094
|
-
var AutomationPlugin = Plugin.define(meta).pipe(AppPlugin.
|
|
1086
|
+
// src/AutomationPlugin.node.ts
|
|
1087
|
+
var AutomationPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
|
|
1088
|
+
activate: AppGraphBuilder
|
|
1089
|
+
}), AppPlugin.addCommandModule({
|
|
1095
1090
|
commands: [
|
|
1096
1091
|
trigger
|
|
1097
1092
|
]
|
|
1093
|
+
}), AppPlugin.addOperationHandlerModule({
|
|
1094
|
+
activate: OperationHandler
|
|
1095
|
+
}), AppPlugin.addSchemaModule({
|
|
1096
|
+
schema: [
|
|
1097
|
+
Operation8.PersistentOperation,
|
|
1098
|
+
Trigger10.Trigger,
|
|
1099
|
+
Trace.Message
|
|
1100
|
+
]
|
|
1098
1101
|
}), Plugin.addModule({
|
|
1099
1102
|
activatesOn: ClientEvents.ClientReady,
|
|
1100
|
-
|
|
1103
|
+
firesAfterActivation: [
|
|
1101
1104
|
AutomationEvents.ComputeRuntimeReady
|
|
1102
1105
|
],
|
|
1103
1106
|
activate: ComputeRuntime
|
|
1104
1107
|
}), Plugin.make);
|
|
1108
|
+
var AutomationPlugin_node_default = AutomationPlugin;
|
|
1105
1109
|
export {
|
|
1106
|
-
AutomationPlugin
|
|
1110
|
+
AutomationPlugin,
|
|
1111
|
+
AutomationPlugin_node_default as default
|
|
1107
1112
|
};
|
|
1108
|
-
//# sourceMappingURL=
|
|
1113
|
+
//# sourceMappingURL=AutomationPlugin.node.mjs.map
|