@descope/vue-sdk 2.15.25 → 2.15.27
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 +1 -1
- package/dist/index.d.ts +24 -12
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
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");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");const n=Symbol("$descope"),s={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.15.25"},o="undefined"!=typeof window,a=()=>{const t=e.inject(n);if(!t)throw Error("Missing Descope context, make sure you are using the Descope plugin");return t},i=()=>a().options,d=()=>a().sdk,l=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let u;const c=e=>{const t=r({persistTokens:o,storeLastAuthenticatedUser:o,autoRefresh:o,...e});return u=t,t};u=c({projectId:"temp pid"});const p=()=>o?u?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),g=()=>o?u?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),m=l(((e=p(),t)=>u?.getJwtPermissions(e,t))),y=l(((e=p(),t)=>u?.getJwtRoles(e,t))),b=l(((e=p())=>u?.getCurrentTenant(e)));var f=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},restartOnError:{type:Boolean},errorTransformer:{type:Function},onScreenUpdate:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String},nonce:{type:String},dismissScreenErrorOnInput:{type:Boolean},popupOrigin:{type:String}},emits:["success","error","ready"],setup(r,{emit:n}){(customElements?.get("descope-wc")||t).sdkConfigOverrides={baseHeaders:s,persistTokens:!1,hooks:{get beforeRequest(){return u.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const o=r,a=n,{projectId:l,baseUrl:c,baseStaticUrl:p,storeLastAuthenticatedUser:g,baseCdnUrl:m,customStorage:y}=i(),b=d(),f=e.computed((()=>o.form?JSON.stringify(o.form):"")),v=e.computed((()=>o.client?JSON.stringify(o.client):"")),h=async e=>{await(b.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),a("success",e)},S=e=>a("error",e),w=e=>a("ready",e);return(t,n)=>{const s=e.resolveComponent("descope-wc");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(l),"base-url":e.unref(c),"base-static-url":e.unref(p),"base-cdn-url":e.unref(m),"flow-id":r.flowId,"^theme":r.theme,"^locale":r.locale,"^tenant":r.tenant,"^debug":r.debug,"^telemetryKey":r.telemetryKey,"redirect-url":r.redirectUrl,"auto-focus":r.autoFocus,"style-id":r.styleId,"validate-on-blur":r.validateOnBlur,"restart-on-error":r.restartOnError,"store-last-authenticated-user":e.unref(g),".customStorage":e.unref(y),".errorTransformer":r.errorTransformer,".onScreenUpdate":r.onScreenUpdate,"^form":f.value,"^client":v.value,"^nonce":r.nonce,"^dismiss-screen-error-on-input":r.dismissScreenErrorOnInput,"^popup-origin":r.popupOrigin,onSuccess:h,onError:S,onReady:w},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},40,["project-id","base-url","base-static-url","base-cdn-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","restart-on-error","store-last-authenticated-user",".customStorage",".errorTransformer",".onScreenUpdate","^form","^client","^nonce","^dismiss-screen-error-on-input","^popup-origin"])])}}});f.__file="src/Descope.vue";var v=e.defineComponent({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-user-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});v.__file="src/UserManagement.vue";var h=e.defineComponent({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-role-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-cdn-url":e.unref(d),"base-static-url":e.unref(a),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-cdn-url","base-static-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});h.__file="src/RoleManagement.vue";var S=e.defineComponent({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-access-key-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});S.__file="src/AccessKeyManagement.vue";var w=e.defineComponent({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-audit-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});w.__file="src/AuditManagement.vue";var U=e.defineComponent({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["logout","ready"],setup(t,{emit:r}){const s=e.inject(n),o=r,a=e=>{s?.resetAuth(),o("logout",e)},d=e=>o("ready",e),{projectId:l,baseUrl:u,baseStaticUrl:c,baseCdnUrl:p}=i();return(r,n)=>{const s=e.resolveComponent("descope-user-profile-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(l),"base-url":e.unref(u),"base-static-url":e.unref(c),"base-cdn-url":e.unref(p),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onLogout:a,onReady:d},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});U.__file="src/UserProfile.vue";var k=e.defineComponent({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-applications-portal-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});k.__file="src/ApplicationsPortal.vue";const I=e.ref(null);let C;var _={install:function(t,r){const o=c({persistTokens:!0,autoRefresh:!0,...r,baseHeaders:s});C=o;const a=e.ref(null),i=e.ref(""),d=e.ref(),l=e.ref(!1),u=e.ref(null),p=e.ref(null);o.onSessionTokenChange((e=>{i.value=e})),o.onClaimsChange((e=>{d.value=e})),o.onIsAuthenticatedChange((e=>{l.value=e})),o.onUserChange((e=>{p.value=e}));const g=async e=>{"undefined"!=typeof window&&window.descopeBridge||(a.value=!0,await o.refresh(void 0,e),a.value=!1)},m=e.computed((()=>null===a.value)),y=e.computed((()=>null===u.value));I.value=()=>new Promise(((t,r)=>{!l.value&&m.value&&g().catch(r),e.watch((()=>a.value),(()=>!a.value&&t(!!e.unref(l))),{immediate:!0})})),t.provide(n,{session:{fetchSession:g,isLoading:e.readonly(a),session:e.readonly(i),claims:e.readonly(d),isAuthenticated:e.readonly(l),isFetchSessionWasNeverCalled:m},user:{fetchUser:async()=>{u.value=!0,await o.me(),u.value=!1},isLoading:e.readonly(u),user:e.readonly(p),isFetchUserWasNeverCalled:y},sdk:o,options:r,resetAuth:function(){i.value="",l.value=!1,p.value=null}})}};exports.AccessKeyManagement=S,exports.ApplicationsPortal=k,exports.AuditManagement=w,exports.Descope=f,exports.RoleManagement=h,exports.UserManagement=v,exports.UserProfile=U,exports.default=_,exports.getCurrentTenant=b,exports.getJwtPermissions=m,exports.getJwtRoles=y,exports.getRefreshToken=g,exports.getSdk=()=>C,exports.getSessionToken=p,exports.isRefreshTokenExpired=(e=g())=>u?.isJwtExpired(e),exports.isSessionTokenExpired=(e=p())=>u?.isJwtExpired(e),exports.routeGuard=()=>e.unref(I)?.(),exports.useDescope=d,exports.useSession=()=>{const{session:t}=a();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(!0),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,claims:t.claims,isAuthenticated:t.isAuthenticated}},exports.useUser=()=>{const{user:t,session:r}=a(),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");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");const n=Symbol("$descope"),s={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.15.27"},o="undefined"!=typeof window,a=()=>{const t=e.inject(n);if(!t)throw Error("Missing Descope context, make sure you are using the Descope plugin");return t},i=()=>a().options,d=()=>a().sdk,l=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let u;const c=e=>{const t=r({persistTokens:o,storeLastAuthenticatedUser:o,autoRefresh:o,...e});return u=t,t};u=c({projectId:"temp pid"});const p=()=>o?u?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),g=()=>o?u?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),m=l(((e=p(),t)=>u?.getJwtPermissions(e,t))),y=l(((e=p(),t)=>u?.getJwtRoles(e,t))),b=l(((e=p())=>u?.getCurrentTenant(e)));var f=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},restartOnError:{type:Boolean},errorTransformer:{type:Function},onScreenUpdate:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String},nonce:{type:String},dismissScreenErrorOnInput:{type:Boolean},popupOrigin:{type:String}},emits:["success","error","ready"],setup(r,{emit:n}){(customElements?.get("descope-wc")||t).sdkConfigOverrides={baseHeaders:s,persistTokens:!1,hooks:{get beforeRequest(){return u.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const o=r,a=n,{projectId:l,baseUrl:c,baseStaticUrl:p,storeLastAuthenticatedUser:g,baseCdnUrl:m,customStorage:y}=i(),b=d(),f=e.computed((()=>o.form?JSON.stringify(o.form):"")),v=e.computed((()=>o.client?JSON.stringify(o.client):"")),h=async e=>{await(b.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),a("success",e)},S=e=>a("error",e),w=e=>a("ready",e);return(t,n)=>{const s=e.resolveComponent("descope-wc");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(l),"base-url":e.unref(c),"base-static-url":e.unref(p),"base-cdn-url":e.unref(m),"flow-id":r.flowId,"^theme":r.theme,"^locale":r.locale,"^tenant":r.tenant,"^debug":r.debug,"^telemetryKey":r.telemetryKey,"redirect-url":r.redirectUrl,"auto-focus":r.autoFocus,"style-id":r.styleId,"validate-on-blur":r.validateOnBlur,"restart-on-error":r.restartOnError,"store-last-authenticated-user":e.unref(g),".customStorage":e.unref(y),".errorTransformer":r.errorTransformer,".onScreenUpdate":r.onScreenUpdate,"^form":f.value,"^client":v.value,"^nonce":r.nonce,"^dismiss-screen-error-on-input":r.dismissScreenErrorOnInput,"^popup-origin":r.popupOrigin,onSuccess:h,onError:S,onReady:w},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},40,["project-id","base-url","base-static-url","base-cdn-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","restart-on-error","store-last-authenticated-user",".customStorage",".errorTransformer",".onScreenUpdate","^form","^client","^nonce","^dismiss-screen-error-on-input","^popup-origin"])])}}});f.__file="src/Descope.vue";var v=e.defineComponent({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-user-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});v.__file="src/UserManagement.vue";var h=e.defineComponent({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-role-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-cdn-url":e.unref(d),"base-static-url":e.unref(a),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-cdn-url","base-static-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});h.__file="src/RoleManagement.vue";var S=e.defineComponent({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-access-key-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});S.__file="src/AccessKeyManagement.vue";var w=e.defineComponent({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-audit-management-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^tenant":t.tenant,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});w.__file="src/AuditManagement.vue";var U=e.defineComponent({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["logout","ready"],setup(t,{emit:r}){const s=e.inject(n),o=r,a=e=>{s?.resetAuth(),o("logout",e)},d=e=>o("ready",e),{projectId:l,baseUrl:u,baseStaticUrl:c,baseCdnUrl:p}=i();return(r,n)=>{const s=e.resolveComponent("descope-user-profile-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,{"project-id":e.unref(l),"base-url":e.unref(u),"base-static-url":e.unref(c),"base-cdn-url":e.unref(p),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onLogout:a,onReady:d},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});U.__file="src/UserProfile.vue";var k=e.defineComponent({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(t,{emit:r}){const n=r,{projectId:s,baseUrl:o,baseStaticUrl:a,baseCdnUrl:d}=i(),l=e=>n("ready",e);return(r,n)=>{const i=e.resolveComponent("descope-applications-portal-widget");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{"project-id":e.unref(s),"base-url":e.unref(o),"base-static-url":e.unref(a),"base-cdn-url":e.unref(d),"^theme":t.theme,"^debug":t.debug,"widget-id":t.widgetId,"style-id":t.styleId,onReady:l},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});k.__file="src/ApplicationsPortal.vue";const I=e.ref(null);let C;var _={install:function(t,r){const o=c({persistTokens:!0,autoRefresh:!0,...r,baseHeaders:s});C=o;const a=e.ref(null),i=e.ref(""),d=e.ref(),l=e.ref(!1),u=e.ref(null),p=e.ref(null);o.onSessionTokenChange((e=>{i.value=e})),o.onClaimsChange((e=>{d.value=e})),o.onIsAuthenticatedChange((e=>{l.value=e})),o.onUserChange((e=>{p.value=e}));const g=async e=>{"undefined"!=typeof window&&window.descopeBridge||(a.value=!0,await o.refresh(void 0,e),a.value=!1)},m=e.computed((()=>null===a.value)),y=e.computed((()=>null===u.value));I.value=()=>new Promise(((t,r)=>{!l.value&&m.value&&g().catch(r),e.watch((()=>a.value),(()=>!a.value&&t(!!e.unref(l))),{immediate:!0})})),t.provide(n,{session:{fetchSession:g,isLoading:e.readonly(a),session:e.readonly(i),claims:e.readonly(d),isAuthenticated:e.readonly(l),isFetchSessionWasNeverCalled:m},user:{fetchUser:async()=>{u.value=!0,await o.me(),u.value=!1},isLoading:e.readonly(u),user:e.readonly(p),isFetchUserWasNeverCalled:y},sdk:o,options:r,resetAuth:function(){i.value="",l.value=!1,p.value=null}})}};exports.AccessKeyManagement=S,exports.ApplicationsPortal=k,exports.AuditManagement=w,exports.Descope=f,exports.RoleManagement=h,exports.UserManagement=v,exports.UserProfile=U,exports.default=_,exports.getCurrentTenant=b,exports.getJwtPermissions=m,exports.getJwtRoles=y,exports.getRefreshToken=g,exports.getSdk=()=>C,exports.getSessionToken=p,exports.isRefreshTokenExpired=(e=g())=>u?.isJwtExpired(e),exports.isSessionTokenExpired=(e=p())=>u?.isJwtExpired(e),exports.routeGuard=()=>e.unref(I)?.(),exports.useDescope=d,exports.useSession=()=>{const{session:t}=a();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(!0),{isLoading:e.computed((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,claims:t.claims,isAuthenticated:t.isAuthenticated}},exports.useUser=()=>{const{user:t,session:r}=a(),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
|
@@ -416,6 +416,7 @@ declare const useDescope: () => (((({
|
|
|
416
416
|
oidcIdpStateId?: string;
|
|
417
417
|
preview?: boolean;
|
|
418
418
|
samlIdpStateId?: string;
|
|
419
|
+
wsfedIdpStateId?: string;
|
|
419
420
|
samlIdpUsername?: string;
|
|
420
421
|
ssoAppId?: string;
|
|
421
422
|
thirdPartyAppId?: string;
|
|
@@ -436,7 +437,7 @@ declare const useDescope: () => (((({
|
|
|
436
437
|
applicationScopes?: string;
|
|
437
438
|
outboundAppId?: string;
|
|
438
439
|
outboundAppScopes?: string[];
|
|
439
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
440
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
440
441
|
lastAuth?: Omit<{
|
|
441
442
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
442
443
|
oauthProvider?: string;
|
|
@@ -1136,6 +1137,7 @@ declare const useDescope: () => (((({
|
|
|
1136
1137
|
oidcIdpStateId?: string;
|
|
1137
1138
|
preview?: boolean;
|
|
1138
1139
|
samlIdpStateId?: string;
|
|
1140
|
+
wsfedIdpStateId?: string;
|
|
1139
1141
|
samlIdpUsername?: string;
|
|
1140
1142
|
ssoAppId?: string;
|
|
1141
1143
|
thirdPartyAppId?: string;
|
|
@@ -1156,7 +1158,7 @@ declare const useDescope: () => (((({
|
|
|
1156
1158
|
applicationScopes?: string;
|
|
1157
1159
|
outboundAppId?: string;
|
|
1158
1160
|
outboundAppScopes?: string[];
|
|
1159
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
1161
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
1160
1162
|
lastAuth?: Omit<{
|
|
1161
1163
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1162
1164
|
oauthProvider?: string;
|
|
@@ -1856,6 +1858,7 @@ declare const useDescope: () => (((({
|
|
|
1856
1858
|
oidcIdpStateId?: string;
|
|
1857
1859
|
preview?: boolean;
|
|
1858
1860
|
samlIdpStateId?: string;
|
|
1861
|
+
wsfedIdpStateId?: string;
|
|
1859
1862
|
samlIdpUsername?: string;
|
|
1860
1863
|
ssoAppId?: string;
|
|
1861
1864
|
thirdPartyAppId?: string;
|
|
@@ -1876,7 +1879,7 @@ declare const useDescope: () => (((({
|
|
|
1876
1879
|
applicationScopes?: string;
|
|
1877
1880
|
outboundAppId?: string;
|
|
1878
1881
|
outboundAppScopes?: string[];
|
|
1879
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
1882
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
1880
1883
|
lastAuth?: Omit<{
|
|
1881
1884
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1882
1885
|
oauthProvider?: string;
|
|
@@ -2586,6 +2589,7 @@ declare const useDescope: () => (((({
|
|
|
2586
2589
|
oidcIdpStateId?: string;
|
|
2587
2590
|
preview?: boolean;
|
|
2588
2591
|
samlIdpStateId?: string;
|
|
2592
|
+
wsfedIdpStateId?: string;
|
|
2589
2593
|
samlIdpUsername?: string;
|
|
2590
2594
|
ssoAppId?: string;
|
|
2591
2595
|
thirdPartyAppId?: string;
|
|
@@ -2606,7 +2610,7 @@ declare const useDescope: () => (((({
|
|
|
2606
2610
|
applicationScopes?: string;
|
|
2607
2611
|
outboundAppId?: string;
|
|
2608
2612
|
outboundAppScopes?: string[];
|
|
2609
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
2613
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
2610
2614
|
lastAuth?: Omit<{
|
|
2611
2615
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
2612
2616
|
oauthProvider?: string;
|
|
@@ -3306,6 +3310,7 @@ declare const useDescope: () => (((({
|
|
|
3306
3310
|
oidcIdpStateId?: string;
|
|
3307
3311
|
preview?: boolean;
|
|
3308
3312
|
samlIdpStateId?: string;
|
|
3313
|
+
wsfedIdpStateId?: string;
|
|
3309
3314
|
samlIdpUsername?: string;
|
|
3310
3315
|
ssoAppId?: string;
|
|
3311
3316
|
thirdPartyAppId?: string;
|
|
@@ -3326,7 +3331,7 @@ declare const useDescope: () => (((({
|
|
|
3326
3331
|
applicationScopes?: string;
|
|
3327
3332
|
outboundAppId?: string;
|
|
3328
3333
|
outboundAppScopes?: string[];
|
|
3329
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
3334
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
3330
3335
|
lastAuth?: Omit<{
|
|
3331
3336
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3332
3337
|
oauthProvider?: string;
|
|
@@ -4026,6 +4031,7 @@ declare const useDescope: () => (((({
|
|
|
4026
4031
|
oidcIdpStateId?: string;
|
|
4027
4032
|
preview?: boolean;
|
|
4028
4033
|
samlIdpStateId?: string;
|
|
4034
|
+
wsfedIdpStateId?: string;
|
|
4029
4035
|
samlIdpUsername?: string;
|
|
4030
4036
|
ssoAppId?: string;
|
|
4031
4037
|
thirdPartyAppId?: string;
|
|
@@ -4046,7 +4052,7 @@ declare const useDescope: () => (((({
|
|
|
4046
4052
|
applicationScopes?: string;
|
|
4047
4053
|
outboundAppId?: string;
|
|
4048
4054
|
outboundAppScopes?: string[];
|
|
4049
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
4055
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
4050
4056
|
lastAuth?: Omit<{
|
|
4051
4057
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
4052
4058
|
oauthProvider?: string;
|
|
@@ -4778,6 +4784,7 @@ declare const getSdk: () => (((({
|
|
|
4778
4784
|
oidcIdpStateId?: string;
|
|
4779
4785
|
preview?: boolean;
|
|
4780
4786
|
samlIdpStateId?: string;
|
|
4787
|
+
wsfedIdpStateId?: string;
|
|
4781
4788
|
samlIdpUsername?: string;
|
|
4782
4789
|
ssoAppId?: string;
|
|
4783
4790
|
thirdPartyAppId?: string;
|
|
@@ -4798,7 +4805,7 @@ declare const getSdk: () => (((({
|
|
|
4798
4805
|
applicationScopes?: string;
|
|
4799
4806
|
outboundAppId?: string;
|
|
4800
4807
|
outboundAppScopes?: string[];
|
|
4801
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
4808
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
4802
4809
|
lastAuth?: Omit<{
|
|
4803
4810
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
4804
4811
|
oauthProvider?: string;
|
|
@@ -5498,6 +5505,7 @@ declare const getSdk: () => (((({
|
|
|
5498
5505
|
oidcIdpStateId?: string;
|
|
5499
5506
|
preview?: boolean;
|
|
5500
5507
|
samlIdpStateId?: string;
|
|
5508
|
+
wsfedIdpStateId?: string;
|
|
5501
5509
|
samlIdpUsername?: string;
|
|
5502
5510
|
ssoAppId?: string;
|
|
5503
5511
|
thirdPartyAppId?: string;
|
|
@@ -5518,7 +5526,7 @@ declare const getSdk: () => (((({
|
|
|
5518
5526
|
applicationScopes?: string;
|
|
5519
5527
|
outboundAppId?: string;
|
|
5520
5528
|
outboundAppScopes?: string[];
|
|
5521
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
5529
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
5522
5530
|
lastAuth?: Omit<{
|
|
5523
5531
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
5524
5532
|
oauthProvider?: string;
|
|
@@ -6218,6 +6226,7 @@ declare const getSdk: () => (((({
|
|
|
6218
6226
|
oidcIdpStateId?: string;
|
|
6219
6227
|
preview?: boolean;
|
|
6220
6228
|
samlIdpStateId?: string;
|
|
6229
|
+
wsfedIdpStateId?: string;
|
|
6221
6230
|
samlIdpUsername?: string;
|
|
6222
6231
|
ssoAppId?: string;
|
|
6223
6232
|
thirdPartyAppId?: string;
|
|
@@ -6238,7 +6247,7 @@ declare const getSdk: () => (((({
|
|
|
6238
6247
|
applicationScopes?: string;
|
|
6239
6248
|
outboundAppId?: string;
|
|
6240
6249
|
outboundAppScopes?: string[];
|
|
6241
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
6250
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
6242
6251
|
lastAuth?: Omit<{
|
|
6243
6252
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
6244
6253
|
oauthProvider?: string;
|
|
@@ -6948,6 +6957,7 @@ declare const getSdk: () => (((({
|
|
|
6948
6957
|
oidcIdpStateId?: string;
|
|
6949
6958
|
preview?: boolean;
|
|
6950
6959
|
samlIdpStateId?: string;
|
|
6960
|
+
wsfedIdpStateId?: string;
|
|
6951
6961
|
samlIdpUsername?: string;
|
|
6952
6962
|
ssoAppId?: string;
|
|
6953
6963
|
thirdPartyAppId?: string;
|
|
@@ -6968,7 +6978,7 @@ declare const getSdk: () => (((({
|
|
|
6968
6978
|
applicationScopes?: string;
|
|
6969
6979
|
outboundAppId?: string;
|
|
6970
6980
|
outboundAppScopes?: string[];
|
|
6971
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
6981
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
6972
6982
|
lastAuth?: Omit<{
|
|
6973
6983
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
6974
6984
|
oauthProvider?: string;
|
|
@@ -7668,6 +7678,7 @@ declare const getSdk: () => (((({
|
|
|
7668
7678
|
oidcIdpStateId?: string;
|
|
7669
7679
|
preview?: boolean;
|
|
7670
7680
|
samlIdpStateId?: string;
|
|
7681
|
+
wsfedIdpStateId?: string;
|
|
7671
7682
|
samlIdpUsername?: string;
|
|
7672
7683
|
ssoAppId?: string;
|
|
7673
7684
|
thirdPartyAppId?: string;
|
|
@@ -7688,7 +7699,7 @@ declare const getSdk: () => (((({
|
|
|
7688
7699
|
applicationScopes?: string;
|
|
7689
7700
|
outboundAppId?: string;
|
|
7690
7701
|
outboundAppScopes?: string[];
|
|
7691
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
7702
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
7692
7703
|
lastAuth?: Omit<{
|
|
7693
7704
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
7694
7705
|
oauthProvider?: string;
|
|
@@ -8388,6 +8399,7 @@ declare const getSdk: () => (((({
|
|
|
8388
8399
|
oidcIdpStateId?: string;
|
|
8389
8400
|
preview?: boolean;
|
|
8390
8401
|
samlIdpStateId?: string;
|
|
8402
|
+
wsfedIdpStateId?: string;
|
|
8391
8403
|
samlIdpUsername?: string;
|
|
8392
8404
|
ssoAppId?: string;
|
|
8393
8405
|
thirdPartyAppId?: string;
|
|
@@ -8408,7 +8420,7 @@ declare const getSdk: () => (((({
|
|
|
8408
8420
|
applicationScopes?: string;
|
|
8409
8421
|
outboundAppId?: string;
|
|
8410
8422
|
outboundAppScopes?: string[];
|
|
8411
|
-
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
8423
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "wsfedIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "oidcResource" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes" | "outboundAppId" | "outboundAppScopes"> & {
|
|
8412
8424
|
lastAuth?: Omit<{
|
|
8413
8425
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
8414
8426
|
oauthProvider?: string;
|
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,withCtx as l,renderSlot as u,ref as c,readonly as p}from"vue";import g from"@descope/web-component";import m 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 y=Symbol("$descope"),b={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.15.
|
|
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,withCtx as l,renderSlot as u,ref as c,readonly as p}from"vue";import g from"@descope/web-component";import m 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 y=Symbol("$descope"),b={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.15.27"},h="undefined"!=typeof window,v=()=>{const e=r(y);if(!e)throw Error("Missing Descope context, make sure you are using the Descope plugin");return e},S=()=>v().options,w=()=>v().sdk,f=()=>{const{session:t}=v();return t.isFetchSessionWasNeverCalled.value&&t.fetchSession(!0),{isLoading:e((()=>t.isLoading.value||t.isFetchSessionWasNeverCalled.value)),sessionToken:t.session,claims:t.claims,isAuthenticated:t.isAuthenticated}},U=()=>{const{user:r,session:s}=v(),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}},I=e=>(...t)=>{let r;try{r=e(...t)}catch(e){console.error(e)}return r};let _;const j=e=>{const t=m({persistTokens:h,storeLastAuthenticatedUser:h,autoRefresh:h,...e});return _=t,t};_=j({projectId:"temp pid"});const k=()=>h?_?.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),C=()=>h?_?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),R=(e=k())=>_?.isJwtExpired(e),A=(e=C())=>_?.isJwtExpired(e),q=I(((e=k(),t)=>_?.getJwtPermissions(e,t))),B=I(((e=k(),t)=>_?.getJwtRoles(e,t))),O=I(((e=k())=>_?.getCurrentTenant(e)));var M=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},restartOnError:{type:Boolean},errorTransformer:{type:Function},onScreenUpdate:{type:Function},form:{type:Object},client:{type:Object},styleId:{type:String},nonce:{type:String},dismissScreenErrorOnInput:{type:Boolean},popupOrigin:{type:String}},emits:["success","error","ready"],setup(t,{emit:r}){(customElements?.get("descope-wc")||g).sdkConfigOverrides={baseHeaders:b,persistTokens:!1,hooks:{get beforeRequest(){return _.httpClient.hooks.beforeRequest},set beforeRequest(e){}}};const s=t,c=r,{projectId:p,baseUrl:m,baseStaticUrl:y,storeLastAuthenticatedUser:h,baseCdnUrl:v,customStorage:f}=S(),U=w(),I=e((()=>s.form?JSON.stringify(s.form):"")),j=e((()=>s.client?JSON.stringify(s.client):"")),k=async e=>{await(U.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),c("success",e)},C=e=>c("error",e),R=e=>c("ready",e);return(e,r)=>{const s=n("descope-wc");return a(),i("div",null,[o(s,{"project-id":d(p),"base-url":d(m),"base-static-url":d(y),"base-cdn-url":d(v),"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,"restart-on-error":t.restartOnError,"store-last-authenticated-user":d(h),".customStorage":d(f),".errorTransformer":t.errorTransformer,".onScreenUpdate":t.onScreenUpdate,"^form":I.value,"^client":j.value,"^nonce":t.nonce,"^dismiss-screen-error-on-input":t.dismissScreenErrorOnInput,"^popup-origin":t.popupOrigin,onSuccess:k,onError:C,onReady:R},{default:l((()=>[u(e.$slots,"default")])),_:3},40,["project-id","base-url","base-static-url","base-cdn-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","style-id","validate-on-blur","restart-on-error","store-last-authenticated-user",".customStorage",".errorTransformer",".onScreenUpdate","^form","^client","^nonce","^dismiss-screen-error-on-input","^popup-origin"])])}}});M.__file="src/Descope.vue";var T=s({__name:"UserManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(e,{emit:t}){const r=t,{projectId:s,baseUrl:l,baseStaticUrl:u,baseCdnUrl:c}=S(),p=e=>r("ready",e);return(t,r)=>{const g=n("descope-user-management-widget");return a(),i("div",null,[o(g,{"project-id":d(s),"base-url":d(l),"base-static-url":d(u),"base-cdn-url":d(c),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onReady:p},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});T.__file="src/UserManagement.vue";var E=s({__name:"RoleManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(e,{emit:t}){const r=t,{projectId:s,baseUrl:l,baseStaticUrl:u,baseCdnUrl:c}=S(),p=e=>r("ready",e);return(t,r)=>{const g=n("descope-role-management-widget");return a(),i("div",null,[o(g,{"project-id":d(s),"base-url":d(l),"base-cdn-url":d(c),"base-static-url":d(u),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onReady:p},null,8,["project-id","base-url","base-cdn-url","base-static-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});E.__file="src/RoleManagement.vue";var F=s({__name:"AccessKeyManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(e,{emit:t}){const r=t,{projectId:s,baseUrl:l,baseStaticUrl:u,baseCdnUrl:c}=S(),p=e=>r("ready",e);return(t,r)=>{const g=n("descope-access-key-management-widget");return a(),i("div",null,[o(g,{"project-id":d(s),"base-url":d(l),"base-static-url":d(u),"base-cdn-url":d(c),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onReady:p},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});F.__file="src/AccessKeyManagement.vue";var L=s({__name:"AuditManagement",props:{tenant:{type:String,required:!0},widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(e,{emit:t}){const r=t,{projectId:s,baseUrl:l,baseStaticUrl:u,baseCdnUrl:c}=S(),p=e=>r("ready",e);return(t,r)=>{const g=n("descope-audit-management-widget");return a(),i("div",null,[o(g,{"project-id":d(s),"base-url":d(l),"base-static-url":d(u),"base-cdn-url":d(c),"^theme":e.theme,"^tenant":e.tenant,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onReady:p},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^tenant","^debug","widget-id","style-id"])])}}});L.__file="src/AuditManagement.vue";var N=s({__name:"UserProfile",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["logout","ready"],setup(e,{emit:t}){const s=r(y),l=t,u=e=>{s?.resetAuth(),l("logout",e)},c=e=>l("ready",e),{projectId:p,baseUrl:g,baseStaticUrl:m,baseCdnUrl:b}=S();return(t,r)=>{const s=n("descope-user-profile-widget");return a(),i("div",null,[o(s,{"project-id":d(p),"base-url":d(g),"base-static-url":d(m),"base-cdn-url":d(b),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onLogout:u,onReady:c},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});N.__file="src/UserProfile.vue";var P=s({__name:"ApplicationsPortal",props:{widgetId:{type:String,required:!0},theme:{type:String},styleId:{type:String},debug:{type:Boolean}},emits:["ready"],setup(e,{emit:t}){const r=t,{projectId:s,baseUrl:l,baseStaticUrl:u,baseCdnUrl:c}=S(),p=e=>r("ready",e);return(t,r)=>{const g=n("descope-applications-portal-widget");return a(),i("div",null,[o(g,{"project-id":d(s),"base-url":d(l),"base-static-url":d(u),"base-cdn-url":d(c),"^theme":e.theme,"^debug":e.debug,"widget-id":e.widgetId,"style-id":e.styleId,onReady:p},null,8,["project-id","base-url","base-static-url","base-cdn-url","^theme","^debug","widget-id","style-id"])])}}});P.__file="src/ApplicationsPortal.vue";const J=c(null),K=()=>d(J)?.();let x;const D=()=>x;var W={install:function(r,s){const n=j({persistTokens:!0,autoRefresh:!0,...s,baseHeaders:b});x=n;const a=c(null),i=c(""),o=c(),l=c(!1),u=c(null),g=c(null);n.onSessionTokenChange((e=>{i.value=e})),n.onClaimsChange((e=>{o.value=e})),n.onIsAuthenticatedChange((e=>{l.value=e})),n.onUserChange((e=>{g.value=e}));const m=async e=>{"undefined"!=typeof window&&window.descopeBridge||(a.value=!0,await n.refresh(void 0,e),a.value=!1)},h=e((()=>null===a.value)),v=e((()=>null===u.value));J.value=()=>new Promise(((e,r)=>{!l.value&&h.value&&m().catch(r),t((()=>a.value),(()=>!a.value&&e(!!d(l))),{immediate:!0})})),r.provide(y,{session:{fetchSession:m,isLoading:p(a),session:p(i),claims:p(o),isAuthenticated:p(l),isFetchSessionWasNeverCalled:h},user:{fetchUser:async()=>{u.value=!0,await n.me(),u.value=!1},isLoading:p(u),user:p(g),isFetchUserWasNeverCalled:v},sdk:n,options:s,resetAuth:function(){i.value="",l.value=!1,g.value=null}})}};export{F as AccessKeyManagement,P as ApplicationsPortal,L as AuditManagement,M as Descope,E as RoleManagement,T as UserManagement,N as UserProfile,W as default,O as getCurrentTenant,q as getJwtPermissions,B as getJwtRoles,C as getRefreshToken,D as getSdk,k as getSessionToken,A as isRefreshTokenExpired,R as isSessionTokenExpired,K as routeGuard,w as useDescope,f as useSession,U 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.15.
|
|
3
|
+
"version": "2.15.27",
|
|
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/
|
|
29
|
-
"@descope/
|
|
30
|
-
"@descope/role-management-widget": "0.5.
|
|
31
|
-
"@descope/user-
|
|
32
|
-
"@descope/user-
|
|
33
|
-
"@descope/
|
|
34
|
-
"@descope/
|
|
35
|
-
"@descope/
|
|
36
|
-
"@descope/
|
|
28
|
+
"@descope/access-key-management-widget": "0.5.41",
|
|
29
|
+
"@descope/audit-management-widget": "0.6.3",
|
|
30
|
+
"@descope/role-management-widget": "0.5.33",
|
|
31
|
+
"@descope/user-management-widget": "0.11.20",
|
|
32
|
+
"@descope/user-profile-widget": "0.9.15",
|
|
33
|
+
"@descope/applications-portal-widget": "0.6.1",
|
|
34
|
+
"@descope/web-component": "3.59.0",
|
|
35
|
+
"@descope/web-js-sdk": "1.48.0",
|
|
36
|
+
"@descope/core-js-sdk": "2.59.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": ">=3"
|