@kong-ui-public/entities-snis 2.5.1 → 2.5.2

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.
@@ -356,7 +356,7 @@ function hi(e, t, n, i = {
356
356
  fetchedItemsKey: "data",
357
357
  searchKeys: ["id"]
358
358
  }) {
359
- n || (n = "100");
359
+ n || (n = "1000");
360
360
  const { axiosInstance: r } = at({
361
361
  headers: e.requestHeaders
362
362
  }), { i18n: { t: o } } = ot(), { debounce: a } = ni(), l = a(async (m) => {
@@ -1,4 +1,4 @@
1
- (function(W,t){typeof exports=="object"&&typeof module<"u"?t(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"],t):(W=typeof globalThis<"u"?globalThis:W||self,t(W["kong-ui-public-entities-snis"]={},W.Vue,W["kong-ui-public-i18n"],W.axios,W.Kongponents,W.VueRouter))})(this,function(W,t,be,ze,Ta,He){"use strict";const un={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 SNI"},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 fn(){const e=be.createI18n("en-us",un);return{i18n:e,i18nT:be.i18nTComponent(e)}}const We={useI18n:fn},ue={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 Ye=(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))(Ye||{}),ke=(e=>(e.Edit="edit",e.Create="create",e))(ke||{}),te=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(te||{});function mn(){return{getAxiosInstance:(e={})=>{try{const n=t.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):ze.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),ze.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var n;return((n=e==null?void 0:e.response)==null?void 0:n.headers["x-datadog-trace-id"])||""}}}function hn(){return{debounce:(e,n)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},n)}}}}const Ae="khcp-user-table-preferences",gn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function yn(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},n=()=>{const r=e(localStorage.getItem(Ae));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=n();o.set(r,i),localStorage.setItem(Ae,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=n();return(i==null?void 0:i.get(r))||void 0||gn},deleteAllTablePreferences:()=>{localStorage.removeItem(Ae)}}}function _e(e={}){const{getAxiosInstance:n}=mn();return{axiosInstance:n(e)}}const bn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},wn={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."}},Cn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sn={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"}},xn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},In={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},An={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"}},_n={global:bn,deleteModal:kn,baseForm:wn,baseTable:Cn,baseConfigCard:Sn,filter:xn,debouncedFilter:Nn,errors:In,toggleModal:An};function Ee(){const e=be.createI18n("en-us",_n);return{i18n:e,i18nT:be.i18nTComponent(e)}}function Je(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,n=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const l of o){const a=r.filter(c=>c===l).length,s=i.filter(c=>c===l).length;if(a!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const l in r)if(Array.isArray(r[l])&&Array.isArray(i[l])){if(n(r[l],i[l]))continue;return!1}else{if(r[l]===i[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let l=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(l=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),l.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function En(e,n,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=_e({headers:e.requestHeaders}),{i18n:{t:l}}=Ee(),{debounce:a}=hn(),s=a(async y=>{await P(y)},200),c=t.ref(!1),p=t.ref(""),u=t.ref(""),d=t.ref([]),f=t.ref([]),m=t.ref(void 0),k=t.unref(n);let g=`${e.apiBaseUrl}${k}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=Je(),_=async()=>{try{c.value=!0;const{data:y}=await o.get(`${g}?size=${r}`);y!=null&&y.next||(m.value=i.fetchedItemsKey in y?y[i.fetchedItemsKey]:[]),f.value=i.fetchedItemsKey in y?y[i.fetchedItemsKey]:[],d.value=f.value}catch{d.value=[],p.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},C=t.ref(""),P=async y=>{var h,w,E;if(C.value!==y)if(C.value=y||"",m.value===void 0)try{if(c.value=!0,p.value="",u.value="",e.app==="konnect"){let v=g+"";y&&(v+=`/${y}`);const{data:x}=await o.get(`${v}?size=${r}`);i.fetchedItemsKey in x?d.value=x[i.fetchedItemsKey]:x!=null&&x.id?d.value=[x]:d.value=[]}else if(y){const v=[];N(y)&&i.searchKeys.includes("id")?v.push((async()=>{const{data:T}=await o.get(`${g}/${y}`);return[T[i.fetchedItemsKey]??T]})()):v.push(...i.searchKeys.filter(T=>T!=="id").map(async T=>{const{data:B}=await o.get(`${g}?${T}=${y}`);return B[i.fetchedItemsKey]}));const x=await Promise.all(v),$=new Set;d.value=[],(h=x==null?void 0:x.forEach)==null||h.call(x,T=>{var B;(B=T==null?void 0:T.forEach)==null||B.call(T,K=>{$.has(K.id)||($.add(K.id),d.value.push(K))})})}else d.value=f.value}catch(v){((w=v==null?void 0:v.response)==null?void 0:w.status)===404?u.value=l("debouncedFilter.errors.invalid"):(d.value=[],p.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",y?(d.value=(E=m.value)==null?void 0:E.filter(v=>{var x;let $=!1;for(const T of i.searchKeys){const B=typeof v[T]=="string"?(x=v[T])==null?void 0:x.toLowerCase():v[T];B!=null&&B.includes(y.toLowerCase())&&($=!0)}return $}),(!d.value||!d.value.length)&&(u.value=l("debouncedFilter.errors.invalid"))):d.value=m.value,c.value=!1};return{loading:c,error:p,validationError:u,results:d,allRecords:m,loadItems:_,debouncedQueryChange:s}}function Bn(e,n){const r=t.unref(n),i=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function vn(){const{i18n:{t:e}}=Ee();return{getMessageFromError:n=>{var r,i,o,l;if(!n)return e("errors.unexpected");if(((r=n==null?void 0:n.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=n==null?void 0:n.response)!=null&&i.data){if(n.response.data.detail)return n.response.data.detail;if((o=n.response.data.details)!=null&&o.length)return n.response.data.details.map(a=>{let s=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(s=a.messages.join(", ")),a.field?`${a.field} - ${s}`:s}).join("; ");if(n.response.data.message){const{message:a}=n.response.data;return Array.isArray(a)?(l=a[0])!=null&&l.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(a=>`${a} ${n.response.data[a]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Tn(e){const n=window.location.origin,r=n.endsWith("/")?n:`${n}/`;try{const i=e.join("/"),o=`${r}${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(o)&&!l&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Ge(e,n){const r=t.ref(t.unref(e)),i=t.ref(t.unref(n)),o=t.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),l=t.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:s,pageSize:c,offset:p,sortColumnKey:u,sortColumnOrder:d,query:f}=a;try{let m=new URL(l.value.href);return o.value&&f?(m.search="",m=r.value.isExactMatch?new URL(`${m.href}/${f}/`):new URL(`${m.href}?filter[name][contains]=${f}`)):(o.value||new URLSearchParams(f).forEach((k,g)=>{m.searchParams.append(g,k)}),u&&m.searchParams.append("sort_by",u),d==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),p&&s!==1&&m.searchParams.append("offset",String(p)),m.href}catch(m){return console.error("RouteList(fetcher)",m),i.value}}}function Vn(e,n,r="data"){var i;const o=t.unref(n),{axiosInstance:l}=_e({...e.axiosRequestConfig,headers:{...(i=e.axiosRequestConfig)==null?void 0:i.headers,...e.requestHeaders}}),a=Ge(e,o),s=t.ref({status:te.Idle});return{fetcher:async c=>{var p;try{s.value={status:te.Loading};let u=a(c);u.includes("filter[name]")&&(u=`${u}&page[size]=${c.pageSize}&page[number]=${c.page}`);const d=await l.get(u);if(d.status>=400)throw d;const f=d.data,m=r&&r.replace(/[^\w-_]/gi,"");let k;f[m]&&Array.isArray(f[m])?k=f[m]:Array.isArray(f)?k=f:k=Object.keys(f).length?[f]:[];const g={data:k,total:k.length,...f.offset?{pagination:{offset:f.offset}}:null};return s.value={status:te.Idle,response:g},g}catch(u){const d={data:[],total:0};return c.query&&(((p=u.response)==null?void 0:p.status)===404||u.status===404)?(s.value={status:te.NoResults,response:d,error:u.response?u:{response:u}},d):(s.value={status:te.Error,response:d,error:u.response?u:{response:u}},d)}},fetcherState:s}}function jn(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(n,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Ze=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Qe=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(Ze);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},Xe=e=>e==="*"||e==="x"||e==="X",et=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},On=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Mn=(e,n)=>{if(Xe(e)||Xe(n))return 0;const[r,i]=On(et(e),et(n));return r>i?1:r<i?-1:0},tt=(e,n)=>{for(let r=0;r<Math.max(e.length,n.length);r++){const i=Mn(e[r]||"0",n[r]||"0");if(i!==0)return i}return 0},Fn=(e,n)=>{const r=Qe(e),i=Qe(n),o=r.pop(),l=i.pop(),a=tt(r,i);return a!==0?a:o&&l?tt(o.split("."),l.split(".")):o||l?o?-1:1:0},nt=(e,n,r)=>{Ln(r);const i=Fn(e,n);return rt[r].includes(i)},rt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},it=Object.keys(rt),Ln=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(it.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${it.join("|")}`)},qn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Ze.test(e);function Dn(e){const{gatewayInfo:n,supportedRange:r}=e;if(!n)return!0;const{edition:i,version:o}=n;if(!qn(o))return console.error("Invalid version"),!1;const l=r[i];if(!l)return!1;const[a,s]=l;return!(a&&nt(o,a,"<")||s&&nt(o,s,">"))}function $n(e){const n=t.ref(0),r=t.ref(0),i=t.ref(!1);return t.watch(e,o=>{o&&!i.value&&(n.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:t.computed(()=>n.value<r.value)}}const ne={useAxios:_e,useDebouncedFilter:En,useDeleteUrlBuilder:Bn,useErrors:vn,useExternalLinkCreator:Tn,useFetcher:Vn,useFetchUrlBuilder:Ge,useHelpers:Je,useStringHelpers:jn,useI18n:Ee,useGatewayFeatureSupported:Dn,useTruncationDetector:$n},ie=(e,n)=>{const r=e.__vccOpts||e;for(const[i,o]of n)r[i]=o;return r},Kn="#0044f4",Rn="#3a3f51",Un="#afb7c5",Pn={class:"json-config"},zn={key:0,class:"json-endpoint"},Hn=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(o=>({"954d3eca":`${i.value}ch`}));const n=e,r=t.computed(()=>n.jsonRecord),i=t.computed(()=>{var o;if(!n.fetcherUrl)return 0;const l=(o=n.fetcherUrl)==null?void 0:o.split("/");return l.length<2?0:41+(n.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(o,l)=>{const a=t.resolveComponent("KBadge"),s=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Pn,[n.fetcherUrl?(t.openBlock(),t.createElementBlock("div",zn,[t.createVNode(a,{appearance:n.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(s,{id:"json-endpoint-codeblock",code:n.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),n.jsonRecord?(t.openBlock(),t.createBlock(s,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":n.fetcherUrl}),code:JSON.stringify(r.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 ot(e){return typeof e>"u"||e===null}function Wn(e){return typeof e=="object"&&e!==null}function Yn(e){return Array.isArray(e)?e:ot(e)?[]:[e]}function Jn(e,n){var r,i,o,l;if(n)for(l=Object.keys(n),r=0,i=l.length;r<i;r+=1)o=l[r],e[o]=n[o];return e}function Gn(e,n){var r="",i;for(i=0;i<n;i+=1)r+=e;return r}function Zn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Qn=ot,Xn=Wn,er=Yn,tr=Gn,nr=Zn,rr=Jn,L={isNothing:Qn,isObject:Xn,toArray:er,repeat:tr,isNegativeZero:nr,extend:rr};function at(e,n){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(r+=`
1
+ (function(W,t){typeof exports=="object"&&typeof module<"u"?t(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"],t):(W=typeof globalThis<"u"?globalThis:W||self,t(W["kong-ui-public-entities-snis"]={},W.Vue,W["kong-ui-public-i18n"],W.axios,W.Kongponents,W.VueRouter))})(this,function(W,t,be,ze,Ta,He){"use strict";const un={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 SNI"},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 fn(){const e=be.createI18n("en-us",un);return{i18n:e,i18nT:be.i18nTComponent(e)}}const We={useI18n:fn},ue={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 Ye=(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))(Ye||{}),ke=(e=>(e.Edit="edit",e.Create="create",e))(ke||{}),te=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(te||{});function mn(){return{getAxiosInstance:(e={})=>{try{const n=t.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):ze.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),ze.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var n;return((n=e==null?void 0:e.response)==null?void 0:n.headers["x-datadog-trace-id"])||""}}}function hn(){return{debounce:(e,n)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},n)}}}}const Ae="khcp-user-table-preferences",gn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function yn(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},n=()=>{const r=e(localStorage.getItem(Ae));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=n();o.set(r,i),localStorage.setItem(Ae,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=n();return(i==null?void 0:i.get(r))||void 0||gn},deleteAllTablePreferences:()=>{localStorage.removeItem(Ae)}}}function _e(e={}){const{getAxiosInstance:n}=mn();return{axiosInstance:n(e)}}const bn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},wn={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."}},Cn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sn={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"}},xn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},In={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},An={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"}},_n={global:bn,deleteModal:kn,baseForm:wn,baseTable:Cn,baseConfigCard:Sn,filter:xn,debouncedFilter:Nn,errors:In,toggleModal:An};function Ee(){const e=be.createI18n("en-us",_n);return{i18n:e,i18nT:be.i18nTComponent(e)}}function Je(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,n=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const l of o){const a=r.filter(c=>c===l).length,s=i.filter(c=>c===l).length;if(a!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const l in r)if(Array.isArray(r[l])&&Array.isArray(i[l])){if(n(r[l],i[l]))continue;return!1}else{if(r[l]===i[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let l=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(l=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),l.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function En(e,n,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=_e({headers:e.requestHeaders}),{i18n:{t:l}}=Ee(),{debounce:a}=hn(),s=a(async y=>{await P(y)},200),c=t.ref(!1),p=t.ref(""),u=t.ref(""),d=t.ref([]),f=t.ref([]),m=t.ref(void 0),k=t.unref(n);let g=`${e.apiBaseUrl}${k}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:N}=Je(),_=async()=>{try{c.value=!0;const{data:y}=await o.get(`${g}?size=${r}`);y!=null&&y.next||(m.value=i.fetchedItemsKey in y?y[i.fetchedItemsKey]:[]),f.value=i.fetchedItemsKey in y?y[i.fetchedItemsKey]:[],d.value=f.value}catch{d.value=[],p.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},C=t.ref(""),P=async y=>{var h,w,E;if(C.value!==y)if(C.value=y||"",m.value===void 0)try{if(c.value=!0,p.value="",u.value="",e.app==="konnect"){let v=g+"";y&&(v+=`/${y}`);const{data:x}=await o.get(`${v}?size=${r}`);i.fetchedItemsKey in x?d.value=x[i.fetchedItemsKey]:x!=null&&x.id?d.value=[x]:d.value=[]}else if(y){const v=[];N(y)&&i.searchKeys.includes("id")?v.push((async()=>{const{data:T}=await o.get(`${g}/${y}`);return[T[i.fetchedItemsKey]??T]})()):v.push(...i.searchKeys.filter(T=>T!=="id").map(async T=>{const{data:B}=await o.get(`${g}?${T}=${y}`);return B[i.fetchedItemsKey]}));const x=await Promise.all(v),$=new Set;d.value=[],(h=x==null?void 0:x.forEach)==null||h.call(x,T=>{var B;(B=T==null?void 0:T.forEach)==null||B.call(T,K=>{$.has(K.id)||($.add(K.id),d.value.push(K))})})}else d.value=f.value}catch(v){((w=v==null?void 0:v.response)==null?void 0:w.status)===404?u.value=l("debouncedFilter.errors.invalid"):(d.value=[],p.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",y?(d.value=(E=m.value)==null?void 0:E.filter(v=>{var x;let $=!1;for(const T of i.searchKeys){const B=typeof v[T]=="string"?(x=v[T])==null?void 0:x.toLowerCase():v[T];B!=null&&B.includes(y.toLowerCase())&&($=!0)}return $}),(!d.value||!d.value.length)&&(u.value=l("debouncedFilter.errors.invalid"))):d.value=m.value,c.value=!1};return{loading:c,error:p,validationError:u,results:d,allRecords:m,loadItems:_,debouncedQueryChange:s}}function Bn(e,n){const r=t.unref(n),i=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function vn(){const{i18n:{t:e}}=Ee();return{getMessageFromError:n=>{var r,i,o,l;if(!n)return e("errors.unexpected");if(((r=n==null?void 0:n.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=n==null?void 0:n.response)!=null&&i.data){if(n.response.data.detail)return n.response.data.detail;if((o=n.response.data.details)!=null&&o.length)return n.response.data.details.map(a=>{let s=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(s=a.messages.join(", ")),a.field?`${a.field} - ${s}`:s}).join("; ");if(n.response.data.message){const{message:a}=n.response.data;return Array.isArray(a)?(l=a[0])!=null&&l.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(a=>`${a} ${n.response.data[a]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Tn(e){const n=window.location.origin,r=n.endsWith("/")?n:`${n}/`;try{const i=e.join("/"),o=`${r}${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(o)&&!l&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Ge(e,n){const r=t.ref(t.unref(e)),i=t.ref(t.unref(n)),o=t.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),l=t.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:s,pageSize:c,offset:p,sortColumnKey:u,sortColumnOrder:d,query:f}=a;try{let m=new URL(l.value.href);return o.value&&f?(m.search="",m=r.value.isExactMatch?new URL(`${m.href}/${f}/`):new URL(`${m.href}?filter[name][contains]=${f}`)):(o.value||new URLSearchParams(f).forEach((k,g)=>{m.searchParams.append(g,k)}),u&&m.searchParams.append("sort_by",u),d==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),p&&s!==1&&m.searchParams.append("offset",String(p)),m.href}catch(m){return console.error("RouteList(fetcher)",m),i.value}}}function Vn(e,n,r="data"){var i;const o=t.unref(n),{axiosInstance:l}=_e({...e.axiosRequestConfig,headers:{...(i=e.axiosRequestConfig)==null?void 0:i.headers,...e.requestHeaders}}),a=Ge(e,o),s=t.ref({status:te.Idle});return{fetcher:async c=>{var p;try{s.value={status:te.Loading};let u=a(c);u.includes("filter[name]")&&(u=`${u}&page[size]=${c.pageSize}&page[number]=${c.page}`);const d=await l.get(u);if(d.status>=400)throw d;const f=d.data,m=r&&r.replace(/[^\w-_]/gi,"");let k;f[m]&&Array.isArray(f[m])?k=f[m]:Array.isArray(f)?k=f:k=Object.keys(f).length?[f]:[];const g={data:k,total:k.length,...f.offset?{pagination:{offset:f.offset}}:null};return s.value={status:te.Idle,response:g},g}catch(u){const d={data:[],total:0};return c.query&&(((p=u.response)==null?void 0:p.status)===404||u.status===404)?(s.value={status:te.NoResults,response:d,error:u.response?u:{response:u}},d):(s.value={status:te.Error,response:d,error:u.response?u:{response:u}},d)}},fetcherState:s}}function jn(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(n,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Ze=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Qe=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(Ze);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},Xe=e=>e==="*"||e==="x"||e==="X",et=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},On=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Mn=(e,n)=>{if(Xe(e)||Xe(n))return 0;const[r,i]=On(et(e),et(n));return r>i?1:r<i?-1:0},tt=(e,n)=>{for(let r=0;r<Math.max(e.length,n.length);r++){const i=Mn(e[r]||"0",n[r]||"0");if(i!==0)return i}return 0},Fn=(e,n)=>{const r=Qe(e),i=Qe(n),o=r.pop(),l=i.pop(),a=tt(r,i);return a!==0?a:o&&l?tt(o.split("."),l.split(".")):o||l?o?-1:1:0},nt=(e,n,r)=>{Ln(r);const i=Fn(e,n);return rt[r].includes(i)},rt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},it=Object.keys(rt),Ln=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(it.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${it.join("|")}`)},qn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Ze.test(e);function Dn(e){const{gatewayInfo:n,supportedRange:r}=e;if(!n)return!0;const{edition:i,version:o}=n;if(!qn(o))return console.error("Invalid version"),!1;const l=r[i];if(!l)return!1;const[a,s]=l;return!(a&&nt(o,a,"<")||s&&nt(o,s,">"))}function $n(e){const n=t.ref(0),r=t.ref(0),i=t.ref(!1);return t.watch(e,o=>{o&&!i.value&&(n.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:t.computed(()=>n.value<r.value)}}const ne={useAxios:_e,useDebouncedFilter:En,useDeleteUrlBuilder:Bn,useErrors:vn,useExternalLinkCreator:Tn,useFetcher:Vn,useFetchUrlBuilder:Ge,useHelpers:Je,useStringHelpers:jn,useI18n:Ee,useGatewayFeatureSupported:Dn,useTruncationDetector:$n},ie=(e,n)=>{const r=e.__vccOpts||e;for(const[i,o]of n)r[i]=o;return r},Kn="#0044f4",Rn="#3a3f51",Un="#afb7c5",Pn={class:"json-config"},zn={key:0,class:"json-endpoint"},Hn=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(o=>({"954d3eca":`${i.value}ch`}));const n=e,r=t.computed(()=>n.jsonRecord),i=t.computed(()=>{var o;if(!n.fetcherUrl)return 0;const l=(o=n.fetcherUrl)==null?void 0:o.split("/");return l.length<2?0:41+(n.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(o,l)=>{const a=t.resolveComponent("KBadge"),s=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Pn,[n.fetcherUrl?(t.openBlock(),t.createElementBlock("div",zn,[t.createVNode(a,{appearance:n.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(s,{id:"json-endpoint-codeblock",code:n.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),n.jsonRecord?(t.openBlock(),t.createBlock(s,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":n.fetcherUrl}),code:JSON.stringify(r.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 ot(e){return typeof e>"u"||e===null}function Wn(e){return typeof e=="object"&&e!==null}function Yn(e){return Array.isArray(e)?e:ot(e)?[]:[e]}function Jn(e,n){var r,i,o,l;if(n)for(l=Object.keys(n),r=0,i=l.length;r<i;r+=1)o=l[r],e[o]=n[o];return e}function Gn(e,n){var r="",i;for(i=0;i<n;i+=1)r+=e;return r}function Zn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Qn=ot,Xn=Wn,er=Yn,tr=Gn,nr=Zn,rr=Jn,L={isNothing:Qn,isObject:Xn,toArray:er,repeat:tr,isNegativeZero:nr,extend:rr};function at(e,n){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(r+=`
2
2
 
3
3
  `+e.mark.snippet),i+" "+r):i}function fe(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=at(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}fe.prototype=Object.create(Error.prototype),fe.prototype.constructor=fe,fe.prototype.toString=function(e){return this.name+": "+at(this,e)};var U=fe;function Be(e,n,r,i,o){var l="",a="",s=Math.floor(o/2)-1;return i-n>s&&(l=" ... ",n=i-s+l.length),r-i>s&&(a=" ...",r=i+s-a.length),{str:l+e.slice(n,r).replace(/\t/g,"→")+a,pos:i-n+l.length}}function ve(e,n){return L.repeat(" ",n-e.length)+e}function ir(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],l,a=-1;l=r.exec(e.buffer);)o.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 s="",c,p,u=Math.min(e.line+n.linesAfter,o.length).toString().length,d=n.maxLength-(n.indent+u+3);for(c=1;c<=n.linesBefore&&!(a-c<0);c++)p=Be(e.buffer,i[a-c],o[a-c],e.position-(i[a]-i[a-c]),d),s=L.repeat(" ",n.indent)+ve((e.line-c+1).toString(),u)+" | "+p.str+`
4
4
  `+s;for(p=Be(e.buffer,i[a],o[a],e.position,d),s+=L.repeat(" ",n.indent)+ve((e.line+1).toString(),u)+" | "+p.str+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-snis",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
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
  "errorLimit": "400KB"
51
51
  },
52
52
  "dependencies": {
53
- "@kong-ui-public/entities-shared": "^2.12.0"
53
+ "@kong-ui-public/entities-shared": "^2.12.1"
54
54
  },
55
55
  "scripts": {
56
56
  "dev": "cross-env USE_SANDBOX=true vite",