@tern-secure/auth 1.1.0-canary.v20251108045933 → 1.1.0-canary.v20251125170702

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 (275) hide show
  1. package/dist/492_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  2. package/dist/687_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  3. package/dist/68_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  4. package/dist/framework_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  5. package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
  6. package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  7. package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
  8. package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  9. package/dist/ternsecure.browser.js +30 -0
  10. package/dist/ternsecure.css +2 -0
  11. package/dist/ternsecure.js +17 -0
  12. package/dist/ternsecure.mjs +17 -0
  13. package/dist/types/auth/AuthCookieManager.d.ts +0 -1
  14. package/dist/types/auth/cookies/authTime_cookie.d.ts +0 -1
  15. package/dist/types/index.browser.d.ts +1 -0
  16. package/dist/types/index.d.ts +3 -10
  17. package/dist/types/instance/c_coreApiClient.d.ts +2 -2
  18. package/dist/types/instance/constants.d.ts +3 -0
  19. package/dist/types/instance/coreApiClient.d.ts +0 -1
  20. package/dist/types/instance/events.d.ts +0 -1
  21. package/dist/types/instance/{TernAuth.d.ts → ternsecure.d.ts} +31 -7
  22. package/dist/types/lib/utils.d.ts +2 -0
  23. package/dist/types/resources/Base.d.ts +16 -3
  24. package/dist/types/resources/Error.d.ts +0 -1
  25. package/dist/types/resources/Session.d.ts +2 -2
  26. package/dist/types/resources/SignIn.d.ts +27 -10
  27. package/dist/types/resources/SignUp.d.ts +12 -10
  28. package/dist/types/resources/internal.d.ts +1 -2
  29. package/dist/types/ui/Renderer.d.ts +26 -0
  30. package/dist/types/ui/common/ProviderInitialIcon.d.ts +6 -0
  31. package/dist/types/ui/common/VerificationCodeCard.d.ts +12 -0
  32. package/dist/types/ui/common/VerificationLinkCard.d.ts +7 -0
  33. package/dist/types/ui/common/constants.d.ts +8 -0
  34. package/dist/types/ui/common/index.d.ts +3 -0
  35. package/dist/types/ui/components/sign-in/ResetPassword.d.ts +1 -0
  36. package/dist/types/ui/components/sign-in/ResetPasswordSuccess.d.ts +1 -0
  37. package/dist/types/ui/components/sign-in/SignIn.d.ts +4 -0
  38. package/dist/types/ui/components/sign-in/SignInEmailLinkCard.d.ts +2 -0
  39. package/dist/types/ui/components/sign-in/SignInFactorOne.d.ts +1 -0
  40. package/dist/types/ui/components/sign-in/SignInFactorOneCodeForm.d.ts +7 -0
  41. package/dist/types/ui/components/sign-in/SignInFactorOnePasswordCard.d.ts +6 -0
  42. package/dist/types/ui/components/sign-in/SignInFactorOnePhoneCodeCard.d.ts +7 -0
  43. package/dist/types/ui/components/sign-in/SignInPassword.d.ts +8 -0
  44. package/dist/types/ui/components/sign-in/SignInSocialButtons.d.ts +1 -0
  45. package/dist/types/ui/components/sign-in/SignInStart.d.ts +7 -0
  46. package/dist/types/ui/components/sign-in/SignInVerifyEmail.d.ts +1 -0
  47. package/dist/types/ui/components/sign-in/index.d.ts +4 -0
  48. package/dist/types/ui/components/sign-up/SignUp.d.ts +8 -0
  49. package/dist/types/ui/components/sign-up/SignUpEmailLinkCard.d.ts +2 -0
  50. package/dist/types/ui/components/sign-up/SignUpSocialButtons.d.ts +1 -0
  51. package/dist/types/ui/components/sign-up/SignUpStart.d.ts +1 -0
  52. package/dist/types/ui/components/sign-up/SignUpVerifyEmail.d.ts +1 -0
  53. package/dist/types/ui/components/sign-up/index.d.ts +2 -0
  54. package/dist/types/ui/components/sign-up/util.d.ts +14 -0
  55. package/dist/types/ui/components/user-button/index.d.ts +1 -0
  56. package/dist/types/ui/components/user-button/userButton.d.ts +1 -0
  57. package/dist/types/ui/ctx/TernAuthContext.d.ts +4 -0
  58. package/dist/types/ui/ctx/TernAuthUIComponentCtx.d.ts +8 -0
  59. package/dist/types/ui/ctx/TernSecureContextWrapper.d.ts +8 -0
  60. package/dist/types/ui/ctx/TernSecureOptions.d.ts +10 -0
  61. package/dist/types/ui/ctx/components/SignIn.d.ts +21 -0
  62. package/dist/types/ui/ctx/components/SignUp.d.ts +14 -0
  63. package/dist/types/ui/ctx/components/UserButton.d.ts +10 -0
  64. package/dist/types/ui/ctx/components/index.d.ts +3 -0
  65. package/dist/types/ui/ctx/index.d.ts +4 -0
  66. package/dist/types/ui/ctx/utils.d.ts +3 -0
  67. package/dist/types/ui/customize/FieldControl.d.ts +15 -0
  68. package/dist/types/ui/customize/FieldLabelControl.d.ts +11 -0
  69. package/dist/types/ui/customize/Form.d.ts +36 -0
  70. package/dist/types/ui/elements/CodeControl.d.ts +47 -0
  71. package/dist/types/ui/elements/ErrorCard.d.ts +10 -0
  72. package/dist/types/ui/elements/LoadingCard.d.ts +1 -0
  73. package/dist/types/ui/elements/RouterLink.d.ts +42 -0
  74. package/dist/types/ui/elements/SocialButtons.d.ts +6 -0
  75. package/dist/types/ui/elements/TimerButton.d.ts +9 -0
  76. package/dist/types/ui/elements/alert.d.ts +8 -0
  77. package/dist/types/ui/elements/avatar.d.ts +6 -0
  78. package/dist/types/ui/elements/button.d.ts +10 -0
  79. package/dist/types/ui/elements/card.d.ts +9 -0
  80. package/dist/types/ui/elements/ctx/CardStateCtx.d.ts +26 -0
  81. package/dist/types/ui/elements/ctx/index.d.ts +1 -0
  82. package/dist/types/ui/elements/field.d.ts +24 -0
  83. package/dist/types/ui/elements/index.d.ts +16 -0
  84. package/dist/types/ui/elements/input.d.ts +3 -0
  85. package/dist/types/ui/elements/label.d.ts +4 -0
  86. package/dist/types/ui/elements/separator.d.ts +4 -0
  87. package/dist/types/ui/hooks/index.d.ts +6 -0
  88. package/dist/types/ui/hooks/useEmailLink.d.ts +11 -0
  89. package/dist/types/ui/hooks/useFetch.d.ts +44 -0
  90. package/dist/types/ui/hooks/useLoadingStatus.d.ts +14 -0
  91. package/dist/types/ui/hooks/useNavigateToFlowStart.d.ts +3 -0
  92. package/dist/types/ui/hooks/useSafeState.d.ts +9 -0
  93. package/dist/types/ui/hooks/useWindowEventListener.d.ts +3 -0
  94. package/dist/types/ui/icons/index.d.ts +13 -0
  95. package/dist/types/ui/lazyLoading/common.d.ts +2 -0
  96. package/dist/types/ui/lazyLoading/components.d.ts +11 -0
  97. package/dist/types/ui/lazyLoading/providersCtx.d.ts +26 -0
  98. package/dist/types/ui/portal/index.d.ts +12 -0
  99. package/dist/types/ui/router/BaseRouter.d.ts +21 -0
  100. package/dist/types/ui/router/HashRouter.d.ts +8 -0
  101. package/dist/types/ui/router/PathRouter.d.ts +8 -0
  102. package/dist/types/ui/router/Route.d.ts +19 -0
  103. package/dist/types/ui/router/RouterCtx.d.ts +32 -0
  104. package/dist/types/ui/router/Switch.d.ts +4 -0
  105. package/dist/types/ui/router/index.d.ts +7 -0
  106. package/dist/types/ui/router/newPaths.d.ts +1 -0
  107. package/dist/types/ui/router/pathToRegexp.d.ts +127 -0
  108. package/dist/types/ui/types.d.ts +18 -0
  109. package/dist/types/ui/utils/form.d.ts +19 -0
  110. package/dist/types/ui/utils/index.d.ts +1 -0
  111. package/dist/types/ui/utils/sleep.d.ts +1 -0
  112. package/dist/types/utils/construct.d.ts +3 -1
  113. package/dist/types/utils/index.d.ts +1 -1
  114. package/dist/types/utils/normalizeRoutingOptions.d.ts +6 -0
  115. package/dist/types/utils/path.d.ts +0 -1
  116. package/dist/types/utils/querystring.d.ts +0 -1
  117. package/dist/types/utils/redirectUrls.d.ts +4 -9
  118. package/dist/types/utils/windowNavigate.d.ts +0 -1
  119. package/dist/ui-common_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  120. package/dist/userbutton_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  121. package/dist/vendors_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
  122. package/package.json +63 -24
  123. package/dist/cjs/auth/AuthCookieManager.js +0 -113
  124. package/dist/cjs/auth/AuthCookieManager.js.map +0 -1
  125. package/dist/cjs/auth/cookies/authTime_cookie.js +0 -62
  126. package/dist/cjs/auth/cookies/authTime_cookie.js.map +0 -1
  127. package/dist/cjs/auth/request.js +0 -159
  128. package/dist/cjs/auth/request.js.map +0 -1
  129. package/dist/cjs/global.d.js +0 -2
  130. package/dist/cjs/global.d.js.map +0 -1
  131. package/dist/cjs/index.js +0 -47
  132. package/dist/cjs/index.js.map +0 -1
  133. package/dist/cjs/instance/TernAuth.js +0 -524
  134. package/dist/cjs/instance/TernAuth.js.map +0 -1
  135. package/dist/cjs/instance/TernAuthServer.js +0 -95
  136. package/dist/cjs/instance/TernAuthServer.js.map +0 -1
  137. package/dist/cjs/instance/c_coreApiClient.js +0 -264
  138. package/dist/cjs/instance/c_coreApiClient.js.map +0 -1
  139. package/dist/cjs/instance/coreApiClient.js +0 -255
  140. package/dist/cjs/instance/coreApiClient.js.map +0 -1
  141. package/dist/cjs/instance/events.js +0 -39
  142. package/dist/cjs/instance/events.js.map +0 -1
  143. package/dist/cjs/instance/jwtClient.js +0 -72
  144. package/dist/cjs/instance/jwtClient.js.map +0 -1
  145. package/dist/cjs/resources/Base.js +0 -137
  146. package/dist/cjs/resources/Base.js.map +0 -1
  147. package/dist/cjs/resources/Error.js +0 -31
  148. package/dist/cjs/resources/Error.js.map +0 -1
  149. package/dist/cjs/resources/Session.js +0 -105
  150. package/dist/cjs/resources/Session.js.map +0 -1
  151. package/dist/cjs/resources/SignIn.js +0 -256
  152. package/dist/cjs/resources/SignIn.js.map +0 -1
  153. package/dist/cjs/resources/SignUp.js +0 -72
  154. package/dist/cjs/resources/SignUp.js.map +0 -1
  155. package/dist/cjs/resources/Token.js +0 -32
  156. package/dist/cjs/resources/Token.js.map +0 -1
  157. package/dist/cjs/resources/UserData.js +0 -43
  158. package/dist/cjs/resources/UserData.js.map +0 -1
  159. package/dist/cjs/resources/cookie.js +0 -154
  160. package/dist/cjs/resources/cookie.js.map +0 -1
  161. package/dist/cjs/resources/index.js +0 -23
  162. package/dist/cjs/resources/index.js.map +0 -1
  163. package/dist/cjs/resources/internal.js +0 -35
  164. package/dist/cjs/resources/internal.js.map +0 -1
  165. package/dist/cjs/utils/construct.js +0 -253
  166. package/dist/cjs/utils/construct.js.map +0 -1
  167. package/dist/cjs/utils/index.js +0 -29
  168. package/dist/cjs/utils/index.js.map +0 -1
  169. package/dist/cjs/utils/jwt.js +0 -46
  170. package/dist/cjs/utils/jwt.js.map +0 -1
  171. package/dist/cjs/utils/mapDecode.js +0 -33
  172. package/dist/cjs/utils/mapDecode.js.map +0 -1
  173. package/dist/cjs/utils/path.js +0 -33
  174. package/dist/cjs/utils/path.js.map +0 -1
  175. package/dist/cjs/utils/querystring.js +0 -70
  176. package/dist/cjs/utils/querystring.js.map +0 -1
  177. package/dist/cjs/utils/redirectUrls.js +0 -156
  178. package/dist/cjs/utils/redirectUrls.js.map +0 -1
  179. package/dist/cjs/utils/windowNavigate.js +0 -45
  180. package/dist/cjs/utils/windowNavigate.js.map +0 -1
  181. package/dist/esm/auth/AuthCookieManager.js +0 -89
  182. package/dist/esm/auth/AuthCookieManager.js.map +0 -1
  183. package/dist/esm/auth/cookies/authTime_cookie.js +0 -38
  184. package/dist/esm/auth/cookies/authTime_cookie.js.map +0 -1
  185. package/dist/esm/auth/request.js +0 -134
  186. package/dist/esm/auth/request.js.map +0 -1
  187. package/dist/esm/global.d.js +0 -1
  188. package/dist/esm/global.d.js.map +0 -1
  189. package/dist/esm/index.js +0 -16
  190. package/dist/esm/index.js.map +0 -1
  191. package/dist/esm/instance/TernAuth.js +0 -510
  192. package/dist/esm/instance/TernAuth.js.map +0 -1
  193. package/dist/esm/instance/TernAuthServer.js +0 -73
  194. package/dist/esm/instance/TernAuthServer.js.map +0 -1
  195. package/dist/esm/instance/c_coreApiClient.js +0 -236
  196. package/dist/esm/instance/c_coreApiClient.js.map +0 -1
  197. package/dist/esm/instance/coreApiClient.js +0 -226
  198. package/dist/esm/instance/coreApiClient.js.map +0 -1
  199. package/dist/esm/instance/events.js +0 -14
  200. package/dist/esm/instance/events.js.map +0 -1
  201. package/dist/esm/instance/jwtClient.js +0 -47
  202. package/dist/esm/instance/jwtClient.js.map +0 -1
  203. package/dist/esm/resources/Base.js +0 -113
  204. package/dist/esm/resources/Base.js.map +0 -1
  205. package/dist/esm/resources/Error.js +0 -9
  206. package/dist/esm/resources/Error.js.map +0 -1
  207. package/dist/esm/resources/Session.js +0 -81
  208. package/dist/esm/resources/Session.js.map +0 -1
  209. package/dist/esm/resources/SignIn.js +0 -240
  210. package/dist/esm/resources/SignIn.js.map +0 -1
  211. package/dist/esm/resources/SignUp.js +0 -48
  212. package/dist/esm/resources/SignUp.js.map +0 -1
  213. package/dist/esm/resources/Token.js +0 -8
  214. package/dist/esm/resources/Token.js.map +0 -1
  215. package/dist/esm/resources/UserData.js +0 -19
  216. package/dist/esm/resources/UserData.js.map +0 -1
  217. package/dist/esm/resources/cookie.js +0 -130
  218. package/dist/esm/resources/cookie.js.map +0 -1
  219. package/dist/esm/resources/index.js +0 -2
  220. package/dist/esm/resources/index.js.map +0 -1
  221. package/dist/esm/resources/internal.js +0 -8
  222. package/dist/esm/resources/internal.js.map +0 -1
  223. package/dist/esm/utils/construct.js +0 -215
  224. package/dist/esm/utils/construct.js.map +0 -1
  225. package/dist/esm/utils/index.js +0 -5
  226. package/dist/esm/utils/index.js.map +0 -1
  227. package/dist/esm/utils/jwt.js +0 -22
  228. package/dist/esm/utils/jwt.js.map +0 -1
  229. package/dist/esm/utils/mapDecode.js +0 -9
  230. package/dist/esm/utils/mapDecode.js.map +0 -1
  231. package/dist/esm/utils/path.js +0 -9
  232. package/dist/esm/utils/path.js.map +0 -1
  233. package/dist/esm/utils/querystring.js +0 -45
  234. package/dist/esm/utils/querystring.js.map +0 -1
  235. package/dist/esm/utils/redirectUrls.js +0 -132
  236. package/dist/esm/utils/redirectUrls.js.map +0 -1
  237. package/dist/esm/utils/windowNavigate.js +0 -19
  238. package/dist/esm/utils/windowNavigate.js.map +0 -1
  239. package/dist/types/auth/AuthCookieManager.d.ts.map +0 -1
  240. package/dist/types/auth/cookies/authTime_cookie.d.ts.map +0 -1
  241. package/dist/types/auth/request.d.ts +0 -49
  242. package/dist/types/auth/request.d.ts.map +0 -1
  243. package/dist/types/index.d.ts.map +0 -1
  244. package/dist/types/instance/TernAuth.d.ts.map +0 -1
  245. package/dist/types/instance/TernAuthServer.d.ts +0 -32
  246. package/dist/types/instance/TernAuthServer.d.ts.map +0 -1
  247. package/dist/types/instance/c_coreApiClient.d.ts.map +0 -1
  248. package/dist/types/instance/coreApiClient.d.ts.map +0 -1
  249. package/dist/types/instance/events.d.ts.map +0 -1
  250. package/dist/types/instance/jwtClient.d.ts +0 -22
  251. package/dist/types/instance/jwtClient.d.ts.map +0 -1
  252. package/dist/types/resources/Base.d.ts.map +0 -1
  253. package/dist/types/resources/Error.d.ts.map +0 -1
  254. package/dist/types/resources/Session.d.ts.map +0 -1
  255. package/dist/types/resources/SignIn.d.ts.map +0 -1
  256. package/dist/types/resources/SignUp.d.ts.map +0 -1
  257. package/dist/types/resources/Token.d.ts +0 -5
  258. package/dist/types/resources/Token.d.ts.map +0 -1
  259. package/dist/types/resources/UserData.d.ts +0 -8
  260. package/dist/types/resources/UserData.d.ts.map +0 -1
  261. package/dist/types/resources/cookie.d.ts +0 -24
  262. package/dist/types/resources/cookie.d.ts.map +0 -1
  263. package/dist/types/resources/index.d.ts +0 -2
  264. package/dist/types/resources/index.d.ts.map +0 -1
  265. package/dist/types/resources/internal.d.ts.map +0 -1
  266. package/dist/types/utils/construct.d.ts.map +0 -1
  267. package/dist/types/utils/index.d.ts.map +0 -1
  268. package/dist/types/utils/jwt.d.ts +0 -12
  269. package/dist/types/utils/jwt.d.ts.map +0 -1
  270. package/dist/types/utils/mapDecode.d.ts +0 -4
  271. package/dist/types/utils/mapDecode.d.ts.map +0 -1
  272. package/dist/types/utils/path.d.ts.map +0 -1
  273. package/dist/types/utils/querystring.d.ts.map +0 -1
  274. package/dist/types/utils/redirectUrls.d.ts.map +0 -1
  275. package/dist/types/utils/windowNavigate.d.ts.map +0 -1
