@neuctra/authix 1.2.0 → 1.2.1
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.
|
@@ -1851,7 +1851,7 @@ class li {
|
|
|
1851
1851
|
if (e && e.success) {
|
|
1852
1852
|
if (typeof document < "u") {
|
|
1853
1853
|
const n = (/* @__PURE__ */ new Date(0)).toUTCString();
|
|
1854
|
-
document.cookie = `a_s_b=; path=/;
|
|
1854
|
+
document.cookie = `a_s_b=; path=/; Max-Age=${n}; SameSite=Lax`;
|
|
1855
1855
|
}
|
|
1856
1856
|
return { success: !0 };
|
|
1857
1857
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Ct]=this[Ct]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=Ce(a);s[c]||(on(i,a),s[c]=!0)}return f.isArray(e)?e.forEach(o):o(e),this}};re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),f.reduceDescriptors(re.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),f.freezeMethods(re);function Ge(t,e){const n=this||Te,s=e||n,i=re.from(s.headers);let o=s.data;return f.forEach(t,function(c){o=c.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Pt(t){return!!(t&&t.__CANCEL__)}function be(t,e,n){N.call(this,t??"canceled",N.ERR_CANCELED,e,n),this.name="CanceledError"}f.inherits(be,N,{__CANCEL__:!0});function Ot(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function an(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ln(t,e){t=t||10;const n=new Array(t),s=new Array(t);let i=0,o=0,a;return e=e!==void 0?e:1e3,function(d){const u=Date.now(),x=s[o];a||(a=u),n[i]=d,s[i]=u;let y=o,k=0;for(;y!==i;)k+=n[y++],y=y%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),u-a<e)return;const T=x&&u-x;return T?Math.round(k*1e3/T):void 0}}function cn(t,e){let n=0,s=1e3/e,i,o;const a=(u,x=Date.now())=>{n=x,i=null,o&&(clearTimeout(o),o=null),t(...u)};return[(...u)=>{const x=Date.now(),y=x-n;y>=s?a(u,x):(i=u,o||(o=setTimeout(()=>{o=null,a(i)},s-y)))},()=>i&&a(i)]}const Ue=(t,e,n=3)=>{let s=0;const i=ln(50,250);return cn(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-s,u=i(d),x=a<=c;s=a;const y={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&x?(c-a)/u:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(y)},n)},It=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},_t=t=>(...e)=>f.asap(()=>t(...e)),dn=Z.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Z.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Z.origin),Z.navigator&&/(msie|trident)/i.test(Z.navigator.userAgent)):()=>!0,un=Z.hasStandardBrowserEnv?{write(t,e,n,s,i,o){const a=[t+"="+encodeURIComponent(e)];f.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),f.isString(s)&&a.push("path="+s),f.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Rt(t,e,n){let s=!pn(e);return t&&(s||n==!1)?fn(t,e):e}const zt=t=>t instanceof re?{...t}:t;function xe(t,e){e=e||{};const n={};function s(u,x,y,k){return f.isPlainObject(u)&&f.isPlainObject(x)?f.merge.call({caseless:k},u,x):f.isPlainObject(x)?f.merge({},x):f.isArray(x)?x.slice():x}function i(u,x,y,k){if(f.isUndefined(x)){if(!f.isUndefined(u))return s(void 0,u,y,k)}else return s(u,x,y,k)}function o(u,x){if(!f.isUndefined(x))return s(void 0,x)}function a(u,x){if(f.isUndefined(x)){if(!f.isUndefined(u))return s(void 0,u)}else return s(void 0,x)}function c(u,x,y){if(y in e)return s(u,x);if(y in t)return s(void 0,u)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(u,x,y)=>i(zt(u),zt(x),y,!0)};return f.forEach(Object.keys({...t,...e}),function(x){const y=d[x]||i,k=y(t[x],e[x],x);f.isUndefined(k)&&y!==c||(n[x]=k)}),n}const At=t=>{const e=xe({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=e;if(e.headers=a=re.from(a),e.url=vt(Rt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),f.isFormData(n)){if(Z.hasStandardBrowserEnv||Z.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(f.isFunction(n.getHeaders)){const d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([x,y])=>{u.includes(x.toLowerCase())&&a.set(x,y)})}}if(Z.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==!1&&dn(e.url))){const d=i&&o&&un.read(o);d&&a.set(i,d)}return e},xn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const i=At(t);let o=i.data;const a=re.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=i,x,y,k,T,p;function w(){T&&T(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(x),i.signal&&i.signal.removeEventListener("abort",x)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function I(){if(!h)return;const g=re.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),D={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:g,config:t,request:h};Ot(function(j){n(j),w()},function(j){s(j),w()},D),h=null}"onloadend"in h?h.onloadend=I:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(I)},h.onabort=function(){h&&(s(new N("Request aborted",N.ECONNABORTED,t,h)),h=null)},h.onerror=function(z){const D=z&&z.message?z.message:"Network Error",b=new N(D,N.ERR_NETWORK,t,h);b.event=z||null,s(b),h=null},h.ontimeout=function(){let z=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||kt;i.timeoutErrorMessage&&(z=i.timeoutErrorMessage),s(new N(z,D.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,h)),h=null},o===void 0&&a.setContentType(null),"setRequestHeader"in h&&f.forEach(a.toJSON(),function(z,D){h.setRequestHeader(D,z)}),f.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),u&&([k,p]=Ue(u,!0),h.addEventListener("progress",k)),d&&h.upload&&([y,T]=Ue(d),h.upload.addEventListener("progress",y),h.upload.addEventListener("loadend",T)),(i.cancelToken||i.signal)&&(x=g=>{h&&(s(!g||g.type?new be(null,t,h):g),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(x),i.signal&&(i.signal.aborted?x():i.signal.addEventListener("abort",x)));const C=an(i.url);if(C&&Z.protocols.indexOf(C)===-1){s(new N("Unsupported protocol "+C+":",N.ERR_BAD_REQUEST,t));return}h.send(o||null)})},hn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,i;const o=function(u){if(!i){i=!0,c();const x=u instanceof Error?u:this.reason;s.abort(x instanceof N?x:new be(x instanceof Error?x.message:x))}};let a=e&&setTimeout(()=>{a=null,o(new N(`timeout ${e} of ms exceeded`,N.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:d}=s;return d.unsubscribe=()=>f.asap(c),d}},mn=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,i;for(;s<n;)i=s+e,yield t.slice(s,i),s=i},gn=async function*(t,e){for await(const n of yn(t))yield*mn(n,e)},yn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},$t=(t,e,n,s)=>{const i=gn(t,e);let o=0,a,c=d=>{a||(a=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:u,value:x}=await i.next();if(u){c(),d.close();return}let y=x.byteLength;if(n){let k=o+=y;n(k)}d.enqueue(new Uint8Array(x))}catch(u){throw c(u),u}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},Nt=64*1024,{isFunction:De}=f,bn=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:Ut,TextEncoder:Dt}=f.global,Ft=(t,...e)=>{try{return!!t(...e)}catch{return!1}},wn=t=>{t=f.merge.call({skipUndefined:!0},bn,t);const{fetch:e,Request:n,Response:s}=t,i=e?De(e):typeof fetch=="function",o=De(n),a=De(s);if(!i)return!1;const c=i&&De(Ut),d=i&&(typeof Dt=="function"?(p=>w=>p.encode(w))(new Dt):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=o&&c&&Ft(()=>{let p=!1;const w=new n(Z.origin,{body:new Ut,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!w}),x=a&&c&&Ft(()=>f.isReadableStream(new s("").body)),y={stream:x&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!y[p]&&(y[p]=(w,h)=>{let I=w&&w[p];if(I)return I.call(w);throw new N(`Response type '${p}' is not supported`,N.ERR_NOT_SUPPORT,h)})});const k=async p=>{if(p==null)return 0;if(f.isBlob(p))return p.size;if(f.isSpecCompliantForm(p))return(await new n(Z.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(f.isArrayBufferView(p)||f.isArrayBuffer(p))return p.byteLength;if(f.isURLSearchParams(p)&&(p=p+""),f.isString(p))return(await d(p)).byteLength},T=async(p,w)=>{const h=f.toFiniteNumber(p.getContentLength());return h??k(w)};return async p=>{let{url:w,method:h,data:I,signal:C,cancelToken:g,timeout:z,onDownloadProgress:D,onUploadProgress:b,responseType:j,headers:q,withCredentials:_="same-origin",fetchOptions:X}=At(p),W=e||fetch;j=j?(j+"").toLowerCase():"text";let P=hn([C,g&&g.toAbortSignal()],z),G=null;const O=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let R;try{if(b&&u&&h!=="get"&&h!=="head"&&(R=await T(q,I))!==0){let l=new n(w,{method:"POST",body:I,duplex:"half"}),m;if(f.isFormData(I)&&(m=l.headers.get("content-type"))&&q.setContentType(m),l.body){const[E,U]=It(R,Ue(_t(b)));I=$t(l.body,Nt,E,U)}}f.isString(_)||(_=_?"include":"omit");const M=o&&"credentials"in n.prototype,K={...X,signal:P,method:h.toUpperCase(),headers:q.normalize().toJSON(),body:I,duplex:"half",credentials:M?_:void 0};G=o&&new n(w,K);let H=await(o?W(G,X):W(w,K));const F=x&&(j==="stream"||j==="response");if(x&&(D||F&&O)){const l={};["status","statusText","headers"].forEach(ne=>{l[ne]=H[ne]});const m=f.toFiniteNumber(H.headers.get("content-length")),[E,U]=D&&It(m,Ue(_t(D),!0))||[];H=new s($t(H.body,Nt,E,()=>{U&&U(),O&&O()}),l)}j=j||"text";let J=await y[f.findKey(y,j)||"text"](H,p);return!F&&O&&O(),await new Promise((l,m)=>{Ot(l,m,{data:J,headers:re.from(H.headers),status:H.status,statusText:H.statusText,config:p,request:G})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,p,G),{cause:M.cause||M}):N.from(M,M&&M.code,p,G)}}},Sn=new Map,Lt=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:i}=e,o=[s,i,n];let a=o.length,c=a,d,u,x=Sn;for(;c--;)d=o[c],u=x.get(d),u===void 0&&x.set(d,u=c?new Map:wn(e)),x=u;return u};Lt();const Xe={http:Mr,xhr:xn,fetch:{get:Lt}};f.forEach(Xe,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const qt=t=>`- ${t}`,jn=t=>f.isFunction(t)||t===null||t===!1,Mt={getAdapter:(t,e)=>{t=f.isArray(t)?t:[t];const{length:n}=t;let s,i;const o={};for(let a=0;a<n;a++){s=t[a];let c;if(i=s,!jn(s)&&(i=Xe[(c=String(s)).toLowerCase()],i===void 0))throw new N(`Unknown adapter '${c}'`);if(i&&(f.isFunction(i)||(i=i.get(e))))break;o[c||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
4
4
|
`+a.map(qt).join(`
|
|
5
5
|
`):" "+qt(a[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return i},adapters:Xe};function Ze(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function Wt(t){return Ze(t),t.headers=re.from(t.headers),t.data=Ge.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Mt.getAdapter(t.adapter||Te.adapter,t)(t).then(function(s){return Ze(t),s.data=Ge.call(t,t.transformResponse,s),s.headers=re.from(s.headers),s},function(s){return Pt(s)||(Ze(t),s&&s.response&&(s.response.data=Ge.call(t,t.transformResponse,s.response),s.response.headers=re.from(s.response.headers))),Promise.reject(s)})}const Bt="1.12.2",Fe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Fe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Ht={};Fe.transitional=function(e,n,s){function i(o,a){return"[Axios v"+Bt+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(e===!1)throw new N(i(a," has been removed"+(n?" in "+n:"")),N.ERR_DEPRECATED);return n&&!Ht[a]&&(Ht[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,c):!0}},Fe.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function vn(t,e,n){if(typeof t!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let i=s.length;for(;i-- >0;){const o=s[i],a=e[o];if(a){const c=t[o],d=c===void 0||a(c,o,t);if(d!==!0)throw new N("option "+o+" must be "+d,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+o,N.ERR_BAD_OPTION)}}const Le={assertOptions:vn,validators:Fe},ae=Le.validators;let he=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Et,response:new Et}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
-
`+o):s.stack=o}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=xe(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&Le.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),i!=null&&(f.isFunction(i)?n.paramsSerializer={serialize:i}:Le.assertOptions(i,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Le.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&f.merge(o.common,o[n.method]);o&&f.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=re.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let x,y=0,k;if(!d){const p=[Wt.bind(this),void 0];for(p.unshift(...c),p.push(...u),k=p.length,x=Promise.resolve(n);y<k;)x=x.then(p[y++],p[y++]);return x}k=c.length;let T=n;for(;y<k;){const p=c[y++],w=c[y++];try{T=p(T)}catch(h){w.call(this,h);break}}try{x=Wt.call(this,T)}catch(p){return Promise.reject(p)}for(y=0,k=u.length;y<k;)x=x.then(u[y++],u[y++]);return x}getUri(e){e=xe(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return vt(n,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){he.prototype[e]=function(n,s){return this.request(xe(s||{},{method:e,url:n,data:(s||{}).data}))}}),f.forEach(["post","put","patch"],function(e){function n(s){return function(o,a,c){return this.request(xe(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}he.prototype[e]=n(),he.prototype[e+"Form"]=n(!0)});let En=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},e(function(o,a,c){s.reason||(s.reason=new be(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nr(function(i){e=i}),cancel:e}}};function kn(t){return function(n){return t.apply(null,n)}}function Tn(t){return f.isObject(t)&&t.isAxiosError===!0}const Qe={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(Qe).forEach(([t,e])=>{Qe[e]=t});function Vt(t){const e=new he(t),n=lt(he.prototype.request,e);return f.extend(n,he.prototype,e,{allOwnKeys:!0}),f.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Vt(xe(t,i))},n}const Y=Vt(Te);Y.Axios=he,Y.CanceledError=be,Y.CancelToken=En,Y.isCancel=Pt,Y.VERSION=Bt,Y.toFormData=$e,Y.AxiosError=N,Y.Cancel=Y.CanceledError,Y.all=function(e){return Promise.all(e)},Y.spread=kn,Y.isAxiosError=Tn,Y.mergeConfig=xe,Y.AxiosHeaders=re,Y.formToJSON=t=>Tt(f.isHTMLForm(t)?new FormData(t):t),Y.getAdapter=Mt.getAdapter,Y.HttpStatusCode=Qe,Y.default=Y;const{Axios:xs,AxiosError:hs,CanceledError:ms,isCancel:gs,CancelToken:ys,VERSION:bs,all:ws,Cancel:Ss,isAxiosError:js,spread:vs,toFormData:Es,AxiosHeaders:ks,HttpStatusCode:Ts,formToJSON:Cs,getAdapter:Ps,mergeConfig:Os}=Y;class Cn{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=Y.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,n,s,i={},o=!1){try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:n,method:e,data:a,headers:i,withCredentials:o})).data}catch(a){throw Y.isAxiosError(a)?{message:a.response?.data?.message||a.message||"Request failed",status:a.response?.status??0}:{message:a.message||"Unexpected error occurred"}}}async signupUser(e){const{name:n,email:s,password:i}=e;if(!n||!s||!i)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:n,password:s}=e;if(!n||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:n,password:s},{},!0)}catch(i){throw new Error(i.message||"Login failed due to an unknown error")}}async logoutUser(){try{const e=await this.request("POST","/users/logout",{},{},!0);if(e&&e.success){if(typeof document<"u"){const n=new Date(0).toUTCString();document.cookie=`a_s_b=; path=/; expires=${n}; SameSite=Lax`}return{success:!0}}return{success:!1}}catch(e){throw new Error(e.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:n,currentPassword:s,newPassword:i}=e;if(!n)throw new Error("changePassword: 'userId' is required");if(!s||!i)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${n}`,{currentPassword:s,newPassword:i},{},!0)}async requestEmailVerificationOTP(e){const{userId:n,email:s}=e;if(!n)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!s)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(n)}`,{email:s},{},!0)}catch(i){throw console.error("requestEmailVerificationOTP Error:",i),{message:i?.message||"Failed to send verification OTP",status:i?.status||500}}}async verifyEmail(e){const{email:n,otp:s}=e;if(!n)throw new Error("verifyEmail: 'email' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:n,otp:s},{},!0)}catch(i){throw{message:i.message||"Failed to verify email",status:i.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session",void 0,{},!0)}catch{return{authenticated:!1}}}async updateUser(e){const{userId:n}=e;if(!n)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${n}`,{...e},{},!0)}async deleteUser(e){const{userId:n}=e;if(!n)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${n}`,{},{},!0)}async getUserProfile(e){const{userId:n}=e;if(!n)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:n},{},!0)}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:n}=e;if(!n)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:n})}async resetUserPassword(e){const{email:n,otp:s,newPassword:i}=e;if(!n||!s||!i)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:n,otp:s,newPassword:i})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchUserData(e){const{userId:n,...s}=e;if(!n)throw new Error("userId required");const i=new URLSearchParams(s).toString();return await this.request("GET",`/users/${n}/data/search?${i}`,void 0,{},!1)}async searchUserDataByKeys(e){const{userId:n,...s}=e;if(!n)throw new Error("searchUserDataByKeys: 'userId' is required");const i=new URLSearchParams(Object.entries(s).reduce((o,[a,c])=>(c!=null&&(o[a]=String(c)),o),{})).toString();return await this.request("GET",`/users/${n}/data/searchbyref?${i}`,void 0,{},!1)}async getUserData(e){const{userId:n}=e;if(!n)throw new Error("getUserData: 'userId' is required");return await this.request("GET",`/users/${n}/data`,void 0,{},!1)}async getSingleUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${n}/data/${s}`,void 0,{},!1)}async addUserData(e){const{userId:n,dataCategory:s,data:i}=e;if(!n)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!i)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${n}/data`,{dataCategory:s,...i},{},!1)}async updateUserData(e){const{userId:n,dataId:s,data:i}=e;if(!n||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!i)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${n}/data/${s}`,i,{},!1)}async deleteUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${n}/data/${s}`,void 0,{},!1)}async getAppData(e){const n=this.appId;if(!n)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return await this.request("GET",`/app/${n}/data${s}`,void 0,{},!1)}async getSingleAppData(e){const n=this.appId;if(!n)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}async searchAppDataByKeys(e){const n=this.appId;if(!n)throw new Error("searchAppDataByKeys: 'appId' is required");if(!e||typeof e!="object")throw new Error("searchAppDataByKeys: params object is required");return await this.request("POST",`/app/${encodeURIComponent(n)}/data/search/bykeys`,e,{},!1)}async addAppData(e){const n=this.appId;if(!n)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:i}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!i||typeof i!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${n}/data/${encodeURIComponent(s)}`,{item:i},{},!1)}async updateAppData(e){const n=this.appId;if(!n)throw new Error("updateAppData: 'appId' is required");if(!e.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e.data)throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${n}/data/${e.dataId}`,e.data,{},!1)}async deleteAppData(e){const n=this.appId;if(!n)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}}var qe={exports:{}},Pe={};/**
|
|
6
|
+
`+o):s.stack=o}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=xe(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&Le.assertOptions(s,{silentJSONParsing:ae.transitional(ae.boolean),forcedJSONParsing:ae.transitional(ae.boolean),clarifyTimeoutError:ae.transitional(ae.boolean)},!1),i!=null&&(f.isFunction(i)?n.paramsSerializer={serialize:i}:Le.assertOptions(i,{encode:ae.function,serialize:ae.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Le.assertOptions(n,{baseUrl:ae.spelling("baseURL"),withXsrfToken:ae.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&f.merge(o.common,o[n.method]);o&&f.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=re.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let x,y=0,k;if(!d){const p=[Wt.bind(this),void 0];for(p.unshift(...c),p.push(...u),k=p.length,x=Promise.resolve(n);y<k;)x=x.then(p[y++],p[y++]);return x}k=c.length;let T=n;for(;y<k;){const p=c[y++],w=c[y++];try{T=p(T)}catch(h){w.call(this,h);break}}try{x=Wt.call(this,T)}catch(p){return Promise.reject(p)}for(y=0,k=u.length;y<k;)x=x.then(u[y++],u[y++]);return x}getUri(e){e=xe(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return vt(n,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){he.prototype[e]=function(n,s){return this.request(xe(s||{},{method:e,url:n,data:(s||{}).data}))}}),f.forEach(["post","put","patch"],function(e){function n(s){return function(o,a,c){return this.request(xe(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}he.prototype[e]=n(),he.prototype[e+"Form"]=n(!0)});let En=class nr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},e(function(o,a,c){s.reason||(s.reason=new be(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nr(function(i){e=i}),cancel:e}}};function kn(t){return function(n){return t.apply(null,n)}}function Tn(t){return f.isObject(t)&&t.isAxiosError===!0}const Qe={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(Qe).forEach(([t,e])=>{Qe[e]=t});function Vt(t){const e=new he(t),n=lt(he.prototype.request,e);return f.extend(n,he.prototype,e,{allOwnKeys:!0}),f.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Vt(xe(t,i))},n}const Y=Vt(Te);Y.Axios=he,Y.CanceledError=be,Y.CancelToken=En,Y.isCancel=Pt,Y.VERSION=Bt,Y.toFormData=$e,Y.AxiosError=N,Y.Cancel=Y.CanceledError,Y.all=function(e){return Promise.all(e)},Y.spread=kn,Y.isAxiosError=Tn,Y.mergeConfig=xe,Y.AxiosHeaders=re,Y.formToJSON=t=>Tt(f.isHTMLForm(t)?new FormData(t):t),Y.getAdapter=Mt.getAdapter,Y.HttpStatusCode=Qe,Y.default=Y;const{Axios:xs,AxiosError:hs,CanceledError:ms,isCancel:gs,CancelToken:ys,VERSION:bs,all:ws,Cancel:Ss,isAxiosError:js,spread:vs,toFormData:Es,AxiosHeaders:ks,HttpStatusCode:Ts,formToJSON:Cs,getAdapter:Ps,mergeConfig:Os}=Y;class Cn{baseUrl;apiKey;appId;client;constructor(e){if(!e||!e.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey||null,this.appId=e.appId||null,this.client=Y.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,n,s,i={},o=!1){try{const a={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:n,method:e,data:a,headers:i,withCredentials:o})).data}catch(a){throw Y.isAxiosError(a)?{message:a.response?.data?.message||a.message||"Request failed",status:a.response?.status??0}:{message:a.message||"Unexpected error occurred"}}}async signupUser(e){const{name:n,email:s,password:i}=e;if(!n||!s||!i)throw new Error("signup: 'name', 'email', and 'password' are required");return await this.request("POST","/users/signup",e,{},!0)}async loginUser(e){const{email:n,password:s}=e;if(!n||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:n,password:s},{},!0)}catch(i){throw new Error(i.message||"Login failed due to an unknown error")}}async logoutUser(){try{const e=await this.request("POST","/users/logout",{},{},!0);if(e&&e.success){if(typeof document<"u"){const n=new Date(0).toUTCString();document.cookie=`a_s_b=; path=/; Max-Age=${n}; SameSite=Lax`}return{success:!0}}return{success:!1}}catch(e){throw new Error(e.message||"Logout failed due to an unknown error")}}async changePassword(e){const{userId:n,currentPassword:s,newPassword:i}=e;if(!n)throw new Error("changePassword: 'userId' is required");if(!s||!i)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return await this.request("PUT",`/users/change-password/${n}`,{currentPassword:s,newPassword:i},{},!0)}async requestEmailVerificationOTP(e){const{userId:n,email:s}=e;if(!n)throw{message:"requestEmailVerificationOTP: 'userId' is required",status:400};if(!s)throw{message:"requestEmailVerificationOTP: 'email' is required",status:400};try{return await this.request("POST",`/users/send-verify-otp/${encodeURIComponent(n)}`,{email:s},{},!0)}catch(i){throw console.error("requestEmailVerificationOTP Error:",i),{message:i?.message||"Failed to send verification OTP",status:i?.status||500}}}async verifyEmail(e){const{email:n,otp:s}=e;if(!n)throw new Error("verifyEmail: 'email' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");try{return await this.request("POST","/users/verify-email",{email:n,otp:s},{},!0)}catch(i){throw{message:i.message||"Failed to verify email",status:i.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session",void 0,{},!0)}catch{return{authenticated:!1}}}async updateUser(e){const{userId:n}=e;if(!n)throw new Error("updateUser: 'userId' is required");return await this.request("PUT",`/users/update/${n}`,{...e},{},!0)}async deleteUser(e){const{userId:n}=e;if(!n)throw new Error("deleteUser: 'userId' is required");return await this.request("DELETE",`/users/delete/${n}`,{},{},!0)}async getUserProfile(e){const{userId:n}=e;if(!n)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:n},{},!0)}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:n}=e;if(!n)throw new Error("forgotPassword: 'email' is required");return await this.request("POST","/users/forgot-password",{email:n})}async resetUserPassword(e){const{email:n,otp:s,newPassword:i}=e;if(!n||!s||!i)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return await this.request("POST","/users/reset-password",{email:n,otp:s,newPassword:i})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return await this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchUserData(e){const{userId:n,...s}=e;if(!n)throw new Error("userId required");const i=new URLSearchParams(s).toString();return await this.request("GET",`/users/${n}/data/search?${i}`,void 0,{},!1)}async searchUserDataByKeys(e){const{userId:n,...s}=e;if(!n)throw new Error("searchUserDataByKeys: 'userId' is required");const i=new URLSearchParams(Object.entries(s).reduce((o,[a,c])=>(c!=null&&(o[a]=String(c)),o),{})).toString();return await this.request("GET",`/users/${n}/data/searchbyref?${i}`,void 0,{},!1)}async getUserData(e){const{userId:n}=e;if(!n)throw new Error("getUserData: 'userId' is required");return await this.request("GET",`/users/${n}/data`,void 0,{},!1)}async getSingleUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return await this.request("GET",`/users/${n}/data/${s}`,void 0,{},!1)}async addUserData(e){const{userId:n,dataCategory:s,data:i}=e;if(!n)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!i)throw new Error("addUserData: 'data' is required");return await this.request("POST",`/users/${n}/data`,{dataCategory:s,...i},{},!1)}async updateUserData(e){const{userId:n,dataId:s,data:i}=e;if(!n||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!i)throw new Error("updateUserData: 'data' is required");return await this.request("PUT",`/users/${n}/data/${s}`,i,{},!1)}async deleteUserData(e){const{userId:n,dataId:s}=e;if(!n||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return await this.request("DELETE",`/users/${n}/data/${s}`,void 0,{},!1)}async getAppData(e){const n=this.appId;if(!n)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return await this.request("GET",`/app/${n}/data${s}`,void 0,{},!1)}async getSingleAppData(e){const n=this.appId;if(!n)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return await this.request("GET",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}async searchAppDataByKeys(e){const n=this.appId;if(!n)throw new Error("searchAppDataByKeys: 'appId' is required");if(!e||typeof e!="object")throw new Error("searchAppDataByKeys: params object is required");return await this.request("POST",`/app/${encodeURIComponent(n)}/data/search/bykeys`,e,{},!1)}async addAppData(e){const n=this.appId;if(!n)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:i}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!i||typeof i!="object")throw new Error("addAppData: 'data' is required");return await this.request("POST",`/app/${n}/data/${encodeURIComponent(s)}`,{item:i},{},!1)}async updateAppData(e){const n=this.appId;if(!n)throw new Error("updateAppData: 'appId' is required");if(!e.dataId)throw new Error("updateAppData: 'dataId' is required");if(!e.data)throw new Error("updateAppData: 'data' is required");return await this.request("PATCH",`/app/${n}/data/${e.dataId}`,e.data,{},!1)}async deleteAppData(e){const n=this.appId;if(!n)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return await this.request("DELETE",`/app/${n}/data/${e.dataId}`,void 0,{},!1)}}var qe={exports:{}},Pe={};/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
9
9
|
*
|