@feelflow/ffid-sdk 5.24.3 → 5.25.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.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDSignOutResult, f as FFIDRedirectResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, T as TokenStore, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDOAuthUserInfoSubscription, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-BRMn6xT0.js';
2
- export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryCategory, R as FFIDInquiryCategorySite2026, S as FFIDInquiryForm, U as FFIDInquiryFormCategoryItem, V as FFIDInquiryFormClassNames, W as FFIDInquiryFormLegalLayout, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a1 as FFIDJwtClaims, a2 as FFIDLoginButton, a3 as FFIDOAuthTokenResponse, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOrganizationSwitcher, a6 as FFIDRedirectErrorCode, a7 as FFIDSeatModel, a8 as FFIDServiceAccessDenialReason, a9 as FFIDServiceAccessFailPolicy, aa as FFIDSubscriptionBadge, ab as FFIDTokenIntrospectionResponse, ac as FFIDUserMenu, ad as FFID_INQUIRY_CATEGORIES, ae as FFID_INQUIRY_CATEGORIES_SITE_2026, af as TokenData, ag as UseFFIDAnnouncementsOptions, ah as UseFFIDAnnouncementsReturn, ai as createTokenStore, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-BRMn6xT0.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDOAuthUserInfoSubscription, 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 FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, T as TokenStore, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-Dd6CMIBd.js';
2
+ export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDApiResponseMeta, N as FFIDCacheConfig, O as FFIDContextValue, P as FFIDInquiryCategory, Q as FFIDInquiryCategorySite2026, R as FFIDInquiryForm, S as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDOAuthUserInfoMemberRole, a3 as FFIDOrganizationSwitcher, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDUserMenu, a9 as FFID_INQUIRY_CATEGORIES, aa as FFID_INQUIRY_CATEGORIES_SITE_2026, ab as TokenData, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as createTokenStore, af as isFFIDInquiryCategorySite2026, ag as useFFIDAnnouncements } from './index-Dd6CMIBd.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, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-BJgVcJyw.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ReactNode, ComponentType, FC } from 'react';
@@ -1151,6 +1151,112 @@ interface FFIDUpdateUserProfileRequest {
1151
1151
  preferences?: Record<string, unknown> | null;
1152
1152
  }
1153
1153
 
