@feelflow/ffid-sdk 2.7.0 → 2.8.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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkI6MKRVUB_cjs = require('./chunk-I6MKRVUB.cjs');
3
+ var chunkGB5OHEVY_cjs = require('./chunk-GB5OHEVY.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -46,7 +46,7 @@ function createKVCacheAdapter(kv) {
46
46
  }
47
47
  function withFFIDAuth(Component, options = {}) {
48
48
  const WrappedComponent = (props) => {
49
- const { isLoading, isAuthenticated, login } = chunkI6MKRVUB_cjs.useFFIDContext();
49
+ const { isLoading, isAuthenticated, login } = chunkGB5OHEVY_cjs.useFFIDContext();
50
50
  const hasRedirected = react.useRef(false);
51
51
  react.useEffect(() => {
52
52
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -74,83 +74,91 @@ var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
74
74
 
75
75
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
76
76
  enumerable: true,
77
- get: function () { return chunkI6MKRVUB_cjs.DEFAULT_API_BASE_URL; }
77
+ get: function () { return chunkGB5OHEVY_cjs.DEFAULT_API_BASE_URL; }
78
78
  });
79
79
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
80
80
  enumerable: true,
81
- get: function () { return chunkI6MKRVUB_cjs.FFIDAnnouncementBadge; }
81
+ get: function () { return chunkGB5OHEVY_cjs.FFIDAnnouncementBadge; }
82
82
  });
83
83
  Object.defineProperty(exports, "FFIDAnnouncementList", {
84
84
  enumerable: true,
85
- get: function () { return chunkI6MKRVUB_cjs.FFIDAnnouncementList; }
85
+ get: function () { return chunkGB5OHEVY_cjs.FFIDAnnouncementList; }
86
+ });
87
+ Object.defineProperty(exports, "FFIDInquiryForm", {
88
+ enumerable: true,
89
+ get: function () { return chunkGB5OHEVY_cjs.FFIDInquiryForm; }
86
90
  });
87
91
  Object.defineProperty(exports, "FFIDLoginButton", {
88
92
  enumerable: true,
89
- get: function () { return chunkI6MKRVUB_cjs.FFIDLoginButton; }
93
+ get: function () { return chunkGB5OHEVY_cjs.FFIDLoginButton; }
90
94
  });
91
95
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
92
96
  enumerable: true,
93
- get: function () { return chunkI6MKRVUB_cjs.FFIDOrganizationSwitcher; }
97
+ get: function () { return chunkGB5OHEVY_cjs.FFIDOrganizationSwitcher; }
94
98
  });
95
99
  Object.defineProperty(exports, "FFIDProvider", {
96
100
  enumerable: true,
97
- get: function () { return chunkI6MKRVUB_cjs.FFIDProvider; }
101
+ get: function () { return chunkGB5OHEVY_cjs.FFIDProvider; }
98
102
  });
99
103
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
100
104
  enumerable: true,
101
- get: function () { return chunkI6MKRVUB_cjs.FFIDSubscriptionBadge; }
105
+ get: function () { return chunkGB5OHEVY_cjs.FFIDSubscriptionBadge; }
102
106
  });
103
107
  Object.defineProperty(exports, "FFIDUserMenu", {
104
108
  enumerable: true,
105
- get: function () { return chunkI6MKRVUB_cjs.FFIDUserMenu; }
109
+ get: function () { return chunkGB5OHEVY_cjs.FFIDUserMenu; }
106
110
  });
107
111
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
108
112
  enumerable: true,
109
- get: function () { return chunkI6MKRVUB_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
113
+ get: function () { return chunkGB5OHEVY_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
114
+ });
115
+ Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
116
+ enumerable: true,
117
+ get: function () { return chunkGB5OHEVY_cjs.FFID_INQUIRY_CATEGORIES; }
110
118
  });
111
119
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
112
120
  enumerable: true,
113
- get: function () { return chunkI6MKRVUB_cjs.createFFIDAnnouncementsClient; }
121
+ get: function () { return chunkGB5OHEVY_cjs.createFFIDAnnouncementsClient; }
114
122
  });
