@feelflow/ffid-sdk 2.21.0 → 3.1.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/agency/index.cjs +3 -3
- package/dist/agency/index.d.cts +1 -1
- package/dist/agency/index.d.ts +1 -1
- package/dist/agency/index.js +2 -2
- package/dist/announcements/index.cjs +2 -2
- package/dist/announcements/index.js +1 -1
- package/dist/{chunk-HUU4Q5VH.cjs → chunk-HZZQ2BX7.cjs} +83 -11
- package/dist/chunk-JEVK2XUM.js +5 -0
- package/dist/{chunk-YUIITYBE.cjs → chunk-MDHKSVLP.cjs} +2 -0
- package/dist/{chunk-I7NEMG52.js → chunk-RRN3DTET.js} +83 -12
- 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/constants-D61jqRIO.d.cts +35 -0
- package/dist/constants-D61jqRIO.d.ts +35 -0
- package/dist/{ffid-client-DgJRU-YZ.d.cts → ffid-client-DM_t1seS.d.cts} +71 -1
- package/dist/{ffid-client-DgJRU-YZ.d.ts → ffid-client-DM_t1seS.d.ts} +71 -1
- package/dist/{index-Dr5G9HQ4.d.cts → index-COnReU8h.d.cts} +24 -2
- package/dist/{index-Dr5G9HQ4.d.ts → index-COnReU8h.d.ts} +24 -2
- package/dist/index.cjs +37 -31
- package/dist/index.d.cts +101 -7
- package/dist/index.d.ts +101 -7
- package/dist/index.js +4 -3
- package/dist/legal/index.cjs +3 -3
- package/dist/legal/index.d.cts +1 -1
- package/dist/legal/index.d.ts +1 -1
- package/dist/legal/index.js +2 -2
- package/dist/server/index.cjs +83 -11
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +78 -10
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-QBRM2RRC.js +0 -4
- package/dist/constants-DvTGHPZn.d.cts +0 -10
- package/dist/constants-DvTGHPZn.d.ts +0 -10
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 FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-
|
|
2
|
-
export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-
|
|
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 FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-COnReU8h.cjs';
|
|
2
|
+
export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-COnReU8h.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
5
5
|
|
|
@@ -11,6 +11,31 @@ import { ReactNode, ComponentType, FC } from 'react';
|
|
|
11
11
|
*/
|
|
12
12
|
/** Default FFID API base URL (production) */
|
|
13
13
|
declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
14
|
+
/**
|
|
15
|
+
* Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
|
|
16
|
+
*
|
|
17
|
+
* Coverage:
|
|
18
|
+
* - `openid email profile` — OIDC standard claims (always required)
|
|
19
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
|
|
20
|
+
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
21
|
+
*
|
|
22
|
+
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
23
|
+
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
24
|
+
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
25
|
+
* - `subscription:write` for self-serve plan changes
|
|
26
|
+
* - `legal:write` for recording user consent
|
|
27
|
+
* - `profile:read` / `profile:write` for profile UI
|
|
28
|
+
* - `organization:api-key` for org-level API key issuance
|
|
29
|
+
*
|
|
30
|
+
* **Note**: kept as a widened `string` (not `as const`) so consumers can
|
|
31
|
+
* concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
|
|
32
|
+
* and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
|
|
33
|
+
* is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
|
|
34
|
+
* not used by the browser OAuth flow.
|
|
35
|
+
*
|
|
36
|
+
* Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
|
|
37
|
+
*/
|
|
38
|
+
declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
14
39
|
|
|
15
40
|
/**
|
|
16
41
|
* Token Store
|
|
@@ -468,17 +493,39 @@ interface ContractWizardSubscriptionOptions {
|
|
|
468
493
|
|
|
469
494
|
/** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
|
|
470
495
|
|
|
496
|
+
/**
|
|
497
|
+
* `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
|
|
498
|
+
* Forwards to Supabase Auth signup screen; only the `'signup'` value is
|
|
499
|
+
* propagated (no-op when `'login'` or omitted).
|
|
500
|
+
*/
|
|
501
|
+
declare const SCREEN_HINT_SIGNUP: "signup";
|
|
502
|
+
/** `screen_hint=login` (no-op marker; default screen is login) */
|
|
503
|
+
declare const SCREEN_HINT_LOGIN: "login";
|
|
471
504
|
/** Options for redirectToAuthorize */
|
|
472
505
|
interface RedirectToAuthorizeOptions {
|
|
473
506
|
/** Target organization ID — triggers org-scoped OAuth re-authorization */
|
|
474
507
|
organizationId?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Initial Supabase Auth screen hint (#2908 / #2911).
|
|
510
|
+
*
|
|
511
|
+
* - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
|
|
512
|
+
* on the signup screen (used by external services that want to deep-link
|
|
513
|
+
* new users into the signup CTA).
|
|
514
|
+
* - `'login'` / `undefined`: no `screen_hint` param is added — the default
|
|
515
|
+
* login screen is shown.
|
|
516
|
+
*
|
|
517
|
+
* In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
|
|
518
|
+
* of `/login` so the SDK contract (signup-screen intent) stays consistent
|
|
519
|
+
* regardless of `authMode`.
|
|
520
|
+
*/
|
|
521
|
+
screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
|
|
475
522
|
}
|
|
476
523
|
|
|
477
524
|
/** Creates an FFID API client instance */
|
|
478
525
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
479
526
|
getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
|
|
480
527
|
signOut: () => Promise<FFIDApiResponse<void>>;
|
|
481
|
-
redirectToLogin: () => Promise<FFIDRedirectResult>;
|
|
528
|
+
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
482
529
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
483
530
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
484
531
|
getLoginUrl: (redirectUrl?: string) => string;
|
|
@@ -543,6 +590,7 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
543
590
|
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
544
591
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
545
592
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
593
|
+
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
546
594
|
};
|
|
547
595
|
/** Inquiry methods (create) */
|
|
548
596
|
inquiry: {
|
|
@@ -633,7 +681,7 @@ interface FFIDProviderProps extends FFIDConfig {
|
|
|
633
681
|
* - Automatic session refresh
|
|
634
682
|
* - Token mode: automatic code exchange and token refresh
|
|
635
683
|
*/
|
|
636
|
-
declare function FFIDProvider({ children, serviceCode, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
684
|
+
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
637
685
|
|
|
638
686
|
/**
|
|
639
687
|
* Return type for useFFID hook
|
|
@@ -653,8 +701,17 @@ interface UseFFIDReturn {
|
|
|
653
701
|
isAuthenticated: boolean;
|
|
654
702
|
/** Any authentication error that occurred */
|
|
655
703
|
error: FFIDError | null;
|
|
656
|
-
/**
|
|
657
|
-
|
|
704
|
+
/**
|
|
705
|
+
* Redirect to login page.
|
|
706
|
+
*
|
|
707
|
+
* @param options.screenHint `'signup'` to deep-link into the signup screen
|
|
708
|
+
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
709
|
+
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
710
|
+
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
711
|
+
*/
|
|
712
|
+
login: (options?: {
|
|
713
|
+
screenHint?: 'signup' | 'login';
|
|
714
|
+
}) => void;
|
|
658
715
|
/** Sign out */
|
|
659
716
|
logout: () => Promise<void>;
|
|
660
717
|
/**
|
|
@@ -1082,6 +1139,42 @@ interface FFIDNewsletterUnsubscribeParams {
|
|
|
1082
1139
|
interface FFIDNewsletterUnsubscribeResponse {
|
|
1083
1140
|
ok: true;
|
|
1084
1141
|
}
|
|
1142
|
+
/** Recipient cap on a single dispatch — mirrors NEWSLETTER_DISPATCH_MAX_RECIPIENTS. */
|
|
1143
|
+
declare const FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1000;
|
|
1144
|
+
type FFIDNewsletterCampaignStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'cancelled';
|
|
1145
|
+
type FFIDNewsletterSegment = {
|
|
1146
|
+
type: 'all';
|
|
1147
|
+
} | {
|
|
1148
|
+
type: 'filter';
|
|
1149
|
+
conditions: Record<string, unknown>;
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* Body source XOR — exactly one of `htmlBody` / `templateId` must be set.
|
|
1153
|
+
* V1 only ships `htmlBody`; `templateId` is reserved for SendGrid dynamic
|
|
1154
|
+
* templates and is rejected server-side until that work lands.
|
|
1155
|
+
*/
|
|
1156
|
+
type FFIDNewsletterBodySource = {
|
|
1157
|
+
htmlBody: string;
|
|
1158
|
+
templateId?: never;
|
|
1159
|
+
} | {
|
|
1160
|
+
templateId: string;
|
|
1161
|
+
htmlBody?: never;
|
|
1162
|
+
};
|
|
1163
|
+
interface FFIDNewsletterDispatchParams {
|
|
1164
|
+
subject: string;
|
|
1165
|
+
/** Optional landing-page URL persisted on `newsletter_campaigns.article_url`. */
|
|
1166
|
+
articleUrl?: string;
|
|
1167
|
+
body: FFIDNewsletterBodySource;
|
|
1168
|
+
/** Defaults to `{ type: 'all' }` server-side when omitted. */
|
|
1169
|
+
segment?: FFIDNewsletterSegment;
|
|
1170
|
+
}
|
|
1171
|
+
interface FFIDNewsletterDispatchResponse {
|
|
1172
|
+
campaignId: string;
|
|
1173
|
+
totalRecipients: number;
|
|
1174
|
+
status: FFIDNewsletterCampaignStatus;
|
|
1175
|
+
sentCount: number;
|
|
1176
|
+
failedCount: number;
|
|
1177
|
+
}
|
|
1085
1178
|
|
|
1086
1179
|
/** Newsletter methods - subscribe / confirm / unsubscribe */
|
|
1087
1180
|
|
|
@@ -1094,6 +1187,7 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
|
|
|
1094
1187
|
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
1095
1188
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
1096
1189
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
1190
|
+
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
1097
1191
|
};
|
|
1098
1192
|
type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
|
|
1099
1193
|
|
|
@@ -1108,4 +1202,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
1108
1202
|
};
|
|
1109
1203
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
1110
1204
|
|
|
1111
|
-
export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, EffectiveSubscriptionStatus, 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 UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
|
1205
|
+
export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, 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 FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, 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_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, 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 FFIDProfileCallOptions, l as FFIDUserProfile, m as FFIDUpdateUserProfileRequest, n as FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-
|
|
2
|
-
export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-
|
|
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 FFIDAnalyticsConfig, o as FFIDCreateCheckoutParams, p as FFIDCheckoutSessionResponse, q as FFIDCreatePortalParams, r as FFIDPortalSessionResponse, s as FFIDVerifyAccessTokenOptions, t as FFIDOAuthUserInfo, u as FFIDInquiryCreateParams, v as FFIDInquiryCreateResponse, w as FFIDAuthMode, x as FFIDLogger, y as FFIDCacheAdapter, z as FFIDUser, A as FFIDOrganization, B as FFIDSubscription, C as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, D as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, G as FFIDAnnouncementsApiResponse, H as AnnouncementListResponse, I as FFIDAnnouncementsLogger } from './index-COnReU8h.js';
|
|
2
|
+
export { J as Announcement, K as AnnouncementStatus, M as AnnouncementType, N as FFIDAnnouncementBadge, O as FFIDAnnouncementList, P as FFIDAnnouncementsError, Q as FFIDAnnouncementsErrorCode, R as FFIDAnnouncementsServerResponse, S as FFIDCacheConfig, T as FFIDContextValue, U as FFIDInquiryCategory, V as FFIDInquiryCategorySite2026, W as FFIDInquiryForm, X as FFIDInquiryFormCategoryItem, Y as FFIDInquiryFormClassNames, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDMemberStatus, a6 as FFIDOAuthTokenResponse, a7 as FFIDOAuthUserInfoMemberRole, a8 as FFIDOAuthUserInfoSubscription, a9 as FFIDOrganizationMember, aa as FFIDOrganizationSwitcher, ab as FFIDRedirectErrorCode, ac as FFIDSeatModel, ad as FFIDSubscriptionBadge, ae as FFIDTokenIntrospectionResponse, af as FFIDUserMenu, ag as FFID_INQUIRY_CATEGORIES, ah as FFID_INQUIRY_CATEGORIES_SITE_2026, ai as UseFFIDAnnouncementsOptions, aj as UseFFIDAnnouncementsReturn, ak as isFFIDInquiryCategorySite2026, al as useFFIDAnnouncements } from './index-COnReU8h.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
5
5
|
|
|
@@ -11,6 +11,31 @@ import { ReactNode, ComponentType, FC } from 'react';
|
|
|
11
11
|
*/
|
|
12
12
|
/** Default FFID API base URL (production) */
|
|
13
13
|
declare const DEFAULT_API_BASE_URL = "https://id.feelflow.net";
|
|
14
|
+
/**
|
|
15
|
+
* Recommended default OAuth scope set for FFID-connected services (v3.0.0+).
|
|
16
|
+
*
|
|
17
|
+
* Coverage:
|
|
18
|
+
* - `openid email profile` — OIDC standard claims (always required)
|
|
19
|
+
* - `subscription:read` — `/api/v1/subscriptions/ext/*` 系(プラン / 課金 gate)
|
|
20
|
+
* - `legal:read` — `/api/v1/legal/ext` 系(利用規約・同意状態)
|
|
21
|
+
*
|
|
22
|
+
* Add feature-specific scopes on top of this when needed (browser SDK):
|
|
23
|
+
* - `analytics:read` for `/api/v1/ext/analytics/config`
|
|
24
|
+
* - `organization:read` / `organization:write` for `/api/v1/organizations/ext/members`
|
|
25
|
+
* - `subscription:write` for self-serve plan changes
|
|
26
|
+
* - `legal:write` for recording user consent
|
|
27
|
+
* - `profile:read` / `profile:write` for profile UI
|
|
28
|
+
* - `organization:api-key` for org-level API key issuance
|
|
29
|
+
*
|
|
30
|
+
* **Note**: kept as a widened `string` (not `as const`) so consumers can
|
|
31
|
+
* concatenate additional scopes (e.g. `\`${DEFAULT_OAUTH_SCOPES} analytics:read\``)
|
|
32
|
+
* and so it remains assignable to `FFIDConfig.scope: string`. `widget:verify`
|
|
33
|
+
* is intentionally excluded — it is a service-key-only scope (`/api/v1/widget/*`),
|
|
34
|
+
* not used by the browser OAuth flow.
|
|
35
|
+
*
|
|
36
|
+
* Survey: feel-flow/feelflow-id-platform#2656 issuecomment-4324082742
|
|
37
|
+
*/
|
|
38
|
+
declare const DEFAULT_OAUTH_SCOPES = "openid email profile subscription:read legal:read";
|
|
14
39
|
|
|
15
40
|
/**
|
|
16
41
|
* Token Store
|
|
@@ -468,17 +493,39 @@ interface ContractWizardSubscriptionOptions {
|
|
|
468
493
|
|
|
469
494
|
/** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
|
|
470
495
|
|
|
496
|
+
/**
|
|
497
|
+
* `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
|
|
498
|
+
* Forwards to Supabase Auth signup screen; only the `'signup'` value is
|
|
499
|
+
* propagated (no-op when `'login'` or omitted).
|
|
500
|
+
*/
|
|
501
|
+
declare const SCREEN_HINT_SIGNUP: "signup";
|
|
502
|
+
/** `screen_hint=login` (no-op marker; default screen is login) */
|
|
503
|
+
declare const SCREEN_HINT_LOGIN: "login";
|
|
471
504
|
/** Options for redirectToAuthorize */
|
|
472
505
|
interface RedirectToAuthorizeOptions {
|
|
473
506
|
/** Target organization ID — triggers org-scoped OAuth re-authorization */
|
|
474
507
|
organizationId?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Initial Supabase Auth screen hint (#2908 / #2911).
|
|
510
|
+
*
|
|
511
|
+
* - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
|
|
512
|
+
* on the signup screen (used by external services that want to deep-link
|
|
513
|
+
* new users into the signup CTA).
|
|
514
|
+
* - `'login'` / `undefined`: no `screen_hint` param is added — the default
|
|
515
|
+
* login screen is shown.
|
|
516
|
+
*
|
|
517
|
+
* In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
|
|
518
|
+
* of `/login` so the SDK contract (signup-screen intent) stays consistent
|
|
519
|
+
* regardless of `authMode`.
|
|
520
|
+
*/
|
|
521
|
+
screenHint?: typeof SCREEN_HINT_SIGNUP | typeof SCREEN_HINT_LOGIN;
|
|
475
522
|
}
|
|
476
523
|
|
|
477
524
|
/** Creates an FFID API client instance */
|
|
478
525
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
479
526
|
getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
|
|
480
527
|
signOut: () => Promise<FFIDApiResponse<void>>;
|
|
481
|
-
redirectToLogin: () => Promise<FFIDRedirectResult>;
|
|
528
|
+
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
482
529
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
483
530
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
484
531
|
getLoginUrl: (redirectUrl?: string) => string;
|
|
@@ -543,6 +590,7 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
543
590
|
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
544
591
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
545
592
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
593
|
+
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
546
594
|
};
|
|
547
595
|
/** Inquiry methods (create) */
|
|
548
596
|
inquiry: {
|
|
@@ -633,7 +681,7 @@ interface FFIDProviderProps extends FFIDConfig {
|
|
|
633
681
|
* - Automatic session refresh
|
|
634
682
|
* - Token mode: automatic code exchange and token refresh
|
|
635
683
|
*/
|
|
636
|
-
declare function FFIDProvider({ children, serviceCode, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
684
|
+
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
637
685
|
|
|
638
686
|
/**
|
|
639
687
|
* Return type for useFFID hook
|
|
@@ -653,8 +701,17 @@ interface UseFFIDReturn {
|
|
|
653
701
|
isAuthenticated: boolean;
|
|
654
702
|
/** Any authentication error that occurred */
|
|
655
703
|
error: FFIDError | null;
|
|
656
|
-
/**
|
|
657
|
-
|
|
704
|
+
/**
|
|
705
|
+
* Redirect to login page.
|
|
706
|
+
*
|
|
707
|
+
* @param options.screenHint `'signup'` to deep-link into the signup screen
|
|
708
|
+
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
709
|
+
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
710
|
+
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
711
|
+
*/
|
|
712
|
+
login: (options?: {
|
|
713
|
+
screenHint?: 'signup' | 'login';
|
|
714
|
+
}) => void;
|
|
658
715
|
/** Sign out */
|
|
659
716
|
logout: () => Promise<void>;
|
|
660
717
|
/**
|
|
@@ -1082,6 +1139,42 @@ interface FFIDNewsletterUnsubscribeParams {
|
|
|
1082
1139
|
interface FFIDNewsletterUnsubscribeResponse {
|
|
1083
1140
|
ok: true;
|
|
1084
1141
|
}
|
|
1142
|
+
/** Recipient cap on a single dispatch — mirrors NEWSLETTER_DISPATCH_MAX_RECIPIENTS. */
|
|
1143
|
+
declare const FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1000;
|
|
1144
|
+
type FFIDNewsletterCampaignStatus = 'draft' | 'queued' | 'sending' | 'sent' | 'failed' | 'cancelled';
|
|
1145
|
+
type FFIDNewsletterSegment = {
|
|
1146
|
+
type: 'all';
|
|
1147
|
+
} | {
|
|
1148
|
+
type: 'filter';
|
|
1149
|
+
conditions: Record<string, unknown>;
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* Body source XOR — exactly one of `htmlBody` / `templateId` must be set.
|
|
1153
|
+
* V1 only ships `htmlBody`; `templateId` is reserved for SendGrid dynamic
|
|
1154
|
+
* templates and is rejected server-side until that work lands.
|
|
1155
|
+
*/
|
|
1156
|
+
type FFIDNewsletterBodySource = {
|
|
1157
|
+
htmlBody: string;
|
|
1158
|
+
templateId?: never;
|
|
1159
|
+
} | {
|
|
1160
|
+
templateId: string;
|
|
1161
|
+
htmlBody?: never;
|
|
1162
|
+
};
|
|
1163
|
+
interface FFIDNewsletterDispatchParams {
|
|
1164
|
+
subject: string;
|
|
1165
|
+
/** Optional landing-page URL persisted on `newsletter_campaigns.article_url`. */
|
|
1166
|
+
articleUrl?: string;
|
|
1167
|
+
body: FFIDNewsletterBodySource;
|
|
1168
|
+
/** Defaults to `{ type: 'all' }` server-side when omitted. */
|
|
1169
|
+
segment?: FFIDNewsletterSegment;
|
|
1170
|
+
}
|
|
1171
|
+
interface FFIDNewsletterDispatchResponse {
|
|
1172
|
+
campaignId: string;
|
|
1173
|
+
totalRecipients: number;
|
|
1174
|
+
status: FFIDNewsletterCampaignStatus;
|
|
1175
|
+
sentCount: number;
|
|
1176
|
+
failedCount: number;
|
|
1177
|
+
}
|
|
1085
1178
|
|
|
1086
1179
|
/** Newsletter methods - subscribe / confirm / unsubscribe */
|
|
1087
1180
|
|
|
@@ -1094,6 +1187,7 @@ declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
|
|
|
1094
1187
|
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
1095
1188
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
1096
1189
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
1190
|
+
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
1097
1191
|
};
|
|
1098
1192
|
type FFIDNewsletterClient = ReturnType<typeof createNewsletterMethods>;
|
|
1099
1193
|
|
|
@@ -1108,4 +1202,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
1108
1202
|
};
|
|
1109
1203
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
1110
1204
|
|
|
1111
|
-
export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, EffectiveSubscriptionStatus, 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 UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
|
1205
|
+
export { AnnouncementListResponse, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, 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 FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, 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_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFFIDContext, useSubscription } from './chunk-
|
|
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, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext, useSubscription } from './chunk-RRN3DTET.js';
|
|
2
|
+
export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-RRN3DTET.js';
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -99,5 +99,6 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
99
99
|
|
|
100
100
|
// src/newsletter/types.ts
|
|
101
101
|
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
102
|
+
var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
102
103
|
|
|
103
|
-
export { FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
|
|
104
|
+
export { FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
|
package/dist/legal/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
|
|
4
4
|
|
|
5
5
|
// src/legal/ffid-legal-client.ts
|
|
6
6
|
var API_PREFIX = "/api/v1/legal/ext";
|
|
@@ -37,7 +37,7 @@ function createFFIDLegalClient(config) {
|
|
|
37
37
|
if (!config.apiKey) {
|
|
38
38
|
throw new Error("FFID Legal Client: apiKey \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
|
|
39
39
|
}
|
|
40
|
-
const baseUrl = config.apiBaseUrl ??
|
|
40
|
+
const baseUrl = config.apiBaseUrl ?? chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL;
|
|
41
41
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
42
42
|
async function fetchWithApiKey(endpoint, options = {}) {
|
|
43
43
|
const url = `${baseUrl}${API_PREFIX}${endpoint}`;
|
|
@@ -176,7 +176,7 @@ function createFFIDLegalClient(config) {
|
|
|
176
176
|
|
|
177
177
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL; }
|
|
180
180
|
});
|
|
181
181
|
exports.FFID_LEGAL_ERROR_CODES = FFID_LEGAL_ERROR_CODES;
|
|
182
182
|
exports.createFFIDLegalClient = createFFIDLegalClient;
|
package/dist/legal/index.d.cts
CHANGED
package/dist/legal/index.d.ts
CHANGED
package/dist/legal/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_API_BASE_URL } from '../chunk-
|
|
2
|
-
export { DEFAULT_API_BASE_URL } from '../chunk-
|
|
1
|
+
import { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
|
|
2
|
+
export { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
|
|
3
3
|
|
|
4
4
|
// src/legal/ffid-legal-client.ts
|
|
5
5
|
var API_PREFIX = "/api/v1/legal/ext";
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
|
|
4
4
|
var jose = require('jose');
|
|
5
5
|
|
|
6
6
|
// src/auth/token-store.ts
|
|
@@ -803,7 +803,7 @@ function createProfileMethods(deps) {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
// src/client/version-check.ts
|
|
806
|
-
var SDK_VERSION = "
|
|
806
|
+
var SDK_VERSION = "3.1.0";
|
|
807
807
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
808
808
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
809
809
|
function sdkHeaders() {
|
|
@@ -1325,6 +1325,8 @@ function base64UrlEncode(buffer) {
|
|
|
1325
1325
|
// src/client/redirect.ts
|
|
1326
1326
|
var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
|
|
1327
1327
|
var AUTH_LOGOUT_ENDPOINT = "/api/v1/auth/logout";
|
|
1328
|
+
var SCREEN_HINT_SIGNUP = "signup";
|
|
1329
|
+
var SCREEN_HINT_PARAM = "screen_hint";
|
|
1328
1330
|
var STATE_RANDOM_BYTES = 16;
|
|
1329
1331
|
var HEX_BASE2 = 16;
|
|
1330
1332
|
var REDIRECT_LOOP_KEY = "ffid_sdk_redirect_loop_history";
|
|
@@ -1419,6 +1421,7 @@ function createRedirectMethods(deps) {
|
|
|
1419
1421
|
baseUrl,
|
|
1420
1422
|
clientId,
|
|
1421
1423
|
serviceCode,
|
|
1424
|
+
scope,
|
|
1422
1425
|
resolvedRedirectUri,
|
|
1423
1426
|
logger
|
|
1424
1427
|
} = deps;
|
|
@@ -1427,6 +1430,24 @@ function createRedirectMethods(deps) {
|
|
|
1427
1430
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1428
1431
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1429
1432
|
}
|
|
1433
|
+
if (authMode === "service-key") {
|
|
1434
|
+
logger.error(
|
|
1435
|
+
"[FFID SDK] service-key \u30E2\u30FC\u30C9\u3067\u306F redirectToAuthorize \u306F\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 \u2014 server-to-server \u7528\u9014\u306E\u305F\u3081 OAuth \u30D6\u30E9\u30A6\u30B6 flow \u3092\u6301\u3061\u307E\u305B\u3093"
|
|
1436
|
+
);
|
|
1437
|
+
return {
|
|
1438
|
+
success: false,
|
|
1439
|
+
error: "service-key \u30E2\u30FC\u30C9\u3067\u306F OAuth \u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093"
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
if (!scope || !scope.trim()) {
|
|
1443
|
+
logger.error(
|
|
1444
|
+
"[FFID SDK] scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081 /oauth/authorize \u3092\u547C\u3073\u51FA\u305B\u307E\u305B\u3093 (#2674) \u2014 FFIDConfig.scope \u306B DEFAULT_OAUTH_SCOPES \u307E\u305F\u306F\u660E\u793A\u7684\u306A scope \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
1445
|
+
);
|
|
1446
|
+
return {
|
|
1447
|
+
success: false,
|
|
1448
|
+
error: "OAuth scope \u304C\u672A\u8A2D\u5B9A\u306E\u305F\u3081\u8A8D\u53EF\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093"
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1430
1451
|
const authorizeKey = buildAuthorizeKey(baseUrl, clientId, options?.organizationId);
|
|
1431
1452
|
const now = Date.now();
|
|
1432
1453
|
const recentCount = getRecentRedirectCount(authorizeKey, now, logger);
|
|
@@ -1459,6 +1480,7 @@ function createRedirectMethods(deps) {
|
|
|
1459
1480
|
const params = new URLSearchParams({
|
|
1460
1481
|
response_type: "code",
|
|
1461
1482
|
client_id: clientId,
|
|
1483
|
+
scope,
|
|
1462
1484
|
redirect_uri: redirectUri,
|
|
1463
1485
|
state,
|
|
1464
1486
|
code_challenge: challenge,
|
|
@@ -1472,6 +1494,9 @@ function createRedirectMethods(deps) {
|
|
|
1472
1494
|
}
|
|
1473
1495
|
params.set("organization_id", trimmedOrgId);
|
|
1474
1496
|
}
|
|
1497
|
+
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1498
|
+
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1499
|
+
}
|
|
1475
1500
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1476
1501
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1477
1502
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1483,18 +1508,17 @@ function createRedirectMethods(deps) {
|
|
|
1483
1508
|
}
|
|
1484
1509
|
return { success: true };
|
|
1485
1510
|
}
|
|
1486
|
-
async function redirectToLogin() {
|
|
1511
|
+
async function redirectToLogin(options) {
|
|
1487
1512
|
if (typeof window === "undefined") {
|
|
1488
1513
|
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
1489
1514
|
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
1490
1515
|
}
|
|
1491
1516
|
if (authMode === "token") {
|
|
1492
|
-
return redirectToAuthorize();
|
|
1517
|
+
return redirectToAuthorize(options);
|
|
1493
1518
|
}
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
window.location.href = loginUrl;
|
|
1519
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1520
|
+
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1521
|
+
window.location.href = targetUrl;
|
|
1498
1522
|
return { success: true };
|
|
1499
1523
|
}
|
|
1500
1524
|
function getLoginUrl(redirectUrl) {
|
|
@@ -1941,6 +1965,7 @@ function createContractWizardMethods(deps) {
|
|
|
1941
1965
|
var EXT_SUBSCRIBE_ENDPOINT2 = "/api/v1/ext/newsletter/subscribe";
|
|
1942
1966
|
var CONFIRM_ENDPOINT = "/api/newsletter/confirm";
|
|
1943
1967
|
var UNSUBSCRIBE_ENDPOINT = "/api/newsletter/unsubscribe";
|
|
1968
|
+
var DISPATCH_ENDPOINT = "/api/v1/newsletter/dispatch";
|
|
1944
1969
|
function trimOrEmpty(s) {
|
|
1945
1970
|
return typeof s === "string" ? s.trim() : "";
|
|
1946
1971
|
}
|
|
@@ -2046,7 +2071,36 @@ function createNewsletterMethods(deps) {
|
|
|
2046
2071
|
}
|
|
2047
2072
|
);
|
|
2048
2073
|
}
|
|
2049
|
-
|
|
2074
|
+
async function dispatch(params) {
|
|
2075
|
+
const subject = trimOrEmpty(params.subject);
|
|
2076
|
+
if (!subject) {
|
|
2077
|
+
return { error: createError("VALIDATION_ERROR", "subject \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2078
|
+
}
|
|
2079
|
+
if (!params.body || typeof params.body !== "object") {
|
|
2080
|
+
return { error: createError("VALIDATION_ERROR", "body \u306F\u5FC5\u9808\u3067\u3059") };
|
|
2081
|
+
}
|
|
2082
|
+
const bodySource = params.body;
|
|
2083
|
+
const hasHtmlBody = typeof bodySource.htmlBody === "string" && bodySource.htmlBody.length > 0;
|
|
2084
|
+
const hasTemplateId = typeof bodySource.templateId === "string" && bodySource.templateId.length > 0;
|
|
2085
|
+
if (hasHtmlBody === hasTemplateId) {
|
|
2086
|
+
return {
|
|
2087
|
+
error: createError(
|
|
2088
|
+
"BODY_SOURCE_REQUIRED",
|
|
2089
|
+
"body \u306F htmlBody \u307E\u305F\u306F templateId \u306E\u3044\u305A\u308C\u304B\u4E00\u65B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
2090
|
+
)
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
return fetchWithAuth(DISPATCH_ENDPOINT, {
|
|
2094
|
+
method: "POST",
|
|
2095
|
+
body: JSON.stringify({
|
|
2096
|
+
subject,
|
|
2097
|
+
articleUrl: params.articleUrl,
|
|
2098
|
+
body: params.body,
|
|
2099
|
+
segment: params.segment
|
|
2100
|
+
})
|
|
2101
|
+
});
|
|
2102
|
+
}
|
|
2103
|
+
return { subscribe, confirm, unsubscribe, dispatch };
|
|
2050
2104
|
}
|
|
2051
2105
|
|
|
2052
2106
|
// src/inquiry/ffid-inquiry-client.ts
|
|
@@ -2148,8 +2202,21 @@ function createFFIDClient(config) {
|
|
|
2148
2202
|
if (!config.serviceCode || !config.serviceCode.trim()) {
|
|
2149
2203
|
throw new Error("FFID Client: serviceCode \u304C\u672A\u8A2D\u5B9A\u3067\u3059");
|
|
2150
2204
|
}
|
|
2151
|
-
const
|
|
2205
|
+
const scope = config.scope?.trim() ?? "";
|
|
2206
|
+
const baseUrl = config.apiBaseUrl ?? chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL;
|
|
2152
2207
|
const authMode = config.authMode ?? "cookie";
|
|
2208
|
+
const VALID_AUTH_MODES = ["cookie", "token", "service-key"];
|
|
2209
|
+
if (!VALID_AUTH_MODES.includes(authMode)) {
|
|
2210
|
+
throw new Error(
|
|
2211
|
+
`FFID Client: authMode \u304C\u4E0D\u6B63\u3067\u3059 (\u53D7\u4FE1: ${JSON.stringify(authMode)}, \u6709\u52B9\u5024: ${VALID_AUTH_MODES.join(" | ")})`
|
|
2212
|
+
);
|
|
2213
|
+
}
|
|
2214
|
+
if (authMode !== "service-key" && !scope) {
|
|
2215
|
+
const received = config.scope === void 0 ? "undefined" : JSON.stringify(config.scope);
|
|
2216
|
+
throw new Error(
|
|
2217
|
+
`FFID Client: scope \u304C\u672A\u8A2D\u5B9A\u3067\u3059 (\u53D7\u4FE1: ${received})\u3002\`DEFAULT_OAUTH_SCOPES\` \u3092 import \u3059\u308B\u304B\u3001\u660E\u793A\u7684\u306B scope \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 (#2674)`
|
|
2218
|
+
);
|
|
2219
|
+
}
|
|
2153
2220
|
const clientId = config.clientId ?? config.serviceCode;
|
|
2154
2221
|
const rawRedirectUri = config.redirectUri ?? null;
|
|
2155
2222
|
const serviceApiKey = config.serviceApiKey?.trim();
|
|
@@ -2320,6 +2387,7 @@ function createFFIDClient(config) {
|
|
|
2320
2387
|
baseUrl,
|
|
2321
2388
|
clientId,
|
|
2322
2389
|
serviceCode: config.serviceCode,
|
|
2390
|
+
scope,
|
|
2323
2391
|
resolvedRedirectUri,
|
|
2324
2392
|
logger
|
|
2325
2393
|
});
|
|
@@ -2541,7 +2609,11 @@ function createKVCacheAdapter(kv) {
|
|
|
2541
2609
|
|
|
2542
2610
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
2543
2611
|
enumerable: true,
|
|
2544
|
-
get: function () { return
|
|
2612
|
+
get: function () { return chunkMDHKSVLP_cjs.DEFAULT_API_BASE_URL; }
|
|
2613
|
+
});
|
|
2614
|
+
Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
|
|
2615
|
+
enumerable: true,
|
|
2616
|
+
get: function () { return chunkMDHKSVLP_cjs.DEFAULT_OAUTH_SCOPES; }
|
|
2545
2617
|
});
|
|
2546
2618
|
exports.createFFIDClient = createFFIDClient;
|
|
2547
2619
|
exports.createKVCacheAdapter = createKVCacheAdapter;
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-
|
|
2
|
-
export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-
|
|
3
|
-
export { D as DEFAULT_API_BASE_URL } from '../constants-
|
|
1
|
+
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DM_t1seS.cjs';
|
|
2
|
+
export { f as FFIDCacheConfig, g as FFIDClient, h as FFIDConfig, i as FFIDOrganization, j as FFIDOtpSendResponse, k as FFIDOtpVerifyResponse, l as FFIDPasswordResetConfirmResponse, m as FFIDPasswordResetResponse, n as FFIDPasswordResetVerifyResponse, o as FFIDProfileCallOptions, p as FFIDResetSessionResponse, q as FFIDSubscription, r as FFIDUpdateUserProfileRequest, s as FFIDUser, t as FFIDUserProfile, T as TokenData, u as TokenStore, v as createFFIDClient, w as createTokenStore } from '../ffid-client-DM_t1seS.cjs';
|
|
3
|
+
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
|
|
4
4
|
|
|
5
5
|
/** Token verification - verifyAccessToken() implementation */
|
|
6
6
|
|