@feelflow/ffid-sdk 2.12.1 → 2.15.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/README.md +38 -0
- package/dist/{chunk-DJPOGNAO.cjs → chunk-6XEWLARZ.cjs} +148 -23
- package/dist/{chunk-MDBV4WY3.js → chunk-OOGFUCRJ.js} +147 -24
- package/dist/components/index.cjs +8 -8
- 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-BuT9VaRt.d.cts → index-LPTvxtgt.d.cts} +165 -10
- package/dist/{index-BuT9VaRt.d.ts → index-LPTvxtgt.d.ts} +165 -10
- package/dist/index.cjs +34 -26
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +72 -5
- package/dist/server/index.d.cts +138 -4
- package/dist/server/index.d.ts +138 -4
- package/dist/server/index.js +72 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6XEWLARZ_cjs = require('./chunk-6XEWLARZ.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 } = chunk6XEWLARZ_cjs.useFFIDContext();
|
|
50
50
|
const hasRedirected = react.useRef(false);
|
|
51
51
|
react.useEffect(() => {
|
|
52
52
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -74,99 +74,107 @@ 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
|
|
77
|
+
get: function () { return chunk6XEWLARZ_cjs.DEFAULT_API_BASE_URL; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDAnnouncementBadge; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDAnnouncementList; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDInquiryForm; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDLoginButton; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDOrganizationSwitcher; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDProvider; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDSDKError; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDSubscriptionBadge; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunk6XEWLARZ_cjs.FFIDUserMenu; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunk6XEWLARZ_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunk6XEWLARZ_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () { return chunk6XEWLARZ_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
122
126
|
});
|
|
123
127
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
124
128
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunk6XEWLARZ_cjs.createFFIDAnnouncementsClient; }
|
|
126
130
|
});
|
|
127
131
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
128
132
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunk6XEWLARZ_cjs.createFFIDClient; }
|
|
130
134
|
});
|
|
131
135
|
Object.defineProperty(exports, "createTokenStore", {
|
|
132
136
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunk6XEWLARZ_cjs.createTokenStore; }
|
|
134
138
|
});
|
|
135
139
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
136
140
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunk6XEWLARZ_cjs.generateCodeChallenge; }
|
|
138
142
|
});
|
|
139
143
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
140
144
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunk6XEWLARZ_cjs.generateCodeVerifier; }
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function () { return chunk6XEWLARZ_cjs.isFFIDInquiryCategorySite2026; }
|
|
142
150
|
});
|
|
143
151
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
144
152
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunk6XEWLARZ_cjs.normalizeRedirectUri; }
|
|
146
154
|
});
|
|
147
155
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
148
156
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunk6XEWLARZ_cjs.retrieveCodeVerifier; }
|
|
150
158
|
});
|
|
151
159
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
152
160
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunk6XEWLARZ_cjs.storeCodeVerifier; }
|
|
154
162
|
});
|
|
155
163
|
Object.defineProperty(exports, "useFFID", {
|
|
156
164
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunk6XEWLARZ_cjs.useFFID; }
|
|
158
166
|
});
|
|
159
167
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
160
168
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunk6XEWLARZ_cjs.useFFIDAnnouncements; }
|
|
162
170
|
});
|
|
163
171
|
Object.defineProperty(exports, "useSubscription", {
|
|
164
172
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunk6XEWLARZ_cjs.useSubscription; }
|
|
166
174
|
});
|
|
167
175
|
Object.defineProperty(exports, "withSubscription", {
|
|
168
176
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunk6XEWLARZ_cjs.withSubscription; }
|
|
170
178
|
});
|
|
171
179
|
exports.FFID_NEWSLETTER_TYPES = FFID_NEWSLETTER_TYPES;
|
|
172
180
|
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
|
|
2
|
-
export {
|
|
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 FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDCreateCheckoutParams, o as FFIDCheckoutSessionResponse, p as FFIDCreatePortalParams, q as FFIDPortalSessionResponse, r as FFIDVerifyAccessTokenOptions, s as FFIDOAuthUserInfo, t as FFIDInquiryCreateParams, u as FFIDInquiryCreateResponse, v as FFIDAuthMode, w as FFIDLogger, x as FFIDCacheAdapter, y as FFIDUser, z as FFIDOrganization, A as FFIDSubscription, B as FFIDSubscriptionContextValue, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, E as AnnouncementListResponse, G as FFIDAnnouncementsLogger } from './index-LPTvxtgt.cjs';
|
|
2
|
+
export { H as Announcement, I as AnnouncementStatus, J as AnnouncementType, K as FFIDAnnouncementBadge, M as FFIDAnnouncementList, N as FFIDAnnouncementsError, O as FFIDAnnouncementsErrorCode, P as FFIDAnnouncementsServerResponse, Q as FFIDCacheConfig, R as FFIDContextValue, S as FFIDInquiryCategory, T as FFIDInquiryCategorySite2026, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a1 as FFIDJwtClaims, a2 as FFIDLoginButton, a3 as FFIDMemberStatus, a4 as FFIDOAuthTokenResponse, a5 as FFIDOAuthUserInfoMemberRole, a6 as FFIDOAuthUserInfoSubscription, a7 as FFIDOrganizationMember, a8 as FFIDOrganizationSwitcher, a9 as FFIDSeatModel, aa as FFIDSubscriptionBadge, ab as FFIDTokenIntrospectionResponse, ac as FFIDUserMenu, ad as FFID_INQUIRY_CATEGORIES, ae as FFID_INQUIRY_CATEGORIES_SITE_2026, af as UseFFIDAnnouncementsOptions, ag as UseFFIDAnnouncementsReturn, ah as isFFIDInquiryCategorySite2026, ai as useFFIDAnnouncements } from './index-LPTvxtgt.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: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
|
|
504
|
+
updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => 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>>;
|
|
@@ -932,4 +934,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
932
934
|
};
|
|
933
935
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
934
936
|
|
|
935
|
-
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 };
|
|
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, FFIDProfileCallOptions, 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, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, 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
|
|
2
|
-
export {
|
|
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 FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDCreateCheckoutParams, o as FFIDCheckoutSessionResponse, p as FFIDCreatePortalParams, q as FFIDPortalSessionResponse, r as FFIDVerifyAccessTokenOptions, s as FFIDOAuthUserInfo, t as FFIDInquiryCreateParams, u as FFIDInquiryCreateResponse, v as FFIDAuthMode, w as FFIDLogger, x as FFIDCacheAdapter, y as FFIDUser, z as FFIDOrganization, A as FFIDSubscription, B as FFIDSubscriptionContextValue, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, E as AnnouncementListResponse, G as FFIDAnnouncementsLogger } from './index-LPTvxtgt.js';
|
|
2
|
+
export { H as Announcement, I as AnnouncementStatus, J as AnnouncementType, K as FFIDAnnouncementBadge, M as FFIDAnnouncementList, N as FFIDAnnouncementsError, O as FFIDAnnouncementsErrorCode, P as FFIDAnnouncementsServerResponse, Q as FFIDCacheConfig, R as FFIDContextValue, S as FFIDInquiryCategory, T as FFIDInquiryCategorySite2026, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormOrganization, Y as FFIDInquiryFormPlaceholderContext, Z as FFIDInquiryFormPrefill, _ as FFIDInquiryFormProps, $ as FFIDInquiryFormSubmitData, a0 as FFIDInquiryFormSubmitResult, a1 as FFIDJwtClaims, a2 as FFIDLoginButton, a3 as FFIDMemberStatus, a4 as FFIDOAuthTokenResponse, a5 as FFIDOAuthUserInfoMemberRole, a6 as FFIDOAuthUserInfoSubscription, a7 as FFIDOrganizationMember, a8 as FFIDOrganizationSwitcher, a9 as FFIDSeatModel, aa as FFIDSubscriptionBadge, ab as FFIDTokenIntrospectionResponse, ac as FFIDUserMenu, ad as FFID_INQUIRY_CATEGORIES, ae as FFID_INQUIRY_CATEGORIES_SITE_2026, af as UseFFIDAnnouncementsOptions, ag as UseFFIDAnnouncementsReturn, ah as isFFIDInquiryCategorySite2026, ai as useFFIDAnnouncements } from './index-LPTvxtgt.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: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
|
|
504
|
+
updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => 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>>;
|
|
@@ -932,4 +934,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
932
934
|
};
|
|
933
935
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
934
936
|
|
|
935
|
-
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 };
|
|
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, FFIDProfileCallOptions, 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, FFIDUpdateUserProfileRequest, FFIDUser, FFIDUserProfile, 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-
|
|
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, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext } from './chunk-OOGFUCRJ.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-OOGFUCRJ.js';
|
|
3
3
|
import { useRef, useEffect } from 'react';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
package/dist/server/index.cjs
CHANGED
|
@@ -756,8 +756,57 @@ 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 resolveAuthOverride(options, createError) {
|
|
762
|
+
if (!options || options.accessToken === void 0) {
|
|
763
|
+
return {};
|
|
764
|
+
}
|
|
765
|
+
const token = options.accessToken;
|
|
766
|
+
if (typeof token !== "string" || token.trim() === "") {
|
|
767
|
+
return {
|
|
768
|
+
error: createError(
|
|
769
|
+
"VALIDATION_ERROR",
|
|
770
|
+
"accessToken \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u5217\u3084\u7A7A\u767D\u306E\u307F\u306E\u5024\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
|
|
771
|
+
)
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
return { override: { accessToken: token } };
|
|
775
|
+
}
|
|
776
|
+
function createProfileMethods(deps) {
|
|
777
|
+
const { fetchWithAuth, createError } = deps;
|
|
778
|
+
async function getProfile(options) {
|
|
779
|
+
const { override, error } = resolveAuthOverride(options, createError);
|
|
780
|
+
if (error) return { error };
|
|
781
|
+
return fetchWithAuth(EXT_PROFILE_ENDPOINT, void 0, override);
|
|
782
|
+
}
|
|
783
|
+
async function updateProfile(data, options) {
|
|
784
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
785
|
+
return {
|
|
786
|
+
error: createError("VALIDATION_ERROR", "data \u306F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059")
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
if (Object.keys(data).length === 0) {
|
|
790
|
+
return {
|
|
791
|
+
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")
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
const { override, error } = resolveAuthOverride(options, createError);
|
|
795
|
+
if (error) return { error };
|
|
796
|
+
return fetchWithAuth(
|
|
797
|
+
EXT_PROFILE_ENDPOINT,
|
|
798
|
+
{
|
|
799
|
+
method: "PUT",
|
|
800
|
+
body: JSON.stringify(data)
|
|
801
|
+
},
|
|
802
|
+
override
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
return { getProfile, updateProfile };
|
|
806
|
+
}
|
|
807
|
+
|
|
759
808
|
// src/client/version-check.ts
|
|
760
|
-
var SDK_VERSION = "2.
|
|
809
|
+
var SDK_VERSION = "2.15.0";
|
|
761
810
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
762
811
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
763
812
|
function sdkHeaders() {
|
|
@@ -1939,7 +1988,19 @@ function createFFIDClient(config) {
|
|
|
1939
1988
|
function createError(code, message) {
|
|
1940
1989
|
return { code, message };
|
|
1941
1990
|
}
|
|
1942
|
-
function buildFetchOptions(options) {
|
|
1991
|
+
function buildFetchOptions(options, authOverride) {
|
|
1992
|
+
if (authOverride) {
|
|
1993
|
+
return {
|
|
1994
|
+
...options,
|
|
1995
|
+
credentials: "omit",
|
|
1996
|
+
headers: {
|
|
1997
|
+
"Content-Type": "application/json",
|
|
1998
|
+
...sdkHeaders(),
|
|
1999
|
+
...options.headers,
|
|
2000
|
+
Authorization: `Bearer ${authOverride.accessToken}`
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
1943
2004
|
if (authMode === "service-key") {
|
|
1944
2005
|
return {
|
|
1945
2006
|
...options,
|
|
@@ -1986,10 +2047,10 @@ function createFFIDClient(config) {
|
|
|
1986
2047
|
logger,
|
|
1987
2048
|
errorCodes: FFID_ERROR_CODES
|
|
1988
2049
|
});
|
|
1989
|
-
async function fetchWithAuth(endpoint, options = {}) {
|
|
2050
|
+
async function fetchWithAuth(endpoint, options = {}, authOverride) {
|
|
1990
2051
|
const url = `${baseUrl}${endpoint}`;
|
|
1991
2052
|
logger.debug("Fetching:", url);
|
|
1992
|
-
const fetchOptions = buildFetchOptions(options);
|
|
2053
|
+
const fetchOptions = buildFetchOptions(options, authOverride);
|
|
1993
2054
|
let response;
|
|
1994
2055
|
try {
|
|
1995
2056
|
response = await fetch(url, fetchOptions);
|
|
@@ -2002,7 +2063,7 @@ function createFFIDClient(config) {
|
|
|
2002
2063
|
}
|
|
2003
2064
|
};
|
|
2004
2065
|
}
|
|
2005
|
-
if (authMode === "token" && response.status === UNAUTHORIZED_STATUS2) {
|
|
2066
|
+
if (!authOverride && authMode === "token" && response.status === UNAUTHORIZED_STATUS2) {
|
|
2006
2067
|
const refreshResult = await refreshAccessToken();
|
|
2007
2068
|
if (!refreshResult.error) {
|
|
2008
2069
|
logger.debug("Token refreshed, retrying request");
|
|
@@ -2128,6 +2189,10 @@ function createFFIDClient(config) {
|
|
|
2128
2189
|
createError,
|
|
2129
2190
|
serviceCode: config.serviceCode
|
|
2130
2191
|
});
|
|
2192
|
+
const { getProfile, updateProfile } = createProfileMethods({
|
|
2193
|
+
fetchWithAuth,
|
|
2194
|
+
createError
|
|
2195
|
+
});
|
|
2131
2196
|
const {
|
|
2132
2197
|
requestPasswordReset,
|
|
2133
2198
|
verifyPasswordResetToken,
|
|
@@ -2199,6 +2264,8 @@ function createFFIDClient(config) {
|
|
|
2199
2264
|
listMembers,
|
|
2200
2265
|
updateMemberRole,
|
|
2201
2266
|
removeMember,
|
|
2267
|
+
getProfile,
|
|
2268
|
+
updateProfile,
|
|
2202
2269
|
createCheckoutSession,
|
|
2203
2270
|
createPortalSession,
|
|
2204
2271
|
listPlans,
|
package/dist/server/index.d.cts
CHANGED
|
@@ -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
|
-
*
|
|
12
|
-
*
|
|
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,96 @@ 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
|
+
* Per-call options for profile methods (`getProfile` / `updateProfile`).
|
|
819
|
+
*
|
|
820
|
+
* Supply `accessToken` to forward an end-user Bearer token for the single call
|
|
821
|
+
* without mutating client-level auth state. Designed for server runtimes (Cloudflare
|
|
822
|
+
* Workers, Edge, Node) that receive a user-scoped Bearer per request and want to
|
|
823
|
+
* act as that user against `/api/v1/users/ext/me`.
|
|
824
|
+
*
|
|
825
|
+
* When `accessToken` is supplied with a non-empty value, it overrides the client's
|
|
826
|
+
* configured auth mode: authentication for that request uses only
|
|
827
|
+
* `Authorization: Bearer <accessToken>` (no service key, no cookie, no token-store
|
|
828
|
+
* lookup, no auto-refresh on 401). Non-auth headers such as `Content-Type` and
|
|
829
|
+
* SDK metadata headers (User-Agent / X-FFID-SDK-Version) are still attached.
|
|
830
|
+
*
|
|
831
|
+
* Runtime semantics:
|
|
832
|
+
* - `accessToken` omitted (or `undefined`) → no override, configured `authMode` is used
|
|
833
|
+
* - `accessToken` is empty string / whitespace-only → rejected as `VALIDATION_ERROR`
|
|
834
|
+
* before any network call (prevents silent impersonation fallback when a caller
|
|
835
|
+
* extracts a missing/blank `Authorization` header into this field)
|
|
836
|
+
* - `accessToken` is a non-empty string → override activated
|
|
837
|
+
*/
|
|
838
|
+
interface FFIDProfileCallOptions {
|
|
839
|
+
/**
|
|
840
|
+
* End-user Bearer token forwarded for this single request.
|
|
841
|
+
*
|
|
842
|
+
* Must be a non-empty string when supplied. Passing `''` or a whitespace-only
|
|
843
|
+
* string is treated as a caller error and surfaces as `VALIDATION_ERROR` —
|
|
844
|
+
* this guards against the common footgun where a server runtime extracts the
|
|
845
|
+
* Bearer from an incoming request without checking the header is present.
|
|
846
|
+
*/
|
|
847
|
+
accessToken?: string;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Request payload for `updateProfile`.
|
|
851
|
+
*
|
|
852
|
+
* Mirrors the FFID backend `UpdateUserProfileRequest` shape. All fields are
|
|
853
|
+
* optional — only the supplied keys will be updated (partial update semantics).
|
|
854
|
+
*/
|
|
855
|
+
interface FFIDUpdateUserProfileRequest {
|
|
856
|
+
/** Display name */
|
|
857
|
+
displayName?: string;
|
|
858
|
+
/** Phone number */
|
|
859
|
+
phone?: string;
|
|
860
|
+
/** Company name */
|
|
861
|
+
companyName?: string;
|
|
862
|
+
/** Department */
|
|
863
|
+
department?: string;
|
|
864
|
+
/** Job title */
|
|
865
|
+
jobTitle?: string;
|
|
866
|
+
/** IANA timezone */
|
|
867
|
+
timezone?: string;
|
|
868
|
+
/** Locale */
|
|
869
|
+
locale?: string;
|
|
870
|
+
/** Arbitrary user preferences bag */
|
|
871
|
+
preferences?: Record<string, unknown>;
|
|
872
|
+
}
|
|
741
873
|
/**
|
|
742
874
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
743
875
|
*
|
|
@@ -892,6 +1024,8 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
892
1024
|
organizationId: string;
|
|
893
1025
|
userId: string;
|
|
894
1026
|
}) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
|
|
1027
|
+
getProfile: (options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
|
|
1028
|
+
updateProfile: (data: FFIDUpdateUserProfileRequest, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDUserProfile>>;
|
|
895
1029
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
896
1030
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
897
1031
|
listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
|
|
@@ -1002,4 +1136,4 @@ interface KVNamespaceLike {
|
|
|
1002
1136
|
*/
|
|
1003
1137
|
declare function createKVCacheAdapter(kv: KVNamespaceLike): FFIDCacheAdapter;
|
|
1004
1138
|
|
|
1005
|
-
export { type FFIDCacheAdapter, type FFIDCacheConfig, type FFIDClient, type FFIDConfig, type FFIDOAuthUserInfo, type FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDResetSessionResponse, type FFIDSubscription, type FFIDUser, type FFIDVerifyAccessTokenOptions, type KVNamespaceLike, type TokenData, type TokenStore, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, createVerifyAccessToken };
|
|
1139
|
+
export { type FFIDCacheAdapter, type FFIDCacheConfig, type FFIDClient, type FFIDConfig, type FFIDOAuthUserInfo, type FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDProfileCallOptions, type FFIDResetSessionResponse, type FFIDSubscription, type FFIDUpdateUserProfileRequest, type FFIDUser, type FFIDUserProfile, type FFIDVerifyAccessTokenOptions, type KVNamespaceLike, type TokenData, type TokenStore, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, createVerifyAccessToken };
|