@descope/vue-sdk 2.0.19 → 2.0.21
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 +148 -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.21"},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,10 @@ 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
|
+
oidcErrorRedirectUri?: string;
|
|
307
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
305
308
|
lastAuth?: Omit<{
|
|
306
309
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
307
310
|
oauthProvider?: string;
|
|
@@ -356,6 +359,8 @@ declare const useDescope: () => ((({
|
|
|
356
359
|
};
|
|
357
360
|
fedcm: {
|
|
358
361
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
362
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
363
|
+
isSupported(): boolean;
|
|
359
364
|
};
|
|
360
365
|
accessKey: {
|
|
361
366
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -700,7 +705,7 @@ declare const useDescope: () => ((({
|
|
|
700
705
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
701
706
|
};
|
|
702
707
|
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>>;
|
|
708
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
704
709
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
705
710
|
};
|
|
706
711
|
saml: {
|
|
@@ -815,6 +820,13 @@ declare const useDescope: () => ((({
|
|
|
815
820
|
};
|
|
816
821
|
token?: string;
|
|
817
822
|
}) => Promise<Response>;
|
|
823
|
+
patch: (path: string, body?: any, config?: {
|
|
824
|
+
headers?: HeadersInit;
|
|
825
|
+
queryParams?: {
|
|
826
|
+
[key: string]: string;
|
|
827
|
+
};
|
|
828
|
+
token?: string;
|
|
829
|
+
}) => Promise<Response>;
|
|
818
830
|
put: (path: string, body?: any, config?: {
|
|
819
831
|
headers?: HeadersInit;
|
|
820
832
|
queryParams?: {
|
|
@@ -834,6 +846,9 @@ declare const useDescope: () => ((({
|
|
|
834
846
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
835
847
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
836
848
|
};
|
|
849
|
+
buildUrl: (path: string, queryParams?: {
|
|
850
|
+
[key: string]: string;
|
|
851
|
+
}) => string;
|
|
837
852
|
};
|
|
838
853
|
} | {
|
|
839
854
|
flow: {
|
|
@@ -863,7 +878,10 @@ declare const useDescope: () => ((({
|
|
|
863
878
|
abTestingKey?: number;
|
|
864
879
|
startOptionsVersion?: number;
|
|
865
880
|
client?: Record<string, any>;
|
|
866
|
-
|
|
881
|
+
locale?: string;
|
|
882
|
+
oidcPrompt?: string;
|
|
883
|
+
oidcErrorRedirectUri?: string;
|
|
884
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
867
885
|
lastAuth?: Omit<{
|
|
868
886
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
869
887
|
oauthProvider?: string;
|
|
@@ -918,6 +936,8 @@ declare const useDescope: () => ((({
|
|
|
918
936
|
};
|
|
919
937
|
fedcm: {
|
|
920
938
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
939
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
940
|
+
isSupported(): boolean;
|
|
921
941
|
};
|
|
922
942
|
accessKey: {
|
|
923
943
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1262,7 +1282,7 @@ declare const useDescope: () => ((({
|
|
|
1262
1282
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1263
1283
|
};
|
|
1264
1284
|
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>>;
|
|
1285
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1266
1286
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1267
1287
|
};
|
|
1268
1288
|
saml: {
|
|
@@ -1377,6 +1397,13 @@ declare const useDescope: () => ((({
|
|
|
1377
1397
|
};
|
|
1378
1398
|
token?: string;
|
|
1379
1399
|
}) => Promise<Response>;
|
|
1400
|
+
patch: (path: string, body?: any, config?: {
|
|
1401
|
+
headers?: HeadersInit;
|
|
1402
|
+
queryParams?: {
|
|
1403
|
+
[key: string]: string;
|
|
1404
|
+
};
|
|
1405
|
+
token?: string;
|
|
1406
|
+
}) => Promise<Response>;
|
|
1380
1407
|
put: (path: string, body?: any, config?: {
|
|
1381
1408
|
headers?: HeadersInit;
|
|
1382
1409
|
queryParams?: {
|
|
@@ -1396,6 +1423,9 @@ declare const useDescope: () => ((({
|
|
|
1396
1423
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1397
1424
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1398
1425
|
};
|
|
1426
|
+
buildUrl: (path: string, queryParams?: {
|
|
1427
|
+
[key: string]: string;
|
|
1428
|
+
}) => string;
|
|
1399
1429
|
};
|
|
1400
1430
|
}) & {
|
|
1401
1431
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -1431,7 +1461,10 @@ declare const useDescope: () => ((({
|
|
|
1431
1461
|
abTestingKey?: number;
|
|
1432
1462
|
startOptionsVersion?: number;
|
|
1433
1463
|
client?: Record<string, any>;
|
|
1434
|
-
|
|
1464
|
+
locale?: string;
|
|
1465
|
+
oidcPrompt?: string;
|
|
1466
|
+
oidcErrorRedirectUri?: string;
|
|
1467
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
1435
1468
|
lastAuth?: Omit<{
|
|
1436
1469
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1437
1470
|
oauthProvider?: string;
|
|
@@ -1486,6 +1519,8 @@ declare const useDescope: () => ((({
|
|
|
1486
1519
|
};
|
|
1487
1520
|
fedcm: {
|
|
1488
1521
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
1522
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
1523
|
+
isSupported(): boolean;
|
|
1489
1524
|
};
|
|
1490
1525
|
accessKey: {
|
|
1491
1526
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -1830,7 +1865,7 @@ declare const useDescope: () => ((({
|
|
|
1830
1865
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
1831
1866
|
};
|
|
1832
1867
|
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>>;
|
|
1868
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1834
1869
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
1835
1870
|
};
|
|
1836
1871
|
saml: {
|
|
@@ -1945,6 +1980,13 @@ declare const useDescope: () => ((({
|
|
|
1945
1980
|
};
|
|
1946
1981
|
token?: string;
|
|
1947
1982
|
}) => Promise<Response>;
|
|
1983
|
+
patch: (path: string, body?: any, config?: {
|
|
1984
|
+
headers?: HeadersInit;
|
|
1985
|
+
queryParams?: {
|
|
1986
|
+
[key: string]: string;
|
|
1987
|
+
};
|
|
1988
|
+
token?: string;
|
|
1989
|
+
}) => Promise<Response>;
|
|
1948
1990
|
put: (path: string, body?: any, config?: {
|
|
1949
1991
|
headers?: HeadersInit;
|
|
1950
1992
|
queryParams?: {
|
|
@@ -1964,6 +2006,9 @@ declare const useDescope: () => ((({
|
|
|
1964
2006
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
1965
2007
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
1966
2008
|
};
|
|
2009
|
+
buildUrl: (path: string, queryParams?: {
|
|
2010
|
+
[key: string]: string;
|
|
2011
|
+
}) => string;
|
|
1967
2012
|
};
|
|
1968
2013
|
} | {
|
|
1969
2014
|
flow: {
|
|
@@ -1993,7 +2038,10 @@ declare const useDescope: () => ((({
|
|
|
1993
2038
|
abTestingKey?: number;
|
|
1994
2039
|
startOptionsVersion?: number;
|
|
1995
2040
|
client?: Record<string, any>;
|
|
1996
|
-
|
|
2041
|
+
locale?: string;
|
|
2042
|
+
oidcPrompt?: string;
|
|
2043
|
+
oidcErrorRedirectUri?: string;
|
|
2044
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
1997
2045
|
lastAuth?: Omit<{
|
|
1998
2046
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
1999
2047
|
oauthProvider?: string;
|
|
@@ -2048,6 +2096,8 @@ declare const useDescope: () => ((({
|
|
|
2048
2096
|
};
|
|
2049
2097
|
fedcm: {
|
|
2050
2098
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
2099
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2100
|
+
isSupported(): boolean;
|
|
2051
2101
|
};
|
|
2052
2102
|
accessKey: {
|
|
2053
2103
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2392,7 +2442,7 @@ declare const useDescope: () => ((({
|
|
|
2392
2442
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2393
2443
|
};
|
|
2394
2444
|
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>>;
|
|
2445
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2396
2446
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2397
2447
|
};
|
|
2398
2448
|
saml: {
|
|
@@ -2507,6 +2557,13 @@ declare const useDescope: () => ((({
|
|
|
2507
2557
|
};
|
|
2508
2558
|
token?: string;
|
|
2509
2559
|
}) => Promise<Response>;
|
|
2560
|
+
patch: (path: string, body?: any, config?: {
|
|
2561
|
+
headers?: HeadersInit;
|
|
2562
|
+
queryParams?: {
|
|
2563
|
+
[key: string]: string;
|
|
2564
|
+
};
|
|
2565
|
+
token?: string;
|
|
2566
|
+
}) => Promise<Response>;
|
|
2510
2567
|
put: (path: string, body?: any, config?: {
|
|
2511
2568
|
headers?: HeadersInit;
|
|
2512
2569
|
queryParams?: {
|
|
@@ -2526,6 +2583,9 @@ declare const useDescope: () => ((({
|
|
|
2526
2583
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
2527
2584
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
2528
2585
|
};
|
|
2586
|
+
buildUrl: (path: string, queryParams?: {
|
|
2587
|
+
[key: string]: string;
|
|
2588
|
+
}) => string;
|
|
2529
2589
|
};
|
|
2530
2590
|
}) & {
|
|
2531
2591
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -2581,7 +2641,10 @@ declare const getSdk: () => ((({
|
|
|
2581
2641
|
abTestingKey?: number;
|
|
2582
2642
|
startOptionsVersion?: number;
|
|
2583
2643
|
client?: Record<string, any>;
|
|
2584
|
-
|
|
2644
|
+
locale?: string;
|
|
2645
|
+
oidcPrompt?: string;
|
|
2646
|
+
oidcErrorRedirectUri?: string;
|
|
2647
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
2585
2648
|
lastAuth?: Omit<{
|
|
2586
2649
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
2587
2650
|
oauthProvider?: string;
|
|
@@ -2636,6 +2699,8 @@ declare const getSdk: () => ((({
|
|
|
2636
2699
|
};
|
|
2637
2700
|
fedcm: {
|
|
2638
2701
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
2702
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
2703
|
+
isSupported(): boolean;
|
|
2639
2704
|
};
|
|
2640
2705
|
accessKey: {
|
|
2641
2706
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -2980,7 +3045,7 @@ declare const getSdk: () => ((({
|
|
|
2980
3045
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
2981
3046
|
};
|
|
2982
3047
|
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>>;
|
|
3048
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2984
3049
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
2985
3050
|
};
|
|
2986
3051
|
saml: {
|
|
@@ -3095,6 +3160,13 @@ declare const getSdk: () => ((({
|
|
|
3095
3160
|
};
|
|
3096
3161
|
token?: string;
|
|
3097
3162
|
}) => Promise<Response>;
|
|
3163
|
+
patch: (path: string, body?: any, config?: {
|
|
3164
|
+
headers?: HeadersInit;
|
|
3165
|
+
queryParams?: {
|
|
3166
|
+
[key: string]: string;
|
|
3167
|
+
};
|
|
3168
|
+
token?: string;
|
|
3169
|
+
}) => Promise<Response>;
|
|
3098
3170
|
put: (path: string, body?: any, config?: {
|
|
3099
3171
|
headers?: HeadersInit;
|
|
3100
3172
|
queryParams?: {
|
|
@@ -3114,6 +3186,9 @@ declare const getSdk: () => ((({
|
|
|
3114
3186
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3115
3187
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3116
3188
|
};
|
|
3189
|
+
buildUrl: (path: string, queryParams?: {
|
|
3190
|
+
[key: string]: string;
|
|
3191
|
+
}) => string;
|
|
3117
3192
|
};
|
|
3118
3193
|
} | {
|
|
3119
3194
|
flow: {
|
|
@@ -3143,7 +3218,10 @@ declare const getSdk: () => ((({
|
|
|
3143
3218
|
abTestingKey?: number;
|
|
3144
3219
|
startOptionsVersion?: number;
|
|
3145
3220
|
client?: Record<string, any>;
|
|
3146
|
-
|
|
3221
|
+
locale?: string;
|
|
3222
|
+
oidcPrompt?: string;
|
|
3223
|
+
oidcErrorRedirectUri?: string;
|
|
3224
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
3147
3225
|
lastAuth?: Omit<{
|
|
3148
3226
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3149
3227
|
oauthProvider?: string;
|
|
@@ -3198,6 +3276,8 @@ declare const getSdk: () => ((({
|
|
|
3198
3276
|
};
|
|
3199
3277
|
fedcm: {
|
|
3200
3278
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
3279
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3280
|
+
isSupported(): boolean;
|
|
3201
3281
|
};
|
|
3202
3282
|
accessKey: {
|
|
3203
3283
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -3542,7 +3622,7 @@ declare const getSdk: () => ((({
|
|
|
3542
3622
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
3543
3623
|
};
|
|
3544
3624
|
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>>;
|
|
3625
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3546
3626
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
3547
3627
|
};
|
|
3548
3628
|
saml: {
|
|
@@ -3657,6 +3737,13 @@ declare const getSdk: () => ((({
|
|
|
3657
3737
|
};
|
|
3658
3738
|
token?: string;
|
|
3659
3739
|
}) => Promise<Response>;
|
|
3740
|
+
patch: (path: string, body?: any, config?: {
|
|
3741
|
+
headers?: HeadersInit;
|
|
3742
|
+
queryParams?: {
|
|
3743
|
+
[key: string]: string;
|
|
3744
|
+
};
|
|
3745
|
+
token?: string;
|
|
3746
|
+
}) => Promise<Response>;
|
|
3660
3747
|
put: (path: string, body?: any, config?: {
|
|
3661
3748
|
headers?: HeadersInit;
|
|
3662
3749
|
queryParams?: {
|
|
@@ -3676,6 +3763,9 @@ declare const getSdk: () => ((({
|
|
|
3676
3763
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
3677
3764
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
3678
3765
|
};
|
|
3766
|
+
buildUrl: (path: string, queryParams?: {
|
|
3767
|
+
[key: string]: string;
|
|
3768
|
+
}) => string;
|
|
3679
3769
|
};
|
|
3680
3770
|
}) & {
|
|
3681
3771
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
@@ -3711,7 +3801,10 @@ declare const getSdk: () => ((({
|
|
|
3711
3801
|
abTestingKey?: number;
|
|
3712
3802
|
startOptionsVersion?: number;
|
|
3713
3803
|
client?: Record<string, any>;
|
|
3714
|
-
|
|
3804
|
+
locale?: string;
|
|
3805
|
+
oidcPrompt?: string;
|
|
3806
|
+
oidcErrorRedirectUri?: string;
|
|
3807
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
3715
3808
|
lastAuth?: Omit<{
|
|
3716
3809
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
3717
3810
|
oauthProvider?: string;
|
|
@@ -3766,6 +3859,8 @@ declare const getSdk: () => ((({
|
|
|
3766
3859
|
};
|
|
3767
3860
|
fedcm: {
|
|
3768
3861
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
3862
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
3863
|
+
isSupported(): boolean;
|
|
3769
3864
|
};
|
|
3770
3865
|
accessKey: {
|
|
3771
3866
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4110,7 +4205,7 @@ declare const getSdk: () => ((({
|
|
|
4110
4205
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4111
4206
|
};
|
|
4112
4207
|
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>>;
|
|
4208
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4114
4209
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4115
4210
|
};
|
|
4116
4211
|
saml: {
|
|
@@ -4225,6 +4320,13 @@ declare const getSdk: () => ((({
|
|
|
4225
4320
|
};
|
|
4226
4321
|
token?: string;
|
|
4227
4322
|
}) => Promise<Response>;
|
|
4323
|
+
patch: (path: string, body?: any, config?: {
|
|
4324
|
+
headers?: HeadersInit;
|
|
4325
|
+
queryParams?: {
|
|
4326
|
+
[key: string]: string;
|
|
4327
|
+
};
|
|
4328
|
+
token?: string;
|
|
4329
|
+
}) => Promise<Response>;
|
|
4228
4330
|
put: (path: string, body?: any, config?: {
|
|
4229
4331
|
headers?: HeadersInit;
|
|
4230
4332
|
queryParams?: {
|
|
@@ -4244,6 +4346,9 @@ declare const getSdk: () => ((({
|
|
|
4244
4346
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4245
4347
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4246
4348
|
};
|
|
4349
|
+
buildUrl: (path: string, queryParams?: {
|
|
4350
|
+
[key: string]: string;
|
|
4351
|
+
}) => string;
|
|
4247
4352
|
};
|
|
4248
4353
|
} | {
|
|
4249
4354
|
flow: {
|
|
@@ -4273,7 +4378,10 @@ declare const getSdk: () => ((({
|
|
|
4273
4378
|
abTestingKey?: number;
|
|
4274
4379
|
startOptionsVersion?: number;
|
|
4275
4380
|
client?: Record<string, any>;
|
|
4276
|
-
|
|
4381
|
+
locale?: string;
|
|
4382
|
+
oidcPrompt?: string;
|
|
4383
|
+
oidcErrorRedirectUri?: string;
|
|
4384
|
+
}, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri"> & {
|
|
4277
4385
|
lastAuth?: Omit<{
|
|
4278
4386
|
authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
|
|
4279
4387
|
oauthProvider?: string;
|
|
@@ -4328,6 +4436,8 @@ declare const getSdk: () => ((({
|
|
|
4328
4436
|
};
|
|
4329
4437
|
fedcm: {
|
|
4330
4438
|
oneTap(provider?: string, oneTapConfig?: _descope_web_js_sdk.OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
|
|
4439
|
+
launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
|
|
4440
|
+
isSupported(): boolean;
|
|
4331
4441
|
};
|
|
4332
4442
|
accessKey: {
|
|
4333
4443
|
exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
|
|
@@ -4672,7 +4782,7 @@ declare const getSdk: () => ((({
|
|
|
4672
4782
|
slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
|
|
4673
4783
|
};
|
|
4674
4784
|
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>>;
|
|
4785
|
+
startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4676
4786
|
finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
|
|
4677
4787
|
};
|
|
4678
4788
|
saml: {
|
|
@@ -4787,6 +4897,13 @@ declare const getSdk: () => ((({
|
|
|
4787
4897
|
};
|
|
4788
4898
|
token?: string;
|
|
4789
4899
|
}) => Promise<Response>;
|
|
4900
|
+
patch: (path: string, body?: any, config?: {
|
|
4901
|
+
headers?: HeadersInit;
|
|
4902
|
+
queryParams?: {
|
|
4903
|
+
[key: string]: string;
|
|
4904
|
+
};
|
|
4905
|
+
token?: string;
|
|
4906
|
+
}) => Promise<Response>;
|
|
4790
4907
|
put: (path: string, body?: any, config?: {
|
|
4791
4908
|
headers?: HeadersInit;
|
|
4792
4909
|
queryParams?: {
|
|
@@ -4806,6 +4923,9 @@ declare const getSdk: () => ((({
|
|
|
4806
4923
|
afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
|
|
4807
4924
|
transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
|
|
4808
4925
|
};
|
|
4926
|
+
buildUrl: (path: string, queryParams?: {
|
|
4927
|
+
[key: string]: string;
|
|
4928
|
+
}) => string;
|
|
4809
4929
|
};
|
|
4810
4930
|
}) & {
|
|
4811
4931
|
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.21"},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.21",
|
|
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.115",
|
|
29
|
+
"@descope/audit-management-widget": "0.1.78",
|
|
30
|
+
"@descope/role-management-widget": "0.1.113",
|
|
31
|
+
"@descope/user-profile-widget": "0.0.93",
|
|
32
|
+
"@descope/web-component": "3.21.0",
|
|
33
|
+
"@descope/user-management-widget": "0.4.116",
|
|
34
|
+
"@descope/web-js-sdk": "1.16.0",
|
|
35
|
+
"@descope/core-js-sdk": "2.24.0"
|
|
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
|
+
}
|