115
123
  Object.defineProperty(exports, "createFFIDClient", {
116
124
  enumerable: true,
117
- get: function () { return chunkI6MKRVUB_cjs.createFFIDClient; }
125
+ get: function () { return chunkGB5OHEVY_cjs.createFFIDClient; }
118
126
  });
119
127
  Object.defineProperty(exports, "createTokenStore", {
120
128
  enumerable: true,
121
- get: function () { return chunkI6MKRVUB_cjs.createTokenStore; }
129
+ get: function () { return chunkGB5OHEVY_cjs.createTokenStore; }
122
130
  });
123
131
  Object.defineProperty(exports, "generateCodeChallenge", {
124
132
  enumerable: true,
125
- get: function () { return chunkI6MKRVUB_cjs.generateCodeChallenge; }
133
+ get: function () { return chunkGB5OHEVY_cjs.generateCodeChallenge; }
126
134
  });
127
135
  Object.defineProperty(exports, "generateCodeVerifier", {
128
136
  enumerable: true,
129
- get: function () { return chunkI6MKRVUB_cjs.generateCodeVerifier; }
137
+ get: function () { return chunkGB5OHEVY_cjs.generateCodeVerifier; }
130
138
  });
131
139
  Object.defineProperty(exports, "retrieveCodeVerifier", {
132
140
  enumerable: true,
133
- get: function () { return chunkI6MKRVUB_cjs.retrieveCodeVerifier; }
141
+ get: function () { return chunkGB5OHEVY_cjs.retrieveCodeVerifier; }
134
142
  });
135
143
  Object.defineProperty(exports, "storeCodeVerifier", {
136
144
  enumerable: true,
137
- get: function () { return chunkI6MKRVUB_cjs.storeCodeVerifier; }
145
+ get: function () { return chunkGB5OHEVY_cjs.storeCodeVerifier; }
138
146
  });
139
147
  Object.defineProperty(exports, "useFFID", {
140
148
  enumerable: true,
141
- get: function () { return chunkI6MKRVUB_cjs.useFFID; }
149
+ get: function () { return chunkGB5OHEVY_cjs.useFFID; }
142
150
  });
143
151
  Object.defineProperty(exports, "useFFIDAnnouncements", {
144
152
  enumerable: true,
145
- get: function () { return chunkI6MKRVUB_cjs.useFFIDAnnouncements; }
153
+ get: function () { return chunkGB5OHEVY_cjs.useFFIDAnnouncements; }
146
154
  });
147
155
  Object.defineProperty(exports, "useSubscription", {
148
156
  enumerable: true,
149
- get: function () { return chunkI6MKRVUB_cjs.useSubscription; }
157
+ get: function () { return chunkGB5OHEVY_cjs.useSubscription; }
150
158
  });
151
159
  Object.defineProperty(exports, "withSubscription", {
152
160
  enumerable: true,
153
- get: function () { return chunkI6MKRVUB_cjs.withSubscription; }
161
+ get: function () { return chunkGB5OHEVY_cjs.withSubscription; }
154
162
  });
155
163
  exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
