@kong-ui-public/entities-consumers 3.5.3 → 3.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as ue, ref as C, computed as G, watch as ge, resolveComponent as U, openBlock as E, createBlock as W, unref as s, withCtx as l, createElementVNode as w, toDisplayString as h, createVNode as m, createElementBlock as q, createCommentVNode as ne, Fragment as xe, renderList as De, onBeforeMount as Oe, Teleport as je, withDirectives as He, createTextVNode as te, vShow as Je, withModifiers as Le, createSlots as Qe, reactive as Ee } from "vue";
|
|
2
2
|
import { useRouter as Ae } from "vue-router";
|
|
3
3
|
import { AddIcon as We } from "@kong/icons";
|
|
4
|
-
import { createI18n as
|
|
4
|
+
import { createI18n as ze, i18nTComponent as Ye } from "@kong-ui-public/i18n";
|
|
5
5
|
import { useAxios as ve, useDebouncedFilter as Xe, useFetcher as Ze, useDeleteUrlBuilder as et, FetcherStatus as tt, EntityBaseTable as ot, EntityFilter as st, PermissionsWrapper as ie, EntityDeleteModal as nt, EntityTypes as rt, useErrors as at, EntityBaseFormType as Ge, EntityBaseForm as it, SupportedEntityType as Re, EntityFormSection as lt, ConfigurationSchemaSection as Me, EntityBaseConfigCard as ut } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const ct = {
|
|
7
7
|
list: {
|
|
@@ -102,16 +102,16 @@ const ct = {
|
|
|
102
102
|
consumers: ct
|
|
103
103
|
};
|
|
104
104
|
function mt() {
|
|
105
|
-
const e =
|
|
105
|
+
const e = ze("en-us", dt);
|
|
106
106
|
return {
|
|
107
107
|
i18n: e,
|
|
108
|
-
i18nT:
|
|
108
|
+
i18nT: Ye(e)
|
|
109
109
|
// Translation component <i18n-t>
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
const ce = {
|
|
113
113
|
useI18n: mt
|
|
114
|
-
}, oe = "/v2/control-planes/{controlPlaneId}/core-entities", se = "/{workspace}",
|
|
114
|
+
}, oe = "/v2/control-planes/{controlPlaneId}/core-entities", se = "/{workspace}", z = {
|
|
115
115
|
list: {
|
|
116
116
|
konnect: {
|
|
117
117
|
all: `${oe}/consumers`,
|
|
@@ -165,11 +165,11 @@ const ce = {
|
|
|
165
165
|
loading: x,
|
|
166
166
|
allRecords: D,
|
|
167
167
|
error: p,
|
|
168
|
-
loadItems:
|
|
168
|
+
loadItems: Y,
|
|
169
169
|
results: j
|
|
170
170
|
} = Xe(
|
|
171
171
|
t.config,
|
|
172
|
-
|
|
172
|
+
z.list[t.config.app].all,
|
|
173
173
|
"",
|
|
174
174
|
{
|
|
175
175
|
fetchedItemsKey: "data",
|
|
@@ -206,7 +206,7 @@ const ce = {
|
|
|
206
206
|
}
|
|
207
207
|
}, a = G(() => {
|
|
208
208
|
var f, g, k, Q;
|
|
209
|
-
let u = `${t.config.apiBaseUrl}${
|
|
209
|
+
let u = `${t.config.apiBaseUrl}${z.list[t.config.app].forConsumerGroup}`;
|
|
210
210
|
return t.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((f = t.config) == null ? void 0 : f.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((g = t.config) == null ? void 0 : g.consumerGroupId) || "") : t.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (k = t.config) != null && k.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((Q = t.config) == null ? void 0 : Q.consumerGroupId) || "")), u;
|
|
211
211
|
}), i = async (u) => {
|
|
212
212
|
const f = {
|
|
@@ -228,7 +228,7 @@ const ce = {
|
|
|
228
228
|
return ge(J, () => {
|
|
229
229
|
Z.value++;
|
|
230
230
|
}, { immediate: !0, deep: !0 }), ge(() => t.visible, () => {
|
|
231
|
-
t.visible &&
|
|
231
|
+
t.visible && Y();
|
|
232
232
|
}, { immediate: !0 }), (u, f) => {
|
|
233
233
|
const g = U("KMultiselect"), k = U("KAlert"), Q = U("KPrompt");
|
|
234
234
|
return E(), W(Q, {
|
|
@@ -336,7 +336,7 @@ const ce = {
|
|
|
336
336
|
var we;
|
|
337
337
|
const n = c, t = e, { i18nT: I, i18n: { t: r } } = ce.useI18n(), M = Ae(), { axiosInstance: S } = ve((we = t.config) == null ? void 0 : we.axiosRequestConfig), x = C(1), D = G(() => !!t.config.consumerGroupId), p = G(
|
|
338
338
|
() => D.value ? "kong-ui-entities-consumers-list-in-group-page" : "kong-ui-entities-consumers-list"
|
|
339
|
-
),
|
|
339
|
+
), Y = G(() => t.config.app !== "kongManager" || !!t.config.disableSorting), j = {
|
|
340
340
|
// the Username column is non-hidable
|
|
341
341
|
username: { label: r("consumers.list.table_headers.username"), searchable: !0, sortable: !0, hidable: !1 },
|
|
342
342
|
custom_id: { label: r("consumers.list.table_headers.custom_id"), searchable: !0, sortable: !0 },
|
|
@@ -345,7 +345,7 @@ const ce = {
|
|
|
345
345
|
"data-testid": o.username ?? o.custom_id ?? o.id
|
|
346
346
|
}), Z = G(() => {
|
|
347
347
|
var d, b, A, P;
|
|
348
|
-
let o = `${t.config.apiBaseUrl}${
|
|
348
|
+
let o = `${t.config.apiBaseUrl}${z.list[t.config.app][D.value ? "forConsumerGroup" : "all"]}`;
|
|
349
349
|
return t.config.app === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((b = t.config) == null ? void 0 : b.consumerGroupId) || "") : t.config.app === "kongManager" && (o = o.replace(/\/{workspace}/gi, (A = t.config) != null && A.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((P = t.config) == null ? void 0 : P.consumerGroupId) || "")), o;
|
|
350
350
|
}), V = C(""), J = G(() => {
|
|
351
351
|
const o = t.config.app === "konnect" || t.config.isExactMatch;
|
|
@@ -431,7 +431,7 @@ const ce = {
|
|
|
431
431
|
pe.value = !1, O.value = void 0;
|
|
432
432
|
}, Ke = G(() => {
|
|
433
433
|
var d, b, A, P;
|
|
434
|
-
let o = `${t.config.apiBaseUrl}${
|
|
434
|
+
let o = `${t.config.apiBaseUrl}${z.list[t.config.app].oneForConsumerGroup}`;
|
|
435
435
|
return t.config.app === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((b = t.config) == null ? void 0 : b.consumerGroupId) || "") : t.config.app === "kongManager" && (o = o.replace(/\/{workspace}/gi, (A = t.config) != null && A.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((P = t.config) == null ? void 0 : P.consumerGroupId) || "")), o;
|
|
436
436
|
}), ke = C(!1), Pe = async () => {
|
|
437
437
|
if (O.value) {
|
|
@@ -471,7 +471,7 @@ const ce = {
|
|
|
471
471
|
"cache-identifier": e.cacheIdentifier,
|
|
472
472
|
"disable-pagination": D.value && !e.config.paginatedEndpoint,
|
|
473
473
|
"disable-pagination-page-jump": "",
|
|
474
|
-
"disable-sorting":
|
|
474
|
+
"disable-sorting": Y.value,
|
|
475
475
|
"empty-state-options": fe.value,
|
|
476
476
|
"enable-entity-actions": "",
|
|
477
477
|
"error-message": a.value,
|
|
@@ -482,7 +482,6 @@ const ce = {
|
|
|
482
482
|
query: V.value,
|
|
483
483
|
"row-attributes": X,
|
|
484
484
|
"table-headers": s(H),
|
|
485
|
-
"use-action-outside": e.useActionOutside,
|
|
486
485
|
onClearSearchInput: R,
|
|
487
486
|
"onClick:row": d[3] || (d[3] = (v) => F(v)),
|
|
488
487
|
onEmptyStateCtaClicked: Ue,
|
|
@@ -508,7 +507,7 @@ const ce = {
|
|
|
508
507
|
He(m(b, {
|
|
509
508
|
appearance: "primary",
|
|
510
509
|
"data-testid": "toolbar-add-consumer",
|
|
511
|
-
size: "large",
|
|
510
|
+
size: e.useActionOutside ? "medium" : "large",
|
|
512
511
|
to: e.config.consumerGroupId ? void 0 : e.config.createRoute,
|
|
513
512
|
onClick: d[1] || (d[1] = () => e.config.consumerGroupId ? he() : void 0)
|
|
514
513
|
}, {
|
|
@@ -517,7 +516,7 @@ const ce = {
|
|
|
517
516
|
te(" " + h(e.config.consumerGroupId ? s(r)("consumers.actions.add_consumer") : s(r)("consumers.list.toolbar_actions.new_consumer")), 1)
|
|
518
517
|
]),
|
|
519
518
|
_: 1
|
|
520
|
-
}, 8, ["to"]), [
|
|
519
|
+
}, 8, ["size", "to"]), [
|
|
521
520
|
[Je, Ie.value]
|
|
522
521
|
])
|
|
523
522
|
]),
|
|
@@ -620,7 +619,7 @@ const ce = {
|
|
|
620
619
|
}, 1032, ["auth-function"])
|
|
621
620
|
]),
|
|
622
621
|
_: 1
|
|
623
|
-
}, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "preferences-storage-key", "query", "table-headers"
|
|
622
|
+
}, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "preferences-storage-key", "query", "table-headers"]),
|
|
624
623
|
m(s(nt), {
|
|
625
624
|
"action-button-disabled": k.value,
|
|
626
625
|
"data-testid": "delete-consumer-modal",
|
|
@@ -677,7 +676,7 @@ const ce = {
|
|
|
677
676
|
]);
|
|
678
677
|
};
|
|
679
678
|
}
|
|
680
|
-
}), Pt = /* @__PURE__ */ ye(It, [["__scopeId", "data-v-
|
|
679
|
+
}), Pt = /* @__PURE__ */ ye(It, [["__scopeId", "data-v-b03c77ce"]]);
|
|
681
680
|
let le;
|
|
682
681
|
const wt = new Uint8Array(16);
|
|
683
682
|
function $t() {
|
|
@@ -742,13 +741,13 @@ const St = { class: "kong-ui-entities-consumer-form" }, xt = ["id"], Dt = { clas
|
|
|
742
741
|
},
|
|
743
742
|
readonly: !1,
|
|
744
743
|
errorMessage: ""
|
|
745
|
-
}),
|
|
744
|
+
}), Y = Ee({
|
|
746
745
|
username: "",
|
|
747
746
|
customId: "",
|
|
748
747
|
tags: ""
|
|
749
748
|
}), j = G(() => {
|
|
750
749
|
var a, i;
|
|
751
|
-
return (i =
|
|
750
|
+
return (i = z.form[(a = n.config) == null ? void 0 : a.app]) == null ? void 0 : i.edit;
|
|
752
751
|
}), H = () => {
|
|
753
752
|
var a;
|
|
754
753
|
M.push(((a = n.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
|
|
@@ -760,12 +759,12 @@ const St = { class: "kong-ui-entities-consumer-form" }, xt = ["id"], Dt = { clas
|
|
|
760
759
|
var y, F, _;
|
|
761
760
|
p.fields.username = ((y = a == null ? void 0 : a.item) == null ? void 0 : y.username) || (a == null ? void 0 : a.username) || "", p.fields.customId = ((F = a == null ? void 0 : a.item) == null ? void 0 : F.custom_id) || (a == null ? void 0 : a.custom_id) || "";
|
|
762
761
|
const i = ((_ = a == null ? void 0 : a.item) == null ? void 0 : _.tags) || (a == null ? void 0 : a.tags) || [];
|
|
763
|
-
p.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(
|
|
762
|
+
p.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(Y, p.fields);
|
|
764
763
|
}, J = G(() => n.consumerId ? Ge.Edit : Ge.Create), N = (a) => {
|
|
765
764
|
var y, F, _, u, f, g;
|
|
766
|
-
let i = `${(y = n.config) == null ? void 0 : y.apiBaseUrl}${
|
|
765
|
+
let i = `${(y = n.config) == null ? void 0 : y.apiBaseUrl}${z.form[(F = n.config) == null ? void 0 : F.app][a]}`;
|
|
767
766
|
return ((_ = n.config) == null ? void 0 : _.app) === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((u = n.config) == null ? void 0 : u.controlPlaneId) || "") : ((f = n.config) == null ? void 0 : f.app) === "kongManager" && (i = i.replace(/\/{workspace}/gi, (g = n.config) != null && g.workspace ? `/${n.config.workspace}` : "")), i = i.replace(/{id}/gi, n.consumerId), i;
|
|
768
|
-
}, re = G(() => !!p.fields.username || !!p.fields.customId), B = G(() => JSON.stringify(p.fields) !== JSON.stringify(
|
|
767
|
+
}, re = G(() => !!p.fields.username || !!p.fields.customId), B = G(() => JSON.stringify(p.fields) !== JSON.stringify(Y)), R = G(() => {
|
|
769
768
|
var a, i;
|
|
770
769
|
return {
|
|
771
770
|
username: p.fields.username || null,
|
|
@@ -939,7 +938,7 @@ const St = { class: "kong-ui-entities-consumer-form" }, xt = ["id"], Dt = { clas
|
|
|
939
938
|
},
|
|
940
939
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
941
940
|
setup(e) {
|
|
942
|
-
const c = e, { i18n: { t: n }, i18nT: t } = ce.useI18n(), I = G(() =>
|
|
941
|
+
const c = e, { i18n: { t: n }, i18nT: t } = ce.useI18n(), I = G(() => z.form[c.config.app].edit), r = C({
|
|
943
942
|
id: {},
|
|
944
943
|
username: {
|
|
945
944
|
section: Me.Basic,
|
|
@@ -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,re,ge,se,f){"use strict";const ye={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"},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. 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 he(){const t=se.createI18n("en-us",ye);return{i18n:t,i18nT:se.i18nTComponent(t)}}const X={useI18n:he},j="/v2/control-planes/{controlPlaneId}/core-entities",L="/{workspace}",P={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}`}}},Ce={class:"add-consumer-form-container"},be={class:"add-consumer-form-cta"},ke={class:"select-item-label"},_e={key:0,class:"select-item-desc"},Ie={key:0,class:"kong-ui-entity-add-consumers-error"},we={key:0},Ve=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:c}){var C;const{i18n:{t:r}}=X.useI18n(),o=t,k=c,{axiosInstance:s}=f.useAxios((C=o.config)==null?void 0:C.axiosRequestConfig),I=e.ref([]),{debouncedQueryChange:w,loading:V,allRecords:x,error:u,loadItems:W,results:R}=f.useDebouncedFilter(o.config,P.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),U=l=>l,H=e.computed(()=>u.value?r("consumers.errors.general"):""),J=e.ref(0),M=e.computed(()=>x.value===void 0),K=e.computed(()=>R.value.map(l=>({label:l.username||l.customId,value:l.id,selected:I.value.includes(l.id),data:l}))),A=l=>{var p;const m=M.value?R.value.find(b=>b.id===l):(p=x.value)==null?void 0:p.find(b=>b.id===l);return m?m.username||m.custom_id:l},Y=()=>{D.value="",G.value=[],y.value=[],k("cancel")},G=e.ref([]),B=e.ref(!1),D=e.ref(""),q=async()=>{if(!I.value.length){D.value="",y.value=[],k("cancel");return}B.value=!0,D.value="",G.value=[],y.value=[];try{const l=I.value.map(b=>i(b)),m=await Promise.allSettled(l);let p=!0;m.forEach(b=>{b.status!=="fulfilled"&&(p=!1)}),p?(G.value=[],y.value=[],k("add:success",I.value),I.value=[]):(G.value.length&&k("add:partial-success",G.value),I.value=[],$(m))}catch{D.value=r("consumers.errors.add"),k("error",D.value)}finally{B.value=!1}},a=e.computed(()=>{var m,p,b,O;let l=`${o.config.apiBaseUrl}${P.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((m=o.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((p=o.config)==null?void 0:p.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((O=o.config)==null?void 0:O.consumerGroupId)||"")),l}),i=async l=>{const m={consumer:l};try{const p=await s.post(a.value,m);return G.value.push(l),p}catch(p){let b=`${A(l)} - ${p.message}`;return p.response.status===409&&(b=`${A(l)} - ${r("consumers.errors.already_added")}`),Promise.reject(Error(b))}},y=e.ref([]),$=l=>{y.value=l.map(m=>{var p;return(p=m.reason)==null?void 0:p.message}).filter(Boolean)};return e.watch(K,()=>{J.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&W()},{immediate:!0}),(l,m)=>{const p=e.resolveComponent("KMultiselect"),b=e.resolveComponent("KAlert"),O=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(O,{"action-button-disabled":B.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(r)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:Y,onProceed:q},{default:e.withCtx(()=>[e.createElementVNode("div",Ce,[e.createElementVNode("p",be,e.toDisplayString(e.unref(r)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(p,{modelValue:I.value,"onUpdate:modelValue":m[0]||(m[0]=T=>I.value=T),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":M.value?e.unref(r)("consumers.consumer_groups.add.footer"):void 0,items:K.value,label:e.unref(r)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(V),placeholder:e.unref(r)("consumers.consumer_groups.add.consumer_placeholder"),readonly:B.value,required:"",width:"100%",onQueryChange:e.unref(w)},{"item-template":e.withCtx(({item:T})=>[e.createElementVNode("div",ke,e.toDisplayString(T.label),1),U(T).data.username&&U(T).data.custom_id?(e.openBlock(),e.createElementBlock("div",_e,e.toDisplayString(U(T).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),D.value||H.value||y.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(b,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.errors.add")),1),y.value.length?(e.openBlock(),e.createElementBlock("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(T,ee)=>(e.openBlock(),e.createElementBlock("li",{key:ee},e.toDisplayString(T),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(D.value||H.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),v=(t,c)=>{const r=t.__vccOpts||t;for(const[o,k]of c)r[o]=k;return r},xe=v(Ve,[["__scopeId","data-v-d54468ab"]]),Ne={class:"kong-ui-entities-consumers-list"},Ee={key:1},Be=v(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","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:c}){var pe;const r=c,o=t,{i18nT:k,i18n:{t:s}}=X.useI18n(),I=re.useRouter(),{axiosInstance:w}=f.useAxios((pe=o.config)==null?void 0:pe.axiosRequestConfig),V=e.ref(1),x=e.computed(()=>!!o.config.consumerGroupId),u=e.computed(()=>x.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),W=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),R={username:{label:s("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:s("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:s("consumers.list.table_headers.tags"),sortable:!1}},U=R,H=n=>({"data-testid":n.username??n.custom_id??n.id}),J=e.computed(()=>{var d,h,N,S;let n=`${o.config.apiBaseUrl}${P.list[o.config.app][x.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((d=o.config)==null?void 0:d.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(N=o.config)!=null&&N.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((S=o.config)==null?void 0:S.consumerGroupId)||"")),n}),M=e.ref(""),K=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:s(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:R.username,custom_id:R.custom_id},schema:o.config.filterSchema}}),A=e.computed(()=>x.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:Y,fetcherState:G}=f.useFetcher(o.config,J.value,A.value),B=()=>{M.value=""},D=()=>{V.value++},q=n=>n??"-",a=e.ref(null),i=(n,d)=>{const h=n.id;if(!d(h)){r("copy:error",{entity:n,field:"id",message:s("consumers.errors.copy")});return}r("copy:success",{entity:n,field:"id",message:s("consumers.copy.success",{val:h})})},y=(n,d)=>{const h=JSON.stringify(n);if(!d(h)){r("copy:error",{entity:n,message:s("consumers.errors.copy")});return}r("copy:success",{entity:n,message:s("consumers.copy.success_brief")})},$=async n=>{var h;await((h=o.canRetrieve)==null?void 0:h.call(o,n))&&I.push(o.config.getViewRoute(n.id))},C=n=>({label:s("consumers.actions.view"),to:o.config.getViewRoute(n)}),l=n=>({label:s("consumers.actions.edit"),to:o.config.getEditRoute(n)}),m=e.ref(void 0),p=e.ref(!1),b=e.ref(!1),O=e.ref(""),T=f.useDeleteUrlBuilder(o.config,J.value),ee=n=>{m.value=n,p.value=!0},Ke=()=>{p.value=!1},qe=async()=>{var n,d,h;if((n=m.value)!=null&&n.id){b.value=!0;try{await w.delete(T(m.value.id)),b.value=!1,p.value=!1,V.value++,r("delete:success",m.value)}catch(N){O.value=((h=(d=N.response)==null?void 0:d.data)==null?void 0:h.message)||N.message||s("consumers.errors.delete"),r("error",N)}finally{b.value=!1}}},te=e.ref(!1),ie=()=>{te.value=!0},le=()=>{te.value=!1},ce=(n,d)=>{d||le(),V.value++,r("add:success",n)},Oe=()=>{x.value&&ie()},F=e.ref(void 0),oe=e.ref(!1),je=e.ref(""),Le=n=>{F.value=n,oe.value=!0},de=()=>{oe.value=!1,F.value=void 0},We=e.computed(()=>{var d,h,N,S;let n=`${o.config.apiBaseUrl}${P.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((d=o.config)==null?void 0:d.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(N=o.config)!=null&&N.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((S=o.config)==null?void 0:S.consumerGroupId)||"")),n}),ue=e.ref(!1),He=async()=>{if(F.value){ue.value=!0;try{const n=We.value.replace(/{consumerId}/gi,F.value.id);await w.delete(n),r("remove:success",F.value),de(),V.value++}catch(n){je.value=n.message||s("consumers.errors.delete"),r("error",n)}finally{ue.value=!1}}},me=e.ref(!1);e.watch(G,n=>{var d,h,N,S;if(Array.isArray((d=n==null?void 0:n.response)==null?void 0:d.data)&&(me.value=n.response.data.length>0),n.status===f.FetcherStatus.Error){a.value={title:s("consumers.errors.general")},(S=(N=(h=n.error)==null?void 0:h.response)==null?void 0:N.data)!=null&&S.message&&(a.value.message=n.error.response.data.message),r("error",n.error);return}a.value=null});const ne=e.ref({ctaPath:x.value?void 0:o.config.createRoute,ctaText:void 0,message:`${s("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:s("consumers.title")});return e.onBeforeMount(async()=>{await o.canCreate()&&(ne.value.title=x.value?s("consumers.list.empty_state.title_for_consumer_group"):s("consumers.list.empty_state.title"),ne.value.ctaText=x.value?s("consumers.actions.add_consumer"):s("consumers.actions.create"))}),(n,d)=>{const h=e.resolveComponent("KButton"),N=e.resolveComponent("KBadge"),S=e.resolveComponent("KTruncate"),z=e.resolveComponent("KDropdownItem"),fe=e.resolveComponent("KClipboardProvider"),Je=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-pagination":x.value&&!t.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":W.value,"empty-state-options":ne.value,"enable-entity-actions":"","error-message":a.value,fetcher:e.unref(Y),"fetcher-cache-key":V.value,"pagination-type":"offset","preferences-storage-key":u.value,query:M.value,"row-attributes":H,"table-headers":e.unref(U),"use-action-outside":t.useActionOutside,onClearSearchInput:B,"onClick:row":d[3]||(d[3]=g=>$(g)),onEmptyStateCtaClicked:Oe,onSort:D},{"toolbar-filter":e.withCtx(()=>[x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:M.value,"onUpdate:modelValue":d[0]||(d[0]=g=>M.value=g),config:K.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.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer",size:"large",to:t.config.consumerGroupId?void 0:t.config.createRoute,onClick:d[1]||(d[1]=()=>t.config.consumerGroupId?ie():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(ge.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(s)("consumers.actions.add_consumer"):e.unref(s)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["to"]),[[e.vShow,me.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),username:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(q(g)),1)]),custom_id:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(q(g)),1)]),tags:e.withCtx(({rowValue:g})=>[g&&g.length>0?(e.openBlock(),e.createBlock(S,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,Q=>(e.openBlock(),e.createBlock(N,{key:Q,onClick:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ee,"-"))]),actions:e.withCtx(({row:g})=>[e.createVNode(fe,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:Qe=>i(g,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(fe,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:Qe=>y(g,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(z,{"data-testid":"action-entity-view","has-divider":"",item:C(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(z,{"data-testid":"action-entity-edit",item:l(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?Le(g):ee(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(s)("consumers.actions.remove"):e.unref(s)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","use-action-outside"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-button-disabled":b.value,"data-testid":"delete-consumer-modal",description:e.unref(s)("consumers.delete.description"),"entity-name":m.value&&(m.value.username||m.value.custom_id||m.value.id),"entity-type":e.unref(f.EntityTypes).Consumer,error:O.value,title:e.unref(s)("consumers.delete.title"),visible:p.value,onCancel:Ke,onProceed:qe},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:te.value,"onAdd:partialSuccess":d[4]||(d[4]=g=>ce(g,!0)),"onAdd:success":d[5]||(d[5]=g=>ce(g)),onCancel:le},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&F.value?(e.openBlock(),e.createBlock(Je,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(s)("consumers.consumer_groups.remove.title"),visible:oe.value,onCancel:de,onProceed:He},{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(F.value.username||F.value.custom_id||F.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(s)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-9a998e6f"]]);let Z;const De=new Uint8Array(16);function $e(){if(!Z&&(Z=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Z))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(De)}const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function Me(t,c=0){return _[t[c+0]]+_[t[c+1]]+_[t[c+2]]+_[t[c+3]]+"-"+_[t[c+4]]+_[t[c+5]]+"-"+_[t[c+6]]+_[t[c+7]]+"-"+_[t[c+8]]+_[t[c+9]]+"-"+_[t[c+10]]+_[t[c+11]]+_[t[c+12]]+_[t[c+13]]+_[t[c+14]]+_[t[c+15]]}const ae={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ge(t,c,r){if(ae.randomUUID&&!c&&!t)return ae.randomUUID();t=t||{};const o=t.random||(t.rng||$e)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,c){r=r||0;for(let k=0;k<16;++k)c[r+k]=o[k];return c}return Me(o)}const Te={class:"kong-ui-entities-consumer-form"},Se=["id"],Ae={class:"fields-group-text"},Fe=["aria-labelledby"],Re=v(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:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(t,{emit:c}){var q;const r=t,o=c,{i18nT:k,i18n:{t:s}}=X.useI18n(),I=re.useRouter(),{axiosInstance:w}=f.useAxios((q=r.config)==null?void 0:q.axiosRequestConfig),{getMessageFromError:V}=f.useErrors(),x=Ge(),u=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),W=e.reactive({username:"",customId:"",tags:""}),R=e.computed(()=>{var a,i;return(i=P.form[(a=r.config)==null?void 0:a.app])==null?void 0:i.edit}),U=()=>{var a;I.push(((a=r.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},H=a=>{o("loading",a)},J=a=>{o("error",a)},M=a=>{var y,$,C;u.fields.username=((y=a==null?void 0:a.item)==null?void 0:y.username)||(a==null?void 0:a.username)||"",u.fields.customId=(($=a==null?void 0:a.item)==null?void 0:$.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((C=a==null?void 0:a.item)==null?void 0:C.tags)||(a==null?void 0:a.tags)||[];u.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(W,u.fields)},K=e.computed(()=>r.consumerId?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),A=a=>{var y,$,C,l,m,p;let i=`${(y=r.config)==null?void 0:y.apiBaseUrl}${P.form[($=r.config)==null?void 0:$.app][a]}`;return((C=r.config)==null?void 0:C.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=r.config)==null?void 0:l.controlPlaneId)||""):((m=r.config)==null?void 0:m.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(p=r.config)!=null&&p.workspace?`/${r.config.workspace}`:"")),i=i.replace(/{id}/gi,r.consumerId),i},Y=e.computed(()=>!!u.fields.username||!!u.fields.customId),G=e.computed(()=>JSON.stringify(u.fields)!==JSON.stringify(W)),B=e.computed(()=>{var a,i;return{username:u.fields.username||null,custom_id:u.fields.customId||null,tags:(i=(a=u.fields.tags.split(","))==null?void 0:a.map(y=>String(y||"").trim()))==null?void 0:i.filter(y=>y!=="")}}),D=async()=>{var a;try{u.readonly=!0;let i;await w.post(A("validate"),B.value),K.value==="create"?i=await w.post(A("create"),B.value):K.value==="edit"&&(i=((a=r.config)==null?void 0:a.app)==="konnect"?await w.put(A("edit"),B.value):await w.patch(A("edit"),B.value)),M(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){u.errorMessage=V(i),o("error",i)}finally{u.readonly=!1}};return(a,i)=>{const y=e.resolveComponent("KInput"),$=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":Y.value&&G.value,config:t.config,"edit-id":t.consumerId,"enable-terraform":t.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).Consumer,"error-message":u.errorMessage,"fetch-url":R.value,"form-fields":B.value,"is-readonly":u.readonly,onCancel:U,"onFetch:error":i[3]||(i[3]=C=>J(C)),"onFetch:success":M,onLoading:i[4]||(i[4]=C=>H(C)),onSubmit:D},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(s)("consumers.form.info.description"),"has-divider":"",title:e.unref(s)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(x)}`,class:"fields-group-title"},e.toDisplayString(e.unref(s)("consumers.form.consumer_identification.title"))+"* ",9,Se),e.createElementVNode("p",Ae,e.toDisplayString(e.unref(s)("consumers.form.consumer_identification.description")),1)]),e.createVNode($,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(x)}`},[e.createVNode(y,{modelValue:u.fields.username,"onUpdate:modelValue":i[0]||(i[0]=C=>u.fields.username=C),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(s)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.username.placeholder"),readonly:u.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(s)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(y,{modelValue:u.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=C=>u.fields.customId=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(s)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.custom_id.placeholder"),readonly:u.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(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Fe)]),_:1}),e.createVNode(y,{modelValue:u.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=C=>u.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(s)("consumers.fields.tags.help"),label:e.unref(s)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(s)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.tags.placeholder"),readonly:u.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-5973c664"]]),Pe={class:"kong-ui-consumer-entity-config-card"},Ue=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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const c=t,{i18n:{t:r},i18nT:o}=X.useI18n(),k=e.computed(()=>P.form[c.config.app].edit),s=e.ref({id:{},username:{section:f.ConfigurationSchemaSection.Basic,tooltip:r("consumers.fields.username.tooltip"),order:1},custom_id:{section:f.ConfigurationSchemaSection.Basic,tooltip:r("consumers.fields.custom_id.tooltip"),label:r("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:r("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(I,w)=>(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":s.value,"enable-terraform":t.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).Consumer,"fetch-url":k.value,"hide-title":t.hideTitle,"onFetch:error":w[0]||(w[0]=V=>I.$emit("fetch:error",V)),"onFetch:success":w[1]||(w[1]=V=>I.$emit("fetch:success",V)),onLoading:w[2]||(w[2]=V=>I.$emit("loading",V))},{"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(r)("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(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Ue,E.ConsumerForm=Re,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,re,ge,se,f){"use strict";const ye={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"},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. 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 he(){const t=se.createI18n("en-us",ye);return{i18n:t,i18nT:se.i18nTComponent(t)}}const X={useI18n:he},j="/v2/control-planes/{controlPlaneId}/core-entities",L="/{workspace}",P={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}`}}},Ce={class:"add-consumer-form-container"},be={class:"add-consumer-form-cta"},ke={class:"select-item-label"},_e={key:0,class:"select-item-desc"},Ie={key:0,class:"kong-ui-entity-add-consumers-error"},we={key:0},Ve=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:c}){var C;const{i18n:{t:r}}=X.useI18n(),o=t,k=c,{axiosInstance:s}=f.useAxios((C=o.config)==null?void 0:C.axiosRequestConfig),I=e.ref([]),{debouncedQueryChange:w,loading:V,allRecords:x,error:u,loadItems:W,results:R}=f.useDebouncedFilter(o.config,P.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),U=l=>l,H=e.computed(()=>u.value?r("consumers.errors.general"):""),J=e.ref(0),M=e.computed(()=>x.value===void 0),K=e.computed(()=>R.value.map(l=>({label:l.username||l.customId,value:l.id,selected:I.value.includes(l.id),data:l}))),A=l=>{var p;const m=M.value?R.value.find(b=>b.id===l):(p=x.value)==null?void 0:p.find(b=>b.id===l);return m?m.username||m.custom_id:l},z=()=>{D.value="",G.value=[],y.value=[],k("cancel")},G=e.ref([]),B=e.ref(!1),D=e.ref(""),q=async()=>{if(!I.value.length){D.value="",y.value=[],k("cancel");return}B.value=!0,D.value="",G.value=[],y.value=[];try{const l=I.value.map(b=>i(b)),m=await Promise.allSettled(l);let p=!0;m.forEach(b=>{b.status!=="fulfilled"&&(p=!1)}),p?(G.value=[],y.value=[],k("add:success",I.value),I.value=[]):(G.value.length&&k("add:partial-success",G.value),I.value=[],$(m))}catch{D.value=r("consumers.errors.add"),k("error",D.value)}finally{B.value=!1}},a=e.computed(()=>{var m,p,b,O;let l=`${o.config.apiBaseUrl}${P.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((m=o.config)==null?void 0:m.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((p=o.config)==null?void 0:p.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((O=o.config)==null?void 0:O.consumerGroupId)||"")),l}),i=async l=>{const m={consumer:l};try{const p=await s.post(a.value,m);return G.value.push(l),p}catch(p){let b=`${A(l)} - ${p.message}`;return p.response.status===409&&(b=`${A(l)} - ${r("consumers.errors.already_added")}`),Promise.reject(Error(b))}},y=e.ref([]),$=l=>{y.value=l.map(m=>{var p;return(p=m.reason)==null?void 0:p.message}).filter(Boolean)};return e.watch(K,()=>{J.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&W()},{immediate:!0}),(l,m)=>{const p=e.resolveComponent("KMultiselect"),b=e.resolveComponent("KAlert"),O=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(O,{"action-button-disabled":B.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(r)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:z,onProceed:q},{default:e.withCtx(()=>[e.createElementVNode("div",Ce,[e.createElementVNode("p",be,e.toDisplayString(e.unref(r)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(p,{modelValue:I.value,"onUpdate:modelValue":m[0]||(m[0]=T=>I.value=T),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":M.value?e.unref(r)("consumers.consumer_groups.add.footer"):void 0,items:K.value,label:e.unref(r)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(V),placeholder:e.unref(r)("consumers.consumer_groups.add.consumer_placeholder"),readonly:B.value,required:"",width:"100%",onQueryChange:e.unref(w)},{"item-template":e.withCtx(({item:T})=>[e.createElementVNode("div",ke,e.toDisplayString(T.label),1),U(T).data.username&&U(T).data.custom_id?(e.openBlock(),e.createElementBlock("div",_e,e.toDisplayString(U(T).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),D.value||H.value||y.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(b,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.errors.add")),1),y.value.length?(e.openBlock(),e.createElementBlock("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(T,ee)=>(e.openBlock(),e.createElementBlock("li",{key:ee},e.toDisplayString(T),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(D.value||H.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),v=(t,c)=>{const r=t.__vccOpts||t;for(const[o,k]of c)r[o]=k;return r},xe=v(Ve,[["__scopeId","data-v-d54468ab"]]),Ne={class:"kong-ui-entities-consumers-list"},Ee={key:1},Be=v(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","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:c}){var pe;const r=c,o=t,{i18nT:k,i18n:{t:s}}=X.useI18n(),I=re.useRouter(),{axiosInstance:w}=f.useAxios((pe=o.config)==null?void 0:pe.axiosRequestConfig),V=e.ref(1),x=e.computed(()=>!!o.config.consumerGroupId),u=e.computed(()=>x.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),W=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),R={username:{label:s("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:s("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:s("consumers.list.table_headers.tags"),sortable:!1}},U=R,H=n=>({"data-testid":n.username??n.custom_id??n.id}),J=e.computed(()=>{var d,h,N,S;let n=`${o.config.apiBaseUrl}${P.list[o.config.app][x.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((d=o.config)==null?void 0:d.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(N=o.config)!=null&&N.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((S=o.config)==null?void 0:S.consumerGroupId)||"")),n}),M=e.ref(""),K=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:s(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:R.username,custom_id:R.custom_id},schema:o.config.filterSchema}}),A=e.computed(()=>x.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:z,fetcherState:G}=f.useFetcher(o.config,J.value,A.value),B=()=>{M.value=""},D=()=>{V.value++},q=n=>n??"-",a=e.ref(null),i=(n,d)=>{const h=n.id;if(!d(h)){r("copy:error",{entity:n,field:"id",message:s("consumers.errors.copy")});return}r("copy:success",{entity:n,field:"id",message:s("consumers.copy.success",{val:h})})},y=(n,d)=>{const h=JSON.stringify(n);if(!d(h)){r("copy:error",{entity:n,message:s("consumers.errors.copy")});return}r("copy:success",{entity:n,message:s("consumers.copy.success_brief")})},$=async n=>{var h;await((h=o.canRetrieve)==null?void 0:h.call(o,n))&&I.push(o.config.getViewRoute(n.id))},C=n=>({label:s("consumers.actions.view"),to:o.config.getViewRoute(n)}),l=n=>({label:s("consumers.actions.edit"),to:o.config.getEditRoute(n)}),m=e.ref(void 0),p=e.ref(!1),b=e.ref(!1),O=e.ref(""),T=f.useDeleteUrlBuilder(o.config,J.value),ee=n=>{m.value=n,p.value=!0},Ke=()=>{p.value=!1},qe=async()=>{var n,d,h;if((n=m.value)!=null&&n.id){b.value=!0;try{await w.delete(T(m.value.id)),b.value=!1,p.value=!1,V.value++,r("delete:success",m.value)}catch(N){O.value=((h=(d=N.response)==null?void 0:d.data)==null?void 0:h.message)||N.message||s("consumers.errors.delete"),r("error",N)}finally{b.value=!1}}},te=e.ref(!1),ie=()=>{te.value=!0},le=()=>{te.value=!1},ce=(n,d)=>{d||le(),V.value++,r("add:success",n)},Oe=()=>{x.value&&ie()},F=e.ref(void 0),oe=e.ref(!1),je=e.ref(""),Le=n=>{F.value=n,oe.value=!0},de=()=>{oe.value=!1,F.value=void 0},We=e.computed(()=>{var d,h,N,S;let n=`${o.config.apiBaseUrl}${P.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((d=o.config)==null?void 0:d.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(N=o.config)!=null&&N.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((S=o.config)==null?void 0:S.consumerGroupId)||"")),n}),ue=e.ref(!1),He=async()=>{if(F.value){ue.value=!0;try{const n=We.value.replace(/{consumerId}/gi,F.value.id);await w.delete(n),r("remove:success",F.value),de(),V.value++}catch(n){je.value=n.message||s("consumers.errors.delete"),r("error",n)}finally{ue.value=!1}}},me=e.ref(!1);e.watch(G,n=>{var d,h,N,S;if(Array.isArray((d=n==null?void 0:n.response)==null?void 0:d.data)&&(me.value=n.response.data.length>0),n.status===f.FetcherStatus.Error){a.value={title:s("consumers.errors.general")},(S=(N=(h=n.error)==null?void 0:h.response)==null?void 0:N.data)!=null&&S.message&&(a.value.message=n.error.response.data.message),r("error",n.error);return}a.value=null});const ne=e.ref({ctaPath:x.value?void 0:o.config.createRoute,ctaText:void 0,message:`${s("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:s("consumers.title")});return e.onBeforeMount(async()=>{await o.canCreate()&&(ne.value.title=x.value?s("consumers.list.empty_state.title_for_consumer_group"):s("consumers.list.empty_state.title"),ne.value.ctaText=x.value?s("consumers.actions.add_consumer"):s("consumers.actions.create"))}),(n,d)=>{const h=e.resolveComponent("KButton"),N=e.resolveComponent("KBadge"),S=e.resolveComponent("KTruncate"),Y=e.resolveComponent("KDropdownItem"),fe=e.resolveComponent("KClipboardProvider"),Je=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(f.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-pagination":x.value&&!t.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":W.value,"empty-state-options":ne.value,"enable-entity-actions":"","error-message":a.value,fetcher:e.unref(z),"fetcher-cache-key":V.value,"pagination-type":"offset","preferences-storage-key":u.value,query:M.value,"row-attributes":H,"table-headers":e.unref(U),onClearSearchInput:B,"onClick:row":d[3]||(d[3]=g=>$(g)),onEmptyStateCtaClicked:Oe,onSort:D},{"toolbar-filter":e.withCtx(()=>[x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(f.EntityFilter),{key:0,modelValue:M.value,"onUpdate:modelValue":d[0]||(d[0]=g=>M.value=g),config:K.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.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer",size:t.useActionOutside?"medium":"large",to:t.config.consumerGroupId?void 0:t.config.createRoute,onClick:d[1]||(d[1]=()=>t.config.consumerGroupId?ie():void 0)},{default:e.withCtx(()=>[e.createVNode(e.unref(ge.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(s)("consumers.actions.add_consumer"):e.unref(s)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["size","to"]),[[e.vShow,me.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),username:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(q(g)),1)]),custom_id:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(q(g)),1)]),tags:e.withCtx(({rowValue:g})=>[g&&g.length>0?(e.openBlock(),e.createBlock(S,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,Q=>(e.openBlock(),e.createBlock(N,{key:Q,onClick:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ee,"-"))]),actions:e.withCtx(({row:g})=>[e.createVNode(fe,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(Y,{"data-testid":"action-entity-copy-id",onClick:Qe=>i(g,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(fe,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(Y,{"data-testid":"action-entity-copy-json",onClick:Qe=>y(g,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(Y,{"data-testid":"action-entity-view","has-divider":"",item:C(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(Y,{"data-testid":"action-entity-edit",item:l(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(f.PermissionsWrapper),{"auth-function":()=>t.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(Y,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?Le(g):ee(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(s)("consumers.actions.remove"):e.unref(s)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers"]),e.createVNode(e.unref(f.EntityDeleteModal),{"action-button-disabled":b.value,"data-testid":"delete-consumer-modal",description:e.unref(s)("consumers.delete.description"),"entity-name":m.value&&(m.value.username||m.value.custom_id||m.value.id),"entity-type":e.unref(f.EntityTypes).Consumer,error:O.value,title:e.unref(s)("consumers.delete.title"),visible:p.value,onCancel:Ke,onProceed:qe},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:te.value,"onAdd:partialSuccess":d[4]||(d[4]=g=>ce(g,!0)),"onAdd:success":d[5]||(d[5]=g=>ce(g)),onCancel:le},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&F.value?(e.openBlock(),e.createBlock(Je,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(s)("consumers.consumer_groups.remove.title"),visible:oe.value,onCancel:de,onProceed:He},{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(F.value.username||F.value.custom_id||F.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(s)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-b03c77ce"]]);let Z;const De=new Uint8Array(16);function $e(){if(!Z&&(Z=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Z))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(De)}const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function Me(t,c=0){return _[t[c+0]]+_[t[c+1]]+_[t[c+2]]+_[t[c+3]]+"-"+_[t[c+4]]+_[t[c+5]]+"-"+_[t[c+6]]+_[t[c+7]]+"-"+_[t[c+8]]+_[t[c+9]]+"-"+_[t[c+10]]+_[t[c+11]]+_[t[c+12]]+_[t[c+13]]+_[t[c+14]]+_[t[c+15]]}const ae={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ge(t,c,r){if(ae.randomUUID&&!c&&!t)return ae.randomUUID();t=t||{};const o=t.random||(t.rng||$e)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,c){r=r||0;for(let k=0;k<16;++k)c[r+k]=o[k];return c}return Me(o)}const Te={class:"kong-ui-entities-consumer-form"},Se=["id"],Ae={class:"fields-group-text"},Fe=["aria-labelledby"],Re=v(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:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(t,{emit:c}){var q;const r=t,o=c,{i18nT:k,i18n:{t:s}}=X.useI18n(),I=re.useRouter(),{axiosInstance:w}=f.useAxios((q=r.config)==null?void 0:q.axiosRequestConfig),{getMessageFromError:V}=f.useErrors(),x=Ge(),u=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),W=e.reactive({username:"",customId:"",tags:""}),R=e.computed(()=>{var a,i;return(i=P.form[(a=r.config)==null?void 0:a.app])==null?void 0:i.edit}),U=()=>{var a;I.push(((a=r.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},H=a=>{o("loading",a)},J=a=>{o("error",a)},M=a=>{var y,$,C;u.fields.username=((y=a==null?void 0:a.item)==null?void 0:y.username)||(a==null?void 0:a.username)||"",u.fields.customId=(($=a==null?void 0:a.item)==null?void 0:$.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((C=a==null?void 0:a.item)==null?void 0:C.tags)||(a==null?void 0:a.tags)||[];u.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(W,u.fields)},K=e.computed(()=>r.consumerId?f.EntityBaseFormType.Edit:f.EntityBaseFormType.Create),A=a=>{var y,$,C,l,m,p;let i=`${(y=r.config)==null?void 0:y.apiBaseUrl}${P.form[($=r.config)==null?void 0:$.app][a]}`;return((C=r.config)==null?void 0:C.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=r.config)==null?void 0:l.controlPlaneId)||""):((m=r.config)==null?void 0:m.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(p=r.config)!=null&&p.workspace?`/${r.config.workspace}`:"")),i=i.replace(/{id}/gi,r.consumerId),i},z=e.computed(()=>!!u.fields.username||!!u.fields.customId),G=e.computed(()=>JSON.stringify(u.fields)!==JSON.stringify(W)),B=e.computed(()=>{var a,i;return{username:u.fields.username||null,custom_id:u.fields.customId||null,tags:(i=(a=u.fields.tags.split(","))==null?void 0:a.map(y=>String(y||"").trim()))==null?void 0:i.filter(y=>y!=="")}}),D=async()=>{var a;try{u.readonly=!0;let i;await w.post(A("validate"),B.value),K.value==="create"?i=await w.post(A("create"),B.value):K.value==="edit"&&(i=((a=r.config)==null?void 0:a.app)==="konnect"?await w.put(A("edit"),B.value):await w.patch(A("edit"),B.value)),M(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){u.errorMessage=V(i),o("error",i)}finally{u.readonly=!1}};return(a,i)=>{const y=e.resolveComponent("KInput"),$=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(f.EntityBaseForm),{"can-submit":z.value&&G.value,config:t.config,"edit-id":t.consumerId,"enable-terraform":t.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).Consumer,"error-message":u.errorMessage,"fetch-url":R.value,"form-fields":B.value,"is-readonly":u.readonly,onCancel:U,"onFetch:error":i[3]||(i[3]=C=>J(C)),"onFetch:success":M,onLoading:i[4]||(i[4]=C=>H(C)),onSubmit:D},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(f.EntityFormSection),{description:e.unref(s)("consumers.form.info.description"),"has-divider":"",title:e.unref(s)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(x)}`,class:"fields-group-title"},e.toDisplayString(e.unref(s)("consumers.form.consumer_identification.title"))+"* ",9,Se),e.createElementVNode("p",Ae,e.toDisplayString(e.unref(s)("consumers.form.consumer_identification.description")),1)]),e.createVNode($,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(x)}`},[e.createVNode(y,{modelValue:u.fields.username,"onUpdate:modelValue":i[0]||(i[0]=C=>u.fields.username=C),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(s)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.username.placeholder"),readonly:u.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(s)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(y,{modelValue:u.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=C=>u.fields.customId=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(s)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.custom_id.placeholder"),readonly:u.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(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Fe)]),_:1}),e.createVNode(y,{modelValue:u.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=C=>u.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(s)("consumers.fields.tags.help"),label:e.unref(s)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(s)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(s)("consumers.fields.tags.placeholder"),readonly:u.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-5973c664"]]),Pe={class:"kong-ui-consumer-entity-config-card"},Ue=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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const c=t,{i18n:{t:r},i18nT:o}=X.useI18n(),k=e.computed(()=>P.form[c.config.app].edit),s=e.ref({id:{},username:{section:f.ConfigurationSchemaSection.Basic,tooltip:r("consumers.fields.username.tooltip"),order:1},custom_id:{section:f.ConfigurationSchemaSection.Basic,tooltip:r("consumers.fields.custom_id.tooltip"),label:r("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:r("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(I,w)=>(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(e.unref(f.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":s.value,"enable-terraform":t.enableTerraform,"entity-type":e.unref(f.SupportedEntityType).Consumer,"fetch-url":k.value,"hide-title":t.hideTitle,"onFetch:error":w[0]||(w[0]=V=>I.$emit("fetch:error",V)),"onFetch:success":w[1]||(w[1]=V=>I.$emit("fetch:success",V)),onLoading:w[2]||(w[2]=V=>I.$emit("loading",V))},{"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(r)("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(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Ue,E.ConsumerForm=Re,E.ConsumerList=Be,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{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-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{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-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .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(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{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-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .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-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .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-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.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-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{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-94990087]{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-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{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}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.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}.kong-ui-entities-consumers-list[data-v-9a998e6f]{width:100%}.kong-ui-entities-consumers-list .message[data-v-9a998e6f]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-9a998e6f]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-5973c664]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-5973c664] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-5973c664]{border:none;margin:0;padding:0}.fields-group-title[data-v-5973c664]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-5973c664]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-5973c664]{margin-bottom:16px}
|
|
1
|
+
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{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-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{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-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .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(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{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-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .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-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .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-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.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-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{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-94990087]{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-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{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}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.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}.kong-ui-entities-consumers-list[data-v-b03c77ce]{width:100%}.kong-ui-entities-consumers-list .message[data-v-b03c77ce]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-b03c77ce]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-5973c664]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-5973c664] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-5973c664]{border:none;margin:0;padding:0}.fields-group-title[data-v-5973c664]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-5973c664]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-5973c664]{margin-bottom:16px}
|