@wso2/am-core-ui 0.0.18 → 0.0.19
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/APIKeysManager-C0phJriD.js +241 -0
- package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
- package/dist/CodeBlock-mB_Loq7I.js +21736 -0
- package/dist/EnvironmentCard-09h1XRxx.js +310 -0
- package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
- package/dist/MCPLogo-D9IJzzl7.js +30 -0
- package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
- package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
- package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
- package/dist/clipboard-YAzStmkw.js +23 -0
- package/dist/debounce-BV83M53b.js +208 -0
- package/dist/format-BEZZRyE2.js +29 -0
- package/dist/formatDistanceToNow-TErllcH8.js +100 -0
- package/dist/gatewayScripts-D8O45W8u.js +72 -0
- package/dist/highlight-BsUzxSR3.js +454 -0
- package/dist/index-B52h3RHg.js +1290 -0
- package/dist/index-BP5drcF2.js +1265 -0
- package/dist/index-BZ4vxviI.js +7981 -0
- package/dist/index-B_Z0MwXk.js +25012 -0
- package/dist/index-BfjzUWDa.js +1397 -0
- package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
- package/dist/index-CGDYgUCH.js +711 -0
- package/dist/index-COt7nJIf.js +2286 -0
- package/dist/index-CWZjOy1h.js +2247 -0
- package/dist/index-CezvogTQ.js +116 -0
- package/dist/index-CgCWbWzN.js +2342 -0
- package/dist/index-CjCkcuuI.js +322 -0
- package/dist/index-CjXvuf9m.js +1354 -0
- package/dist/index-DD4qF7gq.js +2340 -0
- package/dist/index-DeQ-9KTC.js +737 -0
- package/dist/index-Df6OBy4E.js +3041 -0
- package/dist/index-KRsV2L4V.js +1564 -0
- package/dist/index-PUuASE1F.js +2507 -0
- package/dist/index-PWsNvJB-.js +546 -0
- package/dist/index-UqDmyMSA.js +119 -0
- package/dist/index-_0Pj_ZtW.js +459 -0
- package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
- package/dist/index.d.ts +496 -200
- package/dist/index.js +462 -439
- package/dist/llmProviderPayload-CzihkdNa.js +332 -0
- package/dist/schemas-DFScWdSL.js +2969 -0
- package/package.json +1 -1
- package/dist/index-B47EJCom.js +0 -236
- package/dist/index-Bl1Y7Sro.js +0 -3037
- package/dist/index-DlS9Lybj.js +0 -80691
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import T, { memo as ne, useState as U, useRef as g, useCallback as re, useEffect as j } from "react";
|
|
2
|
+
function ae(e, t) {
|
|
3
|
+
(t == null || t > e.length) && (t = e.length);
|
|
4
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
5
|
+
return n;
|
|
6
|
+
}
|
|
7
|
+
function Oe(e) {
|
|
8
|
+
if (Array.isArray(e)) return e;
|
|
9
|
+
}
|
|
10
|
+
function je(e, t, r) {
|
|
11
|
+
return (t = Ce(t)) in e ? Object.defineProperty(e, t, {
|
|
12
|
+
value: r,
|
|
13
|
+
enumerable: !0,
|
|
14
|
+
configurable: !0,
|
|
15
|
+
writable: !0
|
|
16
|
+
}) : e[t] = r, e;
|
|
17
|
+
}
|
|
18
|
+
function Me(e, t) {
|
|
19
|
+
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
20
|
+
if (r != null) {
|
|
21
|
+
var n, o, i, u, l = [], s = !0, d = !1;
|
|
22
|
+
try {
|
|
23
|
+
if (i = (r = r.call(e)).next, t !== 0) for (; !(s = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); s = !0) ;
|
|
24
|
+
} catch (M) {
|
|
25
|
+
d = !0, o = M;
|
|
26
|
+
} finally {
|
|
27
|
+
try {
|
|
28
|
+
if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
|
|
29
|
+
} finally {
|
|
30
|
+
if (d) throw o;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return l;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Pe() {
|
|
37
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
38
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
39
|
+
}
|
|
40
|
+
function ue(e, t) {
|
|
41
|
+
var r = Object.keys(e);
|
|
42
|
+
if (Object.getOwnPropertySymbols) {
|
|
43
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
44
|
+
t && (n = n.filter(function(o) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
46
|
+
})), r.push.apply(r, n);
|
|
47
|
+
}
|
|
48
|
+
return r;
|
|
49
|
+
}
|
|
50
|
+
function ce(e) {
|
|
51
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
52
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
53
|
+
t % 2 ? ue(Object(r), !0).forEach(function(n) {
|
|
54
|
+
je(e, n, r[n]);
|
|
55
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ue(Object(r)).forEach(function(n) {
|
|
56
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
function Se(e, t) {
|
|
62
|
+
if (e == null) return {};
|
|
63
|
+
var r, n, o = Ee(e, t);
|
|
64
|
+
if (Object.getOwnPropertySymbols) {
|
|
65
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
66
|
+
for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
67
|
+
}
|
|
68
|
+
return o;
|
|
69
|
+
}
|
|
70
|
+
function Ee(e, t) {
|
|
71
|
+
if (e == null) return {};
|
|
72
|
+
var r = {};
|
|
73
|
+
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
74
|
+
if (t.indexOf(n) !== -1) continue;
|
|
75
|
+
r[n] = e[n];
|
|
76
|
+
}
|
|
77
|
+
return r;
|
|
78
|
+
}
|
|
79
|
+
function Ie(e, t) {
|
|
80
|
+
return Oe(e) || Me(e, t) || Le(e, t) || Pe();
|
|
81
|
+
}
|
|
82
|
+
function Te(e, t) {
|
|
83
|
+
if (typeof e != "object" || !e) return e;
|
|
84
|
+
var r = e[Symbol.toPrimitive];
|
|
85
|
+
if (r !== void 0) {
|
|
86
|
+
var n = r.call(e, t);
|
|
87
|
+
if (typeof n != "object") return n;
|
|
88
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
|
+
}
|
|
90
|
+
return (t === "string" ? String : Number)(e);
|
|
91
|
+
}
|
|
92
|
+
function Ce(e) {
|
|
93
|
+
var t = Te(e, "string");
|
|
94
|
+
return typeof t == "symbol" ? t : t + "";
|
|
95
|
+
}
|
|
96
|
+
function Le(e, t) {
|
|
97
|
+
if (e) {
|
|
98
|
+
if (typeof e == "string") return ae(e, t);
|
|
99
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
100
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ae(e, t) : void 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function Ae(e, t, r) {
|
|
104
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
105
|
+
value: r,
|
|
106
|
+
enumerable: !0,
|
|
107
|
+
configurable: !0,
|
|
108
|
+
writable: !0
|
|
109
|
+
}) : e[t] = r, e;
|
|
110
|
+
}
|
|
111
|
+
function le(e, t) {
|
|
112
|
+
var r = Object.keys(e);
|
|
113
|
+
if (Object.getOwnPropertySymbols) {
|
|
114
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
115
|
+
t && (n = n.filter(function(o) {
|
|
116
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
117
|
+
})), r.push.apply(r, n);
|
|
118
|
+
}
|
|
119
|
+
return r;
|
|
120
|
+
}
|
|
121
|
+
function se(e) {
|
|
122
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
123
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
124
|
+
t % 2 ? le(Object(r), !0).forEach(function(n) {
|
|
125
|
+
Ae(e, n, r[n]);
|
|
126
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : le(Object(r)).forEach(function(n) {
|
|
127
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return e;
|
|
131
|
+
}
|
|
132
|
+
function $e() {
|
|
133
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
134
|
+
t[r] = arguments[r];
|
|
135
|
+
return function(n) {
|
|
136
|
+
return t.reduceRight(function(o, i) {
|
|
137
|
+
return i(o);
|
|
138
|
+
}, n);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function D(e) {
|
|
142
|
+
return function t() {
|
|
143
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
144
|
+
o[i] = arguments[i];
|
|
145
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
146
|
+
for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
|
|
147
|
+
l[s] = arguments[s];
|
|
148
|
+
return t.apply(r, [].concat(o, l));
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function H(e) {
|
|
153
|
+
return {}.toString.call(e).includes("Object");
|
|
154
|
+
}
|
|
155
|
+
function De(e) {
|
|
156
|
+
return !Object.keys(e).length;
|
|
157
|
+
}
|
|
158
|
+
function V(e) {
|
|
159
|
+
return typeof e == "function";
|
|
160
|
+
}
|
|
161
|
+
function Re(e, t) {
|
|
162
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
163
|
+
}
|
|
164
|
+
function Ve(e, t) {
|
|
165
|
+
return H(t) || S("changeType"), Object.keys(t).some(function(r) {
|
|
166
|
+
return !Re(e, r);
|
|
167
|
+
}) && S("changeField"), t;
|
|
168
|
+
}
|
|
169
|
+
function xe(e) {
|
|
170
|
+
V(e) || S("selectorType");
|
|
171
|
+
}
|
|
172
|
+
function Ne(e) {
|
|
173
|
+
V(e) || H(e) || S("handlerType"), H(e) && Object.values(e).some(function(t) {
|
|
174
|
+
return !V(t);
|
|
175
|
+
}) && S("handlersType");
|
|
176
|
+
}
|
|
177
|
+
function qe(e) {
|
|
178
|
+
e || S("initialIsRequired"), H(e) || S("initialType"), De(e) && S("initialContent");
|
|
179
|
+
}
|
|
180
|
+
function ze(e, t) {
|
|
181
|
+
throw new Error(e[t] || e.default);
|
|
182
|
+
}
|
|
183
|
+
var Fe = {
|
|
184
|
+
initialIsRequired: "initial state is required",
|
|
185
|
+
initialType: "initial state should be an object",
|
|
186
|
+
initialContent: "initial state shouldn't be an empty object",
|
|
187
|
+
handlerType: "handler should be an object or a function",
|
|
188
|
+
handlersType: "all handlers should be a functions",
|
|
189
|
+
selectorType: "selector should be a function",
|
|
190
|
+
changeType: "provided value of changes should be an object",
|
|
191
|
+
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
192
|
+
default: "an unknown error accured in `state-local` package"
|
|
193
|
+
}, S = D(ze)(Fe), z = {
|
|
194
|
+
changes: Ve,
|
|
195
|
+
selector: xe,
|
|
196
|
+
handler: Ne,
|
|
197
|
+
initial: qe
|
|
198
|
+
};
|
|
199
|
+
function Ue(e) {
|
|
200
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
201
|
+
z.initial(e), z.handler(t);
|
|
202
|
+
var r = {
|
|
203
|
+
current: e
|
|
204
|
+
}, n = D(_e)(r, t), o = D(We)(r), i = D(z.changes)(e), u = D(He)(r);
|
|
205
|
+
function l() {
|
|
206
|
+
var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(M) {
|
|
207
|
+
return M;
|
|
208
|
+
};
|
|
209
|
+
return z.selector(d), d(r.current);
|
|
210
|
+
}
|
|
211
|
+
function s(d) {
|
|
212
|
+
$e(n, o, i, u)(d);
|
|
213
|
+
}
|
|
214
|
+
return [l, s];
|
|
215
|
+
}
|
|
216
|
+
function He(e, t) {
|
|
217
|
+
return V(t) ? t(e.current) : t;
|
|
218
|
+
}
|
|
219
|
+
function We(e, t) {
|
|
220
|
+
return e.current = se(se({}, e.current), t), t;
|
|
221
|
+
}
|
|
222
|
+
function _e(e, t, r) {
|
|
223
|
+
return V(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
224
|
+
var o;
|
|
225
|
+
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
226
|
+
}), r;
|
|
227
|
+
}
|
|
228
|
+
var Be = {
|
|
229
|
+
create: Ue
|
|
230
|
+
}, Ke = {
|
|
231
|
+
paths: {
|
|
232
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function Ge(e) {
|
|
236
|
+
return function t() {
|
|
237
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
238
|
+
o[i] = arguments[i];
|
|
239
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
240
|
+
for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
|
|
241
|
+
l[s] = arguments[s];
|
|
242
|
+
return t.apply(r, [].concat(o, l));
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function Ye(e) {
|
|
247
|
+
return {}.toString.call(e).includes("Object");
|
|
248
|
+
}
|
|
249
|
+
function Je(e) {
|
|
250
|
+
return e || fe("configIsRequired"), Ye(e) || fe("configType"), e.urls ? (Qe(), {
|
|
251
|
+
paths: {
|
|
252
|
+
vs: e.urls.monacoBase
|
|
253
|
+
}
|
|
254
|
+
}) : e;
|
|
255
|
+
}
|
|
256
|
+
function Qe() {
|
|
257
|
+
console.warn(de.deprecation);
|
|
258
|
+
}
|
|
259
|
+
function Xe(e, t) {
|
|
260
|
+
throw new Error(e[t] || e.default);
|
|
261
|
+
}
|
|
262
|
+
var de = {
|
|
263
|
+
configIsRequired: "the configuration object is required",
|
|
264
|
+
configType: "the configuration object should be an object",
|
|
265
|
+
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
266
|
+
deprecation: `Deprecation warning!
|
|
267
|
+
You are using deprecated way of configuration.
|
|
268
|
+
|
|
269
|
+
Instead of using
|
|
270
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
271
|
+
use
|
|
272
|
+
monaco.config({ paths: { vs: '...' } })
|
|
273
|
+
|
|
274
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
275
|
+
`
|
|
276
|
+
}, fe = Ge(Xe)(de), Ze = {
|
|
277
|
+
config: Je
|
|
278
|
+
}, ke = function() {
|
|
279
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
280
|
+
r[n] = arguments[n];
|
|
281
|
+
return function(o) {
|
|
282
|
+
return r.reduceRight(function(i, u) {
|
|
283
|
+
return u(i);
|
|
284
|
+
}, o);
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
function pe(e, t) {
|
|
288
|
+
return Object.keys(t).forEach(function(r) {
|
|
289
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], pe(e[r], t[r]));
|
|
290
|
+
}), ce(ce({}, e), t);
|
|
291
|
+
}
|
|
292
|
+
var et = {
|
|
293
|
+
type: "cancelation",
|
|
294
|
+
msg: "operation is manually canceled"
|
|
295
|
+
};
|
|
296
|
+
function k(e) {
|
|
297
|
+
var t = !1, r = new Promise(function(n, o) {
|
|
298
|
+
e.then(function(i) {
|
|
299
|
+
return t ? o(et) : n(i);
|
|
300
|
+
}), e.catch(o);
|
|
301
|
+
});
|
|
302
|
+
return r.cancel = function() {
|
|
303
|
+
return t = !0;
|
|
304
|
+
}, r;
|
|
305
|
+
}
|
|
306
|
+
var tt = ["monaco"], rt = Be.create({
|
|
307
|
+
config: Ke,
|
|
308
|
+
isInitialized: !1,
|
|
309
|
+
resolve: null,
|
|
310
|
+
reject: null,
|
|
311
|
+
monaco: null
|
|
312
|
+
}), ge = Ie(rt, 2), x = ge[0], W = ge[1];
|
|
313
|
+
function nt(e) {
|
|
314
|
+
var t = Ze.config(e), r = t.monaco, n = Se(t, tt);
|
|
315
|
+
W(function(o) {
|
|
316
|
+
return {
|
|
317
|
+
config: pe(o.config, n),
|
|
318
|
+
monaco: r
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function ot() {
|
|
323
|
+
var e = x(function(t) {
|
|
324
|
+
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
325
|
+
return {
|
|
326
|
+
monaco: r,
|
|
327
|
+
isInitialized: n,
|
|
328
|
+
resolve: o
|
|
329
|
+
};
|
|
330
|
+
});
|
|
331
|
+
if (!e.isInitialized) {
|
|
332
|
+
if (W({
|
|
333
|
+
isInitialized: !0
|
|
334
|
+
}), e.monaco)
|
|
335
|
+
return e.resolve(e.monaco), k(ee);
|
|
336
|
+
if (window.monaco && window.monaco.editor)
|
|
337
|
+
return he(window.monaco), e.resolve(window.monaco), k(ee);
|
|
338
|
+
ke(it, ut)(ct);
|
|
339
|
+
}
|
|
340
|
+
return k(ee);
|
|
341
|
+
}
|
|
342
|
+
function it(e) {
|
|
343
|
+
return document.body.appendChild(e);
|
|
344
|
+
}
|
|
345
|
+
function at(e) {
|
|
346
|
+
var t = document.createElement("script");
|
|
347
|
+
return e && (t.src = e), t;
|
|
348
|
+
}
|
|
349
|
+
function ut(e) {
|
|
350
|
+
var t = x(function(n) {
|
|
351
|
+
var o = n.config, i = n.reject;
|
|
352
|
+
return {
|
|
353
|
+
config: o,
|
|
354
|
+
reject: i
|
|
355
|
+
};
|
|
356
|
+
}), r = at("".concat(t.config.paths.vs, "/loader.js"));
|
|
357
|
+
return r.onload = function() {
|
|
358
|
+
return e();
|
|
359
|
+
}, r.onerror = t.reject, r;
|
|
360
|
+
}
|
|
361
|
+
function ct() {
|
|
362
|
+
var e = x(function(r) {
|
|
363
|
+
var n = r.config, o = r.resolve, i = r.reject;
|
|
364
|
+
return {
|
|
365
|
+
config: n,
|
|
366
|
+
resolve: o,
|
|
367
|
+
reject: i
|
|
368
|
+
};
|
|
369
|
+
}), t = window.require;
|
|
370
|
+
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
371
|
+
var n = r.m || r;
|
|
372
|
+
he(n), e.resolve(n);
|
|
373
|
+
}, function(r) {
|
|
374
|
+
e.reject(r);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function he(e) {
|
|
378
|
+
x().monaco || W({
|
|
379
|
+
monaco: e
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function lt() {
|
|
383
|
+
return x(function(e) {
|
|
384
|
+
var t = e.monaco;
|
|
385
|
+
return t;
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
var ee = new Promise(function(e, t) {
|
|
389
|
+
return W({
|
|
390
|
+
resolve: e,
|
|
391
|
+
reject: t
|
|
392
|
+
});
|
|
393
|
+
}), ve = {
|
|
394
|
+
config: nt,
|
|
395
|
+
init: ot,
|
|
396
|
+
__getMonacoInstance: lt
|
|
397
|
+
}, st = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, te = st, ft = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, dt = ft;
|
|
398
|
+
function pt({ children: e }) {
|
|
399
|
+
return T.createElement("div", { style: dt.container }, e);
|
|
400
|
+
}
|
|
401
|
+
var gt = pt, ht = gt;
|
|
402
|
+
function vt({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: u }) {
|
|
403
|
+
return T.createElement("section", { style: { ...te.wrapper, width: e, height: t }, ...u }, !r && T.createElement(ht, null, n), T.createElement("div", { ref: o, style: { ...te.fullWidth, ...!r && te.hide }, className: i }));
|
|
404
|
+
}
|
|
405
|
+
var mt = vt, me = ne(mt);
|
|
406
|
+
function bt(e) {
|
|
407
|
+
j(e, []);
|
|
408
|
+
}
|
|
409
|
+
var be = bt;
|
|
410
|
+
function yt(e, t, r = !0) {
|
|
411
|
+
let n = g(!0);
|
|
412
|
+
j(n.current || !r ? () => {
|
|
413
|
+
n.current = !1;
|
|
414
|
+
} : e, t);
|
|
415
|
+
}
|
|
416
|
+
var w = yt;
|
|
417
|
+
function R() {
|
|
418
|
+
}
|
|
419
|
+
function I(e, t, r, n) {
|
|
420
|
+
return wt(e, n) || Ot(e, t, r, n);
|
|
421
|
+
}
|
|
422
|
+
function wt(e, t) {
|
|
423
|
+
return e.editor.getModel(ye(e, t));
|
|
424
|
+
}
|
|
425
|
+
function Ot(e, t, r, n) {
|
|
426
|
+
return e.editor.createModel(t, r, n ? ye(e, n) : void 0);
|
|
427
|
+
}
|
|
428
|
+
function ye(e, t) {
|
|
429
|
+
return e.Uri.parse(t);
|
|
430
|
+
}
|
|
431
|
+
function jt({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: u, keepCurrentOriginalModel: l = !1, keepCurrentModifiedModel: s = !1, theme: d = "light", loading: M = "Loading...", options: O = {}, height: _ = "100%", width: B = "100%", className: K, wrapperProps: G = {}, beforeMount: Y = R, onMount: J = R }) {
|
|
432
|
+
let [y, C] = U(!1), [L, p] = U(!0), h = g(null), f = g(null), A = g(null), m = g(J), a = g(Y), E = g(!1);
|
|
433
|
+
be(() => {
|
|
434
|
+
let c = ve.init();
|
|
435
|
+
return c.then((v) => (f.current = v) && p(!1)).catch((v) => v?.type !== "cancelation" && console.error("Monaco initialization: error:", v)), () => h.current ? $() : c.cancel();
|
|
436
|
+
}), w(() => {
|
|
437
|
+
if (h.current && f.current) {
|
|
438
|
+
let c = h.current.getOriginalEditor(), v = I(f.current, e || "", n || r || "text", i || "");
|
|
439
|
+
v !== c.getModel() && c.setModel(v);
|
|
440
|
+
}
|
|
441
|
+
}, [i], y), w(() => {
|
|
442
|
+
if (h.current && f.current) {
|
|
443
|
+
let c = h.current.getModifiedEditor(), v = I(f.current, t || "", o || r || "text", u || "");
|
|
444
|
+
v !== c.getModel() && c.setModel(v);
|
|
445
|
+
}
|
|
446
|
+
}, [u], y), w(() => {
|
|
447
|
+
let c = h.current.getModifiedEditor();
|
|
448
|
+
c.getOption(f.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
|
|
449
|
+
}, [t], y), w(() => {
|
|
450
|
+
h.current?.getModel()?.original.setValue(e || "");
|
|
451
|
+
}, [e], y), w(() => {
|
|
452
|
+
let { original: c, modified: v } = h.current.getModel();
|
|
453
|
+
f.current.editor.setModelLanguage(c, n || r || "text"), f.current.editor.setModelLanguage(v, o || r || "text");
|
|
454
|
+
}, [r, n, o], y), w(() => {
|
|
455
|
+
f.current?.editor.setTheme(d);
|
|
456
|
+
}, [d], y), w(() => {
|
|
457
|
+
h.current?.updateOptions(O);
|
|
458
|
+
}, [O], y);
|
|
459
|
+
let N = re(() => {
|
|
460
|
+
if (!f.current) return;
|
|
461
|
+
a.current(f.current);
|
|
462
|
+
let c = I(f.current, e || "", n || r || "text", i || ""), v = I(f.current, t || "", o || r || "text", u || "");
|
|
463
|
+
h.current?.setModel({ original: c, modified: v });
|
|
464
|
+
}, [r, t, o, e, n, i, u]), q = re(() => {
|
|
465
|
+
!E.current && A.current && (h.current = f.current.editor.createDiffEditor(A.current, { automaticLayout: !0, ...O }), N(), f.current?.editor.setTheme(d), C(!0), E.current = !0);
|
|
466
|
+
}, [O, d, N]);
|
|
467
|
+
j(() => {
|
|
468
|
+
y && m.current(h.current, f.current);
|
|
469
|
+
}, [y]), j(() => {
|
|
470
|
+
!L && !y && q();
|
|
471
|
+
}, [L, y, q]);
|
|
472
|
+
function $() {
|
|
473
|
+
let c = h.current?.getModel();
|
|
474
|
+
l || c?.original?.dispose(), s || c?.modified?.dispose(), h.current?.dispose();
|
|
475
|
+
}
|
|
476
|
+
return T.createElement(me, { width: B, height: _, isEditorReady: y, loading: M, _ref: A, className: K, wrapperProps: G });
|
|
477
|
+
}
|
|
478
|
+
var Mt = jt;
|
|
479
|
+
ne(Mt);
|
|
480
|
+
function Pt(e) {
|
|
481
|
+
let t = g();
|
|
482
|
+
return j(() => {
|
|
483
|
+
t.current = e;
|
|
484
|
+
}, [e]), t.current;
|
|
485
|
+
}
|
|
486
|
+
var St = Pt, F = /* @__PURE__ */ new Map();
|
|
487
|
+
function Et({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: u = "light", line: l, loading: s = "Loading...", options: d = {}, overrideServices: M = {}, saveViewState: O = !0, keepCurrentModel: _ = !1, width: B = "100%", height: K = "100%", className: G, wrapperProps: Y = {}, beforeMount: J = R, onMount: y = R, onChange: C, onValidate: L = R }) {
|
|
488
|
+
let [p, h] = U(!1), [f, A] = U(!0), m = g(null), a = g(null), E = g(null), N = g(y), q = g(J), $ = g(), c = g(n), v = St(i), oe = g(!1), Q = g(!1);
|
|
489
|
+
be(() => {
|
|
490
|
+
let b = ve.init();
|
|
491
|
+
return b.then((P) => (m.current = P) && A(!1)).catch((P) => P?.type !== "cancelation" && console.error("Monaco initialization: error:", P)), () => a.current ? we() : b.cancel();
|
|
492
|
+
}), w(() => {
|
|
493
|
+
let b = I(m.current, e || n || "", t || o || "", i || r || "");
|
|
494
|
+
b !== a.current?.getModel() && (O && F.set(v, a.current?.saveViewState()), a.current?.setModel(b), O && a.current?.restoreViewState(F.get(i)));
|
|
495
|
+
}, [i], p), w(() => {
|
|
496
|
+
a.current?.updateOptions(d);
|
|
497
|
+
}, [d], p), w(() => {
|
|
498
|
+
!a.current || n === void 0 || (a.current.getOption(m.current.editor.EditorOption.readOnly) ? a.current.setValue(n) : n !== a.current.getValue() && (Q.current = !0, a.current.executeEdits("", [{ range: a.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), a.current.pushUndoStop(), Q.current = !1));
|
|
499
|
+
}, [n], p), w(() => {
|
|
500
|
+
let b = a.current?.getModel();
|
|
501
|
+
b && o && m.current?.editor.setModelLanguage(b, o);
|
|
502
|
+
}, [o], p), w(() => {
|
|
503
|
+
l !== void 0 && a.current?.revealLine(l);
|
|
504
|
+
}, [l], p), w(() => {
|
|
505
|
+
m.current?.editor.setTheme(u);
|
|
506
|
+
}, [u], p);
|
|
507
|
+
let ie = re(() => {
|
|
508
|
+
if (!(!E.current || !m.current) && !oe.current) {
|
|
509
|
+
q.current(m.current);
|
|
510
|
+
let b = i || r, P = I(m.current, n || e || "", t || o || "", b || "");
|
|
511
|
+
a.current = m.current?.editor.create(E.current, { model: P, automaticLayout: !0, ...d }, M), O && a.current.restoreViewState(F.get(b)), m.current.editor.setTheme(u), l !== void 0 && a.current.revealLine(l), h(!0), oe.current = !0;
|
|
512
|
+
}
|
|
513
|
+
}, [e, t, r, n, o, i, d, M, O, u, l]);
|
|
514
|
+
j(() => {
|
|
515
|
+
p && N.current(a.current, m.current);
|
|
516
|
+
}, [p]), j(() => {
|
|
517
|
+
!f && !p && ie();
|
|
518
|
+
}, [f, p, ie]), c.current = n, j(() => {
|
|
519
|
+
p && C && ($.current?.dispose(), $.current = a.current?.onDidChangeModelContent((b) => {
|
|
520
|
+
Q.current || C(a.current.getValue(), b);
|
|
521
|
+
}));
|
|
522
|
+
}, [p, C]), j(() => {
|
|
523
|
+
if (p) {
|
|
524
|
+
let b = m.current.editor.onDidChangeMarkers((P) => {
|
|
525
|
+
let X = a.current.getModel()?.uri;
|
|
526
|
+
if (X && P.find((Z) => Z.path === X.path)) {
|
|
527
|
+
let Z = m.current.editor.getModelMarkers({ resource: X });
|
|
528
|
+
L?.(Z);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
return () => {
|
|
532
|
+
b?.dispose();
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
return () => {
|
|
536
|
+
};
|
|
537
|
+
}, [p, L]);
|
|
538
|
+
function we() {
|
|
539
|
+
$.current?.dispose(), _ ? O && F.set(i, a.current.saveViewState()) : a.current.getModel()?.dispose(), a.current.dispose();
|
|
540
|
+
}
|
|
541
|
+
return T.createElement(me, { width: B, height: K, isEditorReady: p, loading: s, _ref: E, className: G, wrapperProps: Y });
|
|
542
|
+
}
|
|
543
|
+
var It = Et, Tt = ne(It), Lt = Tt;
|
|
544
|
+
export {
|
|
545
|
+
Lt as F
|
|
546
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as s, jsxs as T, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { c as $ } from "react/compiler-runtime";
|
|
3
|
+
import z from "react";
|
|
4
|
+
import { useParams as H } from "react-router-dom";
|
|
5
|
+
import { Box as J, Skeleton as Q, Alert as B } from "@wso2/oxygen-ui";
|
|
6
|
+
import { Rocket as U, ShieldCheck as V } from "@wso2/oxygen-ui-icons-react";
|
|
7
|
+
import { i as W, c as ee, X as te, Y as ne, Z as oe, P as F, N as ae } from "./index-B_Z0MwXk.js";
|
|
8
|
+
import "@tanstack/react-query";
|
|
9
|
+
import { E as G } from "./EnvironmentSelector-B7Bl93s2.js";
|
|
10
|
+
import { A as se } from "./APIKeysManager-C0phJriD.js";
|
|
11
|
+
const M = () => {
|
|
12
|
+
const e = $(38), {
|
|
13
|
+
orgId: t,
|
|
14
|
+
projectId: n,
|
|
15
|
+
agentId: o,
|
|
16
|
+
envId: a
|
|
17
|
+
} = H();
|
|
18
|
+
let l;
|
|
19
|
+
e[0] !== o || e[1] !== t || e[2] !== n ? (l = {
|
|
20
|
+
orgName: t,
|
|
21
|
+
projName: n,
|
|
22
|
+
agentName: o
|
|
23
|
+
}, e[0] = o, e[1] = t, e[2] = n, e[3] = l) : l = e[3];
|
|
24
|
+
const {
|
|
25
|
+
data: O,
|
|
26
|
+
isLoading: j
|
|
27
|
+
} = W(l);
|
|
28
|
+
let m;
|
|
29
|
+
e[4] !== o || e[5] !== t || e[6] !== n ? (m = {
|
|
30
|
+
orgName: t,
|
|
31
|
+
projName: n,
|
|
32
|
+
agentName: o
|
|
33
|
+
}, e[4] = o, e[5] = t, e[6] = n, e[7] = m) : m = e[7];
|
|
34
|
+
const {
|
|
35
|
+
data: Y,
|
|
36
|
+
isLoading: _
|
|
37
|
+
} = ee(m), d = O?.configurations?.enableApiKeySecurity ?? !0, x = (a ? Y?.[a] : void 0)?.status === "active", c = !j && !_ && x && d && !!a, A = c ? t : void 0, v = c ? n : void 0, I = c ? o : void 0, b = c ? a : void 0;
|
|
38
|
+
let y;
|
|
39
|
+
e[8] !== A || e[9] !== v || e[10] !== I || e[11] !== b ? (y = {
|
|
40
|
+
orgName: A,
|
|
41
|
+
projName: v,
|
|
42
|
+
agentName: I,
|
|
43
|
+
envId: b
|
|
44
|
+
}, e[8] = A, e[9] = v, e[10] = I, e[11] = b, e[12] = y) : y = e[12];
|
|
45
|
+
const {
|
|
46
|
+
data: N,
|
|
47
|
+
isLoading: q,
|
|
48
|
+
isError: k
|
|
49
|
+
} = te(y), g = j || _ || c && q, {
|
|
50
|
+
mutateAsync: P,
|
|
51
|
+
isPending: K
|
|
52
|
+
} = ne(), {
|
|
53
|
+
mutate: L,
|
|
54
|
+
isPending: w
|
|
55
|
+
} = oe(), [S, R] = z.useState(!1);
|
|
56
|
+
let p;
|
|
57
|
+
e[13] !== o || e[14] !== P || e[15] !== a || e[16] !== t || e[17] !== n ? (p = async (i) => {
|
|
58
|
+
const {
|
|
59
|
+
displayName: r,
|
|
60
|
+
expiresAt: X
|
|
61
|
+
} = i, E = await P({
|
|
62
|
+
params: {
|
|
63
|
+
orgName: t,
|
|
64
|
+
projName: n,
|
|
65
|
+
agentName: o,
|
|
66
|
+
envId: a
|
|
67
|
+
},
|
|
68
|
+
body: {
|
|
69
|
+
displayName: r,
|
|
70
|
+
expiresAt: X
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return R(E.gatewayConnected === !1), E.apiKey;
|
|
74
|
+
}, e[13] = o, e[14] = P, e[15] = a, e[16] = t, e[17] = n, e[18] = p) : p = e[18];
|
|
75
|
+
const C = p;
|
|
76
|
+
let u;
|
|
77
|
+
e[19] !== o || e[20] !== a || e[21] !== t || e[22] !== n || e[23] !== L ? (u = (i) => {
|
|
78
|
+
L({
|
|
79
|
+
orgName: t,
|
|
80
|
+
projName: n,
|
|
81
|
+
agentName: o,
|
|
82
|
+
envId: a,
|
|
83
|
+
keyName: i
|
|
84
|
+
});
|
|
85
|
+
}, e[19] = o, e[20] = a, e[21] = t, e[22] = n, e[23] = L, e[24] = u) : u = e[24];
|
|
86
|
+
const D = u;
|
|
87
|
+
if (!g && !x) {
|
|
88
|
+
let i;
|
|
89
|
+
e[25] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ s(G, {}), e[25] = i) : i = e[25];
|
|
90
|
+
let r;
|
|
91
|
+
return e[26] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ s(F, { title: "API Keys", disableIcon: !0, actions: i, children: /* @__PURE__ */ s(J, { height: "50vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ s(ae, { iconElement: U, disableBackground: !0, message: "Agent is not deployed", subtitle: "Deploy your agent to manage API keys. You can deploy your agent by clicking the deploy button in the deploy tab." }) }) }), e[26] = r) : r = e[26], r;
|
|
92
|
+
}
|
|
93
|
+
let f;
|
|
94
|
+
e[27] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ s(G, {}), e[27] = f) : f = e[27];
|
|
95
|
+
let h;
|
|
96
|
+
return e[28] !== S || e[29] !== C || e[30] !== D || e[31] !== K || e[32] !== k || e[33] !== g || e[34] !== w || e[35] !== N || e[36] !== d ? (h = /* @__PURE__ */ s(F, { title: "API Keys", disableIcon: !0, actions: f, children: g ? /* @__PURE__ */ s(Q, { variant: "rectangular", width: "100%", height: 200 }) : d ? /* @__PURE__ */ T(Z, { children: [
|
|
97
|
+
S && /* @__PURE__ */ s(B, { severity: "warning", onClose: () => R(!1), sx: {
|
|
98
|
+
mb: 2
|
|
99
|
+
}, children: "The gateway is not connected to the control plane right now. The API key has been stored but will only work once the gateway reconnects." }),
|
|
100
|
+
/* @__PURE__ */ s(se, { keys: N, isLoading: !1, isError: k, isCreating: K, isRevoking: w, emptyDescription: "Create an API key to authenticate requests to this agent.", onCreate: C, onRevoke: D })
|
|
101
|
+
] }) : /* @__PURE__ */ T(B, { severity: "info", children: [
|
|
102
|
+
"API Key Security is disabled for this agent. To manage API keys, enable it from the ",
|
|
103
|
+
/* @__PURE__ */ s("strong", { children: "Deployment" }),
|
|
104
|
+
" settings and redeploy."
|
|
105
|
+
] }) }), e[28] = S, e[29] = C, e[30] = D, e[31] = K, e[32] = k, e[33] = g, e[34] = w, e[35] = N, e[36] = d, e[37] = h) : h = e[37], h;
|
|
106
|
+
}, he = {
|
|
107
|
+
title: "Security",
|
|
108
|
+
description: "Manage API keys for agent endpoint authentication",
|
|
109
|
+
icon: V,
|
|
110
|
+
path: "/security",
|
|
111
|
+
component: M,
|
|
112
|
+
levels: {
|
|
113
|
+
component: M
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
M as SecurityComponent,
|
|
118
|
+
he as metaData
|
|
119
|
+
};
|