156
164
  exports.createKVCacheAdapter = createKVCacheAdapter;
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 FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-p4dJw3qR.cjs';
2
- export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, E as FFIDAnnouncementBadge, G as FFIDAnnouncementList, H as FFIDAnnouncementsError, I as FFIDAnnouncementsErrorCode, J as FFIDAnnouncementsServerResponse, K as FFIDCacheConfig, M as FFIDContextValue, N as FFIDJwtClaims, O as FFIDLoginButton, P as FFIDMemberStatus, Q as FFIDOAuthTokenResponse, R as FFIDOAuthUserInfoMemberRole, S as FFIDOAuthUserInfoSubscription, T as FFIDOrganizationMember, U as FFIDOrganizationSwitcher, V as FFIDSeatModel, W as FFIDSubscriptionBadge, X as FFIDTokenIntrospectionResponse, Y as FFIDUserMenu, Z as UseFFIDAnnouncementsOptions, _ as UseFFIDAnnouncementsReturn, $ as useFFIDAnnouncements } from './index-p4dJw3qR.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 FFIDCreateCheckoutParams, l as FFIDCheckoutSessionResponse, m as FFIDCreatePortalParams, n as FFIDPortalSessionResponse, o as FFIDVerifyAccessTokenOptions, p as FFIDOAuthUserInfo, q as FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-BBAzyBFG.cjs';
2
+ export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, E as FFIDAnnouncementBadge, G as FFIDAnnouncementList, H as FFIDAnnouncementsError, I as FFIDAnnouncementsErrorCode, J as FFIDAnnouncementsServerResponse, K as FFIDCacheConfig, M as FFIDContextValue, N as FFIDInquiryForm, O as FFIDInquiryFormOrganization, P as FFIDInquiryFormPrefill, Q as FFIDInquiryFormProps, R as FFIDInquiryFormSubmitData, S as FFIDInquiryFormSubmitResult, T as FFIDJwtClaims, U as FFIDLoginButton, V as FFIDMemberStatus, W as FFIDOAuthTokenResponse, X as FFIDOAuthUserInfoMemberRole, Y as FFIDOAuthUserInfoSubscription, Z as FFIDOrganizationMember, _ as FFIDOrganizationSwitcher, $ as FFIDSeatModel, a0 as FFIDSubscriptionBadge, a1 as FFIDTokenIntrospectionResponse, a2 as FFIDUserMenu, a3 as UseFFIDAnnouncementsOptions, a4 as UseFFIDAnnouncementsReturn, a5 as useFFIDAnnouncements } from './index-BBAzyBFG.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -481,6 +481,10 @@ declare function createFFIDClient(config: FFIDConfig): {
481
481
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
482
482
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
483
483
  };
484
+ /** Inquiry methods (create) */
485
+ inquiry: {
486
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
487
+ };
484
488
  /** Token store (token mode only) */
485
489
  tokenStore: TokenStore;
486
490
  /** Resolved auth mode */
@@ -829,4 +833,57 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
829
833
  };
830
834
  type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
831
835
 