1154
+ /**
1155
+ * OAuth flow types: client-side redirect results and OAuth token / RFC 7662
1156
+ * introspection payloads.
1157
+ *
1158
+ * Extracted from `types/index.ts` to keep that barrel under the 800-line hard
1159
+ * limit (`scripts/check-file-size.sh`). Re-exported from `types/index.ts`, so
1160
+ * the public API is unchanged — import from `@feelflow/ffid-sdk` as before.
1161
+ */
1162
+
1163
+ /**
1164
+ * Discriminant for redirect failures that callers need to handle
1165
+ * programmatically (vs. logging the human-readable `error` string).
1166
+ *
1167
+ * - `'redirect_loop_detected'`: `redirectToAuthorize()` detected that the
1168
+ * same authorize URL (keyed by `baseUrl + client_id + organization_id`)
1169
+ * has been fired **3 times within 60 seconds**. Caller should surface a
1170
+ * manual "再度ログインする" UI rather than retry automatically (#2406 / #2411).
1171
+ *
1172
+ * - `'state_persistence_failed'`: `redirectToAuthorize()` could not persist
1173
+ * the OAuth CSRF `state` (storage unavailable / quota). Redirect is aborted
1174
+ * fail-closed (#4136) — callers should surface a manual retry UI.
1175
+ *
1176
+ * Other failure paths (SSR environment, PKCE generation failure, empty
1177
+ * organizationId) currently return `error` without a `code`. Treat this union
1178
+ * as forward-extensible and do NOT exhaustively `switch` over it without a
1179
+ * `default` branch for consumer code that must stay compatible across SDK
1180
+ * upgrades.
1181
+ */
1182
+ type FFIDRedirectErrorCode = 'redirect_loop_detected' | 'state_persistence_failed';
1183
+ /**
1184
+ * Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
1185
+ *
1186
+ * Structured return type so callers can inspect failure reasons
1187
+ * instead of receiving a bare `false`. When `code` is set, branch on it
1188
+ * for programmatic handling; otherwise log `error` for humans.
1189
+ *
1190
+ * `loopDetectionDisabled` (#4119): set to `true` when sessionStorage is
1191
+ * unavailable (iOS WebKit private mode / eviction) so redirect-loop detection
1192
+ * ran **fail-open** — the redirect fired, but repeated-redirect protection is
1193
+ * disabled for this browser session. Callers that need loop protection on
1194
+ * such browsers should add their own max-retry guard.
1195
+ */
1196
+ type FFIDRedirectResult = {
1197
+ success: true;
1198
+ loopDetectionDisabled?: boolean;
1199
+ } | {
1200
+ success: false;
1201
+ error: string;
1202
+ code?: FFIDRedirectErrorCode;
1203
+ };
1204
+ /**
1205
+ * OAuth 2.0 token response from FFID token endpoint
1206
+ */
1207
+ interface FFIDOAuthTokenResponse {
1208
+ access_token: string;
1209
+ token_type: 'Bearer';
1210
+ expires_in: number;
1211
+ refresh_token: string;
1212
+ }
1213
+ /**
1214
+ * RFC 7662 Token Introspection response (raw format from server)
1215
+ *
1216
+ * Used internally by verifyAccessToken(). Consumers receive the normalized
1217
+ * FFIDOAuthUserInfo type instead.
1218
+ *
1219
+ * @see https://tools.ietf.org/html/rfc7662
1220
+ */
1221
+ interface FFIDTokenIntrospectionResponse {
1222
+ active: boolean;
1223
+ sub?: string;
1224
+ email?: string;
1225
+ /** Whether the user's email is verified (#3791). Optional for backward compat with older FFID. */
1226
+ email_verified?: boolean;
1227
+ name?: string;
1228
+ picture?: string | null;
1229
+ company_name?: string | null;
1230
+ department?: string | null;
1231
+ position?: string | null;
1232
+ phone_number?: string | null;
1233
+ scope?: string | null;
1234
+ exp?: number;
1235
+ iat?: number;
1236
+ iss?: string;
1237
+ token_type?: 'Bearer';
1238
+ client_id?: string;
1239
+ organization_id?: string | null;
1240
+ organization_name?: string | null;
1241
+ subscription?: {
1242
+ subscription_id: string | null;
1243
+ status: FFIDOAuthUserInfoSubscription['status'];
1244
+ /** Optional for backward compat with older FFID (< 5.3.0 / #3353). */
1245
+ effective_status?: FFIDOAuthUserInfoSubscription['effectiveStatus'];
1246
+ plan_code: string | null;
1247
+ seat_model: FFIDOAuthUserInfoSubscription['seatModel'];
1248
+ member_role: FFIDOAuthUserInfoSubscription['memberRole'];
1249
+ organization_id: string | null;
1250
+ organization_name?: string | null;
1251
+ has_seat_assignment?: boolean;
1252
+ /**
1253
+ * Optional for backward compat with older FFID (< #4333), and omitted when
1254
+ * the service API key has `token:introspect` without `subscription:read`.
1255
+ */
1256
+ entitlements?: readonly string[];
1257
+ };
1258
+ }
1259
+
1154
1260
  /** OTP / magic link methods - sendOtp / verifyOtp */
1155
1261
 
1156
1262
  /** Response from sendOtp */
@@ -2288,4 +2394,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
2288
2394
  };
2289
2395
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
2290
2396
 
2291
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, 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, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type 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, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
2397
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, 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 FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type 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, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext, useSubscription } from './chunk-O3HGRALD.js';
2
- export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-O3HGRALD.js';
1
+ import { useFFIDContext, useSubscription } from './chunk-HIKX4AVY.js';
2
+ export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-HIKX4AVY.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-G7VOX64X.js';
4
4
  import { useEffect, useRef } from 'react';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';
@@ -111,6 +111,14 @@ function isSessionEligibleSubscriptionStatus(value) {
111
111
  function hasOwnKey(value, key) {
112
112
  return Object.prototype.hasOwnProperty.call(value, key);
113
113
  }
114
+ function normalizeEntitlements(raw) {
115
+ if (!Array.isArray(raw)) return [];
116
+ return raw.flatMap((code) => {
117
+ if (typeof code !== "string") return [];
118
+ const trimmed = code.trim();
119
+ return trimmed.length > 0 ? [trimmed] : [];
120
+ });
121
+ }
114
122
  function normalizeUserinfo(raw) {
115
123
  const hasOrganizationId = hasOwnKey(raw, "organization_id");
116
124
  const hasOrganizationName = hasOwnKey(raw, "organization_name");
@@ -151,7 +159,10 @@ function normalizeUserinfo(raw) {
151
159
  // `'active_canceling'`) for legacy backends. Defaulting to `false`
152
160
  // here keeps the downstream contract a plain boolean.
153
161
  cancelAtPeriodEnd: raw.subscription.cancel_at_period_end ?? false,
154
- currentPeriodEnd: raw.subscription.current_period_end ?? null
162
+ currentPeriodEnd: raw.subscription.current_period_end ?? null,
163
+ // #4333: legacy FFID (< this issue) omits the field on the wire; the
164
+ // guard defaults to `[]` so consumers always get a plain string[].
165
+ entitlements: normalizeEntitlements(raw.subscription.entitlements)
155
166
  } : void 0
156
167
  };
157
168
  }
