@feelflow/ffid-sdk 1.18.0 → 1.19.1

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.
@@ -445,6 +445,106 @@ function createBillingMethods(deps) {
445
445
  return { createCheckoutSession, createPortalSession };
446
446
  }
447
447
 
448
+ // src/client/subscription-methods.ts
449
+ var EXT_PLANS_ENDPOINT = "/api/v1/subscriptions/ext/plans";
450
+ var EXT_SUBSCRIPTION_ENDPOINT = "/api/v1/subscriptions/ext";
451
+ var EXT_SUBSCRIBE_ENDPOINT = "/api/v1/subscriptions/ext/subscribe";
452
+ function createSubscriptionMethods(deps) {
453
+ const { fetchWithAuth, createError } = deps;
454
+ async function listPlans() {
455
+ return fetchWithAuth(EXT_PLANS_ENDPOINT);
456
+ }
457
+ async function getSubscription(subscriptionId) {
458
+ if (!subscriptionId) {
459
+ return {
460
+ error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
461
+ };
462
+ }
463
+ return fetchWithAuth(
464
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(subscriptionId)}`
465
+ );
466
+ }
467
+ async function subscribe(params) {
468
+ if (!params.organizationId || !params.planCode) {
469
+ return {
470
+ error: createError("VALIDATION_ERROR", "organizationId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
471
+ };
472
+ }
473
+ return fetchWithAuth(
474
+ EXT_SUBSCRIBE_ENDPOINT,
475
+ {
476
+ method: "POST",
477
+ body: JSON.stringify({
478
+ organizationId: params.organizationId,
479
+ planCode: params.planCode,
480
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {},
481
+ ...params.quantity !== void 0 ? { quantity: params.quantity } : {},
482
+ ...params.userId ? { userId: params.userId } : {}
483
+ })
484
+ }
485
+ );
486
+ }
487
+ async function changePlan(params) {
488
+ if (!params.subscriptionId || !params.planCode) {
489
+ return {
490
+ error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
491
+ };
492
+ }
493
+ return fetchWithAuth(
494
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan`,
495
+ {
496
+ method: "PUT",
497
+ body: JSON.stringify({
498
+ planCode: params.planCode,
499
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {}
500
+ })
501
+ }
502
+ );
503
+ }
504
+ async function cancelSubscription(params) {
505
+ if (!params.subscriptionId) {
506
+ return {
507
+ error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
508
+ };
509
+ }
510
+ const body = {};
511
+ if (params.reason) body.reason = params.reason;
512
+ if (params.reasonDetails) body.reasonDetails = params.reasonDetails;
513
+ return fetchWithAuth(
514
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}`,
515
+ {
516
+ method: "DELETE",
517
+ ...Object.keys(body).length > 0 ? { body: JSON.stringify(body) } : {}
518
+ }
519
+ );
520
+ }
521
+ async function previewPlanChange(params) {
522
+ if (!params.subscriptionId || !params.planCode) {
523
+ return {
524
+ error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
525
+ };
526
+ }
527
+ return fetchWithAuth(
528
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan/preview`,
529
+ {
530
+ method: "POST",
531
+ body: JSON.stringify({
532
+ planCode: params.planCode,
533
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {}
534
+ })
535
+ }
536
+ );
537
+ }
538
+ return {
539
+ listPlans,
540
+ getSubscription,
541
+ subscribe,
542
+ changePlan,
543
+ cancelSubscription,
544
+ previewPlanChange
545
+ };
546
+ }
547
+
448
548
  // src/client/members-methods.ts
449
549
  var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