832
- 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, 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, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, 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 };
836
+ /**
837
+ * Inquiry types exposed by the FFID SDK.
838
+ *
839
+ * Mirrors the `/api/v1/ext/inquiry` and `/api/contact` endpoints
840
+ * with a single shared shape so that consumers can render one
841
+ * `<FFIDInquiryForm />` and submit through either endpoint.
842
+ */
843
+ /**
844
+ * Categories surfaced by the default form. Consumers are free to
845
+ * pass their own list via `<FFIDInquiryForm categories={...} />`.
846
+ */
847
+ declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
848
+ type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
849
+ /**
850
+ * Parameters for `client.inquiry.create()`. When submitting from a
851
+ * server-side SDK (Service API Key), set `source` to a stable
852
+ * origin string so admins can trace the submission back.
853
+ */
854
+ interface FFIDInquiryCreateParams {
855
+ email: string;
856
+ name: string;
857
+ message: string;
858
+ category?: FFIDInquiryCategory | (string & {});
859
+ company?: string;
860
+ phone?: string;
861
+ locale?: 'ja' | 'en';
862
+ /** Current terms-of-service version the submitter agreed to. */
863
+ termsVersion: string;
864
+ /** Current privacy-policy version the submitter agreed to. */
865
+ privacyVersion: string;
866
+ /** Opt-in to the post-inquiry follow-up newsletter (Type A). */
867
+ inquiryFollowupOptIn?: boolean;
868
+ /** Opt-in to the general marketing newsletter (Type B). */
869
+ generalNewsletterOptIn?: boolean;
870
+ }
871
+ interface FFIDInquiryCreateResponse {
872
+ ok: true;
873
+ inquiryId: string;
874
+ /** True only when the submitter is already a confirmed newsletter subscriber. */
875
+ newsletterSubscribed: boolean;
876
+ }
877
+
878
+ /** Inquiry methods - create external inquiries via the FFID public API. */
879
+
880
+ interface InquiryMethodsDeps {
881
+ fetchWithAuth: <T>(endpoint: string, options?: RequestInit) => Promise<FFIDApiResponse<T>>;
882
+ createError: (code: string, message: string) => FFIDError;
883
+ }
884
+ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
885
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
886
+ };
887
+ type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
888
+
889
+ 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 FFIDInquiryCategory, type FFIDInquiryClient, type FFIDInquiryCreateParams, type 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, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, 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_INQUIRY_CATEGORIES, 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 };
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 FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-p4dJw3qR.js';
2
- export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, E as FFIDAnnouncementBadge, G as FFIDAnnouncementList, H as FFIDAnnouncementsError, I as FFIDAnnouncementsErrorCode, J as FFIDAnnouncementsServerResponse, K as FFIDCacheConfig, M as FFIDContextValue, N as FFIDJwtClaims, O as FFIDLoginButton, P as FFIDMemberStatus, Q as FFIDOAuthTokenResponse, R as FFIDOAuthUserInfoMemberRole, S as FFIDOAuthUserInfoSubscription, T as FFIDOrganizationMember, U as FFIDOrganizationSwitcher, V as FFIDSeatModel, W as FFIDSubscriptionBadge, X as FFIDTokenIntrospectionResponse, Y as FFIDUserMenu, Z as UseFFIDAnnouncementsOptions, _ as UseFFIDAnnouncementsReturn, $ as useFFIDAnnouncements } from './index-p4dJw3qR.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 FFIDCreateCheckoutParams, l as FFIDCheckoutSessionResponse, m as FFIDCreatePortalParams, n as FFIDPortalSessionResponse, o as FFIDVerifyAccessTokenOptions, p as FFIDOAuthUserInfo, q as FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-BBAzyBFG.js';
2
+ export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, E as FFIDAnnouncementBadge, G as FFIDAnnouncementList, H as FFIDAnnouncementsError, I as FFIDAnnouncementsErrorCode, J as FFIDAnnouncementsServerResponse, K as FFIDCacheConfig, M as FFIDContextValue, N as FFIDInquiryForm, O as FFIDInquiryFormOrganization, P as FFIDInquiryFormPrefill, Q as FFIDInquiryFormProps, R as FFIDInquiryFormSubmitData, S as FFIDInquiryFormSubmitResult, T as FFIDJwtClaims, U as FFIDLoginButton, V as FFIDMemberStatus, W as FFIDOAuthTokenResponse, X as FFIDOAuthUserInfoMemberRole, Y as FFIDOAuthUserInfoSubscription, Z as FFIDOrganizationMember, _ as FFIDOrganizationSwitcher, $ as FFIDSeatModel, a0 as FFIDSubscriptionBadge, a1 as FFIDTokenIntrospectionResponse, a2 as FFIDUserMenu, a3 as UseFFIDAnnouncementsOptions, a4 as UseFFIDAnnouncementsReturn, a5 as useFFIDAnnouncements } from './index-BBAzyBFG.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -481,6 +481,10 @@ declare function createFFIDClient(config: FFIDConfig): {
481
481
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
482
482
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
483
483
  };
484
+ /** Inquiry methods (create) */
485
+ inquiry: {
486
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
487
+ };
484
488
  /** Token store (token mode only) */
485
489
  tokenStore: TokenStore;
486
490
  /** Resolved auth mode */
@@ -829,4 +833,57 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
829
833
  };
830
834
  type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
831
835
 
