@descope/vue-sdk 2.0.17 → 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 -56
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +147 -29
- 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,23 +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
|
-
<!-- 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. -->
|
|
58
|
-
<!-- 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. -->
|
|
59
|
-
<!-- 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. -->
|
|
60
56
|
</template>
|
|
61
57
|
|
|
62
58
|
<script setup>
|
|
@@ -66,15 +62,15 @@ import { ref } from 'vue';
|
|
|
66
62
|
const isFlowLoading = ref(true);
|
|
67
63
|
|
|
68
64
|
const handleSuccess = (e) => {
|
|
69
|
-
|
|
65
|
+
console.log('Logged in!', e);
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
const handleError = (e) => {
|
|
73
|
-
|
|
69
|
+
console.log('Could not log in', e);
|
|
74
70
|
};
|
|
75
71
|
|
|
76
72
|
const handleReady = () => {
|
|
77
|
-
|
|
73
|
+
isFlowLoading.value = false;
|
|
78
74
|
};
|
|
79
75
|
|
|
80
76
|
// let tenantId = '<tenantId>'; // replace with your tenant ID
|
|
@@ -145,13 +141,13 @@ import { getSessionToken } from '@descope/vue-sdk';
|
|
|
145
141
|
// fetch data using back
|
|
146
142
|
// Note: Descope backend SDKs support extracting session token from the Authorization header
|
|
147
143
|
export const fetchData = async () => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
const sessionToken = getSessionToken();
|
|
145
|
+
const res = await fetch('/path/to/server/api', {
|
|
146
|
+
headers: {
|
|
147
|
+
Authorization: `Bearer ${sessionToken}`,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
// ... use res
|
|
155
151
|
};
|
|
156
152
|
```
|
|
157
153
|
|
|
@@ -171,8 +167,8 @@ import descope from '@descope/vue-sdk';
|
|
|
171
167
|
const app = createApp(App);
|
|
172
168
|
|
|
173
169
|
app.use(descope, {
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
projectId: 'project-id',
|
|
171
|
+
sessionTokenViaCookie: true,
|
|
176
172
|
});
|
|
177
173
|
```
|
|
178
174
|
|
|
@@ -195,13 +191,13 @@ import descope, { getSdk } from '../src';
|
|
|
195
191
|
const app = createApp(App);
|
|
196
192
|
|
|
197
193
|
app.use(descope, {
|
|
198
|
-
|
|
194
|
+
projectId: 'project-id',
|
|
199
195
|
});
|
|
200
196
|
|
|
201
197
|
const sdk = getSdk();
|
|
202
198
|
|
|
203
199
|
sdk?.onSessionTokenChange((newSession) => {
|
|
204
|
-
|
|
200
|
+
// here you can implement custom logic when the session is changing
|
|
205
201
|
});
|
|
206
202
|
```
|
|
207
203
|
|
|
@@ -271,7 +267,7 @@ Note:
|
|
|
271
267
|
|
|
272
268
|
```vue
|
|
273
269
|
<template>
|
|
274
|
-
|
|
270
|
+
<UserManagement tenant="tenant-id" widget-id="user-management-widget" />
|
|
275
271
|
</template>
|
|
276
272
|
|
|
277
273
|
<script setup>
|
|
@@ -301,7 +297,7 @@ Note:
|
|
|
301
297
|
|
|
302
298
|
```vue
|
|
303
299
|
<template>
|
|
304
|
-
|
|
300
|
+
<RoleManagement tenant="tenant-id" widget-id="role-management-widget" />
|
|
305
301
|
</template>
|
|
306
302
|
|
|
307
303
|
<script setup>
|
|
@@ -326,17 +322,11 @@ The widget lets you:
|
|
|
326
322
|
|
|
327
323
|
```vue
|
|
328
324
|
<template>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
<!-- user view: mange access key for the logged-in tenant's user -->
|
|
336
|
-
<AccessKeyManagement
|
|
337
|
-
tenant="tenant-id"
|
|
338
|
-
widget-id="user-access-key-management-widget"
|
|
339
|
-
/>
|
|
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" />
|
|
340
330
|
</template>
|
|
341
331
|
|
|
342
332
|
<script setup>
|
|
@@ -355,7 +345,7 @@ The `AuditManagement` widget lets you embed an audit table in your site.
|
|
|
355
345
|
|
|
356
346
|
```vue
|
|
357
347
|
<template>
|
|
358
|
-
|
|
348
|
+
<AuditManagement tenant="tenant-id" widget-id="audit-management-widget" />
|
|
359
349
|
</template>
|
|
360
350
|
|
|
361
351
|
<script setup>
|
|
@@ -381,7 +371,7 @@ The widget lets you:
|
|
|
381
371
|
|
|
382
372
|
```vue
|
|
383
373
|
<template>
|
|
384
|
-
|
|
374
|
+
<UserProfile widget-id="user-profile-widget" @logout="onLogout" />
|
|
385
375
|
</template>
|
|
386
376
|
|
|
387
377
|
<script setup>
|
|
@@ -455,11 +445,11 @@ The Descope SDK caches the user and session token in the frontend. If you update
|
|
|
455
445
|
const sdk = useDescope();
|
|
456
446
|
|
|
457
447
|
const handleUpdateUser = () => {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
448
|
+
myBackendUpdateUser().then(() => {
|
|
449
|
+
sdk.me();
|
|
450
|
+
// or
|
|
451
|
+
sdk.refresh();
|
|
452
|
+
});
|
|
463
453
|
};
|
|
464
454
|
```
|
|
465
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
|
@@ -27,6 +27,9 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
27
27
|
type: StringConstructor;
|
|
28
28
|
};
|
|
29
29
|
autoFocus: {
|
|
30
|
+
type: StringConstructor | BooleanConstructor;
|
|
31
|
+
};
|
|
32
|
+
validateOnBlur: {
|
|
30
33
|
type: BooleanConstructor;
|
|
31
34
|
};
|
|
32
35
|
errorTransformer: {
|
|
@@ -40,7 +43,7 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
40
43
|
};
|
|
41
44
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
42
45
|
[key: string]: any;
|
|
43
|
-
}>, 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<{
|
|
44
47
|
flowId: {
|
|
45
48
|
type: StringConstructor;
|
|
46
49
|
required: true;
|
|
@@ -64,6 +67,9 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
64
67
|
type: StringConstructor;
|
|
65
68
|
};
|
|
66
69
|
autoFocus: {
|
|
70
|
+
type: StringConstructor | BooleanConstructor;
|
|
71
|
+
};
|
|
72
|
+
validateOnBlur: {
|
|
67
73
|
type: BooleanConstructor;
|
|
68
74
|
};
|
|
69
75
|
errorTransformer: {
|
|
@@ -81,8 +87,8 @@ declare const _default$6: vue.DefineComponent<{
|
|
|
81
87
|
onReady?: (...args: any[]) => any;
|
|
82
88
|
}, {
|
|
83
89
|
debug: boolean;
|
|
84
|
-
|
|
85
|
-
}>;
|
|
90
|
+
validateOnBlur: boolean;
|
|
91
|
+
}, {}>;
|
|
86
92
|
|
|
87
93
|
declare const _default$5: vue.DefineComponent<{
|
|
88
94
|
tenant: {
|
|
@@ -101,7 +107,7 @@ declare const _default$5: vue.DefineComponent<{
|
|
|
101
107
|
};
|
|
102
108
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
103
109
|
[key: string]: any;
|
|
104
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
110
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
105
111
|
tenant: {
|
|
106
112
|
type: StringConstructor;
|
|
107
113
|
required: true;
|
|
@@ -118,7 +124,7 @@ declare const _default$5: vue.DefineComponent<{
|
|
|
118
124
|
};
|
|
119
125
|
}>>, {
|
|
120
126
|
debug: boolean;
|
|
121
|
-
}>;
|
|
127
|
+
}, {}>;
|
|
122
128
|
|
|
123
129
|
declare const _default$4: vue.DefineComponent<{
|
|
124
130
|
tenant: {
|
|
@@ -137,7 +143,7 @@ declare const _default$4: vue.DefineComponent<{
|
|
|
137
143
|
};
|
|
138
144
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
139
145
|
[key: string]: any;
|
|
140
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
146
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
141
147
|
tenant: {
|
|
142
148
|
type: StringConstructor;
|
|
143
149
|
required: true;
|
|
@@ -154,7 +160,7 @@ declare const _default$4: vue.DefineComponent<{
|
|
|
154
160
|
};
|
|
155
161
|
}>>, {
|
|
156
162
|
debug: boolean;
|
|
157
|
-
}>;
|
|
163
|
+
}, {}>;
|
|
158
164
|
|
|
159
165
|
declare const _default$3: vue.DefineComponent<{
|
|
160
166
|
tenant: {
|
|
@@ -173,7 +179,7 @@ declare const _default$3: vue.DefineComponent<{
|
|
|
173
179
|
};
|
|
174
180
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
175
181
|
[key: string]: any;
|
|
176
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
182
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
177
183
|
tenant: {
|
|
178
184
|
type: StringConstructor;
|
|
179
185
|
required: true;
|
|
@@ -190,7 +196,7 @@ declare const _default$3: vue.DefineComponent<{
|
|
|
190
196
|
};
|
|
191
197
|
}>>, {
|
|
192
198
|
debug: boolean;
|
|
193
|
-
}>;
|
|
199
|
+
}, {}>;
|
|
194
200
|
|
|
195
201
|
declare const _default$2: vue.DefineComponent<{
|
|
196
202
|
tenant: {
|
|
@@ -209,7 +215,7 @@ declare const _default$2: vue.DefineComponent<{
|
|
|
209
215
|
};
|
|
210
216
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
211
217
|
[key: string]: any;
|
|
212
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.
|
|
218
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
213
219
|
tenant: {
|
|
214
220
|
type: StringConstructor;
|
|
215
221
|
required: true;
|
|
@@ -226,7 +232,7 @@ declare const _default$2: vue.DefineComponent<{
|
|
|
226
232
|
};
|
|
227
233
|
}>>, {
|
|
228
234
|
debug: boolean;
|
|
229
|
-
}>;
|
|
235
|
+
}, {}>;
|
|
230
236
|
|
|
231
237
|
declare const _default$1: vue.DefineComponent<{
|
|
232
238
|
widgetId: {
|
|
@@ -241,7 +247,7 @@ declare const _default$1: vue.DefineComponent<{
|
|
|
241
247
|
};
|
|
242
248
|
}, (_ctx: any, _cache: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
243
249
|
[key: string]: any;
|
|
244
|
-
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "logout"[], "logout", vue.
|
|
250
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "logout"[], "logout", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
245
251
|
widgetId: {
|
|
246
252
|
type: StringConstructor;
|
|
247
253
|
required: true;
|
|
@@ -256,7 +262,7 @@ declare const _default$1: vue.DefineComponent<{
|
|
|
256
262
|
onLogout?: (...args: any[]) => any;
|
|
257
263
|
}, {
|
|
258
264
|
debug: boolean;
|
|
259
|
-
}>;
|
|
265
|
+
}, {}>;
|
|
260
266
|
|
|
261
267
|
type Options = {
|
|
262
268
|
projectId: string;
|
|
@@ -295,7 +301,9 @@ declare const useDescope: () => ((({
|
|
|
295
301
|
abTestingKey?: number;
|
|
296
302
|
startOptionsVersion?: number;
|
|
297
303
|
client?: Record<string, any>;
|
|
298
|
-
|
|
304
|
+
locale?: string;
|
|
305
|
+
oidcPrompt?: string;
|
|
306
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
299
307
|
lastAuth?: Omit<{
|
|
300
308
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
301
309
|
oauthProvider?: string;
|
|
@@ -350,6 +358,8 @@ declare const useDescope: () => ((({
|
|
|
350
358
|
};
|
|
351
359
|
fedcm: {
|
|
352
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;
|
|
353
363
|
};
|
|
354
364
|
accessKey: {
|
|
355
365
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -694,7 +704,7 @@ declare const useDescope: () => ((({
|
|
|
694
704
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
695
705
|
};
|
|
696
706
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
697
|
-
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>>;
|
|
698
708
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
699
709
|
};
|
|
700
710
|
saml: {
|
|
@@ -809,6 +819,13 @@ declare const useDescope: () => ((({
|
|
|
809
819
|
};
|
|
810
820
|
token?: string;
|
|
811
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>;
|
|
812
829
|
put: (path: string, body?: any, config?: {
|
|
813
830
|
headers?: HeadersInit;
|
|
814
831
|
queryParams?: {
|
|
@@ -828,6 +845,9 @@ declare const useDescope: () => ((({
|
|
|
828
845
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
829
846
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
830
847
|
};
|
|
848
|
+
buildUrl: (path: string, queryParams?: {
|
|
849
|
+
[key: string]: string;
|
|
850
|
+
}) => string;
|
|
831
851
|
};
|
|
832
852
|
} | {
|
|
833
853
|
flow: {
|
|
@@ -857,7 +877,9 @@ declare const useDescope: () => ((({
|
|
|
857
877
|
abTestingKey?: number;
|
|
858
878
|
startOptionsVersion?: number;
|
|
859
879
|
client?: Record<string, any>;
|
|
860
|
-
|
|
880
|
+
locale?: string;
|
|
881
|
+
oidcPrompt?: string;
|
|
882
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
861
883
|
lastAuth?: Omit<{
|
|
862
884
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
863
885
|
oauthProvider?: string;
|
|
@@ -912,6 +934,8 @@ declare const useDescope: () => ((({
|
|
|
912
934
|
};
|
|
913
935
|
fedcm: {
|
|
914
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;
|
|
915
939
|
};
|
|
916
940
|
accessKey: {
|
|
917
941
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1256,7 +1280,7 @@ declare const useDescope: () => ((({
|
|
|
1256
1280
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1257
1281
|
};
|
|
1258
1282
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1259
|
-
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>>;
|
|
1260
1284
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1261
1285
|
};
|
|
1262
1286
|
saml: {
|
|
@@ -1371,6 +1395,13 @@ declare const useDescope: () => ((({
|
|
|
1371
1395
|
};
|
|
1372
1396
|
token?: string;
|
|
1373
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>;
|
|
1374
1405
|
put: (path: string, body?: any, config?: {
|
|
1375
1406
|
headers?: HeadersInit;
|
|
1376
1407
|
queryParams?: {
|
|
@@ -1390,6 +1421,9 @@ declare const useDescope: () => ((({
|
|
|
1390
1421
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1391
1422
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1392
1423
|
};
|
|
1424
|
+
buildUrl: (path: string, queryParams?: {
|
|
1425
|
+
[key: string]: string;
|
|
1426
|
+
}) => string;
|
|
1393
1427
|
};
|
|
1394
1428
|
}) & {
|
|
1395
1429
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -1425,7 +1459,9 @@ declare const useDescope: () => ((({
|
|
|
1425
1459
|
abTestingKey?: number;
|
|
1426
1460
|
startOptionsVersion?: number;
|
|
1427
1461
|
client?: Record<string, any>;
|
|
1428
|
-
|
|
1462
|
+
locale?: string;
|
|
1463
|
+
oidcPrompt?: string;
|
|
1464
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
1429
1465
|
lastAuth?: Omit<{
|
|
1430
1466
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1431
1467
|
oauthProvider?: string;
|
|
@@ -1480,6 +1516,8 @@ declare const useDescope: () => ((({
|
|
|
1480
1516
|
};
|
|
1481
1517
|
fedcm: {
|
|
1482
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;
|
|
1483
1521
|
};
|
|
1484
1522
|
accessKey: {
|
|
1485
1523
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1824,7 +1862,7 @@ declare const useDescope: () => ((({
|
|
|
1824
1862
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1825
1863
|
};
|
|
1826
1864
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1827
|
-
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>>;
|
|
1828
1866
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1829
1867
|
};
|
|
1830
1868
|
saml: {
|
|
@@ -1939,6 +1977,13 @@ declare const useDescope: () => ((({
|
|
|
1939
1977
|
};
|
|
1940
1978
|
token?: string;
|
|
1941
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>;
|
|
1942
1987
|
put: (path: string, body?: any, config?: {
|
|
1943
1988
|
headers?: HeadersInit;
|
|
1944
1989
|
queryParams?: {
|
|
@@ -1958,6 +2003,9 @@ declare const useDescope: () => ((({
|
|
|
1958
2003
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1959
2004
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1960
2005
|
};
|
|
2006
|
+
buildUrl: (path: string, queryParams?: {
|
|
2007
|
+
[key: string]: string;
|
|
2008
|
+
}) => string;
|
|
1961
2009
|
};
|
|
1962
2010
|
} | {
|
|
1963
2011
|
flow: {
|
|
@@ -1987,7 +2035,9 @@ declare const useDescope: () => ((({
|
|
|
1987
2035
|
abTestingKey?: number;
|
|
1988
2036
|
startOptionsVersion?: number;
|
|
1989
2037
|
client?: Record<string, any>;
|
|
1990
|
-
|
|
2038
|
+
locale?: string;
|
|
2039
|
+
oidcPrompt?: string;
|
|
2040
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
1991
2041
|
lastAuth?: Omit<{
|
|
1992
2042
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1993
2043
|
oauthProvider?: string;
|
|
@@ -2042,6 +2092,8 @@ declare const useDescope: () => ((({
|
|
|
2042
2092
|
};
|
|
2043
2093
|
fedcm: {
|
|
2044
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;
|
|
2045
2097
|
};
|
|
2046
2098
|
accessKey: {
|
|
2047
2099
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2386,7 +2438,7 @@ declare const useDescope: () => ((({
|
|
|
2386
2438
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2387
2439
|
};
|
|
2388
2440
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2389
|
-
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>>;
|
|
2390
2442
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2391
2443
|
};
|
|
2392
2444
|
saml: {
|
|
@@ -2501,6 +2553,13 @@ declare const useDescope: () => ((({
|
|
|
2501
2553
|
};
|
|
2502
2554
|
token?: string;
|
|
2503
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>;
|
|
2504
2563
|
put: (path: string, body?: any, config?: {
|
|
2505
2564
|
headers?: HeadersInit;
|
|
2506
2565
|
queryParams?: {
|
|
@@ -2520,6 +2579,9 @@ declare const useDescope: () => ((({
|
|
|
2520
2579
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
2521
2580
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
2522
2581
|
};
|
|
2582
|
+
buildUrl: (path: string, queryParams?: {
|
|
2583
|
+
[key: string]: string;
|
|
2584
|
+
}) => string;
|
|
2523
2585
|
};
|
|
2524
2586
|
}) & {
|
|
2525
2587
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -2575,7 +2637,9 @@ declare const getSdk: () => ((({
|
|
|
2575
2637
|
abTestingKey?: number;
|
|
2576
2638
|
startOptionsVersion?: number;
|
|
2577
2639
|
client?: Record<string, any>;
|
|
2578
|
-
|
|
2640
|
+
locale?: string;
|
|
2641
|
+
oidcPrompt?: string;
|
|
2642
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
2579
2643
|
lastAuth?: Omit<{
|
|
2580
2644
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
2581
2645
|
oauthProvider?: string;
|
|
@@ -2630,6 +2694,8 @@ declare const getSdk: () => ((({
|
|
|
2630
2694
|
};
|
|
2631
2695
|
fedcm: {
|
|
2632
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;
|
|
2633
2699
|
};
|
|
2634
2700
|
accessKey: {
|
|
2635
2701
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2974,7 +3040,7 @@ declare const getSdk: () => ((({
|
|
|
2974
3040
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2975
3041
|
};
|
|
2976
3042
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2977
|
-
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>>;
|
|
2978
3044
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2979
3045
|
};
|
|
2980
3046
|
saml: {
|
|
@@ -3089,6 +3155,13 @@ declare const getSdk: () => ((({
|
|
|
3089
3155
|
};
|
|
3090
3156
|
token?: string;
|
|
3091
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>;
|
|
3092
3165
|
put: (path: string, body?: any, config?: {
|
|
3093
3166
|
headers?: HeadersInit;
|
|
3094
3167
|
queryParams?: {
|
|
@@ -3108,6 +3181,9 @@ declare const getSdk: () => ((({
|
|
|
3108
3181
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3109
3182
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3110
3183
|
};
|
|
3184
|
+
buildUrl: (path: string, queryParams?: {
|
|
3185
|
+
[key: string]: string;
|
|
3186
|
+
}) => string;
|
|
3111
3187
|
};
|
|
3112
3188
|
} | {
|
|
3113
3189
|
flow: {
|
|
@@ -3137,7 +3213,9 @@ declare const getSdk: () => ((({
|
|
|
3137
3213
|
abTestingKey?: number;
|
|
3138
3214
|
startOptionsVersion?: number;
|
|
3139
3215
|
client?: Record<string, any>;
|
|
3140
|
-
|
|
3216
|
+
locale?: string;
|
|
3217
|
+
oidcPrompt?: string;
|
|
3218
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
3141
3219
|
lastAuth?: Omit<{
|
|
3142
3220
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3143
3221
|
oauthProvider?: string;
|
|
@@ -3192,6 +3270,8 @@ declare const getSdk: () => ((({
|
|
|
3192
3270
|
};
|
|
3193
3271
|
fedcm: {
|
|
3194
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;
|
|
3195
3275
|
};
|
|
3196
3276
|
accessKey: {
|
|
3197
3277
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -3536,7 +3616,7 @@ declare const getSdk: () => ((({
|
|
|
3536
3616
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
3537
3617
|
};
|
|
3538
3618
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3539
|
-
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>>;
|
|
3540
3620
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3541
3621
|
};
|
|
3542
3622
|
saml: {
|
|
@@ -3651,6 +3731,13 @@ declare const getSdk: () => ((({
|
|
|
3651
3731
|
};
|
|
3652
3732
|
token?: string;
|
|
3653
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>;
|
|
3654
3741
|
put: (path: string, body?: any, config?: {
|
|
3655
3742
|
headers?: HeadersInit;
|
|
3656
3743
|
queryParams?: {
|
|
@@ -3670,6 +3757,9 @@ declare const getSdk: () => ((({
|
|
|
3670
3757
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3671
3758
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3672
3759
|
};
|
|
3760
|
+
buildUrl: (path: string, queryParams?: {
|
|
3761
|
+
[key: string]: string;
|
|
3762
|
+
}) => string;
|
|
3673
3763
|
};
|
|
3674
3764
|
}) & {
|
|
3675
3765
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -3705,7 +3795,9 @@ declare const getSdk: () => ((({
|
|
|
3705
3795
|
abTestingKey?: number;
|
|
3706
3796
|
startOptionsVersion?: number;
|
|
3707
3797
|
client?: Record<string, any>;
|
|
3708
|
-
|
|
3798
|
+
locale?: string;
|
|
3799
|
+
oidcPrompt?: string;
|
|
3800
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
3709
3801
|
lastAuth?: Omit<{
|
|
3710
3802
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3711
3803
|
oauthProvider?: string;
|
|
@@ -3760,6 +3852,8 @@ declare const getSdk: () => ((({
|
|
|
3760
3852
|
};
|
|
3761
3853
|
fedcm: {
|
|
3762
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;
|
|
3763
3857
|
};
|
|
3764
3858
|
accessKey: {
|
|
3765
3859
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4104,7 +4198,7 @@ declare const getSdk: () => ((({
|
|
|
4104
4198
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4105
4199
|
};
|
|
4106
4200
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4107
|
-
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>>;
|
|
4108
4202
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4109
4203
|
};
|
|
4110
4204
|
saml: {
|
|
@@ -4219,6 +4313,13 @@ declare const getSdk: () => ((({
|
|
|
4219
4313
|
};
|
|
4220
4314
|
token?: string;
|
|
4221
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>;
|
|
4222
4323
|
put: (path: string, body?: any, config?: {
|
|
4223
4324
|
headers?: HeadersInit;
|
|
4224
4325
|
queryParams?: {
|
|
@@ -4238,6 +4339,9 @@ declare const getSdk: () => ((({
|
|
|
4238
4339
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4239
4340
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4240
4341
|
};
|
|
4342
|
+
buildUrl: (path: string, queryParams?: {
|
|
4343
|
+
[key: string]: string;
|
|
4344
|
+
}) => string;
|
|
4241
4345
|
};
|
|
4242
4346
|
} | {
|
|
4243
4347
|
flow: {
|
|
@@ -4267,7 +4371,9 @@ declare const getSdk: () => ((({
|
|
|
4267
4371
|
abTestingKey?: number;
|
|
4268
4372
|
startOptionsVersion?: number;
|
|
4269
4373
|
client?: Record<string, any>;
|
|
4270
|
-
|
|
4374
|
+
locale?: string;
|
|
4375
|
+
oidcPrompt?: string;
|
|
4376
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt"> & {
|
|
4271
4377
|
lastAuth?: Omit<{
|
|
4272
4378
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
4273
4379
|
oauthProvider?: string;
|
|
@@ -4322,6 +4428,8 @@ declare const getSdk: () => ((({
|
|
|
4322
4428
|
};
|
|
4323
4429
|
fedcm: {
|
|
4324
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;
|
|
4325
4433
|
};
|
|
4326
4434
|
accessKey: {
|
|
4327
4435
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4666,7 +4774,7 @@ declare const getSdk: () => ((({
|
|
|
4666
4774
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4667
4775
|
};
|
|
4668
4776
|
exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4669
|
-
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>>;
|
|
4670
4778
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4671
4779
|
};
|
|
4672
4780
|
saml: {
|
|
@@ -4781,6 +4889,13 @@ declare const getSdk: () => ((({
|
|
|
4781
4889
|
};
|
|
4782
4890
|
token?: string;
|
|
4783
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>;
|
|
4784
4899
|
put: (path: string, body?: any, config?: {
|
|
4785
4900
|
headers?: HeadersInit;
|
|
4786
4901
|
queryParams?: {
|
|
@@ -4800,6 +4915,9 @@ declare const getSdk: () => ((({
|
|
|
4800
4915
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4801
4916
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4802
4917
|
};
|
|
4918
|
+
buildUrl: (path: string, queryParams?: {
|
|
4919
|
+
[key: string]: string;
|
|
4920
|
+
}) => string;
|
|
4803
4921
|
};
|
|
4804
4922
|
}) & {
|
|
4805
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
|
+
}
|