@feelflow/ffid-sdk 10.0.0 → 11.0.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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDOAuthUserInfoSubscription, a as FFIDAccountType, b as FFIDPrompt, c as FFIDConfig, d as FFIDApiResponse, e as FFIDSessionResponse, f as FFIDSignOutResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDSeatsSummary, m as FFIDListPlansResponse, n as FFIDPublishedCatalog, o as FFIDSubscriptionDetail, p as FFIDSubscribeParams, q as FFIDSubscribeResponse, r as FFIDChangePlanParams, s as FFIDChangePlanResponse, t as FFIDCancelSubscriptionParams, u as FFIDCancelSubscriptionResponse, v as FFIDCancelPendingDowngradeResponse, w as FFIDPreviewPlanChangeParams, x as FFIDPlanChangePreviewResponse, y as FFIDPreviewSeatChangeParams, z as FFIDSeatChangePreviewResponse, A as FFIDVerifyAccessTokenOptions, B as FFIDOAuthUserInfo, C as FFIDInquiryCreateParams, D as FFIDInquiryCreateResponse, E as FFIDCreditBalance, G as FFIDListCreditHistoryOptions, H as FFIDCreditHistoryPage, I as FFIDCreditPackList, J as FFIDCreatePackCheckoutParams, K as FFIDCreditPackCheckout, L as FFIDCreditConsumeParams, M as FFIDCreditConsumeResult, N as FFIDBuyCreditsUrlParams, T as TokenStore, O as FFIDAuthMode, P as FFIDLogger, Q as FFIDCacheAdapter, R as FFIDUser, S as FFIDOrganization, U as FFIDSubscription, V as FFIDSubscriptionContextValue, W as EffectiveSubscriptionStatus, X as FFIDSubscriptionStatus, Y as FFIDCatalogEnvironment, Z as FFIDBillingInterval, _ as FFIDTaxBehavior, $ as FFIDAnnouncementsClientConfig, a0 as ListAnnouncementsOptions, a1 as FFIDAnnouncementsApiResponse, a2 as AnnouncementListResponse, a3 as FFIDAnnouncementsLogger } from './index-KjewcNn1.cjs';
2
- export { a4 as Announcement, a5 as AnnouncementStatus, a6 as AnnouncementType, a7 as EFFECTIVE_SUBSCRIPTION_STATUSES, a8 as FFIDAnnouncementBadge, a9 as FFIDAnnouncementList, aa as FFIDAnnouncementsError, ab as FFIDAnnouncementsErrorCode, ac as FFIDAnnouncementsServerResponse, ad as FFIDApiResponseMeta, ae as FFIDCacheConfig, af as FFIDCatalogPublication, ag as FFIDCatalogPublicationStatus, ah as FFIDContextValue, ai as FFIDCreditBreakdown, aj as FFIDCreditGrantKind, ak as FFIDCreditHistoryItem, al as FFIDCreditHistoryType, am as FFIDCreditPack, an as FFIDCreditsInsufficientDetails, ao as FFIDInquiryAcquisitionSource, ap as FFIDInquiryCategory, aq as FFIDInquiryCategorySite2026, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aB as FFIDJwtClaims, aC as FFIDLoginButton, aD as FFIDOAuthUserInfoMemberRole, aE as FFIDOrganizationSwitcher, aF as FFIDPlanChangeLineItem, aG as FFIDPlanChangePreview, aH as FFIDPlanInfo, aI as FFIDPricingModel, aJ as FFIDPublishedPlan, aK as FFIDSeatAssignmentClaim, aL as FFIDSeatAssignmentStatus, aM as FFIDSeatChangeLineItem, aN as FFIDSeatChangePreview, aO as FFIDSeatModel, aP as FFIDServiceAccessDenialReason, aQ as FFIDServiceAccessFailPolicy, aR as FFIDServiceInfo, aS as FFIDSubscriptionBadge, aT as FFIDSubscriptionCheckCredits, aU as FFIDSubscriptionSummary, aV as FFIDSupportedCurrency, aW as FFIDUserMenu, aX as FFID_CATALOG_ENVIRONMENTS, aY as FFID_CATALOG_PUBLICATION_STATUSES, aZ as FFID_CREDITS_CONSUME_MAX_AMOUNT, a_ as FFID_CREDITS_CONSUME_MIN_AMOUNT, a$ as FFID_CREDITS_FEATURE_PATTERN, b0 as FFID_CREDITS_HISTORY_DEFAULT_LIMIT, b1 as FFID_CREDITS_HISTORY_MAX_LIMIT, b2 as FFID_CREDITS_HISTORY_MIN_LIMIT, b3 as FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, b4 as FFID_CREDITS_LOW_THRESHOLD_PERCENT, b5 as FFID_CREDITS_METADATA_MAX_BYTES, b6 as FFID_CREDIT_GRANT_KINDS, b7 as FFID_CREDIT_HISTORY_TYPES, b8 as FFID_CREDIT_PACK_MAX_QUANTITY, b9 as FFID_CREDIT_PACK_MIN_QUANTITY, ba as FFID_INQUIRY_ACQUISITION_SOURCES, bb as FFID_INQUIRY_CATEGORIES, bc as FFID_INQUIRY_CATEGORIES_SITE_2026, bd as TokenData, be as UseFFIDAnnouncementsOptions, bf as UseFFIDAnnouncementsReturn, bg as createTokenStore, bh as isFFIDInquiryAcquisitionSource, bi as isFFIDInquiryCategorySite2026, bj as useFFIDAnnouncements } from './index-KjewcNn1.cjs';
1
+ import { F as FFIDOAuthUserInfoSubscription, a as FFIDAccountType, b as FFIDPrompt, c as FFIDConfig, d as FFIDApiResponse, e as FFIDSessionResponse, f as FFIDSignOutResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDSeatsSummary, m as FFIDListPlansResponse, n as FFIDPublishedCatalog, o as FFIDSubscriptionDetail, p as FFIDSubscribeParams, q as FFIDSubscribeResponse, r as FFIDChangePlanParams, s as FFIDChangePlanResponse, t as FFIDCancelSubscriptionParams, u as FFIDCancelSubscriptionResponse, v as FFIDCancelPendingDowngradeResponse, w as FFIDPreviewPlanChangeParams, x as FFIDPlanChangePreviewResponse, y as FFIDPreviewSeatChangeParams, z as FFIDSeatChangePreviewResponse, A as FFIDVerifyAccessTokenOptions, B as FFIDOAuthUserInfo, C as FFIDInquiryCreateParams, D as FFIDInquiryCreateResponse, E as FFIDCreditBalance, G as FFIDListCreditHistoryOptions, H as FFIDCreditHistoryPage, I as FFIDCreditPackList, J as FFIDCreatePackCheckoutParams, K as FFIDCreditPackCheckout, L as FFIDCreditConsumeParams, M as FFIDCreditConsumeResult, N as FFIDBuyCreditsUrlParams, T as TokenStore, O as FFIDAuthMode, P as FFIDLogger, Q as FFIDCacheAdapter, R as FFIDUser, S as FFIDOrganization, U as FFIDSubscription, V as FFIDSubscriptionContextValue, W as EffectiveSubscriptionStatus, X as FFIDSubscriptionStatus, Y as FFIDCatalogEnvironment, Z as FFIDBillingInterval, _ as FFIDTaxBehavior, $ as FFIDAnnouncementsClientConfig, a0 as ListAnnouncementsOptions, a1 as FFIDAnnouncementsApiResponse, a2 as AnnouncementListResponse, a3 as FFIDAnnouncementsLogger } from './index-BknVfXhZ.cjs';
2
+ export { a4 as Announcement, a5 as AnnouncementStatus, a6 as AnnouncementType, a7 as EFFECTIVE_SUBSCRIPTION_STATUSES, a8 as FFIDAnnouncementBadge, a9 as FFIDAnnouncementList, aa as FFIDAnnouncementsError, ab as FFIDAnnouncementsErrorCode, ac as FFIDAnnouncementsServerResponse, ad as FFIDApiResponseMeta, ae as FFIDCacheConfig, af as FFIDCatalogPublication, ag as FFIDCatalogPublicationStatus, ah as FFIDContextValue, ai as FFIDCreditBreakdown, aj as FFIDCreditGrantKind, ak as FFIDCreditHistoryItem, al as FFIDCreditHistoryType, am as FFIDCreditPack, an as FFIDCreditsInsufficientDetails, ao as FFIDInquiryAcquisitionSource, ap as FFIDInquiryCategory, aq as FFIDInquiryCategorySite2026, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aB as FFIDJwtClaims, aC as FFIDLoginButton, aD as FFIDOAuthUserInfoMemberRole, aE as FFIDOrganizationSwitcher, aF as FFIDPlanChangeLineItem, aG as FFIDPlanChangePreview, aH as FFIDPlanInfo, aI as FFIDPricingModel, aJ as FFIDPublishedPlan, aK as FFIDSeatAssignmentClaim, aL as FFIDSeatAssignmentStatus, aM as FFIDSeatChangeLineItem, aN as FFIDSeatChangePreview, aO as FFIDSeatModel, aP as FFIDServiceAccessDenialReason, aQ as FFIDServiceAccessFailPolicy, aR as FFIDServiceInfo, aS as FFIDSubscriptionBadge, aT as FFIDSubscriptionCheckCredits, aU as FFIDSubscriptionSummary, aV as FFIDSupportedCurrency, aW as FFIDUserMenu, aX as FFID_CATALOG_ENVIRONMENTS, aY as FFID_CATALOG_PUBLICATION_STATUSES, aZ as FFID_CREDITS_CONSUME_MAX_AMOUNT, a_ as FFID_CREDITS_CONSUME_MIN_AMOUNT, a$ as FFID_CREDITS_FEATURE_PATTERN, b0 as FFID_CREDITS_HISTORY_DEFAULT_LIMIT, b1 as FFID_CREDITS_HISTORY_MAX_LIMIT, b2 as FFID_CREDITS_HISTORY_MIN_LIMIT, b3 as FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, b4 as FFID_CREDITS_LOW_THRESHOLD_PERCENT, b5 as FFID_CREDITS_METADATA_MAX_BYTES, b6 as FFID_CREDIT_GRANT_KINDS, b7 as FFID_CREDIT_HISTORY_TYPES, b8 as FFID_CREDIT_PACK_MAX_QUANTITY, b9 as FFID_CREDIT_PACK_MIN_QUANTITY, ba as FFID_INQUIRY_ACQUISITION_SOURCES, bb as FFID_INQUIRY_CATEGORIES, bc as FFID_INQUIRY_CATEGORIES_SITE_2026, bd as TokenData, be as UseFFIDAnnouncementsOptions, bf as UseFFIDAnnouncementsReturn, bg as createTokenStore, bh as isFFIDInquiryAcquisitionSource, bi as isFFIDInquiryCategorySite2026, bj as useFFIDAnnouncements } from './index-BknVfXhZ.cjs';
3
3
  export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, n as FFIDAnalyticsProvider, o as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, q as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, v as FFIDConsentError, w as FFIDConsentErrorCode, x as FFIDConsentMergeStrategy, z as FFIDConsentMergeWarning, B as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, H as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, L as FFIDCookieBanner, M as FFIDCookieBannerClassNames, N as FFIDCookieBannerProps, O as FFIDCookieLink, Q as FFIDCookieLinkProps, f as FFIDCookiePolicy, S as FFIDCookieSettings, T as FFIDCookieSettingsClassNames, U as FFIDCookieSettingsProps, Z as FFID_CONSENT_ERROR_CODES, ad as UseFFIDConsentPreferencesReturn, ae as UseFFIDConsentReturn, af as clearConsentDismissalTimestamp, ai as decodeConsentCookie, ak as encodeConsentCookie, am as readConsentCookie, an as readConsentDismissalTimestamp, ap as useFFIDConsent, aq as useFFIDConsentPreferences, ar as writeConsentCookie, as as writeConsentDismissalTimestamp } from './FFIDCookieLink-yt5SUr-W.cjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode, ComponentType, FC } from 'react';