@@ -39,4 +39,3 @@ export declare class AuthCookieManager {
39
39
  clearAuth(): void;
40
40
  }
41
41
  export {};
42
- //# sourceMappingURL=AuthCookieManager.d.ts.map
@@ -4,4 +4,3 @@ export type TernAUTCookie = {
4
4
  initialize: () => void;
5
5
  };
6
6
  export declare const createTernAUT: () => TernAUTCookie;
7
- //# sourceMappingURL=authTime_cookie.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,3 @@
1
- export { TernSecureAuth } from './instance/TernAuth';
2
- export type { TernAuth } from './instance/TernAuth';
3
- export { TernServerAuth } from './instance/TernAuthServer';
4
- export type { TernServerAuthOptions, AuthenticatedApp } from './instance/TernAuthServer';
5
- export { CoreApiClient, coreApiClient } from './instance/coreApiClient';
6
- export type { ApiResponse, ApiResponseJSON, RequestOptions, BeforeRequestHook, AfterResponseHook } from './instance/coreApiClient';
7
- export { SignIn, TernSecureBase, buildURL } from './resources/internal';
8
- export type { AuthErrorTree, TernSecureConfig, SignInFormValues, SignInProps, SignUpProps, SignInResponse, SignInForceRedirectUrl, SignUpForceRedirectUrl, SignInFallbackRedirectUrl, SignUpFallbackRedirectUrl, ResendEmailVerification, TernSecureUser, TernSecureState } from '@tern-secure/types';
9
- export { RedirectUrls } from './utils/redirectUrls';
10
- //# sourceMappingURL=index.d.ts.map
1
+ import 'regenerator-runtime/runtime';
2
+ import { TernSecureAuth } from './instance/ternsecure';
3
+ export { TernSecureAuth };
@@ -4,6 +4,7 @@ export type ApiRequestInit = RequestInit & {
4
4
  path?: string;
5
5
  search?: ConstructorParameters<typeof URLSearchParams>[0];
6
6
  sessionId?: string;
7
+ pathPrefix?: string;
7
8
  url?: URL;
8
9
  };
9
10
  export interface ApiResponseJSON<T> {
@@ -24,7 +25,7 @@ export interface ApiRequestOptions {
24
25
  recoveryTimeoutMs?: number;
25
26
  }
26
27
  export interface ApiClientOptions {
27
- domain?: string;
28
+ authDomain?: string;
28
29
  apiUrl?: string;
29
30
  frontendApi?: string;
30
31
  instanceType?: InstanceType;
@@ -55,4 +56,3 @@ export declare class HTTPError extends Error {
55
56
  constructor(status: number, url: string, body?: any | undefined);
56
57
  }
57
58
  export declare function createCoreApiClient(clientOptions: ApiClientOptions): ApiClient;
58
- //# sourceMappingURL=c_coreApiClient.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const PRESERVED_QUERYSTRING_PARAMS: string[];
2
+ export declare const SIGN_IN_INITIAL_VALUE_KEYS: string[];
3
+ export declare const SIGN_UP_INITIAL_VALUE_KEYS: string[];
@@ -62,4 +62,3 @@ export declare class CoreApiClient {
62
62
  request<T>(init: ApiRequestInit, opts?: RequestOptions): Promise<ApiResponse<T>>;
63
63
  }
64
64
  export declare const coreApiClient: CoreApiClient;
65
- //# sourceMappingURL=coreApiClient.d.ts.map
@@ -29,4 +29,3 @@ export declare const eventBus: {
29
29
  getListeners: <Event extends keyof InternalEvents>(event: Event) => Array<(...args: any[]) => void>;
30
30
  };
31
31
  export {};
32
- //# sourceMappingURL=events.d.ts.map
@@ -1,9 +1,20 @@
1
- import type { CreateActiveSession, InstanceType, ListenerCallback, NavigateOptions, SessionResource, SignedInSession, SignInRedirectOptions, SignInResource, SignOut, SignUpRedirectOptions, SignUpResource, TernAuthSDK, TernSecureAuth as TernSecureAuthInterface, TernSecureAuthOptions, TernSecureUser, UnsubscribeCallback } from '@tern-secure/types';
1
+ import type { CreateActiveSession, DomainOrProxyUrl, InstanceType, ListenerCallback, NavigateOptions, SessionResource, SignedInSession, SignInProps, SignInRedirectOptions, SignInResource, SignOut, SignUpProps, SignUpRedirectOptions, SignUpResource, TernAuthSDK, TernSecureAuth as TernSecureAuthInterface, TernSecureAuthOptions, TernSecureUser, UnsubscribeCallback } from '@tern-secure/types';
2
2
  import type { Auth as TernAuth } from 'firebase/auth';
3
3
  import { AuthCookieManager } from '../resources/internal';
4
+ import type { MountComponentRenderer } from '../ui/Renderer';
4
5
  import { type ApiClient } from './c_coreApiClient';
5
6
  export declare function inBrowser(): boolean;
6
7
  export { TernAuth };
8
+ declare global {
9
+ interface Window {
10
+ TernSecure?: TernSecureAuth;
11
+ apiKey?: string;
12
+ apiUrl?: string;
13
+ authDomain: TernSecureAuthInterface['authDomain'];
14
+ frontEndDomain?: TernSecureAuthInterface['frontEndDomain'];
15
+ proxyUrl?: TernSecureAuthInterface['proxyUrl'];
16
+ }
17
+ }
7
18
  /**
8
19
  * Firebase implementation of the TernSecureAuth interface
9
20
  */
@@ -11,6 +22,7 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
11
22
  #private;
12
23
  static version: string;
13
24
  static sdkMetadata: TernAuthSDK;
25
+ static mountComponentRenderer?: MountComponentRenderer;
14
26
  private static instance;
15
27
  private _currentUser;
16
28
  private signedInSession;
@@ -22,6 +34,9 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
22
34
  error: Error | null;
23
35
  user: TernSecureUser | null | undefined;
24
36
  __internal_country?: string | null;
37
+ customDomain?: string | undefined;
38
+ isVisible: boolean;
39
+ currentView: 'signIn' | 'signUp' | null;
25
40
  signIn: SignInResource | null | undefined;
26
41
  signUp: SignUpResource | null | undefined;
27
42
  session: SessionResource | null | undefined;
@@ -31,20 +46,29 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
31
46
  set sdkMetadata(metadata: TernAuthSDK);
32
47
  get sdkMetadata(): TernAuthSDK;
33
48
  get requiresVerification(): boolean;
49
+ load: (options?: TernSecureAuthOptions) => Promise<void>;
50
+ __unstable__updateProps: (_props: any) => Promise<void> | undefined;
51
+ assertComponentControlsReady(controls: unknown): asserts controls is ReturnType<MountComponentRenderer>;
52
+ showSignIn(node: HTMLDivElement, props?: SignInProps): void;
53
+ hideSignIn(node: HTMLDivElement): void;
54
+ showSignUp(node: HTMLDivElement, props?: SignUpProps): void;
55
+ hideSignUp(node: HTMLDivElement): void;
56
+ showUserButton(node: HTMLDivElement): void;
57
+ hideUserButton(node: HTMLDivElement): void;
34
58
  get apiUrl(): string;
35
- get domain(): string;
59
+ get authDomain(): string;
36
60
  get instanceType(): InstanceType | undefined;
37
- constructor(options?: TernSecureAuthOptions);
61
+ constructor(apiUrl: string, options?: DomainOrProxyUrl);
38
62
  getApiClient: () => ApiClient;
39
63
  setLoading(isLoading: boolean): void;
40
64
  authCookieManager(): AuthCookieManager | undefined;
41
65
  _internal_getOption<K extends keyof TernSecureAuthOptions>(key: K): TernSecureAuthOptions[K];
42
66
  _internal_getAllOptions(): Readonly<TernSecureAuthOptions>;
43
- static getOrCreateInstance(options?: TernSecureAuthOptions): TernSecureAuth;
67
+ static getOrCreateInstance(apiUrl: string, options?: DomainOrProxyUrl): TernSecureAuth;
44
68
  static clearInstance(): void;
45
- static initialize(options: TernSecureAuthOptions): TernSecureAuth;
69
+ static initialize(options?: TernSecureAuthOptions): TernSecureAuth;
46
70
  initialize: (options?: TernSecureAuthOptions) => Promise<void>;
47
- static create(options: TernSecureAuthOptions): TernSecureAuth;
71
+ static create(options?: TernSecureAuthOptions): TernSecureAuth;
48
72
  private initializeFirebaseApp;
49
73
  signOut: SignOut;
50
74
  get currentSession(): SignedInSession | null;
@@ -63,6 +87,7 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
63
87
  createActiveSession: CreateActiveSession;
64
88
  navigate: (to: string | undefined, options?: NavigateOptions) => Promise<unknown>;
65
89
  constructUrlWithAuthRedirect: (to: string) => string;
90
+ constructAfterSignOutUrl: () => string;
66
91
  redirectToSignIn: (options?: SignInRedirectOptions) => Promise<unknown>;
67
92
  redirectToSignUp: (options?: SignUpRedirectOptions) => Promise<unknown>;
68
93
  redirectAfterSignIn: () => Promise<unknown>;
@@ -71,4 +96,3 @@ export declare class TernSecureAuth implements TernSecureAuthInterface {
71
96
  constructSignUpUrl: (options?: SignUpRedirectOptions) => string;
72
97
  __internal_setCountry: (country: string | null) => void;
73
98
  }
74
- //# sourceMappingURL=TernAuth.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -1,3 +1,4 @@
1
+ import type { TernSecureResourceJSON } from '@tern-secure/types';
1
2
  import type { ApiRequestInit, ApiResponseJSON } from '../instance/coreApiClient';
2
3
  import type { AuthCookieManager, TernSecureAuth } from './internal';
3
4
  export type HTTPMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
@@ -8,16 +9,27 @@ export type PostMutateParams = {
8
9
  path?: string;
9
10
  search?: ConstructorParameters<typeof URLSearchParams>[0];
10
11
  };
12
+ export type BaseMutateParams = {
13
+ action?: string;
14
+ body?: any;
15
+ method?: HTTPMethod;
16
+ path?: string;
17
+ };
11
18
  export declare abstract class TernSecureBase {
12
19
  static ternsecure: TernSecureAuth;
20
+ id?: string;
21
+ pathRoot: string;
13
22
  static get apiClient(): import("../instance/c_coreApiClient").ApiClient;
14
23
  static get authCookieManager(): AuthCookieManager | undefined;
15
24
  protected get authCookieManager(): AuthCookieManager | undefined;
25
+ isNew(): boolean;
16
26
  /**
17
27
  * Core method to fetch data from API endpoints using coreApiClient
18
28
  * This method handles the complete request lifecycle including error handling
19
29
  */
20
- protected static fetchFromCoreApi<J>(requestInit: ApiRequestInit): Promise<ApiResponseJSON<J> | null>;
30
+ protected static _baseFetchFromCoreApi<J extends TernSecureResourceJSON | null>(requestInit: ApiRequestInit): Promise<ApiResponseJSON<J> | null>;
31
+ protected path(action?: string): string;
32
+ protected abstract fromJSON(data: TernSecureResourceJSON | null): this;
21
33
  /**
22
34
  * Convenience method for making POST requests
23
35
  */
@@ -25,11 +37,12 @@ export declare abstract class TernSecureBase {
25
37
  /**
26
38
  * Instance method to fetch data from API endpoints
27
39
  */
28
- protected fetchFromCoreApi(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
40
+ protected _fetchFromCoreApi<J extends TernSecureResourceJSON>(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
29
41
  /**
30
42
  * Instance method for making POST requests
31
43
  */
32
44
  protected basePost(params: PostMutateParams): Promise<ApiResponseJSON<any> | null>;
45
+ protected _baseMutate<J extends TernSecureResourceJSON>(params?: BaseMutateParams): Promise<this>;
33
46
  /**
34
47
  * Instance method to make GET requests
35
48
  * This is a convenience method that sets the HTTP method to GET
@@ -40,8 +53,8 @@ export declare abstract class TernSecureBase {
40
53
  * This is designed to be used by child classes like SignIn
41
54
  */
42
55
  protected _post(params: PostMutateParams): Promise<ApiResponseJSON<any> | null>;
56
+ protected _basePost<J extends TernSecureResourceJSON>(params?: BaseMutateParams): Promise<this>;
43
57
  static makeApiRequest(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
44
58
  protected makeApiRequest(requestInit: ApiRequestInit): Promise<ApiResponseJSON<any> | null>;
45
59
  private static shouldRethrowofflineNetworkError;
46
60
  }
47
- //# sourceMappingURL=Base.d.ts.map
@@ -1,2 +1 @@
1
1
  export { TernSecureAPIResponseError, TernSecureRuntimeError, } from "@tern-secure/shared/errors-api";
2
- //# sourceMappingURL=Error.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { IdTokenResult, SessionJson, SessionResource, SessionStatus, TernSecureUser } from '@tern-secure/types';
1
+ import type { IdTokenResult, SessionJson, SessionResource, SessionStatus, TernSecureResourceJSON, TernSecureUser } from '@tern-secure/types';
2
2
  import { TernSecureBase } from './Base';
3
3
  /**
4
4
  * Enhanced Session class that handles custom token authentication for client-server sync.
@@ -45,5 +45,5 @@ export declare class Session extends TernSecureBase implements SessionResource {
45
45
  * Convert session to plain object for serialization
46
46
  */
47
47
  toJSON(): SessionJson;
48
+ protected fromJSON(data: SessionJson | TernSecureResourceJSON | null): this;
48
49
  }
49
- //# sourceMappingURL=Session.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { ResendEmailVerification, SignInFormValues, SignInResource, SignInResponse as SignInResponseFromTypes, SignInStatus, SocialProviderOptions } from '@tern-secure/types';
2
- import type { Auth, UserCredential } from 'firebase/auth';
1
+ import type { AttemptFirstFactorParams, SignInCreateParams, SignInFirstFactor, SignInJson, SignInPasswordParams, SignInPhoneParams, SignInResource, SignInResponse as SignInResponseFromTypes, SignInStatus, SignInVerificationResponse, SocialProviderOptions, TernSecureUser } from '@tern-secure/types';
2
+ import type { ApplicationVerifier, Auth, UserCredential } from 'firebase/auth';
3
3
  import { TernSecureBase } from './Base';
4
4
  type SignInResponse = SignInResponseFromTypes;
5
5
  export type TernRequestInit = RequestInit;
@@ -13,18 +13,35 @@ export type SignInParams = {
13
13
  export type SupportedProvider = 'google' | 'apple' | 'microsoft' | 'github' | 'twitter' | 'facebook' | string;
14
14
  export declare class SignIn extends TernSecureBase implements SignInResource {
15
15
  pathRoot: string;
16
+ pathSessionRoot: string;
17
+ id?: string;
16
18
  status: SignInStatus | null;
19
+ supportedFirstFactors: SignInFirstFactor[] | null;
20
+ identifier: string | null;
17
21
  private auth;
18
22
  private csrfToken;
19
23
  private _currentUser;
20
- constructor(auth: Auth, csrfToken: string | undefined);
21
- signInWithCredential: (credential: UserCredential) => Promise<import("..").ApiResponseJSON<any> | null>;
22
- withEmailAndPassword: (params: SignInFormValues) => Promise<SignInResponse>;
23
- withCredential: (params: SignInFormValues) => Promise<void>;
24
- withSocialProvider: (provider: SupportedProvider, options?: SocialProviderOptions) => Promise<SignInResponse>;
24
+ private _confirmationResult;
25
+ constructor(data: (SignInJson | null) | undefined, auth: Auth, csrfToken: string | undefined);
26
+ get user(): TernSecureUser | null;
27
+ create: (params: SignInCreateParams) => Promise<this>;
28
+ attemptFirstFactor: (params: AttemptFirstFactorParams) => Promise<SignInResource>;
29
+ attemptPhoneNumberVerification: (params: {
30
+ code: string;
31
+ }) => Promise<SignInResource>;
32
+ signInWithCredential: (credential: UserCredential) => Promise<import("../instance/coreApiClient").ApiResponseJSON<any> | null>;
33
+ authenticateWithPassword: (params: SignInPasswordParams) => Promise<SignInResponse>;
34
+ createRecaptchaVerifier: (containerOrId: string | HTMLElement, parameters?: any) => ApplicationVerifier;
35
+ authenticateWithPhoneNumber: (params: SignInPhoneParams) => Promise<SignInResponse>;
36
+ withCredential: (params: SignInPasswordParams) => Promise<void>;
37
+ authenticateWithSocialProvider: (provider: SupportedProvider, options?: SocialProviderOptions) => Promise<SignInResponse>;
25
38
  completeMfaSignIn: (_mfaToken: string, _mfaContext?: any) => Promise<SignInResponse>;
26
- sendPasswordResetEmail: (email: string) => Promise<void>;
27
- resendEmailVerification: () => Promise<ResendEmailVerification>;
39
+ sendPasswordResetEmail: (email: string) => Promise<import("../instance/coreApiClient").ApiResponseJSON<any> | null>;
40
+ private resendEmailVerification;
41
+ attemptEmailVerification: (options?: {
42
+ url?: string;
43
+ handleCodeInApp?: boolean;
44
+ }) => Promise<SignInVerificationResponse>;
28
45
  private getProviderConfig;
29
46
  private authRedirectResult;
30
47
  /**
@@ -50,6 +67,6 @@ export declare class SignIn extends TernSecureBase implements SignInResource {
50
67
  private _signInWithRedirect;
51
68
  private _signInWithPopUp;
52
69
  checkRedirectResult(): Promise<SignInResponse | null>;
70
+ protected fromJSON(data: SignInJson | null): this;
53
71
  }
54
72
  export {};
55
- //# sourceMappingURL=SignIn.d.ts.map
@@ -1,17 +1,19 @@
1
- import type { SignUpInitialValue, SignUpResource, SignUpResponse, SignUpStatus } from '@tern-secure/types';
1
+ import type { SignUpFormValues, SignUpJson, SignUpResource, SignUpStatus, TernSecureUser, UnverifiedField } from '@tern-secure/types';
2
2
  import type { Auth } from 'firebase/auth';
3
3
  import { TernSecureBase } from './Base';
4
4
  export declare class SignUp extends TernSecureBase implements SignUpResource {
5
5
  status: SignUpStatus | null;
6
- username: string | null;
7
- firstName: string | null;
8
- lastName: string | null;
9
- displayName: string | null;
10
- email: string | null;
11
- phoneNumber: string | null;
6
+ user: TernSecureUser | null;
7
+ unverifiedFields?: UnverifiedField[];
8
+ message?: string;
9
+ error?: any;
12
10
  private auth;
13
- constructor(auth: Auth);
14
- withEmailAndPassword: (params: SignUpInitialValue) => Promise<SignUpResponse>;
11
+ constructor(data: (SignUpJson | null) | undefined, auth: Auth);
12
+ withEmailAndPassword: (params: SignUpFormValues) => Promise<SignUpResource>;
15
13
  withSocialProvider(): Promise<void>;
14
+ attemptEmailVerification: (options?: {
15
+ url?: string;
16
+ handleCodeInApp?: boolean;
17
+ }) => Promise<SignUpResource>;
18
+ protected fromJSON(data: SignUpJson | null): this;
16
19
  }
17
- //# sourceMappingURL=SignUp.d.ts.map
@@ -1,4 +1,4 @@
1
- export type { TernSecureAuth } from '../instance/TernAuth';
1
+ export type { TernSecureAuth } from '../instance/ternsecure';
2
2
  export * from './Session';
3
3
  export * from './SignUp';
4
4
  export * from './SignIn';
@@ -6,4 +6,3 @@ export * from './Base';
6
6
  export * from '../auth/AuthCookieManager';
7
7
  export * from '../utils';
8
8
  export * from './Error';
9
- //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { TernSecureAuth, TernSecureAuthOptions } from '@tern-secure/types';
2
+ import type { TernSecureComponentName } from './lazyLoading/components';
3
+ import type { AvailableComponentProps } from './types';
4
+ export type TernComponentControls = {
5
+ mountComponent: (params: {
6
+ appearanceKey: string;
7
+ name: TernSecureComponentName;
8
+ node: HTMLDivElement;
9
+ props?: AvailableComponentProps;
10
+ }) => void;
11
+ unmountComponent: (params: {
12
+ node: HTMLDivElement;
13
+ }) => void;
14
+ updateProps: (params: {
15
+ appearanceKey?: string;
16
+ options?: TernSecureAuthOptions | undefined;
17
+ node: HTMLDivElement;
18
+ props?: unknown;
19
+ }) => void;
20
+ };
21
+ export declare const mountComponentRenderer: (ternsecure: TernSecureAuth, options: TernSecureAuthOptions) => {
22
+ ensureMounted: (opts?: {
23
+ preloadHint: TernSecureComponentName;
24
+ }) => Promise<TernComponentControls>;
25
+ };
26
+ export type MountComponentRenderer = typeof mountComponentRenderer;
@@ -0,0 +1,6 @@
1
+ type ProviderInitialIconProps = {
2
+ id: string;
3
+ className?: string;
4
+ };
5
+ export declare const ProviderInitialIcon: ({ id, className }: ProviderInitialIconProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export type VerificationCodeCardProps = {
4
+ cardTitle?: string;
5
+ cardDescription?: string;
6
+ inputLabel?: string;
7
+ submitButtonText?: string;
8
+ onCodeEntryFinishedAction: (code: string, resolve: () => Promise<void>, reject: (err: unknown) => Promise<void>) => void;
9
+ onResendCodeClicked?: React.MouseEventHandler;
10
+ onBackLinkClicked?: React.MouseEventHandler;
11
+ };
12
+ export declare const VerificationCodeCard: (props: PropsWithChildren<VerificationCodeCardProps>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ type VerificationLinkCardProps = {
2
+ emailSent?: boolean;
3
+ onResend?: () => Promise<void>;
4
+ isLoading?: boolean;
5
+ };
6
+ export declare const VerificationLinkCard: (props: VerificationLinkCardProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Attribute } from '@tern-secure/types';
2
+ export type SignInStartIdentifier = 'email_address' | 'phone_number';
3
+ export declare const groupIdentifiers: (attributes: Attribute[]) => SignInStartIdentifier[];
4
+ export declare const getIdentifiers: (identifier: SignInStartIdentifier) => {
5
+ fieldName: string;
6
+ label: string;
7
+ placeholder: string;
8
+ };
@@ -0,0 +1,3 @@
1
+ export type { SignInStartIdentifier, } from './constants';
2
+ export { getIdentifiers, groupIdentifiers, } from './constants';
3
+ export { ProviderInitialIcon } from './ProviderInitialIcon';
@@ -0,0 +1 @@
1
+ export declare const PasswordReset: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function PasswordResetSuccess(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { SignInModalProps, SignInProps } from '@tern-secure/types';
2
+ import React from 'react';
3
+ export declare const SignIn: React.ComponentType<SignInProps>;
4
+ export declare const SignInModal: (props: SignInModalProps) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function SignInEmailLinkCard(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SignInFactorOne: (props: unknown) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { EmailCodeFactor, PhoneCodeFactor } from '@tern-secure/types';
2
+ import type { VerificationCodeCardProps } from '../../common/VerificationCodeCard';
3
+ export type SignInFactorOneCodeCard = Pick<VerificationCodeCardProps, 'onBackLinkClicked'> & {
4
+ factor: EmailCodeFactor | PhoneCodeFactor;
5
+ };
6
+ export type SignInFactorOneCodeFormProps = SignInFactorOneCodeCard;
7
+ export declare const SignInFactorOneCodeForm: (props: SignInFactorOneCodeFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ type SignInFactorOnePasswordProps = {
2
+ signInWithPassword: (password: string) => Promise<void>;
3
+ onForgotPassword?: () => void;
4
+ };
5
+ export declare const SignInFactorOnePasswordCard: (props: SignInFactorOnePasswordProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { PhoneCodeFactor } from '@tern-secure/types';
2
+ import type { SignInFactorOneCodeCard } from './SignInFactorOneCodeForm';
3
+ type SignInFactorOnePhoneCodeCardProps = SignInFactorOneCodeCard & {
4
+ factor: PhoneCodeFactor;
5
+ };
6
+ export declare const SignInFactorOnePhoneCodeCard: (props: SignInFactorOnePhoneCodeCardProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ interface SignInPasswordProps {
2
+ onError?: (error: Error) => void;
3
+ isDisabled?: boolean;
4
+ signInWithPassword?: (email: string, password: string) => Promise<void>;
5
+ onForgotPassword?: () => void;
6
+ }
7
+ export declare const SignInPassword: (props: SignInPasswordProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare const SignInSocialButtons: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export type SessionErrorCode = 'ENDPOINT_NOT_FOUND' | 'COOKIE_SET_FAILED' | 'API_REQUEST_FAILED' | 'NETWORK_ERROR' | 'UNAUTHORIZED' | 'UNKNOWN_ERROR';
2
+ export interface SessionError {
3
+ code: SessionErrorCode;
4
+ message: string;
5
+ original?: unknown;
6
+ }
7
+ export declare const SignInStart: (props: unknown) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SignInVerifyEmail: (props: unknown) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import '../../../index.css';
2
+ export * from './SignIn';
3
+ export * from './ResetPassword';
4
+ export * from './ResetPasswordSuccess';
@@ -0,0 +1,8 @@
1
+ import type { SignUpModalProps } from '@tern-secure/types';
2
+ import React from 'react';
3
+ import type { SignUpProps } from '../../types';
4
+ import { SignUpStart } from './SignUpStart';
5
+ import { SignUpVerifyEmail } from './SignUpVerifyEmail';
6
+ export declare const SignUp: React.ComponentType<SignUpProps>;
7
+ export declare const SignUpModal: (props: SignUpModalProps) => React.JSX.Element;
8
+ export { SignUpStart, SignUpVerifyEmail };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function SignUpEmailLinkCard(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SignUpSocialButtons: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SignUpStart: (props: unknown) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const SignUpVerifyEmail: (props: unknown) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import '../../../index.css';
2
+ export * from './SignUp';
@@ -0,0 +1,14 @@
1
+ import type { SignUpResource } from '@tern-secure/types';
2
+ type CompleteSignUpFlowProps = {
3
+ signUp: SignUpResource;
4
+ verifyEmailPath?: string;
5
+ verifyPhonePath?: string;
6
+ continuePath?: string;
7
+ navigate: (to: string) => Promise<unknown>;
8
+ handleComplete?: () => Promise<void>;
9
+ redirectUrl?: string;
10
+ redirectUrlComplete?: string;
11
+ oidcPrompt?: string;
12
+ };
13
+ export declare const completeSignUpFlow: ({ signUp, verifyEmailPath, navigate, handleComplete }: CompleteSignUpFlowProps) => Promise<unknown> | undefined;
14
+ export {};
@@ -0,0 +1 @@
1
+ export * from './userButton';
@@ -0,0 +1 @@
1
+ export declare function UserButton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { SignInResource, SignUpResource, TernSecureUser } from '@tern-secure/types';
2
+ export declare function useAuthSignIn(): SignInResource | undefined | null;
3
+ export declare function useAuthSignUp(): SignUpResource | undefined | null;
4
+ export declare function useAuthUser(): TernSecureUser | null;
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AvailableComponentName, AvailableComponentProps } from '../types';
3
+ export declare function TernAuthUIComponentProvider({ componentName, props, children, }: {
4
+ componentName: AvailableComponentName;
5
+ props: AvailableComponentProps;
6
+ children: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export * from './components';
@@ -0,0 +1,8 @@
1
+ import type { TernSecureAuth } from '@tern-secure/types';
2
+ import React from 'react';
3
+ type TernSecureContextWrapperProps = {
4
+ ternsecure: TernSecureAuth;
5
+ children: React.ReactNode;
6
+ };
7
+ export declare function TernSecureContextWrapper(props: TernSecureContextWrapperProps): React.JSX.Element | null;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { TernSecureAuthOptions } from '@tern-secure/types';
2
+ import React from 'react';
3
+ export declare const TernSecureAuthOptionsCtx: React.Context<TernSecureAuthOptions>;
4
+ interface OptionsProviderProps {
5
+ children: React.ReactNode;
6
+ value: TernSecureAuthOptions;
7
+ }
8
+ declare function TernSecureOptionsProvider({ children, value }: OptionsProviderProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function useTernSecureOptions(): TernSecureAuthOptions;
10
+ export { useTernSecureOptions, TernSecureOptionsProvider };
@@ -0,0 +1,21 @@
1
+ import type { AuthErrorTree, TernSecureUser } from '@tern-secure/types';
2
+ import type { ParsedQueryString } from '../../router';
3
+ import type { SignInCtx } from '../../types';
4
+ export type SignInContextType = Omit<SignInCtx, 'fallbackRedirectUrl' | 'forceRedirectUrl'> & {
5
+ onSignInSuccess: (user: TernSecureUser, options?: {
6
+ onPreRedirect?: () => Promise<boolean>;
7
+ }) => void;
8
+ handleSignInError: (error: AuthErrorTree) => void;
9
+ redirectAfterSignIn: () => any;
10
+ queryParams: ParsedQueryString;
11
+ signInUrl: string;
12
+ signUpUrl: string;
13
+ authQueryString: string | null;
14
+ afterSignUpUrl: string;
15
+ afterSignInUrl: string;
16
+ checkRedirectResult: () => Promise<void>;
17
+ isCombinedFlow: boolean;
18
+ showCombinedForm: boolean;
19
+ };
20
+ export declare const SignInContext: import("react").Context<SignInCtx | null>;
21
+ export declare const useSignInContext: () => SignInContextType;
@@ -0,0 +1,14 @@
1
+ import type { ParsedQueryString } from '../../router';
2
+ import type { SignUpCtx } from '../../types';
3
+ export type SignUpContextType = Omit<SignUpCtx, 'fallbackRedirectUrl' | 'forceRedirectUrl'> & {
4
+ navigateAfterSignUp: () => any;
5
+ queryParams: ParsedQueryString;
6
+ authQueryString: string | null;
7
+ signInUrl: string;
8
+ signUpUrl: string;
9
+ afterSignUpUrl: string;
10
+ afterSignInUrl: string;
11
+ shouldShowForm?: boolean;
12
+ };
13
+ export declare const SignUpContext: import("react").Context<SignUpCtx | null>;
14
+ export declare const useSignUpContext: () => SignUpContextType;