@descope/web-js-sdk
Advanced tools
Comparing version 0.0.1-alpha.7 to 0.1.0
@@ -1,2 +0,2 @@ | ||
"use strict";var e=require("tslib"),t=require("@descope/core-js-sdk"),o=require("@fingerprintjs/fingerprintjs-pro"),r=require("js-cookie");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(t),i=s(r);const a=e=>new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t.toString())})[e],c=e=>{const t=o.load({apiKey:e||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let e=sessionStorage.getItem("vsid");e||(e=a("vsid")),e||(e=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem("vsid",e);const o=await t,r=await o.get({linkedId:e});sessionStorage.setItem("vrid",r.requestId)}catch(e){global.FB_DEBUG&&console.error(e)}}}};let l=[];function u(e,t){const o=function(e){const t=e.split(".");try{if(3===t.length){const t=JSON.parse(window.atob(e.split(".")[1]));if(t.exp)return new Date(1e3*t.exp)}}catch(e){}return null}(t);if(o){let t;for(;t=l.pop();)clearTimeout(t);const r=o.getTime()-2e4-(new Date).getTime(),s=setTimeout((()=>{const t=d();t&&e(t)}),r);l.push(s)}}function g(e){const{sessionJwt:t,refreshJwt:o}=e||{};return function(e,{cookiePath:t,cookieDomain:o,cookieExpiration:r}){e&&i.default.set("DS",e,{path:t,domain:o,expires:r,sameSite:"None",secure:!0})}(t,e||{}),function(e){localStorage&&e&&localStorage.setItem("DSR",e)}(o),t}function d(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem("DSR"):""}module.exports=t=>{var{persistTokens:o=!0}=t,r=e.__rest(t,["persistTokens"]);c(r.fpKey).get().catch((()=>null));const s=r;let a;if(s.hooks={beforeRequest:e=>{var t;return e.queryParams=(t=e.queryParams,Object.assign(Object.assign({},t),{vsid:sessionStorage.getItem("vsid")||"",vrid:sessionStorage.getItem("vrid")||""})),o&&!e.token&&(e.token=d()),e}},o&&(s.hooks.afterRequest=async(e,t)=>{!async function(e,t,o){try{const t=await(null==o?void 0:o.json());if(t){const o=g((null==t?void 0:t.authInfo)||t);o&&u(e,o)}}catch(e){console.error("Could not set tokens from body",e)}}(a.refresh,0,t)}),a=n.default(r),o){const e=a.logout;a.logout=(...t)=>{localStorage&&localStorage.removeItem("DSR"),i.default.remove("DS");return e(...t)}}return a}; | ||
"use strict";var e=require("tslib"),t=require("@descope/core-js-sdk"),o=require("@fingerprintjs/fingerprintjs-pro"),r=require("js-cookie");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(t),i=s(r);const a=e=>new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t.toString())})[e],c=e=>{const t=o.load({apiKey:e||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let e=sessionStorage.getItem("vsid");e||(e=a("vsid")),e||(e=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem("vsid",e);const o=await t,r=await o.get({linkedId:e});sessionStorage.setItem("vrid",r.requestId)}catch(e){global.FB_DEBUG&&console.error(e)}}}};let l=[];function u(e,t){const o=function(e){const t=e.split(".");try{if(3===t.length){const t=JSON.parse(window.atob(e.split(".")[1]));if(t.exp)return new Date(1e3*t.exp)}}catch(e){}return null}(t);if(o){let t;for(;t=l.pop();)clearTimeout(t);const r=o.getTime()-2e4-(new Date).getTime(),s=setTimeout((()=>{e(d())}),r);l.push(s)}}function g(e){const{sessionJwt:t,refreshJwt:o}=e||{};return function(e,{cookiePath:t,cookieDomain:o,cookieExpiration:r}){e&&i.default.set("DS",e,{path:t,domain:o,expires:r,sameSite:"None",secure:!0})}(t,e||{}),function(e){localStorage&&e&&localStorage.setItem("DSR",e)}(o),t}function d(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem("DSR"):""}module.exports=t=>{var{persistTokens:o=!0}=t,r=e.__rest(t,["persistTokens"]);c(r.fpKey).get().catch((()=>null));const s=r;let a;if(s.hooks={beforeRequest:e=>{var t;return e.queryParams=(t=e.queryParams,Object.assign(Object.assign({},t),{vsid:sessionStorage.getItem("vsid")||"",vrid:sessionStorage.getItem("vrid")||""})),o&&!e.token&&(e.token=d()),e}},o&&(s.hooks.afterRequest=async(e,t)=>{!async function(e,t,o){try{const t=await(null==o?void 0:o.json());if(t){const o=g((null==t?void 0:t.authInfo)||t);o&&u(e,o)}}catch(e){console.error("Could not set tokens from body",e)}}(a.refresh,0,t)}),a=n.default(r),o){const e=a.logout;a.logout=(...t)=>{const o=d(),r=[(null==t?void 0:t.shift())||o,...t],s=e(...r);return localStorage&&localStorage.removeItem("DSR"),i.default.remove("DS"),s}}return a}; | ||
//# sourceMappingURL=index.cjs.js.map |
import * as _descope_core_js_sdk from '@descope/core-js-sdk'; | ||
import _descope_core_js_sdk__default from '@descope/core-js-sdk'; | ||
/** Configuration arguments which include the Descope core SDK args and fingerprint configuration. | ||
* Also specifies if we should persist tokens from responses automatically and auto-refresh. | ||
*/ | ||
declare type WebJSSDKArgs = Parameters<typeof _descope_core_js_sdk__default>[0] & { | ||
@@ -8,2 +11,6 @@ fpKey?: string; | ||
}; | ||
/** | ||
* Wrapper around DescopeSDK to handle fingerprint.js and storage of JWT tokens in cookies and localStorage, | ||
* It also sets a timer to refresh session JWT automagically. | ||
*/ | ||
declare const _default: ({ persistTokens, ...args }: WebJSSDKArgs) => { | ||
@@ -209,2 +216,4 @@ accessKey: { | ||
isJwtExpired: (token: string) => boolean; | ||
getJwtPermissions: (token: string, tenant?: string) => string[]; | ||
getJwtRoles: (token: string, tenant?: string) => string[]; | ||
httpClient: { | ||
@@ -211,0 +220,0 @@ get: (path: string, config?: { |
@@ -1,2 +0,2 @@ | ||
import{__rest as t}from"tslib";import e from"@descope/core-js-sdk";import{load as o}from"@fingerprintjs/fingerprintjs-pro";import r from"js-cookie";const s=t=>new Proxy(new URLSearchParams(window.location.search),{get:(t,e)=>t.get(e.toString())})[t],n=t=>{const e=o({apiKey:t||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let t=sessionStorage.getItem("vsid");t||(t=s("vsid")),t||(t=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem("vsid",t);const o=await e,r=await o.get({linkedId:t});sessionStorage.setItem("vrid",r.requestId)}catch(t){global.FB_DEBUG&&console.error(t)}}}};let i=[];function a(t,e){const o=function(t){const e=t.split(".");try{if(3===e.length){const e=JSON.parse(window.atob(t.split(".")[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(t){}return null}(e);if(o){let e;for(;e=i.pop();)clearTimeout(e);const r=o.getTime()-2e4-(new Date).getTime(),s=setTimeout((()=>{const e=l();e&&t(e)}),r);i.push(s)}}function c(t){const{sessionJwt:e,refreshJwt:o}=t||{};return function(t,{cookiePath:e,cookieDomain:o,cookieExpiration:s}){t&&r.set("DS",t,{path:e,domain:o,expires:s,sameSite:"None",secure:!0})}(e,t||{}),function(t){localStorage&&t&&localStorage.setItem("DSR",t)}(o),e}function l(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem("DSR"):""}var g=o=>{var{persistTokens:s=!0}=o,i=t(o,["persistTokens"]);n(i.fpKey).get().catch((()=>null));const g=i;let u;if(g.hooks={beforeRequest:t=>{var e;return t.queryParams=(e=t.queryParams,Object.assign(Object.assign({},e),{vsid:sessionStorage.getItem("vsid")||"",vrid:sessionStorage.getItem("vrid")||""})),s&&!t.token&&(t.token=l()),t}},s&&(g.hooks.afterRequest=async(t,e)=>{!async function(t,e,o){try{const e=await(null==o?void 0:o.json());if(e){const o=c((null==e?void 0:e.authInfo)||e);o&&a(t,o)}}catch(t){console.error("Could not set tokens from body",t)}}(u.refresh,0,e)}),u=e(i),s){const t=u.logout;u.logout=(...e)=>{localStorage&&localStorage.removeItem("DSR"),r.remove("DS");return t(...e)}}return u};export{g as default}; | ||
import{__rest as t}from"tslib";import e from"@descope/core-js-sdk";import{load as o}from"@fingerprintjs/fingerprintjs-pro";import r from"js-cookie";const s=t=>new Proxy(new URLSearchParams(window.location.search),{get:(t,e)=>t.get(e.toString())})[t],n=t=>{const e=o({apiKey:t||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let t=sessionStorage.getItem("vsid");t||(t=s("vsid")),t||(t=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem("vsid",t);const o=await e,r=await o.get({linkedId:t});sessionStorage.setItem("vrid",r.requestId)}catch(t){global.FB_DEBUG&&console.error(t)}}}};let i=[];function a(t,e){const o=function(t){const e=t.split(".");try{if(3===e.length){const e=JSON.parse(window.atob(t.split(".")[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(t){}return null}(e);if(o){let e;for(;e=i.pop();)clearTimeout(e);const r=o.getTime()-2e4-(new Date).getTime(),s=setTimeout((()=>{t(l())}),r);i.push(s)}}function c(t){const{sessionJwt:e,refreshJwt:o}=t||{};return function(t,{cookiePath:e,cookieDomain:o,cookieExpiration:s}){t&&r.set("DS",t,{path:e,domain:o,expires:s,sameSite:"None",secure:!0})}(e,t||{}),function(t){localStorage&&t&&localStorage.setItem("DSR",t)}(o),e}function l(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem("DSR"):""}var g=o=>{var{persistTokens:s=!0}=o,i=t(o,["persistTokens"]);n(i.fpKey).get().catch((()=>null));const g=i;let u;if(g.hooks={beforeRequest:t=>{var e;return t.queryParams=(e=t.queryParams,Object.assign(Object.assign({},e),{vsid:sessionStorage.getItem("vsid")||"",vrid:sessionStorage.getItem("vrid")||""})),s&&!t.token&&(t.token=l()),t}},s&&(g.hooks.afterRequest=async(t,e)=>{!async function(t,e,o){try{const e=await(null==o?void 0:o.json());if(e){const o=c((null==e?void 0:e.authInfo)||e);o&&a(t,o)}}catch(t){console.error("Could not set tokens from body",t)}}(u.refresh,0,e)}),u=e(i),s){const t=u.logout;u.logout=(...e)=>{const o=l(),s=[(null==e?void 0:e.shift())||o,...e],n=t(...s);return localStorage&&localStorage.removeItem("DSR"),r.remove("DS"),n}}return u};export{g as default}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,4 +0,4 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).descopeSdk=t()}(this,(function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function n(e){this.message=e}n.prototype=new Error,n.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,i=0,a=0,s="";o=t.charAt(a++);~o&&(r=i%4?64*r+o:o,i++%4)?s+=String.fromCharCode(255&r>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function o(e){this.message=e}function i(e,t){if("string"!=typeof e)throw new o("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return r(t)}}(e.split(".")[n]))}catch(e){throw new o("Invalid token specified: "+e.message)}}o.prototype=new Error,o.prototype.name="InvalidTokenError";var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s="__lodash_hash_undefined__",c="[object Function]",u="[object GeneratorFunction]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,p=/^\w*$/,d=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,v="object"==typeof a&&a&&a.Object===Object&&a,y="object"==typeof self&&self&&self.Object===Object&&self,m=v||y||Function("return this")();var b,w=Array.prototype,k=Function.prototype,j=Object.prototype,I=m["__core-js_shared__"],O=(b=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",_=k.toString,x=j.hasOwnProperty,P=j.toString,S=RegExp("^"+_.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=m.Symbol,R=w.splice,E=z(m,"Map"),C=z(Object,"create"),D=U?U.prototype:void 0,T=D?D.toString:void 0;function q(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function L(e,t){var n;t=function(e,t){if(H(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||Z(e))return!0;return p.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:H(n=t)?n:J(n);for(var r=0,o=t.length;null!=e&&r<o;)e=e[K(t[r++])];return r&&r==o?e:void 0}function B(e){if(!G(e)||(t=e,O&&O in t))return!1;var t,n=function(e){var t=G(e)?P.call(e):"";return t==c||t==u}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?S:g;return n.test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function F(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function z(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}q.prototype.clear=function(){this.__data__=C?C(null):{}},q.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},q.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===s?void 0:n}return x.call(t,e)?t[e]:void 0},q.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:x.call(t,e)},q.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?s:t,this},$.prototype.clear=function(){this.__data__=[]},$.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),!0)},$.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},$.prototype.has=function(e){return M(this.__data__,e)>-1},$.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},A.prototype.clear=function(){this.__data__={hash:new q,map:new(E||$),string:new q}},A.prototype.delete=function(e){return F(this,e).delete(e)},A.prototype.get=function(e){return F(this,e).get(e)},A.prototype.has=function(e){return F(this,e).has(e)},A.prototype.set=function(e,t){return F(this,e).set(e,t),this};var J=N((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Z(e))return T?T.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(f,(function(e,t,r,o){n.push(r?o.replace(h,"$1"):t||e)})),n}));function K(e){if("string"==typeof e||Z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(N.Cache||A),n}N.Cache=A;var H=Array.isArray;function G(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==P.call(e)}var V,Q=function(e,t,n){var r=null==e?void 0:L(e,t);return void 0===r?n:r},W="/v1/auth/accesskey/exchange",X="/v1/auth/otp/verify",Y="/v1/auth/otp/signin",ee="/v1/auth/otp/signup",te={email:"/v1/auth/otp/update/email",phone:"/v1/auth/otp/update/phone"},ne="/v1/auth/otp/signup-in",re="/v1/auth/magiclink/verify",oe="/v1/auth/magiclink/signin",ie="/v1/auth/magiclink/signup",ae="/v1/auth/magiclink/pending-session",se={email:"/v1/auth/magiclink/update/email",phone:"/v1/auth/magiclink/update/email"},ce="/v1/auth/magiclink/signup-in",ue="/v1/auth/oauth/authorize",le="/v1/auth/saml/authorize",pe="/v1/auth/totp/verify",de="/v1/auth/totp/signup",fe="/v1/user/totp/update",he={start:"/v1/auth/webauthn/signup/start",finish:"/v1/auth/webauthn/signup/finish"},ge={start:"/v1/auth/webauthn/signin/start",finish:"/v1/auth/webauthn/signin/finish"},ve={start:"v1/auth/webauthn/update/start",finish:"/v1/auth/webauthn/update/finish"},ye="/v1/flow/start",me="/v1/flow/next";!function(e){e.get="GET",e.delete="DELETE",e.post="POST",e.put="PUT"}(V||(V={}));const be=()=>{const e={};return{headers(t){const n="function"==typeof t.entries?Object.fromEntries(t.entries()):t;return e.Headers=JSON.stringify(n),this},body(t){return e.Body=t,this},url(t){return e.Url=t.toString(),this},method(t){return e.Method=t,this},title(t){return e.Title=t,this},status(t){return e.Status=t,this},build:()=>Object.keys(e).flatMap((t=>e[t]?[`${"Title"!==t?`${t}: `:""}${e[t]}`]:[])).join("\n")}},we=(...e)=>new Headers(e.reduce(((e,t)=>{const n=(e=>Array.isArray(e)?e:e instanceof Headers?Array.from(e.entries()):e?Object.entries(e):[])(t);return n.reduce(((t,[n,r])=>(e[n]=r,e)),e),e}),{})),ke=e=>void 0===e?void 0:JSON.stringify(e),je=(e,t="")=>{let n=e;return""!==t&&(n=n+":"+t),{Authorization:`Bearer ${n}`}},Ie=({baseUrl:e,projectId:t,baseConfig:n,logger:r,hooks:o,cookiePolicy:i})=>{const a=((e,t)=>{const n=t||fetch;if(!n)throw new Error("fetch is not defined");return e?async(...t)=>{e.log((e=>be().title("Request").url(e[0]).method(e[1].method).headers(e[1].headers).body(e[1].body).build())(t));const r=await n(...t);return e[r.ok?"log":"error"](await(async e=>{const t=await e.text();return e.text=()=>Promise.resolve(t),e.json=()=>Promise.resolve(JSON.parse(t)),be().title("Response").url(e.url.toString()).status(`${e.status} ${e.statusText}`).headers(e.headers).body(t).build()})(r)),r}:n})(r),s=async r=>{const s=(null==o?void 0:o.beforeRequest)?o.beforeRequest(r):r,{path:c,body:u,headers:l,queryParams:p,method:d,token:f}=s,h=await a((({path:e,baseUrl:t,queryParams:n})=>{const r=new URL(e,t);return n&&(r.search=new URLSearchParams(n).toString()),r})({path:c,baseUrl:e,queryParams:p}),{headers:we(je(t,f),(null==n?void 0:n.baseHeaders)||{},l),method:d,body:ke(u),credentials:i||"include"});return(null==o?void 0:o.afterRequest)&&o.afterRequest(r,null==h?void 0:h.clone()),h};return{get:(e,{headers:t,queryParams:n,token:r}={})=>s({path:e,headers:t,queryParams:n,body:void 0,method:V.get,token:r}),post:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.post,token:o}),put:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.put,token:o}),delete:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.delete,token:o})}},Oe=e=>{if("string"!=typeof e||!e)throw new Error("Invalid token provided");const{exp:t}=i(e);return(new Date).getTime()/1e3>t},_e=(...e)=>e.join("/").replace(/\/{2,}/g,"/");async function xe(e){const t=await e,n={code:t.status,ok:t.ok,response:t},r=await t.json();return t.ok?n.data=r:n.error=r,n}const Pe=(e,t)=>(n=t)=>t=>!e(t)&&n.replace("{val}",t),Se=(...e)=>({validate:t=>(e.forEach((e=>{const n=e(t);if(n)throw new Error(n)})),!0)}),Ue=e=>t=>e.test(t),Re=Ue(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),Ee=Ue(/^\+[1-9]{1}[0-9]{3,14}$/),Ce=Pe(Re,'"{val}" is not a valid email'),De=Pe(Ee,'"{val}" is not a valid phone number'),Te=Pe((1,e=>e.length>=1),"Minimum length is 1");const qe=Pe((e=>"string"==typeof e),"Input is not a string"),$e=(...e)=>t=>(...n)=>(e.forEach(((e,t)=>Se(...e).validate(n[t]))),t(...n)),Ae=e=>[qe(`"${e}" must be a string`),Te(`"${e}" must not be empty`)],Me=e=>[qe(`"${e}" must be a string`),Ce()],Le=e=>[qe(`"${e}" must be a string`),De()],Be=$e(Ae("accessKey")),Fe=e=>({exchange:Be((t=>xe(e.get(W,{token:t}))))});var ze,Je,Ke,Ne;!function(e){e.sms="sms",e.whatsapp="whatsapp"}(ze||(ze={})),function(e){e.email="email",e.sms="sms",e.whatsapp="whatsapp"}(Je||(Je={})),function(e){e.signUp="signup",e.signIn="signin",e.verify="verify"}(Ke||(Ke={})),function(e){e.signUp="signup",e.signIn="signin",e.verify="verify",e.updatePhone="updatePhone"}(Ne||(Ne={}));const He=Ae("identifier"),Ge=$e(He,Ae("code")),Ze=$e(He),Ve=$e(He,Le("phone")),Qe=$e(He,Me("email")),We=e=>({verify:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ge(((t,r)=>xe(e.post(_e(X,n),{code:r,externalId:t}))))})),{}),signIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ze((t=>xe(e.post(_e(Y,n),{externalId:t}))))})),{}),signUp:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ze(((t,r)=>xe(e.post(_e(ee,n),{externalId:t,user:r}))))})),{}),signUpOrIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ze((t=>xe(e.post(_e(ne,n),{externalId:t}))))})),{}),update:{email:Qe(((t,n,r)=>xe(e.post(te.email,{externalId:t,email:n},{token:r})))),phone:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ve(((t,r,o)=>xe(e.post(_e(te.phone,n),{externalId:t,phone:r},{token:o}))))})),{})}}),Xe=Ae("identifier"),Ye=Ae("uri"),et=$e(Ae("token")),tt=$e(Xe,Ye),nt=$e(Ae("pendingRef")),rt=$e(Xe,Le("phone"),Ye),ot=$e(Xe,Me("email"),Ye),it=e=>({verify:et((t=>xe(e.post(re,{token:t})))),signIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r)=>xe(e.post(_e(oe,n),{externalId:t,URI:r,crossDevice:!0}))))})),{}),signUpOrIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r)=>xe(e.post(_e(ce,n),{externalId:t,URI:r,crossDevice:!0}))))})),{}),signUp:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r,o)=>xe(e.post(_e(ie,n),{externalId:t,URI:r,user:o,crossDevice:!0}))))})),{}),waitForSession:nt(((t,n)=>new Promise((r=>{const{pollingIntervalMs:o,timeoutMs:i}=(({pollingIntervalMs:e=1e3,timeoutMs:t=6e5}={})=>({pollingIntervalMs:Math.max(e||1e3,1e3),timeoutMs:Math.min(t||6e5,6e5)}))(n);let a;const s=setInterval((async()=>{const n=await e.post(ae,{pendingRef:t});n.ok&&(clearInterval(s),a&&clearTimeout(a),r(xe(Promise.resolve(n))))}),o);a=setTimeout((()=>{r({error:{message:`Session polling timeout exceeded: ${i}ms`,code:"0"},ok:!1}),clearInterval(s)}),i)})))),update:{email:ot(((t,n,r,o)=>xe(e.post(se.email,{externalId:t,email:n,URI:r,crossDevice:!0},{token:o})))),phone:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:rt(((t,r,o,i)=>xe(e.post(_e(se.phone,n),{externalId:t,phone:r,URI:o,crossDevice:!0},{token:i}))))})),{})}}),at=e=>({verify:et((t=>xe(e.post(re,{token:t})))),signIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r)=>xe(e.post(_e(oe,n),{externalId:t,URI:r}))))})),{}),signUp:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r,o)=>xe(e.post(_e(ie,n),{externalId:t,URI:r,user:o}))))})),{}),signUpOrIn:Object.keys(Je).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:tt(((t,r)=>xe(e.post(_e(ce,n),{externalId:t,URI:r}))))})),{}),update:{email:ot(((t,n,r,o)=>xe(e.post(se.email,{externalId:t,email:n,URI:r},{token:o})))),phone:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:rt(((t,r,o,i)=>xe(e.post(_e(se.phone,n),{externalId:t,phone:r,URI:o},{token:i}))))})),{})},crossDevice:it(e)}),st=$e(Ae("code")),ct=e=>({exchange:st((t=>xe(e.get("/v1/auth/exchange",{queryParams:{code:t}}))))});var ut;!function(e){e.facebook="facebook",e.github="github",e.google="google",e.microsoft="microsoft",e.gitlab="gitlab",e.apple="apple"}(ut||(ut={}));const lt=e=>Object.assign({start:Object.keys(ut).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:async(t,{redirect:r=!1}={})=>{const o=await e.get(ue,{queryParams:Object.assign({provider:n},t&&{redirectURL:t})});if(!r||!o.ok)return xe(Promise.resolve(o));const{url:i}=await o.json();window.location.href=i}})),{})},ct(e)),pt=$e(Ae("flowId")),dt=$e(Ae("executionId"),Ae("stepId"),Ae("interactionId")),ft=e=>({start:pt((t=>xe(e.post(ye,{flowId:t})))),next:dt(((t,n,r,o)=>xe(e.post(me,{executionId:t,stepId:n,interactionId:r,input:o}))))}),ht=$e(Ae("tenant")),gt=e=>Object.assign({start:ht((async(t,n,{redirect:r=!1}={})=>{const o=await e.get(le,{queryParams:{tenant:t,redirectURL:n}});if(!r||!o.ok)return xe(Promise.resolve(o));const{url:i}=await o.json();window.location.href=i}))},ct(e)),vt=Ae("identifier"),yt=$e(vt,Ae("code")),mt=$e(vt),bt=$e(vt),wt=e=>({signUp:mt(((t,n)=>xe(e.post(de,{externalId:t,user:n})))),verify:yt(((t,n)=>xe(e.post(pe,{externalId:t,code:n})))),update:bt(((t,n)=>xe(e.post(fe,{externalId:t},{token:n}))))}),kt=Ae("identifier"),jt=Ae("origin"),It=$e(kt,jt,Ae("name")),Ot=$e(kt,jt),_t=$e(kt,jt,Ae("token")),xt=$e(Ae("transactionId"),Ae("response")),Pt=e=>({signUp:{start:It(((t,n,r)=>xe(e.post(he.start,{user:{externalId:t,name:r},origin:n})))),finish:xt(((t,n)=>xe(e.post(he.finish,{transactionId:t,response:n}))))},signIn:{start:Ot(((t,n)=>xe(e.post(ge.start,{externalId:t,origin:n})))),finish:xt(((t,n)=>xe(e.post(ge.finish,{transactionId:t,response:n}))))},update:{start:_t(((t,n,r)=>xe(e.post(ve.start,{externalId:t,origin:n},{token:r})))),finish:xt(((t,n)=>xe(e.post(ve.finish,{transactionId:t,response:n}))))}}),St=$e(Ae("token"));var Ut;const Rt=$e([("projectId",Ut=Ae("projectId"),Pe(((e,t)=>e=>Se(...t).validate(Q(e,"projectId")))(0,Ut))())])((({projectId:e,logger:t,baseUrl:n,hooks:r,cookiePolicy:o})=>{return i=Ie({baseUrl:n||"https://api.descope.com",projectId:e,logger:t,hooks:r,cookiePolicy:o}),{accessKey:Fe(i),otp:We(i),magicLink:at(i),oauth:lt(i),saml:gt(i),totp:wt(i),webauthn:Pt(i),flow:ft(i),refresh:e=>xe(i.get("/v1/auth/refresh",{token:e})),logout:e=>xe(i.get("/v1/auth/logoutall",{token:e})),me:e=>xe(i.get("/v1/auth/me",{token:e})),isJwtExpired:St(Oe),httpClient:i};var i}));function Et(e,t,n){return void 0===n&&(n=0),t(n).catch((function(r){if(n>=e.maxRetries||!e.shouldRetry(r))throw r;var o,i,a,s,c=(o=e.baseDelay,i=e.maxDelay,a=e.baseDelay*Math.pow(2,n),Math.max(o,Math.min(i,a)));return(s=c,new Promise((function(e){return setTimeout(e,s)}))).then((function(){return Et(e,t,n+1)}))}))}Rt.DeliveryMethods=Je;var Ct="Failed to load the JS script of the agent";function Dt(n){var r,o=n.scriptUrlPattern,i=n.token,a=n.apiKey,s=void 0===a?i:a,c=t(n,["scriptUrlPattern","token","apiKey"]),u=(r=n,"scriptUrlPattern",Object.prototype.hasOwnProperty.call(r,"scriptUrlPattern")?o:void 0),l=[];return Promise.resolve().then((function(){if(!s||"string"!=typeof s)throw new Error("API key required");return Et({maxRetries:5,baseDelay:100,maxDelay:3e3,shouldRetry:function(e){return!(e instanceof Error&&"Blocked by CSP"===e.message)}},(function(){var e,t=new Date,n=function(){return l.push({startedAt:t,finishedAt:new Date})},r=function(e,t,n,r){var o,i=document,a="securitypolicyviolation",s=function(t){var n=new URL(e,location.href),r=t.blockedURI;r!==n.href&&r!==n.protocol.slice(0,-1)&&r!==n.origin||(o=t,c())};i.addEventListener(a,s);var c=function(){return i.removeEventListener(a,s)};return Promise.resolve().then(t).then((function(e){return c(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(c(),o)return function(){throw new Error("Blocked by CSP")}();throw e}))}))}(e=function(e,t){void 0===t&&(t="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js");var n=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?n(e):"<loaderVersion>"===t?n("3.7.1"):t}))}(s,u),(function(){return function(e){return new Promise((function(t,n){var r=document.createElement("script"),o=function(){var e;return null===(e=r.parentNode)||void 0===e?void 0:e.removeChild(r)},i=document.head||document.getElementsByTagName("head")[0];r.onload=function(){o(),t()},r.onerror=function(){o(),n(new Error(Ct))},r.async=!0,r.src=e,i.appendChild(r)}))}(e)}));return r.then(n,n),r}))})).then((function(){var t=window,n="__fpjs_p_l_b",r=t[n];if(function(e,t){var n,r=null===(n=Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,t);(null==r?void 0:r.configurable)?delete e[t]:r&&!r.writable||(e[t]=void 0)}(t,n),"function"!=typeof(null==r?void 0:r.load))throw new Error(Ct);return r.load(e(e({},c),{ldi:{attempts:l}}))}))}const Tt="vsid",qt="vrid",$t=e=>new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t.toString())})[e],At=e=>{const t=Dt({apiKey:e||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let e=sessionStorage.getItem(Tt);e||(e=$t(Tt)),e||(e=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem(Tt,e);const n=await t,r=await n.get({linkedId:e});sessionStorage.setItem(qt,r.requestId)}catch(e){global.FB_DEBUG&&console.error(e)}}}}; | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).descopeSdk=t()}(this,(function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function n(e){this.message=e}n.prototype=new Error,n.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,i=0,a=0,s="";o=t.charAt(a++);~o&&(r=i%4?64*r+o:o,i++%4)?s+=String.fromCharCode(255&r>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function o(e){this.message=e}function i(e,t){if("string"!=typeof e)throw new o("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return r(t)}}(e.split(".")[n]))}catch(e){throw new o("Invalid token specified: "+e.message)}}o.prototype=new Error,o.prototype.name="InvalidTokenError";var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s="__lodash_hash_undefined__",c="[object Function]",u="[object GeneratorFunction]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,p=/^\w*$/,d=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,v="object"==typeof a&&a&&a.Object===Object&&a,y="object"==typeof self&&self&&self.Object===Object&&self,m=v||y||Function("return this")();var b,w=Array.prototype,k=Function.prototype,j=Object.prototype,I=m["__core-js_shared__"],O=(b=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",_=k.toString,x=j.hasOwnProperty,P=j.toString,S=RegExp("^"+_.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=m.Symbol,R=w.splice,E=F(m,"Map"),C=F(Object,"create"),D=U?U.prototype:void 0,T=D?D.toString:void 0;function q(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function L(e,t){var n;t=function(e,t){if(H(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||Z(e))return!0;return p.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:H(n=t)?n:z(n);for(var r=0,o=t.length;null!=e&&r<o;)e=e[K(t[r++])];return r&&r==o?e:void 0}function B(e){if(!G(e)||(t=e,O&&O in t))return!1;var t,n=function(e){var t=G(e)?P.call(e):"";return t==c||t==u}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?S:g;return n.test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function J(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function F(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}q.prototype.clear=function(){this.__data__=C?C(null):{}},q.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},q.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===s?void 0:n}return x.call(t,e)?t[e]:void 0},q.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:x.call(t,e)},q.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?s:t,this},$.prototype.clear=function(){this.__data__=[]},$.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),!0)},$.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},$.prototype.has=function(e){return M(this.__data__,e)>-1},$.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},A.prototype.clear=function(){this.__data__={hash:new q,map:new(E||$),string:new q}},A.prototype.delete=function(e){return J(this,e).delete(e)},A.prototype.get=function(e){return J(this,e).get(e)},A.prototype.has=function(e){return J(this,e).has(e)},A.prototype.set=function(e,t){return J(this,e).set(e,t),this};var z=N((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Z(e))return T?T.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(f,(function(e,t,r,o){n.push(r?o.replace(h,"$1"):t||e)})),n}));function K(e){if("string"==typeof e||Z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(N.Cache||A),n}N.Cache=A;var H=Array.isArray;function G(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==P.call(e)}var V,Q=function(e,t,n){var r=null==e?void 0:L(e,t);return void 0===r?n:r},W="/v1/auth/accesskey/exchange",X="/v1/auth/otp/verify",Y="/v1/auth/otp/signin",ee="/v1/auth/otp/signup",te={email:"/v1/auth/otp/update/email",phone:"/v1/auth/otp/update/phone"},ne="/v1/auth/otp/signup-in",re="/v1/auth/magiclink/verify",oe="/v1/auth/magiclink/signin",ie="/v1/auth/magiclink/signup",ae="/v1/auth/magiclink/pending-session",se={email:"/v1/auth/magiclink/update/email",phone:"/v1/auth/magiclink/update/email"},ce="/v1/auth/magiclink/signup-in",ue="/v1/auth/oauth/authorize",le="/v1/auth/saml/authorize",pe="/v1/auth/totp/verify",de="/v1/auth/totp/signup",fe="/v1/user/totp/update",he={start:"/v1/auth/webauthn/signup/start",finish:"/v1/auth/webauthn/signup/finish"},ge={start:"/v1/auth/webauthn/signin/start",finish:"/v1/auth/webauthn/signin/finish"},ve={start:"v1/auth/webauthn/update/start",finish:"/v1/auth/webauthn/update/finish"},ye="/v1/flow/start",me="/v1/flow/next";!function(e){e.get="GET",e.delete="DELETE",e.post="POST",e.put="PUT"}(V||(V={}));const be=()=>{const e={};return{headers(t){const n="function"==typeof t.entries?Object.fromEntries(t.entries()):t;return e.Headers=JSON.stringify(n),this},body(t){return e.Body=t,this},url(t){return e.Url=t.toString(),this},method(t){return e.Method=t,this},title(t){return e.Title=t,this},status(t){return e.Status=t,this},build:()=>Object.keys(e).flatMap((t=>e[t]?[`${"Title"!==t?`${t}: `:""}${e[t]}`]:[])).join("\n")}},we=(...e)=>new Headers(e.reduce(((e,t)=>{const n=(e=>Array.isArray(e)?e:e instanceof Headers?Array.from(e.entries()):e?Object.entries(e):[])(t);return n.reduce(((t,[n,r])=>(e[n]=r,e)),e),e}),{})),ke=e=>void 0===e?void 0:JSON.stringify(e),je=(e,t="")=>{let n=e;return""!==t&&(n=n+":"+t),{Authorization:`Bearer ${n}`}},Ie=({baseUrl:e,projectId:t,baseConfig:n,logger:r,hooks:o,cookiePolicy:i})=>{const a=((e,t)=>{const n=t||fetch;if(!n)throw new Error("fetch is not defined");return e?async(...t)=>{e.log((e=>be().title("Request").url(e[0]).method(e[1].method).headers(e[1].headers).body(e[1].body).build())(t));const r=await n(...t);return e[r.ok?"log":"error"](await(async e=>{const t=await e.text();return e.text=()=>Promise.resolve(t),e.json=()=>Promise.resolve(JSON.parse(t)),be().title("Response").url(e.url.toString()).status(`${e.status} ${e.statusText}`).headers(e.headers).body(t).build()})(r)),r}:n})(r),s=async r=>{const s=(null==o?void 0:o.beforeRequest)?o.beforeRequest(r):r,{path:c,body:u,headers:l,queryParams:p,method:d,token:f}=s,h=await a((({path:e,baseUrl:t,queryParams:n})=>{const r=new URL(e,t);return n&&(r.search=new URLSearchParams(n).toString()),r})({path:c,baseUrl:e,queryParams:p}),{headers:we(je(t,f),(null==n?void 0:n.baseHeaders)||{},l),method:d,body:ke(u),credentials:i||"include"});return(null==o?void 0:o.afterRequest)&&o.afterRequest(r,null==h?void 0:h.clone()),h};return{get:(e,{headers:t,queryParams:n,token:r}={})=>s({path:e,headers:t,queryParams:n,body:void 0,method:V.get,token:r}),post:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.post,token:o}),put:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.put,token:o}),delete:(e,t,{headers:n,queryParams:r,token:o}={})=>s({path:e,headers:n,queryParams:r,body:t,method:V.delete,token:o})}};function Oe(e){const{exp:t}=Re(e);return(new Date).getTime()/1e3>t}function _e(e,t){return Ue(e,t,"permissions")}function xe(e,t){return Ue(e,t,"roles")}const Pe=(...e)=>e.join("/").replace(/\/{2,}/g,"/");async function Se(e){const t=await e,n={code:t.status,ok:t.ok,response:t},r=await t.json();return t.ok?n.data=r:n.error=r,n}function Ue(e,t,n){var r;let o=Re(e);t&&(o=null===(r=o.tenants)||void 0===r?void 0:r[t]);const i=o[n];return Array.isArray(i)?i:[]}function Re(e){if("string"!=typeof e||!e)throw new Error("Invalid token provided");return i(e)}const Ee=(e,t)=>(n=t)=>t=>!e(t)&&n.replace("{val}",t),Ce=(...e)=>({validate:t=>(e.forEach((e=>{const n=e(t);if(n)throw new Error(n)})),!0)}),De=e=>t=>e.test(t),Te=De(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),qe=De(/^\+[1-9]{1}[0-9]{3,14}$/),$e=Ee(Te,'"{val}" is not a valid email'),Ae=Ee(qe,'"{val}" is not a valid phone number'),Me=Ee((1,e=>e.length>=1),"Minimum length is 1");const Le=Ee((e=>"string"==typeof e),"Input is not a string"),Be=(...e)=>t=>(...n)=>(e.forEach(((e,t)=>Ce(...e).validate(n[t]))),t(...n)),Je=e=>[Le(`"${e}" must be a string`),Me(`"${e}" must not be empty`)],Fe=e=>[Le(`"${e}" must be a string`),$e()],ze=e=>[Le(`"${e}" must be a string`),Ae()],Ke=Be(Je("accessKey")),Ne=e=>({exchange:Ke((t=>Se(e.get(W,{token:t}))))});var He,Ge,Ze,Ve;!function(e){e.sms="sms",e.whatsapp="whatsapp"}(He||(He={})),function(e){e.email="email",e.sms="sms",e.whatsapp="whatsapp"}(Ge||(Ge={})),function(e){e.signUp="signup",e.signIn="signin",e.verify="verify"}(Ze||(Ze={})),function(e){e.signUp="signup",e.signIn="signin",e.verify="verify",e.updatePhone="updatePhone"}(Ve||(Ve={}));const Qe=Je("identifier"),We=Be(Qe,Je("code")),Xe=Be(Qe),Ye=Be(Qe,ze("phone")),et=Be(Qe,Fe("email")),tt=e=>({verify:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:We(((t,r)=>Se(e.post(Pe(X,n),{code:r,externalId:t}))))})),{}),signIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Xe((t=>Se(e.post(Pe(Y,n),{externalId:t}))))})),{}),signUp:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Xe(((t,r)=>Se(e.post(Pe(ee,n),{externalId:t,user:r}))))})),{}),signUpOrIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Xe((t=>Se(e.post(Pe(ne,n),{externalId:t}))))})),{}),update:{email:et(((t,n,r)=>Se(e.post(te.email,{externalId:t,email:n},{token:r})))),phone:Object.keys(He).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Ye(((t,r,o)=>Se(e.post(Pe(te.phone,n),{externalId:t,phone:r},{token:o}))))})),{})}}),nt=Je("identifier"),rt=Je("uri"),ot=Be(Je("token")),it=Be(nt,rt),at=Be(Je("pendingRef")),st=Be(nt,ze("phone"),rt),ct=Be(nt,Fe("email"),rt),ut=e=>({verify:ot((t=>Se(e.post(re,{token:t})))),signIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r)=>Se(e.post(Pe(oe,n),{externalId:t,URI:r,crossDevice:!0}))))})),{}),signUpOrIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r)=>Se(e.post(Pe(ce,n),{externalId:t,URI:r,crossDevice:!0}))))})),{}),signUp:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r,o)=>Se(e.post(Pe(ie,n),{externalId:t,URI:r,user:o,crossDevice:!0}))))})),{}),waitForSession:at(((t,n)=>new Promise((r=>{const{pollingIntervalMs:o,timeoutMs:i}=(({pollingIntervalMs:e=1e3,timeoutMs:t=6e5}={})=>({pollingIntervalMs:Math.max(e||1e3,1e3),timeoutMs:Math.min(t||6e5,6e5)}))(n);let a;const s=setInterval((async()=>{const n=await e.post(ae,{pendingRef:t});n.ok&&(clearInterval(s),a&&clearTimeout(a),r(Se(Promise.resolve(n))))}),o);a=setTimeout((()=>{r({error:{message:`Session polling timeout exceeded: ${i}ms`,code:"0"},ok:!1}),clearInterval(s)}),i)})))),update:{email:ct(((t,n,r,o)=>Se(e.post(se.email,{externalId:t,email:n,URI:r,crossDevice:!0},{token:o})))),phone:Object.keys(He).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:st(((t,r,o,i)=>Se(e.post(Pe(se.phone,n),{externalId:t,phone:r,URI:o,crossDevice:!0},{token:i}))))})),{})}}),lt=e=>({verify:ot((t=>Se(e.post(re,{token:t})))),signIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r)=>Se(e.post(Pe(oe,n),{externalId:t,URI:r}))))})),{}),signUp:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r,o)=>Se(e.post(Pe(ie,n),{externalId:t,URI:r,user:o}))))})),{}),signUpOrIn:Object.keys(Ge).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r)=>Se(e.post(Pe(ce,n),{externalId:t,URI:r}))))})),{}),update:{email:ct(((t,n,r,o)=>Se(e.post(se.email,{externalId:t,email:n,URI:r},{token:o})))),phone:Object.keys(He).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:st(((t,r,o,i)=>Se(e.post(Pe(se.phone,n),{externalId:t,phone:r,URI:o},{token:i}))))})),{})},crossDevice:ut(e)}),pt=Be(Je("code")),dt=e=>({exchange:pt((t=>Se(e.get("/v1/auth/exchange",{queryParams:{code:t}}))))});var ft;!function(e){e.facebook="facebook",e.github="github",e.google="google",e.microsoft="microsoft",e.gitlab="gitlab",e.apple="apple"}(ft||(ft={}));const ht=e=>Object.assign({start:Object.keys(ft).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:async(t,{redirect:r=!1}={})=>{const o=await e.get(ue,{queryParams:Object.assign({provider:n},t&&{redirectURL:t})});if(!r||!o.ok)return Se(Promise.resolve(o));const{url:i}=await o.json();window.location.href=i}})),{})},dt(e)),gt=Be(Je("flowId")),vt=Be(Je("executionId"),Je("stepId"),Je("interactionId")),yt=e=>({start:gt((t=>Se(e.post(ye,{flowId:t})))),next:vt(((t,n,r,o)=>Se(e.post(me,{executionId:t,stepId:n,interactionId:r,input:o}))))}),mt=Be(Je("tenant")),bt=e=>Object.assign({start:mt((async(t,n,{redirect:r=!1}={})=>{const o=await e.get(le,{queryParams:{tenant:t,redirectURL:n}});if(!r||!o.ok)return Se(Promise.resolve(o));const{url:i}=await o.json();window.location.href=i}))},dt(e)),wt=Je("identifier"),kt=Be(wt,Je("code")),jt=Be(wt),It=Be(wt),Ot=e=>({signUp:jt(((t,n)=>Se(e.post(de,{externalId:t,user:n})))),verify:kt(((t,n)=>Se(e.post(pe,{externalId:t,code:n})))),update:It(((t,n)=>Se(e.post(fe,{externalId:t},{token:n}))))}),_t=Je("identifier"),xt=Je("origin"),Pt=Be(_t,xt,Je("name")),St=Be(_t,xt),Ut=Be(_t,xt,Je("token")),Rt=Be(Je("transactionId"),Je("response")),Et=e=>({signUp:{start:Pt(((t,n,r)=>Se(e.post(he.start,{user:{externalId:t,name:r},origin:n})))),finish:Rt(((t,n)=>Se(e.post(he.finish,{transactionId:t,response:n}))))},signIn:{start:St(((t,n)=>Se(e.post(ge.start,{externalId:t,origin:n})))),finish:Rt(((t,n)=>Se(e.post(ge.finish,{transactionId:t,response:n}))))},update:{start:Ut(((t,n,r)=>Se(e.post(ve.start,{externalId:t,origin:n},{token:r})))),finish:Rt(((t,n)=>Se(e.post(ve.finish,{transactionId:t,response:n}))))}}),Ct=Be(Je("token"));var Dt;const Tt=Be([("projectId",Dt=Je("projectId"),Ee(((e,t)=>e=>Ce(...t).validate(Q(e,"projectId")))(0,Dt))())])((({projectId:e,logger:t,baseUrl:n,hooks:r,cookiePolicy:o})=>{return i=Ie({baseUrl:n||"https://api.descope.com",projectId:e,logger:t,hooks:r,cookiePolicy:o}),{accessKey:Ne(i),otp:tt(i),magicLink:lt(i),oauth:ht(i),saml:bt(i),totp:Ot(i),webauthn:Et(i),flow:yt(i),refresh:e=>Se(i.get("/v1/auth/refresh",{token:e})),logout:e=>Se(i.get("/v1/auth/logoutall",{token:e})),me:e=>Se(i.get("/v1/auth/me",{token:e})),isJwtExpired:Ct(Oe),getJwtPermissions:Ct(_e),getJwtRoles:Ct(xe),httpClient:i};var i}));function qt(e,t,n){return void 0===n&&(n=0),t(n).catch((function(r){if(n>=e.maxRetries||!e.shouldRetry(r))throw r;var o,i,a,s,c=(o=e.baseDelay,i=e.maxDelay,a=e.baseDelay*Math.pow(2,n),Math.max(o,Math.min(i,a)));return(s=c,new Promise((function(e){return setTimeout(e,s)}))).then((function(){return qt(e,t,n+1)}))}))}Tt.DeliveryMethods=Ge;var $t="Failed to load the JS script of the agent";function At(n){var r,o=n.scriptUrlPattern,i=n.token,a=n.apiKey,s=void 0===a?i:a,c=t(n,["scriptUrlPattern","token","apiKey"]),u=(r=n,"scriptUrlPattern",Object.prototype.hasOwnProperty.call(r,"scriptUrlPattern")?o:void 0),l=[];return Promise.resolve().then((function(){if(!s||"string"!=typeof s)throw new Error("API key required");return qt({maxRetries:5,baseDelay:100,maxDelay:3e3,shouldRetry:function(e){return!(e instanceof Error&&"Blocked by CSP"===e.message)}},(function(){var e,t=new Date,n=function(){return l.push({startedAt:t,finishedAt:new Date})},r=function(e,t,n,r){var o,i=document,a="securitypolicyviolation",s=function(t){var n=new URL(e,location.href),r=t.blockedURI;r!==n.href&&r!==n.protocol.slice(0,-1)&&r!==n.origin||(o=t,c())};i.addEventListener(a,s);var c=function(){return i.removeEventListener(a,s)};return Promise.resolve().then(t).then((function(e){return c(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(c(),o)return function(){throw new Error("Blocked by CSP")}();throw e}))}))}(e=function(e,t){void 0===t&&(t="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js");var n=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?n(e):"<loaderVersion>"===t?n("3.7.1"):t}))}(s,u),(function(){return function(e){return new Promise((function(t,n){var r=document.createElement("script"),o=function(){var e;return null===(e=r.parentNode)||void 0===e?void 0:e.removeChild(r)},i=document.head||document.getElementsByTagName("head")[0];r.onload=function(){o(),t()},r.onerror=function(){o(),n(new Error($t))},r.async=!0,r.src=e,i.appendChild(r)}))}(e)}));return r.then(n,n),r}))})).then((function(){var t=window,n="__fpjs_p_l_b",r=t[n];if(function(e,t){var n,r=null===(n=Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,t);(null==r?void 0:r.configurable)?delete e[t]:r&&!r.writable||(e[t]=void 0)}(t,n),"function"!=typeof(null==r?void 0:r.load))throw new Error($t);return r.load(e(e({},c),{ldi:{attempts:l}}))}))}const Mt="vsid",Lt="vrid",Bt=e=>new Proxy(new URLSearchParams(window.location.search),{get:(e,t)=>e.get(t.toString())})[e],Jt=e=>{const t=At({apiKey:e||"A9aCLRHzKCv3uL69oqDr"});return{get:async()=>{try{let e=sessionStorage.getItem(Mt);e||(e=Bt(Mt)),e||(e=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27)),sessionStorage.setItem(Mt,e);const n=await t,r=await n.get({linkedId:e});sessionStorage.setItem(Lt,r.requestId)}catch(e){global.FB_DEBUG&&console.error(e)}}}}; | ||
/*! js-cookie v3.0.1 | MIT */ | ||
function Mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Lt=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Mt({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Mt({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Mt({},this.attributes,t))},withConverter:function(t){return e(Mt({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const Bt="DSR";let Ft=[];function zt(e,t){const n=function(e){const t=e.split(".");try{if(3===t.length){const t=JSON.parse(window.atob(e.split(".")[1]));if(t.exp)return new Date(1e3*t.exp)}}catch(e){}return null}(t);if(n){let t;for(;t=Ft.pop();)clearTimeout(t);const r=n.getTime()-2e4-(new Date).getTime(),o=setTimeout((()=>{const t=Kt();t&&e(t)}),r);Ft.push(o)}}function Jt(e){const{sessionJwt:t,refreshJwt:n}=e||{};return function(e,{cookiePath:t,cookieDomain:n,cookieExpiration:r}){e&&Lt.set("DS",e,{path:t,domain:n,expires:r,sameSite:"None",secure:!0})}(t,e||{}),function(e){localStorage&&e&&localStorage.setItem(Bt,e)}(n),t}function Kt(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem(Bt):""}return e=>{var{persistTokens:n=!0}=e,r=t(e,["persistTokens"]);At(r.fpKey).get().catch((()=>null));const o=r;let i;if(o.hooks={beforeRequest:e=>{var t;return e.queryParams=(t=e.queryParams,Object.assign(Object.assign({},t),{[Tt]:sessionStorage.getItem(Tt)||"",[qt]:sessionStorage.getItem(qt)||""})),n&&!e.token&&(e.token=Kt()),e}},n&&(o.hooks.afterRequest=async(e,t)=>{!async function(e,t,n){try{const t=await(null==n?void 0:n.json());if(t){const n=Jt((null==t?void 0:t.authInfo)||t);n&&zt(e,n)}}catch(e){console.error("Could not set tokens from body",e)}}(i.refresh,0,t)}),i=Rt(r),n){const e=i.logout;i.logout=(...t)=>{localStorage&&localStorage.removeItem(Bt),Lt.remove("DS");return e(...t)}}return i}})); | ||
function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var zt=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Ft({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Ft({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Ft({},this.attributes,t))},withConverter:function(t){return e(Ft({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const Kt="DSR";let Nt=[];function Ht(e,t){const n=function(e){const t=e.split(".");try{if(3===t.length){const t=JSON.parse(window.atob(e.split(".")[1]));if(t.exp)return new Date(1e3*t.exp)}}catch(e){}return null}(t);if(n){let t;for(;t=Nt.pop();)clearTimeout(t);const r=n.getTime()-2e4-(new Date).getTime(),o=setTimeout((()=>{e(Zt())}),r);Nt.push(o)}}function Gt(e){const{sessionJwt:t,refreshJwt:n}=e||{};return function(e,{cookiePath:t,cookieDomain:n,cookieExpiration:r}){e&&zt.set("DS",e,{path:t,domain:n,expires:r,sameSite:"None",secure:!0})}(t,e||{}),function(e){localStorage&&e&&localStorage.setItem(Kt,e)}(n),t}function Zt(){return localStorage?null===localStorage||void 0===localStorage?void 0:localStorage.getItem(Kt):""}return e=>{var{persistTokens:n=!0}=e,r=t(e,["persistTokens"]);Jt(r.fpKey).get().catch((()=>null));const o=r;let i;if(o.hooks={beforeRequest:e=>{var t;return e.queryParams=(t=e.queryParams,Object.assign(Object.assign({},t),{[Mt]:sessionStorage.getItem(Mt)||"",[Lt]:sessionStorage.getItem(Lt)||""})),n&&!e.token&&(e.token=Zt()),e}},n&&(o.hooks.afterRequest=async(e,t)=>{!async function(e,t,n){try{const t=await(null==n?void 0:n.json());if(t){const n=Gt((null==t?void 0:t.authInfo)||t);n&&Ht(e,n)}}catch(e){console.error("Could not set tokens from body",e)}}(i.refresh,0,t)}),i=Tt(r),n){const e=i.logout;i.logout=(...t)=>{const n=Zt(),r=[(null==t?void 0:t.shift())||n,...t],o=e(...r);return localStorage&&localStorage.removeItem(Kt),zt.remove("DS"),o}}return i}})); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@descope/web-js-sdk", | ||
"version": "0.0.1-alpha.7", | ||
"version": "0.1.0", | ||
"main": "dist/cjs/index.cjs.js", | ||
@@ -77,3 +77,3 @@ "module": "dist/index.esm.js", | ||
"dependencies": { | ||
"@descope/core-js-sdk": "0.0.41-alpha.20", | ||
"@descope/core-js-sdk": "0.0.41-alpha.21", | ||
"@fingerprintjs/fingerprintjs-pro": "^3.7.1", | ||
@@ -80,0 +80,0 @@ "js-cookie": "^3.0.1" |
@@ -6,2 +6,3 @@ # @descope/web-js-sdk | ||
## Usage | ||
### Install the package | ||
@@ -8,0 +9,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172515
356
25
+ Added@descope/core-js-sdk@0.0.41-alpha.21(transitive)
- Removed@descope/core-js-sdk@0.0.41-alpha.20(transitive)