@feelflow/ffid-sdk 2.12.0 → 2.14.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 FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDCreateCheckoutParams, l as FFIDCheckoutSessionResponse, m as FFIDCreatePortalParams, n as FFIDPortalSessionResponse, o as FFIDVerifyAccessTokenOptions, p as FFIDOAuthUserInfo, q as FFIDInquiryCreateParams, r as FFIDInquiryCreateResponse, s as FFIDAuthMode, t as FFIDLogger, u as FFIDCacheAdapter, v as FFIDUser, w as FFIDOrganization, x as FFIDSubscription, y as FFIDSubscriptionContextValue, z as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, A as FFIDAnnouncementsApiResponse, B as AnnouncementListResponse, C as FFIDAnnouncementsLogger } from './index-BuT9VaRt.cjs';
2
- export { D as Announcement, E as AnnouncementStatus, G as AnnouncementType, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDCacheConfig, O as FFIDContextValue, P as FFIDInquiryCategory, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormOrganization, U as FFIDInquiryFormPlaceholderContext, V as FFIDInquiryFormPrefill, W as FFIDInquiryFormProps, X as FFIDInquiryFormSubmitData, Y as FFIDInquiryFormSubmitResult, Z as FFIDJwtClaims, _ as FFIDLoginButton, $ as FFIDMemberStatus, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOAuthUserInfoSubscription, a3 as FFIDOrganizationMember, a4 as FFIDOrganizationSwitcher, a5 as FFIDSeatModel, a6 as FFIDSubscriptionBadge, a7 as FFIDTokenIntrospectionResponse, a8 as FFIDUserMenu, a9 as FFID_INQUIRY_CATEGORIES, aa as UseFFIDAnnouncementsOptions, ab as UseFFIDAnnouncementsReturn, ac as useFFIDAnnouncements } from './index-BuT9VaRt.cjs';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDUserProfile, l as FFIDUpdateUserProfileRequest, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, B as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, C as FFIDAnnouncementsApiResponse, D as AnnouncementListResponse, E as FFIDAnnouncementsLogger } from './index-DT3wF1vZ.cjs';
2
+ export { G as Announcement, H as AnnouncementStatus, I as AnnouncementType, J as FFIDAnnouncementBadge, K as FFIDAnnouncementList, M as FFIDAnnouncementsError, N as FFIDAnnouncementsErrorCode, O as FFIDAnnouncementsServerResponse, P as FFIDCacheConfig, Q as FFIDContextValue, R as FFIDInquiryCategory, S as FFIDInquiryCategorySite2026, T as FFIDInquiryForm, U as FFIDInquiryFormCategoryItem, V as FFIDInquiryFormClassNames, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDMemberStatus, a3 as FFIDOAuthTokenResponse, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOAuthUserInfoSubscription, a6 as FFIDOrganizationMember, a7 as FFIDOrganizationSwitcher, a8 as FFIDSeatModel, a9 as FFIDSubscriptionBadge, aa as FFIDTokenIntrospectionResponse, ab as FFIDUserMenu, ac as FFID_INQUIRY_CATEGORIES, ad as FFID_INQUIRY_CATEGORIES_SITE_2026, ae as UseFFIDAnnouncementsOptions, af as UseFFIDAnnouncementsReturn, ag as isFFIDInquiryCategorySite2026, ah as useFFIDAnnouncements } from './index-DT3wF1vZ.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -500,6 +500,8 @@ declare function createFFIDClient(config: FFIDConfig): {
500
500
  organizationId: string;
501
501
  userId: string;
502
502
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
503
+ getProfile: () => Promise<FFIDApiResponse<FFIDUserProfile>>;
504
+ updateProfile: (data: FFIDUpdateUserProfileRequest) => Promise<FFIDApiResponse<FFIDUserProfile>>;
503
505
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
504
506
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
505
507
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
@@ -568,6 +570,25 @@ declare class FFIDSDKError extends Error {
568
570
  constructor(code: string, message: string);
569
571
  }
