@kong-ui-public/entities-consumer-credentials 1.1.20 → 1.1.21-pr.790.b9b7a5bf.0
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.
|
@@ -159,7 +159,7 @@ const Be = {
|
|
|
159
159
|
useI18n: Pe
|
|
160
160
|
}, je = {
|
|
161
161
|
list: {
|
|
162
|
-
konnect: "/api/
|
|
162
|
+
konnect: "/api/control_planes/{controlPlaneId}/consumers/{consumerId}/{plugin}",
|
|
163
163
|
kongManager: "/{workspace}/consumers/{consumerId}/{plugin}"
|
|
164
164
|
}
|
|
165
165
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumer-credentials"]={},E.Vue,E["kong-ui-public-i18n"],E.axios))})(this,function(E,e,L,re){"use strict";const oe={credentials:{title:"Consumer Credentials",list:{toolbar_actions:{acls:{new:"New ACL Credential"},"basic-auth":{new:"New Basic Auth Credential"},"key-auth":{new:"New Key Auth Credential"},"key-auth-enc":{new:"New Key Auth Encrypted Credential"},oauth2:{new:"New OAuth 2.0 Credential"},"hmac-auth":{new:"New HMAC Credential"},jwt:{new:"New JWT Credential"}},table_headers:{acls:{group:"Group",created_at:"Created At",tags:"Tags"},"basic-auth":{password:"Credential",username:"Username",created_at:"Created at",tags:"Tags"},"key-auth":{key:"Key",created_at:"Created at",tags:"Tags"},"key-auth-enc":{key:"Key",created_at:"Created at",tags:"Tags"},oauth2:{name:"Name",client_id:"Client ID",client_secret:"Client secret",created_at:"Created at",tags:"Tags"},"hmac-auth":{username:"Username",secret:"Secret",created_at:"Created at",tags:"Tags"},jwt:{key:"Key",algorithm:"Algorithm",created_at:"Created at",tags:"Tags"}},empty_state:{acls:{title:"Configure a New ACL Credential",cta:"New ACL Credential"},"basic-auth":{title:"Configure a New Basic Auth Credential",cta:"New Basic Auth Credential"},"key-auth":{title:"Configure a New Key Auth Credential",cta:"New Key Auth Credential"},"key-auth-enc":{title:"Configure a New Key Auth Encrypted Credential",cta:"New Key Auth Encrypted Credential"},oauth2:{title:"Configure a New OAuth 2.0 Credential",cta:"New OAuth 2.0 Credential"},"hmac-auth":{title:"Configure a New HMAC Credential",cta:"New HMAC Credential"},jwt:{title:"Configure a New JWT Credential",cta:"New JWT Credential"}}},actions:{copy_id:"Copy ID",copy_credential:"Copy Credential",copy_key:"Copy Key",copy_secret:"Copy Secret",copy_json:"Copy JSON",edit:"Edit",delete:"Delete"},delete:{acls:{title:"Delete an ACL Credential"},"basic-auth":{title:"Delete a Basic Auth Credential"},"key-auth":{title:"Delete a Key Auth Credential"},"key-auth-enc":{title:"Delete a Key Auth Encrypted Credential"},oauth2:{title:"Delete an OAuth 2.0 Credential"},"hmac-auth":{title:"Delete an HMAC Credential"},jwt:{title:"Delete a JWT Credential"},description:"This action cannot be reversed."},error:{general:"Credentials could not be retrieved",delete:"The credential could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}}};function ie(){const t=L.createI18n("en-us",oe);return{i18n:t,i18nT:L.i18nTComponent(t)}}const le={useI18n:ie},se={list:{konnect:"/api/runtime_groups/{controlPlaneId}/consumers/{consumerId}/{plugin}",kongManager:"/{workspace}/consumers/{consumerId}/{plugin}"}};var G=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(G||{}),P=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(P||{});function F(t={}){return{axiosInstance:re.create({withCredentials:!0,timeout:3e4,...t})}}function ce(){return{debounce:(t,r)=>{let a;return(...n)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{t(...n)},r)}}}}const U="khcp-user-table-preferences",de={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ue(){const t=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},r=()=>{const a=t(localStorage.getItem(U));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,n)=>{try{const i=r();i.set(a,n),localStorage.setItem(U,JSON.stringify(Object.fromEntries(i.entries())))}catch(i){console.error("useTablePreferences(setTablePreferences)",i)}},getTablePreferences:a=>{const n=r();return(n==null?void 0:n.get(a))||void 0||de},deleteAllTablePreferences:()=>{localStorage.removeItem(U)}}}const pe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ye={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},fe={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},he={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}"}},ge={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},me={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},be={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ce={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},we={deleteModal:pe,baseForm:ye,baseTable:fe,baseConfigCard:he,filter:ge,debouncedFilter:me,errors:be,toggleModal:Ce};function H(){const t=L.createI18n("en-us",we);return{i18n:t,i18nT:L.i18nTComponent(t)}}function ke(t,r,a,n={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:i}=F({headers:t.requestHeaders}),{i18n:{t:o}}=H(),{debounce:u}=ce(),k=u(async S=>{await T(S)},200),f=e.ref(!1),d=e.ref(""),b=e.ref(""),y=e.ref([]),N=e.ref(void 0),C=e.unref(r);let _=`${t.apiBaseUrl}${C}`;t.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const p=async()=>{try{f.value=!0;const{data:S}=await i.get(`${_}?size=${a}`);S!=null&&S.next||(N.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]),y.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]}catch{y.value=[],d.value=o("debouncedFilter.errors.fetch")}finally{f.value=!1}},w=e.ref(""),T=async S=>{var l,g;if(w.value!==S)if(w.value=S||"",N.value===void 0)try{f.value=!0,d.value="",b.value="";let x=_+"";S&&(x+=`/${S}`);const{data:B}=await i.get(`${x}?size=${a}`);n.fetchedItemsKey in B?y.value=B[n.fetchedItemsKey]:B!=null&&B.id?y.value=[B]:y.value=[]}catch(x){((l=x==null?void 0:x.response)==null?void 0:l.status)===404?b.value=o("debouncedFilter.errors.invalid"):(y.value=[],d.value=o("debouncedFilter.errors.fetch"))}finally{f.value=!1}else f.value=!0,b.value="",S?(y.value=(g=N.value)==null?void 0:g.filter(x=>{var B;let O=!1;for(const j of n.searchKeys){const M=typeof x[j]=="string"?(B=x[j])==null?void 0:B.toLowerCase():x[j];M!=null&&M.includes(S.toLowerCase())&&(O=!0)}return O}),(!y.value||!y.value.length)&&(b.value=o("debouncedFilter.errors.invalid"))):y.value=N.value,f.value=!1};return{loading:f,error:d,validationError:b,results:y,allRecords:N,loadItems:p,debouncedQueryChange:k}}function _e(t,r){const a=e.unref(r),n=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return n.value.search="",i=>`${n.value.href}/${i}`}function Se(){const{i18n:{t}}=H();return{getMessageFromError:r=>{var a,n,i;if(!r)return t("errors.unexpected");if((a=r==null?void 0:r.response)!=null&&a.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let u=t("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(u=o.messages.join(", ")),o.field?`${o.field} - ${u}`:u}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||t("errors.unexpected")}}}function X(t,r){const a=e.ref(e.unref(t)),n=e.ref(e.unref(r)),i=e.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),o=e.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return u=>{const{page:k,pageSize:f,offset:d,sortColumnKey:b,sortColumnOrder:y,query:N}=u;try{let C=new URL(o.value.href);return i.value&&N?(C.search="",C=new URL(`${C.href}/${N}/`)):(i.value||new URLSearchParams(N).forEach((_,p)=>{C.searchParams.append(p,_)}),b&&C.searchParams.append("sort_by",b),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(f))),d&&k!==1&&C.searchParams.append("offset",String(d)),C.href}catch(C){return console.error("RouteList(fetcher)",C),n.value}}}function xe(t,r,a="data"){const n=e.unref(r),{axiosInstance:i}=F({headers:t.requestHeaders}),o=X(t,n),u=e.ref({status:P.Idle});return{fetcher:async k=>{try{u.value={status:P.Loading};const f=o(k),{data:d}=await i.get(f),b=a&&a.replace(/[^\w-_]/gi,"");let y;d[b]&&Array.isArray(d[b])?y=d[b]:y=Object.keys(d).length?[d]:[];const N={data:y,total:y.length,...d.offset?{pagination:{offset:d.offset}}:null};return u.value={status:P.Idle,response:N},N}catch(f){const d={data:[],total:0};return k.query&&f.response.status===404?(u.value={status:P.NoResults,response:d,error:f},d):(u.value={status:P.Error,response:d,error:f},d)}},fetcherState:u}}function Ne(){return{convertKeyToTitle:(t,r="_")=>t?t.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):""}}const Y=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Q=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const r=t.match(Y);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},Z=t=>t==="*"||t==="x"||t==="X",v=t=>{const r=parseInt(t,10);return isNaN(r)?t:r},Te=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],Be=(t,r)=>{if(Z(t)||Z(r))return 0;const[a,n]=Te(v(t),v(r));return a>n?1:a<n?-1:0},ee=(t,r)=>{for(let a=0;a<Math.max(t.length,r.length);a++){const n=Be(t[a]||"0",r[a]||"0");if(n!==0)return n}return 0},Ie=(t,r)=>{const a=Q(t),n=Q(r),i=a.pop(),o=n.pop(),u=ee(a,n);return u!==0?u:i&&o?ee(i.split("."),o.split(".")):i||o?i?-1:1:0},te=(t,r,a)=>{Ae(a);const n=Ie(t,r);return ae[a].includes(n)},ae={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ne=Object.keys(ae),Ae=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(ne.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${ne.join("|")}`)},Ee=t=>typeof t=="string"&&/^[v\d]/.test(t)&&Y.test(t);function Ke(t){const{gatewayInfo:r,supportedRange:a}=t;if(!r)return!0;const{edition:n,version:i}=r;if(!Ee(i))return console.error("Invalid version"),!1;const o=a[n];if(!o)return!1;const[u,k]=o;return!(u&&te(i,u,"<")||k&&te(i,k,">"))}const W={useAxios:F,useDebouncedFilter:ke,useDeleteUrlBuilder:_e,useErrors:Se,useFetcher:xe,useFetchUrlBuilder:X,useStringHelpers:Ne,useI18n:H,useGatewayFeatureSupported:Ke},z=(t,r)=>{const a=t.__vccOpts||t;for(const[n,i]of r)a[n]=i;return a},Ve="#3a3f51",De={key:0},$e=z(e.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(t){const r=t,a=e.computed(()=>{var p;return((p=r.rowEl)==null?void 0:p.querySelector(`[data-testid="${r.keyName}"]`))||null}),n=e.computed(()=>{var p;return((p=a.value)==null?void 0:p.querySelector('[role="button"]'))||null}),i=e.computed(()=>{var p,w;const T=(p=r.rowEl)==null?void 0:p.querySelectorAll("td");return T?((w=T[0])==null?void 0:w.getAttribute("data-testid"))===r.keyName:!1});let o;const u=()=>{o&&(o.disconnect(),o=void 0)},k=()=>{var p,w,T;d.value=((p=n.value)==null?void 0:p.getBoundingClientRect().width)||0,b.value=((w=a.value)==null?void 0:w.clientWidth)||0,y.value=((T=f.value)==null?void 0:T.innerText)||""},f=e.ref({}),d=e.ref(0),b=e.ref(0),y=e.ref(""),N=e.computed(()=>[n.value,a.value]),C=e.watch(N,p=>{if(i.value&&(u(),"ResizeObserver"in window&&window)){o=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||k()})});for(const w of p)w&&o.observe(w)}},{immediate:!0,flush:"post",deep:!0}),_=e.computed(()=>i.value?d.value>b.value:!1);return e.onMounted(()=>{k()}),e.onUnmounted(()=>{C()}),(p,w)=>{const T=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("span",{ref_key:"contentRef",ref:f,class:"content-wrapper"},[i.value?(e.openBlock(),e.createElementBlock("span",De,[e.createVNode(T,{disabled:!_.value,label:y.value,"max-width":"300",placement:"bottomStart"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):e.renderSlot(p.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),Pe={class:"toolbar-container"},je={key:0,class:"toolbar-button-container"},qe=["data-testid"],Oe=z(e.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(t,{emit:r}){const a=t,{i18n:{t:n}}=W.useI18n(),i=e.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),o=l=>l.hasData||!!a.query,u=e.computed(()=>{const l=[];return Object.keys(a.tableHeaders).forEach(g=>{const x=a.tableHeaders[g];l.push({label:x.label??g,key:g,sortable:x.sortable??!1})}),a.enableEntityActions&&l.push({key:"actions",hideLabel:!0}),l}),k=l=>({"data-rowid":l.id,"data-testid":l.name,...a.rowAttributes(l)}),f=e.ref({}),d=l=>{var g;return(g=f.value)==null?void 0:g.$el.querySelector(`[data-rowid="${l.id}"]`)},b=l=>{const g={"data-testid":l.headerKey,...a.cellAttributes(l)};return l.colIndex===0&&(g.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),g},y=()=>{r("empty-state-cta-clicked"),N()},N=()=>{r("clear-search-input")},C=(l,g)=>{r("click:row",g)},_=l=>{r("sort",l)},{setTablePreferences:p,getTablePreferences:w}=ue(),T=e.computed(()=>{const l=w(a.preferencesStorageKey);return{...a.initialFetcherParams,...l}}),S=l=>{a.preferencesStorageKey&&p(a.preferencesStorageKey,l)};return(l,g)=>{const x=e.resolveComponent("KIcon"),B=e.resolveComponent("KButton"),O=e.resolveComponent("KDropdownMenu"),j=e.resolveComponent("KTable"),M=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(M,{class:"kong-ui-entity-base-table",title:t.title},{body:e.withCtx(()=>[e.createVNode(j,{ref_key:"tableRefs",ref:f,"cache-identifier":i.value,"cell-attrs":b,"disable-pagination-page-jump":t.disablePaginationPageJump,"disable-sorting":t.disableSorting,"empty-state-action-button-icon":t.query?"":"plus","empty-state-action-message":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):t.emptyStateOptions.ctaText,"empty-state-action-route":t.query?"":t.emptyStateOptions.ctaPath,"empty-state-icon":t.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsMessage"):t.emptyStateOptions.message,"empty-state-title":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsTitle"):t.emptyStateOptions.title,"enable-client-sort":t.enableClientSort,"error-state-title":t.errorMessage,fetcher:t.fetcher,"fetcher-cache-key":String(t.fetcherCacheKey),"has-error":!!t.errorMessage,headers:u.value,"hide-pagination-when-optional":"","initial-fetcher-params":T.value,"is-loading":t.isLoading,"pagination-type":t.paginationType,"row-attrs":k,"search-input":t.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C,onSort:g[0]||(g[0]=K=>_(K)),"onUpdate:tablePreferences":S},e.createSlots({toolbar:e.withCtx(({state:K})=>[e.withDirectives(e.createElementVNode("div",Pe,[e.renderSlot(l.$slots,"toolbar-filter",{},void 0,!0),l.$slots["toolbar-button"]?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(l.$slots,"toolbar-button",{},void 0,!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,o(K)]])]),actions:e.withCtx(({row:K,rowKey:q,rowValue:D})=>[e.createElementVNode("div",{class:"actions-container","data-testid":K.name},[e.createVNode(O,{"kpop-attributes":{placement:"bottomEnd"},width:t.dropdownMenuWidth},{items:e.withCtx(()=>[e.renderSlot(l.$slots,"actions",{row:K,rowKey:q,rowValue:D},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(B,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:e.withCtx(()=>[e.createVNode(x,{color:e.unref(Ve),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,qe)]),_:2},[e.renderList(t.tableHeaders,(K,q)=>({name:q,fn:e.withCtx(({row:D,rowKey:s,rowValue:m})=>[e.createVNode($e,{"key-name":String(q),"row-el":d(D)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,q,{row:D,rowKey:s,rowValue:m},()=>[e.createTextVNode(e.toDisplayString(m),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-a598b1d9"]]),Me={key:0,class:"kong-ui-entity-delete-error"},Re={key:1,class:"description"},Le=z(e.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(t,{emit:r}){const a=t,{i18nT:n}=W.useI18n(),i=e.computed(()=>a.needConfirm?a.entityName:""),o=()=>{r("cancel")},u=()=>{r("proceed")};return(k,f)=>{const d=e.resolveComponent("KAlert"),b=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(b,{"action-button-text":"Yes, delete","action-pending":t.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":i.value,"is-visible":t.visible,title:t.title,type:"danger",onCanceled:o,onProceed:u},{"body-content":e.withCtx(()=>[t.error?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(d,{appearance:"danger"},{alertMessage:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.error),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(n),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},e.createSlots({entityType:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||k.$slots.description?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(k.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(a.description),1)],!0)])):e.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),J=e.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(t){const r=t,a=e.ref(void 0),n=e.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return e.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(i,o)=>n.value?e.renderSlot(i.$slots,"default",{key:0,isAllowed:a.value}):e.createCommentVNode("",!0)}}),{useAxios:Fe,useDeleteUrlBuilder:Ue,useErrors:tt,useFetchUrlBuilder:at,useFetcher:He,useDebouncedFilter:nt,useStringHelpers:rt,useGatewayFeatureSupported:ot}=W,it="",We={class:"kong-ui-entities-consumer-credentials-list"},ze={key:1},Je=e.defineComponent({__name:"ConsumerCredentialList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getEditRoute)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(t,{emit:r}){const a=t,{i18n:{t:n,formatUnixTimeStamp:i}}=le.useI18n(),{axiosInstance:o}=Fe({headers:a.config.requestHeaders}),u=e.ref(1),k={acls:{group:{label:n("credentials.list.table_headers.acls.group")},created_at:{label:n("credentials.list.table_headers.acls.created_at")},tags:{label:n("credentials.list.table_headers.acls.tags")}},"basic-auth":{password:{label:n("credentials.list.table_headers.basic-auth.password")},username:{label:n("credentials.list.table_headers.basic-auth.username")},created_at:{label:n("credentials.list.table_headers.basic-auth.created_at")},tags:{label:n("credentials.list.table_headers.basic-auth.tags")}},"key-auth":{key:{label:n("credentials.list.table_headers.key-auth.key")},created_at:{label:n("credentials.list.table_headers.key-auth.created_at")},tags:{label:n("credentials.list.table_headers.key-auth.tags")}},"key-auth-enc":{key:{label:n("credentials.list.table_headers.key-auth-enc.key")},created_at:{label:n("credentials.list.table_headers.key-auth-enc.created_at")},tags:{label:n("credentials.list.table_headers.key-auth-enc.tags")}},oauth2:{name:{label:n("credentials.list.table_headers.oauth2.name")},client_id:{label:n("credentials.list.table_headers.oauth2.client_id")},client_secret:{label:n("credentials.list.table_headers.oauth2.client_secret")},created_at:{label:n("credentials.list.table_headers.oauth2.created_at")},tags:{label:n("credentials.list.table_headers.oauth2.tags")}},"hmac-auth":{username:{label:n("credentials.list.table_headers.hmac-auth.username")},secret:{label:n("credentials.list.table_headers.hmac-auth.secret")},created_at:{label:n("credentials.list.table_headers.hmac-auth.created_at")},tags:{label:n("credentials.list.table_headers.hmac-auth.tags")}},jwt:{key:{label:n("credentials.list.table_headers.jwt.key")},algorithm:{label:n("credentials.list.table_headers.jwt.algorithm")},created_at:{label:n("credentials.list.table_headers.jwt.created_at")},tags:{label:n("credentials.list.table_headers.jwt.tags")}}},f=e.computed(()=>k[a.config.plugin]),d=e.computed(()=>{let s=`${a.config.apiBaseUrl}${se.list[a.config.app]}`;return a.config.app==="konnect"?s=s.replace(/{controlPlaneId}/gi,a.config.controlPlaneId||"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||""):a.config.app==="kongManager"&&(s=s.replace(/\/{workspace}/gi,a.config.workspace?`/${a.config.workspace}`:"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||"")),s}),{fetcher:b,fetcherState:y}=He(a.config,d),N=()=>{u.value++},C=e.ref(""),_=(s,m,V)=>{const A=m?s[m]:JSON.stringify(s);if(!V(A)){T(s,m);return}w(s,m)},p=(s,m,V)=>{const{type:A}=s;A==="success"?w(m,V):T(m,V)},w=(s,m)=>{r("copy:success",{entity:s,field:m,message:m?n("credentials.copy.success",{val:s[m]}):n("credentials.copy.success_brief")})},T=(s,m)=>{r("copy:error",{entity:s,field:m,message:n("credentials.error.copy")})},S=s=>({label:n("credentials.actions.edit"),to:a.config.getEditRoute(s)}),l=e.ref(void 0),g=e.ref(!1),x=e.ref(!1),B=e.ref(""),O=Ue(a.config,d.value),j=e.computed(()=>G[a.config.plugin]),M=s=>{l.value=s,g.value=!0},K=()=>{g.value=!1},q=async()=>{var s,m,V;if((s=l.value)!=null&&s.id){x.value=!0;try{await o.delete(O(l.value.id)),x.value=!1,g.value=!1,u.value++,r("delete:success",l.value)}catch(A){B.value=((V=(m=A.response)==null?void 0:m.data)==null?void 0:V.message)||A.message||n("credentials.error.delete"),r("error",A)}finally{x.value=!1}}};e.watch(y,s=>{if(s.status===P.Error){C.value=n("credentials.error.general"),r("error",s.error);return}C.value=""});const D=e.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:"",title:n("credentials.title")});return e.onBeforeMount(async()=>{await a.canCreate()&&(D.value.title=n(`credentials.list.empty_state.${a.config.plugin}.title`),D.value.ctaText=n(`credentials.list.empty_state.${a.config.plugin}.cta`))}),(s,m)=>{const V=e.resolveComponent("KButton"),A=e.resolveComponent("CopyUuid"),Xe=e.resolveComponent("KBadge"),Ye=e.resolveComponent("KTruncate"),$=e.resolveComponent("KDropdownItem"),R=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",We,[e.createVNode(e.unref(Oe),{"cache-identifier":t.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":"","empty-state-options":D.value,"enable-entity-actions":"","error-message":C.value,fetcher:e.unref(b),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumer-credentials-list","table-headers":f.value,onSort:N},{"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(J),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-credential",icon:"plus",to:t.config.createRoute},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)(`credentials.list.toolbar_actions.${t.config.plugin}.new`)),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),group:e.withCtx(({rowValue:c})=>[e.createElementVNode("b",null,e.toDisplayString(c??"-"),1)]),name:e.withCtx(({rowValue:c})=>[e.createElementVNode("b",null,e.toDisplayString(c??"-"),1)]),username:e.withCtx(({rowValue:c})=>[e.createElementVNode("span",null,e.toDisplayString(c??"-"),1)]),password:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"password"),uuid:h},null,8,["notify","uuid"])]),key:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"key"),uuid:h},null,8,["notify","uuid"])]),client_secret:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"client_secret"),uuid:h},null,8,["notify","uuid"])]),secret:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"secret"),uuid:h},null,8,["notify","uuid"])]),created_at:e.withCtx(({rowValue:c})=>[e.createTextVNode(e.toDisplayString(e.unref(i)(c)),1)]),tags:e.withCtx(({rowValue:c})=>[(c==null?void 0:c.length)>0?(e.openBlock(),e.createBlock(Ye,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,h=>(e.openBlock(),e.createBlock(Xe,{key:h,onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",ze,"-"))]),actions:e.withCtx(({row:c})=>[e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-id",onClick:I=>_(c,"id",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.config.plugin==="basic-auth"?(e.openBlock(),e.createBlock(R,{key:0},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-credential",onClick:I=>_(c,"password",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_credential")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),["key-auth","key-auth-enc","jwt"].includes(t.config.plugin)?(e.openBlock(),e.createBlock(R,{key:1},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-key",onClick:I=>_(c,"key",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_key")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),t.config.plugin==="oauth2"?(e.openBlock(),e.createBlock(R,{key:2},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-secret",onClick:I=>_(c,"client_secret",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),t.config.plugin==="hmac-auth"?(e.openBlock(),e.createBlock(R,{key:3},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-secret",onClick:I=>_(c,"secret",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-json",onClick:I=>_(c,void 0,h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(J),{"auth-function":()=>t.canEdit(c)},{default:e.withCtx(()=>[e.createVNode($,{"data-testid":"action-entity-edit","has-divider":"",item:S(c.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(J),{"auth-function":()=>t.canDelete(c)},{default:e.withCtx(()=>[e.createVNode($,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:h=>M(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers"]),e.createVNode(e.unref(Le),{"action-pending":x.value,description:e.unref(n)("credentials.delete.description"),"entity-type":j.value,error:B.value,title:e.unref(n)(`credentials.delete.${t.config.plugin}.title`),visible:g.value,onCancel:K,onProceed:q},null,8,["action-pending","description","entity-type","error","title","visible"])])}}}),lt="",Ge=((t,r)=>{const a=t.__vccOpts||t;for(const[n,i]of r)a[n]=i;return a})(Je,[["__scopeId","data-v-de45b351"]]);E.ConsumerCredentialList=Ge,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumer-credentials"]={},E.Vue,E["kong-ui-public-i18n"],E.axios))})(this,function(E,e,L,re){"use strict";const oe={credentials:{title:"Consumer Credentials",list:{toolbar_actions:{acls:{new:"New ACL Credential"},"basic-auth":{new:"New Basic Auth Credential"},"key-auth":{new:"New Key Auth Credential"},"key-auth-enc":{new:"New Key Auth Encrypted Credential"},oauth2:{new:"New OAuth 2.0 Credential"},"hmac-auth":{new:"New HMAC Credential"},jwt:{new:"New JWT Credential"}},table_headers:{acls:{group:"Group",created_at:"Created At",tags:"Tags"},"basic-auth":{password:"Credential",username:"Username",created_at:"Created at",tags:"Tags"},"key-auth":{key:"Key",created_at:"Created at",tags:"Tags"},"key-auth-enc":{key:"Key",created_at:"Created at",tags:"Tags"},oauth2:{name:"Name",client_id:"Client ID",client_secret:"Client secret",created_at:"Created at",tags:"Tags"},"hmac-auth":{username:"Username",secret:"Secret",created_at:"Created at",tags:"Tags"},jwt:{key:"Key",algorithm:"Algorithm",created_at:"Created at",tags:"Tags"}},empty_state:{acls:{title:"Configure a New ACL Credential",cta:"New ACL Credential"},"basic-auth":{title:"Configure a New Basic Auth Credential",cta:"New Basic Auth Credential"},"key-auth":{title:"Configure a New Key Auth Credential",cta:"New Key Auth Credential"},"key-auth-enc":{title:"Configure a New Key Auth Encrypted Credential",cta:"New Key Auth Encrypted Credential"},oauth2:{title:"Configure a New OAuth 2.0 Credential",cta:"New OAuth 2.0 Credential"},"hmac-auth":{title:"Configure a New HMAC Credential",cta:"New HMAC Credential"},jwt:{title:"Configure a New JWT Credential",cta:"New JWT Credential"}}},actions:{copy_id:"Copy ID",copy_credential:"Copy Credential",copy_key:"Copy Key",copy_secret:"Copy Secret",copy_json:"Copy JSON",edit:"Edit",delete:"Delete"},delete:{acls:{title:"Delete an ACL Credential"},"basic-auth":{title:"Delete a Basic Auth Credential"},"key-auth":{title:"Delete a Key Auth Credential"},"key-auth-enc":{title:"Delete a Key Auth Encrypted Credential"},oauth2:{title:"Delete an OAuth 2.0 Credential"},"hmac-auth":{title:"Delete an HMAC Credential"},jwt:{title:"Delete a JWT Credential"},description:"This action cannot be reversed."},error:{general:"Credentials could not be retrieved",delete:"The credential could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}}};function ie(){const t=L.createI18n("en-us",oe);return{i18n:t,i18nT:L.i18nTComponent(t)}}const le={useI18n:ie},se={list:{konnect:"/api/control_planes/{controlPlaneId}/consumers/{consumerId}/{plugin}",kongManager:"/{workspace}/consumers/{consumerId}/{plugin}"}};var G=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(G||{}),P=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(P||{});function F(t={}){return{axiosInstance:re.create({withCredentials:!0,timeout:3e4,...t})}}function ce(){return{debounce:(t,r)=>{let a;return(...n)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{t(...n)},r)}}}}const U="khcp-user-table-preferences",de={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ue(){const t=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},r=()=>{const a=t(localStorage.getItem(U));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,n)=>{try{const i=r();i.set(a,n),localStorage.setItem(U,JSON.stringify(Object.fromEntries(i.entries())))}catch(i){console.error("useTablePreferences(setTablePreferences)",i)}},getTablePreferences:a=>{const n=r();return(n==null?void 0:n.get(a))||void 0||de},deleteAllTablePreferences:()=>{localStorage.removeItem(U)}}}const pe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ye={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},fe={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},he={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}"}},ge={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},me={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},be={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ce={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},we={deleteModal:pe,baseForm:ye,baseTable:fe,baseConfigCard:he,filter:ge,debouncedFilter:me,errors:be,toggleModal:Ce};function H(){const t=L.createI18n("en-us",we);return{i18n:t,i18nT:L.i18nTComponent(t)}}function ke(t,r,a,n={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:i}=F({headers:t.requestHeaders}),{i18n:{t:o}}=H(),{debounce:u}=ce(),k=u(async S=>{await T(S)},200),f=e.ref(!1),d=e.ref(""),b=e.ref(""),y=e.ref([]),N=e.ref(void 0),C=e.unref(r);let _=`${t.apiBaseUrl}${C}`;t.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const p=async()=>{try{f.value=!0;const{data:S}=await i.get(`${_}?size=${a}`);S!=null&&S.next||(N.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]),y.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]}catch{y.value=[],d.value=o("debouncedFilter.errors.fetch")}finally{f.value=!1}},w=e.ref(""),T=async S=>{var l,g;if(w.value!==S)if(w.value=S||"",N.value===void 0)try{f.value=!0,d.value="",b.value="";let x=_+"";S&&(x+=`/${S}`);const{data:B}=await i.get(`${x}?size=${a}`);n.fetchedItemsKey in B?y.value=B[n.fetchedItemsKey]:B!=null&&B.id?y.value=[B]:y.value=[]}catch(x){((l=x==null?void 0:x.response)==null?void 0:l.status)===404?b.value=o("debouncedFilter.errors.invalid"):(y.value=[],d.value=o("debouncedFilter.errors.fetch"))}finally{f.value=!1}else f.value=!0,b.value="",S?(y.value=(g=N.value)==null?void 0:g.filter(x=>{var B;let O=!1;for(const j of n.searchKeys){const M=typeof x[j]=="string"?(B=x[j])==null?void 0:B.toLowerCase():x[j];M!=null&&M.includes(S.toLowerCase())&&(O=!0)}return O}),(!y.value||!y.value.length)&&(b.value=o("debouncedFilter.errors.invalid"))):y.value=N.value,f.value=!1};return{loading:f,error:d,validationError:b,results:y,allRecords:N,loadItems:p,debouncedQueryChange:k}}function _e(t,r){const a=e.unref(r),n=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return n.value.search="",i=>`${n.value.href}/${i}`}function Se(){const{i18n:{t}}=H();return{getMessageFromError:r=>{var a,n,i;if(!r)return t("errors.unexpected");if((a=r==null?void 0:r.response)!=null&&a.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let u=t("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(u=o.messages.join(", ")),o.field?`${o.field} - ${u}`:u}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||t("errors.unexpected")}}}function X(t,r){const a=e.ref(e.unref(t)),n=e.ref(e.unref(r)),i=e.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),o=e.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return u=>{const{page:k,pageSize:f,offset:d,sortColumnKey:b,sortColumnOrder:y,query:N}=u;try{let C=new URL(o.value.href);return i.value&&N?(C.search="",C=new URL(`${C.href}/${N}/`)):(i.value||new URLSearchParams(N).forEach((_,p)=>{C.searchParams.append(p,_)}),b&&C.searchParams.append("sort_by",b),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(f))),d&&k!==1&&C.searchParams.append("offset",String(d)),C.href}catch(C){return console.error("RouteList(fetcher)",C),n.value}}}function xe(t,r,a="data"){const n=e.unref(r),{axiosInstance:i}=F({headers:t.requestHeaders}),o=X(t,n),u=e.ref({status:P.Idle});return{fetcher:async k=>{try{u.value={status:P.Loading};const f=o(k),{data:d}=await i.get(f),b=a&&a.replace(/[^\w-_]/gi,"");let y;d[b]&&Array.isArray(d[b])?y=d[b]:y=Object.keys(d).length?[d]:[];const N={data:y,total:y.length,...d.offset?{pagination:{offset:d.offset}}:null};return u.value={status:P.Idle,response:N},N}catch(f){const d={data:[],total:0};return k.query&&f.response.status===404?(u.value={status:P.NoResults,response:d,error:f},d):(u.value={status:P.Error,response:d,error:f},d)}},fetcherState:u}}function Ne(){return{convertKeyToTitle:(t,r="_")=>t?t.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):""}}const Y=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Q=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const r=t.match(Y);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},Z=t=>t==="*"||t==="x"||t==="X",v=t=>{const r=parseInt(t,10);return isNaN(r)?t:r},Te=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],Be=(t,r)=>{if(Z(t)||Z(r))return 0;const[a,n]=Te(v(t),v(r));return a>n?1:a<n?-1:0},ee=(t,r)=>{for(let a=0;a<Math.max(t.length,r.length);a++){const n=Be(t[a]||"0",r[a]||"0");if(n!==0)return n}return 0},Ie=(t,r)=>{const a=Q(t),n=Q(r),i=a.pop(),o=n.pop(),u=ee(a,n);return u!==0?u:i&&o?ee(i.split("."),o.split(".")):i||o?i?-1:1:0},te=(t,r,a)=>{Ae(a);const n=Ie(t,r);return ae[a].includes(n)},ae={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ne=Object.keys(ae),Ae=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(ne.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${ne.join("|")}`)},Ee=t=>typeof t=="string"&&/^[v\d]/.test(t)&&Y.test(t);function Ke(t){const{gatewayInfo:r,supportedRange:a}=t;if(!r)return!0;const{edition:n,version:i}=r;if(!Ee(i))return console.error("Invalid version"),!1;const o=a[n];if(!o)return!1;const[u,k]=o;return!(u&&te(i,u,"<")||k&&te(i,k,">"))}const W={useAxios:F,useDebouncedFilter:ke,useDeleteUrlBuilder:_e,useErrors:Se,useFetcher:xe,useFetchUrlBuilder:X,useStringHelpers:Ne,useI18n:H,useGatewayFeatureSupported:Ke},z=(t,r)=>{const a=t.__vccOpts||t;for(const[n,i]of r)a[n]=i;return a},Ve="#3a3f51",De={key:0},$e=z(e.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(t){const r=t,a=e.computed(()=>{var p;return((p=r.rowEl)==null?void 0:p.querySelector(`[data-testid="${r.keyName}"]`))||null}),n=e.computed(()=>{var p;return((p=a.value)==null?void 0:p.querySelector('[role="button"]'))||null}),i=e.computed(()=>{var p,w;const T=(p=r.rowEl)==null?void 0:p.querySelectorAll("td");return T?((w=T[0])==null?void 0:w.getAttribute("data-testid"))===r.keyName:!1});let o;const u=()=>{o&&(o.disconnect(),o=void 0)},k=()=>{var p,w,T;d.value=((p=n.value)==null?void 0:p.getBoundingClientRect().width)||0,b.value=((w=a.value)==null?void 0:w.clientWidth)||0,y.value=((T=f.value)==null?void 0:T.innerText)||""},f=e.ref({}),d=e.ref(0),b=e.ref(0),y=e.ref(""),N=e.computed(()=>[n.value,a.value]),C=e.watch(N,p=>{if(i.value&&(u(),"ResizeObserver"in window&&window)){o=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||k()})});for(const w of p)w&&o.observe(w)}},{immediate:!0,flush:"post",deep:!0}),_=e.computed(()=>i.value?d.value>b.value:!1);return e.onMounted(()=>{k()}),e.onUnmounted(()=>{C()}),(p,w)=>{const T=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("span",{ref_key:"contentRef",ref:f,class:"content-wrapper"},[i.value?(e.openBlock(),e.createElementBlock("span",De,[e.createVNode(T,{disabled:!_.value,label:y.value,"max-width":"300",placement:"bottomStart"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):e.renderSlot(p.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),Pe={class:"toolbar-container"},je={key:0,class:"toolbar-button-container"},qe=["data-testid"],Oe=z(e.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(t,{emit:r}){const a=t,{i18n:{t:n}}=W.useI18n(),i=e.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),o=l=>l.hasData||!!a.query,u=e.computed(()=>{const l=[];return Object.keys(a.tableHeaders).forEach(g=>{const x=a.tableHeaders[g];l.push({label:x.label??g,key:g,sortable:x.sortable??!1})}),a.enableEntityActions&&l.push({key:"actions",hideLabel:!0}),l}),k=l=>({"data-rowid":l.id,"data-testid":l.name,...a.rowAttributes(l)}),f=e.ref({}),d=l=>{var g;return(g=f.value)==null?void 0:g.$el.querySelector(`[data-rowid="${l.id}"]`)},b=l=>{const g={"data-testid":l.headerKey,...a.cellAttributes(l)};return l.colIndex===0&&(g.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),g},y=()=>{r("empty-state-cta-clicked"),N()},N=()=>{r("clear-search-input")},C=(l,g)=>{r("click:row",g)},_=l=>{r("sort",l)},{setTablePreferences:p,getTablePreferences:w}=ue(),T=e.computed(()=>{const l=w(a.preferencesStorageKey);return{...a.initialFetcherParams,...l}}),S=l=>{a.preferencesStorageKey&&p(a.preferencesStorageKey,l)};return(l,g)=>{const x=e.resolveComponent("KIcon"),B=e.resolveComponent("KButton"),O=e.resolveComponent("KDropdownMenu"),j=e.resolveComponent("KTable"),M=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(M,{class:"kong-ui-entity-base-table",title:t.title},{body:e.withCtx(()=>[e.createVNode(j,{ref_key:"tableRefs",ref:f,"cache-identifier":i.value,"cell-attrs":b,"disable-pagination-page-jump":t.disablePaginationPageJump,"disable-sorting":t.disableSorting,"empty-state-action-button-icon":t.query?"":"plus","empty-state-action-message":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):t.emptyStateOptions.ctaText,"empty-state-action-route":t.query?"":t.emptyStateOptions.ctaPath,"empty-state-icon":t.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsMessage"):t.emptyStateOptions.message,"empty-state-title":t.query?e.unref(n)("baseTable.emptyState.noSearchResultsTitle"):t.emptyStateOptions.title,"enable-client-sort":t.enableClientSort,"error-state-title":t.errorMessage,fetcher:t.fetcher,"fetcher-cache-key":String(t.fetcherCacheKey),"has-error":!!t.errorMessage,headers:u.value,"hide-pagination-when-optional":"","initial-fetcher-params":T.value,"is-loading":t.isLoading,"pagination-type":t.paginationType,"row-attrs":k,"search-input":t.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C,onSort:g[0]||(g[0]=K=>_(K)),"onUpdate:tablePreferences":S},e.createSlots({toolbar:e.withCtx(({state:K})=>[e.withDirectives(e.createElementVNode("div",Pe,[e.renderSlot(l.$slots,"toolbar-filter",{},void 0,!0),l.$slots["toolbar-button"]?(e.openBlock(),e.createElementBlock("div",je,[e.renderSlot(l.$slots,"toolbar-button",{},void 0,!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,o(K)]])]),actions:e.withCtx(({row:K,rowKey:q,rowValue:D})=>[e.createElementVNode("div",{class:"actions-container","data-testid":K.name},[e.createVNode(O,{"kpop-attributes":{placement:"bottomEnd"},width:t.dropdownMenuWidth},{items:e.withCtx(()=>[e.renderSlot(l.$slots,"actions",{row:K,rowKey:q,rowValue:D},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(B,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:e.withCtx(()=>[e.createVNode(x,{color:e.unref(Ve),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,qe)]),_:2},[e.renderList(t.tableHeaders,(K,q)=>({name:q,fn:e.withCtx(({row:D,rowKey:s,rowValue:m})=>[e.createVNode($e,{"key-name":String(q),"row-el":d(D)},{default:e.withCtx(()=>[e.renderSlot(l.$slots,q,{row:D,rowKey:s,rowValue:m},()=>[e.createTextVNode(e.toDisplayString(m),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-a598b1d9"]]),Me={key:0,class:"kong-ui-entity-delete-error"},Re={key:1,class:"description"},Le=z(e.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(t,{emit:r}){const a=t,{i18nT:n}=W.useI18n(),i=e.computed(()=>a.needConfirm?a.entityName:""),o=()=>{r("cancel")},u=()=>{r("proceed")};return(k,f)=>{const d=e.resolveComponent("KAlert"),b=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(b,{"action-button-text":"Yes, delete","action-pending":t.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":i.value,"is-visible":t.visible,title:t.title,type:"danger",onCanceled:o,onProceed:u},{"body-content":e.withCtx(()=>[t.error?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(d,{appearance:"danger"},{alertMessage:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.error),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(n),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},e.createSlots({entityType:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||k.$slots.description?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(k.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(a.description),1)],!0)])):e.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),J=e.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(t){const r=t,a=e.ref(void 0),n=e.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return e.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(i,o)=>n.value?e.renderSlot(i.$slots,"default",{key:0,isAllowed:a.value}):e.createCommentVNode("",!0)}}),{useAxios:Fe,useDeleteUrlBuilder:Ue,useErrors:tt,useFetchUrlBuilder:at,useFetcher:He,useDebouncedFilter:nt,useStringHelpers:rt,useGatewayFeatureSupported:ot}=W,it="",We={class:"kong-ui-entities-consumer-credentials-list"},ze={key:1},Je=e.defineComponent({__name:"ConsumerCredentialList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getEditRoute)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(t,{emit:r}){const a=t,{i18n:{t:n,formatUnixTimeStamp:i}}=le.useI18n(),{axiosInstance:o}=Fe({headers:a.config.requestHeaders}),u=e.ref(1),k={acls:{group:{label:n("credentials.list.table_headers.acls.group")},created_at:{label:n("credentials.list.table_headers.acls.created_at")},tags:{label:n("credentials.list.table_headers.acls.tags")}},"basic-auth":{password:{label:n("credentials.list.table_headers.basic-auth.password")},username:{label:n("credentials.list.table_headers.basic-auth.username")},created_at:{label:n("credentials.list.table_headers.basic-auth.created_at")},tags:{label:n("credentials.list.table_headers.basic-auth.tags")}},"key-auth":{key:{label:n("credentials.list.table_headers.key-auth.key")},created_at:{label:n("credentials.list.table_headers.key-auth.created_at")},tags:{label:n("credentials.list.table_headers.key-auth.tags")}},"key-auth-enc":{key:{label:n("credentials.list.table_headers.key-auth-enc.key")},created_at:{label:n("credentials.list.table_headers.key-auth-enc.created_at")},tags:{label:n("credentials.list.table_headers.key-auth-enc.tags")}},oauth2:{name:{label:n("credentials.list.table_headers.oauth2.name")},client_id:{label:n("credentials.list.table_headers.oauth2.client_id")},client_secret:{label:n("credentials.list.table_headers.oauth2.client_secret")},created_at:{label:n("credentials.list.table_headers.oauth2.created_at")},tags:{label:n("credentials.list.table_headers.oauth2.tags")}},"hmac-auth":{username:{label:n("credentials.list.table_headers.hmac-auth.username")},secret:{label:n("credentials.list.table_headers.hmac-auth.secret")},created_at:{label:n("credentials.list.table_headers.hmac-auth.created_at")},tags:{label:n("credentials.list.table_headers.hmac-auth.tags")}},jwt:{key:{label:n("credentials.list.table_headers.jwt.key")},algorithm:{label:n("credentials.list.table_headers.jwt.algorithm")},created_at:{label:n("credentials.list.table_headers.jwt.created_at")},tags:{label:n("credentials.list.table_headers.jwt.tags")}}},f=e.computed(()=>k[a.config.plugin]),d=e.computed(()=>{let s=`${a.config.apiBaseUrl}${se.list[a.config.app]}`;return a.config.app==="konnect"?s=s.replace(/{controlPlaneId}/gi,a.config.controlPlaneId||"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||""):a.config.app==="kongManager"&&(s=s.replace(/\/{workspace}/gi,a.config.workspace?`/${a.config.workspace}`:"").replace(/{consumerId}/gi,a.config.consumerId||"").replace(/{plugin}/gi,a.config.plugin||"")),s}),{fetcher:b,fetcherState:y}=He(a.config,d),N=()=>{u.value++},C=e.ref(""),_=(s,m,V)=>{const A=m?s[m]:JSON.stringify(s);if(!V(A)){T(s,m);return}w(s,m)},p=(s,m,V)=>{const{type:A}=s;A==="success"?w(m,V):T(m,V)},w=(s,m)=>{r("copy:success",{entity:s,field:m,message:m?n("credentials.copy.success",{val:s[m]}):n("credentials.copy.success_brief")})},T=(s,m)=>{r("copy:error",{entity:s,field:m,message:n("credentials.error.copy")})},S=s=>({label:n("credentials.actions.edit"),to:a.config.getEditRoute(s)}),l=e.ref(void 0),g=e.ref(!1),x=e.ref(!1),B=e.ref(""),O=Ue(a.config,d.value),j=e.computed(()=>G[a.config.plugin]),M=s=>{l.value=s,g.value=!0},K=()=>{g.value=!1},q=async()=>{var s,m,V;if((s=l.value)!=null&&s.id){x.value=!0;try{await o.delete(O(l.value.id)),x.value=!1,g.value=!1,u.value++,r("delete:success",l.value)}catch(A){B.value=((V=(m=A.response)==null?void 0:m.data)==null?void 0:V.message)||A.message||n("credentials.error.delete"),r("error",A)}finally{x.value=!1}}};e.watch(y,s=>{if(s.status===P.Error){C.value=n("credentials.error.general"),r("error",s.error);return}C.value=""});const D=e.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:"",title:n("credentials.title")});return e.onBeforeMount(async()=>{await a.canCreate()&&(D.value.title=n(`credentials.list.empty_state.${a.config.plugin}.title`),D.value.ctaText=n(`credentials.list.empty_state.${a.config.plugin}.cta`))}),(s,m)=>{const V=e.resolveComponent("KButton"),A=e.resolveComponent("CopyUuid"),Xe=e.resolveComponent("KBadge"),Ye=e.resolveComponent("KTruncate"),$=e.resolveComponent("KDropdownItem"),R=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",We,[e.createVNode(e.unref(Oe),{"cache-identifier":t.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":"","empty-state-options":D.value,"enable-entity-actions":"","error-message":C.value,fetcher:e.unref(b),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumer-credentials-list","table-headers":f.value,onSort:N},{"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(J),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-credential",icon:"plus",to:t.config.createRoute},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)(`credentials.list.toolbar_actions.${t.config.plugin}.new`)),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),group:e.withCtx(({rowValue:c})=>[e.createElementVNode("b",null,e.toDisplayString(c??"-"),1)]),name:e.withCtx(({rowValue:c})=>[e.createElementVNode("b",null,e.toDisplayString(c??"-"),1)]),username:e.withCtx(({rowValue:c})=>[e.createElementVNode("span",null,e.toDisplayString(c??"-"),1)]),password:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"password"),uuid:h},null,8,["notify","uuid"])]),key:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"key"),uuid:h},null,8,["notify","uuid"])]),client_secret:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"client_secret"),uuid:h},null,8,["notify","uuid"])]),secret:e.withCtx(({row:c,rowValue:h})=>[e.createVNode(A,{format:"redacted",notify:I=>p(I,c,"secret"),uuid:h},null,8,["notify","uuid"])]),created_at:e.withCtx(({rowValue:c})=>[e.createTextVNode(e.toDisplayString(e.unref(i)(c)),1)]),tags:e.withCtx(({rowValue:c})=>[(c==null?void 0:c.length)>0?(e.openBlock(),e.createBlock(Ye,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,h=>(e.openBlock(),e.createBlock(Xe,{key:h,onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",ze,"-"))]),actions:e.withCtx(({row:c})=>[e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-id",onClick:I=>_(c,"id",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.config.plugin==="basic-auth"?(e.openBlock(),e.createBlock(R,{key:0},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-credential",onClick:I=>_(c,"password",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_credential")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),["key-auth","key-auth-enc","jwt"].includes(t.config.plugin)?(e.openBlock(),e.createBlock(R,{key:1},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-key",onClick:I=>_(c,"key",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_key")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),t.config.plugin==="oauth2"?(e.openBlock(),e.createBlock(R,{key:2},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-secret",onClick:I=>_(c,"client_secret",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),t.config.plugin==="hmac-auth"?(e.openBlock(),e.createBlock(R,{key:3},{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-secret",onClick:I=>_(c,"secret",h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_secret")),1)]),_:2},1032,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:h})=>[e.createVNode($,{"data-testid":"action-entity-copy-json",onClick:I=>_(c,void 0,h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(J),{"auth-function":()=>t.canEdit(c)},{default:e.withCtx(()=>[e.createVNode($,{"data-testid":"action-entity-edit","has-divider":"",item:S(c.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(J),{"auth-function":()=>t.canDelete(c)},{default:e.withCtx(()=>[e.createVNode($,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:h=>M(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("credentials.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers"]),e.createVNode(e.unref(Le),{"action-pending":x.value,description:e.unref(n)("credentials.delete.description"),"entity-type":j.value,error:B.value,title:e.unref(n)(`credentials.delete.${t.config.plugin}.title`),visible:g.value,onCancel:K,onProceed:q},null,8,["action-pending","description","entity-type","error","title","visible"])])}}}),lt="",Ge=((t,r)=>{const a=t.__vccOpts||t;for(const[n,i]of r)a[n]=i;return a})(Je,[["__scopeId","data-v-de45b351"]]);E.ConsumerCredentialList=Ge,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-7410504d] .k-button.navigation-button{font-size:14px;font-weight:400}.kong-ui-copy-uuid[data-v-e4ea1359]{display:flex}.kong-ui-copy-uuid .uuid-container[data-v-e4ea1359]{margin-right:12px;white-space:nowrap}.kong-ui-copy-uuid .truncated-uuid[data-v-e4ea1359]{margin-right:1ch;max-width:10ch;overflow:hidden;text-overflow:ellipsis}.kong-ui-copy-uuid .uuid-icon-wrapper[data-v-e4ea1359]{align-items:center;cursor:pointer;display:flex}.kong-ui-copy-uuid .uuid-icon[data-v-e4ea1359]{display:flex}.config-card-details-row[data-v-a3c5ab01]{border-bottom:var(--2c6ac268);display:var(--c7a65802);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-a3c5ab01]{width:var(--778426fe)}.config-card-details-row .config-card-details-label label[data-v-a3c5ab01]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-a3c5ab01]{width:var(--777f9b48)}.config-card-details-row .config-card-details-value .truncated[data-v-a3c5ab01]{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-a3c5ab01]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-a3c5ab01] .kong-ui-copy-uuid:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-a3c5ab01]{display:flex}.config-card-details-row .config-badge[data-v-a3c5ab01]{margin-right:4px}.config-card-details-row[data-v-a3c5ab01] .k-input-label{margin-bottom:0}.config-card-details-row[data-v-a3c5ab01] .k-input-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-a3c5ab01] .config-card-details-row{width:auto}.kong-ui-entity-base-config-card[data-v-
|
|
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-7410504d] .k-button.navigation-button{font-size:14px;font-weight:400}.kong-ui-copy-uuid[data-v-e4ea1359]{display:flex}.kong-ui-copy-uuid .uuid-container[data-v-e4ea1359]{margin-right:12px;white-space:nowrap}.kong-ui-copy-uuid .truncated-uuid[data-v-e4ea1359]{margin-right:1ch;max-width:10ch;overflow:hidden;text-overflow:ellipsis}.kong-ui-copy-uuid .uuid-icon-wrapper[data-v-e4ea1359]{align-items:center;cursor:pointer;display:flex}.kong-ui-copy-uuid .uuid-icon[data-v-e4ea1359]{display:flex}.config-card-details-row[data-v-a3c5ab01]{border-bottom:var(--2c6ac268);display:var(--c7a65802);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-a3c5ab01]{width:var(--778426fe)}.config-card-details-row .config-card-details-label label[data-v-a3c5ab01]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-a3c5ab01]{width:var(--777f9b48)}.config-card-details-row .config-card-details-value .truncated[data-v-a3c5ab01]{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-a3c5ab01]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-a3c5ab01] .kong-ui-copy-uuid:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-a3c5ab01]{display:flex}.config-card-details-row .config-badge[data-v-a3c5ab01]{margin-right:4px}.config-card-details-row[data-v-a3c5ab01] .k-input-label{margin-bottom:0}.config-card-details-row[data-v-a3c5ab01] .k-input-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-a3c5ab01] .config-card-details-row{width:auto}.kong-ui-entity-base-config-card[data-v-8ede8e2e] .k-card-content .k-card-body{font-size:14px}.kong-ui-entity-base-config-card .config-card-actions[data-v-8ede8e2e]{display:flex}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-8ede8e2e]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-8ede8e2e] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-form[data-v-bffcae34]{border:1px solid #F1F1F5!important;box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-bffcae34]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-bffcae34] .k-button:last-of-type{margin-left:16px}.content-wrapper[data-v-f8a220e9] [role=button]{display:inline}.kong-ui-entity-base-table[data-v-a598b1d9]{border:1px solid #F1F1F5!important}.kong-ui-entity-base-table .toolbar-container[data-v-a598b1d9]{align-items:center}.kong-ui-entity-base-table .toolbar-button-container[data-v-a598b1d9]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-a598b1d9]{float:right}.kong-ui-entity-base-table .actions-container[data-v-a598b1d9] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.kong-ui-entity-base-table .actions-trigger[data-v-a598b1d9]{background-color:#0000!important;border:none!important;cursor:pointer!important;font-weight:400!important}.k-tabs>.tab-container>.kong-ui-entity-base-table,.k-tabs>.tab-container>[class^=kong-ui-entities-]>.kong-ui-entity-base-table{border-top:0}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-1c9a2a07],.kong-ui-entity-delete-modal .description[data-v-1c9a2a07]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-1c9a2a07]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-1c9a2a07]{margin-top:32px}.kong-ui-entity-delete-error[data-v-1c9a2a07]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-745f38c0]{width:100%}.kong-ui-entity-filter[data-v-745f38c0]{display:flex;position:relative}.kong-ui-entity-filter[data-v-745f38c0] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-745f38c0] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-745f38c0]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-745f38c0]{box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;position:absolute;top:100%;z-index:1060}.kong-ui-entity-filter-menu[data-v-745f38c0] .k-menu-item .menu-button:focus{box-shadow:none}.kong-ui-entity-filter-menu[data-v-745f38c0] .k-menu-item .menu-button:focus-visible{box-shadow:0 0 0 1px #bee2ff}.menu-item-title[data-v-745f38c0]{align-items:center;display:flex}.menu-item-indicator[data-v-745f38c0]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-745f38c0]{align-items:center;display:flex;justify-content:space-between}.menu-item-body[data-v-745f38c0] .k-input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-745f38c0] .k-input-wrapper{width:100%}.menu-item-body[data-v-745f38c0] .k-select-input .k-input{font-size:12px}.menu-item-body[data-v-745f38c0] .k-select-input .k-input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-745f38c0]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-745f38c0]{display:flex;justify-content:space-between;margin:10px 0 6px}fieldset[data-v-8b6dc312]{margin:0;padding:0}.kong-ui-entity-form-section[data-v-8b6dc312]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-8b6dc312]{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-8b6dc312]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-8b6dc312]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-8b6dc312]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-8b6dc312]{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-8b6dc312]{color:#000933;font-size:18px;font-weight:600;line-height:24px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-8b6dc312],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-8b6dc312],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-8b6dc312] 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-8b6dc312]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-8b6dc312]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-8b6dc312]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-8b6dc312]{border-bottom:1px solid #e0e4ea}.kong-ui-entities-consumer-credentials-list[data-v-de45b351]{width:100%}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-credentials",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21-pr.790.b9b7a5bf.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-credentials.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-credentials.es.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"errorLimit": "300KB"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@kong-ui-public/entities-shared": "^1.3.
|
|
54
|
+
"@kong-ui-public/entities-shared": "^1.3.4-pr.790.b9b7a5bf.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"dev": "cross-env USE_SANDBOX=true vite",
|