@oomol-lab/open-flow 0.1.0-beta.60 → 0.1.0-beta.61

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.
@@ -1,7 +1,7 @@
1
- import { $ as RunStore, $n as connection, $t as DropdownMenuContent, At as followWorkbenchLink, B as CacheResource, Bn as errorNotice, Cn as Badge, Ct as setCodeActions, Dn as createI18n, Dt as updateTriggerConfig, Et as setTriggerConnection, F as feishuResourceKind, Gn as decodeTriggerCatalog, Gt as Empty, H as resourceData, Hn as randomId, Ht as InputGroup, I as supportsFeishuChatFilter, It as PopoverTitle, J as providerIcon, Jn as sampleErrorOutputs, Jt as EmptyHeader, Kt as EmptyContent, L as combineSources, M as addNodeIntent, Mt as PopoverContent, N as deriveAddNodeOptions, Ot as updateTriggerSchedule, St as resetInputValues, Tt as setInputSources, U as resourceValue, Un as allConnectorConnectionsQuery, Ut as InputGroupAddon, Vn as WorkbenchClient, W as designerGraph, Wt as InputGroupInput, Xn as isJsonObject, Xt as EmptyTitle, Yn as triggerOutputDefinitions, Yt as EmptyMedia, Zt as DropdownMenu, _ as updateValue, _t as setComment, a as nameCreatedNodes, an as DropdownMenuSeparator, at as deriveInspectorDiagnostics, bt as setNodePositions, c as updateCondition, d as updateNodeName, dr as invalidResponse, dt as connectionCatalog, er as connectorActionMetadata, f as updateNodeSettings, fr as jsonValue, ft as canvasPresentationChange, g as updateTaskPorts, gr as controlErrorCode, gt as restoreCanvasPresentation, h as updateTaskAdditionalInputs, hr as ApiError, ht as removeComments, i as deleteSelection, it as Latest, jt as Popover, kt as IdTooltip, l as updateNodeDescription, ln as DropdownMenuTrigger, m as updateTask, mr as string, mt as flowPresentation, nt as revisionView, o as setInputValue, ot as diagnosticItems, p as updateResolution, pr as record, pt as commentIds, qt as EmptyDescription, r as applyFlowChanges, rt as flowResourceReferences, s as setInputVariable, t as addNode, tn as DropdownMenuItem, tr as providerIconAppearance, u as updateNodeIcon, ur as inputValue, ut as actionWithConnections, v as updateWebhook, vt as setFlowViewport, wn as EventSourcesPage, wt as setConnectorConnection, xt as repairNodeNames, yr as IconThemeContext, yt as setNodeContentHidden, z as scopedValue } from "./flowChanges-Cbl6Izr-.js";
1
+ import { $ as RunStore, $n as setInputSources, B as CacheResource, Bn as providerIconAppearance, Bt as EmptyHeader, Ct as Popover, F as feishuResourceKind, Fn as allConnectorConnectionsQuery, Ft as InputGroupAddon, Gt as DropdownMenuContent, H as resourceData, Ht as EmptyTitle, I as supportsFeishuChatFilter, It as InputGroupInput, J as providerIcon, L as combineSources, Ln as decodeTriggerCatalog, Lt as Empty, M as addNodeIntent, Mn as errorNotice, N as deriveAddNodeOptions, Nn as WorkbenchClient, Ot as PopoverTitle, Pn as randomId, Pt as InputGroup, Qn as setConnectorConnection, Rn as connection, Rt as EmptyContent, St as followWorkbenchLink, U as resourceValue, Ut as DropdownMenu, Vt as EmptyMedia, W as designerGraph, Xn as resetInputValues, Yn as repairNodeNames, Zn as setCodeActions, Zt as DropdownMenuSeparator, _ as updateValue, _r as ApiError, _t as setComment, a as nameCreatedNodes, at as deriveInspectorDiagnostics, bt as setNodePositions, c as updateCondition, cr as triggerOutputDefinitions, d as updateNodeName, dt as connectionCatalog, er as setTriggerConnection, f as updateNodeSettings, fr as inputValue, ft as canvasPresentationChange, g as updateTaskPorts, gn as EventSourcesPage, gr as string, gt as restoreCanvasPresentation, h as updateTaskAdditionalInputs, hn as Badge, hr as record, ht as removeComments, i as deleteSelection, ir as replaceSource, it as Latest, l as updateNodeDescription, lr as isJsonObject, m as updateTask, mr as jsonValue, mt as flowPresentation, nr as updateTriggerSchedule, nt as revisionView, o as setInputValue, ot as diagnosticItems, p as updateResolution, pr as invalidResponse, pt as commentIds, qt as DropdownMenuItem, r as applyFlowChanges, rr as imports, rt as flowResourceReferences, s as setInputVariable, sr as sampleErrorOutputs, t as addNode, tn as DropdownMenuTrigger, tr as updateTriggerConfig, u as updateNodeIcon, ut as actionWithConnections, v as updateWebhook, vr as controlErrorCode, vt as setFlowViewport, wt as PopoverContent, xr as IconThemeContext, xt as IdTooltip, yn as createI18n, yt as setNodeContentHidden, z as scopedValue, zn as connectorActionMetadata, zt as EmptyDescription } from "./flowChanges-DSA0FxxN.js";
2
2
  import { a as derive, i as compute, l as val } from "./dist-bO8nvHFH.js";
