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

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.
@@ -10752,6 +10752,10 @@ svg.react-flow__connectionline {
10752
10752
  font-weight: 500;
10753
10753
  }
10754
10754
 
10755
+ .open-flow-workbench .trigger-binding-state.neutral {
10756
+ color: var(--ui-muted-foreground);
10757
+ }
10758
+
10755
10759
  .open-flow-workbench .trigger-binding-state.success {
10756
10760
  color: var(--success-foreground);
10757
10761
  }
@@ -10815,26 +10819,6 @@ svg.react-flow__connectionline {
10815
10819
  display: grid;
10816
10820
  }
10817
10821
 
10818
- .open-flow-workbench .trigger-webhook code {
10819
- min-width: 0;
10820
- color: var(--ui-foreground);
10821
- overflow-wrap: anywhere;
10822
- flex: 1;
10823
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
10824
- font-size: 12px;
10825
- }
10826
-
10827
- .open-flow-workbench .trigger-webhook > div {
10828
- align-items: center;
10829
- gap: 8px;
10830
- min-width: 0;
10831
- display: flex;
10832
- }
10833
-
10834
- .open-flow-workbench .trigger-webhook [data-slot="button"] {
10835
- flex: none;
10836
- }
10837
-
10838
10822
  .open-flow-workbench .trigger-binding-detail-sections {
10839
10823
  border-top: 1px solid var(--ui-border);
10840
10824
  grid-template-columns: minmax(0, 1fr);
@@ -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 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-CzYIVevI.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 { B as applyFlowChanges$1, E as FieldLabel, K as resourceNameIssue, S as Field, T as FieldGroup, X as nodeInputMappings, Y as mapConditionSources, a as DialogDescription, c as DialogTitle, d as TooltipContent, i as DialogContent, n as Dialog, o as DialogFooter, p as TooltipTrigger, r as DialogClose, rt as dequal$1, s as DialogHeader, sr as Input, t as Icon, u as Tooltip, w as FieldError, x as Spinner, xi as cn, yi as Button, z as FlowChangeError } from "./icons-CajfDpy_.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-DZgJsr3e.js"));
188
188
  var flowIdTooltipAlignOffset = 44;
189
189
  var renamePopoverAlignOffset = -12;
190
190
  var renamePopoverVerticalShift = 8;
@@ -975,12 +975,15 @@ function presentTriggerDiagnostics(items, revision, displays, language, t) {
975
975
  }
976
976
  //#endregion
977
977
  //#region src/workbench/browser/runtime/publications/publicationStore.ts