832
- 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, 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, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, 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 };
836
+ /**
837
+ * Inquiry types exposed by the FFID SDK.
838
+ *
839
+ * Mirrors the `/api/v1/ext/inquiry` and `/api/contact` endpoints
840
+ * with a single shared shape so that consumers can render one
841
+ * `<FFIDInquiryForm />` and submit through either endpoint.
842
+ */
843
+ /**
844
+ * Categories surfaced by the default form. Consumers are free to
845
+ * pass their own list via `<FFIDInquiryForm categories={...} />`.
846
+ */
847
+ declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
848
+ type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
849
+ /**
850
+ * Parameters for `client.inquiry.create()`. When submitting from a
851
+ * server-side SDK (Service API Key), set `source` to a stable
852
+ * origin string so admins can trace the submission back.
853
+ */
854
+ interface FFIDInquiryCreateParams {
855
+ email: string;
856
+ name: string;
857
+ message: string;
858
+ category?: FFIDInquiryCategory | (string & {});
859
+ company?: string;
860
+ phone?: string;
861
+ locale?: 'ja' | 'en';
862
+ /** Current terms-of-service version the submitter agreed to. */
863
+ termsVersion: string;
864
+ /** Current privacy-policy version the submitter agreed to. */
865
+ privacyVersion: string;
866
+ /** Opt-in to the post-inquiry follow-up newsletter (Type A). */
867
+ inquiryFollowupOptIn?: boolean;
868
+ /** Opt-in to the general marketing newsletter (Type B). */
869
+ generalNewsletterOptIn?: boolean;
870
+ }
871
+ interface FFIDInquiryCreateResponse {
872
+ ok: true;
873
+ inquiryId: string;
874
+ /** True only when the submitter is already a confirmed newsletter subscriber. */
875
+ newsletterSubscribed: boolean;
876
+ }
877
+
878
+ /** Inquiry methods - create external inquiries via the FFID public API. */
879
+
880
+ interface InquiryMethodsDeps {
881
+ fetchWithAuth: <T>(endpoint: string, options?: RequestInit) => Promise<FFIDApiResponse<T>>;
882
+ createError: (code: string, message: string) => FFIDError;
883
+ }
884
+ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
885
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
886
+ };
887
+ type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
888
+
889
+ 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 FFIDInquiryCategory, type FFIDInquiryClient, type FFIDInquiryCreateParams, type 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, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, 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_INQUIRY_CATEGORIES, 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 };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext } from './chunk-YQPG6Z7W.js';
2
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-YQPG6Z7W.js';
1
+ import { useFFIDContext } from './chunk-SR4UAQ3C.js';
2
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-SR4UAQ3C.js';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -617,7 +617,7 @@ function createMembersMethods(deps) {
617
617
  }
618
618
 
619
619
  // src/client/version-check.ts