570
572
 
573
+ /**
574
+ * Redirect URI normalization (SDK copy)
575
+ *
576
+ * Kept in sync with `src/lib/common/redirect-uri.ts` in the FFID server
577
+ * repository. OAuth 2.1 exact-match comparison requires that both the
578
+ * registered redirect_uri (managed via the FFID admin UI) and the value
579
+ * sent by OAuth clients converge on the same canonical form — otherwise
580
+ * root-path URLs like `https://example.com` vs `https://example.com/`
581
+ * silently fail to match.
582
+ */
583
+ /** Result of a normalization attempt. */
584
+ interface NormalizeRedirectUriResult {
585
+ /** The normalized URL. `input` plus a trailing `/` if a root-path slash was appended; otherwise exactly `input`. */
586
+ readonly normalized: string;
587
+ /** True only when a trailing slash was appended to a root-path URL. */
588
+ readonly changed: boolean;
589
+ }
590
+ declare function normalizeRedirectUri(input: string): NormalizeRedirectUriResult;
591
+
571
592
  /**
572
593
  * Create an in-memory cache adapter using a Map.
573
594
  * Suitable for single-process environments (e.g., development, testing).
@@ -913,4 +934,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
913
934
  };
914
935
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
915
936
 
916
- export { AnnouncementListResponse, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
937
+ export { AnnouncementListResponse, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDCreateCheckoutParams, l as FFIDCheckoutSessionResponse, m as FFIDCreatePortalParams, n as FFIDPortalSessionResponse, o as FFIDVerifyAccessTokenOptions, p as FFIDOAuthUserInfo, q as FFIDInquiryCreateParams, r as FFIDInquiryCreateResponse, s as FFIDAuthMode, t as FFIDLogger, u as FFIDCacheAdapter, v as FFIDUser, w as FFIDOrganization, x as FFIDSubscription, y as FFIDSubscriptionContextValue, z as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, A as FFIDAnnouncementsApiResponse, B as AnnouncementListResponse, C as FFIDAnnouncementsLogger } from './index-BuT9VaRt.js';
2
- export { D as Announcement, E as AnnouncementStatus, G as AnnouncementType, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDCacheConfig, O as FFIDContextValue, P as FFIDInquiryCategory, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormOrganization, U as FFIDInquiryFormPlaceholderContext, V as FFIDInquiryFormPrefill, W as FFIDInquiryFormProps, X as FFIDInquiryFormSubmitData, Y as FFIDInquiryFormSubmitResult, Z as FFIDJwtClaims, _ as FFIDLoginButton, $ as FFIDMemberStatus, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOAuthUserInfoSubscription, a3 as FFIDOrganizationMember, a4 as FFIDOrganizationSwitcher, a5 as FFIDSeatModel, a6 as FFIDSubscriptionBadge, a7 as FFIDTokenIntrospectionResponse, a8 as FFIDUserMenu, a9 as FFID_INQUIRY_CATEGORIES, aa as UseFFIDAnnouncementsOptions, ab as UseFFIDAnnouncementsReturn, ac as useFFIDAnnouncements } from './index-BuT9VaRt.js';
1
+ import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDListMembersResponse, h as FFIDMemberRole, i as FFIDUpdateMemberRoleResponse, j as FFIDRemoveMemberResponse, k as FFIDUserProfile, l as FFIDUpdateUserProfileRequest, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, B as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, C as FFIDAnnouncementsApiResponse, D as AnnouncementListResponse, E as FFIDAnnouncementsLogger } from './index-DT3wF1vZ.js';
2
+ export { G as Announcement, H as AnnouncementStatus, I as AnnouncementType, J as FFIDAnnouncementBadge, K as FFIDAnnouncementList, M as FFIDAnnouncementsError, N as FFIDAnnouncementsErrorCode, O as FFIDAnnouncementsServerResponse, P as FFIDCacheConfig, Q as FFIDContextValue, R as FFIDInquiryCategory, S as FFIDInquiryCategorySite2026, T as FFIDInquiryForm, U as FFIDInquiryFormCategoryItem, V as FFIDInquiryFormClassNames, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDMemberStatus, a3 as FFIDOAuthTokenResponse, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOAuthUserInfoSubscription, a6 as FFIDOrganizationMember, a7 as FFIDOrganizationSwitcher, a8 as FFIDSeatModel, a9 as FFIDSubscriptionBadge, aa as FFIDTokenIntrospectionResponse, ab as FFIDUserMenu, ac as FFID_INQUIRY_CATEGORIES, ad as FFID_INQUIRY_CATEGORIES_SITE_2026, ae as UseFFIDAnnouncementsOptions, af as UseFFIDAnnouncementsReturn, ag as isFFIDInquiryCategorySite2026, ah as useFFIDAnnouncements } from './index-DT3wF1vZ.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -500,6 +500,8 @@ declare function createFFIDClient(config: FFIDConfig): {
500
500
  organizationId: string;
501
501
  userId: string;
502
502
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
503
+ getProfile: () => Promise<FFIDApiResponse<FFIDUserProfile>>;
504
+ updateProfile: (data: FFIDUpdateUserProfileRequest) => Promise<FFIDApiResponse<FFIDUserProfile>>;
503
505
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
504
506
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
505
507
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
@@ -568,6 +570,25 @@ declare class FFIDSDKError extends Error {
568
570
  constructor(code: string, message: string);
569
571
  }
570
572
 
573
+ /**
574
+ * Redirect URI normalization (SDK copy)
575
+ *
576
+ * Kept in sync with `src/lib/common/redirect-uri.ts` in the FFID server
577
+ * repository. OAuth 2.1 exact-match comparison requires that both the
578
+ * registered redirect_uri (managed via the FFID admin UI) and the value
579
+ * sent by OAuth clients converge on the same canonical form — otherwise
580
+ * root-path URLs like `https://example.com` vs `https://example.com/`
581
+ * silently fail to match.
582
+ */
583
+ /** Result of a normalization attempt. */
584
+ interface NormalizeRedirectUriResult {
585
+ /** The normalized URL. `input` plus a trailing `/` if a root-path slash was appended; otherwise exactly `input`. */
586
+ readonly normalized: string;
587
+ /** True only when a trailing slash was appended to a root-path URL. */
588
+ readonly changed: boolean;
589
+ }
590
+ declare function normalizeRedirectUri(input: string): NormalizeRedirectUriResult;
591
+
571
592
  /**
572
593
  * Create an in-memory cache adapter using a Map.
573
594
  * Suitable for single-process environments (e.g., development, testing).
@@ -913,4 +934,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
913
934
  };
914
935
  type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
915
936
 
916
- export { AnnouncementListResponse, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
937
+ export { AnnouncementListResponse, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, FFIDMemberRole, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext } from './chunk-KJUA77BM.js';
2
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-KJUA77BM.js';
1
+ import { useFFIDContext } from './chunk-424GEJSP.js';
2
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-424GEJSP.js';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -756,8 +756,34 @@ function createMembersMethods(deps) {
756
756
  return { listMembers, updateMemberRole, removeMember };
757
757
  }
758
758
 
759
+ // src/client/profile-methods.ts
760
+ var EXT_PROFILE_ENDPOINT = "/api/v1/users/ext/me";
761
+ function createProfileMethods(deps) {
762
+ const { fetchWithAuth, createError } = deps;
763
+ async function getProfile() {
764
+ return fetchWithAuth(EXT_PROFILE_ENDPOINT);
765
+ }
766
+ async function updateProfile(data) {
767
+ if (data === null || typeof data !== "object" || Array.isArray(data)) {
768
+ return {
769
+ error: createError("VALIDATION_ERROR", "data \u306F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059")
770
+ };
771
+ }
772
+ if (Object.keys(data).length === 0) {
773
+ return {
774
+ error: createError("VALIDATION_ERROR", "\u66F4\u65B0\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044")
775
+ };
776
+ }
777
+ return fetchWithAuth(EXT_PROFILE_ENDPOINT, {
778
+ method: "PUT",
779
+ body: JSON.stringify(data)
780
+ });
781
+ }
782
+ return { getProfile, updateProfile };
783
+ }
784
+
759
785
  // src/client/version-check.ts
760
- var SDK_VERSION = "2.12.0";
786
+ var SDK_VERSION = "2.14.0";
761
787
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
762
788
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
763
789
  function sdkHeaders() {
@@ -1367,6 +1393,23 @@ function createRedirectMethods(deps) {
1367
1393
  return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout };
1368
1394
  }
1369
1395
 
1396
+ // src/client/redirect-uri.ts
1397
+ var AUTHORITY_BOUNDARY = /^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/?#]+)([/?#]?)/;
1398
+ function normalizeRedirectUri(input) {
1399
+ const url = new URL(input);
1400
+ const isRootPath = url.pathname === "" || url.pathname === "/";
1401
+ if (!isRootPath) {
1402
+ return { normalized: input, changed: false };
1403
+ }
1404
+ const match = input.match(AUTHORITY_BOUNDARY);
1405
+ if (match === null || match[2] === "/") {
1406
+ return { normalized: input, changed: false };
1407
+ }
1408
+ const authority = match[1];
1409
+ const rest = input.slice(authority.length);
1410
+ return { normalized: `${authority}/${rest}`, changed: true };
1411
+ }
1412
+
1370
1413
  // src/client/password-reset.ts
1371
1414
  var RESET_PASSWORD_BASE = "/api/v1/auth/reset-password";
1372
1415
  function isBlank(value) {
@@ -1877,6 +1920,24 @@ var FFID_ERROR_CODES = {
1877
1920
  TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR"
1878
1921
  };
1879
1922
  var EXT_CHECK_ENDPOINT = "/api/v1/subscriptions/ext/check";
1923
+ function resolveRedirectUri(raw, logger) {
1924
+ if (raw === null) return null;
1925
+ try {
1926
+ const { normalized, changed } = normalizeRedirectUri(raw);
1927
+ if (changed) {
1928
+ logger.warn(
1929
+ `FFID Client: redirect_uri \u3092\u6B63\u898F\u5316\u3057\u307E\u3057\u305F (${raw} \u2192 ${normalized})\u3002FFID \u7BA1\u7406\u753B\u9762\u3067\u306E\u767B\u9332\u5024\u3068\u4E00\u81F4\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002`
1930
+ );
1931
+ }
1932
+ return normalized;
1933
+ } catch (error) {
1934
+ logger.warn(
1935
+ `FFID Client: redirectUri \u306E\u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u6B63\u898F\u5316\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F (${raw})`,
1936
+ error
1937
+ );
1938
+ return raw;
1939
+ }
1940
+ }
1880
1941
  function createFFIDClient(config) {
1881
1942
  if (!config.serviceCode || !config.serviceCode.trim()) {
1882
1943
  throw new Error("FFID Client: serviceCode \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
@@ -1884,7 +1945,7 @@ function createFFIDClient(config) {
1884
1945
  const baseUrl = config.apiBaseUrl ?? chunkYUIITYBE_cjs.DEFAULT_API_BASE_URL;
1885
1946
  const authMode = config.authMode ?? "cookie";
1886
1947
  const clientId = config.clientId ?? config.serviceCode;
1887
- const resolvedRedirectUri = config.redirectUri ?? null;
1948
+ const rawRedirectUri = config.redirectUri ?? null;
1888
1949
  const serviceApiKey = config.serviceApiKey?.trim();
1889
1950
  const verifyStrategy = config.verifyStrategy ?? "jwt";
1890
1951
  const cache = config.cache;
@@ -1899,6 +1960,7 @@ function createFFIDClient(config) {
1899
1960
  throw new Error("FFID Client: timeout \u306F\u6B63\u306E\u6570\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
1900
1961
  }
1901
1962
  const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
1963
+ const resolvedRedirectUri = resolveRedirectUri(rawRedirectUri, logger);
1902
1964
  const tokenStore = authMode === "token" ? createTokenStore() : createTokenStore("memory");
1903
1965
  function createError(code, message) {
1904
1966
  return { code, message };
@@ -2092,6 +2154,10 @@ function createFFIDClient(config) {
2092
2154
  createError,
2093
2155
  serviceCode: config.serviceCode
2094
2156
  });
2157
+ const { getProfile, updateProfile } = createProfileMethods({
2158
+ fetchWithAuth,
2159
+ createError
2160
+ });
2095
2161
  const {
2096
2162
  requestPasswordReset,
2097
2163
  verifyPasswordResetToken,
@@ -2163,6 +2229,8 @@ function createFFIDClient(config) {
2163
2229
  listMembers,
2164
2230
  updateMemberRole,
2165
2231
  removeMember,
2232
+ getProfile,
2233
+ updateProfile,
2166
2234
  createCheckoutSession,
2167
2235
  createPortalSession,
2168
2236
  listPlans,
@@ -8,21 +8,63 @@ export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.cjs';
8
8
  * `<FFIDInquiryForm />` and submit through either endpoint.
9
9
  */
