@feelflow/ffid-sdk 5.10.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-IZSL6DI7.cjs → chunk-JFFRO2Q5.cjs} +308 -11
- package/dist/{chunk-OJ3OJTIE.js → chunk-RATTQIKM.js} +304 -12
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{ffid-client-DRjzfAaS.d.cts → ffid-client-BG0Qr86U.d.ts} +228 -71
- package/dist/{ffid-client-gboJROw0.d.ts → ffid-client-C3K3sAqq.d.cts} +228 -71
- package/dist/{index-DSvX4q8E.d.cts → index-C6dnexXf.d.cts} +24 -43
- package/dist/{index-DSvX4q8E.d.ts → index-C6dnexXf.d.ts} +24 -43
- package/dist/index.cjs +56 -36
- package/dist/index.d.cts +266 -4
- package/dist/index.d.ts +266 -4
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +144 -5
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +144 -5
- package/dist/server/test/index.d.cts +2 -2
- package/dist/server/test/index.d.ts +2 -2
- package/dist/{types-BYdtyO_2.d.cts → types-BeVl-z12.d.cts} +10 -1
- package/dist/{types-BYdtyO_2.d.ts → types-BeVl-z12.d.ts} +10 -1
- package/dist/webhooks/index.cjs +5 -2
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +5 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EffectiveSubscriptionStatus } from './types-
|
|
1
|
+
import { E as EffectiveSubscriptionStatus } from './types-BeVl-z12.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Inquiry types exposed by the FFID SDK.
|
|
@@ -270,6 +270,52 @@ interface FFIDServiceAccessDecision {
|
|
|
270
270
|
error?: FFIDServiceAccessError;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Billing checkout / portal session types.
|
|
275
|
+
*
|
|
276
|
+
* types/index.ts のサイズ上限対応で切り出し(中身は逐語移設、#3787 Phase A)。
|
|
277
|
+
*/
|
|
278
|
+
/**
|
|
279
|
+
* Checkout session response from billing checkout endpoint
|
|
280
|
+
*/
|
|
281
|
+
interface FFIDCheckoutSessionResponse {
|
|
282
|
+
/** Stripe Checkout session ID */
|
|
283
|
+
sessionId: string;
|
|
284
|
+
/** Stripe Checkout session URL (null if session creation had issues) */
|
|
285
|
+
url: string | null;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Portal session response from billing portal endpoint
|
|
289
|
+
*/
|
|
290
|
+
interface FFIDPortalSessionResponse {
|
|
291
|
+
/** Stripe Billing Portal URL */
|
|
292
|
+
url: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Parameters for creating a checkout session
|
|
296
|
+
*/
|
|
297
|
+
interface FFIDCreateCheckoutParams {
|
|
298
|
+
/** Organization ID (UUID) */
|
|
299
|
+
organizationId: string;
|
|
300
|
+
/** Subscription ID (UUID) */
|
|
301
|
+
subscriptionId: string;
|
|
302
|
+
/** URL to redirect after successful checkout */
|
|
303
|
+
successUrl: string;
|
|
304
|
+
/** URL to redirect after cancelled checkout */
|
|
305
|
+
cancelUrl: string;
|
|
306
|
+
/** Optional plan ID for upgrade or resubscription */
|
|
307
|
+
planId?: string;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Parameters for creating a billing portal session
|
|
311
|
+
*/
|
|
312
|
+
interface FFIDCreatePortalParams {
|
|
313
|
+
/** Organization ID (UUID) */
|
|
314
|
+
organizationId: string;
|
|
315
|
+
/** URL to redirect when user exits the portal */
|
|
316
|
+
returnUrl: string;
|
|
317
|
+
}
|
|
318
|
+
|
|
273
319
|
/** Billing interval for subscriptions */
|
|
274
320
|
type FFIDBillingInterval = 'monthly' | 'yearly';
|
|
275
321
|
/**
|
|
@@ -637,6 +683,122 @@ interface FFIDRemoveMemberResponse {
|
|
|
637
683
|
message: string;
|
|
638
684
|
}
|
|
639
685
|
|
|
686
|
+
/**
|
|
687
|
+
* Contract resource types (#3787 Phase A)
|
|
688
|
+
*
|
|
689
|
+
* シート割り当て・請求書・支払い再試行の ext API 型。
|
|
690
|
+
* サーバー側の sanitize 済みレスポンス(Stripe 内部 ID を含まない)と対になる。
|
|
691
|
+
*/
|
|
692
|
+
/** シート割り当て 1 件(ユーザー情報付き、一覧用) */
|
|
693
|
+
interface FFIDSeatAssignmentWithUser {
|
|
694
|
+
userId: string;
|
|
695
|
+
email: string;
|
|
696
|
+
name: string | null;
|
|
697
|
+
role: string;
|
|
698
|
+
assignedAt: string;
|
|
699
|
+
assignedBy: string | null;
|
|
700
|
+
}
|
|
701
|
+
/** シート割り当てレコード(割り当て直後のレスポンス用) */
|
|
702
|
+
interface FFIDSeatAssignmentRecord {
|
|
703
|
+
id: string;
|
|
704
|
+
subscriptionId: string;
|
|
705
|
+
userId: string;
|
|
706
|
+
assignedBy: string | null;
|
|
707
|
+
assignedAt: string;
|
|
708
|
+
createdAt: string;
|
|
709
|
+
updatedAt: string;
|
|
710
|
+
}
|
|
711
|
+
/** GET /api/v1/subscriptions/ext/{id}/seats/assignments のレスポンス */
|
|
712
|
+
interface FFIDListSeatAssignmentsResponse {
|
|
713
|
+
assignments: FFIDSeatAssignmentWithUser[];
|
|
714
|
+
totalSeats: number;
|
|
715
|
+
assignedSeats: number;
|
|
716
|
+
availableSeats: number;
|
|
717
|
+
}
|
|
718
|
+
/** listSeatAssignments のパラメータ */
|
|
719
|
+
interface FFIDListSeatAssignmentsParams {
|
|
720
|
+
subscriptionId: string;
|
|
721
|
+
}
|
|
722
|
+
/** assignSeats のパラメータ */
|
|
723
|
+
interface FFIDAssignSeatsParams {
|
|
724
|
+
subscriptionId: string;
|
|
725
|
+
userIds: string[];
|
|
726
|
+
}
|
|
727
|
+
/** POST /api/v1/subscriptions/ext/{id}/seats/assignments のレスポンス */
|
|
728
|
+
interface FFIDAssignSeatsResponse {
|
|
729
|
+
message: string;
|
|
730
|
+
assignments: FFIDSeatAssignmentRecord[];
|
|
731
|
+
}
|
|
732
|
+
/** unassignSeat のパラメータ */
|
|
733
|
+
interface FFIDUnassignSeatParams {
|
|
734
|
+
subscriptionId: string;
|
|
735
|
+
userId: string;
|
|
736
|
+
}
|
|
737
|
+
/** DELETE /api/v1/subscriptions/ext/{id}/seats/assignments/{userId} のレスポンス */
|
|
738
|
+
interface FFIDUnassignSeatResponse {
|
|
739
|
+
message: string;
|
|
740
|
+
}
|
|
741
|
+
/** 請求書サマリー(一覧用) */
|
|
742
|
+
interface FFIDInvoiceSummary {
|
|
743
|
+
id: string;
|
|
744
|
+
organizationId: string;
|
|
745
|
+
subscriptionId: string | null;
|
|
746
|
+
invoiceNumber: string;
|
|
747
|
+
description: string | null;
|
|
748
|
+
subtotal: number;
|
|
749
|
+
taxRate: number;
|
|
750
|
+
taxAmount: number;
|
|
751
|
+
totalAmount: number;
|
|
752
|
+
currency: string;
|
|
753
|
+
status: string;
|
|
754
|
+
issuedAt: string | null;
|
|
755
|
+
dueDate: string | null;
|
|
756
|
+
paidAt: string | null;
|
|
757
|
+
pdfUrl: string | null;
|
|
758
|
+
createdAt: string;
|
|
759
|
+
}
|
|
760
|
+
/** 請求書詳細(請求先情報・備考を含む) */
|
|
761
|
+
interface FFIDInvoiceDetail extends FFIDInvoiceSummary {
|
|
762
|
+
billingName: string | null;
|
|
763
|
+
billingEmail: string | null;
|
|
764
|
+
notes: string | null;
|
|
765
|
+
}
|
|
766
|
+
/** listInvoices のパラメータ */
|
|
767
|
+
interface FFIDListInvoicesParams {
|
|
768
|
+
organizationId: string;
|
|
769
|
+
}
|
|
770
|
+
/** GET /api/v1/billing/ext/invoices のレスポンス */
|
|
771
|
+
interface FFIDListInvoicesResponse {
|
|
772
|
+
invoices: FFIDInvoiceSummary[];
|
|
773
|
+
count: number;
|
|
774
|
+
}
|
|
775
|
+
/** getInvoice のパラメータ */
|
|
776
|
+
interface FFIDGetInvoiceParams {
|
|
777
|
+
invoiceId: string;
|
|
778
|
+
}
|
|
779
|
+
/** GET /api/v1/billing/ext/invoices/{id} のレスポンス */
|
|
780
|
+
interface FFIDGetInvoiceResponse {
|
|
781
|
+
invoice: FFIDInvoiceDetail;
|
|
782
|
+
}
|
|
783
|
+
/** retryPayment のパラメータ */
|
|
784
|
+
interface FFIDRetryPaymentParams {
|
|
785
|
+
organizationId: string;
|
|
786
|
+
}
|
|
787
|
+
/** 再試行に失敗した契約の詳細 */
|
|
788
|
+
interface FFIDRetryPaymentFailure {
|
|
789
|
+
subscriptionId: string;
|
|
790
|
+
reason: string;
|
|
791
|
+
stripeCode?: string;
|
|
792
|
+
}
|
|
793
|
+
/** POST /api/v1/billing/ext/retry-payment のレスポンス */
|
|
794
|
+
interface FFIDRetryPaymentSummary {
|
|
795
|
+
totalAttempted: number;
|
|
796
|
+
succeeded: number;
|
|
797
|
+
failed: number;
|
|
798
|
+
noOpenInvoice: number;
|
|
799
|
+
failures: FFIDRetryPaymentFailure[];
|
|
800
|
+
}
|
|
801
|
+
|
|
640
802
|
/**
|
|
641
803
|
* FFID SDK Type Definitions
|
|
642
804
|
*
|
|
@@ -793,6 +955,17 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
793
955
|
interface FFIDOAuthUserInfo {
|
|
794
956
|
sub: string;
|
|
795
957
|
email: string | null;
|
|
958
|
+
/**
|
|
959
|
+
* Whether the user's email is verified on the FFID side (#3791). Use this to
|
|
960
|
+
* safely gate email-based auto account-linking (account-takeover prevention):
|
|
961
|
+
* never auto-link on an unverified email.
|
|
962
|
+
*
|
|
963
|
+
* `undefined` means the FFID server predates the field (older deployment) or
|
|
964
|
+
* the verification path could not populate it — NOT "unverified". Treat
|
|
965
|
+
* `undefined` as "unknown" and fall back to a stricter linking policy rather
|
|
966
|
+
* than coercing it to `false`/`true`.
|
|
967
|
+
*/
|
|
968
|
+
emailVerified?: boolean | undefined;
|
|
796
969
|
name: string | null;
|
|
797
970
|
picture: string | null;
|
|
798
971
|
companyName?: string | null | undefined;
|
|
@@ -962,47 +1135,6 @@ type FFIDApiResponse<T> = {
|
|
|
962
1135
|
error: FFIDError;
|
|
963
1136
|
};
|
|
964
1137
|
|
|
965
|
-
/**
|
|
966
|
-
* Checkout session response from billing checkout endpoint
|
|
967
|
-
*/
|
|
968
|
-
interface FFIDCheckoutSessionResponse {
|
|
969
|
-
/** Stripe Checkout session ID */
|
|
970
|
-
sessionId: string;
|
|
971
|
-
/** Stripe Checkout session URL (null if session creation had issues) */
|
|
972
|
-
url: string | null;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Portal session response from billing portal endpoint
|
|
976
|
-
*/
|
|
977
|
-
interface FFIDPortalSessionResponse {
|
|
978
|
-
/** Stripe Billing Portal URL */
|
|
979
|
-
url: string;
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Parameters for creating a checkout session
|
|
983
|
-
*/
|
|
984
|
-
interface FFIDCreateCheckoutParams {
|
|
985
|
-
/** Organization ID (UUID) */
|
|
986
|
-
organizationId: string;
|
|
987
|
-
/** Subscription ID (UUID) */
|
|
988
|
-
subscriptionId: string;
|
|
989
|
-
/** URL to redirect after successful checkout */
|
|
990
|
-
successUrl: string;
|
|
991
|
-
/** URL to redirect after cancelled checkout */
|
|
992
|
-
cancelUrl: string;
|
|
993
|
-
/** Optional plan ID for upgrade or resubscription */
|
|
994
|
-
planId?: string;
|
|
995
|
-
}
|
|
996
|
-
/**
|
|
997
|
-
* Parameters for creating a billing portal session
|
|
998
|
-
*/
|
|
999
|
-
interface FFIDCreatePortalParams {
|
|
1000
|
-
/** Organization ID (UUID) */
|
|
1001
|
-
organizationId: string;
|
|
1002
|
-
/** URL to redirect when user exits the portal */
|
|
1003
|
-
returnUrl: string;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
1138
|
/**
|
|
1007
1139
|
* User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
|
|
1008
1140
|
*
|
|
@@ -1232,34 +1364,6 @@ interface ContractWizardSubscriptionOptions {
|
|
|
1232
1364
|
organizationId?: string;
|
|
1233
1365
|
}
|
|
1234
1366
|
|
|
1235
|
-
/** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
|
|
1236
|
-
|
|
1237
|
-
/**
|
|
1238
|
-
* `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
|
|
1239
|
-
* Forwards to Supabase Auth signup screen; only the `'signup'` value is
|
|
1240
|
-
* propagated (no-op when `'login'` or omitted).
|
|
1241
|
-
*/
|
|
1242
|
-
declare const SCREEN_HINT_SIGNUP: "signup";
|
|
1243
|
-
/** Options for redirectToAuthorize */
|
|
1244
|
-
interface RedirectToAuthorizeOptions {
|
|
1245
|
-
/** Target organization ID — triggers org-scoped OAuth re-authorization */
|
|
1246
|
-
organizationId?: string;
|
|
1247
|
-
/**
|
|
1248
|
-
* Initial Supabase Auth screen hint (#2908 / #2911).
|
|
1249
|
-
*
|
|
1250
|
-
* - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
|
|
1251
|
-
* on the signup screen (used by external services that want to deep-link
|
|
1252
|
-
* new users into the signup CTA).
|
|
1253
|
-
* - `'login'` / `undefined`: no `screen_hint` param is added — the default
|
|
1254
|
-
* login screen is shown.
|
|
1255
|
-
*
|
|
1256
|
-
* In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
|
|
1257
|
-
* of `/login` so the SDK contract (signup-screen intent) stays consistent
|
|
1258
|
-
* regardless of `authMode`.
|
|
1259
|
-
*/
|
|
1260
|
-
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
1367
|
/**
|
|
1264
1368
|
* Token Store
|
|
1265
1369
|
*
|
|
@@ -1301,6 +1405,53 @@ interface TokenStore {
|
|
|
1301
1405
|
*/
|
|
1302
1406
|
declare function createTokenStore(storageType?: 'localStorage' | 'memory'): TokenStore;
|
|
1303
1407
|
|
|
1408
|
+
/** OAuth token operations - exchangeCodeForTokens / refreshAccessToken / signOutToken */
|
|
1409
|
+
|
|
1410
|
+
/**
|
|
1411
|
+
* Optional OAuth `state` validation for {@link exchangeCodeForTokens}.
|
|
1412
|
+
*
|
|
1413
|
+
* If a `state` is supplied on EITHER side — `expectedState` (the value persisted
|
|
1414
|
+
* at `redirectToAuthorize`) or `actualState` (the value returned on the callback
|
|
1415
|
+
* URL) — both must be present and equal before any token exchange. A mismatch
|
|
1416
|
+
* OR an omitted counterpart fails closed (no exchange) to defend against CSRF
|
|
1417
|
+
* (RFC 6749 §10.12 / #3841). Validation is skipped only when BOTH are omitted
|
|
1418
|
+
* (backward compatible — callers that don't opt in are unaffected).
|
|
1419
|
+
*/
|
|
1420
|
+
interface ExchangeCodeForTokensOptions {
|
|
1421
|
+
/** Stored state from `redirectToAuthorize` (e.g. `retrieveState()`) */
|
|
1422
|
+
expectedState?: string;
|
|
1423
|
+
/** State returned on the OAuth callback URL */
|
|
1424
|
+
actualState?: string;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
/** Redirect and URL generation - redirectToLogin / redirectToAuthorize / redirectToLogout / getLoginUrl / getSignupUrl / getLogoutUrl */
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* `screen_hint=signup` query value for `/oauth/authorize` (#2908 / #2911).
|
|
1431
|
+
* Forwards to Supabase Auth signup screen; only the `'signup'` value is
|
|
1432
|
+
* propagated (no-op when `'login'` or omitted).
|
|
1433
|
+
*/
|
|
1434
|
+
declare const SCREEN_HINT_SIGNUP: "signup";
|
|
1435
|
+
/** Options for redirectToAuthorize */
|
|
1436
|
+
interface RedirectToAuthorizeOptions {
|
|
1437
|
+
/** Target organization ID — triggers org-scoped OAuth re-authorization */
|
|
1438
|
+
organizationId?: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Initial Supabase Auth screen hint (#2908 / #2911).
|
|
1441
|
+
*
|
|
1442
|
+
* - `'signup'`: forwards `?screen_hint=signup` so the FFID OAuth flow lands
|
|
1443
|
+
* on the signup screen (used by external services that want to deep-link
|
|
1444
|
+
* new users into the signup CTA).
|
|
1445
|
+
* - `'login'` / `undefined`: no `screen_hint` param is added — the default
|
|
1446
|
+
* login screen is shown.
|
|
1447
|
+
*
|
|
1448
|
+
* In cookie mode, `'signup'` redirects to the FFID `/signup` page instead
|
|
1449
|
+
* of `/login` so the SDK contract (signup-screen intent) stays consistent
|
|
1450
|
+
* regardless of `authMode`.
|
|
1451
|
+
*/
|
|
1452
|
+
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1304
1455
|
/** Creates an FFID API client instance */
|
|
1305
1456
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
1306
1457
|
getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
|
|
@@ -1312,7 +1463,7 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1312
1463
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1313
1464
|
getSignupUrl: (redirectUrl?: string) => string;
|
|
1314
1465
|
createError: (code: string, message: string) => FFIDError;
|
|
1315
|
-
exchangeCodeForTokens: (code: string, codeVerifier?: string) => Promise<FFIDApiResponse<void>>;
|
|
1466
|
+
exchangeCodeForTokens: (code: string, codeVerifier?: string, opts?: ExchangeCodeForTokensOptions) => Promise<FFIDApiResponse<void>>;
|
|
1316
1467
|
refreshAccessToken: () => Promise<FFIDApiResponse<void>>;
|
|
1317
1468
|
checkSubscription: (params: {
|
|
1318
1469
|
userId?: string;
|
|
@@ -1341,6 +1492,12 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1341
1492
|
getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
|
|
1342
1493
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
1343
1494
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
1495
|
+
listInvoices: (params: FFIDListInvoicesParams) => Promise<FFIDApiResponse<FFIDListInvoicesResponse>>;
|
|
1496
|
+
getInvoice: (params: FFIDGetInvoiceParams) => Promise<FFIDApiResponse<FFIDGetInvoiceResponse>>;
|
|
1497
|
+
retryPayment: (params: FFIDRetryPaymentParams) => Promise<FFIDApiResponse<FFIDRetryPaymentSummary>>;
|
|
1498
|
+
listSeatAssignments: (params: FFIDListSeatAssignmentsParams) => Promise<FFIDApiResponse<FFIDListSeatAssignmentsResponse>>;
|
|
1499
|
+
assignSeats: (params: FFIDAssignSeatsParams) => Promise<FFIDApiResponse<FFIDAssignSeatsResponse>>;
|
|
1500
|
+
unassignSeat: (params: FFIDUnassignSeatParams) => Promise<FFIDApiResponse<FFIDUnassignSeatResponse>>;
|
|
1344
1501
|
listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
|
|
1345
1502
|
getSubscription: (subscriptionId: string) => Promise<FFIDApiResponse<FFIDSubscriptionDetail>>;
|
|
1346
1503
|
subscribe: (params: FFIDSubscribeParams) => Promise<FFIDApiResponse<FFIDSubscribeResponse>>;
|
|
@@ -73,7 +73,16 @@ interface FFIDCacheConfig {
|
|
|
73
73
|
* @see /api/v1/subscriptions/ext/check
|
|
74
74
|
* @see docs/03-implementation/EXPIRED_CONTRACT_HANDLING.md
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
declare const EFFECTIVE_SUBSCRIPTION_STATUSES: readonly ["active", "active_canceling", "past_due_grace", "blocked", "canceled", "trial_expired", "expired"];
|
|
77
|
+
/**
|
|
78
|
+
* Derived from {@link EFFECTIVE_SUBSCRIPTION_STATUSES} so the literal set has
|
|
79
|
+
* a runtime representation. The server mirrors the same const in
|
|
80
|
+
* `src/lib/common/subscription-helpers.ts`, and a server-side unit test pins
|
|
81
|
+
* element-equality between the two arrays (#3474) — convention-only sync
|
|
82
|
+
* could drift silently in the server-extending direction (a new server
|
|
83
|
+
* literal would fall through SDK consumers' `switch` defaults).
|
|
84
|
+
*/
|
|
85
|
+
type EffectiveSubscriptionStatus = (typeof EFFECTIVE_SUBSCRIPTION_STATUSES)[number];
|
|
77
86
|
|
|
78
87
|
/**
|
|
79
88
|
* Canonical service-access types for subscription lifecycle decisions.
|
|
@@ -316,6 +325,17 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
316
325
|
interface FFIDOAuthUserInfo {
|
|
317
326
|
sub: string;
|
|
318
327
|
email: string | null;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the user's email is verified on the FFID side (#3791). Use this to
|
|
330
|
+
* safely gate email-based auto account-linking (account-takeover prevention):
|
|
331
|
+
* never auto-link on an unverified email.
|
|
332
|
+
*
|
|
333
|
+
* `undefined` means the FFID server predates the field (older deployment) or
|
|
334
|
+
* the verification path could not populate it — NOT "unverified". Treat
|
|
335
|
+
* `undefined` as "unknown" and fall back to a stricter linking policy rather
|
|
336
|
+
* than coercing it to `false`/`true`.
|
|
337
|
+
*/
|
|
338
|
+
emailVerified?: boolean | undefined;
|
|
319
339
|
name: string | null;
|
|
320
340
|
picture: string | null;
|
|
321
341
|
companyName?: string | null | undefined;
|
|
@@ -624,47 +644,6 @@ type FFIDApiResponse<T> = {
|
|
|
624
644
|
error: FFIDError;
|
|
625
645
|
};
|
|
626
646
|
|
|
627
|
-
/**
|
|
628
|
-
* Checkout session response from billing checkout endpoint
|
|
629
|
-
*/
|
|
630
|
-
interface FFIDCheckoutSessionResponse {
|
|
631
|
-
/** Stripe Checkout session ID */
|
|
632
|
-
sessionId: string;
|
|
633
|
-
/** Stripe Checkout session URL (null if session creation had issues) */
|
|
634
|
-
url: string | null;
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* Portal session response from billing portal endpoint
|
|
638
|
-
*/
|
|
639
|
-
interface FFIDPortalSessionResponse {
|
|
640
|
-
/** Stripe Billing Portal URL */
|
|
641
|
-
url: string;
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* Parameters for creating a checkout session
|
|
645
|
-
*/
|
|
646
|
-
interface FFIDCreateCheckoutParams {
|
|
647
|
-
/** Organization ID (UUID) */
|
|
648
|
-
organizationId: string;
|
|
649
|
-
/** Subscription ID (UUID) */
|
|
650
|
-
subscriptionId: string;
|
|
651
|
-
/** URL to redirect after successful checkout */
|
|
652
|
-
successUrl: string;
|
|
653
|
-
/** URL to redirect after cancelled checkout */
|
|
654
|
-
cancelUrl: string;
|
|
655
|
-
/** Optional plan ID for upgrade or resubscription */
|
|
656
|
-
planId?: string;
|
|
657
|
-
}
|
|
658
|
-
/**
|
|
659
|
-
* Parameters for creating a billing portal session
|
|
660
|
-
*/
|
|
661
|
-
interface FFIDCreatePortalParams {
|
|
662
|
-
/** Organization ID (UUID) */
|
|
663
|
-
organizationId: string;
|
|
664
|
-
/** URL to redirect when user exits the portal */
|
|
665
|
-
returnUrl: string;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
647
|
/**
|
|
669
648
|
* User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
|
|
670
649
|
*
|
|
@@ -851,6 +830,8 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
851
830
|
active: boolean;
|
|
852
831
|
sub?: string;
|
|
853
832
|
email?: string;
|
|
833
|
+
/** Whether the user's email is verified (#3791). Optional for backward compat with older FFID. */
|
|
834
|
+
email_verified?: boolean;
|
|
854
835
|
name?: string;
|
|
855
836
|
picture?: string | null;
|
|
856
837
|
company_name?: string | null;
|
|
@@ -1578,4 +1559,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1578
1559
|
}
|
|
1579
1560
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1580
1561
|
|
|
1581
|
-
export { type
|
|
1562
|
+
export { type FFIDInquiryFormSubmitResult as $, type AnnouncementListResponse as A, type FFIDAnnouncementsLogger as B, type Announcement as C, type AnnouncementStatus as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementType as G, EFFECTIVE_SUBSCRIPTION_STATUSES as H, FFIDAnnouncementBadge as I, FFIDAnnouncementList as J, type FFIDAnnouncementsError as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsErrorCode as M, type FFIDAnnouncementsServerResponse as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type FFIDInquiryFormCategoryItem as T, type FFIDInquiryFormClassNames as U, type FFIDInquiryFormLegalLayout as V, type FFIDInquiryFormOrganization as W, type FFIDInquiryFormPlaceholderContext as X, type FFIDInquiryFormPrefill as Y, type FFIDInquiryFormProps as Z, type FFIDInquiryFormSubmitData as _, type FFIDConfig as a, type FFIDJwtClaims as a0, FFIDLoginButton as a1, type FFIDOAuthTokenResponse as a2, type FFIDOAuthUserInfoMemberRole as a3, FFIDOrganizationSwitcher as a4, type FFIDRedirectErrorCode as a5, type FFIDSeatModel as a6, type FFIDServiceAccessDenialReason as a7, type FFIDServiceAccessFailPolicy as a8, FFIDSubscriptionBadge as a9, type FFIDTokenIntrospectionResponse as aa, FFIDUserMenu as ab, FFID_INQUIRY_CATEGORIES as ac, FFID_INQUIRY_CATEGORIES_SITE_2026 as ad, type UseFFIDAnnouncementsOptions as ae, type UseFFIDAnnouncementsReturn as af, isFFIDInquiryCategorySite2026 as ag, useFFIDAnnouncements as ah, type FFIDAnnouncementBadgeClassNames as ai, type FFIDAnnouncementBadgeProps as aj, type FFIDAnnouncementListClassNames as ak, type FFIDAnnouncementListProps as al, type FFIDLoginButtonProps as am, type FFIDOrganizationSwitcherClassNames as an, type FFIDOrganizationSwitcherProps as ao, type FFIDSubscriptionBadgeClassNames as ap, type FFIDSubscriptionBadgeProps as aq, type FFIDUserMenuClassNames as ar, type FFIDUserMenuProps as as, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDCheckServiceAccessParams as g, type FFIDServiceAccessDecision as h, type FFIDProfileCallOptions as i, type FFIDUserProfile as j, type FFIDUpdateUserProfileRequest as k, type FFIDAnalyticsConfig as l, type FFIDVerifyAccessTokenOptions as m, type FFIDOAuthUserInfo as n, type FFIDInquiryCreateParams as o, type FFIDInquiryCreateResponse as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDOAuthUserInfoSubscription as x, type FFIDAnnouncementsClientConfig as y, type FFIDAnnouncementsApiResponse as z };
|
|
@@ -73,7 +73,16 @@ interface FFIDCacheConfig {
|
|
|
73
73
|
* @see /api/v1/subscriptions/ext/check
|
|
74
74
|
* @see docs/03-implementation/EXPIRED_CONTRACT_HANDLING.md
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
declare const EFFECTIVE_SUBSCRIPTION_STATUSES: readonly ["active", "active_canceling", "past_due_grace", "blocked", "canceled", "trial_expired", "expired"];
|
|
77
|
+
/**
|
|
78
|
+
* Derived from {@link EFFECTIVE_SUBSCRIPTION_STATUSES} so the literal set has
|
|
79
|
+
* a runtime representation. The server mirrors the same const in
|
|
80
|
+
* `src/lib/common/subscription-helpers.ts`, and a server-side unit test pins
|
|
81
|
+
* element-equality between the two arrays (#3474) — convention-only sync
|
|
82
|
+
* could drift silently in the server-extending direction (a new server
|
|
83
|
+
* literal would fall through SDK consumers' `switch` defaults).
|
|
84
|
+
*/
|
|
85
|
+
type EffectiveSubscriptionStatus = (typeof EFFECTIVE_SUBSCRIPTION_STATUSES)[number];
|
|
77
86
|
|
|
78
87
|
/**
|
|
79
88
|
* Canonical service-access types for subscription lifecycle decisions.
|
|
@@ -316,6 +325,17 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
316
325
|
interface FFIDOAuthUserInfo {
|
|
317
326
|
sub: string;
|
|
318
327
|
email: string | null;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the user's email is verified on the FFID side (#3791). Use this to
|
|
330
|
+
* safely gate email-based auto account-linking (account-takeover prevention):
|
|
331
|
+
* never auto-link on an unverified email.
|
|
332
|
+
*
|
|
333
|
+
* `undefined` means the FFID server predates the field (older deployment) or
|
|
334
|
+
* the verification path could not populate it — NOT "unverified". Treat
|
|
335
|
+
* `undefined` as "unknown" and fall back to a stricter linking policy rather
|
|
336
|
+
* than coercing it to `false`/`true`.
|
|
337
|
+
*/
|
|
338
|
+
emailVerified?: boolean | undefined;
|
|
319
339
|
name: string | null;
|
|
320
340
|
picture: string | null;
|
|
321
341
|
companyName?: string | null | undefined;
|
|
@@ -624,47 +644,6 @@ type FFIDApiResponse<T> = {
|
|
|
624
644
|
error: FFIDError;
|
|
625
645
|
};
|
|
626
646
|
|
|
627
|
-
/**
|
|
628
|
-
* Checkout session response from billing checkout endpoint
|
|
629
|
-
*/
|
|
630
|
-
interface FFIDCheckoutSessionResponse {
|
|
631
|
-
/** Stripe Checkout session ID */
|
|
632
|
-
sessionId: string;
|
|
633
|
-
/** Stripe Checkout session URL (null if session creation had issues) */
|
|
634
|
-
url: string | null;
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* Portal session response from billing portal endpoint
|
|
638
|
-
*/
|
|
639
|
-
interface FFIDPortalSessionResponse {
|
|
640
|
-
/** Stripe Billing Portal URL */
|
|
641
|
-
url: string;
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* Parameters for creating a checkout session
|
|
645
|
-
*/
|
|
646
|
-
interface FFIDCreateCheckoutParams {
|
|
647
|
-
/** Organization ID (UUID) */
|
|
648
|
-
organizationId: string;
|
|
649
|
-
/** Subscription ID (UUID) */
|
|
650
|
-
subscriptionId: string;
|
|
651
|
-
/** URL to redirect after successful checkout */
|
|
652
|
-
successUrl: string;
|
|
653
|
-
/** URL to redirect after cancelled checkout */
|
|
654
|
-
cancelUrl: string;
|
|
655
|
-
/** Optional plan ID for upgrade or resubscription */
|
|
656
|
-
planId?: string;
|
|
657
|
-
}
|
|
658
|
-
/**
|
|
659
|
-
* Parameters for creating a billing portal session
|
|
660
|
-
*/
|
|
661
|
-
interface FFIDCreatePortalParams {
|
|
662
|
-
/** Organization ID (UUID) */
|
|
663
|
-
organizationId: string;
|
|
664
|
-
/** URL to redirect when user exits the portal */
|
|
665
|
-
returnUrl: string;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
647
|
/**
|
|
669
648
|
* User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
|
|
670
649
|
*
|
|
@@ -851,6 +830,8 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
851
830
|
active: boolean;
|
|
852
831
|
sub?: string;
|
|
853
832
|
email?: string;
|
|
833
|
+
/** Whether the user's email is verified (#3791). Optional for backward compat with older FFID. */
|
|
834
|
+
email_verified?: boolean;
|
|
854
835
|
name?: string;
|
|
855
836
|
picture?: string | null;
|
|
856
837
|
company_name?: string | null;
|
|
@@ -1578,4 +1559,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1578
1559
|
}
|
|
1579
1560
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1580
1561
|
|
|
1581
|
-
export { type
|
|
1562
|
+
export { type FFIDInquiryFormSubmitResult as $, type AnnouncementListResponse as A, type FFIDAnnouncementsLogger as B, type Announcement as C, type AnnouncementStatus as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementType as G, EFFECTIVE_SUBSCRIPTION_STATUSES as H, FFIDAnnouncementBadge as I, FFIDAnnouncementList as J, type FFIDAnnouncementsError as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementsErrorCode as M, type FFIDAnnouncementsServerResponse as N, type FFIDCacheConfig as O, type FFIDContextValue as P, type FFIDInquiryCategory as Q, type FFIDInquiryCategorySite2026 as R, FFIDInquiryForm as S, type FFIDInquiryFormCategoryItem as T, type FFIDInquiryFormClassNames as U, type FFIDInquiryFormLegalLayout as V, type FFIDInquiryFormOrganization as W, type FFIDInquiryFormPlaceholderContext as X, type FFIDInquiryFormPrefill as Y, type FFIDInquiryFormProps as Z, type FFIDInquiryFormSubmitData as _, type FFIDConfig as a, type FFIDJwtClaims as a0, FFIDLoginButton as a1, type FFIDOAuthTokenResponse as a2, type FFIDOAuthUserInfoMemberRole as a3, FFIDOrganizationSwitcher as a4, type FFIDRedirectErrorCode as a5, type FFIDSeatModel as a6, type FFIDServiceAccessDenialReason as a7, type FFIDServiceAccessFailPolicy as a8, FFIDSubscriptionBadge as a9, type FFIDTokenIntrospectionResponse as aa, FFIDUserMenu as ab, FFID_INQUIRY_CATEGORIES as ac, FFID_INQUIRY_CATEGORIES_SITE_2026 as ad, type UseFFIDAnnouncementsOptions as ae, type UseFFIDAnnouncementsReturn as af, isFFIDInquiryCategorySite2026 as ag, useFFIDAnnouncements as ah, type FFIDAnnouncementBadgeClassNames as ai, type FFIDAnnouncementBadgeProps as aj, type FFIDAnnouncementListClassNames as ak, type FFIDAnnouncementListProps as al, type FFIDLoginButtonProps as am, type FFIDOrganizationSwitcherClassNames as an, type FFIDOrganizationSwitcherProps as ao, type FFIDSubscriptionBadgeClassNames as ap, type FFIDSubscriptionBadgeProps as aq, type FFIDUserMenuClassNames as ar, type FFIDUserMenuProps as as, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDCheckServiceAccessParams as g, type FFIDServiceAccessDecision as h, type FFIDProfileCallOptions as i, type FFIDUserProfile as j, type FFIDUpdateUserProfileRequest as k, type FFIDAnalyticsConfig as l, type FFIDVerifyAccessTokenOptions as m, type FFIDOAuthUserInfo as n, type FFIDInquiryCreateParams as o, type FFIDInquiryCreateResponse as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDOAuthUserInfoSubscription as x, type FFIDAnnouncementsClientConfig as y, type FFIDAnnouncementsApiResponse as z };
|