@feelflow/ffid-sdk 5.9.0 → 5.12.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.
Files changed (33) hide show
  1. package/dist/{FFIDCookieLink-CE01gYc4.d.cts → FFIDCookieLink-D1WwE_ZO.d.cts} +5 -0
  2. package/dist/{FFIDCookieLink-CE01gYc4.d.ts → FFIDCookieLink-D1WwE_ZO.d.ts} +5 -0
  3. package/dist/{chunk-A6MOPB7D.cjs → chunk-AOJDV3UO.cjs} +88 -3
  4. package/dist/{chunk-KENJXMSG.js → chunk-KB2JG64Z.js} +88 -4
  5. package/dist/{chunk-KJ7FUNA6.js → chunk-M4N2PUX6.js} +64 -32
  6. package/dist/{chunk-Q5SZVLNB.cjs → chunk-R5WSZMUL.cjs} +64 -32
  7. package/dist/components/index.cjs +8 -8
  8. package/dist/components/index.d.cts +1 -1
  9. package/dist/components/index.d.ts +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/consent/index.cjs +64 -64
  12. package/dist/consent/index.d.cts +2 -2
  13. package/dist/consent/index.d.ts +2 -2
  14. package/dist/consent/index.js +1 -1
  15. package/dist/{ffid-client-gboJROw0.d.ts → ffid-client-5IprSUVR.d.ts} +169 -42
  16. package/dist/{ffid-client-DRjzfAaS.d.cts → ffid-client-Dx4oc4Cw.d.cts} +169 -42
  17. package/dist/{index-DSvX4q8E.d.cts → index-DqsWKU16.d.cts} +11 -43
  18. package/dist/{index-DSvX4q8E.d.ts → index-DqsWKU16.d.ts} +11 -43
  19. package/dist/index.cjs +61 -57
  20. package/dist/index.d.cts +172 -4
  21. package/dist/index.d.ts +172 -4
  22. package/dist/index.js +3 -3
  23. package/dist/server/index.cjs +78 -3
  24. package/dist/server/index.d.cts +3 -3
  25. package/dist/server/index.d.ts +3 -3
  26. package/dist/server/index.js +78 -3
  27. package/dist/server/test/index.d.cts +2 -2
  28. package/dist/server/test/index.d.ts +2 -2
  29. package/dist/{types-BYdtyO_2.d.cts → types-BeVl-z12.d.cts} +10 -1
  30. package/dist/{types-BYdtyO_2.d.ts → types-BeVl-z12.d.ts} +10 -1
  31. package/dist/webhooks/index.d.cts +1 -1
  32. package/dist/webhooks/index.d.ts +1 -1
  33. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { E as EffectiveSubscriptionStatus } from './types-BYdtyO_2.js';
1
+ import { E as EffectiveSubscriptionStatus } from './types-BeVl-z12.js';
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
  *
@@ -962,47 +1124,6 @@ type FFIDApiResponse<T> = {
962
1124
  error: FFIDError;
963
1125
  };
