@lunora/studio 1.0.0-alpha.36 → 1.0.0-alpha.38
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/LICENSE.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/packem_chunks/auth-config-panel.js +290 -104
- package/dist/packem_chunks/organizations-panel.js +3002 -494
- package/dist/packem_chunks/users-panel.js +576 -110
- package/dist/packem_shared/use-async-submit-BWMDwRa4.js +91 -0
- package/dist/standalone/{chunk-PACH5AHG.js → chunk-2F4VYKM6.js} +1 -1
- package/dist/standalone/{chunk-OIZ4CHPN.js → chunk-2GFAOIC3.js} +1 -1
- package/dist/standalone/{chunk-OY3GVYS7.js → chunk-2SAZ5BZ5.js} +1 -1
- package/dist/standalone/chunk-2SE7II7A.js +1 -0
- package/dist/standalone/{chunk-5OH3VPZF.js → chunk-34OQUHSV.js} +1 -1
- package/dist/standalone/{chunk-2THHW7BC.js → chunk-3DBG4RIV.js} +1 -1
- package/dist/standalone/{chunk-EUIHTPKI.js → chunk-3UFZCRWL.js} +1 -1
- package/dist/standalone/{chunk-QLM6FYZW.js → chunk-4FL3EDN5.js} +1 -1
- package/dist/standalone/{chunk-ILCTSAOB.js → chunk-4JOKDSPU.js} +1 -1
- package/dist/standalone/{chunk-BQUQS7QN.js → chunk-7FF76BYY.js} +1 -1
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AJKR6PY7.js +1 -0
- package/dist/standalone/{chunk-TOJ3TC35.js → chunk-FA3CCTXK.js} +1 -1
- package/dist/standalone/chunk-GLUNBZRI.js +1 -0
- package/dist/standalone/chunk-GM4NPF3W.js +1 -0
- package/dist/standalone/{chunk-XLQ4BHBD.js → chunk-HLZ4YLRK.js} +1 -1
- package/dist/standalone/{chunk-RRAFQ5G2.js → chunk-I3VXCZZL.js} +1 -1
- package/dist/standalone/{chunk-7VF3IAAW.js → chunk-IJPFHUJK.js} +1 -1
- package/dist/standalone/chunk-IQ466Q6W.js +1 -0
- package/dist/standalone/{chunk-LD2R263D.js → chunk-IU6GTBPD.js} +1 -1
- package/dist/standalone/{chunk-764T6X6X.js → chunk-IXDH4GL5.js} +1 -1
- package/dist/standalone/{chunk-6WRZP62V.js → chunk-JTTVXBLU.js} +1 -1
- package/dist/standalone/{chunk-7SLSB2TS.js → chunk-KQTCLPLO.js} +2 -2
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/{chunk-BI35RXKQ.js → chunk-LEHGGJP2.js} +1 -1
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/{chunk-OCHNCAXJ.js → chunk-MZ756AFF.js} +1 -1
- package/dist/standalone/chunk-N7G5I47W.js +1 -0
- package/dist/standalone/{chunk-TO4JQX7W.js → chunk-NV6RHG5L.js} +1 -1
- package/dist/standalone/chunk-O3I57FXK.js +1 -0
- package/dist/standalone/{chunk-YEVCU7TB.js → chunk-OES45DFG.js} +1 -1
- package/dist/standalone/{chunk-DVKPRFIJ.js → chunk-OIC7EJWI.js} +1 -1
- package/dist/standalone/{chunk-ZU4DZ6NK.js → chunk-OLE2AYTD.js} +1 -1
- package/dist/standalone/{chunk-U4OAQPBT.js → chunk-P3ZMBPCY.js} +1 -1
- package/dist/standalone/{chunk-VTGBPW24.js → chunk-P5JW7HKP.js} +1 -1
- package/dist/standalone/{chunk-MPTM7ZU3.js → chunk-Q3PTSVVU.js} +1 -1
- package/dist/standalone/chunk-QKQABJBE.js +1 -0
- package/dist/standalone/{chunk-JE2YOAB7.js → chunk-R5OQZYSW.js} +1 -1
- package/dist/standalone/{chunk-ATYUMPDM.js → chunk-SE2TQAHJ.js} +1 -1
- package/dist/standalone/{chunk-DVC6YWVP.js → chunk-TI7SE33D.js} +1 -1
- package/dist/standalone/{chunk-DWTBY343.js → chunk-VFJPO4UO.js} +1 -1
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/{chunk-46K3NKPA.js → chunk-X7RPB4K4.js} +1 -1
- package/dist/standalone/{chunk-X5P2WRYI.js → chunk-XFSUINL3.js} +1 -1
- package/dist/standalone/{chunk-SLKF2L74.js → chunk-XGUOXHX4.js} +1 -1
- package/dist/standalone/{chunk-M55U7NHO.js → chunk-ZL4E2WVF.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +3 -3
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/standalone/chunk-22W5VKZ6.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-IOFMK4D7.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-NKJDGOM3.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useLunora } from '@lunora/react';
|
|
3
|
+
import { a as useClientQuery } from './use-admin-query-BHPKmPuj.js';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { f as fireAndForget, e as errorMessage } from './internal-DTsYVn-g.js';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_AUTH_CONFIG = {
|
|
8
|
+
capabilities: {
|
|
9
|
+
accounts: true,
|
|
10
|
+
admin: true,
|
|
11
|
+
organization: false,
|
|
12
|
+
passkey: false,
|
|
13
|
+
twoFactor: false
|
|
14
|
+
},
|
|
15
|
+
emailAndPassword: false,
|
|
16
|
+
organization: {
|
|
17
|
+
enabled: false,
|
|
18
|
+
roles: false,
|
|
19
|
+
teams: false
|
|
20
|
+
},
|
|
21
|
+
plugins: [],
|
|
22
|
+
rateLimit: {
|
|
23
|
+
enabled: false
|
|
24
|
+
},
|
|
25
|
+
session: {},
|
|
26
|
+
socialProviders: [],
|
|
27
|
+
userFields: []
|
|
28
|
+
};
|
|
29
|
+
const useAuthConfig = () => {
|
|
30
|
+
const $ = c(6);
|
|
31
|
+
const client = useLunora();
|
|
32
|
+
let t0;
|
|
33
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t0 = ["lunora-auth-config"];
|
|
35
|
+
$[0] = t0;
|
|
36
|
+
} else {
|
|
37
|
+
t0 = $[0];
|
|
38
|
+
}
|
|
39
|
+
let t1;
|
|
40
|
+
if ($[1] !== client) {
|
|
41
|
+
t1 = () => client.getAuthConfig();
|
|
42
|
+
$[1] = client;
|
|
43
|
+
$[2] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
t1 = $[2];
|
|
46
|
+
}
|
|
47
|
+
const {
|
|
48
|
+
data,
|
|
49
|
+
isLoading
|
|
50
|
+
} = useClientQuery(t0, t1);
|
|
51
|
+
const t2 = data ?? DEFAULT_AUTH_CONFIG;
|
|
52
|
+
const t3 = !isLoading;
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[3] !== t2 || $[4] !== t3) {
|
|
55
|
+
t4 = {
|
|
56
|
+
config: t2,
|
|
57
|
+
ready: t3
|
|
58
|
+
};
|
|
59
|
+
$[3] = t2;
|
|
60
|
+
$[4] = t3;
|
|
61
|
+
$[5] = t4;
|
|
62
|
+
} else {
|
|
63
|
+
t4 = $[5];
|
|
64
|
+
}
|
|
65
|
+
return t4;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const useAsyncSubmit = () => {
|
|
69
|
+
const [busy, setBusy] = useState(false);
|
|
70
|
+
const [error, setError] = useState(null);
|
|
71
|
+
const run = (action) => {
|
|
72
|
+
fireAndForget((async () => {
|
|
73
|
+
setBusy(true);
|
|
74
|
+
setError(null);
|
|
75
|
+
try {
|
|
76
|
+
await action();
|
|
77
|
+
} catch (error_) {
|
|
78
|
+
setError(errorMessage(error_));
|
|
79
|
+
} finally {
|
|
80
|
+
setBusy(false);
|
|
81
|
+
}
|
|
82
|
+
})());
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
busy,
|
|
86
|
+
error,
|
|
87
|
+
run
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export { useAuthConfig as a, useAsyncSubmit as u };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-J6J54MBP.js";import{a as j}from"./chunk-2K47A3P6.js";import{a as H}from"./chunk-AJIUI7DD.js";import"./chunk-XNJNSCLM.js";import{a as P,b as F,c as L,d as k,e as u,f as m}from"./chunk-GTM65MVX.js";import{a as _}from"./chunk-K3GNLVYK.js";import"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as R}from"./chunk-BOXSWNXZ.js";import{a as B}from"./chunk-TAD43CG5.js";import{b as K}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-J6J54MBP.js";import{a as j}from"./chunk-2K47A3P6.js";import{a as H}from"./chunk-AJIUI7DD.js";import"./chunk-XNJNSCLM.js";import{a as P,b as F,c as L,d as k,e as u,f as m}from"./chunk-GTM65MVX.js";import{a as _}from"./chunk-K3GNLVYK.js";import"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as R}from"./chunk-BOXSWNXZ.js";import{a as B}from"./chunk-TAD43CG5.js";import{b as K}from"./chunk-OIC7EJWI.js";import{a as M,e as $}from"./chunk-SEU5V7I6.js";import{b as y}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-GLUNBZRI.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as D}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as S,e as T,f as U,g as V,h as X}from"./chunk-RRCPZMC2.js";var G=T(V(),1),J=T(U(),1);var t=T(X(),1);var W=80,Z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>W?`${e.slice(0,W)}\u2026`:e},"formatArguments"),q=S(a=>{let e=[];for(let n of a){let o=n.id.toString();if(n.subscriptions.length===0){e.push({admin:n.admin,connectionId:n.id,key:`c${o}`,subscription:null});continue}n.subscriptions.forEach((s,N)=>{e.push({admin:n.admin,connectionId:n.id,key:`c${o}-s${N.toString()}`,subscription:s})})}return e},"toRows"),w=(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1),de=S(a=>{let e=(0,G.c)(22),{initialShardKey:n}=a,o=D(),[s,N]=(0,J.useState)(n??""),f;e[0]!==s?(f=s.trim(),e[0]=s,e[1]=f):f=e[1];let A=j(f,400),h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];let p;e[3]!==A?(p={keepPreviousData:!0,shardKey:A},e[3]=A,e[4]=p):p=e[4];let{data:i,error:r,errorSource:c,refetch:Q}=K(R.listSubscriptions,h,p);O(Q,!0);let v;if(e[5]!==r||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o){let C=i===void 0?[]:q(i.connections),l;e[11]!==s?(l=(0,t.jsxDEV)(_,{onChange:N,testId:"subs-shard-input",value:s},void 0,!1),e[11]=s,e[12]=l):l=e[12];let d;e[13]!==i||e[14]!==o?(d=i!==void 0&&(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsxDEV)(y,{variant:"secondary",children:o("{count} connections",{count:i.totalConnections})},void 0,!1),(0,t.jsxDEV)(y,{variant:"secondary",children:o("{count} subscriptions",{count:i.totalSubscriptions})},void 0,!1)]},void 0,!0),e[13]=i,e[14]=o,e[15]=d):d=e[15];let b;e[16]!==l||e[17]!==d?(b=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[l,d]},void 0,!0),e[16]=l,e[17]=d,e[18]=b):b=e[18];let g;e[19]!==r||e[20]!==c?(g=r!==null&&(0,t.jsxDEV)(H,{error:c,testId:"subs-error"},void 0,!1),e[19]=r,e[20]=c,e[21]=g):g=e[21],v=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[b,g,r===null&&i!==void 0&&C.length===0&&(0,t.jsxDEV)(B,{description:o("Active WebSocket subscriptions on this shard."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},void 0,!1)},void 0,!1),testId:"subs-empty",title:o("No active subscriptions.")},void 0,!1),r===null&&C.length>0&&(0,t.jsxDEV)(M,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)($,{className:"px-0",children:(0,t.jsxDEV)(P,{"data-testid":"subs-table",children:[(0,t.jsxDEV)(F,{children:(0,t.jsxDEV)(k,{children:[(0,t.jsxDEV)(u,{children:o("Connection")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Function path")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Table")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Arguments")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(L,{children:C.map(x=>{let{subscription:I}=x,E=Z(I?.args);return(0,t.jsxDEV)(k,{"data-testid":"subs-row",children:[(0,t.jsxDEV)(m,{className:"font-medium tabular-nums",children:(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1.5",children:["#",x.connectionId,x.admin&&(0,t.jsxDEV)(y,{variant:"outline",children:o("admin")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(m,{className:"font-mono text-xs",children:I?.functionPath??w},void 0,!1),(0,t.jsxDEV)(m,{children:I?.table??w},void 0,!1),(0,t.jsxDEV)(m,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:E||void 0,children:E||w},void 0,!1)]},x.key,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[5]=r,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=v}else v=e[10];return v},"SubscriptionsPanel");export{de as default};
|