foundation-sdk 0.2.10 → 0.2.11
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.
- package/dist/auth-auth0.cjs +1 -1
- package/dist/auth-auth0.cjs.map +1 -1
- package/dist/auth-auth0.d.cts +2 -2
- package/dist/auth-auth0.d.ts +2 -2
- package/dist/auth-auth0.js +1 -1
- package/dist/auth-auth0.js.map +1 -1
- package/dist/auth-cognito.cjs +1 -1
- package/dist/auth-cognito.cjs.map +1 -1
- package/dist/auth-cognito.d.cts +2 -2
- package/dist/auth-cognito.d.ts +2 -2
- package/dist/auth-cognito.js +1 -1
- package/dist/auth-cognito.js.map +1 -1
- package/dist/foundation-sdk.browser.auth0.global.js +3 -3
- package/dist/foundation-sdk.browser.auth0.global.js.map +1 -1
- package/dist/foundation-sdk.browser.global.js +3 -3
- package/dist/foundation-sdk.browser.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{types-HdCjnyCt.d.cts → types-C9WPa35S.d.cts} +50 -2
- package/dist/{types-HdCjnyCt.d.ts → types-C9WPa35S.d.ts} +50 -2
- package/package.json +1 -1
|
@@ -22,7 +22,19 @@ interface EntityChangeEvent {
|
|
|
22
22
|
namespace?: string;
|
|
23
23
|
timestamp?: number;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
interface AuthProviderContext {
|
|
26
|
+
/** API base URL for backend endpoints */
|
|
27
|
+
apiBaseUrl: string;
|
|
28
|
+
/** Account service base URL */
|
|
29
|
+
accountBaseUrl: string;
|
|
30
|
+
/** App ID for request headers */
|
|
31
|
+
appId: string;
|
|
32
|
+
/** Tenant ID for request headers */
|
|
33
|
+
tenantId: string;
|
|
34
|
+
/** App version for request headers */
|
|
35
|
+
version: string;
|
|
36
|
+
}
|
|
37
|
+
type AuthProvider = (config: Record<string, unknown>, ctx: AuthProviderContext) => Promise<AuthClient>;
|
|
26
38
|
interface FoundationConfig {
|
|
27
39
|
/** Backend config endpoint URL. If omitted, reads from /foundation-env.json */
|
|
28
40
|
configUrl?: string;
|
|
@@ -62,8 +74,11 @@ interface AuthClient {
|
|
|
62
74
|
getUser(): Promise<User | undefined>;
|
|
63
75
|
getTokenSilently(options?: Record<string, unknown>): Promise<string>;
|
|
64
76
|
isAuthenticated(): Promise<boolean>;
|
|
77
|
+
handleCallback?(url?: string): Promise<void>;
|
|
65
78
|
signIn?(email: string, password: string): Promise<void>;
|
|
66
79
|
signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
80
|
+
confirmSignUp?(email: string, code: string): Promise<void>;
|
|
81
|
+
resendSignUpCode?(email: string): Promise<void>;
|
|
67
82
|
forgotPassword?(email: string): Promise<void>;
|
|
68
83
|
resetPassword?(code: string, newPassword: string): Promise<void>;
|
|
69
84
|
}
|
|
@@ -78,6 +93,12 @@ interface AuthService {
|
|
|
78
93
|
signIn(email: string, password: string): Promise<void>;
|
|
79
94
|
/** Direct sign up (for custom registration forms) */
|
|
80
95
|
signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
96
|
+
/** Confirm sign up with verification code (Cognito email/SMS verification) */
|
|
97
|
+
confirmSignUp(email: string, code: string): Promise<void>;
|
|
98
|
+
/** Resend sign up verification code */
|
|
99
|
+
resendSignUpCode(email: string): Promise<void>;
|
|
100
|
+
/** Handle OAuth redirect callback — call on your /callback route */
|
|
101
|
+
handleCallback(url?: string): Promise<void>;
|
|
81
102
|
/** Initiate password reset */
|
|
82
103
|
forgotPassword(email: string): Promise<void>;
|
|
83
104
|
/** Complete password reset with code */
|
|
@@ -178,6 +199,32 @@ interface IntegrationService {
|
|
|
178
199
|
}>;
|
|
179
200
|
disconnect(source: string, configurationId: string): Promise<void>;
|
|
180
201
|
}
|
|
202
|
+
interface OAuthClient {
|
|
203
|
+
id: string;
|
|
204
|
+
name: string;
|
|
205
|
+
description?: string;
|
|
206
|
+
redirectUris: string[];
|
|
207
|
+
allowedScopes: string[];
|
|
208
|
+
grantTypes: string[];
|
|
209
|
+
status: string;
|
|
210
|
+
[key: string]: unknown;
|
|
211
|
+
}
|
|
212
|
+
interface OAuthConsentParams {
|
|
213
|
+
client_id: string;
|
|
214
|
+
redirect_uri: string;
|
|
215
|
+
scope: string;
|
|
216
|
+
state: string;
|
|
217
|
+
code_challenge: string;
|
|
218
|
+
code_challenge_method: string;
|
|
219
|
+
}
|
|
220
|
+
interface OAuthService {
|
|
221
|
+
/** Get an OAuth client's details (for consent screen) */
|
|
222
|
+
getClient(clientId: string): Promise<OAuthClient>;
|
|
223
|
+
/** Grant consent and generate authorization code */
|
|
224
|
+
authorizeConsent(params: OAuthConsentParams): Promise<{
|
|
225
|
+
code: string;
|
|
226
|
+
}>;
|
|
227
|
+
}
|
|
181
228
|
interface OpenApiService {
|
|
182
229
|
get(): Promise<Record<string, unknown>>;
|
|
183
230
|
}
|
|
@@ -196,9 +243,10 @@ interface Foundation {
|
|
|
196
243
|
integration: IntegrationService;
|
|
197
244
|
account: AccountService;
|
|
198
245
|
config: FullConfig;
|
|
246
|
+
oauth: OAuthService;
|
|
199
247
|
openapi: OpenApiService;
|
|
200
248
|
log: LogService;
|
|
201
249
|
on(event: string, callback: (event: EntityChangeEvent) => void): () => void;
|
|
202
250
|
}
|
|
203
251
|
|
|
204
|
-
export type {
|
|
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 };
|
|
@@ -22,7 +22,19 @@ interface EntityChangeEvent {
|
|
|
22
22
|
namespace?: string;
|
|
23
23
|
timestamp?: number;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
interface AuthProviderContext {
|
|
26
|
+
/** API base URL for backend endpoints */
|
|
27
|
+
apiBaseUrl: string;
|
|
28
|
+
/** Account service base URL */
|
|
29
|
+
accountBaseUrl: string;
|
|
30
|
+
/** App ID for request headers */
|
|
31
|
+
appId: string;
|
|
32
|
+
/** Tenant ID for request headers */
|
|
33
|
+
tenantId: string;
|
|
34
|
+
/** App version for request headers */
|
|
35
|
+
version: string;
|
|
36
|
+
}
|
|
37
|
+
type AuthProvider = (config: Record<string, unknown>, ctx: AuthProviderContext) => Promise<AuthClient>;
|
|
26
38
|
interface FoundationConfig {
|
|
27
39
|
/** Backend config endpoint URL. If omitted, reads from /foundation-env.json */
|
|
28
40
|
configUrl?: string;
|
|
@@ -62,8 +74,11 @@ interface AuthClient {
|
|
|
62
74
|
getUser(): Promise<User | undefined>;
|
|
63
75
|
getTokenSilently(options?: Record<string, unknown>): Promise<string>;
|
|
64
76
|
isAuthenticated(): Promise<boolean>;
|
|
77
|
+
handleCallback?(url?: string): Promise<void>;
|
|
65
78
|
signIn?(email: string, password: string): Promise<void>;
|
|
66
79
|
signUp?(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
80
|
+
confirmSignUp?(email: string, code: string): Promise<void>;
|
|
81
|
+
resendSignUpCode?(email: string): Promise<void>;
|
|
67
82
|
forgotPassword?(email: string): Promise<void>;
|
|
68
83
|
resetPassword?(code: string, newPassword: string): Promise<void>;
|
|
69
84
|
}
|
|
@@ -78,6 +93,12 @@ interface AuthService {
|
|
|
78
93
|
signIn(email: string, password: string): Promise<void>;
|
|
79
94
|
/** Direct sign up (for custom registration forms) */
|
|
80
95
|
signUp(email: string, password: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
96
|
+
/** Confirm sign up with verification code (Cognito email/SMS verification) */
|
|
97
|
+
confirmSignUp(email: string, code: string): Promise<void>;
|
|
98
|
+
/** Resend sign up verification code */
|
|
99
|
+
resendSignUpCode(email: string): Promise<void>;
|
|
100
|
+
/** Handle OAuth redirect callback — call on your /callback route */
|
|
101
|
+
handleCallback(url?: string): Promise<void>;
|
|
81
102
|
/** Initiate password reset */
|
|
82
103
|
forgotPassword(email: string): Promise<void>;
|
|
83
104
|
/** Complete password reset with code */
|
|
@@ -178,6 +199,32 @@ interface IntegrationService {
|
|
|
178
199
|
}>;
|
|
179
200
|
disconnect(source: string, configurationId: string): Promise<void>;
|
|
180
201
|
}
|
|
202
|
+
interface OAuthClient {
|
|
203
|
+
id: string;
|
|
204
|
+
name: string;
|
|
205
|
+
description?: string;
|
|
206
|
+
redirectUris: string[];
|
|
207
|
+
allowedScopes: string[];
|
|
208
|
+
grantTypes: string[];
|
|
209
|
+
status: string;
|
|
210
|
+
[key: string]: unknown;
|
|
211
|
+
}
|
|
212
|
+
interface OAuthConsentParams {
|
|
213
|
+
client_id: string;
|
|
214
|
+
redirect_uri: string;
|
|
215
|
+
scope: string;
|
|
216
|
+
state: string;
|
|
217
|
+
code_challenge: string;
|
|
218
|
+
code_challenge_method: string;
|
|
219
|
+
}
|
|
220
|
+
interface OAuthService {
|
|
221
|
+
/** Get an OAuth client's details (for consent screen) */
|
|
222
|
+
getClient(clientId: string): Promise<OAuthClient>;
|
|
223
|
+
/** Grant consent and generate authorization code */
|
|
224
|
+
authorizeConsent(params: OAuthConsentParams): Promise<{
|
|
225
|
+
code: string;
|
|
226
|
+
}>;
|
|
227
|
+
}
|
|
181
228
|
interface OpenApiService {
|
|
182
229
|
get(): Promise<Record<string, unknown>>;
|
|
183
230
|
}
|
|
@@ -196,9 +243,10 @@ interface Foundation {
|
|
|
196
243
|
integration: IntegrationService;
|
|
197
244
|
account: AccountService;
|
|
198
245
|
config: FullConfig;
|
|
246
|
+
oauth: OAuthService;
|
|
199
247
|
openapi: OpenApiService;
|
|
200
248
|
log: LogService;
|
|
201
249
|
on(event: string, callback: (event: EntityChangeEvent) => void): () => void;
|
|
202
250
|
}
|
|
203
251
|
|
|
204
|
-
export type {
|
|
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 };
|