@descope/vue-sdk 2.0.19 → 2.0.20
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/README.md +46 -57
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +140 -28
- package/dist/index.mjs +1 -1
- package/package.json +93 -95
package/README.md
CHANGED
|
@@ -27,11 +27,11 @@ import descope from '@descope/vue-sdk';
|
|
|
27
27
|
|
|
28
28
|
const app = createApp(App);
|
|
29
29
|
app.use(descope, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
projectId: 'my-project-id',
|
|
31
|
+
// If the Descope project manages the token response in cookies, a custom domain
|
|
32
|
+
// must be configured (e.g., https://auth.app.example.com)
|
|
33
|
+
// and should be set as the baseUrl property.
|
|
34
|
+
// baseUrl: https://auth.app.example.com'
|
|
35
35
|
});
|
|
36
36
|
app.mount('#app');
|
|
37
37
|
```
|
|
@@ -40,24 +40,19 @@ app.mount('#app');
|
|
|
40
40
|
|
|
41
41
|
```vue
|
|
42
42
|
<template>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<!-- autoFocus="skipFirstScreen" autoFocus can be true, false or "skipFirstScreen". Default is true. - true: automatically focus on the first input of each screen - false: do not automatically focus on screen's inputs - "skipFirstScreen": automatically focus on the first input of each screen, except first screen -->
|
|
57
|
-
<!-- validateOnBlur can be true in order to show input validation errors on blur, in addition to on submit. Default is false. -->
|
|
58
|
-
<!-- errorTransformer="errorTransformer" errorTransformer is a function that receives an error object and returns a string. The returned string will be displayed to the user. NOTE: errorTransformer is not required. If not provided, the error object will be displayed as is. -->
|
|
59
|
-
<!-- form="{ email: 'test@domain.com' }" form is an object the initial form context that is used in screens inputs in the flow execution. Used to inject predifined input values on flow start such as custom inputs, custom attrbiutes and other inputs. Keys passed can be accessed in flows actions, conditions and screens prefixed with "form.". NOTE: form is not required. If not provided, 'form' context key will be empty before user input. -->
|
|
60
|
-
<!-- client="{ version: '1.2.3' }" client is an object the initial client context in the flow execution. Keys passed can be accessed in flows actions and conditions prefixed with "client.". NOTE: client is not required. If not provided, context key will be empty. -->
|
|
43
|
+
<p v-if="isFlowLoading">Loading...</p>
|
|
44
|
+
<Descope flowId="my-flow-id" @success="handleSuccess" @error="handleError" @ready="handleReady" />
|
|
45
|
+
<!-- additional props -->
|
|
46
|
+
<!-- theme="dark" theme can be "light", "dark" or "os", which auto select a theme based on the OS theme. Default is "light" -->
|
|
47
|
+
<!-- v-bind:debug="true" debug can be set to true to enable debug mode -->
|
|
48
|
+
<!-- locale="en" locale can be any supported locale which the flow's screen translated to, if not provided, the locale is taken from the browser's locale. -->
|
|
49
|
+
<!-- tenant="tenantId" tenant ID for SSO (SAML) login. If not provided, Descope will use the domain of available email to choose the tenant -->
|
|
50
|
+
<!-- redirectUrl="redirectUrl" Redirect URL for OAuth and SSO (will be used when redirecting back from the OAuth provider / IdP), or for "Magic Link" and "Enchanted Link" (will be used as a link in the message sent to the the user) -->
|
|
51
|
+
<!-- autoFocus="skipFirstScreen" autoFocus can be true, false or "skipFirstScreen". Default is true. - true: automatically focus on the first input of each screen - false: do not automatically focus on screen's inputs - "skipFirstScreen": automatically focus on the first input of each screen, except first screen -->
|
|
52
|
+
<!-- validateOnBlur can be true in order to show input validation errors on blur, in addition to on submit. Default is false. -->
|
|
53
|
+
<!-- errorTransformer="errorTransformer" errorTransformer is a function that receives an error object and returns a string. The returned string will be displayed to the user. NOTE: errorTransformer is not required. If not provided, the error object will be displayed as is. -->
|
|
54
|
+
<!-- form="{ email: 'test@domain.com' }" form is an object the initial form context that is used in screens inputs in the flow execution. Used to inject predifined input values on flow start such as custom inputs, custom attrbiutes and other inputs. Keys passed can be accessed in flows actions, conditions and screens prefixed with "form.". NOTE: form is not required. If not provided, 'form' context key will be empty before user input. -->
|
|
55
|
+
<!-- client="{ version: '1.2.3' }" client is an object the initial client context in the flow execution. Keys passed can be accessed in flows actions and conditions prefixed with "client.". NOTE: client is not required. If not provided, context key will be empty. -->
|
|
61
56
|
</template>
|
|
62
57
|
|
|
63
58
|
<script setup>
|
|
@@ -67,15 +62,15 @@ import { ref } from 'vue';
|
|
|
67
62
|
const isFlowLoading = ref(true);
|
|
68
63
|
|
|
69
64
|
const handleSuccess = (e) => {
|
|
70
|
-
|
|
65
|
+
console.log('Logged in!', e);
|
|
71
66
|
};
|
|
72
67
|
|
|
73
68
|
const handleError = (e) => {
|
|
74
|
-
|
|
69
|
+
console.log('Could not log in', e);
|
|
75
70
|
};
|
|
76
71
|
|
|
77
72
|
const handleReady = () => {
|
|
78
|
-
|
|
73
|
+
isFlowLoading.value = false;
|
|
79
74
|
};
|
|
80
75
|
|
|
81
76
|
// let tenantId = '<tenantId>'; // replace with your tenant ID
|
|
@@ -146,13 +141,13 @@ import { getSessionToken } from '@descope/vue-sdk';
|
|
|
146
141
|
// fetch data using back
|
|
147
142
|
// Note: Descope backend SDKs support extracting session token from the Authorization header
|
|
148
143
|
export const fetchData = async () => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
const sessionToken = getSessionToken();
|
|
145
|
+
const res = await fetch('/path/to/server/api', {
|
|
146
|
+
headers: {
|
|
147
|
+
Authorization: `Bearer ${sessionToken}`,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
// ... use res
|
|
156
151
|
};
|
|
157
152
|
```
|
|
158
153
|
|
|
@@ -172,8 +167,8 @@ import descope from '@descope/vue-sdk';
|
|
|
172
167
|
const app = createApp(App);
|
|
173
168
|
|
|
174
169
|
app.use(descope, {
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
projectId: 'project-id',
|
|
171
|
+
sessionTokenViaCookie: true,
|
|
177
172
|
});
|
|
178
173
|
```
|
|
179
174
|
|
|
@@ -196,13 +191,13 @@ import descope, { getSdk } from '../src';
|
|
|
196
191
|
const app = createApp(App);
|
|
197
192
|
|
|
198
193
|
app.use(descope, {
|
|
199
|
-
|
|
194
|
+
projectId: 'project-id',
|
|
200
195
|
});
|
|
201
196
|
|
|
202
197
|
const sdk = getSdk();
|
|
203
198
|
|
|
204
199
|
sdk?.onSessionTokenChange((newSession) => {
|
|
205
|
-
|
|
200
|
+
// here you can implement custom logic when the session is changing
|
|
206
201
|
});
|
|
207
202
|
```
|
|
208
203
|
|
|
@@ -272,7 +267,7 @@ Note:
|
|
|
272
267
|
|
|
273
268
|
```vue
|
|
274
269
|
<template>
|
|
275
|
-
|
|
270
|
+
<UserManagement tenant="tenant-id" widget-id="user-management-widget" />
|
|
276
271
|
</template>
|
|
277
272
|
|
|
278
273
|
<script setup>
|
|
@@ -302,7 +297,7 @@ Note:
|
|
|
302
297
|
|
|
303
298
|
```vue
|
|
304
299
|
<template>
|
|
305
|
-
|
|
300
|
+
<RoleManagement tenant="tenant-id" widget-id="role-management-widget" />
|
|
306
301
|
</template>
|
|
307
302
|
|
|
308
303
|
<script setup>
|
|
@@ -327,17 +322,11 @@ The widget lets you:
|
|
|
327
322
|
|
|
328
323
|
```vue
|
|
329
324
|
<template>
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
<!-- user view: mange access key for the logged-in tenant's user -->
|
|
337
|
-
<AccessKeyManagement
|
|
338
|
-
tenant="tenant-id"
|
|
339
|
-
widget-id="user-access-key-management-widget"
|
|
340
|
-
/>
|
|
325
|
+
<!-- admin view: manage all tenant users' access keys -->
|
|
326
|
+
<AccessKeyManagement tenant="tenant-id" widget-id="access-key-management-widget" />
|
|
327
|
+
|
|
328
|
+
<!-- user view: mange access key for the logged-in tenant's user -->
|
|
329
|
+
<AccessKeyManagement tenant="tenant-id" widget-id="user-access-key-management-widget" />
|
|
341
330
|
</template>
|
|
342
331
|
|
|
343
332
|
<script setup>
|
|
@@ -356,7 +345,7 @@ The `AuditManagement` widget lets you embed an audit table in your site.
|
|
|
356
345
|
|
|
357
346
|
```vue
|
|
358
347
|
<template>
|
|
359
|
-
|
|
348
|
+
<AuditManagement tenant="tenant-id" widget-id="audit-management-widget" />
|
|
360
349
|
</template>
|
|
361
350
|
|
|
362
351
|
<script setup>
|
|
@@ -382,7 +371,7 @@ The widget lets you:
|
|
|
382
371
|
|
|
383
372
|
```vue
|
|
384
373
|
<template>
|
|
385
|
-
|
|
374
|
+
<UserProfile widget-id="user-profile-widget" @logout="onLogout" />
|
|
386
375
|
</template>
|
|
387
376
|
|
|
388
377
|
<script setup>
|
|
@@ -456,11 +445,11 @@ The Descope SDK caches the user and session token in the frontend. If you update
|
|
|
456
445
|
const sdk = useDescope();
|
|
457
446
|
|
|
458
447
|
const handleUpdateUser = () => {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
448
|
+
myBackendUpdateUser().then(() => {
|
|
449
|
+
sdk.me();
|
|
450
|
+
// or
|
|
451
|
+
sdk.refresh();
|
|
452
|
+
});
|
|
464
453
|
};
|
|
465
454
|
```
|
|
466
455
|
|
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")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue"),t=require("@descope/web-component");require("@descope/core-js-sdk");var 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");var s=n(t),o=n(r);const a=Symbol("$descope"),i={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.0.20"},u="undefined"!=typeof window,d=()=>{const t=e.inject(a);if(!t)throw Error("Missing Descope context, make sure you are using the Descope plugin");return t},l=()=>d().options,c=()=>d().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"),""),v=p(((e=f(),t)=>g?.getJwtPermissions(e,t))),y=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}},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:d,storeLastAuthenticatedUser:p}=l(),m=c(),f=e.computed((()=>n.form?JSON.stringify(n.form):"")),b=e.computed((()=>n.client?JSON.stringify(n.client):"")),v=async e=>{await(m.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),o("success",e)},y=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(d),"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,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":e.unref(p),".errorTransformer":t.errorTransformer,"^form":f.value,"^client":b.value,onSuccess:v,onError:y,onReady:h},null,40,["project-id","base-url","base-static-url","flow-id","^theme","^locale","^tenant","^debug","^telemetryKey","redirect-url","auto-focus","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}=l();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}=l();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}=l();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}=l();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 j=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}=l();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"])])}}});j.__file="src/UserProfile.vue";const x=e.ref(null);let _;var q={install:function(t,r){const n=m({persistTokens:!0,...r,autoRefresh:!0,baseHeaders:i});_=n;const s=e.ref(null),o=e.ref(""),u=e.ref(null),d=e.ref(null);n.onSessionTokenChange((e=>{o.value=e})),n.onUserChange((e=>{d.value=e}));const l=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&&l().catch(r),e.watch((()=>s.value),(()=>!s.value&&t(!!e.unref(o))),{immediate:!0})})),t.provide(a,{session:{fetchSession:l,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(d),isFetchUserWasNeverCalled:p},sdk:n,options:r})}};exports.AccessKeyManagement=k,exports.AuditManagement=U,exports.Descope=h,exports.RoleManagement=S,exports.UserManagement=w,exports.UserProfile=j,exports.default=q,exports.getJwtPermissions=v,exports.getJwtRoles=y,exports.getRefreshToken=b,exports.getSdk=()=>_,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}=d();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}=d(),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
|
@@ -43,7 +43,7 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
43
43
|
};
|
|
44
44
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
45
45
|
[key: string]: any;
|
|
46
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error" | "ready")[], "success" | "error" | "ready", vue.
|
|
46
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error" | "ready")[], "success" | "error" | "ready", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
47
47
|
flowId: {
|
|
48
48
|
type: StringConstructor;
|
|
49
49
|
required: true;
|
|
@@ -88,7 +88,7 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
88
88
|
}, {
|
|
89
89
|
debug: boolean;
|
|
90
90
|
validateOnBlur: boolean;
|
|
91
|
-
}>;
|
|
91
|
+
}, {}>;
|
|
92
92
|
|
|
93
93
|
declare const _default$5: vue.DefineComponent<{
|
|
94
94
|
tenant: {
|
|
@@ -107,7 +107,7 @@ declare const _default$5: vue.DefineComponent<{
|
|
|
107
107
|
};
|
|
108
108
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
109
109
|
[key: string]: any;
|
|
110
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
110
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
111
111
|
tenant: {
|
|
112
112
|
type: StringConstructor;
|
|
113
113
|
required: true;
|
|
@@ -124,7 +124,7 @@ declare const _default$5: vue.DefineComponent<{
|
|
|
124
124
|
};
|
|
125
125
|
}>>, {
|
|
126
126
|
debug: boolean;
|
|
127
|
-
}>;
|
|
127
|
+
}, {}>;
|
|
128
128
|
|
|
129
129
|
declare const _default$4: vue.DefineComponent<{
|
|
130
130
|
tenant: {
|
|
@@ -143,7 +143,7 @@ declare const _default$4: vue.DefineComponent<{
|
|
|
143
143
|
};
|
|
144
144
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
145
145
|
[key: string]: any;
|
|
146
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
146
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
147
147
|
tenant: {
|
|
148
148
|
type: StringConstructor;
|
|
149
149
|
required: true;
|
|
@@ -160,7 +160,7 @@ declare const _default$4: vue.DefineComponent<{
|
|
|
160
160
|
};
|
|
161
161
|
}>>, {
|
|
162
162
|
debug: boolean;
|
|
163
|
-
}>;
|
|
163
|
+
}, {}>;
|
|
164
164
|
|
|
165
165
|
declare const _default$3: vue.DefineComponent<{
|
|
166
166
|
tenant: {
|
|
@@ -179,7 +179,7 @@ declare const _default$3: vue.DefineComponent<{
|
|
|
179
179
|
};
|
|
180
180
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
181
181
|
[key: string]: any;
|
|
182
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
182
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
183
183
|
tenant: {
|
|
184
184
|
type: StringConstructor;
|
|
185
185
|
required: true;
|
|
@@ -196,7 +196,7 @@ declare const _default$3: vue.DefineComponent<{
|
|
|
196
196
|
};
|
|
197
197
|
}>>, {
|
|
198
198
|
debug: boolean;
|
|
199
|
-
}>;
|
|
199
|
+
}, {}>;
|
|
200
200
|
|
|
201
201
|
declare const _default$2: vue.DefineComponent<{
|
|
202
202
|
tenant: {
|
|
@@ -215,7 +215,7 @@ declare const _default$2: vue.DefineComponent<{
|
|
|
215
215
|
};
|
|
216
216
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
217
217
|
[key: string]: any;
|
|
218
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
218
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
219
219
|
tenant: {
|
|
220
220
|
type: StringConstructor;
|
|
221
221
|
required: true;
|
|
@@ -232,7 +232,7 @@ declare const _default$2: vue.DefineComponent<{
|
|
|
232
232
|
};
|
|
233
233
|
}>>, {
|
|
234
234
|
debug: boolean;
|
|
235
|
-
}>;
|
|
235
|
+
}, {}>;
|
|
236
236
|
|
|
237
237
|
declare const _default$1: vue.DefineComponent<{
|
|
238
238
|
widgetId: {
|
|
@@ -247,7 +247,7 @@ declare const _default$1: vue.DefineComponent<{
|
|
|
247
247
|
};
|
|
248
248
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
249
249
|
[key: string]: any;
|
|
250
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "logout"[], "logout", vue.
|
|
250
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "logout"[], "logout", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
251
251
|
widgetId: {
|
|
252
252
|
type: StringConstructor;
|
|
253
253
|
required: true;
|
|
@@ -262,7 +262,7 @@ declare const _default$1: vue.DefineComponent<{
|
|
|
262
262
|
onLogout?: (...args: any[]) => any;
|
|
263
263
|
}, {
|
|
264
264
|
debug: boolean;
|
|
265
|
-
}>;
|
|
265
|
+
}, {}>;
|
|
266
266
|
|
|
267
267
|
type Options = {
|
|
268
268
|
projectId: string;
|
|
@@ -301,7 +301,9 @@ declare const useDescope: () => ((({
|
|
|
301
301
|
abTestingKey?: number;
|
|
302
302
|
startOptionsVersion?: number;
|
|
303
303
|
client?: Record<string, any>;
|
|
304
|
-
|
|
304
|
+
locale?: string;
|
|
305
|
+
oidcPrompt?: string;
|
|
306
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
305
307
|
lastAuth?: Omit<{
|
|
306
308
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
307
309
|
oauthProvider?: string;
|
|
@@ -356,6 +358,8 @@ declare const useDescope: () => ((({
|
|
|
356
358
|
};
|
|
357
359
|
fedcm: {
|
|
358
360
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
361
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
362
|
+
isSupported(): boolean;
|
|
359
363
|
};
|
|
360
364
|
accessKey: {
|
|
361
365
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -700,7 +704,7 @@ declare const useDescope: () => ((({
|
|
|
700
704
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
701
705
|
};
|
|
702
706
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
703
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
707
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
704
708
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
705
709
|
};
|
|
706
710
|
saml: {
|
|
@@ -815,6 +819,13 @@ declare const useDescope: () => ((({
|
|
|
815
819
|
};
|
|
816
820
|
token?: string;
|
|
817
821
|
}) => Promise<Response>;
|
|
822
|
+
patch: (path: string, body?: any, config?: {
|
|
823
|
+
headers?: HeadersInit;
|
|
824
|
+
queryParams?: {
|
|
825
|
+
[key: string]: string;
|
|
826
|
+
};
|
|
827
|
+
token?: string;
|
|
828
|
+
}) => Promise<Response>;
|
|
818
829
|
put: (path: string, body?: any, config?: {
|
|
819
830
|
headers?: HeadersInit;
|
|
820
831
|
queryParams?: {
|
|
@@ -834,6 +845,9 @@ declare const useDescope: () => ((({
|
|
|
834
845
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
835
846
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
836
847
|
};
|
|
848
|
+
buildUrl: (path: string, queryParams?: {
|
|
849
|
+
[key: string]: string;
|
|
850
|
+
}) => string;
|
|
837
851
|
};
|
|
838
852
|
} | {
|
|
839
853
|
flow: {
|
|
@@ -863,7 +877,9 @@ declare const useDescope: () => ((({
|
|
|
863
877
|
abTestingKey?: number;
|
|
864
878
|
startOptionsVersion?: number;
|
|
865
879
|
client?: Record<string, any>;
|
|
866
|
-
|
|
880
|
+
locale?: string;
|
|
881
|
+
oidcPrompt?: string;
|
|
882
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
867
883
|
lastAuth?: Omit<{
|
|
868
884
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
869
885
|
oauthProvider?: string;
|
|
@@ -918,6 +934,8 @@ declare const useDescope: () => ((({
|
|
|
918
934
|
};
|
|
919
935
|
fedcm: {
|
|
920
936
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
937
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
938
|
+
isSupported(): boolean;
|
|
921
939
|
};
|
|
922
940
|
accessKey: {
|
|
923
941
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1262,7 +1280,7 @@ declare const useDescope: () => ((({
|
|
|
1262
1280
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1263
1281
|
};
|
|
1264
1282
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1265
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1283
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1266
1284
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1267
1285
|
};
|
|
1268
1286
|
saml: {
|
|
@@ -1377,6 +1395,13 @@ declare const useDescope: () => ((({
|
|
|
1377
1395
|
};
|
|
1378
1396
|
token?: string;
|
|
1379
1397
|
}) => Promise<Response>;
|
|
1398
|
+
patch: (path: string, body?: any, config?: {
|
|
1399
|
+
headers?: HeadersInit;
|
|
1400
|
+
queryParams?: {
|
|
1401
|
+
[key: string]: string;
|
|
1402
|
+
};
|
|
1403
|
+
token?: string;
|
|
1404
|
+
}) => Promise<Response>;
|
|
1380
1405
|
put: (path: string, body?: any, config?: {
|
|
1381
1406
|
headers?: HeadersInit;
|
|
1382
1407
|
queryParams?: {
|
|
@@ -1396,6 +1421,9 @@ declare const useDescope: () => ((({
|
|
|
1396
1421
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1397
1422
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1398
1423
|
};
|
|
1424
|
+
buildUrl: (path: string, queryParams?: {
|
|
1425
|
+
[key: string]: string;
|
|
1426
|
+
}) => string;
|
|
1399
1427
|
};
|
|
1400
1428
|
}) & {
|
|
1401
1429
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -1431,7 +1459,9 @@ declare const useDescope: () => ((({
|
|
|
1431
1459
|
abTestingKey?: number;
|
|
1432
1460
|
startOptionsVersion?: number;
|
|
1433
1461
|
client?: Record<string, any>;
|
|
1434
|
-
|
|
1462
|
+
locale?: string;
|
|
1463
|
+
oidcPrompt?: string;
|
|
1464
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
1435
1465
|
lastAuth?: Omit<{
|
|
1436
1466
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1437
1467
|
oauthProvider?: string;
|
|
@@ -1486,6 +1516,8 @@ declare const useDescope: () => ((({
|
|
|
1486
1516
|
};
|
|
1487
1517
|
fedcm: {
|
|
1488
1518
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
1519
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1520
|
+
isSupported(): boolean;
|
|
1489
1521
|
};
|
|
1490
1522
|
accessKey: {
|
|
1491
1523
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1830,7 +1862,7 @@ declare const useDescope: () => ((({
|
|
|
1830
1862
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1831
1863
|
};
|
|
1832
1864
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1833
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1865
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1834
1866
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1835
1867
|
};
|
|
1836
1868
|
saml: {
|
|
@@ -1945,6 +1977,13 @@ declare const useDescope: () => ((({
|
|
|
1945
1977
|
};
|
|
1946
1978
|
token?: string;
|
|
1947
1979
|
}) => Promise<Response>;
|
|
1980
|
+
patch: (path: string, body?: any, config?: {
|
|
1981
|
+
headers?: HeadersInit;
|
|
1982
|
+
queryParams?: {
|
|
1983
|
+
[key: string]: string;
|
|
1984
|
+
};
|
|
1985
|
+
token?: string;
|
|
1986
|
+
}) => Promise<Response>;
|
|
1948
1987
|
put: (path: string, body?: any, config?: {
|
|
1949
1988
|
headers?: HeadersInit;
|
|
1950
1989
|
queryParams?: {
|
|
@@ -1964,6 +2003,9 @@ declare const useDescope: () => ((({
|
|
|
1964
2003
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1965
2004
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1966
2005
|
};
|
|
2006
|
+
buildUrl: (path: string, queryParams?: {
|
|
2007
|
+
[key: string]: string;
|
|
2008
|
+
}) => string;
|
|
1967
2009
|
};
|
|
1968
2010
|
} | {
|
|
1969
2011
|
flow: {
|
|
@@ -1993,7 +2035,9 @@ declare const useDescope: () => ((({
|
|
|
1993
2035
|
abTestingKey?: number;
|
|
1994
2036
|
startOptionsVersion?: number;
|
|
1995
2037
|
client?: Record<string, any>;
|
|
1996
|
-
|
|
2038
|
+
locale?: string;
|
|
2039
|
+
oidcPrompt?: string;
|
|
2040
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
1997
2041
|
lastAuth?: Omit<{
|
|
1998
2042
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1999
2043
|
oauthProvider?: string;
|
|
@@ -2048,6 +2092,8 @@ declare const useDescope: () => ((({
|
|
|
2048
2092
|
};
|
|
2049
2093
|
fedcm: {
|
|
2050
2094
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
2095
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2096
|
+
isSupported(): boolean;
|
|
2051
2097
|
};
|
|
2052
2098
|
accessKey: {
|
|
2053
2099
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2392,7 +2438,7 @@ declare const useDescope: () => ((({
|
|
|
2392
2438
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2393
2439
|
};
|
|
2394
2440
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2395
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2441
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2396
2442
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2397
2443
|
};
|
|
2398
2444
|
saml: {
|
|
@@ -2507,6 +2553,13 @@ declare const useDescope: () => ((({
|
|
|
2507
2553
|
};
|
|
2508
2554
|
token?: string;
|
|
2509
2555
|
}) => Promise<Response>;
|
|
2556
|
+
patch: (path: string, body?: any, config?: {
|
|
2557
|
+
headers?: HeadersInit;
|
|
2558
|
+
queryParams?: {
|
|
2559
|
+
[key: string]: string;
|
|
2560
|
+
};
|
|
2561
|
+
token?: string;
|
|
2562
|
+
}) => Promise<Response>;
|
|
2510
2563
|
put: (path: string, body?: any, config?: {
|
|
2511
2564
|
headers?: HeadersInit;
|
|
2512
2565
|
queryParams?: {
|
|
@@ -2526,6 +2579,9 @@ declare const useDescope: () => ((({
|
|
|
2526
2579
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
2527
2580
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
2528
2581
|
};
|
|
2582
|
+
buildUrl: (path: string, queryParams?: {
|
|
2583
|
+
[key: string]: string;
|
|
2584
|
+
}) => string;
|
|
2529
2585
|
};
|
|
2530
2586
|
}) & {
|
|
2531
2587
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -2581,7 +2637,9 @@ declare const getSdk: () => ((({
|
|
|
2581
2637
|
abTestingKey?: number;
|
|
2582
2638
|
startOptionsVersion?: number;
|
|
2583
2639
|
client?: Record<string, any>;
|
|
2584
|
-
|
|
2640
|
+
locale?: string;
|
|
2641
|
+
oidcPrompt?: string;
|
|
2642
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
2585
2643
|
lastAuth?: Omit<{
|
|
2586
2644
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
2587
2645
|
oauthProvider?: string;
|
|
@@ -2636,6 +2694,8 @@ declare const getSdk: () => ((({
|
|
|
2636
2694
|
};
|
|
2637
2695
|
fedcm: {
|
|
2638
2696
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
2697
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2698
|
+
isSupported(): boolean;
|
|
2639
2699
|
};
|
|
2640
2700
|
accessKey: {
|
|
2641
2701
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2980,7 +3040,7 @@ declare const getSdk: () => ((({
|
|
|
2980
3040
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2981
3041
|
};
|
|
2982
3042
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2983
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3043
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2984
3044
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2985
3045
|
};
|
|
2986
3046
|
saml: {
|
|
@@ -3095,6 +3155,13 @@ declare const getSdk: () => ((({
|
|
|
3095
3155
|
};
|
|
3096
3156
|
token?: string;
|
|
3097
3157
|
}) => Promise<Response>;
|
|
3158
|
+
patch: (path: string, body?: any, config?: {
|
|
3159
|
+
headers?: HeadersInit;
|
|
3160
|
+
queryParams?: {
|
|
3161
|
+
[key: string]: string;
|
|
3162
|
+
};
|
|
3163
|
+
token?: string;
|
|
3164
|
+
}) => Promise<Response>;
|
|
3098
3165
|
put: (path: string, body?: any, config?: {
|
|
3099
3166
|
headers?: HeadersInit;
|
|
3100
3167
|
queryParams?: {
|
|
@@ -3114,6 +3181,9 @@ declare const getSdk: () => ((({
|
|
|
3114
3181
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3115
3182
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3116
3183
|
};
|
|
3184
|
+
buildUrl: (path: string, queryParams?: {
|
|
3185
|
+
[key: string]: string;
|
|
3186
|
+
}) => string;
|
|
3117
3187
|
};
|
|
3118
3188
|
} | {
|
|
3119
3189
|
flow: {
|
|
@@ -3143,7 +3213,9 @@ declare const getSdk: () => ((({
|
|
|
3143
3213
|
abTestingKey?: number;
|
|
3144
3214
|
startOptionsVersion?: number;
|
|
3145
3215
|
client?: Record<string, any>;
|
|
3146
|
-
|
|
3216
|
+
locale?: string;
|
|
3217
|
+
oidcPrompt?: string;
|
|
3218
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
3147
3219
|
lastAuth?: Omit<{
|
|
3148
3220
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3149
3221
|
oauthProvider?: string;
|
|
@@ -3198,6 +3270,8 @@ declare const getSdk: () => ((({
|
|
|
3198
3270
|
};
|
|
3199
3271
|
fedcm: {
|
|
3200
3272
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
3273
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3274
|
+
isSupported(): boolean;
|
|
3201
3275
|
};
|
|
3202
3276
|
accessKey: {
|
|
3203
3277
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -3542,7 +3616,7 @@ declare const getSdk: () => ((({
|
|
|
3542
3616
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
3543
3617
|
};
|
|
3544
3618
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3545
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3619
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3546
3620
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3547
3621
|
};
|
|
3548
3622
|
saml: {
|
|
@@ -3657,6 +3731,13 @@ declare const getSdk: () => ((({
|
|
|
3657
3731
|
};
|
|
3658
3732
|
token?: string;
|
|
3659
3733
|
}) => Promise<Response>;
|
|
3734
|
+
patch: (path: string, body?: any, config?: {
|
|
3735
|
+
headers?: HeadersInit;
|
|
3736
|
+
queryParams?: {
|
|
3737
|
+
[key: string]: string;
|
|
3738
|
+
};
|
|
3739
|
+
token?: string;
|
|
3740
|
+
}) => Promise<Response>;
|
|
3660
3741
|
put: (path: string, body?: any, config?: {
|
|
3661
3742
|
headers?: HeadersInit;
|
|
3662
3743
|
queryParams?: {
|
|
@@ -3676,6 +3757,9 @@ declare const getSdk: () => ((({
|
|
|
3676
3757
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3677
3758
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3678
3759
|
};
|
|
3760
|
+
buildUrl: (path: string, queryParams?: {
|
|
3761
|
+
[key: string]: string;
|
|
3762
|
+
}) => string;
|
|
3679
3763
|
};
|
|
3680
3764
|
}) & {
|
|
3681
3765
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -3711,7 +3795,9 @@ declare const getSdk: () => ((({
|
|
|
3711
3795
|
abTestingKey?: number;
|
|
3712
3796
|
startOptionsVersion?: number;
|
|
3713
3797
|
client?: Record<string, any>;
|
|
3714
|
-
|
|
3798
|
+
locale?: string;
|
|
3799
|
+
oidcPrompt?: string;
|
|
3800
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
3715
3801
|
lastAuth?: Omit<{
|
|
3716
3802
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3717
3803
|
oauthProvider?: string;
|
|
@@ -3766,6 +3852,8 @@ declare const getSdk: () => ((({
|
|
|
3766
3852
|
};
|
|
3767
3853
|
fedcm: {
|
|
3768
3854
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
3855
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3856
|
+
isSupported(): boolean;
|
|
3769
3857
|
};
|
|
3770
3858
|
accessKey: {
|
|
3771
3859
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4110,7 +4198,7 @@ declare const getSdk: () => ((({
|
|
|
4110
4198
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4111
4199
|
};
|
|
4112
4200
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4113
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4201
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4114
4202
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4115
4203
|
};
|
|
4116
4204
|
saml: {
|
|
@@ -4225,6 +4313,13 @@ declare const getSdk: () => ((({
|
|
|
4225
4313
|
};
|
|
4226
4314
|
token?: string;
|
|
4227
4315
|
}) => Promise<Response>;
|
|
4316
|
+
patch: (path: string, body?: any, config?: {
|
|
4317
|
+
headers?: HeadersInit;
|
|
4318
|
+
queryParams?: {
|
|
4319
|
+
[key: string]: string;
|
|
4320
|
+
};
|
|
4321
|
+
token?: string;
|
|
4322
|
+
}) => Promise<Response>;
|
|
4228
4323
|
put: (path: string, body?: any, config?: {
|
|
4229
4324
|
headers?: HeadersInit;
|
|
4230
4325
|
queryParams?: {
|
|
@@ -4244,6 +4339,9 @@ declare const getSdk: () => ((({
|
|
|
4244
4339
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4245
4340
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4246
4341
|
};
|
|
4342
|
+
buildUrl: (path: string, queryParams?: {
|
|
4343
|
+
[key: string]: string;
|
|
4344
|
+
}) => string;
|
|
4247
4345
|
};
|
|
4248
4346
|
} | {
|
|
4249
4347
|
flow: {
|
|
@@ -4273,7 +4371,9 @@ declare const getSdk: () => ((({
|
|
|
4273
4371
|
abTestingKey?: number;
|
|
4274
4372
|
startOptionsVersion?: number;
|
|
4275
4373
|
client?: Record<string, any>;
|
|
4276
|
-
|
|
4374
|
+
locale?: string;
|
|
4375
|
+
oidcPrompt?: string;
|
|
4376
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
4277
4377
|
lastAuth?: Omit<{
|
|
4278
4378
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
4279
4379
|
oauthProvider?: string;
|
|
@@ -4328,6 +4428,8 @@ declare const getSdk: () => ((({
|
|
|
4328
4428
|
};
|
|
4329
4429
|
fedcm: {
|
|
4330
4430
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
4431
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4432
|
+
isSupported(): boolean;
|
|
4331
4433
|
};
|
|
4332
4434
|
accessKey: {
|
|
4333
4435
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4672,7 +4774,7 @@ declare const getSdk: () => ((({
|
|
|
4672
4774
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4673
4775
|
};
|
|
4674
4776
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4675
|
-
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4777
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4676
4778
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4677
4779
|
};
|
|
4678
4780
|
saml: {
|
|
@@ -4787,6 +4889,13 @@ declare const getSdk: () => ((({
|
|
|
4787
4889
|
};
|
|
4788
4890
|
token?: string;
|
|
4789
4891
|
}) => Promise<Response>;
|
|
4892
|
+
patch: (path: string, body?: any, config?: {
|
|
4893
|
+
headers?: HeadersInit;
|
|
4894
|
+
queryParams?: {
|
|
4895
|
+
[key: string]: string;
|
|
4896
|
+
};
|
|
4897
|
+
token?: string;
|
|
4898
|
+
}) => Promise<Response>;
|
|
4790
4899
|
put: (path: string, body?: any, config?: {
|
|
4791
4900
|
headers?: HeadersInit;
|
|
4792
4901
|
queryParams?: {
|
|
@@ -4806,6 +4915,9 @@ declare const getSdk: () => ((({
|
|
|
4806
4915
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4807
4916
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4808
4917
|
};
|
|
4918
|
+
buildUrl: (path: string, queryParams?: {
|
|
4919
|
+
[key: string]: string;
|
|
4920
|
+
}) => string;
|
|
4809
4921
|
};
|
|
4810
4922
|
}) & {
|
|
4811
4923
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{computed as e,watch as t,inject as
|
|
1
|
+
import{computed as e,watch as t,inject as r,defineComponent as s,resolveComponent as n,openBlock as a,createElementBlock as o,createVNode as i,unref as u,ref as d,readonly as l}from"vue";import c from"@descope/web-component";import"@descope/core-js-sdk";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";const g=Symbol("$descope"),m={"x-descope-sdk-name":"vue","x-descope-sdk-version":"2.0.20"},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,f=()=>{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))}},w=()=>{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"),""),k=()=>b?U?.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),I=(e=j())=>U?.isJwtExpired(e),R=(e=k())=>U?.isJwtExpired(e),q=S(((e=j(),t)=>U?.getJwtPermissions(e,t))),M=S(((e=j(),t)=>U?.getJwtRoles(e,t)));var T=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}},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,d=r,{projectId:l,baseUrl:p,baseStaticUrl:g,storeLastAuthenticatedUser:b}=v(),y=h(),f=e((()=>s.form?JSON.stringify(s.form):"")),w=e((()=>s.client?JSON.stringify(s.client):"")),S=async e=>{await(y.httpClient.hooks?.afterRequest?.({},new Response(JSON.stringify(e.detail)))),d("success",e)},_=e=>d("error",e),j=e=>d("ready",e);return(e,r)=>{const s=n("descope-wc");return a(),o("div",null,[i(s,{"project-id":u(l),"base-url":u(p),"base-static-url":u(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,"validate-on-blur":t.validateOnBlur,"store-last-authenticated-user":u(b),".errorTransformer":t.errorTransformer,"^form":f.value,"^client":w.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","validate-on-blur","store-last-authenticated-user",".errorTransformer","^form","^client"])])}}});T.__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(d,l)=>{const c=n("descope-user-management-widget");return a(),o("div",null,[i(c,{"project-id":u(t),"base-url":u(r),"base-static-url":u(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 C=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(d,l)=>{const c=n("descope-role-management-widget");return a(),o("div",null,[i(c,{"project-id":u(t),"base-url":u(r),"base-static-url":u(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/RoleManagement.vue";var A=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(d,l)=>{const c=n("descope-access-key-management-widget");return a(),o("div",null,[i(c,{"project-id":u(t),"base-url":u(r),"base-static-url":u(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"])])}}});A.__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(d,l)=>{const c=n("descope-audit-management-widget");return a(),o("div",null,[i(c,{"project-id":u(t),"base-url":u(r),"base-static-url":u(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:d,baseUrl:l,baseStaticUrl:c}=v();return(t,r)=>{const p=n("descope-user-profile-widget");return a(),o("div",null,[i(p,{"project-id":u(d),"base-url":u(l),"base-static-url":u(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";const N=d(null),O=()=>u(N)?.();let J;const K=()=>J;var x={install:function(r,s){const n=_({persistTokens:!0,...s,autoRefresh:!0,baseHeaders:m});J=n;const a=d(null),o=d(""),i=d(null),c=d(null);n.onSessionTokenChange((e=>{o.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===i.value));N.value=()=>new Promise(((e,r)=>{!o.value&&b.value&&p().catch(r),t((()=>a.value),(()=>!a.value&&e(!!u(o))),{immediate:!0})})),r.provide(g,{session:{fetchSession:p,isLoading:l(a),session:l(o),isFetchSessionWasNeverCalled:b},user:{fetchUser:async()=>{i.value=!0,await n.me(),i.value=!1},isLoading:l(i),user:l(c),isFetchUserWasNeverCalled:y},sdk:n,options:s})}};export{A as AccessKeyManagement,L as AuditManagement,T as Descope,C as RoleManagement,B as UserManagement,F as UserProfile,x as default,q as getJwtPermissions,M as getJwtRoles,k as getRefreshToken,K as getSdk,j as getSessionToken,R as isRefreshTokenExpired,I as isSessionTokenExpired,O as routeGuard,h as useDescope,f as useSession,w as useUser};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,96 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
}
|
|
2
|
+
"name": "@descope/vue-sdk",
|
|
3
|
+
"version": "2.0.20",
|
|
4
|
+
"main": "dist/index.cjs",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"exports": {
|
|
9
|
+
"require": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"lint-staged": {
|
|
23
|
+
"+(src|tests|example)/**/*.{js,ts,jsx,tsx}": [
|
|
24
|
+
"npm run lint"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@descope/access-key-management-widget": "0.1.114",
|
|
29
|
+
"@descope/audit-management-widget": "0.1.77",
|
|
30
|
+
"@descope/role-management-widget": "0.1.112",
|
|
31
|
+
"@descope/user-management-widget": "0.4.115",
|
|
32
|
+
"@descope/user-profile-widget": "0.0.92",
|
|
33
|
+
"@descope/web-component": "3.20.3",
|
|
34
|
+
"@descope/web-js-sdk": "1.15.9",
|
|
35
|
+
"@descope/core-js-sdk": "2.23.5"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"vue": ">=3"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@rollup/plugin-typescript": "^11.1.0",
|
|
42
|
+
"@types/jest": "^27.0.1",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
44
|
+
"@types/node": "20.14.11",
|
|
45
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
46
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
47
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
48
|
+
"@vue/cli-plugin-typescript": "~5.0.0",
|
|
49
|
+
"@vue/cli-plugin-unit-jest": "~5.0.0",
|
|
50
|
+
"@vue/cli-service": "~5.0.0",
|
|
51
|
+
"@vue/eslint-config-typescript": "^9.1.0",
|
|
52
|
+
"@vue/test-utils": "^2.0.0-0",
|
|
53
|
+
"@vue/vue3-jest": "^27.0.0-alpha.1",
|
|
54
|
+
"babel-jest": "^27.0.6",
|
|
55
|
+
"eslint": "^7.32.0",
|
|
56
|
+
"eslint-config-prettier": "^8.3.0",
|
|
57
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
58
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
59
|
+
"jest": "^29.0.0",
|
|
60
|
+
"jest-fetch-mock": "^3.0.3",
|
|
61
|
+
"lint-staged": "^13.0.3",
|
|
62
|
+
"prettier": "^2.4.1",
|
|
63
|
+
"pretty-quick": "^3.1.3",
|
|
64
|
+
"rollup": "^2.79.1",
|
|
65
|
+
"rollup-plugin-auto-external": "^2.0.0",
|
|
66
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
67
|
+
"rollup-plugin-define": "1.0.1",
|
|
68
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
69
|
+
"rollup-plugin-dts": "^4.2.2",
|
|
70
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
71
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
72
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
73
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
74
|
+
"ts-jest": "^27.0.4",
|
|
75
|
+
"tslib": "^2.3.1",
|
|
76
|
+
"typescript": "^4.9.3",
|
|
77
|
+
"vue": "^3.2.13",
|
|
78
|
+
"vue-router": "^4.1.6",
|
|
79
|
+
"jest-environment-jsdom": "^29.0.0"
|
|
80
|
+
},
|
|
81
|
+
"overrides": {
|
|
82
|
+
"semver": "7.5.2"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"start": "vue-cli-service serve --port 3000",
|
|
86
|
+
"build": "rollup -m -c rollup.config.js",
|
|
87
|
+
"test": "vue-cli-service test:unit",
|
|
88
|
+
"lint": "vue-cli-service lint",
|
|
89
|
+
"format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged",
|
|
90
|
+
"format": "prettier . -w --ignore-path .gitignore",
|
|
91
|
+
"format-check": "prettier . --check --ignore-path .gitignore",
|
|
92
|
+
"leaks": "bash ./scripts/gitleaks/gitleaks.sh"
|
|
93
|
+
}
|
|
94
|
+
}
|