620
- var SDK_VERSION = "2.7.0";
620
+ var SDK_VERSION = "2.8.0";
621
621
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
622
622
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
623
623
  function sdkHeaders() {
@@ -1660,6 +1660,56 @@ function createNewsletterMethods(deps) {
1660
1660
  return { subscribe, confirm, unsubscribe };
1661
1661
  }
1662
1662
 
1663
+ // src/inquiry/ffid-inquiry-client.ts
1664
+ var EXT_INQUIRY_ENDPOINT = "/api/v1/ext/inquiry";
1665
+ function trimOrEmpty2(s) {
1666
+ return typeof s === "string" ? s.trim() : "";
1667
+ }
1668
+ function createInquiryMethods(deps) {
1669
+ const { fetchWithAuth, createError } = deps;
1670
+ async function create(params) {
1671
+ const email = trimOrEmpty2(params.email);
1672
+ const name = trimOrEmpty2(params.name);
1673
+ const message = trimOrEmpty2(params.message);
1674
+ const termsVersion = trimOrEmpty2(params.termsVersion);
1675
+ const privacyVersion = trimOrEmpty2(params.privacyVersion);
1676
+ if (!email) return { error: createError("VALIDATION_ERROR", "email \u306F\u5FC5\u9808\u3067\u3059") };
1677
+ if (!name) return { error: createError("VALIDATION_ERROR", "name \u306F\u5FC5\u9808\u3067\u3059") };
1678
+ if (!message) return { error: createError("VALIDATION_ERROR", "message \u306F\u5FC5\u9808\u3067\u3059") };
1679
+ if (!termsVersion) {
1680
+ return { error: createError("VALIDATION_ERROR", "termsVersion \u306F\u5FC5\u9808\u3067\u3059") };
1681
+ }
1682
+ if (!privacyVersion) {
1683
+ return { error: createError("VALIDATION_ERROR", "privacyVersion \u306F\u5FC5\u9808\u3067\u3059") };
1684
+ }
1685
+ const inquiryFollowupOptIn = params.inquiryFollowupOptIn === true;
1686
+ const generalNewsletterOptIn = params.generalNewsletterOptIn === true;
1687
+ return fetchWithAuth(EXT_INQUIRY_ENDPOINT, {
1688
+ method: "POST",
1689
+ body: JSON.stringify({
1690
+ email,
1691
+ name,
1692
+ message,
1693
+ category: params.category,
1694
+ company: params.company,
1695
+ phone: params.phone,
1696
+ locale: params.locale,
1697
+ termsVersion,
1698
+ privacyVersion,
1699
+ // The ext endpoint still accepts the legacy single-flag field, but
1700
+ // the SDK always submits the 2-layer model. `newsletterOptIn` is
1701
+ // passed as the union of the two new flags only to satisfy the
1702
+ // current schema's required bool — the server preferentially
1703
+ // reads `inquiryFollowupOptIn` / `generalNewsletterOptIn`.
1704
+ newsletterOptIn: inquiryFollowupOptIn || generalNewsletterOptIn,
1705
+ inquiryFollowupOptIn,
1706
+ generalNewsletterOptIn
1707
+ })
1708
+ });
1709
+ }
1710
+ return { create };
1711
+ }
1712
+
1663
1713
  // src/client/ffid-client.ts
1664
1714
  var UNAUTHORIZED_STATUS2 = 401;
1665
1715
  var SDK_LOG_PREFIX = "[FFID SDK]";
@@ -1940,6 +1990,10 @@ function createFFIDClient(config) {
1940
1990
  baseUrl,
1941
1991
  createError
1942
1992
  });