10
10
  /**
11
- * Categories surfaced by the default form. Consumers are free to
12
- * pass their own list via `<FFIDInquiryForm categories={...} />`.
11
+ * Legacy 6-value canonical categories. Retained for historical DB rows
12
+ * (the pre-2026 values `general`, `sales`, `support`, `press` still appear
13
+ * in older inquiries) and for 2.x backwards compatibility with SDK
14
+ * consumers that pinned to this exact set.
15
+ *
16
+ * Note: `partnership` and `other` intentionally also appear in
17
+ * {@link FFID_INQUIRY_CATEGORIES_SITE_2026}; the legacy-only subset is
18
+ * `general`, `sales`, `support`, `press`.
19
+ *
20
+ * @deprecated New integrations should use
21
+ * {@link FFID_INQUIRY_CATEGORIES_SITE_2026} (13 values, aligned with
22
+ * feelflow-website-2026 `/contact`). This legacy constant remains
23
+ * exported for 2.x compatibility and may be removed in 3.x.
13
24
  */
14
25
  declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
26
+ /**
27
+ * Type alias derived from the legacy 6-value list. Still referenced by
28
+ * {@link FFIDInquiryCreateParams.category} so existing callers compile
29
+ * without changes; no `@deprecated` on the type itself because the
30
+ * actionable migration target is the runtime constant above, and
31
+ * propagating `@deprecated` to the type would surface false-positive
32
+ * warnings on public API that deliberately accepts both shapes.
33
+ */
15
34
  type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