964
1126
 
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
1127
  /**
1007
1128
  * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
1008
1129
  *
@@ -1341,6 +1462,12 @@ declare function createFFIDClient(config: FFIDConfig): {
1341
1462
  getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
1342
1463
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
1343
1464
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
1465
+ listInvoices: (params: FFIDListInvoicesParams) => Promise<FFIDApiResponse<FFIDListInvoicesResponse>>;
1466
+ getInvoice: (params: FFIDGetInvoiceParams) => Promise<FFIDApiResponse<FFIDGetInvoiceResponse>>;
1467
+ retryPayment: (params: FFIDRetryPaymentParams) => Promise<FFIDApiResponse<FFIDRetryPaymentSummary>>;
1468
+ listSeatAssignments: (params: FFIDListSeatAssignmentsParams) => Promise<FFIDApiResponse<FFIDListSeatAssignmentsResponse>>;
1469
+ assignSeats: (params: FFIDAssignSeatsParams) => Promise<FFIDApiResponse<FFIDAssignSeatsResponse>>;
1470
+ unassignSeat: (params: FFIDUnassignSeatParams) => Promise<FFIDApiResponse<FFIDUnassignSeatResponse>>;
1344
1471
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
1345
1472
  getSubscription: (subscriptionId: string) => Promise<FFIDApiResponse<FFIDSubscriptionDetail>>;
1346
1473
  subscribe: (params: FFIDSubscribeParams) => Promise<FFIDApiResponse<FFIDSubscribeResponse>>;
@@ -1,4 +1,4 @@
1
- import { E as EffectiveSubscriptionStatus } from './types-BYdtyO_2.cjs';
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
  *
@@ -962,47 +1124,6 @@ type FFIDApiResponse<T> = {
962
1124
  error: FFIDError;
963
1125
  };
964
1126
 
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
1127
  /**
1007
1128
  * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
1008
1129
  *
@@ -1341,6 +1462,12 @@ declare function createFFIDClient(config: FFIDConfig): {
1341
1462
  getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
1342
1463
  createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
1343
1464
  createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
1465
+ listInvoices: (params: FFIDListInvoicesParams) => Promise<FFIDApiResponse<FFIDListInvoicesResponse>>;
1466
+ getInvoice: (params: FFIDGetInvoiceParams) => Promise<FFIDApiResponse<FFIDGetInvoiceResponse>>;
1467
+ retryPayment: (params: FFIDRetryPaymentParams) => Promise<FFIDApiResponse<FFIDRetryPaymentSummary>>;
1468
+ listSeatAssignments: (params: FFIDListSeatAssignmentsParams) => Promise<FFIDApiResponse<FFIDListSeatAssignmentsResponse>>;
1469
+ assignSeats: (params: FFIDAssignSeatsParams) => Promise<FFIDApiResponse<FFIDAssignSeatsResponse>>;
1470
+ unassignSeat: (params: FFIDUnassignSeatParams) => Promise<FFIDApiResponse<FFIDUnassignSeatResponse>>;
1344
1471
  listPlans: () => Promise<FFIDApiResponse<FFIDListPlansResponse>>;
1345
1472
  getSubscription: (subscriptionId: string) => Promise<FFIDApiResponse<FFIDSubscriptionDetail>>;
1346
1473
  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
- type EffectiveSubscriptionStatus = 'active' | 'active_canceling' | 'past_due_grace' | 'blocked' | 'canceled' | 'trial_expired' | 'expired';
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.
@@ -624,47 +633,6 @@ type FFIDApiResponse<T> = {
624
633
  error: FFIDError;
625
634
  };
626
635
 
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
636
  /**
669
637
  * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
670
638
  *
@@ -1578,4 +1546,4 @@ interface FFIDInquiryFormPlaceholderContext {
1578
1546
  }
1579
1547
  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
1548
 
1581
- export { type FFIDInquiryFormPrefill as $, type FFIDSubscriptionContextValue as A, type FFIDOAuthUserInfoSubscription as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementListResponse as G, type FFIDAnnouncementsLogger as H, type Announcement as I, type AnnouncementStatus as J, type AnnouncementType as K, type ListAnnouncementsOptions as L, FFIDAnnouncementBadge as M, FFIDAnnouncementList as N, type FFIDAnnouncementsError as O, type FFIDAnnouncementsErrorCode as P, type FFIDAnnouncementsServerResponse as Q, type FFIDCacheConfig as R, type FFIDContextValue as S, type FFIDInquiryCategory as T, type FFIDInquiryCategorySite2026 as U, FFIDInquiryForm as V, type FFIDInquiryFormCategoryItem as W, type FFIDInquiryFormClassNames as X, type FFIDInquiryFormLegalLayout as Y, type FFIDInquiryFormOrganization as Z, type FFIDInquiryFormPlaceholderContext as _, type FFIDConfig as a, type FFIDInquiryFormProps as a0, type FFIDInquiryFormSubmitData as a1, type FFIDInquiryFormSubmitResult as a2, type FFIDJwtClaims as a3, FFIDLoginButton as a4, type FFIDOAuthTokenResponse as a5, type FFIDOAuthUserInfoMemberRole as a6, FFIDOrganizationSwitcher as a7, type FFIDRedirectErrorCode as a8, type FFIDSeatModel as a9, type FFIDServiceAccessDenialReason as aa, type FFIDServiceAccessFailPolicy as ab, FFIDSubscriptionBadge as ac, type FFIDTokenIntrospectionResponse as ad, FFIDUserMenu as ae, FFID_INQUIRY_CATEGORIES as af, FFID_INQUIRY_CATEGORIES_SITE_2026 as ag, type UseFFIDAnnouncementsOptions as ah, type UseFFIDAnnouncementsReturn as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, 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 FFIDCreateCheckoutParams as m, type FFIDCheckoutSessionResponse as n, type FFIDCreatePortalParams as o, type FFIDPortalSessionResponse as p, type FFIDVerifyAccessTokenOptions as q, type FFIDOAuthUserInfo as r, type FFIDInquiryCreateParams as s, type FFIDInquiryCreateResponse as t, type FFIDAuthMode as u, type FFIDLogger as v, type FFIDCacheAdapter as w, type FFIDUser as x, type FFIDOrganization as y, type FFIDSubscription as z };
1549
+ 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
- type EffectiveSubscriptionStatus = 'active' | 'active_canceling' | 'past_due_grace' | 'blocked' | 'canceled' | 'trial_expired' | 'expired';
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.
@@ -624,47 +633,6 @@ type FFIDApiResponse<T> = {
624
633
  error: FFIDError;
625
634
  };
626
635
 
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
636
  /**
669
637
  * User profile for the authenticated user (returned by `getProfile` / `updateProfile`).
670
638
  *
@@ -1578,4 +1546,4 @@ interface FFIDInquiryFormPlaceholderContext {
1578
1546
  }
1579
1547
  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
1548
 
1581
- export { type FFIDInquiryFormPrefill as $, type FFIDSubscriptionContextValue as A, type FFIDOAuthUserInfoSubscription as B, type FFIDAnnouncementsClientConfig as C, type FFIDAnnouncementsApiResponse as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, type AnnouncementListResponse as G, type FFIDAnnouncementsLogger as H, type Announcement as I, type AnnouncementStatus as J, type AnnouncementType as K, type ListAnnouncementsOptions as L, FFIDAnnouncementBadge as M, FFIDAnnouncementList as N, type FFIDAnnouncementsError as O, type FFIDAnnouncementsErrorCode as P, type FFIDAnnouncementsServerResponse as Q, type FFIDCacheConfig as R, type FFIDContextValue as S, type FFIDInquiryCategory as T, type FFIDInquiryCategorySite2026 as U, FFIDInquiryForm as V, type FFIDInquiryFormCategoryItem as W, type FFIDInquiryFormClassNames as X, type FFIDInquiryFormLegalLayout as Y, type FFIDInquiryFormOrganization as Z, type FFIDInquiryFormPlaceholderContext as _, type FFIDConfig as a, type FFIDInquiryFormProps as a0, type FFIDInquiryFormSubmitData as a1, type FFIDInquiryFormSubmitResult as a2, type FFIDJwtClaims as a3, FFIDLoginButton as a4, type FFIDOAuthTokenResponse as a5, type FFIDOAuthUserInfoMemberRole as a6, FFIDOrganizationSwitcher as a7, type FFIDRedirectErrorCode as a8, type FFIDSeatModel as a9, type FFIDServiceAccessDenialReason as aa, type FFIDServiceAccessFailPolicy as ab, FFIDSubscriptionBadge as ac, type FFIDTokenIntrospectionResponse as ad, FFIDUserMenu as ae, FFID_INQUIRY_CATEGORIES as af, FFID_INQUIRY_CATEGORIES_SITE_2026 as ag, type UseFFIDAnnouncementsOptions as ah, type UseFFIDAnnouncementsReturn as ai, isFFIDInquiryCategorySite2026 as aj, useFFIDAnnouncements as ak, type FFIDAnnouncementBadgeClassNames as al, type FFIDAnnouncementBadgeProps as am, type FFIDAnnouncementListClassNames as an, type FFIDAnnouncementListProps as ao, type FFIDLoginButtonProps as ap, type FFIDOrganizationSwitcherClassNames as aq, type FFIDOrganizationSwitcherProps as ar, type FFIDSubscriptionBadgeClassNames as as, type FFIDSubscriptionBadgeProps as at, type FFIDUserMenuClassNames as au, type FFIDUserMenuProps as av, 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 FFIDCreateCheckoutParams as m, type FFIDCheckoutSessionResponse as n, type FFIDCreatePortalParams as o, type FFIDPortalSessionResponse as p, type FFIDVerifyAccessTokenOptions as q, type FFIDOAuthUserInfo as r, type FFIDInquiryCreateParams as s, type FFIDInquiryCreateResponse as t, type FFIDAuthMode as u, type FFIDLogger as v, type FFIDCacheAdapter as w, type FFIDUser as x, type FFIDOrganization as y, type FFIDSubscription as z };
1549
+ 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 };