@burdenoff/microfe-devportal 2026.705.1 → 2026.705.2

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.
@@ -610,7 +610,10 @@ var Le = [
610
610
  tabIndex: 0,
611
611
  children: [
612
612
  E === "overview" && /* @__PURE__ */ G(Ye, { app: J }),
613
- E === "permissions" && /* @__PURE__ */ G(ut, { app: J }),
613
+ E === "permissions" && /* @__PURE__ */ G(ft, {
614
+ app: J,
615
+ versionScopes: L?.application?.versions?.edges?.[0]?.node?.requiredScopes ?? []
616
+ }),
614
617
  E === "webhooks" && /* @__PURE__ */ G(Ke, {
615
618
  appId: J.id,
616
619
  onNavigate: q
@@ -2881,37 +2884,48 @@ var ot = ({ app: t, versionCount: n = 0, isPackageApp: r = !1, pricingDone: i =
2881
2884
  function lt(e) {
2882
2885
  let t = Object.fromEntries(ct.map((e) => [e.id, "none"]));
2883
2886
  if (!e || !Array.isArray(e.permissions)) return t;
2884
- for (let n of e.permissions) n.resource in t && (t[n.resource] = n.level === "write" ? "write" : "read");
2887
+ for (let n of e.permissions) n && typeof n == "object" && n.resource in t && (t[n.resource] = n.level === "write" ? "write" : "read");
2885
2888
  return t;
2886
2889
  }
2887
- var ut = ({ app: e }) => {
2888
- let t = e.manifest ?? {}, [n, r] = N(() => lt(t)), [i, a] = N(!1), [o, s] = N(!1), [c] = _(), l = (e, t) => {
2889
- s(!1), r((n) => ({
2890
+ function ut(e) {
2891
+ let t = Object.fromEntries(ct.map((e) => [e.id, "none"]));
2892
+ for (let n of e) {
2893
+ let [e, r] = n.split(":");
2894
+ r && r in t && (t[r] = e === "write" ? "write" : "read");
2895
+ }
2896
+ return t;
2897
+ }
2898
+ function dt(e) {
2899
+ return !e || !Array.isArray(e.permissions) ? !1 : e.permissions.some((e) => e && typeof e == "object");
2900
+ }
2901
+ var ft = ({ app: e, versionScopes: t }) => {
2902
+ let n = e.manifest ?? {}, [r, i] = N(() => dt(n) ? lt(n) : t && t.length > 0 ? ut(t) : lt(n)), [a, o] = N(!1), [s, c] = N(!1), [l] = _(), u = (e, t) => {
2903
+ c(!1), i((n) => ({
2890
2904
  ...n,
2891
2905
  [e]: t
2892
2906
  }));
2893
- }, u = async () => {
2894
- a(!0);
2907
+ }, d = async () => {
2908
+ o(!0);
2895
2909
  try {
2896
- let r = Object.entries(n).filter(([, e]) => e !== "none").map(([e, t]) => ({
2910
+ let t = Object.entries(r).filter(([, e]) => e !== "none").map(([e, t]) => ({
2897
2911
  resource: e,
2898
2912
  level: t
2899
2913
  }));
2900
- await c({ variables: {
2914
+ await l({ variables: {
2901
2915
  id: e.id,
2902
2916
  input: { manifest: {
2903
- ...t,
2904
- permissions: r
2917
+ ...n,
2918
+ permissions: t
2905
2919
  } }
2906
- } }), s(!0);
2920
+ } }), c(!0);
2907
2921
  } finally {
2908
- a(!1);
2922
+ o(!1);
2909
2923
  }
2910
- }, d = {
2924
+ }, f = {
2911
2925
  none: "No access",
2912
2926
  read: "Read",
2913
2927
  write: "Read & Write"
2914
- }, f = [
2928
+ }, p = [
2915
2929
  "none",
2916
2930
  "read",
2917
2931
  "write"
@@ -2931,9 +2945,9 @@ var ut = ({ app: e }) => {
2931
2945
  children: [/* @__PURE__ */ G("th", {
2932
2946
  className: "px-4 py-3 text-left font-medium text-text-secondary w-1/2",
2933
2947
  children: "Resource"
2934
- }), f.map((e) => /* @__PURE__ */ G("th", {
2948
+ }), p.map((e) => /* @__PURE__ */ G("th", {
2935
2949
  className: "px-4 py-3 text-center font-medium text-text-secondary",
2936
- children: d[e]
2950
+ children: f[e]
2937
2951
  }, e))]
2938
2952
  }) }), /* @__PURE__ */ G("tbody", {
2939
2953
  className: "divide-y divide-border",
@@ -2948,14 +2962,14 @@ var ut = ({ app: e }) => {
2948
2962
  className: "text-xs text-text-secondary",
2949
2963
  children: e.description
2950
2964
  })]
2951
- }), f.map((t) => /* @__PURE__ */ G("td", {
2965
+ }), p.map((t) => /* @__PURE__ */ G("td", {
2952
2966
  className: "px-4 py-3 text-center",
2953
2967
  children: /* @__PURE__ */ G("input", {
2954
2968
  type: "radio",
2955
2969
  name: `perm-${e.id}`,
2956
2970
  value: t,
2957
- checked: n[e.id] === t,
2958
- onChange: () => l(e.id, t),
2971
+ checked: r[e.id] === t,
2972
+ onChange: () => u(e.id, t),
2959
2973
  className: "h-4 w-4 accent-primary cursor-pointer"
2960
2974
  })
2961
2975
  }, t))]
@@ -2972,15 +2986,15 @@ var ut = ({ app: e }) => {
2972
2986
  }),
2973
2987
  /* @__PURE__ */ K("div", {
2974
2988
  className: "flex items-center justify-end gap-3",
2975
- children: [o && /* @__PURE__ */ K("span", {
2989
+ children: [s && /* @__PURE__ */ K("span", {
2976
2990
  className: "flex items-center gap-1.5 text-sm text-status-success-text",
2977
2991
  children: [/* @__PURE__ */ G(ue, { size: 14 }), "Saved"]
2978
2992
  }), /* @__PURE__ */ K("button", {
2979
2993
  type: "button",
2980
- onClick: () => void u(),
2981
- disabled: i,
2994
+ onClick: () => void d(),
2995
+ disabled: a,
2982
2996
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
2983
- children: [i ? /* @__PURE__ */ G(B, {
2997
+ children: [a ? /* @__PURE__ */ G(B, {
2984
2998
  size: 14,
2985
2999
  className: "animate-spin"
2986
3000
  }) : /* @__PURE__ */ G(H, { size: 14 }), "Save Permissions"]