@dxos/plugin-automation 0.8.4-main.422d1c7879 → 0.8.4-main.51f1e5ca51
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/browser/{chunk-VKSAIOAL.mjs → chunk-3JLJBF5C.mjs} +1 -1
- package/dist/lib/browser/chunk-3JLJBF5C.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LEN2XWRB.mjs → chunk-SZIGF7TB.mjs} +2 -2
- package/dist/lib/browser/cli/index.mjs +21 -24
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/{create-trigger-from-template-NH5EL6LB.mjs → create-trigger-from-template-RSZIPHIG.mjs} +6 -6
- package/dist/lib/browser/{create-trigger-from-template-NH5EL6LB.mjs.map → create-trigger-from-template-RSZIPHIG.mjs.map} +2 -2
- package/dist/lib/browser/hooks/index.mjs +54 -12
- package/dist/lib/browser/hooks/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +5 -48
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +3 -3
- package/dist/lib/browser/operations/index.mjs.map +2 -2
- package/dist/lib/browser/translations.mjs +47 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-45PS7CQD.mjs → chunk-7I6EPBJI.mjs} +1 -1
- package/dist/lib/node-esm/chunk-7I6EPBJI.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-V2SSR4MK.mjs → chunk-TR5BMZG5.mjs} +2 -2
- package/dist/lib/node-esm/cli/index.mjs +21 -24
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/{create-trigger-from-template-C7UPU2VL.mjs → create-trigger-from-template-GE76I6FE.mjs} +6 -6
- package/dist/lib/node-esm/{create-trigger-from-template-C7UPU2VL.mjs.map → create-trigger-from-template-GE76I6FE.mjs.map} +2 -2
- package/dist/lib/node-esm/hooks/index.mjs +54 -12
- package/dist/lib/node-esm/hooks/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +5 -48
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +3 -3
- package/dist/lib/node-esm/operations/index.mjs.map +2 -2
- package/dist/lib/node-esm/translations.mjs +48 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/create/index.d.ts +6 -6
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/index.d.ts +7 -7
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/update/index.d.ts +5 -5
- package/dist/types/src/cli/commands/trigger/util.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +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 -32
- 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.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +4 -4
- 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.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +95 -95
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +14 -2
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +3 -3
- package/dist/types/src/testing/test-functions.d.ts +78 -78
- package/dist/types/src/translations.d.ts +32 -33
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +3 -3
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -45
- package/src/AutomationPlugin.tsx +1 -2
- package/src/capabilities/app-graph-builder.ts +8 -7
- package/src/capabilities/compute-runtime.ts +15 -1
- package/src/cli/commands/trigger/list.ts +4 -2
- package/src/cli/commands/trigger/update/queue.ts +4 -4
- package/src/cli/commands/trigger/update/subscription.ts +4 -4
- package/src/cli/commands/trigger/update/timer.ts +4 -4
- package/src/cli/commands/trigger/util.ts +4 -2
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -1
- package/src/components/AutomationPanel/AutomationPanel.tsx +7 -4
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +2 -2
- package/src/components/TriggerEditor/TriggerEditor.tsx +1 -1
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +1 -2
- package/src/hooks/useComputeRuntime.ts +9 -0
- package/src/hooks/useComputeRuntimeService.ts +48 -9
- package/src/hooks/useTriggerRuntimeControls.ts +5 -2
- package/src/operations/create-trigger-from-template.ts +3 -3
- package/src/translations.ts +3 -3
- package/src/types/capabilities.ts +3 -2
- package/dist/lib/browser/chunk-VKSAIOAL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-45PS7CQD.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-LEN2XWRB.mjs.map → chunk-SZIGF7TB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-V2SSR4MK.mjs.map → chunk-TR5BMZG5.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { type AiService, type OpaqueToolkit } from '@dxos/ai';\nimport { Capability } from '@dxos/app-framework';\nimport type { Blueprint } from '@dxos/blueprints';\nimport { type Database, type Feed } from '@dxos/echo';\nimport type { CredentialsService, Process, QueueService } from '@dxos/functions';\nimport { AgentService } from '@dxos/functions-runtime';\nimport type { ProcessManager, TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';\nimport type { SpaceId } from '@dxos/keys';\nimport type { Operation, OperationRegistry } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nexport namespace AutomationCapabilities {\n /**\n * Service stack for executing agents, functions, and triggers.\n */\n export type ComputeServices =\n | TriggerDispatcher\n | TriggerStateStore\n | AiService.AiService\n | Database.Service\n | Feed.FeedService\n | QueueService\n | CredentialsService\n | Blueprint.RegistryService\n | AgentService.AgentService\n | Process.ProcessMonitorService\n | ProcessManager.Service\n | Operation.Service\n | OperationRegistry.Service\n | OpaqueToolkit.OpaqueToolkitProvider;\n\n export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;\n export interface ComputeRuntimeProvider {\n getRuntime(spaceId: SpaceId): ComputeRuntime;\n }\n\n /**\n * Runtime for executing agents, functions, and triggers.\n */\n export const ComputeRuntime = Capability.make<ComputeRuntimeProvider>(`${meta.id}.capability.compute-runtime`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport namespace AutomationEvents {\n export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}.event.compute-runtime-ready`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Database } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nexport const TriggerTemplate = Schema.Union(\n Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),\n Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),\n);\n\nexport namespace AutomationAction {\n export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(\n `${meta.id}.action.create-trigger-from-template`,\n {\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n"],
|
|
5
|
+
"mappings": ";AAOA,SAASA,kBAAkB;AAS3B,SAASC,YAAY;UAEJC,yBAAAA;0BA4BFC,iBAAiBH,WAAWI,KAA6B,GAAGH,KAAKI,EAAE,6BAA6B;AAC/G,GA7BiBH,2BAAAA,yBAAAA,CAAAA,EAAAA;;;;ACdjB,SAASI,uBAAuB;AAEhC,SAASC,QAAAA,aAAY;UAEJC,mBAAAA;oBACFC,sBAAsBH,gBAAgBI,KAAK,GAAGH,MAAKI,EAAE,8BAA8B;AAClG,GAFiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;;;;ACJjB,YAAYI,YAAY;AAExB,SAASC,gBAAgB;AAEzB,SAASC,QAAAA,aAAY;AAEd,IAAMC,kBAAyBC,aAC7BC,cAAO;EAAEC,MAAaC,eAAQ,OAAA;EAAUC,MAAaC;AAAO,CAAA,GAC5DJ,cAAO;EAAEC,MAAaC,eAAQ,OAAA;EAAUG,UAAiBC;AAAI,CAAA,CAAA;UAGrDC,mBAAAA;EACR,MAAMC,kCAAyCC,mBAAW,EAC/D,GAAGZ,MAAKa,EAAE,wCACV;IACEC,OAAcX,cAAO;MACnBY,IAAIhB,SAASA;MACbiB,UAAUf;MACVgB,SAAgBC,gBAAgBC,cAAO;;MAEvCC,YAAmBF,gBAAgBX,aAAM;MACzCO,OAAcI,gBAAgBG,cAAO;QAAEC,KAAYf;QAAQgB,OAAcd;MAAI,CAAA,CAAA;IAC/E,CAAA;IACAe,QAAeC;EACjB,CAAA,EAAA;EACC;oBAbUd,4BAAAA;AAcf,GAfiBD,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Capability", "meta", "AutomationCapabilities", "ComputeRuntime", "make", "id", "ActivationEvent", "meta", "AutomationEvents", "ComputeRuntimeReady", "make", "id", "Schema", "Database", "meta", "TriggerTemplate", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "CreateTriggerFromTemplate", "TaggedClass", "id", "input", "db", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "key", "value", "output", "Void"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TriggerTemplate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JLJBF5C.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
6
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
CreateTriggerFromTemplate,
|
|
42
42
|
definitions_exports
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-SZIGF7TB.mjs.map
|
|
@@ -59,7 +59,7 @@ import * as Match from "effect/Match";
|
|
|
59
59
|
import * as Option from "effect/Option";
|
|
60
60
|
import * as SchemaAST from "effect/SchemaAST";
|
|
61
61
|
import { FormBuilder } from "@dxos/cli-util";
|
|
62
|
-
import { Annotation, Database, Entity, Feed, Filter, Obj, Ref, Type } from "@dxos/echo";
|
|
62
|
+
import { Annotation, Database, Entity, Feed, Filter, Obj, Query, Ref, Type } from "@dxos/echo";
|
|
63
63
|
import { getProperties } from "@dxos/effect";
|
|
64
64
|
import { Trigger } from "@dxos/functions";
|
|
65
65
|
import { Operation } from "@dxos/operation";
|
|
@@ -241,7 +241,7 @@ var selectFunction = Effect.fn(function* () {
|
|
|
241
241
|
return String(selected);
|
|
242
242
|
});
|
|
243
243
|
var selectTrigger = Effect.fn(function* (kind) {
|
|
244
|
-
const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
|
|
244
|
+
const triggers = yield* Database.runQuery(Query.select(Filter.type(Trigger.Trigger)).debugLabel("cli.trigger.selectTrigger"));
|
|
245
245
|
const filteredTriggers = kind ? triggers.filter((trigger2) => trigger2.spec?.kind === kind) : triggers;
|
|
246
246
|
if (filteredTriggers.length === 0) {
|
|
247
247
|
return yield* Effect.fail(new Error(kind ? `No ${kind} triggers available` : "No triggers available"));
|
|
@@ -379,7 +379,7 @@ import * as Option3 from "effect/Option";
|
|
|
379
379
|
import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
|
|
380
380
|
import { flushAndSync as flushAndSync2, print as print2, spaceLayer as spaceLayer2, withTypes as withTypes2 } from "@dxos/cli-util";
|
|
381
381
|
import { Common as Common2 } from "@dxos/cli-util";
|
|
382
|
-
import { Database as Database3, Filter as Filter3, JsonSchema as JsonSchema2, Query, Ref as Ref3 } from "@dxos/echo";
|
|
382
|
+
import { Database as Database3, Filter as Filter3, JsonSchema as JsonSchema2, Query as Query2, Ref as Ref3 } from "@dxos/echo";
|
|
383
383
|
import { Trigger as Trigger3 } from "@dxos/functions";
|
|
384
384
|
import { Operation as Operation3 } from "@dxos/operation";
|
|
385
385
|
var subscription = Command2.make("subscription", {
|
|
@@ -407,7 +407,7 @@ var subscription = Command2.make("subscription", {
|
|
|
407
407
|
}).pipe(Prompt3.run),
|
|
408
408
|
onSome: (value2) => Effect3.succeed(value2)
|
|
409
409
|
});
|
|
410
|
-
const subscriptionQuery =
|
|
410
|
+
const subscriptionQuery = Query2.select(Filter3.type(typename));
|
|
411
411
|
const deepOption = yield* Option3.match(options.deep, {
|
|
412
412
|
onNone: () => Prompt3.confirm({
|
|
413
413
|
message: "Watch changes to nested properties (deep)?",
|
|
@@ -539,21 +539,18 @@ import * as Effect5 from "effect/Effect";
|
|
|
539
539
|
import { CommandConfig as CommandConfig4, Common as Common4, printList, spaceIdWithDefault, spaceLayer as spaceLayer4 } from "@dxos/cli-util";
|
|
540
540
|
import { ClientService } from "@dxos/client";
|
|
541
541
|
import { Context } from "@dxos/context";
|
|
542
|
-
import { Database as Database5, Filter as Filter5 } from "@dxos/echo";
|
|
542
|
+
import { Database as Database5, Filter as Filter5, Query as Query3 } from "@dxos/echo";
|
|
543
543
|
import { Trigger as Trigger5 } from "@dxos/functions";
|
|
544
544
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/cli/commands/trigger/list.ts";
|
|
545
545
|
var list = Command5.make("list", {
|
|
546
546
|
spaceId: Common4.spaceId.pipe(Options5.optional)
|
|
547
547
|
}, Effect5.fn(function* ({ spaceId: spaceIdOption }) {
|
|
548
548
|
const { json } = yield* CommandConfig4;
|
|
549
|
-
const triggers = yield* Database5.runQuery(Filter5.type(Trigger5.Trigger));
|
|
549
|
+
const triggers = yield* Database5.runQuery(Query3.select(Filter5.type(Trigger5.Trigger)).debugLabel("cli.trigger.list"));
|
|
550
550
|
const remoteCronIds = yield* Effect5.gen(function* () {
|
|
551
551
|
const client = yield* ClientService;
|
|
552
552
|
const spaceId = yield* spaceIdWithDefault(spaceIdOption);
|
|
553
|
-
const result = yield* Effect5.promise(() => client.edge.http.getCronTriggers(Context.default(void 0, {
|
|
554
|
-
F: __dxlog_file,
|
|
555
|
-
L: 33
|
|
556
|
-
}), spaceId)).pipe(Effect5.catchAll(() => Effect5.succeed({
|
|
553
|
+
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({
|
|
557
554
|
cronIds: []
|
|
558
555
|
})));
|
|
559
556
|
return result.cronIds;
|
|
@@ -679,7 +676,7 @@ var updateFunction = Effect7.fn(function* (trigger2, functionIdOption) {
|
|
|
679
676
|
if (!foundFn || !Obj2.instanceOf(Operation5.PersistentOperation, foundFn)) {
|
|
680
677
|
return yield* Effect7.fail(new Error(`Function not found: ${functionId}`));
|
|
681
678
|
}
|
|
682
|
-
Obj2.
|
|
679
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
683
680
|
trigger3.function = Ref5.make(foundFn);
|
|
684
681
|
});
|
|
685
682
|
currentFn = foundFn;
|
|
@@ -705,7 +702,7 @@ var updateQueue = Effect7.fn(function* (trigger2, queueOption) {
|
|
|
705
702
|
onNone: () => selectQueue(),
|
|
706
703
|
onSome: (dxn) => Effect7.succeed(dxn.toString())
|
|
707
704
|
});
|
|
708
|
-
Obj2.
|
|
705
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
709
706
|
if (trigger3.spec?.kind === "queue") {
|
|
710
707
|
trigger3.spec.queue = queueDxn;
|
|
711
708
|
}
|
|
@@ -730,7 +727,7 @@ var updateInput = Effect7.fn(function* (trigger2, fn6, inputOption) {
|
|
|
730
727
|
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema4.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
731
728
|
onSome: (value2) => Effect7.succeed(value2)
|
|
732
729
|
});
|
|
733
|
-
Obj2.
|
|
730
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
734
731
|
trigger3.input = inputObj;
|
|
735
732
|
});
|
|
736
733
|
}
|
|
@@ -743,7 +740,7 @@ var updateEnabled = Effect7.fn(function* (trigger2, idOption, enabled) {
|
|
|
743
740
|
}).pipe(Prompt5.run),
|
|
744
741
|
onSome: () => Effect7.succeed(enabled)
|
|
745
742
|
});
|
|
746
|
-
Obj2.
|
|
743
|
+
Obj2.update(trigger2, (trigger3) => {
|
|
747
744
|
trigger3.enabled = enabledValue;
|
|
748
745
|
});
|
|
749
746
|
});
|
|
@@ -759,7 +756,7 @@ import * as Option7 from "effect/Option";
|
|
|
759
756
|
import { CommandConfig as CommandConfig7 } from "@dxos/cli-util";
|
|
760
757
|
import { flushAndSync as flushAndSync5, print as print6, spaceLayer as spaceLayer7, withTypes as withTypes6 } from "@dxos/cli-util";
|
|
761
758
|
import { Common as Common7 } from "@dxos/cli-util";
|
|
762
|
-
import { DXN as DXN4, Database as Database8, Filter as Filter7, JsonSchema as JsonSchema5, Obj as Obj3, Query as
|
|
759
|
+
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";
|
|
763
760
|
import { Trigger as Trigger8 } from "@dxos/functions";
|
|
764
761
|
import { Operation as Operation6 } from "@dxos/operation";
|
|
765
762
|
var subscription2 = Command8.make("subscription", {
|
|
@@ -828,7 +825,7 @@ var updateFunction2 = Effect8.fn(function* (trigger2, functionIdOption) {
|
|
|
828
825
|
if (!foundFn || !Obj3.instanceOf(Operation6.PersistentOperation, foundFn)) {
|
|
829
826
|
return yield* Effect8.fail(new Error(`Function not found: ${functionId}`));
|
|
830
827
|
}
|
|
831
|
-
Obj3.
|
|
828
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
832
829
|
trigger3.function = Ref6.make(foundFn);
|
|
833
830
|
});
|
|
834
831
|
currentFn = foundFn;
|
|
@@ -868,7 +865,7 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
|
|
|
868
865
|
}).pipe(Prompt6.run),
|
|
869
866
|
onSome: (value2) => Effect8.succeed(value2)
|
|
870
867
|
});
|
|
871
|
-
const queryAst =
|
|
868
|
+
const queryAst = Query4.select(Filter7.type(typename)).ast;
|
|
872
869
|
const deepOptionValue = yield* Option7.match(deepOption, {
|
|
873
870
|
onNone: () => Prompt6.confirm({
|
|
874
871
|
message: "Watch changes to nested properties (deep)?",
|
|
@@ -893,7 +890,7 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
|
|
|
893
890
|
if (Option7.isSome(delayOptionValue)) {
|
|
894
891
|
subscriptionOptions.delay = delayOptionValue.value;
|
|
895
892
|
}
|
|
896
|
-
Obj3.
|
|
893
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
897
894
|
const spec = trigger3.spec;
|
|
898
895
|
if (spec?.kind === "subscription") {
|
|
899
896
|
spec.query = {
|
|
@@ -922,7 +919,7 @@ var updateInput2 = Effect8.fn(function* (trigger2, fn6, inputOption) {
|
|
|
922
919
|
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema5.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
923
920
|
onSome: (value2) => Effect8.succeed(value2)
|
|
924
921
|
});
|
|
925
|
-
Obj3.
|
|
922
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
926
923
|
trigger3.input = inputObj;
|
|
927
924
|
});
|
|
928
925
|
}
|
|
@@ -935,7 +932,7 @@ var updateEnabled2 = Effect8.fn(function* (trigger2, idOption, enabled) {
|
|
|
935
932
|
}).pipe(Prompt6.run),
|
|
936
933
|
onSome: () => Effect8.succeed(enabled)
|
|
937
934
|
});
|
|
938
|
-
Obj3.
|
|
935
|
+
Obj3.update(trigger2, (trigger3) => {
|
|
939
936
|
trigger3.enabled = enabledValue;
|
|
940
937
|
});
|
|
941
938
|
});
|
|
@@ -1007,7 +1004,7 @@ var updateFunction3 = Effect9.fn(function* (trigger2, functionIdOption) {
|
|
|
1007
1004
|
if (!foundFn || !Obj4.instanceOf(Operation7.PersistentOperation, foundFn)) {
|
|
1008
1005
|
return yield* Effect9.fail(new Error(`Function not found: ${functionId}`));
|
|
1009
1006
|
}
|
|
1010
|
-
Obj4.
|
|
1007
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1011
1008
|
trigger3.function = Ref7.make(foundFn);
|
|
1012
1009
|
});
|
|
1013
1010
|
currentFn = foundFn;
|
|
@@ -1034,7 +1031,7 @@ var updateCron = Effect9.fn(function* (trigger2, cronOption) {
|
|
|
1034
1031
|
}).pipe(Prompt7.run),
|
|
1035
1032
|
onSome: (value2) => Effect9.succeed(value2)
|
|
1036
1033
|
});
|
|
1037
|
-
Obj4.
|
|
1034
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1038
1035
|
if (trigger3.spec?.kind === "timer") {
|
|
1039
1036
|
trigger3.spec.cron = cron;
|
|
1040
1037
|
}
|
|
@@ -1059,7 +1056,7 @@ var updateInput3 = Effect9.fn(function* (trigger2, fn6, inputOption) {
|
|
|
1059
1056
|
onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema6.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
|
|
1060
1057
|
onSome: (value2) => Effect9.succeed(value2)
|
|
1061
1058
|
});
|
|
1062
|
-
Obj4.
|
|
1059
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1063
1060
|
trigger3.input = inputObj;
|
|
1064
1061
|
});
|
|
1065
1062
|
}
|
|
@@ -1072,7 +1069,7 @@ var updateEnabled3 = Effect9.fn(function* (trigger2, idOption, enabled) {
|
|
|
1072
1069
|
}).pipe(Prompt7.run),
|
|
1073
1070
|
onSome: () => Effect9.succeed(enabled)
|
|
1074
1071
|
});
|
|
1075
|
-
Obj4.
|
|
1072
|
+
Obj4.update(trigger2, (trigger3) => {
|
|
1076
1073
|
trigger3.enabled = enabledValue;
|
|
1077
1074
|
});
|
|
1078
1075
|
});
|