@kong-ui-public/entities-keys 3.5.43 → 3.5.45
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 +1 @@
|
|
|
1
|
-
(function(C,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):(C=typeof globalThis<"u"?globalThis:C||self,e(C["kong-ui-public-entities-keys"]={},C.Vue,C.VueRouter,C.KongIcons,C["kong-ui-public-i18n"],C["kong-ui-public-entities-shared"]))})(this,function(C,e,ee,ie,te,n){"use strict";const ae={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function ne(){const a=te.createI18n("en-us",ae);return{i18n:a,i18nT:te.i18nTComponent(a)}}const G={useI18n:ne},E="/v2/control-planes/{controlPlaneId}/core-entities",N="/{workspace}",j={list:{konnect:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`},kongManager:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`},edit:{all:`${E}/keys/{id}`,forKeySet:`${E}/key-sets/{keySetId}/keys/{id}`},keySets:`${E}/key-sets`,getKeySet:`${E}/key-sets/{keySetId}`},kongManager:{create:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},edit:{all:`${N}/keys/{id}`,forKeySet:`${N}/key-sets/{keySetId}/keys/{id}`},keySets:`${N}/key-sets`,getKeySet:`${N}/key-sets/{keySetId}`}}},re={class:"kong-ui-entities-keys-list"},se={key:1},ce=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.createRoute||!a.getViewRoute||!a.getEditRoute||a.app==="kongManager"&&!a.isExactMatch&&!a.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"],setup(a,{emit:D}){var Q;const b=D,l=a,{i18n:{t:y}}=G.useI18n(),c=ee.useRouter(),{axiosInstance:S}=n.useAxios((Q=l.config)==null?void 0:Q.axiosRequestConfig),K=e.ref(1),A=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),I={name:{label:y("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:y("keys.list.table_headers.key_id"),sortable:!0},tags:{label:y("keys.list.table_headers.tags")},id:{label:y("keys.list.table_headers.id"),sortable:!0}},o=I,_=e.computed(()=>{var i,d,p,h;let t=`${l.config.apiBaseUrl}${j.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?t=t.replace(/{controlPlaneId}/gi,((i=l.config)==null?void 0:i.controlPlaneId)||"").replace(/{keySetId}/gi,((d=l.config)==null?void 0:d.keySetId)||""):l.config.app==="kongManager"&&(t=t.replace(/\/{workspace}/gi,(p=l.config)!=null&&p.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((h=l.config)==null?void 0:h.keySetId)||"")),t}),x=e.ref(""),$=e.computed(()=>{const t=l.config.app==="konnect"||l.config.isExactMatch;if(t)return{isExactMatch:t,placeholder:y("keys.search.placeholder")};const i={name:I.name};return{isExactMatch:t,fields:i,schema:l.config.filterSchema}}),{fetcher:q,fetcherState:P}=n.useFetcher(l.config,_.value),U=()=>{x.value=""},F=()=>{K.value++},r=e.ref(null),u=e.ref(!1),V=(t,i)=>{const d=t.id;if(!i(d)){k(t,"id");return}w(t,"id")},g=(t,i)=>{const d=JSON.stringify(t);if(!i(d)){b("copy:error",{entity:t,message:y("keys.errors.copy")});return}b("copy:success",{entity:t,message:y("keys.copy.success_brief")})},w=(t,i)=>{b("copy:success",{entity:t,field:i,message:y("keys.copy.success",{val:t[i]})})},k=(t,i)=>{b("copy:error",{entity:t,field:i,message:y("keys.errors.copy")})},z=async t=>{var d;await((d=l.canRetrieve)==null?void 0:d.call(l,t))&&c.push(l.config.getViewRoute(t.id))},H=t=>({label:y("keys.actions.view"),to:l.config.getViewRoute(t)}),X=t=>({label:y("keys.actions.edit"),to:l.config.getEditRoute(t)}),B=e.ref(void 0),M=e.ref(!1),R=e.ref(!1),O=e.ref(""),Y=n.useDeleteUrlBuilder(l.config,_.value),Z=t=>{B.value=t,M.value=!0},v=()=>{M.value=!1},J=async()=>{var t,i,d;if((t=B.value)!=null&&t.id){R.value=!0;try{await S.delete(Y(B.value.id)),R.value=!1,M.value=!1,K.value++,b("delete:success",B.value)}catch(p){O.value=((d=(i=p.response)==null?void 0:i.data)==null?void 0:d.message)||p.message||y("keys.errors.delete"),b("error",p)}finally{R.value=!1}}},W=e.ref(!1);e.watch(P,t=>{var i,d,p,h;if(Array.isArray((i=t==null?void 0:t.response)==null?void 0:i.data)&&(W.value=t.response.data.length>0),t.status===n.FetcherStatus.NoRecords?u.value=!0:u.value=!1,t.status===n.FetcherStatus.Error){r.value={title:y("keys.errors.general")},(h=(p=(d=t.error)==null?void 0:d.response)==null?void 0:p.data)!=null&&h.message&&(r.value.message=t.error.response.data.message),b("error",t.error);return}r.value=null});const L=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:y("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(L.value.title=y("keys.list.empty_state.title"),L.value.ctaText=y("keys.actions.create"))}),(t,i)=>{const d=e.resolveComponent("KButton"),p=e.resolveComponent("KCopy"),h=e.resolveComponent("KBadge"),s=e.resolveComponent("KTruncate"),f=e.resolveComponent("KDropdownItem"),le=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(n.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":A.value,"empty-state-options":L.value,"enable-entity-actions":"","error-message":r.value,fetcher:e.unref(q),"fetcher-cache-key":K.value,"hide-toolbar":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:x.value,"table-headers":e.unref(o),onClearSearchInput:U,"onClick:row":i[2]||(i[2]=m=>z(m)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(n.EntityFilter),{modelValue:x.value,"onUpdate:modelValue":i[0]||(i[0]=m=>x.value=m),config:$.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(n.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(d,{appearance:"primary","data-testid":"toolbar-add-key",size:a.useActionOutside?"medium":"large",to:a.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(ie.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(y)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["size","to"]),[[e.vShow,W.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:m})=>[e.createElementVNode("b",null,e.toDisplayString(m??"-"),1)]),kid:e.withCtx(({rowValue:m})=>[e.createVNode(p,{text:m},null,8,["text"])]),tags:e.withCtx(({rowValue:m})=>[(m==null?void 0:m.length)>0?(e.openBlock(),e.createBlock(s,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,T=>(e.openBlock(),e.createBlock(h,{key:T,onClick:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",se,"-"))]),id:e.withCtx(({rowValue:m})=>[e.createVNode(p,{text:m,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:m})=>[e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:T})=>[e.createVNode(f,{"data-testid":"action-entity-copy-id",onClick:we=>V(m,T)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:T})=>[e.createVNode(f,{"data-testid":"action-entity-copy-json",onClick:we=>g(m,T)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(n.PermissionsWrapper),{"auth-function":()=>a.canRetrieve(m)},{default:e.withCtx(()=>[e.createVNode(f,{"data-testid":"action-entity-view","has-divider":"",item:H(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(n.PermissionsWrapper),{"auth-function":()=>a.canEdit(m)},{default:e.withCtx(()=>[e.createVNode(f,{"data-testid":"action-entity-edit",item:X(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(n.PermissionsWrapper),{"auth-function":()=>a.canDelete(m)},{default:e.withCtx(()=>[e.createVNode(f,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:T=>Z(m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","query","table-headers"]),e.createVNode(e.unref(n.EntityDeleteModal),{"action-pending":R.value,description:e.unref(y)("keys.delete.description"),"entity-name":B.value&&(B.value.name||B.value.id),"entity-type":e.unref(n.EntityTypes).Key,error:O.value,"need-confirm":!1,title:e.unref(y)("keys.delete.title"),visible:M.value,onCancel:v,onProceed:J},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),oe=(a,D)=>{const b=a.__vccOpts||a;for(const[l,y]of D)b[l]=y;return b},de=oe(ce,[["__scopeId","data-v-a99a46e1"]]),fe={class:"kong-ui-entities-keys-form"},ye={"data-testid":"no-search-results"},pe={class:"select-item-container"},ke={class:"select-item-label"},me={class:"select-item-description"},ue={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},ge={"data-testid":"key-format-container"},be=oe(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.cancelRoute)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(a,{emit:D}){var Q;const b=D,l=a,y=ee.useRouter(),{i18n:{t:c}}=G.useI18n(),{getMessageFromError:S}=n.useErrors(),{axiosInstance:K}=n.useAxios((Q=l.config)==null?void 0:Q.axiosRequestConfig),A=e.computed(()=>l.keySetId?j.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):j.form[l.config.app].edit.all),I=e.computed(()=>l.keyId?n.EntityBaseFormType.Edit:n.EntityBaseFormType.Create),o=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),_=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),x=[{label:c("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:c("keys.form.fields.key_format.options.pem"),value:"pem"}],$=e.computed(()=>o.isReadonly||I.value===n.EntityBaseFormType.Create&&!!l.fixedKeySetId),q=e.computed(()=>!$.value);e.watch(()=>l.fixedKeySetId,t=>{I.value===n.EntityBaseFormType.Create&&(o.fields.key_set=t)},{immediate:!0});const P=e.computed(()=>JSON.stringify(o.fields)!==JSON.stringify(_)&&!!o.fields.key_id&&!!o.fields.key_format&&(o.fields.key_format==="jwk"&&!!o.fields.jwk||o.fields.key_format==="pem"&&!!o.fields.private_key&&!!o.fields.public_key)),U=t=>{var i,d,p,h;o.fields.key_id=(t==null?void 0:t.kid)||"",o.fields.name=(t==null?void 0:t.name)||"",o.fields.tags=((i=t==null?void 0:t.tags)==null?void 0:i.join(", "))||"",o.fields.key_set=((d=t==null?void 0:t.set)==null?void 0:d.id)||"",o.fields.key_format=t!=null&&t.pem?"pem":"jwk",o.fields.jwk=(t==null?void 0:t.jwk)||"",o.fields.private_key=((p=t==null?void 0:t.pem)==null?void 0:p.private_key)||"",o.fields.public_key=((h=t==null?void 0:t.pem)==null?void 0:h.public_key)||"",Object.assign(_,o.fields)},F=()=>{y.push(l.config.cancelRoute)},r=e.computed(()=>{var i,d;let t=`${l.config.apiBaseUrl}${j.form[l.config.app][I.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?t=t.replace(/{controlPlaneId}/gi,((i=l.config)==null?void 0:i.controlPlaneId)||""):l.config.app==="kongManager"&&(t=t.replace(/\/{workspace}/gi,(d=l.config)!=null&&d.workspace?`/${l.config.workspace}`:"")),t=t.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),t}),u=e.computed(()=>{var t,i,d;return{kid:o.fields.key_id,name:o.fields.name||null,tags:((d=(i=(t=o.fields.tags)==null?void 0:t.split(","))==null?void 0:i.map(p=>String(p||"").trim()))==null?void 0:d.filter(p=>p!==""))||[],set:o.fields.key_set?{id:o.fields.key_set}:null,jwk:o.fields.key_format==="jwk"?o.fields.jwk:null,pem:o.fields.key_format==="pem"?{private_key:o.fields.private_key,public_key:o.fields.public_key}:null}}),V=async()=>{var t,i,d,p,h;try{o.isReadonly=!0;let s;if(I.value==="create"?s=await K.post(r.value,u.value):I.value==="edit"&&(s=((t=l.config)==null?void 0:t.app)==="konnect"?await K.put(r.value,u.value):await K.patch(r.value,u.value)),s){const{data:f}=s;o.fields.key_id=(f==null?void 0:f.kid)||"",o.fields.name=(f==null?void 0:f.name)||"",o.fields.tags=((i=f==null?void 0:f.tags)==null?void 0:i.join(", "))||"",o.fields.key_set=((d=f==null?void 0:f.set)==null?void 0:d.id)||"",o.fields.key_format=f!=null&&f.pem?"pem":"jwk",o.fields.jwk=(f==null?void 0:f.jwk)||"",o.fields.private_key=((p=f==null?void 0:f.pem)==null?void 0:p.private_key)||"",o.fields.public_key=((h=f==null?void 0:f.pem)==null?void 0:h.public_key)||"",Object.assign(_,o.fields),b("update",s==null?void 0:s.data)}}catch(s){o.errorMessage=S(s),b("error",s)}finally{o.isReadonly=!1}},{debouncedQueryChange:g,loading:w,allRecords:k,error:z,validationError:H,loadItems:X,results:B}=n.useDebouncedFilter(l.config,j.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),M=t=>{(!t||t!==o.fields.key_set&&t!==_.key_set)&&g(t)},R=e.computed(()=>z.value?c("keys.errors.key_sets.fetch"):""),O=e.computed(()=>H.value?c("keys.errors.key_sets.invalid"):""),Y=e.ref(0),Z=e.computed(()=>k.value===void 0),v=e.computed(()=>{if(Z.value)return l.config.app==="konnect"?c("keys.form.fields.key_set.footer"):void 0}),J=e.ref(new Set),W=e.computed(()=>Array.from(J.value).map(i=>({name:i.name||"",label:"",value:i.id,selected:o.fields.key_set===i.id}))),L=t=>{J.value.clear();let i;for(i of t)J.value.add(i)};return e.watch(B,t=>{L(t)},{immediate:!0,deep:!0}),e.watch(W,()=>{Y.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await X()}),(t,i)=>{const d=e.resolveComponent("KInput"),p=e.resolveComponent("KSelect"),h=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(n.EntityBaseForm),{"can-submit":P.value,config:a.config,"edit-id":a.keyId,"entity-type":e.unref(n.SupportedEntityType).Key,"error-message":o.errorMessage||R.value,"fetch-url":A.value,"form-fields":u.value,"is-readonly":o.isReadonly,onCancel:F,"onFetch:error":i[8]||(i[8]=s=>t.$emit("error",s)),"onFetch:success":U,onLoading:i[9]||(i[9]=s=>t.$emit("loading",s)),onSubmit:V},{default:e.withCtx(()=>[e.createVNode(e.unref(n.EntityFormSection),{description:e.unref(c)("keys.form.sections.general.description"),title:e.unref(c)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:o.fields.key_id,"onUpdate:modelValue":i[0]||(i[0]=s=>o.fields.key_id=s),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(c)("keys.form.fields.id.help"),label:e.unref(c)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(c)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(c)("keys.form.fields.id.placeholder"),readonly:o.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(d,{modelValue:o.fields.name,"onUpdate:modelValue":i[1]||(i[1]=s=>o.fields.name=s),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(c)("keys.form.fields.name.label"),placeholder:e.unref(c)("keys.form.fields.name.placeholder"),readonly:o.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(p,{modelValue:o.fields.key_set,"onUpdate:modelValue":i[2]||(i[2]=s=>o.fields.key_set=s),clearable:q.value,"data-testid":"key-form-key-set","dropdown-footer-text":v.value,"enable-filtering":"","filter-function":()=>!0,items:W.value,label:e.unref(c)("keys.form.fields.key_set.label"),loading:e.unref(w),placeholder:e.unref(c)("keys.form.fields.key_set.placeholder"),readonly:$.value,width:"100%",onQueryChange:M},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(c)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",ye,e.toDisplayString(e.unref(c)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:s})=>[e.createElementVNode("div",null,e.toDisplayString(s.name),1)]),"item-template":e.withCtx(({item:s})=>[e.createElementVNode("div",pe,[e.createElementVNode("div",ke,e.toDisplayString(s.name),1),e.createElementVNode("div",me,e.toDisplayString(s.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),O.value?(e.openBlock(),e.createElementBlock("p",ue,e.toDisplayString(O.value),1)):e.createCommentVNode("",!0),e.createVNode(d,{modelValue:o.fields.tags,"onUpdate:modelValue":i[3]||(i[3]=s=>o.fields.tags=s),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(c)("keys.form.fields.tags.help"),label:e.unref(c)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(c)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(c)("keys.form.fields.tags.placeholder"),readonly:o.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(n.EntityFormSection),{description:e.unref(c)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(c)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.createVNode(p,{modelValue:o.fields.key_format,"onUpdate:modelValue":i[4]||(i[4]=s=>o.fields.key_format=s),"data-testid":"key-form-key-format",items:x,label:e.unref(c)("keys.form.fields.key_format.label"),readonly:o.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),o.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(h,{key:0,modelValue:o.fields.jwk,"onUpdate:modelValue":i[5]||(i[5]=s=>o.fields.jwk=s),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(c)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(c)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(c)("keys.form.fields.jwk.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),o.fields.key_format==="pem"?(e.openBlock(),e.createBlock(h,{key:1,modelValue:o.fields.private_key,"onUpdate:modelValue":i[6]||(i[6]=s=>o.fields.private_key=s),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(c)("keys.form.fields.private_key.label"),placeholder:e.unref(c)("keys.form.fields.private_key.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),o.fields.key_format==="pem"?(e.openBlock(),e.createBlock(h,{key:2,modelValue:o.fields.public_key,"onUpdate:modelValue":i[7]||(i[7]=s=>o.fields.public_key=s),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(c)("keys.form.fields.public_key.label"),placeholder:e.unref(c)("keys.form.fields.public_key.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-9d0b1ebc"]]),he={class:"kong-ui-entities-keys-entity-config-card"},_e={key:2},Ce=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(a,{emit:D}){var F;const b=D,l=a,{axiosInstance:y}=n.useAxios((F=l.config)==null?void 0:F.axiosRequestConfig),{convertKeyToTitle:c}=n.useStringHelpers(),{i18n:{t:S}}=G.useI18n(),K=e.computed(()=>l.keySetId?`${j.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):j.form[l.config.app].edit.all),A=e.computed(()=>{var r;return(r=j.form[l.config.app])==null?void 0:r.getKeySet}),I=e.ref(),o=e.ref({}),_=e.ref(l.keySetId||""),x=e.ref(""),$=e.ref(!1),q=async r=>{var u;I.value=r,_.value=(u=r==null?void 0:r.set)==null?void 0:u.id,b("fetch:success",r),P(r)};e.watch(_,async()=>{var u,V;if(!_.value)return;let r=`${l.config.apiBaseUrl}${A.value}`;l.config.app==="konnect"?r=r.replace(/{controlPlaneId}/gi,((u=l.config)==null?void 0:u.controlPlaneId)||"").replace(/{keySetId}/gi,_.value||""):l.config.app==="kongManager"&&(r=r.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,_.value||""));try{$.value=!0;const{data:g}=await y.get(r,{validateStatus:w=>w===404||w>=200&&w<300});x.value=(g==null?void 0:g.name)||(g==null?void 0:g.id)}catch(g){b("fetch:error",g)}finally{$.value=!1}},{immediate:!0});const P=r=>{var u,V;try{if(r.jwk){const g=JSON.parse(r.jwk);Object.keys(g).forEach(w=>{o.value={...o.value,[`jwk.${w}`]:g[w]}})}else o.value={"pem.public_key":(u=r==null?void 0:r.pem)==null?void 0:u.public_key,"pem.private_key":(V=r==null?void 0:r.pem)==null?void 0:V.private_key}}catch(g){b("fetch:error",g)}return o},U=e.ref({id:{},name:{tooltip:S("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:S("keys.form.fields.set.label"),section:n.ConfigurationSchemaSection.Basic,tooltip:S("keys.form.fields.set.tooltip"),order:5},kid:{label:S("keys.form.fields.kid.label"),section:n.ConfigurationSchemaSection.Basic,tooltip:S("keys.form.fields.kid.tooltip")},tags:{tooltip:S("keys.form.fields.tags.tooltip")},jwk:{label:S("keys.form.fields.jwk.label"),type:n.ConfigurationSchemaType.Json},pem:{section:n.ConfigurationSchemaSection.Advanced,label:S("keys.form.fields.key_format.options.pem"),type:n.ConfigurationSchemaType.Json}});return(r,u)=>{var g,w;const V=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",he,[e.createVNode(e.unref(n.EntityBaseConfigCard),{config:a.config,"config-card-doc":a.configCardDoc,"config-schema":U.value,"entity-type":e.unref(n.SupportedEntityType).Key,"fetch-url":K.value,"hide-title":a.hideTitle,"onFetch:error":u[0]||(u[0]=k=>r.$emit("fetch:error",k)),"onFetch:success":q,onLoading:u[1]||(u[1]=k=>r.$emit("loading",k))},e.createSlots({set:e.withCtx(({row:k})=>[$.value?(e.openBlock(),e.createBlock(V,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):k.value&&k.value.id===_.value&&x.value?(e.openBlock(),e.createBlock(e.unref(n.InternalLinkItem),{key:1,item:{key:k.value.id,value:x.value,type:e.unref(n.ConfigurationSchemaType).LinkInternal},onClick:z=>r.$emit("navigation-click",k.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",_e,e.toDisplayString("–")))]),_:2},[(g=I.value)!=null&&g.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(o.value),k=>(e.openBlock(),e.createBlock(e.unref(n.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(c)(k),value:o.value[k]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(w=I.value)!=null&&w.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(o.value),k=>(e.openBlock(),e.createBlock(e.unref(n.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(c)(k),value:o.value[k]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}});C.KeyConfigCard=Ce,C.KeyForm=be,C.KeyList=de,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(_,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):(_=typeof globalThis<"u"?globalThis:_||self,e(_["kong-ui-public-entities-keys"]={},_.Vue,_.VueRouter,_.KongIcons,_["kong-ui-public-i18n"],_["kong-ui-public-entities-shared"]))})(this,function(_,e,v,oe,ee,s){"use strict";const le={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function ie(){const a=ee.createI18n("en-us",le);return{i18n:a,i18nT:ee.i18nTComponent(a)}}const z={useI18n:ie},N="/v2/control-planes/{controlPlaneId}/core-entities",E="/{workspace}",B={list:{konnect:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},kongManager:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},edit:{all:`${N}/keys/{id}`,forKeySet:`${N}/key-sets/{keySetId}/keys/{id}`},keySets:`${N}/key-sets`,getKeySet:`${N}/key-sets/{keySetId}`},kongManager:{create:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`},edit:{all:`${E}/keys/{id}`,forKeySet:`${E}/key-sets/{keySetId}/keys/{id}`},keySets:`${E}/key-sets`,getKeySet:`${E}/key-sets/{keySetId}`}}},ae={class:"kong-ui-entities-keys-list"},re=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.createRoute||!a.getViewRoute||!a.getEditRoute||a.app==="kongManager"&&!a.isExactMatch&&!a.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"],setup(a,{emit:$}){var W;const b=$,l=a,{i18n:{t:y}}=z.useI18n(),d=v.useRouter(),{axiosInstance:w}=s.useAxios((W=l.config)==null?void 0:W.axiosRequestConfig),x=e.ref(1),M=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),S={name:{label:y("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:y("keys.list.table_headers.key_id"),sortable:!0},tags:{label:y("keys.list.table_headers.tags")},id:{label:y("keys.list.table_headers.id"),sortable:!0}},o=S,h=e.computed(()=>{var i,f,p,u;let t=`${l.config.apiBaseUrl}${B.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?t=t.replace(/{controlPlaneId}/gi,((i=l.config)==null?void 0:i.controlPlaneId)||"").replace(/{keySetId}/gi,((f=l.config)==null?void 0:f.keySetId)||""):l.config.app==="kongManager"&&(t=t.replace(/\/{workspace}/gi,(p=l.config)!=null&&p.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((u=l.config)==null?void 0:u.keySetId)||"")),t}),V=e.ref(""),j=e.computed(()=>{const t=l.config.app==="konnect"||l.config.isExactMatch;if(t)return{isExactMatch:t,placeholder:y("keys.search.placeholder")};const i={name:S.name};return{isExactMatch:t,fields:i,schema:l.config.filterSchema}}),{fetcher:R,fetcherState:A}=s.useFetcher(l.config,h.value),q=()=>{V.value=""},D=()=>{x.value++},c=e.ref(null),m=e.ref(!1),I=(t,i)=>{const f=t.id;if(!i(f)){k(t,"id");return}C(t,"id")},g=(t,i)=>{const f=JSON.stringify(t);if(!i(f)){b("copy:error",{entity:t,message:y("keys.errors.copy")});return}b("copy:success",{entity:t,message:y("keys.copy.success_brief")})},C=(t,i)=>{b("copy:success",{entity:t,field:i,message:y("keys.copy.success",{val:t[i]})})},k=(t,i)=>{b("copy:error",{entity:t,field:i,message:y("keys.errors.copy")})},L=async t=>{var f;await((f=l.canRetrieve)==null?void 0:f.call(l,t))&&d.push(l.config.getViewRoute(t.id))},G=t=>({label:y("keys.actions.view"),to:l.config.getViewRoute(t)}),H=t=>({label:y("keys.actions.edit"),to:l.config.getEditRoute(t)}),K=e.ref(void 0),T=e.ref(!1),F=e.ref(!1),P=e.ref(""),X=s.useDeleteUrlBuilder(l.config,h.value),Y=t=>{K.value=t,T.value=!0},Z=()=>{T.value=!1},U=async()=>{var t,i,f;if((t=K.value)!=null&&t.id){F.value=!0;try{await w.delete(X(K.value.id)),F.value=!1,T.value=!1,x.value++,b("delete:success",K.value)}catch(p){P.value=((f=(i=p.response)==null?void 0:i.data)==null?void 0:f.message)||p.message||y("keys.errors.delete"),b("error",p)}finally{F.value=!1}}},O=e.ref(!1);e.watch(A,t=>{var i,f,p,u;if(Array.isArray((i=t==null?void 0:t.response)==null?void 0:i.data)&&(O.value=t.response.data.length>0),t.status===s.FetcherStatus.NoRecords?m.value=!0:m.value=!1,t.status===s.FetcherStatus.Error){c.value={title:y("keys.errors.general")},(u=(p=(f=t.error)==null?void 0:f.response)==null?void 0:p.data)!=null&&u.message&&(c.value.message=t.error.response.data.message),b("error",t.error);return}c.value=null});const J=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:y("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(J.value.title=y("keys.list.empty_state.title"),J.value.ctaText=y("keys.actions.create"))}),(t,i)=>{const f=e.resolveComponent("KButton"),p=e.resolveComponent("KCopy"),u=e.resolveComponent("KDropdownItem"),n=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(s.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":M.value,"empty-state-options":J.value,"enable-entity-actions":"","error-message":c.value,fetcher:e.unref(R),"fetcher-cache-key":x.value,"hide-toolbar":m.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:V.value,"table-headers":e.unref(o),onClearSearchInput:q,"onClick:row":i[1]||(i[1]=r=>L(r)),onSort:D},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(s.EntityFilter),{modelValue:V.value,"onUpdate:modelValue":i[0]||(i[0]=r=>V.value=r),config:j.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(f,{appearance:"primary","data-testid":"toolbar-add-key",size:a.useActionOutside?"medium":"large",to:a.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(oe.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(y)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["size","to"]),[[e.vShow,O.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:r})=>[e.createElementVNode("b",null,e.toDisplayString(r??"-"),1)]),kid:e.withCtx(({rowValue:r})=>[e.createVNode(p,{text:r},null,8,["text"])]),tags:e.withCtx(({rowValue:r})=>[e.createVNode(e.unref(s.TableTags),{tags:r},null,8,["tags"])]),id:e.withCtx(({rowValue:r})=>[e.createVNode(p,{text:r,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:r})=>[e.createVNode(n,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(u,{"data-testid":"action-entity-copy-id",onClick:he=>I(r,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(n,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(u,{"data-testid":"action-entity-copy-json",onClick:he=>g(r,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>a.canRetrieve(r)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-view","has-divider":"",item:G(r.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>a.canEdit(r)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-edit",item:H(r.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>a.canDelete(r)},{default:e.withCtx(()=>[e.createVNode(u,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Q=>Y(r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","query","table-headers"]),e.createVNode(e.unref(s.EntityDeleteModal),{"action-pending":F.value,description:e.unref(y)("keys.delete.description"),"entity-name":K.value&&(K.value.name||K.value.id),"entity-type":e.unref(s.EntityTypes).Key,error:P.value,"need-confirm":!1,title:e.unref(y)("keys.delete.title"),visible:T.value,onCancel:Z,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),te=(a,$)=>{const b=a.__vccOpts||a;for(const[l,y]of $)b[l]=y;return b},se=te(re,[["__scopeId","data-v-22a4f9c4"]]),ne={class:"kong-ui-entities-keys-form"},ce={"data-testid":"no-search-results"},de={class:"select-item-container"},fe={class:"select-item-label"},ye={class:"select-item-description"},pe={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},ke={"data-testid":"key-format-container"},me=te(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.cancelRoute)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(a,{emit:$}){var W;const b=$,l=a,y=v.useRouter(),{i18n:{t:d}}=z.useI18n(),{getMessageFromError:w}=s.useErrors(),{axiosInstance:x}=s.useAxios((W=l.config)==null?void 0:W.axiosRequestConfig),M=e.computed(()=>l.keySetId?B.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):B.form[l.config.app].edit.all),S=e.computed(()=>l.keyId?s.EntityBaseFormType.Edit:s.EntityBaseFormType.Create),o=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),h=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),V=[{label:d("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:d("keys.form.fields.key_format.options.pem"),value:"pem"}],j=e.computed(()=>o.isReadonly||S.value===s.EntityBaseFormType.Create&&!!l.fixedKeySetId),R=e.computed(()=>!j.value);e.watch(()=>l.fixedKeySetId,t=>{S.value===s.EntityBaseFormType.Create&&(o.fields.key_set=t)},{immediate:!0});const A=e.computed(()=>JSON.stringify(o.fields)!==JSON.stringify(h)&&!!o.fields.key_id&&!!o.fields.key_format&&(o.fields.key_format==="jwk"&&!!o.fields.jwk||o.fields.key_format==="pem"&&!!o.fields.private_key&&!!o.fields.public_key)),q=t=>{var i,f,p,u;o.fields.key_id=(t==null?void 0:t.kid)||"",o.fields.name=(t==null?void 0:t.name)||"",o.fields.tags=((i=t==null?void 0:t.tags)==null?void 0:i.join(", "))||"",o.fields.key_set=((f=t==null?void 0:t.set)==null?void 0:f.id)||"",o.fields.key_format=t!=null&&t.pem?"pem":"jwk",o.fields.jwk=(t==null?void 0:t.jwk)||"",o.fields.private_key=((p=t==null?void 0:t.pem)==null?void 0:p.private_key)||"",o.fields.public_key=((u=t==null?void 0:t.pem)==null?void 0:u.public_key)||"",Object.assign(h,o.fields)},D=()=>{y.push(l.config.cancelRoute)},c=e.computed(()=>{var i,f;let t=`${l.config.apiBaseUrl}${B.form[l.config.app][S.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?t=t.replace(/{controlPlaneId}/gi,((i=l.config)==null?void 0:i.controlPlaneId)||""):l.config.app==="kongManager"&&(t=t.replace(/\/{workspace}/gi,(f=l.config)!=null&&f.workspace?`/${l.config.workspace}`:"")),t=t.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),t}),m=e.computed(()=>{var t,i,f;return{kid:o.fields.key_id,name:o.fields.name||null,tags:((f=(i=(t=o.fields.tags)==null?void 0:t.split(","))==null?void 0:i.map(p=>String(p||"").trim()))==null?void 0:f.filter(p=>p!==""))||[],set:o.fields.key_set?{id:o.fields.key_set}:null,jwk:o.fields.key_format==="jwk"?o.fields.jwk:null,pem:o.fields.key_format==="pem"?{private_key:o.fields.private_key,public_key:o.fields.public_key}:null}}),I=async()=>{var t,i,f,p,u;try{o.isReadonly=!0;let n;if(S.value==="create"?n=await x.post(c.value,m.value):S.value==="edit"&&(n=((t=l.config)==null?void 0:t.app)==="konnect"?await x.put(c.value,m.value):await x.patch(c.value,m.value)),n){const{data:r}=n;o.fields.key_id=(r==null?void 0:r.kid)||"",o.fields.name=(r==null?void 0:r.name)||"",o.fields.tags=((i=r==null?void 0:r.tags)==null?void 0:i.join(", "))||"",o.fields.key_set=((f=r==null?void 0:r.set)==null?void 0:f.id)||"",o.fields.key_format=r!=null&&r.pem?"pem":"jwk",o.fields.jwk=(r==null?void 0:r.jwk)||"",o.fields.private_key=((p=r==null?void 0:r.pem)==null?void 0:p.private_key)||"",o.fields.public_key=((u=r==null?void 0:r.pem)==null?void 0:u.public_key)||"",Object.assign(h,o.fields),b("update",n==null?void 0:n.data)}}catch(n){o.errorMessage=w(n),b("error",n)}finally{o.isReadonly=!1}},{debouncedQueryChange:g,loading:C,allRecords:k,error:L,validationError:G,loadItems:H,results:K}=s.useDebouncedFilter(l.config,B.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),T=t=>{(!t||t!==o.fields.key_set&&t!==h.key_set)&&g(t)},F=e.computed(()=>L.value?d("keys.errors.key_sets.fetch"):""),P=e.computed(()=>G.value?d("keys.errors.key_sets.invalid"):""),X=e.ref(0),Y=e.computed(()=>k.value===void 0),Z=e.computed(()=>{if(Y.value)return l.config.app==="konnect"?d("keys.form.fields.key_set.footer"):void 0}),U=e.ref(new Set),O=e.computed(()=>Array.from(U.value).map(i=>({name:i.name||"",label:"",value:i.id,selected:o.fields.key_set===i.id}))),J=t=>{U.value.clear();let i;for(i of t)U.value.add(i)};return e.watch(K,t=>{J(t)},{immediate:!0,deep:!0}),e.watch(O,()=>{X.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await H()}),(t,i)=>{const f=e.resolveComponent("KInput"),p=e.resolveComponent("KSelect"),u=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(e.unref(s.EntityBaseForm),{"can-submit":A.value,config:a.config,"edit-id":a.keyId,"entity-type":e.unref(s.SupportedEntityType).Key,"error-message":o.errorMessage||F.value,"fetch-url":M.value,"form-fields":m.value,"is-readonly":o.isReadonly,onCancel:D,"onFetch:error":i[8]||(i[8]=n=>t.$emit("error",n)),"onFetch:success":q,onLoading:i[9]||(i[9]=n=>t.$emit("loading",n)),onSubmit:I},{default:e.withCtx(()=>[e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.general.description"),title:e.unref(d)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(f,{modelValue:o.fields.key_id,"onUpdate:modelValue":i[0]||(i[0]=n=>o.fields.key_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(d)("keys.form.fields.id.help"),label:e.unref(d)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.id.placeholder"),readonly:o.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(f,{modelValue:o.fields.name,"onUpdate:modelValue":i[1]||(i[1]=n=>o.fields.name=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(d)("keys.form.fields.name.label"),placeholder:e.unref(d)("keys.form.fields.name.placeholder"),readonly:o.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(p,{modelValue:o.fields.key_set,"onUpdate:modelValue":i[2]||(i[2]=n=>o.fields.key_set=n),clearable:R.value,"data-testid":"key-form-key-set","dropdown-footer-text":Z.value,"enable-filtering":"","filter-function":()=>!0,items:O.value,label:e.unref(d)("keys.form.fields.key_set.label"),loading:e.unref(C),placeholder:e.unref(d)("keys.form.fields.key_set.placeholder"),readonly:j.value,width:"100%",onQueryChange:T},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",ce,e.toDisplayString(e.unref(d)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:n})=>[e.createElementVNode("div",null,e.toDisplayString(n.name),1)]),"item-template":e.withCtx(({item:n})=>[e.createElementVNode("div",de,[e.createElementVNode("div",fe,e.toDisplayString(n.name),1),e.createElementVNode("div",ye,e.toDisplayString(n.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),P.value?(e.openBlock(),e.createElementBlock("p",pe,e.toDisplayString(P.value),1)):e.createCommentVNode("",!0),e.createVNode(f,{modelValue:o.fields.tags,"onUpdate:modelValue":i[3]||(i[3]=n=>o.fields.tags=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(d)("keys.form.fields.tags.help"),label:e.unref(d)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.tags.placeholder"),readonly:o.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(d)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.createVNode(p,{modelValue:o.fields.key_format,"onUpdate:modelValue":i[4]||(i[4]=n=>o.fields.key_format=n),"data-testid":"key-form-key-format",items:V,label:e.unref(d)("keys.form.fields.key_format.label"),readonly:o.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),o.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(u,{key:0,modelValue:o.fields.jwk,"onUpdate:modelValue":i[5]||(i[5]=n=>o.fields.jwk=n),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(d)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.jwk.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),o.fields.key_format==="pem"?(e.openBlock(),e.createBlock(u,{key:1,modelValue:o.fields.private_key,"onUpdate:modelValue":i[6]||(i[6]=n=>o.fields.private_key=n),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(d)("keys.form.fields.private_key.label"),placeholder:e.unref(d)("keys.form.fields.private_key.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),o.fields.key_format==="pem"?(e.openBlock(),e.createBlock(u,{key:2,modelValue:o.fields.public_key,"onUpdate:modelValue":i[7]||(i[7]=n=>o.fields.public_key=n),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(d)("keys.form.fields.public_key.label"),placeholder:e.unref(d)("keys.form.fields.public_key.placeholder"),readonly:o.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-9d0b1ebc"]]),ue={class:"kong-ui-entities-keys-entity-config-card"},ge={key:2},be=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(a,{emit:$}){var D;const b=$,l=a,{axiosInstance:y}=s.useAxios((D=l.config)==null?void 0:D.axiosRequestConfig),{convertKeyToTitle:d}=s.useStringHelpers(),{i18n:{t:w}}=z.useI18n(),x=e.computed(()=>l.keySetId?`${B.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):B.form[l.config.app].edit.all),M=e.computed(()=>{var c;return(c=B.form[l.config.app])==null?void 0:c.getKeySet}),S=e.ref(),o=e.ref({}),h=e.ref(l.keySetId||""),V=e.ref(""),j=e.ref(!1),R=async c=>{var m;S.value=c,h.value=(m=c==null?void 0:c.set)==null?void 0:m.id,b("fetch:success",c),A(c)};e.watch(h,async()=>{var m,I;if(!h.value)return;let c=`${l.config.apiBaseUrl}${M.value}`;l.config.app==="konnect"?c=c.replace(/{controlPlaneId}/gi,((m=l.config)==null?void 0:m.controlPlaneId)||"").replace(/{keySetId}/gi,h.value||""):l.config.app==="kongManager"&&(c=c.replace(/\/{workspace}/gi,(I=l.config)!=null&&I.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,h.value||""));try{j.value=!0;const{data:g}=await y.get(c,{validateStatus:C=>C===404||C>=200&&C<300});V.value=(g==null?void 0:g.name)||(g==null?void 0:g.id)}catch(g){b("fetch:error",g)}finally{j.value=!1}},{immediate:!0});const A=c=>{var m,I;try{if(c.jwk){const g=JSON.parse(c.jwk);Object.keys(g).forEach(C=>{o.value={...o.value,[`jwk.${C}`]:g[C]}})}else o.value={"pem.public_key":(m=c==null?void 0:c.pem)==null?void 0:m.public_key,"pem.private_key":(I=c==null?void 0:c.pem)==null?void 0:I.private_key}}catch(g){b("fetch:error",g)}return o},q=e.ref({id:{},name:{tooltip:w("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:w("keys.form.fields.set.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.set.tooltip"),order:5},kid:{label:w("keys.form.fields.kid.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.kid.tooltip")},tags:{tooltip:w("keys.form.fields.tags.tooltip")},jwk:{label:w("keys.form.fields.jwk.label"),type:s.ConfigurationSchemaType.Json},pem:{section:s.ConfigurationSchemaSection.Advanced,label:w("keys.form.fields.key_format.options.pem"),type:s.ConfigurationSchemaType.Json}});return(c,m)=>{var g,C;const I=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(e.unref(s.EntityBaseConfigCard),{config:a.config,"config-card-doc":a.configCardDoc,"config-schema":q.value,"entity-type":e.unref(s.SupportedEntityType).Key,"fetch-url":x.value,"hide-title":a.hideTitle,"onFetch:error":m[0]||(m[0]=k=>c.$emit("fetch:error",k)),"onFetch:success":R,onLoading:m[1]||(m[1]=k=>c.$emit("loading",k))},e.createSlots({set:e.withCtx(({row:k})=>[j.value?(e.openBlock(),e.createBlock(I,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):k.value&&k.value.id===h.value&&V.value?(e.openBlock(),e.createBlock(e.unref(s.InternalLinkItem),{key:1,item:{key:k.value.id,value:V.value,type:e.unref(s.ConfigurationSchemaType).LinkInternal},onClick:L=>c.$emit("navigation-click",k.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",ge,e.toDisplayString("–")))]),_:2},[(g=S.value)!=null&&g.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(o.value),k=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:o.value[k]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(C=S.value)!=null&&C.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(o.value),k=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:o.value[k]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}});_.KeyConfigCard=be,_.KeyForm=me,_.KeyList=se,Object.defineProperty(_,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-2fde1e51]{align-items:center;border-bottom:var(--445df5cd);display:var(--36146f00);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-2fde1e51]{width:var(--41377040)}.config-card-details-row .config-card-details-label label[data-v-2fde1e51]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-2fde1e51]{width:var(--4132e48a)}.config-card-details-row .config-card-details-value .truncated[data-v-2fde1e51]{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-2fde1e51]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-2fde1e51] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-2fde1e51]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-2fde1e51]{margin-right:4px}.config-card-details-row[data-v-2fde1e51] .k-label{margin-bottom:0}.config-card-details-row[data-v-2fde1e51] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-2fde1e51] .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-7ef5c755]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-7ef5c755]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-7ef5c755]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-7ef5c755] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-7ef5c755]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-6210a67a]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-6210a67a]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .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-765e475b]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-765e475b]{margin-left:auto}.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-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{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-10fa27a5]{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-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{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-keys-list[data-v-a99a46e1]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-a99a46e1]{margin-right:12px}.kong-ui-entities-keys-form[data-v-9d0b1ebc],.kong-ui-entities-keys-form .key-form-textarea[data-v-9d0b1ebc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-9d0b1ebc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-9d0b1ebc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-9d0b1ebc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-9d0b1ebc]{color:#6c7489;font-size:12px}
|
|
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-2fde1e51]{align-items:center;border-bottom:var(--445df5cd);display:var(--36146f00);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-2fde1e51]{width:var(--41377040)}.config-card-details-row .config-card-details-label label[data-v-2fde1e51]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-2fde1e51]{width:var(--4132e48a)}.config-card-details-row .config-card-details-value .truncated[data-v-2fde1e51]{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-2fde1e51]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-2fde1e51] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-2fde1e51]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-2fde1e51]{margin-right:4px}.config-card-details-row[data-v-2fde1e51] .k-label{margin-bottom:0}.config-card-details-row[data-v-2fde1e51] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-2fde1e51] .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-7ef5c755]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-7ef5c755]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-7ef5c755]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-7ef5c755] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-7ef5c755]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-6210a67a]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-6210a67a]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .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-6210a67a] .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-765e475b]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-765e475b]{margin-left:auto}.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-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{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-10fa27a5]{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-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{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-keys-list[data-v-22a4f9c4]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-22a4f9c4]{margin-right:12px}.kong-ui-entities-keys-form[data-v-9d0b1ebc],.kong-ui-entities-keys-form .key-form-textarea[data-v-9d0b1ebc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-9d0b1ebc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-9d0b1ebc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-9d0b1ebc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-9d0b1ebc]{color:#6c7489;font-size:12px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyList.vue"],"names":[],"mappings":"AAweA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAiBvC,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EACjB,MAAM,UAAU,CAAA;AASjB,OAAO,gDAAgD,CAAA;;IAkzBrD,oHAAoH;;cAElG,QAAQ,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;;4BAErD,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;;;;;IAY/E,yHAAyH;;cAErG,QAAQ,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI9D,2HAA2H;;cAEvG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,yHAAyH;;cAErG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,4IAA4I;;cAExH,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,iHAAiH;;;;;;;;;;;IAxCjH,oHAAoH;;cAElG,QAAQ,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;;4BAErD,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;;;;;IAY/E,yHAAyH;;cAErG,QAAQ,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI9D,2HAA2H;;cAEvG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,yHAAyH;;cAErG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,4IAA4I;;cAExH,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,iHAAiH;;;;;;;;;;;;qBAtB9E,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;qBAM1B,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;mBAMxC,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;uBAMxC,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;;;AAhD7E,wBA0DG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-keys",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-keys.umd.js",
|
|
6
6
|
"module": "./dist/entities-keys.es.js",
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@kong/icons": "^1.18.
|
|
25
|
-
"@kong/kongponents": "^9.14.
|
|
24
|
+
"@kong/icons": "^1.18.2",
|
|
25
|
+
"@kong/kongponents": "^9.14.8",
|
|
26
26
|
"axios": "^1.7.7",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.4.5",
|
|
29
|
-
"@kong-ui-public/entities-shared": "^3.10.
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.10.3",
|
|
30
30
|
"@kong-ui-public/i18n": "^2.2.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@kong/design-tokens": "1.17.2",
|
|
34
|
-
"@kong/icons": "^1.18.
|
|
35
|
-
"@kong/kongponents": "9.14.
|
|
34
|
+
"@kong/icons": "^1.18.2",
|
|
35
|
+
"@kong/kongponents": "9.14.8",
|
|
36
36
|
"axios": "^1.7.7",
|
|
37
37
|
"vue": "^3.5.12",
|
|
38
38
|
"vue-router": "^4.4.5",
|
|
39
|
-
"@kong-ui-public/
|
|
40
|
-
"@kong-ui-public/
|
|
39
|
+
"@kong-ui-public/entities-shared": "^3.10.3",
|
|
40
|
+
"@kong-ui-public/i18n": "^2.2.7"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|