3
3
  import { a as toPlainObject, c as useLang, l as useTranslate, o as I18nProvider, u as useVal } from "./dist-BFmpkX4P.js";
4
- import { E as FieldLabel, H as applyFlowChanges$1, J as resourceNameIssue, Q as nodeInputMappings, S as Field, T as FieldGroup, V as FlowChangeError, Z as mapConditionSources, a as DialogDescription, at as dequal$1, bi as cn, c as DialogTitle, d as TooltipContent, i as DialogContent, n as Dialog, o as DialogFooter, or as Input, p as TooltipTrigger, r as DialogClose, s as DialogHeader, t as Icon, u as Tooltip, vi as Button, w as FieldError, x as Spinner } from "./icons-D70mz3qW.js";
4
+ import { E as FieldLabel, J as nodeInputMappings, L as FlowChangeError, R as applyFlowChanges$1, S as Field, T as FieldGroup, W as resourceNameIssue, a as DialogDescription, bi as cn, c as DialogTitle, d as TooltipContent, i as DialogContent, n as Dialog, o as DialogFooter, or as Input, p as TooltipTrigger, q as mapConditionSources, r as DialogClose, s as DialogHeader, t as Icon, u as Tooltip, vi as Button, w as FieldError, x as Spinner, yt as dequal$1 } from "./icons-DVJvrj1H.js";
5
5
  import { c as isUiLanguage, d as uiLanguages, l as resolveUiLanguage, u as uiLanguageNames } from "./value-DL_poNiC.js";
6
6
  import { Suspense, lazy, useEffect, useRef, useState } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -184,7 +184,7 @@ function Skeleton({ className, ...props }) {
184
184
  }
185
185
  //#endregion
186
186
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
187
- var CreateResourceDialog = lazy(() => import("./createResourceDialog-B7ThMSeA.js"));
187
+ var CreateResourceDialog = lazy(() => import("./createResourceDialog-D71fO68i.js"));
188
188
  var flowIdTooltipAlignOffset = 44;
189
189
  var renamePopoverAlignOffset = -12;
190
190
  var renamePopoverVerticalShift = 8;
@@ -925,36 +925,6 @@ function disconnect(content, edge) {
925
925
  kind: "graph.edge.disconnect"
926
926
  }];
927
927
  }
928
- //#endregion
929
- //#region src/flow/common/moduleChanges.ts
930
- async function imports(source) {
931
- try {
932
- const { parse } = await import("./lib-Dws05GHj.js").then((n) => n.t);
933
- const program = parse(source, {
934
- errorRecovery: true,
935
- sourceType: "module"
936
- }).program;
937
- const dependencies = /* @__PURE__ */ new Set();
938
- for (const statement of program.body) {
939
- if (statement.type != "ImportDeclaration") continue;
940
- const match = /^\.\/(.+)\.mjs$/.exec(statement.source.value);
941
- if (match?.[1] != null) dependencies.add(match[1]);
942
- }
943
- return [...dependencies].toSorted();
944
- } catch {
945
- return [];
946
- }
947
- }
948
- function replaceSource(moduleId, beforeSource, beforeImports, source, moduleImports) {
949
- return [{
950
- beforeImports,
951
- beforeSource,
952
- imports: moduleImports,
953
- kind: "module.source.replace",
954
- moduleId,
955
- source
956
- }];
957
- }
958
928
  var createAuthoringId = customAlphabet("23456789abcdefghjkmnpqrstuvwxyz", 10);
959
929
  //#endregion
960
930
  //#region src/workbench/browser/runtime/editor/triggerDiagnosticPresentation.ts