978
+ var initialBindings = {
979
+ status: "idle",
980
+ bindings: []
981
+ };
978
982
  var initialState$6 = {
979
983
  activities: [],
980
984
  activitiesLoadFailed: false,
981
985
  activitiesLoading: false,
982
986
  activitiesLoadingMore: false,
983
- bindings: [],
984
987
  detailLoading: false,
985
988
  loaded: false,
986
989
  loadFailed: false,
@@ -1001,6 +1004,8 @@ var PublicationStore = class {
1001
1004
  #client;
1002
1005
  #identity;
1003
1006
  #i18n;
1007
+ #bindings = val(initialBindings);
1008
+ #bindingLoads = new Latest();
1004
1009
  #loads = new Latest();
1005
1010
  #operation = new Latest();
1006
1011
  #preferences;
@@ -1024,8 +1029,7 @@ var PublicationStore = class {
1024
1029
  activitiesLoading: derive(this.#state, (state) => state.activitiesLoading),
1025
1030
  activitiesLoadingMore: derive(this.#state, (state) => state.activitiesLoadingMore),
1026
1031
  activitiesNextCursor: derive(this.#state, (state) => state.activitiesNextCursor),
1027
- bindings: derive(this.#state, (state) => state.bindings),
1028
- changingTriggerId: derive(this.#state, (state) => state.changingTriggerId),
1032
+ bindings: this.#bindings,
1029
1033
  detail: derive(this.#state, (state) => state.detail),
1030
1034
  detailLoading: derive(this.#state, (state) => state.detailLoading),
1031
1035
  live: derive(this.#state, (state) => state.live),
@@ -1046,6 +1050,7 @@ var PublicationStore = class {
1046
1050
  };
1047
1051
  }
1048
1052
  dispose() {
1053
+ this.#bindingLoads.invalidate();
1049
1054
  this.#loads.invalidate();
1050
1055
  this.#operation.invalidate();
1051
1056
  this.#stopObservation();
@@ -1055,6 +1060,8 @@ var PublicationStore = class {
1055
1060
  this.#state.dispose();
1056
1061
  }
1057
1062
  reset() {
1063
+ this.#bindingLoads.invalidate();
1064
+ this.#bindings.set(initialBindings);
1058
1065
  this.#loads.invalidate();
1059
1066
  this.#operation.invalidate();
1060
1067
  this.#stopObservation();
@@ -1086,11 +1093,11 @@ var PublicationStore = class {
1086
1093
  });
1087
1094
  try {
1088
1095
  const operation = warm ? state.operation : await this.#storedOperation(target);
1089
- const [live, page, bindings] = await this.#read(target);
1096
+ if (!current()) return;
1097
+ const [live, page] = await this.#read(target);
1090
1098
  if (!current()) return;
1091
1099
  this.#workspace.updateLive(live);
1092
1100
  this.#set({
1093
- bindings,
1094
1101
  live,
1095
1102
  loaded: true,
1096
1103
  loading: false,
@@ -1117,6 +1124,36 @@ var PublicationStore = class {
1117
1124
  this.#setNotice(errorNotice(error, this.#i18n.t));
1118
1125
  }
1119
1126
  }
1127
+ async loadBindings(flowId) {
1128
+ try {
1129
+ await this.#readBindings(flowId);
1130
+ } catch {}
1131
+ }
1132
+ async #readBindings(flowId, signal) {
1133
+ const previous = this.#bindings.value;
1134
+ const current = this.#bindingLoads.begin();
1135
+ this.#bindings.set({
1136
+ flowId,
1137
+ status: "loading",
1138
+ bindings: previous.flowId === flowId ? previous.bindings : []
1139
+ });
1140
+ try {
1141
+ const bindings = await this.#client.listFlowTriggerBindings(flowId, signal);
1142
+ if (!current()) return;
1143
+ this.#bindings.set({
1144
+ flowId,
1145
+ status: "loaded",
1146
+ bindings
1147
+ });
1148
+ } catch (error) {
1149
+ if (!current()) return;
1150
+ this.#bindings.set({
1151
+ ...this.#bindings.value,
1152
+ status: "failed"
1153
+ });
1154
+ throw error;
1155
+ }
1156
+ }
1120
1157
  async loadMore() {
1121
1158
  const { loadingMore, nextCursor, target } = this.#state.value;
1122
1159
  if (loadingMore || nextCursor == null || target == null) return;
@@ -1152,7 +1189,7 @@ var PublicationStore = class {
1152
1189
  if (!await this.#workspace.saveModuleEditor() || flowId != this.#workspace.$.flowId.value) return false;
1153
1190
  const flow = this.#workspace.$.flow.value;
1154
1191
  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;
1192
+ if (flow == null || draft == null || this.#state.value.publishing || this.#state.value.rollingBackPublicationId != null) return false;
1156
1193
  const target = { flowId: flow.flowId };
1157
1194
  const expectedLivePublicationId = this.#workspace.$.live.value?.publication?.publicationId ?? null;
1158
1195
  const signature = JSON.stringify({
@@ -1190,7 +1227,7 @@ var PublicationStore = class {
1190
1227
  async rollback(publication) {
1191
1228
  const { live, rollingBackPublicationId, target } = this.#state.value;
1192
1229
  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;
1230
+ if (target == null || currentPublicationId == null || rollingBackPublicationId != null || this.#state.value.publishing || publication.flowId != target.flowId) return false;
1194
1231
  const signature = JSON.stringify({
1195
1232
  currentPublicationId,
1196
1233
  flowId: target.flowId,
@@ -1336,42 +1373,15 @@ var PublicationStore = class {
1336
1373
  if (current() && this.#state.value.selectedTriggerId == selectedTriggerId) this.#set({ testingTriggerId: void 0 });
1337
1374
  }
1338
1375
  }
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
1376
  async #refresh(target, signal) {
1366
1377
  const current = this.#loads.begin();
1367
- const [live, page, bindings] = await this.#read(target, signal).catch((error) => {
1378
+ const [live, page] = await this.#read(target, signal).catch((error) => {
1368
1379
  if (current() && sameTarget(this.#state.value.target, target)) this.#set({ refreshing: false });
1369
1380
  throw error;
1370
1381
  });
1371
1382
  signal?.throwIfAborted();
1372
1383
  if (current()) this.#workspace.updateLive(live);
1373
1384
  if (current() && sameTarget(this.#state.value.target, target)) this.#set({
1374
- bindings,
1375
1385
  live,
1376
1386
  loaded: true,
1377
1387
  loadFailed: false,
@@ -1398,7 +1408,7 @@ var PublicationStore = class {
1398
1408
  includeTotal: true,
1399
1409
  limit: pageLimit$1
1400
1410
  }, signal),
1401
- this.#client.listFlowTriggerBindings(target.flowId, signal)
1411
+ this.#readBindings(target.flowId, signal)
1402
1412
  ]);
1403
1413
  }
1404
1414
  async #storedOperation(target) {
@@ -6493,7 +6503,6 @@ var WorkbenchStore = class {
6493
6503
  if (get(this.runs.$.cancelingRunId) != null) return "cancel";
6494
6504
  if (get(this.publications.$.publishing)) return "publish";
6495
6505
  if (get(this.publications.$.rollingBackPublicationId) != null) return "rollback";
6496
- if (get(this.publications.$.changingTriggerId) != null) return "trigger";
6497
6506
  }),
6498
6507
  diagnosticItems: compute((get) => {
6499
6508
  const revision = get(this.workspace.$.revision);
@@ -6784,7 +6793,7 @@ var WorkbenchStore = class {
6784
6793
  };
6785
6794
  //#endregion
6786
6795
  //#region src/workbench/browser/runtime/openFlowWorkbench.tsx
6787
- var FlowWorkspace = lazy(() => import("./flowWorkspace-BdbsnUDs.js"));
6796
+ var FlowWorkspace = lazy(() => import("./flowWorkspace-BgZaFKZm.js"));
6788
6797
  function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
6789
6798
  const hasToken = token != null && tokenLabel != null && onTokenChange != null;
6790
6799
  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 SelectContent, Dt as SelectTrigger, Ot as SelectValue, Tt as SelectItem, wt as SelectGroup, xi as cn, xt as Select } from "./icons-CajfDpy_.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>;