pangea-lib 3.1.36 → 3.1.39
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/main.cjs.js +1 -1
- package/dist/main.es.js +76 -44
- package/dist/types/api-connections/create-api-connections.d.ts +1 -1
- package/dist/types/api-connections/methods/connect-to-api.d.ts +1 -1
- package/dist/types/api-connections/methods/get-request-config.d.ts +1 -1
- package/dist/types/types/api-connections.types.d.ts +0 -4
- package/package.json +1 -1
package/dist/main.cjs.js
CHANGED
|
@@ -875,4 +875,4 @@ A valid view must be one of: ${qu.join(", ")}.`),e="week"),this.enabledViews.inc
|
|
|
875
875
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...a){const r=new this(t);return a.forEach(n=>r.set(n)),r}static accessor(t){const r=(this[Mp]=this[Mp]={accessors:{}}).accessors,n=this.prototype;function c(i){const s=$a(i);r[s]||(Yj1(n,i),r[s]=!0)}return _1.isArray(t)?t.forEach(c):c(t),this}}vi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_1.reduceDescriptors(vi.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[a]=r}}});_1.freezeMethods(vi);const d4=vi;function Vs(e,t){const a=this||Hf,r=t||a,n=d4.from(r.headers);let c=r.data;return _1.forEach(e,function(s){c=s.call(a,c,n.normalize(),t?t.status:void 0)}),n.normalize(),c}function XA(e){return!!(e&&e.__CANCEL__)}function Ca(e,t,a){t2.call(this,e??"canceled",t2.ERR_CANCELED,t,a),this.name="CanceledError"}_1.inherits(Ca,t2,{__CANCEL__:!0});function KA(e,t,a){const r=a.config.validateStatus;!a.status||!r||r(a.status)?e(a):t(new t2("Request failed with status code "+a.status,[t2.ERR_BAD_REQUEST,t2.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function Gj1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xj1(e,t){e=e||10;const a=new Array(e),r=new Array(e);let n=0,c=0,i;return t=t!==void 0?t:1e3,function(l){const f=Date.now(),u=r[c];i||(i=f),a[n]=l,r[n]=f;let d=c,h=0;for(;d!==n;)h+=a[d++],d=d%e;if(n=(n+1)%e,n===c&&(c=(c+1)%e),f-i<t)return;const m=u&&f-u;return m?Math.round(h*1e3/m):void 0}}function Kj1(e,t){let a=0,r=1e3/t,n,c;const i=(f,u=Date.now())=>{a=u,n=null,c&&(clearTimeout(c),c=null),e.apply(null,f)};return[(...f)=>{const u=Date.now(),d=u-a;d>=r?i(f,u):(n=f,c||(c=setTimeout(()=>{c=null,i(n)},r-d)))},()=>n&&i(n)]}const a5=(e,t,a=3)=>{let r=0;const n=Xj1(50,250);return Kj1(c=>{const i=c.loaded,s=c.lengthComputable?c.total:void 0,l=i-r,f=n(l),u=i<=s;r=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:l,rate:f||void 0,estimated:f&&s&&u?(s-i)/f:void 0,event:c,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},a)},zp=(e,t)=>{const a=e!=null;return[r=>t[0]({lengthComputable:a,total:e,loaded:r}),t[1]]},wp=e=>(...t)=>_1.asap(()=>e(...t)),Zj1=Ze.hasStandardBrowserEnv?((e,t)=>a=>(a=new URL(a,Ze.origin),e.protocol===a.protocol&&e.host===a.host&&(t||e.port===a.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,Qj1=Ze.hasStandardBrowserEnv?{write(e,t,a,r,n,c){const i=[e+"="+encodeURIComponent(t)];_1.isNumber(a)&&i.push("expires="+new Date(a).toGMTString()),_1.isString(r)&&i.push("path="+r),_1.isString(n)&&i.push("domain="+n),c===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Jj1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eY1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ZA(e,t){return e&&!Jj1(t)?eY1(e,t):t}const _p=e=>e instanceof d4?{...e}:e;function f6(e,t){t=t||{};const a={};function r(f,u,d,h){return _1.isPlainObject(f)&&_1.isPlainObject(u)?_1.merge.call({caseless:h},f,u):_1.isPlainObject(u)?_1.merge({},u):_1.isArray(u)?u.slice():u}function n(f,u,d,h){if(_1.isUndefined(u)){if(!_1.isUndefined(f))return r(void 0,f,d,h)}else return r(f,u,d,h)}function c(f,u){if(!_1.isUndefined(u))return r(void 0,u)}function i(f,u){if(_1.isUndefined(u)){if(!_1.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function s(f,u,d){if(d in t)return r(f,u);if(d in e)return r(void 0,f)}const l={url:c,method:c,data:c,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(f,u,d)=>n(_p(f),_p(u),d,!0)};return _1.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||n,h=d(e[u],t[u],u);_1.isUndefined(h)&&d!==s||(a[u]=h)}),a}const QA=e=>{const t=f6({},e);let{data:a,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:c,headers:i,auth:s}=t;t.headers=i=d4.from(i),t.url=jA(ZA(t.baseURL,t.url),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(_1.isFormData(a)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((l=i.getContentType())!==!1){const[f,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([f||"multipart/form-data",...u].join("; "))}}if(Ze.hasStandardBrowserEnv&&(r&&_1.isFunction(r)&&(r=r(t)),r||r!==!1&&Zj1(t.url))){const f=n&&c&&Qj1.read(c);f&&i.set(n,f)}return t},tY1=typeof XMLHttpRequest<"u",aY1=tY1&&function(e){return new Promise(function(a,r){const n=QA(e);let c=n.data;const i=d4.from(n.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:f}=n,u,d,h,m,v;function p(){m&&m(),v&&v(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout;function y(){if(!g)return;const C=d4.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),M={data:!s||s==="text"||s==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:C,config:e,request:g};KA(function(z){a(z),p()},function(z){r(z),p()},M),g=null}"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(y)},g.onabort=function(){g&&(r(new t2("Request aborted",t2.ECONNABORTED,e,g)),g=null)},g.onerror=function(){r(new t2("Network Error",t2.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let b=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const M=n.transitional||YA;n.timeoutErrorMessage&&(b=n.timeoutErrorMessage),r(new t2(b,M.clarifyTimeoutError?t2.ETIMEDOUT:t2.ECONNABORTED,e,g)),g=null},c===void 0&&i.setContentType(null),"setRequestHeader"in g&&_1.forEach(i.toJSON(),function(b,M){g.setRequestHeader(M,b)}),_1.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),s&&s!=="json"&&(g.responseType=n.responseType),f&&([h,v]=a5(f,!0),g.addEventListener("progress",h)),l&&g.upload&&([d,m]=a5(l),g.upload.addEventListener("progress",d),g.upload.addEventListener("loadend",m)),(n.cancelToken||n.signal)&&(u=C=>{g&&(r(!C||C.type?new Ca(null,e,g):C),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const x=Gj1(n.url);if(x&&Ze.protocols.indexOf(x)===-1){r(new t2("Unsupported protocol "+x+":",t2.ERR_BAD_REQUEST,e));return}g.send(c||null)})},rY1=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let r=new AbortController,n;const c=function(f){if(!n){n=!0,s();const u=f instanceof Error?f:this.reason;r.abort(u instanceof t2?u:new Ca(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,c(new t2(`timeout ${t} of ms exceeded`,t2.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(c):f.removeEventListener("abort",c)}),e=null)};e.forEach(f=>f.addEventListener("abort",c));const{signal:l}=r;return l.unsubscribe=()=>_1.asap(s),l}},nY1=rY1,cY1=function*(e,t){let a=e.byteLength;if(!t||a<t){yield e;return}let r=0,n;for(;r<a;)n=r+t,yield e.slice(r,n),r=n},iY1=async function*(e,t){for await(const a of sY1(e))yield*cY1(a,t)},sY1=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:a,value:r}=await t.read();if(a)break;yield r}}finally{await t.cancel()}},kp=(e,t,a,r)=>{const n=iY1(e,t);let c=0,i,s=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:f,value:u}=await n.next();if(f){s(),l.close();return}let d=u.byteLength;if(a){let h=c+=d;a(h)}l.enqueue(new Uint8Array(u))}catch(f){throw s(f),f}},cancel(l){return s(l),n.return()}},{highWaterMark:2})},gi=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",JA=gi&&typeof ReadableStream=="function",oY1=gi&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},lY1=JA&&eT(()=>{let e=!1;const t=new Request(Ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Hp=64*1024,ao=JA&&eT(()=>_1.isReadableStream(new Response("").body)),r5={stream:ao&&(e=>e.body)};gi&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!r5[t]&&(r5[t]=_1.isFunction(e[t])?a=>a[t]():(a,r)=>{throw new t2(`Response type '${t}' is not supported`,t2.ERR_NOT_SUPPORT,r)})})})(new Response);const fY1=async e=>{if(e==null)return 0;if(_1.isBlob(e))return e.size;if(_1.isSpecCompliantForm(e))return(await new Request(Ze.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(_1.isArrayBufferView(e)||_1.isArrayBuffer(e))return e.byteLength;if(_1.isURLSearchParams(e)&&(e=e+""),_1.isString(e))return(await oY1(e)).byteLength},uY1=async(e,t)=>{const a=_1.toFiniteNumber(e.getContentLength());return a??fY1(t)},dY1=gi&&(async e=>{let{url:t,method:a,data:r,signal:n,cancelToken:c,timeout:i,onDownloadProgress:s,onUploadProgress:l,responseType:f,headers:u,withCredentials:d="same-origin",fetchOptions:h}=QA(e);f=f?(f+"").toLowerCase():"text";let m=nY1([n,c&&c.toAbortSignal()],i),v;const p=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let g;try{if(l&&lY1&&a!=="get"&&a!=="head"&&(g=await uY1(u,r))!==0){let M=new Request(t,{method:"POST",body:r,duplex:"half"}),w;if(_1.isFormData(r)&&(w=M.headers.get("content-type"))&&u.setContentType(w),M.body){const[z,k]=zp(g,a5(wp(l)));r=kp(M.body,Hp,z,k)}}_1.isString(d)||(d=d?"include":"omit");const y="credentials"in Request.prototype;v=new Request(t,{...h,signal:m,method:a.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:y?d:void 0});let x=await fetch(v);const C=ao&&(f==="stream"||f==="response");if(ao&&(s||C&&p)){const M={};["status","statusText","headers"].forEach(S=>{M[S]=x[S]});const w=_1.toFiniteNumber(x.headers.get("content-length")),[z,k]=s&&zp(w,a5(wp(s),!0))||[];x=new Response(kp(x.body,Hp,z,()=>{k&&k(),p&&p()}),M)}f=f||"text";let b=await r5[_1.findKey(r5,f)||"text"](x,e);return!C&&p&&p(),await new Promise((M,w)=>{KA(M,w,{data:b,headers:d4.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:v})})}catch(y){throw p&&p(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new t2("Network Error",t2.ERR_NETWORK,e,v),{cause:y.cause||y}):t2.from(y,y&&y.code,e,v)}}),ro={http:_j1,xhr:aY1,fetch:dY1};_1.forEach(ro,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Vp=e=>`- ${e}`,hY1=e=>_1.isFunction(e)||e===null||e===!1,tT={getAdapter:e=>{e=_1.isArray(e)?e:[e];const{length:t}=e;let a,r;const n={};for(let c=0;c<t;c++){a=e[c];let i;if(r=a,!hY1(a)&&(r=ro[(i=String(a)).toLowerCase()],r===void 0))throw new t2(`Unknown adapter '${i}'`);if(r)break;n[i||"#"+c]=r}if(!r){const c=Object.entries(n).map(([s,l])=>`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=t?c.length>1?`since :
|
|
876
876
|
`+c.map(Vp).join(`
|
|
877
877
|
`):" "+Vp(c[0]):"as no adapter specified";throw new t2("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:ro};function Ls(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ca(null,e)}function Lp(e){return Ls(e),e.headers=d4.from(e.headers),e.data=Vs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tT.getAdapter(e.adapter||Hf.adapter)(e).then(function(r){return Ls(e),r.data=Vs.call(e,e.transformResponse,r),r.headers=d4.from(r.headers),r},function(r){return XA(r)||(Ls(e),r&&r.response&&(r.response.data=Vs.call(e,e.transformResponse,r.response),r.response.headers=d4.from(r.response.headers))),Promise.reject(r)})}const aT="1.7.8",yi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{yi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Sp={};yi.transitional=function(t,a,r){function n(c,i){return"[Axios v"+aT+"] Transitional option '"+c+"'"+i+(r?". "+r:"")}return(c,i,s)=>{if(t===!1)throw new t2(n(i," has been removed"+(a?" in "+a:"")),t2.ERR_DEPRECATED);return a&&!Sp[i]&&(Sp[i]=!0,console.warn(n(i," has been deprecated since v"+a+" and will be removed in the near future"))),t?t(c,i,s):!0}};yi.spelling=function(t){return(a,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function mY1(e,t,a){if(typeof e!="object")throw new t2("options must be an object",t2.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const c=r[n],i=t[c];if(i){const s=e[c],l=s===void 0||i(s,c,e);if(l!==!0)throw new t2("option "+c+" must be "+l,t2.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new t2("Unknown option "+c,t2.ERR_BAD_OPTION)}}const cc={assertOptions:mY1,validators:yi},w4=cc.validators;class n5{constructor(t){this.defaults=t,this.interceptors={request:new Cp,response:new Cp}}async request(t,a){try{return await this._request(t,a)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const c=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?c&&!String(r.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
878
|
-
`+c):r.stack=c}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=f6(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:c}=a;r!==void 0&&cc.assertOptions(r,{silentJSONParsing:w4.transitional(w4.boolean),forcedJSONParsing:w4.transitional(w4.boolean),clarifyTimeoutError:w4.transitional(w4.boolean)},!1),n!=null&&(_1.isFunction(n)?a.paramsSerializer={serialize:n}:cc.assertOptions(n,{encode:w4.function,serialize:w4.function},!0)),cc.assertOptions(a,{baseUrl:w4.spelling("baseURL"),withXsrfToken:w4.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let i=c&&_1.merge(c.common,c[a.method]);c&&_1.forEach(["delete","get","head","post","put","patch","common"],v=>{delete c[v]}),a.headers=d4.concat(i,c);const s=[];let l=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(a)===!1||(l=l&&p.synchronous,s.unshift(p.fulfilled,p.rejected))});const f=[];this.interceptors.response.forEach(function(p){f.push(p.fulfilled,p.rejected)});let u,d=0,h;if(!l){const v=[Lp.bind(this),void 0];for(v.unshift.apply(v,s),v.push.apply(v,f),h=v.length,u=Promise.resolve(a);d<h;)u=u.then(v[d++],v[d++]);return u}h=s.length;let m=a;for(d=0;d<h;){const v=s[d++],p=s[d++];try{m=v(m)}catch(g){p.call(this,g);break}}try{u=Lp.call(this,m)}catch(v){return Promise.reject(v)}for(d=0,h=f.length;d<h;)u=u.then(f[d++],f[d++]);return u}getUri(t){t=f6(this.defaults,t);const a=ZA(t.baseURL,t.url);return jA(a,t.params,t.paramsSerializer)}}_1.forEach(["delete","get","head","options"],function(t){n5.prototype[t]=function(a,r){return this.request(f6(r||{},{method:t,url:a,data:(r||{}).data}))}});_1.forEach(["post","put","patch"],function(t){function a(r){return function(c,i,s){return this.request(f6(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:i}))}}n5.prototype[t]=a(),n5.prototype[t+"Form"]=a(!0)});const ic=n5;class Vf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(c){a=c});const r=this;this.promise.then(n=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](n);r._listeners=null}),this.promise.then=n=>{let c;const i=new Promise(s=>{r.subscribe(s),c=s}).then(n);return i.cancel=function(){r.unsubscribe(c)},i},t(function(c,i,s){r.reason||(r.reason=new Ca(c,i,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new Vf(function(n){t=n}),cancel:t}}}const pY1=Vf;function vY1(e){return function(a){return e.apply(null,a)}}function gY1(e){return _1.isObject(e)&&e.isAxiosError===!0}const no={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(no).forEach(([e,t])=>{no[t]=e});const yY1=no;function rT(e){const t=new ic(e),a=NA(ic.prototype.request,t);return _1.extend(a,ic.prototype,t,{allOwnKeys:!0}),_1.extend(a,t,null,{allOwnKeys:!0}),a.create=function(n){return rT(f6(e,n))},a}const we=rT(Hf);we.Axios=ic;we.CanceledError=Ca;we.CancelToken=pY1;we.isCancel=XA;we.VERSION=aT;we.toFormData=pi;we.AxiosError=t2;we.Cancel=we.CanceledError;we.all=function(t){return Promise.all(t)};we.spread=vY1;we.isAxiosError=gY1;we.mergeConfig=f6;we.AxiosHeaders=d4;we.formToJSON=e=>GA(_1.isHTMLForm(e)?new FormData(e):e);we.getAdapter=tT.getAdapter;we.HttpStatusCode=yY1;we.default=we;const Ua=we;function xY1(e,t,a,r){if(e==="get")return Ua.get(t,{params:a,...r});if(e==="post")return Ua.post(t,a,r);if(e==="put")return Ua.put(t,a,r);if(e==="patch")return Ua.patch(t,a,r);if(e==="delete")return Ua.delete(t,{data:a,...r})}function bY1(e,t){return e?Array.isArray(t)?t.map(a=>new e(a)):new e(t):t}const O8=_2("apiConnectionsError");function CY1(e){var r,n,c;const t=(c=(n=(r=e.response)==null?void 0:r.data)==null?void 0:n.error)==null?void 0:c.errorCode;if(!t){E4("danger",()=>O8("INTERNAL_SERVER_ERROR"));return}const a=re.getConfig();if(a.i18n.apiConnectionsError(t)){E4("danger",()=>a.i18n.apiConnectionsError(t));return}if(O8(t)){E4("danger",()=>O8(t));return}E4("danger",()=>O8("INTERNAL_SERVER_ERROR"))}const Ap=_2("apiConnectionsSuccess");function MY1(e){const t=re.getConfig();if(t.i18n.apiConnectionsSuccess(e)){E4("success",()=>t.i18n.apiConnectionsSuccess(e));return}Ap(e)&&E4("success",()=>Ap(e))}function zY1(e){const t=new FormData;return Object.entries(e).forEach(([a,r])=>{Array.isArray(r)?r.forEach(n=>{t.append(a,n)}):t.append(a,r)}),t}function wY1(e){var r;const t={...(r=e.getCustomHeaders)==null?void 0:r.call(e),"x-language":h4().language};e.basicAuth||(t.Authorization=`Bearer ${Dp()||""}`);const a={headers:t};return e.basicAuth&&(a.auth=e.basicAuth),a}async function Pt(e,t,a,r,n,c){var i;try{c!=null&&c.isLoadingRef&&!(c!=null&&c.preventSetIsLoadingRef)&&(c.isLoadingRef.value=!0);const s=re.getConfig().backendUrl,l=(i=a.meta)!=null&&i.sendAsFormData?zY1(r):r,f=wY1({basicAuth:c==null?void 0:c.basicAuth,getCustomHeaders:n==null?void 0:n.getCustomHeaders}),u=await xY1(e,`${s}/${t}`,l,f),d=bY1(a.response,u.data.data);return((c==null?void 0:c.displaySuccess)!==void 0?c.displaySuccess:e!=="get")&&MY1(u.data.successCode),c!=null&&c.success&&c.success(d,u.data.totalCount),{data:d,totalCount:u.data.totalCount}}catch(s){if(c!=null&&c.preventDisplayError||CY1(s),c!=null&&c.error&&c.error(s),c!=null&&c.preventThrowError)return{data:null,totalCount:void 0};throw s}finally{c!=null&&c.isLoadingRef&&(c.isLoadingRef.value=!1),c!=null&&c.finally&&c.finally()}}function Ss(e,t){return t?`${e}/${t}`:e}function A6(e,t){return e?Array.isArray(t)?t.map(a=>new e(a)):new e(t):t}function _Y1(e,t){return{getOne(a,r,n,c){const i=e[a].getOne,s=Ss(a,r),l=A6(i.params,n);return Pt("get",s,i,l,t,c)},getMany(a,r,n){const c=e[a].getMany,i=A6(c.params,r);return Pt("get",a,c,i,t,n)},postOne(a,r,n){const c=e[a].postOne,i=A6(c.params,r);return Pt("post",a,c,i,t,n)},postMany(a,r,n){const c=e[a].postMany,i=A6(c.params,r);return Pt("post",a,c,i,t,n)},putOne(a,r,n,c){const i=e[a].putOne,s=Ss(a,r),l=A6(i.params,n);return Pt("put",s,i,l,t,c)},putMany(a,r,n){const c=e[a].putMany,i=A6(c.params,r);return Pt("put",a,c,i,t,n)},deleteOne(a,r,n){const c=e[a].deleteOne,i=Ss(a,r);return Pt("delete",i,c,void 0,t,n)},deleteMany(a,r,n){const c=e[a].deleteMany;return Pt("delete",a,c,r,t,n)}}}class xi{constructor(t){v1(this,"id",0);v1(this,"createdAt",new Date);v1(this,"updatedAt",new Date);v1(this,"deletedAt",null);xi.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}class hn extends xi{constructor(a){super(a);v1(this,"username","");hn.CopyFields(this,a)}}class kY1{constructor(t){v1(this,"accessToken","");v1(this,"user",new hn);xn(this,t,{user:hn})}}class L3{constructor(t){L3.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}class HY1 extends L3{constructor(a){super(a);v1(this,"page");v1(this,"pageSize");v1(this,"search");L3.CopyFields(this,a)}}class VY1 extends L3{constructor(t){super(t),L3.CopyFields(this,t)}}class LY1 extends L3{constructor(a){super(a);v1(this,"index",0);L3.CopyFields(this,a)}}class SY1 extends L3{constructor(a){super(a);v1(this,"image");L3.CopyFields(this,a)}}class AY1 extends L3{constructor(a){super(a);v1(this,"images");L3.CopyFields(this,a)}}class Lf{constructor(t){Lf.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}function TY1(e,t,a){return a||{top:0}}async function EY1(e,t,a){if(t.name&&t.name===e.name){a();return}const r=re.getConfig().routerHelpers;if(!r.validateRouteAccess(e.meta.access)){a({name:r.getDefaultRouteName(e)});return}a()}async function NY1(e){x4().currentRoute=e,DY1(e.name),OY1()}function DY1(e){const t=x4().routeType;document.title=`${bn(t,e)} | ${re.getConfig().appName}`}async function OY1(){const e=re.getConfig(),t=e.routerHelpers;if(await Pp(),!t.validateRouteAccess(x4().routeAccess)){e.router.push({name:t.getDefaultRouteName()});return}}function PY1(e){const t=Vr.createRouter({history:Vr.createWebHistory(),routes:e,scrollBehavior:TY1});return t.beforeEach(EY1),t.afterEach(NY1),t}function BY1(e,t,a){const r=I4.createPinia();r.use(pF({storage:localStorage})),e.use(r),e.use(t.router),e.use(Mg),e.use(gR,yR),re.init(t),Rv(a==null?void 0:a.appOptions),h4().init(a==null?void 0:a.appOptionsStore);const n={...n71,...a==null?void 0:a.components};Object.entries(n).forEach(([c,i])=>e.component(c,i))}exports.App=lF;exports.AuthUser=kY1;exports.BaseParams=L3;exports.BaseResponse=Lf;exports.DatabaseDefault=xi;exports.GetManyBaseParams=HY1;exports.RemoveImageParams=VY1;exports.RemoveImagesParams=LY1;exports.UploadImageParams=SY1;exports.UploadImagesParams=AY1;exports.User=hn;exports.addNotification=E4;exports.animateElement=lT;exports.clearNotifications=$v;exports.copyModelFields=xn;exports.createApiConnections=_Y1;exports.createI18n=Fp;exports.createRouter=PY1;exports.default=BY1;exports.displayAlert=Kg;exports.getAccessToken=Dp;exports.getAppOptions=$e;exports.getDateStr=Ts;exports.getDatetimeStr=m4;exports.getDomain=Ao;exports.getEnvironment=So;exports.getFinalValue=Fe;exports.getIsSmallDevice=pc;exports.getLayouts=XO;exports.getMonthStr=HT;exports.getNavigationSectionsToDisplay=Lo;exports.getNumberStr=Ds;exports.getNumericDateStr=Wa;exports.getRandomColorSelectorColor=fT;exports.getRouteTitle=bn;exports.getRouteType=Bv;exports.getRoutesByNavigationSection=v5;exports.getRoutesToDisplay=Vo;exports.getSubdomain=GO;exports.getTimeStr=lc;exports.greaterEqualRule=n11;exports.greaterThanRule=c11;exports.idRequiredRule=a11;exports.initAppOptions=Rv;exports.integerRule=r11;exports.isAValidId=KO;exports.isColorTemplateVariable=mn;exports.isMobileDevice=ZO;exports.lessEqualRule=i11;exports.lessThanRule=s11;exports.login=Op;exports.logout=oT;exports.maxLengthRule=E7;exports.minLengthRule=T7;exports.removeHtmlTags=jp;exports.removeNotification=Eo;exports.requiredRule=A7;exports.rgba=Bp;exports.sanitizeHtml=YT;exports.scrollToTop=Fv;exports.setBodyOverflow=oc;exports.setColorProperties=To;exports.setColorRootProperties=As;exports.setLayoutProperties=Iv;exports.setRootProperty=sc;exports.useAppOptionsStore=h4;exports.useElementPosition=tM;exports.useRouteStore=x4;exports.useScrollListener=al;exports.validateAccessToken=Pp;
|
|
878
|
+
`+c):r.stack=c}catch{}}throw r}}_request(t,a){typeof t=="string"?(a=a||{},a.url=t):a=t||{},a=f6(this.defaults,a);const{transitional:r,paramsSerializer:n,headers:c}=a;r!==void 0&&cc.assertOptions(r,{silentJSONParsing:w4.transitional(w4.boolean),forcedJSONParsing:w4.transitional(w4.boolean),clarifyTimeoutError:w4.transitional(w4.boolean)},!1),n!=null&&(_1.isFunction(n)?a.paramsSerializer={serialize:n}:cc.assertOptions(n,{encode:w4.function,serialize:w4.function},!0)),cc.assertOptions(a,{baseUrl:w4.spelling("baseURL"),withXsrfToken:w4.spelling("withXSRFToken")},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase();let i=c&&_1.merge(c.common,c[a.method]);c&&_1.forEach(["delete","get","head","post","put","patch","common"],v=>{delete c[v]}),a.headers=d4.concat(i,c);const s=[];let l=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(a)===!1||(l=l&&p.synchronous,s.unshift(p.fulfilled,p.rejected))});const f=[];this.interceptors.response.forEach(function(p){f.push(p.fulfilled,p.rejected)});let u,d=0,h;if(!l){const v=[Lp.bind(this),void 0];for(v.unshift.apply(v,s),v.push.apply(v,f),h=v.length,u=Promise.resolve(a);d<h;)u=u.then(v[d++],v[d++]);return u}h=s.length;let m=a;for(d=0;d<h;){const v=s[d++],p=s[d++];try{m=v(m)}catch(g){p.call(this,g);break}}try{u=Lp.call(this,m)}catch(v){return Promise.reject(v)}for(d=0,h=f.length;d<h;)u=u.then(f[d++],f[d++]);return u}getUri(t){t=f6(this.defaults,t);const a=ZA(t.baseURL,t.url);return jA(a,t.params,t.paramsSerializer)}}_1.forEach(["delete","get","head","options"],function(t){n5.prototype[t]=function(a,r){return this.request(f6(r||{},{method:t,url:a,data:(r||{}).data}))}});_1.forEach(["post","put","patch"],function(t){function a(r){return function(c,i,s){return this.request(f6(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:i}))}}n5.prototype[t]=a(),n5.prototype[t+"Form"]=a(!0)});const ic=n5;class Vf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(c){a=c});const r=this;this.promise.then(n=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](n);r._listeners=null}),this.promise.then=n=>{let c;const i=new Promise(s=>{r.subscribe(s),c=s}).then(n);return i.cancel=function(){r.unsubscribe(c)},i},t(function(c,i,s){r.reason||(r.reason=new Ca(c,i,s),a(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const a=this._listeners.indexOf(t);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const t=new AbortController,a=r=>{t.abort(r)};return this.subscribe(a),t.signal.unsubscribe=()=>this.unsubscribe(a),t.signal}static source(){let t;return{token:new Vf(function(n){t=n}),cancel:t}}}const pY1=Vf;function vY1(e){return function(a){return e.apply(null,a)}}function gY1(e){return _1.isObject(e)&&e.isAxiosError===!0}const no={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(no).forEach(([e,t])=>{no[t]=e});const yY1=no;function rT(e){const t=new ic(e),a=NA(ic.prototype.request,t);return _1.extend(a,ic.prototype,t,{allOwnKeys:!0}),_1.extend(a,t,null,{allOwnKeys:!0}),a.create=function(n){return rT(f6(e,n))},a}const we=rT(Hf);we.Axios=ic;we.CanceledError=Ca;we.CancelToken=pY1;we.isCancel=XA;we.VERSION=aT;we.toFormData=pi;we.AxiosError=t2;we.Cancel=we.CanceledError;we.all=function(t){return Promise.all(t)};we.spread=vY1;we.isAxiosError=gY1;we.mergeConfig=f6;we.AxiosHeaders=d4;we.formToJSON=e=>GA(_1.isHTMLForm(e)?new FormData(e):e);we.getAdapter=tT.getAdapter;we.HttpStatusCode=yY1;we.default=we;const Ua=we;function xY1(e,t,a,r){if(e==="get")return Ua.get(t,{params:a,...r});if(e==="post")return Ua.post(t,a,r);if(e==="put")return Ua.put(t,a,r);if(e==="patch")return Ua.patch(t,a,r);if(e==="delete")return Ua.delete(t,{data:a,...r})}function bY1(e,t){return e?Array.isArray(t)?t.map(a=>new e(a)):new e(t):t}const O8=_2("apiConnectionsError");function CY1(e){var r,n,c;const t=(c=(n=(r=e.response)==null?void 0:r.data)==null?void 0:n.error)==null?void 0:c.errorCode;if(!t){E4("danger",()=>O8("INTERNAL_SERVER_ERROR"));return}const a=re.getConfig();if(a.i18n.apiConnectionsError(t)){E4("danger",()=>a.i18n.apiConnectionsError(t));return}if(O8(t)){E4("danger",()=>O8(t));return}E4("danger",()=>O8("INTERNAL_SERVER_ERROR"))}const Ap=_2("apiConnectionsSuccess");function MY1(e){const t=re.getConfig();if(t.i18n.apiConnectionsSuccess(e)){E4("success",()=>t.i18n.apiConnectionsSuccess(e));return}Ap(e)&&E4("success",()=>Ap(e))}function zY1(e){const t=new FormData;return Object.entries(e).forEach(([a,r])=>{Array.isArray(r)?r.forEach(n=>{t.append(a,n)}):t.append(a,r)}),t}function wY1(e,t){var n;const a={...(n=t.getCustomHeaders)==null?void 0:n.call(t),"x-app-version":e,"x-language":h4().language};t.basicAuth||(a.Authorization=`Bearer ${Dp()||""}`);const r={headers:a};return t.basicAuth&&(r.auth=t.basicAuth),r}async function Pt(e,t,a,r,n,c,i={}){var m,v,p,g;const{getCustomHeaders:s}=c||{},{success:l,error:f,preventDisplayError:u,isLoadingRef:d,basicAuth:h}=i;try{d&&(d.value=!0);const y=re.getConfig().backendUrl,x=(m=a.meta)!=null&&m.sendAsFormData?zY1(r):r,C=wY1(n,{basicAuth:h,getCustomHeaders:s}),b=await xY1(e,`${y}/${t}`,x,C),M=bY1(a.response,b.data.data);return e!=="get"&&MY1(b.data.successCode),l&&l(M,b.data.totalCount),{data:M,totalCount:b.data.totalCount}}catch(y){throw((g=(p=(v=y.response)==null?void 0:v.data)==null?void 0:p.error)==null?void 0:g.errorCode)==="APP_VERSION_MISMATCH"&&window.location.reload(),u||CY1(y),f&&f(y),y}finally{d&&(d.value=!1)}}function Ss(e,t){return t?`${e}/${t}`:e}function A6(e,t){return e?Array.isArray(t)?t.map(a=>new e(a)):new e(t):t}function _Y1(e,t,a){return{getOne(r,n,c,i){const s=Ss(r,n),l=e[r].getOne,f=A6(l.params,c);return Pt("get",s,l,f,t,a,i)},getMany(r,n,c){const i=e[r].getMany,s=A6(i.params,n);return Pt("get",r,i,s,t,a,c)},postOne(r,n,c){const i=e[r].postOne,s=A6(i.params,n);return Pt("post",r,i,s,t,a,c)},postMany(r,n,c){const i=e[r].postMany,s=A6(i.params,n);return Pt("post",r,i,s,t,a,c)},putOne(r,n,c,i){const s=Ss(r,n),l=e[r].putOne,f=A6(l.params,c);return Pt("put",s,l,f,t,a,i)},putMany(r,n,c){const i=e[r].putMany,s=A6(i.params,n);return Pt("put",r,i,s,t,a,c)},deleteOne(r,n,c){const i=Ss(r,n),s=e[r].deleteOne;return Pt("delete",i,s,void 0,t,a,c)},deleteMany(r,n,c){const i=e[r].deleteMany;return Pt("delete",r,i,n,t,a,c)}}}class xi{constructor(t){v1(this,"id",0);v1(this,"createdAt",new Date);v1(this,"updatedAt",new Date);v1(this,"deletedAt",null);xi.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}class hn extends xi{constructor(a){super(a);v1(this,"username","");hn.CopyFields(this,a)}}class kY1{constructor(t){v1(this,"accessToken","");v1(this,"user",new hn);xn(this,t,{user:hn})}}class L3{constructor(t){L3.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}class HY1 extends L3{constructor(a){super(a);v1(this,"page");v1(this,"pageSize");v1(this,"search");L3.CopyFields(this,a)}}class VY1 extends L3{constructor(t){super(t),L3.CopyFields(this,t)}}class LY1 extends L3{constructor(a){super(a);v1(this,"index",0);L3.CopyFields(this,a)}}class SY1 extends L3{constructor(a){super(a);v1(this,"image");L3.CopyFields(this,a)}}class AY1 extends L3{constructor(a){super(a);v1(this,"images");L3.CopyFields(this,a)}}class Lf{constructor(t){Lf.CopyFields(this,t)}static CopyFields(t,a,r){xn(t,a,r)}}function TY1(e,t,a){return a||{top:0}}async function EY1(e,t,a){if(t.name&&t.name===e.name){a();return}const r=re.getConfig().routerHelpers;if(!r.validateRouteAccess(e.meta.access)){a({name:r.getDefaultRouteName(e)});return}a()}async function NY1(e){x4().currentRoute=e,DY1(e.name),OY1()}function DY1(e){const t=x4().routeType;document.title=`${bn(t,e)} | ${re.getConfig().appName}`}async function OY1(){const e=re.getConfig(),t=e.routerHelpers;if(await Pp(),!t.validateRouteAccess(x4().routeAccess)){e.router.push({name:t.getDefaultRouteName()});return}}function PY1(e){const t=Vr.createRouter({history:Vr.createWebHistory(),routes:e,scrollBehavior:TY1});return t.beforeEach(EY1),t.afterEach(NY1),t}function BY1(e,t,a){const r=I4.createPinia();r.use(pF({storage:localStorage})),e.use(r),e.use(t.router),e.use(Mg),e.use(gR,yR),re.init(t),Rv(a==null?void 0:a.appOptions),h4().init(a==null?void 0:a.appOptionsStore);const n={...n71,...a==null?void 0:a.components};Object.entries(n).forEach(([c,i])=>e.component(c,i))}exports.App=lF;exports.AuthUser=kY1;exports.BaseParams=L3;exports.BaseResponse=Lf;exports.DatabaseDefault=xi;exports.GetManyBaseParams=HY1;exports.RemoveImageParams=VY1;exports.RemoveImagesParams=LY1;exports.UploadImageParams=SY1;exports.UploadImagesParams=AY1;exports.User=hn;exports.addNotification=E4;exports.animateElement=lT;exports.clearNotifications=$v;exports.copyModelFields=xn;exports.createApiConnections=_Y1;exports.createI18n=Fp;exports.createRouter=PY1;exports.default=BY1;exports.displayAlert=Kg;exports.getAccessToken=Dp;exports.getAppOptions=$e;exports.getDateStr=Ts;exports.getDatetimeStr=m4;exports.getDomain=Ao;exports.getEnvironment=So;exports.getFinalValue=Fe;exports.getIsSmallDevice=pc;exports.getLayouts=XO;exports.getMonthStr=HT;exports.getNavigationSectionsToDisplay=Lo;exports.getNumberStr=Ds;exports.getNumericDateStr=Wa;exports.getRandomColorSelectorColor=fT;exports.getRouteTitle=bn;exports.getRouteType=Bv;exports.getRoutesByNavigationSection=v5;exports.getRoutesToDisplay=Vo;exports.getSubdomain=GO;exports.getTimeStr=lc;exports.greaterEqualRule=n11;exports.greaterThanRule=c11;exports.idRequiredRule=a11;exports.initAppOptions=Rv;exports.integerRule=r11;exports.isAValidId=KO;exports.isColorTemplateVariable=mn;exports.isMobileDevice=ZO;exports.lessEqualRule=i11;exports.lessThanRule=s11;exports.login=Op;exports.logout=oT;exports.maxLengthRule=E7;exports.minLengthRule=T7;exports.removeHtmlTags=jp;exports.removeNotification=Eo;exports.requiredRule=A7;exports.rgba=Bp;exports.sanitizeHtml=YT;exports.scrollToTop=Fv;exports.setBodyOverflow=oc;exports.setColorProperties=To;exports.setColorRootProperties=As;exports.setLayoutProperties=Iv;exports.setRootProperty=sc;exports.useAppOptionsStore=h4;exports.useElementPosition=tM;exports.useRouteStore=x4;exports.useScrollListener=al;exports.validateAccessToken=Pp;
|
package/dist/main.es.js
CHANGED
|
@@ -77960,28 +77960,28 @@ function CG1(e) {
|
|
|
77960
77960
|
}) : t.append(a, r);
|
|
77961
77961
|
}), t;
|
|
77962
77962
|
}
|
|
77963
|
-
function MG1(e) {
|
|
77964
|
-
var
|
|
77965
|
-
const
|
|
77966
|
-
|
|
77967
|
-
|
|
77968
|
-
|
|
77963
|
+
function MG1(e, t) {
|
|
77964
|
+
var n;
|
|
77965
|
+
const a = {
|
|
77966
|
+
...(n = t.getCustomHeaders) == null ? void 0 : n.call(t),
|
|
77967
|
+
"x-app-version": e,
|
|
77968
|
+
"x-language": mt().language
|
|
77969
|
+
};
|
|
77970
|
+
t.basicAuth || (a.Authorization = `Bearer ${lE() || ""}`);
|
|
77971
|
+
const r = { headers: a };
|
|
77972
|
+
return t.basicAuth && (r.auth = t.basicAuth), r;
|
|
77969
77973
|
}
|
|
77970
|
-
async function m0(e, t, a, r, n, i) {
|
|
77971
|
-
var
|
|
77974
|
+
async function m0(e, t, a, r, n, i, c = {}) {
|
|
77975
|
+
var d, p, m, v;
|
|
77976
|
+
const { getCustomHeaders: s } = i || {}, { success: o, error: l, preventDisplayError: f, isLoadingRef: u, basicAuth: h } = c;
|
|
77972
77977
|
try {
|
|
77973
|
-
|
|
77974
|
-
const
|
|
77975
|
-
|
|
77976
|
-
|
|
77977
|
-
|
|
77978
|
-
return ((i == null ? void 0 : i.displaySuccess) !== void 0 ? i.displaySuccess : e !== "get") && bG1(f.data.successCode), i != null && i.success && i.success(u, f.data.totalCount), { data: u, totalCount: f.data.totalCount };
|
|
77979
|
-
} catch (s) {
|
|
77980
|
-
if (i != null && i.preventDisplayError || xG1(s), i != null && i.error && i.error(s), i != null && i.preventThrowError)
|
|
77981
|
-
return { data: null, totalCount: void 0 };
|
|
77982
|
-
throw s;
|
|
77978
|
+
u && (u.value = !0);
|
|
77979
|
+
const g = we.getConfig().backendUrl, y = (d = a.meta) != null && d.sendAsFormData ? CG1(r) : r, b = MG1(n, { basicAuth: h, getCustomHeaders: s }), x = await gG1(e, `${g}/${t}`, y, b), C = yG1(a.response, x.data.data);
|
|
77980
|
+
return e !== "get" && bG1(x.data.successCode), o && o(C, x.data.totalCount), { data: C, totalCount: x.data.totalCount };
|
|
77981
|
+
} catch (g) {
|
|
77982
|
+
throw ((v = (m = (p = g.response) == null ? void 0 : p.data) == null ? void 0 : m.error) == null ? void 0 : v.errorCode) === "APP_VERSION_MISMATCH" && window.location.reload(), f || xG1(g), l && l(g), g;
|
|
77983
77983
|
} finally {
|
|
77984
|
-
|
|
77984
|
+
u && (u.value = !1);
|
|
77985
77985
|
}
|
|
77986
77986
|
}
|
|
77987
77987
|
function u7(e, t) {
|
|
@@ -77990,39 +77990,71 @@ function u7(e, t) {
|
|
|
77990
77990
|
function ua(e, t) {
|
|
77991
77991
|
return e ? Array.isArray(t) ? t.map((a) => new e(a)) : new e(t) : t;
|
|
77992
77992
|
}
|
|
77993
|
-
function GG1(e, t) {
|
|
77993
|
+
function GG1(e, t, a) {
|
|
77994
77994
|
return {
|
|
77995
|
-
getOne(
|
|
77996
|
-
const
|
|
77997
|
-
return m0("get", s,
|
|
77995
|
+
getOne(r, n, i, c) {
|
|
77996
|
+
const s = u7(r, n), o = e[r].getOne, l = ua(o.params, i);
|
|
77997
|
+
return m0("get", s, o, l, t, a, c);
|
|
77998
77998
|
},
|
|
77999
|
-
getMany(
|
|
78000
|
-
const
|
|
78001
|
-
return m0(
|
|
77999
|
+
getMany(r, n, i) {
|
|
78000
|
+
const c = e[r].getMany, s = ua(c.params, n);
|
|
78001
|
+
return m0(
|
|
78002
|
+
"get",
|
|
78003
|
+
r,
|
|
78004
|
+
c,
|
|
78005
|
+
s,
|
|
78006
|
+
t,
|
|
78007
|
+
a,
|
|
78008
|
+
i
|
|
78009
|
+
);
|
|
78002
78010
|
},
|
|
78003
|
-
postOne(
|
|
78004
|
-
const
|
|
78005
|
-
return m0(
|
|
78011
|
+
postOne(r, n, i) {
|
|
78012
|
+
const c = e[r].postOne, s = ua(c.params, n);
|
|
78013
|
+
return m0(
|
|
78014
|
+
"post",
|
|
78015
|
+
r,
|
|
78016
|
+
c,
|
|
78017
|
+
s,
|
|
78018
|
+
t,
|
|
78019
|
+
a,
|
|
78020
|
+
i
|
|
78021
|
+
);
|
|
78006
78022
|
},
|
|
78007
|
-
postMany(
|
|
78008
|
-
const
|
|
78009
|
-
return m0(
|
|
78023
|
+
postMany(r, n, i) {
|
|
78024
|
+
const c = e[r].postMany, s = ua(c.params, n);
|
|
78025
|
+
return m0(
|
|
78026
|
+
"post",
|
|
78027
|
+
r,
|
|
78028
|
+
c,
|
|
78029
|
+
s,
|
|
78030
|
+
t,
|
|
78031
|
+
a,
|
|
78032
|
+
i
|
|
78033
|
+
);
|
|
78010
78034
|
},
|
|
78011
|
-
putOne(
|
|
78012
|
-
const
|
|
78013
|
-
return m0("put", s,
|
|
78035
|
+
putOne(r, n, i, c) {
|
|
78036
|
+
const s = u7(r, n), o = e[r].putOne, l = ua(o.params, i);
|
|
78037
|
+
return m0("put", s, o, l, t, a, c);
|
|
78014
78038
|
},
|
|
78015
|
-
putMany(
|
|
78016
|
-
const
|
|
78017
|
-
return m0(
|
|
78039
|
+
putMany(r, n, i) {
|
|
78040
|
+
const c = e[r].putMany, s = ua(c.params, n);
|
|
78041
|
+
return m0(
|
|
78042
|
+
"put",
|
|
78043
|
+
r,
|
|
78044
|
+
c,
|
|
78045
|
+
s,
|
|
78046
|
+
t,
|
|
78047
|
+
a,
|
|
78048
|
+
i
|
|
78049
|
+
);
|
|
78018
78050
|
},
|
|
78019
|
-
deleteOne(
|
|
78020
|
-
const
|
|
78021
|
-
return m0("delete", c,
|
|
78051
|
+
deleteOne(r, n, i) {
|
|
78052
|
+
const c = u7(r, n), s = e[r].deleteOne;
|
|
78053
|
+
return m0("delete", c, s, void 0, t, a, i);
|
|
78022
78054
|
},
|
|
78023
|
-
deleteMany(
|
|
78024
|
-
const
|
|
78025
|
-
return m0("delete",
|
|
78055
|
+
deleteMany(r, n, i) {
|
|
78056
|
+
const c = e[r].deleteMany;
|
|
78057
|
+
return m0("delete", r, c, n, t, a, i);
|
|
78026
78058
|
}
|
|
78027
78059
|
};
|
|
78028
78060
|
}
|
|
@@ -2,7 +2,7 @@ import { Arrayify } from 'pangea-helpers';
|
|
|
2
2
|
import { Id } from '../types';
|
|
3
3
|
import { ApiConfig, ApiEndpoints, ApiEndpointName, ApiEndpointParams, ApiEndpointResponse, ApiConnectionsConfig } from '../types/api-connections.types';
|
|
4
4
|
|
|
5
|
-
export declare function createApiConnections<AE extends ApiEndpoints>(endpoints: AE, apiConnectionsConfig?: ApiConnectionsConfig): {
|
|
5
|
+
export declare function createApiConnections<AE extends ApiEndpoints>(endpoints: AE, appVersion: string, apiConnectionsConfig?: ApiConnectionsConfig): {
|
|
6
6
|
getOne<T extends ApiEndpointName<AE, "getOne">>(url: T, id?: Id, params?: ApiEndpointParams<AE, T, "getOne">, apiConfig?: ApiConfig<ApiEndpointResponse<AE, T, "getOne">>): Promise<{
|
|
7
7
|
data: ApiEndpointResponse<AE, T, "getOne">;
|
|
8
8
|
totalCount: undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlainObject } from 'pangea-helpers';
|
|
2
2
|
import { ApiMethod, ApiConfig, EndpointSettings, ApiConnectionsConfig } from '../../types/api-connections.types';
|
|
3
3
|
|
|
4
|
-
export declare function connectToApi<T extends ApiMethod, SuccessRes, TCount>(method: T, url: string, endpointSettings: EndpointSettings, params: PlainObject | Array<any>, apiConnectionsConfig: ApiConnectionsConfig | undefined, apiConfig?: ApiConfig<SuccessRes, TCount>): Promise<{
|
|
4
|
+
export declare function connectToApi<T extends ApiMethod, SuccessRes, TCount>(method: T, url: string, endpointSettings: EndpointSettings, params: PlainObject | Array<any>, appVersion: string, apiConnectionsConfig: ApiConnectionsConfig | undefined, apiConfig?: ApiConfig<SuccessRes, TCount>): Promise<{
|
|
5
5
|
data: SuccessRes;
|
|
6
6
|
totalCount: TCount;
|
|
7
7
|
}>;
|
|
@@ -5,5 +5,5 @@ type Config = {
|
|
|
5
5
|
basicAuth: AxiosBasicCredentials | undefined;
|
|
6
6
|
getCustomHeaders: GetCustomHeaders | undefined;
|
|
7
7
|
};
|
|
8
|
-
export declare function getRequestConfig(config: Config): AxiosRequestConfig<any>;
|
|
8
|
+
export declare function getRequestConfig(appVersion: string, config: Config): AxiosRequestConfig<any>;
|
|
9
9
|
export {};
|
|
@@ -11,12 +11,8 @@ export type ApiConnectionMethod = 'getOne' | 'getMany' | 'postOne' | 'postMany'
|
|
|
11
11
|
export type ApiConfig<SuccessRes, TCount = undefined> = {
|
|
12
12
|
success?: (data: SuccessRes, totalCount?: TCount) => void;
|
|
13
13
|
error?: (err: AxiosError) => void;
|
|
14
|
-
finally?: () => void;
|
|
15
|
-
displaySuccess?: boolean;
|
|
16
14
|
preventDisplayError?: boolean;
|
|
17
|
-
preventThrowError?: boolean;
|
|
18
15
|
isLoadingRef?: Ref<boolean>;
|
|
19
|
-
preventSetIsLoadingRef?: boolean;
|
|
20
16
|
basicAuth?: AxiosBasicCredentials;
|
|
21
17
|
};
|
|
22
18
|
export type Headers = Record<string, string>;
|