450
550
  function createMembersMethods(deps) {
@@ -498,7 +598,7 @@ function createMembersMethods(deps) {
498
598
  }
499
599
 
500
600
  // src/client/version-check.ts
501
- var SDK_VERSION = "1.18.0";
601
+ var SDK_VERSION = "1.19.1";
502
602
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
503
603
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
504
604
  function sdkHeaders() {
@@ -1553,16 +1653,23 @@ function createFFIDClient(config) {
1553
1653
  logger
1554
1654
  });
1555
1655
  async function checkSubscription(params) {
1556
- if (!params.userId || !params.organizationId) {
1656
+ if (!params.organizationId) {
1657
+ return {
1658
+ error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
1659
+ };
1660
+ }
1661
+ if (params.userId !== void 0 && !params.userId.trim()) {
1557
1662
  return {
1558
- error: createError("VALIDATION_ERROR", "userId \u3068 organizationId \u306F\u5FC5\u9808\u3067\u3059")
1663
+ error: createError("VALIDATION_ERROR", "userId \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093")
1559
1664
  };
1560
1665
  }
1561
1666
  const query = new URLSearchParams({
1562
- userId: params.userId,
1563
1667
  organizationId: params.organizationId,
1564
1668
  serviceCode: config.serviceCode
1565
1669
  });
1670
+ if (params.userId) {
1671
+ query.set("userId", params.userId);
1672
+ }
1566
1673
  return fetchWithAuth(
1567
1674
  `${EXT_CHECK_ENDPOINT}?${query.toString()}`
1568
1675
  );
@@ -1571,6 +1678,17 @@ function createFFIDClient(config) {
1571
1678
  fetchWithAuth,
1572
1679
  createError
1573
1680
  });
1681
+ const {
1682
+ listPlans,
1683
+ getSubscription,
1684
+ subscribe,
1685
+ changePlan,
1686
+ cancelSubscription,
1687
+ previewPlanChange
1688
+ } = createSubscriptionMethods({
1689
+ fetchWithAuth,
1690
+ createError
1691
+ });
1574
1692
  const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
1575
1693
  fetchWithAuth,
1576
1694
  createError,
@@ -1624,6 +1742,12 @@ function createFFIDClient(config) {
1624
1742
  removeMember,
1625
1743
  createCheckoutSession,
1626
1744
  createPortalSession,
1745
+ listPlans,
1746
+ getSubscription,
1747
+ subscribe,
1748
+ changePlan,
1749
+ cancelSubscription,
1750
+ previewPlanChange,
1627
1751
  verifyAccessToken,
1628
1752
  requestPasswordReset,
1629
1753
  verifyPasswordResetToken,
@@ -447,6 +447,106 @@ function createBillingMethods(deps) {
447
447
  return { createCheckoutSession, createPortalSession };
448
448
  }
449
449
 
450
+ // src/client/subscription-methods.ts
451
+ var EXT_PLANS_ENDPOINT = "/api/v1/subscriptions/ext/plans";
452
+ var EXT_SUBSCRIPTION_ENDPOINT = "/api/v1/subscriptions/ext";
453
+ var EXT_SUBSCRIBE_ENDPOINT = "/api/v1/subscriptions/ext/subscribe";
454
+ function createSubscriptionMethods(deps) {
455
+ const { fetchWithAuth, createError } = deps;
456
+ async function listPlans() {
457
+ return fetchWithAuth(EXT_PLANS_ENDPOINT);
458
+ }
459
+ async function getSubscription(subscriptionId) {
460
+ if (!subscriptionId) {
461
+ return {
462
+ error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
463
+ };
464
+ }
465
+ return fetchWithAuth(
466
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(subscriptionId)}`
467
+ );
468
+ }
469
+ async function subscribe(params) {
470
+ if (!params.organizationId || !params.planCode) {
471
+ return {
472
+ error: createError("VALIDATION_ERROR", "organizationId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
473
+ };
474
+ }
475
+ return fetchWithAuth(
476
+ EXT_SUBSCRIBE_ENDPOINT,
477
+ {
478
+ method: "POST",
479
+ body: JSON.stringify({
480
+ organizationId: params.organizationId,
481
+ planCode: params.planCode,
482
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {},
483
+ ...params.quantity !== void 0 ? { quantity: params.quantity } : {},
484
+ ...params.userId ? { userId: params.userId } : {}
485
+ })
486
+ }
487
+ );
488
+ }
489
+ async function changePlan(params) {
490
+ if (!params.subscriptionId || !params.planCode) {
491
+ return {
492
+ error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
493
+ };
494
+ }
495
+ return fetchWithAuth(
496
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan`,
497
+ {
498
+ method: "PUT",
499
+ body: JSON.stringify({
500
+ planCode: params.planCode,
501
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {}
502
+ })
503
+ }
504
+ );
505
+ }
506
+ async function cancelSubscription(params) {
507
+ if (!params.subscriptionId) {
508
+ return {
509
+ error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
510
+ };
511
+ }
512
+ const body = {};
513
+ if (params.reason) body.reason = params.reason;
514
+ if (params.reasonDetails) body.reasonDetails = params.reasonDetails;
515
+ return fetchWithAuth(
516
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}`,
517
+ {
518
+ method: "DELETE",
519
+ ...Object.keys(body).length > 0 ? { body: JSON.stringify(body) } : {}
520
+ }
521
+ );
522
+ }
523
+ async function previewPlanChange(params) {
524
+ if (!params.subscriptionId || !params.planCode) {
525
+ return {
526
+ error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
527
+ };
528
+ }
529
+ return fetchWithAuth(
530
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan/preview`,
531
+ {
532
+ method: "POST",
533
+ body: JSON.stringify({
534
+ planCode: params.planCode,
535
+ ...params.billingInterval ? { billingInterval: params.billingInterval } : {}
536
+ })
537
+ }
538
+ );
539
+ }
540
+ return {
541
+ listPlans,
542
+ getSubscription,
543
+ subscribe,
544
+ changePlan,
545
+ cancelSubscription,
546
+ previewPlanChange
547
+ };
548
+ }
549
+
450
550
  // src/client/members-methods.ts
451
551
  var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
452
552
  function createMembersMethods(deps) {
@@ -500,7 +600,7 @@ function createMembersMethods(deps) {
500
600
  }
501
601
 
502
602
  // src/client/version-check.ts
503
- var SDK_VERSION = "1.18.0";
603
+ var SDK_VERSION = "1.19.1";
504
604
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
505
605
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
506
606
  function sdkHeaders() {
@@ -1555,16 +1655,23 @@ function createFFIDClient(config) {
1555
1655
  logger
1556
1656
  });
1557
1657
  async function checkSubscription(params) {
1558
- if (!params.userId || !params.organizationId) {
1658
+ if (!params.organizationId) {
1659
+ return {
1660
+ error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
1661
+ };
1662
+ }
1663
+ if (params.userId !== void 0 && !params.userId.trim()) {
1559
1664
  return {
1560
- error: createError("VALIDATION_ERROR", "userId \u3068 organizationId \u306F\u5FC5\u9808\u3067\u3059")
1665
+ error: createError("VALIDATION_ERROR", "userId \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093")
1561
1666
  };
1562
1667
  }
1563
1668
  const query = new URLSearchParams({
1564
- userId: params.userId,
1565
1669
  organizationId: params.organizationId,
1566
1670
  serviceCode: config.serviceCode
1567
1671
  });
1672
+ if (params.userId) {
1673
+ query.set("userId", params.userId);
1674
+ }
1568
1675
  return fetchWithAuth(
1569
1676
  `${EXT_CHECK_ENDPOINT}?${query.toString()}`
1570
1677
  );
@@ -1573,6 +1680,17 @@ function createFFIDClient(config) {
1573
1680
  fetchWithAuth,
1574
1681
  createError
1575
1682
  });
1683
+ const {
1684
+ listPlans,
1685
+ getSubscription,
1686
+ subscribe,
1687
+ changePlan,
1688
+ cancelSubscription,
1689
+ previewPlanChange
1690
+ } = createSubscriptionMethods({
1691
+ fetchWithAuth,
1692
+ createError
1693
+ });
1576
1694
  const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
1577
1695
  fetchWithAuth,
1578
1696
  createError,
@@ -1626,6 +1744,12 @@ function createFFIDClient(config) {
1626
1744
  removeMember,
1627
1745
  createCheckoutSession,
1628
1746
  createPortalSession,
1747
+ listPlans,
1748
+ getSubscription,
1749
+ subscribe,
1750
+ changePlan,
1751
+ cancelSubscription,
1752
+ previewPlanChange,
1629
1753
  verifyAccessToken,
1630
1754
  requestPasswordReset,
1631
1755
  verifyPasswordResetToken,
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkTHHBQAFX_cjs = require('../chunk-THHBQAFX.cjs');
3
+ var chunkJT7IIDMS_cjs = require('../chunk-JT7IIDMS.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunkJT7IIDMS_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunkJT7IIDMS_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDLoginButton", {
16
16
  enumerable: true,
17
- get: function () { return chunkTHHBQAFX_cjs.FFIDLoginButton; }
17
+ get: function () { return chunkJT7IIDMS_cjs.FFIDLoginButton; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
20
20
  enumerable: true,
21
- get: function () { return chunkTHHBQAFX_cjs.FFIDOrganizationSwitcher; }
21
+ get: function () { return chunkJT7IIDMS_cjs.FFIDOrganizationSwitcher; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
24
24
  enumerable: true,
25
- get: function () { return chunkTHHBQAFX_cjs.FFIDSubscriptionBadge; }
25
+ get: function () { return chunkJT7IIDMS_cjs.FFIDSubscriptionBadge; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDUserMenu", {
28
28
  enumerable: true,
29
- get: function () { return chunkTHHBQAFX_cjs.FFIDUserMenu; }
29
+ get: function () { return chunkJT7IIDMS_cjs.FFIDUserMenu; }
30
30
  });
@@ -1,3 +1,3 @@
1
- export { D as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, E as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, N as FFIDLoginButton, a4 as FFIDLoginButtonProps, T as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, V as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-BHh-uxYS.cjs';
1
+ export { E as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, G as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, O as FFIDLoginButton, a4 as FFIDLoginButtonProps, U as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, W as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-p4dJw3qR.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { D as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, E as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, N as FFIDLoginButton, a4 as FFIDLoginButtonProps, T as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, V as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-BHh-uxYS.js';
1
+ export { E as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, G as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, O as FFIDLoginButton, a4 as FFIDLoginButtonProps, U as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, W as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-p4dJw3qR.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-ZJIZTYXQ.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-66HJMEHY.js';
@@ -104,7 +104,7 @@ interface FFIDSubscription {
104
104
  /** Plan display name */
105
105
  planName: string;
106
106
  /** Subscription status */
107
- status: 'trialing' | 'active' | 'past_due' | 'canceled' | 'paused';
107
+ status: FFIDSubscriptionStatus;
108
108
  /** Current billing period end date */
109
109
  currentPeriodEnd: string | null;
110
110
  /** Trial end date (null if not a trial or no trial_end set) */
@@ -119,7 +119,7 @@ interface FFIDSubscription {
119
119
  /** OAuth userinfo subscription summary */
120
120
  interface FFIDOAuthUserInfoSubscription {
121
121
  subscriptionId: string | null;
122
- status: 'trialing' | 'active' | 'past_due' | 'canceled' | 'paused' | null;
122
+ status: FFIDSubscriptionStatus | null;
123
123
  planCode: string | null;
124
124
  seatModel: FFIDSeatModel | null;
125
125
  memberRole: FFIDOAuthUserInfoMemberRole | null;
@@ -337,9 +337,6 @@ type FFIDApiResponse<T> = {
337
337
  data?: undefined;
338
338
  error: FFIDError;
339
339
  };
340
- /**
341
- * Subscription check response from ext/check endpoint
342
- */
343
340
  /** Subscription status values matching the FFID platform's SubscriptionStatus type */
344
341
  type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
345
342
  interface FFIDSubscriptionCheckResponse {
@@ -390,6 +387,7 @@ interface FFIDCreatePortalParams {
390
387
  /** URL to redirect when user exits the portal */
391
388
  returnUrl: string;
392
389
  }
390
+
393
391
  /** Member role in an organization */
394
392
  type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
395
393
  /** Member status in an organization */
@@ -846,4 +844,4 @@ interface FFIDAnnouncementListProps {
846
844
  */
847
845
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
848
846
 
849
- export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, FFIDAnnouncementBadge as D, FFIDAnnouncementList as E, type FFIDConfig as F, type FFIDAnnouncementsError as G, type FFIDAnnouncementsErrorCode as H, type FFIDAnnouncementsServerResponse as I, type FFIDCacheConfig as J, type FFIDContextValue as K, type ListAnnouncementsOptions as L, type FFIDJwtClaims as M, FFIDLoginButton as N, type FFIDMemberStatus as O, type FFIDOAuthTokenResponse as P, type FFIDOAuthUserInfoMemberRole as Q, type FFIDOAuthUserInfoSubscription as R, type FFIDOrganizationMember as S, FFIDOrganizationSwitcher as T, type FFIDSeatModel as U, FFIDSubscriptionBadge as V, type FFIDSubscriptionStatus as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDApiResponse as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDListMembersResponse as f, type FFIDMemberRole as g, type FFIDUpdateMemberRoleResponse as h, type FFIDRemoveMemberResponse as i, type FFIDCreateCheckoutParams as j, type FFIDCheckoutSessionResponse as k, type FFIDCreatePortalParams as l, type FFIDPortalSessionResponse as m, type FFIDVerifyAccessTokenOptions as n, type FFIDOAuthUserInfo as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
847
+ export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, type FFIDJwtClaims as N, FFIDLoginButton as O, type FFIDMemberStatus as P, type FFIDOAuthTokenResponse as Q, type FFIDOAuthUserInfoMemberRole as R, type FFIDOAuthUserInfoSubscription as S, type FFIDOrganizationMember as T, FFIDOrganizationSwitcher as U, type FFIDSeatModel as V, FFIDSubscriptionBadge as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDConfig as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo 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 FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
@@ -104,7 +104,7 @@ interface FFIDSubscription {
104
104
  /** Plan display name */
105
105
  planName: string;
106
106
  /** Subscription status */
107
- status: 'trialing' | 'active' | 'past_due' | 'canceled' | 'paused';
107
+ status: FFIDSubscriptionStatus;
108
108
  /** Current billing period end date */
109
109
  currentPeriodEnd: string | null;
110
110
  /** Trial end date (null if not a trial or no trial_end set) */
@@ -119,7 +119,7 @@ interface FFIDSubscription {
119
119
  /** OAuth userinfo subscription summary */
120
120
  interface FFIDOAuthUserInfoSubscription {
121
121
  subscriptionId: string | null;
122
- status: 'trialing' | 'active' | 'past_due' | 'canceled' | 'paused' | null;
122
+ status: FFIDSubscriptionStatus | null;
123
123
  planCode: string | null;
124
124
  seatModel: FFIDSeatModel | null;
125
125
  memberRole: FFIDOAuthUserInfoMemberRole | null;
@@ -337,9 +337,6 @@ type FFIDApiResponse<T> = {
337
337
  data?: undefined;
338
338
  error: FFIDError;
339
339
  };
340
- /**
341
- * Subscription check response from ext/check endpoint
342
- */
343
340
  /** Subscription status values matching the FFID platform's SubscriptionStatus type */
344
341
  type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
345
342
  interface FFIDSubscriptionCheckResponse {
@@ -390,6 +387,7 @@ interface FFIDCreatePortalParams {
390
387
  /** URL to redirect when user exits the portal */
391
388
  returnUrl: string;
392
389
  }
390
+
393
391
  /** Member role in an organization */
394
392
  type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
395
393
  /** Member status in an organization */
@@ -846,4 +844,4 @@ interface FFIDAnnouncementListProps {
846
844
  */
847
845
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
848
846
 
849
- export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, FFIDAnnouncementBadge as D, FFIDAnnouncementList as E, type FFIDConfig as F, type FFIDAnnouncementsError as G, type FFIDAnnouncementsErrorCode as H, type FFIDAnnouncementsServerResponse as I, type FFIDCacheConfig as J, type FFIDContextValue as K, type ListAnnouncementsOptions as L, type FFIDJwtClaims as M, FFIDLoginButton as N, type FFIDMemberStatus as O, type FFIDOAuthTokenResponse as P, type FFIDOAuthUserInfoMemberRole as Q, type FFIDOAuthUserInfoSubscription as R, type FFIDOrganizationMember as S, FFIDOrganizationSwitcher as T, type FFIDSeatModel as U, FFIDSubscriptionBadge as V, type FFIDSubscriptionStatus as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDApiResponse as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDListMembersResponse as f, type FFIDMemberRole as g, type FFIDUpdateMemberRoleResponse as h, type FFIDRemoveMemberResponse as i, type FFIDCreateCheckoutParams as j, type FFIDCheckoutSessionResponse as k, type FFIDCreatePortalParams as l, type FFIDPortalSessionResponse as m, type FFIDVerifyAccessTokenOptions as n, type FFIDOAuthUserInfo as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
847
+ export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, type FFIDJwtClaims as N, FFIDLoginButton as O, type FFIDMemberStatus as P, type FFIDOAuthTokenResponse as Q, type FFIDOAuthUserInfoMemberRole as R, type FFIDOAuthUserInfoSubscription as S, type FFIDOrganizationMember as T, FFIDOrganizationSwitcher as U, type FFIDSeatModel as V, FFIDSubscriptionBadge as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDConfig as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo 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 FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTHHBQAFX_cjs = require('./chunk-THHBQAFX.cjs');
3
+ var chunkJT7IIDMS_cjs = require('./chunk-JT7IIDMS.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
@@ -46,7 +46,7 @@ function createKVCacheAdapter(kv) {
46
46
  }
47
47
  function withFFIDAuth(Component, options = {}) {
48
48
  const WrappedComponent = (props) => {
49
- const { isLoading, isAuthenticated, login } = chunkTHHBQAFX_cjs.useFFIDContext();
49
+ const { isLoading, isAuthenticated, login } = chunkJT7IIDMS_cjs.useFFIDContext();
50
50
  const hasRedirected = react.useRef(false);
51
51
  react.useEffect(() => {
52
52
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -71,83 +71,83 @@ function withFFIDAuth(Component, options = {}) {
71
71
 
72
72
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
73
73
  enumerable: true,
74
- get: function () { return chunkTHHBQAFX_cjs.DEFAULT_API_BASE_URL; }
74
+ get: function () { return chunkJT7IIDMS_cjs.DEFAULT_API_BASE_URL; }
75
75
  });
76
76
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
77
77
  enumerable: true,
78
- get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementBadge; }
78
+ get: function () { return chunkJT7IIDMS_cjs.FFIDAnnouncementBadge; }
79
79
  });
80
80
  Object.defineProperty(exports, "FFIDAnnouncementList", {
81
81
  enumerable: true,
82
- get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementList; }
82
+ get: function () { return chunkJT7IIDMS_cjs.FFIDAnnouncementList; }
83
83
  });
84
84
  Object.defineProperty(exports, "FFIDLoginButton", {
85
85
  enumerable: true,
86
- get: function () { return chunkTHHBQAFX_cjs.FFIDLoginButton; }
86
+ get: function () { return chunkJT7IIDMS_cjs.FFIDLoginButton; }
87
87
  });
88
88
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
89
89
  enumerable: true,
90
- get: function () { return chunkTHHBQAFX_cjs.FFIDOrganizationSwitcher; }
90
+ get: function () { return chunkJT7IIDMS_cjs.FFIDOrganizationSwitcher; }
91
91
  });
92
92
  Object.defineProperty(exports, "FFIDProvider", {
93
93
  enumerable: true,
94
- get: function () { return chunkTHHBQAFX_cjs.FFIDProvider; }
94
+ get: function () { return chunkJT7IIDMS_cjs.FFIDProvider; }
95
95
  });
96
96
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
97
97
  enumerable: true,
98
- get: function () { return chunkTHHBQAFX_cjs.FFIDSubscriptionBadge; }
98
+ get: function () { return chunkJT7IIDMS_cjs.FFIDSubscriptionBadge; }
99
99
  });
100
100
  Object.defineProperty(exports, "FFIDUserMenu", {
101
101
  enumerable: true,
102
- get: function () { return chunkTHHBQAFX_cjs.FFIDUserMenu; }
102
+ get: function () { return chunkJT7IIDMS_cjs.FFIDUserMenu; }
103
103
  });
104
104
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
105
105
  enumerable: true,
106
- get: function () { return chunkTHHBQAFX_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
106
+ get: function () { return chunkJT7IIDMS_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
107
107
  });
108
108
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
109
109
  enumerable: true,
110
- get: function () { return chunkTHHBQAFX_cjs.createFFIDAnnouncementsClient; }
110
+ get: function () { return chunkJT7IIDMS_cjs.createFFIDAnnouncementsClient; }
111
111
  });
112
112
  Object.defineProperty(exports, "createFFIDClient", {
113
113
  enumerable: true,
114
- get: function () { return chunkTHHBQAFX_cjs.createFFIDClient; }
114
+ get: function () { return chunkJT7IIDMS_cjs.createFFIDClient; }
115
115
  });
116
116
  Object.defineProperty(exports, "createTokenStore", {
117
117
  enumerable: true,
118
- get: function () { return chunkTHHBQAFX_cjs.createTokenStore; }
118
+ get: function () { return chunkJT7IIDMS_cjs.createTokenStore; }
119
119
  });
120
120
  Object.defineProperty(exports, "generateCodeChallenge", {
121
121
  enumerable: true,
122
- get: function () { return chunkTHHBQAFX_cjs.generateCodeChallenge; }
122
+ get: function () { return chunkJT7IIDMS_cjs.generateCodeChallenge; }
123
123
  });
124
124
  Object.defineProperty(exports, "generateCodeVerifier", {
125
125
  enumerable: true,
126
- get: function () { return chunkTHHBQAFX_cjs.generateCodeVerifier; }
126
+ get: function () { return chunkJT7IIDMS_cjs.generateCodeVerifier; }
127
127
  });
128
128
  Object.defineProperty(exports, "retrieveCodeVerifier", {
129
129
  enumerable: true,
130
- get: function () { return chunkTHHBQAFX_cjs.retrieveCodeVerifier; }
130
+ get: function () { return chunkJT7IIDMS_cjs.retrieveCodeVerifier; }
131
131
  });
132
132
  Object.defineProperty(exports, "storeCodeVerifier", {
133
133
  enumerable: true,
134
- get: function () { return chunkTHHBQAFX_cjs.storeCodeVerifier; }
134
+ get: function () { return chunkJT7IIDMS_cjs.storeCodeVerifier; }
135
135
  });
136
136
  Object.defineProperty(exports, "useFFID", {
137
137
  enumerable: true,
138
- get: function () { return chunkTHHBQAFX_cjs.useFFID; }
138
+ get: function () { return chunkJT7IIDMS_cjs.useFFID; }
139
139
  });
140
140
  Object.defineProperty(exports, "useFFIDAnnouncements", {
141
141
  enumerable: true,
142
- get: function () { return chunkTHHBQAFX_cjs.useFFIDAnnouncements; }
142
+ get: function () { return chunkJT7IIDMS_cjs.useFFIDAnnouncements; }
143
143
  });
144
144
  Object.defineProperty(exports, "useSubscription", {
145
145
  enumerable: true,
146
- get: function () { return chunkTHHBQAFX_cjs.useSubscription; }
146
+ get: function () { return chunkJT7IIDMS_cjs.useSubscription; }
147
147
  });
148
148
  Object.defineProperty(exports, "withSubscription", {
149
149
  enumerable: true,
150
- get: function () { return chunkTHHBQAFX_cjs.withSubscription; }
150
+ get: function () { return chunkJT7IIDMS_cjs.withSubscription; }
151
151
  });
152
152
  exports.createKVCacheAdapter = createKVCacheAdapter;
153
153
  exports.createMemoryCacheAdapter = createMemoryCacheAdapter;