@oomol-lab/open-flow 0.1.0-beta.33 → 0.1.0-beta.34

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
1
  import { l as e } from "./dist-Dz6Nglsd.js";
2
2
  import { a as t } from "./main-BDnNHhkU.js";
3
3
  import { t as n } from "./flowRunInputEditorStore-Bgb5vSeS.js";
4
- import { n as r } from "./flowWorkspace-CBo6Ih_c.js";
4
+ import { n as r } from "./flowWorkspace-CG16aXUX.js";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
6
  import { useEffect as a, useRef as o, useState as s } from "react";
7
7
  //#region src/workbench/browser/runtime/editor/inputValues.tsx
@@ -1,8 +1,8 @@
1
1
  import { a as e, i as t, l as n } from "./dist-Dz6Nglsd.js";
2
2
  import { a as r, i, r as a, t as o } from "./main-BDnNHhkU.js";
3
3
  import { Bn as s, Hn as c, kt as l, t as u } from "./lite-BA96NG4M.js";
4
- import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-bXA-KosC.js";
5
- import { $t as C, Bt as w, E as T, F as E, G as ee, Gt as D, H as O, Ht as te, K as ne, Kt as re, M as k, O as A, P as j, Q as ie, Qt as M, S as ae, T as N, U as oe, Ut as se, Vt as ce, W as le, Wt as ue, X as P, Z as de, _ as fe, a as pe, an as me, at as he, b as ge, c as _e, cn as F, ct as ve, d as ye, dt as be, en as I, f as xe, ft as Se, g as Ce, h as we, i as Te, in as L, it as Ee, j as De, k as Oe, l as ke, ln as Ae, lt as je, m as Me, nn as Ne, nt as Pe, o as Fe, on as Ie, ot as Le, p as Re, q as ze, qt as Be, r as R, rn as Ve, s as He, sn as z, st as Ue, t as We, tn as Ge, u as Ke, ut as B, v as qe, w as Je, x as Ye, y as Xe, z as Ze, zt as Qe } from "./flowChanges-FiZJreeB.js";
4
+ import { E as d, M as f, N as p, O as m, P as h, T as g, _, h as v, j as y, k as b, m as x, w as S } from "./editorComponent-BIUas5Qq.js";
5
+ import { $t as C, Bt as w, E as T, F as E, G as ee, Gt as D, H as O, Ht as te, K as ne, Kt as re, M as k, O as A, P as j, Q as ie, Qt as M, S as ae, T as N, U as oe, Ut as se, Vt as ce, W as le, Wt as ue, X as P, Z as de, _ as fe, a as pe, an as me, at as he, b as ge, c as _e, cn as F, ct as ve, d as ye, dt as be, en as I, f as xe, ft as Se, g as Ce, h as we, i as Te, in as L, it as Ee, j as De, k as Oe, l as ke, ln as Ae, lt as je, m as Me, nn as Ne, nt as Pe, o as Fe, on as Ie, ot as Le, p as Re, q as ze, qt as Be, r as R, rn as Ve, s as He, sn as z, st as Ue, t as We, tn as Ge, u as Ke, ut as B, v as qe, w as Je, x as Ye, y as Xe, z as Ze, zt as Qe } from "./flowChanges-D94HuOXQ.js";
6
6
  import { C as $e, D as et, O as tt, _ as nt, a as rt, c as it, d as at, f as ot, g as st, h as ct, i as lt, l as ut, m as dt, n as ft, o as pt, r as mt, s as ht, t as gt, v as _t, w as vt } from "./workbenchSelect-DNteZJYP.js";
7
7
  import { c as yt, d as bt, l as xt, u as St } from "./value-B_yE9ean.js";
8
8
  import { a as V } from "./dist-CoszrK7m.js";
