@feelflow/ffid-sdk 2.6.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/{chunk-ZORI5YFR.cjs → chunk-GB5OHEVY.cjs} +533 -1
- package/dist/{chunk-7FEWA2P2.js → chunk-SR4UAQ3C.js} +532 -2
- package/dist/components/index.cjs +11 -7
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-p4dJw3qR.d.cts → index-BBAzyBFG.d.cts} +58 -1
- package/dist/{index-p4dJw3qR.d.ts → index-BBAzyBFG.d.ts} +58 -1
- package/dist/index.cjs +34 -22
- package/dist/index.d.cts +126 -3
- package/dist/index.d.ts +126 -3
- package/dist/index.js +6 -3
- package/dist/server/index.cjs +176 -1
- package/dist/server/index.d.cts +98 -0
- package/dist/server/index.d.ts +98 -0
- package/dist/server/index.js +176 -1
- package/package.json +1 -1
|
@@ -844,4 +844,61 @@ interface FFIDAnnouncementListProps {
|
|
|
844
844
|
*/
|
|
845
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
846
846
|
|
|
847
|
-
|
|
847
|
+
/** Organization summary rendered in the selector. */
|
|
848
|
+
interface FFIDInquiryFormOrganization {
|
|
849
|
+
id: string;
|
|
850
|
+
name: string;
|
|
851
|
+
slug?: string;
|
|
852
|
+
role?: string;
|
|
853
|
+
}
|
|
854
|
+
interface FFIDInquiryFormPrefill {
|
|
855
|
+
name?: string;
|
|
856
|
+
email?: string;
|
|
857
|
+
}
|
|
858
|
+
interface FFIDInquiryFormSubmitData {
|
|
859
|
+
name: string;
|
|
860
|
+
email: string;
|
|
861
|
+
company: string | null;
|
|
862
|
+
phone: string | null;
|
|
863
|
+
category: string;
|
|
864
|
+
message: string;
|
|
865
|
+
organizationId: string | null;
|
|
866
|
+
inquiryFollowupOptIn: boolean;
|
|
867
|
+
generalNewsletterOptIn: boolean;
|
|
868
|
+
termsVersion: string;
|
|
869
|
+
privacyVersion: string;
|
|
870
|
+
turnstileToken: string | null;
|
|
871
|
+
locale: 'ja' | 'en';
|
|
872
|
+
}
|
|
873
|
+
type FFIDInquiryFormSubmitResult = {
|
|
874
|
+
ok: true;
|
|
875
|
+
requiresDoubleOptIn?: boolean;
|
|
876
|
+
message?: string;
|
|
877
|
+
} | {
|
|
878
|
+
ok: false;
|
|
879
|
+
message: string;
|
|
880
|
+
};
|
|
881
|
+
interface FFIDInquiryFormProps {
|
|
882
|
+
mode: 'anonymous' | 'authenticated';
|
|
883
|
+
prefill?: FFIDInquiryFormPrefill;
|
|
884
|
+
organizations?: FFIDInquiryFormOrganization[];
|
|
885
|
+
preselectedOrganizationId?: string | null;
|
|
886
|
+
categories?: ReadonlyArray<{
|
|
887
|
+
value: string;
|
|
888
|
+
label: string;
|
|
889
|
+
}>;
|
|
890
|
+
termsVersion: string;
|
|
891
|
+
privacyVersion: string;
|
|
892
|
+
termsHref?: string;
|
|
893
|
+
privacyHref?: string;
|
|
894
|
+
/** Must be refreshed by the consumer when the Turnstile widget reissues a token. */
|
|
895
|
+
turnstileToken?: string | null;
|
|
896
|
+
/** Slot for the consumer's Turnstile widget (anonymous mode only). */
|
|
897
|
+
turnstileSlot?: ReactNode;
|
|
898
|
+
onSubmit: (data: FFIDInquiryFormSubmitData) => Promise<FFIDInquiryFormSubmitResult>;
|
|
899
|
+
locale?: 'ja' | 'en';
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
903
|
+
|
|
904
|
+
export { type FFIDSeatModel as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, FFIDInquiryForm as N, type FFIDInquiryFormOrganization as O, type FFIDInquiryFormPrefill as P, type FFIDInquiryFormProps as Q, type FFIDInquiryFormSubmitData as R, type FFIDInquiryFormSubmitResult as S, type FFIDJwtClaims as T, FFIDLoginButton as U, type FFIDMemberStatus as V, type FFIDOAuthTokenResponse as W, type FFIDOAuthUserInfoMemberRole as X, type FFIDOAuthUserInfoSubscription as Y, type FFIDOrganizationMember as Z, FFIDOrganizationSwitcher as _, type FFIDConfig as a, FFIDSubscriptionBadge as a0, type FFIDTokenIntrospectionResponse as a1, FFIDUserMenu as a2, type UseFFIDAnnouncementsOptions as a3, type UseFFIDAnnouncementsReturn as a4, useFFIDAnnouncements as a5, type FFIDAnnouncementBadgeClassNames as a6, type FFIDAnnouncementBadgeProps as a7, type FFIDAnnouncementListClassNames as a8, type FFIDAnnouncementListProps as a9, type FFIDLoginButtonProps as aa, type FFIDOrganizationSwitcherClassNames as ab, type FFIDOrganizationSwitcherProps as ac, type FFIDSubscriptionBadgeClassNames as ad, type FFIDSubscriptionBadgeProps as ae, type FFIDUserMenuClassNames as af, type FFIDUserMenuProps as ag, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
|
@@ -844,4 +844,61 @@ interface FFIDAnnouncementListProps {
|
|
|
844
844
|
*/
|
|
845
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
846
846
|
|
|
847
|
-
|
|
847
|
+
/** Organization summary rendered in the selector. */
|
|
848
|
+
interface FFIDInquiryFormOrganization {
|
|
849
|
+
id: string;
|
|
850
|
+
name: string;
|
|
851
|
+
slug?: string;
|
|
852
|
+
role?: string;
|
|
853
|
+
}
|
|
854
|
+
interface FFIDInquiryFormPrefill {
|
|
855
|
+
name?: string;
|
|
856
|
+
email?: string;
|
|
857
|
+
}
|
|
858
|
+
interface FFIDInquiryFormSubmitData {
|
|
859
|
+
name: string;
|
|
860
|
+
email: string;
|
|
861
|
+
company: string | null;
|
|
862
|
+
phone: string | null;
|
|
863
|
+
category: string;
|
|
864
|
+
message: string;
|
|
865
|
+
organizationId: string | null;
|
|
866
|
+
inquiryFollowupOptIn: boolean;
|
|
867
|
+
generalNewsletterOptIn: boolean;
|
|
868
|
+
termsVersion: string;
|
|
869
|
+
privacyVersion: string;
|
|
870
|
+
turnstileToken: string | null;
|
|
871
|
+
locale: 'ja' | 'en';
|
|
872
|
+
}
|
|
873
|
+
type FFIDInquiryFormSubmitResult = {
|
|
874
|
+
ok: true;
|
|
875
|
+
requiresDoubleOptIn?: boolean;
|
|
876
|
+
message?: string;
|
|
877
|
+
} | {
|
|
878
|
+
ok: false;
|
|
879
|
+
message: string;
|
|
880
|
+
};
|
|
881
|
+
interface FFIDInquiryFormProps {
|
|
882
|
+
mode: 'anonymous' | 'authenticated';
|
|
883
|
+
prefill?: FFIDInquiryFormPrefill;
|
|
884
|
+
organizations?: FFIDInquiryFormOrganization[];
|
|
885
|
+
preselectedOrganizationId?: string | null;
|
|
886
|
+
categories?: ReadonlyArray<{
|
|
887
|
+
value: string;
|
|
888
|
+
label: string;
|
|
889
|
+
}>;
|
|
890
|
+
termsVersion: string;
|
|
891
|
+
privacyVersion: string;
|
|
892
|
+
termsHref?: string;
|
|
893
|
+
privacyHref?: string;
|
|
894
|
+
/** Must be refreshed by the consumer when the Turnstile widget reissues a token. */
|
|
895
|
+
turnstileToken?: string | null;
|
|
896
|
+
/** Slot for the consumer's Turnstile widget (anonymous mode only). */
|
|
897
|
+
turnstileSlot?: ReactNode;
|
|
898
|
+
onSubmit: (data: FFIDInquiryFormSubmitData) => Promise<FFIDInquiryFormSubmitResult>;
|
|
899
|
+
locale?: 'ja' | 'en';
|
|
900
|
+
className?: string;
|
|
901
|
+
}
|
|
902
|
+
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
903
|
+
|
|
904
|
+
export { type FFIDSeatModel as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, FFIDInquiryForm as N, type FFIDInquiryFormOrganization as O, type FFIDInquiryFormPrefill as P, type FFIDInquiryFormProps as Q, type FFIDInquiryFormSubmitData as R, type FFIDInquiryFormSubmitResult as S, type FFIDJwtClaims as T, FFIDLoginButton as U, type FFIDMemberStatus as V, type FFIDOAuthTokenResponse as W, type FFIDOAuthUserInfoMemberRole as X, type FFIDOAuthUserInfoSubscription as Y, type FFIDOrganizationMember as Z, FFIDOrganizationSwitcher as _, type FFIDConfig as a, FFIDSubscriptionBadge as a0, type FFIDTokenIntrospectionResponse as a1, FFIDUserMenu as a2, type UseFFIDAnnouncementsOptions as a3, type UseFFIDAnnouncementsReturn as a4, useFFIDAnnouncements as a5, type FFIDAnnouncementBadgeClassNames as a6, type FFIDAnnouncementBadgeProps as a7, type FFIDAnnouncementListClassNames as a8, type FFIDAnnouncementListProps as a9, type FFIDLoginButtonProps as aa, type FFIDOrganizationSwitcherClassNames as ab, type FFIDOrganizationSwitcherProps as ac, type FFIDSubscriptionBadgeClassNames as ad, type FFIDSubscriptionBadgeProps as ae, type FFIDUserMenuClassNames as af, type FFIDUserMenuProps as ag, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var 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 } =
|
|
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) {
|
|
@@ -69,86 +69,98 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
69
69
|
return WrappedComponent;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
// src/newsletter/types.ts
|
|
73
|
+
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
74
|
+
|
|
72
75
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
73
76
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkGB5OHEVY_cjs.DEFAULT_API_BASE_URL; }
|
|
75
78
|
});
|
|
76
79
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
77
80
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDAnnouncementBadge; }
|
|
79
82
|
});
|
|
80
83
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
81
84
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDAnnouncementList; }
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDInquiryForm; }
|
|
83
90
|
});
|
|
84
91
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
85
92
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDLoginButton; }
|
|
87
94
|
});
|
|
88
95
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
89
96
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDOrganizationSwitcher; }
|
|
91
98
|
});
|
|
92
99
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
93
100
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDProvider; }
|
|
95
102
|
});
|
|
96
103
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
97
104
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDSubscriptionBadge; }
|
|
99
106
|
});
|
|
100
107
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
101
108
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkGB5OHEVY_cjs.FFIDUserMenu; }
|
|
103
110
|
});
|
|
104
111
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
105
112
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
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; }
|
|
107
118
|
});
|
|
108
119
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
109
120
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkGB5OHEVY_cjs.createFFIDAnnouncementsClient; }
|
|
111
122
|
});
|
|
112
123
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
113
124
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkGB5OHEVY_cjs.createFFIDClient; }
|
|
115
126
|
});
|
|
116
127
|
Object.defineProperty(exports, "createTokenStore", {
|
|
117
128
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkGB5OHEVY_cjs.createTokenStore; }
|
|
119
130
|
});
|
|
120
131
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
121
132
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkGB5OHEVY_cjs.generateCodeChallenge; }
|
|
123
134
|
});
|
|
124
135
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
125
136
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkGB5OHEVY_cjs.generateCodeVerifier; }
|
|
127
138
|
});
|
|
128
139
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
129
140
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkGB5OHEVY_cjs.retrieveCodeVerifier; }
|
|
131
142
|
});
|
|
132
143
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
133
144
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkGB5OHEVY_cjs.storeCodeVerifier; }
|
|
135
146
|
});
|
|
136
147
|
Object.defineProperty(exports, "useFFID", {
|
|
137
148
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkGB5OHEVY_cjs.useFFID; }
|
|
139
150
|
});
|
|
140
151
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
141
152
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkGB5OHEVY_cjs.useFFIDAnnouncements; }
|
|
143
154
|
});
|
|
144
155
|
Object.defineProperty(exports, "useSubscription", {
|
|
145
156
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkGB5OHEVY_cjs.useSubscription; }
|
|
147
158
|
});
|
|
148
159
|
Object.defineProperty(exports, "withSubscription", {
|
|
149
160
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkGB5OHEVY_cjs.withSubscription; }
|
|
151
162
|
});
|
|
163
|
+
exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
|
|
152
164
|
exports.createKVCacheAdapter = createKVCacheAdapter;
|
|
153
165
|
exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
|
|
154
166
|
exports.withFFIDAuth = withFFIDAuth;
|
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-
|
|
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
|
|
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
|
|
|
@@ -475,6 +475,16 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
475
475
|
accessToken: string;
|
|
476
476
|
refreshToken: string;
|
|
477
477
|
}) => Promise<FFIDApiResponse<FFIDOtpVerifyResponse>>;
|
|
478
|
+
/** Newsletter methods (subscribe / confirm / unsubscribe) */
|
|
479
|
+
newsletter: {
|
|
480
|
+
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
481
|
+
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
482
|
+
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
483
|
+
};
|
|
484
|
+
/** Inquiry methods (create) */
|
|
485
|
+
inquiry: {
|
|
486
|
+
create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
|
|
487
|
+
};
|
|
478
488
|
/** Token store (token mode only) */
|
|
479
489
|
tokenStore: TokenStore;
|
|
480
490
|
/** Resolved auth mode */
|
|
@@ -763,4 +773,117 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
|
|
|
763
773
|
/** Type of the FFID Announcements client */
|
|
764
774
|
type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
|
|
765
775
|
|
|
766
|
-
|
|
776
|
+
/**
|
|
777
|
+
* Newsletter types exposed by the FFID SDK.
|
|
778
|
+
*
|
|
779
|
+
* 2-layer newsletter model (#2078):
|
|
780
|
+
* - `inquiry_followup`: 問い合わせフォローアップ (Type A)
|
|
781
|
+
* - `general`: 定期ニュースレター (Type B)
|
|
782
|
+
*
|
|
783
|
+
* FFID account holders' preferences live in `user_marketing_preferences`;
|
|
784
|
+
* anonymous subscribers live in `newsletter_subscribers` with double
|
|
785
|
+
* opt-in required.
|
|
786
|
+
*/
|
|
787
|
+
declare const FFID_NEWSLETTER_TYPES: readonly ["inquiry_followup", "general"];
|
|
788
|
+
type FFIDNewsletterType = (typeof FFID_NEWSLETTER_TYPES)[number];
|
|
789
|
+
interface FFIDNewsletterSubscribeParams {
|
|
790
|
+
/** Subscriber email address */
|
|
791
|
+
email: string;
|
|
792
|
+
/** One or more newsletter types to opt in to */
|
|
793
|
+
types: FFIDNewsletterType[];
|
|
794
|
+
/** Origin string recorded on the subscriber row (e.g. your service code) */
|
|
795
|
+
source: string;
|
|
796
|
+
/** ISO 639-1 locale (e.g. 'ja', 'en') */
|
|
797
|
+
locale?: string;
|
|
798
|
+
}
|
|
799
|
+
interface FFIDNewsletterSubscribeResponse {
|
|
800
|
+
ok: true;
|
|
801
|
+
/** True when a double opt-in confirmation email was sent */
|
|
802
|
+
requiresConfirmation: boolean;
|
|
803
|
+
/** True when the email matched an existing FFID account; the caller
|
|
804
|
+
* must sign in to update preferences. Preferences are NOT modified. */
|
|
805
|
+
requiresSignIn: boolean;
|
|
806
|
+
}
|
|
807
|
+
interface FFIDNewsletterConfirmParams {
|
|
808
|
+
/** Confirmation token received in the double opt-in email */
|
|
809
|
+
token: string;
|
|
810
|
+
}
|
|
811
|
+
interface FFIDNewsletterConfirmResponse {
|
|
812
|
+
ok: true;
|
|
813
|
+
}
|
|
814
|
+
interface FFIDNewsletterUnsubscribeParams {
|
|
815
|
+
/** Unsubscribe token received in the newsletter footer / List-Unsubscribe header */
|
|
816
|
+
token: string;
|
|
817
|
+
}
|
|
818
|
+
interface FFIDNewsletterUnsubscribeResponse {
|
|
819
|
+
ok: true;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** Newsletter methods - subscribe / confirm / unsubscribe */
|
|
823
|
+
|
|
824
|
+
interface NewsletterMethodsDeps {
|
|
825
|
+
fetchWithAuth: <T>(endpoint: string, options?: RequestInit) => Promise<FFIDApiResponse<T>>;
|
|
826
|
+
baseUrl: string;
|
|
827
|
+
createError: (code: string, message: string) => FFIDError;
|
|
828
|
+
}
|
|
829
|
+
declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
|
|
830
|
+
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
831
|
+
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
832
|
+
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
833
|
+
};
|
|
834
|
+
type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
|
|
835
|
+
|
|
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-
|
|
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
|
|
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
|
|
|
@@ -475,6 +475,16 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
475
475
|
accessToken: string;
|
|
476
476
|
refreshToken: string;
|
|
477
477
|
}) => Promise<FFIDApiResponse<FFIDOtpVerifyResponse>>;
|
|
478
|
+
/** Newsletter methods (subscribe / confirm / unsubscribe) */
|
|
479
|
+
newsletter: {
|
|
480
|
+
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
481
|
+
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
482
|
+
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
483
|
+
};
|
|
484
|
+
/** Inquiry methods (create) */
|
|
485
|
+
inquiry: {
|
|
486
|
+
create: (params: FFIDInquiryCreateParams) => Promise<FFIDApiResponse<FFIDInquiryCreateResponse>>;
|
|
487
|
+
};
|
|
478
488
|
/** Token store (token mode only) */
|
|
479
489
|
tokenStore: TokenStore;
|
|
480
490
|
/** Resolved auth mode */
|
|
@@ -763,4 +773,117 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
|
|
|
763
773
|
/** Type of the FFID Announcements client */
|
|
764
774
|
type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
|
|
765
775
|
|
|
766
|
-
|
|
776
|
+
/**
|
|
777
|
+
* Newsletter types exposed by the FFID SDK.
|
|
778
|
+
*
|
|
779
|
+
* 2-layer newsletter model (#2078):
|
|
780
|
+
* - `inquiry_followup`: 問い合わせフォローアップ (Type A)
|
|
781
|
+
* - `general`: 定期ニュースレター (Type B)
|
|
782
|
+
*
|
|
783
|
+
* FFID account holders' preferences live in `user_marketing_preferences`;
|
|
784
|
+
* anonymous subscribers live in `newsletter_subscribers` with double
|
|
785
|
+
* opt-in required.
|
|
786
|
+
*/
|
|
787
|
+
declare const FFID_NEWSLETTER_TYPES: readonly ["inquiry_followup", "general"];
|
|
788
|
+
type FFIDNewsletterType = (typeof FFID_NEWSLETTER_TYPES)[number];
|
|
789
|
+
interface FFIDNewsletterSubscribeParams {
|
|
790
|
+
/** Subscriber email address */
|
|
791
|
+
email: string;
|
|
792
|
+
/** One or more newsletter types to opt in to */
|
|
793
|
+
types: FFIDNewsletterType[];
|
|
794
|
+
/** Origin string recorded on the subscriber row (e.g. your service code) */
|
|
795
|
+
source: string;
|
|
796
|
+
/** ISO 639-1 locale (e.g. 'ja', 'en') */
|
|
797
|
+
locale?: string;
|
|
798
|
+
}
|
|
799
|
+
interface FFIDNewsletterSubscribeResponse {
|
|
800
|
+
ok: true;
|
|
801
|
+
/** True when a double opt-in confirmation email was sent */
|
|
802
|
+
requiresConfirmation: boolean;
|
|
803
|
+
/** True when the email matched an existing FFID account; the caller
|
|
804
|
+
* must sign in to update preferences. Preferences are NOT modified. */
|
|
805
|
+
requiresSignIn: boolean;
|
|
806
|
+
}
|
|
807
|
+
interface FFIDNewsletterConfirmParams {
|
|
808
|
+
/** Confirmation token received in the double opt-in email */
|
|
809
|
+
token: string;
|
|
810
|
+
}
|
|
811
|
+
interface FFIDNewsletterConfirmResponse {
|
|
812
|
+
ok: true;
|
|
813
|
+
}
|
|
814
|
+
interface FFIDNewsletterUnsubscribeParams {
|
|
815
|
+
/** Unsubscribe token received in the newsletter footer / List-Unsubscribe header */
|
|
816
|
+
token: string;
|
|
817
|
+
}
|
|
818
|
+
interface FFIDNewsletterUnsubscribeResponse {
|
|
819
|
+
ok: true;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/** Newsletter methods - subscribe / confirm / unsubscribe */
|
|
823
|
+
|
|
824
|
+
interface NewsletterMethodsDeps {
|
|
825
|
+
fetchWithAuth: <T>(endpoint: string, options?: RequestInit) => Promise<FFIDApiResponse<T>>;
|
|
826
|
+
baseUrl: string;
|
|
827
|
+
createError: (code: string, message: string) => FFIDError;
|
|
828
|
+
}
|
|
829
|
+
declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
|
|
830
|
+
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
831
|
+
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
832
|
+
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
833
|
+
};
|
|
834
|
+
type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
|
|
835
|
+
|
|
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-
|
|
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-
|
|
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
|
|
|
@@ -68,4 +68,7 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
68
68
|
return WrappedComponent;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
// src/newsletter/types.ts
|
|
72
|
+
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
73
|
+
|
|
74
|
+
export { FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, withFFIDAuth };
|