@kong-ui-public/entities-consumers 4.2.9 → 4.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-consumers.es.js +75 -77
- package/dist/entities-consumers.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/ConsumerForm.vue.d.ts.map +1 -1
- package/dist/types/consumers-endpoints.d.ts +0 -2
- package/dist/types/consumers-endpoints.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -117,29 +117,27 @@ function yt() {
|
|
|
117
117
|
}
|
|
118
118
|
const ce = {
|
|
119
119
|
useI18n: yt
|
|
120
|
-
},
|
|
120
|
+
}, ne = "/v2/control-planes/{controlPlaneId}/core-entities", re = "/{workspace}", X = {
|
|
121
121
|
list: {
|
|
122
122
|
konnect: {
|
|
123
|
-
all: `${se}/consumers`,
|
|
124
|
-
forConsumerGroup: `${se}/consumer_groups/{consumerGroupId}/consumers`,
|
|
125
|
-
oneForConsumerGroup: `${se}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
|
|
126
|
-
},
|
|
127
|
-
kongManager: {
|
|
128
123
|
all: `${ne}/consumers`,
|
|
129
124
|
forConsumerGroup: `${ne}/consumer_groups/{consumerGroupId}/consumers`,
|
|
130
125
|
oneForConsumerGroup: `${ne}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
|
|
126
|
+
},
|
|
127
|
+
kongManager: {
|
|
128
|
+
all: `${re}/consumers`,
|
|
129
|
+
forConsumerGroup: `${re}/consumer_groups/{consumerGroupId}/consumers`,
|
|
130
|
+
oneForConsumerGroup: `${re}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
form: {
|
|
134
134
|
konnect: {
|
|
135
|
-
validate: `${se}/v1/schemas/json/consumer/validate`,
|
|
136
|
-
create: `${se}/consumers`,
|
|
137
|
-
edit: `${se}/consumers/{id}`
|
|
138
|
-
},
|
|
139
|
-
kongManager: {
|
|
140
|
-
validate: `${ne}/schemas/consumers/validate`,
|
|
141
135
|
create: `${ne}/consumers`,
|
|
142
136
|
edit: `${ne}/consumers/{id}`
|
|
137
|
+
},
|
|
138
|
+
kongManager: {
|
|
139
|
+
create: `${re}/consumers`,
|
|
140
|
+
edit: `${re}/consumers/{id}`
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
143
|
}, ht = { class: "add-consumer-form-container" }, bt = { class: "add-consumer-form-cta" }, _t = { class: "select-item-label" }, Ct = {
|
|
@@ -168,7 +166,7 @@ const ce = {
|
|
|
168
166
|
var h;
|
|
169
167
|
const { i18n: { t: r } } = ce.useI18n(), t = e, w = p, { axiosInstance: n } = he((h = t.config) == null ? void 0 : h.axiosRequestConfig), $ = C([]), {
|
|
170
168
|
debouncedQueryChange: M,
|
|
171
|
-
loading:
|
|
169
|
+
loading: V,
|
|
172
170
|
allRecords: q,
|
|
173
171
|
error: m,
|
|
174
172
|
loadItems: Z,
|
|
@@ -181,34 +179,34 @@ const ce = {
|
|
|
181
179
|
fetchedItemsKey: "data",
|
|
182
180
|
searchKeys: ["username", "id"]
|
|
183
181
|
}
|
|
184
|
-
),
|
|
182
|
+
), O = (c) => c, F = I(() => m.value ? r("consumers.errors.general") : ""), se = C(0), W = I(() => q.value === void 0), z = I(() => Q.value.map((c) => ({
|
|
185
183
|
label: c.username || c.customId,
|
|
186
184
|
value: c.id,
|
|
187
185
|
selected: $.value.includes(c.id),
|
|
188
186
|
data: c
|
|
189
187
|
// we need this to determine whether or not to show the description text
|
|
190
|
-
}))),
|
|
188
|
+
}))), j = (c) => {
|
|
191
189
|
var b;
|
|
192
190
|
const _ = W.value ? Q.value.find((E) => E.id === c) : (b = q.value) == null ? void 0 : b.find((E) => E.id === c);
|
|
193
191
|
return _ ? _.username || _.custom_id : c;
|
|
194
192
|
}, x = () => {
|
|
195
193
|
T.value = "", B.value = [], g.value = [], w("cancel");
|
|
196
|
-
}, B = C([]),
|
|
194
|
+
}, B = C([]), P = C(!1), T = C(""), ee = async () => {
|
|
197
195
|
if (!$.value.length) {
|
|
198
196
|
T.value = "", g.value = [], w("cancel");
|
|
199
197
|
return;
|
|
200
198
|
}
|
|
201
|
-
|
|
199
|
+
P.value = !0, T.value = "", B.value = [], g.value = [];
|
|
202
200
|
try {
|
|
203
201
|
const c = $.value.map((E) => i(E)), _ = await Promise.allSettled(c);
|
|
204
202
|
let b = !0;
|
|
205
203
|
_.forEach((E) => {
|
|
206
204
|
E.status !== "fulfilled" && (b = !1);
|
|
207
|
-
}), b ? (B.value = [], g.value = [], w("add:success", $.value), $.value = []) : (B.value.length && w("add:partial-success", B.value), $.value = [],
|
|
205
|
+
}), b ? (B.value = [], g.value = [], w("add:success", $.value), $.value = []) : (B.value.length && w("add:partial-success", B.value), $.value = [], A(_));
|
|
208
206
|
} catch {
|
|
209
207
|
T.value = r("consumers.errors.add"), w("error", T.value);
|
|
210
208
|
} finally {
|
|
211
|
-
|
|
209
|
+
P.value = !1;
|
|
212
210
|
}
|
|
213
211
|
}, a = I(() => {
|
|
214
212
|
var _, b, E, te;
|
|
@@ -222,23 +220,23 @@ const ce = {
|
|
|
222
220
|
const b = await n.post(a.value, _);
|
|
223
221
|
return B.value.push(c), b;
|
|
224
222
|
} catch (b) {
|
|
225
|
-
let E = `${
|
|
226
|
-
return b.response.status === 409 && (E = `${
|
|
223
|
+
let E = `${j(c)} - ${b.message}`;
|
|
224
|
+
return b.response.status === 409 && (E = `${j(c)} - ${r("consumers.errors.already_added")}`), Promise.reject(Error(E));
|
|
227
225
|
}
|
|
228
|
-
}, g = C([]),
|
|
226
|
+
}, g = C([]), A = (c) => {
|
|
229
227
|
g.value = c.map((_) => {
|
|
230
228
|
var b;
|
|
231
229
|
return (b = _.reason) == null ? void 0 : b.message;
|
|
232
230
|
}).filter(Boolean);
|
|
233
231
|
};
|
|
234
232
|
return ye(z, () => {
|
|
235
|
-
|
|
233
|
+
se.value++;
|
|
236
234
|
}, { immediate: !0, deep: !0 }), ye(() => t.visible, () => {
|
|
237
235
|
t.visible && Z();
|
|
238
236
|
}, { immediate: !0 }), (c, _) => {
|
|
239
237
|
const b = K("KMultiselect"), E = K("KAlert"), te = K("KPrompt");
|
|
240
238
|
return D(), Y(te, {
|
|
241
|
-
"action-button-disabled":
|
|
239
|
+
"action-button-disabled": P.value,
|
|
242
240
|
class: "kong-ui-entities-add-consumers-modal",
|
|
243
241
|
"data-testid": "add-consumer-modal",
|
|
244
242
|
title: o(r)("consumers.consumer_groups.add.title"),
|
|
@@ -257,27 +255,27 @@ const ce = {
|
|
|
257
255
|
"dropdown-footer-text": W.value ? o(r)("consumers.consumer_groups.add.footer") : void 0,
|
|
258
256
|
items: z.value,
|
|
259
257
|
label: o(r)("consumers.consumer_groups.add.consumers_label"),
|
|
260
|
-
loading: o(
|
|
258
|
+
loading: o(V),
|
|
261
259
|
placeholder: o(r)("consumers.consumer_groups.add.consumer_placeholder"),
|
|
262
|
-
readonly:
|
|
260
|
+
readonly: P.value,
|
|
263
261
|
required: "",
|
|
264
262
|
width: "100%",
|
|
265
263
|
onQueryChange: o(M)
|
|
266
264
|
}, {
|
|
267
265
|
"item-template": l(({ item: S }) => [
|
|
268
266
|
k("div", _t, y(S.label), 1),
|
|
269
|
-
|
|
267
|
+
O(S).data.username && O(S).data.custom_id ? (D(), H("div", Ct, y(O(S).data.custom_id), 1)) : J("", !0)
|
|
270
268
|
]),
|
|
271
269
|
_: 1
|
|
272
270
|
}, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
|
|
273
|
-
T.value ||
|
|
271
|
+
T.value || F.value || g.value.length ? (D(), H("div", kt, [
|
|
274
272
|
u(E, { appearance: "danger" }, {
|
|
275
273
|
default: l(() => [
|
|
276
274
|
k("p", null, y(o(r)("consumers.errors.add")), 1),
|
|
277
275
|
g.value.length ? (D(), H("ul", It, [
|
|
278
276
|
(D(!0), H(Qe, null, We(g.value, (S, oe) => (D(), H("li", { key: oe }, y(S), 1))), 128))
|
|
279
277
|
])) : J("", !0),
|
|
280
|
-
k("div", null, y(T.value ||
|
|
278
|
+
k("div", null, y(T.value || F.value), 1)
|
|
281
279
|
]),
|
|
282
280
|
_: 1
|
|
283
281
|
})
|
|
@@ -340,7 +338,7 @@ const ce = {
|
|
|
340
338
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
|
|
341
339
|
setup(e, { emit: p }) {
|
|
342
340
|
var Ee;
|
|
343
|
-
const r = p, t = e, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((Ee = t.config) == null ? void 0 : Ee.axiosRequestConfig),
|
|
341
|
+
const r = p, t = e, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((Ee = t.config) == null ? void 0 : Ee.axiosRequestConfig), V = I(() => t.config.app !== "kongManager" || !!t.config.disableSorting), q = {
|
|
344
342
|
// the Username column is non-hidable
|
|
345
343
|
username: { label: n("consumers.list.table_headers.username"), searchable: !0, sortable: !0, hidable: !1 },
|
|
346
344
|
custom_id: { label: n("consumers.list.table_headers.custom_id"), searchable: !0, sortable: !0 },
|
|
@@ -349,11 +347,11 @@ const ce = {
|
|
|
349
347
|
"data-testid": s.username ?? s.custom_id ?? s.id
|
|
350
348
|
}), Q = () => {
|
|
351
349
|
t.config.consumerGroupId ? Ce() : $.push(t.config.createRoute);
|
|
352
|
-
},
|
|
350
|
+
}, O = I(() => {
|
|
353
351
|
var d, v, R, U;
|
|
354
352
|
let s = `${t.config.apiBaseUrl}${X.list[t.config.app][x.value ? "forConsumerGroup" : "all"]}`;
|
|
355
353
|
return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((v = t.config) == null ? void 0 : v.consumerGroupId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (R = t.config) != null && R.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((U = t.config) == null ? void 0 : U.consumerGroupId) || "")), s;
|
|
356
|
-
}),
|
|
354
|
+
}), F = C(""), se = I(() => {
|
|
357
355
|
const s = t.config.app === "konnect" || t.config.isExactMatch;
|
|
358
356
|
return s ? {
|
|
359
357
|
isExactMatch: s,
|
|
@@ -366,17 +364,17 @@ const ce = {
|
|
|
366
364
|
},
|
|
367
365
|
schema: t.config.filterSchema
|
|
368
366
|
};
|
|
369
|
-
}), { hasRecords: W, handleStateChange: z } = ot(
|
|
367
|
+
}), { hasRecords: W, handleStateChange: z } = ot(F), j = I(() => W.value && t.config.app === "konnect"), x = I(() => !!t.config.consumerGroupId), B = I(
|
|
370
368
|
() => x.value ? "kong-ui-entities-consumers-list-in-group-page" : "kong-ui-entities-consumers-list"
|
|
371
|
-
),
|
|
369
|
+
), P = I(() => x.value && !t.config.paginatedEndpoint ? "consumers" : void 0), {
|
|
372
370
|
fetcher: T,
|
|
373
371
|
fetcherState: ee,
|
|
374
372
|
fetcherCacheKey: a
|
|
375
|
-
} = st(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })),
|
|
376
|
-
|
|
373
|
+
} = st(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), O, P), i = () => {
|
|
374
|
+
F.value = "";
|
|
377
375
|
}, g = () => {
|
|
378
376
|
a.value++;
|
|
379
|
-
},
|
|
377
|
+
}, A = (s) => s ?? "-", h = C(null), c = async (s, d) => {
|
|
380
378
|
const v = s.id;
|
|
381
379
|
if (!await d(v)) {
|
|
382
380
|
r("copy:error", {
|
|
@@ -413,7 +411,7 @@ const ce = {
|
|
|
413
411
|
}), te = (s) => ({
|
|
414
412
|
label: n("consumers.actions.edit"),
|
|
415
413
|
to: t.config.getEditRoute(s)
|
|
416
|
-
}), S = C(void 0), oe = C(!1), ae = C(!1), _e = C(""), Te = nt(t.config,
|
|
414
|
+
}), S = C(void 0), oe = C(!1), ae = C(!1), _e = C(""), Te = nt(t.config, O.value), Ue = (s) => {
|
|
417
415
|
S.value = s, oe.value = !0;
|
|
418
416
|
}, Be = () => {
|
|
419
417
|
oe.value = !1;
|
|
@@ -437,20 +435,20 @@ const ce = {
|
|
|
437
435
|
d || ke(), a.value++, r("add:success", s);
|
|
438
436
|
}, qe = () => {
|
|
439
437
|
x.value && Ce();
|
|
440
|
-
},
|
|
441
|
-
|
|
438
|
+
}, N = C(void 0), me = C(!1), Ne = C(""), Oe = (s) => {
|
|
439
|
+
N.value = s, me.value = !0;
|
|
442
440
|
}, we = () => {
|
|
443
|
-
me.value = !1,
|
|
441
|
+
me.value = !1, N.value = void 0;
|
|
444
442
|
}, je = I(() => {
|
|
445
443
|
var d, v, R, U;
|
|
446
444
|
let s = `${t.config.apiBaseUrl}${X.list[t.config.app].oneForConsumerGroup}`;
|
|
447
445
|
return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((v = t.config) == null ? void 0 : v.consumerGroupId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (R = t.config) != null && R.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((U = t.config) == null ? void 0 : U.consumerGroupId) || "")), s;
|
|
448
446
|
}), $e = C(!1), Le = async () => {
|
|
449
|
-
if (
|
|
447
|
+
if (N.value) {
|
|
450
448
|
$e.value = !0;
|
|
451
449
|
try {
|
|
452
|
-
const s = je.value.replace(/{consumerId}/gi,
|
|
453
|
-
await M.delete(s), r("remove:success",
|
|
450
|
+
const s = je.value.replace(/{consumerId}/gi, N.value.id);
|
|
451
|
+
await M.delete(s), r("remove:success", N.value), we(), a.value++;
|
|
454
452
|
} catch (s) {
|
|
455
453
|
Ne.value = s.message || n("consumers.errors.delete"), r("error", s);
|
|
456
454
|
} finally {
|
|
@@ -481,7 +479,7 @@ const ce = {
|
|
|
481
479
|
return D(), H("div", Et, [
|
|
482
480
|
u(o(at), {
|
|
483
481
|
"cache-identifier": e.cacheIdentifier,
|
|
484
|
-
"disable-sorting":
|
|
482
|
+
"disable-sorting": V.value,
|
|
485
483
|
"empty-state-options": pe.value,
|
|
486
484
|
"enable-entity-actions": "",
|
|
487
485
|
"error-message": h.value,
|
|
@@ -490,7 +488,7 @@ const ce = {
|
|
|
490
488
|
"hide-pagination": x.value && !e.config.paginatedEndpoint,
|
|
491
489
|
"pagination-type": "offset",
|
|
492
490
|
"preferences-storage-key": B.value,
|
|
493
|
-
query:
|
|
491
|
+
query: F.value,
|
|
494
492
|
"row-attributes": Z,
|
|
495
493
|
"table-headers": o(m),
|
|
496
494
|
onClearSearchInput: i,
|
|
@@ -503,9 +501,9 @@ const ce = {
|
|
|
503
501
|
Ge(s.$slots, "toolbar-filter", {}, void 0, !0),
|
|
504
502
|
x.value ? J("", !0) : (D(), Y(o(lt), {
|
|
505
503
|
key: 0,
|
|
506
|
-
modelValue:
|
|
507
|
-
"onUpdate:modelValue": d[0] || (d[0] = (f) =>
|
|
508
|
-
config:
|
|
504
|
+
modelValue: F.value,
|
|
505
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => F.value = f),
|
|
506
|
+
config: se.value
|
|
509
507
|
}, null, 8, ["modelValue", "config"]))
|
|
510
508
|
]),
|
|
511
509
|
"toolbar-button": l(() => [
|
|
@@ -514,7 +512,7 @@ const ce = {
|
|
|
514
512
|
to: "#kong-ui-app-page-header-action-button"
|
|
515
513
|
}, [
|
|
516
514
|
k("div", St, [
|
|
517
|
-
!x.value &&
|
|
515
|
+
!x.value && j.value ? (D(), Y(v, {
|
|
518
516
|
key: 0,
|
|
519
517
|
appearance: "secondary",
|
|
520
518
|
class: "open-learning-hub",
|
|
@@ -550,10 +548,10 @@ const ce = {
|
|
|
550
548
|
], 8, ["disabled"]))
|
|
551
549
|
]),
|
|
552
550
|
username: l(({ rowValue: f }) => [
|
|
553
|
-
k("b", null, y(
|
|
551
|
+
k("b", null, y(A(f)), 1)
|
|
554
552
|
]),
|
|
555
553
|
custom_id: l(({ rowValue: f }) => [
|
|
556
|
-
L(y(
|
|
554
|
+
L(y(A(f)), 1)
|
|
557
555
|
]),
|
|
558
556
|
tags: l(({ rowValue: f }) => [
|
|
559
557
|
u(o(it), { tags: f }, null, 8, ["tags"])
|
|
@@ -631,7 +629,7 @@ const ce = {
|
|
|
631
629
|
]),
|
|
632
630
|
_: 2
|
|
633
631
|
}, [
|
|
634
|
-
!
|
|
632
|
+
!F.value && e.config.app === "konnect" ? {
|
|
635
633
|
name: "empty-state",
|
|
636
634
|
fn: l(() => {
|
|
637
635
|
var f;
|
|
@@ -708,7 +706,7 @@ const ce = {
|
|
|
708
706
|
"onAdd:success": d[5] || (d[5] = (f) => Ie(f)),
|
|
709
707
|
onCancel: ke
|
|
710
708
|
}, null, 8, ["config", "visible"])) : J("", !0),
|
|
711
|
-
e.config.consumerGroupId &&
|
|
709
|
+
e.config.consumerGroupId && N.value ? (D(), Y(He, {
|
|
712
710
|
key: 1,
|
|
713
711
|
"action-button-appearance": "danger",
|
|
714
712
|
"data-testid": "remove-consumer-modal",
|
|
@@ -724,7 +722,7 @@ const ce = {
|
|
|
724
722
|
tag: "p"
|
|
725
723
|
}, ge({
|
|
726
724
|
consumer: l(() => [
|
|
727
|
-
k("strong", null, y(
|
|
725
|
+
k("strong", null, y(N.value.username || N.value.custom_id || N.value.id), 1)
|
|
728
726
|
]),
|
|
729
727
|
_: 2
|
|
730
728
|
}, [
|
|
@@ -789,7 +787,7 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
789
787
|
emits: ["update", "error", "loading"],
|
|
790
788
|
setup(e, { emit: p }) {
|
|
791
789
|
var ee;
|
|
792
|
-
const r = e, t = p, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((ee = r.config) == null ? void 0 : ee.axiosRequestConfig), { getMessageFromError:
|
|
790
|
+
const r = e, t = p, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((ee = r.config) == null ? void 0 : ee.axiosRequestConfig), { getMessageFromError: V } = dt(), q = Vt(), m = Me({
|
|
793
791
|
fields: {
|
|
794
792
|
username: "",
|
|
795
793
|
customId: "",
|
|
@@ -804,23 +802,23 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
804
802
|
}), Q = I(() => {
|
|
805
803
|
var a, i;
|
|
806
804
|
return (i = X.form[(a = r.config) == null ? void 0 : a.app]) == null ? void 0 : i.edit;
|
|
807
|
-
}),
|
|
805
|
+
}), O = () => {
|
|
808
806
|
var a;
|
|
809
807
|
$.push(((a = r.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
|
|
810
|
-
},
|
|
808
|
+
}, F = (a) => {
|
|
811
809
|
t("loading", a);
|
|
812
|
-
},
|
|
810
|
+
}, se = (a) => {
|
|
813
811
|
t("error", a);
|
|
814
812
|
}, W = (a) => {
|
|
815
|
-
var g,
|
|
816
|
-
m.fields.username = ((g = a == null ? void 0 : a.item) == null ? void 0 : g.username) || (a == null ? void 0 : a.username) || "", m.fields.customId = ((
|
|
813
|
+
var g, A, h;
|
|
814
|
+
m.fields.username = ((g = a == null ? void 0 : a.item) == null ? void 0 : g.username) || (a == null ? void 0 : a.username) || "", m.fields.customId = ((A = a == null ? void 0 : a.item) == null ? void 0 : A.custom_id) || (a == null ? void 0 : a.custom_id) || "";
|
|
817
815
|
const i = ((h = a == null ? void 0 : a.item) == null ? void 0 : h.tags) || (a == null ? void 0 : a.tags) || [];
|
|
818
816
|
m.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(Z, m.fields);
|
|
819
|
-
}, z = I(() => r.consumerId ? Re.Edit : Re.Create),
|
|
820
|
-
var g,
|
|
821
|
-
let i = `${(g = r.config) == null ? void 0 : g.apiBaseUrl}${X.form[(
|
|
817
|
+
}, z = I(() => r.consumerId ? Re.Edit : Re.Create), j = (a) => {
|
|
818
|
+
var g, A, h, c, _, b;
|
|
819
|
+
let i = `${(g = r.config) == null ? void 0 : g.apiBaseUrl}${X.form[(A = r.config) == null ? void 0 : A.app][a]}`;
|
|
822
820
|
return ((h = r.config) == null ? void 0 : h.app) === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((c = r.config) == null ? void 0 : c.controlPlaneId) || "") : ((_ = r.config) == null ? void 0 : _.app) === "kongManager" && (i = i.replace(/\/{workspace}/gi, (b = r.config) != null && b.workspace ? `/${r.config.workspace}` : "")), i = i.replace(/{id}/gi, r.consumerId), i;
|
|
823
|
-
}, x = I(() => !!m.fields.username || !!m.fields.customId), B = I(() => JSON.stringify(m.fields) !== JSON.stringify(Z)),
|
|
821
|
+
}, x = I(() => !!m.fields.username || !!m.fields.customId), B = I(() => JSON.stringify(m.fields) !== JSON.stringify(Z)), P = I(() => {
|
|
824
822
|
var a, i;
|
|
825
823
|
return {
|
|
826
824
|
username: m.fields.username || null,
|
|
@@ -832,15 +830,15 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
832
830
|
try {
|
|
833
831
|
m.readonly = !0;
|
|
834
832
|
let i;
|
|
835
|
-
|
|
833
|
+
z.value === "create" ? i = await M.post(j("create"), P.value) : z.value === "edit" && (i = ((a = r.config) == null ? void 0 : a.app) === "konnect" ? await M.put(j("edit"), P.value) : await M.patch(j("edit"), P.value)), W(i == null ? void 0 : i.data), t("update", i == null ? void 0 : i.data);
|
|
836
834
|
} catch (i) {
|
|
837
|
-
m.errorMessage =
|
|
835
|
+
m.errorMessage = V(i), t("error", i);
|
|
838
836
|
} finally {
|
|
839
837
|
m.readonly = !1;
|
|
840
838
|
}
|
|
841
839
|
};
|
|
842
840
|
return (a, i) => {
|
|
843
|
-
const g = K("KInput"),
|
|
841
|
+
const g = K("KInput"), A = K("KCard");
|
|
844
842
|
return D(), H("div", Ft, [
|
|
845
843
|
u(o(mt), {
|
|
846
844
|
"can-submit": x.value && B.value,
|
|
@@ -849,12 +847,12 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
849
847
|
"entity-type": o(Pe).Consumer,
|
|
850
848
|
"error-message": m.errorMessage,
|
|
851
849
|
"fetch-url": Q.value,
|
|
852
|
-
"form-fields":
|
|
850
|
+
"form-fields": P.value,
|
|
853
851
|
"is-readonly": m.readonly,
|
|
854
|
-
onCancel:
|
|
855
|
-
"onFetch:error": i[3] || (i[3] = (h) =>
|
|
852
|
+
onCancel: O,
|
|
853
|
+
"onFetch:error": i[3] || (i[3] = (h) => se(h)),
|
|
856
854
|
"onFetch:success": W,
|
|
857
|
-
onLoading: i[4] || (i[4] = (h) =>
|
|
855
|
+
onLoading: i[4] || (i[4] = (h) => F(h)),
|
|
858
856
|
onSubmit: T
|
|
859
857
|
}, {
|
|
860
858
|
default: l(() => [
|
|
@@ -872,7 +870,7 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
872
870
|
}, y(o(n)("consumers.form.consumer_identification.title")) + "* ", 9, Pt),
|
|
873
871
|
k("p", Tt, y(o(n)("consumers.form.consumer_identification.description")), 1)
|
|
874
872
|
]),
|
|
875
|
-
u(
|
|
873
|
+
u(A, null, {
|
|
876
874
|
default: l(() => [
|
|
877
875
|
k("fieldset", {
|
|
878
876
|
"aria-labelledby": `fields-group-title-${o(q)}`
|
|
@@ -958,7 +956,7 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
958
956
|
]);
|
|
959
957
|
};
|
|
960
958
|
}
|
|
961
|
-
}), Jt = /* @__PURE__ */ be(Bt, [["__scopeId", "data-v-
|
|
959
|
+
}), Jt = /* @__PURE__ */ be(Bt, [["__scopeId", "data-v-ecefc72c"]]), Kt = { class: "kong-ui-consumer-entity-config-card" }, Qt = /* @__PURE__ */ ue({
|
|
962
960
|
__name: "ConsumerConfigCard",
|
|
963
961
|
props: {
|
|
964
962
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1018,9 +1016,9 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { clas
|
|
|
1018
1016
|
"entity-type": o(Pe).Consumer,
|
|
1019
1017
|
"fetch-url": w.value,
|
|
1020
1018
|
"hide-title": e.hideTitle,
|
|
1021
|
-
"onFetch:error": M[0] || (M[0] = (
|
|
1022
|
-
"onFetch:success": M[1] || (M[1] = (
|
|
1023
|
-
onLoading: M[2] || (M[2] = (
|
|
1019
|
+
"onFetch:error": M[0] || (M[0] = (V) => $.$emit("fetch:error", V)),
|
|
1020
|
+
"onFetch:success": M[1] || (M[1] = (V) => $.$emit("fetch:success", V)),
|
|
1021
|
+
onLoading: M[2] || (M[2] = (V) => $.$emit("loading", V))
|
|
1024
1022
|
}, {
|
|
1025
1023
|
"username-label-tooltip": l(() => [
|
|
1026
1024
|
u(o(t), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumers"]={},E.Vue,E.VueRouter,E.KongIcons,E["kong-ui-public-i18n"],E["kong-ui-public-entities-shared"]))})(this,function(E,e,ae,z,ie,u){"use strict";const he={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},empty_state_v2:{title:"Configure your first consumer",group:"Consumers created in gateways within this group will automatically appear here.",description:"Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control.",learn_more:"Learn more"},toolbar_actions:{new_consumer:"New consumer"}},title:"Consumers",search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact username or ID"}},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group and delete all its plugins. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function Ce(){const t=ie.createI18n("en-us",he);return{i18n:t,i18nT:ie.i18nTComponent(t)}}const X={useI18n:Ce},j="/v2/control-planes/{controlPlaneId}/core-entities",L="/{workspace}",U={list:{konnect:{all:`${j}/consumers`,forConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`},kongManager:{all:`${L}/consumers`,forConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{validate:`${j}/v1/schemas/json/consumer/validate`,create:`${j}/consumers`,edit:`${j}/consumers/{id}`},kongManager:{validate:`${L}/schemas/consumers/validate`,create:`${L}/consumers`,edit:`${L}/consumers/{id}`}}},be={class:"add-consumer-form-container"},ke={class:"add-consumer-form-cta"},_e={class:"select-item-label"},we={key:0,class:"select-item-desc"},Ve={key:0,class:"kong-ui-entity-add-consumers-error"},Ie={key:0},Ne=e.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(t,{emit:m}){var y;const{i18n:{t:s}}=X.useI18n(),o=t,k=m,{axiosInstance:r}=u.useAxios((y=o.config)==null?void 0:y.axiosRequestConfig),_=e.ref([]),{debouncedQueryChange:I,loading:B,allRecords:A,error:d,loadItems:H,results:q}=u.useDebouncedFilter(o.config,U.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),F=l=>l,S=e.computed(()=>d.value?s("consumers.errors.general"):""),Y=e.ref(0),K=e.computed(()=>A.value===void 0),O=e.computed(()=>q.value.map(l=>({label:l.username||l.customId,value:l.id,selected:_.value.includes(l.id),data:l}))),R=l=>{var h;const C=K.value?q.value.find(w=>w.id===l):(h=A.value)==null?void 0:h.find(w=>w.id===l);return C?C.username||C.custom_id:l},N=()=>{G.value="",T.value=[],f.value=[],k("cancel")},T=e.ref([]),D=e.ref(!1),G=e.ref(""),W=async()=>{if(!_.value.length){G.value="",f.value=[],k("cancel");return}D.value=!0,G.value="",T.value=[],f.value=[];try{const l=_.value.map(w=>i(w)),C=await Promise.allSettled(l);let h=!0;C.forEach(w=>{w.status!=="fulfilled"&&(h=!1)}),h?(T.value=[],f.value=[],k("add:success",_.value),_.value=[]):(T.value.length&&k("add:partial-success",T.value),_.value=[],$(C))}catch{G.value=s("consumers.errors.add"),k("error",G.value)}finally{D.value=!1}},a=e.computed(()=>{var C,h,w,J;let l=`${o.config.apiBaseUrl}${U.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(w=o.config)!=null&&w.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((J=o.config)==null?void 0:J.consumerGroupId)||"")),l}),i=async l=>{const C={consumer:l};try{const h=await r.post(a.value,C);return T.value.push(l),h}catch(h){let w=`${R(l)} - ${h.message}`;return h.response.status===409&&(w=`${R(l)} - ${s("consumers.errors.already_added")}`),Promise.reject(Error(w))}},f=e.ref([]),$=l=>{f.value=l.map(C=>{var h;return(h=C.reason)==null?void 0:h.message}).filter(Boolean)};return e.watch(O,()=>{Y.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&H()},{immediate:!0}),(l,C)=>{const h=e.resolveComponent("KMultiselect"),w=e.resolveComponent("KAlert"),J=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(J,{"action-button-disabled":D.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(s)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:N,onProceed:W},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",ke,e.toDisplayString(e.unref(s)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(h,{modelValue:_.value,"onUpdate:modelValue":C[0]||(C[0]=V=>_.value=V),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":K.value?e.unref(s)("consumers.consumer_groups.add.footer"):void 0,items:O.value,label:e.unref(s)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(B),placeholder:e.unref(s)("consumers.consumer_groups.add.consumer_placeholder"),readonly:D.value,required:"",width:"100%",onQueryChange:e.unref(I)},{"item-template":e.withCtx(({item:V})=>[e.createElementVNode("div",_e,e.toDisplayString(V.label),1),F(V).data.username&&F(V).data.custom_id?(e.openBlock(),e.createElementBlock("div",we,e.toDisplayString(F(V).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),G.value||S.value||f.value.length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(w,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(s)("consumers.errors.add")),1),f.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(V,Q)=>(e.openBlock(),e.createElementBlock("li",{key:Q},e.toDisplayString(V),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(G.value||S.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ee=(t,m)=>{const s=t.__vccOpts||t;for(const[o,k]of m)s[o]=k;return s},xe=ee(Ne,[["__scopeId","data-v-d54468ab"]]),Ee={class:"kong-ui-entities-consumers-list"},De={class:"button-row"},$e={class:"empty-state-wrapper"},Be=ee(e.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},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},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:m}){var ge;const s=m,o=t,{i18nT:k,i18n:{t:r}}=X.useI18n(),_=ae.useRouter(),{axiosInstance:I}=u.useAxios((ge=o.config)==null?void 0:ge.axiosRequestConfig),B=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),A={username:{label:r("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:r("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:r("consumers.list.table_headers.tags"),sortable:!1}},d=A,H=n=>({"data-testid":n.username??n.custom_id??n.id}),q=()=>{o.config.consumerGroupId?de():_.push(o.config.createRoute)},F=e.computed(()=>{var c,g,x,M;let n=`${o.config.apiBaseUrl}${U.list[o.config.app][N.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((g=o.config)==null?void 0:g.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((M=o.config)==null?void 0:M.consumerGroupId)||"")),n}),S=e.ref(""),Y=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:r(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:A.username,custom_id:A.custom_id},schema:o.config.filterSchema}}),{hasRecords:K,handleStateChange:O}=u.useTableState(S),R=e.computed(()=>K.value&&o.config.app==="konnect"),N=e.computed(()=>!!o.config.consumerGroupId),T=e.computed(()=>N.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),D=e.computed(()=>N.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:G,fetcherState:W,fetcherCacheKey:a}=u.useFetcher(e.computed(()=>({...o.config,cacheIdentifier:o.cacheIdentifier})),F,D),i=()=>{S.value=""},f=()=>{a.value++},$=n=>n??"-",y=e.ref(null),l=async(n,c)=>{const g=n.id;if(!await c(g)){s("copy:error",{entity:n,field:"id",message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,field:"id",message:r("consumers.copy.success",{val:g})})},C=(n,c)=>{const g=JSON.stringify(n);if(!c(g)){s("copy:error",{entity:n,message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,message:r("consumers.copy.success_brief")})},h=async n=>{var g;await((g=o.canRetrieve)==null?void 0:g.call(o,n))&&_.push(o.config.getViewRoute(n.id))},w=n=>({label:r("consumers.actions.view"),to:o.config.getViewRoute(n)}),J=n=>({label:r("consumers.actions.edit"),to:o.config.getEditRoute(n)}),V=e.ref(void 0),Q=e.ref(!1),Z=e.ref(!1),ce=e.ref(""),Oe=u.useDeleteUrlBuilder(o.config,F.value),je=n=>{V.value=n,Q.value=!0},Le=()=>{Q.value=!1},He=async()=>{var n,c,g;if((n=V.value)!=null&&n.id){Z.value=!0;try{await I.delete(Oe(V.value.id)),Z.value=!1,Q.value=!1,a.value++,s("delete:success",V.value)}catch(x){ce.value=((g=(c=x.response)==null?void 0:c.data)==null?void 0:g.message)||x.message||r("consumers.errors.delete"),s("error",x)}finally{Z.value=!1}}},oe=e.ref(!1),de=()=>{oe.value=!0},ue=()=>{oe.value=!1},me=(n,c)=>{c||ue(),a.value++,s("add:success",n)},We=()=>{N.value&&de()},P=e.ref(void 0),ne=e.ref(!1),Je=e.ref(""),Qe=n=>{P.value=n,ne.value=!0},pe=()=>{ne.value=!1,P.value=void 0},ze=e.computed(()=>{var c,g,x,M;let n=`${o.config.apiBaseUrl}${U.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((g=o.config)==null?void 0:g.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((M=o.config)==null?void 0:M.consumerGroupId)||"")),n}),fe=e.ref(!1),Ye=async()=>{if(P.value){fe.value=!0;try{const n=ze.value.replace(/{consumerId}/gi,P.value.id);await I.delete(n),s("remove:success",P.value),pe(),a.value++}catch(n){Je.value=n.message||r("consumers.errors.delete"),s("error",n)}finally{fe.value=!1}}};e.watch(W,n=>{var c,g,x;if(n.status===u.FetcherStatus.Error){y.value={title:r("consumers.errors.general")},(x=(g=(c=n.error)==null?void 0:c.response)==null?void 0:g.data)!=null&&x.message&&(y.value.message=n.error.response.data.message),s("error",n.error);return}y.value=null});const re=e.ref({ctaPath:N.value?void 0:o.config.createRoute,ctaText:void 0,message:`${r("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:r("consumers.title")}),se=e.ref(!1);return e.onBeforeMount(async()=>{se.value=await o.canCreate(),se.value&&(re.value.title=N.value?r("consumers.list.empty_state.title_for_consumer_group"):r("consumers.list.empty_state.title"),re.value.ctaText=N.value?r("consumers.actions.add_consumer"):r("consumers.actions.create"))}),(n,c)=>{const g=e.resolveComponent("KButton"),x=e.resolveComponent("KEmptyState"),M=e.resolveComponent("KDropdownItem"),ye=e.resolveComponent("KClipboardProvider"),Xe=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(u.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-sorting":B.value,"empty-state-options":re.value,"enable-entity-actions":"","error-message":y.value,fetcher:e.unref(G),"fetcher-cache-key":e.unref(a),"hide-pagination":N.value&&!t.config.paginatedEndpoint,"pagination-type":"offset","preferences-storage-key":T.value,query:S.value,"row-attributes":H,"table-headers":e.unref(d),onClearSearchInput:i,"onClick:row":c[3]||(c[3]=p=>h(p)),onEmptyStateCtaClicked:We,onSort:f,onState:e.unref(O)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.renderSlot(n.$slots,"toolbar-filter",{},void 0,!0),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.EntityFilter),{key:0,modelValue:S.value,"onUpdate:modelValue":c[0]||(c[0]=p=>S.value=p),config:Y.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!t.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",De,[!N.value&&R.value?(e.openBlock(),e.createBlock(g,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumers-learn-more-button",icon:"",onClick:c[1]||(c[1]=p=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(g,{appearance:"primary","data-testid":"toolbar-add-consumer",size:t.useActionOutside?"medium":"large",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.add_consumer"):e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["size"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),username:e.withCtx(({rowValue:p})=>[e.createElementVNode("b",null,e.toDisplayString($(p)),1)]),custom_id:e.withCtx(({rowValue:p})=>[e.createTextVNode(e.toDisplayString($(p)),1)]),tags:e.withCtx(({rowValue:p})=>[e.createVNode(e.unref(u.TableTags),{tags:p},null,8,["tags"])]),actions:e.withCtx(({row:p})=>[e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(M,{"data-testid":"action-entity-copy-id",onClick:Ze=>l(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(M,{"data-testid":"action-entity-copy-json",onClick:Ze=>C(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(p)},{default:e.withCtx(()=>[e.createVNode(M,{"data-testid":"action-entity-view","has-divider":"",item:w(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canEdit(p)},{default:e.withCtx(()=>[e.createVNode(M,{"data-testid":"action-entity-edit",item:J(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canDelete(p)},{default:e.withCtx(()=>[e.createVNode(M,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?Qe(p):je(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.remove"):e.unref(r)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!S.value&&t.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var p;return[e.createElementVNode("div",$e,[e.renderSlot(n.$slots,"empty-state-toolbar",{},void 0,!0),e.createVNode(x,{"data-testid":t.config.consumerGroupId?"nested-consumers-entity-empty-state":"consumers-entity-empty-state","icon-background":"",message:e.unref(r)("consumers.list.empty_state_v2.description"),title:e.unref(r)("consumers.list.empty_state_v2.title")},e.createSlots({icon:e.withCtx(()=>[e.createVNode(e.unref(z.TeamIcon),{decorative:""})]),action:e.withCtx(()=>[se.value?(e.openBlock(),e.createBlock(g,{key:0,"data-testid":"entity-create-button",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(g,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:c[2]||(c[2]=v=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(p=t.config)!=null&&p.isControlPlaneGroup?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["data-testid","message","title"])])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-pagination","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(u.EntityDeleteModal),{"action-button-disabled":Z.value,"data-testid":"delete-consumer-modal",description:e.unref(r)("consumers.delete.description"),"entity-name":V.value&&(V.value.username||V.value.custom_id||V.value.id),"entity-type":e.unref(u.EntityTypes).Consumer,error:ce.value,title:e.unref(r)("consumers.delete.title"),visible:Q.value,onCancel:Le,onProceed:He},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),t.config.consumerGroupId?(e.openBlock(),e.createBlock(xe,{key:0,config:t.config,"data-testid":"add-consumer-modal",visible:oe.value,"onAdd:partialSuccess":c[4]||(c[4]=p=>me(p,!0)),"onAdd:success":c[5]||(c[5]=p=>me(p)),onCancel:ue},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&P.value?(e.openBlock(),e.createBlock(Xe,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(r)("consumers.consumer_groups.remove.title"),visible:ne.value,onCancel:pe,onProceed:Ye},{default:e.withCtx(()=>[e.createVNode(e.unref(k),{class:"message",keypath:t.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},e.createSlots({consumer:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(P.value.username||P.value.custom_id||P.value.id),1)]),_:2},[t.config.consumerGroupName?{name:"consumerGroup",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(t.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-4737bfb9"]]),b=[];for(let t=0;t<256;++t)b.push((t+256).toString(16).slice(1));function Se(t,m=0){return(b[t[m+0]]+b[t[m+1]]+b[t[m+2]]+b[t[m+3]]+"-"+b[t[m+4]]+b[t[m+5]]+"-"+b[t[m+6]]+b[t[m+7]]+"-"+b[t[m+8]]+b[t[m+9]]+"-"+b[t[m+10]]+b[t[m+11]]+b[t[m+12]]+b[t[m+13]]+b[t[m+14]]+b[t[m+15]]).toLowerCase()}let te;const Ge=new Uint8Array(16);function Me(){if(!te){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");te=crypto.getRandomValues.bind(crypto)}return te(Ge)}const le={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Te(t,m,s){var k;if(le.randomUUID&&!t)return le.randomUUID();t=t||{};const o=t.random??((k=t.rng)==null?void 0:k.call(t))??Me();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Se(o)}const Ae={class:"kong-ui-entities-consumer-form"},Re=["id"],Pe={class:"fields-group-text"},Fe=["aria-labelledby"],Ue=ee(e.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||(t==null?void 0:t.app)==="konnect"&&!(t!=null&&t.controlPlaneId)||(t==null?void 0:t.app)==="kongManager"&&typeof(t==null?void 0:t.workspace)!="string"||!(t!=null&&t.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:m}){var W;const s=t,o=m,{i18nT:k,i18n:{t:r}}=X.useI18n(),_=ae.useRouter(),{axiosInstance:I}=u.useAxios((W=s.config)==null?void 0:W.axiosRequestConfig),{getMessageFromError:B}=u.useErrors(),A=Te(),d=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),H=e.reactive({username:"",customId:"",tags:""}),q=e.computed(()=>{var a,i;return(i=U.form[(a=s.config)==null?void 0:a.app])==null?void 0:i.edit}),F=()=>{var a;_.push(((a=s.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},S=a=>{o("loading",a)},Y=a=>{o("error",a)},K=a=>{var f,$,y;d.fields.username=((f=a==null?void 0:a.item)==null?void 0:f.username)||(a==null?void 0:a.username)||"",d.fields.customId=(($=a==null?void 0:a.item)==null?void 0:$.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((y=a==null?void 0:a.item)==null?void 0:y.tags)||(a==null?void 0:a.tags)||[];d.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(H,d.fields)},O=e.computed(()=>s.consumerId?u.EntityBaseFormType.Edit:u.EntityBaseFormType.Create),R=a=>{var f,$,y,l,C,h;let i=`${(f=s.config)==null?void 0:f.apiBaseUrl}${U.form[($=s.config)==null?void 0:$.app][a]}`;return((y=s.config)==null?void 0:y.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=s.config)==null?void 0:l.controlPlaneId)||""):((C=s.config)==null?void 0:C.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(h=s.config)!=null&&h.workspace?`/${s.config.workspace}`:"")),i=i.replace(/{id}/gi,s.consumerId),i},N=e.computed(()=>!!d.fields.username||!!d.fields.customId),T=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(H)),D=e.computed(()=>{var a,i;return{username:d.fields.username||null,custom_id:d.fields.customId||null,tags:(i=(a=d.fields.tags.split(","))==null?void 0:a.map(f=>String(f||"").trim()))==null?void 0:i.filter(f=>f!=="")}}),G=async()=>{var a;try{d.readonly=!0;let i;await I.post(R("validate"),D.value),O.value==="create"?i=await I.post(R("create"),D.value):O.value==="edit"&&(i=((a=s.config)==null?void 0:a.app)==="konnect"?await I.put(R("edit"),D.value):await I.patch(R("edit"),D.value)),K(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){d.errorMessage=B(i),o("error",i)}finally{d.readonly=!1}};return(a,i)=>{const f=e.resolveComponent("KInput"),$=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(u.EntityBaseForm),{"can-submit":N.value&&T.value,config:t.config,"edit-id":t.consumerId,"entity-type":e.unref(u.SupportedEntityType).Consumer,"error-message":d.errorMessage,"fetch-url":q.value,"form-fields":D.value,"is-readonly":d.readonly,onCancel:F,"onFetch:error":i[3]||(i[3]=y=>Y(y)),"onFetch:success":K,onLoading:i[4]||(i[4]=y=>S(y)),onSubmit:G},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(u.EntityFormSection),{description:e.unref(r)("consumers.form.info.description"),"has-divider":"",title:e.unref(r)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(A)}`,class:"fields-group-title"},e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.title"))+"* ",9,Re),e.createElementVNode("p",Pe,e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.description")),1)]),e.createVNode($,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(A)}`},[e.createVNode(f,{modelValue:d.fields.username,"onUpdate:modelValue":i[0]||(i[0]=y=>d.fields.username=y),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(r)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.username.placeholder"),readonly:d.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(k),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(f,{modelValue:d.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=y=>d.fields.customId=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(r)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.custom_id.placeholder"),readonly:d.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(k),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Fe)]),_:1}),e.createVNode(f,{modelValue:d.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=y=>d.fields.tags=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(r)("consumers.fields.tags.help"),label:e.unref(r)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(r)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.tags.placeholder"),readonly:d.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ab3e5b9b"]]),qe={class:"kong-ui-consumer-entity-config-card"},Ke=e.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const m=t,{i18n:{t:s},i18nT:o}=X.useI18n(),k=e.computed(()=>U.form[m.config.app].edit),r=e.ref({id:{},username:{section:u.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.username.tooltip"),order:1},custom_id:{section:u.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.custom_id.tooltip"),label:s("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:s("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(_,I)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createVNode(e.unref(u.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":r.value,"entity-type":e.unref(u.SupportedEntityType).Consumer,"fetch-url":k.value,"hide-title":t.hideTitle,"onFetch:error":I[0]||(I[0]=B=>_.$emit("fetch:error",B)),"onFetch:success":I[1]||(I[1]=B=>_.$emit("fetch:success",B)),onLoading:I[2]||(I[2]=B=>_.$emit("loading",B))},{"username-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Ke,E.ConsumerForm=Ue,E.ConsumerList=Be,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumers"]={},E.Vue,E.VueRouter,E.KongIcons,E["kong-ui-public-i18n"],E["kong-ui-public-entities-shared"]))})(this,function(E,e,ae,J,ie,u){"use strict";const he={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},empty_state_v2:{title:"Configure your first consumer",group:"Consumers created in gateways within this group will automatically appear here.",description:"Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control.",learn_more:"Learn more"},toolbar_actions:{new_consumer:"New consumer"}},title:"Consumers",search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact username or ID"}},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group and delete all its plugins. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function Ce(){const t=ie.createI18n("en-us",he);return{i18n:t,i18nT:ie.i18nTComponent(t)}}const X={useI18n:Ce},Q="/v2/control-planes/{controlPlaneId}/core-entities",z="/{workspace}",U={list:{konnect:{all:`${Q}/consumers`,forConsumerGroup:`${Q}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${Q}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`},kongManager:{all:`${z}/consumers`,forConsumerGroup:`${z}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${z}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{create:`${Q}/consumers`,edit:`${Q}/consumers/{id}`},kongManager:{create:`${z}/consumers`,edit:`${z}/consumers/{id}`}}},be={class:"add-consumer-form-container"},ke={class:"add-consumer-form-cta"},_e={class:"select-item-label"},we={key:0,class:"select-item-desc"},Ve={key:0,class:"kong-ui-entity-add-consumers-error"},Ie={key:0},Ne=e.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(t,{emit:m}){var y;const{i18n:{t:s}}=X.useI18n(),o=t,k=m,{axiosInstance:r}=u.useAxios((y=o.config)==null?void 0:y.axiosRequestConfig),_=e.ref([]),{debouncedQueryChange:I,loading:B,allRecords:A,error:d,loadItems:j,results:q}=u.useDebouncedFilter(o.config,U.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),P=l=>l,$=e.computed(()=>d.value?s("consumers.errors.general"):""),Y=e.ref(0),K=e.computed(()=>A.value===void 0),O=e.computed(()=>q.value.map(l=>({label:l.username||l.customId,value:l.id,selected:_.value.includes(l.id),data:l}))),F=l=>{var h;const C=K.value?q.value.find(w=>w.id===l):(h=A.value)==null?void 0:h.find(w=>w.id===l);return C?C.username||C.custom_id:l},N=()=>{G.value="",T.value=[],f.value=[],k("cancel")},T=e.ref([]),S=e.ref(!1),G=e.ref(""),L=async()=>{if(!_.value.length){G.value="",f.value=[],k("cancel");return}S.value=!0,G.value="",T.value=[],f.value=[];try{const l=_.value.map(w=>i(w)),C=await Promise.allSettled(l);let h=!0;C.forEach(w=>{w.status!=="fulfilled"&&(h=!1)}),h?(T.value=[],f.value=[],k("add:success",_.value),_.value=[]):(T.value.length&&k("add:partial-success",T.value),_.value=[],D(C))}catch{G.value=s("consumers.errors.add"),k("error",G.value)}finally{S.value=!1}},a=e.computed(()=>{var C,h,w,H;let l=`${o.config.apiBaseUrl}${U.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(w=o.config)!=null&&w.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((H=o.config)==null?void 0:H.consumerGroupId)||"")),l}),i=async l=>{const C={consumer:l};try{const h=await r.post(a.value,C);return T.value.push(l),h}catch(h){let w=`${F(l)} - ${h.message}`;return h.response.status===409&&(w=`${F(l)} - ${s("consumers.errors.already_added")}`),Promise.reject(Error(w))}},f=e.ref([]),D=l=>{f.value=l.map(C=>{var h;return(h=C.reason)==null?void 0:h.message}).filter(Boolean)};return e.watch(O,()=>{Y.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&j()},{immediate:!0}),(l,C)=>{const h=e.resolveComponent("KMultiselect"),w=e.resolveComponent("KAlert"),H=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(H,{"action-button-disabled":S.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(s)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:N,onProceed:L},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",ke,e.toDisplayString(e.unref(s)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(h,{modelValue:_.value,"onUpdate:modelValue":C[0]||(C[0]=V=>_.value=V),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":K.value?e.unref(s)("consumers.consumer_groups.add.footer"):void 0,items:O.value,label:e.unref(s)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(B),placeholder:e.unref(s)("consumers.consumer_groups.add.consumer_placeholder"),readonly:S.value,required:"",width:"100%",onQueryChange:e.unref(I)},{"item-template":e.withCtx(({item:V})=>[e.createElementVNode("div",_e,e.toDisplayString(V.label),1),P(V).data.username&&P(V).data.custom_id?(e.openBlock(),e.createElementBlock("div",we,e.toDisplayString(P(V).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),G.value||$.value||f.value.length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(w,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(s)("consumers.errors.add")),1),f.value.length?(e.openBlock(),e.createElementBlock("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(V,W)=>(e.openBlock(),e.createElementBlock("li",{key:W},e.toDisplayString(V),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(G.value||$.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ee=(t,m)=>{const s=t.__vccOpts||t;for(const[o,k]of m)s[o]=k;return s},xe=ee(Ne,[["__scopeId","data-v-d54468ab"]]),Ee={class:"kong-ui-entities-consumers-list"},De={class:"button-row"},Be={class:"empty-state-wrapper"},$e=ee(e.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},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},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:m}){var ge;const s=m,o=t,{i18nT:k,i18n:{t:r}}=X.useI18n(),_=ae.useRouter(),{axiosInstance:I}=u.useAxios((ge=o.config)==null?void 0:ge.axiosRequestConfig),B=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),A={username:{label:r("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:r("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:r("consumers.list.table_headers.tags"),sortable:!1}},d=A,j=n=>({"data-testid":n.username??n.custom_id??n.id}),q=()=>{o.config.consumerGroupId?de():_.push(o.config.createRoute)},P=e.computed(()=>{var c,g,x,M;let n=`${o.config.apiBaseUrl}${U.list[o.config.app][N.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((g=o.config)==null?void 0:g.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((M=o.config)==null?void 0:M.consumerGroupId)||"")),n}),$=e.ref(""),Y=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:r(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:A.username,custom_id:A.custom_id},schema:o.config.filterSchema}}),{hasRecords:K,handleStateChange:O}=u.useTableState($),F=e.computed(()=>K.value&&o.config.app==="konnect"),N=e.computed(()=>!!o.config.consumerGroupId),T=e.computed(()=>N.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),S=e.computed(()=>N.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:G,fetcherState:L,fetcherCacheKey:a}=u.useFetcher(e.computed(()=>({...o.config,cacheIdentifier:o.cacheIdentifier})),P,S),i=()=>{$.value=""},f=()=>{a.value++},D=n=>n??"-",y=e.ref(null),l=async(n,c)=>{const g=n.id;if(!await c(g)){s("copy:error",{entity:n,field:"id",message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,field:"id",message:r("consumers.copy.success",{val:g})})},C=(n,c)=>{const g=JSON.stringify(n);if(!c(g)){s("copy:error",{entity:n,message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,message:r("consumers.copy.success_brief")})},h=async n=>{var g;await((g=o.canRetrieve)==null?void 0:g.call(o,n))&&_.push(o.config.getViewRoute(n.id))},w=n=>({label:r("consumers.actions.view"),to:o.config.getViewRoute(n)}),H=n=>({label:r("consumers.actions.edit"),to:o.config.getEditRoute(n)}),V=e.ref(void 0),W=e.ref(!1),Z=e.ref(!1),ce=e.ref(""),Oe=u.useDeleteUrlBuilder(o.config,P.value),je=n=>{V.value=n,W.value=!0},Le=()=>{W.value=!1},He=async()=>{var n,c,g;if((n=V.value)!=null&&n.id){Z.value=!0;try{await I.delete(Oe(V.value.id)),Z.value=!1,W.value=!1,a.value++,s("delete:success",V.value)}catch(x){ce.value=((g=(c=x.response)==null?void 0:c.data)==null?void 0:g.message)||x.message||r("consumers.errors.delete"),s("error",x)}finally{Z.value=!1}}},oe=e.ref(!1),de=()=>{oe.value=!0},ue=()=>{oe.value=!1},me=(n,c)=>{c||ue(),a.value++,s("add:success",n)},We=()=>{N.value&&de()},R=e.ref(void 0),ne=e.ref(!1),Je=e.ref(""),Qe=n=>{R.value=n,ne.value=!0},pe=()=>{ne.value=!1,R.value=void 0},ze=e.computed(()=>{var c,g,x,M;let n=`${o.config.apiBaseUrl}${U.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((g=o.config)==null?void 0:g.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((M=o.config)==null?void 0:M.consumerGroupId)||"")),n}),fe=e.ref(!1),Ye=async()=>{if(R.value){fe.value=!0;try{const n=ze.value.replace(/{consumerId}/gi,R.value.id);await I.delete(n),s("remove:success",R.value),pe(),a.value++}catch(n){Je.value=n.message||r("consumers.errors.delete"),s("error",n)}finally{fe.value=!1}}};e.watch(L,n=>{var c,g,x;if(n.status===u.FetcherStatus.Error){y.value={title:r("consumers.errors.general")},(x=(g=(c=n.error)==null?void 0:c.response)==null?void 0:g.data)!=null&&x.message&&(y.value.message=n.error.response.data.message),s("error",n.error);return}y.value=null});const re=e.ref({ctaPath:N.value?void 0:o.config.createRoute,ctaText:void 0,message:`${r("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:r("consumers.title")}),se=e.ref(!1);return e.onBeforeMount(async()=>{se.value=await o.canCreate(),se.value&&(re.value.title=N.value?r("consumers.list.empty_state.title_for_consumer_group"):r("consumers.list.empty_state.title"),re.value.ctaText=N.value?r("consumers.actions.add_consumer"):r("consumers.actions.create"))}),(n,c)=>{const g=e.resolveComponent("KButton"),x=e.resolveComponent("KEmptyState"),M=e.resolveComponent("KDropdownItem"),ye=e.resolveComponent("KClipboardProvider"),Xe=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(u.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-sorting":B.value,"empty-state-options":re.value,"enable-entity-actions":"","error-message":y.value,fetcher:e.unref(G),"fetcher-cache-key":e.unref(a),"hide-pagination":N.value&&!t.config.paginatedEndpoint,"pagination-type":"offset","preferences-storage-key":T.value,query:$.value,"row-attributes":j,"table-headers":e.unref(d),onClearSearchInput:i,"onClick:row":c[3]||(c[3]=p=>h(p)),onEmptyStateCtaClicked:We,onSort:f,onState:e.unref(O)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.renderSlot(n.$slots,"toolbar-filter",{},void 0,!0),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.EntityFilter),{key:0,modelValue:$.value,"onUpdate:modelValue":c[0]||(c[0]=p=>$.value=p),config:Y.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!t.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",De,[!N.value&&F.value?(e.openBlock(),e.createBlock(g,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumers-learn-more-button",icon:"",onClick:c[1]||(c[1]=p=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(J.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(g,{appearance:"primary","data-testid":"toolbar-add-consumer",size:t.useActionOutside?"medium":"large",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(J.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.add_consumer"):e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["size"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),username:e.withCtx(({rowValue:p})=>[e.createElementVNode("b",null,e.toDisplayString(D(p)),1)]),custom_id:e.withCtx(({rowValue:p})=>[e.createTextVNode(e.toDisplayString(D(p)),1)]),tags:e.withCtx(({rowValue:p})=>[e.createVNode(e.unref(u.TableTags),{tags:p},null,8,["tags"])]),actions:e.withCtx(({row:p})=>[e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(M,{"data-testid":"action-entity-copy-id",onClick:Ze=>l(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(ye,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(M,{"data-testid":"action-entity-copy-json",onClick:Ze=>C(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(p)},{default:e.withCtx(()=>[e.createVNode(M,{"data-testid":"action-entity-view","has-divider":"",item:w(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canEdit(p)},{default:e.withCtx(()=>[e.createVNode(M,{"data-testid":"action-entity-edit",item:H(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(u.PermissionsWrapper),{"auth-function":()=>t.canDelete(p)},{default:e.withCtx(()=>[e.createVNode(M,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?Qe(p):je(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.remove"):e.unref(r)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!$.value&&t.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var p;return[e.createElementVNode("div",Be,[e.renderSlot(n.$slots,"empty-state-toolbar",{},void 0,!0),e.createVNode(x,{"data-testid":t.config.consumerGroupId?"nested-consumers-entity-empty-state":"consumers-entity-empty-state","icon-background":"",message:e.unref(r)("consumers.list.empty_state_v2.description"),title:e.unref(r)("consumers.list.empty_state_v2.title")},e.createSlots({icon:e.withCtx(()=>[e.createVNode(e.unref(J.TeamIcon),{decorative:""})]),action:e.withCtx(()=>[se.value?(e.openBlock(),e.createBlock(g,{key:0,"data-testid":"entity-create-button",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(J.AddIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(g,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:c[2]||(c[2]=v=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(J.BookIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(p=t.config)!=null&&p.isControlPlaneGroup?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["data-testid","message","title"])])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-pagination","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(u.EntityDeleteModal),{"action-button-disabled":Z.value,"data-testid":"delete-consumer-modal",description:e.unref(r)("consumers.delete.description"),"entity-name":V.value&&(V.value.username||V.value.custom_id||V.value.id),"entity-type":e.unref(u.EntityTypes).Consumer,error:ce.value,title:e.unref(r)("consumers.delete.title"),visible:W.value,onCancel:Le,onProceed:He},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),t.config.consumerGroupId?(e.openBlock(),e.createBlock(xe,{key:0,config:t.config,"data-testid":"add-consumer-modal",visible:oe.value,"onAdd:partialSuccess":c[4]||(c[4]=p=>me(p,!0)),"onAdd:success":c[5]||(c[5]=p=>me(p)),onCancel:ue},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&R.value?(e.openBlock(),e.createBlock(Xe,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(r)("consumers.consumer_groups.remove.title"),visible:ne.value,onCancel:pe,onProceed:Ye},{default:e.withCtx(()=>[e.createVNode(e.unref(k),{class:"message",keypath:t.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},e.createSlots({consumer:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(R.value.username||R.value.custom_id||R.value.id),1)]),_:2},[t.config.consumerGroupName?{name:"consumerGroup",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(t.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-4737bfb9"]]),b=[];for(let t=0;t<256;++t)b.push((t+256).toString(16).slice(1));function Se(t,m=0){return(b[t[m+0]]+b[t[m+1]]+b[t[m+2]]+b[t[m+3]]+"-"+b[t[m+4]]+b[t[m+5]]+"-"+b[t[m+6]]+b[t[m+7]]+"-"+b[t[m+8]]+b[t[m+9]]+"-"+b[t[m+10]]+b[t[m+11]]+b[t[m+12]]+b[t[m+13]]+b[t[m+14]]+b[t[m+15]]).toLowerCase()}let te;const Ge=new Uint8Array(16);function Me(){if(!te){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");te=crypto.getRandomValues.bind(crypto)}return te(Ge)}const le={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Te(t,m,s){var k;if(le.randomUUID&&!t)return le.randomUUID();t=t||{};const o=t.random??((k=t.rng)==null?void 0:k.call(t))??Me();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Se(o)}const Ae={class:"kong-ui-entities-consumer-form"},Re=["id"],Pe={class:"fields-group-text"},Fe=["aria-labelledby"],Ue=ee(e.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||(t==null?void 0:t.app)==="konnect"&&!(t!=null&&t.controlPlaneId)||(t==null?void 0:t.app)==="kongManager"&&typeof(t==null?void 0:t.workspace)!="string"||!(t!=null&&t.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:m}){var L;const s=t,o=m,{i18nT:k,i18n:{t:r}}=X.useI18n(),_=ae.useRouter(),{axiosInstance:I}=u.useAxios((L=s.config)==null?void 0:L.axiosRequestConfig),{getMessageFromError:B}=u.useErrors(),A=Te(),d=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),j=e.reactive({username:"",customId:"",tags:""}),q=e.computed(()=>{var a,i;return(i=U.form[(a=s.config)==null?void 0:a.app])==null?void 0:i.edit}),P=()=>{var a;_.push(((a=s.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},$=a=>{o("loading",a)},Y=a=>{o("error",a)},K=a=>{var f,D,y;d.fields.username=((f=a==null?void 0:a.item)==null?void 0:f.username)||(a==null?void 0:a.username)||"",d.fields.customId=((D=a==null?void 0:a.item)==null?void 0:D.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((y=a==null?void 0:a.item)==null?void 0:y.tags)||(a==null?void 0:a.tags)||[];d.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(j,d.fields)},O=e.computed(()=>s.consumerId?u.EntityBaseFormType.Edit:u.EntityBaseFormType.Create),F=a=>{var f,D,y,l,C,h;let i=`${(f=s.config)==null?void 0:f.apiBaseUrl}${U.form[(D=s.config)==null?void 0:D.app][a]}`;return((y=s.config)==null?void 0:y.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=s.config)==null?void 0:l.controlPlaneId)||""):((C=s.config)==null?void 0:C.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(h=s.config)!=null&&h.workspace?`/${s.config.workspace}`:"")),i=i.replace(/{id}/gi,s.consumerId),i},N=e.computed(()=>!!d.fields.username||!!d.fields.customId),T=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(j)),S=e.computed(()=>{var a,i;return{username:d.fields.username||null,custom_id:d.fields.customId||null,tags:(i=(a=d.fields.tags.split(","))==null?void 0:a.map(f=>String(f||"").trim()))==null?void 0:i.filter(f=>f!=="")}}),G=async()=>{var a;try{d.readonly=!0;let i;O.value==="create"?i=await I.post(F("create"),S.value):O.value==="edit"&&(i=((a=s.config)==null?void 0:a.app)==="konnect"?await I.put(F("edit"),S.value):await I.patch(F("edit"),S.value)),K(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){d.errorMessage=B(i),o("error",i)}finally{d.readonly=!1}};return(a,i)=>{const f=e.resolveComponent("KInput"),D=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(e.unref(u.EntityBaseForm),{"can-submit":N.value&&T.value,config:t.config,"edit-id":t.consumerId,"entity-type":e.unref(u.SupportedEntityType).Consumer,"error-message":d.errorMessage,"fetch-url":q.value,"form-fields":S.value,"is-readonly":d.readonly,onCancel:P,"onFetch:error":i[3]||(i[3]=y=>Y(y)),"onFetch:success":K,onLoading:i[4]||(i[4]=y=>$(y)),onSubmit:G},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(u.EntityFormSection),{description:e.unref(r)("consumers.form.info.description"),"has-divider":"",title:e.unref(r)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(A)}`,class:"fields-group-title"},e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.title"))+"* ",9,Re),e.createElementVNode("p",Pe,e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.description")),1)]),e.createVNode(D,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(A)}`},[e.createVNode(f,{modelValue:d.fields.username,"onUpdate:modelValue":i[0]||(i[0]=y=>d.fields.username=y),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(r)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.username.placeholder"),readonly:d.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(k),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(f,{modelValue:d.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=y=>d.fields.customId=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(r)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.custom_id.placeholder"),readonly:d.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(k),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Fe)]),_:1}),e.createVNode(f,{modelValue:d.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=y=>d.fields.tags=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(r)("consumers.fields.tags.help"),label:e.unref(r)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(r)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.tags.placeholder"),readonly:d.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ecefc72c"]]),qe={class:"kong-ui-consumer-entity-config-card"},Ke=e.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const m=t,{i18n:{t:s},i18nT:o}=X.useI18n(),k=e.computed(()=>U.form[m.config.app].edit),r=e.ref({id:{},username:{section:u.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.username.tooltip"),order:1},custom_id:{section:u.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.custom_id.tooltip"),label:s("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:s("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(_,I)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createVNode(e.unref(u.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":r.value,"entity-type":e.unref(u.SupportedEntityType).Consumer,"fetch-url":k.value,"hide-title":t.hideTitle,"onFetch:error":I[0]||(I[0]=B=>_.$emit("fetch:error",B)),"onFetch:success":I[1]||(I[1]=B=>_.$emit("fetch:success",B)),onLoading:I[2]||(I[2]=B=>_.$emit("loading",B))},{"username-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Ke,E.ConsumerForm=Ue,E.ConsumerList=$e,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-dc1e39a1]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-dc1e39a1]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-66d61bea]{align-items:center;border-bottom:var(--70f369b3);box-sizing:border-box;display:var(--67c2fae6);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-66d61bea]{box-sizing:border-box;padding-right:16px;width:var(--847b138c)}.config-card-details-row .config-card-details-label label[data-v-66d61bea]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-66d61bea]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-66d61bea]{min-width:0}.config-card-details-row .config-card-details-value[data-v-66d61bea]{box-sizing:border-box;width:var(--847687d6)}.config-card-details-row .config-card-details-value .truncated[data-v-66d61bea]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-66d61bea]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-66d61bea] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-66d61bea]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-66d61bea]{margin-right:4px}.config-card-details-row[data-v-66d61bea] .k-label{margin-bottom:0}.config-card-details-row[data-v-66d61bea] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-66d61bea] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--eca0976a);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-f11c7e34]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-8dc3c29c]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-8dc3c29c]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-8dc3c29c]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-8dc3c29c] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-8dc3c29c]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-7c5c8d6b]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-7c5c8d6b] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-7c5c8d6b]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-7c5c8d6b] .k-button:last-of-type,.form-actions[data-v-7c5c8d6b] .k-button:nth-last-of-type(2){margin-left:16px}.form-actions-reverted[data-v-7c5c8d6b]{direction:rtl}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-44153100]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-44153100]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-44153100]{display:none}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-084f7978]{width:100%}.kong-ui-entity-filter-clear[data-v-084f7978]{cursor:pointer}.kong-ui-entity-filter[data-v-084f7978]{display:flex;position:relative}.kong-ui-entity-filter[data-v-084f7978] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-084f7978] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-084f7978]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-084f7978]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-084f7978]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-084f7978]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-084f7978]{color:#232633}.menu-item-expand-icon[data-v-084f7978]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-084f7978]{transform:rotate(180deg)}.menu-item-indicator[data-v-084f7978]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-084f7978]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-084f7978] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-084f7978] .k-input{width:100%}.menu-item-body[data-v-084f7978] .k-select-input .input{font-size:12px}.menu-item-body[data-v-084f7978] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-084f7978]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-084f7978]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-084f7978]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.ff-form-section .header[data-v-cb6d2e95]{align-items:flex-start;display:flex;gap:8px}.ff-form-section .step[data-v-cb6d2e95]{align-items:center;background:#fff;border:1px solid #afb7c5;border-radius:100px;display:flex;flex:0 0 auto;height:32px;justify-content:center;padding:4px;width:32px}.ff-form-section .header-content[data-v-cb6d2e95]{align-items:flex-start;display:flex;flex:1 1 auto;flex-direction:column;gap:8px;padding-top:4px}.ff-form-section .header-title[data-v-cb6d2e95]{color:#000933;font-size:18px;font-weight:700;line-height:24px;margin:0}.ff-form-section .header-description[data-v-cb6d2e95]{color:#52596e;font-size:14px;line-height:20px;margin:0}.ff-form-section .header-extra[data-v-cb6d2e95]{align-items:center;display:flex;flex:0 0 auto;gap:8px;justify-content:flex-end}.ff-form-section .content[data-v-cb6d2e95]{background:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;display:flex;flex-direction:column;gap:20px;margin-left:16px;margin-top:20px;padding:20px 24px}.kong-ui-public-entity-link[data-v-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-645aae54]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-645aae54]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-645aae54]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-645aae54]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-645aae54]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-645aae54]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-645aae54],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-645aae54]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-645aae54],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-645aae54]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-645aae54]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-645aae54]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-645aae54]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-645aae54]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-645aae54]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-645aae54]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-645aae54] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-645aae54]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-645aae54]{width:640px}}.kong-ui-entities-add-consumers-modal .add-consumer-form-cta[data-v-d54468ab]{margin-top:0}.kong-ui-entities-add-consumers-modal .add-consumer-form-container[data-v-d54468ab]{margin-bottom:20px}.kong-ui-entities-add-consumers-modal .add-consumer-form-container .kong-ui-entity-add-consumers-error[data-v-d54468ab]{margin-top:16px}.button-row[data-v-4737bfb9]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumers-list[data-v-4737bfb9]{width:100%}.kong-ui-entities-consumers-list .empty-state-wrapper[data-v-4737bfb9]{display:flex;flex-direction:column;gap:4px;padding:4px 4px 0}.kong-ui-entities-consumers-list .message[data-v-4737bfb9]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-4737bfb9]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-ab3e5b9b]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-ab3e5b9b] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-ab3e5b9b]{border:none;margin:0;padding:0}.fields-group-title[data-v-ab3e5b9b]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-ab3e5b9b]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-ab3e5b9b]{margin-bottom:16px}
|
|
1
|
+
.config-card-fieldset[data-v-dc1e39a1]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-dc1e39a1]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-66d61bea]{align-items:center;border-bottom:var(--70f369b3);box-sizing:border-box;display:var(--67c2fae6);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-66d61bea]{box-sizing:border-box;padding-right:16px;width:var(--847b138c)}.config-card-details-row .config-card-details-label label[data-v-66d61bea]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-66d61bea]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-66d61bea]{min-width:0}.config-card-details-row .config-card-details-value[data-v-66d61bea]{box-sizing:border-box;width:var(--847687d6)}.config-card-details-row .config-card-details-value .truncated[data-v-66d61bea]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-66d61bea]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-66d61bea] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-66d61bea]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-66d61bea]{margin-right:4px}.config-card-details-row[data-v-66d61bea] .k-label{margin-bottom:0}.config-card-details-row[data-v-66d61bea] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-66d61bea] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--eca0976a);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-f11c7e34]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-8dc3c29c]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-8dc3c29c]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-8dc3c29c]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-8dc3c29c] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-8dc3c29c]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-7c5c8d6b]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-7c5c8d6b] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-7c5c8d6b] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-7c5c8d6b]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-7c5c8d6b] .k-button:last-of-type,.form-actions[data-v-7c5c8d6b] .k-button:nth-last-of-type(2){margin-left:16px}.form-actions-reverted[data-v-7c5c8d6b]{direction:rtl}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-44153100]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-44153100]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-44153100]{display:none}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-084f7978]{width:100%}.kong-ui-entity-filter-clear[data-v-084f7978]{cursor:pointer}.kong-ui-entity-filter[data-v-084f7978]{display:flex;position:relative}.kong-ui-entity-filter[data-v-084f7978] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-084f7978] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-084f7978]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-084f7978]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-084f7978]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-084f7978]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-084f7978]{color:#232633}.menu-item-expand-icon[data-v-084f7978]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-084f7978]{transform:rotate(180deg)}.menu-item-indicator[data-v-084f7978]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-084f7978]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-084f7978] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-084f7978] .k-input{width:100%}.menu-item-body[data-v-084f7978] .k-select-input .input{font-size:12px}.menu-item-body[data-v-084f7978] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-084f7978]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-084f7978]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-084f7978]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.ff-form-section .header[data-v-cb6d2e95]{align-items:flex-start;display:flex;gap:8px}.ff-form-section .step[data-v-cb6d2e95]{align-items:center;background:#fff;border:1px solid #afb7c5;border-radius:100px;display:flex;flex:0 0 auto;height:32px;justify-content:center;padding:4px;width:32px}.ff-form-section .header-content[data-v-cb6d2e95]{align-items:flex-start;display:flex;flex:1 1 auto;flex-direction:column;gap:8px;padding-top:4px}.ff-form-section .header-title[data-v-cb6d2e95]{color:#000933;font-size:18px;font-weight:700;line-height:24px;margin:0}.ff-form-section .header-description[data-v-cb6d2e95]{color:#52596e;font-size:14px;line-height:20px;margin:0}.ff-form-section .header-extra[data-v-cb6d2e95]{align-items:center;display:flex;flex:0 0 auto;gap:8px;justify-content:flex-end}.ff-form-section .content[data-v-cb6d2e95]{background:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;display:flex;flex-direction:column;gap:20px;margin-left:16px;margin-top:20px;padding:20px 24px}.kong-ui-public-entity-link[data-v-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-645aae54]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-645aae54]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-645aae54]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-645aae54]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-645aae54]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-645aae54]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-645aae54],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-645aae54]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-645aae54],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-645aae54]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-645aae54]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-645aae54]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-645aae54]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-645aae54]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-645aae54]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-645aae54]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-645aae54] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-645aae54] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-645aae54]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-645aae54]{width:640px}}.kong-ui-entities-add-consumers-modal .add-consumer-form-cta[data-v-d54468ab]{margin-top:0}.kong-ui-entities-add-consumers-modal .add-consumer-form-container[data-v-d54468ab]{margin-bottom:20px}.kong-ui-entities-add-consumers-modal .add-consumer-form-container .kong-ui-entity-add-consumers-error[data-v-d54468ab]{margin-top:16px}.button-row[data-v-4737bfb9]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumers-list[data-v-4737bfb9]{width:100%}.kong-ui-entities-consumers-list .empty-state-wrapper[data-v-4737bfb9]{display:flex;flex-direction:column;gap:4px;padding:4px 4px 0}.kong-ui-entities-consumers-list .message[data-v-4737bfb9]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-4737bfb9]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-ecefc72c]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-ecefc72c] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-ecefc72c]{border:none;margin:0;padding:0}.fields-group-title[data-v-ecefc72c]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-ecefc72c]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-ecefc72c]{margin-bottom:16px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsumerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ConsumerForm.vue"],"names":[],"mappings":"AAqTA,OAAO,gDAAgD,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAGV,mBAAmB,EACnB,6BAA6B,EAC7B,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,OAAO,CAAA;;IAsepD,oHAAoH;;cAElG,QAAQ,CAAC,yBAAyB,GAAG,6BAA6B,CAAC;;4BAE/D,yBAAyB,GAAG,6BAA6B,KAAG,OAAO;;IAQzF,6FAA6F;;;;;;;;;;;IAZ7F,oHAAoH;;cAElG,QAAQ,CAAC,yBAAyB,GAAG,6BAA6B,CAAC;;4BAE/D,yBAAyB,GAAG,6BAA6B,KAAG,OAAO;;IAQzF,6FAA6F;;;;;;;;;;;;;AAjB/F,wBAwBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumers-endpoints.d.ts","sourceRoot":"","sources":["../../src/consumers-endpoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consumers-endpoints.d.ts","sourceRoot":"","sources":["../../src/consumers-endpoints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAyBC"}
|