@@ -1025,7 +995,6 @@ var PublicationStore = class {
1025
995
  activitiesLoadingMore: derive(this.#state, (state) => state.activitiesLoadingMore),
1026
996
  activitiesNextCursor: derive(this.#state, (state) => state.activitiesNextCursor),
1027
997
  bindings: derive(this.#state, (state) => state.bindings),
1028
- changingTriggerId: derive(this.#state, (state) => state.changingTriggerId),
1029
998
  detail: derive(this.#state, (state) => state.detail),
1030
999
  detailLoading: derive(this.#state, (state) => state.detailLoading),
1031
1000
  live: derive(this.#state, (state) => state.live),
@@ -1152,7 +1121,7 @@ var PublicationStore = class {
1152
1121
  if (!await this.#workspace.saveModuleEditor() || flowId != this.#workspace.$.flowId.value) return false;
1153
1122
  const flow = this.#workspace.$.flow.value;
1154
1123
  const draft = this.#workspace.$.draft.value;
1155
- if (flow == null || draft == null || this.#state.value.changingTriggerId != null || this.#state.value.publishing || this.#state.value.rollingBackPublicationId != null) return false;
1124
+ if (flow == null || draft == null || this.#state.value.publishing || this.#state.value.rollingBackPublicationId != null) return false;
1156
1125
  const target = { flowId: flow.flowId };
1157
1126
  const expectedLivePublicationId = this.#workspace.$.live.value?.publication?.publicationId ?? null;
1158
1127
  const signature = JSON.stringify({
@@ -1190,7 +1159,7 @@ var PublicationStore = class {
1190
1159
  async rollback(publication) {
1191
1160
  const { live, rollingBackPublicationId, target } = this.#state.value;
1192
1161
  const currentPublicationId = live?.publication?.publicationId;
1193
- if (target == null || currentPublicationId == null || this.#state.value.changingTriggerId != null || rollingBackPublicationId != null || this.#state.value.publishing || publication.flowId != target.flowId) return false;
1162
+ if (target == null || currentPublicationId == null || rollingBackPublicationId != null || this.#state.value.publishing || publication.flowId != target.flowId) return false;
1194
1163
  const signature = JSON.stringify({
1195
1164
  currentPublicationId,
1196
1165
  flowId: target.flowId,
@@ -1336,32 +1305,6 @@ var PublicationStore = class {
1336
1305
  if (current() && this.#state.value.selectedTriggerId == selectedTriggerId) this.#set({ testingTriggerId: void 0 });
1337
1306
  }
1338
1307
  }
1339
- async toggleTrigger(binding) {
1340
- const target = this.#state.value.target;
1341
- if (target == null || this.#state.value.changingTriggerId != null || this.#state.value.publishing || this.#state.value.rollingBackPublicationId != null) return false;
1342
- this.#stopObservation();
1343
- const current = this.#operation.begin();
1344
- this.#set({ changingTriggerId: binding.triggerNodeId });
1345
- try {
1346
- if (binding.operatorState == "active") await this.#client.pauseFlowTrigger(target.flowId, binding.triggerNodeId);
1347
- else await this.#client.resumeFlowTrigger(target.flowId, binding.triggerNodeId);
1348
- if (!current()) return false;
1349
- const bindings = await this.#client.listFlowTriggerBindings(target.flowId);
1350
- if (!current()) return false;
1351
- this.#set({ bindings });
1352
- if (this.#state.value.selectedTriggerId == binding.triggerNodeId) this.openTrigger(binding.triggerNodeId);
1353
- this.#setNotice({
1354
- kind: "success",
1355
- message: this.#i18n.t(binding.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
1356
- });
1357
- return true;
1358
- } catch (error) {
1359
- if (current()) this.#setNotice(errorNotice(error, this.#i18n.t));
1360
- return false;
1361
- } finally {
1362
- if (current()) this.#set({ changingTriggerId: void 0 });
1363
- }
1364
- }
1365
1308
  async #refresh(target, signal) {
1366
1309
  const current = this.#loads.begin();
1367
1310
  const [live, page, bindings] = await this.#read(target, signal).catch((error) => {
@@ -6493,7 +6436,6 @@ var WorkbenchStore = class {
6493
6436
  if (get(this.runs.$.cancelingRunId) != null) return "cancel";
6494
6437
  if (get(this.publications.$.publishing)) return "publish";
6495
6438
  if (get(this.publications.$.rollingBackPublicationId) != null) return "rollback";
6496
- if (get(this.publications.$.changingTriggerId) != null) return "trigger";
6497
6439
  }),
6498
6440
  diagnosticItems: compute((get) => {
6499
6441
  const revision = get(this.workspace.$.revision);
@@ -6784,7 +6726,7 @@ var WorkbenchStore = class {
6784
6726
  };
6785
6727
  //#endregion
6786
6728
  //#region src/workbench/browser/runtime/openFlowWorkbench.tsx
6787
- var FlowWorkspace = lazy(() => import("./flowWorkspace-BdbsnUDs.js"));
6729
+ var FlowWorkspace = lazy(() => import("./flowWorkspace-0sUJ5JhQ.js"));
6788
6730
  function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
6789
6731
  const hasToken = token != null && tokenLabel != null && onTokenChange != null;
6790
6732
  const tokenValue = token ?? "";
@@ -1,4 +1,4 @@
1
- import { Ct as SelectGroup, Dt as SelectValue, Et as SelectTrigger, St as SelectContent, bi as cn, bt as Select, wt as SelectItem } from "./icons-D70mz3qW.js";
1
+ import { Ct as SelectGroup, Dt as SelectValue, Et as SelectTrigger, St as SelectContent, bi as cn, bt as Select, wt as SelectItem } from "./icons-DVJvrj1H.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/workbench/browser/runtime/shell/workbenchSelect.tsx
4
4
  function WorkbenchSelect({ ariaLabel, className, disabled = false, id, onValueChange, options, portalRoot, size, value, variant }) {
@@ -0,0 +1,6 @@
1
+ export interface OpenFlowCommandHost {
2
+ readonly cloudRequest?: (path: string, init?: RequestInit) => Promise<Response>;
3
+ getWorkbenchUrl?(flowId?: string): Promise<string>;
4
+ readonly language?: string;
5
+ }
6
+ export declare function runOpenFlowCommand(args: readonly string[], host?: OpenFlowCommandHost): Promise<number>;