@neuctra/authix 1.1.63 → 1.1.64

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.
@@ -1848,22 +1848,30 @@ class xa {
1848
1848
  }
1849
1849
  /**
1850
1850
  * Send email verification OTP for a user
1851
- * @param params requires email and appId
1851
+ * @param params requires userId and email
1852
1852
  */
1853
1853
  async requestEmailVerificationOTP(e) {
1854
- const { email: r } = e;
1854
+ const { userId: r, email: s } = e;
1855
1855
  if (!r)
1856
- throw new Error(
1857
- "sendEmailVerificationRequest: 'email' and 'appId' are required"
1858
- );
1859
- try {
1860
- return await this.request("POST", "/users/send-verify-otp", {
1861
- email: r
1862
- });
1863
- } catch (s) {
1864
1856
  throw {
1865
- message: s.message || "Failed to send verification OTP",
1866
- status: s.status || 500
1857
+ message: "requestEmailVerificationOTP: 'userId' is required",
1858
+ status: 400
1859
+ };
1860
+ if (!s)
1861
+ throw {
1862
+ message: "requestEmailVerificationOTP: 'email' is required",
1863
+ status: 400
1864
+ };
1865
+ try {
1866
+ return await this.request(
1867
+ "POST",
1868
+ `/users/send-verify-otp/${encodeURIComponent(r)}`,
1869
+ { email: s }
1870
+ );
1871
+ } catch (a) {
1872
+ throw console.error("requestEmailVerificationOTP Error:", a), {
1873
+ message: a?.message || "Failed to send verification OTP",
1874
+ status: a?.status || 500
1867
1875
  };
1868
1876
  }
1869
1877
  }
@@ -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,...r){const s=new this(e);return r.forEach(a=>s.set(a)),s}static accessor(e){const s=(this[Pt]=this[Pt]={accessors:{}}).accessors,a=this.prototype;function i(o){const l=Ce(o);s[l]||(un(a,o),s[l]=!0)}return p.isArray(e)?e.forEach(i):i(e),this}};ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(ne.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),p.freezeMethods(ne);function Xe(t,e){const r=this||ke,s=e||r,a=ne.from(s.headers);let i=s.data;return p.forEach(t,function(l){i=l.call(r,i,a.normalize(),e?e.status:void 0)}),a.normalize(),i}function Ot(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){D.call(this,t??"canceled",D.ERR_CANCELED,e,r),this.name="CanceledError"}p.inherits(be,D,{__CANCEL__:!0});function Rt(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new D("Request failed with status code "+r.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function pn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function fn(t,e){t=t||10;const r=new Array(t),s=new Array(t);let a=0,i=0,o;return e=e!==void 0?e:1e3,function(h){const c=Date.now(),d=s[i];o||(o=c),r[a]=h,s[a]=c;let m=i,b=0;for(;m!==a;)b+=r[m++],m=m%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),c-o<e)return;const S=d&&c-d;return S?Math.round(b*1e3/S):void 0}}function xn(t,e){let r=0,s=1e3/e,a,i;const o=(c,d=Date.now())=>{r=d,a=null,i&&(clearTimeout(i),i=null),t(...c)};return[(...c)=>{const d=Date.now(),m=d-r;m>=s?o(c,d):(a=c,i||(i=setTimeout(()=>{i=null,o(a)},s-m)))},()=>a&&o(a)]}const Ue=(t,e,r=3)=>{let s=0;const a=fn(50,250);return xn(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,h=o-s,c=a(h),d=o<=l;s=o;const m={loaded:o,total:l,progress:l?o/l:void 0,bytes:h,rate:c||void 0,estimated:c&&l&&d?(l-o)/c:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},r)},At=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},_t=t=>(...e)=>p.asap(()=>t(...e)),hn=ee.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,ee.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(ee.origin),ee.navigator&&/(msie|trident)/i.test(ee.navigator.userAgent)):()=>!0,gn=ee.hasStandardBrowserEnv?{write(t,e,r,s,a,i){const o=[t+"="+encodeURIComponent(e)];p.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),p.isString(s)&&o.push("path="+s),p.isString(a)&&o.push("domain="+a),i===!0&&o.push("secure"),document.cookie=o.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 mn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function yn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function zt(t,e,r){let s=!mn(e);return t&&(s||r==!1)?yn(t,e):e}const $t=t=>t instanceof ne?{...t}:t;function fe(t,e){e=e||{};const r={};function s(c,d,m,b){return p.isPlainObject(c)&&p.isPlainObject(d)?p.merge.call({caseless:b},c,d):p.isPlainObject(d)?p.merge({},d):p.isArray(d)?d.slice():d}function a(c,d,m,b){if(p.isUndefined(d)){if(!p.isUndefined(c))return s(void 0,c,m,b)}else return s(c,d,m,b)}function i(c,d){if(!p.isUndefined(d))return s(void 0,d)}function o(c,d){if(p.isUndefined(d)){if(!p.isUndefined(c))return s(void 0,c)}else return s(void 0,d)}function l(c,d,m){if(m in e)return s(c,d);if(m in t)return s(void 0,c)}const h={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(c,d,m)=>a($t(c),$t(d),m,!0)};return p.forEach(Object.keys({...t,...e}),function(d){const m=h[d]||a,b=m(t[d],e[d],d);p.isUndefined(b)&&m!==l||(r[d]=b)}),r}const Nt=t=>{const e=fe({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:l}=e;if(e.headers=o=ne.from(o),e.url=kt(zt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),p.isFormData(r)){if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(p.isFunction(r.getHeaders)){const h=r.getHeaders(),c=["content-type","content-length"];Object.entries(h).forEach(([d,m])=>{c.includes(d.toLowerCase())&&o.set(d,m)})}}if(ee.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(e)),s||s!==!1&&hn(e.url))){const h=a&&i&&gn.read(i);h&&o.set(a,h)}return e},bn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,s){const a=Nt(t);let i=a.data;const o=ne.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:c}=a,d,m,b,S,u;function j(){S&&S(),u&&u(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function z(){if(!y)return;const _=ne.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),q={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:t,request:y};Rt(function(O){r(O),j()},function(O){s(O),j()},q),y=null}"onloadend"in y?y.onloadend=z:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(z)},y.onabort=function(){y&&(s(new D("Request aborted",D.ECONNABORTED,t,y)),y=null)},y.onerror=function(T){const q=T&&T.message?T.message:"Network Error",g=new D(q,D.ERR_NETWORK,t,y);g.event=T||null,s(g),y=null},y.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const q=a.transitional||Tt;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),s(new D(T,q.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,t,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&p.forEach(o.toJSON(),function(T,q){y.setRequestHeader(q,T)}),p.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),l&&l!=="json"&&(y.responseType=a.responseType),c&&([b,u]=Ue(c,!0),y.addEventListener("progress",b)),h&&y.upload&&([m,S]=Ue(h),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",S)),(a.cancelToken||a.signal)&&(d=_=>{y&&(s(!_||_.type?new be(null,t,y):_),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const P=pn(a.url);if(P&&ee.protocols.indexOf(P)===-1){s(new D("Unsupported protocol "+P+":",D.ERR_BAD_REQUEST,t));return}y.send(i||null)})},wn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,a;const i=function(c){if(!a){a=!0,l();const d=c instanceof Error?c:this.reason;s.abort(d instanceof D?d:new be(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new D(`timeout ${e} of ms exceeded`,D.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),t=null)};t.forEach(c=>c.addEventListener("abort",i));const{signal:h}=s;return h.unsubscribe=()=>p.asap(l),h}},Sn=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,a;for(;s<r;)a=s+e,yield t.slice(s,a),s=a},jn=async function*(t,e){for await(const r of vn(t))yield*Sn(r,e)},vn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},Ut=(t,e,r,s)=>{const a=jn(t,e);let i=0,o,l=h=>{o||(o=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:d}=await a.next();if(c){l(),h.close();return}let m=d.byteLength;if(r){let b=i+=m;r(b)}h.enqueue(new Uint8Array(d))}catch(c){throw l(c),c}},cancel(h){return l(h),a.return()}},{highWaterMark:2})},Dt=64*1024,{isFunction:De}=p,En=(({Request:t,Response:e})=>({Request:t,Response:e}))(p.global),{ReadableStream:Lt,TextEncoder:Ft}=p.global,qt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},kn=t=>{t=p.merge.call({skipUndefined:!0},En,t);const{fetch:e,Request:r,Response:s}=t,a=e?De(e):typeof fetch=="function",i=De(r),o=De(s);if(!a)return!1;const l=a&&De(Lt),h=a&&(typeof Ft=="function"?(u=>j=>u.encode(j))(new Ft):async u=>new Uint8Array(await new r(u).arrayBuffer())),c=i&&l&&qt(()=>{let u=!1;const j=new r(ee.origin,{body:new Lt,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!j}),d=o&&l&&qt(()=>p.isReadableStream(new s("").body)),m={stream:d&&(u=>u.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!m[u]&&(m[u]=(j,y)=>{let z=j&&j[u];if(z)return z.call(j);throw new D(`Response type '${u}' is not supported`,D.ERR_NOT_SUPPORT,y)})});const b=async u=>{if(u==null)return 0;if(p.isBlob(u))return u.size;if(p.isSpecCompliantForm(u))return(await new r(ee.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(p.isArrayBufferView(u)||p.isArrayBuffer(u))return u.byteLength;if(p.isURLSearchParams(u)&&(u=u+""),p.isString(u))return(await h(u)).byteLength},S=async(u,j)=>{const y=p.toFiniteNumber(u.getContentLength());return y??b(j)};return async u=>{let{url:j,method:y,data:z,signal:P,cancelToken:_,timeout:T,onDownloadProgress:q,onUploadProgress:g,responseType:O,headers:v,withCredentials:U="same-origin",fetchOptions:W}=Nt(u),F=e||fetch;O=O?(O+"").toLowerCase():"text";let V=wn([P,_&&_.toAbortSignal()],T),Z=null;const I=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let J;try{if(g&&c&&y!=="get"&&y!=="head"&&(J=await S(v,z))!==0){let f=new r(j,{method:"POST",body:z,duplex:"half"}),E;if(p.isFormData(z)&&(E=f.headers.get("content-type"))&&v.setContentType(E),f.body){const[x,k]=At(J,Ue(_t(g)));z=Ut(f.body,Dt,x,k)}}p.isString(U)||(U=U?"include":"omit");const A=i&&"credentials"in r.prototype,R={...W,signal:V,method:y.toUpperCase(),headers:v.normalize().toJSON(),body:z,duplex:"half",credentials:A?U:void 0};Z=i&&new r(j,R);let K=await(i?F(Z,W):F(j,R));const te=d&&(O==="stream"||O==="response");if(d&&(q||te&&I)){const f={};["status","statusText","headers"].forEach($=>{f[$]=K[$]});const E=p.toFiniteNumber(K.headers.get("content-length")),[x,k]=q&&At(E,Ue(_t(q),!0))||[];K=new s(Ut(K.body,Dt,x,()=>{k&&k(),I&&I()}),f)}O=O||"text";let G=await m[p.findKey(m,O)||"text"](K,u);return!te&&I&&I(),await new Promise((f,E)=>{Rt(f,E,{data:G,headers:ne.from(K.headers),status:K.status,statusText:K.statusText,config:u,request:Z})})}catch(A){throw I&&I(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new D("Network Error",D.ERR_NETWORK,u,Z),{cause:A.cause||A}):D.from(A,A&&A.code,u,Z)}}},Cn=new Map,Mt=t=>{let e=t?t.env:{};const{fetch:r,Request:s,Response:a}=e,i=[s,a,r];let o=i.length,l=o,h,c,d=Cn;for(;l--;)h=i[l],c=d.get(h),c===void 0&&d.set(h,c=l?new Map:kn(e)),d=c;return c};Mt();const Ze={http:Yr,xhr:bn,fetch:{get:Mt}};p.forEach(Ze,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Wt=t=>`- ${t}`,Tn=t=>p.isFunction(t)||t===null||t===!1,Bt={getAdapter:(t,e)=>{t=p.isArray(t)?t:[t];const{length:r}=t;let s,a;const i={};for(let o=0;o<r;o++){s=t[o];let l;if(a=s,!Tn(s)&&(a=Ze[(l=String(s)).toLowerCase()],a===void 0))throw new D(`Unknown adapter '${l}'`);if(a&&(p.isFunction(a)||(a=a.get(e))))break;i[l||"#"+o]=a}if(!a){const o=Object.entries(i).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?o.length>1?`since :
4
4
  `+o.map(Wt).join(`
5
5
  `):" "+Wt(o[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a},adapters:Ze};function Qe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function Ht(t){return Qe(t),t.headers=ne.from(t.headers),t.data=Xe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bt.getAdapter(t.adapter||ke.adapter,t)(t).then(function(s){return Qe(t),s.data=Xe.call(t,t.transformResponse,s),s.headers=ne.from(s.headers),s},function(s){return Ot(s)||(Qe(t),s&&s.response&&(s.response.data=Xe.call(t,t.transformResponse,s.response),s.response.headers=ne.from(s.response.headers))),Promise.reject(s)})}const Vt="1.12.2",Le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Le[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Yt={};Le.transitional=function(e,r,s){function a(i,o){return"[Axios v"+Vt+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,l)=>{if(e===!1)throw new D(a(o," has been removed"+(r?" in "+r:"")),D.ERR_DEPRECATED);return r&&!Yt[o]&&(Yt[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,l):!0}},Le.spelling=function(e){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function In(t,e,r){if(typeof t!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let a=s.length;for(;a-- >0;){const i=s[a],o=e[i];if(o){const l=t[i],h=l===void 0||o(l,i,t);if(h!==!0)throw new D("option "+i+" must be "+h,D.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}const Fe={assertOptions:In,validators:Le},ie=Fe.validators;let xe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ct,response:new Ct}}async request(e,r){try{return await this._request(e,r)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+i):s.stack=i}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=fe(this.defaults,r);const{transitional:s,paramsSerializer:a,headers:i}=r;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),a!=null&&(p.isFunction(a)?r.paramsSerializer={serialize:a}:Fe.assertOptions(a,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fe.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u]}),r.headers=ne.concat(o,i);const l=[];let h=!0;this.interceptors.request.forEach(function(j){typeof j.runWhen=="function"&&j.runWhen(r)===!1||(h=h&&j.synchronous,l.unshift(j.fulfilled,j.rejected))});const c=[];this.interceptors.response.forEach(function(j){c.push(j.fulfilled,j.rejected)});let d,m=0,b;if(!h){const u=[Ht.bind(this),void 0];for(u.unshift(...l),u.push(...c),b=u.length,d=Promise.resolve(r);m<b;)d=d.then(u[m++],u[m++]);return d}b=l.length;let S=r;for(;m<b;){const u=l[m++],j=l[m++];try{S=u(S)}catch(y){j.call(this,y);break}}try{d=Ht.call(this,S)}catch(u){return Promise.reject(u)}for(m=0,b=c.length;m<b;)d=d.then(c[m++],c[m++]);return d}getUri(e){e=fe(this.defaults,e);const r=zt(e.baseURL,e.url,e.allowAbsoluteUrls);return kt(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,s){return this.request(fe(s||{},{method:e,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function r(s){return function(i,o,l){return this.request(fe(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});let Pn=class lr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(a=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](a);s._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{s.subscribe(l),i=l}).then(a);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,l){s.reason||(s.reason=new be(i,o,l),r(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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new lr(function(a){e=a}),cancel:e}}};function On(t){return function(r){return t.apply(null,r)}}function Rn(t){return p.isObject(t)&&t.isAxiosError===!0}const et={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(et).forEach(([t,e])=>{et[e]=t});function Kt(t){const e=new xe(t),r=ct(xe.prototype.request,e);return p.extend(r,xe.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return Kt(fe(t,a))},r}const M=Kt(ke);M.Axios=xe,M.CanceledError=be,M.CancelToken=Pn,M.isCancel=Ot,M.VERSION=Vt,M.toFormData=$e,M.AxiosError=D,M.Cancel=M.CanceledError,M.all=function(e){return Promise.all(e)},M.spread=On,M.isAxiosError=Rn,M.mergeConfig=fe,M.AxiosHeaders=ne,M.formToJSON=t=>It(p.isHTMLForm(t)?new FormData(t):t),M.getAdapter=Bt.getAdapter,M.HttpStatusCode=et,M.default=M;const{Axios:js,AxiosError:vs,CanceledError:Es,isCancel:ks,CancelToken:Cs,VERSION:Ts,all:Is,Cancel:Ps,isAxiosError:Os,spread:Rs,toFormData:As,AxiosHeaders:_s,HttpStatusCode:zs,formToJSON:$s,getAdapter:Ns,mergeConfig:Us}=M;class An{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=M.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,r,s,a={}){try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:e,data:i,headers:a})).data}catch(i){throw M.isAxiosError(i)?{message:i.response?.data?.message||i.message||"Request failed",status:i.response?.status??0}:{message:i.message||"Unexpected error occurred"}}}async signupUser(e){const{name:r,email:s,password:a}=e;if(!r||!s||!a)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",e)}async loginUser(e){const{email:r,password:s}=e;if(!r||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:r,password:s})}catch(a){throw new Error(a.message||"Login failed due to an unknown error")}}async changePassword(e){const{userId:r,currentPassword:s,newPassword:a}=e;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!a)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:a})}async requestEmailVerificationOTP(e){const{email:r}=e;if(!r)throw new Error("sendEmailVerificationRequest: 'email' and 'appId' are required");try{return await this.request("POST","/users/send-verify-otp",{email:r})}catch(s){throw{message:s.message||"Failed to send verification OTP",status:s.status||500}}}async verifyEmail(e){const{email:r,otp:s}=e;if(!r)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:r,otp:s})}catch(a){throw{message:a.message||"Failed to verify email",status:a.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session")}catch{return{authenticated:!1}}}async updateUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...e,appId:s||this.appId})}async deleteUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getUserProfile(e){const{userId:r}=e;if(!r)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:r})}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:r}=e;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r})}async resetUserPassword(e){const{email:r,otp:s,newPassword:a}=e;if(!r||!s||!a)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:a})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchAllUsersData(e){if(!this.appId)throw new Error("searchAllUsersData: appId missing");const r=new URLSearchParams(e).toString();return this.request("GET",`/users/${this.appId}/data/search?${r}`)}async searchUserData(e){const{userId:r,...s}=e;if(!r)throw new Error("userId required");const a=new URLSearchParams(s).toString();return this.request("GET",`/users/${r}/data/search?${a}`)}async searchUserDataByKeys(e){const{userId:r,...s}=e;if(!r)throw new Error("searchUserDataByKeys: 'userId' is required");const a=new URLSearchParams(Object.entries(s).reduce((i,[o,l])=>(l!=null&&(i[o]=String(l)),i),{})).toString();return this.request("GET",`/users/${r}/data/searchbyref?${a}`)}async searchAllUsersDataByKeys(e){const r=this.appId;if(!r)throw new Error("searchAllUsersDataByKeys: 'appId' is required on SDK initialization");const s=new URLSearchParams(Object.entries(e).reduce((a,[i,o])=>(o!=null&&(a[i]=String(o)),a),{})).toString();return this.request("GET",`/users/${encodeURIComponent(r)}/data/searchbyref/all?${s}`)}async getAllUsersData(){if(!this.appId)throw new Error("getAllUsersData: SDK 'appId' is missing in config");return this.request("GET",`/users/all-data/${this.appId}/data`)}async getUserData(e){const{userId:r}=e;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(e){const{userId:r,dataCategory:s,data:a}=e;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!a)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,{dataCategory:s,...a})}async updateUserData(e){const{userId:r,dataId:s,data:a}=e;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!a)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,a)}async deleteUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}async getAppData(e){const r=this.appId;if(!r)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return(await this.request("GET",`/app/${r}/data${s}`))?.data||[]}async getSingleAppData(e){const r=this.appId;if(!r)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return(await this.request("GET",`/app/${r}/data/${e.dataId}`))?.data}async searchAppDataByKeys(e){const r=this.appId;if(!r)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(r)}/data/search/bykeys`,e))?.data||[]}async addAppData(e){const r=this.appId;if(!r)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:a}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!a||typeof a!="object")throw new Error("addAppData: 'data' is required");return(await this.request("POST",`/app/${r}/data/${encodeURIComponent(s)}`,{item:a}))?.data}async updateAppData(e){const r=this.appId;if(!r)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/${r}/data/${e.dataId}`,e.data))?.data}async deleteAppData(e){const r=this.appId;if(!r)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return(await this.request("DELETE",`/app/${r}/data/${e.dataId}`))?.data}}var qe={exports:{}},Te={};/**
6
+ `+i):s.stack=i}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=fe(this.defaults,r);const{transitional:s,paramsSerializer:a,headers:i}=r;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),a!=null&&(p.isFunction(a)?r.paramsSerializer={serialize:a}:Fe.assertOptions(a,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Fe.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u]}),r.headers=ne.concat(o,i);const l=[];let h=!0;this.interceptors.request.forEach(function(j){typeof j.runWhen=="function"&&j.runWhen(r)===!1||(h=h&&j.synchronous,l.unshift(j.fulfilled,j.rejected))});const c=[];this.interceptors.response.forEach(function(j){c.push(j.fulfilled,j.rejected)});let d,m=0,b;if(!h){const u=[Ht.bind(this),void 0];for(u.unshift(...l),u.push(...c),b=u.length,d=Promise.resolve(r);m<b;)d=d.then(u[m++],u[m++]);return d}b=l.length;let S=r;for(;m<b;){const u=l[m++],j=l[m++];try{S=u(S)}catch(y){j.call(this,y);break}}try{d=Ht.call(this,S)}catch(u){return Promise.reject(u)}for(m=0,b=c.length;m<b;)d=d.then(c[m++],c[m++]);return d}getUri(e){e=fe(this.defaults,e);const r=zt(e.baseURL,e.url,e.allowAbsoluteUrls);return kt(r,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,s){return this.request(fe(s||{},{method:e,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function r(s){return function(i,o,l){return this.request(fe(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});let Pn=class lr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(a=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](a);s._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{s.subscribe(l),i=l}).then(a);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,l){s.reason||(s.reason=new be(i,o,l),r(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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new lr(function(a){e=a}),cancel:e}}};function On(t){return function(r){return t.apply(null,r)}}function Rn(t){return p.isObject(t)&&t.isAxiosError===!0}const et={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(et).forEach(([t,e])=>{et[e]=t});function Kt(t){const e=new xe(t),r=ct(xe.prototype.request,e);return p.extend(r,xe.prototype,e,{allOwnKeys:!0}),p.extend(r,e,null,{allOwnKeys:!0}),r.create=function(a){return Kt(fe(t,a))},r}const M=Kt(ke);M.Axios=xe,M.CanceledError=be,M.CancelToken=Pn,M.isCancel=Ot,M.VERSION=Vt,M.toFormData=$e,M.AxiosError=D,M.Cancel=M.CanceledError,M.all=function(e){return Promise.all(e)},M.spread=On,M.isAxiosError=Rn,M.mergeConfig=fe,M.AxiosHeaders=ne,M.formToJSON=t=>It(p.isHTMLForm(t)?new FormData(t):t),M.getAdapter=Bt.getAdapter,M.HttpStatusCode=et,M.default=M;const{Axios:js,AxiosError:vs,CanceledError:Es,isCancel:ks,CancelToken:Cs,VERSION:Ts,all:Is,Cancel:Ps,isAxiosError:Os,spread:Rs,toFormData:As,AxiosHeaders:_s,HttpStatusCode:zs,formToJSON:$s,getAdapter:Ns,mergeConfig:Us}=M;class An{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=M.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:3e4,withCredentials:!0})}async request(e,r,s,a={}){try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:e,data:i,headers:a})).data}catch(i){throw M.isAxiosError(i)?{message:i.response?.data?.message||i.message||"Request failed",status:i.response?.status??0}:{message:i.message||"Unexpected error occurred"}}}async signupUser(e){const{name:r,email:s,password:a}=e;if(!r||!s||!a)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",e)}async loginUser(e){const{email:r,password:s}=e;if(!r||!s)throw new Error("login: 'email' and 'password' are required");try{return await this.request("POST","/users/login",{email:r,password:s})}catch(a){throw new Error(a.message||"Login failed due to an unknown error")}}async changePassword(e){const{userId:r,currentPassword:s,newPassword:a}=e;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!a)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:a})}async requestEmailVerificationOTP(e){const{userId:r,email:s}=e;if(!r)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(r)}`,{email:s})}catch(a){throw console.error("requestEmailVerificationOTP Error:",a),{message:a?.message||"Failed to send verification OTP",status:a?.status||500}}}async verifyEmail(e){const{email:r,otp:s}=e;if(!r)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:r,otp:s})}catch(a){throw{message:a.message||"Failed to verify email",status:a.status||500}}}async checkUserSession(){if(typeof window>"u")return{authenticated:!1};try{return await this.request("GET","/users/session")}catch{return{authenticated:!1}}}async updateUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...e,appId:s||this.appId})}async deleteUser(e){const{userId:r,appId:s}=e;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getUserProfile(e){const{userId:r}=e;if(!r)throw new Error("getProfile: 'userId' and 'appId' are required");try{return await this.request("POST","/users/profile",{userId:r})}catch(s){throw{message:s.message||"Failed to fetch profile",status:s.status||500}}}async requestResetUserPasswordOTP(e){const{email:r}=e;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r})}async resetUserPassword(e){const{email:r,otp:s,newPassword:a}=e;if(!r||!s||!a)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:a})}async checkIfUserExists(e){if(!e)throw new Error("checkUser: 'userId' is required");return this.request("GET",`/users/check-user/${e}?appId=${this.appId}`)}async searchAllUsersData(e){if(!this.appId)throw new Error("searchAllUsersData: appId missing");const r=new URLSearchParams(e).toString();return this.request("GET",`/users/${this.appId}/data/search?${r}`)}async searchUserData(e){const{userId:r,...s}=e;if(!r)throw new Error("userId required");const a=new URLSearchParams(s).toString();return this.request("GET",`/users/${r}/data/search?${a}`)}async searchUserDataByKeys(e){const{userId:r,...s}=e;if(!r)throw new Error("searchUserDataByKeys: 'userId' is required");const a=new URLSearchParams(Object.entries(s).reduce((i,[o,l])=>(l!=null&&(i[o]=String(l)),i),{})).toString();return this.request("GET",`/users/${r}/data/searchbyref?${a}`)}async searchAllUsersDataByKeys(e){const r=this.appId;if(!r)throw new Error("searchAllUsersDataByKeys: 'appId' is required on SDK initialization");const s=new URLSearchParams(Object.entries(e).reduce((a,[i,o])=>(o!=null&&(a[i]=String(o)),a),{})).toString();return this.request("GET",`/users/${encodeURIComponent(r)}/data/searchbyref/all?${s}`)}async getAllUsersData(){if(!this.appId)throw new Error("getAllUsersData: SDK 'appId' is missing in config");return this.request("GET",`/users/all-data/${this.appId}/data`)}async getUserData(e){const{userId:r}=e;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(e){const{userId:r,dataCategory:s,data:a}=e;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'dataCategory' is required");if(!a)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,{dataCategory:s,...a})}async updateUserData(e){const{userId:r,dataId:s,data:a}=e;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!a)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,a)}async deleteUserData(e){const{userId:r,dataId:s}=e;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}async getAppData(e){const r=this.appId;if(!r)throw new Error("getAppData: 'appId' is required");const s=e?`?category=${encodeURIComponent(e)}`:"";return(await this.request("GET",`/app/${r}/data${s}`))?.data||[]}async getSingleAppData(e){const r=this.appId;if(!r)throw new Error("getSingleAppData: 'appId' is required");if(!e.dataId)throw new Error("getSingleAppData: 'dataId' is required");return(await this.request("GET",`/app/${r}/data/${e.dataId}`))?.data}async searchAppDataByKeys(e){const r=this.appId;if(!r)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(r)}/data/search/bykeys`,e))?.data||[]}async addAppData(e){const r=this.appId;if(!r)throw new Error("addAppData: 'appId' is required");const{dataCategory:s,data:a}=e;if(!s)throw new Error("addAppData: 'dataCategory' is required");if(!a||typeof a!="object")throw new Error("addAppData: 'data' is required");return(await this.request("POST",`/app/${r}/data/${encodeURIComponent(s)}`,{item:a}))?.data}async updateAppData(e){const r=this.appId;if(!r)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/${r}/data/${e.dataId}`,e.data))?.data}async deleteAppData(e){const r=this.appId;if(!r)throw new Error("deleteAppData: 'appId' is required");if(!e.dataId)throw new Error("deleteAppData: 'dataId' is required");return(await this.request("DELETE",`/app/${r}/data/${e.dataId}`))?.data}}var qe={exports:{}},Te={};/**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
9
9
  *
@@ -37,9 +37,10 @@ export declare class NeuctraAuthix {
37
37
  changePassword(params: ChangePasswordParams): Promise<any>;
38
38
  /**
39
39
  * Send email verification OTP for a user
40
- * @param params requires email and appId
40
+ * @param params requires userId and email
41
41
  */
42
42
  requestEmailVerificationOTP(params: {
43
+ userId: string;
43
44
  email: string;
44
45
  }): Promise<any>;
45
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,E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AE,GAAG,OAAO,CAAC,WAAW,CAAC;CAYtE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuctra/authix",
3
- "version": "1.1.63",
3
+ "version": "1.1.64",
4
4
  "description": "Universal authentication SDK and UI components for React (v16–v19) with TailwindCSS.",
5
5
  "author": "Taha Asif",
6
6
  "license": "MIT",