@@ -438,7 +449,11 @@ function createVerifyAccessToken(deps) {
438
449
  member_role: introspectResponse.subscription.member_role,
439
450
  organization_id: introspectResponse.subscription.organization_id,
440
451
  organization_name: introspectResponse.subscription.organization_name ?? null,
441
- has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
452
+ has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false,
453
+ // #4333: forward pack entitlement codes through the introspect →
454
+ // userinfo normalization boundary. normalizeUserinfo guards the
455
+ // value, so an older FFID that omits it degrades to `[]`.
456
+ entitlements: introspectResponse.subscription.entitlements
442
457
  }
443
458
  } : base;
444
459
  const userinfo = normalizeUserinfo(raw);
@@ -1251,7 +1266,7 @@ function validateTokenResponse(tokenResponse) {
1251
1266
  }
1252
1267
 
1253
1268
  // src/client/version-check.ts
1254
- var SDK_VERSION = "5.24.3";
1269
+ var SDK_VERSION = "5.25.0";
1255
1270
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1256
1271
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1257
1272
  function sdkHeaders() {
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-BjZphrz9.cjs';
2
- export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDProvisionMemberPlan, x as FFIDProvisionMemberPlanStatus, y as FFIDProvisionMemberResult, z as FFIDProvisionMemberStatus, A as FFIDProvisionOrganizationDryRun, B as FFIDProvisionOrganizationMemberInput, C as FFIDProvisionOrganizationOutcome, D as FFIDProvisionOrganizationParams, E as FFIDProvisionOrganizationResponse, G as FFIDProvisionUserDryRun, H as FFIDProvisionUserOutcome, I as FFIDProvisionUserParams, J as FFIDProvisionUserProfileInput, K as FFIDProvisionUserResponse, L as FFIDProvisionedOrganization, M as FFIDProvisionedUser, N as FFIDRemoveMemberResponse, O as FFIDResetSessionResponse, P as FFIDSubscription, Q as FFIDUpdateMemberRoleResponse, R as FFIDUpdateUserProfileRequest, S as FFIDUser, T as FFIDUserProfile, U as TokenData, V as TokenStore, W as createFFIDClient, X as createTokenStore } from '../ffid-client-BjZphrz9.cjs';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-BZERrMAF.cjs';
2
+ export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDProvisionMemberPlan, x as FFIDProvisionMemberPlanStatus, y as FFIDProvisionMemberResult, z as FFIDProvisionMemberStatus, A as FFIDProvisionOrganizationDryRun, B as FFIDProvisionOrganizationMemberInput, C as FFIDProvisionOrganizationOutcome, D as FFIDProvisionOrganizationParams, E as FFIDProvisionOrganizationResponse, G as FFIDProvisionUserDryRun, H as FFIDProvisionUserOutcome, I as FFIDProvisionUserParams, J as FFIDProvisionUserProfileInput, K as FFIDProvisionUserResponse, L as FFIDProvisionedOrganization, M as FFIDProvisionedUser, N as FFIDRemoveMemberResponse, O as FFIDResetSessionResponse, P as FFIDSubscription, Q as FFIDUpdateMemberRoleResponse, R as FFIDUpdateUserProfileRequest, S as FFIDUser, T as FFIDUserProfile, U as TokenData, V as TokenStore, W as createFFIDClient, X as createTokenStore } from '../ffid-client-BZERrMAF.cjs';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.cjs';
@@ -1,5 +1,5 @@
1
- import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-B-xjtrCb.js';
2
- export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDProvisionMemberPlan, x as FFIDProvisionMemberPlanStatus, y as FFIDProvisionMemberResult, z as FFIDProvisionMemberStatus, A as FFIDProvisionOrganizationDryRun, B as FFIDProvisionOrganizationMemberInput, C as FFIDProvisionOrganizationOutcome, D as FFIDProvisionOrganizationParams, E as FFIDProvisionOrganizationResponse, G as FFIDProvisionUserDryRun, H as FFIDProvisionUserOutcome, I as FFIDProvisionUserParams, J as FFIDProvisionUserProfileInput, K as FFIDProvisionUserResponse, L as FFIDProvisionedOrganization, M as FFIDProvisionedUser, N as FFIDRemoveMemberResponse, O as FFIDResetSessionResponse, P as FFIDSubscription, Q as FFIDUpdateMemberRoleResponse, R as FFIDUpdateUserProfileRequest, S as FFIDUser, T as FFIDUserProfile, U as TokenData, V as TokenStore, W as createFFIDClient, X as createTokenStore } from '../ffid-client-B-xjtrCb.js';
1
+ import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-CFZPX5ej.js';
2
+ export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDProvisionMemberPlan, x as FFIDProvisionMemberPlanStatus, y as FFIDProvisionMemberResult, z as FFIDProvisionMemberStatus, A as FFIDProvisionOrganizationDryRun, B as FFIDProvisionOrganizationMemberInput, C as FFIDProvisionOrganizationOutcome, D as FFIDProvisionOrganizationParams, E as FFIDProvisionOrganizationResponse, G as FFIDProvisionUserDryRun, H as FFIDProvisionUserOutcome, I as FFIDProvisionUserParams, J as FFIDProvisionUserProfileInput, K as FFIDProvisionUserResponse, L as FFIDProvisionedOrganization, M as FFIDProvisionedUser, N as FFIDRemoveMemberResponse, O as FFIDResetSessionResponse, P as FFIDSubscription, Q as FFIDUpdateMemberRoleResponse, R as FFIDUpdateUserProfileRequest, S as FFIDUser, T as FFIDUserProfile, U as TokenData, V as TokenStore, W as createFFIDClient, X as createTokenStore } from '../ffid-client-CFZPX5ej.js';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.js';
@@ -110,6 +110,14 @@ function isSessionEligibleSubscriptionStatus(value) {
110
110
  function hasOwnKey(value, key) {
111
111
  return Object.prototype.hasOwnProperty.call(value, key);
112
112
  }
113
+ function normalizeEntitlements(raw) {
114
+ if (!Array.isArray(raw)) return [];
115
+ return raw.flatMap((code) => {
116
+ if (typeof code !== "string") return [];
117
+ const trimmed = code.trim();
118
+ return trimmed.length > 0 ? [trimmed] : [];
119
+ });
120
+ }
113
121
  function normalizeUserinfo(raw) {
114
122
  const hasOrganizationId = hasOwnKey(raw, "organization_id");
115
123
  const hasOrganizationName = hasOwnKey(raw, "organization_name");
@@ -150,7 +158,10 @@ function normalizeUserinfo(raw) {
150
158
  // `'active_canceling'`) for legacy backends. Defaulting to `false`
151
159
  // here keeps the downstream contract a plain boolean.
152
160
  cancelAtPeriodEnd: raw.subscription.cancel_at_period_end ?? false,
153
- currentPeriodEnd: raw.subscription.current_period_end ?? null
161
+ currentPeriodEnd: raw.subscription.current_period_end ?? null,
162
+ // #4333: legacy FFID (< this issue) omits the field on the wire; the
163
+ // guard defaults to `[]` so consumers always get a plain string[].
164
+ entitlements: normalizeEntitlements(raw.subscription.entitlements)
154
165
  } : void 0
155
166
  };
156
167
  }
