@feelflow/ffid-sdk 12.1.0 → 12.2.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 +29 -0
- package/dist/{chunk-3MYUVPLD.js → chunk-75ISD4I4.js} +68 -10
- package/dist/{chunk-62MINYOA.cjs → chunk-LT7FQ7BT.cjs} +69 -9
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.js +1 -1
- package/dist/{ffid-client-aUNBn5SW.d.cts → ffid-client-DMwmK8mM.d.cts} +15 -2
- package/dist/{ffid-client-5dVFeHt8.d.ts → ffid-client-Dr2KVlIZ.d.ts} +15 -2
- package/dist/index.cjs +99 -97
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +3 -7
- package/dist/server/index.cjs +66 -9
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +66 -9
- 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/index.d.ts
CHANGED
|
@@ -1578,7 +1578,7 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1578
1578
|
}) => Promise<FFIDApiResponse<FFIDOtpVerifyResponse>>;
|
|
1579
1579
|
/** Newsletter methods (subscribe / confirm / unsubscribe) */
|
|
1580
1580
|
newsletter: {
|
|
1581
|
-
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
1581
|
+
subscribe: (params: FFIDNewsletterSubscribeParams, options?: FFIDNewsletterSubscribeOptions) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
1582
1582
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
1583
1583
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
1584
1584
|
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
@@ -2886,7 +2886,7 @@ type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
|
|
|
2886
2886
|
* Newsletter types exposed by the FFID SDK.
|
|
2887
2887
|
*
|
|
2888
2888
|
* 2-layer newsletter model (#2078):
|
|
2889
|
-
* - `inquiry_followup`:
|
|
2889
|
+
* - `inquiry_followup`: 資料請求・お問い合わせ後のご案内 (Type A)
|
|
2890
2890
|
* - `general`: 定期ニュースレター (Type B)
|
|
2891
2891
|
*
|
|
2892
2892
|
* FFID account holders' preferences live in `user_marketing_preferences`;
|
|
@@ -2905,6 +2905,12 @@ interface FFIDNewsletterSubscribeParams {
|
|
|
2905
2905
|
/** ISO 639-1 locale (e.g. 'ja', 'en') */
|
|
2906
2906
|
locale?: string;
|
|
2907
2907
|
}
|
|
2908
|
+
interface FFIDNewsletterSubscribeOptions {
|
|
2909
|
+
/** UUID for one intentional registration. Reuse unchanged across retries;
|
|
2910
|
+
* create a new key when the registration changes or a new request is intended.
|
|
2911
|
+
* Transport-only: sent as Idempotency-Key, never added to the consent body. */
|
|
2912
|
+
idempotencyKey?: string | undefined;
|
|
2913
|
+
}
|
|
2908
2914
|
interface FFIDNewsletterSubscribeResponse {
|
|
2909
2915
|
ok: true;
|
|
2910
2916
|
/** True when a double opt-in confirmation email was sent */
|
|
@@ -2912,6 +2918,11 @@ interface FFIDNewsletterSubscribeResponse {
|
|
|
2912
2918
|
/** True when the email matched an existing FFID account; the caller
|
|
2913
2919
|
* must sign in to update preferences. Preferences are NOT modified. */
|
|
2914
2920
|
requiresSignIn: boolean;
|
|
2921
|
+
/** True when confirmation could not be sent; subscription is still pending.
|
|
2922
|
+
* This flag does not promise an automatic resend. */
|
|
2923
|
+
confirmationEmailPending: boolean;
|
|
2924
|
+
/** Present only when the independent owner acknowledged a durable registration intent. */
|
|
2925
|
+
requestId?: string | undefined;
|
|
2915
2926
|
}
|
|
2916
2927
|
interface FFIDNewsletterConfirmParams {
|
|
2917
2928
|
/** Confirmation token received in the double opt-in email */
|
|
@@ -2923,6 +2934,8 @@ interface FFIDNewsletterConfirmResponse {
|
|
|
2923
2934
|
interface FFIDNewsletterUnsubscribeParams {
|
|
2924
2935
|
/** Unsubscribe token received in the newsletter footer / List-Unsubscribe header */
|
|
2925
2936
|
token: string;
|
|
2937
|
+
/** Stop only the selected purpose. Omission preserves legacy all-purpose links. */
|
|
2938
|
+
type?: FFIDNewsletterType | undefined;
|
|
2926
2939
|
}
|
|
2927
2940
|
interface FFIDNewsletterUnsubscribeResponse {
|
|
2928
2941
|
ok: true;
|
|
@@ -2972,7 +2985,7 @@ interface NewsletterMethodsDeps {
|
|
|
2972
2985
|
createError: (code: string, message: string) => FFIDError;
|
|
2973
2986
|
}
|
|
2974
2987
|
declare function createNewsletterMethods(deps: NewsletterMethodsDeps): {
|
|
2975
|
-
subscribe: (params: FFIDNewsletterSubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
2988
|
+
subscribe: (params: FFIDNewsletterSubscribeParams, options?: FFIDNewsletterSubscribeOptions) => Promise<FFIDApiResponse<FFIDNewsletterSubscribeResponse>>;
|
|
2976
2989
|
confirm: (params: FFIDNewsletterConfirmParams) => Promise<FFIDApiResponse<FFIDNewsletterConfirmResponse>>;
|
|
2977
2990
|
unsubscribe: (params: FFIDNewsletterUnsubscribeParams) => Promise<FFIDApiResponse<FFIDNewsletterUnsubscribeResponse>>;
|
|
2978
2991
|
dispatch: (params: FFIDNewsletterDispatchParams) => Promise<FFIDApiResponse<FFIDNewsletterDispatchResponse>>;
|
|
@@ -2990,4 +3003,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
2990
3003
|
};
|
|
2991
3004
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
2992
3005
|
|
|
2993
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDAuthorizationError, type FFIDAuthorizationErrorDetails, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberSeatAssignmentResult, type FFIDMemberStatus, 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, type FFIDOAuthDenialReason, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
|
|
3006
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, type AgencyInviteCookieOptions, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, type CaptureAgencyInviteTokenOptions, type CaptureAgencyInviteTokenResult, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, FFIDAccountType, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, type FFIDAllowedLogoMimeType, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDAuthorizationError, type FFIDAuthorizationErrorDetails, FFIDBillingInterval, FFIDBuyCreditsUrlParams, FFIDCacheAdapter, FFIDCancelPendingDowngradeResponse, FFIDCancelSubscriptionParams, FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, FFIDCatalogEnvironment, FFIDCatalogHashError, FFIDChangePlanParams, FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, FFIDCreatePackCheckoutParams, type FFIDCreatePortalParams, FFIDCreditBalance, FFIDCreditConsumeParams, FFIDCreditConsumeResult, FFIDCreditHistoryPage, FFIDCreditPackCheckout, FFIDCreditPackList, type FFIDCreditsClient, type FFIDCreditsErrorCode, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, FFIDListCreditHistoryOptions, type FFIDListMembersResponse, FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, type FFIDMemberSeatAssignmentResult, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeOptions, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, type FFIDOAuthDenialReason, type FFIDOAuthTokenResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationLogoUploadResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOrganizationProfile, type FFIDOrganizationProfileErrorCode, type FFIDOrganizationProfileResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPaymentConfiguration, FFIDPlanChangePreviewResponse, type FFIDPortalSessionResponse, FFIDPreviewPlanChangeParams, FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDPublishedCatalog, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, FFIDSeatChangePreviewResponse, FFIDSeatsSummary, FFIDServiceAccessDecision, FFIDSessionResponse, FFIDSignOutResult, FFIDSubscribeParams, FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, FFIDTaxBehavior, type FFIDTaxConfiguration, type FFIDTokenIntrospectionResponse, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, type FFIDUploadOrganizationLogoParams, type FFIDUpsertOrganizationProfileParams, type FFIDUpsertOrganizationProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_ERROR_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type ReadAgencyInviteTokenOptions, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFFIDContext, useSubscription } from './chunk-
|
|
2
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_CONSUME_MAX_AMOUNT, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_ERROR_CODES, FFID_CREDITS_FEATURE_PATTERN, FFID_CREDITS_HISTORY_DEFAULT_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, FFID_CREDITS_LOW_THRESHOLD_PERCENT, FFID_CREDITS_METADATA_MAX_BYTES, FFID_CREDIT_GRANT_KINDS, FFID_CREDIT_HISTORY_TYPES, FFID_CREDIT_PACK_MAX_QUANTITY, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext, useSubscription } from './chunk-75ISD4I4.js';
|
|
2
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_CONSUME_MAX_AMOUNT, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_ERROR_CODES, FFID_CREDITS_FEATURE_PATTERN, FFID_CREDITS_HISTORY_DEFAULT_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, FFID_CREDITS_LOW_THRESHOLD_PERCENT, FFID_CREDITS_METADATA_MAX_BYTES, FFID_CREDIT_GRANT_KINDS, FFID_CREDIT_HISTORY_TYPES, FFID_CREDIT_PACK_MAX_QUANTITY, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, FFID_OAUTH_DENIAL_REASONS, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, clearAgencyInviteToken, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, getFFIDAuthorizationError, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, isFFIDOAuthDenialReason, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, validatePublishedCatalog, withSubscription } from './chunk-75ISD4I4.js';
|
|
3
3
|
export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-S2AEBJRX.js';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
5
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -98,8 +98,4 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
98
98
|
return WrappedComponent;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
103
|
-
var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
104
|
-
|
|
105
|
-
export { FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
|
|
101
|
+
export { createKVCacheAdapter, createMemoryCacheAdapter, useRequireActiveSubscription, withFFIDAuth };
|
package/dist/server/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
|
|
4
4
|
var jose = require('jose');
|
|
5
|
+
var zod = require('zod');
|
|
5
6
|
|
|
6
7
|
// src/auth/token-store.ts
|
|
7
8
|
var STORAGE_KEY = "ffid_tokens";
|
|
@@ -1388,7 +1389,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
|
|
|
1388
1389
|
};
|
|
1389
1390
|
|
|
1390
1391
|
// src/client/version-check.ts
|
|
1391
|
-
var SDK_VERSION = "12.
|
|
1392
|
+
var SDK_VERSION = "12.2.0";
|
|
1392
1393
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1393
1394
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1394
1395
|
function sdkHeaders() {
|
|
@@ -3337,24 +3338,44 @@ function createContractWizardMethods(deps) {
|
|
|
3337
3338
|
};
|
|
3338
3339
|
}
|
|
3339
3340
|
|
|
3341
|
+
// src/newsletter/types.ts
|
|
3342
|
+
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
3343
|
+
|
|
3340
3344
|
// src/newsletter/ffid-newsletter-client.ts
|
|
3341
3345
|
var EXT_SUBSCRIBE_ENDPOINT2 = "/api/v1/ext/newsletter/subscribe";
|
|
3342
3346
|
var CONFIRM_ENDPOINT = "/api/newsletter/confirm";
|
|
3343
3347
|
var UNSUBSCRIBE_ENDPOINT = "/api/newsletter/unsubscribe";
|
|
3344
3348
|
var DISPATCH_ENDPOINT = "/api/v1/newsletter/dispatch";
|
|
3349
|
+
var PUBLIC_TOKEN_TIMEOUT_MS = 3e4;
|
|
3350
|
+
var subscribeResponseSchema = zod.z.object({
|
|
3351
|
+
ok: zod.z.literal(true),
|
|
3352
|
+
requiresConfirmation: zod.z.boolean(),
|
|
3353
|
+
requiresSignIn: zod.z.boolean(),
|
|
3354
|
+
confirmationEmailPending: zod.z.boolean(),
|
|
3355
|
+
requestId: zod.z.uuid().optional()
|
|
3356
|
+
}).refine(
|
|
3357
|
+
(value) => [
|
|
3358
|
+
value.requiresConfirmation,
|
|
3359
|
+
value.requiresSignIn,
|
|
3360
|
+
value.confirmationEmailPending
|
|
3361
|
+
].filter(Boolean).length <= 1
|
|
3362
|
+
);
|
|
3345
3363
|
function trimOrEmpty(s) {
|
|
3346
3364
|
return typeof s === "string" ? s.trim() : "";
|
|
3347
3365
|
}
|
|
3348
3366
|
async function postPublic(url, init, opts) {
|
|
3349
3367
|
let response;
|
|
3350
3368
|
try {
|
|
3351
|
-
response = await fetch(url,
|
|
3352
|
-
|
|
3369
|
+
response = await fetch(url, {
|
|
3370
|
+
...init,
|
|
3371
|
+
credentials: "omit",
|
|
3372
|
+
redirect: "error",
|
|
3373
|
+
cache: "no-store",
|
|
3374
|
+
signal: AbortSignal.timeout(PUBLIC_TOKEN_TIMEOUT_MS)
|
|
3375
|
+
});
|
|
3376
|
+
} catch {
|
|
3353
3377
|
return {
|
|
3354
|
-
error: opts.createError(
|
|
3355
|
-
"NETWORK_ERROR",
|
|
3356
|
-
err instanceof Error ? err.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
|
|
3357
|
-
)
|
|
3378
|
+
error: opts.createError("NETWORK_ERROR", opts.fallbackMessage)
|
|
3358
3379
|
};
|
|
3359
3380
|
}
|
|
3360
3381
|
if (!response.ok) {
|
|
@@ -3381,7 +3402,7 @@ async function postPublic(url, init, opts) {
|
|
|
3381
3402
|
}
|
|
3382
3403
|
function createNewsletterMethods(deps) {
|
|
3383
3404
|
const { fetchWithAuth, baseUrl, createError } = deps;
|
|
3384
|
-
async function subscribe(params) {
|
|
3405
|
+
async function subscribe(params, options = {}) {
|
|
3385
3406
|
const email = trimOrEmpty(params.email);
|
|
3386
3407
|
const source = trimOrEmpty(params.source);
|
|
3387
3408
|
if (!email) {
|
|
@@ -3398,10 +3419,19 @@ function createNewsletterMethods(deps) {
|
|
|
3398
3419
|
)
|
|
3399
3420
|
};
|
|
3400
3421
|
}
|
|
3401
|
-
|
|
3422
|
+
if (options.idempotencyKey !== void 0 && !zod.z.uuid().safeParse(options.idempotencyKey).success) {
|
|
3423
|
+
return {
|
|
3424
|
+
error: createError(
|
|
3425
|
+
"INVALID_IDEMPOTENCY_KEY",
|
|
3426
|
+
"idempotencyKey \u306B\u306F UUID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
3427
|
+
)
|
|
3428
|
+
};
|
|
3429
|
+
}
|
|
3430
|
+
const response = await fetchWithAuth(
|
|
3402
3431
|
EXT_SUBSCRIBE_ENDPOINT2,
|
|
3403
3432
|
{
|
|
3404
3433
|
method: "POST",
|
|
3434
|
+
...options.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {},
|
|
3405
3435
|
body: JSON.stringify({
|
|
3406
3436
|
email,
|
|
3407
3437
|
types: params.types,
|
|
@@ -3410,6 +3440,23 @@ function createNewsletterMethods(deps) {
|
|
|
3410
3440
|
})
|
|
3411
3441
|
}
|
|
3412
3442
|
);
|
|
3443
|
+
if (response.error) return response;
|
|
3444
|
+
const parsed = subscribeResponseSchema.safeParse(response.data);
|
|
3445
|
+
if (!parsed.success)
|
|
3446
|
+
return {
|
|
3447
|
+
error: createError(
|
|
3448
|
+
"PARSE_ERROR",
|
|
3449
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u767B\u9332\u306E\u5FDC\u7B54\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
3450
|
+
)
|
|
3451
|
+
};
|
|
3452
|
+
if (options.idempotencyKey && parsed.data.requestId !== options.idempotencyKey)
|
|
3453
|
+
return {
|
|
3454
|
+
error: createError(
|
|
3455
|
+
"PARSE_ERROR",
|
|
3456
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u767B\u9332\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u8B58\u5225\u5B50\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
3457
|
+
)
|
|
3458
|
+
};
|
|
3459
|
+
return { data: parsed.data };
|
|
3413
3460
|
}
|
|
3414
3461
|
async function confirm(params) {
|
|
3415
3462
|
const token = trimOrEmpty(params.token);
|
|
@@ -3437,6 +3484,16 @@ function createNewsletterMethods(deps) {
|
|
|
3437
3484
|
}
|
|
3438
3485
|
const url = new URL(`${baseUrl}${UNSUBSCRIBE_ENDPOINT}`);
|
|
3439
3486
|
url.searchParams.set("token", token);
|
|
3487
|
+
if (params.type !== void 0) {
|
|
3488
|
+
if (!FFID_NEWSLETTER_TYPES.includes(params.type))
|
|
3489
|
+
return {
|
|
3490
|
+
error: createError(
|
|
3491
|
+
"VALIDATION_ERROR",
|
|
3492
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u306E\u914D\u4FE1\u7A2E\u5225\u304C\u4E0D\u6B63\u3067\u3059"
|
|
3493
|
+
)
|
|
3494
|
+
};
|
|
3495
|
+
url.searchParams.set("type", params.type);
|
|
3496
|
+
}
|
|
3440
3497
|
return postPublic(
|
|
3441
3498
|
url.toString(),
|
|
3442
3499
|
{ method: "POST" },
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-
|
|
2
|
-
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-DMwmK8mM.cjs';
|
|
2
|
+
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-DMwmK8mM.cjs';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.cjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-Cjb9J0rL.cjs';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-
|
|
2
|
-
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-Dr2KVlIZ.js';
|
|
2
|
+
export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-Dr2KVlIZ.js';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-Cjb9J0rL.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
|
|
2
2
|
export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES } from '../chunk-JEVK2XUM.js';
|
|
3
3
|
import { SignJWT, importJWK, jwtVerify, createRemoteJWKSet, errors } from 'jose';
|
|
4
|
+
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
// src/auth/token-store.ts
|
|
6
7
|
var STORAGE_KEY = "ffid_tokens";
|
|
@@ -1387,7 +1388,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
|
|
|
1387
1388
|
};
|
|
1388
1389
|
|
|
1389
1390
|
// src/client/version-check.ts
|
|
1390
|
-
var SDK_VERSION = "12.
|
|
1391
|
+
var SDK_VERSION = "12.2.0";
|
|
1391
1392
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1392
1393
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1393
1394
|
function sdkHeaders() {
|
|
@@ -3336,24 +3337,44 @@ function createContractWizardMethods(deps) {
|
|
|
3336
3337
|
};
|
|
3337
3338
|
}
|
|
3338
3339
|
|
|
3340
|
+
// src/newsletter/types.ts
|
|
3341
|
+
var FFID_NEWSLETTER_TYPES = ["inquiry_followup", "general"];
|
|
3342
|
+
|
|
3339
3343
|
// src/newsletter/ffid-newsletter-client.ts
|
|
3340
3344
|
var EXT_SUBSCRIBE_ENDPOINT2 = "/api/v1/ext/newsletter/subscribe";
|
|
3341
3345
|
var CONFIRM_ENDPOINT = "/api/newsletter/confirm";
|
|
3342
3346
|
var UNSUBSCRIBE_ENDPOINT = "/api/newsletter/unsubscribe";
|
|
3343
3347
|
var DISPATCH_ENDPOINT = "/api/v1/newsletter/dispatch";
|
|
3348
|
+
var PUBLIC_TOKEN_TIMEOUT_MS = 3e4;
|
|
3349
|
+
var subscribeResponseSchema = z.object({
|
|
3350
|
+
ok: z.literal(true),
|
|
3351
|
+
requiresConfirmation: z.boolean(),
|
|
3352
|
+
requiresSignIn: z.boolean(),
|
|
3353
|
+
confirmationEmailPending: z.boolean(),
|
|
3354
|
+
requestId: z.uuid().optional()
|
|
3355
|
+
}).refine(
|
|
3356
|
+
(value) => [
|
|
3357
|
+
value.requiresConfirmation,
|
|
3358
|
+
value.requiresSignIn,
|
|
3359
|
+
value.confirmationEmailPending
|
|
3360
|
+
].filter(Boolean).length <= 1
|
|
3361
|
+
);
|
|
3344
3362
|
function trimOrEmpty(s) {
|
|
3345
3363
|
return typeof s === "string" ? s.trim() : "";
|
|
3346
3364
|
}
|
|
3347
3365
|
async function postPublic(url, init, opts) {
|
|
3348
3366
|
let response;
|
|
3349
3367
|
try {
|
|
3350
|
-
response = await fetch(url,
|
|
3351
|
-
|
|
3368
|
+
response = await fetch(url, {
|
|
3369
|
+
...init,
|
|
3370
|
+
credentials: "omit",
|
|
3371
|
+
redirect: "error",
|
|
3372
|
+
cache: "no-store",
|
|
3373
|
+
signal: AbortSignal.timeout(PUBLIC_TOKEN_TIMEOUT_MS)
|
|
3374
|
+
});
|
|
3375
|
+
} catch {
|
|
3352
3376
|
return {
|
|
3353
|
-
error: opts.createError(
|
|
3354
|
-
"NETWORK_ERROR",
|
|
3355
|
-
err instanceof Error ? err.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
|
|
3356
|
-
)
|
|
3377
|
+
error: opts.createError("NETWORK_ERROR", opts.fallbackMessage)
|
|
3357
3378
|
};
|
|
3358
3379
|
}
|
|
3359
3380
|
if (!response.ok) {
|
|
@@ -3380,7 +3401,7 @@ async function postPublic(url, init, opts) {
|
|
|
3380
3401
|
}
|
|
3381
3402
|
function createNewsletterMethods(deps) {
|
|
3382
3403
|
const { fetchWithAuth, baseUrl, createError } = deps;
|
|
3383
|
-
async function subscribe(params) {
|
|
3404
|
+
async function subscribe(params, options = {}) {
|
|
3384
3405
|
const email = trimOrEmpty(params.email);
|
|
3385
3406
|
const source = trimOrEmpty(params.source);
|
|
3386
3407
|
if (!email) {
|
|
@@ -3397,10 +3418,19 @@ function createNewsletterMethods(deps) {
|
|
|
3397
3418
|
)
|
|
3398
3419
|
};
|
|
3399
3420
|
}
|
|
3400
|
-
|
|
3421
|
+
if (options.idempotencyKey !== void 0 && !z.uuid().safeParse(options.idempotencyKey).success) {
|
|
3422
|
+
return {
|
|
3423
|
+
error: createError(
|
|
3424
|
+
"INVALID_IDEMPOTENCY_KEY",
|
|
3425
|
+
"idempotencyKey \u306B\u306F UUID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
3426
|
+
)
|
|
3427
|
+
};
|
|
3428
|
+
}
|
|
3429
|
+
const response = await fetchWithAuth(
|
|
3401
3430
|
EXT_SUBSCRIBE_ENDPOINT2,
|
|
3402
3431
|
{
|
|
3403
3432
|
method: "POST",
|
|
3433
|
+
...options.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {},
|
|
3404
3434
|
body: JSON.stringify({
|
|
3405
3435
|
email,
|
|
3406
3436
|
types: params.types,
|
|
@@ -3409,6 +3439,23 @@ function createNewsletterMethods(deps) {
|
|
|
3409
3439
|
})
|
|
3410
3440
|
}
|
|
3411
3441
|
);
|
|
3442
|
+
if (response.error) return response;
|
|
3443
|
+
const parsed = subscribeResponseSchema.safeParse(response.data);
|
|
3444
|
+
if (!parsed.success)
|
|
3445
|
+
return {
|
|
3446
|
+
error: createError(
|
|
3447
|
+
"PARSE_ERROR",
|
|
3448
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u767B\u9332\u306E\u5FDC\u7B54\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
3449
|
+
)
|
|
3450
|
+
};
|
|
3451
|
+
if (options.idempotencyKey && parsed.data.requestId !== options.idempotencyKey)
|
|
3452
|
+
return {
|
|
3453
|
+
error: createError(
|
|
3454
|
+
"PARSE_ERROR",
|
|
3455
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u767B\u9332\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u8B58\u5225\u5B50\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
3456
|
+
)
|
|
3457
|
+
};
|
|
3458
|
+
return { data: parsed.data };
|
|
3412
3459
|
}
|
|
3413
3460
|
async function confirm(params) {
|
|
3414
3461
|
const token = trimOrEmpty(params.token);
|
|
@@ -3436,6 +3483,16 @@ function createNewsletterMethods(deps) {
|
|
|
3436
3483
|
}
|
|
3437
3484
|
const url = new URL(`${baseUrl}${UNSUBSCRIBE_ENDPOINT}`);
|
|
3438
3485
|
url.searchParams.set("token", token);
|
|
3486
|
+
if (params.type !== void 0) {
|
|
3487
|
+
if (!FFID_NEWSLETTER_TYPES.includes(params.type))
|
|
3488
|
+
return {
|
|
3489
|
+
error: createError(
|
|
3490
|
+
"VALIDATION_ERROR",
|
|
3491
|
+
"\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u306E\u914D\u4FE1\u7A2E\u5225\u304C\u4E0D\u6B63\u3067\u3059"
|
|
3492
|
+
)
|
|
3493
|
+
};
|
|
3494
|
+
url.searchParams.set("type", params.type);
|
|
3495
|
+
}
|
|
3439
3496
|
return postPublic(
|
|
3440
3497
|
url.toString(),
|
|
3441
3498
|
{ method: "POST" },
|