@feelflow/ffid-sdk 5.24.1 → 5.24.3
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/{chunk-L5SBAHY3.cjs → chunk-AMVL7J2G.cjs} +65 -36
- package/dist/{chunk-C4RNFEME.js → chunk-O3HGRALD.js} +65 -36
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{ffid-client-DX2PTTFr.d.ts → ffid-client-B-xjtrCb.d.ts} +69 -41
- package/dist/{ffid-client-D0Jh4bO7.d.cts → ffid-client-BjZphrz9.d.cts} +69 -41
- package/dist/{index-GqflEaKi.d.cts → index-BRMn6xT0.d.cts} +77 -1
- package/dist/{index-GqflEaKi.d.ts → index-BRMn6xT0.d.ts} +77 -1
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +17 -45
- package/dist/index.d.ts +17 -45
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +58 -45
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +58 -45
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -270,6 +270,47 @@ interface FFIDServiceAccessDecision {
|
|
|
270
270
|
error?: FFIDServiceAccessError;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Token Store
|
|
275
|
+
*
|
|
276
|
+
* Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
|
|
277
|
+
* Falls back to in-memory storage when localStorage is unavailable
|
|
278
|
+
* (e.g., Safari private browsing mode).
|
|
279
|
+
*/
|
|
280
|
+
/**
|
|
281
|
+
* Token data stored by the token store
|
|
282
|
+
*/
|
|
283
|
+
interface TokenData {
|
|
284
|
+
/** OAuth 2.0 access token */
|
|
285
|
+
accessToken: string;
|
|
286
|
+
/** OAuth 2.0 refresh token */
|
|
287
|
+
refreshToken: string;
|
|
288
|
+
/** Expiration timestamp in milliseconds (Unix epoch) */
|
|
289
|
+
expiresAt: number;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Token store interface for managing OAuth tokens
|
|
293
|
+
*/
|
|
294
|
+
interface TokenStore {
|
|
295
|
+
/** Get stored tokens (null if not stored) */
|
|
296
|
+
getTokens(): TokenData | null;
|
|
297
|
+
/** Store new tokens */
|
|
298
|
+
setTokens(tokens: TokenData): void;
|
|
299
|
+
/** Clear all stored tokens */
|
|
300
|
+
clearTokens(): void;
|
|
301
|
+
/** Check if access token is expired (with 30s buffer) */
|
|
302
|
+
isAccessTokenExpired(): boolean;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Create a token store with the specified storage type.
|
|
306
|
+
*
|
|
307
|
+
* When storageType is 'localStorage' (default in browser), falls back
|
|
308
|
+
* to memory if localStorage is not available (e.g., Safari private mode).
|
|
309
|
+
*
|
|
310
|
+
* @param storageType - 'localStorage' (default) or 'memory'
|
|
311
|
+
*/
|
|
312
|
+
declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
|
|
313
|
+
|
|
273
314
|
/**
|
|
274
315
|
* Billing checkout / portal session types.
|
|
275
316
|
*
|
|
@@ -1608,6 +1649,29 @@ interface FFIDConfig {
|
|
|
1608
1649
|
* @default undefined (no timeout, uses fetch default)
|
|
1609
1650
|
*/
|
|
1610
1651
|
timeout?: number | undefined;
|
|
1652
|
+
/**
|
|
1653
|
+
* Token mode only: inject a shared {@link TokenStore} instance so the SDK and
|
|
1654
|
+
* the host app read/write the *same* token source (#4318).
|
|
1655
|
+
*
|
|
1656
|
+
* By default the client creates its own store internally
|
|
1657
|
+
* (`createTokenStore()` in `token` mode, `createTokenStore('memory')`
|
|
1658
|
+
* otherwise). That is fine when `localStorage` is available, because a
|
|
1659
|
+
* separately-created `localStorage` store still points at the same
|
|
1660
|
+
* `ffid_tokens` key. But when `localStorage` is unavailable (e.g. Safari
|
|
1661
|
+
* Private Mode) the SDK falls back to an *in-memory* store, and a store the
|
|
1662
|
+
* host app creates independently is a **different** object — so the app would
|
|
1663
|
+
* see the user as signed-out even though the SDK holds valid tokens.
|
|
1664
|
+
*
|
|
1665
|
+
* Passing a single instance here (typically `createTokenStore()` created once
|
|
1666
|
+
* by the host) guarantees both sides share one source of truth regardless of
|
|
1667
|
+
* storage backend. Prefer reading the token via `useFFID().getAccessToken()`
|
|
1668
|
+
* so refresh/logout stay reflected without the host polling the store.
|
|
1669
|
+
*
|
|
1670
|
+
* Ignored in `cookie` and `service-key` modes (neither exposes a browser
|
|
1671
|
+
* access-token store). When omitted, behavior is unchanged from previous
|
|
1672
|
+
* versions.
|
|
1673
|
+
*/
|
|
1674
|
+
tokenStore?: TokenStore | undefined;
|
|
1611
1675
|
}
|
|
1612
1676
|
/**
|
|
1613
1677
|
* OIDC `prompt` values the SDK forwards to FFID `/oauth/authorize` (#4027).
|
|
@@ -1850,47 +1914,6 @@ interface FFIDGetLoginHistoryParams {
|
|
|
1850
1914
|
limit?: number;
|
|
1851
1915
|
}
|
|
1852
1916
|
|
|
1853
|
-
/**
|
|
1854
|
-
* Token Store
|
|
1855
|
-
*
|
|
1856
|
-
* Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
|
|
1857
|
-
* Falls back to in-memory storage when localStorage is unavailable
|
|
1858
|
-
* (e.g., Safari private browsing mode).
|
|
1859
|
-
*/
|
|
1860
|
-
/**
|
|
1861
|
-
* Token data stored by the token store
|
|
1862
|
-
*/
|
|
1863
|
-
interface TokenData {
|
|
1864
|
-
/** OAuth 2.0 access token */
|
|
1865
|
-
accessToken: string;
|
|
1866
|
-
/** OAuth 2.0 refresh token */
|
|
1867
|
-
refreshToken: string;
|
|
1868
|
-
/** Expiration timestamp in milliseconds (Unix epoch) */
|
|
1869
|
-
expiresAt: number;
|
|
1870
|
-
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Token store interface for managing OAuth tokens
|
|
1873
|
-
*/
|
|
1874
|
-
interface TokenStore {
|
|
1875
|
-
/** Get stored tokens (null if not stored) */
|
|
1876
|
-
getTokens(): TokenData | null;
|
|
1877
|
-
/** Store new tokens */
|
|
1878
|
-
setTokens(tokens: TokenData): void;
|
|
1879
|
-
/** Clear all stored tokens */
|
|
1880
|
-
clearTokens(): void;
|
|
1881
|
-
/** Check if access token is expired (with 30s buffer) */
|
|
1882
|
-
isAccessTokenExpired(): boolean;
|
|
1883
|
-
}
|
|
1884
|
-
/**
|
|
1885
|
-
* Create a token store with the specified storage type.
|
|
1886
|
-
*
|
|
1887
|
-
* When storageType is 'localStorage' (default in browser), falls back
|
|
1888
|
-
* to memory if localStorage is not available (e.g., Safari private mode).
|
|
1889
|
-
*
|
|
1890
|
-
* @param storageType - 'localStorage' (default) or 'memory'
|
|
1891
|
-
*/
|
|
1892
|
-
declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
|
|
1893
|
-
|
|
1894
1917
|
/** OAuth token operations - exchangeCodeForTokens / refreshAccessToken / signOutToken */
|
|
1895
1918
|
|
|
1896
1919
|
/**
|
|
@@ -2065,6 +2088,11 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
2065
2088
|
};
|
|
2066
2089
|
/** Token store (token mode only) */
|
|
2067
2090
|
tokenStore: TokenStore;
|
|
2091
|
+
/**
|
|
2092
|
+
* Return the currently-valid access token, or null (token mode only; #4318).
|
|
2093
|
+
* Live-reads the store and applies the 30s expiry buffer.
|
|
2094
|
+
*/
|
|
2095
|
+
getAccessToken: () => string | null;
|
|
2068
2096
|
/** Resolved auth mode */
|
|
2069
2097
|
authMode: FFIDAuthMode;
|
|
2070
2098
|
/** Resolved logger instance */
|
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Token Store
|
|
6
|
+
*
|
|
7
|
+
* Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
|
|
8
|
+
* Falls back to in-memory storage when localStorage is unavailable
|
|
9
|
+
* (e.g., Safari private browsing mode).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Token data stored by the token store
|
|
13
|
+
*/
|
|
14
|
+
interface TokenData {
|
|
15
|
+
/** OAuth 2.0 access token */
|
|
16
|
+
accessToken: string;
|
|
17
|
+
/** OAuth 2.0 refresh token */
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
/** Expiration timestamp in milliseconds (Unix epoch) */
|
|
20
|
+
expiresAt: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Token store interface for managing OAuth tokens
|
|
24
|
+
*/
|
|
25
|
+
interface TokenStore {
|
|
26
|
+
/** Get stored tokens (null if not stored) */
|
|
27
|
+
getTokens(): TokenData | null;
|
|
28
|
+
/** Store new tokens */
|
|
29
|
+
setTokens(tokens: TokenData): void;
|
|
30
|
+
/** Clear all stored tokens */
|
|
31
|
+
clearTokens(): void;
|
|
32
|
+
/** Check if access token is expired (with 30s buffer) */
|
|
33
|
+
isAccessTokenExpired(): boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a token store with the specified storage type.
|
|
37
|
+
*
|
|
38
|
+
* When storageType is 'localStorage' (default in browser), falls back
|
|
39
|
+
* to memory if localStorage is not available (e.g., Safari private mode).
|
|
40
|
+
*
|
|
41
|
+
* @param storageType - 'localStorage' (default) or 'memory'
|
|
42
|
+
*/
|
|
43
|
+
declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
|
|
44
|
+
|
|
4
45
|
/** Cache adapter interface for FFID SDK token verification */
|
|
5
46
|
/**
|
|
6
47
|
* Pluggable cache adapter interface.
|
|
@@ -474,6 +515,29 @@ interface FFIDConfig {
|
|
|
474
515
|
* @default undefined (no timeout, uses fetch default)
|
|
475
516
|
*/
|
|
476
517
|
timeout?: number | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* Token mode only: inject a shared {@link TokenStore} instance so the SDK and
|
|
520
|
+
* the host app read/write the *same* token source (#4318).
|
|
521
|
+
*
|
|
522
|
+
* By default the client creates its own store internally
|
|
523
|
+
* (`createTokenStore()` in `token` mode, `createTokenStore('memory')`
|
|
524
|
+
* otherwise). That is fine when `localStorage` is available, because a
|
|
525
|
+
* separately-created `localStorage` store still points at the same
|
|
526
|
+
* `ffid_tokens` key. But when `localStorage` is unavailable (e.g. Safari
|
|
527
|
+
* Private Mode) the SDK falls back to an *in-memory* store, and a store the
|
|
528
|
+
* host app creates independently is a **different** object — so the app would
|
|
529
|
+
* see the user as signed-out even though the SDK holds valid tokens.
|
|
530
|
+
*
|
|
531
|
+
* Passing a single instance here (typically `createTokenStore()` created once
|
|
532
|
+
* by the host) guarantees both sides share one source of truth regardless of
|
|
533
|
+
* storage backend. Prefer reading the token via `useFFID().getAccessToken()`
|
|
534
|
+
* so refresh/logout stay reflected without the host polling the store.
|
|
535
|
+
*
|
|
536
|
+
* Ignored in `cookie` and `service-key` modes (neither exposes a browser
|
|
537
|
+
* access-token store). When omitted, behavior is unchanged from previous
|
|
538
|
+
* versions.
|
|
539
|
+
*/
|
|
540
|
+
tokenStore?: TokenStore | undefined;
|
|
477
541
|
}
|
|
478
542
|
/**
|
|
479
543
|
* FFID JWT claims structure (minimal payload).
|
|
@@ -556,6 +620,18 @@ interface FFIDContextValue {
|
|
|
556
620
|
switchOrganization: (organizationId: string) => void;
|
|
557
621
|
/** Refresh session data */
|
|
558
622
|
refresh: () => Promise<void>;
|
|
623
|
+
/**
|
|
624
|
+
* Token mode: return the currently-stored access token, or `null` when there
|
|
625
|
+
* is none, it is empty, or it is expired (30s buffer, same as
|
|
626
|
+
* `TokenStore.isAccessTokenExpired`). Reads the store live on every call, so a
|
|
627
|
+
* token the SDK refreshed in the background is reflected without the host
|
|
628
|
+
* caching or polling it (#4318).
|
|
629
|
+
*
|
|
630
|
+
* Always returns `null` in `cookie` / `service-key` mode (no browser access
|
|
631
|
+
* token to expose). This is a stable function reference — safe to call in
|
|
632
|
+
* render or event handlers without adding it to effect dependency arrays.
|
|
633
|
+
*/
|
|
634
|
+
getAccessToken: () => string | null;
|
|
559
635
|
}
|
|
560
636
|
/**
|
|
561
637
|
* Subscription context value
|
|
@@ -1526,4 +1602,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1526
1602
|
}
|
|
1527
1603
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1528
1604
|
|
|
1529
|
-
export { type
|
|
1605
|
+
export { type FFIDInquiryFormSubmitData as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type TokenStore as T, type FFIDInquiryFormCategoryItem as U, type FFIDInquiryFormClassNames as V, type FFIDInquiryFormLegalLayout as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDPrompt as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDOAuthTokenResponse as a3, type FFIDOAuthUserInfoMemberRole as a4, FFIDOrganizationSwitcher as a5, type FFIDRedirectErrorCode as a6, type FFIDSeatModel as a7, type FFIDServiceAccessDenialReason as a8, type FFIDServiceAccessFailPolicy as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type TokenData as af, type UseFFIDAnnouncementsOptions as ag, type UseFFIDAnnouncementsReturn as ah, createTokenStore as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Token Store
|
|
6
|
+
*
|
|
7
|
+
* Manages OAuth 2.0 tokens (access + refresh) with dual-storage support.
|
|
8
|
+
* Falls back to in-memory storage when localStorage is unavailable
|
|
9
|
+
* (e.g., Safari private browsing mode).
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Token data stored by the token store
|
|
13
|
+
*/
|
|
14
|
+
interface TokenData {
|
|
15
|
+
/** OAuth 2.0 access token */
|
|
16
|
+
accessToken: string;
|
|
17
|
+
/** OAuth 2.0 refresh token */
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
/** Expiration timestamp in milliseconds (Unix epoch) */
|
|
20
|
+
expiresAt: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Token store interface for managing OAuth tokens
|
|
24
|
+
*/
|
|
25
|
+
interface TokenStore {
|
|
26
|
+
/** Get stored tokens (null if not stored) */
|
|
27
|
+
getTokens(): TokenData | null;
|
|
28
|
+
/** Store new tokens */
|
|
29
|
+
setTokens(tokens: TokenData): void;
|
|
30
|
+
/** Clear all stored tokens */
|
|
31
|
+
clearTokens(): void;
|
|
32
|
+
/** Check if access token is expired (with 30s buffer) */
|
|
33
|
+
isAccessTokenExpired(): boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a token store with the specified storage type.
|
|
37
|
+
*
|
|
38
|
+
* When storageType is 'localStorage' (default in browser), falls back
|
|
39
|
+
* to memory if localStorage is not available (e.g., Safari private mode).
|
|
40
|
+
*
|
|
41
|
+
* @param storageType - 'localStorage' (default) or 'memory'
|
|
42
|
+
*/
|
|
43
|
+
declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
|
|
44
|
+
|
|
4
45
|
/** Cache adapter interface for FFID SDK token verification */
|
|
5
46
|
/**
|
|
6
47
|
* Pluggable cache adapter interface.
|
|
@@ -474,6 +515,29 @@ interface FFIDConfig {
|
|
|
474
515
|
* @default undefined (no timeout, uses fetch default)
|
|
475
516
|
*/
|
|
476
517
|
timeout?: number | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* Token mode only: inject a shared {@link TokenStore} instance so the SDK and
|
|
520
|
+
* the host app read/write the *same* token source (#4318).
|
|
521
|
+
*
|
|
522
|
+
* By default the client creates its own store internally
|
|
523
|
+
* (`createTokenStore()` in `token` mode, `createTokenStore('memory')`
|
|
524
|
+
* otherwise). That is fine when `localStorage` is available, because a
|
|
525
|
+
* separately-created `localStorage` store still points at the same
|
|
526
|
+
* `ffid_tokens` key. But when `localStorage` is unavailable (e.g. Safari
|
|
527
|
+
* Private Mode) the SDK falls back to an *in-memory* store, and a store the
|
|
528
|
+
* host app creates independently is a **different** object — so the app would
|
|
529
|
+
* see the user as signed-out even though the SDK holds valid tokens.
|
|
530
|
+
*
|
|
531
|
+
* Passing a single instance here (typically `createTokenStore()` created once
|
|
532
|
+
* by the host) guarantees both sides share one source of truth regardless of
|
|
533
|
+
* storage backend. Prefer reading the token via `useFFID().getAccessToken()`
|
|
534
|
+
* so refresh/logout stay reflected without the host polling the store.
|
|
535
|
+
*
|
|
536
|
+
* Ignored in `cookie` and `service-key` modes (neither exposes a browser
|
|
537
|
+
* access-token store). When omitted, behavior is unchanged from previous
|
|
538
|
+
* versions.
|
|
539
|
+
*/
|
|
540
|
+
tokenStore?: TokenStore | undefined;
|
|
477
541
|
}
|
|
478
542
|
/**
|
|
479
543
|
* FFID JWT claims structure (minimal payload).
|
|
@@ -556,6 +620,18 @@ interface FFIDContextValue {
|
|
|
556
620
|
switchOrganization: (organizationId: string) => void;
|
|
557
621
|
/** Refresh session data */
|
|
558
622
|
refresh: () => Promise<void>;
|
|
623
|
+
/**
|
|
624
|
+
* Token mode: return the currently-stored access token, or `null` when there
|
|
625
|
+
* is none, it is empty, or it is expired (30s buffer, same as
|
|
626
|
+
* `TokenStore.isAccessTokenExpired`). Reads the store live on every call, so a
|
|
627
|
+
* token the SDK refreshed in the background is reflected without the host
|
|
628
|
+
* caching or polling it (#4318).
|
|
629
|
+
*
|
|
630
|
+
* Always returns `null` in `cookie` / `service-key` mode (no browser access
|
|
631
|
+
* token to expose). This is a stable function reference — safe to call in
|
|
632
|
+
* render or event handlers without adding it to effect dependency arrays.
|
|
633
|
+
*/
|
|
634
|
+
getAccessToken: () => string | null;
|
|
559
635
|
}
|
|
560
636
|
/**
|
|
561
637
|
* Subscription context value
|
|
@@ -1526,4 +1602,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1526
1602
|
}
|
|
1527
1603
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1528
1604
|
|
|
1529
|
-
export { type
|
|
1605
|
+
export { type FFIDInquiryFormSubmitData as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, EFFECTIVE_SUBSCRIPTION_STATUSES as G, FFIDAnnouncementBadge as H, FFIDAnnouncementList as I, type FFIDAnnouncementsError as J, type FFIDAnnouncementsErrorCode as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsServerResponse as M, type FFIDApiResponseMeta as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type TokenStore as T, type FFIDInquiryFormCategoryItem as U, type FFIDInquiryFormClassNames as V, type FFIDInquiryFormLegalLayout as W, type FFIDInquiryFormOrganization as X, type FFIDInquiryFormPlaceholderContext as Y, type FFIDInquiryFormPrefill as Z, type FFIDInquiryFormProps as _, type FFIDPrompt as a, type FFIDInquiryFormSubmitResult as a0, type FFIDJwtClaims as a1, FFIDLoginButton as a2, type FFIDOAuthTokenResponse as a3, type FFIDOAuthUserInfoMemberRole as a4, FFIDOrganizationSwitcher as a5, type FFIDRedirectErrorCode as a6, type FFIDSeatModel as a7, type FFIDServiceAccessDenialReason as a8, type FFIDServiceAccessFailPolicy as a9, FFIDSubscriptionBadge as aa, type FFIDTokenIntrospectionResponse as ab, FFIDUserMenu as ac, FFID_INQUIRY_CATEGORIES as ad, FFID_INQUIRY_CATEGORIES_SITE_2026 as ae, type TokenData as af, type UseFFIDAnnouncementsOptions as ag, type UseFFIDAnnouncementsReturn as ah, createTokenStore as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDSignOutResult as e, type FFIDRedirectResult as f, type FFIDError as g, type FFIDSubscriptionCheckResponse as h, type FFIDCheckServiceAccessParams as i, type FFIDServiceAccessDecision as j, type FFIDAnalyticsConfig as k, type FFIDVerifyAccessTokenOptions as l, type FFIDOAuthUserInfo as m, type FFIDInquiryCreateParams as n, type FFIDInquiryCreateResponse as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDOAuthUserInfoSubscription as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAMVL7J2G_cjs = require('./chunk-AMVL7J2G.cjs');
|
|
4
4
|
var chunkH5O2CCAY_cjs = require('./chunk-H5O2CCAY.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -54,8 +54,8 @@ function defaultRedirect(url) {
|
|
|
54
54
|
}
|
|
55
55
|
function useRequireActiveSubscription(options) {
|
|
56
56
|
const { redirectTo, allowGrace = true, onRedirect } = options;
|
|
57
|
-
const { isLoading, error } =
|
|
58
|
-
const { effectiveStatus, isBlocked, isGrace } =
|
|
57
|
+
const { isLoading, error } = chunkAMVL7J2G_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkAMVL7J2G_cjs.useSubscription();
|
|
59
59
|
const hasFetchError = error !== null && effectiveStatus === null;
|
|
60
60
|
const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
|
|
61
61
|
react.useEffect(() => {
|
|
@@ -76,7 +76,7 @@ function useRequireActiveSubscription(options) {
|
|
|
76
76
|
}
|
|
77
77
|
function withFFIDAuth(Component, options = {}) {
|
|
78
78
|
const WrappedComponent = (props) => {
|
|
79
|
-
const { isLoading, isAuthenticated, login } =
|
|
79
|
+
const { isLoading, isAuthenticated, login } = chunkAMVL7J2G_cjs.useFFIDContext();
|
|
80
80
|
const hasRedirected = react.useRef(false);
|
|
81
81
|
react.useEffect(() => {
|
|
82
82
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -105,155 +105,155 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
|
105
105
|
|
|
106
106
|
Object.defineProperty(exports, "ACCESS_GRANTING_EFFECTIVE_STATUSES", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkAMVL7J2G_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkAMVL7J2G_cjs.BLOCKING_EFFECTIVE_STATUSES; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkAMVL7J2G_cjs.DEFAULT_API_BASE_URL; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkAMVL7J2G_cjs.DEFAULT_OAUTH_SCOPES; }
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "EFFECTIVE_SUBSCRIPTION_STATUSES", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkAMVL7J2G_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDAnnouncementBadge; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDAnnouncementList; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDInquiryForm; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDLoginButton; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDOrganizationSwitcher; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDProvider; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDSDKError; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDSubscriptionBadge; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkAMVL7J2G_cjs.FFIDUserMenu; }
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
164
|
+
get: function () { return chunkAMVL7J2G_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
165
165
|
});
|
|
166
166
|
Object.defineProperty(exports, "FFID_ERROR_CODES", {
|
|
167
167
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkAMVL7J2G_cjs.FFID_ERROR_CODES; }
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkAMVL7J2G_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkAMVL7J2G_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
177
177
|
});
|
|
178
178
|
Object.defineProperty(exports, "clearState", {
|
|
179
179
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkAMVL7J2G_cjs.cleanupStateStorage; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkAMVL7J2G_cjs.computeEffectiveStatusFromSession; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkAMVL7J2G_cjs.createFFIDAnnouncementsClient; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkAMVL7J2G_cjs.createFFIDClient; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "createTokenStore", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkAMVL7J2G_cjs.createTokenStore; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkAMVL7J2G_cjs.generateCodeChallenge; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkAMVL7J2G_cjs.generateCodeVerifier; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "handleRedirectCallback", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkAMVL7J2G_cjs.handleRedirectCallback; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkAMVL7J2G_cjs.hasAccessFromUserinfo; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkAMVL7J2G_cjs.isBlockedFromUserinfo; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkAMVL7J2G_cjs.isFFIDInquiryCategorySite2026; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkAMVL7J2G_cjs.normalizeRedirectUri; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkAMVL7J2G_cjs.retrieveCodeVerifier; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "retrieveState", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkAMVL7J2G_cjs.retrieveState; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunkAMVL7J2G_cjs.storeCodeVerifier; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "storeState", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunkAMVL7J2G_cjs.storeState; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "useFFID", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunkAMVL7J2G_cjs.useFFID; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunkAMVL7J2G_cjs.useFFIDAnnouncements; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "useSubscription", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkAMVL7J2G_cjs.useSubscription; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "withSubscription", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunkAMVL7J2G_cjs.withSubscription; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
259
259
|
enumerable: true,
|