@kong-ui-public/entities-gateway-services 2.4.27 → 2.4.28
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.
|
@@ -242,7 +242,7 @@ function Cr() {
|
|
|
242
242
|
return {
|
|
243
243
|
getAxiosInstance: (e = {}) => {
|
|
244
244
|
try {
|
|
245
|
-
const i = ai("get-axios-instance");
|
|
245
|
+
const i = ai("get-axios-instance", void 0);
|
|
246
246
|
return typeof i == "function" ? i(e) : Mt.create({
|
|
247
247
|
withCredentials: !0,
|
|
248
248
|
timeout: 3e4,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(oe,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(oe=typeof globalThis<"u"?globalThis:oe||self,t(oe["kong-ui-public-entities-gateway-services"]={},oe.Vue,oe.VueRouter,oe["kong-ui-public-i18n"],oe.axios,oe.Kongponents))})(this,function(oe,t,Oe,we,it,Ao){"use strict";const To={actions:{create:"New Gateway Service",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",clear:"Clear",view:"View Details",enable:{enabled_label:"Enabled",disabled_label:"Disabled"},delete:{title:"Delete a Gateway Service",description:"Deleting this Gateway Service will also remove any associated routes and plugins. This action cannot be reversed.",menu_label:"Delete"}},search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact name or ID"}},gateway_services:{title:"Gateway Services",list:{toolbar_actions:{new_gateway_service:"New Gateway Service"},table_headers:{name:"Name",protocol:"Protocol",host:"Host",port:"Port",path:"Path",enabled:"Enabled",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Gateway Service",description:"Gateway services are used to proxy traffic."}},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this Gateway Service."},keys:{title:"Service Endpoint",description:"Define the endpoint for this service by specifying the full URL or by its separate elements.",checkedGroupLabel:"Choose how and where to send traffic",urlLabel:"Full URL",checkedGroupAltLabel:"Protocol, Host, Port and Path",viewAdvancedFields:"View Advanced Fields"}},fields:{upstream_url:{label:"Upstream URL",placeholder:"Enter a URL",tooltip_for_konnect:"This is the URL of the API you will manage in Konnect.",tooltip_for_km:"This is the URL of the API you will manage in Kong Gateway."},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The Service name."},protocol:{label:"Protocol",tooltip:"The protocol used to communicate with the upstream.",options:{http:"http",https:"https",tcp:"tcp",tls:"tls",tls_passthrough:"tls_passthrough",grpc:"grpc",grpcs:"grpcs",ws:"ws",wss:"wss",udp:"udp"}},host:{label:"Host",placeholder:"Enter a host",tooltip:"The host of the upstream server. Note that the host value is case sensitive."},path:{label:"Path",placeholder:"Enter a path",tooltip:"The path to be used in request to the upstream server."},port:{label:"Port",tooltip:"The upstream server port."},retries:{label:"Retries",tooltip:"The number of retries to execute upon failure to proxy."},connect_timeout:{label:"Connection Timeout",tooltip:"The timeout in milliseconds for establishing a connection to the upstream server."},write_timeout:{label:"Write Timeout",tooltip:"The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."},read_timeout:{label:"Read Timeout",tooltip:"The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."},client_certificate:{label:"Client Certificate",placeholder:"Enter a Certificate ID",tooltip:"Certificate to be used as client certificate while TLS handshaking to the upstream server."},ca_certificates:{label:"CA Certificates",placeholder:"Enter a comma separated list of CA Certificate IDs",tooltip:"Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",code1:"CA Certificate",code2:"null"},tls_verify_enabled:{label:"TLS Verify",help:"If unchecked, use default system setting",tooltip:"Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",code1:"null"},tls_verify_option:{unset:{display:"Use default system setting"},true:{label:"True",display:"On"},false:{label:"False",display:"Off"}},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Service for grouping and filtering.",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"},enabled:{label:"Enabled",tooltip:"Whether the Service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.",false:"false",true:"true"}}}},errors:{general:"Gateway Services could not be retrieved",delete:"The gateway service could not be deleted at this time.",copy:"Failed to copy to clipboard",urlErrorMessage:"Error: invalid URL",validationNameError:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},glossary:{gateway_services:"gateway services"}};function jo(){const e=we.createI18n("en-us",To);return{i18n:e,i18nT:we.i18nTComponent(e)}}function Mo(){return{getPortFromProtocol:(r,o)=>{const i=[80,443],n=Number(o);if((n||n===0)&&!i.includes(n))return n;switch(r){case"grpcs":case"tls":case"https":case"wss":return 443;case"grpc":case"tcp":case"http":case"ws":default:return 80}}}}const Ie={useI18n:jo,usePortFromProtocol:Mo},ke={list:{konnect:{all:"/v2/control-planes/{controlPlaneId}/core-entities/services"},kongManager:{all:"/{workspace}/services"}},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/services",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/service/validate",edit:"/api/runtime_groups/{controlPlaneId}/services/{id}"},kongManager:{create:"/{workspace}/services",validate:"/{workspace}/schemas/services/validate",edit:"/{workspace}/services/{id}"}}};var at=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(at||{}),De=(e=>(e.Edit="edit",e.Create="create",e))(De||{}),de=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(de||{}),U=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(U||{}),Q=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(Q||{});function $o(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance");return typeof r=="function"?r(e):it.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),it.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Fo(){return{debounce:(e,r)=>{let o;return(...i)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{e(...i)},r)}}}}const Le="khcp-user-table-preferences",Oo={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Do(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},r=()=>{const o=e(localStorage.getItem(Le));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,i)=>{try{const n=r();n.set(o,i),localStorage.setItem(Le,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:o=>{const i=r();return(i==null?void 0:i.get(o))||void 0||Oo},deleteAllTablePreferences:()=>{localStorage.removeItem(Le)}}}function qe(e={}){const{getAxiosInstance:r}=$o();return{axiosInstance:r(e)}}const Lo={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},qo={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Uo={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Ko={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Po={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}",structuredFormat:"Structured"}},Ro={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},zo={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ho={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Go={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"}},Jo={global:Lo,deleteModal:qo,baseForm:Uo,baseTable:Ko,baseConfigCard:Po,filter:Ro,debouncedFilter:zo,errors:Ho,toggleModal:Go};function Ue(){const e=we.createI18n("en-us",Jo);return{i18n:e,i18nT:we.i18nTComponent(e)}}function lt(){const e=(o,i)=>(i==null?void 0:i[o])??void 0,r=(o,i)=>{if(o.length!==i.length)return!1;const n=new Set([...o,...i]);for(const l of n){const a=o.filter(s=>s===l).length,c=i.filter(s=>s===l).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(o,i,n)=>{if(n){if(Object.keys(o).length===Object.keys(i).length)for(const l in o)if(Array.isArray(o[l])&&Array.isArray(i[l])){if(r(o[l],i[l]))continue;return!1}else{if(o[l]===i[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(o)===JSON.stringify(i)}catch{return!1}},sortAlpha:o=>(i,n)=>{let l=i[o]===void 0||i[o]===null?"":i[o],a=n[o]===void 0||n[o]===null?"":n[o];return Array.isArray(i[o])&&(l=i[o][0]),Array.isArray(n[o])&&(a=n[o][0]),l.localeCompare(a)},isValidUuid:o=>o?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(o):!1}}function Yo(e,r,o,i={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="100");const{axiosInstance:n}=qe({headers:e.requestHeaders}),{i18n:{t:l}}=Ue(),{debounce:a}=Fo(),c=a(async k=>{await p(k)},200),s=t.ref(!1),u=t.ref(""),m=t.ref(""),f=t.ref([]),w=t.ref([]),y=t.ref(void 0),x=t.unref(r);let h=`${e.apiBaseUrl}${x}`;e.app==="konnect"?h=h.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(h=h.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=lt(),C=async()=>{try{s.value=!0;const{data:k}=await n.get(`${h}?size=${o}`);k!=null&&k.next||(y.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[]),w.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[],f.value=w.value}catch{f.value=[],u.value=l("debouncedFilter.errors.fetch")}finally{s.value=!1}},V=t.ref(""),p=async k=>{var v,E,z;if(V.value!==k)if(V.value=k||"",y.value===void 0)try{if(s.value=!0,u.value="",m.value="",e.app==="konnect"){let j=h+"";k&&(j+=`/${k}`);const{data:_}=await n.get(`${j}?size=${o}`);i.fetchedItemsKey in _?f.value=_[i.fetchedItemsKey]:_!=null&&_.id?f.value=[_]:f.value=[]}else if(k){const j=[];N(k)&&i.searchKeys.includes("id")?j.push((async()=>{const{data:A}=await n.get(`${h}/${k}`);return[A[i.fetchedItemsKey]??A]})()):j.push(...i.searchKeys.filter(A=>A!=="id").map(async A=>{const{data:T}=await n.get(`${h}?${A}=${k}`);return T[i.fetchedItemsKey]}));const _=await Promise.all(j),M=new Set;f.value=[],(v=_==null?void 0:_.forEach)==null||v.call(_,A=>{var T;(T=A==null?void 0:A.forEach)==null||T.call(A,$=>{M.has($.id)||(M.add($.id),f.value.push($))})})}else f.value=w.value}catch(j){((E=j==null?void 0:j.response)==null?void 0:E.status)===404?m.value=l("debouncedFilter.errors.invalid"):(f.value=[],u.value=l("debouncedFilter.errors.fetch"))}finally{s.value=!1}else s.value=!0,m.value="",k?(f.value=(z=y.value)==null?void 0:z.filter(j=>{var _;let M=!1;for(const A of i.searchKeys){const T=typeof j[A]=="string"?(_=j[A])==null?void 0:_.toLowerCase():j[A];T!=null&&T.includes(k.toLowerCase())&&(M=!0)}return M}),(!f.value||!f.value.length)&&(m.value=l("debouncedFilter.errors.invalid"))):f.value=y.value,s.value=!1};return{loading:s,error:u,validationError:m,results:f,allRecords:y,loadItems:C,debouncedQueryChange:c}}function Wo(e,r){const o=t.unref(r),i=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return i.value.search="",n=>`${i.value.href}/${n}`}function Zo(){const{i18n:{t:e}}=Ue();return{getMessageFromError:r=>{var o,i,n,l;if(!r)return e("errors.unexpected");if(((o=r==null?void 0:r.response)==null?void 0:o.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=r==null?void 0:r.response)!=null&&i.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(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(r.response.data.message){const{message:a}=r.response.data;return Array.isArray(a)?(l=a[0])!=null&&l.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(a=>`${a} ${r.response.data[a]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Qo(e){const r=window.location.origin,o=r.endsWith("/")?r:`${r}/`;try{const i=e.join("/"),n=`${o}${i}`,l=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!l&&new URL(n))return`${o}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function st(e,r){const o=t.ref(t.unref(e)),i=t.ref(t.unref(r)),n=t.computed(()=>!!(o.value.app==="konnect"||o.value.isExactMatch)),l=t.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:s,offset:u,sortColumnKey:m,sortColumnOrder:f,query:w}=a;try{let y=new URL(l.value.href);return n.value&&w?(y.search="",y=o.value.app==="konnect"?new URL(`${y.href}?filter[name][contains]=${w}`):new URL(`${y.href}/${w}/`)):(n.value||new URLSearchParams(w).forEach((x,h)=>{y.searchParams.append(h,x)}),m&&y.searchParams.append("sort_by",m),f==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(s))),u&&c!==1&&y.searchParams.append("offset",String(u)),y.href}catch(y){return console.error("RouteList(fetcher)",y),i.value}}}function Xo(e,r,o="data"){const i=t.unref(r),{axiosInstance:n}=qe({headers:e.requestHeaders}),l=st(e,i),a=t.ref({status:de.Idle});return{fetcher:async c=>{try{a.value={status:de.Loading};let s=l(c);s.includes("filter[name]")&&(s=`${s}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:u}=await n.get(s),m=o&&o.replace(/[^\w-_]/gi,"");let f;u[m]&&Array.isArray(u[m])?f=u[m]:Array.isArray(u)?f=u:f=Object.keys(u).length?[u]:[];const w={data:f,total:f.length,...u.offset?{pagination:{offset:u.offset}}:null};return a.value={status:de.Idle,response:w},w}catch(s){const u={data:[],total:0};return c.query&&s.response.status===404?(a.value={status:de.NoResults,response:u,error:s},u):(a.value={status:de.Error,response:u,error:s},u)}},fetcherState:a}}function er(){const e=(o,i="_")=>o?o.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:o=>o?o.replace(r,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const ct=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,dt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(ct);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},pt=e=>e==="*"||e==="x"||e==="X",ut=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},tr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],or=(e,r)=>{if(pt(e)||pt(r))return 0;const[o,i]=tr(ut(e),ut(r));return o>i?1:o<i?-1:0},ft=(e,r)=>{for(let o=0;o<Math.max(e.length,r.length);o++){const i=or(e[o]||"0",r[o]||"0");if(i!==0)return i}return 0},rr=(e,r)=>{const o=dt(e),i=dt(r),n=o.pop(),l=i.pop(),a=ft(o,i);return a!==0?a:n&&l?ft(n.split("."),l.split(".")):n||l?n?-1:1:0},mt=(e,r,o)=>{nr(o);const i=rr(e,r);return gt[o].includes(i)},gt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},yt=Object.keys(gt),nr=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(yt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${yt.join("|")}`)},ir=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ct.test(e);function ar(e){const{gatewayInfo:r,supportedRange:o}=e;if(!r)return!0;const{edition:i,version:n}=r;if(!ir(n))return console.error("Invalid version"),!1;const l=o[i];if(!l)return!1;const[a,c]=l;return!(a&&mt(n,a,"<")||c&&mt(n,c,">"))}function lr(e){const r=t.ref(0),o=t.ref(0),i=t.ref(!1);return t.watch(e,n=>{n&&!i.value&&(r.value=n.offsetWidth,o.value=n.scrollWidth,i.value=!0)}),{isTruncated:t.computed(()=>r.value<o.value)}}const G={useAxios:qe,useDebouncedFilter:Yo,useDeleteUrlBuilder:Wo,useErrors:Zo,useExternalLinkCreator:Qo,useFetcher:Xo,useFetchUrlBuilder:st,useHelpers:lt,useStringHelpers:er,useI18n:Ue,useGatewayFeatureSupported:ar,useTruncationDetector:lr},sr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},cr="Copy to clipboard",dr={message:sr,iconTitle:cr},pr="kong-ui-copy-uuid-notify",ht="24px",ur=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},fr=e=>(t.pushScopeId("data-v-13f41aa3"),e=e(),t.popScopeId(),e),mr=["aria-hidden"],gr={key:0,"data-testid":"kui-icon-svg-title"},yr=fr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),hr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ht,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),o=Number(r);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,o=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),l=Number(n);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return`${l}px`}return ht}),i=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:o.value,lineHeight:"0",width:o.value}));return(n,l)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(i.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",gr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),yr],8,mr))]),_:1},8,["aria-hidden","style"]))}}),br=ur(hr,[["__scopeId","data-v-13f41aa3"]]),wr="16px",kr={class:"kong-ui-copy-uuid"},Cr=["onClick"],bt=15,_r=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:o}=we.createI18n("en-us",dr),i=e,n=r,l=i.notify||t.inject(pr,()=>{}),a=t.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=t.computed(()=>!!(i.tooltip&&i.successTooltip)),s=t.ref(i.tooltip),u=t.computed(()=>i.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),m=t.computed(()=>{var y;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(y=i.uuid)==null?void 0:y.substring(0,5)}`:i.uuid}),f=y=>{s.value=y,setTimeout(()=>{s.value=i.tooltip},1800)},w=y=>{var x,h;if(!y(i.uuid)){typeof l=="function"&&l({type:"error",message:o("message.fail")}),c.value?f(o("message.fail")):n("error",i.uuid);return}const N=((x=i.uuid)==null?void 0:x.length)>bt,C=i.format==="hidden"||i.format==="redacted"?o("message.success.prefix"):`"${((h=i.uuid)==null?void 0:h.substring(0,bt))+(N?"...":"")}"`;typeof l=="function"&&l({type:"success",message:`${C}${o("message.success.content")}`}),c.value?f(i.successTooltip):n("success",i.uuid)};return(y,x)=>{const h=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",kr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(m.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(u.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(h,null,{default:t.withCtx(({copyToClipboard:N})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(C=>w(N),["stop"])},[t.createVNode(t.unref(br),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(wr),title:t.unref(o)("iconTitle")},null,8,["color","decorative","size","title"])],8,Cr)]),_:1})]),_:1},16))])}}}),Sr=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},wt=Sr(_r,[["__scopeId","data-v-0c07874b"]]),xr={key:0,class:"config-card-fieldset-title"},Vr=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:o}}=G.useI18n(),{convertKeyToTitle:i}=G.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),l=t.computed(()=>r.item.value??r.item),a=t.computed(()=>{const s=JSON.parse(JSON.stringify(l.value));return r.isArrayItem&&delete s.name,s}),c=t.computed(()=>{var s;return r.isArrayItem?(s=l.value)!=null&&s.name?i(l.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:r.index}):""});return(s,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",xr,[t.createElementVNode("b",null,t.toDisplayString(c.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(a.value),(m,f)=>(t.openBlock(),t.createBlock(Ke,{key:`${n.value}-property-${f}`,item:{key:m,label:t.unref(i)(m),value:a.value[m]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),re=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},kt=re(Vr,[["__scopeId","data-v-68ca83ec"]]),Nr=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=G.useI18n();return(o,i)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=l=>o.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Br=re(Nr,[["__scopeId","data-v-c96811e5"]]),vr=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=G.useI18n();return(o,i)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ir="#0044f4",Er="#e0e4ea",Ar="#3a3f51",Tr="1px",jr="20px",Mr={class:"config-card-details-row"},$r=["data-testid"],Fr=["data-testid"],Or=["data-testid"],Dr=["data-testid"],Lr={key:1},qr=["data-testid"],Ur=["data-testid"],Kr=["data-testid"],Pr=["data-testid"],Rr={name:"ConfigCardItem",components:{CopyUuid:wt,JsonCardItem:kt,StatusBadge:vr,InternalLinkItem:Br}},zr=t.defineComponent({...Rr,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(x=>({"5ae2770e":m.value?"none":`solid ${t.unref(Tr)} ${t.unref(Er)}`,"4db3977e":u.value&&c.value?"block":"flex","1a7c5e02":u.value&&c.value?"100%":o.slim?"50%":"25%","1a77d24c":u.value&&c.value?"100%":o.slim?"50%":"75%"}));const o=e,i=r,n=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:a}}=G.useI18n(),c=t.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),s=t.computed(()=>!!(o.item.tooltip||n["label-tooltip"])),u=t.computed(()=>o.item.type===U.Json||o.item.type===U.JsonArray),m=t.computed(()=>o.item.type===U.JsonArray),f=t.computed(()=>{switch(o.item.type){case U.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case U.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case U.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case U.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case U.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:a(o.item.value)};case U.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case U.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case U.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case U.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:x=>{i("navigation-click",x)}}};case U.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case U.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case U.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),w=t.ref(),{isTruncated:y}=G.useTruncationDetector(w);return(x,h)=>{const N=t.resolveComponent("KLabel"),C=t.resolveComponent("KBadge"),V=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Mr,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(x.$slots,"label",{item:e.item},()=>[t.createVNode(N,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(x.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Fr)]),key:"0"}:void 0]),1024)],!0)],8,$r),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(x.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(t.openBlock(),t.createElementBlock("div",Lr,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.value.tag),t.normalizeProps(t.guardReactiveProps(f.value.attrs)),{default:t.withCtx(()=>[f.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(C,{key:`${e.item.key}-badge-tag-${k}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${k}`,tooltip:p,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,qr)):t.createCommentVNode("",!0),f.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(t.unref(wt),t.mergeProps(f.value.childAttrs,{key:`${e.item.key}-copy-uuid-${k}`,"data-testid":`${e.item.key}-copy-uuid-${k}`,uuid:p}),null,16,["data-testid","uuid"]))),128))],8,Ur)):f.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(C,{key:`${e.item.key}-badge-method-${k}`,appearance:Object.values(t.unref(Ao.BadgeMethodAppearances)).includes(p.toLowerCase())?p.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${k}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Kr)):t.createCommentVNode("",!0),f.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(kt,{key:`json-array-item-${k}`,index:k,"is-array-item":"",item:p},null,8,["index","item"]))),128))],8,Pr)):(t.openBlock(),t.createBlock(V,{key:4,text:t.unref(y)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:w,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(f.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Dr))],!0)],8,Or)])}}}),Ke=re(zr,[["__scopeId","data-v-f65fc52c"]]),Hr={class:"json-config"},Gr={key:0,class:"json-endpoint"},Ct=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"2d178975":`${i.value}ch`}));const r=e,o=t.computed(()=>r.jsonRecord),i=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const l=(n=r.fetcherUrl)==null?void 0:n.split("/");return l.length<2?0:41+(r.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(n,l)=>{var a;const c=t.resolveComponent("KBadge"),s=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Hr,[r.fetcherUrl&&(a=r.config)!=null&&a.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",Gr,[t.createVNode(c,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(s,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(s,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(o.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function _t(e){return typeof e>"u"||e===null}function Jr(e){return typeof e=="object"&&e!==null}function Yr(e){return Array.isArray(e)?e:_t(e)?[]:[e]}function Wr(e,r){var o,i,n,l;if(r)for(l=Object.keys(r),o=0,i=l.length;o<i;o+=1)n=l[o],e[n]=r[n];return e}function Zr(e,r){var o="",i;for(i=0;i<r;i+=1)o+=e;return o}function Qr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xr=_t,en=Jr,tn=Yr,on=Zr,rn=Qr,nn=Wr,J={isNothing:Xr,isObject:en,toArray:tn,repeat:on,isNegativeZero:rn,extend:nn};function St(e,r){var o="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(o+='in "'+e.mark.name+'" '),o+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(o+=`
|
|
1
|
+
(function(oe,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(oe=typeof globalThis<"u"?globalThis:oe||self,t(oe["kong-ui-public-entities-gateway-services"]={},oe.Vue,oe.VueRouter,oe["kong-ui-public-i18n"],oe.axios,oe.Kongponents))})(this,function(oe,t,Oe,we,it,Ao){"use strict";const To={actions:{create:"New Gateway Service",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",clear:"Clear",view:"View Details",enable:{enabled_label:"Enabled",disabled_label:"Disabled"},delete:{title:"Delete a Gateway Service",description:"Deleting this Gateway Service will also remove any associated routes and plugins. This action cannot be reversed.",menu_label:"Delete"}},search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact name or ID"}},gateway_services:{title:"Gateway Services",list:{toolbar_actions:{new_gateway_service:"New Gateway Service"},table_headers:{name:"Name",protocol:"Protocol",host:"Host",port:"Port",path:"Path",enabled:"Enabled",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Gateway Service",description:"Gateway services are used to proxy traffic."}},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this Gateway Service."},keys:{title:"Service Endpoint",description:"Define the endpoint for this service by specifying the full URL or by its separate elements.",checkedGroupLabel:"Choose how and where to send traffic",urlLabel:"Full URL",checkedGroupAltLabel:"Protocol, Host, Port and Path",viewAdvancedFields:"View Advanced Fields"}},fields:{upstream_url:{label:"Upstream URL",placeholder:"Enter a URL",tooltip_for_konnect:"This is the URL of the API you will manage in Konnect.",tooltip_for_km:"This is the URL of the API you will manage in Kong Gateway."},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The Service name."},protocol:{label:"Protocol",tooltip:"The protocol used to communicate with the upstream.",options:{http:"http",https:"https",tcp:"tcp",tls:"tls",tls_passthrough:"tls_passthrough",grpc:"grpc",grpcs:"grpcs",ws:"ws",wss:"wss",udp:"udp"}},host:{label:"Host",placeholder:"Enter a host",tooltip:"The host of the upstream server. Note that the host value is case sensitive."},path:{label:"Path",placeholder:"Enter a path",tooltip:"The path to be used in request to the upstream server."},port:{label:"Port",tooltip:"The upstream server port."},retries:{label:"Retries",tooltip:"The number of retries to execute upon failure to proxy."},connect_timeout:{label:"Connection Timeout",tooltip:"The timeout in milliseconds for establishing a connection to the upstream server."},write_timeout:{label:"Write Timeout",tooltip:"The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."},read_timeout:{label:"Read Timeout",tooltip:"The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."},client_certificate:{label:"Client Certificate",placeholder:"Enter a Certificate ID",tooltip:"Certificate to be used as client certificate while TLS handshaking to the upstream server."},ca_certificates:{label:"CA Certificates",placeholder:"Enter a comma separated list of CA Certificate IDs",tooltip:"Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",code1:"CA Certificate",code2:"null"},tls_verify_enabled:{label:"TLS Verify",help:"If unchecked, use default system setting",tooltip:"Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",code1:"null"},tls_verify_option:{unset:{display:"Use default system setting"},true:{label:"True",display:"On"},false:{label:"False",display:"Off"}},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Service for grouping and filtering.",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"},enabled:{label:"Enabled",tooltip:"Whether the Service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.",false:"false",true:"true"}}}},errors:{general:"Gateway Services could not be retrieved",delete:"The gateway service could not be deleted at this time.",copy:"Failed to copy to clipboard",urlErrorMessage:"Error: invalid URL",validationNameError:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},glossary:{gateway_services:"gateway services"}};function jo(){const e=we.createI18n("en-us",To);return{i18n:e,i18nT:we.i18nTComponent(e)}}function Mo(){return{getPortFromProtocol:(r,o)=>{const i=[80,443],n=Number(o);if((n||n===0)&&!i.includes(n))return n;switch(r){case"grpcs":case"tls":case"https":case"wss":return 443;case"grpc":case"tcp":case"http":case"ws":default:return 80}}}}const Ie={useI18n:jo,usePortFromProtocol:Mo},ke={list:{konnect:{all:"/v2/control-planes/{controlPlaneId}/core-entities/services"},kongManager:{all:"/{workspace}/services"}},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/services",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/service/validate",edit:"/api/runtime_groups/{controlPlaneId}/services/{id}"},kongManager:{create:"/{workspace}/services",validate:"/{workspace}/schemas/services/validate",edit:"/{workspace}/services/{id}"}}};var at=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(at||{}),De=(e=>(e.Edit="edit",e.Create="create",e))(De||{}),de=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(de||{}),U=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(U||{}),Q=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(Q||{});function $o(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):it.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),it.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Fo(){return{debounce:(e,r)=>{let o;return(...i)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{e(...i)},r)}}}}const Le="khcp-user-table-preferences",Oo={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Do(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},r=()=>{const o=e(localStorage.getItem(Le));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,i)=>{try{const n=r();n.set(o,i),localStorage.setItem(Le,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:o=>{const i=r();return(i==null?void 0:i.get(o))||void 0||Oo},deleteAllTablePreferences:()=>{localStorage.removeItem(Le)}}}function qe(e={}){const{getAxiosInstance:r}=$o();return{axiosInstance:r(e)}}const Lo={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},qo={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Uo={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Ko={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Po={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}",structuredFormat:"Structured"}},Ro={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},zo={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ho={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Go={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"}},Jo={global:Lo,deleteModal:qo,baseForm:Uo,baseTable:Ko,baseConfigCard:Po,filter:Ro,debouncedFilter:zo,errors:Ho,toggleModal:Go};function Ue(){const e=we.createI18n("en-us",Jo);return{i18n:e,i18nT:we.i18nTComponent(e)}}function lt(){const e=(o,i)=>(i==null?void 0:i[o])??void 0,r=(o,i)=>{if(o.length!==i.length)return!1;const n=new Set([...o,...i]);for(const l of n){const a=o.filter(s=>s===l).length,c=i.filter(s=>s===l).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(o,i,n)=>{if(n){if(Object.keys(o).length===Object.keys(i).length)for(const l in o)if(Array.isArray(o[l])&&Array.isArray(i[l])){if(r(o[l],i[l]))continue;return!1}else{if(o[l]===i[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(o)===JSON.stringify(i)}catch{return!1}},sortAlpha:o=>(i,n)=>{let l=i[o]===void 0||i[o]===null?"":i[o],a=n[o]===void 0||n[o]===null?"":n[o];return Array.isArray(i[o])&&(l=i[o][0]),Array.isArray(n[o])&&(a=n[o][0]),l.localeCompare(a)},isValidUuid:o=>o?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(o):!1}}function Yo(e,r,o,i={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="100");const{axiosInstance:n}=qe({headers:e.requestHeaders}),{i18n:{t:l}}=Ue(),{debounce:a}=Fo(),c=a(async k=>{await p(k)},200),s=t.ref(!1),u=t.ref(""),m=t.ref(""),f=t.ref([]),w=t.ref([]),y=t.ref(void 0),x=t.unref(r);let h=`${e.apiBaseUrl}${x}`;e.app==="konnect"?h=h.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(h=h.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=lt(),C=async()=>{try{s.value=!0;const{data:k}=await n.get(`${h}?size=${o}`);k!=null&&k.next||(y.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[]),w.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[],f.value=w.value}catch{f.value=[],u.value=l("debouncedFilter.errors.fetch")}finally{s.value=!1}},V=t.ref(""),p=async k=>{var v,E,z;if(V.value!==k)if(V.value=k||"",y.value===void 0)try{if(s.value=!0,u.value="",m.value="",e.app==="konnect"){let j=h+"";k&&(j+=`/${k}`);const{data:_}=await n.get(`${j}?size=${o}`);i.fetchedItemsKey in _?f.value=_[i.fetchedItemsKey]:_!=null&&_.id?f.value=[_]:f.value=[]}else if(k){const j=[];N(k)&&i.searchKeys.includes("id")?j.push((async()=>{const{data:A}=await n.get(`${h}/${k}`);return[A[i.fetchedItemsKey]??A]})()):j.push(...i.searchKeys.filter(A=>A!=="id").map(async A=>{const{data:T}=await n.get(`${h}?${A}=${k}`);return T[i.fetchedItemsKey]}));const _=await Promise.all(j),M=new Set;f.value=[],(v=_==null?void 0:_.forEach)==null||v.call(_,A=>{var T;(T=A==null?void 0:A.forEach)==null||T.call(A,$=>{M.has($.id)||(M.add($.id),f.value.push($))})})}else f.value=w.value}catch(j){((E=j==null?void 0:j.response)==null?void 0:E.status)===404?m.value=l("debouncedFilter.errors.invalid"):(f.value=[],u.value=l("debouncedFilter.errors.fetch"))}finally{s.value=!1}else s.value=!0,m.value="",k?(f.value=(z=y.value)==null?void 0:z.filter(j=>{var _;let M=!1;for(const A of i.searchKeys){const T=typeof j[A]=="string"?(_=j[A])==null?void 0:_.toLowerCase():j[A];T!=null&&T.includes(k.toLowerCase())&&(M=!0)}return M}),(!f.value||!f.value.length)&&(m.value=l("debouncedFilter.errors.invalid"))):f.value=y.value,s.value=!1};return{loading:s,error:u,validationError:m,results:f,allRecords:y,loadItems:C,debouncedQueryChange:c}}function Wo(e,r){const o=t.unref(r),i=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return i.value.search="",n=>`${i.value.href}/${n}`}function Zo(){const{i18n:{t:e}}=Ue();return{getMessageFromError:r=>{var o,i,n,l;if(!r)return e("errors.unexpected");if(((o=r==null?void 0:r.response)==null?void 0:o.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=r==null?void 0:r.response)!=null&&i.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(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(r.response.data.message){const{message:a}=r.response.data;return Array.isArray(a)?(l=a[0])!=null&&l.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(a=>`${a} ${r.response.data[a]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Qo(e){const r=window.location.origin,o=r.endsWith("/")?r:`${r}/`;try{const i=e.join("/"),n=`${o}${i}`,l=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!l&&new URL(n))return`${o}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function st(e,r){const o=t.ref(t.unref(e)),i=t.ref(t.unref(r)),n=t.computed(()=>!!(o.value.app==="konnect"||o.value.isExactMatch)),l=t.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:s,offset:u,sortColumnKey:m,sortColumnOrder:f,query:w}=a;try{let y=new URL(l.value.href);return n.value&&w?(y.search="",y=o.value.app==="konnect"?new URL(`${y.href}?filter[name][contains]=${w}`):new URL(`${y.href}/${w}/`)):(n.value||new URLSearchParams(w).forEach((x,h)=>{y.searchParams.append(h,x)}),m&&y.searchParams.append("sort_by",m),f==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(s))),u&&c!==1&&y.searchParams.append("offset",String(u)),y.href}catch(y){return console.error("RouteList(fetcher)",y),i.value}}}function Xo(e,r,o="data"){const i=t.unref(r),{axiosInstance:n}=qe({headers:e.requestHeaders}),l=st(e,i),a=t.ref({status:de.Idle});return{fetcher:async c=>{try{a.value={status:de.Loading};let s=l(c);s.includes("filter[name]")&&(s=`${s}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:u}=await n.get(s),m=o&&o.replace(/[^\w-_]/gi,"");let f;u[m]&&Array.isArray(u[m])?f=u[m]:Array.isArray(u)?f=u:f=Object.keys(u).length?[u]:[];const w={data:f,total:f.length,...u.offset?{pagination:{offset:u.offset}}:null};return a.value={status:de.Idle,response:w},w}catch(s){const u={data:[],total:0};return c.query&&s.response.status===404?(a.value={status:de.NoResults,response:u,error:s},u):(a.value={status:de.Error,response:u,error:s},u)}},fetcherState:a}}function er(){const e=(o,i="_")=>o?o.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:o=>o?o.replace(r,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const ct=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,dt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(ct);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},pt=e=>e==="*"||e==="x"||e==="X",ut=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},tr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],or=(e,r)=>{if(pt(e)||pt(r))return 0;const[o,i]=tr(ut(e),ut(r));return o>i?1:o<i?-1:0},ft=(e,r)=>{for(let o=0;o<Math.max(e.length,r.length);o++){const i=or(e[o]||"0",r[o]||"0");if(i!==0)return i}return 0},rr=(e,r)=>{const o=dt(e),i=dt(r),n=o.pop(),l=i.pop(),a=ft(o,i);return a!==0?a:n&&l?ft(n.split("."),l.split(".")):n||l?n?-1:1:0},mt=(e,r,o)=>{nr(o);const i=rr(e,r);return gt[o].includes(i)},gt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},yt=Object.keys(gt),nr=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(yt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${yt.join("|")}`)},ir=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ct.test(e);function ar(e){const{gatewayInfo:r,supportedRange:o}=e;if(!r)return!0;const{edition:i,version:n}=r;if(!ir(n))return console.error("Invalid version"),!1;const l=o[i];if(!l)return!1;const[a,c]=l;return!(a&&mt(n,a,"<")||c&&mt(n,c,">"))}function lr(e){const r=t.ref(0),o=t.ref(0),i=t.ref(!1);return t.watch(e,n=>{n&&!i.value&&(r.value=n.offsetWidth,o.value=n.scrollWidth,i.value=!0)}),{isTruncated:t.computed(()=>r.value<o.value)}}const G={useAxios:qe,useDebouncedFilter:Yo,useDeleteUrlBuilder:Wo,useErrors:Zo,useExternalLinkCreator:Qo,useFetcher:Xo,useFetchUrlBuilder:st,useHelpers:lt,useStringHelpers:er,useI18n:Ue,useGatewayFeatureSupported:ar,useTruncationDetector:lr},sr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},cr="Copy to clipboard",dr={message:sr,iconTitle:cr},pr="kong-ui-copy-uuid-notify",ht="24px",ur=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},fr=e=>(t.pushScopeId("data-v-13f41aa3"),e=e(),t.popScopeId(),e),mr=["aria-hidden"],gr={key:0,"data-testid":"kui-icon-svg-title"},yr=fr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),hr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ht,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),o=Number(r);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,o=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),l=Number(n);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return`${l}px`}return ht}),i=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:o.value,lineHeight:"0",width:o.value}));return(n,l)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(i.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",gr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),yr],8,mr))]),_:1},8,["aria-hidden","style"]))}}),br=ur(hr,[["__scopeId","data-v-13f41aa3"]]),wr="16px",kr={class:"kong-ui-copy-uuid"},Cr=["onClick"],bt=15,_r=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:o}=we.createI18n("en-us",dr),i=e,n=r,l=i.notify||t.inject(pr,()=>{}),a=t.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=t.computed(()=>!!(i.tooltip&&i.successTooltip)),s=t.ref(i.tooltip),u=t.computed(()=>i.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),m=t.computed(()=>{var y;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(y=i.uuid)==null?void 0:y.substring(0,5)}`:i.uuid}),f=y=>{s.value=y,setTimeout(()=>{s.value=i.tooltip},1800)},w=y=>{var x,h;if(!y(i.uuid)){typeof l=="function"&&l({type:"error",message:o("message.fail")}),c.value?f(o("message.fail")):n("error",i.uuid);return}const N=((x=i.uuid)==null?void 0:x.length)>bt,C=i.format==="hidden"||i.format==="redacted"?o("message.success.prefix"):`"${((h=i.uuid)==null?void 0:h.substring(0,bt))+(N?"...":"")}"`;typeof l=="function"&&l({type:"success",message:`${C}${o("message.success.content")}`}),c.value?f(i.successTooltip):n("success",i.uuid)};return(y,x)=>{const h=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",kr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(m.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(u.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(h,null,{default:t.withCtx(({copyToClipboard:N})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(C=>w(N),["stop"])},[t.createVNode(t.unref(br),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(wr),title:t.unref(o)("iconTitle")},null,8,["color","decorative","size","title"])],8,Cr)]),_:1})]),_:1},16))])}}}),Sr=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},wt=Sr(_r,[["__scopeId","data-v-0c07874b"]]),xr={key:0,class:"config-card-fieldset-title"},Vr=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:o}}=G.useI18n(),{convertKeyToTitle:i}=G.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),l=t.computed(()=>r.item.value??r.item),a=t.computed(()=>{const s=JSON.parse(JSON.stringify(l.value));return r.isArrayItem&&delete s.name,s}),c=t.computed(()=>{var s;return r.isArrayItem?(s=l.value)!=null&&s.name?i(l.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:r.index}):""});return(s,u)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",xr,[t.createElementVNode("b",null,t.toDisplayString(c.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(a.value),(m,f)=>(t.openBlock(),t.createBlock(Ke,{key:`${n.value}-property-${f}`,item:{key:m,label:t.unref(i)(m),value:a.value[m]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),re=(e,r)=>{const o=e.__vccOpts||e;for(const[i,n]of r)o[i]=n;return o},kt=re(Vr,[["__scopeId","data-v-68ca83ec"]]),Nr=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=G.useI18n();return(o,i)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=l=>o.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Br=re(Nr,[["__scopeId","data-v-c96811e5"]]),vr=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=G.useI18n();return(o,i)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ir="#0044f4",Er="#e0e4ea",Ar="#3a3f51",Tr="1px",jr="20px",Mr={class:"config-card-details-row"},$r=["data-testid"],Fr=["data-testid"],Or=["data-testid"],Dr=["data-testid"],Lr={key:1},qr=["data-testid"],Ur=["data-testid"],Kr=["data-testid"],Pr=["data-testid"],Rr={name:"ConfigCardItem",components:{CopyUuid:wt,JsonCardItem:kt,StatusBadge:vr,InternalLinkItem:Br}},zr=t.defineComponent({...Rr,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(x=>({"5ae2770e":m.value?"none":`solid ${t.unref(Tr)} ${t.unref(Er)}`,"4db3977e":u.value&&c.value?"block":"flex","1a7c5e02":u.value&&c.value?"100%":o.slim?"50%":"25%","1a77d24c":u.value&&c.value?"100%":o.slim?"50%":"75%"}));const o=e,i=r,n=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:a}}=G.useI18n(),c=t.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),s=t.computed(()=>!!(o.item.tooltip||n["label-tooltip"])),u=t.computed(()=>o.item.type===U.Json||o.item.type===U.JsonArray),m=t.computed(()=>o.item.type===U.JsonArray),f=t.computed(()=>{switch(o.item.type){case U.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case U.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case U.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case U.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case U.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:a(o.item.value)};case U.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case U.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case U.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case U.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:x=>{i("navigation-click",x)}}};case U.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case U.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case U.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),w=t.ref(),{isTruncated:y}=G.useTruncationDetector(w);return(x,h)=>{const N=t.resolveComponent("KLabel"),C=t.resolveComponent("KBadge"),V=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Mr,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(x.$slots,"label",{item:e.item},()=>[t.createVNode(N,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(x.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Fr)]),key:"0"}:void 0]),1024)],!0)],8,$r),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(x.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(t.openBlock(),t.createElementBlock("div",Lr,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.value.tag),t.normalizeProps(t.guardReactiveProps(f.value.attrs)),{default:t.withCtx(()=>[f.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(C,{key:`${e.item.key}-badge-tag-${k}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${k}`,tooltip:p,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,qr)):t.createCommentVNode("",!0),f.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(t.unref(wt),t.mergeProps(f.value.childAttrs,{key:`${e.item.key}-copy-uuid-${k}`,"data-testid":`${e.item.key}-copy-uuid-${k}`,uuid:p}),null,16,["data-testid","uuid"]))),128))],8,Ur)):f.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(C,{key:`${e.item.key}-badge-method-${k}`,appearance:Object.values(t.unref(Ao.BadgeMethodAppearances)).includes(p.toLowerCase())?p.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${k}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Kr)):t.createCommentVNode("",!0),f.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(p,k)=>(t.openBlock(),t.createBlock(kt,{key:`json-array-item-${k}`,index:k,"is-array-item":"",item:p},null,8,["index","item"]))),128))],8,Pr)):(t.openBlock(),t.createBlock(V,{key:4,text:t.unref(y)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:w,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(f.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Dr))],!0)],8,Or)])}}}),Ke=re(zr,[["__scopeId","data-v-f65fc52c"]]),Hr={class:"json-config"},Gr={key:0,class:"json-endpoint"},Ct=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"2d178975":`${i.value}ch`}));const r=e,o=t.computed(()=>r.jsonRecord),i=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const l=(n=r.fetcherUrl)==null?void 0:n.split("/");return l.length<2?0:41+(r.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(n,l)=>{var a;const c=t.resolveComponent("KBadge"),s=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Hr,[r.fetcherUrl&&(a=r.config)!=null&&a.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",Gr,[t.createVNode(c,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(s,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(s,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(o.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function _t(e){return typeof e>"u"||e===null}function Jr(e){return typeof e=="object"&&e!==null}function Yr(e){return Array.isArray(e)?e:_t(e)?[]:[e]}function Wr(e,r){var o,i,n,l;if(r)for(l=Object.keys(r),o=0,i=l.length;o<i;o+=1)n=l[o],e[n]=r[n];return e}function Zr(e,r){var o="",i;for(i=0;i<r;i+=1)o+=e;return o}function Qr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xr=_t,en=Jr,tn=Yr,on=Zr,rn=Qr,nn=Wr,J={isNothing:Xr,isObject:en,toArray:tn,repeat:on,isNegativeZero:rn,extend:nn};function St(e,r){var o="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(o+='in "'+e.mark.name+'" '),o+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(o+=`
|
|
2
2
|
|
|
3
3
|
`+e.mark.snippet),i+" "+o):i}function Ce(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=St(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ce.prototype=Object.create(Error.prototype),Ce.prototype.constructor=Ce,Ce.prototype.toString=function(e){return this.name+": "+St(this,e)};var ee=Ce;function Pe(e,r,o,i,n){var l="",a="",c=Math.floor(n/2)-1;return i-r>c&&(l=" ... ",r=i-c+l.length),o-i>c&&(a=" ...",o=i+c-a.length),{str:l+e.slice(r,o).replace(/\t/g,"→")+a,pos:i-r+l.length}}function Re(e,r){return J.repeat(" ",r-e.length)+e}function an(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var o=/\r?\n|\r|\0/g,i=[0],n=[],l,a=-1;l=o.exec(e.buffer);)n.push(l.index),i.push(l.index+l[0].length),e.position<=l.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",s,u,m=Math.min(e.line+r.linesAfter,n.length).toString().length,f=r.maxLength-(r.indent+m+3);for(s=1;s<=r.linesBefore&&!(a-s<0);s++)u=Pe(e.buffer,i[a-s],n[a-s],e.position-(i[a]-i[a-s]),f),c=J.repeat(" ",r.indent)+Re((e.line-s+1).toString(),m)+" | "+u.str+`
|
|
4
4
|
`+c;for(u=Pe(e.buffer,i[a],n[a],e.position,f),c+=J.repeat(" ",r.indent)+Re((e.line+1).toString(),m)+" | "+u.str+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-gateway-services",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-gateway-services.umd.js",
|
|
6
6
|
"module": "./dist/entities-gateway-services.es.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"errorLimit": "600KB"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kong-ui-public/entities-shared": "^2.7.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^2.7.5"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|