35
+ /**
36
+ * 13-value category list that mirrors feelflow-website-2026
37
+ * `/contact` (`feelflow-site/src/lib/contact-schema.ts` `CATEGORY_OPTIONS`).
38
+ *
39
+ * Source-of-truth ownership: **the site repo is authoritative**; this
40
+ * constant is a delayed-sync snapshot shipped through the SDK so
41
+ * consumers can get autocomplete without depending on the site repo.
42
+ * Drift between site and the FFID admin UI is detected automatically by
43
+ * `scripts/sync-inquiry-categories.ts` (SDK-side drift is a separate
44
+ * follow-up and today is caught only if the SDK snapshot is updated
45
+ * alongside the admin UI constants).
46
+ */
47
+ declare const FFID_INQUIRY_CATEGORIES_SITE_2026: readonly ["consulting", "saas", "development", "agent-hub", "ai-feel-chatbot", "knowledge-db", "biz-simulator", "discussion-board", "realtime-ai", "partnership", "media", "recruiting", "other"];
48
+ type FFIDInquiryCategorySite2026 = (typeof FFID_INQUIRY_CATEGORIES_SITE_2026)[number];
16
49
  /**
17
50
  * Parameters for `client.inquiry.create()`. When submitting from a
18
51
  * server-side SDK (Service API Key), set `source` to a stable
19
52
  * origin string so admins can trace the submission back.
53
+ *
54
+ * `category` accepts any string at the SDK boundary to keep the SDK
55
+ * forward-compatible with new site-side categories added before the SDK
56
+ * re-publishes. FFID ext-endpoint validation (`/api/v1/ext/inquiry`) is
57
+ * lenient — `z.string().max(100).optional()` — so unknown strings flow
58
+ * through to the DB unchanged. Note: the `(string & {})` arm of the
59
+ * union intentionally keeps autocomplete active while allowing arbitrary
60
+ * strings; callers using exhaustive `switch` statements should include
61
+ * a `default` branch.
20
62
  */
