@kong-ui-public/entities-consumer-credentials 2.1.17 → 2.1.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as v, computed as N, watch as se, renderSlot as Y, createCommentVNode as G, unref as m, resolveComponent as
|
|
1
|
+
import { defineComponent as ie, ref as v, computed as N, watch as se, renderSlot as Y, createCommentVNode as G, unref as m, resolveComponent as D, openBlock as j, createBlock as W, withCtx as s, createVNode as g, createSlots as Te, withDirectives as Ae, createElementVNode as ee, createElementBlock as V, vShow as Ne, renderList as Ie, createTextVNode as U, toDisplayString as x, onMounted as Re, onUnmounted as qe, onBeforeMount as Be, Teleport as ze, Fragment as We, withModifiers as He } from "vue";
|
|
2
2
|
import { createI18n as xe, i18nTComponent as Ee } from "@kong-ui-public/i18n";
|
|
3
3
|
import Je from "axios";
|
|
4
4
|
import "@kong/kongponents";
|
|
@@ -336,7 +336,7 @@ function je() {
|
|
|
336
336
|
return !1;
|
|
337
337
|
const n = /* @__PURE__ */ new Set([...t, ...a]);
|
|
338
338
|
for (const i of n) {
|
|
339
|
-
const l = t.filter((
|
|
339
|
+
const l = t.filter((c) => c === i).length, o = a.filter((c) => c === i).length;
|
|
340
340
|
if (l !== o)
|
|
341
341
|
return !1;
|
|
342
342
|
}
|
|
@@ -383,25 +383,25 @@ function pt(e, r, t, a = {
|
|
|
383
383
|
headers: e.requestHeaders
|
|
384
384
|
}), { i18n: { t: i } } = pe(), { debounce: l } = Xe(), o = l(async (w) => {
|
|
385
385
|
await ae(w);
|
|
386
|
-
}, 200),
|
|
386
|
+
}, 200), c = v(!1), p = v(""), b = v(""), y = v([]), T = v([]), _ = v(void 0), L = m(r);
|
|
387
387
|
let f = `${e.apiBaseUrl}${L}`;
|
|
388
388
|
e.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (f = f.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : ""));
|
|
389
|
-
const { isValidUuid: A } = je(),
|
|
389
|
+
const { isValidUuid: A } = je(), P = async () => {
|
|
390
390
|
try {
|
|
391
|
-
|
|
391
|
+
c.value = !0;
|
|
392
392
|
const { data: w } = await n.get(`${f}?size=${t}`);
|
|
393
393
|
w != null && w.next || (_.value = a.fetchedItemsKey in w ? w[a.fetchedItemsKey] : []), T.value = a.fetchedItemsKey in w ? w[a.fetchedItemsKey] : [], y.value = T.value;
|
|
394
394
|
} catch {
|
|
395
395
|
y.value = [], p.value = i("debouncedFilter.errors.fetch");
|
|
396
396
|
} finally {
|
|
397
|
-
|
|
397
|
+
c.value = !1;
|
|
398
398
|
}
|
|
399
399
|
}, Z = v(""), ae = async (w) => {
|
|
400
|
-
var
|
|
400
|
+
var u, k, B;
|
|
401
401
|
if (Z.value !== w)
|
|
402
402
|
if (Z.value = w || "", _.value === void 0)
|
|
403
403
|
try {
|
|
404
|
-
if (
|
|
404
|
+
if (c.value = !0, p.value = "", b.value = "", e.app === "konnect") {
|
|
405
405
|
let E = f + "";
|
|
406
406
|
w && (E += `/${w}`);
|
|
407
407
|
const { data: K } = await n.get(`${E}?size=${t}`);
|
|
@@ -417,11 +417,11 @@ function pt(e, r, t, a = {
|
|
|
417
417
|
return O[a.fetchedItemsKey];
|
|
418
418
|
})
|
|
419
419
|
);
|
|
420
|
-
const K = await Promise.all(E),
|
|
421
|
-
y.value = [], (
|
|
420
|
+
const K = await Promise.all(E), z = /* @__PURE__ */ new Set();
|
|
421
|
+
y.value = [], (u = K == null ? void 0 : K.forEach) == null || u.call(K, (I) => {
|
|
422
422
|
var O;
|
|
423
423
|
(O = I == null ? void 0 : I.forEach) == null || O.call(I, (R) => {
|
|
424
|
-
|
|
424
|
+
z.has(R.id) || (z.add(R.id), y.value.push(R));
|
|
425
425
|
});
|
|
426
426
|
});
|
|
427
427
|
} else
|
|
@@ -429,26 +429,26 @@ function pt(e, r, t, a = {
|
|
|
429
429
|
} catch (E) {
|
|
430
430
|
((k = E == null ? void 0 : E.response) == null ? void 0 : k.status) === 404 ? b.value = i("debouncedFilter.errors.invalid") : (y.value = [], p.value = i("debouncedFilter.errors.fetch"));
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
c.value = !1;
|
|
433
433
|
}
|
|
434
434
|
else
|
|
435
|
-
|
|
435
|
+
c.value = !0, b.value = "", w ? (y.value = (B = _.value) == null ? void 0 : B.filter((E) => {
|
|
436
436
|
var K;
|
|
437
|
-
let
|
|
437
|
+
let z = !1;
|
|
438
438
|
for (const I of a.searchKeys) {
|
|
439
439
|
const O = typeof E[I] == "string" ? (K = E[I]) == null ? void 0 : K.toLowerCase() : E[I];
|
|
440
|
-
O != null && O.includes(w.toLowerCase()) && (
|
|
440
|
+
O != null && O.includes(w.toLowerCase()) && (z = !0);
|
|
441
441
|
}
|
|
442
|
-
return
|
|
443
|
-
}), (!y.value || !y.value.length) && (b.value = i("debouncedFilter.errors.invalid"))) : y.value = _.value,
|
|
442
|
+
return z;
|
|
443
|
+
}), (!y.value || !y.value.length) && (b.value = i("debouncedFilter.errors.invalid"))) : y.value = _.value, c.value = !1;
|
|
444
444
|
};
|
|
445
445
|
return {
|
|
446
|
-
loading:
|
|
446
|
+
loading: c,
|
|
447
447
|
error: p,
|
|
448
448
|
validationError: b,
|
|
449
449
|
results: y,
|
|
450
450
|
allRecords: _,
|
|
451
|
-
loadItems:
|
|
451
|
+
loadItems: P,
|
|
452
452
|
debouncedQueryChange: o
|
|
453
453
|
};
|
|
454
454
|
}
|
|
@@ -504,12 +504,12 @@ function Ke(e, r) {
|
|
|
504
504
|
() => a.value.startsWith("/") ? new URL(`${window.location.origin}${a.value}`) : new URL(a.value)
|
|
505
505
|
);
|
|
506
506
|
return (l) => {
|
|
507
|
-
const { page: o, pageSize:
|
|
507
|
+
const { page: o, pageSize: c, offset: p, sortColumnKey: b, sortColumnOrder: y, query: T } = l;
|
|
508
508
|
try {
|
|
509
509
|
let _ = new URL(i.value.href);
|
|
510
510
|
return n.value && T ? (_.search = "", _ = t.value.app === "konnect" ? new URL(`${_.href}?filter[name][contains]=${T}`) : new URL(`${_.href}/${T}/`)) : (n.value || new URLSearchParams(T).forEach((L, f) => {
|
|
511
511
|
_.searchParams.append(f, L);
|
|
512
|
-
}), b && _.searchParams.append("sort_by", b), y === "desc" && _.searchParams.append("sort_desc", "1"), _.searchParams.append("size", String(
|
|
512
|
+
}), b && _.searchParams.append("sort_by", b), y === "desc" && _.searchParams.append("sort_desc", "1"), _.searchParams.append("size", String(c))), p && o !== 1 && _.searchParams.append("offset", String(p)), _.href;
|
|
513
513
|
} catch (_) {
|
|
514
514
|
return console.error("RouteList(fetcher)", _), a.value;
|
|
515
515
|
}
|
|
@@ -524,7 +524,9 @@ function gt(e, r, t = "data") {
|
|
|
524
524
|
return { fetcher: async (o) => {
|
|
525
525
|
try {
|
|
526
526
|
l.value = { status: Q.Loading };
|
|
527
|
-
|
|
527
|
+
let c = i(o);
|
|
528
|
+
c.includes("filter[name]") && (c = `${c}&page[size]=${o.pageSize}&page[number]=${o.page}`);
|
|
529
|
+
const { data: p } = await n.get(c), b = t && t.replace(/[^\w-_]/gi, "");
|
|
528
530
|
let y;
|
|
529
531
|
p[b] && Array.isArray(p[b]) ? y = p[b] : Array.isArray(p) ? y = p : y = Object.keys(p).length ? [p] : [];
|
|
530
532
|
const T = {
|
|
@@ -540,19 +542,19 @@ function gt(e, r, t = "data") {
|
|
|
540
542
|
status: Q.Idle,
|
|
541
543
|
response: T
|
|
542
544
|
}, T;
|
|
543
|
-
} catch (
|
|
545
|
+
} catch (c) {
|
|
544
546
|
const p = {
|
|
545
547
|
data: [],
|
|
546
548
|
total: 0
|
|
547
549
|
};
|
|
548
|
-
return o.query &&
|
|
550
|
+
return o.query && c.response.status === 404 ? (l.value = {
|
|
549
551
|
status: Q.NoResults,
|
|
550
552
|
response: p,
|
|
551
|
-
error:
|
|
553
|
+
error: c
|
|
552
554
|
}, p) : (l.value = {
|
|
553
555
|
status: Q.Error,
|
|
554
556
|
response: p,
|
|
555
|
-
error:
|
|
557
|
+
error: c
|
|
556
558
|
}, p);
|
|
557
559
|
}
|
|
558
560
|
}, fetcherState: l };
|
|
@@ -592,15 +594,15 @@ const $e = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
|
|
|
592
594
|
}, ke = (e, r, t) => {
|
|
593
595
|
kt(t);
|
|
594
596
|
const a = wt(e, r);
|
|
595
|
-
return
|
|
596
|
-
},
|
|
597
|
+
return Fe[t].includes(a);
|
|
598
|
+
}, Fe = {
|
|
597
599
|
">": [1],
|
|
598
600
|
">=": [0, 1],
|
|
599
601
|
"=": [0],
|
|
600
602
|
"<=": [-1, 0],
|
|
601
603
|
"<": [-1],
|
|
602
604
|
"!=": [-1, 1]
|
|
603
|
-
}, Ce = Object.keys(
|
|
605
|
+
}, Ce = Object.keys(Fe), kt = (e) => {
|
|
604
606
|
if (typeof e != "string")
|
|
605
607
|
throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
|
|
606
608
|
if (Ce.indexOf(e) === -1)
|
|
@@ -647,14 +649,14 @@ const fe = {
|
|
|
647
649
|
return t;
|
|
648
650
|
}, Tt = "#3a3f51";
|
|
649
651
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
650
|
-
function
|
|
652
|
+
function Pe(e) {
|
|
651
653
|
return typeof e > "u" || e === null;
|
|
652
654
|
}
|
|
653
655
|
function At(e) {
|
|
654
656
|
return typeof e == "object" && e !== null;
|
|
655
657
|
}
|
|
656
658
|
function Nt(e) {
|
|
657
|
-
return Array.isArray(e) ? e :
|
|
659
|
+
return Array.isArray(e) ? e : Pe(e) ? [] : [e];
|
|
658
660
|
}
|
|
659
661
|
function It(e, r) {
|
|
660
662
|
var t, a, n, i;
|
|
@@ -672,29 +674,29 @@ function xt(e, r) {
|
|
|
672
674
|
function Et(e) {
|
|
673
675
|
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
674
676
|
}
|
|
675
|
-
var Ot =
|
|
677
|
+
var Ot = Pe, jt = At, Kt = Nt, $t = xt, Ft = Et, Pt = It, he = {
|
|
676
678
|
isNothing: Ot,
|
|
677
679
|
isObject: jt,
|
|
678
680
|
toArray: Kt,
|
|
679
681
|
repeat: $t,
|
|
680
|
-
isNegativeZero:
|
|
681
|
-
extend:
|
|
682
|
+
isNegativeZero: Ft,
|
|
683
|
+
extend: Pt
|
|
682
684
|
};
|
|
683
|
-
function
|
|
685
|
+
function De(e, r) {
|
|
684
686
|
var t = "", a = e.reason || "(unknown reason)";
|
|
685
687
|
return e.mark ? (e.mark.name && (t += 'in "' + e.mark.name + '" '), t += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !r && e.mark.snippet && (t += `
|
|
686
688
|
|
|
687
689
|
` + e.mark.snippet), a + " " + t) : a;
|
|
688
690
|
}
|
|
689
691
|
function ne(e, r) {
|
|
690
|
-
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = r, this.message =
|
|
692
|
+
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = r, this.message = De(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
691
693
|
}
|
|
692
694
|
ne.prototype = Object.create(Error.prototype);
|
|
693
695
|
ne.prototype.constructor = ne;
|
|
694
696
|
ne.prototype.toString = function(e) {
|
|
695
|
-
return this.name + ": " +
|
|
697
|
+
return this.name + ": " + De(this, e);
|
|
696
698
|
};
|
|
697
|
-
var X = ne,
|
|
699
|
+
var X = ne, Dt = [
|
|
698
700
|
"kind",
|
|
699
701
|
"multi",
|
|
700
702
|
"resolve",
|
|
@@ -720,7 +722,7 @@ function Ut(e) {
|
|
|
720
722
|
}
|
|
721
723
|
function Lt(e, r) {
|
|
722
724
|
if (r = r || {}, Object.keys(r).forEach(function(t) {
|
|
723
|
-
if (
|
|
725
|
+
if (Dt.indexOf(t) === -1)
|
|
724
726
|
throw new X('Unknown option "' + t + '" is met in definition of "' + e + '" YAML type.');
|
|
725
727
|
}), this.options = r, this.tag = e, this.kind = r.kind || null, this.resolve = r.resolve || function() {
|
|
726
728
|
return !0;
|
|
@@ -791,12 +793,12 @@ var qt = ue, Bt = new $("tag:yaml.org,2002:str", {
|
|
|
791
793
|
construct: function(e) {
|
|
792
794
|
return e !== null ? e : "";
|
|
793
795
|
}
|
|
794
|
-
}),
|
|
796
|
+
}), zt = new $("tag:yaml.org,2002:seq", {
|
|
795
797
|
kind: "sequence",
|
|
796
798
|
construct: function(e) {
|
|
797
799
|
return e !== null ? e : [];
|
|
798
800
|
}
|
|
799
|
-
}),
|
|
801
|
+
}), Wt = new $("tag:yaml.org,2002:map", {
|
|
800
802
|
kind: "mapping",
|
|
801
803
|
construct: function(e) {
|
|
802
804
|
return e !== null ? e : {};
|
|
@@ -804,8 +806,8 @@ var qt = ue, Bt = new $("tag:yaml.org,2002:str", {
|
|
|
804
806
|
}), Ht = new qt({
|
|
805
807
|
explicit: [
|
|
806
808
|
Bt,
|
|
807
|
-
|
|
808
|
-
|
|
809
|
+
zt,
|
|
810
|
+
Wt
|
|
809
811
|
]
|
|
810
812
|
});
|
|
811
813
|
function Jt(e) {
|
|
@@ -1047,17 +1049,17 @@ function mr(e) {
|
|
|
1047
1049
|
return e === null ? !1 : Me.exec(e) !== null || Ue.exec(e) !== null;
|
|
1048
1050
|
}
|
|
1049
1051
|
function vr(e) {
|
|
1050
|
-
var r, t, a, n, i, l, o,
|
|
1052
|
+
var r, t, a, n, i, l, o, c = 0, p = null, b, y, T;
|
|
1051
1053
|
if (r = Me.exec(e), r === null && (r = Ue.exec(e)), r === null)
|
|
1052
1054
|
throw new Error("Date resolve error");
|
|
1053
1055
|
if (t = +r[1], a = +r[2] - 1, n = +r[3], !r[4])
|
|
1054
1056
|
return new Date(Date.UTC(t, a, n));
|
|
1055
1057
|
if (i = +r[4], l = +r[5], o = +r[6], r[7]) {
|
|
1056
|
-
for (
|
|
1057
|
-
|
|
1058
|
-
|
|
1058
|
+
for (c = r[7].slice(0, 3); c.length < 3; )
|
|
1059
|
+
c += "0";
|
|
1060
|
+
c = +c;
|
|
1059
1061
|
}
|
|
1060
|
-
return r[9] && (b = +r[10], y = +(r[11] || 0), p = (b * 60 + y) * 6e4, r[9] === "-" && (p = -p)), T = new Date(Date.UTC(t, a, n, i, l, o,
|
|
1062
|
+
return r[9] && (b = +r[10], y = +(r[11] || 0), p = (b * 60 + y) * 6e4, r[9] === "-" && (p = -p)), T = new Date(Date.UTC(t, a, n, i, l, o, c)), p && T.setTime(T.getTime() - p), T;
|
|
1061
1063
|
}
|
|
1062
1064
|
function br(e) {
|
|
1063
1065
|
return e.toISOString();
|
|
@@ -1152,7 +1154,7 @@ function $r(e) {
|
|
|
1152
1154
|
}
|
|
1153
1155
|
return !0;
|
|
1154
1156
|
}
|
|
1155
|
-
function
|
|
1157
|
+
function Fr(e) {
|
|
1156
1158
|
if (e === null)
|
|
1157
1159
|
return [];
|
|
1158
1160
|
var r, t, a, n, i, l = e;
|
|
@@ -1160,17 +1162,17 @@ function Pr(e) {
|
|
|
1160
1162
|
a = l[r], n = Object.keys(a), i[r] = [n[0], a[n[0]]];
|
|
1161
1163
|
return i;
|
|
1162
1164
|
}
|
|
1163
|
-
var
|
|
1165
|
+
var Pr = new $("tag:yaml.org,2002:pairs", {
|
|
1164
1166
|
kind: "sequence",
|
|
1165
1167
|
resolve: $r,
|
|
1166
|
-
construct:
|
|
1167
|
-
}),
|
|
1168
|
+
construct: Fr
|
|
1169
|
+
}), Dr = Object.prototype.hasOwnProperty;
|
|
1168
1170
|
function Mr(e) {
|
|
1169
1171
|
if (e === null)
|
|
1170
1172
|
return !0;
|
|
1171
1173
|
var r, t = e;
|
|
1172
1174
|
for (r in t)
|
|
1173
|
-
if (
|
|
1175
|
+
if (Dr.call(t, r) && t[r] !== null)
|
|
1174
1176
|
return !1;
|
|
1175
1177
|
return !0;
|
|
1176
1178
|
}
|
|
@@ -1190,7 +1192,7 @@ gr.extend({
|
|
|
1190
1192
|
explicit: [
|
|
1191
1193
|
Nr,
|
|
1192
1194
|
jr,
|
|
1193
|
-
|
|
1195
|
+
Pr,
|
|
1194
1196
|
Lr
|
|
1195
1197
|
]
|
|
1196
1198
|
});
|
|
@@ -1204,7 +1206,7 @@ for (var re = 0; re < 256; re++)
|
|
|
1204
1206
|
const Br = {
|
|
1205
1207
|
key: 0,
|
|
1206
1208
|
"data-testid": "first-col"
|
|
1207
|
-
},
|
|
1209
|
+
}, zr = /* @__PURE__ */ ie({
|
|
1208
1210
|
__name: "EntityBaseTableCell",
|
|
1209
1211
|
props: {
|
|
1210
1212
|
keyName: {
|
|
@@ -1225,16 +1227,16 @@ const Br = {
|
|
|
1225
1227
|
return ((f = t.value) == null ? void 0 : f.querySelector('[data-testid="first-col"]')) || null;
|
|
1226
1228
|
}), n = N(() => {
|
|
1227
1229
|
var f, A;
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
1230
|
+
const P = (f = r.rowEl) == null ? void 0 : f.querySelectorAll("td");
|
|
1231
|
+
return P ? ((A = P[0]) == null ? void 0 : A.getAttribute("data-testid")) === r.keyName : !1;
|
|
1230
1232
|
});
|
|
1231
1233
|
let i;
|
|
1232
1234
|
const l = () => {
|
|
1233
1235
|
i && (i.disconnect(), i = void 0);
|
|
1234
1236
|
}, o = () => {
|
|
1235
|
-
var f, A,
|
|
1236
|
-
p.value = ((f = a.value) == null ? void 0 : f.getBoundingClientRect().width) || 0, b.value = ((A = t.value) == null ? void 0 : A.clientWidth) || 0, y.value = ((
|
|
1237
|
-
},
|
|
1237
|
+
var f, A, P;
|
|
1238
|
+
p.value = ((f = a.value) == null ? void 0 : f.getBoundingClientRect().width) || 0, b.value = ((A = t.value) == null ? void 0 : A.clientWidth) || 0, y.value = ((P = c.value) == null ? void 0 : P.innerText) || "";
|
|
1239
|
+
}, c = v({}), p = v(0), b = v(0), y = v(""), T = N(() => [a.value, t.value]), _ = se(
|
|
1238
1240
|
T,
|
|
1239
1241
|
(f) => {
|
|
1240
1242
|
if (n.value && (l(), "ResizeObserver" in window && window)) {
|
|
@@ -1254,14 +1256,14 @@ const Br = {
|
|
|
1254
1256
|
}), qe(() => {
|
|
1255
1257
|
_();
|
|
1256
1258
|
}), (f, A) => {
|
|
1257
|
-
const
|
|
1259
|
+
const P = D("KTooltip");
|
|
1258
1260
|
return j(), V("span", {
|
|
1259
1261
|
ref_key: "contentRef",
|
|
1260
|
-
ref:
|
|
1262
|
+
ref: c,
|
|
1261
1263
|
class: "content-wrapper"
|
|
1262
1264
|
}, [
|
|
1263
1265
|
n.value ? (j(), V("span", Br, [
|
|
1264
|
-
g(
|
|
1266
|
+
g(P, {
|
|
1265
1267
|
label: L.value ? y.value : "",
|
|
1266
1268
|
"max-width": "300",
|
|
1267
1269
|
placement: "bottomStart"
|
|
@@ -1275,7 +1277,7 @@ const Br = {
|
|
|
1275
1277
|
], 512);
|
|
1276
1278
|
};
|
|
1277
1279
|
}
|
|
1278
|
-
}),
|
|
1280
|
+
}), Wr = /* @__PURE__ */ ye(zr, [["__scopeId", "data-v-e42a20c9"]]), Hr = { class: "toolbar-container" }, Jr = {
|
|
1279
1281
|
key: 0,
|
|
1280
1282
|
class: "toolbar-button-container"
|
|
1281
1283
|
}, Yr = ["data-testid"], Gr = /* @__PURE__ */ ie({
|
|
@@ -1389,42 +1391,42 @@ const Br = {
|
|
|
1389
1391
|
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
|
|
1390
1392
|
setup(e, { emit: r }) {
|
|
1391
1393
|
const t = e, a = r, { i18n: { t: n } } = fe.useI18n(), i = N(() => {
|
|
1392
|
-
var
|
|
1394
|
+
var u, k;
|
|
1393
1395
|
return typeof t.errorMessage == "string" ? {
|
|
1394
1396
|
hasError: !!t.errorMessage,
|
|
1395
1397
|
title: t.errorMessage,
|
|
1396
1398
|
message: void 0
|
|
1397
1399
|
} : {
|
|
1398
1400
|
hasError: !!t.errorMessage,
|
|
1399
|
-
title: (
|
|
1401
|
+
title: (u = t.errorMessage) == null ? void 0 : u.title,
|
|
1400
1402
|
message: (k = t.errorMessage) == null ? void 0 : k.message
|
|
1401
1403
|
};
|
|
1402
|
-
}), l = N(() => t.cacheIdentifier || t.preferencesStorageKey), o = (
|
|
1403
|
-
const
|
|
1404
|
+
}), l = N(() => t.cacheIdentifier || t.preferencesStorageKey), o = (u) => u.hasData || !!t.query, c = N(() => {
|
|
1405
|
+
const u = [];
|
|
1404
1406
|
return Object.keys(t.tableHeaders).forEach((k) => {
|
|
1405
1407
|
const B = t.tableHeaders[k];
|
|
1406
|
-
|
|
1408
|
+
u.push({
|
|
1407
1409
|
label: B.label ?? k,
|
|
1408
1410
|
key: k,
|
|
1409
1411
|
sortable: B.sortable ?? !1
|
|
1410
1412
|
});
|
|
1411
|
-
}), t.enableEntityActions &&
|
|
1413
|
+
}), t.enableEntityActions && u.push({
|
|
1412
1414
|
key: "actions",
|
|
1413
1415
|
hideLabel: !0
|
|
1414
|
-
}),
|
|
1415
|
-
}), p = (
|
|
1416
|
-
"data-rowid":
|
|
1417
|
-
"data-testid":
|
|
1418
|
-
...t.rowAttributes(
|
|
1419
|
-
}), b = v({}), y = (
|
|
1416
|
+
}), u;
|
|
1417
|
+
}), p = (u) => ({
|
|
1418
|
+
"data-rowid": u.id,
|
|
1419
|
+
"data-testid": u.name,
|
|
1420
|
+
...t.rowAttributes(u)
|
|
1421
|
+
}), b = v({}), y = (u) => {
|
|
1420
1422
|
var k;
|
|
1421
|
-
return (k = b.value) == null ? void 0 : k.$el.querySelector(`[data-rowid="${
|
|
1422
|
-
}, T = (
|
|
1423
|
+
return (k = b.value) == null ? void 0 : k.$el.querySelector(`[data-rowid="${u.id}"]`);
|
|
1424
|
+
}, T = (u) => {
|
|
1423
1425
|
const k = {
|
|
1424
|
-
"data-testid":
|
|
1425
|
-
...t.cellAttributes(
|
|
1426
|
+
"data-testid": u.headerKey,
|
|
1427
|
+
...t.cellAttributes(u)
|
|
1426
1428
|
};
|
|
1427
|
-
return
|
|
1429
|
+
return u.colIndex === 0 && (k.style = {
|
|
1428
1430
|
maxWidth: "250px",
|
|
1429
1431
|
overflowX: "hidden",
|
|
1430
1432
|
textOverflow: "ellipsis"
|
|
@@ -1433,27 +1435,27 @@ const Br = {
|
|
|
1433
1435
|
a("empty-state-cta-clicked"), L();
|
|
1434
1436
|
}, L = () => {
|
|
1435
1437
|
a("clear-search-input");
|
|
1436
|
-
}, f = N(() => t.disableRowClick ? void 0 : (
|
|
1438
|
+
}, f = N(() => t.disableRowClick ? void 0 : (u, k) => {
|
|
1437
1439
|
a("click:row", k);
|
|
1438
|
-
}), A = (
|
|
1439
|
-
a("sort",
|
|
1440
|
-
}, { setTablePreferences:
|
|
1441
|
-
const
|
|
1440
|
+
}), A = (u) => {
|
|
1441
|
+
a("sort", u);
|
|
1442
|
+
}, { setTablePreferences: P, getTablePreferences: Z } = tt(), ae = N(() => {
|
|
1443
|
+
const u = Z(t.preferencesStorageKey);
|
|
1442
1444
|
return {
|
|
1443
1445
|
...t.initialFetcherParams,
|
|
1444
|
-
...
|
|
1446
|
+
...u
|
|
1445
1447
|
};
|
|
1446
|
-
}), w = (
|
|
1447
|
-
t.preferencesStorageKey &&
|
|
1448
|
+
}), w = (u) => {
|
|
1449
|
+
t.preferencesStorageKey && P(t.preferencesStorageKey, u);
|
|
1448
1450
|
};
|
|
1449
|
-
return (
|
|
1450
|
-
const B =
|
|
1451
|
-
return j(),
|
|
1451
|
+
return (u, k) => {
|
|
1452
|
+
const B = D("KIcon"), E = D("KButton"), K = D("KDropdown"), z = D("KTable"), I = D("KCard");
|
|
1453
|
+
return j(), W(I, {
|
|
1452
1454
|
class: "kong-ui-entity-base-table",
|
|
1453
1455
|
title: e.title
|
|
1454
1456
|
}, {
|
|
1455
1457
|
default: s(() => [
|
|
1456
|
-
g(
|
|
1458
|
+
g(z, {
|
|
1457
1459
|
ref_key: "tableRefs",
|
|
1458
1460
|
ref: b,
|
|
1459
1461
|
"cache-identifier": l.value,
|
|
@@ -1473,7 +1475,7 @@ const Br = {
|
|
|
1473
1475
|
fetcher: e.fetcher,
|
|
1474
1476
|
"fetcher-cache-key": String(e.fetcherCacheKey),
|
|
1475
1477
|
"has-error": i.value.hasError,
|
|
1476
|
-
headers:
|
|
1478
|
+
headers: c.value,
|
|
1477
1479
|
"hide-pagination-when-optional": "",
|
|
1478
1480
|
"initial-fetcher-params": ae.value,
|
|
1479
1481
|
"is-loading": e.isLoading,
|
|
@@ -1487,9 +1489,9 @@ const Br = {
|
|
|
1487
1489
|
}, Te({
|
|
1488
1490
|
toolbar: s(({ state: O }) => [
|
|
1489
1491
|
Ae(ee("div", Hr, [
|
|
1490
|
-
Y(
|
|
1491
|
-
|
|
1492
|
-
Y(
|
|
1492
|
+
Y(u.$slots, "toolbar-filter", {}, void 0, !0),
|
|
1493
|
+
u.$slots["toolbar-button"] ? (j(), V("div", Jr, [
|
|
1494
|
+
Y(u.$slots, "toolbar-button", {}, void 0, !0)
|
|
1493
1495
|
])) : G("", !0)
|
|
1494
1496
|
], 512), [
|
|
1495
1497
|
[Ne, o(O)]
|
|
@@ -1505,7 +1507,7 @@ const Br = {
|
|
|
1505
1507
|
width: e.dropdownMenuWidth
|
|
1506
1508
|
}, {
|
|
1507
1509
|
items: s(() => [
|
|
1508
|
-
Y(
|
|
1510
|
+
Y(u.$slots, "actions", {
|
|
1509
1511
|
row: O,
|
|
1510
1512
|
rowKey: R,
|
|
1511
1513
|
rowValue: H
|
|
@@ -1535,15 +1537,15 @@ const Br = {
|
|
|
1535
1537
|
}, [
|
|
1536
1538
|
Ie(e.tableHeaders, (O, R) => ({
|
|
1537
1539
|
name: R,
|
|
1538
|
-
fn: s(({ row: H, rowKey:
|
|
1539
|
-
g(
|
|
1540
|
+
fn: s(({ row: H, rowKey: d, rowValue: C }) => [
|
|
1541
|
+
g(Wr, {
|
|
1540
1542
|
"key-name": String(R),
|
|
1541
1543
|
"row-el": y(H)
|
|
1542
1544
|
}, {
|
|
1543
1545
|
default: s(() => [
|
|
1544
|
-
Y(
|
|
1546
|
+
Y(u.$slots, R, {
|
|
1545
1547
|
row: H,
|
|
1546
|
-
rowKey:
|
|
1548
|
+
rowKey: d,
|
|
1547
1549
|
rowValue: C
|
|
1548
1550
|
}, () => [
|
|
1549
1551
|
U(x(C), 1)
|
|
@@ -1609,9 +1611,9 @@ const Br = {
|
|
|
1609
1611
|
}, o = () => {
|
|
1610
1612
|
n("proceed");
|
|
1611
1613
|
};
|
|
1612
|
-
return (
|
|
1613
|
-
const b =
|
|
1614
|
-
return j(),
|
|
1614
|
+
return (c, p) => {
|
|
1615
|
+
const b = D("KAlert"), y = D("KPrompt");
|
|
1616
|
+
return j(), W(y, {
|
|
1615
1617
|
"action-button-text": "Yes, delete",
|
|
1616
1618
|
"action-pending": e.actionPending,
|
|
1617
1619
|
class: "kong-ui-entity-delete-modal",
|
|
@@ -1649,8 +1651,8 @@ const Br = {
|
|
|
1649
1651
|
key: "0"
|
|
1650
1652
|
} : void 0
|
|
1651
1653
|
]), 1032, ["keypath"]),
|
|
1652
|
-
a.description ||
|
|
1653
|
-
Y(
|
|
1654
|
+
a.description || c.$slots.description ? (j(), V("div", Qr, [
|
|
1655
|
+
Y(c.$slots, "description", {}, () => [
|
|
1654
1656
|
ee("p", null, x(a.description), 1)
|
|
1655
1657
|
], !0)
|
|
1656
1658
|
])) : G("", !0)
|
|
@@ -1731,7 +1733,7 @@ const Br = {
|
|
|
1731
1733
|
setup(e, { emit: r }) {
|
|
1732
1734
|
const t = r, a = e, { i18n: { t: n, formatUnixTimeStamp: i } } = Ze.useI18n(), { axiosInstance: l } = ta({
|
|
1733
1735
|
headers: a.config.requestHeaders
|
|
1734
|
-
}), o = v(1),
|
|
1736
|
+
}), o = v(1), c = {
|
|
1735
1737
|
acls: {
|
|
1736
1738
|
group: { label: n("credentials.list.table_headers.acls.group") },
|
|
1737
1739
|
created_at: { label: n("credentials.list.table_headers.acls.created_at") },
|
|
@@ -1772,59 +1774,59 @@ const Br = {
|
|
|
1772
1774
|
created_at: { label: n("credentials.list.table_headers.jwt.created_at") },
|
|
1773
1775
|
tags: { label: n("credentials.list.table_headers.jwt.tags") }
|
|
1774
1776
|
}
|
|
1775
|
-
}, p = N(() =>
|
|
1776
|
-
let
|
|
1777
|
-
return a.config.app === "konnect" ?
|
|
1777
|
+
}, p = N(() => c[a.config.plugin]), b = N(() => {
|
|
1778
|
+
let d = `${a.config.apiBaseUrl}${Qe.list[a.config.app]}`;
|
|
1779
|
+
return a.config.app === "konnect" ? d = d.replace(/{controlPlaneId}/gi, a.config.controlPlaneId || "").replace(/{consumerId}/gi, a.config.consumerId || "").replace(/{plugin}/gi, a.config.plugin || "") : a.config.app === "kongManager" && (d = d.replace(/\/{workspace}/gi, a.config.workspace ? `/${a.config.workspace}` : "").replace(/{consumerId}/gi, a.config.consumerId || "").replace(/{plugin}/gi, a.config.plugin || "")), d;
|
|
1778
1780
|
}), { fetcher: y, fetcherState: T } = aa(a.config, b), _ = () => {
|
|
1779
1781
|
o.value++;
|
|
1780
|
-
}, L = v(null), f = (
|
|
1781
|
-
const
|
|
1782
|
-
if (!q(
|
|
1783
|
-
Z(
|
|
1782
|
+
}, L = v(null), f = (d, C, q) => {
|
|
1783
|
+
const F = C ? d[C] : JSON.stringify(d);
|
|
1784
|
+
if (!q(F)) {
|
|
1785
|
+
Z(d, C);
|
|
1784
1786
|
return;
|
|
1785
1787
|
}
|
|
1786
|
-
|
|
1787
|
-
}, A = (
|
|
1788
|
-
const { type:
|
|
1789
|
-
|
|
1790
|
-
},
|
|
1788
|
+
P(d, C);
|
|
1789
|
+
}, A = (d, C, q) => {
|
|
1790
|
+
const { type: F } = d;
|
|
1791
|
+
F === "success" ? P(C, q) : Z(C, q);
|
|
1792
|
+
}, P = (d, C) => {
|
|
1791
1793
|
t("copy:success", {
|
|
1792
|
-
entity:
|
|
1794
|
+
entity: d,
|
|
1793
1795
|
field: C,
|
|
1794
|
-
message: C ? n("credentials.copy.success", { val:
|
|
1796
|
+
message: C ? n("credentials.copy.success", { val: d[C] }) : n("credentials.copy.success_brief")
|
|
1795
1797
|
});
|
|
1796
|
-
}, Z = (
|
|
1798
|
+
}, Z = (d, C) => {
|
|
1797
1799
|
t("copy:error", {
|
|
1798
|
-
entity:
|
|
1800
|
+
entity: d,
|
|
1799
1801
|
field: C,
|
|
1800
1802
|
message: n("credentials.error.copy")
|
|
1801
1803
|
});
|
|
1802
|
-
}, ae = (
|
|
1804
|
+
}, ae = (d) => ({
|
|
1803
1805
|
label: n("credentials.actions.edit"),
|
|
1804
|
-
to: a.config.getEditRoute(
|
|
1805
|
-
}), w = v(void 0),
|
|
1806
|
-
w.value =
|
|
1806
|
+
to: a.config.getEditRoute(d)
|
|
1807
|
+
}), w = v(void 0), u = v(!1), k = v(!1), B = v(""), E = ra(a.config, b.value), K = N(() => Oe[a.config.plugin]), z = (d) => {
|
|
1808
|
+
w.value = d, u.value = !0;
|
|
1807
1809
|
}, I = () => {
|
|
1808
|
-
|
|
1810
|
+
u.value = !1;
|
|
1809
1811
|
}, O = async () => {
|
|
1810
|
-
var
|
|
1811
|
-
if ((
|
|
1812
|
+
var d, C, q;
|
|
1813
|
+
if ((d = w.value) != null && d.id) {
|
|
1812
1814
|
k.value = !0;
|
|
1813
1815
|
try {
|
|
1814
|
-
await l.delete(E(w.value.id)), k.value = !1,
|
|
1815
|
-
} catch (
|
|
1816
|
-
B.value = ((q = (C =
|
|
1816
|
+
await l.delete(E(w.value.id)), k.value = !1, u.value = !1, o.value++, t("delete:success", w.value);
|
|
1817
|
+
} catch (F) {
|
|
1818
|
+
B.value = ((q = (C = F.response) == null ? void 0 : C.data) == null ? void 0 : q.message) || F.message || n("credentials.error.delete"), t("error", F);
|
|
1817
1819
|
} finally {
|
|
1818
1820
|
k.value = !1;
|
|
1819
1821
|
}
|
|
1820
1822
|
}
|
|
1821
1823
|
}, R = v(!0);
|
|
1822
|
-
se(T, (
|
|
1823
|
-
var C, q,
|
|
1824
|
-
if (Array.isArray((C =
|
|
1824
|
+
se(T, (d) => {
|
|
1825
|
+
var C, q, F, le;
|
|
1826
|
+
if (Array.isArray((C = d == null ? void 0 : d.response) == null ? void 0 : C.data) && (R.value = d.response.data.length > 0), d.status === Q.Error) {
|
|
1825
1827
|
L.value = {
|
|
1826
1828
|
title: n("credentials.error.general")
|
|
1827
|
-
}, (le = (
|
|
1829
|
+
}, (le = (F = (q = d.error) == null ? void 0 : q.response) == null ? void 0 : F.data) != null && le.message && (L.value.message = d.error.response.data.message), t("error", d.error);
|
|
1828
1830
|
return;
|
|
1829
1831
|
}
|
|
1830
1832
|
L.value = null;
|
|
@@ -1837,8 +1839,8 @@ const Br = {
|
|
|
1837
1839
|
});
|
|
1838
1840
|
return Be(async () => {
|
|
1839
1841
|
await a.canCreate() && (H.value.title = n(`credentials.list.empty_state.${a.config.plugin}.title`), H.value.ctaText = n(`credentials.list.empty_state.${a.config.plugin}.cta`));
|
|
1840
|
-
}), (
|
|
1841
|
-
const q =
|
|
1842
|
+
}), (d, C) => {
|
|
1843
|
+
const q = D("KButton"), F = D("CopyUuid"), le = D("KBadge"), Le = D("KTruncate"), J = D("KDropdownItem"), te = D("KClipboardProvider");
|
|
1842
1844
|
return j(), V("div", na, [
|
|
1843
1845
|
g(m(Vr), {
|
|
1844
1846
|
"cache-identifier": e.cacheIdentifier,
|
|
@@ -1857,7 +1859,7 @@ const Br = {
|
|
|
1857
1859
|
onSort: _
|
|
1858
1860
|
}, {
|
|
1859
1861
|
"toolbar-button": s(() => [
|
|
1860
|
-
(j(),
|
|
1862
|
+
(j(), W(ze, {
|
|
1861
1863
|
disabled: !e.useActionOutside,
|
|
1862
1864
|
to: "#kong-ui-app-page-header-action-button"
|
|
1863
1865
|
}, [
|
|
@@ -1893,28 +1895,28 @@ const Br = {
|
|
|
1893
1895
|
ee("span", null, x(h ?? "-"), 1)
|
|
1894
1896
|
]),
|
|
1895
1897
|
password: s(({ row: h, rowValue: S }) => [
|
|
1896
|
-
g(
|
|
1898
|
+
g(F, {
|
|
1897
1899
|
format: "redacted",
|
|
1898
1900
|
notify: (M) => A(M, h, "password"),
|
|
1899
1901
|
uuid: S
|
|
1900
1902
|
}, null, 8, ["notify", "uuid"])
|
|
1901
1903
|
]),
|
|
1902
1904
|
key: s(({ row: h, rowValue: S }) => [
|
|
1903
|
-
g(
|
|
1905
|
+
g(F, {
|
|
1904
1906
|
format: "redacted",
|
|
1905
1907
|
notify: (M) => A(M, h, "key"),
|
|
1906
1908
|
uuid: S
|
|
1907
1909
|
}, null, 8, ["notify", "uuid"])
|
|
1908
1910
|
]),
|
|
1909
1911
|
client_secret: s(({ row: h, rowValue: S }) => [
|
|
1910
|
-
g(
|
|
1912
|
+
g(F, {
|
|
1911
1913
|
format: "redacted",
|
|
1912
1914
|
notify: (M) => A(M, h, "client_secret"),
|
|
1913
1915
|
uuid: S
|
|
1914
1916
|
}, null, 8, ["notify", "uuid"])
|
|
1915
1917
|
]),
|
|
1916
1918
|
secret: s(({ row: h, rowValue: S }) => [
|
|
1917
|
-
g(
|
|
1919
|
+
g(F, {
|
|
1918
1920
|
format: "redacted",
|
|
1919
1921
|
notify: (M) => A(M, h, "secret"),
|
|
1920
1922
|
uuid: S
|
|
@@ -1924,9 +1926,9 @@ const Br = {
|
|
|
1924
1926
|
U(x(m(i)(h)), 1)
|
|
1925
1927
|
]),
|
|
1926
1928
|
tags: s(({ rowValue: h }) => [
|
|
1927
|
-
(h == null ? void 0 : h.length) > 0 ? (j(),
|
|
1929
|
+
(h == null ? void 0 : h.length) > 0 ? (j(), W(Le, { key: 0 }, {
|
|
1928
1930
|
default: s(() => [
|
|
1929
|
-
(j(!0), V(
|
|
1931
|
+
(j(!0), V(We, null, Ie(h, (S) => (j(), W(le, {
|
|
1930
1932
|
key: S,
|
|
1931
1933
|
onClick: C[0] || (C[0] = He(() => {
|
|
1932
1934
|
}, ["stop"]))
|
|
@@ -1955,7 +1957,7 @@ const Br = {
|
|
|
1955
1957
|
]),
|
|
1956
1958
|
_: 2
|
|
1957
1959
|
}, 1024),
|
|
1958
|
-
e.config.plugin === "basic-auth" ? (j(),
|
|
1960
|
+
e.config.plugin === "basic-auth" ? (j(), W(te, { key: 0 }, {
|
|
1959
1961
|
default: s(({ copyToClipboard: S }) => [
|
|
1960
1962
|
g(J, {
|
|
1961
1963
|
"data-testid": "action-entity-copy-credential",
|
|
@@ -1969,7 +1971,7 @@ const Br = {
|
|
|
1969
1971
|
]),
|
|
1970
1972
|
_: 2
|
|
1971
1973
|
}, 1024)) : G("", !0),
|
|
1972
|
-
["key-auth", "key-auth-enc", "jwt"].includes(e.config.plugin) ? (j(),
|
|
1974
|
+
["key-auth", "key-auth-enc", "jwt"].includes(e.config.plugin) ? (j(), W(te, { key: 1 }, {
|
|
1973
1975
|
default: s(({ copyToClipboard: S }) => [
|
|
1974
1976
|
g(J, {
|
|
1975
1977
|
"data-testid": "action-entity-copy-key",
|
|
@@ -1983,7 +1985,7 @@ const Br = {
|
|
|
1983
1985
|
]),
|
|
1984
1986
|
_: 2
|
|
1985
1987
|
}, 1024)) : G("", !0),
|
|
1986
|
-
e.config.plugin === "oauth2" ? (j(),
|
|
1988
|
+
e.config.plugin === "oauth2" ? (j(), W(te, { key: 2 }, {
|
|
1987
1989
|
default: s(({ copyToClipboard: S }) => [
|
|
1988
1990
|
g(J, {
|
|
1989
1991
|
"data-testid": "action-entity-copy-secret",
|
|
@@ -1997,7 +1999,7 @@ const Br = {
|
|
|
1997
1999
|
]),
|
|
1998
2000
|
_: 2
|
|
1999
2001
|
}, 1024)) : G("", !0),
|
|
2000
|
-
e.config.plugin === "hmac-auth" ? (j(),
|
|
2002
|
+
e.config.plugin === "hmac-auth" ? (j(), W(te, { key: 3 }, {
|
|
2001
2003
|
default: s(({ copyToClipboard: S }) => [
|
|
2002
2004
|
g(J, {
|
|
2003
2005
|
"data-testid": "action-entity-copy-secret",
|
|
@@ -2045,7 +2047,7 @@ const Br = {
|
|
|
2045
2047
|
danger: "",
|
|
2046
2048
|
"data-testid": "action-entity-delete",
|
|
2047
2049
|
"has-divider": "",
|
|
2048
|
-
onClick: (S) =>
|
|
2050
|
+
onClick: (S) => z(h)
|
|
2049
2051
|
}, {
|
|
2050
2052
|
default: s(() => [
|
|
2051
2053
|
U(x(m(n)("credentials.actions.delete")), 1)
|
|
@@ -2064,7 +2066,7 @@ const Br = {
|
|
|
2064
2066
|
"entity-type": K.value,
|
|
2065
2067
|
error: B.value,
|
|
2066
2068
|
title: m(n)(`credentials.delete.${e.config.plugin}.title`),
|
|
2067
|
-
visible:
|
|
2069
|
+
visible: u.value,
|
|
2068
2070
|
onCancel: I,
|
|
2069
2071
|
onProceed: O
|
|
2070
2072
|
}, null, 8, ["action-pending", "description", "entity-type", "error", "title", "visible"])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(K,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],t):(K=typeof globalThis<"u"?globalThis:K||self,t(K["kong-ui-public-entities-consumer-credentials"]={},K.Vue,K["kong-ui-public-i18n"],K.axios))})(this,function(K,t,H,ke){"use strict";const _e={credentials:{title:"Consumer Credentials",list:{toolbar_actions:{acls:{new:"New ACL Credential"},"basic-auth":{new:"New Basic Auth Credential"},"key-auth":{new:"New Key Auth Credential"},"key-auth-enc":{new:"New Key Auth Encrypted Credential"},oauth2:{new:"New OAuth 2.0 Credential"},"hmac-auth":{new:"New HMAC Credential"},jwt:{new:"New JWT Credential"}},table_headers:{acls:{group:"Group",created_at:"Created At",tags:"Tags"},"basic-auth":{password:"Credential",username:"Username",created_at:"Created at",tags:"Tags"},"key-auth":{key:"Key",created_at:"Created at",tags:"Tags"},"key-auth-enc":{key:"Key",created_at:"Created at",tags:"Tags"},oauth2:{name:"Name",client_id:"Client ID",client_secret:"Client secret",created_at:"Created at",tags:"Tags"},"hmac-auth":{username:"Username",secret:"Secret",created_at:"Created at",tags:"Tags"},jwt:{key:"Key",algorithm:"Algorithm",created_at:"Created at",tags:"Tags"}},empty_state:{acls:{title:"Configure a New ACL Credential",cta:"New ACL Credential"},"basic-auth":{title:"Configure a New Basic Auth Credential",cta:"New Basic Auth Credential"},"key-auth":{title:"Configure a New Key Auth Credential",cta:"New Key Auth Credential"},"key-auth-enc":{title:"Configure a New Key Auth Encrypted Credential",cta:"New Key Auth Encrypted Credential"},oauth2:{title:"Configure a New OAuth 2.0 Credential",cta:"New OAuth 2.0 Credential"},"hmac-auth":{title:"Configure a New HMAC Credential",cta:"New HMAC Credential"},jwt:{title:"Configure a New JWT Credential",cta:"New JWT Credential"}}},actions:{copy_id:"Copy ID",copy_credential:"Copy Credential",copy_key:"Copy Key",copy_secret:"Copy Secret",copy_json:"Copy JSON",edit:"Edit",delete:"Delete"},delete:{acls:{title:"Delete an ACL Credential"},"basic-auth":{title:"Delete a Basic Auth Credential"},"key-auth":{title:"Delete a Key Auth Credential"},"key-auth-enc":{title:"Delete a Key Auth Encrypted Credential"},oauth2:{title:"Delete an OAuth 2.0 Credential"},"hmac-auth":{title:"Delete an HMAC Credential"},jwt:{title:"Delete a JWT Credential"},description:"This action cannot be reversed."},error:{general:"Credentials could not be retrieved",delete:"The credential could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}}};function Ne(){const e=H.createI18n("en-us",_e);return{i18n:e,i18nT:H.i18nTComponent(e)}}const Se={useI18n:Ne},xe={list:{konnect:"/api/runtime_groups/{controlPlaneId}/consumers/{consumerId}/{plugin}",kongManager:"/{workspace}/consumers/{consumerId}/{plugin}"}};var ae=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(ae||{}),M=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(M||{});function Y(e={}){return{axiosInstance:ke.create({withCredentials:!0,timeout:3e4,...e})}}function Te(){return{debounce:(e,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...a)},n)}}}}const G="khcp-user-table-preferences",Ae={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Ee(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},n=()=>{const r=e(localStorage.getItem(G));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,a)=>{try{const i=n();i.set(r,a),localStorage.setItem(G,JSON.stringify(Object.fromEntries(i.entries())))}catch(i){console.error("useTablePreferences(setTablePreferences)",i)}},getTablePreferences:r=>{const a=n();return(a==null?void 0:a.get(r))||void 0||Ae},deleteAllTablePreferences:()=>{localStorage.removeItem(G)}}}const Ie={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Oe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},je={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Be={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ve={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},endpoints:{get:"Get"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},$e={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},De={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ke={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ve={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Pe={global:Ie,deleteModal:Oe,baseForm:je,baseTable:Be,baseConfigCard:ve,filter:$e,debouncedFilter:De,errors:Ke,toggleModal:Ve};function Z(){const e=H.createI18n("en-us",Pe);return{i18n:e,i18nT:H.i18nTComponent(e)}}function ie(){const e=(r,a)=>(a==null?void 0:a[r])??void 0,n=(r,a)=>{if(r.length!==a.length)return!1;const i=new Set([...r,...a]);for(const o of i){const l=r.filter(u=>u===o).length,s=a.filter(u=>u===o).length;if(l!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,a,i)=>{if(i){if(Object.keys(r).length===Object.keys(a).length)for(const o in r)if(Array.isArray(r[o])&&Array.isArray(a[o])){if(n(r[o],a[o]))continue;return!1}else{if(r[o]===a[o])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(a)}catch{return!1}},sortAlpha:r=>(a,i)=>{let o=a[r]===void 0||a[r]===null?"":a[r],l=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(a[r])&&(o=a[r][0]),Array.isArray(i[r])&&(l=i[r][0]),o.localeCompare(l)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function qe(e,n,r,a={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:i}=Y({headers:e.requestHeaders}),{i18n:{t:o}}=Z(),{debounce:l}=Te(),s=l(async g=>{await z(g)},200),u=t.ref(!1),p=t.ref(""),m=t.ref(""),y=t.ref([]),_=t.ref([]),C=t.ref(void 0),B=t.unref(n);let f=`${e.apiBaseUrl}${B}`;e.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=ie(),O=async()=>{try{u.value=!0;const{data:g}=await i.get(`${f}?size=${r}`);g!=null&&g.next||(C.value=a.fetchedItemsKey in g?g[a.fetchedItemsKey]:[]),_.value=a.fetchedItemsKey in g?g[a.fetchedItemsKey]:[],y.value=_.value}catch{y.value=[],p.value=o("debouncedFilter.errors.fetch")}finally{u.value=!1}},L=t.ref(""),z=async g=>{var c,b,D;if(L.value!==g)if(L.value=g||"",C.value===void 0)try{if(u.value=!0,p.value="",m.value="",e.app==="konnect"){let x=f+"";g&&(x+=`/${g}`);const{data:E}=await i.get(`${x}?size=${r}`);a.fetchedItemsKey in E?y.value=E[a.fetchedItemsKey]:E!=null&&E.id?y.value=[E]:y.value=[]}else if(g){const x=[];N(g)&&a.searchKeys.includes("id")?x.push((async()=>{const{data:S}=await i.get(`${f}/${g}`);return[S[a.fetchedItemsKey]??S]})()):x.push(...a.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:T}=await i.get(`${f}?${S}=${g}`);return T[a.fetchedItemsKey]}));const E=await Promise.all(x),V=new Set;y.value=[],(c=E==null?void 0:E.forEach)==null||c.call(E,S=>{var T;(T=S==null?void 0:S.forEach)==null||T.call(S,v=>{V.has(v.id)||(V.add(v.id),y.value.push(v))})})}else y.value=_.value}catch(x){((b=x==null?void 0:x.response)==null?void 0:b.status)===404?m.value=o("debouncedFilter.errors.invalid"):(y.value=[],p.value=o("debouncedFilter.errors.fetch"))}finally{u.value=!1}else u.value=!0,m.value="",g?(y.value=(D=C.value)==null?void 0:D.filter(x=>{var E;let V=!1;for(const S of a.searchKeys){const T=typeof x[S]=="string"?(E=x[S])==null?void 0:E.toLowerCase():x[S];T!=null&&T.includes(g.toLowerCase())&&(V=!0)}return V}),(!y.value||!y.value.length)&&(m.value=o("debouncedFilter.errors.invalid"))):y.value=C.value,u.value=!1};return{loading:u,error:p,validationError:m,results:y,allRecords:C,loadItems:O,debouncedQueryChange:s}}function Me(e,n){const r=t.unref(n),a=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return a.value.search="",i=>`${a.value.href}/${i}`}function Fe(){const{i18n:{t:e}}=Z();return{getMessageFromError:n=>{var r,a,i;if(!n)return e("errors.unexpected");if((r=n==null?void 0:n.response)!=null&&r.data){if(n.response.data.detail)return n.response.data.detail;if((a=n.response.data.details)!=null&&a.length)return n.response.data.details.map(o=>{let l=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(l=o.messages.join(", ")),o.field?`${o.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:o}=n.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(o=>`${o} ${n.response.data[o]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Le(e){const n=window.location.origin,r=n.endsWith("/")?n:`${n}/`;try{const a=e.join("/"),i=`${r}${a}`,o=e.some(l=>l.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!o&&new URL(i))return`${r}${a}`;throw new Error("Invalid url")}catch(a){return console.warn("Failed to build valid URL:",a),""}}function oe(e,n){const r=t.ref(t.unref(e)),a=t.ref(t.unref(n)),i=t.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),o=t.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return l=>{const{page:s,pageSize:u,offset:p,sortColumnKey:m,sortColumnOrder:y,query:_}=l;try{let C=new URL(o.value.href);return i.value&&_?(C.search="",C=r.value.app==="konnect"?new URL(`${C.href}?filter[name][contains]=${_}`):new URL(`${C.href}/${_}/`)):(i.value||new URLSearchParams(_).forEach((B,f)=>{C.searchParams.append(f,B)}),m&&C.searchParams.append("sort_by",m),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(u))),p&&s!==1&&C.searchParams.append("offset",String(p)),C.href}catch(C){return console.error("RouteList(fetcher)",C),a.value}}}function Ue(e,n,r="data"){const a=t.unref(n),{axiosInstance:i}=Y({headers:e.requestHeaders}),o=oe(e,a),l=t.ref({status:M.Idle});return{fetcher:async s=>{try{l.value={status:M.Loading};const u=o(s),{data:p}=await i.get(u),m=r&&r.replace(/[^\w-_]/gi,"");let y;p[m]&&Array.isArray(p[m])?y=p[m]:Array.isArray(p)?y=p:y=Object.keys(p).length?[p]:[];const _={data:y,total:y.length,...p.offset?{pagination:{offset:p.offset}}:null};return l.value={status:M.Idle,response:_},_}catch(u){const p={data:[],total:0};return s.query&&u.response.status===404?(l.value={status:M.NoResults,response:p,error:u},p):(l.value={status:M.Error,response:p,error:u},p)}},fetcherState:l}}function Re(){const e=(r,a="_")=>r?r.split(a).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(n,a=>a.toUpperCase()):"",convertKeyToTitle:e}}const le=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,se=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(le);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},ce=e=>e==="*"||e==="x"||e==="X",de=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},We=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],ze=(e,n)=>{if(ce(e)||ce(n))return 0;const[r,a]=We(de(e),de(n));return r>a?1:r<a?-1:0},ue=(e,n)=>{for(let r=0;r<Math.max(e.length,n.length);r++){const a=ze(e[r]||"0",n[r]||"0");if(a!==0)return a}return 0},He=(e,n)=>{const r=se(e),a=se(n),i=r.pop(),o=a.pop(),l=ue(r,a);return l!==0?l:i&&o?ue(i.split("."),o.split(".")):i||o?i?-1:1:0},pe=(e,n,r)=>{Je(r);const a=He(e,n);return fe[r].includes(a)},fe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ye=Object.keys(fe),Je=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(ye.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${ye.join("|")}`)},Ye=e=>typeof e=="string"&&/^[v\d]/.test(e)&&le.test(e);function Ge(e){const{gatewayInfo:n,supportedRange:r}=e;if(!n)return!0;const{edition:a,version:i}=n;if(!Ye(i))return console.error("Invalid version"),!1;const o=r[a];if(!o)return!1;const[l,s]=o;return!(l&&pe(i,l,"<")||s&&pe(i,s,">"))}function Ze(e){const n=t.ref(0),r=t.ref(0),a=t.ref(!1);return t.watch(e,i=>{i&&!a.value&&(n.value=i.offsetWidth,r.value=i.scrollWidth,a.value=!0)}),{isTruncated:t.computed(()=>n.value<r.value)}}const Q={useAxios:Y,useDebouncedFilter:qe,useDeleteUrlBuilder:Me,useErrors:Fe,useExternalLinkCreator:Le,useFetcher:Ue,useFetchUrlBuilder:oe,useHelpers:ie,useStringHelpers:Re,useI18n:Z,useGatewayFeatureSupported:Ge,useTruncationDetector:Ze},X=(e,n)=>{const r=e.__vccOpts||e;for(const[a,i]of n)r[a]=i;return r},Qe="#3a3f51";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function he(e){return typeof e>"u"||e===null}function Xe(e){return typeof e=="object"&&e!==null}function et(e){return Array.isArray(e)?e:he(e)?[]:[e]}function tt(e,n){var r,a,i,o;if(n)for(o=Object.keys(n),r=0,a=o.length;r<a;r+=1)i=o[r],e[i]=n[i];return e}function rt(e,n){var r="",a;for(a=0;a<n;a+=1)r+=e;return r}function nt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var at=he,it=Xe,ot=et,lt=rt,st=nt,ct=tt,ee={isNothing:at,isObject:it,toArray:ot,repeat:lt,isNegativeZero:st,extend:ct};function me(e,n){var r="",a=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(r+=`
|
|
1
|
+
(function($,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],t):($=typeof globalThis<"u"?globalThis:$||self,t($["kong-ui-public-entities-consumer-credentials"]={},$.Vue,$["kong-ui-public-i18n"],$.axios))})(this,function($,t,H,ke){"use strict";const _e={credentials:{title:"Consumer Credentials",list:{toolbar_actions:{acls:{new:"New ACL Credential"},"basic-auth":{new:"New Basic Auth Credential"},"key-auth":{new:"New Key Auth Credential"},"key-auth-enc":{new:"New Key Auth Encrypted Credential"},oauth2:{new:"New OAuth 2.0 Credential"},"hmac-auth":{new:"New HMAC Credential"},jwt:{new:"New JWT Credential"}},table_headers:{acls:{group:"Group",created_at:"Created At",tags:"Tags"},"basic-auth":{password:"Credential",username:"Username",created_at:"Created at",tags:"Tags"},"key-auth":{key:"Key",created_at:"Created at",tags:"Tags"},"key-auth-enc":{key:"Key",created_at:"Created at",tags:"Tags"},oauth2:{name:"Name",client_id:"Client ID",client_secret:"Client secret",created_at:"Created at",tags:"Tags"},"hmac-auth":{username:"Username",secret:"Secret",created_at:"Created at",tags:"Tags"},jwt:{key:"Key",algorithm:"Algorithm",created_at:"Created at",tags:"Tags"}},empty_state:{acls:{title:"Configure a New ACL Credential",cta:"New ACL Credential"},"basic-auth":{title:"Configure a New Basic Auth Credential",cta:"New Basic Auth Credential"},"key-auth":{title:"Configure a New Key Auth Credential",cta:"New Key Auth Credential"},"key-auth-enc":{title:"Configure a New Key Auth Encrypted Credential",cta:"New Key Auth Encrypted Credential"},oauth2:{title:"Configure a New OAuth 2.0 Credential",cta:"New OAuth 2.0 Credential"},"hmac-auth":{title:"Configure a New HMAC Credential",cta:"New HMAC Credential"},jwt:{title:"Configure a New JWT Credential",cta:"New JWT Credential"}}},actions:{copy_id:"Copy ID",copy_credential:"Copy Credential",copy_key:"Copy Key",copy_secret:"Copy Secret",copy_json:"Copy JSON",edit:"Edit",delete:"Delete"},delete:{acls:{title:"Delete an ACL Credential"},"basic-auth":{title:"Delete a Basic Auth Credential"},"key-auth":{title:"Delete a Key Auth Credential"},"key-auth-enc":{title:"Delete a Key Auth Encrypted Credential"},oauth2:{title:"Delete an OAuth 2.0 Credential"},"hmac-auth":{title:"Delete an HMAC Credential"},jwt:{title:"Delete a JWT Credential"},description:"This action cannot be reversed."},error:{general:"Credentials could not be retrieved",delete:"The credential could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}}};function Ne(){const e=H.createI18n("en-us",_e);return{i18n:e,i18nT:H.i18nTComponent(e)}}const Se={useI18n:Ne},xe={list:{konnect:"/api/runtime_groups/{controlPlaneId}/consumers/{consumerId}/{plugin}",kongManager:"/{workspace}/consumers/{consumerId}/{plugin}"}};var ae=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(ae||{}),q=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(q||{});function Y(e={}){return{axiosInstance:ke.create({withCredentials:!0,timeout:3e4,...e})}}function Te(){return{debounce:(e,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...a)},n)}}}}const G="khcp-user-table-preferences",Ae={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Ee(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},n=()=>{const r=e(localStorage.getItem(G));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,a)=>{try{const i=n();i.set(r,a),localStorage.setItem(G,JSON.stringify(Object.fromEntries(i.entries())))}catch(i){console.error("useTablePreferences(setTablePreferences)",i)}},getTablePreferences:r=>{const a=n();return(a==null?void 0:a.get(r))||void 0||Ae},deleteAllTablePreferences:()=>{localStorage.removeItem(G)}}}const Ie={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Oe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},je={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Be={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ve={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},endpoints:{get:"Get"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},De={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ke={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},$e={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ve={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Fe={global:Ie,deleteModal:Oe,baseForm:je,baseTable:Be,baseConfigCard:ve,filter:De,debouncedFilter:Ke,errors:$e,toggleModal:Ve};function Z(){const e=H.createI18n("en-us",Fe);return{i18n:e,i18nT:H.i18nTComponent(e)}}function ie(){const e=(r,a)=>(a==null?void 0:a[r])??void 0,n=(r,a)=>{if(r.length!==a.length)return!1;const i=new Set([...r,...a]);for(const o of i){const l=r.filter(c=>c===o).length,s=a.filter(c=>c===o).length;if(l!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,a,i)=>{if(i){if(Object.keys(r).length===Object.keys(a).length)for(const o in r)if(Array.isArray(r[o])&&Array.isArray(a[o])){if(n(r[o],a[o]))continue;return!1}else{if(r[o]===a[o])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(a)}catch{return!1}},sortAlpha:r=>(a,i)=>{let o=a[r]===void 0||a[r]===null?"":a[r],l=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(a[r])&&(o=a[r][0]),Array.isArray(i[r])&&(l=i[r][0]),o.localeCompare(l)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Pe(e,n,r,a={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:i}=Y({headers:e.requestHeaders}),{i18n:{t:o}}=Z(),{debounce:l}=Te(),s=l(async g=>{await W(g)},200),c=t.ref(!1),p=t.ref(""),m=t.ref(""),y=t.ref([]),_=t.ref([]),C=t.ref(void 0),B=t.unref(n);let f=`${e.apiBaseUrl}${B}`;e.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=ie(),O=async()=>{try{c.value=!0;const{data:g}=await i.get(`${f}?size=${r}`);g!=null&&g.next||(C.value=a.fetchedItemsKey in g?g[a.fetchedItemsKey]:[]),_.value=a.fetchedItemsKey in g?g[a.fetchedItemsKey]:[],y.value=_.value}catch{y.value=[],p.value=o("debouncedFilter.errors.fetch")}finally{c.value=!1}},L=t.ref(""),W=async g=>{var d,b,K;if(L.value!==g)if(L.value=g||"",C.value===void 0)try{if(c.value=!0,p.value="",m.value="",e.app==="konnect"){let x=f+"";g&&(x+=`/${g}`);const{data:E}=await i.get(`${x}?size=${r}`);a.fetchedItemsKey in E?y.value=E[a.fetchedItemsKey]:E!=null&&E.id?y.value=[E]:y.value=[]}else if(g){const x=[];N(g)&&a.searchKeys.includes("id")?x.push((async()=>{const{data:S}=await i.get(`${f}/${g}`);return[S[a.fetchedItemsKey]??S]})()):x.push(...a.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:T}=await i.get(`${f}?${S}=${g}`);return T[a.fetchedItemsKey]}));const E=await Promise.all(x),V=new Set;y.value=[],(d=E==null?void 0:E.forEach)==null||d.call(E,S=>{var T;(T=S==null?void 0:S.forEach)==null||T.call(S,v=>{V.has(v.id)||(V.add(v.id),y.value.push(v))})})}else y.value=_.value}catch(x){((b=x==null?void 0:x.response)==null?void 0:b.status)===404?m.value=o("debouncedFilter.errors.invalid"):(y.value=[],p.value=o("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,m.value="",g?(y.value=(K=C.value)==null?void 0:K.filter(x=>{var E;let V=!1;for(const S of a.searchKeys){const T=typeof x[S]=="string"?(E=x[S])==null?void 0:E.toLowerCase():x[S];T!=null&&T.includes(g.toLowerCase())&&(V=!0)}return V}),(!y.value||!y.value.length)&&(m.value=o("debouncedFilter.errors.invalid"))):y.value=C.value,c.value=!1};return{loading:c,error:p,validationError:m,results:y,allRecords:C,loadItems:O,debouncedQueryChange:s}}function qe(e,n){const r=t.unref(n),a=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return a.value.search="",i=>`${a.value.href}/${i}`}function Me(){const{i18n:{t:e}}=Z();return{getMessageFromError:n=>{var r,a,i;if(!n)return e("errors.unexpected");if((r=n==null?void 0:n.response)!=null&&r.data){if(n.response.data.detail)return n.response.data.detail;if((a=n.response.data.details)!=null&&a.length)return n.response.data.details.map(o=>{let l=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(l=o.messages.join(", ")),o.field?`${o.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:o}=n.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(o=>`${o} ${n.response.data[o]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Le(e){const n=window.location.origin,r=n.endsWith("/")?n:`${n}/`;try{const a=e.join("/"),i=`${r}${a}`,o=e.some(l=>l.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!o&&new URL(i))return`${r}${a}`;throw new Error("Invalid url")}catch(a){return console.warn("Failed to build valid URL:",a),""}}function oe(e,n){const r=t.ref(t.unref(e)),a=t.ref(t.unref(n)),i=t.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),o=t.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return l=>{const{page:s,pageSize:c,offset:p,sortColumnKey:m,sortColumnOrder:y,query:_}=l;try{let C=new URL(o.value.href);return i.value&&_?(C.search="",C=r.value.app==="konnect"?new URL(`${C.href}?filter[name][contains]=${_}`):new URL(`${C.href}/${_}/`)):(i.value||new URLSearchParams(_).forEach((B,f)=>{C.searchParams.append(f,B)}),m&&C.searchParams.append("sort_by",m),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(c))),p&&s!==1&&C.searchParams.append("offset",String(p)),C.href}catch(C){return console.error("RouteList(fetcher)",C),a.value}}}function Ue(e,n,r="data"){const a=t.unref(n),{axiosInstance:i}=Y({headers:e.requestHeaders}),o=oe(e,a),l=t.ref({status:q.Idle});return{fetcher:async s=>{try{l.value={status:q.Loading};let c=o(s);c.includes("filter[name]")&&(c=`${c}&page[size]=${s.pageSize}&page[number]=${s.page}`);const{data:p}=await i.get(c),m=r&&r.replace(/[^\w-_]/gi,"");let y;p[m]&&Array.isArray(p[m])?y=p[m]:Array.isArray(p)?y=p:y=Object.keys(p).length?[p]:[];const _={data:y,total:y.length,...p.offset?{pagination:{offset:p.offset}}:null};return l.value={status:q.Idle,response:_},_}catch(c){const p={data:[],total:0};return s.query&&c.response.status===404?(l.value={status:q.NoResults,response:p,error:c},p):(l.value={status:q.Error,response:p,error:c},p)}},fetcherState:l}}function Re(){const e=(r,a="_")=>r?r.split(a).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(n,a=>a.toUpperCase()):"",convertKeyToTitle:e}}const le=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,se=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(le);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},ce=e=>e==="*"||e==="x"||e==="X",de=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},ze=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],We=(e,n)=>{if(ce(e)||ce(n))return 0;const[r,a]=ze(de(e),de(n));return r>a?1:r<a?-1:0},ue=(e,n)=>{for(let r=0;r<Math.max(e.length,n.length);r++){const a=We(e[r]||"0",n[r]||"0");if(a!==0)return a}return 0},He=(e,n)=>{const r=se(e),a=se(n),i=r.pop(),o=a.pop(),l=ue(r,a);return l!==0?l:i&&o?ue(i.split("."),o.split(".")):i||o?i?-1:1:0},pe=(e,n,r)=>{Je(r);const a=He(e,n);return fe[r].includes(a)},fe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ye=Object.keys(fe),Je=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(ye.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${ye.join("|")}`)},Ye=e=>typeof e=="string"&&/^[v\d]/.test(e)&&le.test(e);function Ge(e){const{gatewayInfo:n,supportedRange:r}=e;if(!n)return!0;const{edition:a,version:i}=n;if(!Ye(i))return console.error("Invalid version"),!1;const o=r[a];if(!o)return!1;const[l,s]=o;return!(l&&pe(i,l,"<")||s&&pe(i,s,">"))}function Ze(e){const n=t.ref(0),r=t.ref(0),a=t.ref(!1);return t.watch(e,i=>{i&&!a.value&&(n.value=i.offsetWidth,r.value=i.scrollWidth,a.value=!0)}),{isTruncated:t.computed(()=>n.value<r.value)}}const Q={useAxios:Y,useDebouncedFilter:Pe,useDeleteUrlBuilder:qe,useErrors:Me,useExternalLinkCreator:Le,useFetcher:Ue,useFetchUrlBuilder:oe,useHelpers:ie,useStringHelpers:Re,useI18n:Z,useGatewayFeatureSupported:Ge,useTruncationDetector:Ze},X=(e,n)=>{const r=e.__vccOpts||e;for(const[a,i]of n)r[a]=i;return r},Qe="#3a3f51";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function he(e){return typeof e>"u"||e===null}function Xe(e){return typeof e=="object"&&e!==null}function et(e){return Array.isArray(e)?e:he(e)?[]:[e]}function tt(e,n){var r,a,i,o;if(n)for(o=Object.keys(n),r=0,a=o.length;r<a;r+=1)i=o[r],e[i]=n[i];return e}function rt(e,n){var r="",a;for(a=0;a<n;a+=1)r+=e;return r}function nt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var at=he,it=Xe,ot=et,lt=rt,st=nt,ct=tt,ee={isNothing:at,isObject:it,toArray:ot,repeat:lt,isNegativeZero:st,extend:ct};function me(e,n){var r="",a=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(r+=`
|
|
2
2
|
|
|
3
|
-
`+e.mark.snippet),a+" "+r):a}function
|
|
3
|
+
`+e.mark.snippet),a+" "+r):a}function z(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=me(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}z.prototype=Object.create(Error.prototype),z.prototype.constructor=z,z.prototype.toString=function(e){return this.name+": "+me(this,e)};var M=z,dt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ut=["scalar","sequence","mapping"];function pt(e){var n={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(a){n[String(a)]=r})}),n}function ft(e,n){if(n=n||{},Object.keys(n).forEach(function(r){if(dt.indexOf(r)===-1)throw new M('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(r){return r},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=pt(n.styleAliases||null),ut.indexOf(this.kind)===-1)throw new M('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var A=ft;function ge(e,n){var r=[];return e[n].forEach(function(a){var i=r.length;r.forEach(function(o,l){o.tag===a.tag&&o.kind===a.kind&&o.multi===a.multi&&(i=l)}),r[i]=a}),r}function yt(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,r;function a(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,r=arguments.length;n<r;n+=1)arguments[n].forEach(a);return e}function te(e){return this.extend(e)}te.prototype.extend=function(e){var n=[],r=[];if(e instanceof A)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new M("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(i){if(!(i instanceof A))throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new M("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new M("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(i){if(!(i instanceof A))throw new M("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(te.prototype);return a.implicit=(this.implicit||[]).concat(n),a.explicit=(this.explicit||[]).concat(r),a.compiledImplicit=ge(a,"implicit"),a.compiledExplicit=ge(a,"explicit"),a.compiledTypeMap=yt(a.compiledImplicit,a.compiledExplicit),a};var ht=te,mt=new A("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),gt=new A("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),bt=new A("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),wt=new ht({explicit:[mt,gt,bt]});function Ct(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function kt(){return null}function _t(e){return e===null}var Nt=new A("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ct,construct:kt,predicate:_t,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function St(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function xt(e){return e==="true"||e==="True"||e==="TRUE"}function Tt(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var At=new A("tag:yaml.org,2002:bool",{kind:"scalar",resolve:St,construct:xt,predicate:Tt,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Et(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function It(e){return 48<=e&&e<=55}function Ot(e){return 48<=e&&e<=57}function jt(e){if(e===null)return!1;var n=e.length,r=0,a=!1,i;if(!n)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===n)return!0;if(i=e[++r],i==="b"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;a=!0}return a&&i!=="_"}if(i==="x"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(!Et(e.charCodeAt(r)))return!1;a=!0}return a&&i!=="_"}if(i==="o"){for(r++;r<n;r++)if(i=e[r],i!=="_"){if(!It(e.charCodeAt(r)))return!1;a=!0}return a&&i!=="_"}}if(i==="_")return!1;for(;r<n;r++)if(i=e[r],i!=="_"){if(!Ot(e.charCodeAt(r)))return!1;a=!0}return!(!a||i==="_")}function Bt(e){var n=e,r=1,a;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),a=n[0],(a==="-"||a==="+")&&(a==="-"&&(r=-1),n=n.slice(1),a=n[0]),n==="0")return 0;if(a==="0"){if(n[1]==="b")return r*parseInt(n.slice(2),2);if(n[1]==="x")return r*parseInt(n.slice(2),16);if(n[1]==="o")return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)}function vt(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ee.isNegativeZero(e)}var Dt=new A("tag:yaml.org,2002:int",{kind:"scalar",resolve:jt,construct:Bt,predicate:vt,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Kt=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function $t(e){return!(e===null||!Kt.test(e)||e[e.length-1]==="_")}function Vt(e){var n,r;return n=e.replace(/_/g,"").toLowerCase(),r=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:r*parseFloat(n,10)}var Ft=/^[-+]?[0-9]+e/;function Pt(e,n){var r;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ee.isNegativeZero(e))return"-0.0";return r=e.toString(10),Ft.test(r)?r.replace("e",".e"):r}function qt(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ee.isNegativeZero(e))}var Mt=new A("tag:yaml.org,2002:float",{kind:"scalar",resolve:$t,construct:Vt,predicate:qt,represent:Pt,defaultStyle:"lowercase"}),Lt=wt.extend({implicit:[Nt,At,Dt,Mt]}),Ut=Lt,be=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),we=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Rt(e){return e===null?!1:be.exec(e)!==null||we.exec(e)!==null}function zt(e){var n,r,a,i,o,l,s,c=0,p=null,m,y,_;if(n=be.exec(e),n===null&&(n=we.exec(e)),n===null)throw new Error("Date resolve error");if(r=+n[1],a=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(r,a,i));if(o=+n[4],l=+n[5],s=+n[6],n[7]){for(c=n[7].slice(0,3);c.length<3;)c+="0";c=+c}return n[9]&&(m=+n[10],y=+(n[11]||0),p=(m*60+y)*6e4,n[9]==="-"&&(p=-p)),_=new Date(Date.UTC(r,a,i,o,l,s,c)),p&&_.setTime(_.getTime()-p),_}function Wt(e){return e.toISOString()}var Ht=new A("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Rt,construct:zt,instanceOf:Date,represent:Wt});function Jt(e){return e==="<<"||e===null}var Yt=new A("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Jt}),re=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
4
4
|
\r`;function Gt(e){if(e===null)return!1;var n,r,a=0,i=e.length,o=re;for(r=0;r<i;r++)if(n=o.indexOf(e.charAt(r)),!(n>64)){if(n<0)return!1;a+=6}return a%8===0}function Zt(e){var n,r,a=e.replace(/[\r\n=]/g,""),i=a.length,o=re,l=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|o.indexOf(a.charAt(n));return r=i%4*6,r===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):r===18?(s.push(l>>10&255),s.push(l>>2&255)):r===12&&s.push(l>>4&255),new Uint8Array(s)}function Qt(e){var n="",r=0,a,i,o=e.length,l=re;for(a=0;a<o;a++)a%3===0&&a&&(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]),r=(r<<8)+e[a];return i=o%3,i===0?(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]):i===2?(n+=l[r>>10&63],n+=l[r>>4&63],n+=l[r<<2&63],n+=l[64]):i===1&&(n+=l[r>>2&63],n+=l[r<<4&63],n+=l[64],n+=l[64]),n}function Xt(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var er=new A("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Gt,construct:Zt,predicate:Xt,represent:Qt}),tr=Object.prototype.hasOwnProperty,rr=Object.prototype.toString;function nr(e){if(e===null)return!0;var n=[],r,a,i,o,l,s=e;for(r=0,a=s.length;r<a;r+=1){if(i=s[r],l=!1,rr.call(i)!=="[object Object]")return!1;for(o in i)if(tr.call(i,o))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function ar(e){return e!==null?e:[]}var ir=new A("tag:yaml.org,2002:omap",{kind:"sequence",resolve:nr,construct:ar}),or=Object.prototype.toString;function lr(e){if(e===null)return!0;var n,r,a,i,o,l=e;for(o=new Array(l.length),n=0,r=l.length;n<r;n+=1){if(a=l[n],or.call(a)!=="[object Object]"||(i=Object.keys(a),i.length!==1))return!1;o[n]=[i[0],a[i[0]]]}return!0}function sr(e){if(e===null)return[];var n,r,a,i,o,l=e;for(o=new Array(l.length),n=0,r=l.length;n<r;n+=1)a=l[n],i=Object.keys(a),o[n]=[i[0],a[i[0]]];return o}var cr=new A("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:lr,construct:sr}),dr=Object.prototype.hasOwnProperty;function ur(e){if(e===null)return!0;var n,r=e;for(n in r)if(dr.call(r,n)&&r[n]!==null)return!1;return!0}function pr(e){return e!==null?e:{}}var fr=new A("tag:yaml.org,2002:set",{kind:"mapping",resolve:ur,construct:pr});Ut.extend({implicit:[Ht,Yt],explicit:[er,ir,cr,fr]});function Ce(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
5
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var yr=new Array(256),hr=new Array(256),U=0;U<256;U++)yr[U]=Ce(U)?1:0,hr[U]=Ce(U);const mr={key:0,"data-testid":"first-col"},gr=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,r=t.computed(()=>{var f;return((f=n.rowEl)==null?void 0:f.querySelector(`[data-testid="${n.keyName}"]`))||null}),a=t.computed(()=>{var f;return((f=r.value)==null?void 0:f.querySelector('[data-testid="first-col"]'))||null}),i=t.computed(()=>{var f,N;const O=(f=n.rowEl)==null?void 0:f.querySelectorAll("td");return O?((N=O[0])==null?void 0:N.getAttribute("data-testid"))===n.keyName:!1});let o;const l=()=>{o&&(o.disconnect(),o=void 0)},s=()=>{var f,N,O;p.value=((f=a.value)==null?void 0:f.getBoundingClientRect().width)||0,m.value=((N=r.value)==null?void 0:N.clientWidth)||0,y.value=((O=u.value)==null?void 0:O.innerText)||""},u=t.ref({}),p=t.ref(0),m=t.ref(0),y=t.ref(""),_=t.computed(()=>[a.value,r.value]),C=t.watch(_,f=>{if(i.value&&(l(),"ResizeObserver"in window&&window)){o=new ResizeObserver(N=>{window.requestAnimationFrame(()=>{!Array.isArray(N)||!N.length||s()})});for(const N of f)N&&o.observe(N)}},{immediate:!0,flush:"post",deep:!0}),B=t.computed(()=>i.value?p.value>m.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{C()}),(f,N)=>{const O=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:u,class:"content-wrapper"},[i.value?(t.openBlock(),t.createElementBlock("span",mr,[t.createVNode(O,{label:B.value?y.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(f.$slots,"default",{key:1},void 0,!0)],512)}}}),br=X(gr,[["__scopeId","data-v-e42a20c9"]]),wr={class:"toolbar-container"},Cr={key:0,class:"toolbar-button-container"},kr=["data-testid"],_r=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const r=e,a=n,{i18n:{t:i}}=Q.useI18n(),o=t.computed(()=>{var c,b;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(c=r.errorMessage)==null?void 0:c.title,message:(b=r.errorMessage)==null?void 0:b.message}}),l=t.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=c=>c.hasData||!!r.query,u=t.computed(()=>{const c=[];return Object.keys(r.tableHeaders).forEach(b=>{const D=r.tableHeaders[b];c.push({label:D.label??b,key:b,sortable:D.sortable??!1})}),r.enableEntityActions&&c.push({key:"actions",hideLabel:!0}),c}),p=c=>({"data-rowid":c.id,"data-testid":c.name,...r.rowAttributes(c)}),m=t.ref({}),y=c=>{var b;return(b=m.value)==null?void 0:b.$el.querySelector(`[data-rowid="${c.id}"]`)},_=c=>{const b={"data-testid":c.headerKey,...r.cellAttributes(c)};return c.colIndex===0&&(b.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),b},C=()=>{a("empty-state-cta-clicked"),B()},B=()=>{a("clear-search-input")},f=t.computed(()=>r.disableRowClick?void 0:(c,b)=>{a("click:row",b)}),N=c=>{a("sort",c)},{setTablePreferences:O,getTablePreferences:L}=Ee(),z=t.computed(()=>{const c=L(r.preferencesStorageKey);return{...r.initialFetcherParams,...c}}),g=c=>{r.preferencesStorageKey&&O(r.preferencesStorageKey,c)};return(c,b)=>{const D=t.resolveComponent("KIcon"),x=t.resolveComponent("KButton"),E=t.resolveComponent("KDropdown"),V=t.resolveComponent("KTable"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(S,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(V,{ref_key:"tableRefs",ref:m,"cache-identifier":l.value,"cell-attrs":_,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:u.value,"hide-pagination-when-optional":"","initial-fetcher-params":z.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":p,"search-input":e.query,onKtableEmptyStateCtaClicked:C,"onRow:click":f.value,onSort:b[0]||(b[0]=T=>N(T)),"onUpdate:tablePreferences":g},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",wr,[t.renderSlot(c.$slots,"toolbar-filter",{},void 0,!0),c.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Cr,[t.renderSlot(c.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,s(T)]])]),actions:t.withCtx(({row:T,rowKey:v,rowValue:P})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(c.$slots,"actions",{row:T,rowKey:v,rowValue:P},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(x,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(D,{color:t.unref(Qe),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,kr)]),_:2},[t.renderList(e.tableHeaders,(T,v)=>({name:v,fn:t.withCtx(({row:P,rowKey:d,rowValue:w})=>[t.createVNode(br,{"key-name":String(v),"row-el":y(P)},{default:t.withCtx(()=>[t.renderSlot(c.$slots,v,{row:P,rowKey:d,rowValue:w},()=>[t.createTextVNode(t.toDisplayString(w),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Nr=X(_r,[["__scopeId","data-v-57b5a97b"]]),Sr={key:0,class:"kong-ui-entity-delete-error"},xr={key:1,class:"description"},Tr=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:n}){const{i18nT:r}=Q.useI18n(),a=e,i=n,o=t.computed(()=>a.needConfirm?a.entityName:""),l=()=>{i("cancel")},s=()=>{i("proceed")};return(u,p)=>{const m=t.resolveComponent("KAlert"),y=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(y,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:l,onProceed:s},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Sr,[t.createVNode(m,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||u.$slots.description?(t.openBlock(),t.createElementBlock("div",xr,[t.renderSlot(u.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(a.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Ar=X(Tr,[["__scopeId","data-v-1c9a2a07"]]),ne=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,r=t.ref(void 0),a=t.computed(()=>r.value===!0||r.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{r.value=await n.authFunction()},{immediate:!0}),(i,o)=>a.value?t.renderSlot(i.$slots,"default",{key:0,isAllowed:r.value}):t.createCommentVNode("",!0)}}),{useAxios:Er,useDeleteUrlBuilder:Ir,useErrors:Kr,useExternalLinkCreator:Vr,useFetchUrlBuilder:Pr,useFetcher:Or,useDebouncedFilter:qr,useStringHelpers:Mr,useHelpers:Fr,useGatewayFeatureSupported:Lr,useTruncationDetector:Ur}=Q,jr={class:"kong-ui-entities-consumer-credentials-list"},Br={key:1},vr=((e,n)=>{const r=e.__vccOpts||e;for(const[a,i]of n)r[a]=i;return r})(t.defineComponent({__name:"ConsumerCredentialList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getEditRoute)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:n}){const r=n,a=e,{i18n:{t:i,formatUnixTimeStamp:o}}=Se.useI18n(),{axiosInstance:l}=Er({headers:a.config.requestHeaders}),s=t.ref(1),u={acls:{group:{label:i("credentials.list.table_headers.acls.group")},created_at:{label:i("credentials.list.table_headers.acls.created_at")},tags:{label:i("credentials.list.table_headers.acls.tags")}},"basic-auth":{password:{label:i("credentials.list.table_headers.basic-auth.password")},username:{label:i("credentials.list.table_headers.basic-auth.username")},created_at:{label:i("credentials.list.table_headers.basic-auth.created_at")},tags:{label:i("credentials.list.table_headers.basic-auth.tags")}},"key-auth":{key:{label:i("credentials.list.table_headers.key-auth.key")},created_at:{label:i("credentials.list.table_headers.key-auth.created_at")},tags:{label:i("credentials.list.table_headers.key-auth.tags")}},"key-auth-enc":{key:{label:i("credentials.list.table_headers.key-auth-enc.key")},created_at:{label:i("credentials.list.table_headers.key-auth-enc.created_at")},tags:{label:i("credentials.list.table_headers.key-auth-enc.tags")}},oauth2:{name:{label:i("credentials.list.table_headers.oauth2.name")},client_id:{label:i("credentials.list.table_headers.oauth2.client_id")},client_secret:{label:i("credentials.list.table_headers.oauth2.client_secret")},created_at:{label:i("credentials.list.table_headers.oauth2.created_at")},tags:{label:i("credentials.list.table_headers.oauth2.tags")}},"hmac-auth":{username:{label:i("credentials.list.table_headers.hmac-auth.username")},secret:{label:i("credentials.list.table_headers.hmac-auth.secret")},created_at:{label:i("credentials.list.table_headers.hmac-auth.created_at")},tags:{label:i("credentials.list.table_headers.hmac-auth.tags")}},jwt:{key:{label:i("credentials.list.table_headers.jwt.key")},algorithm:{label:i("credentials.list.table_headers.jwt.algorithm")},created_at:{label:i("credentials.list.table_headers.jwt.created_at")},tags:{label:i("credentials.list.table_headers.jwt.tags")}}},p=t.computed(()=>u[a.config.plugin]),m=t.computed(()=>{let d=`${a.config.apiBaseUrl}${xe.list[a.config.app]}`;return a.config.app==="konnect"?d=d.replace(/{controlPlaneId}/gi,a.config.controlPlaneId||"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||""):a.config.app==="kongManager"&&(d=d.replace(/\/{workspace}/gi,a.config.workspace?`/${a.config.workspace}`:"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||"")),d}),{fetcher:y,fetcherState:_}=Or(a.config,m),C=()=>{s.value++},B=t.ref(null),f=(d,w,$)=>{const I=w?d[w]:JSON.stringify(d);if(!$(I)){L(d,w);return}O(d,w)},N=(d,w,$)=>{const{type:I}=d;I==="success"?O(w,$):L(w,$)},O=(d,w)=>{r("copy:success",{entity:d,field:w,message:w?i("credentials.copy.success",{val:d[w]}):i("credentials.copy.success_brief")})},L=(d,w)=>{r("copy:error",{entity:d,field:w,message:i("credentials.error.copy")})},z=d=>({label:i("credentials.actions.edit"),to:a.config.getEditRoute(d)}),g=t.ref(void 0),c=t.ref(!1),b=t.ref(!1),D=t.ref(""),x=Ir(a.config,m.value),E=t.computed(()=>ae[a.config.plugin]),V=d=>{g.value=d,c.value=!0},S=()=>{c.value=!1},T=async()=>{var d,w,$;if((d=g.value)!=null&&d.id){b.value=!0;try{await l.delete(x(g.value.id)),b.value=!1,c.value=!1,s.value++,r("delete:success",g.value)}catch(I){D.value=(($=(w=I.response)==null?void 0:w.data)==null?void 0:$.message)||I.message||i("credentials.error.delete"),r("error",I)}finally{b.value=!1}}},v=t.ref(!0);t.watch(_,d=>{var w,$,I,J;if(Array.isArray((w=d==null?void 0:d.response)==null?void 0:w.data)&&(v.value=d.response.data.length>0),d.status===M.Error){B.value={title:i("credentials.error.general")},(J=(I=($=d.error)==null?void 0:$.response)==null?void 0:I.data)!=null&&J.message&&(B.value.message=d.error.response.data.message),r("error",d.error);return}B.value=null});const P=t.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:"",title:i("credentials.title")});return t.onBeforeMount(async()=>{await a.canCreate()&&(P.value.title=i(`credentials.list.empty_state.${a.config.plugin}.title`),P.value.ctaText=i(`credentials.list.empty_state.${a.config.plugin}.cta`))}),(d,w)=>{const $=t.resolveComponent("KButton"),I=t.resolveComponent("CopyUuid"),J=t.resolveComponent("KBadge"),$r=t.resolveComponent("KTruncate"),q=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",jr,[t.createVNode(t.unref(Nr),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-row-click":"","disable-sorting":"","empty-state-options":P.value,"enable-entity-actions":"","error-message":B.value,fetcher:t.unref(y),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumer-credentials-list","table-headers":p.value,"use-action-outside":e.useActionOutside,onSort:C},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ne),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode($,{appearance:"primary","data-testid":"toolbar-add-credential",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)(`credentials.list.toolbar_actions.${e.config.plugin}.new`)),1)]),_:1},8,["to"]),[[t.vShow,v.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),group:t.withCtx(({rowValue:h})=>[t.createElementVNode("b",null,t.toDisplayString(h??"-"),1)]),name:t.withCtx(({rowValue:h})=>[t.createElementVNode("b",null,t.toDisplayString(h??"-"),1)]),username:t.withCtx(({rowValue:h})=>[t.createElementVNode("span",null,t.toDisplayString(h??"-"),1)]),password:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"password"),uuid:k},null,8,["notify","uuid"])]),key:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"key"),uuid:k},null,8,["notify","uuid"])]),client_secret:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"client_secret"),uuid:k},null,8,["notify","uuid"])]),secret:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"secret"),uuid:k},null,8,["notify","uuid"])]),created_at:t.withCtx(({rowValue:h})=>[t.createTextVNode(t.toDisplayString(t.unref(o)(h)),1)]),tags:t.withCtx(({rowValue:h})=>[(h==null?void 0:h.length)>0?(t.openBlock(),t.createBlock($r,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h,k=>(t.openBlock(),t.createBlock(J,{key:k,onClick:w[0]||(w[0]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(k),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",Br,"-"))]),actions:t.withCtx(({row:h})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-id",onClick:j=>f(h,"id",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.config.plugin==="basic-auth"?(t.openBlock(),t.createBlock(R,{key:0},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-credential",onClick:j=>f(h,"password",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_credential")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),["key-auth","key-auth-enc","jwt"].includes(e.config.plugin)?(t.openBlock(),t.createBlock(R,{key:1},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-key",onClick:j=>f(h,"key",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_key")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),e.config.plugin==="oauth2"?(t.openBlock(),t.createBlock(R,{key:2},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-secret",onClick:j=>f(h,"client_secret",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),e.config.plugin==="hmac-auth"?(t.openBlock(),t.createBlock(R,{key:3},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-secret",onClick:j=>f(h,"secret",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(q,{"data-testid":"action-entity-copy-json",onClick:j=>f(h,void 0,k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ne),{"auth-function":()=>e.canEdit(h)},{default:t.withCtx(()=>[t.createVNode(q,{"data-testid":"action-entity-edit","has-divider":"",item:z(h.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ne),{"auth-function":()=>e.canDelete(h)},{default:t.withCtx(()=>[t.createVNode(q,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:k=>V(h)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(Ar),{"action-pending":b.value,description:t.unref(i)("credentials.delete.description"),"entity-type":E.value,error:D.value,title:t.unref(i)(`credentials.delete.${e.config.plugin}.title`),visible:c.value,onCancel:S,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f6c6d08c"]]);K.ConsumerCredentialList=vr,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var yr=new Array(256),hr=new Array(256),U=0;U<256;U++)yr[U]=Ce(U)?1:0,hr[U]=Ce(U);const mr={key:0,"data-testid":"first-col"},gr=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,r=t.computed(()=>{var f;return((f=n.rowEl)==null?void 0:f.querySelector(`[data-testid="${n.keyName}"]`))||null}),a=t.computed(()=>{var f;return((f=r.value)==null?void 0:f.querySelector('[data-testid="first-col"]'))||null}),i=t.computed(()=>{var f,N;const O=(f=n.rowEl)==null?void 0:f.querySelectorAll("td");return O?((N=O[0])==null?void 0:N.getAttribute("data-testid"))===n.keyName:!1});let o;const l=()=>{o&&(o.disconnect(),o=void 0)},s=()=>{var f,N,O;p.value=((f=a.value)==null?void 0:f.getBoundingClientRect().width)||0,m.value=((N=r.value)==null?void 0:N.clientWidth)||0,y.value=((O=c.value)==null?void 0:O.innerText)||""},c=t.ref({}),p=t.ref(0),m=t.ref(0),y=t.ref(""),_=t.computed(()=>[a.value,r.value]),C=t.watch(_,f=>{if(i.value&&(l(),"ResizeObserver"in window&&window)){o=new ResizeObserver(N=>{window.requestAnimationFrame(()=>{!Array.isArray(N)||!N.length||s()})});for(const N of f)N&&o.observe(N)}},{immediate:!0,flush:"post",deep:!0}),B=t.computed(()=>i.value?p.value>m.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{C()}),(f,N)=>{const O=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[i.value?(t.openBlock(),t.createElementBlock("span",mr,[t.createVNode(O,{label:B.value?y.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(f.$slots,"default",{key:1},void 0,!0)],512)}}}),br=X(gr,[["__scopeId","data-v-e42a20c9"]]),wr={class:"toolbar-container"},Cr={key:0,class:"toolbar-button-container"},kr=["data-testid"],_r=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const r=e,a=n,{i18n:{t:i}}=Q.useI18n(),o=t.computed(()=>{var d,b;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(d=r.errorMessage)==null?void 0:d.title,message:(b=r.errorMessage)==null?void 0:b.message}}),l=t.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=d=>d.hasData||!!r.query,c=t.computed(()=>{const d=[];return Object.keys(r.tableHeaders).forEach(b=>{const K=r.tableHeaders[b];d.push({label:K.label??b,key:b,sortable:K.sortable??!1})}),r.enableEntityActions&&d.push({key:"actions",hideLabel:!0}),d}),p=d=>({"data-rowid":d.id,"data-testid":d.name,...r.rowAttributes(d)}),m=t.ref({}),y=d=>{var b;return(b=m.value)==null?void 0:b.$el.querySelector(`[data-rowid="${d.id}"]`)},_=d=>{const b={"data-testid":d.headerKey,...r.cellAttributes(d)};return d.colIndex===0&&(b.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),b},C=()=>{a("empty-state-cta-clicked"),B()},B=()=>{a("clear-search-input")},f=t.computed(()=>r.disableRowClick?void 0:(d,b)=>{a("click:row",b)}),N=d=>{a("sort",d)},{setTablePreferences:O,getTablePreferences:L}=Ee(),W=t.computed(()=>{const d=L(r.preferencesStorageKey);return{...r.initialFetcherParams,...d}}),g=d=>{r.preferencesStorageKey&&O(r.preferencesStorageKey,d)};return(d,b)=>{const K=t.resolveComponent("KIcon"),x=t.resolveComponent("KButton"),E=t.resolveComponent("KDropdown"),V=t.resolveComponent("KTable"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(S,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(V,{ref_key:"tableRefs",ref:m,"cache-identifier":l.value,"cell-attrs":_,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":W.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":p,"search-input":e.query,onKtableEmptyStateCtaClicked:C,"onRow:click":f.value,onSort:b[0]||(b[0]=T=>N(T)),"onUpdate:tablePreferences":g},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",wr,[t.renderSlot(d.$slots,"toolbar-filter",{},void 0,!0),d.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Cr,[t.renderSlot(d.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,s(T)]])]),actions:t.withCtx(({row:T,rowKey:v,rowValue:F})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(d.$slots,"actions",{row:T,rowKey:v,rowValue:F},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(x,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(K,{color:t.unref(Qe),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,kr)]),_:2},[t.renderList(e.tableHeaders,(T,v)=>({name:v,fn:t.withCtx(({row:F,rowKey:u,rowValue:w})=>[t.createVNode(br,{"key-name":String(v),"row-el":y(F)},{default:t.withCtx(()=>[t.renderSlot(d.$slots,v,{row:F,rowKey:u,rowValue:w},()=>[t.createTextVNode(t.toDisplayString(w),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Nr=X(_r,[["__scopeId","data-v-57b5a97b"]]),Sr={key:0,class:"kong-ui-entity-delete-error"},xr={key:1,class:"description"},Tr=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:n}){const{i18nT:r}=Q.useI18n(),a=e,i=n,o=t.computed(()=>a.needConfirm?a.entityName:""),l=()=>{i("cancel")},s=()=>{i("proceed")};return(c,p)=>{const m=t.resolveComponent("KAlert"),y=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(y,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:l,onProceed:s},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Sr,[t.createVNode(m,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",xr,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(a.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Ar=X(Tr,[["__scopeId","data-v-1c9a2a07"]]),ne=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,r=t.ref(void 0),a=t.computed(()=>r.value===!0||r.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{r.value=await n.authFunction()},{immediate:!0}),(i,o)=>a.value?t.renderSlot(i.$slots,"default",{key:0,isAllowed:r.value}):t.createCommentVNode("",!0)}}),{useAxios:Er,useDeleteUrlBuilder:Ir,useErrors:$r,useExternalLinkCreator:Vr,useFetchUrlBuilder:Fr,useFetcher:Or,useDebouncedFilter:Pr,useStringHelpers:qr,useHelpers:Mr,useGatewayFeatureSupported:Lr,useTruncationDetector:Ur}=Q,jr={class:"kong-ui-entities-consumer-credentials-list"},Br={key:1},vr=((e,n)=>{const r=e.__vccOpts||e;for(const[a,i]of n)r[a]=i;return r})(t.defineComponent({__name:"ConsumerCredentialList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getEditRoute)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:n}){const r=n,a=e,{i18n:{t:i,formatUnixTimeStamp:o}}=Se.useI18n(),{axiosInstance:l}=Er({headers:a.config.requestHeaders}),s=t.ref(1),c={acls:{group:{label:i("credentials.list.table_headers.acls.group")},created_at:{label:i("credentials.list.table_headers.acls.created_at")},tags:{label:i("credentials.list.table_headers.acls.tags")}},"basic-auth":{password:{label:i("credentials.list.table_headers.basic-auth.password")},username:{label:i("credentials.list.table_headers.basic-auth.username")},created_at:{label:i("credentials.list.table_headers.basic-auth.created_at")},tags:{label:i("credentials.list.table_headers.basic-auth.tags")}},"key-auth":{key:{label:i("credentials.list.table_headers.key-auth.key")},created_at:{label:i("credentials.list.table_headers.key-auth.created_at")},tags:{label:i("credentials.list.table_headers.key-auth.tags")}},"key-auth-enc":{key:{label:i("credentials.list.table_headers.key-auth-enc.key")},created_at:{label:i("credentials.list.table_headers.key-auth-enc.created_at")},tags:{label:i("credentials.list.table_headers.key-auth-enc.tags")}},oauth2:{name:{label:i("credentials.list.table_headers.oauth2.name")},client_id:{label:i("credentials.list.table_headers.oauth2.client_id")},client_secret:{label:i("credentials.list.table_headers.oauth2.client_secret")},created_at:{label:i("credentials.list.table_headers.oauth2.created_at")},tags:{label:i("credentials.list.table_headers.oauth2.tags")}},"hmac-auth":{username:{label:i("credentials.list.table_headers.hmac-auth.username")},secret:{label:i("credentials.list.table_headers.hmac-auth.secret")},created_at:{label:i("credentials.list.table_headers.hmac-auth.created_at")},tags:{label:i("credentials.list.table_headers.hmac-auth.tags")}},jwt:{key:{label:i("credentials.list.table_headers.jwt.key")},algorithm:{label:i("credentials.list.table_headers.jwt.algorithm")},created_at:{label:i("credentials.list.table_headers.jwt.created_at")},tags:{label:i("credentials.list.table_headers.jwt.tags")}}},p=t.computed(()=>c[a.config.plugin]),m=t.computed(()=>{let u=`${a.config.apiBaseUrl}${xe.list[a.config.app]}`;return a.config.app==="konnect"?u=u.replace(/{controlPlaneId}/gi,a.config.controlPlaneId||"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||""):a.config.app==="kongManager"&&(u=u.replace(/\/{workspace}/gi,a.config.workspace?`/${a.config.workspace}`:"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||"")),u}),{fetcher:y,fetcherState:_}=Or(a.config,m),C=()=>{s.value++},B=t.ref(null),f=(u,w,D)=>{const I=w?u[w]:JSON.stringify(u);if(!D(I)){L(u,w);return}O(u,w)},N=(u,w,D)=>{const{type:I}=u;I==="success"?O(w,D):L(w,D)},O=(u,w)=>{r("copy:success",{entity:u,field:w,message:w?i("credentials.copy.success",{val:u[w]}):i("credentials.copy.success_brief")})},L=(u,w)=>{r("copy:error",{entity:u,field:w,message:i("credentials.error.copy")})},W=u=>({label:i("credentials.actions.edit"),to:a.config.getEditRoute(u)}),g=t.ref(void 0),d=t.ref(!1),b=t.ref(!1),K=t.ref(""),x=Ir(a.config,m.value),E=t.computed(()=>ae[a.config.plugin]),V=u=>{g.value=u,d.value=!0},S=()=>{d.value=!1},T=async()=>{var u,w,D;if((u=g.value)!=null&&u.id){b.value=!0;try{await l.delete(x(g.value.id)),b.value=!1,d.value=!1,s.value++,r("delete:success",g.value)}catch(I){K.value=((D=(w=I.response)==null?void 0:w.data)==null?void 0:D.message)||I.message||i("credentials.error.delete"),r("error",I)}finally{b.value=!1}}},v=t.ref(!0);t.watch(_,u=>{var w,D,I,J;if(Array.isArray((w=u==null?void 0:u.response)==null?void 0:w.data)&&(v.value=u.response.data.length>0),u.status===q.Error){B.value={title:i("credentials.error.general")},(J=(I=(D=u.error)==null?void 0:D.response)==null?void 0:I.data)!=null&&J.message&&(B.value.message=u.error.response.data.message),r("error",u.error);return}B.value=null});const F=t.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:"",title:i("credentials.title")});return t.onBeforeMount(async()=>{await a.canCreate()&&(F.value.title=i(`credentials.list.empty_state.${a.config.plugin}.title`),F.value.ctaText=i(`credentials.list.empty_state.${a.config.plugin}.cta`))}),(u,w)=>{const D=t.resolveComponent("KButton"),I=t.resolveComponent("CopyUuid"),J=t.resolveComponent("KBadge"),Dr=t.resolveComponent("KTruncate"),P=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",jr,[t.createVNode(t.unref(Nr),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-row-click":"","disable-sorting":"","empty-state-options":F.value,"enable-entity-actions":"","error-message":B.value,fetcher:t.unref(y),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumer-credentials-list","table-headers":p.value,"use-action-outside":e.useActionOutside,onSort:C},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ne),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(D,{appearance:"primary","data-testid":"toolbar-add-credential",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)(`credentials.list.toolbar_actions.${e.config.plugin}.new`)),1)]),_:1},8,["to"]),[[t.vShow,v.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),group:t.withCtx(({rowValue:h})=>[t.createElementVNode("b",null,t.toDisplayString(h??"-"),1)]),name:t.withCtx(({rowValue:h})=>[t.createElementVNode("b",null,t.toDisplayString(h??"-"),1)]),username:t.withCtx(({rowValue:h})=>[t.createElementVNode("span",null,t.toDisplayString(h??"-"),1)]),password:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"password"),uuid:k},null,8,["notify","uuid"])]),key:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"key"),uuid:k},null,8,["notify","uuid"])]),client_secret:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"client_secret"),uuid:k},null,8,["notify","uuid"])]),secret:t.withCtx(({row:h,rowValue:k})=>[t.createVNode(I,{format:"redacted",notify:j=>N(j,h,"secret"),uuid:k},null,8,["notify","uuid"])]),created_at:t.withCtx(({rowValue:h})=>[t.createTextVNode(t.toDisplayString(t.unref(o)(h)),1)]),tags:t.withCtx(({rowValue:h})=>[(h==null?void 0:h.length)>0?(t.openBlock(),t.createBlock(Dr,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h,k=>(t.openBlock(),t.createBlock(J,{key:k,onClick:w[0]||(w[0]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(k),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",Br,"-"))]),actions:t.withCtx(({row:h})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-id",onClick:j=>f(h,"id",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.config.plugin==="basic-auth"?(t.openBlock(),t.createBlock(R,{key:0},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-credential",onClick:j=>f(h,"password",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_credential")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),["key-auth","key-auth-enc","jwt"].includes(e.config.plugin)?(t.openBlock(),t.createBlock(R,{key:1},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-key",onClick:j=>f(h,"key",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_key")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),e.config.plugin==="oauth2"?(t.openBlock(),t.createBlock(R,{key:2},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-secret",onClick:j=>f(h,"client_secret",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),e.config.plugin==="hmac-auth"?(t.openBlock(),t.createBlock(R,{key:3},{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-secret",onClick:j=>f(h,"secret",k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):t.createCommentVNode("",!0),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:k})=>[t.createVNode(P,{"data-testid":"action-entity-copy-json",onClick:j=>f(h,void 0,k)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ne),{"auth-function":()=>e.canEdit(h)},{default:t.withCtx(()=>[t.createVNode(P,{"data-testid":"action-entity-edit","has-divider":"",item:W(h.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ne),{"auth-function":()=>e.canDelete(h)},{default:t.withCtx(()=>[t.createVNode(P,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:k=>V(h)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("credentials.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(Ar),{"action-pending":b.value,description:t.unref(i)("credentials.delete.description"),"entity-type":E.value,error:K.value,title:t.unref(i)(`credentials.delete.${e.config.plugin}.title`),visible:d.value,onCancel:S,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f6c6d08c"]]);$.ConsumerCredentialList=vr,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-credentials",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-credentials.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-credentials.es.js",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@kong/kongponents": "9.0.0-alpha.73",
|
|
25
25
|
"axios": "^1.6.2",
|
|
26
|
-
"vue": "^3.3.
|
|
26
|
+
"vue": "^3.3.12",
|
|
27
27
|
"vue-router": "^4.2.5",
|
|
28
|
-
"@kong-ui-public/copy-uuid": "^2.0.
|
|
29
|
-
"@kong-ui-public/i18n": "^2.0.
|
|
28
|
+
"@kong-ui-public/copy-uuid": "^2.0.18",
|
|
29
|
+
"@kong-ui-public/i18n": "^2.0.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@kong/design-tokens": "1.12.3",
|
|
33
33
|
"@kong/kongponents": "9.0.0-alpha.73",
|
|
34
34
|
"axios": "^1.6.2",
|
|
35
|
-
"vue": "^3.3.
|
|
35
|
+
"vue": "^3.3.12",
|
|
36
36
|
"vue-router": "^4.2.5",
|
|
37
|
-
"@kong-ui-public/copy-uuid": "^2.0.
|
|
38
|
-
"@kong-ui-public/i18n": "^2.0.
|
|
37
|
+
"@kong-ui-public/copy-uuid": "^2.0.18",
|
|
38
|
+
"@kong-ui-public/i18n": "^2.0.4"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"errorLimit": "300KB"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@kong-ui-public/entities-shared": "^2.
|
|
55
|
+
"@kong-ui-public/entities-shared": "^2.3.1"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"dev": "cross-env USE_SANDBOX=true vite",
|