1993
+ const inquiry = createInquiryMethods({
1994
+ fetchWithAuth,
1995
+ createError
1996
+ });
1943
1997
  const verifyAccessToken = createVerifyAccessToken({
1944
1998
  authMode,
1945
1999
  baseUrl,
@@ -1996,6 +2050,8 @@ function createFFIDClient(config) {
1996
2050
  verifyOtp,
1997
2051
  /** Newsletter methods (subscribe / confirm / unsubscribe) */
1998
2052
  newsletter,
2053
+ /** Inquiry methods (create) */
2054
+ inquiry,
1999
2055
  /** Token store (token mode only) */
2000
2056
  tokenStore,
2001
2057
  /** Resolved auth mode */
@@ -1,5 +1,47 @@
1
1
  export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.cjs';
2
2
 
3
+ /**
4
+ * Inquiry types exposed by the FFID SDK.
5
+ *
6
+ * Mirrors the `/api/v1/ext/inquiry` and `/api/contact` endpoints
7
+ * with a single shared shape so that consumers can render one
8
+ * `<FFIDInquiryForm />` and submit through either endpoint.
9
+ */
10
+ /**
11
+ * Categories surfaced by the default form. Consumers are free to
12
+ * pass their own list via `<FFIDInquiryForm categories={...} />`.
13
+ */
14
+ declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
15
+ type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
16
+ /**
17
+ * Parameters for `client.inquiry.create()`. When submitting from a
18
+ * server-side SDK (Service API Key), set `source` to a stable
19
+ * origin string so admins can trace the submission back.
20
+ */
21
+ interface FFIDInquiryCreateParams {
22
+ email: string;
23
+ name: string;
24
+ message: string;
25
+ category?: FFIDInquiryCategory | (string & {});
26
+ company?: string;
27
+ phone?: string;
28
+ locale?: 'ja' | 'en';
29
+ /** Current terms-of-service version the submitter agreed to. */
30
+ termsVersion: string;
31
+ /** Current privacy-policy version the submitter agreed to. */
32
+ privacyVersion: string;
33
+ /** Opt-in to the post-inquiry follow-up newsletter (Type A). */
34
+ inquiryFollowupOptIn?: boolean;
35
+ /** Opt-in to the general marketing newsletter (Type B). */
36
+ generalNewsletterOptIn?: boolean;
37
+ }
38
+ interface FFIDInquiryCreateResponse {
39
+ ok: true;
40
+ inquiryId: string;
41
+ /** True only when the submitter is already a confirmed newsletter subscriber. */
42
+ newsletterSubscribed: boolean;
43
+ }
44
+
3
45
  /**
4
46
  * Newsletter types exposed by the FFID SDK.
5
47
  *
@@ -831,6 +873,10 @@ declare function createFFIDClient(config: FFIDConfig): {
831
873
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
832
874
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
833
875
  };
876
+ /** Inquiry methods (create) */
877
+ inquiry: {
878
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
879
+ };
834
880
  /** Token store (token mode only) */
835
881
  tokenStore: TokenStore;
836
882
  /** Resolved auth mode */
@@ -1,5 +1,47 @@
1
1
  export { D as DEFAULT_API_BASE_URL } from '../constants-DvTGHPZn.js';
2
2
 
3
+ /**
4
+ * Inquiry types exposed by the FFID SDK.
5
+ *
6
+ * Mirrors the `/api/v1/ext/inquiry` and `/api/contact` endpoints
7
+ * with a single shared shape so that consumers can render one
8
+ * `<FFIDInquiryForm />` and submit through either endpoint.
9
+ */
10
+ /**
11
+ * Categories surfaced by the default form. Consumers are free to
12
+ * pass their own list via `<FFIDInquiryForm categories={...} />`.
13
+ */
14
+ declare const FFID_INQUIRY_CATEGORIES: readonly ["general", "sales", "support", "partnership", "press", "other"];
15
+ type FFIDInquiryCategory = (typeof FFID_INQUIRY_CATEGORIES)[number];
16
+ /**
17
+ * Parameters for `client.inquiry.create()`. When submitting from a
18
+ * server-side SDK (Service API Key), set `source` to a stable
19
+ * origin string so admins can trace the submission back.
20
+ */
21
+ interface FFIDInquiryCreateParams {
22
+ email: string;
23
+ name: string;
24
+ message: string;
25
+ category?: FFIDInquiryCategory | (string & {});
26
+ company?: string;
27
+ phone?: string;
28
+ locale?: 'ja' | 'en';
29
+ /** Current terms-of-service version the submitter agreed to. */
30
+ termsVersion: string;
31
+ /** Current privacy-policy version the submitter agreed to. */
32
+ privacyVersion: string;
33
+ /** Opt-in to the post-inquiry follow-up newsletter (Type A). */
34
+ inquiryFollowupOptIn?: boolean;
35
+ /** Opt-in to the general marketing newsletter (Type B). */
36
+ generalNewsletterOptIn?: boolean;
37
+ }
38
+ interface FFIDInquiryCreateResponse {
39
+ ok: true;
40
+ inquiryId: string;
41
+ /** True only when the submitter is already a confirmed newsletter subscriber. */
42
+ newsletterSubscribed: boolean;
43
+ }
44
+
3
45
  /**
4
46
  * Newsletter types exposed by the FFID SDK.
5
47
  *
@@ -831,6 +873,10 @@ declare function createFFIDClient(config: FFIDConfig): {
831
873
  confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
832
874
  unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
833
875
  };
876
+ /** Inquiry methods (create) */
877
+ inquiry: {
878
+ create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
879
+ };
834
880
  /** Token store (token mode only) */
835
881
  tokenStore: TokenStore;
836
882
  /** Resolved auth mode */
@@ -616,7 +616,7 @@ function createMembersMethods(deps) {
616
616
  }
617
617
 
618
618
  // src/client/version-check.ts
619
- var SDK_VERSION = "2.7.0";
619
+ var SDK_VERSION = "2.8.0";
620
620
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
621
621
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
622
622
  function sdkHeaders() {
@@ -1659,6 +1659,56 @@ function createNewsletterMethods(deps) {
1659
1659
  return { subscribe, confirm, unsubscribe };
1660
1660
  }
1661
1661
 
1662
+ // src/inquiry/ffid-inquiry-client.ts
1663
+ var EXT_INQUIRY_ENDPOINT = "/api/v1/ext/inquiry";
1664
+ function trimOrEmpty2(s) {
1665
+ return typeof s === "string" ? s.trim() : "";
1666
+ }
1667
+ function createInquiryMethods(deps) {
1668
+ const { fetchWithAuth, createError } = deps;
1669
+ async function create(params) {
1670
+ const email = trimOrEmpty2(params.email);
1671
+ const name = trimOrEmpty2(params.name);
1672
+ const message = trimOrEmpty2(params.message);
1673
+ const termsVersion = trimOrEmpty2(params.termsVersion);
1674
+ const privacyVersion = trimOrEmpty2(params.privacyVersion);
1675
+ if (!email) return { error: createError("VALIDATION_ERROR", "email \u306F\u5FC5\u9808\u3067\u3059") };
1676
+ if (!name) return { error: createError("VALIDATION_ERROR", "name \u306F\u5FC5\u9808\u3067\u3059") };
1677
+ if (!message) return { error: createError("VALIDATION_ERROR", "message \u306F\u5FC5\u9808\u3067\u3059") };
1678
+ if (!termsVersion) {
1679
+ return { error: createError("VALIDATION_ERROR", "termsVersion \u306F\u5FC5\u9808\u3067\u3059") };
1680
+ }
1681
+ if (!privacyVersion) {
1682
+ return { error: createError("VALIDATION_ERROR", "privacyVersion \u306F\u5FC5\u9808\u3067\u3059") };
1683
+ }
1684
+ const inquiryFollowupOptIn = params.inquiryFollowupOptIn === true;
1685
+ const generalNewsletterOptIn = params.generalNewsletterOptIn === true;
1686
+ return fetchWithAuth(EXT_INQUIRY_ENDPOINT, {
1687
+ method: "POST",
1688
+ body: JSON.stringify({
1689
+ email,
1690
+ name,
1691
+ message,
1692
+ category: params.category,
1693
+ company: params.company,
1694
+ phone: params.phone,
1695
+ locale: params.locale,
1696
+ termsVersion,
1697
+ privacyVersion,
1698
+ // The ext endpoint still accepts the legacy single-flag field, but
1699
+ // the SDK always submits the 2-layer model. `newsletterOptIn` is
1700
+ // passed as the union of the two new flags only to satisfy the
1701
+ // current schema's required bool — the server preferentially
1702
+ // reads `inquiryFollowupOptIn` / `generalNewsletterOptIn`.
1703
+ newsletterOptIn: inquiryFollowupOptIn || generalNewsletterOptIn,
1704
+ inquiryFollowupOptIn,
1705
+ generalNewsletterOptIn
1706
+ })
1707
+ });
1708
+ }
1709
+ return { create };
1710
+ }
1711
+
1662
1712
  // src/client/ffid-client.ts
1663
1713
  var UNAUTHORIZED_STATUS2 = 401;
1664
1714
  var SDK_LOG_PREFIX = "[FFID SDK]";
@@ -1939,6 +1989,10 @@ function createFFIDClient(config) {
1939
1989
  baseUrl,
1940
1990
  createError
1941
1991
  });
1992
+ const inquiry = createInquiryMethods({
1993
+ fetchWithAuth,
1994
+ createError
1995
+ });
1942
1996
  const verifyAccessToken = createVerifyAccessToken({
1943
1997
  authMode,
1944
1998
  baseUrl,
@@ -1995,6 +2049,8 @@ function createFFIDClient(config) {
1995
2049
  verifyOtp,
1996
2050
  /** Newsletter methods (subscribe / confirm / unsubscribe) */
1997
2051
  newsletter,
2052
+ /** Inquiry methods (create) */
2053
+ inquiry,
1998
2054
  /** Token store (token mode only) */
1999
2055
  tokenStore,
2000
2056
  /** Resolved auth mode */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",