@feelflow/ffid-sdk 7.2.0 → 8.0.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 +115 -5
- package/dist/{chunk-SOZ2B2ZL.cjs → chunk-RNCK5E3Y.cjs} +204 -12
- package/dist/{chunk-E2AJAVX6.js → chunk-YKBAFPX5.js} +195 -13
- 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/{ffid-client-QNEFA3mv.d.ts → ffid-client-5GAPcRIG.d.ts} +105 -23
- package/dist/{ffid-client-BFgoVPOZ.d.cts → ffid-client-BaEmw7jP.d.cts} +105 -23
- package/dist/{index-BMKhKhzF.d.cts → index-BG7g99pK.d.cts} +1 -0
- package/dist/{index-BMKhKhzF.d.ts → index-BG7g99pK.d.ts} +1 -0
- package/dist/index.cjs +104 -64
- package/dist/index.d.cts +378 -26
- package/dist/index.d.ts +378 -26
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +128 -10
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +128 -10
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/dist/webhooks/index.d.cts +55 -6
- package/dist/webhooks/index.d.ts +55 -6
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as FFIDOAuthUserInfoSubscription, b as FFIDAccountType, c as FFIDPrompt, d as FFIDConfig, e as FFIDApiResponse, f as FFIDSessionResponse, g as FFIDSignOutResult, h as FFIDError, i as FFIDSubscriptionCheckResponse, j as FFIDCheckServiceAccessParams, k as FFIDServiceAccessDecision, l as FFIDAnalyticsConfig, m as FFIDVerifyAccessTokenOptions, n as FFIDOAuthUserInfo, o as FFIDInquiryCreateParams, p as FFIDInquiryCreateResponse, T as TokenStore, q as FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-
|
|
2
|
-
export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryAcquisitionSource, R as FFIDInquiryCategory, S as FFIDInquiryCategorySite2026, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormLegalLayout, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a2 as FFIDJwtClaims, a3 as FFIDLoginButton, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOrganizationSwitcher, a6 as FFIDSeatAssignmentClaim, a7 as FFIDSeatAssignmentStatus, a8 as FFIDSeatModel, a9 as FFIDServiceAccessDenialReason, aa as FFIDServiceAccessFailPolicy, ab as FFIDSubscriptionBadge, ac as FFIDUserMenu, ad as FFID_INQUIRY_ACQUISITION_SOURCES, ae as FFID_INQUIRY_CATEGORIES, af as FFID_INQUIRY_CATEGORIES_SITE_2026, ag as TokenData, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as createTokenStore, ak as isFFIDInquiryAcquisitionSource, al as isFFIDInquiryCategorySite2026, am as useFFIDAnnouncements } from './index-
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDOAuthUserInfoSubscription, b as FFIDAccountType, c as FFIDPrompt, d as FFIDConfig, e as FFIDApiResponse, f as FFIDSessionResponse, g as FFIDSignOutResult, h as FFIDError, i as FFIDSubscriptionCheckResponse, j as FFIDCheckServiceAccessParams, k as FFIDServiceAccessDecision, l as FFIDAnalyticsConfig, m as FFIDVerifyAccessTokenOptions, n as FFIDOAuthUserInfo, o as FFIDInquiryCreateParams, p as FFIDInquiryCreateResponse, T as TokenStore, q as FFIDAuthMode, r as FFIDLogger, s as FFIDCacheAdapter, t as FFIDUser, u as FFIDOrganization, v as FFIDSubscription, w as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-BG7g99pK.cjs';
|
|
2
|
+
export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryAcquisitionSource, R as FFIDInquiryCategory, S as FFIDInquiryCategorySite2026, U as FFIDInquiryForm, V as FFIDInquiryFormCategoryItem, W as FFIDInquiryFormClassNames, X as FFIDInquiryFormLegalLayout, Y as FFIDInquiryFormOrganization, Z as FFIDInquiryFormPlaceholderContext, _ as FFIDInquiryFormPrefill, $ as FFIDInquiryFormProps, a0 as FFIDInquiryFormSubmitData, a1 as FFIDInquiryFormSubmitResult, a2 as FFIDJwtClaims, a3 as FFIDLoginButton, a4 as FFIDOAuthUserInfoMemberRole, a5 as FFIDOrganizationSwitcher, a6 as FFIDSeatAssignmentClaim, a7 as FFIDSeatAssignmentStatus, a8 as FFIDSeatModel, a9 as FFIDServiceAccessDenialReason, aa as FFIDServiceAccessFailPolicy, ab as FFIDSubscriptionBadge, ac as FFIDUserMenu, ad as FFID_INQUIRY_ACQUISITION_SOURCES, ae as FFID_INQUIRY_CATEGORIES, af as FFID_INQUIRY_CATEGORIES_SITE_2026, ag as TokenData, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as createTokenStore, ak as isFFIDInquiryAcquisitionSource, al as isFFIDInquiryCategorySite2026, am as useFFIDAnnouncements } from './index-BG7g99pK.cjs';
|
|
3
3
|
export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, n as FFIDAnalyticsProvider, o as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, q as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, v as FFIDConsentError, w as FFIDConsentErrorCode, x as FFIDConsentMergeStrategy, z as FFIDConsentMergeWarning, B as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, H as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, L as FFIDCookieBanner, M as FFIDCookieBannerClassNames, N as FFIDCookieBannerProps, O as FFIDCookieLink, Q as FFIDCookieLinkProps, f as FFIDCookiePolicy, S as FFIDCookieSettings, T as FFIDCookieSettingsClassNames, U as FFIDCookieSettingsProps, Z as FFID_CONSENT_ERROR_CODES, ad as UseFFIDConsentPreferencesReturn, ae as UseFFIDConsentReturn, af as clearConsentDismissalTimestamp, ai as decodeConsentCookie, ak as encodeConsentCookie, am as readConsentCookie, an as readConsentDismissalTimestamp, ap as useFFIDConsent, aq as useFFIDConsentPreferences, ar as writeConsentCookie, as as writeConsentDismissalTimestamp } from './FFIDCookieLink-Bwr0FBrV.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
@@ -226,12 +226,31 @@ interface FFIDSubscriptionDetail {
|
|
|
226
226
|
trialStart: string | null;
|
|
227
227
|
trialEnd: string | null;
|
|
228
228
|
canceledAt: string | null;
|
|
229
|
+
/**
|
|
230
|
+
* `true` while a cancellation is reserved until the period end. `status` stays
|
|
231
|
+
* `active` until then; the subscription becomes `canceled` at `currentPeriodEnd`.
|
|
232
|
+
* The reservation can only be withdrawn in the FFID portal (there is no SDK method).
|
|
233
|
+
*/
|
|
229
234
|
cancelAtPeriodEnd: boolean;
|
|
230
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* Change reserved until the period end (null = nothing reserved).
|
|
237
|
+
*
|
|
238
|
+
* Every decrease — a lower plan, paid → free, fewer seats, yearly → monthly — is
|
|
239
|
+
* reserved instead of applied immediately (FFID #6327). The current plan, seats and
|
|
240
|
+
* interval stay in effect until `scheduledAt`. Withdraw it with `cancelPendingDowngrade()`.
|
|
241
|
+
*/
|
|
231
242
|
pendingDowngrade: {
|
|
243
|
+
/** Plan in effect after the period end. Equals `planCode` for a seat-only or interval-only reservation. */
|
|
232
244
|
planCode: string;
|
|
233
245
|
planName: string;
|
|
246
|
+
/** Billing interval in effect after the period end */
|
|
234
247
|
billingInterval: FFIDBillingInterval;
|
|
248
|
+
/**
|
|
249
|
+
* Seat count in effect after the period end. `null` = the seat count does not change.
|
|
250
|
+
* Seat reductions are made in the FFID portal; this lets you show them (8.0.0).
|
|
251
|
+
* FFID servers released before #6327 omit it, so compare with `== null` at runtime.
|
|
252
|
+
*/
|
|
253
|
+
quantity: number | null;
|
|
235
254
|
scheduledAt: string;
|
|
236
255
|
requestedAt: string;
|
|
237
256
|
} | null;
|
|
@@ -298,7 +317,17 @@ interface FFIDChangePlanParams {
|
|
|
298
317
|
/** New billing interval (default: keeps current) */
|
|
299
318
|
billingInterval?: FFIDBillingInterval;
|
|
300
319
|
}
|
|
301
|
-
/**
|
|
320
|
+
/**
|
|
321
|
+
* Response from change plan endpoint.
|
|
322
|
+
*
|
|
323
|
+
* - An increase (higher plan / monthly → yearly) applies immediately and the difference up to
|
|
324
|
+
* the current period end is charged now. `pendingDowngrade` is absent.
|
|
325
|
+
* - A decrease (lower plan / paid → free / yearly → monthly) is reserved until the period end:
|
|
326
|
+
* `pendingDowngrade` is present and `subscription.planCode` is still the current plan.
|
|
327
|
+
* Nothing is charged or refunded. A contract that cannot be reserved still changes
|
|
328
|
+
* immediately, without a refund: one with no period end, or a paid → paid decrease on a
|
|
329
|
+
* contract without a Stripe subscription.
|
|
330
|
+
*/
|
|
302
331
|
interface FFIDChangePlanResponse {
|
|
303
332
|
message: string;
|
|
304
333
|
subscription: {
|
|
@@ -311,7 +340,7 @@ interface FFIDChangePlanResponse {
|
|
|
311
340
|
status: FFIDSubscriptionStatus;
|
|
312
341
|
isUpgrade: boolean;
|
|
313
342
|
};
|
|
314
|
-
/** Present when
|
|
343
|
+
/** Present when the change is a decrease reserved until the period end */
|
|
315
344
|
pendingDowngrade?: {
|
|
316
345
|
planCode: string;
|
|
317
346
|
planName: string;
|
|
@@ -327,17 +356,41 @@ interface FFIDCancelSubscriptionParams {
|
|
|
327
356
|
/** Additional cancellation details */
|
|
328
357
|
reasonDetails?: string;
|
|
329
358
|
}
|
|
330
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Response from cancel subscription endpoint.
|
|
361
|
+
*
|
|
362
|
+
* Since 8.0.0 a contract billed through Stripe is **reserved** for cancellation at the period
|
|
363
|
+
* end (FFID #6327): `status` stays `active`, `cancelAtPeriodEnd` is `true` and `cancelAt` is the
|
|
364
|
+
* period end. Access continues until then and nothing is refunded. A contract that cannot be
|
|
365
|
+
* reserved (no Stripe subscription, no period end yet, or Stripe not configured on FFID) is
|
|
366
|
+
* canceled immediately (`status: 'canceled'`, `cancelAtPeriodEnd: false`, `cancelAt: null`).
|
|
367
|
+
* Branch on `cancelAtPeriodEnd`, not on whether the contract uses Stripe.
|
|
368
|
+
*
|
|
369
|
+
* Do not treat this response as "access revoked". The `subscription.canceled` webhook arrives
|
|
370
|
+
* at reservation (`source: 'user_initiated'`) and again at the period end
|
|
371
|
+
* (`source: 'stripe_confirmed'`); see `FFIDSubscriptionCanceledPayload`.
|
|
372
|
+
*/
|
|
331
373
|
interface FFIDCancelSubscriptionResponse {
|
|
332
374
|
message: string;
|
|
333
375
|
subscription: {
|
|
334
376
|
id: string;
|
|
335
377
|
organizationId: string;
|
|
378
|
+
/** `active` while the cancellation is reserved; `canceled` only for an immediate cancellation */
|
|
336
379
|
status: FFIDSubscriptionStatus;
|
|
337
380
|
canceledAt: string | null;
|
|
381
|
+
/** `true` when the cancellation is reserved until the period end */
|
|
382
|
+
cancelAtPeriodEnd: boolean;
|
|
383
|
+
/** When the reserved cancellation takes effect (the period end). `null` for an immediate cancellation */
|
|
384
|
+
cancelAt: string | null;
|
|
338
385
|
};
|
|
339
386
|
}
|
|
340
|
-
/**
|
|
387
|
+
/**
|
|
388
|
+
* Response from cancel pending downgrade endpoint.
|
|
389
|
+
*
|
|
390
|
+
* Withdraws the reserved change on the Stripe side as well, so the current plan, seats and
|
|
391
|
+
* interval simply continue after the period end. It does not withdraw a reserved
|
|
392
|
+
* cancellation — that is done in the FFID portal.
|
|
393
|
+
*/
|
|
341
394
|
interface FFIDCancelPendingDowngradeResponse {
|
|
342
395
|
message: string;
|
|
343
396
|
subscription: {
|
|
@@ -392,14 +445,18 @@ interface FFIDPlanChangePreviewBase {
|
|
|
392
445
|
lineItems: FFIDPlanChangeLineItem[];
|
|
393
446
|
}
|
|
394
447
|
/**
|
|
395
|
-
* Plan change proration preview.
|
|
448
|
+
* Plan change proration preview. It is computed with the same rules as `changePlan()`.
|
|
396
449
|
*
|
|
397
450
|
* `willApplyAtPeriodEnd` is a discriminant that constrains related fields at the type level:
|
|
398
|
-
* - `true`: period
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
* - `false`: immediate change. `effectiveDate` is always `null
|
|
402
|
-
*
|
|
451
|
+
* - `true`: a decrease reserved until the period end. `proratedAmount` is always 0 (nothing is
|
|
452
|
+
* charged or refunded now); `effectiveDate` mirrors the subscription's `currentPeriodEnd`
|
|
453
|
+
* (may be `null` when the subscription has no active billing cycle yet).
|
|
454
|
+
* - `false`: immediate change. `effectiveDate` is always `null`. For an increase,
|
|
455
|
+
* `proratedAmount` is the difference up to the current period end that is charged now
|
|
456
|
+
* (possibly Stripe-refined). A decrease on a contract that cannot be reserved also lands here:
|
|
457
|
+
* `0` for a contract without a Stripe subscription (no refund), but Stripe's prorated amount —
|
|
458
|
+
* negative, credited on the next invoice — for a Stripe contract with no period end yet
|
|
459
|
+
* (e.g. during a trial).
|
|
403
460
|
*/
|
|
404
461
|
type FFIDPlanChangePreview = FFIDPlanChangePreviewBase & ({
|
|
405
462
|
willApplyAtPeriodEnd: true;
|
|
@@ -409,7 +466,7 @@ type FFIDPlanChangePreview = FFIDPlanChangePreviewBase & ({
|
|
|
409
466
|
} | {
|
|
410
467
|
willApplyAtPeriodEnd: false;
|
|
411
468
|
effectiveDate: null;
|
|
412
|
-
/**
|
|
469
|
+
/** Difference up to the current period end charged now (see the type doc for the decrease cases) */
|
|
413
470
|
proratedAmount: number;
|
|
414
471
|
});
|
|
415
472
|
/** Response from plan change preview endpoint */
|
|
@@ -434,14 +491,27 @@ interface FFIDSeatChangeLineItem {
|
|
|
434
491
|
* Sister type to `FFIDPlanChangePreview`. The shared `type` discriminant lets
|
|
435
492
|
* consumers narrow a preview payload without inspecting unrelated fields.
|
|
436
493
|
*
|
|
494
|
+
* - `willApplyAtPeriodEnd=true`: a seat reduction reserved until the period end.
|
|
495
|
+
* `proratedAmount` is 0 and `effectiveDate` is when the new seat count applies.
|
|
496
|
+
* - Otherwise the change applies immediately. For an increase, `proratedAmount` is the amount
|
|
497
|
+
* charged now up to the current period end. A reduction that cannot be reserved is normally
|
|
498
|
+
* `0`, but can be negative (a credit on the next invoice) for a Stripe contract with no period
|
|
499
|
+
* end yet or when only the contract unit price is known.
|
|
437
500
|
* - `isEstimate=true` (default when Stripe is not configured or data is unavailable):
|
|
438
|
-
* `proratedAmount` is computed locally
|
|
439
|
-
*
|
|
501
|
+
* `proratedAmount` is computed locally. `isEstimate=false`: it reflects Stripe's live
|
|
502
|
+
* proration calculation.
|
|
440
503
|
*
|
|
441
504
|
* `nextInvoiceAmount` is always a local estimate (`unitPrice * newQuantity`).
|
|
442
505
|
*
|
|
443
|
-
* `pricingUnavailable=true`
|
|
444
|
-
*
|
|
506
|
+
* `pricingUnavailable=true` means custom pricing or an unverified contracted Stripe
|
|
507
|
+
* Price. Hide amounts; zero is not a quote. `custom_pricing` permits the existing
|
|
508
|
+
* unbilled seat-change flow. Require another preview before confirmation only when
|
|
509
|
+
* pricing is unavailable and the reason is not `custom_pricing`. `stripe_error` also
|
|
510
|
+
* covers invoice/address failures after the contract price is known; use
|
|
511
|
+
* `pricingUnavailable`, not the reason alone, to decide whether to hide amounts.
|
|
512
|
+
* `no_stripe_data` means invoice proration is unavailable even if the contract unit
|
|
513
|
+
* price is known. Portal seat PUT independently enforces subscription limits;
|
|
514
|
+
* external consumers should guide users to the FFID portal for seat changes.
|
|
445
515
|
*/
|
|
446
516
|
interface FFIDSeatChangePreview {
|
|
447
517
|
/** Discriminant for preview response variants (pairs with `FFIDPlanChangePreview.type`) */
|
|
@@ -452,20 +522,28 @@ interface FFIDSeatChangePreview {
|
|
|
452
522
|
unitPrice: number;
|
|
453
523
|
billingInterval: FFIDBillingInterval;
|
|
454
524
|
/**
|
|
455
|
-
*
|
|
456
|
-
* (
|
|
525
|
+
* Amount charged now for the rest of the current billing period. A reserved seat reduction
|
|
526
|
+
* (`willApplyAtPeriodEnd: true`) is always `0`; see the type doc for reductions that cannot
|
|
527
|
+
* be reserved. Also `0` when `pricingUnavailable === true`; hide it instead of quoting zero.
|
|
457
528
|
*/
|
|
458
529
|
proratedAmount: number;
|
|
459
530
|
/** Next invoice full amount — always a local estimate (`unitPrice * newQuantity`) */
|
|
460
531
|
nextInvoiceAmount: number;
|
|
461
532
|
nextInvoiceDate: string | null;
|
|
462
533
|
currency: FFIDSupportedCurrency;
|
|
463
|
-
/** true when proratedAmount is
|
|
534
|
+
/** true when proratedAmount is a local estimate rather than Stripe invoice/proration data */
|
|
464
535
|
isEstimate: boolean;
|
|
465
|
-
/**
|
|
536
|
+
/** Hide amounts: custom pricing or contracted Stripe Price could not be verified. */
|
|
466
537
|
pricingUnavailable?: boolean;
|
|
467
538
|
/** Reason why `isEstimate` is true. Only meaningful when `isEstimate === true`. */
|
|
468
539
|
estimateReason?: 'no_stripe_data' | 'custom_pricing' | 'stripe_error';
|
|
540
|
+
/**
|
|
541
|
+
* `true` when the seat reduction would be reserved until the period end (8.0.0).
|
|
542
|
+
* Absent or `false` = the change applies immediately.
|
|
543
|
+
*/
|
|
544
|
+
willApplyAtPeriodEnd?: boolean;
|
|
545
|
+
/** When the reserved seat count applies (present when `willApplyAtPeriodEnd` is `true`) */
|
|
546
|
+
effectiveDate?: string | null;
|
|
469
547
|
lineItems: FFIDSeatChangeLineItem[];
|
|
470
548
|
}
|
|
471
549
|
/** Response from seat change preview endpoint */
|
|
@@ -550,6 +628,7 @@ interface FFIDProvisionUserProfileInput {
|
|
|
550
628
|
/** Display name (1–255 chars). */
|
|
551
629
|
displayName?: string;
|
|
552
630
|
/** Company name (≤255 chars). */
|
|
631
|
+
/** @deprecated Accepted for compatibility but ignored by FFID. */
|
|
553
632
|
companyName?: string;
|
|
554
633
|
/** Department (≤255 chars). */
|
|
555
634
|
department?: string;
|
|
@@ -1258,7 +1337,7 @@ interface FFIDUserProfile {
|
|
|
1258
1337
|
avatarUrl: string | null;
|
|
1259
1338
|
/** Phone number (nullable when not set) */
|
|
1260
1339
|
phone: string | null;
|
|
1261
|
-
/**
|
|
1340
|
+
/** @deprecated Individual employer name is retired; this field is always null. Use the organization entity's name. */
|
|
1262
1341
|
companyName: string | null;
|
|
1263
1342
|
/** Department (nullable when not set) */
|
|
1264
1343
|
department: string | null;
|
|
@@ -1339,7 +1418,7 @@ interface FFIDUpdateUserProfileRequest {
|
|
|
1339
1418
|
displayName?: string | null;
|
|
1340
1419
|
/** Phone number (null clears the field) */
|
|
1341
1420
|
phone?: string | null;
|
|
1342
|
-
/**
|
|
1421
|
+
/** @deprecated Accepted for compatibility but ignored. Use the organization entity's name. */
|
|
1343
1422
|
companyName?: string | null;
|
|
1344
1423
|
/** Department (null clears the field) */
|
|
1345
1424
|
department?: string | null;
|
|
@@ -1428,6 +1507,7 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
1428
1507
|
email_verified?: boolean;
|
|
1429
1508
|
name?: string;
|
|
1430
1509
|
picture?: string | null;
|
|
1510
|
+
/** @deprecated Kept on the wire for compatibility; FFID returns null. */
|
|
1431
1511
|
company_name?: string | null;
|
|
1432
1512
|
department?: string | null;
|
|
1433
1513
|
position?: string | null;
|
|
@@ -1739,6 +1819,45 @@ declare const FFID_ERROR_CODES: {
|
|
|
1739
1819
|
* error codes pass through verbatim and must not be narrowed away.
|
|
1740
1820
|
*/
|
|
1741
1821
|
type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
|
|
1822
|
+
/**
|
|
1823
|
+
* Server error codes returned by the subscription endpoints (`changePlan`,
|
|
1824
|
+
* `cancelSubscription`, `cancelPendingDowngrade` and the two previews) that callers
|
|
1825
|
+
* are expected to branch on (FFID #6327 billing rules). They arrive verbatim in
|
|
1826
|
+
* `FFIDError.code`.
|
|
1827
|
+
*
|
|
1828
|
+
* - `CANCELLATION_SCHEDULED` (409): a cancellation is reserved until the period end, so
|
|
1829
|
+
* plan / seat changes are refused. The reservation can only be withdrawn in the FFID
|
|
1830
|
+
* portal — send the user to the subscription page there.
|
|
1831
|
+
* - `PENDING_CHANGE_EXISTS` (409): another change is already reserved. Withdraw it with
|
|
1832
|
+
* `cancelPendingDowngrade()` first.
|
|
1833
|
+
* - `CHANGE_DIRECTION_MIXED` (422): the request mixes an increase (applied now) and a
|
|
1834
|
+
* decrease (reserved), e.g. a higher plan billed yearly → monthly. Split it.
|
|
1835
|
+
* - `CHANGE_PAYMENT_FAILED` (402): the immediate charge for an increase failed; nothing
|
|
1836
|
+
* changed.
|
|
1837
|
+
* - `SAME_PLAN_SELECTED` (400): nothing would change.
|
|
1838
|
+
* - `NO_PENDING_DOWNGRADE` (400): `cancelPendingDowngrade()` found nothing reserved.
|
|
1839
|
+
* - `SUBSCRIPTION_NOT_CANCELABLE` (400): the cancellation is already reserved.
|
|
1840
|
+
* - `SUBSCRIPTION_ALREADY_CANCELED` (400): the subscription is already canceled.
|
|
1841
|
+
* - `FREE_DOWNGRADE_NOT_ALLOWED` (400): the service does not allow paid → free.
|
|
1842
|
+
* - `PAYMENT_METHOD_REQUIRED` (402): an increase needs a payment method on file.
|
|
1843
|
+
*
|
|
1844
|
+
* The values are checked against the FFID server's definitions by a test in the
|
|
1845
|
+
* FFID repository, so they cannot drift silently.
|
|
1846
|
+
*/
|
|
1847
|
+
declare const FFID_SUBSCRIPTION_ERROR_CODES: {
|
|
1848
|
+
readonly CANCELLATION_SCHEDULED: "CANCELLATION_SCHEDULED";
|
|
1849
|
+
readonly PENDING_CHANGE_EXISTS: "PENDING_CHANGE_EXISTS";
|
|
1850
|
+
readonly CHANGE_DIRECTION_MIXED: "CHANGE_DIRECTION_MIXED";
|
|
1851
|
+
readonly CHANGE_PAYMENT_FAILED: "CHANGE_PAYMENT_FAILED";
|
|
1852
|
+
readonly SAME_PLAN_SELECTED: "SAME_PLAN_SELECTED";
|
|
1853
|
+
readonly NO_PENDING_DOWNGRADE: "NO_PENDING_DOWNGRADE";
|
|
1854
|
+
readonly SUBSCRIPTION_NOT_CANCELABLE: "SUBSCRIPTION_NOT_CANCELABLE";
|
|
1855
|
+
readonly SUBSCRIPTION_ALREADY_CANCELED: "SUBSCRIPTION_ALREADY_CANCELED";
|
|
1856
|
+
readonly FREE_DOWNGRADE_NOT_ALLOWED: "FREE_DOWNGRADE_NOT_ALLOWED";
|
|
1857
|
+
readonly PAYMENT_METHOD_REQUIRED: "PAYMENT_METHOD_REQUIRED";
|
|
1858
|
+
};
|
|
1859
|
+
/** Union of `FFID_SUBSCRIPTION_ERROR_CODES` values */
|
|
1860
|
+
type FFIDSubscriptionErrorCode = (typeof FFID_SUBSCRIPTION_ERROR_CODES)[keyof typeof FFID_SUBSCRIPTION_ERROR_CODES];
|
|
1742
1861
|
|
|
1743
1862
|
/** Creates an FFID API client instance */
|
|
1744
1863
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
@@ -1754,7 +1873,9 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1754
1873
|
prompt?: FFIDPrompt;
|
|
1755
1874
|
}) => string;
|
|
1756
1875
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1757
|
-
getSignupUrl: (redirectUrl?: string
|
|
1876
|
+
getSignupUrl: (redirectUrl?: string, options?: {
|
|
1877
|
+
inviteToken?: string;
|
|
1878
|
+
}) => string;
|
|
1758
1879
|
createError: (code: string, message: string) => FFIDError;
|
|
1759
1880
|
exchangeCodeForTokens: (code: string, codeVerifier?: string, opts?: ExchangeCodeForTokensOptions) => Promise<FFIDApiResponse<void>>;
|
|
1760
1881
|
refreshAccessToken: () => Promise<FFIDApiResponse<void>>;
|
|
@@ -1983,6 +2104,237 @@ interface NormalizeRedirectUriResult {
|
|
|
1983
2104
|
}
|
|
1984
2105
|
declare function normalizeRedirectUri(input: string): NormalizeRedirectUriResult;
|
|
1985
2106
|
|
|
2107
|
+
/**
|
|
2108
|
+
* 代理店の招待トークン(`invite`)の捕捉・保持・ログ抑止(#5823)。
|
|
2109
|
+
*
|
|
2110
|
+
* ## 何のための仕組みか
|
|
2111
|
+
*
|
|
2112
|
+
* 代理店の招待リンクから来た顧客が FFID に登録すると、作られた組織がその代理店に
|
|
2113
|
+
* 紐付く。紐付けの実務は FFID 側(`/signup?invite=…` を読む `SignupPageClient`)が
|
|
2114
|
+
* 行うので、SDK の責務は **トークンを signup URL まで運ぶこと** だけである。
|
|
2115
|
+
*
|
|
2116
|
+
* ⚠️ **代理店ポータルが現在発行するリンクは FFID の origin を指す**
|
|
2117
|
+
* (`buildInviteLinkUrl` が `https://id.feelflow.net/signup?invite=<token>` を組む)。
|
|
2118
|
+
* サービスサイトを着地点にする形(`https://<サービス>/?invite=<token>`)はポータルの
|
|
2119
|
+
* UI が提示しておらず、代理店がトークンを自分のキャンペーン URL に貼って初めて
|
|
2120
|
+
* 成立する。このモジュールが有効になるのはその形の導線である。
|
|
2121
|
+
*
|
|
2122
|
+
* ## なぜ cookie が要るのか
|
|
2123
|
+
*
|
|
2124
|
+
* 「着地した URL で即 signup する」利用者だけなら `location.search` を読めば足りる。
|
|
2125
|
+
* しかし実際の導線は「`/?invite=abc` に着地 → 回遊 → パラメータの無い別ページで
|
|
2126
|
+
* 登録を押す」であり、`getSignupUrl()` が呼ばれる時点の URL には `invite` が無い。
|
|
2127
|
+
* 着地時点で捕捉して保持しておく以外に、この経路を救う方法が無い。
|
|
2128
|
+
*
|
|
2129
|
+
* ### 保持期間 30 日の費用
|
|
2130
|
+
*
|
|
2131
|
+
* 便益は「リンクを踏んでから検討して戻ってくる」までを覆えること。費用は
|
|
2132
|
+
* **意図しない紐付け**である。招待リンクは既定で使用回数が無制限
|
|
2133
|
+
* (`agency_invite_links.max_uses` は nullable で「NULL = 無制限」、発行ダイアログの
|
|
2134
|
+
* 既定は未入力)なので、保持中の cookie は**同じブラウザで後から作られた組織も
|
|
2135
|
+
* 同じ代理店に紐付ける**。共有ブラウザではこれが誤紐付けになる。
|
|
2136
|
+
*
|
|
2137
|
+
* 姉妹の `AGENCY_INVITE_TOKEN_COOKIE`(FFID 側・OAuth 往復用・15 分)が短いのは
|
|
2138
|
+
* 同じ費用を避けるためである(`src/lib/auth/shared-utils.ts` のその docstring を参照)。
|
|
2139
|
+
* こちらが 30 日なのは覆いたい導線の長さが違うからで、費用が無いからではない。
|
|
2140
|
+
*
|
|
2141
|
+
* ### 消す責任者は現在いない
|
|
2142
|
+
*
|
|
2143
|
+
* {@link clearAgencyInviteToken} は公開しているが、SDK 内・FFID 側のどちらからも
|
|
2144
|
+
* 登録完了時に呼んでいない。登録完了は FFID のドメインで起こるため consumer から
|
|
2145
|
+
* 検知しにくい。したがって現在の挙動は「30 日経過・上書き・consumer による明示的な
|
|
2146
|
+
* 削除のいずれかまで保持し続ける」である。これを単回にすべきかは製品判断で、
|
|
2147
|
+
* 本モジュールは現挙動を明文化するに留める。
|
|
2148
|
+
*
|
|
2149
|
+
* ## 誰が捕捉を起動するか
|
|
2150
|
+
*
|
|
2151
|
+
* SDK 自身はページ読み込みを hook できない。したがって捕捉の起動点は 2 つある。
|
|
2152
|
+
*
|
|
2153
|
+
* | 起動点 | 対象 | 利用者側の配線 |
|
|
2154
|
+
* |---|---|---|
|
|
2155
|
+
* | `FFIDProvider` の mount effect | React 利用者 | 不要 |
|
|
2156
|
+
* | {@link captureAgencyInviteToken} の直接呼び出し | 非 React / provider 未使用 | ページ遷移ごとに呼ぶ |
|
|
2157
|
+
*
|
|
2158
|
+
* 配線を忘れた場合は「着地ページで即 signup した人だけ紐付く」= URL 直読み相当まで
|
|
2159
|
+
* **劣化する**(紐付けが壊れるのではなく、上記の回遊経路を救えなくなる)。
|
|
2160
|
+
*
|
|
2161
|
+
* ℹ️ **`authMode: 'token'`(OAuth モード)も v7.4.0 から転送される(#5958)。**
|
|
2162
|
+
* その経路の signup 意図は `getSignupUrl()` に到達しないが、`redirectToAuthorize` が
|
|
2163
|
+
* `invite` を `/api/v1/oauth/authorize` へ載せ、FFID 本体が `/signup` へ引き継ぐ。
|
|
2164
|
+
* **SDK と FFID 本体の両方が新しい必要がある**(2 段で成立するため)。
|
|
2165
|
+
* 詳細は `redirect.ts` の `getSignupUrl` / `redirectToAuthorize` の docstring を参照。
|
|
2166
|
+
*
|
|
2167
|
+
* ## トークンを平文で扱うことの帰結
|
|
2168
|
+
*
|
|
2169
|
+
* このトークンは URL に載る平文の資格情報である。**単回使用ではない** — FFID 側の
|
|
2170
|
+
* `consume_agency_invite_link` RPC が担保するのは「同時実行下でも `max_uses` を
|
|
2171
|
+
* 超えない」ことである。DB の `max_uses` は DEFAULT を持たず NULL 可で、発行処理も
|
|
2172
|
+
* 未指定時は NULL を保存する(= 回数無制限)。したがって漏れた
|
|
2173
|
+
* トークンは、新規組織が作られる限り何度でも紐付けに使える。
|
|
2174
|
+
*
|
|
2175
|
+
* それゆえ SDK 側では **ログ・エラーレポート・アナリティクスに値を出さない**。
|
|
2176
|
+
* URL を出力する経路には {@link redactAgencyInviteToken} を通すこと。
|
|
2177
|
+
*
|
|
2178
|
+
* ⚠️ `AGENCY_INVITE_TOKEN_PARAM` は FFID 本体の `INVITE_TOKEN_PARAM`
|
|
2179
|
+
* (`src/lib/auth/shared-utils.ts`) と**同じ値でなければならない**。
|
|
2180
|
+
*/
|
|
2181
|
+
/**
|
|
2182
|
+
* signup URL に載せるクエリパラメータ名。
|
|
2183
|
+
*
|
|
2184
|
+
* ⚠️ FFID 本体の `INVITE_TOKEN_PARAM`(`src/lib/auth/shared-utils.ts`)と同値。
|
|
2185
|
+
* これは**ワイヤプロトコル定数**であって共有型ではない。publish 済みの全 SDK
|
|
2186
|
+
* バージョンが同じ値を送るので、片側を改名すると古い SDK からの紐付けが静かに
|
|
2187
|
+
* 落ちる。**改名ではなく凍結する**のが正しい扱いで、
|
|
2188
|
+
* `src/lib/auth/__tests__/shared-utils.test.ts` のドリフトガードが落ちたときの
|
|
2189
|
+
* 対応は「両側を揃える」ではなく「SDK 側の改名を戻す」である。
|
|
2190
|
+
*/
|
|
2191
|
+
declare const AGENCY_INVITE_TOKEN_PARAM = "invite";
|
|
2192
|
+
/** 招待トークンを保持する first-party cookie の名前。 */
|
|
2193
|
+
declare const AGENCY_INVITE_COOKIE_NAME = "ffid_invite";
|
|
2194
|
+
/** cookie の Max-Age(秒)。 */
|
|
2195
|
+
declare const AGENCY_INVITE_COOKIE_MAX_AGE_SEC: number;
|
|
2196
|
+
/** ログ出力時にトークン値を置き換える文字列。 */
|
|
2197
|
+
declare const AGENCY_INVITE_TOKEN_REDACTION = "[REDACTED]";
|
|
2198
|
+
/** cookie の書き込み先を制御するオプション。`consent/storage/cookie.ts` と同形。 */
|
|
2199
|
+
interface AgencyInviteCookieOptions {
|
|
2200
|
+
/**
|
|
2201
|
+
* `Secure` 属性の明示指定。既定は本番のみ(`NODE_ENV === 'production'`)で、
|
|
2202
|
+
* これは `consent/storage/cookie.ts` の `defaultSecure()` と同じ既定である。
|
|
2203
|
+
*
|
|
2204
|
+
* 明示上書きが必要になるのは **https でない独自ドメイン**(LAN IP や plain http
|
|
2205
|
+
* の検証機)で動かす場合。そこではブラウザが `Secure` cookie を黙って捨てる。
|
|
2206
|
+
* `http://localhost` は W3C の secure context として扱われるため `Secure` でも
|
|
2207
|
+
* 保持される(Chrome 153 で実測)ので、ローカル開発では上書き不要。
|
|
2208
|
+
*/
|
|
2209
|
+
secure?: boolean;
|
|
2210
|
+
/** cookie の Path。既定は `'/'`(サイト全体で読めないと回遊経路を救えない)。 */
|
|
2211
|
+
path?: string;
|
|
2212
|
+
/**
|
|
2213
|
+
* cookie の Domain。既定は未指定 = 現在のホストのみ(first-party)。
|
|
2214
|
+
* サブドメイン間で共有する場合だけ明示する。
|
|
2215
|
+
*/
|
|
2216
|
+
domain?: string;
|
|
2217
|
+
}
|
|
2218
|
+
/** 招待トークンの読み取り元。 */
|
|
2219
|
+
interface ReadAgencyInviteTokenOptions {
|
|
2220
|
+
/**
|
|
2221
|
+
* `window.location.search` の代わりに読む URL または `?` 始まりの query string。
|
|
2222
|
+
* SSR とテストのための seam。fragment は無視される({@link toQueryString} 参照)。
|
|
2223
|
+
*/
|
|
2224
|
+
url?: string;
|
|
2225
|
+
}
|
|
2226
|
+
/** {@link captureAgencyInviteToken} の引数。 */
|
|
2227
|
+
interface CaptureAgencyInviteTokenOptions extends AgencyInviteCookieOptions, ReadAgencyInviteTokenOptions {
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* {@link captureAgencyInviteToken} の結果。
|
|
2231
|
+
*
|
|
2232
|
+
* `source` を判別子にした union にしてあるのは、3 フィールドを独立に持たせると
|
|
2233
|
+
* `{ source: 'none', persisted: true }` のような**起こりえない組み合わせが型で
|
|
2234
|
+
* 構築できてしまう**ため。分解代入(`const { token, source, persisted } = …`)は
|
|
2235
|
+
* 全メンバーが 3 プロパティを持つのでそのまま通る。
|
|
2236
|
+
*/
|
|
2237
|
+
type CaptureAgencyInviteTokenResult =
|
|
2238
|
+
/**
|
|
2239
|
+
* 今回の URL から読んだ。**cookie が更新されたかは `persisted` を見る** —
|
|
2240
|
+
* `false`(ブラウザが落とした)と `undefined`(SSR で書ける環境が無い)のとき、
|
|
2241
|
+
* cookie は上書きされていない。
|
|
2242
|
+
*/
|
|
2243
|
+
{
|
|
2244
|
+
readonly source: 'url';
|
|
2245
|
+
readonly token: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* cookie 書き込みが read-back で確認できたか。
|
|
2248
|
+
*
|
|
2249
|
+
* - `true`: 保持できた
|
|
2250
|
+
* - `false`: **ブラウザが黙って落とした。** 今回の URL 経由では紐付くが、
|
|
2251
|
+
* パラメータの無い別ページへ回遊した時点で失われる。現実的な原因は
|
|
2252
|
+
* `Secure` cookie を https でない独自ドメインへ書いた場合、ITP、
|
|
2253
|
+
* 全 cookie ブロック、プライベートモードの挙動差
|
|
2254
|
+
* - `undefined`: **書ける環境が無かった**(`document` が無い = SSR)。
|
|
2255
|
+
* ブラウザ側で捕捉し直す必要がある、という別の対処になるので `false` と
|
|
2256
|
+
* 混ぜない
|
|
2257
|
+
*/
|
|
2258
|
+
readonly persisted: boolean | undefined;
|
|
2259
|
+
}
|
|
2260
|
+
/** URL には無く、以前保持したものを読んだ(cookie は触っていない)。 */
|
|
2261
|
+
| {
|
|
2262
|
+
readonly source: 'cookie';
|
|
2263
|
+
readonly token: string;
|
|
2264
|
+
readonly persisted: undefined;
|
|
2265
|
+
}
|
|
2266
|
+
/** URL・cookie のいずれにも無い。 */
|
|
2267
|
+
| {
|
|
2268
|
+
readonly source: 'none';
|
|
2269
|
+
readonly token: undefined;
|
|
2270
|
+
readonly persisted: undefined;
|
|
2271
|
+
};
|
|
2272
|
+
/**
|
|
2273
|
+
* cookie に保持された招待トークンを読む。
|
|
2274
|
+
*
|
|
2275
|
+
* 戻り値の `undefined` は「トークンが無い」と「`document` が無い(SSR)」と
|
|
2276
|
+
* 「値が壊れていて読めない」を畳んでいる。呼び出し側が取る対応がいずれも同じ
|
|
2277
|
+
* (トークン無しとして進む)ため、ここでは区別しない。
|
|
2278
|
+
*
|
|
2279
|
+
* 前方一致に `=` を含めるのは、`ffid_invite_foo=` のような別 cookie を誤って
|
|
2280
|
+
* 掴まないため(`consent/storage/cookie.ts` と同じ形)。
|
|
2281
|
+
*/
|
|
2282
|
+
declare function readAgencyInviteCookie(): string | undefined;
|
|
2283
|
+
/**
|
|
2284
|
+
* 現在有効な招待トークンを読む。**URL が cookie に勝つ**(最後に踏んだリンクが
|
|
2285
|
+
* 勝つ)。副作用は無い — cookie の更新は {@link captureAgencyInviteToken} の責務。
|
|
2286
|
+
*/
|
|
2287
|
+
declare function readAgencyInviteToken(options?: ReadAgencyInviteTokenOptions): string | undefined;
|
|
2288
|
+
/**
|
|
2289
|
+
* 保持中の招待トークンを削除する。
|
|
2290
|
+
*
|
|
2291
|
+
* ⚠️ **書き込み時と同じ `path` / `domain` / `secure` を渡すこと。** ブラウザは
|
|
2292
|
+
* 削除にこれらの一致を要求するので、既定以外で書いた cookie は既定の呼び出しでは
|
|
2293
|
+
* 消えない。
|
|
2294
|
+
*
|
|
2295
|
+
* @returns 削除が確認できたか(read-back で不在)。`document` が無い(SSR)=
|
|
2296
|
+
* **試みていない**場合は `undefined`。
|
|
2297
|
+
*/
|
|
2298
|
+
declare function clearAgencyInviteToken(options?: AgencyInviteCookieOptions): boolean | undefined;
|
|
2299
|
+
/**
|
|
2300
|
+
* ページ URL の `invite` を読み、あれば first-party cookie に保存する。
|
|
2301
|
+
*
|
|
2302
|
+
* **ページ遷移ごとに呼ぶ**。`FFIDProvider` を mount している React 利用者は
|
|
2303
|
+
* provider が呼ぶので配線不要。
|
|
2304
|
+
*
|
|
2305
|
+
* URL にトークンがあれば cookie を**上書きする**(最後に踏んだリンクが勝つ)。
|
|
2306
|
+
* URL に無ければ cookie は触らず、保持中の値をそのまま返す。
|
|
2307
|
+
*
|
|
2308
|
+
* @example
|
|
2309
|
+
* ```typescript
|
|
2310
|
+
* // 非 React 利用者: ページ読み込みごとに呼ぶ
|
|
2311
|
+
* const { token, persisted } = captureAgencyInviteToken()
|
|
2312
|
+
* if (persisted === false) {
|
|
2313
|
+
* // 紐付けは今回の URL 経由では効くが、別ページへ回遊すると失われる
|
|
2314
|
+
* }
|
|
2315
|
+
* ```
|
|
2316
|
+
*/
|
|
2317
|
+
declare function captureAgencyInviteToken(options?: CaptureAgencyInviteTokenOptions): CaptureAgencyInviteTokenResult;
|
|
2318
|
+
/**
|
|
2319
|
+
* URL 文字列中の `invite` の値を潰す。**URL をログ・エラーレポート・アナリティクスへ
|
|
2320
|
+
* 出す経路は必ずこれを通す**(トークンは平文の資格情報で、単回使用ではない / #5823)。
|
|
2321
|
+
*
|
|
2322
|
+
* 素の `invite=` と、percent-encode されて入れ子になった形(`%3Finvite%3D` /
|
|
2323
|
+
* `%253Finvite%253D`)を潰す。入れ子が必要なのは、signup URL の `redirect`
|
|
2324
|
+
* パラメータに着地 URL がそのまま入るためで、着地 URL が `?invite=…` なら
|
|
2325
|
+
* `redirect=…%3Finvite%3Dtoken` の形で二重に載る。さらにその signup URL 自体が
|
|
2326
|
+
* 別の `redirect` の値になると 1 段深くなる。
|
|
2327
|
+
*
|
|
2328
|
+
* ⚠️ **覆う encode の深さは 2 段まで**(`%3F` と `%253F`)。任意深さは正規表現で
|
|
2329
|
+
* 表現できないので、3 段以上入れ子にした URL をログへ出さないこと。
|
|
2330
|
+
*
|
|
2331
|
+
* 過剰に潰す方向(無関係な文字列を `[REDACTED]` にする)は安全側なので許容し、
|
|
2332
|
+
* 潰し漏れは許容しない。正規表現で処理するのは、`URL` でのパースが失敗した経路
|
|
2333
|
+
* (相対 URL・壊れた URL)で**元の文字列をそのまま返す = 漏らす**実装になるのを
|
|
2334
|
+
* 避けるため。
|
|
2335
|
+
*/
|
|
2336
|
+
declare function redactAgencyInviteToken(url: string): string;
|
|
2337
|
+
|
|
1986
2338
|
/**
|
|
1987
2339
|
* Create an in-memory cache adapter using a Map.
|
|
1988
2340
|
* Suitable for single-process environments (e.g., development, testing).
|
|
@@ -2898,4 +3250,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
2898
3250
|
};
|
|
2899
3251
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
2900
3252
|
|
|
2901
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, 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 FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, type FFIDCatalogEnvironment, FFIDCatalogHashError, type FFIDCatalogPublication, type FFIDCatalogPublicationStatus, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, 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 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, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type 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, type FFIDPublishedCatalog, type FFIDPublishedPlan, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type 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_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_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_ORGANIZATION_PROFILE_ERROR_CODES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, canonicalizeCatalogValue, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
|
|
3253
|
+
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 FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDCanonicalJsonValue, type FFIDCatalogEnvironment, FFIDCatalogHashError, type FFIDCatalogPublication, type FFIDCatalogPublicationStatus, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, type FFIDCompanySizeCode, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDIndustryCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, type FFIDListingConsentInput, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDLogoWallEntry, type FFIDLogoWallResponse, type FFIDMemberRole, 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 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, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type 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, type FFIDPublishedCatalog, type FFIDPublishedPlan, type FFIDRedirectErrorCode, type FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDScopeHashInput, type FFIDScopeHashPlan, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, type FFIDSubscriptionErrorCode, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type 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_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_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_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, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, validatePublishedCatalog, withFFIDAuth, withSubscription };
|