21
63
  interface FFIDInquiryCreateParams {
22
64
  email: string;
23
65
  name: string;
24
66
  message: string;
25
- category?: FFIDInquiryCategory | (string & {});
67
+ category?: FFIDInquiryCategorySite2026 | FFIDInquiryCategory | (string & {});
26
68
  company?: string;
27
69
  phone?: string;
28
70
  locale?: 'ja' | 'en';
@@ -738,6 +780,64 @@ interface FFIDUpdateMemberRoleResponse {
738
780
  interface FFIDRemoveMemberResponse {
739
781
  message: string;
740
782
  }
783
+ /**
784
+ * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
785
+ *
786
+ * Mirrors the FFID backend `UserProfile` shape exposed via
787
+ * `GET /api/v1/users/ext/me` and `PUT /api/v1/users/ext/me`.
788
+ */
789
+ interface FFIDUserProfile {
790
+ /** User ID (UUID) */
791
+ id: string;
792
+ /** Email address */
793
+ email: string;
794
+ /** Display name (nullable when not set) */
795
+ displayName: string | null;
796
+ /** Avatar URL (nullable when not set) */
797
+ avatarUrl: string | null;
798
+ /** Phone number (nullable when not set) */
799
+ phone: string | null;
800
+ /** Company name (nullable when not set) */
801
+ companyName: string | null;
802
+ /** Department (nullable when not set) */
803
+ department: string | null;
804
+ /** Job title (nullable when not set) */
805
+ jobTitle: string | null;
806
+ /** IANA timezone (e.g. 'Asia/Tokyo') */
807
+ timezone: string;
808
+ /** Locale (e.g. 'ja', 'en') */
809
+ locale: string;
810
+ /** Arbitrary user preferences bag */
811
+ preferences: Record<string, unknown>;
812
+ /** Account creation timestamp (ISO 8601) */
813
+ createdAt: string;
814
+ /** Profile last-updated timestamp (ISO 8601) */
815
+ updatedAt: string;
816
+ }
817
+ /**
818
+ * Request payload for `updateProfile`.
819
+ *
820
+ * Mirrors the FFID backend `UpdateUserProfileRequest` shape. All fields are
821
+ * optional — only the supplied keys will be updated (partial update semantics).
822
+ */
823
+ interface FFIDUpdateUserProfileRequest {
824
+ /** Display name */
825
+ displayName?: string;
826
+ /** Phone number */
827
+ phone?: string;
828
+ /** Company name */
829
+ companyName?: string;
830
+ /** Department */
831
+ department?: string;
832
+ /** Job title */
833
+ jobTitle?: string;
834
+ /** IANA timezone */
835
+ timezone?: string;
836
+ /** Locale */
837
+ locale?: string;
838
+ /** Arbitrary user preferences bag */
839
+ preferences?: Record<string, unknown>;
840
+ }
741
841
  /**
742
842
  * Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
743
843
  *
@@ -892,6 +992,8 @@ declare function createFFIDClient(config: FFIDConfig): {
892
992
  organizationId: string;
893
993
  userId: string;
894
994
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
995
+ getProfile: () => Promise<FFIDApiResponse<FFIDUserProfile>>;
996
+ updateProfile: (data: FFIDUpdateUserProfileRequest) => Promise<FFIDApiResponse<FFIDUserProfile>>;
895
997
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
896
998
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
897
999
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
@@ -8,21 +8,63 @@ export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.js';
8
8
  * `<FFIDInquiryForm />` and submit through either endpoint.
9
9
  */
10
10
  /**
11
- * Categories surfaced by the default form. Consumers are free to
12
- * pass their own list via `<FFIDInquiryForm categories={...} />`.
11
+ * Legacy 6-value canonical categories. Retained for historical DB rows
12
+ * (the pre-2026 values `general`, `sales`, `support`, `press` still appear
13
+ * in older inquiries) and for 2.x backwards compatibility with SDK
14
+ * consumers that pinned to this exact set.
15
+ *
16
+ * Note: `partnership` and `other` intentionally also appear in
17
+ * {@link FFID_INQUIRY_CATEGORIES_SITE_2026}; the legacy-only subset is
18
+ * `general`, `sales`, `support`, `press`.
19
+ *
20
+ * @deprecated New integrations should use
21
+ * {@link FFID_INQUIRY_CATEGORIES_SITE_2026} (13 values, aligned with
22
+ * feelflow-website-2026 `/contact`). This legacy constant remains
23
+ * exported for 2.x compatibility and may be removed in 3.x.
13
24
  */
14
25
  declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
26
+ /**
27
+ * Type alias derived from the legacy 6-value list. Still referenced by
28
+ * {@link FFIDInquiryCreateParams.category} so existing callers compile
29
+ * without changes; no `@deprecated` on the type itself because the
30
+ * actionable migration target is the runtime constant above, and
31
+ * propagating `@deprecated` to the type would surface false-positive
32
+ * warnings on public API that deliberately accepts both shapes.
33
+ */
15
34
  type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
35
+ /**
36
+ * 13-value category list that mirrors feelflow-website-2026
37
+ * `/contact` (`feelflow-site/src/lib/contact-schema.ts` `CATEGORY_OPTIONS`).
38
+ *
39
+ * Source-of-truth ownership: **the site repo is authoritative**; this
40
+ * constant is a delayed-sync snapshot shipped through the SDK so
41
+ * consumers can get autocomplete without depending on the site repo.
42
+ * Drift between site and the FFID admin UI is detected automatically by
43
+ * `scripts/sync-inquiry-categories.ts` (SDK-side drift is a separate
44
+ * follow-up and today is caught only if the SDK snapshot is updated
45
+ * alongside the admin UI constants).
46
+ */
47
+ declare const FFID_INQUIRY_CATEGORIES_SITE_2026: readonly ["consulting", "saas", "development", "agent-hub", "ai-feel-chatbot", "knowledge-db", "biz-simulator", "discussion-board", "realtime-ai", "partnership", "media", "recruiting", "other"];
48
+ type FFIDInquiryCategorySite2026 = (typeof FFID_INQUIRY_CATEGORIES_SITE_2026)[number];
16
49
  /**
17
50
  * Parameters for `client.inquiry.create()`. When submitting from a
18
51
  * server-side SDK (Service API Key), set `source` to a stable
19
52
  * origin string so admins can trace the submission back.
53
+ *
54
+ * `category` accepts any string at the SDK boundary to keep the SDK
55
+ * forward-compatible with new site-side categories added before the SDK
56
+ * re-publishes. FFID ext-endpoint validation (`/api/v1/ext/inquiry`) is
57
+ * lenient — `z.string().max(100).optional()` — so unknown strings flow
58
+ * through to the DB unchanged. Note: the `(string & {})` arm of the
59
+ * union intentionally keeps autocomplete active while allowing arbitrary
60
+ * strings; callers using exhaustive `switch` statements should include
61
+ * a `default` branch.
20
62
  */
21
63
  interface FFIDInquiryCreateParams {
22
64
  email: string;
23
65
  name: string;
24
66
  message: string;
25
- category?: FFIDInquiryCategory | (string & {});
67
+ category?: FFIDInquiryCategorySite2026 | FFIDInquiryCategory | (string & {});
26
68
  company?: string;
27
69
  phone?: string;
28
70
  locale?: 'ja' | 'en';
@@ -738,6 +780,64 @@ interface FFIDUpdateMemberRoleResponse {
738
780
  interface FFIDRemoveMemberResponse {
739
781
  message: string;
740
782
  }
783
+ /**
784
+ * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
785
+ *
786
+ * Mirrors the FFID backend `UserProfile` shape exposed via
787
+ * `GET /api/v1/users/ext/me` and `PUT /api/v1/users/ext/me`.
788
+ */
789
+ interface FFIDUserProfile {
790
+ /** User ID (UUID) */
791
+ id: string;
792
+ /** Email address */
793
+ email: string;
794
+ /** Display name (nullable when not set) */
795
+ displayName: string | null;
796
+ /** Avatar URL (nullable when not set) */
797
+ avatarUrl: string | null;
798
+ /** Phone number (nullable when not set) */
799
+ phone: string | null;
800
+ /** Company name (nullable when not set) */
801
+ companyName: string | null;
802
+ /** Department (nullable when not set) */
803
+ department: string | null;
804
+ /** Job title (nullable when not set) */
805
+ jobTitle: string | null;
806
+ /** IANA timezone (e.g. 'Asia/Tokyo') */
807
+ timezone: string;
808
+ /** Locale (e.g. 'ja', 'en') */
809
+ locale: string;
810
+ /** Arbitrary user preferences bag */
811
+ preferences: Record<string, unknown>;
812
+ /** Account creation timestamp (ISO 8601) */
813
+ createdAt: string;
814
+ /** Profile last-updated timestamp (ISO 8601) */
815
+ updatedAt: string;
816
+ }
817
+ /**
818
+ * Request payload for `updateProfile`.
819
+ *
820
+ * Mirrors the FFID backend `UpdateUserProfileRequest` shape. All fields are
821
+ * optional — only the supplied keys will be updated (partial update semantics).
822
+ */
823
+ interface FFIDUpdateUserProfileRequest {
824
+ /** Display name */
825
+ displayName?: string;
826
+ /** Phone number */
827
+ phone?: string;
828
+ /** Company name */
829
+ companyName?: string;
830
+ /** Department */
831
+ department?: string;
832
+ /** Job title */
833
+ jobTitle?: string;
834
+ /** IANA timezone */
835
+ timezone?: string;
836
+ /** Locale */
837
+ locale?: string;
838
+ /** Arbitrary user preferences bag */
839
+ preferences?: Record<string, unknown>;
840
+ }
741
841
  /**
742
842
  * Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
743
843
  *
@@ -892,6 +992,8 @@ declare function createFFIDClient(config: FFIDConfig): {
892
992
  organizationId: string;
893
993
  userId: string;
894
994
  }) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
995
+ getProfile: () => Promise<FFIDApiResponse<FFIDUserProfile>>;
996
+ updateProfile: (data: FFIDUpdateUserProfileRequest) => Promise<FFIDApiResponse<FFIDUserProfile>>;
895
997
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
896
998
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
897
999
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;