@@ -207,9 +207,18 @@ interface FFIDAddMemberRequest {
207
207
  interface FFIDAddMemberParams extends FFIDAddMemberRequest {
208
208
  organizationId: string;
209
209
  }
210
+ /** Seat assignment outcome after membership creation; membership exists in every case. */
211
+ type FFIDMemberSeatAssignmentResult = 'assigned' | 'not_applicable' | 'member_limit_reached' | 'failed';
210
212
  /** Response from addMember (ext) */
211
213
  interface FFIDAddMemberResponse {
212
214
  member: FFIDOrganizationMember;
215
+ /**
216
+ * Membership creation can succeed even when seat assignment fails.
217
+ * Omitted by older servers. `not_applicable`/undefined do not prove an active seat.
218
+ * Check the authenticated user's hasAccess and seatAssigned before granting access;
219
+ * do not automatically restore a removed seat on a duplicate-member retry.
220
+ */
221
+ seatAssignment?: FFIDMemberSeatAssignmentResult;
213
222
  }
214
223
  /** Response from updateMemberRole (ext) */
215
224
  interface FFIDUpdateMemberRoleResponse {
@@ -737,6 +746,12 @@ interface FFIDInviteMemberRequest {
737
746
  email: string;
738
747
  /** Role to assign on acceptance (defaults to `member` server-side) */
739
748
  role?: FFIDAssignableMemberRole;
749
+ /**
750
+ * FFID user id recorded as the inviter (FFID #6279). Must be an active owner / admin
751
+ * of the organization. Omit in `token` mode (the signed-in user is recorded); when
752
+ * omitted in `service-key` mode the organization owner is recorded.
753
+ */
754
+ inviterUserId?: string;
740
755
  }
741
756
  /**
742
757
  * Response from inviteMember (ext).
@@ -1390,6 +1405,7 @@ type FFIDSubscriptionErrorCode = (typeof FFID_SUBSCRIPTION_ERROR_CODES)[keyof ty
1390
1405
  * Do not retry automatically; show the credit purchase path.
1391
1406
  * - `CREDITS_IDEMPOTENCY_CONFLICT` (409): the same idempotency key with another amount.
1392
1407
  * A caller bug — do not retry.
1408
+ * - `CREDITS_TURN_CANCELLED` (409): a failed chatbot attempt was cancelled; use a new attempt key.
1393
1409
  * - `CREDITS_NOT_APPLICABLE` (409): the contract's plan is per_seat (not credit-based).
1394
1410
  * - `CREDITS_BALANCE_CAP_EXCEEDED` (409): a grant would push the balance over the cap.
1395
1411
  * - `SEAT_BILLING_NOT_APPLICABLE` (409): seat-count changes on a flat contract.
@@ -1408,6 +1424,7 @@ type FFIDSubscriptionErrorCode = (typeof FFID_SUBSCRIPTION_ERROR_CODES)[keyof ty
1408
1424
  declare const FFID_CREDITS_ERROR_CODES: {
1409
1425
  readonly CREDITS_INSUFFICIENT: "CREDITS_INSUFFICIENT";
1410
1426
  readonly CREDITS_IDEMPOTENCY_CONFLICT: "CREDITS_IDEMPOTENCY_CONFLICT";
1427
+ readonly CREDITS_TURN_CANCELLED: "CREDITS_TURN_CANCELLED";
1411
1428
  readonly CREDITS_NOT_APPLICABLE: "CREDITS_NOT_APPLICABLE";
1412
1429
  readonly CREDITS_BALANCE_CAP_EXCEEDED: "CREDITS_BALANCE_CAP_EXCEEDED";
1413
1430
  readonly SEAT_BILLING_NOT_APPLICABLE: "SEAT_BILLING_NOT_APPLICABLE";
@@ -1498,6 +1515,7 @@ declare function createFFIDClient(config: FFIDConfig): {
1498
1515
  organizationId: string;
1499
1516
  email: string;
1500
1517
  role?: FFIDAssignableMemberRole;
1518
+ inviterUserId?: string;
1501
1519
  }) => Promise<FFIDApiResponse<FFIDInviteMemberResponse>>;
1502
1520
  leaveOrganization: (params: FFIDLeaveOrganizationParams) => Promise<FFIDApiResponse<FFIDLeaveOrganizationResponse>>;
1503
1521
  getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
@@ -1604,6 +1622,10 @@ declare class FFIDSDKError extends Error {
1604
1622
  * validates the OAuth `state` against the value persisted at authorize time
1605
1623
  * (CSRF protection, RFC 6749 §10.12), retrieves the PKCE verifier, exchanges
1606
1624
  * the code for tokens, and cleans the params out of the URL on success.
1625
+ *
1626
+ * When FFID refused the user, the callback carries `error` (+ FFID's
1627
+ * `denial_reason`) instead of `code` (#6523). After the same `state` check the
1628
+ * error is returned as an authorization error (see `./authorization-error`).
1607
1629
  */
1608
1630
 
1609
1631
  /**
@@ -1621,8 +1643,9 @@ interface HandleRedirectCallbackOptions {
1621
1643
  url?: string | undefined;
1622
1644
  /**
1623
1645
  * Whether to remove `code` / `state` from the browser URL via
1624
- * `window.history.replaceState` after a successful exchange. Defaults to
1625
- * `true`.
1646
+ * `window.history.replaceState` after a successful exchange — and, on an
1647
+ * authorization error, `state` only (#6523; see {@link ERROR_CALLBACK_CONSUMED_PARAMS}).
1648
+ * Defaults to `true`.
1626
1649
  *
1627
1650
  * Set to `false` to take over URL cleanup on the consumer side. This matters
1628
1651
  * on Next.js App Router: the App Router patches `history.replaceState`, so
@@ -1642,7 +1665,9 @@ interface HandleRedirectCallbackOptions {
1642
1665
  * Complete an OAuth authorization-code redirect.
1643
1666
  *
1644
1667
  * Behavior:
1645
- * 1. Reads `code` + `state` from `options.url ?? window.location.search`.
1668
+ * 1. Reads `code` + `state` (or `error`) from `options.url ?? window.location.search`.
1669
+ * A URL with no `code` — and no `error` carrying a `state` — returns
1670
+ * `MISSING_AUTHORIZATION_CODE` without touching the stored state.
1646
1671
  * 2. CSRF guard: if a `state` exists on EITHER side (a stored state from
1647
1672
  * authorize OR a `state` on the callback URL), the two MUST match — mismatch,
1648
1673
  * a missing stored state, or an **omitted** callback `state` all **fail closed**
@@ -1652,6 +1677,17 @@ interface HandleRedirectCallbackOptions {
1652
1677
  * 3. Retrieves the PKCE verifier and exchanges the code for tokens.
1653
1678
  * 4. On success, removes `code` + `state` from the browser URL (skipped when
1654
1679
  * `options.cleanUrl` is `false` — the consumer then owns URL cleanup).
1680
+ * 5. When the URL carries `error` **and** `state` (FFID refused the user),
1681
+ * returns it as an authorization error after step 2 instead of exchanging
1682
+ * anything. Unlike a code callback there is no no-state leniency: the URL
1683
+ * `state` must match a stored one, so a crafted `?error=...&error_description=`
1684
+ * link cannot be shown as a denial (content spoofing). `code` is
1685
+ * the OAuth `error` (e.g. `access_denied`) and `details` holds FFID's
1686
+ * `denial_reason` — read it with `getFFIDAuthorizationError`. The PKCE
1687
+ * verifier is discarded and the consumed `state` is removed from the URL
1688
+ * (same `cleanUrl` rule), so a reload does not re-process it. `error` /
1689
+ * `error_description` / `denial_reason` stay in the URL.
1690
+ * Do not call `login()` again on this error: FFID refuses the same way.
1655
1691
  *
1656
1692
  * SSR-safe: when there is no `window` and no `options.url`, no exchange is
1657
1693
  * attempted and an error result is returned.
@@ -1661,6 +1697,77 @@ interface HandleRedirectCallbackOptions {
1661
1697
  */
1662
1698
  declare function handleRedirectCallback(client: HandleRedirectCallbackClient, options?: HandleRedirectCallbackOptions): Promise<FFIDApiResponse<void>>;
1663
1699
 
1700
+ /**
1701
+ * OAuth authorization errors returned to the service's `redirect_uri` (#6523)
1702
+ *
1703
+ * When FFID's `/oauth/authorize` refuses a user, it redirects back with
1704
+ * `error=<OAuth error>&error_description=...&state=...` (RFC 6749 §4.1.2.1). For
1705
+ * subscription / seat denials it also adds the FFID extension `denial_reason`
1706
+ * (#6498), so a service can tell "no seat in this organization" from "no
1707
+ * subscription" without parsing `error_description`.
1708
+ *
1709
+ * Both callback paths build the same {@link FFIDError} from those params:
1710
+ * - `handleRedirectCallback` / token-mode `FFIDProvider` (browser, PKCE)
1711
+ * - `createServerAuthClient().handleCallback` (confidential / BFF)
1712
+ *
1713
+ * `error.code` is the OAuth `error` value verbatim (e.g. `access_denied`), and
1714
+ * `error.details` is {@link FFIDAuthorizationErrorDetails}. Read it with
1715
+ * {@link getFFIDAuthorizationError}.
1716
+ *
1717
+ * This module has no browser dependency so the server entry can share it.
1718
+ */
1719
+
1720
+ /**
1721
+ * Values of FFID's `denial_reason` (the authorize error redirect and the
1722
+ * `/oauth/userinfo` 403; `/oauth/introspect` only answers `active: false`). Kept
1723
+ * identical to the FFID server's `DENIAL_REASONS` by a test in the FFID repository.
1724
+ *
1725
+ * This is a different vocabulary from `FFIDServiceAccessDenialReason`
1726
+ * (`checkServiceAccess()`), which is derived from the subscription status.
1727
+ */
1728
+ declare const FFID_OAUTH_DENIAL_REASONS: readonly ["no_membership", "no_active_subscription", "no_seat_assignment", "subscription_expired", "member_limit_reached"];
1729
+ type FFIDOAuthDenialReason = (typeof FFID_OAUTH_DENIAL_REASONS)[number];
1730
+ /** Runtime guard for {@link FFIDOAuthDenialReason}. Unknown values are `false`. */
1731
+ declare function isFFIDOAuthDenialReason(value: unknown): value is FFIDOAuthDenialReason;
1732
+ /** `FFIDError.details` of an authorization error */
1733
+ interface FFIDAuthorizationErrorDetails {
1734
+ /** Marks the error as an authorize redirect error (vs. token / network errors) */
1735
+ source: 'authorization';
1736
+ /**
1737
+ * FFID's `denial_reason`. `null` when FFID did not send one (any OAuth error other
1738
+ * than a subscription / seat denial) **or** sent a value this SDK version does not
1739
+ * know — the error itself is still returned, only the reason is unknown.
1740
+ */
1741
+ denialReason: FFIDOAuthDenialReason | null;
1742
+ /**
1743
+ * `error_description` as sent — short ASCII English meant for logs. The same text
1744
+ * is `error.message` (when FFID sent one), so show end users guidance chosen by
1745
+ * `denialReason` rather than the message itself.
1746
+ */
1747
+ errorDescription: string | null;
1748
+ }
1749
+ /** An authorization error read back by {@link getFFIDAuthorizationError} */
1750
+ interface FFIDAuthorizationError {
1751
+ /** The OAuth `error` value, e.g. `access_denied`, `login_required` */
1752
+ oauthError: string;
1753
+ denialReason: FFIDOAuthDenialReason | null;
1754
+ errorDescription: string | null;
1755
+ }
1756
+ /**
1757
+ * Read an authorization error (and FFID's `denial_reason`) from an {@link FFIDError},
1758
+ * e.g. `useFFID().error` or the result of `handleRedirectCallback` /
1759
+ * `createServerAuthClient().handleCallback`. Returns `null` for any other error.
1760
+ *
1761
+ * ```ts
1762
+ * const denial = getFFIDAuthorizationError(error)
1763
+ * if (denial?.denialReason === 'no_seat_assignment') {
1764
+ * // Ask an organization owner / admin to add the user. Do not call login() again:
1765
+ * // FFID would refuse the same way.
1766
+ * }
1767
+ * ```
1768
+ */
1769
+ declare function getFFIDAuthorizationError(error: FFIDError | null | undefined): FFIDAuthorizationError | null;
1770
+
1664
1771
  /**
1665
1772
  * Redirect URI normalization (SDK copy)
1666
1773
  *
@@ -1951,7 +2058,10 @@ interface FFIDProviderProps extends FFIDConfig {
1951
2058
  * Set to `false` on Next.js App Router when the patched history API
1952
2059
  * re-evaluating `useSearchParams()` (and re-running effects that depend on
1953
2060
  * it) is a problem — then remove `code` / `state` yourself (keeping other
1954
- * query params) after authentication completes. Consumed callback params
2061
+ * query params) after authentication completes. When FFID refused the user
2062
+ * (`?error=` callback, #6523), the provider removes only the consumed `state`
2063
+ * under the same rule (`error` / `denial_reason` stay for the app to read), so
2064
+ * with `false` remove `state` too. Consumed callback params
1955
2065
  * left in the URL fail on reload with `STATE_MISMATCH_ERROR` (the one-time
1956
2066
  * OAuth `state` was already consumed), which also leaves an authenticated
1957
2067
  * user rendered as signed-out until the URL is cleaned.
@@ -2866,4 +2976,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2866
2976
  };
2867
2977
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2868
2978
 
2869
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
2979
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDAuthorizationError, type FFIDAuthorizationErrorDetails, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberSeatAssignmentResult, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, type FFIDOAuthDenialReason, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDOAuthUserInfoSubscription, a as FFIDAccountType, b as FFIDPrompt, c as FFIDConfig, d as FFIDApiResponse, e as FFIDSessionResponse, f as FFIDSignOutResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDSeatsSummary, m as FFIDListPlansResponse, n as FFIDPublishedCatalog, o as FFIDSubscriptionDetail, p as FFIDSubscribeParams, q as FFIDSubscribeResponse, r as FFIDChangePlanParams, s as FFIDChangePlanResponse, t as FFIDCancelSubscriptionParams, u as FFIDCancelSubscriptionResponse, v as FFIDCancelPendingDowngradeResponse, w as FFIDPreviewPlanChangeParams, x as FFIDPlanChangePreviewResponse, y as FFIDPreviewSeatChangeParams, z as FFIDSeatChangePreviewResponse, A as FFIDVerifyAccessTokenOptions, B as FFIDOAuthUserInfo, C as FFIDInquiryCreateParams, D as FFIDInquiryCreateResponse, E as FFIDCreditBalance, G as FFIDListCreditHistoryOptions, H as FFIDCreditHistoryPage, I as FFIDCreditPackList, J as FFIDCreatePackCheckoutParams, K as FFIDCreditPackCheckout, L as FFIDCreditConsumeParams, M as FFIDCreditConsumeResult, N as FFIDBuyCreditsUrlParams, T as TokenStore, O as FFIDAuthMode, P as FFIDLogger, Q as FFIDCacheAdapter, R as FFIDUser, S as FFIDOrganization, U as FFIDSubscription, V as FFIDSubscriptionContextValue, W as EffectiveSubscriptionStatus, X as FFIDSubscriptionStatus, Y as FFIDCatalogEnvironment, Z as FFIDBillingInterval, _ as FFIDTaxBehavior, $ as FFIDAnnouncementsClientConfig, a0 as ListAnnouncementsOptions, a1 as FFIDAnnouncementsApiResponse, a2 as AnnouncementListResponse, a3 as FFIDAnnouncementsLogger } from './index-KjewcNn1.js';
2
- export { a4 as Announcement, a5 as AnnouncementStatus, a6 as AnnouncementType, a7 as EFFECTIVE_SUBSCRIPTION_STATUSES, a8 as FFIDAnnouncementBadge, a9 as FFIDAnnouncementList, aa as FFIDAnnouncementsError, ab as FFIDAnnouncementsErrorCode, ac as FFIDAnnouncementsServerResponse, ad as FFIDApiResponseMeta, ae as FFIDCacheConfig, af as FFIDCatalogPublication, ag as FFIDCatalogPublicationStatus, ah as FFIDContextValue, ai as FFIDCreditBreakdown, aj as FFIDCreditGrantKind, ak as FFIDCreditHistoryItem, al as FFIDCreditHistoryType, am as FFIDCreditPack, an as FFIDCreditsInsufficientDetails, ao as FFIDInquiryAcquisitionSource, ap as FFIDInquiryCategory, aq as FFIDInquiryCategorySite2026, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aB as FFIDJwtClaims, aC as FFIDLoginButton, aD as FFIDOAuthUserInfoMemberRole, aE as FFIDOrganizationSwitcher, aF as FFIDPlanChangeLineItem, aG as FFIDPlanChangePreview, aH as FFIDPlanInfo, aI as FFIDPricingModel, aJ as FFIDPublishedPlan, aK as FFIDSeatAssignmentClaim, aL as FFIDSeatAssignmentStatus, aM as FFIDSeatChangeLineItem, aN as FFIDSeatChangePreview, aO as FFIDSeatModel, aP as FFIDServiceAccessDenialReason, aQ as FFIDServiceAccessFailPolicy, aR as FFIDServiceInfo, aS as FFIDSubscriptionBadge, aT as FFIDSubscriptionCheckCredits, aU as FFIDSubscriptionSummary, aV as FFIDSupportedCurrency, aW as FFIDUserMenu, aX as FFID_CATALOG_ENVIRONMENTS, aY as FFID_CATALOG_PUBLICATION_STATUSES, aZ as FFID_CREDITS_CONSUME_MAX_AMOUNT, a_ as FFID_CREDITS_CONSUME_MIN_AMOUNT, a$ as FFID_CREDITS_FEATURE_PATTERN, b0 as FFID_CREDITS_HISTORY_DEFAULT_LIMIT, b1 as FFID_CREDITS_HISTORY_MAX_LIMIT, b2 as FFID_CREDITS_HISTORY_MIN_LIMIT, b3 as FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, b4 as FFID_CREDITS_LOW_THRESHOLD_PERCENT, b5 as FFID_CREDITS_METADATA_MAX_BYTES, b6 as FFID_CREDIT_GRANT_KINDS, b7 as FFID_CREDIT_HISTORY_TYPES, b8 as FFID_CREDIT_PACK_MAX_QUANTITY, b9 as FFID_CREDIT_PACK_MIN_QUANTITY, ba as FFID_INQUIRY_ACQUISITION_SOURCES, bb as FFID_INQUIRY_CATEGORIES, bc as FFID_INQUIRY_CATEGORIES_SITE_2026, bd as TokenData, be as UseFFIDAnnouncementsOptions, bf as UseFFIDAnnouncementsReturn, bg as createTokenStore, bh as isFFIDInquiryAcquisitionSource, bi as isFFIDInquiryCategorySite2026, bj as useFFIDAnnouncements } from './index-KjewcNn1.js';
1
+ import { F as FFIDOAuthUserInfoSubscription, a as FFIDAccountType, b as FFIDPrompt, c as FFIDConfig, d as FFIDApiResponse, e as FFIDSessionResponse, f as FFIDSignOutResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDSeatsSummary, m as FFIDListPlansResponse, n as FFIDPublishedCatalog, o as FFIDSubscriptionDetail, p as FFIDSubscribeParams, q as FFIDSubscribeResponse, r as FFIDChangePlanParams, s as FFIDChangePlanResponse, t as FFIDCancelSubscriptionParams, u as FFIDCancelSubscriptionResponse, v as FFIDCancelPendingDowngradeResponse, w as FFIDPreviewPlanChangeParams, x as FFIDPlanChangePreviewResponse, y as FFIDPreviewSeatChangeParams, z as FFIDSeatChangePreviewResponse, A as FFIDVerifyAccessTokenOptions, B as FFIDOAuthUserInfo, C as FFIDInquiryCreateParams, D as FFIDInquiryCreateResponse, E as FFIDCreditBalance, G as FFIDListCreditHistoryOptions, H as FFIDCreditHistoryPage, I as FFIDCreditPackList, J as FFIDCreatePackCheckoutParams, K as FFIDCreditPackCheckout, L as FFIDCreditConsumeParams, M as FFIDCreditConsumeResult, N as FFIDBuyCreditsUrlParams, T as TokenStore, O as FFIDAuthMode, P as FFIDLogger, Q as FFIDCacheAdapter, R as FFIDUser, S as FFIDOrganization, U as FFIDSubscription, V as FFIDSubscriptionContextValue, W as EffectiveSubscriptionStatus, X as FFIDSubscriptionStatus, Y as FFIDCatalogEnvironment, Z as FFIDBillingInterval, _ as FFIDTaxBehavior, $ as FFIDAnnouncementsClientConfig, a0 as ListAnnouncementsOptions, a1 as FFIDAnnouncementsApiResponse, a2 as AnnouncementListResponse, a3 as FFIDAnnouncementsLogger } from './index-BknVfXhZ.js';
2
+ export { a4 as Announcement, a5 as AnnouncementStatus, a6 as AnnouncementType, a7 as EFFECTIVE_SUBSCRIPTION_STATUSES, a8 as FFIDAnnouncementBadge, a9 as FFIDAnnouncementList, aa as FFIDAnnouncementsError, ab as FFIDAnnouncementsErrorCode, ac as FFIDAnnouncementsServerResponse, ad as FFIDApiResponseMeta, ae as FFIDCacheConfig, af as FFIDCatalogPublication, ag as FFIDCatalogPublicationStatus, ah as FFIDContextValue, ai as FFIDCreditBreakdown, aj as FFIDCreditGrantKind, ak as FFIDCreditHistoryItem, al as FFIDCreditHistoryType, am as FFIDCreditPack, an as FFIDCreditsInsufficientDetails, ao as FFIDInquiryAcquisitionSource, ap as FFIDInquiryCategory, aq as FFIDInquiryCategorySite2026, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aB as FFIDJwtClaims, aC as FFIDLoginButton, aD as FFIDOAuthUserInfoMemberRole, aE as FFIDOrganizationSwitcher, aF as FFIDPlanChangeLineItem, aG as FFIDPlanChangePreview, aH as FFIDPlanInfo, aI as FFIDPricingModel, aJ as FFIDPublishedPlan, aK as FFIDSeatAssignmentClaim, aL as FFIDSeatAssignmentStatus, aM as FFIDSeatChangeLineItem, aN as FFIDSeatChangePreview, aO as FFIDSeatModel, aP as FFIDServiceAccessDenialReason, aQ as FFIDServiceAccessFailPolicy, aR as FFIDServiceInfo, aS as FFIDSubscriptionBadge, aT as FFIDSubscriptionCheckCredits, aU as FFIDSubscriptionSummary, aV as FFIDSupportedCurrency, aW as FFIDUserMenu, aX as FFID_CATALOG_ENVIRONMENTS, aY as FFID_CATALOG_PUBLICATION_STATUSES, aZ as FFID_CREDITS_CONSUME_MAX_AMOUNT, a_ as FFID_CREDITS_CONSUME_MIN_AMOUNT, a$ as FFID_CREDITS_FEATURE_PATTERN, b0 as FFID_CREDITS_HISTORY_DEFAULT_LIMIT, b1 as FFID_CREDITS_HISTORY_MAX_LIMIT, b2 as FFID_CREDITS_HISTORY_MIN_LIMIT, b3 as FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, b4 as FFID_CREDITS_LOW_THRESHOLD_PERCENT, b5 as FFID_CREDITS_METADATA_MAX_BYTES, b6 as FFID_CREDIT_GRANT_KINDS, b7 as FFID_CREDIT_HISTORY_TYPES, b8 as FFID_CREDIT_PACK_MAX_QUANTITY, b9 as FFID_CREDIT_PACK_MIN_QUANTITY, ba as FFID_INQUIRY_ACQUISITION_SOURCES, bb as FFID_INQUIRY_CATEGORIES, bc as FFID_INQUIRY_CATEGORIES_SITE_2026, bd as TokenData, be as UseFFIDAnnouncementsOptions, bf as UseFFIDAnnouncementsReturn, bg as createTokenStore, bh as isFFIDInquiryAcquisitionSource, bi as isFFIDInquiryCategorySite2026, bj as useFFIDAnnouncements } from './index-BknVfXhZ.js';
3
3
  export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, n as FFIDAnalyticsProvider, o as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, q as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, v as FFIDConsentError, w as FFIDConsentErrorCode, x as FFIDConsentMergeStrategy, z as FFIDConsentMergeWarning, B as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, H as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, L as FFIDCookieBanner, M as FFIDCookieBannerClassNames, N as FFIDCookieBannerProps, O as FFIDCookieLink, Q as FFIDCookieLinkProps, f as FFIDCookiePolicy, S as FFIDCookieSettings, T as FFIDCookieSettingsClassNames, U as FFIDCookieSettingsProps, Z as FFID_CONSENT_ERROR_CODES, ad as UseFFIDConsentPreferencesReturn, ae as UseFFIDConsentReturn, af as clearConsentDismissalTimestamp, ai as decodeConsentCookie, ak as encodeConsentCookie, am as readConsentCookie, an as readConsentDismissalTimestamp, ap as useFFIDConsent, aq as useFFIDConsentPreferences, ar as writeConsentCookie, as as writeConsentDismissalTimestamp } from './FFIDCookieLink-yt5SUr-W.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode, ComponentType, FC } from 'react';
@@ -207,9 +207,18 @@ interface FFIDAddMemberRequest {
207
207
  interface FFIDAddMemberParams extends FFIDAddMemberRequest {
208
208
  organizationId: string;
209
209
  }
210
+ /** Seat assignment outcome after membership creation; membership exists in every case. */
211
+ type FFIDMemberSeatAssignmentResult = 'assigned' | 'not_applicable' | 'member_limit_reached' | 'failed';
210
212
  /** Response from addMember (ext) */
211
213
  interface FFIDAddMemberResponse {
212
214
  member: FFIDOrganizationMember;
215
+ /**
216
+ * Membership creation can succeed even when seat assignment fails.
217
+ * Omitted by older servers. `not_applicable`/undefined do not prove an active seat.
218
+ * Check the authenticated user's hasAccess and seatAssigned before granting access;
219
+ * do not automatically restore a removed seat on a duplicate-member retry.
220
+ */
221
+ seatAssignment?: FFIDMemberSeatAssignmentResult;
213
222
  }
214
223
  /** Response from updateMemberRole (ext) */
215
224
  interface FFIDUpdateMemberRoleResponse {
@@ -737,6 +746,12 @@ interface FFIDInviteMemberRequest {
737
746
  email: string;
738
747
  /** Role to assign on acceptance (defaults to `member` server-side) */
739
748
  role?: FFIDAssignableMemberRole;
749
+ /**
750
+ * FFID user id recorded as the inviter (FFID #6279). Must be an active owner / admin
751
+ * of the organization. Omit in `token` mode (the signed-in user is recorded); when
752
+ * omitted in `service-key` mode the organization owner is recorded.
753
+ */
754
+ inviterUserId?: string;
740
755
  }
741
756
  /**
742
757
  * Response from inviteMember (ext).
@@ -1390,6 +1405,7 @@ type FFIDSubscriptionErrorCode = (typeof FFID_SUBSCRIPTION_ERROR_CODES)[keyof ty
1390
1405
  * Do not retry automatically; show the credit purchase path.
1391
1406
  * - `CREDITS_IDEMPOTENCY_CONFLICT` (409): the same idempotency key with another amount.
1392
1407
  * A caller bug — do not retry.
1408
+ * - `CREDITS_TURN_CANCELLED` (409): a failed chatbot attempt was cancelled; use a new attempt key.
1393
1409
  * - `CREDITS_NOT_APPLICABLE` (409): the contract's plan is per_seat (not credit-based).
1394
1410
  * - `CREDITS_BALANCE_CAP_EXCEEDED` (409): a grant would push the balance over the cap.
1395
1411
  * - `SEAT_BILLING_NOT_APPLICABLE` (409): seat-count changes on a flat contract.
@@ -1408,6 +1424,7 @@ type FFIDSubscriptionErrorCode = (typeof FFID_SUBSCRIPTION_ERROR_CODES)[keyof ty
1408
1424
  declare const FFID_CREDITS_ERROR_CODES: {
1409
1425
  readonly CREDITS_INSUFFICIENT: "CREDITS_INSUFFICIENT";
1410
1426
  readonly CREDITS_IDEMPOTENCY_CONFLICT: "CREDITS_IDEMPOTENCY_CONFLICT";
1427
+ readonly CREDITS_TURN_CANCELLED: "CREDITS_TURN_CANCELLED";
1411
1428
  readonly CREDITS_NOT_APPLICABLE: "CREDITS_NOT_APPLICABLE";
1412
1429
  readonly CREDITS_BALANCE_CAP_EXCEEDED: "CREDITS_BALANCE_CAP_EXCEEDED";
1413
1430
  readonly SEAT_BILLING_NOT_APPLICABLE: "SEAT_BILLING_NOT_APPLICABLE";
@@ -1498,6 +1515,7 @@ declare function createFFIDClient(config: FFIDConfig): {
1498
1515
  organizationId: string;
1499
1516
  email: string;
1500
1517
  role?: FFIDAssignableMemberRole;
1518
+ inviterUserId?: string;
1501
1519
  }) => Promise<FFIDApiResponse<FFIDInviteMemberResponse>>;
1502
1520
  leaveOrganization: (params: FFIDLeaveOrganizationParams) => Promise<FFIDApiResponse<FFIDLeaveOrganizationResponse>>;
1503
1521
  getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
@@ -1604,6 +1622,10 @@ declare class FFIDSDKError extends Error {
1604
1622
  * validates the OAuth `state` against the value persisted at authorize time
1605
1623
  * (CSRF protection, RFC 6749 §10.12), retrieves the PKCE verifier, exchanges
1606
1624
  * the code for tokens, and cleans the params out of the URL on success.
1625
+ *
1626
+ * When FFID refused the user, the callback carries `error` (+ FFID's
1627
+ * `denial_reason`) instead of `code` (#6523). After the same `state` check the
1628
+ * error is returned as an authorization error (see `./authorization-error`).
1607
1629
  */
1608
1630
 
1609
1631
  /**
@@ -1621,8 +1643,9 @@ interface HandleRedirectCallbackOptions {
1621
1643
  url?: string | undefined;
1622
1644
  /**
1623
1645
  * Whether to remove `code` / `state` from the browser URL via
1624
- * `window.history.replaceState` after a successful exchange. Defaults to
1625
- * `true`.
1646
+ * `window.history.replaceState` after a successful exchange — and, on an
1647
+ * authorization error, `state` only (#6523; see {@link ERROR_CALLBACK_CONSUMED_PARAMS}).
1648
+ * Defaults to `true`.
1626
1649
  *
1627
1650
  * Set to `false` to take over URL cleanup on the consumer side. This matters
1628
1651
  * on Next.js App Router: the App Router patches `history.replaceState`, so
@@ -1642,7 +1665,9 @@ interface HandleRedirectCallbackOptions {
1642
1665
  * Complete an OAuth authorization-code redirect.
1643
1666
  *
1644
1667
  * Behavior:
1645
- * 1. Reads `code` + `state` from `options.url ?? window.location.search`.
1668
+ * 1. Reads `code` + `state` (or `error`) from `options.url ?? window.location.search`.
1669
+ * A URL with no `code` — and no `error` carrying a `state` — returns
1670
+ * `MISSING_AUTHORIZATION_CODE` without touching the stored state.
1646
1671
  * 2. CSRF guard: if a `state` exists on EITHER side (a stored state from
1647
1672
  * authorize OR a `state` on the callback URL), the two MUST match — mismatch,
1648
1673
  * a missing stored state, or an **omitted** callback `state` all **fail closed**
@@ -1652,6 +1677,17 @@ interface HandleRedirectCallbackOptions {
1652
1677
  * 3. Retrieves the PKCE verifier and exchanges the code for tokens.
1653
1678
  * 4. On success, removes `code` + `state` from the browser URL (skipped when
1654
1679
  * `options.cleanUrl` is `false` — the consumer then owns URL cleanup).
1680
+ * 5. When the URL carries `error` **and** `state` (FFID refused the user),
1681
+ * returns it as an authorization error after step 2 instead of exchanging
1682
+ * anything. Unlike a code callback there is no no-state leniency: the URL
1683
+ * `state` must match a stored one, so a crafted `?error=...&error_description=`
1684
+ * link cannot be shown as a denial (content spoofing). `code` is
1685
+ * the OAuth `error` (e.g. `access_denied`) and `details` holds FFID's
1686
+ * `denial_reason` — read it with `getFFIDAuthorizationError`. The PKCE
1687
+ * verifier is discarded and the consumed `state` is removed from the URL
1688
+ * (same `cleanUrl` rule), so a reload does not re-process it. `error` /
1689
+ * `error_description` / `denial_reason` stay in the URL.
1690
+ * Do not call `login()` again on this error: FFID refuses the same way.
1655
1691
  *
1656
1692
  * SSR-safe: when there is no `window` and no `options.url`, no exchange is
1657
1693
  * attempted and an error result is returned.
@@ -1661,6 +1697,77 @@ interface HandleRedirectCallbackOptions {
1661
1697
  */
1662
1698
  declare function handleRedirectCallback(client: HandleRedirectCallbackClient, options?: HandleRedirectCallbackOptions): Promise<FFIDApiResponse<void>>;
1663
1699
 
1700
+ /**
1701
+ * OAuth authorization errors returned to the service's `redirect_uri` (#6523)
1702
+ *
1703
+ * When FFID's `/oauth/authorize` refuses a user, it redirects back with
1704
+ * `error=<OAuth error>&error_description=...&state=...` (RFC 6749 §4.1.2.1). For
1705
+ * subscription / seat denials it also adds the FFID extension `denial_reason`
1706
+ * (#6498), so a service can tell "no seat in this organization" from "no
1707
+ * subscription" without parsing `error_description`.
1708
+ *
1709
+ * Both callback paths build the same {@link FFIDError} from those params:
1710
+ * - `handleRedirectCallback` / token-mode `FFIDProvider` (browser, PKCE)
1711
+ * - `createServerAuthClient().handleCallback` (confidential / BFF)
1712
+ *
1713
+ * `error.code` is the OAuth `error` value verbatim (e.g. `access_denied`), and
1714
+ * `error.details` is {@link FFIDAuthorizationErrorDetails}. Read it with
1715
+ * {@link getFFIDAuthorizationError}.
1716
+ *
1717
+ * This module has no browser dependency so the server entry can share it.
1718
+ */
1719
+
1720
+ /**
1721
+ * Values of FFID's `denial_reason` (the authorize error redirect and the
1722
+ * `/oauth/userinfo` 403; `/oauth/introspect` only answers `active: false`). Kept
1723
+ * identical to the FFID server's `DENIAL_REASONS` by a test in the FFID repository.
1724
+ *
1725
+ * This is a different vocabulary from `FFIDServiceAccessDenialReason`
1726
+ * (`checkServiceAccess()`), which is derived from the subscription status.
1727
+ */
1728
+ declare const FFID_OAUTH_DENIAL_REASONS: readonly ["no_membership", "no_active_subscription", "no_seat_assignment", "subscription_expired", "member_limit_reached"];
1729
+ type FFIDOAuthDenialReason = (typeof FFID_OAUTH_DENIAL_REASONS)[number];
1730
+ /** Runtime guard for {@link FFIDOAuthDenialReason}. Unknown values are `false`. */
1731
+ declare function isFFIDOAuthDenialReason(value: unknown): value is FFIDOAuthDenialReason;
1732
+ /** `FFIDError.details` of an authorization error */
1733
+ interface FFIDAuthorizationErrorDetails {
1734
+ /** Marks the error as an authorize redirect error (vs. token / network errors) */
1735
+ source: 'authorization';
1736
+ /**
1737
+ * FFID's `denial_reason`. `null` when FFID did not send one (any OAuth error other
1738
+ * than a subscription / seat denial) **or** sent a value this SDK version does not
1739
+ * know — the error itself is still returned, only the reason is unknown.
1740
+ */
1741
+ denialReason: FFIDOAuthDenialReason | null;
1742
+ /**
1743
+ * `error_description` as sent — short ASCII English meant for logs. The same text
1744
+ * is `error.message` (when FFID sent one), so show end users guidance chosen by
1745
+ * `denialReason` rather than the message itself.
1746
+ */
1747
+ errorDescription: string | null;
1748
+ }
1749
+ /** An authorization error read back by {@link getFFIDAuthorizationError} */
1750
+ interface FFIDAuthorizationError {
1751
+ /** The OAuth `error` value, e.g. `access_denied`, `login_required` */
1752
+ oauthError: string;
1753
+ denialReason: FFIDOAuthDenialReason | null;
1754
+ errorDescription: string | null;
1755
+ }
1756
+ /**
1757
+ * Read an authorization error (and FFID's `denial_reason`) from an {@link FFIDError},
1758
+ * e.g. `useFFID().error` or the result of `handleRedirectCallback` /
1759
+ * `createServerAuthClient().handleCallback`. Returns `null` for any other error.
1760
+ *
1761
+ * ```ts
1762
+ * const denial = getFFIDAuthorizationError(error)
1763
+ * if (denial?.denialReason === 'no_seat_assignment') {
1764
+ * // Ask an organization owner / admin to add the user. Do not call login() again:
1765
+ * // FFID would refuse the same way.
1766
+ * }
1767
+ * ```
1768
+ */
1769
+ declare function getFFIDAuthorizationError(error: FFIDError | null | undefined): FFIDAuthorizationError | null;
1770
+
1664
1771
  /**
1665
1772
  * Redirect URI normalization (SDK copy)
1666
1773
  *
@@ -1951,7 +2058,10 @@ interface FFIDProviderProps extends FFIDConfig {
1951
2058
  * Set to `false` on Next.js App Router when the patched history API
1952
2059
  * re-evaluating `useSearchParams()` (and re-running effects that depend on
1953
2060
  * it) is a problem — then remove `code` / `state` yourself (keeping other
1954
- * query params) after authentication completes. Consumed callback params
2061
+ * query params) after authentication completes. When FFID refused the user
2062
+ * (`?error=` callback, #6523), the provider removes only the consumed `state`
2063
+ * under the same rule (`error` / `denial_reason` stay for the app to read), so
2064
+ * with `false` remove `state` too. Consumed callback params
1955
2065
  * left in the URL fail on reload with `STATE_MISMATCH_ERROR` (the one-time
1956
2066
  * OAuth `state` was already consumed), which also leaves an authenticated
1957
2067
  * user rendered as signed-out until the URL is cleaned.
@@ -2866,4 +2976,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2866
2976
  };
2867
2977
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2868
2978
 
2869
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
2979
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDAuthorizationError, type FFIDAuthorizationErrorDetails, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberSeatAssignmentResult, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, type FFIDOAuthDenialReason, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-OXW6QSTO.js';
2
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_CONSUME_MAX_AMOUNT, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_ERROR_CODES, FFID_CREDITS_FEATURE_PATTERN, FFID_CREDITS_HISTORY_DEFAULT_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, FFID_CREDITS_LOW_THRESHOLD_PERCENT, FFID_CREDITS_METADATA_MAX_BYTES, FFID_CREDIT_GRANT_KINDS, FFID_CREDIT_HISTORY_TYPES, FFID_CREDIT_PACK_MAX_QUANTITY, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-OXW6QSTO.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-QORWLPWG.js';
2
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_CONSUME_MAX_AMOUNT, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_ERROR_CODES, FFID_CREDITS_FEATURE_PATTERN, FFID_CREDITS_HISTORY_DEFAULT_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, FFID_CREDITS_LOW_THRESHOLD_PERCENT, FFID_CREDITS_METADATA_MAX_BYTES, FFID_CREDIT_GRANT_KINDS, FFID_CREDIT_HISTORY_TYPES, FFID_CREDIT_PACK_MAX_QUANTITY, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-QORWLPWG.js';
3
3
  export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-S2AEBJRX.js';
4
4
  import { useEffect, useRef } from 'react';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';