@kong-ui-public/entities-snis 1.1.31 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/entities-snis.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-entities-snis"]={},$.Vue,$["kong-ui-public-i18n"],$.axios,$.Kongponents,$.VueRouter))})(this,function($,e,Z,Me,Nn,de){"use strict";const Fe={actions:{create:"New SNI",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},snis:{title:"SNIs",list:{toolbar_actions:{new:"New SNI"},table_headers:{name:"Name",id:"ID",certificate_id:"SSL Certificate ID",tags:"Tags"},empty_state:{title:"Configure a New SNI",description:"SNIs are used to map hostnames to a certificate."}}},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this SNI."},certificate:{title:"Certificate",description:"Map an existing Certificate object to hostnames"}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."},certificate_id:{label:"SSL Certificate ID",placeholder:"Enter or select a Certificate ID",footer:"Search by exact ID to find certificates not included in the list"}}},delete:{title:"Delete an SNI",description:"This action cannot be reversed so make sure to check the SNI usage before deleting."},errors:{delete:"The SNI could not be deleted at this time.",general:"SNIs could not be retrieved",certificates:{fetch:"Could not fetch available certificates",invalid:"Please select a valid certificate ID"},copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}};function De(){const t=Z.createI18n("en-us",Fe);return{i18n:t,i18nT:Z.i18nTComponent(t)}}const pe={useI18n:De},Q={list:{konnect:{all:"/api/runtime_groups/{controlPlaneId}/snis"},kongManager:{all:"/{workspace}/snis"}},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/snis",edit:"/api/runtime_groups/{controlPlaneId}/snis/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/sni/validate",certificates:"/api/runtime_groups/{controlPlaneId}/certificates"},kongManager:{create:"/{workspace}/snis",edit:"/{workspace}/snis/{id}",validate:"/{workspace}/schemas/snis/validate",certificates:"/{workspace}/certificates"}}};var ue=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(ue||{}),ee=(t=>(t.Edit="edit",t.Create="create",t))(ee||{}),j=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(j||{});function re(t={}){return{axiosInstance:Me.create({withCredentials:!0,timeout:3e4,...t})}}function Ke(){return{debounce:(t,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{t(...a)},n)}}}}const ne="khcp-user-table-preferences",Pe={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function $e(){const t=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},n=()=>{const r=t(localStorage.getItem(ne));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,a)=>{try{const o=n();o.set(r,a),localStorage.setItem(ne,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const a=n();return(a==null?void 0:a.get(r))||void 0||Pe},deleteAllTablePreferences:()=>{localStorage.removeItem(ne)}}}const qe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Re={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},je={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Ue={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"}},Le={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},He={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ze={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"}},Ye={deleteModal:qe,baseForm:Re,baseTable:je,baseConfigCard:Ue,filter:Le,debouncedFilter:ve,errors:He,toggleModal:ze};function ae(){const t=Z.createI18n("en-us",Ye);return{i18n:t,i18nT:Z.i18nTComponent(t)}}function We(t,n,r,a={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=re({headers:t.requestHeaders}),{i18n:{t:i}}=ae(),{debounce:l}=Ke(),f=l(async p=>{await g(p)},200),m=e.ref(!1),u=e.ref(""),s=e.ref(""),h=e.ref([]),b=e.ref(void 0),_=e.unref(n);let N=`${t.apiBaseUrl}${_}`;t.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const w=async()=>{try{m.value=!0;const{data:p}=await o.get(`${N}?size=${r}`);p!=null&&p.next||(b.value=a.fetchedItemsKey in p?p[a.fetchedItemsKey]:[]),h.value=a.fetchedItemsKey in p?p[a.fetchedItemsKey]:[]}catch{h.value=[],u.value=i("debouncedFilter.errors.fetch")}finally{m.value=!1}},c=e.ref(""),g=async p=>{var d,I;if(c.value!==p)if(c.value=p||"",b.value===void 0)try{m.value=!0,u.value="",s.value="";let E=N+"";p&&(E+=`/${p}`);const{data:O}=await o.get(`${E}?size=${r}`);a.fetchedItemsKey in O?h.value=O[a.fetchedItemsKey]:O!=null&&O.id?h.value=[O]:h.value=[]}catch(E){((d=E==null?void 0:E.response)==null?void 0:d.status)===404?s.value=i("debouncedFilter.errors.invalid"):(h.value=[],u.value=i("debouncedFilter.errors.fetch"))}finally{m.value=!1}else m.value=!0,s.value="",p?(h.value=(I=b.value)==null?void 0:I.filter(E=>{var O;let C=!1;for(const P of a.searchKeys){const M=typeof E[P]=="string"?(O=E[P])==null?void 0:O.toLowerCase():E[P];M!=null&&M.includes(p.toLowerCase())&&(C=!0)}return C}),(!h.value||!h.value.length)&&(s.value=i("debouncedFilter.errors.invalid"))):h.value=b.value,m.value=!1};return{loading:m,error:u,validationError:s,results:h,allRecords:b,loadItems:w,debouncedQueryChange:f}}function Je(t,n){const r=e.unref(n),a=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return a.value.search="",o=>`${a.value.href}/${o}`}function Ge(){const{i18n:{t}}=ae();return{getMessageFromError:n=>{var r,a,o;if(!n)return t("errors.unexpected");if((r=n==null?void 0:n.response)!=null&&r.data){if(n.response.data.detail)return n.response.data.detail;if((a=n.response.data.details)!=null&&a.length)return n.response.data.details.map(i=>{let l=t("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:i}=n.response.data;return Array.isArray(i)?(o=i[0])!=null&&o.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(i=>`${i} ${n.response.data[i]}`).join(", ")}return n.message||t("errors.unexpected")}}}function fe(t,n){const r=e.ref(e.unref(t)),a=e.ref(e.unref(n)),o=e.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),i=e.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return l=>{const{page:f,pageSize:m,offset:u,sortColumnKey:s,sortColumnOrder:h,query:b}=l;try{let _=new URL(i.value.href);return o.value&&b?(_.search="",_=new URL(`${_.href}/${b}/`)):(o.value||new URLSearchParams(b).forEach((N,w)=>{_.searchParams.append(w,N)}),s&&_.searchParams.append("sort_by",s),h==="desc"&&_.searchParams.append("sort_desc","1"),_.searchParams.append("size",String(m))),u&&f!==1&&_.searchParams.append("offset",String(u)),_.href}catch(_){return console.error("RouteList(fetcher)",_),a.value}}}function Ze(t,n,r="data"){const a=e.unref(n),{axiosInstance:o}=re({headers:t.requestHeaders}),i=fe(t,a),l=e.ref({status:j.Idle});return{fetcher:async f=>{try{l.value={status:j.Loading};const m=i(f),{data:u}=await o.get(m),s=r&&r.replace(/[^\w-_]/gi,"");let h;u[s]&&Array.isArray(u[s])?h=u[s]:h=Object.keys(u).length?[u]:[];const b={data:h,total:h.length,...u.offset?{pagination:{offset:u.offset}}:null};return l.value={status:j.Idle,response:b},b}catch(m){const u={data:[],total:0};return f.query&&m.response.status===404?(l.value={status:j.NoResults,response:u,error:m},u):(l.value={status:j.Error,response:u,error:m},u)}},fetcherState:l}}function Qe(){return{getPropValue:(t,n)=>(n==null?void 0:n[t])||void 0}}function Xe(){return{convertKeyToTitle:(t,n="_")=>t?t.split(n).map(r=>r.toLowerCase()==="id"?r.toUpperCase():r.charAt(0).toUpperCase()+r.substring(1)).join(" "):""}}const me=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ye=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const n=t.match(me);if(!n)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return n.shift(),n},ge=t=>t==="*"||t==="x"||t==="X",he=t=>{const n=parseInt(t,10);return isNaN(n)?t:n},et=(t,n)=>typeof t!=typeof n?[String(t),String(n)]:[t,n],tt=(t,n)=>{if(ge(t)||ge(n))return 0;const[r,a]=et(he(t),he(n));return r>a?1:r<a?-1:0},be=(t,n)=>{for(let r=0;r<Math.max(t.length,n.length);r++){const a=tt(t[r]||"0",n[r]||"0");if(a!==0)return a}return 0},rt=(t,n)=>{const r=ye(t),a=ye(n),o=r.pop(),i=a.pop(),l=be(r,a);return l!==0?l:o&&i?be(o.split("."),i.split(".")):o||i?o?-1:1:0},ke=(t,n,r)=>{nt(r);const a=rt(t,n);return we[r].includes(a)},we={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Se=Object.keys(we),nt=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Se.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Se.join("|")}`)},at=t=>typeof t=="string"&&/^[v\d]/.test(t)&&me.test(t);function ot(t){const{gatewayInfo:n,supportedRange:r}=t;if(!n)return!0;const{edition:a,version:o}=n;if(!at(o))return console.error("Invalid version"),!1;const i=r[a];if(!i)return!1;const[l,f]=i;return!(l&&ke(o,l,"<")||f&&ke(o,f,">"))}const U={useAxios:re,useDebouncedFilter:We,useDeleteUrlBuilder:Je,useErrors:Ge,useFetcher:Ze,useFetchUrlBuilder:fe,useHelpers:Qe,useStringHelpers:Xe,useI18n:ae,useGatewayFeatureSupported:ot},z=(t,n)=>{const r=t.__vccOpts||t;for(const[a,o]of n)r[a]=o;return r},it="#0044f4",lt="#3a3f51";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ce(t){return typeof t>"u"||t===null}function st(t){return typeof t=="object"&&t!==null}function ct(t){return Array.isArray(t)?t:Ce(t)?[]:[t]}function dt(t,n){var r,a,o,i;if(n)for(i=Object.keys(n),r=0,a=i.length;r<a;r+=1)o=i[r],t[o]=n[o];return t}function pt(t,n){var r="",a;for(a=0;a<n;a+=1)r+=t;return r}function ut(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var ft=Ce,mt=st,yt=ct,gt=pt,ht=ut,bt=dt,oe={isNothing:ft,isObject:mt,toArray:yt,repeat:gt,isNegativeZero:ht,extend:bt};function xe(t,n){var r="",a=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!n&&t.mark.snippet&&(r+=`
|
|
1
|
+
(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","axios","@kong/kongponents","vue-router"],e):($=typeof globalThis<"u"?globalThis:$||self,e($["kong-ui-public-entities-snis"]={},$.Vue,$["kong-ui-public-i18n"],$.axios,$.Kongponents,$.VueRouter))})(this,function($,e,Z,Me,Nn,de){"use strict";const Fe={actions:{create:"New SNI",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},snis:{title:"SNIs",list:{toolbar_actions:{new:"New SNI"},table_headers:{name:"Name",id:"ID",certificate_id:"SSL Certificate ID",tags:"Tags"},empty_state:{title:"Configure a New SNI",description:"SNIs are used to map hostnames to a certificate."}}},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this SNI."},certificate:{title:"Certificate",description:"Map an existing Certificate object to hostnames"}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."},certificate_id:{label:"SSL Certificate ID",placeholder:"Enter or select a Certificate ID",footer:"Search by exact ID to find certificates not included in the list"}}},delete:{title:"Delete an SNI",description:"This action cannot be reversed so make sure to check the SNI usage before deleting."},errors:{delete:"The SNI could not be deleted at this time.",general:"SNIs could not be retrieved",certificates:{fetch:"Could not fetch available certificates",invalid:"Please select a valid certificate ID"},copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}};function De(){const t=Z.createI18n("en-us",Fe);return{i18n:t,i18nT:Z.i18nTComponent(t)}}const pe={useI18n:De},Q={list:{konnect:{all:"/api/runtime_groups/{controlPlaneId}/snis"},kongManager:{all:"/{workspace}/snis"}},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/snis",edit:"/api/runtime_groups/{controlPlaneId}/snis/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/sni/validate",certificates:"/api/runtime_groups/{controlPlaneId}/certificates"},kongManager:{create:"/{workspace}/snis",edit:"/{workspace}/snis/{id}",validate:"/{workspace}/schemas/snis/validate",certificates:"/{workspace}/certificates"}}};var ue=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(ue||{}),ee=(t=>(t.Edit="edit",t.Create="create",t))(ee||{}),j=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(j||{});function re(t={}){return{axiosInstance:Me.create({withCredentials:!0,timeout:3e4,...t})}}function Ke(){return{debounce:(t,n)=>{let r;return(...a)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{t(...a)},n)}}}}const ne="khcp-user-table-preferences",Pe={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function $e(){const t=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},n=()=>{const r=t(localStorage.getItem(ne));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,a)=>{try{const o=n();o.set(r,a),localStorage.setItem(ne,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const a=n();return(a==null?void 0:a.get(r))||void 0||Pe},deleteAllTablePreferences:()=>{localStorage.removeItem(ne)}}}const qe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Re={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},je={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Ue={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"}},Le={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},He={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ze={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"}},Ye={deleteModal:qe,baseForm:Re,baseTable:je,baseConfigCard:Ue,filter:Le,debouncedFilter:ve,errors:He,toggleModal:ze};function ae(){const t=Z.createI18n("en-us",Ye);return{i18n:t,i18nT:Z.i18nTComponent(t)}}function We(t,n,r,a={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=re({headers:t.requestHeaders}),{i18n:{t:i}}=ae(),{debounce:l}=Ke(),f=l(async p=>{await g(p)},200),m=e.ref(!1),u=e.ref(""),s=e.ref(""),h=e.ref([]),b=e.ref(void 0),_=e.unref(n);let N=`${t.apiBaseUrl}${_}`;t.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const w=async()=>{try{m.value=!0;const{data:p}=await o.get(`${N}?size=${r}`);p!=null&&p.next||(b.value=a.fetchedItemsKey in p?p[a.fetchedItemsKey]:[]),h.value=a.fetchedItemsKey in p?p[a.fetchedItemsKey]:[]}catch{h.value=[],u.value=i("debouncedFilter.errors.fetch")}finally{m.value=!1}},c=e.ref(""),g=async p=>{var d,I;if(c.value!==p)if(c.value=p||"",b.value===void 0)try{m.value=!0,u.value="",s.value="";let E=N+"";p&&(E+=`/${p}`);const{data:O}=await o.get(`${E}?size=${r}`);a.fetchedItemsKey in O?h.value=O[a.fetchedItemsKey]:O!=null&&O.id?h.value=[O]:h.value=[]}catch(E){((d=E==null?void 0:E.response)==null?void 0:d.status)===404?s.value=i("debouncedFilter.errors.invalid"):(h.value=[],u.value=i("debouncedFilter.errors.fetch"))}finally{m.value=!1}else m.value=!0,s.value="",p?(h.value=(I=b.value)==null?void 0:I.filter(E=>{var O;let C=!1;for(const P of a.searchKeys){const M=typeof E[P]=="string"?(O=E[P])==null?void 0:O.toLowerCase():E[P];M!=null&&M.includes(p.toLowerCase())&&(C=!0)}return C}),(!h.value||!h.value.length)&&(s.value=i("debouncedFilter.errors.invalid"))):h.value=b.value,m.value=!1};return{loading:m,error:u,validationError:s,results:h,allRecords:b,loadItems:w,debouncedQueryChange:f}}function Je(t,n){const r=e.unref(n),a=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return a.value.search="",o=>`${a.value.href}/${o}`}function Ge(){const{i18n:{t}}=ae();return{getMessageFromError:n=>{var r,a,o;if(!n)return t("errors.unexpected");if((r=n==null?void 0:n.response)!=null&&r.data){if(n.response.data.detail)return n.response.data.detail;if((a=n.response.data.details)!=null&&a.length)return n.response.data.details.map(i=>{let l=t("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:i}=n.response.data;return Array.isArray(i)?(o=i[0])!=null&&o.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(i=>`${i} ${n.response.data[i]}`).join(", ")}return n.message||t("errors.unexpected")}}}function fe(t,n){const r=e.ref(e.unref(t)),a=e.ref(e.unref(n)),o=e.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),i=e.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return l=>{const{page:f,pageSize:m,offset:u,sortColumnKey:s,sortColumnOrder:h,query:b}=l;try{let _=new URL(i.value.href);return o.value&&b?(_.search="",_=new URL(`${_.href}/${b}/`)):(o.value||new URLSearchParams(b).forEach((N,w)=>{_.searchParams.append(w,N)}),s&&_.searchParams.append("sort_by",s),h==="desc"&&_.searchParams.append("sort_desc","1"),_.searchParams.append("size",String(m))),u&&f!==1&&_.searchParams.append("offset",String(u)),_.href}catch(_){return console.error("RouteList(fetcher)",_),a.value}}}function Ze(t,n,r="data"){const a=e.unref(n),{axiosInstance:o}=re({headers:t.requestHeaders}),i=fe(t,a),l=e.ref({status:j.Idle});return{fetcher:async f=>{try{l.value={status:j.Loading};const m=i(f),{data:u}=await o.get(m),s=r&&r.replace(/[^\w-_]/gi,"");let h;u[s]&&Array.isArray(u[s])?h=u[s]:h=Object.keys(u).length?[u]:[];const b={data:h,total:h.length,...u.offset?{pagination:{offset:u.offset}}:null};return l.value={status:j.Idle,response:b},b}catch(m){const u={data:[],total:0};return f.query&&m.response.status===404?(l.value={status:j.NoResults,response:u,error:m},u):(l.value={status:j.Error,response:u,error:m},u)}},fetcherState:l}}function Qe(){return{getPropValue:(t,n)=>(n==null?void 0:n[t])??void 0}}function Xe(){return{convertKeyToTitle:(t,n="_")=>t?t.split(n).map(r=>r.toLowerCase()==="id"?r.toUpperCase():r.charAt(0).toUpperCase()+r.substring(1)).join(" "):""}}const me=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ye=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const n=t.match(me);if(!n)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return n.shift(),n},ge=t=>t==="*"||t==="x"||t==="X",he=t=>{const n=parseInt(t,10);return isNaN(n)?t:n},et=(t,n)=>typeof t!=typeof n?[String(t),String(n)]:[t,n],tt=(t,n)=>{if(ge(t)||ge(n))return 0;const[r,a]=et(he(t),he(n));return r>a?1:r<a?-1:0},be=(t,n)=>{for(let r=0;r<Math.max(t.length,n.length);r++){const a=tt(t[r]||"0",n[r]||"0");if(a!==0)return a}return 0},rt=(t,n)=>{const r=ye(t),a=ye(n),o=r.pop(),i=a.pop(),l=be(r,a);return l!==0?l:o&&i?be(o.split("."),i.split(".")):o||i?o?-1:1:0},ke=(t,n,r)=>{nt(r);const a=rt(t,n);return we[r].includes(a)},we={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Se=Object.keys(we),nt=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Se.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Se.join("|")}`)},at=t=>typeof t=="string"&&/^[v\d]/.test(t)&&me.test(t);function ot(t){const{gatewayInfo:n,supportedRange:r}=t;if(!n)return!0;const{edition:a,version:o}=n;if(!at(o))return console.error("Invalid version"),!1;const i=r[a];if(!i)return!1;const[l,f]=i;return!(l&&ke(o,l,"<")||f&&ke(o,f,">"))}const U={useAxios:re,useDebouncedFilter:We,useDeleteUrlBuilder:Je,useErrors:Ge,useFetcher:Ze,useFetchUrlBuilder:fe,useHelpers:Qe,useStringHelpers:Xe,useI18n:ae,useGatewayFeatureSupported:ot},z=(t,n)=>{const r=t.__vccOpts||t;for(const[a,o]of n)r[a]=o;return r},it="#0044f4",lt="#3a3f51";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ce(t){return typeof t>"u"||t===null}function st(t){return typeof t=="object"&&t!==null}function ct(t){return Array.isArray(t)?t:Ce(t)?[]:[t]}function dt(t,n){var r,a,o,i;if(n)for(i=Object.keys(n),r=0,a=i.length;r<a;r+=1)o=i[r],t[o]=n[o];return t}function pt(t,n){var r="",a;for(a=0;a<n;a+=1)r+=t;return r}function ut(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var ft=Ce,mt=st,yt=ct,gt=pt,ht=ut,bt=dt,oe={isNothing:ft,isObject:mt,toArray:yt,repeat:gt,isNegativeZero:ht,extend:bt};function xe(t,n){var r="",a=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!n&&t.mark.snippet&&(r+=`
|
|
2
2
|
|
|
3
3
|
`+t.mark.snippet),a+" "+r):a}function X(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=xe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X.prototype.toString=function(t){return this.name+": "+xe(this,t)};var L=X,kt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],wt=["scalar","sequence","mapping"];function St(t){var n={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(a){n[String(a)]=r})}),n}function Ct(t,n){if(n=n||{},Object.keys(n).forEach(function(r){if(kt.indexOf(r)===-1)throw new L('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=n,this.tag=t,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(r){return r},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=St(n.styleAliases||null),wt.indexOf(this.kind)===-1)throw new L('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var A=Ct;function _e(t,n){var r=[];return t[n].forEach(function(a){var o=r.length;r.forEach(function(i,l){i.tag===a.tag&&i.kind===a.kind&&i.multi===a.multi&&(o=l)}),r[o]=a}),r}function xt(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,r;function a(o){o.multi?(t.multi[o.kind].push(o),t.multi.fallback.push(o)):t[o.kind][o.tag]=t.fallback[o.tag]=o}for(n=0,r=arguments.length;n<r;n+=1)arguments[n].forEach(a);return t}function ie(t){return this.extend(t)}ie.prototype.extend=function(t){var n=[],r=[];if(t instanceof A)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new L("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof A))throw new L("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new L("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new L("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof A))throw new L("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(ie.prototype);return a.implicit=(this.implicit||[]).concat(n),a.explicit=(this.explicit||[]).concat(r),a.compiledImplicit=_e(a,"implicit"),a.compiledExplicit=_e(a,"explicit"),a.compiledTypeMap=xt(a.compiledImplicit,a.compiledExplicit),a};var _t=ie,Nt=new A("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),It=new A("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Et=new A("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Tt=new _t({explicit:[Nt,It,Et]});function Bt(t){if(t===null)return!0;var n=t.length;return n===1&&t==="~"||n===4&&(t==="null"||t==="Null"||t==="NULL")}function Vt(){return null}function Ot(t){return t===null}var At=new A("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bt,construct:Vt,predicate:Ot,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Mt(t){if(t===null)return!1;var n=t.length;return n===4&&(t==="true"||t==="True"||t==="TRUE")||n===5&&(t==="false"||t==="False"||t==="FALSE")}function Ft(t){return t==="true"||t==="True"||t==="TRUE"}function Dt(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var Kt=new A("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Mt,construct:Ft,predicate:Dt,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function Pt(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function $t(t){return 48<=t&&t<=55}function qt(t){return 48<=t&&t<=57}function Rt(t){if(t===null)return!1;var n=t.length,r=0,a=!1,o;if(!n)return!1;if(o=t[r],(o==="-"||o==="+")&&(o=t[++r]),o==="0"){if(r+1===n)return!0;if(o=t[++r],o==="b"){for(r++;r<n;r++)if(o=t[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;a=!0}return a&&o!=="_"}if(o==="x"){for(r++;r<n;r++)if(o=t[r],o!=="_"){if(!Pt(t.charCodeAt(r)))return!1;a=!0}return a&&o!=="_"}if(o==="o"){for(r++;r<n;r++)if(o=t[r],o!=="_"){if(!$t(t.charCodeAt(r)))return!1;a=!0}return a&&o!=="_"}}if(o==="_")return!1;for(;r<n;r++)if(o=t[r],o!=="_"){if(!qt(t.charCodeAt(r)))return!1;a=!0}return!(!a||o==="_")}function jt(t){var n=t,r=1,a;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),a=n[0],(a==="-"||a==="+")&&(a==="-"&&(r=-1),n=n.slice(1),a=n[0]),n==="0")return 0;if(a==="0"){if(n[1]==="b")return r*parseInt(n.slice(2),2);if(n[1]==="x")return r*parseInt(n.slice(2),16);if(n[1]==="o")return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)}function Ut(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!oe.isNegativeZero(t)}var Lt=new A("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rt,construct:jt,predicate:Ut,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),vt=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ht(t){return!(t===null||!vt.test(t)||t[t.length-1]==="_")}function zt(t){var n,r;return n=t.replace(/_/g,"").toLowerCase(),r=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:r*parseFloat(n,10)}var Yt=/^[-+]?[0-9]+e/;function Wt(t,n){var r;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(oe.isNegativeZero(t))return"-0.0";return r=t.toString(10),Yt.test(r)?r.replace("e",".e"):r}function Jt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||oe.isNegativeZero(t))}var Gt=new A("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ht,construct:zt,predicate:Jt,represent:Wt,defaultStyle:"lowercase"}),Zt=Tt.extend({implicit:[At,Kt,Lt,Gt]}),Qt=Zt,Ne=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ie=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Xt(t){return t===null?!1:Ne.exec(t)!==null||Ie.exec(t)!==null}function er(t){var n,r,a,o,i,l,f,m=0,u=null,s,h,b;if(n=Ne.exec(t),n===null&&(n=Ie.exec(t)),n===null)throw new Error("Date resolve error");if(r=+n[1],a=+n[2]-1,o=+n[3],!n[4])return new Date(Date.UTC(r,a,o));if(i=+n[4],l=+n[5],f=+n[6],n[7]){for(m=n[7].slice(0,3);m.length<3;)m+="0";m=+m}return n[9]&&(s=+n[10],h=+(n[11]||0),u=(s*60+h)*6e4,n[9]==="-"&&(u=-u)),b=new Date(Date.UTC(r,a,o,i,l,f,m)),u&&b.setTime(b.getTime()-u),b}function tr(t){return t.toISOString()}var rr=new A("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xt,construct:er,instanceOf:Date,represent:tr});function nr(t){return t==="<<"||t===null}var ar=new A("tag:yaml.org,2002:merge",{kind:"scalar",resolve:nr}),le=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
4
4
|
\r`;function or(t){if(t===null)return!1;var n,r,a=0,o=t.length,i=le;for(r=0;r<o;r++)if(n=i.indexOf(t.charAt(r)),!(n>64)){if(n<0)return!1;a+=6}return a%8===0}function ir(t){var n,r,a=t.replace(/[\r\n=]/g,""),o=a.length,i=le,l=0,f=[];for(n=0;n<o;n++)n%4===0&&n&&(f.push(l>>16&255),f.push(l>>8&255),f.push(l&255)),l=l<<6|i.indexOf(a.charAt(n));return r=o%4*6,r===0?(f.push(l>>16&255),f.push(l>>8&255),f.push(l&255)):r===18?(f.push(l>>10&255),f.push(l>>2&255)):r===12&&f.push(l>>4&255),new Uint8Array(f)}function lr(t){var n="",r=0,a,o,i=t.length,l=le;for(a=0;a<i;a++)a%3===0&&a&&(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]),r=(r<<8)+t[a];return o=i%3,o===0?(n+=l[r>>18&63],n+=l[r>>12&63],n+=l[r>>6&63],n+=l[r&63]):o===2?(n+=l[r>>10&63],n+=l[r>>4&63],n+=l[r<<2&63],n+=l[64]):o===1&&(n+=l[r>>2&63],n+=l[r<<4&63],n+=l[64],n+=l[64]),n}function sr(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var cr=new A("tag:yaml.org,2002:binary",{kind:"scalar",resolve:or,construct:ir,predicate:sr,represent:lr}),dr=Object.prototype.hasOwnProperty,pr=Object.prototype.toString;function ur(t){if(t===null)return!0;var n=[],r,a,o,i,l,f=t;for(r=0,a=f.length;r<a;r+=1){if(o=f[r],l=!1,pr.call(o)!=="[object Object]")return!1;for(i in o)if(dr.call(o,i))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(i)===-1)n.push(i);else return!1}return!0}function fr(t){return t!==null?t:[]}var mr=new A("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ur,construct:fr}),yr=Object.prototype.toString;function gr(t){if(t===null)return!0;var n,r,a,o,i,l=t;for(i=new Array(l.length),n=0,r=l.length;n<r;n+=1){if(a=l[n],yr.call(a)!=="[object Object]"||(o=Object.keys(a),o.length!==1))return!1;i[n]=[o[0],a[o[0]]]}return!0}function hr(t){if(t===null)return[];var n,r,a,o,i,l=t;for(i=new Array(l.length),n=0,r=l.length;n<r;n+=1)a=l[n],o=Object.keys(a),i[n]=[o[0],a[o[0]]];return i}var br=new A("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gr,construct:hr}),kr=Object.prototype.hasOwnProperty;function wr(t){if(t===null)return!0;var n,r=t;for(n in r)if(kr.call(r,n)&&r[n]!==null)return!1;return!0}function Sr(t){return t!==null?t:{}}var Cr=new A("tag:yaml.org,2002:set",{kind:"mapping",resolve:wr,construct:Sr});Qt.extend({implicit:[rr,ar],explicit:[cr,mr,br,Cr]});function Ee(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-snis",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-snis.umd.js",
|
|
6
6
|
"module": "./dist/entities-snis.es.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@kong-ui-public/copy-uuid": "^1.3.0",
|
|
53
|
-
"@kong-ui-public/entities-shared": "^1.5.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^1.5.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|