@wso2/am-core-ui 0.0.19 → 0.0.20
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/dist/CatalogKindListing-DvUuZEpc.js +137 -0
- package/dist/{CodeBlock-mB_Loq7I.js → CodeBlock-B2Ecl916.js} +1 -1
- package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
- package/dist/{EnvironmentSelector-B7Bl93s2.js → EnvironmentSelector-D8S6nO9u.js} +1 -1
- package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
- package/dist/LabelChips-7rA7_yre.js +139 -0
- package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
- package/dist/{ResourceListShell-Cx6mdeqv.js → ResourceListShell-DFisKftq.js} +1 -1
- package/dist/{SwaggerSpecViewer-BvkhoKsi.js → SwaggerSpecViewer-DzjR6U6W.js} +1 -1
- package/dist/{debounce-BV83M53b.js → debounce-D17ObVdG.js} +1 -1
- package/dist/{format-BEZZRyE2.js → format-wlHhWjGo.js} +1 -1
- package/dist/{formatDistanceToNow-TErllcH8.js → formatDistanceToNow-DyjnT7l9.js} +11 -11
- package/dist/{gatewayScripts-D8O45W8u.js → gatewayScripts-D4ZDEDPS.js} +1 -1
- package/dist/{index-sr-mWz4T.js → index-3K-zqdp-.js} +32 -32
- package/dist/{index-KRsV2L4V.js → index-6liAPSDn.js} +160 -160
- package/dist/{index-B52h3RHg.js → index-B3ASENUJ.js} +109 -109
- package/dist/index-B7Pf4oPq.js +3069 -0
- package/dist/index-BNO3FhZK.js +2304 -0
- package/dist/index-BUZSfCl5.js +335 -0
- package/dist/index-BXiG1r_o.js +1409 -0
- package/dist/{index-_0Pj_ZtW.js → index-BYy7Iaam.js} +40 -40
- package/dist/{index-BfjzUWDa.js → index-BbB_yx4V.js} +103 -103
- package/dist/index-BjWJ95lH.js +2728 -0
- package/dist/{index-B_Z0MwXk.js → index-ByEInFlf.js} +10916 -9520
- package/dist/index-C8WIhzyz.js +123 -0
- package/dist/index-CnzvaT6b.js +2368 -0
- package/dist/index-CrnCf-hJ.js +763 -0
- package/dist/{index-CgCWbWzN.js → index-Cvsho9xg.js} +381 -377
- package/dist/{index-UqDmyMSA.js → index-CxnAo1_c.js} +21 -21
- package/dist/{index-BnV-PkwM.js → index-Cz7-AZwE.js} +2 -2
- package/dist/{index-BP5drcF2.js → index-DBdRFjxm.js} +232 -233
- package/dist/{index-BZ4vxviI.js → index-DFsSvmMZ.js} +5 -5
- package/dist/index-DslzOSGN.js +2549 -0
- package/dist/{index-DD4qF7gq.js → index-DvpYvchM.js} +101 -100
- package/dist/index.d.ts +784 -163
- package/dist/index.js +532 -454
- package/dist/js-yaml-CvhD-clg.js +1335 -0
- package/dist/{llmProviderPayload-CzihkdNa.js → llmProviderPayload-BPzWDy7n.js} +2 -2
- package/package.json +1 -1
- package/dist/CatalogKindListing-DtFI2YMG.js +0 -118
- package/dist/EnvironmentCard-09h1XRxx.js +0 -310
- package/dist/PolicyListSection-o4k9e8XO.js +0 -2475
- package/dist/index-CGDYgUCH.js +0 -711
- package/dist/index-COt7nJIf.js +0 -2286
- package/dist/index-CWZjOy1h.js +0 -2247
- package/dist/index-CezvogTQ.js +0 -116
- package/dist/index-CjCkcuuI.js +0 -322
- package/dist/index-CjXvuf9m.js +0 -1354
- package/dist/index-DeQ-9KTC.js +0 -737
- package/dist/index-Df6OBy4E.js +0 -3041
- package/dist/index-PUuASE1F.js +0 -2507
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as a, jsx as n, Fragment as qt } from "react/jsx-runtime";
|
|
2
2
|
import { c as Se } from "react/compiler-runtime";
|
|
3
|
-
import { useTheme as kt, Stack as E, Typography as $, Alert as ce, Card as Pe, Chip as ue, FormControl as ge, FormLabel as ve, TextField as Le, InputAdornment as ot, Tooltip as Ge, IconButton as Qe, Divider as $e, Box as se, Button as de, ListingTable as B, Avatar as
|
|
3
|
+
import { useTheme as kt, Stack as E, Typography as $, Alert as ce, Card as Pe, Chip as ue, FormControl as ge, FormLabel as ve, TextField as Le, InputAdornment as ot, Tooltip as Ge, IconButton as Qe, Divider as $e, Box as se, Button as de, ListingTable as B, Avatar as Ot, TablePagination as ct, Skeleton as ee, Grid as D, Select as Xe, MenuItem as _e, Collapse as Ze, CircularProgress as Et, SearchBar as At, Accordion as je, AccordionSummary as Ue, AccordionDetails as Be, Tabs as Mt, Tab as at, ToggleButtonGroup as Wt, ToggleButton as yt, Paper as lt, Switch as _t } from "@wso2/oxygen-ui";
|
|
4
4
|
import { useState as N, useMemo as Q, useCallback as H, useEffect as oe, useRef as Ke, Suspense as Ft } from "react";
|
|
5
5
|
import { Copy as gt, Key as Gt, Trash as vt, ServerCog as bt, EyeOff as $t, Eye as jt, Users as Ut, ArrowRight as Bt, Plus as xt, ShieldAlert as Vt, Search as Kt, ChevronDown as Ve, Save as Ht, Download as Yt, FileCode as Jt, BrainCircuit as Qt } from "@wso2/oxygen-ui-icons-react";
|
|
6
6
|
import { useNavigate as dt, useParams as De, Link as Xt, generatePath as Ne, useSearchParams as Zt, Route as tt, Routes as Dt, Navigate as en } from "react-router-dom";
|
|
7
|
-
import {
|
|
7
|
+
import { L as tn, b6 as nn, bk as rn, ab as ut, O as sn, g as ze, bl as on, bm as Nt, bn as an, bo as ln, bp as cn, bq as dn, w as zt, br as un, bs as hn, bt as mn, P as ht, M as Fe, b4 as pn } from "./index-ByEInFlf.js";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
|
-
import { f as fn } from "./format-
|
|
10
|
-
import { R as yn, A as gn } from "./ResourceListShell-
|
|
11
|
-
import { j as vn
|
|
12
|
-
import { i as
|
|
13
|
-
import { s as pe, o as Re, c as mt, r as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { f as fn } from "./format-wlHhWjGo.js";
|
|
10
|
+
import { R as yn, A as gn } from "./ResourceListShell-DFisKftq.js";
|
|
11
|
+
import { j as vn } from "./js-yaml-CvhD-clg.js";
|
|
12
|
+
import { i as bn, A as xn } from "./APIKeysManager-C0phJriD.js";
|
|
13
|
+
import { s as pe, o as Re, c as mt, r as Cn, e as wn, b as Rt, _ as Ct } from "./schemas-DFScWdSL.js";
|
|
14
|
+
import { a as Pn } from "./PolicyListSection-D6aVSKwP.js";
|
|
15
|
+
import { S as Ln } from "./SwaggerSpecViewer-DzjR6U6W.js";
|
|
16
|
+
import { m as Sn, b as In, A as kn } from "./llmProviderPayload-BPzWDy7n.js";
|
|
17
|
+
import { t as kr } from "./llmProviderPayload-BPzWDy7n.js";
|
|
17
18
|
const nt = "__unassigned__";
|
|
18
19
|
function wt(t) {
|
|
19
20
|
return navigator.clipboard.writeText(t);
|
|
@@ -198,7 +199,7 @@ function An() {
|
|
|
198
199
|
providerId: w.uuid
|
|
199
200
|
})), onMouseEnter: () => u(w.uuid), onMouseLeave: () => u(null), onFocus: () => u(w.uuid), onBlur: () => u(null), children: [
|
|
200
201
|
/* @__PURE__ */ n(B.Cell, { children: /* @__PURE__ */ a(E, { direction: "row", alignItems: "center", spacing: 2, children: [
|
|
201
|
-
/* @__PURE__ */ n(
|
|
202
|
+
/* @__PURE__ */ n(Ot, { sx: {
|
|
202
203
|
bgcolor: "primary.main",
|
|
203
204
|
color: "primary.contrastText",
|
|
204
205
|
fontSize: 16,
|
|
@@ -317,7 +318,7 @@ function ft(t) {
|
|
|
317
318
|
return l !== 0 ? l : o.method.localeCompare(i.method);
|
|
318
319
|
}), r;
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function We(t, e = "::") {
|
|
321
322
|
return `${t.method}${e}${t.path}`;
|
|
322
323
|
}
|
|
323
324
|
function Tt(t) {
|
|
@@ -403,7 +404,7 @@ function zn({
|
|
|
403
404
|
const C = String(t.accessControl?.mode || "").toLowerCase().replace(/-/g, "_") === "deny_all" ? "deny" : "allow", g = t.openapi?.trim() ?? "", A = (t.accessControl?.exceptions || []).flatMap((T) => (T.methods ?? ["GET"]).map((Y) => ({
|
|
404
405
|
method: Y,
|
|
405
406
|
path: T.path ?? ""
|
|
406
|
-
}))).map((T) =>
|
|
407
|
+
}))).map((T) => We(T));
|
|
407
408
|
y(C), u(A), l.current = {
|
|
408
409
|
mode: C,
|
|
409
410
|
exceptionKeys: A,
|
|
@@ -420,7 +421,7 @@ function zn({
|
|
|
420
421
|
})), [v, b]), f = Q(() => He(v), [v]), M = Q(() => s.map((K) => {
|
|
421
422
|
const C = f ? Nn(f, K.method, K.path) : null;
|
|
422
423
|
return {
|
|
423
|
-
key:
|
|
424
|
+
key: We(K),
|
|
424
425
|
method: K.method,
|
|
425
426
|
path: K.path,
|
|
426
427
|
summary: K.summary,
|
|
@@ -434,16 +435,16 @@ function zn({
|
|
|
434
435
|
}, [c, d, v]), x = H(async () => {
|
|
435
436
|
if (!t) return;
|
|
436
437
|
const K = c === "allow" ? "allow_all" : "deny_all", C = /* @__PURE__ */ new Map();
|
|
437
|
-
s.forEach((
|
|
438
|
+
s.forEach((W) => C.set(We(W), W));
|
|
438
439
|
const g = /* @__PURE__ */ new Map();
|
|
439
|
-
for (const
|
|
440
|
-
const A = C.get(
|
|
440
|
+
for (const W of d) {
|
|
441
|
+
const A = C.get(W);
|
|
441
442
|
if (!A) continue;
|
|
442
443
|
const T = A.path ?? "", Y = g.get(T) ?? [];
|
|
443
444
|
Y.includes(A.method) || Y.push(A.method), g.set(T, Y);
|
|
444
445
|
}
|
|
445
|
-
const F = Array.from(g.entries()).map(([
|
|
446
|
-
path:
|
|
446
|
+
const F = Array.from(g.entries()).map(([W, A]) => ({
|
|
447
|
+
path: W,
|
|
447
448
|
methods: A
|
|
448
449
|
}));
|
|
449
450
|
try {
|
|
@@ -491,11 +492,11 @@ function zn({
|
|
|
491
492
|
if (K)
|
|
492
493
|
y(K.mode), u([...K.exceptionKeys]), P(K.openapi);
|
|
493
494
|
else if (t) {
|
|
494
|
-
const g = String(t.accessControl?.mode || "").toLowerCase().replace(/-/g, "_") === "deny_all" ? "deny" : "allow",
|
|
495
|
+
const g = String(t.accessControl?.mode || "").toLowerCase().replace(/-/g, "_") === "deny_all" ? "deny" : "allow", W = (t.accessControl?.exceptions || []).flatMap((A) => (A.methods ?? ["GET"]).map((T) => ({
|
|
495
496
|
method: T,
|
|
496
497
|
path: A.path ?? ""
|
|
497
498
|
})));
|
|
498
|
-
y(g), u(
|
|
499
|
+
y(g), u(W.map((A) => We(A))), P(t.openapi?.trim() ?? "");
|
|
499
500
|
}
|
|
500
501
|
h(null);
|
|
501
502
|
}, [t, P]);
|
|
@@ -508,7 +509,7 @@ function Rn(t) {
|
|
|
508
509
|
providerId: i,
|
|
509
510
|
isLoading: l,
|
|
510
511
|
error: c
|
|
511
|
-
} = t, y = l === void 0 ? !1 : l, d = c === void 0 ? null : c, u =
|
|
512
|
+
} = t, y = l === void 0 ? !1 : l, d = c === void 0 ? null : c, u = bn(r?.security), L = u ? o : void 0, v = u ? i : void 0;
|
|
512
513
|
let P;
|
|
513
514
|
e[0] !== L || e[1] !== v ? (P = {
|
|
514
515
|
orgName: L,
|
|
@@ -533,7 +534,7 @@ function Rn(t) {
|
|
|
533
534
|
} = C;
|
|
534
535
|
if (!o || !i)
|
|
535
536
|
return;
|
|
536
|
-
const
|
|
537
|
+
const W = Math.random().toString(36).slice(2, 10), A = `provider-${r?.id ?? i}-${W}`;
|
|
537
538
|
return (await h({
|
|
538
539
|
params: {
|
|
539
540
|
orgName: o,
|
|
@@ -573,7 +574,7 @@ function Rn(t) {
|
|
|
573
574
|
}
|
|
574
575
|
const _ = S?.keys;
|
|
575
576
|
let K;
|
|
576
|
-
return e[16] !== w || e[17] !== U || e[18] !== b || e[19] !== p || e[20] !== I || e[21] !== f || e[22] !== _ ? (K = /* @__PURE__ */ n(
|
|
577
|
+
return e[16] !== w || e[17] !== U || e[18] !== b || e[19] !== p || e[20] !== I || e[21] !== f || e[22] !== _ ? (K = /* @__PURE__ */ n(xn, { keys: _, isLoading: I, isError: p, isCreating: b, isRevoking: f, emptyDescription: "Create an API key to authenticate requests to this LLM provider.", onCreate: w, onRevoke: U }), e[16] = w, e[17] = U, e[18] = b, e[19] = p, e[20] = I, e[21] = f, e[22] = _, e[23] = K) : K = e[23], K;
|
|
577
578
|
}
|
|
578
579
|
const Te = "••••••••••••", Tn = pe().min(1, "Provider Endpoint is required").url("Please enter a valid URL"), Me = "api-key", qn = [{
|
|
579
580
|
value: "api-key",
|
|
@@ -588,7 +589,7 @@ const Te = "••••••••••••", Tn = pe().min(1, "Provider En
|
|
|
588
589
|
value: "none",
|
|
589
590
|
label: "None"
|
|
590
591
|
}];
|
|
591
|
-
function
|
|
592
|
+
function On({
|
|
592
593
|
providerData: t,
|
|
593
594
|
valuePrefix: e = "",
|
|
594
595
|
isLoading: r = !1,
|
|
@@ -603,14 +604,14 @@ function Wn({
|
|
|
603
604
|
}, [t]);
|
|
604
605
|
const U = Q(() => {
|
|
605
606
|
if (!t) return !1;
|
|
606
|
-
const g = t.upstream?.main, F = (g?.url ?? "").trim(),
|
|
607
|
-
return y.trim() !== F || (u || Me) !==
|
|
607
|
+
const g = t.upstream?.main, F = (g?.url ?? "").trim(), W = g?.auth?.type ?? Me, A = (g?.auth?.header ?? "").trim();
|
|
608
|
+
return y.trim() !== F || (u || Me) !== W || v.trim() !== A || !p && S.trim() !== Te;
|
|
608
609
|
}, [t, y, u, v, S, p]), _ = H((g) => {
|
|
609
610
|
const F = Tn.safeParse(g.trim());
|
|
610
611
|
if (F.success)
|
|
611
612
|
return x(null), null;
|
|
612
|
-
const
|
|
613
|
-
return x(
|
|
613
|
+
const W = F.error.flatten().formErrors[0] ?? "Invalid URL";
|
|
614
|
+
return x(W), W;
|
|
614
615
|
}, []), K = H(() => {
|
|
615
616
|
t && (d(t.upstream?.main?.url ?? ""), L(t.upstream?.main?.auth?.type ?? Me), P(t.upstream?.main?.auth?.header ?? ""), I(Te), h(!0), x(null), M(null));
|
|
616
617
|
}, [t]), C = H(async () => {
|
|
@@ -623,13 +624,13 @@ function Wn({
|
|
|
623
624
|
});
|
|
624
625
|
return;
|
|
625
626
|
}
|
|
626
|
-
let
|
|
627
|
+
let W = t.upstream?.main?.auth?.value ?? "";
|
|
627
628
|
if (!p && S.trim() !== Te)
|
|
628
629
|
if (S.trim() === "" && !c.current)
|
|
629
|
-
|
|
630
|
+
W = t.upstream?.main?.auth?.value ?? "";
|
|
630
631
|
else {
|
|
631
632
|
const T = S.trim();
|
|
632
|
-
|
|
633
|
+
W = e ? T.startsWith(e) ? T : `${e}${T}` : T;
|
|
633
634
|
}
|
|
634
635
|
const A = u === "none" ? {
|
|
635
636
|
type: "none",
|
|
@@ -638,7 +639,7 @@ function Wn({
|
|
|
638
639
|
} : {
|
|
639
640
|
type: u || Me,
|
|
640
641
|
header: v.trim() || "",
|
|
641
|
-
value:
|
|
642
|
+
value: W
|
|
642
643
|
};
|
|
643
644
|
try {
|
|
644
645
|
await o({
|
|
@@ -721,7 +722,7 @@ function Wn({
|
|
|
721
722
|
] }) })
|
|
722
723
|
] }) }) }) : null;
|
|
723
724
|
}
|
|
724
|
-
function
|
|
725
|
+
function Wn(t, e) {
|
|
725
726
|
if (e.consumerType === "agent")
|
|
726
727
|
return Ne(ze.children.org.children.projects.children.agents.children.configure.path, {
|
|
727
728
|
orgId: t,
|
|
@@ -780,7 +781,7 @@ const _n = (t) => {
|
|
|
780
781
|
if (e[10] !== L || e[11] !== i || e[12] !== r) {
|
|
781
782
|
let p;
|
|
782
783
|
e[14] !== i || e[15] !== r ? (p = (h, b) => {
|
|
783
|
-
const s = r ?
|
|
784
|
+
const s = r ? Wn(r, h) : void 0;
|
|
784
785
|
return /* @__PURE__ */ a(B.Row, { hover: !0, sx: {
|
|
785
786
|
"& .row-action": {
|
|
786
787
|
visibility: "hidden"
|
|
@@ -811,7 +812,7 @@ const _n = (t) => {
|
|
|
811
812
|
}, Fn = Re({
|
|
812
813
|
path: pe(),
|
|
813
814
|
methods: mt(pe()),
|
|
814
|
-
params:
|
|
815
|
+
params: Cn(pe(), wn()).optional()
|
|
815
816
|
}), Gn = Re({
|
|
816
817
|
name: pe().min(1),
|
|
817
818
|
version: pe().min(1),
|
|
@@ -847,9 +848,9 @@ function Un({
|
|
|
847
848
|
text: v,
|
|
848
849
|
isLoading: P,
|
|
849
850
|
error: S
|
|
850
|
-
} = pt(e, L), [I, p] = N(!1), [h, b] = N(null), [s, f] = N(null), [M, w] = N(/* @__PURE__ */ new Set()), [x, U] = N(0), [_, K] = N(""), C = 10, g = Q(() => t?.policies ?? [], [t?.policies]), [F,
|
|
851
|
+
} = pt(e, L), [I, p] = N(!1), [h, b] = N(null), [s, f] = N(null), [M, w] = N(/* @__PURE__ */ new Set()), [x, U] = N(0), [_, K] = N(""), C = 10, g = Q(() => t?.policies ?? [], [t?.policies]), [F, W] = N([]), A = Ke(JSON.stringify(g));
|
|
851
852
|
oe(() => {
|
|
852
|
-
|
|
853
|
+
W(g), A.current = JSON.stringify(g);
|
|
853
854
|
}, [g]);
|
|
854
855
|
const T = F;
|
|
855
856
|
oe(() => {
|
|
@@ -883,10 +884,10 @@ function Un({
|
|
|
883
884
|
}, [T]), q = H((m) => {
|
|
884
885
|
const G = [];
|
|
885
886
|
return T.forEach((k, z) => {
|
|
886
|
-
(k.paths ?? []).forEach((R,
|
|
887
|
+
(k.paths ?? []).forEach((R, O) => {
|
|
887
888
|
St(R, m.path, m.method) && G.push({
|
|
888
889
|
policyIndex: z,
|
|
889
|
-
pathIndex:
|
|
890
|
+
pathIndex: O,
|
|
890
891
|
policy: k,
|
|
891
892
|
path: R
|
|
892
893
|
});
|
|
@@ -922,7 +923,7 @@ function Un({
|
|
|
922
923
|
});
|
|
923
924
|
}
|
|
924
925
|
}, [F, i]), J = H(() => {
|
|
925
|
-
|
|
926
|
+
W(g), A.current = JSON.stringify(g), u(null);
|
|
926
927
|
}, [g]), he = H((m, G) => {
|
|
927
928
|
if (!h) return;
|
|
928
929
|
const k = G ?? {}, z = h.type === "global" ? {
|
|
@@ -934,38 +935,38 @@ function Un({
|
|
|
934
935
|
methods: [h.method],
|
|
935
936
|
params: k
|
|
936
937
|
}, R = T.find((j) => j.name === m.name && j.version === m.version);
|
|
937
|
-
let
|
|
938
|
+
let O;
|
|
938
939
|
if (R) {
|
|
939
940
|
const j = R.paths ?? [], Z = jn(j, z) ? j : [...j, z];
|
|
940
|
-
|
|
941
|
+
O = T.map((ie) => ie.name === m.name && ie.version === m.version ? {
|
|
941
942
|
...ie,
|
|
942
943
|
paths: Z
|
|
943
944
|
} : ie);
|
|
944
945
|
} else
|
|
945
|
-
|
|
946
|
+
O = [...T, {
|
|
946
947
|
name: m.name,
|
|
947
948
|
version: m.version,
|
|
948
949
|
paths: [z]
|
|
949
950
|
}];
|
|
950
|
-
O
|
|
951
|
+
W(O);
|
|
951
952
|
}, [h, T]), ne = H((m, G) => {
|
|
952
953
|
const k = T[m];
|
|
953
954
|
if (!k) return;
|
|
954
|
-
const z = (k.paths ?? []).filter((
|
|
955
|
-
...
|
|
955
|
+
const z = (k.paths ?? []).filter((O, j) => j !== G), R = z.length === 0 ? T.filter((O, j) => j !== m) : T.map((O, j) => j === m ? {
|
|
956
|
+
...O,
|
|
956
957
|
paths: z
|
|
957
|
-
} :
|
|
958
|
-
|
|
958
|
+
} : O);
|
|
959
|
+
W(R);
|
|
959
960
|
}, [T]), re = H((m, G) => {
|
|
960
961
|
if (!s) return;
|
|
961
|
-
const k = G ?? {}, z = T.map((R,
|
|
962
|
+
const k = G ?? {}, z = T.map((R, O) => O !== s.policyIndex ? R : {
|
|
962
963
|
...R,
|
|
963
964
|
paths: (R.paths ?? []).map((j, Z) => Z === s.pathIndex ? {
|
|
964
965
|
...j,
|
|
965
966
|
params: k
|
|
966
967
|
} : j)
|
|
967
968
|
});
|
|
968
|
-
|
|
969
|
+
W(z);
|
|
969
970
|
}, [s, T]), xe = H((m) => {
|
|
970
971
|
b(m), f(null), p(!0);
|
|
971
972
|
}, []), le = H((m) => {
|
|
@@ -1044,10 +1045,10 @@ function Un({
|
|
|
1044
1045
|
width: "100%"
|
|
1045
1046
|
} }),
|
|
1046
1047
|
me.length === 0 ? /* @__PURE__ */ n(B.Container, { children: /* @__PURE__ */ n(B.EmptyState, { illustration: /* @__PURE__ */ n(Kt, { size: 64 }), title: "No resources match your search", description: "Try a different keyword or clear the search filter." }) }) : /* @__PURE__ */ n(E, { spacing: 0, children: Ie.map((m) => {
|
|
1047
|
-
const G =
|
|
1048
|
-
return /* @__PURE__ */ a(je, { expanded: k, onChange: (R,
|
|
1048
|
+
const G = We(m), k = M.has(G), z = q(m);
|
|
1049
|
+
return /* @__PURE__ */ a(je, { expanded: k, onChange: (R, O) => w((j) => {
|
|
1049
1050
|
const Z = new Set(j);
|
|
1050
|
-
return
|
|
1051
|
+
return O ? Z.add(G) : Z.delete(G), Z;
|
|
1051
1052
|
}), disableGutters: !0, children: [
|
|
1052
1053
|
/* @__PURE__ */ n(Ue, { expandIcon: /* @__PURE__ */ n(Ve, { size: 18 }), children: /* @__PURE__ */ a(E, { direction: "row", alignItems: "center", spacing: 1, children: [
|
|
1053
1054
|
/* @__PURE__ */ n(ue, { label: m.method, size: "small", variant: "outlined", color: Tt(m.method), sx: {
|
|
@@ -1085,7 +1086,7 @@ function Un({
|
|
|
1085
1086
|
/* @__PURE__ */ n(de, { variant: "outlined", onClick: J, disabled: !V || l, children: "Discard" }),
|
|
1086
1087
|
/* @__PURE__ */ n(de, { variant: "contained", onClick: () => void X(), disabled: !V || l, children: l ? "Saving..." : "Save" })
|
|
1087
1088
|
] }),
|
|
1088
|
-
/* @__PURE__ */ n(
|
|
1089
|
+
/* @__PURE__ */ n(Pn, { open: I, onClose: te, onSubmit: fe, policyNoun: "guardrail", loadingLabel: "Loading guardrails...", searchPlaceholder: "Search guardrails...", catalogErrorLabel: "Failed to load guardrails.", emptySearchTitle: "No guardrails match your search", emptyCatalogTitle: "No guardrails available", emptyCatalogDescription: "No guardrail policies are available in the catalog.", disabledPolicyKeys: s ? [] : T.filter((m) => h?.type === "global" ? (m.paths ?? []).some(rt) : h?.type === "resource" ? (m.paths ?? []).some((G) => St(G, h.path, h.method)) : !1).map((m) => `${m.name}@${m.version}`), existingSettings: s?.params, editPolicyKey: s ? `${s.guardrailName}@${s.guardrailVersion}` : void 0, title: s ? "Edit Guardrail" : "Guardrails", subtitle: s ? "Update the guardrail configuration." : "Choose a guardrail to configure advanced options.", minWidth: 600, maxWidth: 600 })
|
|
1089
1090
|
] });
|
|
1090
1091
|
}
|
|
1091
1092
|
function Bn(t, e) {
|
|
@@ -1152,7 +1153,7 @@ function Vn({
|
|
|
1152
1153
|
name: J.name,
|
|
1153
1154
|
environment: J.environments?.[0]
|
|
1154
1155
|
}));
|
|
1155
|
-
}, [t?.context, x, U, r, o]), [K, C] = N(null), [g, F] = N(null),
|
|
1156
|
+
}, [t?.context, x, U, r, o]), [K, C] = N(null), [g, F] = N(null), W = Nt(), A = un(), T = H((q) => {
|
|
1156
1157
|
if (q && typeof q == "object") {
|
|
1157
1158
|
if ((q.status ?? q.statusCode) === 409) return !0;
|
|
1158
1159
|
const X = String(q.message ?? q.error ?? "").toLowerCase();
|
|
@@ -1165,7 +1166,7 @@ function Vn({
|
|
|
1165
1166
|
F(null), C(null);
|
|
1166
1167
|
const q = Math.random().toString(36).slice(2, 10), V = `provider-${t?.id ?? "unknown"}-${q}`;
|
|
1167
1168
|
try {
|
|
1168
|
-
const X = await
|
|
1169
|
+
const X = await W.mutateAsync({
|
|
1169
1170
|
params: {
|
|
1170
1171
|
orgName: r,
|
|
1171
1172
|
providerId: o
|
|
@@ -1194,7 +1195,7 @@ function Vn({
|
|
|
1194
1195
|
else
|
|
1195
1196
|
F(X instanceof Error ? X.message : "Failed to generate API key");
|
|
1196
1197
|
}
|
|
1197
|
-
}, [r, o, _.length,
|
|
1198
|
+
}, [r, o, _.length, W, A, T]), ae = H(async () => {
|
|
1198
1199
|
const q = I.trim().startsWith("http") ? I.trim() : null;
|
|
1199
1200
|
if (q) {
|
|
1200
1201
|
L(!0), P(null);
|
|
@@ -1318,7 +1319,7 @@ function Vn({
|
|
|
1318
1319
|
} })
|
|
1319
1320
|
] }) }) })
|
|
1320
1321
|
] }),
|
|
1321
|
-
r && o && /* @__PURE__ */ n(En, { endpoints: _, onGenerateApiKey: Y, isGeneratingApiKey:
|
|
1322
|
+
r && o && /* @__PURE__ */ n(En, { endpoints: _, onGenerateApiKey: Y, isGeneratingApiKey: W.isPending || A.isPending, apiKeyError: g, generatedApiKey: K, onClearApiKeyError: () => F(null), emptyMessage: "No invoke URLs available. Deploy this provider to an AI gateway to see invoke URLs and generate API keys." }),
|
|
1322
1323
|
/* @__PURE__ */ n($e, {}),
|
|
1323
1324
|
/* @__PURE__ */ a(E, { spacing: 1.5, sx: {
|
|
1324
1325
|
mt: 3
|
|
@@ -1417,7 +1418,7 @@ const Hn = [{
|
|
|
1417
1418
|
request: It,
|
|
1418
1419
|
token: It,
|
|
1419
1420
|
cost: Yn
|
|
1420
|
-
}), it = (t) =>
|
|
1421
|
+
}), it = (t) => We(t, "-"), Ce = {
|
|
1421
1422
|
request: {
|
|
1422
1423
|
enabled: !1,
|
|
1423
1424
|
quota: "",
|
|
@@ -1509,7 +1510,7 @@ function Qn(t) {
|
|
|
1509
1510
|
}
|
|
1510
1511
|
return r;
|
|
1511
1512
|
}
|
|
1512
|
-
function
|
|
1513
|
+
function Oe(t) {
|
|
1513
1514
|
return t.request.enabled && Number(t.request.quota) >= 1 || t.token.enabled && Number(t.token.quota) >= 1 || t.cost.enabled && Number(t.cost.quota) > 0;
|
|
1514
1515
|
}
|
|
1515
1516
|
function Xn(t) {
|
|
@@ -1569,13 +1570,13 @@ function st(t) {
|
|
|
1569
1570
|
e[16] !== u ? (F = (we, et) => u({
|
|
1570
1571
|
enabled: et
|
|
1571
1572
|
}), e[16] = u, e[17] = F) : F = e[17];
|
|
1572
|
-
let
|
|
1573
|
-
e[18] !== P || e[19] !== F || e[20] !== d.enabled ? (
|
|
1573
|
+
let W;
|
|
1574
|
+
e[18] !== P || e[19] !== F || e[20] !== d.enabled ? (W = /* @__PURE__ */ n(_t, { size: "small", checked: d.enabled, onChange: F, disabled: P, onClick: Dn }), e[18] = P, e[19] = F, e[20] = d.enabled, e[21] = W) : W = e[21];
|
|
1574
1575
|
let A;
|
|
1575
|
-
e[22] !== g || e[23] !==
|
|
1576
|
+
e[22] !== g || e[23] !== W ? (A = /* @__PURE__ */ n(Ue, { expandIcon: U, sx: _, children: /* @__PURE__ */ a(E, { direction: "row", alignItems: "center", justifyContent: "space-between", width: "100%", pr: 1, children: [
|
|
1576
1577
|
g,
|
|
1577
|
-
|
|
1578
|
-
] }) }), e[22] = g, e[23] =
|
|
1578
|
+
W
|
|
1579
|
+
] }) }), e[22] = g, e[23] = W, e[24] = A) : A = e[24];
|
|
1579
1580
|
let T;
|
|
1580
1581
|
e[25] === Symbol.for("react.memo_cache_sentinel") ? (T = {
|
|
1581
1582
|
px: 2,
|
|
@@ -1648,14 +1649,14 @@ function st(t) {
|
|
|
1648
1649
|
e[59] !== u ? (R = (we) => u({
|
|
1649
1650
|
unit: we.target.value
|
|
1650
1651
|
}), e[59] = u, e[60] = R) : R = e[60];
|
|
1651
|
-
const
|
|
1652
|
+
const O = P || !d.enabled;
|
|
1652
1653
|
let j;
|
|
1653
1654
|
e[61] === Symbol.for("react.memo_cache_sentinel") ? (j = Hn.map(Zn), e[61] = j) : j = e[61];
|
|
1654
1655
|
let Z;
|
|
1655
|
-
e[62] !== R || e[63] !==
|
|
1656
|
+
e[62] !== R || e[63] !== O || e[64] !== d.unit ? (Z = /* @__PURE__ */ n(D, { size: G, children: /* @__PURE__ */ a(ge, { fullWidth: !0, size: "small", children: [
|
|
1656
1657
|
k,
|
|
1657
|
-
/* @__PURE__ */ n(Xe, { size: "small", value: z, onChange: R, disabled:
|
|
1658
|
-
] }) }), e[62] = R, e[63] =
|
|
1658
|
+
/* @__PURE__ */ n(Xe, { size: "small", value: z, onChange: R, disabled: O, children: j })
|
|
1659
|
+
] }) }), e[62] = R, e[63] = O, e[64] = d.unit, e[65] = Z) : Z = e[65];
|
|
1659
1660
|
let ie;
|
|
1660
1661
|
e[66] !== re || e[67] !== m || e[68] !== Z ? (ie = /* @__PURE__ */ n(Be, { sx: T, children: /* @__PURE__ */ a(D, { container: !0, spacing: 2, children: [
|
|
1661
1662
|
re,
|
|
@@ -1734,11 +1735,11 @@ function er({
|
|
|
1734
1735
|
if (!P.trim()) return [];
|
|
1735
1736
|
const k = He(P);
|
|
1736
1737
|
return k ? ft(k) : [];
|
|
1737
|
-
}, [P]), h = l.get("mode"), b = h === "global" || h === "resourceWise" ? h : "global", [s, f] = N(b), [M, w] = N(Ce), [x, U] = N(Ce), [_, K] = N({}), [C, g] = N(""), [F,
|
|
1738
|
-
const k = Ee(M), z = Ee(x), R = Object.entries(_).filter(([,
|
|
1739
|
-
resource:
|
|
1738
|
+
}, [P]), h = l.get("mode"), b = h === "global" || h === "resourceWise" ? h : "global", [s, f] = N(b), [M, w] = N(Ce), [x, U] = N(Ce), [_, K] = N({}), [C, g] = N(""), [F, W] = N(/* @__PURE__ */ new Set()), [A, T] = N({}), [Y, ae] = N(Ce), q = Q(() => Oe(M), [M]), V = Q(() => Oe(x) ? !0 : Object.values(_).some(Oe), [x, _]), X = Ke(null), [J, he] = N(0), ne = H(() => {
|
|
1739
|
+
const k = Ee(M), z = Ee(x), R = Object.entries(_).filter(([, O]) => Oe(O)).map(([O, j]) => ({
|
|
1740
|
+
resource: O,
|
|
1740
1741
|
limit: Ee(j)
|
|
1741
|
-
})).sort((
|
|
1742
|
+
})).sort((O, j) => O.resource.localeCompare(j.resource));
|
|
1742
1743
|
return JSON.stringify({
|
|
1743
1744
|
global: k,
|
|
1744
1745
|
resourceWise: {
|
|
@@ -1764,8 +1765,8 @@ function er({
|
|
|
1764
1765
|
}, {
|
|
1765
1766
|
replace: !0
|
|
1766
1767
|
});
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1768
|
+
const O = t.rateLimiting?.consumerLevel;
|
|
1769
|
+
O?.global ? ae(Ye(O.global)) : ae(Ce), he(Date.now());
|
|
1769
1770
|
}, [t, l, c]);
|
|
1770
1771
|
oe(() => {
|
|
1771
1772
|
re();
|
|
@@ -1808,9 +1809,9 @@ function er({
|
|
|
1808
1809
|
}) : (k.push({
|
|
1809
1810
|
c: x,
|
|
1810
1811
|
blockKey: "resourceWise-default"
|
|
1811
|
-
}), Object.entries(_).forEach(([R,
|
|
1812
|
-
Xn(
|
|
1813
|
-
c:
|
|
1812
|
+
}), Object.entries(_).forEach(([R, O]) => {
|
|
1813
|
+
Xn(O) && k.push({
|
|
1814
|
+
c: O,
|
|
1814
1815
|
blockKey: `resourceWise-${R}`
|
|
1815
1816
|
});
|
|
1816
1817
|
})), k.push({
|
|
@@ -1819,17 +1820,17 @@ function er({
|
|
|
1819
1820
|
});
|
|
1820
1821
|
for (const {
|
|
1821
1822
|
c: R,
|
|
1822
|
-
blockKey:
|
|
1823
|
+
blockKey: O
|
|
1823
1824
|
} of k) {
|
|
1824
1825
|
const j = Qn(R);
|
|
1825
1826
|
if (Object.keys(j).length > 0) {
|
|
1826
1827
|
if (T({
|
|
1827
|
-
[
|
|
1828
|
-
}),
|
|
1828
|
+
[O]: j
|
|
1829
|
+
}), O === "consumer-global")
|
|
1829
1830
|
d(1);
|
|
1830
|
-
else if (d(0),
|
|
1831
|
-
const Z =
|
|
1832
|
-
|
|
1831
|
+
else if (d(0), O.startsWith("resourceWise-") && O !== "resourceWise-default") {
|
|
1832
|
+
const Z = O.replace("resourceWise-", "");
|
|
1833
|
+
W((ye) => new Set(ye).add(Z));
|
|
1833
1834
|
const ie = te.findIndex((ye) => it(ye) === Z);
|
|
1834
1835
|
ie >= 0 && me(Math.floor(ie / fe));
|
|
1835
1836
|
}
|
|
@@ -1843,8 +1844,8 @@ function er({
|
|
|
1843
1844
|
global: Ee(M),
|
|
1844
1845
|
resourceWise: void 0
|
|
1845
1846
|
};
|
|
1846
|
-
const R = Object.entries(_).filter(([,
|
|
1847
|
-
resource:
|
|
1847
|
+
const R = Object.entries(_).filter(([, O]) => Oe(O)).map(([O, j]) => ({
|
|
1848
|
+
resource: O,
|
|
1848
1849
|
limit: Ee(j)
|
|
1849
1850
|
}));
|
|
1850
1851
|
return {
|
|
@@ -1895,10 +1896,10 @@ function er({
|
|
|
1895
1896
|
/* @__PURE__ */ n(ve, { sx: {
|
|
1896
1897
|
mb: 1
|
|
1897
1898
|
}, children: "Mode" }),
|
|
1898
|
-
/* @__PURE__ */ a(
|
|
1899
|
+
/* @__PURE__ */ a(Wt, { value: s, exclusive: !0, color: "primary", onChange: (k, z) => {
|
|
1899
1900
|
z && (f(z), c((R) => {
|
|
1900
|
-
const
|
|
1901
|
-
return
|
|
1901
|
+
const O = new URLSearchParams(R);
|
|
1902
|
+
return O.set("mode", z), O;
|
|
1902
1903
|
}, {
|
|
1903
1904
|
replace: !0
|
|
1904
1905
|
}));
|
|
@@ -1943,11 +1944,11 @@ function er({
|
|
|
1943
1944
|
/* @__PURE__ */ n($, { variant: "body2", color: "text.secondary", children: "Loading OpenAPI spec…" })
|
|
1944
1945
|
] }) : te.length === 0 ? /* @__PURE__ */ n(B.Container, { children: /* @__PURE__ */ n(B.EmptyState, { illustration: C.trim() ? /* @__PURE__ */ n(Kt, { size: 64 }) : /* @__PURE__ */ n(Jt, { size: 64 }), title: C.trim() ? "No resources match your search" : "No resources found", description: C.trim() ? "Try a different keyword or clear the search filter." : "No resources are available from the OpenAPI spec. Add an OpenAPI specification to define resources." }) }) : /* @__PURE__ */ a(E, { spacing: 1, children: [
|
|
1945
1946
|
Ie.map((k) => {
|
|
1946
|
-
const z = it(k), R = F.has(z),
|
|
1947
|
+
const z = it(k), R = F.has(z), O = _[z] ?? Ce, j = Oe(O);
|
|
1947
1948
|
return /* @__PURE__ */ n(lt, { variant: "outlined", sx: {
|
|
1948
1949
|
borderRadius: 2,
|
|
1949
1950
|
overflow: "hidden"
|
|
1950
|
-
}, children: /* @__PURE__ */ a(je, { expanded: R, onChange: (Z, ie) =>
|
|
1951
|
+
}, children: /* @__PURE__ */ a(je, { expanded: R, onChange: (Z, ie) => W((ye) => {
|
|
1951
1952
|
const ke = new Set(ye);
|
|
1952
1953
|
return ie ? ke.add(z) : ke.delete(z), ke;
|
|
1953
1954
|
}), disableGutters: !0, elevation: 0, sx: {
|
|
@@ -1972,7 +1973,7 @@ function er({
|
|
|
1972
1973
|
R && /* @__PURE__ */ n(Be, { sx: {
|
|
1973
1974
|
px: 2,
|
|
1974
1975
|
pb: 2
|
|
1975
|
-
}, children: /* @__PURE__ */ n(Je, { criteria:
|
|
1976
|
+
}, children: /* @__PURE__ */ n(Je, { criteria: O, onChange: (Z) => K((ie) => ({
|
|
1976
1977
|
...ie,
|
|
1977
1978
|
[z]: Z
|
|
1978
1979
|
})), fieldErrors: A[`resourceWise-${z}`] }) })
|
|
@@ -2083,7 +2084,7 @@ function rr({
|
|
|
2083
2084
|
xs: 12,
|
|
2084
2085
|
md: 5
|
|
2085
2086
|
}, children: /* @__PURE__ */ a(ge, { fullWidth: !0, disabled: b, children: [
|
|
2086
|
-
/* @__PURE__ */ n(ve, { children: "
|
|
2087
|
+
/* @__PURE__ */ n(ve, { children: "Method" }),
|
|
2087
2088
|
/* @__PURE__ */ a(Xe, { size: "small", value: i || "", onChange: (s) => l(s.target.value || ""), children: [
|
|
2088
2089
|
/* @__PURE__ */ n(_e, { value: "", children: "None" }),
|
|
2089
2090
|
/* @__PURE__ */ n(_e, { value: "apiKey", children: "apiKey" })
|
|
@@ -2197,7 +2198,7 @@ const sr = () => {
|
|
|
2197
2198
|
pb: 3
|
|
2198
2199
|
}, children: [
|
|
2199
2200
|
/* @__PURE__ */ n(Ae, { value: t, index: 0, children: /* @__PURE__ */ n(Vn, { providerData: i, openapiSpecUrl: I, orgName: o, providerId: r, isLoading: l, error: c instanceof Error ? c : c ? new Error(Fe(c)) : null, onUpdate: u, isUpdating: d }) }),
|
|
2200
|
-
/* @__PURE__ */ n(Ae, { value: t, index: 1, children: /* @__PURE__ */ n(
|
|
2201
|
+
/* @__PURE__ */ n(Ae, { value: t, index: 1, children: /* @__PURE__ */ n(On, { providerData: i, valuePrefix: p, isLoading: l, onUpdate: u, isUpdating: d }) }),
|
|
2201
2202
|
/* @__PURE__ */ n(Ae, { value: t, index: 2, children: /* @__PURE__ */ n(zn, { providerData: i, openapiSpecUrl: I, isLoading: l, onUpdate: u, isUpdating: d }) }),
|
|
2202
2203
|
/* @__PURE__ */ n(Ae, { value: t, index: 3, children: /* @__PURE__ */ n(rr, { providerData: i, isLoading: l, onUpdate: u, isUpdating: d }) }),
|
|
2203
2204
|
/* @__PURE__ */ n(Ae, { value: t, index: 4, children: /* @__PURE__ */ n(Rn, { providerData: i, orgName: o, providerId: r, isLoading: l, error: c instanceof Error ? c : c ? new Error(Fe(c)) : null }) }),
|
|
@@ -2314,9 +2315,9 @@ const sr = () => {
|
|
|
2314
2315
|
t[18] !== i || t[19] !== r ? (g = () => r(i), t[18] = i, t[19] = r, t[20] = g) : g = t[20];
|
|
2315
2316
|
let F;
|
|
2316
2317
|
t[21] !== U || t[22] !== K || t[23] !== p || t[24] !== u || t[25] !== w || t[26] !== C || t[27] !== g || t[28] !== f ? (F = /* @__PURE__ */ n(kn, { orgId: C, templates: f, isLoadingTemplates: u, missingParamsMessage: w, errorMessage: U, isSubmitting: p, onCancel: g, onSubmit: K }), t[21] = U, t[22] = K, t[23] = p, t[24] = u, t[25] = w, t[26] = C, t[27] = g, t[28] = f, t[29] = F) : F = t[29];
|
|
2317
|
-
let
|
|
2318
|
-
return t[30] !== i || t[31] !== F ? (
|
|
2319
|
-
},
|
|
2318
|
+
let W;
|
|
2319
|
+
return t[30] !== i || t[31] !== F ? (W = /* @__PURE__ */ n(ht, { title: "Add LLM Service Provider", backHref: i, disableIcon: !0, backLabel: "Back to Providers List", children: F }), t[30] = i, t[31] = F, t[32] = W) : W = t[32], W;
|
|
2320
|
+
}, Lr = {
|
|
2320
2321
|
title: "LLM Service Providers",
|
|
2321
2322
|
description: "A page component for LLM Service Provider management",
|
|
2322
2323
|
icon: Qt,
|
|
@@ -2335,6 +2336,6 @@ export {
|
|
|
2335
2336
|
or as LLMProvidersOrganization,
|
|
2336
2337
|
In as buildCreateLLMProviderRequest,
|
|
2337
2338
|
Sn as mapLLMProviderTemplatesToCards,
|
|
2338
|
-
|
|
2339
|
-
|
|
2339
|
+
Lr as metaData,
|
|
2340
|
+
kr as toProviderId
|
|
2340
2341
|
};
|