@iqauth/sdk 2.0.5 → 2.1.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.
- package/dist/react.d.mts +57 -2
- package/dist/react.d.ts +57 -2
- package/dist/react.js +400 -145
- package/dist/react.mjs +397 -145
- package/package.json +1 -1
package/dist/react.d.mts
CHANGED
|
@@ -122,6 +122,7 @@ declare function AuthCallback({ onComplete, fallback }?: AuthCallbackProps): Rea
|
|
|
122
122
|
interface IQAuthBranding {
|
|
123
123
|
brandName: string | null;
|
|
124
124
|
logoUrl: string | null;
|
|
125
|
+
logoLightUrl?: string | null;
|
|
125
126
|
logoDarkUrl?: string | null;
|
|
126
127
|
faviconUrl?: string | null;
|
|
127
128
|
loginHeadline: string | null;
|
|
@@ -132,14 +133,30 @@ interface IQAuthBranding {
|
|
|
132
133
|
surfaceColor: string | null;
|
|
133
134
|
textColor: string | null;
|
|
134
135
|
heroImageUrl?: string | null;
|
|
136
|
+
/** Optional full-bleed background image for the `full_bleed` layout. */
|
|
137
|
+
backgroundImageUrl?: string | null;
|
|
135
138
|
tagline?: string | null;
|
|
136
139
|
loginSideCopy?: string | null;
|
|
137
140
|
googleButtonLabel?: string | null;
|
|
138
141
|
customCss?: string | null;
|
|
142
|
+
/** "centered_card" | "split_screen" | "full_bleed" */
|
|
143
|
+
loginLayout?: string | null;
|
|
144
|
+
/** "solid" | "outline" | "ghost" */
|
|
145
|
+
socialButtonStyle?: string | null;
|
|
146
|
+
fontFamilyBody?: string | null;
|
|
147
|
+
fontFamilyHeading?: string | null;
|
|
148
|
+
customFontUrl?: string | null;
|
|
149
|
+
borderRadius?: number | string | null;
|
|
150
|
+
footerText?: string | null;
|
|
151
|
+
emailHeaderImageUrl?: string | null;
|
|
152
|
+
emailSenderName?: string | null;
|
|
153
|
+
emailFooter?: string | null;
|
|
139
154
|
supportEmail?: string | null;
|
|
140
155
|
supportUrl?: string | null;
|
|
141
156
|
termsUrl?: string | null;
|
|
142
157
|
privacyUrl?: string | null;
|
|
158
|
+
/** Composite revision (`${tenantRev}.${appRev}`) for cache-busting. */
|
|
159
|
+
brandingRev?: string | null;
|
|
143
160
|
}
|
|
144
161
|
interface IQAuthSignInContext {
|
|
145
162
|
app: {
|
|
@@ -156,6 +173,13 @@ interface IQAuthSignInContext {
|
|
|
156
173
|
allowedOrigins: string[];
|
|
157
174
|
returnAllowed: boolean;
|
|
158
175
|
branding: IQAuthBranding | null;
|
|
176
|
+
brandingRev?: string | null;
|
|
177
|
+
session?: {
|
|
178
|
+
userId: string;
|
|
179
|
+
email: string;
|
|
180
|
+
name: string;
|
|
181
|
+
authenticatedAt: number;
|
|
182
|
+
} | null;
|
|
159
183
|
}
|
|
160
184
|
interface SharedComponentProps {
|
|
161
185
|
/** Base URL of the IQAuth service (e.g. https://auth.dispositioniq.com). */
|
|
@@ -173,13 +197,44 @@ declare function useIQAuthSignInContext(iqAuthBaseUrl: string, appKey: string, r
|
|
|
173
197
|
loading: boolean;
|
|
174
198
|
error: string | null;
|
|
175
199
|
};
|
|
200
|
+
declare function sanitizeBrandCss(input: string | null | undefined): string;
|
|
201
|
+
/**
|
|
202
|
+
* Fetches the layered tenant/app branding for use by chrome-only SDK
|
|
203
|
+
* components (`<UserButton/>`, `<UserProfile/>`, `<OrganizationSwitcher/>`)
|
|
204
|
+
* that don't go through `<SignIn/>`'s sign-in-context.
|
|
205
|
+
*
|
|
206
|
+
* Cached at module scope for 60s, keyed by URL. The cache is also
|
|
207
|
+
* brandingRev-aware: a newer rev for the same URL replaces older entries
|
|
208
|
+
* even within the TTL window. Returns `null` until first resolution; callers
|
|
209
|
+
* should treat that as "use neutral defaults".
|
|
210
|
+
*
|
|
211
|
+
* Reads `appId` from the IQAuthProvider's session manager (parsed from the
|
|
212
|
+
* publishable key) so per-app branding overrides are layered. Callers may
|
|
213
|
+
* override with the explicit `appId` parameter.
|
|
214
|
+
*/
|
|
215
|
+
declare function useResolvedSdkBranding(iqAuthBaseUrl: string, appId?: string | null): IQAuthBranding | null;
|
|
176
216
|
interface SignInProps extends SharedComponentProps {
|
|
177
217
|
/** URL the IQAuth backend should redirect back to with `?code=...`. Must be in the app's allowed_origins. */
|
|
178
218
|
returnTo: string;
|
|
179
219
|
/** Called after successful redirect. By default, `window.location.href = url`. */
|
|
180
220
|
onRedirect?: (url: string) => void;
|
|
221
|
+
/** Pass `"login"` to force the form to render even when an SSO session is active. */
|
|
222
|
+
prompt?: "login";
|
|
181
223
|
}
|
|
182
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Pure render-decision helper. When this returns `true`, `<SignIn/>` MUST
|
|
226
|
+
* render the silent SSO placeholder instead of the email/password form,
|
|
227
|
+
* even on the very first render before `useEffect` fires. Exported so that
|
|
228
|
+
* smoke tests can verify the no-flash guarantee without standing up a DOM.
|
|
229
|
+
*/
|
|
230
|
+
declare function isSilentSsoEligible(ctx: {
|
|
231
|
+
session?: unknown;
|
|
232
|
+
app: {
|
|
233
|
+
defaultClientId: string | null;
|
|
234
|
+
};
|
|
235
|
+
returnAllowed: boolean;
|
|
236
|
+
} | null | undefined, effectivePrompt: "login" | undefined): boolean;
|
|
237
|
+
declare function SignIn({ iqAuthBaseUrl, appKey, returnTo, onRedirect, className, prompt }: SignInProps): react_jsx_runtime.JSX.Element;
|
|
183
238
|
interface SignUpProps extends SharedComponentProps {
|
|
184
239
|
returnTo?: string;
|
|
185
240
|
onSuccess?: () => void;
|
|
@@ -213,4 +268,4 @@ interface OrganizationSwitcherProps {
|
|
|
213
268
|
declare function OrganizationSwitcher({ iqAuthBaseUrl, onSwitched, className }: OrganizationSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
214
269
|
declare const __version__ = "phase-bc-1.0.0";
|
|
215
270
|
|
|
216
|
-
export { AuthCallback, type AuthCallbackProps, type IQAuthBranding, IQAuthProvider, type IQAuthProviderProps, type IQAuthSignInContext, OrganizationSwitcher, type OrganizationSwitcherProps, RedirectToSignIn, type RedirectToSignInProps, type SessionError, type SharedComponentProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, type UseAuthResult, type UseOrganizationResult, type UseSessionResult, type UseUserResult, UserButton, type UserButtonProps, UserProfile, type UserProfileProps, type UserSummary, __version__, useAuth, useAuthFetch, useIQAuthSignInContext, useOrganization, useSession, useUser };
|
|
271
|
+
export { AuthCallback, type AuthCallbackProps, type IQAuthBranding, IQAuthProvider, type IQAuthProviderProps, type IQAuthSignInContext, OrganizationSwitcher, type OrganizationSwitcherProps, RedirectToSignIn, type RedirectToSignInProps, type SessionError, type SharedComponentProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, type UseAuthResult, type UseOrganizationResult, type UseSessionResult, type UseUserResult, UserButton, type UserButtonProps, UserProfile, type UserProfileProps, type UserSummary, __version__, isSilentSsoEligible, sanitizeBrandCss, useAuth, useAuthFetch, useIQAuthSignInContext, useOrganization, useResolvedSdkBranding, useSession, useUser };
|
package/dist/react.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ declare function AuthCallback({ onComplete, fallback }?: AuthCallbackProps): Rea
|
|
|
122
122
|
interface IQAuthBranding {
|
|
123
123
|
brandName: string | null;
|
|
124
124
|
logoUrl: string | null;
|
|
125
|
+
logoLightUrl?: string | null;
|
|
125
126
|
logoDarkUrl?: string | null;
|
|
126
127
|
faviconUrl?: string | null;
|
|
127
128
|
loginHeadline: string | null;
|
|
@@ -132,14 +133,30 @@ interface IQAuthBranding {
|
|
|
132
133
|
surfaceColor: string | null;
|
|
133
134
|
textColor: string | null;
|
|
134
135
|
heroImageUrl?: string | null;
|
|
136
|
+
/** Optional full-bleed background image for the `full_bleed` layout. */
|
|
137
|
+
backgroundImageUrl?: string | null;
|
|
135
138
|
tagline?: string | null;
|
|
136
139
|
loginSideCopy?: string | null;
|
|
137
140
|
googleButtonLabel?: string | null;
|
|
138
141
|
customCss?: string | null;
|
|
142
|
+
/** "centered_card" | "split_screen" | "full_bleed" */
|
|
143
|
+
loginLayout?: string | null;
|
|
144
|
+
/** "solid" | "outline" | "ghost" */
|
|
145
|
+
socialButtonStyle?: string | null;
|
|
146
|
+
fontFamilyBody?: string | null;
|
|
147
|
+
fontFamilyHeading?: string | null;
|
|
148
|
+
customFontUrl?: string | null;
|
|
149
|
+
borderRadius?: number | string | null;
|
|
150
|
+
footerText?: string | null;
|
|
151
|
+
emailHeaderImageUrl?: string | null;
|
|
152
|
+
emailSenderName?: string | null;
|
|
153
|
+
emailFooter?: string | null;
|
|
139
154
|
supportEmail?: string | null;
|
|
140
155
|
supportUrl?: string | null;
|
|
141
156
|
termsUrl?: string | null;
|
|
142
157
|
privacyUrl?: string | null;
|
|
158
|
+
/** Composite revision (`${tenantRev}.${appRev}`) for cache-busting. */
|
|
159
|
+
brandingRev?: string | null;
|
|
143
160
|
}
|
|
144
161
|
interface IQAuthSignInContext {
|
|
145
162
|
app: {
|
|
@@ -156,6 +173,13 @@ interface IQAuthSignInContext {
|
|
|
156
173
|
allowedOrigins: string[];
|
|
157
174
|
returnAllowed: boolean;
|
|
158
175
|
branding: IQAuthBranding | null;
|
|
176
|
+
brandingRev?: string | null;
|
|
177
|
+
session?: {
|
|
178
|
+
userId: string;
|
|
179
|
+
email: string;
|
|
180
|
+
name: string;
|
|
181
|
+
authenticatedAt: number;
|
|
182
|
+
} | null;
|
|
159
183
|
}
|
|
160
184
|
interface SharedComponentProps {
|
|
161
185
|
/** Base URL of the IQAuth service (e.g. https://auth.dispositioniq.com). */
|
|
@@ -173,13 +197,44 @@ declare function useIQAuthSignInContext(iqAuthBaseUrl: string, appKey: string, r
|
|
|
173
197
|
loading: boolean;
|
|
174
198
|
error: string | null;
|
|
175
199
|
};
|
|
200
|
+
declare function sanitizeBrandCss(input: string | null | undefined): string;
|
|
201
|
+
/**
|
|
202
|
+
* Fetches the layered tenant/app branding for use by chrome-only SDK
|
|
203
|
+
* components (`<UserButton/>`, `<UserProfile/>`, `<OrganizationSwitcher/>`)
|
|
204
|
+
* that don't go through `<SignIn/>`'s sign-in-context.
|
|
205
|
+
*
|
|
206
|
+
* Cached at module scope for 60s, keyed by URL. The cache is also
|
|
207
|
+
* brandingRev-aware: a newer rev for the same URL replaces older entries
|
|
208
|
+
* even within the TTL window. Returns `null` until first resolution; callers
|
|
209
|
+
* should treat that as "use neutral defaults".
|
|
210
|
+
*
|
|
211
|
+
* Reads `appId` from the IQAuthProvider's session manager (parsed from the
|
|
212
|
+
* publishable key) so per-app branding overrides are layered. Callers may
|
|
213
|
+
* override with the explicit `appId` parameter.
|
|
214
|
+
*/
|
|
215
|
+
declare function useResolvedSdkBranding(iqAuthBaseUrl: string, appId?: string | null): IQAuthBranding | null;
|
|
176
216
|
interface SignInProps extends SharedComponentProps {
|
|
177
217
|
/** URL the IQAuth backend should redirect back to with `?code=...`. Must be in the app's allowed_origins. */
|
|
178
218
|
returnTo: string;
|
|
179
219
|
/** Called after successful redirect. By default, `window.location.href = url`. */
|
|
180
220
|
onRedirect?: (url: string) => void;
|
|
221
|
+
/** Pass `"login"` to force the form to render even when an SSO session is active. */
|
|
222
|
+
prompt?: "login";
|
|
181
223
|
}
|
|
182
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Pure render-decision helper. When this returns `true`, `<SignIn/>` MUST
|
|
226
|
+
* render the silent SSO placeholder instead of the email/password form,
|
|
227
|
+
* even on the very first render before `useEffect` fires. Exported so that
|
|
228
|
+
* smoke tests can verify the no-flash guarantee without standing up a DOM.
|
|
229
|
+
*/
|
|
230
|
+
declare function isSilentSsoEligible(ctx: {
|
|
231
|
+
session?: unknown;
|
|
232
|
+
app: {
|
|
233
|
+
defaultClientId: string | null;
|
|
234
|
+
};
|
|
235
|
+
returnAllowed: boolean;
|
|
236
|
+
} | null | undefined, effectivePrompt: "login" | undefined): boolean;
|
|
237
|
+
declare function SignIn({ iqAuthBaseUrl, appKey, returnTo, onRedirect, className, prompt }: SignInProps): react_jsx_runtime.JSX.Element;
|
|
183
238
|
interface SignUpProps extends SharedComponentProps {
|
|
184
239
|
returnTo?: string;
|
|
185
240
|
onSuccess?: () => void;
|
|
@@ -213,4 +268,4 @@ interface OrganizationSwitcherProps {
|
|
|
213
268
|
declare function OrganizationSwitcher({ iqAuthBaseUrl, onSwitched, className }: OrganizationSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
214
269
|
declare const __version__ = "phase-bc-1.0.0";
|
|
215
270
|
|
|
216
|
-
export { AuthCallback, type AuthCallbackProps, type IQAuthBranding, IQAuthProvider, type IQAuthProviderProps, type IQAuthSignInContext, OrganizationSwitcher, type OrganizationSwitcherProps, RedirectToSignIn, type RedirectToSignInProps, type SessionError, type SharedComponentProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, type UseAuthResult, type UseOrganizationResult, type UseSessionResult, type UseUserResult, UserButton, type UserButtonProps, UserProfile, type UserProfileProps, type UserSummary, __version__, useAuth, useAuthFetch, useIQAuthSignInContext, useOrganization, useSession, useUser };
|
|
271
|
+
export { AuthCallback, type AuthCallbackProps, type IQAuthBranding, IQAuthProvider, type IQAuthProviderProps, type IQAuthSignInContext, OrganizationSwitcher, type OrganizationSwitcherProps, RedirectToSignIn, type RedirectToSignInProps, type SessionError, type SharedComponentProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, type UseAuthResult, type UseOrganizationResult, type UseSessionResult, type UseUserResult, UserButton, type UserButtonProps, UserProfile, type UserProfileProps, type UserSummary, __version__, isSilentSsoEligible, sanitizeBrandCss, useAuth, useAuthFetch, useIQAuthSignInContext, useOrganization, useResolvedSdkBranding, useSession, useUser };
|