@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,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as k, Fragment as ge } from "react/jsx-runtime";
|
|
2
2
|
import { c as se } from "react/compiler-runtime";
|
|
3
3
|
import { useState as $, useMemo as Q, useRef as pe, useEffect as oe, lazy as we, Suspense as be } from "react";
|
|
4
|
-
import { Typography as
|
|
4
|
+
import { Typography as H, Box as b, CardContent as xe, Stack as ve, Card as Ie, Alert as N, Button as q, TextField as le, CircularProgress as re, Skeleton as J } from "@wso2/oxygen-ui";
|
|
5
5
|
import { MessageCircle as Te, Send as ce, Rocket as Ae, FlaskConical as Se } from "@wso2/oxygen-ui-icons-react";
|
|
6
|
-
import {
|
|
6
|
+
import { o as Z, aM as ke, aN as fe, aO as me, O as de, M as Ce, c as Ne, P as he, N as Ee } from "./index-ByEInFlf.js";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
8
|
import { useParams as ee } from "react-router-dom";
|
|
9
|
-
import { E as ue } from "./EnvironmentSelector-
|
|
9
|
+
import { E as ue } from "./EnvironmentSelector-D8S6nO9u.js";
|
|
10
10
|
function Ke(n) {
|
|
11
11
|
const e = se(47), {
|
|
12
12
|
role: r,
|
|
@@ -42,9 +42,9 @@ function Ke(n) {
|
|
|
42
42
|
"& .MuiCardContent-root": o
|
|
43
43
|
}, e[7] = P, e[8] = g, e[9] = o, e[10] = f) : f = e[10];
|
|
44
44
|
let c;
|
|
45
|
-
e[11] !== a?.displayName || e[12] !== r ? (c = r !== "user" && /* @__PURE__ */ t(
|
|
45
|
+
e[11] !== a?.displayName || e[12] !== r ? (c = r !== "user" && /* @__PURE__ */ t(H, { variant: "caption", children: a?.displayName }), e[11] = a?.displayName, e[12] = r, e[13] = c) : c = e[13];
|
|
46
46
|
let u;
|
|
47
|
-
e[14] !== r ? (u = r === "user" && /* @__PURE__ */ t(
|
|
47
|
+
e[14] !== r ? (u = r === "user" && /* @__PURE__ */ t(H, { variant: "caption", color: "primary.contrastText", children: "You" }), e[14] = r, e[15] = u) : u = e[15];
|
|
48
48
|
const D = r === "user" ? "primary.contrastText" : "text.primary";
|
|
49
49
|
let I;
|
|
50
50
|
e[16] !== D ? (I = {
|
|
@@ -86,8 +86,8 @@ function Ke(n) {
|
|
|
86
86
|
e[38] !== K || e[39] !== f ? (A = /* @__PURE__ */ t(Ie, { variant: "outlined", sx: f, children: K }), e[38] = K, e[39] = f, e[40] = A) : A = e[40];
|
|
87
87
|
let S;
|
|
88
88
|
e[41] !== A || e[42] !== B ? (S = /* @__PURE__ */ t(b, { display: "flex", gap: 1.5, maxWidth: 500, flexDirection: B, alignItems: "flex-start", children: A }), e[41] = A, e[42] = B, e[43] = S) : S = e[43];
|
|
89
|
-
let
|
|
90
|
-
return e[44] !== i || e[45] !== S ? (
|
|
89
|
+
let O;
|
|
90
|
+
return e[44] !== i || e[45] !== S ? (O = /* @__PURE__ */ t(b, { display: "flex", justifyContent: i, width: "100%", sx: E, children: S }), e[44] = i, e[45] = S, e[46] = O) : O = e[46], O;
|
|
91
91
|
}
|
|
92
92
|
const Re = 2e3;
|
|
93
93
|
function je() {
|
|
@@ -175,22 +175,22 @@ function je() {
|
|
|
175
175
|
throw m;
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
|
-
let
|
|
179
|
-
if (
|
|
178
|
+
let z = await X();
|
|
179
|
+
if (z === null) {
|
|
180
180
|
P(!0);
|
|
181
181
|
try {
|
|
182
|
-
await new Promise((m) => setTimeout(m, Re)),
|
|
182
|
+
await new Promise((m) => setTimeout(m, Re)), z = await X();
|
|
183
183
|
} finally {
|
|
184
184
|
P(!1);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
if (
|
|
187
|
+
if (z === null) {
|
|
188
188
|
v((m) => m.filter((G) => G.id !== h.id)), s(h.content), y?.gatewayConnected !== !1 && p("unauthorized");
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
let W;
|
|
192
|
-
const ie =
|
|
193
|
-
if (ie && ie.includes("application/json") ? W = await
|
|
192
|
+
const ie = z.headers.get("content-type");
|
|
193
|
+
if (ie && ie.includes("application/json") ? W = await z.json() : W = await z.text(), z.ok) {
|
|
194
194
|
const m = typeof W?.response == "string" ? W.response : JSON.stringify(W?.result, null, 4), G = {
|
|
195
195
|
id: (Date.now() + 1).toString(),
|
|
196
196
|
role: "assistant",
|
|
@@ -200,7 +200,7 @@ function je() {
|
|
|
200
200
|
v((ne) => [...ne, G]);
|
|
201
201
|
} else {
|
|
202
202
|
const m = typeof W == "string" ? W : JSON.stringify(W, null, 2);
|
|
203
|
-
a(`Request failed with status ${
|
|
203
|
+
a(`Request failed with status ${z.status}: ${m}`);
|
|
204
204
|
const G = {
|
|
205
205
|
id: (Date.now() + 1).toString(),
|
|
206
206
|
role: "assistant",
|
|
@@ -218,11 +218,11 @@ function je() {
|
|
|
218
218
|
content: `Error: ${V}`,
|
|
219
219
|
timestamp: /* @__PURE__ */ new Date()
|
|
220
220
|
};
|
|
221
|
-
v((
|
|
221
|
+
v((z) => [...z, X]);
|
|
222
222
|
} finally {
|
|
223
223
|
E(!1);
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, O = (h) => {
|
|
226
226
|
h.key === "Enter" && !h.shiftKey && (h.preventDefault(), S());
|
|
227
227
|
}, F = async () => {
|
|
228
228
|
f(!0);
|
|
@@ -231,7 +231,7 @@ function je() {
|
|
|
231
231
|
} finally {
|
|
232
232
|
f(!1);
|
|
233
233
|
}
|
|
234
|
-
},
|
|
234
|
+
}, U = /* @__PURE__ */ k(ge, { children: [
|
|
235
235
|
T && y?.gatewayConnected === !1 && /* @__PURE__ */ t(N, { severity: "warning", sx: {
|
|
236
236
|
borderRadius: 1
|
|
237
237
|
}, children: "The gateway is not connected to the control plane right now. The test API key has been stored but will only work once the gateway reconnects." }),
|
|
@@ -242,16 +242,16 @@ function je() {
|
|
|
242
242
|
borderRadius: 1
|
|
243
243
|
}, children: "Test key refreshed. Send your message again." })
|
|
244
244
|
] }), te = w || i || _ || L || T && !y?.apiKey, ae = te || !r.trim();
|
|
245
|
-
return w ? /* @__PURE__ */ t(N, { severity: "info", children: /* @__PURE__ */ t(
|
|
245
|
+
return w ? /* @__PURE__ */ t(N, { severity: "info", children: /* @__PURE__ */ t(H, { variant: "caption", children: "Testing is unavailable while OAuth is enabled. Test this endpoint out-of-band with a valid token." }) }) : x.length === 0 ? /* @__PURE__ */ t(de, { children: /* @__PURE__ */ k(b, { display: "flex", justifyContent: "center", alignItems: "center", width: "100%", flexDirection: "column", minHeight: "calc(100vh - 550px)", gap: 2, children: [
|
|
246
246
|
/* @__PURE__ */ k(b, { display: "flex", flexDirection: "column", gap: 1, alignItems: "center", children: [
|
|
247
247
|
/* @__PURE__ */ t(Te, { size: 40 }),
|
|
248
|
-
/* @__PURE__ */ t(
|
|
249
|
-
/* @__PURE__ */ t(
|
|
248
|
+
/* @__PURE__ */ t(H, { variant: "h5", children: "Start a conversation" }),
|
|
249
|
+
/* @__PURE__ */ t(H, { variant: "body2", children: "Send a message to begin chatting with the agent" })
|
|
250
250
|
] }),
|
|
251
251
|
/* @__PURE__ */ k(b, { width: "100%", maxWidth: 600, display: "flex", flexDirection: "column", gap: 1, children: [
|
|
252
|
-
|
|
252
|
+
U,
|
|
253
253
|
/* @__PURE__ */ k(b, { width: "100%", display: "flex", justifyContent: "flex-end", alignItems: "center", gap: 1, children: [
|
|
254
|
-
/* @__PURE__ */ t(le, { fullWidth: !0, value: r, onChange: (h) => s(h.target.value), onKeyDown:
|
|
254
|
+
/* @__PURE__ */ t(le, { fullWidth: !0, value: r, onChange: (h) => s(h.target.value), onKeyDown: O, placeholder: "Type your message...", variant: "outlined", disabled: te }),
|
|
255
255
|
/* @__PURE__ */ t(q, { variant: "contained", color: "primary", onClick: S, disabled: ae, startIcon: i || _ ? /* @__PURE__ */ t(re, { size: 16 }) : /* @__PURE__ */ t(ce, { size: 16 }), children: i ? "Sending" : "Send" })
|
|
256
256
|
] })
|
|
257
257
|
] })
|
|
@@ -262,13 +262,13 @@ function je() {
|
|
|
262
262
|
x.map((h) => /* @__PURE__ */ t(Ke, { id: h.id, role: h.role, content: h.content }, h.id)),
|
|
263
263
|
i && /* @__PURE__ */ t(b, { display: "flex", justifyContent: "flex-start", width: "100%", children: /* @__PURE__ */ k(b, { display: "flex", gap: 1, alignItems: "flex-start", children: [
|
|
264
264
|
/* @__PURE__ */ t(re, { size: 16 }),
|
|
265
|
-
/* @__PURE__ */ t(
|
|
265
|
+
/* @__PURE__ */ t(H, { variant: "body2", color: "text.secondary", sx: {
|
|
266
266
|
fontSize: "0.875rem"
|
|
267
267
|
}, children: B ? "Waiting for the test API key to become active..." : "Loading..." })
|
|
268
268
|
] }) }),
|
|
269
269
|
/* @__PURE__ */ t("div", { ref: c })
|
|
270
270
|
] }),
|
|
271
|
-
|
|
271
|
+
U,
|
|
272
272
|
C && /* @__PURE__ */ t(N, { severity: "error", onClose: () => a(null), sx: {
|
|
273
273
|
borderRadius: 1
|
|
274
274
|
}, children: C }),
|
|
@@ -276,12 +276,12 @@ function je() {
|
|
|
276
276
|
borderRadius: 1
|
|
277
277
|
}, children: "Failed to obtain a test API key. Send may fail until this is resolved." }),
|
|
278
278
|
/* @__PURE__ */ k(b, { display: "flex", justifyContent: "flex-end", alignItems: "center", gap: 1, py: 2, children: [
|
|
279
|
-
/* @__PURE__ */ t(le, { fullWidth: !0, value: r, onChange: (h) => s(h.target.value), onKeyDown:
|
|
279
|
+
/* @__PURE__ */ t(le, { fullWidth: !0, value: r, onChange: (h) => s(h.target.value), onKeyDown: O, placeholder: "Type your message...", variant: "outlined", size: "small", disabled: te }),
|
|
280
280
|
/* @__PURE__ */ t(q, { variant: "contained", color: "primary", onClick: S, disabled: ae, startIcon: i || _ ? /* @__PURE__ */ t(re, { size: 16 }) : /* @__PURE__ */ t(ce, { size: 16 }), children: i || _ ? "Sending" : "Send" })
|
|
281
281
|
] })
|
|
282
282
|
] }) });
|
|
283
283
|
}
|
|
284
|
-
const Pe = we(() => import("./index-
|
|
284
|
+
const Pe = we(() => import("./index-Cz7-AZwE.js")), De = 2e3, _e = {
|
|
285
285
|
statePlugins: {
|
|
286
286
|
spec: {
|
|
287
287
|
wrapSelectors: {
|
|
@@ -335,22 +335,22 @@ function Le() {
|
|
|
335
335
|
return d;
|
|
336
336
|
const w = new URL(d.url, window.location.origin), y = new URL(T), L = y.pathname.replace(/\/+$/, ""), M = w.pathname.replace(/^\/+/, ""), K = [L, M].filter(Boolean).join("/");
|
|
337
337
|
return y.pathname = K.startsWith("/") ? K : `/${K}`, y.search = w.search, y.hash = w.hash, d.url = y.toString(), a && o && (d.headers = d.headers ?? {}, d.headers["X-API-Key"] = o), a && !I && (d.userFetch = async (A, S) => {
|
|
338
|
-
const
|
|
338
|
+
const O = () => new Promise((F) => setTimeout(F, De));
|
|
339
339
|
try {
|
|
340
340
|
const F = await fetch(A, S);
|
|
341
341
|
if (F.status !== 401)
|
|
342
342
|
return F;
|
|
343
|
-
await
|
|
344
|
-
const
|
|
345
|
-
return
|
|
343
|
+
await O();
|
|
344
|
+
const U = await fetch(A, S);
|
|
345
|
+
return U.status === 401 && c("unauthorized"), U;
|
|
346
346
|
} catch (F) {
|
|
347
347
|
if (!(F instanceof TypeError))
|
|
348
348
|
throw F;
|
|
349
|
-
await
|
|
349
|
+
await O();
|
|
350
350
|
try {
|
|
351
351
|
return await fetch(A, S);
|
|
352
|
-
} catch (
|
|
353
|
-
throw c("unauthorized"),
|
|
352
|
+
} catch (U) {
|
|
353
|
+
throw c("unauthorized"), U;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}), d;
|
|
@@ -362,14 +362,14 @@ function Le() {
|
|
|
362
362
|
D(!1);
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
|
-
return x || a && B ? /* @__PURE__ */ t(
|
|
365
|
+
return x || a && B ? /* @__PURE__ */ t(J, { variant: "rounded", height: 500 }) : v ? /* @__PURE__ */ t(N, { severity: "error", children: Ce(v) }) : a && P ? /* @__PURE__ */ k(N, { severity: "error", children: [
|
|
366
366
|
"Failed to fetch test API key",
|
|
367
367
|
g instanceof Error ? `: ${g.message}` : "",
|
|
368
368
|
"."
|
|
369
|
-
] }) : l?.[R]?.schema?.content ? /* @__PURE__ */ k(be, { fallback: /* @__PURE__ */ t(
|
|
369
|
+
] }) : l?.[R]?.schema?.content ? /* @__PURE__ */ k(be, { fallback: /* @__PURE__ */ t(J, { variant: "rounded", height: 500 }), children: [
|
|
370
370
|
i && /* @__PURE__ */ t(N, { severity: "info", sx: {
|
|
371
371
|
mb: 2
|
|
372
|
-
}, children: /* @__PURE__ */ k(
|
|
372
|
+
}, children: /* @__PURE__ */ k(H, { variant: "caption", children: [
|
|
373
373
|
"OAuth is enabled — test this endpoint out-of-band with an",
|
|
374
374
|
" ",
|
|
375
375
|
/* @__PURE__ */ t("code", { children: "Authorization: Bearer <token>" }),
|
|
@@ -394,13 +394,13 @@ function Le() {
|
|
|
394
394
|
const Me = () => {
|
|
395
395
|
const n = se(4);
|
|
396
396
|
let e, r, s;
|
|
397
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t(
|
|
397
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t(J, { variant: "circular", width: 80, height: 80 }), r = /* @__PURE__ */ t(J, { variant: "text", width: 250, height: 32 }), s = /* @__PURE__ */ t(J, { variant: "text", width: 350, height: 20 }), n[0] = e, n[1] = r, n[2] = s) : (e = n[0], r = n[1], s = n[2]);
|
|
398
398
|
let l;
|
|
399
399
|
return n[3] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ k(b, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2, height: "60vh", children: [
|
|
400
400
|
e,
|
|
401
401
|
r,
|
|
402
402
|
s,
|
|
403
|
-
/* @__PURE__ */ t(
|
|
403
|
+
/* @__PURE__ */ t(J, { variant: "rounded", width: 500, height: 48, sx: {
|
|
404
404
|
mt: 2
|
|
405
405
|
} })
|
|
406
406
|
] }), n[3] = l) : l = n[3], l;
|
|
@@ -443,7 +443,7 @@ const Me = () => {
|
|
|
443
443
|
n[11] !== s || n[12] !== a || n[13] !== g ? (o = g ? /* @__PURE__ */ t(Me, {}) : /* @__PURE__ */ t(ge, { children: a ? /* @__PURE__ */ t(je, {}, s) : /* @__PURE__ */ t(Le, {}, s) }), n[11] = s, n[12] = a, n[13] = g, n[14] = o) : o = n[14];
|
|
444
444
|
let f;
|
|
445
445
|
return n[15] !== g || n[16] !== o ? (f = /* @__PURE__ */ t(he, { title: "Try your agent", disableIcon: !0, isLoading: g, actions: p, children: o }), n[15] = g, n[16] = o, n[17] = f) : f = n[17], f;
|
|
446
|
-
},
|
|
446
|
+
}, He = {
|
|
447
447
|
title: "Try It",
|
|
448
448
|
description: "A page component for Try It",
|
|
449
449
|
icon: Se,
|
|
@@ -455,5 +455,5 @@ const Me = () => {
|
|
|
455
455
|
};
|
|
456
456
|
export {
|
|
457
457
|
ye as TestComponent,
|
|
458
|
-
|
|
458
|
+
He as metaData
|
|
459
459
|
};
|