@@ -4183,6 +4183,12 @@ var Er = (...e) => JSON.stringify(e), Dr = class {
4183
4183
  changed(e) {
4184
4184
  e == this.#t && this.load(e);
4185
4185
  }
4186
+ configure(e) {
4187
+ this.#r || this.#t == null || this.#e.set({
4188
+ ...this.#e.value,
4189
+ configuration: { providerId: e }
4190
+ });
4191
+ }
4186
4192
  async loadCandidates(e) {
4187
4193
  let t = this.#t, n = this.#e.value;
4188
4194
  if (!(t == null || n.access?.mode != "selectable" || n.loadingCandidates.includes(e))) {
@@ -6963,27 +6969,42 @@ var bi = { openExternalPage: async () => !1 }, xi = class {
6963
6969
  }
6964
6970
  async prepareConnectorAction(e) {
6965
6971
  let t = this.workspace.$.flowId.value;
6966
- if (t == null || (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#u || t != this.workspace.$.flowId.value)) return;
6967
- let n = this.connectorAccess.$.value.access, r;
6968
- if (n?.mode == "selectable") {
6969
- this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates(e.serviceId);
6970
- let t = this.connectorAccess.$.value.candidates[e.serviceId]?.candidates.filter((t) => t.permissions == null || t.permissions.allActions || t.permissions.actionIds.includes(e.actionId)), i = new Set(n.bindings.filter((t) => t.providerId == e.serviceId && t.status == "active").map((e) => e.accessBindingId));
6971
- if (t != null && !t.some((e) => i.has(e.accessBindingId))) {
6972
- let r = t.find((e) => e.isDefault) ?? (t.length == 1 ? t[0] : void 0);
6973
- r != null && (await this.connectorAccess.select(e.serviceId, r.accessBindingId), n = this.connectorAccess.$.value.access);
6972
+ if (t == null) return;
6973
+ let { defaultConnection: n, ...r } = e, i = {
6974
+ action: r,
6975
+ connections: []
6976
+ };
6977
+ if (!e.authenticated) {
6978
+ let n = await this.connectors.resolveAction(e.actionId);
6979
+ return this.#u || t != this.workspace.$.flowId.value ? void 0 : n;
6980
+ }
6981
+ if (this.connectorAccess.$.value.access ?? await this.connectorAccess.load(t), this.#u || t != this.workspace.$.flowId.value) return;
6982
+ let a = this.connectorAccess.$.value.access;
6983
+ if (a == null) return i;
6984
+ let o;
6985
+ if (a?.mode == "selectable") {
6986
+ if (this.connectorAccess.$.value.candidates[e.serviceId] ?? await this.connectorAccess.loadCandidates(e.serviceId), this.#u || t != this.workspace.$.flowId.value) return;
6987
+ let n = this.connectorAccess.$.value.candidates[e.serviceId]?.candidates.filter((t) => t.permissions == null || t.permissions.allActions || t.permissions.actionIds.includes(e.actionId));
6988
+ if (n == null) return i;
6989
+ let r = new Set(a.bindings.filter((t) => t.providerId == e.serviceId && t.status == "active").map((e) => e.accessBindingId));
6990
+ if (n != null && !n.some((e) => r.has(e.accessBindingId))) {
6991
+ let r = n.find((e) => e.isDefault) ?? (n.length == 1 ? n[0] : void 0);
6992
+ if (r != null) {
6993
+ if (!await this.connectorAccess.select(e.serviceId, r.accessBindingId)) return this.#u || t != this.workspace.$.flowId.value ? void 0 : i;
6994
+ a = this.connectorAccess.$.value.access;
6995
+ }
6974
6996
  }
6975
- r = t?.some((e) => n?.bindings.some((t) => t.accessBindingId == e.accessBindingId && t.status == "active"));
6997
+ o = n?.some((e) => a?.bindings.some((t) => t.accessBindingId == e.accessBindingId && t.status == "active"));
6976
6998
  }
6977
6999
  if (this.#u || t != this.workspace.$.flowId.value) return;
6978
- let i = n?.bindings.some((t) => t.providerId == e.serviceId && t.status == "active") ?? !1;
6979
- if (n?.mode != "implicit" && !(r ?? i)) return {
6980
- action: e,
6981
- connections: []
6982
- };
7000
+ let s = a?.bindings.some((t) => t.providerId == e.serviceId && t.status == "active") ?? !1;
7001
+ if (a?.mode != "implicit" && !(o ?? s)) return i;
6983
7002
  this.workspace.catalogs.refreshFlow(t);
6984
- let a = await this.connectors.resolveAction(e.actionId);
6985
- if (a.action.serviceId != e.serviceId) throw Error("Connector Action Provider changed while access was being configured.");
6986
- return a;
7003
+ let c = await this.connectors.resolveAction(e.actionId);
7004
+ if (!(this.#u || t != this.workspace.$.flowId.value)) {
7005
+ if (c.action.serviceId != e.serviceId) throw Error("Connector Action Provider changed while access was being configured.");
7006
+ return c;
7007
+ }
6987
7008
  }
6988
7009
  async refreshSelectedConnector(e = !1) {
6989
7010
  await this.connectors.refresh(e);
@@ -7016,7 +7037,7 @@ var bi = { openExternalPage: async () => !1 }, xi = class {
7016
7037
  return;
7017
7038
  }
7018
7039
  }
7019
- }, Si = Tt(() => import("./flowWorkspace-CBo6Ih_c.js").then((e) => e.t));
7040
+ }, Si = Tt(() => import("./flowWorkspace-CG16aXUX.js").then((e) => e.t));
7020
7041
  function Ci({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: c, tokenLabel: u }) {
7021
7042
  let d = c != null && u != null && i != null, f = c ?? "", p = /* @__PURE__ */ U(Ct, { children: [
7022
7043
  /* @__PURE__ */ H("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oomol-lab/open-flow",
3
- "version": "0.1.0-beta.33",
3
+ "version": "0.1.0-beta.34",
4
4
  "description": "TypeScript contracts and Browser runtime for Open Flow.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {