foundation-sdk 0.2.11 → 0.3.0

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.
@@ -68,6 +68,23 @@ interface FullConfig {
68
68
  };
69
69
  readonly raw: Record<string, unknown>;
70
70
  }
71
+ type SignInStep = 'DONE' | 'CONFIRM_SIGN_UP' | 'CONFIRM_SIGN_IN_WITH_SMS_CODE' | 'CONFIRM_SIGN_IN_WITH_TOTP_CODE' | 'CONTINUE_SIGN_IN_WITH_MFA_SELECTION' | 'RESET_PASSWORD' | 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED' | string;
72
+ interface SignInResult {
73
+ isSignedIn: boolean;
74
+ nextStep?: {
75
+ signInStep: SignInStep;
76
+ [key: string]: unknown;
77
+ };
78
+ }
79
+ type SignUpStep = 'DONE' | 'CONFIRM_SIGN_UP' | string;
80
+ interface SignUpResult {
81
+ isSignUpComplete: boolean;
82
+ userId?: string;
83
+ nextStep?: {
84
+ signUpStep: SignUpStep;
85
+ [key: string]: unknown;
86
+ };
87
+ }
71
88
  interface AuthClient {
72
89
  login(options?: Record<string, unknown>): Promise<void>;
73
90
  logout(options?: Record<string, unknown>): void | Promise<void>;
@@ -75,8 +92,8 @@ interface AuthClient {
75
92
  getTokenSilently(options?: Record<string, unknown>): Promise<string>;
76
93
  isAuthenticated(): Promise<boolean>;
77
94
  handleCallback?(url?: string): Promise<void>;
78
- signIn?(email: string, password: string): Promise<void>;
79
- signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
95
+ signIn?(email: string, password: string): Promise<SignInResult>;
96
+ signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<SignUpResult>;
80
97
  confirmSignUp?(email: string, code: string): Promise<void>;
81
98
  resendSignUpCode?(email: string): Promise<void>;
82
99
  forgotPassword?(email: string): Promise<void>;
@@ -89,10 +106,13 @@ interface AuthService {
89
106
  /** Redirect-based login (Auth0 Universal Login / Cognito Hosted UI) */
90
107
  login(options?: Record<string, unknown>): Promise<void>;
91
108
  logout(options?: Record<string, unknown>): Promise<void>;
92
- /** Direct sign in with credentials (for custom login forms) */
93
- signIn(email: string, password: string): Promise<void>;
94
- /** Direct sign up (for custom registration forms) */
95
- signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
109
+ /** Direct sign in with credentials (for custom login forms).
110
+ * Returns `{ isSignedIn, nextStep? }`. Check `isSignedIn` before navigating. */
111
+ signIn(email: string, password: string): Promise<SignInResult>;
112
+ /** Direct sign up (for custom registration forms).
113
+ * Returns `{ isSignUpComplete, nextStep? }`. If configured for unified verification,
114
+ * `isSignUpComplete` is true and the backend sends a verification email. */
115
+ signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<SignUpResult>;
96
116
  /** Confirm sign up with verification code (Cognito email/SMS verification) */
97
117
  confirmSignUp(email: string, code: string): Promise<void>;
98
118
  /** Resend sign up verification code */
@@ -249,4 +269,4 @@ interface Foundation {
249
269
  on(event: string, callback: (event: EntityChangeEvent) => void): () => void;
250
270
  }
251
271
 
252
- export type { AuthProvider as A, DbService as D, EntityChangeEvent as E, FoundationConfig as F, IntegrationService as I, LogService as L, OAuthService as O, User as U, Foundation as a, FullConfig as b, FileMetadata as c, AuthClient as d, AuthService as e, FilesService as f, AccountService as g, Integration as h, IntegrationConnection as i, IntegrationDetail as j, OAuthClient as k, OAuthConsentParams as l, OpenApiService as m, AuthProviderContext as n };
272
+ export type { AuthProvider as A, DbService as D, EntityChangeEvent as E, FoundationConfig as F, IntegrationService as I, LogService as L, OAuthService as O, SignInResult as S, User as U, Foundation as a, FullConfig as b, FileMetadata as c, AuthClient as d, AuthService as e, SignInStep as f, SignUpResult as g, SignUpStep as h, FilesService as i, AccountService as j, Integration as k, IntegrationConnection as l, IntegrationDetail as m, OAuthClient as n, OAuthConsentParams as o, OpenApiService as p, AuthProviderContext as q };
@@ -68,6 +68,23 @@ interface FullConfig {
68
68
  };
69
69
  readonly raw: Record<string, unknown>;
70
70
  }
71
+ type SignInStep = 'DONE' | 'CONFIRM_SIGN_UP' | 'CONFIRM_SIGN_IN_WITH_SMS_CODE' | 'CONFIRM_SIGN_IN_WITH_TOTP_CODE' | 'CONTINUE_SIGN_IN_WITH_MFA_SELECTION' | 'RESET_PASSWORD' | 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED' | string;
72
+ interface SignInResult {
73
+ isSignedIn: boolean;
74
+ nextStep?: {
75
+ signInStep: SignInStep;
76
+ [key: string]: unknown;
77
+ };
78
+ }
79
+ type SignUpStep = 'DONE' | 'CONFIRM_SIGN_UP' | string;
80
+ interface SignUpResult {
81
+ isSignUpComplete: boolean;
82
+ userId?: string;
83
+ nextStep?: {
84
+ signUpStep: SignUpStep;
85
+ [key: string]: unknown;
86
+ };
87
+ }
71
88
  interface AuthClient {
72
89
  login(options?: Record<string, unknown>): Promise<void>;
73
90
  logout(options?: Record<string, unknown>): void | Promise<void>;
@@ -75,8 +92,8 @@ interface AuthClient {
75
92
  getTokenSilently(options?: Record<string, unknown>): Promise<string>;
76
93
  isAuthenticated(): Promise<boolean>;
77
94
  handleCallback?(url?: string): Promise<void>;
78
- signIn?(email: string, password: string): Promise<void>;
79
- signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
95
+ signIn?(email: string, password: string): Promise<SignInResult>;
96
+ signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<SignUpResult>;
80
97
  confirmSignUp?(email: string, code: string): Promise<void>;
81
98
  resendSignUpCode?(email: string): Promise<void>;
82
99
  forgotPassword?(email: string): Promise<void>;
@@ -89,10 +106,13 @@ interface AuthService {
89
106
  /** Redirect-based login (Auth0 Universal Login / Cognito Hosted UI) */
90
107
  login(options?: Record<string, unknown>): Promise<void>;
91
108
  logout(options?: Record<string, unknown>): Promise<void>;
92
- /** Direct sign in with credentials (for custom login forms) */
93
- signIn(email: string, password: string): Promise<void>;
94
- /** Direct sign up (for custom registration forms) */
95
- signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
109
+ /** Direct sign in with credentials (for custom login forms).
110
+ * Returns `{ isSignedIn, nextStep? }`. Check `isSignedIn` before navigating. */
111
+ signIn(email: string, password: string): Promise<SignInResult>;
112
+ /** Direct sign up (for custom registration forms).
113
+ * Returns `{ isSignUpComplete, nextStep? }`. If configured for unified verification,
114
+ * `isSignUpComplete` is true and the backend sends a verification email. */
115
+ signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<SignUpResult>;
96
116
  /** Confirm sign up with verification code (Cognito email/SMS verification) */
97
117
  confirmSignUp(email: string, code: string): Promise<void>;
98
118
  /** Resend sign up verification code */
@@ -249,4 +269,4 @@ interface Foundation {
249
269
  on(event: string, callback: (event: EntityChangeEvent) => void): () => void;
250
270
  }
251
271
 
252
- export type { AuthProvider as A, DbService as D, EntityChangeEvent as E, FoundationConfig as F, IntegrationService as I, LogService as L, OAuthService as O, User as U, Foundation as a, FullConfig as b, FileMetadata as c, AuthClient as d, AuthService as e, FilesService as f, AccountService as g, Integration as h, IntegrationConnection as i, IntegrationDetail as j, OAuthClient as k, OAuthConsentParams as l, OpenApiService as m, AuthProviderContext as n };
272
+ export type { AuthProvider as A, DbService as D, EntityChangeEvent as E, FoundationConfig as F, IntegrationService as I, LogService as L, OAuthService as O, SignInResult as S, User as U, Foundation as a, FullConfig as b, FileMetadata as c, AuthClient as d, AuthService as e, SignInStep as f, SignUpResult as g, SignUpStep as h, FilesService as i, AccountService as j, Integration as k, IntegrationConnection as l, IntegrationDetail as m, OAuthClient as n, OAuthConsentParams as o, OpenApiService as p, AuthProviderContext as q };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundation-sdk",
3
- "version": "0.2.11",
3
+ "version": "0.3.0",
4
4
  "description": "TypeScript SDK for Foundation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",