@crossmint/client-sdk-auth 1.1.3 → 1.1.5

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.
Files changed (69) hide show
  1. package/dist/CrossmintAuthClient.cjs +1 -12
  2. package/dist/CrossmintAuthClient.js +1 -12
  3. package/dist/chunk-22GIA4MK.js +1 -0
  4. package/dist/chunk-3K3UA645.js +1 -0
  5. package/dist/chunk-CK4JCQY6.cjs +1 -0
  6. package/dist/chunk-FTVKNCGF.cjs +1 -0
  7. package/dist/chunk-HU56N5SW.js +1 -0
  8. package/dist/chunk-NIH25R3L.js +1 -0
  9. package/dist/chunk-NYYORERK.cjs +1 -0
  10. package/dist/chunk-NZ2DAY24.cjs +1 -0
  11. package/dist/chunk-REIMEXVF.js +1 -0
  12. package/dist/chunk-U76ID4TS.js +0 -0
  13. package/dist/chunk-VDJHVTKI.cjs +1 -0
  14. package/dist/chunk-XHYLTO6W.cjs +1 -0
  15. package/dist/index.cjs +1 -29
  16. package/dist/index.js +1 -29
  17. package/dist/utils/constants.cjs +1 -8
  18. package/dist/utils/constants.js +1 -8
  19. package/dist/utils/cookies.cjs +1 -12
  20. package/dist/utils/cookies.js +1 -12
  21. package/dist/utils/index.cjs +1 -21
  22. package/dist/utils/index.js +1 -21
  23. package/dist/utils/jwt.cjs +1 -8
  24. package/dist/utils/jwt.js +1 -8
  25. package/package.json +4 -5
  26. package/dist/CrossmintAuthClient.cjs.map +0 -1
  27. package/dist/CrossmintAuthClient.js.map +0 -1
  28. package/dist/chunk-5JXPQKM4.js +0 -19
  29. package/dist/chunk-5JXPQKM4.js.map +0 -1
  30. package/dist/chunk-BGMXXFQ4.cjs +0 -19
  31. package/dist/chunk-BGMXXFQ4.cjs.map +0 -1
  32. package/dist/chunk-BMYZMMVR.js +0 -7
  33. package/dist/chunk-BMYZMMVR.js.map +0 -1
  34. package/dist/chunk-F45I5NLI.cjs +0 -46
  35. package/dist/chunk-F45I5NLI.cjs.map +0 -1
  36. package/dist/chunk-FEGDFSUW.cjs +0 -275
  37. package/dist/chunk-FEGDFSUW.cjs.map +0 -1
  38. package/dist/chunk-JPRRZPBL.js +0 -46
  39. package/dist/chunk-JPRRZPBL.js.map +0 -1
  40. package/dist/chunk-MLMLBCSI.js +0 -11
  41. package/dist/chunk-MLMLBCSI.js.map +0 -1
  42. package/dist/chunk-QY4RIGNM.cjs +0 -11
  43. package/dist/chunk-QY4RIGNM.cjs.map +0 -1
  44. package/dist/chunk-SGSYRRRS.js +0 -275
  45. package/dist/chunk-SGSYRRRS.js.map +0 -1
  46. package/dist/chunk-TIUX4OOQ.cjs +0 -7
  47. package/dist/chunk-TIUX4OOQ.cjs.map +0 -1
  48. package/dist/chunk-TOXKCKTY.js +0 -1
  49. package/dist/chunk-TOXKCKTY.js.map +0 -1
  50. package/dist/chunk-VQ3HTIQ3.cjs +0 -1
  51. package/dist/chunk-VQ3HTIQ3.cjs.map +0 -1
  52. package/dist/index.cjs.map +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/utils/constants.cjs.map +0 -1
  55. package/dist/utils/constants.js.map +0 -1
  56. package/dist/utils/cookies.cjs.map +0 -1
  57. package/dist/utils/cookies.js.map +0 -1
  58. package/dist/utils/index.cjs.map +0 -1
  59. package/dist/utils/index.js.map +0 -1
  60. package/dist/utils/jwt.cjs.map +0 -1
  61. package/dist/utils/jwt.js.map +0 -1
  62. package/src/CrossmintAuthClient.test.ts +0 -416
  63. package/src/CrossmintAuthClient.ts +0 -294
  64. package/src/index.ts +0 -3
  65. package/src/utils/constants.ts +0 -1
  66. package/src/utils/cookies.test.ts +0 -44
  67. package/src/utils/cookies.ts +0 -13
  68. package/src/utils/index.ts +0 -3
  69. package/src/utils/jwt.ts +0 -6