@@ -437,7 +448,11 @@ function createVerifyAccessToken(deps) {
437
448
  member_role: introspectResponse.subscription.member_role,
438
449
  organization_id: introspectResponse.subscription.organization_id,
439
450
  organization_name: introspectResponse.subscription.organization_name ?? null,
440
- has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
451
+ has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false,
452
+ // #4333: forward pack entitlement codes through the introspect →
453
+ // userinfo normalization boundary. normalizeUserinfo guards the
454
+ // value, so an older FFID that omits it degrades to `[]`.
455
+ entitlements: introspectResponse.subscription.entitlements
441
456
  }
442
457
  } : base;
443
458
  const userinfo = normalizeUserinfo(raw);
@@ -1250,7 +1265,7 @@ function validateTokenResponse(tokenResponse) {
1250
1265
  }
1251
1266
 
1252
1267
  // src/client/version-check.ts
1253
- var SDK_VERSION = "5.24.3";
1268
+ var SDK_VERSION = "5.25.0";
1254
1269
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1255
1270
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1256
1271
  function sdkHeaders() {
@@ -1,4 +1,4 @@
1
- import { k as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-BjZphrz9.cjs';
1
+ import { k as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-BZERrMAF.cjs';
2
2
  import '../../types-Cjb9J0rL.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { k as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-B-xjtrCb.js';
1
+ import { k as FFIDClient, e as FFIDOAuthUserInfo } from '../../ffid-client-CFZPX5ej.js';
2
2
  import '../../types-Cjb9J0rL.js';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "5.24.3",
3
+ "version": "5.25.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",