@tern-secure/shared 1.3.0-canary.v20251008131428 → 1.3.0-canary.v20251019190011

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.
@@ -1,15 +1,13 @@
1
- import { TernSecureResources, InitialState, TernSecureUser } from '@tern-secure/types';
1
+ import { TernSecureResources, TernSecureStateExtended, TernSecureUser, DecodedIdToken, SignedInSession } from '@tern-secure/types';
2
2
 
3
- declare const deriveAuthState: (authState: TernSecureResources, initialState: InitialState | undefined) => {
4
- userId: string | null;
5
- token: any;
6
- email: string | null;
7
- user: TernSecureUser;
8
- } | {
3
+ type NormalizedClaims = DecodedIdToken;
4
+ type DerivedAuthState = {
9
5
  userId: string | null | undefined;
10
- token: Promise<string> | null;
11
- email: string | null;
12
6
  user: TernSecureUser | null | undefined;
7
+ sessionClaims: NormalizedClaims | null | undefined;
8
+ token?: string | null;
9
+ session?: SignedInSession | null;
13
10
  };
11
+ declare const deriveAuthState: (ternSecureIsReady: boolean, authState: TernSecureResources, initialState: TernSecureStateExtended | undefined) => DerivedAuthState;
14
12
 
15
13
  export { deriveAuthState };
@@ -1,15 +1,13 @@
1
- import { TernSecureResources, InitialState, TernSecureUser } from '@tern-secure/types';
1
+ import { TernSecureResources, TernSecureStateExtended, TernSecureUser, DecodedIdToken, SignedInSession } from '@tern-secure/types';
2
2
 
3
- declare const deriveAuthState: (authState: TernSecureResources, initialState: InitialState | undefined) => {
4
- userId: string | null;
5
- token: any;
6
- email: string | null;
7
- user: TernSecureUser;
8
- } | {
3
+ type NormalizedClaims = DecodedIdToken;
4
+ type DerivedAuthState = {
9
5
  userId: string | null | undefined;
10
- token: Promise<string> | null;
11
- email: string | null;
12
6
  user: TernSecureUser | null | undefined;
7
+ sessionClaims: NormalizedClaims | null | undefined;
8
+ token?: string | null;
9
+ session?: SignedInSession | null;
13
10
  };
11
+ declare const deriveAuthState: (ternSecureIsReady: boolean, authState: TernSecureResources, initialState: TernSecureStateExtended | undefined) => DerivedAuthState;
14
12
 
15
13
  export { deriveAuthState };
@@ -23,33 +23,51 @@ __export(derivedAuthState_exports, {
23
23
  deriveAuthState: () => deriveAuthState
24
24
  });
25
25
  module.exports = __toCommonJS(derivedAuthState_exports);
26
- var deriveAuthState = (authState, initialState) => {
27
- if (initialState) {
28
- return fromInitialState(initialState);
26
+ var deriveAuthState = (ternSecureIsReady, authState, initialState) => {
27
+ if (!authState.user && initialState) {
28
+ return fromSsrInitialState(initialState);
29
29
  }
30
30
  return fromClientSideState(authState);
31
31
  };
32
- var fromInitialState = (initialState) => {
32
+ var fromSsrInitialState = (initialState) => {
33
33
  const userId = initialState.userId;
34
+ const sessionClaims = initialState.sessionClaims;
34
35
  const token = initialState.token;
35
- const email = initialState.email;
36
36
  const user = initialState.user;
37
37
  return {
38
38
  userId,
39
+ sessionClaims,
39
40
  token,
40
- email,
41
- user
41
+ user,
42
+ session: void 0
42
43
  };
43
44
  };
44
45
  var fromClientSideState = (authState) => {
45
- const userId = authState.user ? authState.user.uid : authState.user;
46
- const token = authState.user ? authState.user.getIdToken() : null;
47
- const email = authState.user ? authState.user.email : null;
46
+ var _a, _b, _c, _d, _e, _f;
47
+ const userId = authState.user ? authState.user.uid : null;
48
48
  const user = authState.user;
49
+ const sessionClaims = ((_a = authState.session) == null ? void 0 : _a.claims) ? {
50
+ uid: userId || authState.session.claims.sub || "",
51
+ sub: authState.session.claims.sub || userId || "",
52
+ email: authState.session.claims.email || ((_b = authState.user) == null ? void 0 : _b.email) || void 0,
53
+ email_verified: authState.session.claims.email_verified || ((_c = authState.user) == null ? void 0 : _c.emailVerified) || false,
54
+ exp: authState.session.claims.exp ? parseInt(authState.session.claims.exp) : 0,
55
+ iat: authState.session.claims.iat ? parseInt(authState.session.claims.iat) : 0,
56
+ auth_time: authState.session.claims.auth_time ? parseInt(authState.session.claims.auth_time) : 0,
57
+ aud: authState.session.claims.aud || "",
58
+ iss: authState.session.claims.iss || "",
59
+ firebase: {
60
+ identities: ((_d = authState.session.claims.firebase) == null ? void 0 : _d.identities) || {},
61
+ sign_in_provider: ((_e = authState.session.claims.firebase) == null ? void 0 : _e.sign_in_provider) || authState.session.signInProvider || "unknown",
62
+ sign_in_second_factor: (_f = authState.session.claims.firebase) == null ? void 0 : _f.sign_in_second_factor
63
+ },
64
+ phone_number: (user == null ? void 0 : user.phoneNumber) || void 0,
65
+ picture: (user == null ? void 0 : user.photoURL) || void 0,
66
+ name: (user == null ? void 0 : user.displayName) || void 0
67
+ } : null;
49
68
  return {
50
69
  userId,
51
- token,
52
- email,
70
+ sessionClaims,
53
71
  user
54
72
  };
55
73
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/derivedAuthState.ts"],"sourcesContent":["import type { \n InitialState,\n TernSecureResources,\n TernSecureUser,\n} from \"@tern-secure/types\";\n\n\nexport const deriveAuthState = (authState: TernSecureResources, initialState: InitialState | undefined ) => {\n if (initialState) {\n return fromInitialState(initialState);\n }\n return fromClientSideState(authState);\n};\n\nconst fromInitialState = (initialState: InitialState) => {\n const userId = initialState.userId;\n const token = initialState.token;\n const email = initialState.email;\n const user = initialState.user as TernSecureUser;\n \n return {\n userId,\n token,\n email,\n user\n }\n}\n\n\nconst fromClientSideState = (authState: TernSecureResources) => {\n const userId: string | null | undefined = authState.user ? authState.user.uid : authState.user;\n const token = authState.user ? authState.user.getIdToken() : null;\n const email = authState.user ? authState.user.email : null;\n const user = authState.user;\n\n return {\n userId,\n token,\n email,\n user\n };\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAM,kBAAkB,CAAC,WAAgC,iBAA4C;AAC1G,MAAI,cAAc;AAChB,WAAO,iBAAiB,YAAY;AAAA,EACtC;AACA,SAAO,oBAAoB,SAAS;AACtC;AAEA,IAAM,mBAAmB,CAAC,iBAA+B;AACvD,QAAM,SAAS,aAAa;AAC5B,QAAM,QAAQ,aAAa;AAC3B,QAAM,QAAQ,aAAa;AAC3B,QAAM,OAAO,aAAa;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAGA,IAAM,sBAAsB,CAAC,cAAmC;AAC9D,QAAM,SAAoC,UAAU,OAAO,UAAU,KAAK,MAAM,UAAU;AAC1F,QAAM,QAAQ,UAAU,OAAO,UAAU,KAAK,WAAW,IAAI;AAC7D,QAAM,QAAQ,UAAU,OAAO,UAAU,KAAK,QAAQ;AACtD,QAAM,OAAO,UAAU;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/derivedAuthState.ts"],"sourcesContent":["import type {\n DecodedIdToken,\n SignedInSession,\n TernSecureResources,\n TernSecureStateExtended,\n TernSecureUser,\n} from '@tern-secure/types';\n\n\ntype NormalizedClaims = DecodedIdToken;\n\n\ntype DerivedAuthState = {\n userId: string | null | undefined;\n user: TernSecureUser | null | undefined;\n sessionClaims: NormalizedClaims | null | undefined;\n token?: string | null;\n session?: SignedInSession | null;\n};\n\nexport const deriveAuthState = (\n ternSecureIsReady: boolean,\n authState: TernSecureResources,\n initialState: TernSecureStateExtended | undefined,\n): DerivedAuthState => {\n if (!authState.user && initialState) {\n return fromSsrInitialState(initialState);\n }\n return fromClientSideState(authState);\n};\n\nconst fromSsrInitialState = (initialState: TernSecureStateExtended) => {\n const userId = initialState.userId;\n const sessionClaims = initialState.sessionClaims;\n const token = initialState.token;\n const user = initialState.user as TernSecureUser;\n\n return {\n userId,\n sessionClaims,\n token,\n user,\n session: undefined,\n };\n};\n\n\nconst fromClientSideState = (authState: TernSecureResources) => {\n const userId: string | null | undefined = authState.user ? authState.user.uid : null;\n const user = authState.user;\n const sessionClaims: DecodedIdToken | null = authState.session?.claims ? {\n uid: userId || (authState.session.claims.sub as string) || '',\n sub: (authState.session.claims.sub as string) || userId || '',\n email: (authState.session.claims as any).email || authState.user?.email || undefined,\n email_verified: (authState.session.claims as any).email_verified || authState.user?.emailVerified || false,\n exp: authState.session.claims.exp ? parseInt(authState.session.claims.exp) : 0,\n iat: authState.session.claims.iat ? parseInt(authState.session.claims.iat) : 0,\n auth_time: authState.session.claims.auth_time ? parseInt(authState.session.claims.auth_time) : 0,\n aud: (authState.session.claims as any).aud || '',\n iss: (authState.session.claims as any).iss || '',\n firebase: {\n identities: (authState.session.claims.firebase?.identities || {}) as { [key: string]: unknown },\n sign_in_provider: authState.session.claims.firebase?.sign_in_provider || authState.session.signInProvider || 'unknown',\n sign_in_second_factor: authState.session.claims.firebase?.sign_in_second_factor,\n },\n phone_number: user?.phoneNumber || undefined,\n picture: user?.photoURL || undefined,\n name: user?.displayName || undefined,\n } as DecodedIdToken : null;\n\n return {\n userId,\n sessionClaims,\n user,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,IAAM,kBAAkB,CAC7B,mBACA,WACA,iBACqB;AACrB,MAAI,CAAC,UAAU,QAAQ,cAAc;AACnC,WAAO,oBAAoB,YAAY;AAAA,EACzC;AACA,SAAO,oBAAoB,SAAS;AACtC;AAEA,IAAM,sBAAsB,CAAC,iBAA0C;AACrE,QAAM,SAAS,aAAa;AAC5B,QAAM,gBAAgB,aAAa;AACnC,QAAM,QAAQ,aAAa;AAC3B,QAAM,OAAO,aAAa;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX;AACF;AAGA,IAAM,sBAAsB,CAAC,cAAmC;AA/ChE;AAgDE,QAAM,SAAoC,UAAU,OAAO,UAAU,KAAK,MAAM;AAChF,QAAM,OAAO,UAAU;AACvB,QAAM,kBAAuC,eAAU,YAAV,mBAAmB,UAAS;AAAA,IACvE,KAAK,UAAW,UAAU,QAAQ,OAAO,OAAkB;AAAA,IAC3D,KAAM,UAAU,QAAQ,OAAO,OAAkB,UAAU;AAAA,IAC3D,OAAQ,UAAU,QAAQ,OAAe,WAAS,eAAU,SAAV,mBAAgB,UAAS;AAAA,IAC3E,gBAAiB,UAAU,QAAQ,OAAe,oBAAkB,eAAU,SAAV,mBAAgB,kBAAiB;AAAA,IACrG,KAAK,UAAU,QAAQ,OAAO,MAAM,SAAS,UAAU,QAAQ,OAAO,GAAG,IAAI;AAAA,IAC7E,KAAK,UAAU,QAAQ,OAAO,MAAM,SAAS,UAAU,QAAQ,OAAO,GAAG,IAAI;AAAA,IAC7E,WAAW,UAAU,QAAQ,OAAO,YAAY,SAAS,UAAU,QAAQ,OAAO,SAAS,IAAI;AAAA,IAC/F,KAAM,UAAU,QAAQ,OAAe,OAAO;AAAA,IAC9C,KAAM,UAAU,QAAQ,OAAe,OAAO;AAAA,IAC9C,UAAU;AAAA,MACR,cAAa,eAAU,QAAQ,OAAO,aAAzB,mBAAmC,eAAc,CAAC;AAAA,MAC/D,oBAAkB,eAAU,QAAQ,OAAO,aAAzB,mBAAmC,qBAAoB,UAAU,QAAQ,kBAAkB;AAAA,MAC7G,wBAAuB,eAAU,QAAQ,OAAO,aAAzB,mBAAmC;AAAA,IAC5D;AAAA,IACA,eAAc,6BAAM,gBAAe;AAAA,IACnC,UAAS,6BAAM,aAAY;AAAA,IAC3B,OAAM,6BAAM,gBAAe;AAAA,EAC7B,IAAsB;AAEtB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,31 +1,49 @@
1
1
  // src/derivedAuthState.ts
2
- var deriveAuthState = (authState, initialState) => {
3
- if (initialState) {
4
- return fromInitialState(initialState);
2
+ var deriveAuthState = (ternSecureIsReady, authState, initialState) => {
3
+ if (!authState.user && initialState) {
4
+ return fromSsrInitialState(initialState);
5
5
  }
6
6
  return fromClientSideState(authState);
7
7
  };
8
- var fromInitialState = (initialState) => {
8
+ var fromSsrInitialState = (initialState) => {
9
9
  const userId = initialState.userId;
10
+ const sessionClaims = initialState.sessionClaims;
10
11
  const token = initialState.token;
11
- const email = initialState.email;
12
12
  const user = initialState.user;
13
13
  return {
14
14
  userId,
15
+ sessionClaims,
15
16
  token,
16
- email,
17
- user
17
+ user,
18
+ session: void 0
18
19
  };
19
20
  };
20
21
  var fromClientSideState = (authState) => {
21
- const userId = authState.user ? authState.user.uid : authState.user;
22
- const token = authState.user ? authState.user.getIdToken() : null;
23
- const email = authState.user ? authState.user.email : null;
22
+ var _a, _b, _c, _d, _e, _f;
23
+ const userId = authState.user ? authState.user.uid : null;
24
24
  const user = authState.user;
25
+ const sessionClaims = ((_a = authState.session) == null ? void 0 : _a.claims) ? {
26
+ uid: userId || authState.session.claims.sub || "",
27
+ sub: authState.session.claims.sub || userId || "",
28
+ email: authState.session.claims.email || ((_b = authState.user) == null ? void 0 : _b.email) || void 0,
29
+ email_verified: authState.session.claims.email_verified || ((_c = authState.user) == null ? void 0 : _c.emailVerified) || false,
30
+ exp: authState.session.claims.exp ? parseInt(authState.session.claims.exp) : 0,
31
+ iat: authState.session.claims.iat ? parseInt(authState.session.claims.iat) : 0,
32
+ auth_time: authState.session.claims.auth_time ? parseInt(authState.session.claims.auth_time) : 0,
33
+ aud: authState.session.claims.aud || "",
34
+ iss: authState.session.claims.iss || "",
35
+ firebase: {
36
+ identities: ((_d = authState.session.claims.firebase) == null ? void 0 : _d.identities) || {},
37
+ sign_in_provider: ((_e = authState.session.claims.firebase) == null ? void 0 : _e.sign_in_provider) || authState.session.signInProvider || "unknown",
38
+ sign_in_second_factor: (_f = authState.session.claims.firebase) == null ? void 0 : _f.sign_in_second_factor
39
+ },
40
+ phone_number: (user == null ? void 0 : user.phoneNumber) || void 0,
41
+ picture: (user == null ? void 0 : user.photoURL) || void 0,
42
+ name: (user == null ? void 0 : user.displayName) || void 0
43
+ } : null;
25
44
  return {
26
45
  userId,
27
- token,
28
- email,
46
+ sessionClaims,
29
47
  user
30
48
  };
31
49
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/derivedAuthState.ts"],"sourcesContent":["import type { \n InitialState,\n TernSecureResources,\n TernSecureUser,\n} from \"@tern-secure/types\";\n\n\nexport const deriveAuthState = (authState: TernSecureResources, initialState: InitialState | undefined ) => {\n if (initialState) {\n return fromInitialState(initialState);\n }\n return fromClientSideState(authState);\n};\n\nconst fromInitialState = (initialState: InitialState) => {\n const userId = initialState.userId;\n const token = initialState.token;\n const email = initialState.email;\n const user = initialState.user as TernSecureUser;\n \n return {\n userId,\n token,\n email,\n user\n }\n}\n\n\nconst fromClientSideState = (authState: TernSecureResources) => {\n const userId: string | null | undefined = authState.user ? authState.user.uid : authState.user;\n const token = authState.user ? authState.user.getIdToken() : null;\n const email = authState.user ? authState.user.email : null;\n const user = authState.user;\n\n return {\n userId,\n token,\n email,\n user\n };\n};"],"mappings":";AAOO,IAAM,kBAAkB,CAAC,WAAgC,iBAA4C;AAC1G,MAAI,cAAc;AAChB,WAAO,iBAAiB,YAAY;AAAA,EACtC;AACA,SAAO,oBAAoB,SAAS;AACtC;AAEA,IAAM,mBAAmB,CAAC,iBAA+B;AACvD,QAAM,SAAS,aAAa;AAC5B,QAAM,QAAQ,aAAa;AAC3B,QAAM,QAAQ,aAAa;AAC3B,QAAM,OAAO,aAAa;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAGA,IAAM,sBAAsB,CAAC,cAAmC;AAC9D,QAAM,SAAoC,UAAU,OAAO,UAAU,KAAK,MAAM,UAAU;AAC1F,QAAM,QAAQ,UAAU,OAAO,UAAU,KAAK,WAAW,IAAI;AAC7D,QAAM,QAAQ,UAAU,OAAO,UAAU,KAAK,QAAQ;AACtD,QAAM,OAAO,UAAU;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/derivedAuthState.ts"],"sourcesContent":["import type {\n DecodedIdToken,\n SignedInSession,\n TernSecureResources,\n TernSecureStateExtended,\n TernSecureUser,\n} from '@tern-secure/types';\n\n\ntype NormalizedClaims = DecodedIdToken;\n\n\ntype DerivedAuthState = {\n userId: string | null | undefined;\n user: TernSecureUser | null | undefined;\n sessionClaims: NormalizedClaims | null | undefined;\n token?: string | null;\n session?: SignedInSession | null;\n};\n\nexport const deriveAuthState = (\n ternSecureIsReady: boolean,\n authState: TernSecureResources,\n initialState: TernSecureStateExtended | undefined,\n): DerivedAuthState => {\n if (!authState.user && initialState) {\n return fromSsrInitialState(initialState);\n }\n return fromClientSideState(authState);\n};\n\nconst fromSsrInitialState = (initialState: TernSecureStateExtended) => {\n const userId = initialState.userId;\n const sessionClaims = initialState.sessionClaims;\n const token = initialState.token;\n const user = initialState.user as TernSecureUser;\n\n return {\n userId,\n sessionClaims,\n token,\n user,\n session: undefined,\n };\n};\n\n\nconst fromClientSideState = (authState: TernSecureResources) => {\n const userId: string | null | undefined = authState.user ? authState.user.uid : null;\n const user = authState.user;\n const sessionClaims: DecodedIdToken | null = authState.session?.claims ? {\n uid: userId || (authState.session.claims.sub as string) || '',\n sub: (authState.session.claims.sub as string) || userId || '',\n email: (authState.session.claims as any).email || authState.user?.email || undefined,\n email_verified: (authState.session.claims as any).email_verified || authState.user?.emailVerified || false,\n exp: authState.session.claims.exp ? parseInt(authState.session.claims.exp) : 0,\n iat: authState.session.claims.iat ? parseInt(authState.session.claims.iat) : 0,\n auth_time: authState.session.claims.auth_time ? parseInt(authState.session.claims.auth_time) : 0,\n aud: (authState.session.claims as any).aud || '',\n iss: (authState.session.claims as any).iss || '',\n firebase: {\n identities: (authState.session.claims.firebase?.identities || {}) as { [key: string]: unknown },\n sign_in_provider: authState.session.claims.firebase?.sign_in_provider || authState.session.signInProvider || 'unknown',\n sign_in_second_factor: authState.session.claims.firebase?.sign_in_second_factor,\n },\n phone_number: user?.phoneNumber || undefined,\n picture: user?.photoURL || undefined,\n name: user?.displayName || undefined,\n } as DecodedIdToken : null;\n\n return {\n userId,\n sessionClaims,\n user,\n };\n};\n"],"mappings":";AAoBO,IAAM,kBAAkB,CAC7B,mBACA,WACA,iBACqB;AACrB,MAAI,CAAC,UAAU,QAAQ,cAAc;AACnC,WAAO,oBAAoB,YAAY;AAAA,EACzC;AACA,SAAO,oBAAoB,SAAS;AACtC;AAEA,IAAM,sBAAsB,CAAC,iBAA0C;AACrE,QAAM,SAAS,aAAa;AAC5B,QAAM,gBAAgB,aAAa;AACnC,QAAM,QAAQ,aAAa;AAC3B,QAAM,OAAO,aAAa;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX;AACF;AAGA,IAAM,sBAAsB,CAAC,cAAmC;AA/ChE;AAgDE,QAAM,SAAoC,UAAU,OAAO,UAAU,KAAK,MAAM;AAChF,QAAM,OAAO,UAAU;AACvB,QAAM,kBAAuC,eAAU,YAAV,mBAAmB,UAAS;AAAA,IACvE,KAAK,UAAW,UAAU,QAAQ,OAAO,OAAkB;AAAA,IAC3D,KAAM,UAAU,QAAQ,OAAO,OAAkB,UAAU;AAAA,IAC3D,OAAQ,UAAU,QAAQ,OAAe,WAAS,eAAU,SAAV,mBAAgB,UAAS;AAAA,IAC3E,gBAAiB,UAAU,QAAQ,OAAe,oBAAkB,eAAU,SAAV,mBAAgB,kBAAiB;AAAA,IACrG,KAAK,UAAU,QAAQ,OAAO,MAAM,SAAS,UAAU,QAAQ,OAAO,GAAG,IAAI;AAAA,IAC7E,KAAK,UAAU,QAAQ,OAAO,MAAM,SAAS,UAAU,QAAQ,OAAO,GAAG,IAAI;AAAA,IAC7E,WAAW,UAAU,QAAQ,OAAO,YAAY,SAAS,UAAU,QAAQ,OAAO,SAAS,IAAI;AAAA,IAC/F,KAAM,UAAU,QAAQ,OAAe,OAAO;AAAA,IAC9C,KAAM,UAAU,QAAQ,OAAe,OAAO;AAAA,IAC9C,UAAU;AAAA,MACR,cAAa,eAAU,QAAQ,OAAO,aAAzB,mBAAmC,eAAc,CAAC;AAAA,MAC/D,oBAAkB,eAAU,QAAQ,OAAO,aAAzB,mBAAmC,qBAAoB,UAAU,QAAQ,kBAAkB;AAAA,MAC7G,wBAAuB,eAAU,QAAQ,OAAO,aAAzB,mBAAmC;AAAA,IAC5D;AAAA,IACA,eAAc,6BAAM,gBAAe;AAAA,IACnC,UAAS,6BAAM,aAAY;AAAA,IAC3B,OAAM,6BAAM,gBAAe;AAAA,EAC7B,IAAsB;AAEtB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,9 +1,12 @@
1
1
  import * as _tern_secure_types from '@tern-secure/types';
2
- import { TernSecureInstanceTree, TernSecureAuthProvider, TernSecureState, TernSecureAuth } from '@tern-secure/types';
2
+ import { TernSecureAuth, TernSecureInstanceTree, TernSecureAuthProvider, TernSecureState } from '@tern-secure/types';
3
3
  import * as react from 'react';
4
4
  import react__default from 'react';
5
5
 
6
- declare const useTernSecure: () => TernSecureInstanceTree;
6
+ /**
7
+ * New hook that uses TernSecureAuth
8
+ */
9
+ declare const useTernSecure: () => TernSecureAuth;
7
10
 
8
11
  type TernSecureAuthContextType = {
9
12
  authProvider: TernSecureAuthProvider | null | undefined;
@@ -1,9 +1,12 @@
1
1
  import * as _tern_secure_types from '@tern-secure/types';
2
- import { TernSecureInstanceTree, TernSecureAuthProvider, TernSecureState, TernSecureAuth } from '@tern-secure/types';
2
+ import { TernSecureAuth, TernSecureInstanceTree, TernSecureAuthProvider, TernSecureState } from '@tern-secure/types';
3
3
  import * as react from 'react';
4
4
  import react__default from 'react';
5
5
 
6
- declare const useTernSecure: () => TernSecureInstanceTree;
6
+ /**
7
+ * New hook that uses TernSecureAuth
8
+ */
9
+ declare const useTernSecure: () => TernSecureAuth;
7
10
 
8
11
  type TernSecureAuthContextType = {
9
12
  authProvider: TernSecureAuthProvider | null | undefined;
@@ -48,7 +48,7 @@ __export(react_exports, {
48
48
  });
49
49
  module.exports = __toCommonJS(react_exports);
50
50
 
51
- // src/react/ternSecureProvider.tsx
51
+ // src/react/ternSecureAuthProvider.tsx
52
52
  var import_react2 = require("react");
53
53
 
54
54
  // src/react/ternsecureCtx.ts
@@ -74,13 +74,10 @@ var createContextAndHook = (displayName, options) => {
74
74
  return [Ctx, useCtx, useCtxWithoutGuarantee];
75
75
  };
76
76
 
77
- // src/react/ternSecureProvider.tsx
78
- var [TernSecureInstanceContext, useTernSecureInstanceContext] = createContextAndHook("TernSecureInstanceContext");
79
- var [TernSecureAuthContext, useTernSecureAuthContext] = createContextAndHook("TernSecureAuthContext");
80
- var [SessionContext, useSessionContext] = createContextAndHook("SessionContext");
81
- var [UserContext, useUserContext] = createContextAndHook("UserContext");
82
- function useAssertWrappedByTernSecureProvider(displayNameOrFn) {
83
- const ctx = (0, import_react2.useContext)(TernSecureInstanceContext);
77
+ // src/react/ternSecureAuthProvider.tsx
78
+ var [TernSecureAuthCtx, useTernSecureAuthCtx] = createContextAndHook("TernSecureAuthCtx");
79
+ function useAssertWrappedByTernSecureAuthProvider(displayNameOrFn) {
80
+ const ctx = (0, import_react2.useContext)(TernSecureAuthCtx);
84
81
  if (!ctx) {
85
82
  if (typeof displayNameOrFn === "function") {
86
83
  displayNameOrFn();
@@ -96,17 +93,14 @@ Possible fixes:
96
93
  }
97
94
  }
98
95
 
99
- // src/react/hooks/useTernSecure.ts
100
- var useTernSecure = () => {
101
- useAssertWrappedByTernSecureProvider("useTernSecure");
102
- return useTernSecureInstanceContext();
103
- };
104
-
105
- // src/react/ternSecureAuthProvider.tsx
96
+ // src/react/ternSecureProvider.tsx
106
97
  var import_react3 = require("react");
107
- var [TernSecureAuthCtx, useTernSecureAuthCtx] = createContextAndHook("TernSecureAuthCtx");
108
- function useAssertWrappedByTernSecureAuthProvider(displayNameOrFn) {
109
- const ctx = (0, import_react3.useContext)(TernSecureAuthCtx);
98
+ var [TernSecureInstanceContext, useTernSecureInstanceContext] = createContextAndHook("TernSecureInstanceContext");
99
+ var [TernSecureAuthContext, useTernSecureAuthContext] = createContextAndHook("TernSecureAuthContext");
100
+ var [SessionContext, useSessionContext] = createContextAndHook("SessionContext");
101
+ var [UserContext, useUserContext] = createContextAndHook("UserContext");
102
+ function useAssertWrappedByTernSecureProvider(displayNameOrFn) {
103
+ const ctx = (0, import_react3.useContext)(TernSecureInstanceContext);
110
104
  if (!ctx) {
111
105
  if (typeof displayNameOrFn === "function") {
112
106
  displayNameOrFn();
@@ -121,6 +115,12 @@ Possible fixes:
121
115
  );
122
116
  }
123
117
  }
118
+
119
+ // src/react/hooks/useTernSecure.ts
120
+ var useTernSecure = () => {
121
+ useAssertWrappedByTernSecureAuthProvider("useTernSecure");
122
+ return useTernSecureAuthCtx();
123
+ };
124
124
  // Annotate the CommonJS export names for ESM import in node:
125
125
  0 && (module.exports = {
126
126
  SessionContext,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/index.ts","../../src/react/ternSecureProvider.tsx","../../src/react/ternsecureCtx.ts","../../src/react/hooks/useTernSecure.ts","../../src/react/ternSecureAuthProvider.tsx"],"sourcesContent":["export * from './hooks'\n\nexport {\n useAssertWrappedByTernSecureProvider,\n useTernSecureInstanceContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n SessionContext,\n UserContext,\n TernSecureAuthContext,\n TernSecureInstanceContext\n} from './ternSecureProvider'\n\nexport {\n assertContextExists,\n createContextAndHook\n} from './ternsecureCtx'\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider\n} from './ternSecureAuthProvider'","'use client'\n\nimport type { \n TernSecureAuthProvider,\n TernSecureInstanceTree,\n TernSecureState,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\nexport type TernSecureAuthContextType = {\n authProvider: TernSecureAuthProvider | null | undefined;\n authState: TernSecureState;\n}\n\n\n// Create TernSecure instance context\nconst [TernSecureInstanceContext, useTernSecureInstanceContext] = \n createContextAndHook<TernSecureInstanceTree>('TernSecureInstanceContext');\n\nconst [TernSecureAuthContext, useTernSecureAuthContext] =\n createContextAndHook<TernSecureAuthContextType>('TernSecureAuthContext');\n\nconst [SessionContext, useSessionContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['session']>('SessionContext');\n\nconst [UserContext, useUserContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['user']>('UserContext');\n\n// Assert helper\nfunction useAssertWrappedByTernSecureProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureInstanceContext);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n\n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\nexport {\n TernSecureInstanceContext,\n TernSecureAuthContext,\n SessionContext,\n UserContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n useTernSecureInstanceContext,\n useAssertWrappedByTernSecureProvider\n};","'use client'\n\nimport React from 'react';\n\n/**\n * Assert that the context value exists, otherwise throw an error.\n *\n * @internal\n */\nexport function assertContextExists(contextVal: unknown, msgOrCtx: string | React.Context<any>): asserts contextVal {\n if (!contextVal) {\n throw typeof msgOrCtx === 'string' ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);\n }\n}\ntype Options = { assertCtxFn?: (v: unknown, msg: string) => void };\ntype ContextAndHook<T> = React.Context<{ value: T } | undefined>;\ntype UseCtxFn<T> = () => T;\n\n/**\n * Create and return a Context and two hooks that return the context value.\n * The Context type is derived from the type passed in by the user.\n *\n * The first hook returned guarantees that the context exists so the returned value is always `CtxValue`\n * The second hook makes no guarantees, so the returned value can be `CtxValue | undefined`\n *\n * @internal\n */\n\nexport const createContextAndHook = <CtxValue>(\n displayName: string,\n options?: Options,\n): [ContextAndHook<CtxValue>, UseCtxFn<CtxValue>, UseCtxFn<CtxValue | Partial<CtxValue>>] => {\n const { assertCtxFn = assertContextExists } = options || {};\n const Ctx = React.createContext<{ value: CtxValue } | undefined >(undefined);\n Ctx.displayName = displayName;\n\n const useCtx = () => {\n const ctx = React.useContext(Ctx);\n assertCtxFn(ctx, `${displayName} not found`);\n return (ctx as any).value as CtxValue;\n };\n\n const useCtxWithoutGuarantee = () => {\n const ctx = React.useContext(Ctx);\n return ctx ? ctx.value : {}\n };\n\n /**\n * Assert that the context value exists, otherwise throw an error.\n if (ctx === undefined) {\n throw new Error(`use${name} must be used within a ${name}Provider`);\n }\n return ctx.value;\n */\n\n return [Ctx, useCtx, useCtxWithoutGuarantee];\n}","import type { \n TernSecureInstanceTree\n} from \"@tern-secure/types\";\n\nimport { \n useAssertWrappedByTernSecureProvider, \n useTernSecureInstanceContext \n} from \"../ternSecureProvider\";\n\nexport const useTernSecure = (): TernSecureInstanceTree => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n \n useAssertWrappedByTernSecureProvider('useTernSecure');\n return useTernSecureInstanceContext();\n}","'use client'\n\nimport type { \n TernSecureAuth,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\n\nconst [TernSecureAuthCtx, useTernSecureAuthCtx] =\n createContextAndHook<TernSecureAuth>('TernSecureAuthCtx');\n\nfunction useAssertWrappedByTernSecureAuthProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureAuthCtx);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n \n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider,\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,IAAAA,gBAA2B;;;ACL3B,mBAAkB;AAOX,SAAS,oBAAoB,YAAqB,UAA2D;AAClH,MAAI,CAAC,YAAY;AACf,UAAM,OAAO,aAAa,WAAW,IAAI,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG,SAAS,WAAW,YAAY;AAAA,EAC1G;AACF;AAeO,IAAM,uBAAuB,CAClC,aACA,YAC2F;AAC3F,QAAM,EAAE,cAAc,oBAAoB,IAAI,WAAW,CAAC;AAC1D,QAAM,MAAM,aAAAC,QAAM,cAAgD,MAAS;AAC3E,MAAI,cAAc;AAElB,QAAM,SAAS,MAAM;AACnB,UAAM,MAAM,aAAAA,QAAM,WAAW,GAAG;AAChC,gBAAY,KAAK,GAAG,WAAW,YAAY;AAC3C,WAAQ,IAAY;AAAA,EACtB;AAEA,QAAM,yBAAyB,MAAM;AACnC,UAAM,MAAM,aAAAA,QAAM,WAAW,GAAG;AAChC,WAAO,MAAM,IAAI,QAAQ,CAAC;AAAA,EAC5B;AAUA,SAAO,CAAC,KAAK,QAAQ,sBAAsB;AAC7C;;;ADtCA,IAAM,CAAC,2BAA2B,4BAA4B,IAC5D,qBAA6C,2BAA2B;AAE1E,IAAM,CAAC,uBAAuB,wBAAwB,IACpD,qBAAgD,uBAAuB;AAEzE,IAAM,CAAC,gBAAgB,iBAAiB,IACxC,qBAAgE,gBAAgB;AAEhF,IAAM,CAAC,aAAa,cAAc,IAClC,qBAA6D,aAAa;AAG1E,SAAS,qCAAqC,iBAA8C;AAE1F,QAAM,UAAM,0BAAW,yBAAyB;AAEhD,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AExCO,IAAM,gBAAgB,MAA8B;AAUvD,uCAAqC,eAAe;AACpD,SAAO,6BAA6B;AACxC;;;AChBA,IAAAC,gBAA2B;AAK3B,IAAM,CAAC,mBAAmB,oBAAoB,IAC5C,qBAAqC,mBAAmB;AAE1D,SAAS,yCAAyC,iBAA8C;AAE9F,QAAM,UAAM,0BAAW,iBAAiB;AAExC,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;","names":["import_react","React","import_react"]}
1
+ {"version":3,"sources":["../../src/react/index.ts","../../src/react/ternSecureAuthProvider.tsx","../../src/react/ternsecureCtx.ts","../../src/react/ternSecureProvider.tsx","../../src/react/hooks/useTernSecure.ts"],"sourcesContent":["export * from './hooks'\n\nexport {\n useAssertWrappedByTernSecureProvider,\n useTernSecureInstanceContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n SessionContext,\n UserContext,\n TernSecureAuthContext,\n TernSecureInstanceContext\n} from './ternSecureProvider'\n\nexport {\n assertContextExists,\n createContextAndHook\n} from './ternsecureCtx'\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider\n} from './ternSecureAuthProvider'","'use client'\n\nimport type { \n TernSecureAuth,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\n\nconst [TernSecureAuthCtx, useTernSecureAuthCtx] =\n createContextAndHook<TernSecureAuth>('TernSecureAuthCtx');\n\nfunction useAssertWrappedByTernSecureAuthProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureAuthCtx);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n \n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider,\n};","'use client'\n\nimport React from 'react';\n\n/**\n * Assert that the context value exists, otherwise throw an error.\n *\n * @internal\n */\nexport function assertContextExists(contextVal: unknown, msgOrCtx: string | React.Context<any>): asserts contextVal {\n if (!contextVal) {\n throw typeof msgOrCtx === 'string' ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);\n }\n}\ntype Options = { assertCtxFn?: (v: unknown, msg: string) => void };\ntype ContextAndHook<T> = React.Context<{ value: T } | undefined>;\ntype UseCtxFn<T> = () => T;\n\n/**\n * Create and return a Context and two hooks that return the context value.\n * The Context type is derived from the type passed in by the user.\n *\n * The first hook returned guarantees that the context exists so the returned value is always `CtxValue`\n * The second hook makes no guarantees, so the returned value can be `CtxValue | undefined`\n *\n * @internal\n */\n\nexport const createContextAndHook = <CtxValue>(\n displayName: string,\n options?: Options,\n): [ContextAndHook<CtxValue>, UseCtxFn<CtxValue>, UseCtxFn<CtxValue | Partial<CtxValue>>] => {\n const { assertCtxFn = assertContextExists } = options || {};\n const Ctx = React.createContext<{ value: CtxValue } | undefined >(undefined);\n Ctx.displayName = displayName;\n\n const useCtx = () => {\n const ctx = React.useContext(Ctx);\n assertCtxFn(ctx, `${displayName} not found`);\n return (ctx as any).value as CtxValue;\n };\n\n const useCtxWithoutGuarantee = () => {\n const ctx = React.useContext(Ctx);\n return ctx ? ctx.value : {}\n };\n\n /**\n * Assert that the context value exists, otherwise throw an error.\n if (ctx === undefined) {\n throw new Error(`use${name} must be used within a ${name}Provider`);\n }\n return ctx.value;\n */\n\n return [Ctx, useCtx, useCtxWithoutGuarantee];\n}","'use client'\n\nimport type { \n TernSecureAuthProvider,\n TernSecureInstanceTree,\n TernSecureState,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\nexport type TernSecureAuthContextType = {\n authProvider: TernSecureAuthProvider | null | undefined;\n authState: TernSecureState;\n}\n\n\n// Create TernSecure instance context\nconst [TernSecureInstanceContext, useTernSecureInstanceContext] = \n createContextAndHook<TernSecureInstanceTree>('TernSecureInstanceContext');\n\nconst [TernSecureAuthContext, useTernSecureAuthContext] =\n createContextAndHook<TernSecureAuthContextType>('TernSecureAuthContext');\n\nconst [SessionContext, useSessionContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['session']>('SessionContext');\n\nconst [UserContext, useUserContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['user']>('UserContext');\n\n// Assert helper\nfunction useAssertWrappedByTernSecureProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureInstanceContext);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n\n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\nexport {\n TernSecureInstanceContext,\n TernSecureAuthContext,\n SessionContext,\n UserContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n useTernSecureInstanceContext,\n useAssertWrappedByTernSecureProvider\n};","import type { TernSecureAuth, TernSecureInstanceTree } from '@tern-secure/types';\n\nimport {\n useAssertWrappedByTernSecureAuthProvider,\n useTernSecureAuthCtx,\n} from '../ternSecureAuthProvider';\nimport {\n useAssertWrappedByTernSecureProvider,\n useTernSecureInstanceContext,\n} from '../ternSecureProvider';\n\n/**\n * @deprecated this was a previous version with cdn. now since in this package we dont use cdn, create a new hook that uuses TernSecureAuth and rename this to useTernSecure_Deprecated\n *\n */\nexport const useTernSecure_Deprecated = (): TernSecureInstanceTree => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n\n useAssertWrappedByTernSecureProvider('useTernSecure');\n return useTernSecureInstanceContext();\n};\n\n\n/**\n * New hook that uses TernSecureAuth\n */\nexport const useTernSecure = (): TernSecureAuth => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n\n useAssertWrappedByTernSecureAuthProvider('useTernSecure');\n return useTernSecureAuthCtx();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAAA,gBAA2B;;;ACH3B,mBAAkB;AAOX,SAAS,oBAAoB,YAAqB,UAA2D;AAClH,MAAI,CAAC,YAAY;AACf,UAAM,OAAO,aAAa,WAAW,IAAI,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG,SAAS,WAAW,YAAY;AAAA,EAC1G;AACF;AAeO,IAAM,uBAAuB,CAClC,aACA,YAC2F;AAC3F,QAAM,EAAE,cAAc,oBAAoB,IAAI,WAAW,CAAC;AAC1D,QAAM,MAAM,aAAAC,QAAM,cAAgD,MAAS;AAC3E,MAAI,cAAc;AAElB,QAAM,SAAS,MAAM;AACnB,UAAM,MAAM,aAAAA,QAAM,WAAW,GAAG;AAChC,gBAAY,KAAK,GAAG,WAAW,YAAY;AAC3C,WAAQ,IAAY;AAAA,EACtB;AAEA,QAAM,yBAAyB,MAAM;AACnC,UAAM,MAAM,aAAAA,QAAM,WAAW,GAAG;AAChC,WAAO,MAAM,IAAI,QAAQ,CAAC;AAAA,EAC5B;AAUA,SAAO,CAAC,KAAK,QAAQ,sBAAsB;AAC7C;;;AD9CA,IAAM,CAAC,mBAAmB,oBAAoB,IAC5C,qBAAqC,mBAAmB;AAE1D,SAAS,yCAAyC,iBAA8C;AAE9F,QAAM,UAAM,0BAAW,iBAAiB;AAExC,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AExBA,IAAAC,gBAA2B;AAW3B,IAAM,CAAC,2BAA2B,4BAA4B,IAC5D,qBAA6C,2BAA2B;AAE1E,IAAM,CAAC,uBAAuB,wBAAwB,IACpD,qBAAgD,uBAAuB;AAEzE,IAAM,CAAC,gBAAgB,iBAAiB,IACxC,qBAAgE,gBAAgB;AAEhF,IAAM,CAAC,aAAa,cAAc,IAClC,qBAA6D,aAAa;AAG1E,SAAS,qCAAqC,iBAA8C;AAE1F,QAAM,UAAM,0BAAW,yBAAyB;AAEhD,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AChBO,IAAM,gBAAgB,MAAsB;AAUjD,2CAAyC,eAAe;AACxD,SAAO,qBAAqB;AAC9B;","names":["import_react","React","import_react"]}
@@ -1,4 +1,4 @@
1
- // src/react/ternSecureProvider.tsx
1
+ // src/react/ternSecureAuthProvider.tsx
2
2
  import { useContext } from "react";
3
3
 
4
4
  // src/react/ternsecureCtx.ts
@@ -24,13 +24,10 @@ var createContextAndHook = (displayName, options) => {
24
24
  return [Ctx, useCtx, useCtxWithoutGuarantee];
25
25
  };
26
26
 
27
- // src/react/ternSecureProvider.tsx
28
- var [TernSecureInstanceContext, useTernSecureInstanceContext] = createContextAndHook("TernSecureInstanceContext");
29
- var [TernSecureAuthContext, useTernSecureAuthContext] = createContextAndHook("TernSecureAuthContext");
30
- var [SessionContext, useSessionContext] = createContextAndHook("SessionContext");
31
- var [UserContext, useUserContext] = createContextAndHook("UserContext");
32
- function useAssertWrappedByTernSecureProvider(displayNameOrFn) {
33
- const ctx = useContext(TernSecureInstanceContext);
27
+ // src/react/ternSecureAuthProvider.tsx
28
+ var [TernSecureAuthCtx, useTernSecureAuthCtx] = createContextAndHook("TernSecureAuthCtx");
29
+ function useAssertWrappedByTernSecureAuthProvider(displayNameOrFn) {
30
+ const ctx = useContext(TernSecureAuthCtx);
34
31
  if (!ctx) {
35
32
  if (typeof displayNameOrFn === "function") {
36
33
  displayNameOrFn();
@@ -46,17 +43,14 @@ Possible fixes:
46
43
  }
47
44
  }
48
45
 
49
- // src/react/hooks/useTernSecure.ts
50
- var useTernSecure = () => {
51
- useAssertWrappedByTernSecureProvider("useTernSecure");
52
- return useTernSecureInstanceContext();
53
- };
54
-
55
- // src/react/ternSecureAuthProvider.tsx
46
+ // src/react/ternSecureProvider.tsx
56
47
  import { useContext as useContext2 } from "react";
57
- var [TernSecureAuthCtx, useTernSecureAuthCtx] = createContextAndHook("TernSecureAuthCtx");
58
- function useAssertWrappedByTernSecureAuthProvider(displayNameOrFn) {
59
- const ctx = useContext2(TernSecureAuthCtx);
48
+ var [TernSecureInstanceContext, useTernSecureInstanceContext] = createContextAndHook("TernSecureInstanceContext");
49
+ var [TernSecureAuthContext, useTernSecureAuthContext] = createContextAndHook("TernSecureAuthContext");
50
+ var [SessionContext, useSessionContext] = createContextAndHook("SessionContext");
51
+ var [UserContext, useUserContext] = createContextAndHook("UserContext");
52
+ function useAssertWrappedByTernSecureProvider(displayNameOrFn) {
53
+ const ctx = useContext2(TernSecureInstanceContext);
60
54
  if (!ctx) {
61
55
  if (typeof displayNameOrFn === "function") {
62
56
  displayNameOrFn();
@@ -71,6 +65,12 @@ Possible fixes:
71
65
  );
72
66
  }
73
67
  }
68
+
69
+ // src/react/hooks/useTernSecure.ts
70
+ var useTernSecure = () => {
71
+ useAssertWrappedByTernSecureAuthProvider("useTernSecure");
72
+ return useTernSecureAuthCtx();
73
+ };
74
74
  export {
75
75
  SessionContext,
76
76
  TernSecureAuthContext,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/ternSecureProvider.tsx","../../src/react/ternsecureCtx.ts","../../src/react/hooks/useTernSecure.ts","../../src/react/ternSecureAuthProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { \n TernSecureAuthProvider,\n TernSecureInstanceTree,\n TernSecureState,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\nexport type TernSecureAuthContextType = {\n authProvider: TernSecureAuthProvider | null | undefined;\n authState: TernSecureState;\n}\n\n\n// Create TernSecure instance context\nconst [TernSecureInstanceContext, useTernSecureInstanceContext] = \n createContextAndHook<TernSecureInstanceTree>('TernSecureInstanceContext');\n\nconst [TernSecureAuthContext, useTernSecureAuthContext] =\n createContextAndHook<TernSecureAuthContextType>('TernSecureAuthContext');\n\nconst [SessionContext, useSessionContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['session']>('SessionContext');\n\nconst [UserContext, useUserContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['user']>('UserContext');\n\n// Assert helper\nfunction useAssertWrappedByTernSecureProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureInstanceContext);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n\n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\nexport {\n TernSecureInstanceContext,\n TernSecureAuthContext,\n SessionContext,\n UserContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n useTernSecureInstanceContext,\n useAssertWrappedByTernSecureProvider\n};","'use client'\n\nimport React from 'react';\n\n/**\n * Assert that the context value exists, otherwise throw an error.\n *\n * @internal\n */\nexport function assertContextExists(contextVal: unknown, msgOrCtx: string | React.Context<any>): asserts contextVal {\n if (!contextVal) {\n throw typeof msgOrCtx === 'string' ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);\n }\n}\ntype Options = { assertCtxFn?: (v: unknown, msg: string) => void };\ntype ContextAndHook<T> = React.Context<{ value: T } | undefined>;\ntype UseCtxFn<T> = () => T;\n\n/**\n * Create and return a Context and two hooks that return the context value.\n * The Context type is derived from the type passed in by the user.\n *\n * The first hook returned guarantees that the context exists so the returned value is always `CtxValue`\n * The second hook makes no guarantees, so the returned value can be `CtxValue | undefined`\n *\n * @internal\n */\n\nexport const createContextAndHook = <CtxValue>(\n displayName: string,\n options?: Options,\n): [ContextAndHook<CtxValue>, UseCtxFn<CtxValue>, UseCtxFn<CtxValue | Partial<CtxValue>>] => {\n const { assertCtxFn = assertContextExists } = options || {};\n const Ctx = React.createContext<{ value: CtxValue } | undefined >(undefined);\n Ctx.displayName = displayName;\n\n const useCtx = () => {\n const ctx = React.useContext(Ctx);\n assertCtxFn(ctx, `${displayName} not found`);\n return (ctx as any).value as CtxValue;\n };\n\n const useCtxWithoutGuarantee = () => {\n const ctx = React.useContext(Ctx);\n return ctx ? ctx.value : {}\n };\n\n /**\n * Assert that the context value exists, otherwise throw an error.\n if (ctx === undefined) {\n throw new Error(`use${name} must be used within a ${name}Provider`);\n }\n return ctx.value;\n */\n\n return [Ctx, useCtx, useCtxWithoutGuarantee];\n}","import type { \n TernSecureInstanceTree\n} from \"@tern-secure/types\";\n\nimport { \n useAssertWrappedByTernSecureProvider, \n useTernSecureInstanceContext \n} from \"../ternSecureProvider\";\n\nexport const useTernSecure = (): TernSecureInstanceTree => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n \n useAssertWrappedByTernSecureProvider('useTernSecure');\n return useTernSecureInstanceContext();\n}","'use client'\n\nimport type { \n TernSecureAuth,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\n\nconst [TernSecureAuthCtx, useTernSecureAuthCtx] =\n createContextAndHook<TernSecureAuth>('TernSecureAuthCtx');\n\nfunction useAssertWrappedByTernSecureAuthProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureAuthCtx);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n \n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider,\n};"],"mappings":";AAOA,SAAS,kBAAkB;;;ACL3B,OAAO,WAAW;AAOX,SAAS,oBAAoB,YAAqB,UAA2D;AAClH,MAAI,CAAC,YAAY;AACf,UAAM,OAAO,aAAa,WAAW,IAAI,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG,SAAS,WAAW,YAAY;AAAA,EAC1G;AACF;AAeO,IAAM,uBAAuB,CAClC,aACA,YAC2F;AAC3F,QAAM,EAAE,cAAc,oBAAoB,IAAI,WAAW,CAAC;AAC1D,QAAM,MAAM,MAAM,cAAgD,MAAS;AAC3E,MAAI,cAAc;AAElB,QAAM,SAAS,MAAM;AACnB,UAAM,MAAM,MAAM,WAAW,GAAG;AAChC,gBAAY,KAAK,GAAG,WAAW,YAAY;AAC3C,WAAQ,IAAY;AAAA,EACtB;AAEA,QAAM,yBAAyB,MAAM;AACnC,UAAM,MAAM,MAAM,WAAW,GAAG;AAChC,WAAO,MAAM,IAAI,QAAQ,CAAC;AAAA,EAC5B;AAUA,SAAO,CAAC,KAAK,QAAQ,sBAAsB;AAC7C;;;ADtCA,IAAM,CAAC,2BAA2B,4BAA4B,IAC5D,qBAA6C,2BAA2B;AAE1E,IAAM,CAAC,uBAAuB,wBAAwB,IACpD,qBAAgD,uBAAuB;AAEzE,IAAM,CAAC,gBAAgB,iBAAiB,IACxC,qBAAgE,gBAAgB;AAEhF,IAAM,CAAC,aAAa,cAAc,IAClC,qBAA6D,aAAa;AAG1E,SAAS,qCAAqC,iBAA8C;AAE1F,QAAM,MAAM,WAAW,yBAAyB;AAEhD,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AExCO,IAAM,gBAAgB,MAA8B;AAUvD,uCAAqC,eAAe;AACpD,SAAO,6BAA6B;AACxC;;;AChBA,SAAS,cAAAA,mBAAkB;AAK3B,IAAM,CAAC,mBAAmB,oBAAoB,IAC5C,qBAAqC,mBAAmB;AAE1D,SAAS,yCAAyC,iBAA8C;AAE9F,QAAM,MAAMC,YAAW,iBAAiB;AAExC,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;","names":["useContext","useContext"]}
1
+ {"version":3,"sources":["../../src/react/ternSecureAuthProvider.tsx","../../src/react/ternsecureCtx.ts","../../src/react/ternSecureProvider.tsx","../../src/react/hooks/useTernSecure.ts"],"sourcesContent":["'use client'\n\nimport type { \n TernSecureAuth,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\n\nconst [TernSecureAuthCtx, useTernSecureAuthCtx] =\n createContextAndHook<TernSecureAuth>('TernSecureAuthCtx');\n\nfunction useAssertWrappedByTernSecureAuthProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureAuthCtx);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n \n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\n\nexport {\n TernSecureAuthCtx,\n useTernSecureAuthCtx,\n useAssertWrappedByTernSecureAuthProvider,\n};","'use client'\n\nimport React from 'react';\n\n/**\n * Assert that the context value exists, otherwise throw an error.\n *\n * @internal\n */\nexport function assertContextExists(contextVal: unknown, msgOrCtx: string | React.Context<any>): asserts contextVal {\n if (!contextVal) {\n throw typeof msgOrCtx === 'string' ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);\n }\n}\ntype Options = { assertCtxFn?: (v: unknown, msg: string) => void };\ntype ContextAndHook<T> = React.Context<{ value: T } | undefined>;\ntype UseCtxFn<T> = () => T;\n\n/**\n * Create and return a Context and two hooks that return the context value.\n * The Context type is derived from the type passed in by the user.\n *\n * The first hook returned guarantees that the context exists so the returned value is always `CtxValue`\n * The second hook makes no guarantees, so the returned value can be `CtxValue | undefined`\n *\n * @internal\n */\n\nexport const createContextAndHook = <CtxValue>(\n displayName: string,\n options?: Options,\n): [ContextAndHook<CtxValue>, UseCtxFn<CtxValue>, UseCtxFn<CtxValue | Partial<CtxValue>>] => {\n const { assertCtxFn = assertContextExists } = options || {};\n const Ctx = React.createContext<{ value: CtxValue } | undefined >(undefined);\n Ctx.displayName = displayName;\n\n const useCtx = () => {\n const ctx = React.useContext(Ctx);\n assertCtxFn(ctx, `${displayName} not found`);\n return (ctx as any).value as CtxValue;\n };\n\n const useCtxWithoutGuarantee = () => {\n const ctx = React.useContext(Ctx);\n return ctx ? ctx.value : {}\n };\n\n /**\n * Assert that the context value exists, otherwise throw an error.\n if (ctx === undefined) {\n throw new Error(`use${name} must be used within a ${name}Provider`);\n }\n return ctx.value;\n */\n\n return [Ctx, useCtx, useCtxWithoutGuarantee];\n}","'use client'\n\nimport type { \n TernSecureAuthProvider,\n TernSecureInstanceTree,\n TernSecureState,\n} from '@tern-secure/types';\nimport { useContext } from 'react';\n\nimport { createContextAndHook } from './ternsecureCtx';\n\nexport type TernSecureAuthContextType = {\n authProvider: TernSecureAuthProvider | null | undefined;\n authState: TernSecureState;\n}\n\n\n// Create TernSecure instance context\nconst [TernSecureInstanceContext, useTernSecureInstanceContext] = \n createContextAndHook<TernSecureInstanceTree>('TernSecureInstanceContext');\n\nconst [TernSecureAuthContext, useTernSecureAuthContext] =\n createContextAndHook<TernSecureAuthContextType>('TernSecureAuthContext');\n\nconst [SessionContext, useSessionContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['session']>('SessionContext');\n\nconst [UserContext, useUserContext] = \ncreateContextAndHook<TernSecureInstanceTree['auth']['user']>('UserContext');\n\n// Assert helper\nfunction useAssertWrappedByTernSecureProvider(displayNameOrFn: string | (() => void)): void {\n //const ctx = useTernSecureInstanceContext();\n const ctx = useContext(TernSecureInstanceContext);\n \n if (!ctx) {\n if (typeof displayNameOrFn === 'function') {\n displayNameOrFn();\n return;\n }\n\n throw new Error(\n `${displayNameOrFn} can only be used within the <TernSecureProvider /> component.\n \nPossible fixes:\n1. Ensure that the <TernSecureProvider /> is correctly wrapping your application\n2. Check for multiple versions of @tern-secure packages in your project`\n );\n }\n}\n\n\nexport {\n TernSecureInstanceContext,\n TernSecureAuthContext,\n SessionContext,\n UserContext,\n useTernSecureAuthContext,\n useSessionContext,\n useUserContext,\n useTernSecureInstanceContext,\n useAssertWrappedByTernSecureProvider\n};","import type { TernSecureAuth, TernSecureInstanceTree } from '@tern-secure/types';\n\nimport {\n useAssertWrappedByTernSecureAuthProvider,\n useTernSecureAuthCtx,\n} from '../ternSecureAuthProvider';\nimport {\n useAssertWrappedByTernSecureProvider,\n useTernSecureInstanceContext,\n} from '../ternSecureProvider';\n\n/**\n * @deprecated this was a previous version with cdn. now since in this package we dont use cdn, create a new hook that uuses TernSecureAuth and rename this to useTernSecure_Deprecated\n *\n */\nexport const useTernSecure_Deprecated = (): TernSecureInstanceTree => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n\n useAssertWrappedByTernSecureProvider('useTernSecure');\n return useTernSecureInstanceContext();\n};\n\n\n/**\n * New hook that uses TernSecureAuth\n */\nexport const useTernSecure = (): TernSecureAuth => {\n /**\n * if no assertion is needed, you can use the following:\n * const instance = useTernSecureInstanceContext();\n * if (!instance) {\n * throw new Error('useTernSecure must be used within a TernSecureProvider');\n * }\n * return instance;\n */\n\n useAssertWrappedByTernSecureAuthProvider('useTernSecure');\n return useTernSecureAuthCtx();\n};\n"],"mappings":";AAKA,SAAS,kBAAkB;;;ACH3B,OAAO,WAAW;AAOX,SAAS,oBAAoB,YAAqB,UAA2D;AAClH,MAAI,CAAC,YAAY;AACf,UAAM,OAAO,aAAa,WAAW,IAAI,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG,SAAS,WAAW,YAAY;AAAA,EAC1G;AACF;AAeO,IAAM,uBAAuB,CAClC,aACA,YAC2F;AAC3F,QAAM,EAAE,cAAc,oBAAoB,IAAI,WAAW,CAAC;AAC1D,QAAM,MAAM,MAAM,cAAgD,MAAS;AAC3E,MAAI,cAAc;AAElB,QAAM,SAAS,MAAM;AACnB,UAAM,MAAM,MAAM,WAAW,GAAG;AAChC,gBAAY,KAAK,GAAG,WAAW,YAAY;AAC3C,WAAQ,IAAY;AAAA,EACtB;AAEA,QAAM,yBAAyB,MAAM;AACnC,UAAM,MAAM,MAAM,WAAW,GAAG;AAChC,WAAO,MAAM,IAAI,QAAQ,CAAC;AAAA,EAC5B;AAUA,SAAO,CAAC,KAAK,QAAQ,sBAAsB;AAC7C;;;AD9CA,IAAM,CAAC,mBAAmB,oBAAoB,IAC5C,qBAAqC,mBAAmB;AAE1D,SAAS,yCAAyC,iBAA8C;AAE9F,QAAM,MAAM,WAAW,iBAAiB;AAExC,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AExBA,SAAS,cAAAA,mBAAkB;AAW3B,IAAM,CAAC,2BAA2B,4BAA4B,IAC5D,qBAA6C,2BAA2B;AAE1E,IAAM,CAAC,uBAAuB,wBAAwB,IACpD,qBAAgD,uBAAuB;AAEzE,IAAM,CAAC,gBAAgB,iBAAiB,IACxC,qBAAgE,gBAAgB;AAEhF,IAAM,CAAC,aAAa,cAAc,IAClC,qBAA6D,aAAa;AAG1E,SAAS,qCAAqC,iBAA8C;AAE1F,QAAM,MAAMC,YAAW,yBAAyB;AAEhD,MAAI,CAAC,KAAK;AACR,QAAI,OAAO,oBAAoB,YAAY;AACzC,sBAAgB;AAChB;AAAA,IACF;AAEA,UAAM,IAAI;AAAA,MACR,GAAG,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,IAKpB;AAAA,EACF;AACF;;;AChBO,IAAM,gBAAgB,MAAsB;AAUjD,2CAAyC,eAAe;AACxD,SAAO,qBAAqB;AAC9B;","names":["useContext","useContext"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tern-secure/shared",
3
- "version": "1.3.0-canary.v20251008131428",
3
+ "version": "1.3.0-canary.v20251019190011",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/TernSecure/auth.git",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "js-cookie": "^3.0.5",
83
83
  "tslib": "2.4.1",
84
- "@tern-secure/types": "1.1.0-canary.v20251008131428"
84
+ "@tern-secure/types": "1.1.0-canary.v20251019190011"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "react": "^19",