@feelflow/ffid-sdk 10.1.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -361,11 +361,12 @@ interface FFIDSubscribeResponse {
361
361
  code: string;
362
362
  name: string;
363
363
  };
364
+ /** `priceMonthly` は `customPricing` プランで `null`(個別見積り)。11.1.0 で `FFIDPlanInfo` と揃えた */
364
365
  plan: {
365
366
  id: string;
366
367
  code: string;
367
368
  name: string;
368
- priceMonthly: number;
369
+ priceMonthly: number | null;
369
370
  priceYearly: number | null;
370
371
  trialDays: number;
371
372
  };
@@ -961,12 +962,19 @@ interface FFIDBuyCreditsUrlParams {
961
962
  type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
962
963
  interface FFIDSubscriptionCheckResponse {
963
964
  hasActiveSubscription: boolean;
965
+ /**
966
+ * Active seat for the requested user; null for organization-only checks.
967
+ * Older servers omit this field. User access requires hasAccess AND
968
+ * seatAssigned === true; an omitted/null value is not proof of a seat.
969
+ */
970
+ seatAssigned?: boolean | null;
964
971
  /**
965
972
  * Canonical access decision returned by FFID's `/subscriptions/ext/check`.
966
973
  *
967
974
  * This is the server-side source of truth for service gates. Consumers
968
975
  * should not recompute access from `currentPeriodEnd`, `past_due_since`, or
969
976
  * local payment timestamps.
977
+ * This is contract access; user access also requires seatAssigned === true.
970
978
  */
971
979
  hasAccess?: boolean;
972
980
  /** True when `effectiveStatus === 'past_due_grace'`. */
@@ -996,9 +1004,11 @@ interface FFIDSubscriptionCheckResponse {
996
1004
  */
997
1005
  pricingModel?: FFIDPricingModel | null;
998
1006
  /**
999
- * Credit balance summary — flat plans only (10.0.0). `null` for per_seat, for no
1000
- * subscription, **and** when FFID could not read the ledger, so `null` does not
1001
- * mean "not flat" (use `pricingModel`). Never affects `hasAccess`.
1007
+ * Credit balance summary — paid flat plans only (10.0.0). `null` for per_seat, for a
1008
+ * `free` plan (flat on the unified ladder since #6547, but outside credits — consume /
1009
+ * balance return 409 `CREDITS_NOT_APPLICABLE`), for no subscription, **and** when FFID
1010
+ * could not read the ledger, so `null` does not mean "not flat" (use `pricingModel`).
1011
+ * Never affects `hasAccess`.
1002
1012
  */
1003
1013
  credits?: FFIDSubscriptionCheckCredits | null;
1004
1014
  /**
@@ -1045,7 +1055,10 @@ interface FFIDServiceAccessError {
1045
1055
  details?: unknown;
1046
1056
  }
1047
1057
  interface FFIDServiceAccessDecision {
1058
+ /** Contract access; user access also requires seatAssigned === true. */
1048
1059
  hasAccess: boolean;
1060
+ /** User's active seat, passed through when returned. Gate user access with === true. */
1061
+ seatAssigned?: boolean | null;
1049
1062
  effectiveStatus: EffectiveSubscriptionStatus | null;
1050
1063
  isGrace: boolean;
1051
1064
  isBlocked: boolean;
@@ -1210,9 +1223,18 @@ interface FFIDAddMemberRequest {
1210
1223
  interface FFIDAddMemberParams extends FFIDAddMemberRequest {
1211
1224
  organizationId: string;
1212
1225
  }
1226
+ /** Seat assignment outcome after membership creation; membership exists in every case. */
1227
+ type FFIDMemberSeatAssignmentResult = 'assigned' | 'not_applicable' | 'member_limit_reached' | 'failed';
1213
1228
  /** Response from addMember (ext) */
1214
1229
  interface FFIDAddMemberResponse {
1215
1230
  member: FFIDOrganizationMember;
1231
+ /**
1232
+ * Membership creation can succeed even when seat assignment fails.
1233
+ * Omitted by older servers. `not_applicable`/undefined do not prove an active seat.
1234
+ * Check the authenticated user's hasAccess and seatAssigned before granting access;
1235
+ * do not automatically restore a removed seat on a duplicate-member retry.
1236
+ */
1237
+ seatAssignment?: FFIDMemberSeatAssignmentResult;
1216
1238
  }
1217
1239
  /** Response from updateMemberRole (ext) */
1218
1240
  interface FFIDUpdateMemberRoleResponse {
@@ -2431,11 +2453,10 @@ interface FFIDConfig {
2431
2453
  */
2432
2454
  cache?: FFIDCacheConfig | undefined;
2433
2455
  /**
2434
- * Request timeout in milliseconds for FFID API calls. Applies to server-side
2435
- * token verification / introspection and, in `token` mode, to the client-side
2436
- * OAuth operations (code exchange / refresh / revoke) — including via the
2437
- * `FFIDProvider` `timeout` prop (#4260). On timeout the fetch is aborted and
2438
- * surfaced through the normal error path (e.g. `NETWORK_ERROR`).
2456
+ * Per-HTTP timeout (ms): shared JSON APIs (e.g. checkSubscription/getProfile),
2457
+ * token verification/introspection, token OAuth exchange/refresh/revoke; also FFIDProvider.timeout.
2458
+ * Shared JSON includes body and preserves signals; refresh/retry have separate deadlines.
2459
+ * Excludes token getSession, cookie signOut, public/newsletter/inquiry; not a method deadline.
2439
2460
  * @default undefined (no timeout, uses fetch default)
2440
2461
  */
2441
2462
  timeout?: number | undefined;
@@ -2801,6 +2822,7 @@ declare function createFFIDClient(config: FFIDConfig): {
2801
2822
  organizationId: string;
2802
2823
  email: string;
2803
2824
  role?: FFIDAssignableMemberRole;
2825
+ inviterUserId?: string;
2804
2826
  }) => Promise<FFIDApiResponse<FFIDInviteMemberResponse>>;
2805
2827
  leaveOrganization: (params: FFIDLeaveOrganizationParams) => Promise<FFIDApiResponse<FFIDLeaveOrganizationResponse>>;
2806
2828
  getAnalyticsConfig: (serviceCode: string, options?: FFIDProfileCallOptions) => Promise<FFIDApiResponse<FFIDAnalyticsConfig>>;
@@ -2887,4 +2909,4 @@ declare function createFFIDClient(config: FFIDConfig): {
2887
2909
  /** Type of the FFID client */
2888
2910
  type FFIDClient = ReturnType<typeof createFFIDClient>;
2889
2911
 
2890
- export { type FFIDProvisionedOrganization as $, type FFIDOrganization as A, type FFIDOrganizationLogoUploadResponse as B, type FFIDOrganizationMember as C, type FFIDOrganizationProfile as D, type FFIDOrganizationProfileErrorCode as E, type FFIDError as F, type FFIDOrganizationProfileResponse as G, type FFIDOtpSendResponse as H, type FFIDOtpVerifyResponse as I, type FFIDPasswordResetConfirmResponse as J, type FFIDPasswordResetResponse as K, type FFIDPasswordResetVerifyResponse as L, type FFIDProfileCallOptions as M, type FFIDProvisionMemberPlan as N, type FFIDProvisionMemberPlanStatus as O, type FFIDProvisionMemberResult as P, type FFIDProvisionMemberStatus as Q, type FFIDProvisionOrganizationDryRun as R, type FFIDProvisionOrganizationMemberInput as S, type FFIDProvisionOrganizationOutcome as T, type FFIDProvisionOrganizationParams as U, type FFIDProvisionOrganizationResponse as V, type FFIDProvisionUserDryRun as W, type FFIDProvisionUserOutcome as X, type FFIDProvisionUserParams as Y, type FFIDProvisionUserProfileInput as Z, type FFIDProvisionUserResponse as _, type FFIDLogger as a, type FFIDProvisionedUser as a0, type FFIDPublishedPlan as a1, type FFIDRemoveMemberResponse as a2, type FFIDResetSessionResponse as a3, type FFIDSubscription as a4, type FFIDUpdateMemberRoleResponse as a5, type FFIDUpdateUserProfileRequest as a6, type FFIDUploadOrganizationLogoParams as a7, type FFIDUpsertOrganizationProfileParams as a8, type FFIDUpsertOrganizationProfileRequest as a9, type FFIDUser as aa, type FFIDUserProfile as ab, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES as ac, FFID_CATALOG_ENVIRONMENTS as ad, FFID_CATALOG_PUBLICATION_STATUSES as ae, FFID_COMPANY_SIZE_CODES as af, FFID_INDUSTRY_CODES as ag, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES as ah, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB as ai, FFID_ORGANIZATION_PROFILE_ERROR_CODES as aj, type TokenData as ak, type TokenStore as al, createFFIDClient as am, createTokenStore as an, type FFIDCacheAdapter as b, type FFIDVerifyAccessTokenOptions as c, type FFIDApiResponse as d, type FFIDOAuthUserInfo as e, type FFIDCatalogEnvironment as f, type FFIDBillingInterval as g, type FFIDTaxBehavior as h, type FFIDPublishedCatalog as i, type FFIDAddMemberParams as j, type FFIDAddMemberRequest as k, type FFIDAddMemberResponse as l, type FFIDAllowedLogoMimeType as m, type FFIDAssignableMemberRole as n, type FFIDCacheConfig as o, type FFIDCatalogPublication as p, type FFIDCatalogPublicationStatus as q, type FFIDClient as r, type FFIDCompanySizeCode as s, type FFIDConfig as t, type FFIDIndustryCode as u, type FFIDListMembersResponse as v, type FFIDListingConsentInput as w, type FFIDLogoWallEntry as x, type FFIDLogoWallResponse as y, type FFIDMemberRole as z };
2912
+ export { type FFIDProvisionUserResponse as $, type FFIDMemberSeatAssignmentResult as A, type FFIDOrganization as B, type FFIDOrganizationLogoUploadResponse as C, type FFIDOrganizationMember as D, type FFIDOrganizationProfile as E, type FFIDError as F, type FFIDOrganizationProfileErrorCode as G, type FFIDOrganizationProfileResponse as H, type FFIDOtpSendResponse as I, type FFIDOtpVerifyResponse as J, type FFIDPasswordResetConfirmResponse as K, type FFIDPasswordResetResponse as L, type FFIDPasswordResetVerifyResponse as M, type FFIDProfileCallOptions as N, type FFIDProvisionMemberPlan as O, type FFIDProvisionMemberPlanStatus as P, type FFIDProvisionMemberResult as Q, type FFIDProvisionMemberStatus as R, type FFIDProvisionOrganizationDryRun as S, type FFIDProvisionOrganizationMemberInput as T, type FFIDProvisionOrganizationOutcome as U, type FFIDProvisionOrganizationParams as V, type FFIDProvisionOrganizationResponse as W, type FFIDProvisionUserDryRun as X, type FFIDProvisionUserOutcome as Y, type FFIDProvisionUserParams as Z, type FFIDProvisionUserProfileInput as _, type FFIDLogger as a, type FFIDProvisionedOrganization as a0, type FFIDProvisionedUser as a1, type FFIDPublishedPlan as a2, type FFIDRemoveMemberResponse as a3, type FFIDResetSessionResponse as a4, type FFIDSubscription as a5, type FFIDUpdateMemberRoleResponse as a6, type FFIDUpdateUserProfileRequest as a7, type FFIDUploadOrganizationLogoParams as a8, type FFIDUpsertOrganizationProfileParams as a9, type FFIDUpsertOrganizationProfileRequest as aa, type FFIDUser as ab, type FFIDUserProfile as ac, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES as ad, FFID_CATALOG_ENVIRONMENTS as ae, FFID_CATALOG_PUBLICATION_STATUSES as af, FFID_COMPANY_SIZE_CODES as ag, FFID_INDUSTRY_CODES as ah, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES as ai, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB as aj, FFID_ORGANIZATION_PROFILE_ERROR_CODES as ak, type TokenData as al, type TokenStore as am, createFFIDClient as an, createTokenStore as ao, type FFIDCacheAdapter as b, type FFIDVerifyAccessTokenOptions as c, type FFIDApiResponse as d, type FFIDOAuthUserInfo as e, type FFIDCatalogEnvironment as f, type FFIDBillingInterval as g, type FFIDTaxBehavior as h, type FFIDPublishedCatalog as i, type FFIDAddMemberParams as j, type FFIDAddMemberRequest as k, type FFIDAddMemberResponse as l, type FFIDAllowedLogoMimeType as m, type FFIDAssignableMemberRole as n, type FFIDCacheConfig as o, type FFIDCatalogPublication as p, type FFIDCatalogPublicationStatus as q, type FFIDClient as r, type FFIDCompanySizeCode as s, type FFIDConfig as t, type FFIDIndustryCode as u, type FFIDListMembersResponse as v, type FFIDListingConsentInput as w, type FFIDLogoWallEntry as x, type FFIDLogoWallResponse as y, type FFIDMemberRole as z };
@@ -276,11 +276,12 @@ interface FFIDSubscribeResponse {
276
276
  code: string;
277
277
  name: string;
278
278
  };
279
+ /** `priceMonthly` は `customPricing` プランで `null`(個別見積り)。11.1.0 で `FFIDPlanInfo` と揃えた */
279
280
  plan: {
280
281
  id: string;
281
282
  code: string;
282
283
  name: string;
283
- priceMonthly: number;
284
+ priceMonthly: number | null;
284
285
  priceYearly: number | null;
285
286
  trialDays: number;
286
287
  };
@@ -909,12 +910,19 @@ interface FFIDBuyCreditsUrlParams {
909
910
  type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
910
911
  interface FFIDSubscriptionCheckResponse {
911
912
  hasActiveSubscription: boolean;
913
+ /**
914
+ * Active seat for the requested user; null for organization-only checks.
915
+ * Older servers omit this field. User access requires hasAccess AND
916
+ * seatAssigned === true; an omitted/null value is not proof of a seat.
917
+ */
918
+ seatAssigned?: boolean | null;
912
919
  /**
913
920
  * Canonical access decision returned by FFID's `/subscriptions/ext/check`.
914
921
  *
915
922
  * This is the server-side source of truth for service gates. Consumers
916
923
  * should not recompute access from `currentPeriodEnd`, `past_due_since`, or
917
924
  * local payment timestamps.
925
+ * This is contract access; user access also requires seatAssigned === true.
918
926
  */
919
927
  hasAccess?: boolean;
920
928
  /** True when `effectiveStatus === 'past_due_grace'`. */
@@ -944,9 +952,11 @@ interface FFIDSubscriptionCheckResponse {
944
952
  */
945
953
  pricingModel?: FFIDPricingModel | null;
946
954
  /**
947
- * Credit balance summary — flat plans only (10.0.0). `null` for per_seat, for no
948
- * subscription, **and** when FFID could not read the ledger, so `null` does not
949
- * mean "not flat" (use `pricingModel`). Never affects `hasAccess`.
955
+ * Credit balance summary — paid flat plans only (10.0.0). `null` for per_seat, for a
956
+ * `free` plan (flat on the unified ladder since #6547, but outside credits — consume /
957
+ * balance return 409 `CREDITS_NOT_APPLICABLE`), for no subscription, **and** when FFID
958
+ * could not read the ledger, so `null` does not mean "not flat" (use `pricingModel`).
959
+ * Never affects `hasAccess`.
950
960
  */
951
961
  credits?: FFIDSubscriptionCheckCredits | null;
952
962
  /**
@@ -993,7 +1003,10 @@ interface FFIDServiceAccessError {
993
1003
  details?: unknown;
994
1004
  }
995
1005
  interface FFIDServiceAccessDecision {
1006
+ /** Contract access; user access also requires seatAssigned === true. */
996
1007
  hasAccess: boolean;
1008
+ /** User's active seat, passed through when returned. Gate user access with === true. */
1009
+ seatAssigned?: boolean | null;
997
1010
  effectiveStatus: EffectiveSubscriptionStatus | null;
998
1011
  isGrace: boolean;
999
1012
  isBlocked: boolean;
@@ -1351,11 +1364,10 @@ interface FFIDConfig {
1351
1364
  */
1352
1365
  cache?: FFIDCacheConfig | undefined;
1353
1366
  /**
1354
- * Request timeout in milliseconds for FFID API calls. Applies to server-side
1355
- * token verification / introspection and, in `token` mode, to the client-side
1356
- * OAuth operations (code exchange / refresh / revoke) — including via the
1357
- * `FFIDProvider` `timeout` prop (#4260). On timeout the fetch is aborted and
1358
- * surfaced through the normal error path (e.g. `NETWORK_ERROR`).
1367
+ * Per-HTTP timeout (ms): shared JSON APIs (e.g. checkSubscription/getProfile),
1368
+ * token verification/introspection, token OAuth exchange/refresh/revoke; also FFIDProvider.timeout.
1369
+ * Shared JSON includes body and preserves signals; refresh/retry have separate deadlines.
1370
+ * Excludes token getSession, cookie signOut, public/newsletter/inquiry; not a method deadline.
1359
1371
  * @default undefined (no timeout, uses fetch default)
1360
1372
  */
1361
1373
  timeout?: number | undefined;
@@ -276,11 +276,12 @@ interface FFIDSubscribeResponse {
276
276
  code: string;
277
277
  name: string;
278
278
  };
279
+ /** `priceMonthly` は `customPricing` プランで `null`(個別見積り)。11.1.0 で `FFIDPlanInfo` と揃えた */
279
280
  plan: {
280
281
  id: string;
281
282
  code: string;
282
283
  name: string;
283
- priceMonthly: number;
284
+ priceMonthly: number | null;
284
285
  priceYearly: number | null;
285
286
  trialDays: number;
286
287
  };
@@ -909,12 +910,19 @@ interface FFIDBuyCreditsUrlParams {
909
910
  type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
910
911
  interface FFIDSubscriptionCheckResponse {
911
912
  hasActiveSubscription: boolean;
913
+ /**
914
+ * Active seat for the requested user; null for organization-only checks.
915
+ * Older servers omit this field. User access requires hasAccess AND
916
+ * seatAssigned === true; an omitted/null value is not proof of a seat.
917
+ */
918
+ seatAssigned?: boolean | null;
912
919
  /**
913
920
  * Canonical access decision returned by FFID's `/subscriptions/ext/check`.
914
921
  *
915
922
  * This is the server-side source of truth for service gates. Consumers
916
923
  * should not recompute access from `currentPeriodEnd`, `past_due_since`, or
917
924
  * local payment timestamps.
925
+ * This is contract access; user access also requires seatAssigned === true.
918
926
  */
919
927
  hasAccess?: boolean;
920
928
  /** True when `effectiveStatus === 'past_due_grace'`. */
@@ -944,9 +952,11 @@ interface FFIDSubscriptionCheckResponse {
944
952
  */
945
953
  pricingModel?: FFIDPricingModel | null;
946
954
  /**
947
- * Credit balance summary — flat plans only (10.0.0). `null` for per_seat, for no
948
- * subscription, **and** when FFID could not read the ledger, so `null` does not
949
- * mean "not flat" (use `pricingModel`). Never affects `hasAccess`.
955
+ * Credit balance summary — paid flat plans only (10.0.0). `null` for per_seat, for a
956
+ * `free` plan (flat on the unified ladder since #6547, but outside credits — consume /
957
+ * balance return 409 `CREDITS_NOT_APPLICABLE`), for no subscription, **and** when FFID
958
+ * could not read the ledger, so `null` does not mean "not flat" (use `pricingModel`).
959
+ * Never affects `hasAccess`.
950
960
  */
951
961
  credits?: FFIDSubscriptionCheckCredits | null;
952
962
  /**
@@ -993,7 +1003,10 @@ interface FFIDServiceAccessError {
993
1003
  details?: unknown;
994
1004
  }
995
1005
  interface FFIDServiceAccessDecision {
1006
+ /** Contract access; user access also requires seatAssigned === true. */
996
1007
  hasAccess: boolean;
1008
+ /** User's active seat, passed through when returned. Gate user access with === true. */
1009
+ seatAssigned?: boolean | null;
997
1010
  effectiveStatus: EffectiveSubscriptionStatus | null;
998
1011
  isGrace: boolean;
999
1012
  isBlocked: boolean;
@@ -1351,11 +1364,10 @@ interface FFIDConfig {
1351
1364
  */
1352
1365
  cache?: FFIDCacheConfig | undefined;
1353
1366
  /**
1354
- * Request timeout in milliseconds for FFID API calls. Applies to server-side
1355
- * token verification / introspection and, in `token` mode, to the client-side
1356
- * OAuth operations (code exchange / refresh / revoke) — including via the
1357
- * `FFIDProvider` `timeout` prop (#4260). On timeout the fetch is aborted and
1358
- * surfaced through the normal error path (e.g. `NETWORK_ERROR`).
1367
+ * Per-HTTP timeout (ms): shared JSON APIs (e.g. checkSubscription/getProfile),
1368
+ * token verification/introspection, token OAuth exchange/refresh/revoke; also FFIDProvider.timeout.
1369
+ * Shared JSON includes body and preserves signals; refresh/retry have separate deadlines.
1370
+ * Excludes token getSession, cookie signOut, public/newsletter/inquiry; not a method deadline.
1359
1371
  * @default undefined (no timeout, uses fetch default)
1360
1372
  */
1361
1373
  timeout?: number | undefined;