@descope/vue-sdk 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@descope/web-component"),r=require("@descope/web-js-sdk");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@descope/user-management-widget"),require("@descope/role-management-widget"),require("@descope/access-key-management-widget"),require("@descope/audit-management-widget"),require("@descope/user-profile-widget"),require("@descope/applications-portal-widget");var s=n(t),o=n(r);const a=Symbol("$descope"),i={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.1.1"},u="undefined"!=typeof window,l=()=>{const t=e.inject(a);if(!t)throw Error("Missing Descope context, make sure you are using the Descope plugin");return t},d=()=>l().options,c=()=>l().sdk,p=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let g;const m=e=>{const t=o.default({persistTokens:u,storeLastAuthenticatedUser:u,...e,autoRefresh:u});return g=t,t};g=m({projectId:"temp pid"});const f=()=>u?g?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),b=()=>u?g?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),y=p(((e=f(),t)=>g?.getJwtPermissions(e,t))),v=p(((e=f(),t)=>g?.getJwtRoles(e,t)));var h=e.defineComponent({__name:"Descope",props:{flowId:{type:String,required:!0},tenant:{type:String},theme:{type:String},locale:{type:String},debug:{type:Boolean},telemetryKey:{type:String},redirectUrl:{type:String},autoFocus:{type:Boolean||String},validateOnBlur:{type:Boolean},errorTransformer:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String}},emits:["success","error","ready"],setup(t,{emit:r}){s.default.sdkConfigOverrides={baseHeaders:i,persistTokens:!1,hooks:{get beforeRequest(){return g.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const n=t,o=r,{projectId:a,baseUrl:u,baseStaticUrl:l,storeLastAuthenticatedUser:p}=d(),m=c(),f=e.computed((()=>n.form?JSON.stringify(n.form):"")),b=e.computed((()=>n.client?JSON.stringify(n.client):"")),y=async e=>{await(m.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),o("success",e)},v=e=>o("error",e),h=e=>o("ready",e);return(r,n)=>{const s=e.resolveComponent("descope-wc");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(a),"base-url":e.unref(u),"base-static-url":e.unref(l),"flow-id":t.flowId,"^theme":t.theme,"^locale":t.locale,"^tenant":t.tenant,"^debug":t.debug,"^telemetryKey":t.telemetryKey,"redirect-url":t.redirectUrl,"auto-focus":t.autoFocus,"style-id":t.styleId,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":e.unref(p),".errorTransformer":t.errorTransformer,"^form":f.value,"^client":b.value,onSuccess:y,onError:v,onReady:h},null,40,["project-id","base-url","base-static-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","store-last-authenticated-user",".errorTransformer","^form","^client"])])}}});h.__file="src/Descope.vue";var w=e.defineComponent({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-user-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});w.__file="src/UserManagement.vue";var S=e.defineComponent({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-role-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});S.__file="src/RoleManagement.vue";var k=e.defineComponent({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-access-key-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});k.__file="src/AccessKeyManagement.vue";var U=e.defineComponent({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-audit-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});U.__file="src/AuditManagement.vue";var _=e.defineComponent({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},emits:["logout"],setup(t,{emit:r}){const n=r,s=e=>n("logout",e),{projectId:o,baseUrl:a,baseStaticUrl:i}=d();return(r,n)=>{const u=e.resolveComponent("descope-user-profile-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(u,{"project-id":e.unref(o),"base-url":e.unref(a),"base-static-url":e.unref(i),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,onLogout:s},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});_.__file="src/UserProfile.vue";var j=e.defineComponent({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-applications-portal-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});j.__file="src/ApplicationsPortal.vue";const x=e.ref(null);let B;var q={install:function(t,r){const n=m({persistTokens:!0,...r,autoRefresh:!0,baseHeaders:i});B=n;const s=e.ref(null),o=e.ref(""),u=e.ref(null),l=e.ref(null);n.onSessionTokenChange((e=>{o.value=e})),n.onUserChange((e=>{l.value=e}));const d=async()=>{s.value=!0,await n.refresh(),s.value=!1},c=e.computed((()=>null===s.value)),p=e.computed((()=>null===u.value));x.value=()=>new Promise(((t,r)=>{!o.value&&c.value&&d().catch(r),e.watch((()=>s.value),(()=>!s.value&&t(!!e.unref(o))),{immediate:!0})})),t.provide(a,{session:{fetchSession:d,isLoading:e.readonly(s),session:e.readonly(o),isFetchSessionWasNeverCalled:c},user:{fetchUser:async()=>{u.value=!0,await n.me(),u.value=!1},isLoading:e.readonly(u),user:e.readonly(l),isFetchUserWasNeverCalled:p},sdk:n,options:r})}};exports.AccessKeyManagement=k,exports.ApplicationsPortal=j,exports.AuditManagement=U,exports.Descope=h,exports.RoleManagement=S,exports.UserManagement=w,exports.UserProfile=_,exports.default=q,exports.getJwtPermissions=y,exports.getJwtRoles=v,exports.getRefreshToken=b,exports.getSdk=()=>B,exports.getSessionToken=f,exports.isRefreshTokenExpired=(e=b())=>g?.isJwtExpired(e),exports.isSessionTokenExpired=(e=f())=>g?.isJwtExpired(e),exports.routeGuard=()=>e.unref(x)?.(),exports.useDescope=c,exports.useSession=()=>{const{session:t}=l();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,isAuthenticated:e.computed((()=>!!t.session.value))}},exports.useUser=()=>{const{user:t,session:r}=l(),n=()=>{!t.user.value&&r.session.value&&t.fetchUser()};return n(),e.watch(r.session,n),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchUserWasNeverCalled.value)),user:t.user}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@descope/web-component"),r=require("@descope/web-js-sdk");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@descope/user-management-widget"),require("@descope/role-management-widget"),require("@descope/access-key-management-widget"),require("@descope/audit-management-widget"),require("@descope/user-profile-widget"),require("@descope/applications-portal-widget");var s=n(t),o=n(r);const a=Symbol("$descope"),i={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.1.2"},u="undefined"!=typeof window,l=()=>{const t=e.inject(a);if(!t)throw Error("Missing Descope context, make sure you are using the Descope plugin");return t},d=()=>l().options,c=()=>l().sdk,p=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let g;const m=e=>{const t=o.default({persistTokens:u,storeLastAuthenticatedUser:u,...e,autoRefresh:u});return g=t,t};g=m({projectId:"temp pid"});const f=()=>u?g?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),b=()=>u?g?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),y=p(((e=f(),t)=>g?.getJwtPermissions(e,t))),v=p(((e=f(),t)=>g?.getJwtRoles(e,t)));var h=e.defineComponent({__name:"Descope",props:{flowId:{type:String,required:!0},tenant:{type:String},theme:{type:String},locale:{type:String},debug:{type:Boolean},telemetryKey:{type:String},redirectUrl:{type:String},autoFocus:{type:Boolean||String},validateOnBlur:{type:Boolean},errorTransformer:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String}},emits:["success","error","ready"],setup(t,{emit:r}){s.default.sdkConfigOverrides={baseHeaders:i,persistTokens:!1,hooks:{get beforeRequest(){return g.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const n=t,o=r,{projectId:a,baseUrl:u,baseStaticUrl:l,storeLastAuthenticatedUser:p}=d(),m=c(),f=e.computed((()=>n.form?JSON.stringify(n.form):"")),b=e.computed((()=>n.client?JSON.stringify(n.client):"")),y=async e=>{await(m.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),o("success",e)},v=e=>o("error",e),h=e=>o("ready",e);return(r,n)=>{const s=e.resolveComponent("descope-wc");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(a),"base-url":e.unref(u),"base-static-url":e.unref(l),"flow-id":t.flowId,"^theme":t.theme,"^locale":t.locale,"^tenant":t.tenant,"^debug":t.debug,"^telemetryKey":t.telemetryKey,"redirect-url":t.redirectUrl,"auto-focus":t.autoFocus,"style-id":t.styleId,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":e.unref(p),".errorTransformer":t.errorTransformer,"^form":f.value,"^client":b.value,onSuccess:y,onError:v,onReady:h},null,40,["project-id","base-url","base-static-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","store-last-authenticated-user",".errorTransformer","^form","^client"])])}}});h.__file="src/Descope.vue";var w=e.defineComponent({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-user-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});w.__file="src/UserManagement.vue";var S=e.defineComponent({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-role-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});S.__file="src/RoleManagement.vue";var k=e.defineComponent({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-access-key-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});k.__file="src/AccessKeyManagement.vue";var U=e.defineComponent({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-audit-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});U.__file="src/AuditManagement.vue";var _=e.defineComponent({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},emits:["logout"],setup(t,{emit:r}){const n=r,s=e=>n("logout",e),{projectId:o,baseUrl:a,baseStaticUrl:i}=d();return(r,n)=>{const u=e.resolveComponent("descope-user-profile-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(u,{"project-id":e.unref(o),"base-url":e.unref(a),"base-static-url":e.unref(i),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,onLogout:s},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});_.__file="src/UserProfile.vue";var j=e.defineComponent({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(t){const{projectId:r,baseUrl:n,baseStaticUrl:s}=d();return(o,a)=>{const i=e.resolveComponent("descope-applications-portal-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(r),"base-url":e.unref(n),"base-static-url":e.unref(s),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});j.__file="src/ApplicationsPortal.vue";const x=e.ref(null);let B;var q={install:function(t,r){const n=m({persistTokens:!0,...r,autoRefresh:!0,baseHeaders:i});B=n;const s=e.ref(null),o=e.ref(""),u=e.ref(null),l=e.ref(null);n.onSessionTokenChange((e=>{o.value=e})),n.onUserChange((e=>{l.value=e}));const d=async()=>{s.value=!0,await n.refresh(),s.value=!1},c=e.computed((()=>null===s.value)),p=e.computed((()=>null===u.value));x.value=()=>new Promise(((t,r)=>{!o.value&&c.value&&d().catch(r),e.watch((()=>s.value),(()=>!s.value&&t(!!e.unref(o))),{immediate:!0})})),t.provide(a,{session:{fetchSession:d,isLoading:e.readonly(s),session:e.readonly(o),isFetchSessionWasNeverCalled:c},user:{fetchUser:async()=>{u.value=!0,await n.me(),u.value=!1},isLoading:e.readonly(u),user:e.readonly(l),isFetchUserWasNeverCalled:p},sdk:n,options:r})}};exports.AccessKeyManagement=k,exports.ApplicationsPortal=j,exports.AuditManagement=U,exports.Descope=h,exports.RoleManagement=S,exports.UserManagement=w,exports.UserProfile=_,exports.default=q,exports.getJwtPermissions=y,exports.getJwtRoles=v,exports.getRefreshToken=b,exports.getSdk=()=>B,exports.getSessionToken=f,exports.isRefreshTokenExpired=(e=b())=>g?.isJwtExpired(e),exports.isSessionTokenExpired=(e=f())=>g?.isJwtExpired(e),exports.routeGuard=()=>e.unref(x)?.(),exports.useDescope=c,exports.useSession=()=>{const{session:t}=l();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,isAuthenticated:e.computed((()=>!!t.session.value))}},exports.useUser=()=>{const{user:t,session:r}=l(),n=()=>{!t.user.value&&r.session.value&&t.fetchUser()};return n(),e.watch(r.session,n),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchUserWasNeverCalled.value)),user:t.user}};
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -436,6 +436,7 @@ declare const useDescope: () => ((({
436
436
  phone?: string;
437
437
  }, signUpOptions?: {
438
438
  customClaims?: Record<string, any>;
439
+ templateId?: string;
439
440
  templateOptions?: {
440
441
  [x: string]: string;
441
442
  };
@@ -451,6 +452,7 @@ declare const useDescope: () => ((({
451
452
  phone?: string;
452
453
  }, signUpOptions?: {
453
454
  customClaims?: Record<string, any>;
455
+ templateId?: string;
454
456
  templateOptions?: {
455
457
  [x: string]: string;
456
458
  };
@@ -466,6 +468,7 @@ declare const useDescope: () => ((({
466
468
  phone?: string;
467
469
  }, signUpOptions?: {
468
470
  customClaims?: Record<string, any>;
471
+ templateId?: string;
469
472
  templateOptions?: {
470
473
  [x: string]: string;
471
474
  };
@@ -481,6 +484,7 @@ declare const useDescope: () => ((({
481
484
  phone?: string;
482
485
  }, signUpOptions?: {
483
486
  customClaims?: Record<string, any>;
487
+ templateId?: string;
484
488
  templateOptions?: {
485
489
  [x: string]: string;
486
490
  };
@@ -569,6 +573,7 @@ declare const useDescope: () => ((({
569
573
  phone?: string;
570
574
  }, signUpOptions?: {
571
575
  customClaims?: Record<string, any>;
576
+ templateId?: string;
572
577
  templateOptions?: {
573
578
  [x: string]: string;
574
579
  };
@@ -584,6 +589,7 @@ declare const useDescope: () => ((({
584
589
  phone?: string;
585
590
  }, signUpOptions?: {
586
591
  customClaims?: Record<string, any>;
592
+ templateId?: string;
587
593
  templateOptions?: {
588
594
  [x: string]: string;
589
595
  };
@@ -599,6 +605,7 @@ declare const useDescope: () => ((({
599
605
  phone?: string;
600
606
  }, signUpOptions?: {
601
607
  customClaims?: Record<string, any>;
608
+ templateId?: string;
602
609
  templateOptions?: {
603
610
  [x: string]: string;
604
611
  };
@@ -614,6 +621,7 @@ declare const useDescope: () => ((({
614
621
  phone?: string;
615
622
  }, signUpOptions?: {
616
623
  customClaims?: Record<string, any>;
624
+ templateId?: string;
617
625
  templateOptions?: {
618
626
  [x: string]: string;
619
627
  };
@@ -624,6 +632,7 @@ declare const useDescope: () => ((({
624
632
  signUpOrIn: {
625
633
  sms: (loginId: string, URI?: string, signUpOptions?: {
626
634
  customClaims?: Record<string, any>;
635
+ templateId?: string;
627
636
  templateOptions?: {
628
637
  [x: string]: string;
629
638
  };
@@ -632,6 +641,7 @@ declare const useDescope: () => ((({
632
641
  }>>;
633
642
  voice: (loginId: string, URI?: string, signUpOptions?: {
634
643
  customClaims?: Record<string, any>;
644
+ templateId?: string;
635
645
  templateOptions?: {
636
646
  [x: string]: string;
637
647
  };
@@ -640,6 +650,7 @@ declare const useDescope: () => ((({
640
650
  }>>;
641
651
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
642
652
  customClaims?: Record<string, any>;
653
+ templateId?: string;
643
654
  templateOptions?: {
644
655
  [x: string]: string;
645
656
  };
@@ -648,6 +659,7 @@ declare const useDescope: () => ((({
648
659
  }>>;
649
660
  email: (loginId: string, URI?: string, signUpOptions?: {
650
661
  customClaims?: Record<string, any>;
662
+ templateId?: string;
651
663
  templateOptions?: {
652
664
  [x: string]: string;
653
665
  };
@@ -701,6 +713,7 @@ declare const useDescope: () => ((({
701
713
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
702
714
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
703
715
  customClaims?: Record<string, any>;
716
+ templateId?: string;
704
717
  templateOptions?: {
705
718
  [x: string]: string;
706
719
  };
@@ -714,6 +727,7 @@ declare const useDescope: () => ((({
714
727
  phone?: string;
715
728
  }, signUpOptions?: {
716
729
  customClaims?: Record<string, any>;
730
+ templateId?: string;
717
731
  templateOptions?: {
718
732
  [x: string]: string;
719
733
  };
@@ -767,6 +781,7 @@ declare const useDescope: () => ((({
767
781
  notp: {
768
782
  signUpOrIn: (loginId?: string, signUpOptions?: {
769
783
  customClaims?: Record<string, any>;
784
+ templateId?: string;
770
785
  templateOptions?: {
771
786
  [x: string]: string;
772
787
  };
@@ -784,6 +799,7 @@ declare const useDescope: () => ((({
784
799
  phone?: string;
785
800
  }, signUpOptions?: {
786
801
  customClaims?: Record<string, any>;
802
+ templateId?: string;
787
803
  templateOptions?: {
788
804
  [x: string]: string;
789
805
  };
@@ -812,6 +828,7 @@ declare const useDescope: () => ((({
812
828
  phone?: string;
813
829
  }, signUpOptions?: {
814
830
  customClaims?: Record<string, any>;
831
+ templateId?: string;
815
832
  templateOptions?: {
816
833
  [x: string]: string;
817
834
  };
@@ -1025,6 +1042,7 @@ declare const useDescope: () => ((({
1025
1042
  phone?: string;
1026
1043
  }, signUpOptions?: {
1027
1044
  customClaims?: Record<string, any>;
1045
+ templateId?: string;
1028
1046
  templateOptions?: {
1029
1047
  [x: string]: string;
1030
1048
  };
@@ -1040,6 +1058,7 @@ declare const useDescope: () => ((({
1040
1058
  phone?: string;
1041
1059
  }, signUpOptions?: {
1042
1060
  customClaims?: Record<string, any>;
1061
+ templateId?: string;
1043
1062
  templateOptions?: {
1044
1063
  [x: string]: string;
1045
1064
  };
@@ -1055,6 +1074,7 @@ declare const useDescope: () => ((({
1055
1074
  phone?: string;
1056
1075
  }, signUpOptions?: {
1057
1076
  customClaims?: Record<string, any>;
1077
+ templateId?: string;
1058
1078
  templateOptions?: {
1059
1079
  [x: string]: string;
1060
1080
  };
@@ -1070,6 +1090,7 @@ declare const useDescope: () => ((({
1070
1090
  phone?: string;
1071
1091
  }, signUpOptions?: {
1072
1092
  customClaims?: Record<string, any>;
1093
+ templateId?: string;
1073
1094
  templateOptions?: {
1074
1095
  [x: string]: string;
1075
1096
  };
@@ -1158,6 +1179,7 @@ declare const useDescope: () => ((({
1158
1179
  phone?: string;
1159
1180
  }, signUpOptions?: {
1160
1181
  customClaims?: Record<string, any>;
1182
+ templateId?: string;
1161
1183
  templateOptions?: {
1162
1184
  [x: string]: string;
1163
1185
  };
@@ -1173,6 +1195,7 @@ declare const useDescope: () => ((({
1173
1195
  phone?: string;
1174
1196
  }, signUpOptions?: {
1175
1197
  customClaims?: Record<string, any>;
1198
+ templateId?: string;
1176
1199
  templateOptions?: {
1177
1200
  [x: string]: string;
1178
1201
  };
@@ -1188,6 +1211,7 @@ declare const useDescope: () => ((({
1188
1211
  phone?: string;
1189
1212
  }, signUpOptions?: {
1190
1213
  customClaims?: Record<string, any>;
1214
+ templateId?: string;
1191
1215
  templateOptions?: {
1192
1216
  [x: string]: string;
1193
1217
  };
@@ -1203,6 +1227,7 @@ declare const useDescope: () => ((({
1203
1227
  phone?: string;
1204
1228
  }, signUpOptions?: {
1205
1229
  customClaims?: Record<string, any>;
1230
+ templateId?: string;
1206
1231
  templateOptions?: {
1207
1232
  [x: string]: string;
1208
1233
  };
@@ -1213,6 +1238,7 @@ declare const useDescope: () => ((({
1213
1238
  signUpOrIn: {
1214
1239
  sms: (loginId: string, URI?: string, signUpOptions?: {
1215
1240
  customClaims?: Record<string, any>;
1241
+ templateId?: string;
1216
1242
  templateOptions?: {
1217
1243
  [x: string]: string;
1218
1244
  };
@@ -1221,6 +1247,7 @@ declare const useDescope: () => ((({
1221
1247
  }>>;
1222
1248
  voice: (loginId: string, URI?: string, signUpOptions?: {
1223
1249
  customClaims?: Record<string, any>;
1250
+ templateId?: string;
1224
1251
  templateOptions?: {
1225
1252
  [x: string]: string;
1226
1253
  };
@@ -1229,6 +1256,7 @@ declare const useDescope: () => ((({
1229
1256
  }>>;
1230
1257
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
1231
1258
  customClaims?: Record<string, any>;
1259
+ templateId?: string;
1232
1260
  templateOptions?: {
1233
1261
  [x: string]: string;
1234
1262
  };
@@ -1237,6 +1265,7 @@ declare const useDescope: () => ((({
1237
1265
  }>>;
1238
1266
  email: (loginId: string, URI?: string, signUpOptions?: {
1239
1267
  customClaims?: Record<string, any>;
1268
+ templateId?: string;
1240
1269
  templateOptions?: {
1241
1270
  [x: string]: string;
1242
1271
  };
@@ -1290,6 +1319,7 @@ declare const useDescope: () => ((({
1290
1319
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1291
1320
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1292
1321
  customClaims?: Record<string, any>;
1322
+ templateId?: string;
1293
1323
  templateOptions?: {
1294
1324
  [x: string]: string;
1295
1325
  };
@@ -1303,6 +1333,7 @@ declare const useDescope: () => ((({
1303
1333
  phone?: string;
1304
1334
  }, signUpOptions?: {
1305
1335
  customClaims?: Record<string, any>;
1336
+ templateId?: string;
1306
1337
  templateOptions?: {
1307
1338
  [x: string]: string;
1308
1339
  };
@@ -1356,6 +1387,7 @@ declare const useDescope: () => ((({
1356
1387
  notp: {
1357
1388
  signUpOrIn: (loginId?: string, signUpOptions?: {
1358
1389
  customClaims?: Record<string, any>;
1390
+ templateId?: string;
1359
1391
  templateOptions?: {
1360
1392
  [x: string]: string;
1361
1393
  };
@@ -1373,6 +1405,7 @@ declare const useDescope: () => ((({
1373
1405
  phone?: string;
1374
1406
  }, signUpOptions?: {
1375
1407
  customClaims?: Record<string, any>;
1408
+ templateId?: string;
1376
1409
  templateOptions?: {
1377
1410
  [x: string]: string;
1378
1411
  };
@@ -1401,6 +1434,7 @@ declare const useDescope: () => ((({
1401
1434
  phone?: string;
1402
1435
  }, signUpOptions?: {
1403
1436
  customClaims?: Record<string, any>;
1437
+ templateId?: string;
1404
1438
  templateOptions?: {
1405
1439
  [x: string]: string;
1406
1440
  };
@@ -1620,6 +1654,7 @@ declare const useDescope: () => ((({
1620
1654
  phone?: string;
1621
1655
  }, signUpOptions?: {
1622
1656
  customClaims?: Record<string, any>;
1657
+ templateId?: string;
1623
1658
  templateOptions?: {
1624
1659
  [x: string]: string;
1625
1660
  };
@@ -1635,6 +1670,7 @@ declare const useDescope: () => ((({
1635
1670
  phone?: string;
1636
1671
  }, signUpOptions?: {
1637
1672
  customClaims?: Record<string, any>;
1673
+ templateId?: string;
1638
1674
  templateOptions?: {
1639
1675
  [x: string]: string;
1640
1676
  };
@@ -1650,6 +1686,7 @@ declare const useDescope: () => ((({
1650
1686
  phone?: string;
1651
1687
  }, signUpOptions?: {
1652
1688
  customClaims?: Record<string, any>;
1689
+ templateId?: string;
1653
1690
  templateOptions?: {
1654
1691
  [x: string]: string;
1655
1692
  };
@@ -1665,6 +1702,7 @@ declare const useDescope: () => ((({
1665
1702
  phone?: string;
1666
1703
  }, signUpOptions?: {
1667
1704
  customClaims?: Record<string, any>;
1705
+ templateId?: string;
1668
1706
  templateOptions?: {
1669
1707
  [x: string]: string;
1670
1708
  };
@@ -1753,6 +1791,7 @@ declare const useDescope: () => ((({
1753
1791
  phone?: string;
1754
1792
  }, signUpOptions?: {
1755
1793
  customClaims?: Record<string, any>;
1794
+ templateId?: string;
1756
1795
  templateOptions?: {
1757
1796
  [x: string]: string;
1758
1797
  };
@@ -1768,6 +1807,7 @@ declare const useDescope: () => ((({
1768
1807
  phone?: string;
1769
1808
  }, signUpOptions?: {
1770
1809
  customClaims?: Record<string, any>;
1810
+ templateId?: string;
1771
1811
  templateOptions?: {
1772
1812
  [x: string]: string;
1773
1813
  };
@@ -1783,6 +1823,7 @@ declare const useDescope: () => ((({
1783
1823
  phone?: string;
1784
1824
  }, signUpOptions?: {
1785
1825
  customClaims?: Record<string, any>;
1826
+ templateId?: string;
1786
1827
  templateOptions?: {
1787
1828
  [x: string]: string;
1788
1829
  };
@@ -1798,6 +1839,7 @@ declare const useDescope: () => ((({
1798
1839
  phone?: string;
1799
1840
  }, signUpOptions?: {
1800
1841
  customClaims?: Record<string, any>;
1842
+ templateId?: string;
1801
1843
  templateOptions?: {
1802
1844
  [x: string]: string;
1803
1845
  };
@@ -1808,6 +1850,7 @@ declare const useDescope: () => ((({
1808
1850
  signUpOrIn: {
1809
1851
  sms: (loginId: string, URI?: string, signUpOptions?: {
1810
1852
  customClaims?: Record<string, any>;
1853
+ templateId?: string;
1811
1854
  templateOptions?: {
1812
1855
  [x: string]: string;
1813
1856
  };
@@ -1816,6 +1859,7 @@ declare const useDescope: () => ((({
1816
1859
  }>>;
1817
1860
  voice: (loginId: string, URI?: string, signUpOptions?: {
1818
1861
  customClaims?: Record<string, any>;
1862
+ templateId?: string;
1819
1863
  templateOptions?: {
1820
1864
  [x: string]: string;
1821
1865
  };
@@ -1824,6 +1868,7 @@ declare const useDescope: () => ((({
1824
1868
  }>>;
1825
1869
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
1826
1870
  customClaims?: Record<string, any>;
1871
+ templateId?: string;
1827
1872
  templateOptions?: {
1828
1873
  [x: string]: string;
1829
1874
  };
@@ -1832,6 +1877,7 @@ declare const useDescope: () => ((({
1832
1877
  }>>;
1833
1878
  email: (loginId: string, URI?: string, signUpOptions?: {
1834
1879
  customClaims?: Record<string, any>;
1880
+ templateId?: string;
1835
1881
  templateOptions?: {
1836
1882
  [x: string]: string;
1837
1883
  };
@@ -1885,6 +1931,7 @@ declare const useDescope: () => ((({
1885
1931
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1886
1932
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1887
1933
  customClaims?: Record<string, any>;
1934
+ templateId?: string;
1888
1935
  templateOptions?: {
1889
1936
  [x: string]: string;
1890
1937
  };
@@ -1898,6 +1945,7 @@ declare const useDescope: () => ((({
1898
1945
  phone?: string;
1899
1946
  }, signUpOptions?: {
1900
1947
  customClaims?: Record<string, any>;
1948
+ templateId?: string;
1901
1949
  templateOptions?: {
1902
1950
  [x: string]: string;
1903
1951
  };
@@ -1951,6 +1999,7 @@ declare const useDescope: () => ((({
1951
1999
  notp: {
1952
2000
  signUpOrIn: (loginId?: string, signUpOptions?: {
1953
2001
  customClaims?: Record<string, any>;
2002
+ templateId?: string;
1954
2003
  templateOptions?: {
1955
2004
  [x: string]: string;
1956
2005
  };
@@ -1968,6 +2017,7 @@ declare const useDescope: () => ((({
1968
2017
  phone?: string;
1969
2018
  }, signUpOptions?: {
1970
2019
  customClaims?: Record<string, any>;
2020
+ templateId?: string;
1971
2021
  templateOptions?: {
1972
2022
  [x: string]: string;
1973
2023
  };
@@ -1996,6 +2046,7 @@ declare const useDescope: () => ((({
1996
2046
  phone?: string;
1997
2047
  }, signUpOptions?: {
1998
2048
  customClaims?: Record<string, any>;
2049
+ templateId?: string;
1999
2050
  templateOptions?: {
2000
2051
  [x: string]: string;
2001
2052
  };
@@ -2209,6 +2260,7 @@ declare const useDescope: () => ((({
2209
2260
  phone?: string;
2210
2261
  }, signUpOptions?: {
2211
2262
  customClaims?: Record<string, any>;
2263
+ templateId?: string;
2212
2264
  templateOptions?: {
2213
2265
  [x: string]: string;
2214
2266
  };
@@ -2224,6 +2276,7 @@ declare const useDescope: () => ((({
2224
2276
  phone?: string;
2225
2277
  }, signUpOptions?: {
2226
2278
  customClaims?: Record<string, any>;
2279
+ templateId?: string;
2227
2280
  templateOptions?: {
2228
2281
  [x: string]: string;
2229
2282
  };
@@ -2239,6 +2292,7 @@ declare const useDescope: () => ((({
2239
2292
  phone?: string;
2240
2293
  }, signUpOptions?: {
2241
2294
  customClaims?: Record<string, any>;
2295
+ templateId?: string;
2242
2296
  templateOptions?: {
2243
2297
  [x: string]: string;
2244
2298
  };
@@ -2254,6 +2308,7 @@ declare const useDescope: () => ((({
2254
2308
  phone?: string;
2255
2309
  }, signUpOptions?: {
2256
2310
  customClaims?: Record<string, any>;
2311
+ templateId?: string;
2257
2312
  templateOptions?: {
2258
2313
  [x: string]: string;
2259
2314
  };
@@ -2342,6 +2397,7 @@ declare const useDescope: () => ((({
2342
2397
  phone?: string;
2343
2398
  }, signUpOptions?: {
2344
2399
  customClaims?: Record<string, any>;
2400
+ templateId?: string;
2345
2401
  templateOptions?: {
2346
2402
  [x: string]: string;
2347
2403
  };
@@ -2357,6 +2413,7 @@ declare const useDescope: () => ((({
2357
2413
  phone?: string;
2358
2414
  }, signUpOptions?: {
2359
2415
  customClaims?: Record<string, any>;
2416
+ templateId?: string;
2360
2417
  templateOptions?: {
2361
2418
  [x: string]: string;
2362
2419
  };
@@ -2372,6 +2429,7 @@ declare const useDescope: () => ((({
2372
2429
  phone?: string;
2373
2430
  }, signUpOptions?: {
2374
2431
  customClaims?: Record<string, any>;
2432
+ templateId?: string;
2375
2433
  templateOptions?: {
2376
2434
  [x: string]: string;
2377
2435
  };
@@ -2387,6 +2445,7 @@ declare const useDescope: () => ((({
2387
2445
  phone?: string;
2388
2446
  }, signUpOptions?: {
2389
2447
  customClaims?: Record<string, any>;
2448
+ templateId?: string;
2390
2449
  templateOptions?: {
2391
2450
  [x: string]: string;
2392
2451
  };
@@ -2397,6 +2456,7 @@ declare const useDescope: () => ((({
2397
2456
  signUpOrIn: {
2398
2457
  sms: (loginId: string, URI?: string, signUpOptions?: {
2399
2458
  customClaims?: Record<string, any>;
2459
+ templateId?: string;
2400
2460
  templateOptions?: {
2401
2461
  [x: string]: string;
2402
2462
  };
@@ -2405,6 +2465,7 @@ declare const useDescope: () => ((({
2405
2465
  }>>;
2406
2466
  voice: (loginId: string, URI?: string, signUpOptions?: {
2407
2467
  customClaims?: Record<string, any>;
2468
+ templateId?: string;
2408
2469
  templateOptions?: {
2409
2470
  [x: string]: string;
2410
2471
  };
@@ -2413,6 +2474,7 @@ declare const useDescope: () => ((({
2413
2474
  }>>;
2414
2475
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
2415
2476
  customClaims?: Record<string, any>;
2477
+ templateId?: string;
2416
2478
  templateOptions?: {
2417
2479
  [x: string]: string;
2418
2480
  };
@@ -2421,6 +2483,7 @@ declare const useDescope: () => ((({
2421
2483
  }>>;
2422
2484
  email: (loginId: string, URI?: string, signUpOptions?: {
2423
2485
  customClaims?: Record<string, any>;
2486
+ templateId?: string;
2424
2487
  templateOptions?: {
2425
2488
  [x: string]: string;
2426
2489
  };
@@ -2474,6 +2537,7 @@ declare const useDescope: () => ((({
2474
2537
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2475
2538
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
2476
2539
  customClaims?: Record<string, any>;
2540
+ templateId?: string;
2477
2541
  templateOptions?: {
2478
2542
  [x: string]: string;
2479
2543
  };
@@ -2487,6 +2551,7 @@ declare const useDescope: () => ((({
2487
2551
  phone?: string;
2488
2552
  }, signUpOptions?: {
2489
2553
  customClaims?: Record<string, any>;
2554
+ templateId?: string;
2490
2555
  templateOptions?: {
2491
2556
  [x: string]: string;
2492
2557
  };
@@ -2540,6 +2605,7 @@ declare const useDescope: () => ((({
2540
2605
  notp: {
2541
2606
  signUpOrIn: (loginId?: string, signUpOptions?: {
2542
2607
  customClaims?: Record<string, any>;
2608
+ templateId?: string;
2543
2609
  templateOptions?: {
2544
2610
  [x: string]: string;
2545
2611
  };
@@ -2557,6 +2623,7 @@ declare const useDescope: () => ((({
2557
2623
  phone?: string;
2558
2624
  }, signUpOptions?: {
2559
2625
  customClaims?: Record<string, any>;
2626
+ templateId?: string;
2560
2627
  templateOptions?: {
2561
2628
  [x: string]: string;
2562
2629
  };
@@ -2585,6 +2652,7 @@ declare const useDescope: () => ((({
2585
2652
  phone?: string;
2586
2653
  }, signUpOptions?: {
2587
2654
  customClaims?: Record<string, any>;
2655
+ templateId?: string;
2588
2656
  templateOptions?: {
2589
2657
  [x: string]: string;
2590
2658
  };
@@ -2824,6 +2892,7 @@ declare const getSdk: () => ((({
2824
2892
  phone?: string;
2825
2893
  }, signUpOptions?: {
2826
2894
  customClaims?: Record<string, any>;
2895
+ templateId?: string;
2827
2896
  templateOptions?: {
2828
2897
  [x: string]: string;
2829
2898
  };
@@ -2839,6 +2908,7 @@ declare const getSdk: () => ((({
2839
2908
  phone?: string;
2840
2909
  }, signUpOptions?: {
2841
2910
  customClaims?: Record<string, any>;
2911
+ templateId?: string;
2842
2912
  templateOptions?: {
2843
2913
  [x: string]: string;
2844
2914
  };
@@ -2854,6 +2924,7 @@ declare const getSdk: () => ((({
2854
2924
  phone?: string;
2855
2925
  }, signUpOptions?: {
2856
2926
  customClaims?: Record<string, any>;
2927
+ templateId?: string;
2857
2928
  templateOptions?: {
2858
2929
  [x: string]: string;
2859
2930
  };
@@ -2869,6 +2940,7 @@ declare const getSdk: () => ((({
2869
2940
  phone?: string;
2870
2941
  }, signUpOptions?: {
2871
2942
  customClaims?: Record<string, any>;
2943
+ templateId?: string;
2872
2944
  templateOptions?: {
2873
2945
  [x: string]: string;
2874
2946
  };
@@ -2957,6 +3029,7 @@ declare const getSdk: () => ((({
2957
3029
  phone?: string;
2958
3030
  }, signUpOptions?: {
2959
3031
  customClaims?: Record<string, any>;
3032
+ templateId?: string;
2960
3033
  templateOptions?: {
2961
3034
  [x: string]: string;
2962
3035
  };
@@ -2972,6 +3045,7 @@ declare const getSdk: () => ((({
2972
3045
  phone?: string;
2973
3046
  }, signUpOptions?: {
2974
3047
  customClaims?: Record<string, any>;
3048
+ templateId?: string;
2975
3049
  templateOptions?: {
2976
3050
  [x: string]: string;
2977
3051
  };
@@ -2987,6 +3061,7 @@ declare const getSdk: () => ((({
2987
3061
  phone?: string;
2988
3062
  }, signUpOptions?: {
2989
3063
  customClaims?: Record<string, any>;
3064
+ templateId?: string;
2990
3065
  templateOptions?: {
2991
3066
  [x: string]: string;
2992
3067
  };
@@ -3002,6 +3077,7 @@ declare const getSdk: () => ((({
3002
3077
  phone?: string;
3003
3078
  }, signUpOptions?: {
3004
3079
  customClaims?: Record<string, any>;
3080
+ templateId?: string;
3005
3081
  templateOptions?: {
3006
3082
  [x: string]: string;
3007
3083
  };
@@ -3012,6 +3088,7 @@ declare const getSdk: () => ((({
3012
3088
  signUpOrIn: {
3013
3089
  sms: (loginId: string, URI?: string, signUpOptions?: {
3014
3090
  customClaims?: Record<string, any>;
3091
+ templateId?: string;
3015
3092
  templateOptions?: {
3016
3093
  [x: string]: string;
3017
3094
  };
@@ -3020,6 +3097,7 @@ declare const getSdk: () => ((({
3020
3097
  }>>;
3021
3098
  voice: (loginId: string, URI?: string, signUpOptions?: {
3022
3099
  customClaims?: Record<string, any>;
3100
+ templateId?: string;
3023
3101
  templateOptions?: {
3024
3102
  [x: string]: string;
3025
3103
  };
@@ -3028,6 +3106,7 @@ declare const getSdk: () => ((({
3028
3106
  }>>;
3029
3107
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
3030
3108
  customClaims?: Record<string, any>;
3109
+ templateId?: string;
3031
3110
  templateOptions?: {
3032
3111
  [x: string]: string;
3033
3112
  };
@@ -3036,6 +3115,7 @@ declare const getSdk: () => ((({
3036
3115
  }>>;
3037
3116
  email: (loginId: string, URI?: string, signUpOptions?: {
3038
3117
  customClaims?: Record<string, any>;
3118
+ templateId?: string;
3039
3119
  templateOptions?: {
3040
3120
  [x: string]: string;
3041
3121
  };
@@ -3089,6 +3169,7 @@ declare const getSdk: () => ((({
3089
3169
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3090
3170
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
3091
3171
  customClaims?: Record<string, any>;
3172
+ templateId?: string;
3092
3173
  templateOptions?: {
3093
3174
  [x: string]: string;
3094
3175
  };
@@ -3102,6 +3183,7 @@ declare const getSdk: () => ((({
3102
3183
  phone?: string;
3103
3184
  }, signUpOptions?: {
3104
3185
  customClaims?: Record<string, any>;
3186
+ templateId?: string;
3105
3187
  templateOptions?: {
3106
3188
  [x: string]: string;
3107
3189
  };
@@ -3155,6 +3237,7 @@ declare const getSdk: () => ((({
3155
3237
  notp: {
3156
3238
  signUpOrIn: (loginId?: string, signUpOptions?: {
3157
3239
  customClaims?: Record<string, any>;
3240
+ templateId?: string;
3158
3241
  templateOptions?: {
3159
3242
  [x: string]: string;
3160
3243
  };
@@ -3172,6 +3255,7 @@ declare const getSdk: () => ((({
3172
3255
  phone?: string;
3173
3256
  }, signUpOptions?: {
3174
3257
  customClaims?: Record<string, any>;
3258
+ templateId?: string;
3175
3259
  templateOptions?: {
3176
3260
  [x: string]: string;
3177
3261
  };
@@ -3200,6 +3284,7 @@ declare const getSdk: () => ((({
3200
3284
  phone?: string;
3201
3285
  }, signUpOptions?: {
3202
3286
  customClaims?: Record<string, any>;
3287
+ templateId?: string;
3203
3288
  templateOptions?: {
3204
3289
  [x: string]: string;
3205
3290
  };
@@ -3413,6 +3498,7 @@ declare const getSdk: () => ((({
3413
3498
  phone?: string;
3414
3499
  }, signUpOptions?: {
3415
3500
  customClaims?: Record<string, any>;
3501
+ templateId?: string;
3416
3502
  templateOptions?: {
3417
3503
  [x: string]: string;
3418
3504
  };
@@ -3428,6 +3514,7 @@ declare const getSdk: () => ((({
3428
3514
  phone?: string;
3429
3515
  }, signUpOptions?: {
3430
3516
  customClaims?: Record<string, any>;
3517
+ templateId?: string;
3431
3518
  templateOptions?: {
3432
3519
  [x: string]: string;
3433
3520
  };
@@ -3443,6 +3530,7 @@ declare const getSdk: () => ((({
3443
3530
  phone?: string;
3444
3531
  }, signUpOptions?: {
3445
3532
  customClaims?: Record<string, any>;
3533
+ templateId?: string;
3446
3534
  templateOptions?: {
3447
3535
  [x: string]: string;
3448
3536
  };
@@ -3458,6 +3546,7 @@ declare const getSdk: () => ((({
3458
3546
  phone?: string;
3459
3547
  }, signUpOptions?: {
3460
3548
  customClaims?: Record<string, any>;
3549
+ templateId?: string;
3461
3550
  templateOptions?: {
3462
3551
  [x: string]: string;
3463
3552
  };
@@ -3546,6 +3635,7 @@ declare const getSdk: () => ((({
3546
3635
  phone?: string;
3547
3636
  }, signUpOptions?: {
3548
3637
  customClaims?: Record<string, any>;
3638
+ templateId?: string;
3549
3639
  templateOptions?: {
3550
3640
  [x: string]: string;
3551
3641
  };
@@ -3561,6 +3651,7 @@ declare const getSdk: () => ((({
3561
3651
  phone?: string;
3562
3652
  }, signUpOptions?: {
3563
3653
  customClaims?: Record<string, any>;
3654
+ templateId?: string;
3564
3655
  templateOptions?: {
3565
3656
  [x: string]: string;
3566
3657
  };
@@ -3576,6 +3667,7 @@ declare const getSdk: () => ((({
3576
3667
  phone?: string;
3577
3668
  }, signUpOptions?: {
3578
3669
  customClaims?: Record<string, any>;
3670
+ templateId?: string;
3579
3671
  templateOptions?: {
3580
3672
  [x: string]: string;
3581
3673
  };
@@ -3591,6 +3683,7 @@ declare const getSdk: () => ((({
3591
3683
  phone?: string;
3592
3684
  }, signUpOptions?: {
3593
3685
  customClaims?: Record<string, any>;
3686
+ templateId?: string;
3594
3687
  templateOptions?: {
3595
3688
  [x: string]: string;
3596
3689
  };
@@ -3601,6 +3694,7 @@ declare const getSdk: () => ((({
3601
3694
  signUpOrIn: {
3602
3695
  sms: (loginId: string, URI?: string, signUpOptions?: {
3603
3696
  customClaims?: Record<string, any>;
3697
+ templateId?: string;
3604
3698
  templateOptions?: {
3605
3699
  [x: string]: string;
3606
3700
  };
@@ -3609,6 +3703,7 @@ declare const getSdk: () => ((({
3609
3703
  }>>;
3610
3704
  voice: (loginId: string, URI?: string, signUpOptions?: {
3611
3705
  customClaims?: Record<string, any>;
3706
+ templateId?: string;
3612
3707
  templateOptions?: {
3613
3708
  [x: string]: string;
3614
3709
  };
@@ -3617,6 +3712,7 @@ declare const getSdk: () => ((({
3617
3712
  }>>;
3618
3713
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
3619
3714
  customClaims?: Record<string, any>;
3715
+ templateId?: string;
3620
3716
  templateOptions?: {
3621
3717
  [x: string]: string;
3622
3718
  };
@@ -3625,6 +3721,7 @@ declare const getSdk: () => ((({
3625
3721
  }>>;
3626
3722
  email: (loginId: string, URI?: string, signUpOptions?: {
3627
3723
  customClaims?: Record<string, any>;
3724
+ templateId?: string;
3628
3725
  templateOptions?: {
3629
3726
  [x: string]: string;
3630
3727
  };
@@ -3678,6 +3775,7 @@ declare const getSdk: () => ((({
3678
3775
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3679
3776
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
3680
3777
  customClaims?: Record<string, any>;
3778
+ templateId?: string;
3681
3779
  templateOptions?: {
3682
3780
  [x: string]: string;
3683
3781
  };
@@ -3691,6 +3789,7 @@ declare const getSdk: () => ((({
3691
3789
  phone?: string;
3692
3790
  }, signUpOptions?: {
3693
3791
  customClaims?: Record<string, any>;
3792
+ templateId?: string;
3694
3793
  templateOptions?: {
3695
3794
  [x: string]: string;
3696
3795
  };
@@ -3744,6 +3843,7 @@ declare const getSdk: () => ((({
3744
3843
  notp: {
3745
3844
  signUpOrIn: (loginId?: string, signUpOptions?: {
3746
3845
  customClaims?: Record<string, any>;
3846
+ templateId?: string;
3747
3847
  templateOptions?: {
3748
3848
  [x: string]: string;
3749
3849
  };
@@ -3761,6 +3861,7 @@ declare const getSdk: () => ((({
3761
3861
  phone?: string;
3762
3862
  }, signUpOptions?: {
3763
3863
  customClaims?: Record<string, any>;
3864
+ templateId?: string;
3764
3865
  templateOptions?: {
3765
3866
  [x: string]: string;
3766
3867
  };
@@ -3789,6 +3890,7 @@ declare const getSdk: () => ((({
3789
3890
  phone?: string;
3790
3891
  }, signUpOptions?: {
3791
3892
  customClaims?: Record<string, any>;
3893
+ templateId?: string;
3792
3894
  templateOptions?: {
3793
3895
  [x: string]: string;
3794
3896
  };
@@ -4008,6 +4110,7 @@ declare const getSdk: () => ((({
4008
4110
  phone?: string;
4009
4111
  }, signUpOptions?: {
4010
4112
  customClaims?: Record<string, any>;
4113
+ templateId?: string;
4011
4114
  templateOptions?: {
4012
4115
  [x: string]: string;
4013
4116
  };
@@ -4023,6 +4126,7 @@ declare const getSdk: () => ((({
4023
4126
  phone?: string;
4024
4127
  }, signUpOptions?: {
4025
4128
  customClaims?: Record<string, any>;
4129
+ templateId?: string;
4026
4130
  templateOptions?: {
4027
4131
  [x: string]: string;
4028
4132
  };
@@ -4038,6 +4142,7 @@ declare const getSdk: () => ((({
4038
4142
  phone?: string;
4039
4143
  }, signUpOptions?: {
4040
4144
  customClaims?: Record<string, any>;
4145
+ templateId?: string;
4041
4146
  templateOptions?: {
4042
4147
  [x: string]: string;
4043
4148
  };
@@ -4053,6 +4158,7 @@ declare const getSdk: () => ((({
4053
4158
  phone?: string;
4054
4159
  }, signUpOptions?: {
4055
4160
  customClaims?: Record<string, any>;
4161
+ templateId?: string;
4056
4162
  templateOptions?: {
4057
4163
  [x: string]: string;
4058
4164
  };
@@ -4141,6 +4247,7 @@ declare const getSdk: () => ((({
4141
4247
  phone?: string;
4142
4248
  }, signUpOptions?: {
4143
4249
  customClaims?: Record<string, any>;
4250
+ templateId?: string;
4144
4251
  templateOptions?: {
4145
4252
  [x: string]: string;
4146
4253
  };
@@ -4156,6 +4263,7 @@ declare const getSdk: () => ((({
4156
4263
  phone?: string;
4157
4264
  }, signUpOptions?: {
4158
4265
  customClaims?: Record<string, any>;
4266
+ templateId?: string;
4159
4267
  templateOptions?: {
4160
4268
  [x: string]: string;
4161
4269
  };
@@ -4171,6 +4279,7 @@ declare const getSdk: () => ((({
4171
4279
  phone?: string;
4172
4280
  }, signUpOptions?: {
4173
4281
  customClaims?: Record<string, any>;
4282
+ templateId?: string;
4174
4283
  templateOptions?: {
4175
4284
  [x: string]: string;
4176
4285
  };
@@ -4186,6 +4295,7 @@ declare const getSdk: () => ((({
4186
4295
  phone?: string;
4187
4296
  }, signUpOptions?: {
4188
4297
  customClaims?: Record<string, any>;
4298
+ templateId?: string;
4189
4299
  templateOptions?: {
4190
4300
  [x: string]: string;
4191
4301
  };
@@ -4196,6 +4306,7 @@ declare const getSdk: () => ((({
4196
4306
  signUpOrIn: {
4197
4307
  sms: (loginId: string, URI?: string, signUpOptions?: {
4198
4308
  customClaims?: Record<string, any>;
4309
+ templateId?: string;
4199
4310
  templateOptions?: {
4200
4311
  [x: string]: string;
4201
4312
  };
@@ -4204,6 +4315,7 @@ declare const getSdk: () => ((({
4204
4315
  }>>;
4205
4316
  voice: (loginId: string, URI?: string, signUpOptions?: {
4206
4317
  customClaims?: Record<string, any>;
4318
+ templateId?: string;
4207
4319
  templateOptions?: {
4208
4320
  [x: string]: string;
4209
4321
  };
@@ -4212,6 +4324,7 @@ declare const getSdk: () => ((({
4212
4324
  }>>;
4213
4325
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
4214
4326
  customClaims?: Record<string, any>;
4327
+ templateId?: string;
4215
4328
  templateOptions?: {
4216
4329
  [x: string]: string;
4217
4330
  };
@@ -4220,6 +4333,7 @@ declare const getSdk: () => ((({
4220
4333
  }>>;
4221
4334
  email: (loginId: string, URI?: string, signUpOptions?: {
4222
4335
  customClaims?: Record<string, any>;
4336
+ templateId?: string;
4223
4337
  templateOptions?: {
4224
4338
  [x: string]: string;
4225
4339
  };
@@ -4273,6 +4387,7 @@ declare const getSdk: () => ((({
4273
4387
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
4274
4388
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
4275
4389
  customClaims?: Record<string, any>;
4390
+ templateId?: string;
4276
4391
  templateOptions?: {
4277
4392
  [x: string]: string;
4278
4393
  };
@@ -4286,6 +4401,7 @@ declare const getSdk: () => ((({
4286
4401
  phone?: string;
4287
4402
  }, signUpOptions?: {
4288
4403
  customClaims?: Record<string, any>;
4404
+ templateId?: string;
4289
4405
  templateOptions?: {
4290
4406
  [x: string]: string;
4291
4407
  };
@@ -4339,6 +4455,7 @@ declare const getSdk: () => ((({
4339
4455
  notp: {
4340
4456
  signUpOrIn: (loginId?: string, signUpOptions?: {
4341
4457
  customClaims?: Record<string, any>;
4458
+ templateId?: string;
4342
4459
  templateOptions?: {
4343
4460
  [x: string]: string;
4344
4461
  };
@@ -4356,6 +4473,7 @@ declare const getSdk: () => ((({
4356
4473
  phone?: string;
4357
4474
  }, signUpOptions?: {
4358
4475
  customClaims?: Record<string, any>;
4476
+ templateId?: string;
4359
4477
  templateOptions?: {
4360
4478
  [x: string]: string;
4361
4479
  };
@@ -4384,6 +4502,7 @@ declare const getSdk: () => ((({
4384
4502
  phone?: string;
4385
4503
  }, signUpOptions?: {
4386
4504
  customClaims?: Record<string, any>;
4505
+ templateId?: string;
4387
4506
  templateOptions?: {
4388
4507
  [x: string]: string;
4389
4508
  };
@@ -4597,6 +4716,7 @@ declare const getSdk: () => ((({
4597
4716
  phone?: string;
4598
4717
  }, signUpOptions?: {
4599
4718
  customClaims?: Record<string, any>;
4719
+ templateId?: string;
4600
4720
  templateOptions?: {
4601
4721
  [x: string]: string;
4602
4722
  };
@@ -4612,6 +4732,7 @@ declare const getSdk: () => ((({
4612
4732
  phone?: string;
4613
4733
  }, signUpOptions?: {
4614
4734
  customClaims?: Record<string, any>;
4735
+ templateId?: string;
4615
4736
  templateOptions?: {
4616
4737
  [x: string]: string;
4617
4738
  };
@@ -4627,6 +4748,7 @@ declare const getSdk: () => ((({
4627
4748
  phone?: string;
4628
4749
  }, signUpOptions?: {
4629
4750
  customClaims?: Record<string, any>;
4751
+ templateId?: string;
4630
4752
  templateOptions?: {
4631
4753
  [x: string]: string;
4632
4754
  };
@@ -4642,6 +4764,7 @@ declare const getSdk: () => ((({
4642
4764
  phone?: string;
4643
4765
  }, signUpOptions?: {
4644
4766
  customClaims?: Record<string, any>;
4767
+ templateId?: string;
4645
4768
  templateOptions?: {
4646
4769
  [x: string]: string;
4647
4770
  };
@@ -4730,6 +4853,7 @@ declare const getSdk: () => ((({
4730
4853
  phone?: string;
4731
4854
  }, signUpOptions?: {
4732
4855
  customClaims?: Record<string, any>;
4856
+ templateId?: string;
4733
4857
  templateOptions?: {
4734
4858
  [x: string]: string;
4735
4859
  };
@@ -4745,6 +4869,7 @@ declare const getSdk: () => ((({
4745
4869
  phone?: string;
4746
4870
  }, signUpOptions?: {
4747
4871
  customClaims?: Record<string, any>;
4872
+ templateId?: string;
4748
4873
  templateOptions?: {
4749
4874
  [x: string]: string;
4750
4875
  };
@@ -4760,6 +4885,7 @@ declare const getSdk: () => ((({
4760
4885
  phone?: string;
4761
4886
  }, signUpOptions?: {
4762
4887
  customClaims?: Record<string, any>;
4888
+ templateId?: string;
4763
4889
  templateOptions?: {
4764
4890
  [x: string]: string;
4765
4891
  };
@@ -4775,6 +4901,7 @@ declare const getSdk: () => ((({
4775
4901
  phone?: string;
4776
4902
  }, signUpOptions?: {
4777
4903
  customClaims?: Record<string, any>;
4904
+ templateId?: string;
4778
4905
  templateOptions?: {
4779
4906
  [x: string]: string;
4780
4907
  };
@@ -4785,6 +4912,7 @@ declare const getSdk: () => ((({
4785
4912
  signUpOrIn: {
4786
4913
  sms: (loginId: string, URI?: string, signUpOptions?: {
4787
4914
  customClaims?: Record<string, any>;
4915
+ templateId?: string;
4788
4916
  templateOptions?: {
4789
4917
  [x: string]: string;
4790
4918
  };
@@ -4793,6 +4921,7 @@ declare const getSdk: () => ((({
4793
4921
  }>>;
4794
4922
  voice: (loginId: string, URI?: string, signUpOptions?: {
4795
4923
  customClaims?: Record<string, any>;
4924
+ templateId?: string;
4796
4925
  templateOptions?: {
4797
4926
  [x: string]: string;
4798
4927
  };
@@ -4801,6 +4930,7 @@ declare const getSdk: () => ((({
4801
4930
  }>>;
4802
4931
  whatsapp: (loginId: string, URI?: string, signUpOptions?: {
4803
4932
  customClaims?: Record<string, any>;
4933
+ templateId?: string;
4804
4934
  templateOptions?: {
4805
4935
  [x: string]: string;
4806
4936
  };
@@ -4809,6 +4939,7 @@ declare const getSdk: () => ((({
4809
4939
  }>>;
4810
4940
  email: (loginId: string, URI?: string, signUpOptions?: {
4811
4941
  customClaims?: Record<string, any>;
4942
+ templateId?: string;
4812
4943
  templateOptions?: {
4813
4944
  [x: string]: string;
4814
4945
  };
@@ -4862,6 +4993,7 @@ declare const getSdk: () => ((({
4862
4993
  signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
4863
4994
  signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
4864
4995
  customClaims?: Record<string, any>;
4996
+ templateId?: string;
4865
4997
  templateOptions?: {
4866
4998
  [x: string]: string;
4867
4999
  };
@@ -4875,6 +5007,7 @@ declare const getSdk: () => ((({
4875
5007
  phone?: string;
4876
5008
  }, signUpOptions?: {
4877
5009
  customClaims?: Record<string, any>;
5010
+ templateId?: string;
4878
5011
  templateOptions?: {
4879
5012
  [x: string]: string;
4880
5013
  };
@@ -4928,6 +5061,7 @@ declare const getSdk: () => ((({
4928
5061
  notp: {
4929
5062
  signUpOrIn: (loginId?: string, signUpOptions?: {
4930
5063
  customClaims?: Record<string, any>;
5064
+ templateId?: string;
4931
5065
  templateOptions?: {
4932
5066
  [x: string]: string;
4933
5067
  };
@@ -4945,6 +5079,7 @@ declare const getSdk: () => ((({
4945
5079
  phone?: string;
4946
5080
  }, signUpOptions?: {
4947
5081
  customClaims?: Record<string, any>;
5082
+ templateId?: string;
4948
5083
  templateOptions?: {
4949
5084
  [x: string]: string;
4950
5085
  };
@@ -4973,6 +5108,7 @@ declare const getSdk: () => ((({
4973
5108
  phone?: string;
4974
5109
  }, signUpOptions?: {
4975
5110
  customClaims?: Record<string, any>;
5111
+ templateId?: string;
4976
5112
  templateOptions?: {
4977
5113
  [x: string]: string;
4978
5114
  };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{computed as e,watch as t,inject as r,defineComponent as s,resolveComponent as n,openBlock as a,createElementBlock as i,createVNode as o,unref as d,ref as l,readonly as u}from"vue";import c from"@descope/web-component";import p from"@descope/web-js-sdk";import"@descope/user-management-widget";import"@descope/role-management-widget";import"@descope/access-key-management-widget";import"@descope/audit-management-widget";import"@descope/user-profile-widget";import"@descope/applications-portal-widget";const g=Symbol("$descope"),m={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.1.1"},b="undefined"!=typeof window,y=()=>{const e=r(g);if(!e)throw Error("Missing Descope context, make sure you are using the Descope plugin");return e},v=()=>y().options,h=()=>y().sdk,w=()=>{const{session:t}=y();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(),{isLoading:e((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,isAuthenticated:e((()=>!!t.session.value))}},f=()=>{const{user:r,session:s}=y(),n=()=>{!r.user.value&&s.session.value&&r.fetchUser()};return n(),t(s.session,n),{isLoading:e((()=>r.isLoading.value||r.isFetchUserWasNeverCalled.value)),user:r.user}},S=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let U;const _=e=>{const t=p({persistTokens:b,storeLastAuthenticatedUser:b,...e,autoRefresh:b});return U=t,t};U=_({projectId:"temp pid"});const j=()=>b?U?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),I=()=>b?U?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),k=(e=j())=>U?.isJwtExpired(e),q=(e=I())=>U?.isJwtExpired(e),R=S(((e=j(),t)=>U?.getJwtPermissions(e,t))),M=S(((e=j(),t)=>U?.getJwtRoles(e,t)));var A=s({__name:"Descope",props:{flowId:{type:String,required:!0},tenant:{type:String},theme:{type:String},locale:{type:String},debug:{type:Boolean},telemetryKey:{type:String},redirectUrl:{type:String},autoFocus:{type:Boolean||String},validateOnBlur:{type:Boolean},errorTransformer:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String}},emits:["success","error","ready"],setup(t,{emit:r}){c.sdkConfigOverrides={baseHeaders:m,persistTokens:!1,hooks:{get beforeRequest(){return U.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const s=t,l=r,{projectId:u,baseUrl:p,baseStaticUrl:g,storeLastAuthenticatedUser:b}=v(),y=h(),w=e((()=>s.form?JSON.stringify(s.form):"")),f=e((()=>s.client?JSON.stringify(s.client):"")),S=async e=>{await(y.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),l("success",e)},_=e=>l("error",e),j=e=>l("ready",e);return(e,r)=>{const s=n("descope-wc");return a(),i("div",null,[o(s,{"project-id":d(u),"base-url":d(p),"base-static-url":d(g),"flow-id":t.flowId,"^theme":t.theme,"^locale":t.locale,"^tenant":t.tenant,"^debug":t.debug,"^telemetryKey":t.telemetryKey,"redirect-url":t.redirectUrl,"auto-focus":t.autoFocus,"style-id":t.styleId,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":d(b),".errorTransformer":t.errorTransformer,"^form":w.value,"^client":f.value,onSuccess:S,onError:_,onReady:j},null,40,["project-id","base-url","base-static-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","store-last-authenticated-user",".errorTransformer","^form","^client"])])}}});A.__file="src/Descope.vue";var B=s({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-user-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});B.__file="src/UserManagement.vue";var T=s({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-role-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});T.__file="src/RoleManagement.vue";var C=s({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-access-key-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});C.__file="src/AccessKeyManagement.vue";var L=s({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-audit-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});L.__file="src/AuditManagement.vue";var F=s({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},emits:["logout"],setup(e,{emit:t}){const r=t,s=e=>r("logout",e),{projectId:l,baseUrl:u,baseStaticUrl:c}=v();return(t,r)=>{const p=n("descope-user-profile-widget");return a(),i("div",null,[o(p,{"project-id":d(l),"base-url":d(u),"base-static-url":d(c),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId,onLogout:s},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});F.__file="src/UserProfile.vue";var N=s({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-applications-portal-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});N.__file="src/ApplicationsPortal.vue";const O=l(null),P=()=>d(O)?.();let J;const K=()=>J;var x={install:function(r,s){const n=_({persistTokens:!0,...s,autoRefresh:!0,baseHeaders:m});J=n;const a=l(null),i=l(""),o=l(null),c=l(null);n.onSessionTokenChange((e=>{i.value=e})),n.onUserChange((e=>{c.value=e}));const p=async()=>{a.value=!0,await n.refresh(),a.value=!1},b=e((()=>null===a.value)),y=e((()=>null===o.value));O.value=()=>new Promise(((e,r)=>{!i.value&&b.value&&p().catch(r),t((()=>a.value),(()=>!a.value&&e(!!d(i))),{immediate:!0})})),r.provide(g,{session:{fetchSession:p,isLoading:u(a),session:u(i),isFetchSessionWasNeverCalled:b},user:{fetchUser:async()=>{o.value=!0,await n.me(),o.value=!1},isLoading:u(o),user:u(c),isFetchUserWasNeverCalled:y},sdk:n,options:s})}};export{C as AccessKeyManagement,N as ApplicationsPortal,L as AuditManagement,A as Descope,T as RoleManagement,B as UserManagement,F as UserProfile,x as default,R as getJwtPermissions,M as getJwtRoles,I as getRefreshToken,K as getSdk,j as getSessionToken,q as isRefreshTokenExpired,k as isSessionTokenExpired,P as routeGuard,h as useDescope,w as useSession,f as useUser};
1
+ import{computed as e,watch as t,inject as r,defineComponent as s,resolveComponent as n,openBlock as a,createElementBlock as i,createVNode as o,unref as d,ref as l,readonly as u}from"vue";import c from"@descope/web-component";import p from"@descope/web-js-sdk";import"@descope/user-management-widget";import"@descope/role-management-widget";import"@descope/access-key-management-widget";import"@descope/audit-management-widget";import"@descope/user-profile-widget";import"@descope/applications-portal-widget";const g=Symbol("$descope"),m={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.1.2"},b="undefined"!=typeof window,y=()=>{const e=r(g);if(!e)throw Error("Missing Descope context, make sure you are using the Descope plugin");return e},v=()=>y().options,h=()=>y().sdk,w=()=>{const{session:t}=y();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(),{isLoading:e((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,isAuthenticated:e((()=>!!t.session.value))}},f=()=>{const{user:r,session:s}=y(),n=()=>{!r.user.value&&s.session.value&&r.fetchUser()};return n(),t(s.session,n),{isLoading:e((()=>r.isLoading.value||r.isFetchUserWasNeverCalled.value)),user:r.user}},S=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let U;const _=e=>{const t=p({persistTokens:b,storeLastAuthenticatedUser:b,...e,autoRefresh:b});return U=t,t};U=_({projectId:"temp pid"});const j=()=>b?U?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),I=()=>b?U?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),k=(e=j())=>U?.isJwtExpired(e),q=(e=I())=>U?.isJwtExpired(e),R=S(((e=j(),t)=>U?.getJwtPermissions(e,t))),M=S(((e=j(),t)=>U?.getJwtRoles(e,t)));var A=s({__name:"Descope",props:{flowId:{type:String,required:!0},tenant:{type:String},theme:{type:String},locale:{type:String},debug:{type:Boolean},telemetryKey:{type:String},redirectUrl:{type:String},autoFocus:{type:Boolean||String},validateOnBlur:{type:Boolean},errorTransformer:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String}},emits:["success","error","ready"],setup(t,{emit:r}){c.sdkConfigOverrides={baseHeaders:m,persistTokens:!1,hooks:{get beforeRequest(){return U.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const s=t,l=r,{projectId:u,baseUrl:p,baseStaticUrl:g,storeLastAuthenticatedUser:b}=v(),y=h(),w=e((()=>s.form?JSON.stringify(s.form):"")),f=e((()=>s.client?JSON.stringify(s.client):"")),S=async e=>{await(y.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),l("success",e)},_=e=>l("error",e),j=e=>l("ready",e);return(e,r)=>{const s=n("descope-wc");return a(),i("div",null,[o(s,{"project-id":d(u),"base-url":d(p),"base-static-url":d(g),"flow-id":t.flowId,"^theme":t.theme,"^locale":t.locale,"^tenant":t.tenant,"^debug":t.debug,"^telemetryKey":t.telemetryKey,"redirect-url":t.redirectUrl,"auto-focus":t.autoFocus,"style-id":t.styleId,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":d(b),".errorTransformer":t.errorTransformer,"^form":w.value,"^client":f.value,onSuccess:S,onError:_,onReady:j},null,40,["project-id","base-url","base-static-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","store-last-authenticated-user",".errorTransformer","^form","^client"])])}}});A.__file="src/Descope.vue";var B=s({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-user-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});B.__file="src/UserManagement.vue";var T=s({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-role-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});T.__file="src/RoleManagement.vue";var C=s({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-access-key-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});C.__file="src/AccessKeyManagement.vue";var L=s({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-audit-management-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^tenant","^debug","widget-id"])])}}});L.__file="src/AuditManagement.vue";var F=s({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},emits:["logout"],setup(e,{emit:t}){const r=t,s=e=>r("logout",e),{projectId:l,baseUrl:u,baseStaticUrl:c}=v();return(t,r)=>{const p=n("descope-user-profile-widget");return a(),i("div",null,[o(p,{"project-id":d(l),"base-url":d(u),"base-static-url":d(c),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId,onLogout:s},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});F.__file="src/UserProfile.vue";var N=s({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},debug:{type:Boolean}},setup(e){const{projectId:t,baseUrl:r,baseStaticUrl:s}=v();return(l,u)=>{const c=n("descope-applications-portal-widget");return a(),i("div",null,[o(c,{"project-id":d(t),"base-url":d(r),"base-static-url":d(s),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId},null,8,["project-id","base-url","base-static-url","^theme","^debug","widget-id"])])}}});N.__file="src/ApplicationsPortal.vue";const O=l(null),P=()=>d(O)?.();let J;const K=()=>J;var x={install:function(r,s){const n=_({persistTokens:!0,...s,autoRefresh:!0,baseHeaders:m});J=n;const a=l(null),i=l(""),o=l(null),c=l(null);n.onSessionTokenChange((e=>{i.value=e})),n.onUserChange((e=>{c.value=e}));const p=async()=>{a.value=!0,await n.refresh(),a.value=!1},b=e((()=>null===a.value)),y=e((()=>null===o.value));O.value=()=>new Promise(((e,r)=>{!i.value&&b.value&&p().catch(r),t((()=>a.value),(()=>!a.value&&e(!!d(i))),{immediate:!0})})),r.provide(g,{session:{fetchSession:p,isLoading:u(a),session:u(i),isFetchSessionWasNeverCalled:b},user:{fetchUser:async()=>{o.value=!0,await n.me(),o.value=!1},isLoading:u(o),user:u(c),isFetchUserWasNeverCalled:y},sdk:n,options:s})}};export{C as AccessKeyManagement,N as ApplicationsPortal,L as AuditManagement,A as Descope,T as RoleManagement,B as UserManagement,F as UserProfile,x as default,R as getJwtPermissions,M as getJwtRoles,I as getRefreshToken,K as getSdk,j as getSessionToken,q as isRefreshTokenExpired,k as isSessionTokenExpired,P as routeGuard,h as useDescope,w as useSession,f as useUser};
2
2
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/vue-sdk",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "type": "module",
@@ -25,15 +25,15 @@
25
25
  ]
26
26
  },
27
27
  "dependencies": {
28
- "@descope/access-key-management-widget": "0.1.126",
29
- "@descope/audit-management-widget": "0.1.90",
30
- "@descope/user-management-widget": "0.4.127",
31
- "@descope/user-profile-widget": "0.0.109",
32
- "@descope/applications-portal-widget": "0.1.1",
33
- "@descope/web-component": "3.27.0",
34
- "@descope/role-management-widget": "0.1.124",
35
- "@descope/web-js-sdk": "1.19.0",
36
- "@descope/core-js-sdk": "2.28.0"
28
+ "@descope/access-key-management-widget": "0.1.127",
29
+ "@descope/audit-management-widget": "0.1.91",
30
+ "@descope/role-management-widget": "0.1.125",
31
+ "@descope/user-management-widget": "0.4.128",
32
+ "@descope/user-profile-widget": "0.0.110",
33
+ "@descope/applications-portal-widget": "0.1.2",
34
+ "@descope/web-component": "3.27.1",
35
+ "@descope/core-js-sdk": "2.29.0",
36
+ "@descope/web-js-sdk": "1.19.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "vue": ">=3"