@feelflow/ffid-sdk 12.2.2 → 13.0.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.
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunkD6CCHTHL_cjs = require('../chunk-D6CCHTHL.cjs');
3
4
  var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
4
5
 
5
6
  // src/legal/ffid-legal-client.ts
@@ -54,6 +55,7 @@ function createFFIDLegalClient(config) {
54
55
  try {
55
56
  response = await fetch(url, {
56
57
  ...options,
58
+ ...chunkD6CCHTHL_cjs.CREDENTIAL_REDIRECT_INIT,
57
59
  headers: {
58
60
  "Content-Type": "application/json",
59
61
  "X-Service-Api-Key": config.apiKey,
@@ -69,6 +71,14 @@ function createFFIDLegalClient(config) {
69
71
  }
70
72
  };
71
73
  }
74
+ if (chunkD6CCHTHL_cjs.isRedirectResponse(response)) {
75
+ return {
76
+ error: {
77
+ code: FFID_LEGAL_ERROR_CODES.NETWORK_ERROR,
78
+ message: chunkD6CCHTHL_cjs.credentialRedirectMessage(response)
79
+ }
80
+ };
81
+ }
72
82
  if (response.status === NO_CONTENT_STATUS) {
73
83
  logger.debug("Response: 204 No Content (unexpected)", { url });
74
84
  return {
@@ -1,3 +1,4 @@
1
+ import { CREDENTIAL_REDIRECT_INIT, isRedirectResponse, credentialRedirectMessage } from '../chunk-HTFNV6DW.js';
1
2
  import { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
2
3
  export { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
3
4
 
@@ -53,6 +54,7 @@ function createFFIDLegalClient(config) {
53
54
  try {
54
55
  response = await fetch(url, {
55
56
  ...options,
57
+ ...CREDENTIAL_REDIRECT_INIT,
56
58
  headers: {
57
59
  "Content-Type": "application/json",
58
60
  "X-Service-Api-Key": config.apiKey,
@@ -68,6 +70,14 @@ function createFFIDLegalClient(config) {
68
70
  }
69
71
  };
70
72
  }
73
+ if (isRedirectResponse(response)) {
74
+ return {
75
+ error: {
76
+ code: FFID_LEGAL_ERROR_CODES.NETWORK_ERROR,
77
+ message: credentialRedirectMessage(response)
78
+ }
79
+ };
80
+ }
71
81
  if (response.status === NO_CONTENT_STATUS) {
72
82
  logger.debug("Response: 204 No Content (unexpected)", { url });
73
83
  return {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunkD6CCHTHL_cjs = require('../chunk-D6CCHTHL.cjs');
3
4
  var chunkMDHKSVLP_cjs = require('../chunk-MDHKSVLP.cjs');
4
5
  var jose = require('jose');
5
6
  var zod = require('zod');
@@ -408,6 +409,7 @@ function createVerifyAccessToken(deps) {
408
409
  }
409
410
  const fetchOptions = {
410
411
  method: "POST",
412
+ ...chunkD6CCHTHL_cjs.CREDENTIAL_REDIRECT_INIT,
411
413
  credentials: "omit",
412
414
  headers: {
413
415
  "Content-Type": "application/x-www-form-urlencoded",
@@ -430,6 +432,9 @@ function createVerifyAccessToken(deps) {
430
432
  }
431
433
  };
432
434
  }
435
+ if (chunkD6CCHTHL_cjs.isRedirectResponse(response)) {
436
+ return { error: { code: errorCodes.NETWORK_ERROR, message: chunkD6CCHTHL_cjs.credentialRedirectMessage(response) } };
437
+ }
433
438
  const upstreamUnavailable = response.status === HTTP_TOO_MANY_REQUESTS || response.status >= HTTP_SERVER_ERROR_MIN && response.status < HTTP_SERVER_ERROR_LIMIT;
434
439
  let introspectResponse;
435
440
  try {
@@ -1389,7 +1394,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
1389
1394
  };
1390
1395
 
1391
1396
  // src/client/version-check.ts
1392
- var SDK_VERSION = "12.2.2";
1397
+ var SDK_VERSION = "13.0.1";
1393
1398
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1394
1399
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1395
1400
  function sdkHeaders() {
@@ -4013,6 +4018,7 @@ function createFFIDClient(config) {
4013
4018
  if (authMode === "service-key") {
4014
4019
  return {
4015
4020
  ...options,
4021
+ ...chunkD6CCHTHL_cjs.CREDENTIAL_REDIRECT_INIT,
4016
4022
  credentials: "omit",
4017
4023
  headers: {
4018
4024
  ...jsonContentTypeHeader(options.body),
@@ -4074,6 +4080,9 @@ function createFFIDClient(config) {
4074
4080
  }
4075
4081
  };
4076
4082
  }
4083
+ if (fetchOptions.redirect === chunkD6CCHTHL_cjs.CREDENTIAL_REDIRECT_INIT.redirect && chunkD6CCHTHL_cjs.isRedirectResponse(response)) {
4084
+ return { error: { code: FFID_ERROR_CODES.NETWORK_ERROR, message: chunkD6CCHTHL_cjs.credentialRedirectMessage(response) } };
4085
+ }
4077
4086
  if (!authOverride && authMode === "token" && response.status === UNAUTHORIZED_STATUS2) {
4078
4087
  const refreshResult = await refreshAccessToken();
4079
4088
  if (!refreshResult.error) {
@@ -4424,16 +4433,16 @@ function createFFIDClient(config) {
4424
4433
  cancelSubscription,
4425
4434
  cancelPendingDowngrade,
4426
4435
  previewPlanChange,
4427
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4436
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4428
4437
  previewSeatChange,
4429
4438
  verifyAccessToken,
4430
4439
  getSubscribeUrl,
4431
4440
  redirectToSubscribe,
4432
4441
  getChangePlanUrl,
4433
4442
  redirectToChangePlan,
4434
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4443
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4435
4444
  getChangeSeatsUrl,
4436
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4445
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4437
4446
  redirectToChangeSeats,
4438
4447
  getRecoverPaymentUrl,
4439
4448
  redirectToRecoverPayment,
@@ -4695,6 +4704,8 @@ async function postToken(deps, body, fallbackErrorCode) {
4695
4704
  withTimeout(
4696
4705
  {
4697
4706
  method: "POST",
4707
+ // client_secret is a service API key; 307/308 would re-send the body (#7184)
4708
+ ...chunkD6CCHTHL_cjs.CREDENTIAL_REDIRECT_INIT,
4698
4709
  credentials: "omit",
4699
4710
  headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
4700
4711
  body: new URLSearchParams(body).toString()
@@ -4708,6 +4719,9 @@ async function postToken(deps, body, fallbackErrorCode) {
4708
4719
  error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
4709
4720
  );
4710
4721
  }
4722
+ if (chunkD6CCHTHL_cjs.isRedirectResponse(response)) {
4723
+ return fail(FFID_ERROR_CODES.NETWORK_ERROR, chunkD6CCHTHL_cjs.credentialRedirectMessage(response));
4724
+ }
4711
4725
  let json;
4712
4726
  try {
4713
4727
  json = await response.json();
@@ -1,5 +1,5 @@
1
- import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-C4Mjg70P.cjs';
2
- export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-C4Mjg70P.cjs';
1
+ import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-CW3siYTe.cjs';
2
+ export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-CW3siYTe.cjs';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.cjs';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.cjs';
@@ -1,5 +1,5 @@
1
- import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-E9ja3Jus.js';
2
- export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-E9ja3Jus.js';
1
+ import { F as FFIDError, a as FFIDLogger, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo, f as FFIDCatalogEnvironment, g as FFIDBillingInterval, h as FFIDTaxBehavior, i as FFIDPublishedCatalog } from '../ffid-client-CWvm_T2K.js';
2
+ export { j as FFIDAddMemberParams, k as FFIDAddMemberRequest, l as FFIDAddMemberResponse, m as FFIDAllowedLogoMimeType, n as FFIDAssignableMemberRole, o as FFIDCacheConfig, p as FFIDCatalogPublication, q as FFIDCatalogPublicationStatus, r as FFIDClient, s as FFIDCompanySizeCode, t as FFIDConfig, u as FFIDIndustryCode, v as FFIDListMembersResponse, w as FFIDListingConsentInput, x as FFIDLogoWallEntry, y as FFIDLogoWallResponse, z as FFIDMemberRole, A as FFIDMemberSeatAssignmentResult, B as FFIDOrganization, C as FFIDOrganizationLogoUploadResponse, D as FFIDOrganizationMember, E as FFIDOrganizationProfile, G as FFIDOrganizationProfileErrorCode, H as FFIDOrganizationProfileResponse, I as FFIDOtpSendResponse, J as FFIDOtpVerifyResponse, K as FFIDPasswordResetConfirmResponse, L as FFIDPasswordResetResponse, M as FFIDPasswordResetVerifyResponse, N as FFIDProfileCallOptions, O as FFIDProvisionMemberPlan, P as FFIDProvisionMemberPlanStatus, Q as FFIDProvisionMemberResult, R as FFIDProvisionMemberStatus, S as FFIDProvisionOrganizationDryRun, T as FFIDProvisionOrganizationMemberInput, U as FFIDProvisionOrganizationOutcome, V as FFIDProvisionOrganizationParams, W as FFIDProvisionOrganizationResponse, X as FFIDProvisionUserDryRun, Y as FFIDProvisionUserOutcome, Z as FFIDProvisionUserParams, _ as FFIDProvisionUserProfileInput, $ as FFIDProvisionUserResponse, a0 as FFIDProvisionedOrganization, a1 as FFIDProvisionedUser, a2 as FFIDPublishedPlan, a3 as FFIDRemoveMemberResponse, a4 as FFIDResetSessionResponse, a5 as FFIDSubscription, a6 as FFIDUpdateMemberRoleResponse, a7 as FFIDUpdateUserProfileRequest, a8 as FFIDUploadOrganizationLogoParams, a9 as FFIDUpsertOrganizationProfileParams, aa as FFIDUpsertOrganizationProfileRequest, ab as FFIDUser, ac as FFIDUserProfile, ad as FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, ae as FFID_CATALOG_ENVIRONMENTS, af as FFID_CATALOG_PUBLICATION_STATUSES, ag as FFID_COMPANY_SIZE_CODES, ah as FFID_INDUSTRY_CODES, ai as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, aj as FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, ak as FFID_ORGANIZATION_PROFILE_ERROR_CODES, al as TokenData, am as TokenStore, an as createFFIDClient, ao as createTokenStore } from '../ffid-client-CWvm_T2K.js';
3
3
  export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-Ce2eXQtB.js';
4
4
  import { z } from 'zod';
5
5
  import '../types-Cjb9J0rL.js';
@@ -1,3 +1,4 @@
1
+ import { CREDENTIAL_REDIRECT_INIT, isRedirectResponse, credentialRedirectMessage } from '../chunk-HTFNV6DW.js';
1
2
  import { DEFAULT_API_BASE_URL } from '../chunk-JEVK2XUM.js';
2
3
  export { DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES } from '../chunk-JEVK2XUM.js';
3
4
  import { SignJWT, importJWK, jwtVerify, createRemoteJWKSet, errors } from 'jose';
@@ -407,6 +408,7 @@ function createVerifyAccessToken(deps) {
407
408
  }
408
409
  const fetchOptions = {
409
410
  method: "POST",
411
+ ...CREDENTIAL_REDIRECT_INIT,
410
412
  credentials: "omit",
411
413
  headers: {
412
414
  "Content-Type": "application/x-www-form-urlencoded",
@@ -429,6 +431,9 @@ function createVerifyAccessToken(deps) {
429
431
  }
430
432
  };
431
433
  }
434
+ if (isRedirectResponse(response)) {
435
+ return { error: { code: errorCodes.NETWORK_ERROR, message: credentialRedirectMessage(response) } };
436
+ }
432
437
  const upstreamUnavailable = response.status === HTTP_TOO_MANY_REQUESTS || response.status >= HTTP_SERVER_ERROR_MIN && response.status < HTTP_SERVER_ERROR_LIMIT;
433
438
  let introspectResponse;
434
439
  try {
@@ -1388,7 +1393,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
1388
1393
  };
1389
1394
 
1390
1395
  // src/client/version-check.ts
1391
- var SDK_VERSION = "12.2.2";
1396
+ var SDK_VERSION = "13.0.1";
1392
1397
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
1393
1398
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
1394
1399
  function sdkHeaders() {
@@ -4012,6 +4017,7 @@ function createFFIDClient(config) {
4012
4017
  if (authMode === "service-key") {
4013
4018
  return {
4014
4019
  ...options,
4020
+ ...CREDENTIAL_REDIRECT_INIT,
4015
4021
  credentials: "omit",
4016
4022
  headers: {
4017
4023
  ...jsonContentTypeHeader(options.body),
@@ -4073,6 +4079,9 @@ function createFFIDClient(config) {
4073
4079
  }
4074
4080
  };
4075
4081
  }
4082
+ if (fetchOptions.redirect === CREDENTIAL_REDIRECT_INIT.redirect && isRedirectResponse(response)) {
4083
+ return { error: { code: FFID_ERROR_CODES.NETWORK_ERROR, message: credentialRedirectMessage(response) } };
4084
+ }
4076
4085
  if (!authOverride && authMode === "token" && response.status === UNAUTHORIZED_STATUS2) {
4077
4086
  const refreshResult = await refreshAccessToken();
4078
4087
  if (!refreshResult.error) {
@@ -4423,16 +4432,16 @@ function createFFIDClient(config) {
4423
4432
  cancelSubscription,
4424
4433
  cancelPendingDowngrade,
4425
4434
  previewPlanChange,
4426
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4435
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4427
4436
  previewSeatChange,
4428
4437
  verifyAccessToken,
4429
4438
  getSubscribeUrl,
4430
4439
  redirectToSubscribe,
4431
4440
  getChangePlanUrl,
4432
4441
  redirectToChangePlan,
4433
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4442
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4434
4443
  getChangeSeatsUrl,
4435
- /** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
4444
+ /** @deprecated 10.0.0: per_seat (praxis) only; kept while per_seat contracts exist */
4436
4445
  redirectToChangeSeats,
4437
4446
  getRecoverPaymentUrl,
4438
4447
  redirectToRecoverPayment,
@@ -4694,6 +4703,8 @@ async function postToken(deps, body, fallbackErrorCode) {
4694
4703
  withTimeout(
4695
4704
  {
4696
4705
  method: "POST",
4706
+ // client_secret is a service API key; 307/308 would re-send the body (#7184)
4707
+ ...CREDENTIAL_REDIRECT_INIT,
4697
4708
  credentials: "omit",
4698
4709
  headers: { "Content-Type": "application/x-www-form-urlencoded", ...sdkHeaders() },
4699
4710
  body: new URLSearchParams(body).toString()
@@ -4707,6 +4718,9 @@ async function postToken(deps, body, fallbackErrorCode) {
4707
4718
  error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
4708
4719
  );
4709
4720
  }
4721
+ if (isRedirectResponse(response)) {
4722
+ return fail(FFID_ERROR_CODES.NETWORK_ERROR, credentialRedirectMessage(response));
4723
+ }
4710
4724
  let json;
4711
4725
  try {
4712
4726
  json = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "12.2.2",
3
+ "version": "13.0.1",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",
@@ -123,7 +123,7 @@
123
123
  "vitest": "^4.0.0"
124
124
  },
125
125
  "engines": {
126
- "node": ">=18.0.0"
126
+ "node": ">=26.12.1"
127
127
  },
128
128
  "publishConfig": {
129
129
  "access": "public"