@@ -1,12 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkFEGDFSUWcjs = require('./chunk-FEGDFSUW.cjs');
4
- require('./chunk-VQ3HTIQ3.cjs');
5
- require('./chunk-TIUX4OOQ.cjs');
6
- require('./chunk-BGMXXFQ4.cjs');
7
- require('./chunk-QY4RIGNM.cjs');
8
- require('./chunk-F45I5NLI.cjs');
9
-
10
-
11
- exports.CrossmintAuthClient = _chunkFEGDFSUWcjs.CrossmintAuthClient;
12
- //# sourceMappingURL=CrossmintAuthClient.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFTVKNCGFcjs = require('./chunk-FTVKNCGF.cjs');require('./chunk-XHYLTO6W.cjs');require('./chunk-NZ2DAY24.cjs');require('./chunk-NYYORERK.cjs');require('./chunk-VDJHVTKI.cjs');require('./chunk-CK4JCQY6.cjs');exports.CrossmintAuthClient = _chunkFTVKNCGFcjs.a;
@@ -1,12 +1 @@
1
- import {
2
- CrossmintAuthClient
3
- } from "./chunk-SGSYRRRS.js";
4
- import "./chunk-TOXKCKTY.js";
5
- import "./chunk-BMYZMMVR.js";
6
- import "./chunk-5JXPQKM4.js";
7
- import "./chunk-MLMLBCSI.js";
8
- import "./chunk-JPRRZPBL.js";
9
- export {
10
- CrossmintAuthClient
11
- };
12
- //# sourceMappingURL=CrossmintAuthClient.js.map
1
+ import{a}from"./chunk-3K3UA645.js";import"./chunk-U76ID4TS.js";import"./chunk-REIMEXVF.js";import"./chunk-HU56N5SW.js";import"./chunk-NIH25R3L.js";import"./chunk-22GIA4MK.js";export{a as CrossmintAuthClient};
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty,n=Object.defineProperties;var o=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var i=(c,b,a)=>b in c?m(c,b,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[b]=a,r=(c,b)=>{for(var a in b||(b={}))p.call(b,a)&&i(c,a,b[a]);if(h)for(var a of h(b))q.call(b,a)&&i(c,a,b[a]);return c},s=(c,b)=>n(c,o(b));var t=(c,b,a)=>new Promise((j,g)=>{var k=d=>{try{e(a.next(d))}catch(f){g(f)}},l=d=>{try{e(a.throw(d))}catch(f){g(f)}},e=d=>d.done?j(d.value):Promise.resolve(d.value).then(k,l);e((a=a.apply(c,b)).next())});export{r as a,s as b,t as c};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-REIMEXVF.js";import{a as h,b as c,c as u}from"./chunk-HU56N5SW.js";import{a as w}from"./chunk-NIH25R3L.js";import{a as p,b as m,c as i}from"./chunk-22GIA4MK.js";import{AUTH_SDK_ROOT_ENDPOINT as o,CROSSMINT_API_VERSION as k,CrossmintAuth as d,CrossmintAuthenticationError as n,REFRESH_TOKEN_PREFIX as l,SESSION_PREFIX as C}from"@crossmint/common-sdk-auth";import{queueTask as R}from"@crossmint/client-sdk-base";var g=class y extends d{constructor(e,t,r={}){var a,s;super(e,t,r);this.refreshTask=null;this.refreshPromise=null;this.callbacks=(a=r.callbacks)!=null?a:{},this.logoutRoute=(s=r.logoutRoute)!=null?s:null}static from(e,t={}){let r=new y(e,d.defaultApiClient(e),t);return typeof window!="undefined"&&r.handleRefreshAuthMaterial(),r}getUser(){return i(this,null,function*(){try{let e=yield this.apiClient.get(`api/${k}/sdk/auth/user`,{headers:{"Content-Type":"application/json"}});if(!e.ok)throw yield e.text();return yield e.json()}catch(e){throw new n(`Failed to fetch user: ${e instanceof Error?e.message:"Unknown error"}`)}})}storeAuthMaterial(e){c(C,e.jwt),c(l,e.refreshToken.secret,e.refreshToken.expiresAt)}logout(){return i(this,null,function*(){var t,r;let e=h(l);u(l),u(C),(r=(t=this.callbacks).onLogout)==null||r.call(t);try{this.logoutRoute!=null?yield this.logoutFromCustomRoute():e!=null&&(yield this.logoutFromDefaultRoute(e))}catch(a){console.error(a)}})}handleRefreshAuthMaterial(e){return i(this,null,function*(){var r,a;let t=e!=null?e:h(l);if(!(t==null&&this.refreshRoute==null))try{this.refreshPromise==null&&(this.refreshPromise=this.refreshAuthMaterial(t));let s=yield this.refreshPromise;this.refreshRoute==null&&this.storeAuthMaterial(s),(a=(r=this.callbacks).onTokenRefresh)==null||a.call(r,s),this.scheduleNextRefresh(s.jwt)}catch(s){console.error(s),this.logout()}finally{this.refreshPromise=null}})}getOAuthUrl(e){return i(this,null,function*(){try{let t=yield this.apiClient.get(`${o}/social/${e}/start`,{headers:{"Content-Type":"application/json"}});if(!t.ok)throw yield t.text();return(yield t.json()).oauthUrl}catch(t){throw new n(`Failed to get OAuth URL for provider ${e}: ${t instanceof Error?t.message:"Unknown error"}`)}})}sendEmailOtp(e){return i(this,null,function*(){try{let t=yield this.apiClient.post(`${o}/otps/send`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok)throw yield t.text();return yield t.json()}catch(t){throw new n(`Failed to send email OTP: ${t instanceof Error?t.message:"Unknown error"}`)}})}confirmEmailOtp(e,t,r){return i(this,null,function*(){try{let a=new URLSearchParams({email:e,signinAuthenticationMethod:"email",token:r,locale:"en",state:t}),s=yield this.apiClient.post(`${o}/authenticate?${a}`,{headers:{"Content-Type":"application/json"}});if(!s.ok)throw yield s.text();return(yield s.json()).oneTimeSecret}catch(a){throw new n(`Failed to confirm email OTP: ${a instanceof Error?a.message:"Unknown error"}`)}})}signInWithFarcaster(e){return i(this,null,function*(){try{let t=new URLSearchParams({signinAuthenticationMethod:"farcaster",callbackUrl:`${this.apiClient.baseUrl}/${o}/callback`}),r=yield this.apiClient.post(`${o}/authenticate?${t}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify(m(p({},e),{domain:e.signatureParams.domain,redirect:!0,callbackUrl:`${this.apiClient.baseUrl}/${o}/callback`}))});if(!r.ok)throw yield r.text();return(yield r.json()).oneTimeSecret}catch(t){throw new n(`Failed to sign in with Farcaster: ${t instanceof Error?t.message:"Unknown error"}`)}})}signInWithSmartWallet(e){return i(this,null,function*(){try{let t=new URLSearchParams({signinAuthenticationMethod:"evm"}),r=yield this.apiClient.post(`${o}/crypto_wallets/authenticate/start?${t}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({walletAddress:e})});if(!r.ok)throw yield r.text();return yield r.json()}catch(t){throw new n(`Failed to initiate smart wallet sign in: ${t instanceof Error?t.message:"Unknown error"}`)}})}authenticateSmartWallet(e,t){return i(this,null,function*(){try{let r=new URLSearchParams({signinAuthenticationMethod:"evm",callbackUrl:`${this.apiClient.baseUrl}/${o}/callback`}),a=yield this.apiClient.post(`${o}/crypto_wallets/authenticate?${r}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({walletAddress:e,signature:t})});if(!a.ok)throw yield a.text();return yield a.json()}catch(r){throw new n(`Failed to authenticate smart wallet: ${r instanceof Error?r.message:"Unknown error"}`)}})}logoutFromCustomRoute(){return i(this,null,function*(){if(!this.logoutRoute)throw new Error("Custom logout route is not set");return yield fetch(this.logoutRoute,{method:"POST"})})}scheduleNextRefresh(e){let t=w(e);if(!t)throw new Error("Invalid JWT");let r=Date.now()/1e3,a=t-r-120;if(a>0){let s=Date.now()+a*1e3;this.cancelScheduledRefresh(),this.refreshTask=R(()=>this.handleRefreshAuthMaterial(),s)}}cancelScheduledRefresh(){this.refreshTask&&(this.refreshTask.cancel(),this.refreshTask=null)}};export{g as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var m=Object.defineProperty,n=Object.defineProperties;var o=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var i=(c,b,a)=>b in c?m(c,b,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[b]=a,r= exports.a =(c,b)=>{for(var a in b||(b={}))p.call(b,a)&&i(c,a,b[a]);if(h)for(var a of h(b))q.call(b,a)&&i(c,a,b[a]);return c},s= exports.b =(c,b)=>n(c,o(b));var t=(c,b,a)=>new Promise((j,g)=>{var k=d=>{try{e(a.next(d))}catch(f){g(f)}},l=d=>{try{e(a.throw(d))}catch(f){g(f)}},e=d=>d.done?j(d.value):Promise.resolve(d.value).then(k,l);e((a=a.apply(c,b)).next())});exports.a = r; exports.b = s; exports.c = t;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNZ2DAY24cjs = require('./chunk-NZ2DAY24.cjs');var _chunkNYYORERKcjs = require('./chunk-NYYORERK.cjs');var _chunkVDJHVTKIcjs = require('./chunk-VDJHVTKI.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _clientsdkbase = require('@crossmint/client-sdk-base');var g=class y extends _commonsdkauth.CrossmintAuth{constructor(e,t,r={}){var a,s;super(e,t,r);this.refreshTask=null;this.refreshPromise=null;this.callbacks=(a=r.callbacks)!=null?a:{},this.logoutRoute=(s=r.logoutRoute)!=null?s:null}static from(e,t={}){let r=new y(e,_commonsdkauth.CrossmintAuth.defaultApiClient(e),t);return typeof window!="undefined"&&r.handleRefreshAuthMaterial(),r}getUser(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let e=yield this.apiClient.get(`api/${_commonsdkauth.CROSSMINT_API_VERSION}/sdk/auth/user`,{headers:{"Content-Type":"application/json"}});if(!e.ok)throw yield e.text();return yield e.json()}catch(e){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to fetch user: ${e instanceof Error?e.message:"Unknown error"}`)}})}storeAuthMaterial(e){_chunkNYYORERKcjs.b.call(void 0, _commonsdkauth.SESSION_PREFIX,e.jwt),_chunkNYYORERKcjs.b.call(void 0, _commonsdkauth.REFRESH_TOKEN_PREFIX,e.refreshToken.secret,e.refreshToken.expiresAt)}logout(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var t,r;let e=_chunkNYYORERKcjs.a.call(void 0, _commonsdkauth.REFRESH_TOKEN_PREFIX);_chunkNYYORERKcjs.c.call(void 0, _commonsdkauth.REFRESH_TOKEN_PREFIX),_chunkNYYORERKcjs.c.call(void 0, _commonsdkauth.SESSION_PREFIX),(r=(t=this.callbacks).onLogout)==null||r.call(t);try{this.logoutRoute!=null?yield this.logoutFromCustomRoute():e!=null&&(yield this.logoutFromDefaultRoute(e))}catch(a){console.error(a)}})}handleRefreshAuthMaterial(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var r,a;let t=e!=null?e:_chunkNYYORERKcjs.a.call(void 0, _commonsdkauth.REFRESH_TOKEN_PREFIX);if(!(t==null&&this.refreshRoute==null))try{this.refreshPromise==null&&(this.refreshPromise=this.refreshAuthMaterial(t));let s=yield this.refreshPromise;this.refreshRoute==null&&this.storeAuthMaterial(s),(a=(r=this.callbacks).onTokenRefresh)==null||a.call(r,s),this.scheduleNextRefresh(s.jwt)}catch(s){console.error(s),this.logout()}finally{this.refreshPromise=null}})}getOAuthUrl(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let t=yield this.apiClient.get(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/social/${e}/start`,{headers:{"Content-Type":"application/json"}});if(!t.ok)throw yield t.text();return(yield t.json()).oauthUrl}catch(t){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to get OAuth URL for provider ${e}: ${t instanceof Error?t.message:"Unknown error"}`)}})}sendEmailOtp(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let t=yield this.apiClient.post(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/otps/send`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok)throw yield t.text();return yield t.json()}catch(t){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to send email OTP: ${t instanceof Error?t.message:"Unknown error"}`)}})}confirmEmailOtp(e,t,r){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let a=new URLSearchParams({email:e,signinAuthenticationMethod:"email",token:r,locale:"en",state:t}),s=yield this.apiClient.post(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/authenticate?${a}`,{headers:{"Content-Type":"application/json"}});if(!s.ok)throw yield s.text();return(yield s.json()).oneTimeSecret}catch(a){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to confirm email OTP: ${a instanceof Error?a.message:"Unknown error"}`)}})}signInWithFarcaster(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let t=new URLSearchParams({signinAuthenticationMethod:"farcaster",callbackUrl:`${this.apiClient.baseUrl}/${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/callback`}),r=yield this.apiClient.post(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/authenticate?${t}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify(_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},e),{domain:e.signatureParams.domain,redirect:!0,callbackUrl:`${this.apiClient.baseUrl}/${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/callback`}))});if(!r.ok)throw yield r.text();return(yield r.json()).oneTimeSecret}catch(t){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to sign in with Farcaster: ${t instanceof Error?t.message:"Unknown error"}`)}})}signInWithSmartWallet(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let t=new URLSearchParams({signinAuthenticationMethod:"evm"}),r=yield this.apiClient.post(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/crypto_wallets/authenticate/start?${t}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({walletAddress:e})});if(!r.ok)throw yield r.text();return yield r.json()}catch(t){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to initiate smart wallet sign in: ${t instanceof Error?t.message:"Unknown error"}`)}})}authenticateSmartWallet(e,t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{let r=new URLSearchParams({signinAuthenticationMethod:"evm",callbackUrl:`${this.apiClient.baseUrl}/${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/callback`}),a=yield this.apiClient.post(`${_commonsdkauth.AUTH_SDK_ROOT_ENDPOINT}/crypto_wallets/authenticate?${r}`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({walletAddress:e,signature:t})});if(!a.ok)throw yield a.text();return yield a.json()}catch(r){throw new (0, _commonsdkauth.CrossmintAuthenticationError)(`Failed to authenticate smart wallet: ${r instanceof Error?r.message:"Unknown error"}`)}})}logoutFromCustomRoute(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(!this.logoutRoute)throw new Error("Custom logout route is not set");return yield fetch(this.logoutRoute,{method:"POST"})})}scheduleNextRefresh(e){let t=_chunkVDJHVTKIcjs.a.call(void 0, e);if(!t)throw new Error("Invalid JWT");let r=Date.now()/1e3,a=t-r-120;if(a>0){let s=Date.now()+a*1e3;this.cancelScheduledRefresh(),this.refreshTask=_clientsdkbase.queueTask.call(void 0, ()=>this.handleRefreshAuthMaterial(),s)}}cancelScheduledRefresh(){this.refreshTask&&(this.refreshTask.cancel(),this.refreshTask=null)}};exports.a = g;
@@ -0,0 +1 @@
1
+ function r(t){let n=document.cookie.split("; ").find(e=>e.startsWith(t));return n?n.split("=")[1]:void 0}function c(t,n,e){let o=e?new Date(e).toUTCString():"";document.cookie=`${t}=${n}; ${e?`expires=${o};`:""} path=/; SameSite=Lax;`}function u(t){document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`}export{r as a,c as b,u as c};
@@ -0,0 +1 @@
1
+ import{jwtDecode as o}from"jwt-decode";function c(e){return o(e).exp}export{c as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});function s(t){let n=document.cookie.split("; ").find(e=>e.startsWith(t));return n?n.split("=")[1]:void 0}function r(t,n,e){let o=e?new Date(e).toUTCString():"";document.cookie=`${t}=${n}; ${e?`expires=${o};`:""} path=/; SameSite=Lax;`}function c(t){document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`}exports.a = s; exports.b = r; exports.c = c;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _=120;exports.a = _;
@@ -0,0 +1 @@
1
+ var I=120;export{I as a};
File without changes
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jwtdecode = require('jwt-decode');function n(e){return _jwtdecode.jwtDecode.call(void 0, e).exp}exports.a = n;
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/index.cjs CHANGED
@@ -1,29 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkFEGDFSUWcjs = require('./chunk-FEGDFSUW.cjs');
4
- require('./chunk-VQ3HTIQ3.cjs');
5
-
6
-
7
- var _chunkTIUX4OOQcjs = require('./chunk-TIUX4OOQ.cjs');
8
-
9
-
10
-
11
-
12
- var _chunkBGMXXFQ4cjs = require('./chunk-BGMXXFQ4.cjs');
13
-
14
-
15
- var _chunkQY4RIGNMcjs = require('./chunk-QY4RIGNM.cjs');
16
- require('./chunk-F45I5NLI.cjs');
17
-
18
- // src/index.ts
19
- var _commonsdkbase = require('@crossmint/common-sdk-base');
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
- exports.CrossmintAuth = _chunkFEGDFSUWcjs.CrossmintAuthClient; exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkTIUX4OOQcjs.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS; exports.createCrossmint = _commonsdkbase.createCrossmint; exports.deleteCookie = _chunkBGMXXFQ4cjs.deleteCookie; exports.getCookie = _chunkBGMXXFQ4cjs.getCookie; exports.getJWTExpiration = _chunkQY4RIGNMcjs.getJWTExpiration; exports.setCookie = _chunkBGMXXFQ4cjs.setCookie;
29
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFTVKNCGFcjs = require('./chunk-FTVKNCGF.cjs');require('./chunk-XHYLTO6W.cjs');var _chunkNZ2DAY24cjs = require('./chunk-NZ2DAY24.cjs');var _chunkNYYORERKcjs = require('./chunk-NYYORERK.cjs');var _chunkVDJHVTKIcjs = require('./chunk-VDJHVTKI.cjs');require('./chunk-CK4JCQY6.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');exports.CrossmintAuth = _chunkFTVKNCGFcjs.a; exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkNZ2DAY24cjs.a; exports.createCrossmint = _commonsdkbase.createCrossmint; exports.deleteCookie = _chunkNYYORERKcjs.c; exports.getCookie = _chunkNYYORERKcjs.a; exports.getJWTExpiration = _chunkVDJHVTKIcjs.a; exports.setCookie = _chunkNYYORERKcjs.b;
package/dist/index.js CHANGED
@@ -1,29 +1 @@
1
- import {
2
- CrossmintAuthClient
3
- } from "./chunk-SGSYRRRS.js";
4
- import "./chunk-TOXKCKTY.js";
5
- import {
6
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS
7
- } from "./chunk-BMYZMMVR.js";
8
- import {
9
- deleteCookie,
10
- getCookie,
11
- setCookie
12
- } from "./chunk-5JXPQKM4.js";
13
- import {
14
- getJWTExpiration
15
- } from "./chunk-MLMLBCSI.js";
16
- import "./chunk-JPRRZPBL.js";
17
-
18
- // src/index.ts
19
- import { createCrossmint } from "@crossmint/common-sdk-base";
20
- export {
21
- CrossmintAuthClient as CrossmintAuth,
22
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS,
23
- createCrossmint,
24
- deleteCookie,
25
- getCookie,
26
- getJWTExpiration,
27
- setCookie
28
- };
29
- //# sourceMappingURL=index.js.map
1
+ import{a as r}from"./chunk-3K3UA645.js";import"./chunk-U76ID4TS.js";import{a as m}from"./chunk-REIMEXVF.js";import{a as o,b as s,c as e}from"./chunk-HU56N5SW.js";import{a as t}from"./chunk-NIH25R3L.js";import"./chunk-22GIA4MK.js";import{createCrossmint as x}from"@crossmint/common-sdk-base";export{r as CrossmintAuth,m as TIME_BEFORE_EXPIRING_JWT_IN_SECONDS,x as createCrossmint,e as deleteCookie,o as getCookie,t as getJWTExpiration,s as setCookie};
@@ -1,8 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkTIUX4OOQcjs = require('../chunk-TIUX4OOQ.cjs');
4
- require('../chunk-F45I5NLI.cjs');
5
-
6
-
7
- exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkTIUX4OOQcjs.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS;
8
- //# sourceMappingURL=constants.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNZ2DAY24cjs = require('../chunk-NZ2DAY24.cjs');require('../chunk-CK4JCQY6.cjs');exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkNZ2DAY24cjs.a;
@@ -1,8 +1 @@
1
- import {
2
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS
3
- } from "../chunk-BMYZMMVR.js";
4
- import "../chunk-JPRRZPBL.js";
5
- export {
6
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS
7
- };
8
- //# sourceMappingURL=constants.js.map
1
+ import{a}from"../chunk-REIMEXVF.js";import"../chunk-22GIA4MK.js";export{a as TIME_BEFORE_EXPIRING_JWT_IN_SECONDS};
@@ -1,12 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunkBGMXXFQ4cjs = require('../chunk-BGMXXFQ4.cjs');
6
- require('../chunk-F45I5NLI.cjs');
7
-
8
-
9
-
10
-
11
- exports.deleteCookie = _chunkBGMXXFQ4cjs.deleteCookie; exports.getCookie = _chunkBGMXXFQ4cjs.getCookie; exports.setCookie = _chunkBGMXXFQ4cjs.setCookie;
12
- //# sourceMappingURL=cookies.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNYYORERKcjs = require('../chunk-NYYORERK.cjs');require('../chunk-CK4JCQY6.cjs');exports.deleteCookie = _chunkNYYORERKcjs.c; exports.getCookie = _chunkNYYORERKcjs.a; exports.setCookie = _chunkNYYORERKcjs.b;
@@ -1,12 +1 @@
1
- import {
2
- deleteCookie,
3
- getCookie,
4
- setCookie
5
- } from "../chunk-5JXPQKM4.js";
6
- import "../chunk-JPRRZPBL.js";
7
- export {
8
- deleteCookie,
9
- getCookie,
10
- setCookie
11
- };
12
- //# sourceMappingURL=cookies.js.map
1
+ import{a,b,c}from"../chunk-HU56N5SW.js";import"../chunk-22GIA4MK.js";export{c as deleteCookie,a as getCookie,b as setCookie};
@@ -1,21 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-VQ3HTIQ3.cjs');
2
-
3
-
4
- var _chunkTIUX4OOQcjs = require('../chunk-TIUX4OOQ.cjs');
5
-
6
-
7
-
8
-
9
- var _chunkBGMXXFQ4cjs = require('../chunk-BGMXXFQ4.cjs');
10
-
11
-
12
- var _chunkQY4RIGNMcjs = require('../chunk-QY4RIGNM.cjs');
13
- require('../chunk-F45I5NLI.cjs');
14
-
15
-
16
-
17
-
18
-
19
-
20
- exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkTIUX4OOQcjs.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS; exports.deleteCookie = _chunkBGMXXFQ4cjs.deleteCookie; exports.getCookie = _chunkBGMXXFQ4cjs.getCookie; exports.getJWTExpiration = _chunkQY4RIGNMcjs.getJWTExpiration; exports.setCookie = _chunkBGMXXFQ4cjs.setCookie;
21
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-XHYLTO6W.cjs');var _chunkNZ2DAY24cjs = require('../chunk-NZ2DAY24.cjs');var _chunkNYYORERKcjs = require('../chunk-NYYORERK.cjs');var _chunkVDJHVTKIcjs = require('../chunk-VDJHVTKI.cjs');require('../chunk-CK4JCQY6.cjs');exports.TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = _chunkNZ2DAY24cjs.a; exports.deleteCookie = _chunkNYYORERKcjs.c; exports.getCookie = _chunkNYYORERKcjs.a; exports.getJWTExpiration = _chunkVDJHVTKIcjs.a; exports.setCookie = _chunkNYYORERKcjs.b;
@@ -1,21 +1 @@
1
- import "../chunk-TOXKCKTY.js";
2
- import {
3
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS
4
- } from "../chunk-BMYZMMVR.js";
5
- import {
6
- deleteCookie,
7
- getCookie,
8
- setCookie
9
- } from "../chunk-5JXPQKM4.js";
10
- import {
11
- getJWTExpiration
12
- } from "../chunk-MLMLBCSI.js";
13
- import "../chunk-JPRRZPBL.js";
14
- export {
15
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS,
16
- deleteCookie,
17
- getCookie,
18
- getJWTExpiration,
19
- setCookie
20
- };
21
- //# sourceMappingURL=index.js.map
1
+ import"../chunk-U76ID4TS.js";import{a as e}from"../chunk-REIMEXVF.js";import{a as b,b as c,c as d}from"../chunk-HU56N5SW.js";import{a}from"../chunk-NIH25R3L.js";import"../chunk-22GIA4MK.js";export{e as TIME_BEFORE_EXPIRING_JWT_IN_SECONDS,d as deleteCookie,b as getCookie,a as getJWTExpiration,c as setCookie};
@@ -1,8 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkQY4RIGNMcjs = require('../chunk-QY4RIGNM.cjs');
4
- require('../chunk-F45I5NLI.cjs');
5
-
6
-
7
- exports.getJWTExpiration = _chunkQY4RIGNMcjs.getJWTExpiration;
8
- //# sourceMappingURL=jwt.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVDJHVTKIcjs = require('../chunk-VDJHVTKI.cjs');require('../chunk-CK4JCQY6.cjs');exports.getJWTExpiration = _chunkVDJHVTKIcjs.a;
package/dist/utils/jwt.js CHANGED
@@ -1,8 +1 @@
1
- import {
2
- getJWTExpiration
3
- } from "../chunk-MLMLBCSI.js";
4
- import "../chunk-JPRRZPBL.js";
5
- export {
6
- getJWTExpiration
7
- };
8
- //# sourceMappingURL=jwt.js.map
1
+ import{a}from"../chunk-NIH25R3L.js";import"../chunk-22GIA4MK.js";export{a as getJWTExpiration};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/client-sdk-auth",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -15,15 +15,14 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "files": [
17
17
  "dist",
18
- "src",
19
18
  "LICENSE"
20
19
  ],
21
20
  "dependencies": {
22
21
  "jwt-decode": "4.0.0",
23
22
  "@farcaster/auth-kit": "0.6.0",
24
- "@crossmint/client-sdk-base": "1.3.4",
25
- "@crossmint/common-sdk-auth": "1.0.3",
26
- "@crossmint/common-sdk-base": "0.3.0"
23
+ "@crossmint/client-sdk-base": "1.4.1",
24
+ "@crossmint/common-sdk-auth": "1.0.5",
25
+ "@crossmint/common-sdk-base": "0.3.1"
27
26
  },
28
27
  "scripts": {
29
28
  "build": "tsup",
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,19 +0,0 @@
1
- // src/utils/cookies.ts
2
- function getCookie(name) {
3
- const crossmintRefreshToken = document.cookie.split("; ").find((row) => row.startsWith(name));
4
- return crossmintRefreshToken ? crossmintRefreshToken.split("=")[1] : void 0;
5
- }
6
- function setCookie(name, value, expiresAt) {
7
- const expiresInUtc = expiresAt ? new Date(expiresAt).toUTCString() : "";
8
- document.cookie = `${name}=${value}; ${expiresAt ? `expires=${expiresInUtc};` : ""} path=/; SameSite=Lax;`;
9
- }
10
- function deleteCookie(name) {
11
- document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
12
- }
13
-
14
- export {
15
- getCookie,
16
- setCookie,
17
- deleteCookie
18
- };
19
- //# sourceMappingURL=chunk-5JXPQKM4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/cookies.ts"],"sourcesContent":["export function getCookie(name: string): string | undefined {\n const crossmintRefreshToken = document.cookie.split(\"; \").find((row) => row.startsWith(name));\n return crossmintRefreshToken ? crossmintRefreshToken.split(\"=\")[1] : undefined;\n}\n\nexport function setCookie(name: string, value: string, expiresAt?: string) {\n const expiresInUtc = expiresAt ? new Date(expiresAt).toUTCString() : \"\";\n document.cookie = `${name}=${value}; ${expiresAt ? `expires=${expiresInUtc};` : \"\"} path=/; SameSite=Lax;`;\n}\n\nexport function deleteCookie(name: string) {\n document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;\n}\n"],"mappings":";AAAO,SAAS,UAAU,MAAkC;AACxD,QAAM,wBAAwB,SAAS,OAAO,MAAM,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,WAAW,IAAI,CAAC;AAC5F,SAAO,wBAAwB,sBAAsB,MAAM,GAAG,EAAE,CAAC,IAAI;AACzE;AAEO,SAAS,UAAU,MAAc,OAAe,WAAoB;AACvE,QAAM,eAAe,YAAY,IAAI,KAAK,SAAS,EAAE,YAAY,IAAI;AACrE,WAAS,SAAS,GAAG,IAAI,IAAI,KAAK,KAAK,YAAY,WAAW,YAAY,MAAM,EAAE;AACtF;AAEO,SAAS,aAAa,MAAc;AACvC,WAAS,SAAS,GAAG,IAAI;AAC7B;","names":[]}
@@ -1,19 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/cookies.ts
2
- function getCookie(name) {
3
- const crossmintRefreshToken = document.cookie.split("; ").find((row) => row.startsWith(name));
4
- return crossmintRefreshToken ? crossmintRefreshToken.split("=")[1] : void 0;
5
- }
6
- function setCookie(name, value, expiresAt) {
7
- const expiresInUtc = expiresAt ? new Date(expiresAt).toUTCString() : "";
8
- document.cookie = `${name}=${value}; ${expiresAt ? `expires=${expiresInUtc};` : ""} path=/; SameSite=Lax;`;
9
- }
10
- function deleteCookie(name) {
11
- document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
12
- }
13
-
14
-
15
-
16
-
17
-
18
- exports.getCookie = getCookie; exports.setCookie = setCookie; exports.deleteCookie = deleteCookie;
19
- //# sourceMappingURL=chunk-BGMXXFQ4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/cookies.ts"],"names":[],"mappings":";AAAO,SAAS,UAAU,MAAkC;AACxD,QAAM,wBAAwB,SAAS,OAAO,MAAM,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,WAAW,IAAI,CAAC;AAC5F,SAAO,wBAAwB,sBAAsB,MAAM,GAAG,EAAE,CAAC,IAAI;AACzE;AAEO,SAAS,UAAU,MAAc,OAAe,WAAoB;AACvE,QAAM,eAAe,YAAY,IAAI,KAAK,SAAS,EAAE,YAAY,IAAI;AACrE,WAAS,SAAS,GAAG,IAAI,IAAI,KAAK,KAAK,YAAY,WAAW,YAAY,MAAM,EAAE;AACtF;AAEO,SAAS,aAAa,MAAc;AACvC,WAAS,SAAS,GAAG,IAAI;AAC7B","sourcesContent":["export function getCookie(name: string): string | undefined {\n const crossmintRefreshToken = document.cookie.split(\"; \").find((row) => row.startsWith(name));\n return crossmintRefreshToken ? crossmintRefreshToken.split(\"=\")[1] : undefined;\n}\n\nexport function setCookie(name: string, value: string, expiresAt?: string) {\n const expiresInUtc = expiresAt ? new Date(expiresAt).toUTCString() : \"\";\n document.cookie = `${name}=${value}; ${expiresAt ? `expires=${expiresInUtc};` : \"\"} path=/; SameSite=Lax;`;\n}\n\nexport function deleteCookie(name: string) {\n document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;\n}\n"]}
@@ -1,7 +0,0 @@
1
- // src/utils/constants.ts
2
- var TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = 120;
3
-
4
- export {
5
- TIME_BEFORE_EXPIRING_JWT_IN_SECONDS
6
- };
7
- //# sourceMappingURL=chunk-BMYZMMVR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/constants.ts"],"sourcesContent":["export const TIME_BEFORE_EXPIRING_JWT_IN_SECONDS = 120;\n"],"mappings":";AAAO,IAAM,sCAAsC;","names":[]}
@@ -1,46 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
-
41
-
42
-
43
-
44
-
45
- exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__async = __async;
46
- //# sourceMappingURL=chunk-F45I5NLI.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}