@feelflow/ffid-sdk 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -435,7 +435,7 @@ function createBillingMethods(deps) {
435
435
  }
436
436
 
437
437
  // src/client/version-check.ts
438
- var SDK_VERSION = "1.11.0";
438
+ var SDK_VERSION = "1.13.0";
439
439
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
440
440
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
441
441
  function sdkHeaders() {
@@ -481,6 +481,22 @@ npm install @feelflow/ffid-sdk@latest \u3067\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8
481
481
  var OAUTH_TOKEN_ENDPOINT = "/api/v1/oauth/token";
482
482
  var OAUTH_REVOKE_ENDPOINT = "/api/v1/oauth/revoke";
483
483
  var MS_PER_SECOND = 1e3;
484
+ function validateTokenResponse(tokenResponse) {
485
+ const invalid = [];
486
+ if (!tokenResponse.access_token) {
487
+ invalid.push("access_token");
488
+ }
489
+ if (!tokenResponse.refresh_token) {
490
+ invalid.push("refresh_token");
491
+ }
492
+ if (typeof tokenResponse.expires_in !== "number" || tokenResponse.expires_in <= 0) {
493
+ invalid.push("expires_in");
494
+ }
495
+ if (invalid.length > 0) {
496
+ return `\u30C8\u30FC\u30AF\u30F3\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059: ${invalid.join(", ")}`;
497
+ }
498
+ return null;
499
+ }
484
500
  function createOAuthTokenMethods(deps) {
485
501
  const {
486
502
  baseUrl,
@@ -550,6 +566,16 @@ function createOAuthTokenMethods(deps) {
550
566
  }
551
567
  };
552
568
  }
569
+ const validationError = validateTokenResponse(tokenResponse);
570
+ if (validationError) {
571
+ logger.error("Token exchange validation failed:", validationError);
572
+ return {
573
+ error: {
574
+ code: errorCodes.TOKEN_EXCHANGE_ERROR,
575
+ message: validationError
576
+ }
577
+ };
578
+ }
553
579
  tokenStore.setTokens({
554
580
  accessToken: tokenResponse.access_token,
555
581
  refreshToken: tokenResponse.refresh_token,
@@ -618,6 +644,16 @@ function createOAuthTokenMethods(deps) {
618
644
  }
619
645
  };
620
646
  }
647
+ const validationError = validateTokenResponse(tokenResponse);
648
+ if (validationError) {
649
+ logger.error("Token refresh validation failed:", validationError);
650
+ return {
651
+ error: {
652
+ code: errorCodes.TOKEN_REFRESH_ERROR,
653
+ message: validationError
654
+ }
655
+ };
656
+ }
621
657
  tokenStore.setTokens({
622
658
  accessToken: tokenResponse.access_token,
623
659
  refreshToken: tokenResponse.refresh_token,
@@ -871,14 +907,20 @@ async function generateCodeChallenge(verifier) {
871
907
  const digest = await crypto.subtle.digest("SHA-256", data);
872
908
  return base64UrlEncode(digest);
873
909
  }
874
- function storeCodeVerifier(verifier) {
910
+ function storeCodeVerifier(verifier, logger) {
875
911
  try {
876
- if (typeof window === "undefined") return;
912
+ if (typeof window === "undefined") {
913
+ logger?.warn("storeCodeVerifier: sessionStorage is not available in SSR context");
914
+ return false;
915
+ }
877
916
  window.sessionStorage.setItem(VERIFIER_STORAGE_KEY, verifier);
878
- } catch {
917
+ return true;
918
+ } catch (error) {
919
+ logger?.warn("storeCodeVerifier: sessionStorage \u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", error);
920
+ return false;
879
921
  }
880
922
  }
881
- function retrieveCodeVerifier() {
923
+ function retrieveCodeVerifier(logger) {
882
924
  try {
883
925
  if (typeof window === "undefined") return null;
884
926
  const verifier = window.sessionStorage.getItem(VERIFIER_STORAGE_KEY);
@@ -886,7 +928,8 @@ function retrieveCodeVerifier() {
886
928
  window.sessionStorage.removeItem(VERIFIER_STORAGE_KEY);
887
929
  }
888
930
  return verifier;
889
- } catch {
931
+ } catch (error) {
932
+ logger?.warn("retrieveCodeVerifier: sessionStorage \u304B\u3089\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", error);
890
933
  return null;
891
934
  }
892
935
  }
@@ -919,32 +962,34 @@ function createRedirectMethods(deps) {
919
962
  } = deps;
920
963
  async function redirectToAuthorize() {
921
964
  const verifier = generateCodeVerifier();
922
- storeCodeVerifier(verifier);
965
+ storeCodeVerifier(verifier, logger);
966
+ let challenge;
923
967
  try {
924
- const challenge = await generateCodeChallenge(verifier);
925
- const state = generateRandomState();
926
- const redirectUri = resolvedRedirectUri ?? window.location.origin + window.location.pathname;
927
- const params = new URLSearchParams({
928
- response_type: "code",
929
- client_id: clientId,
930
- redirect_uri: redirectUri,
931
- state,
932
- code_challenge: challenge,
933
- code_challenge_method: "S256"
934
- });
935
- const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
936
- logger.debug("Redirecting to authorize:", authorizeUrl);
937
- window.location.href = authorizeUrl;
938
- return true;
968
+ challenge = await generateCodeChallenge(verifier);
939
969
  } catch (error) {
970
+ const errorMessage = error instanceof Error ? error.message : "PKCE \u30B3\u30FC\u30C9\u30C1\u30E3\u30EC\u30F3\u30B8\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F";
940
971
  logger.error("PKCE \u30B3\u30FC\u30C9\u30C1\u30E3\u30EC\u30F3\u30B8\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F:", error);
941
- return false;
972
+ return { success: false, error: errorMessage };
942
973
  }
974
+ const state = generateRandomState();
975
+ const redirectUri = resolvedRedirectUri ?? window.location.origin + window.location.pathname;
976
+ const params = new URLSearchParams({
977
+ response_type: "code",
978
+ client_id: clientId,
979
+ redirect_uri: redirectUri,
980
+ state,
981
+ code_challenge: challenge,
982
+ code_challenge_method: "S256"
983
+ });
984
+ const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
985
+ logger.debug("Redirecting to authorize:", authorizeUrl);
986
+ window.location.href = authorizeUrl;
987
+ return { success: true };
943
988
  }
944
989
  async function redirectToLogin() {
945
990
  if (typeof window === "undefined") {
946
- logger.debug("Cannot redirect in SSR context");
947
- return false;
991
+ logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
992
+ return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
948
993
  }
949
994
  if (authMode === "token") {
950
995
  return redirectToAuthorize();
@@ -953,19 +998,273 @@ function createRedirectMethods(deps) {
953
998
  const loginUrl = `${baseUrl}/login?redirect=${encodeURIComponent(currentUrl)}&service=${encodeURIComponent(serviceCode)}`;
954
999
  logger.debug("Redirecting to login:", loginUrl);
955
1000
  window.location.href = loginUrl;
956
- return true;
1001
+ return { success: true };
957
1002
  }
958
1003
  function getLoginUrl(redirectUrl) {
959
- const redirect = redirectUrl ?? (typeof window !== "undefined" ? window.location.href : "");
1004
+ let redirect;
1005
+ if (redirectUrl != null) {
1006
+ redirect = redirectUrl;
1007
+ } else if (typeof window !== "undefined") {
1008
+ redirect = window.location.href;
1009
+ } else {
1010
+ logger.warn("getLoginUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
1011
+ redirect = "";
1012
+ }
960
1013
  return `${baseUrl}/login?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}`;
961
1014
  }
962
1015
  function getSignupUrl(redirectUrl) {
963
- const redirect = redirectUrl ?? (typeof window !== "undefined" ? window.location.href : "");
1016
+ let redirect;
1017
+ if (redirectUrl != null) {
1018
+ redirect = redirectUrl;
1019
+ } else if (typeof window !== "undefined") {
1020
+ redirect = window.location.href;
1021
+ } else {
1022
+ logger.warn("getSignupUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
1023
+ redirect = "";
1024
+ }
964
1025
  return `${baseUrl}/signup?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}`;
965
1026
  }
966
1027
  return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl };
967
1028
  }
968
1029
 
1030
+ // src/client/password-reset.ts
1031
+ var RESET_PASSWORD_BASE = "/api/v1/auth/reset-password";
1032
+ function isBlank(value) {
1033
+ return !value || !value.trim();
1034
+ }
1035
+ function createPasswordResetMethods(deps) {
1036
+ const { baseUrl, logger, createError, fetchWithAuth, errorCodes } = deps;
1037
+ async function fetchPublic(endpoint, options = {}) {
1038
+ const url = `${baseUrl}${endpoint}`;
1039
+ logger.debug("Fetching (public):", url);
1040
+ let response;
1041
+ try {
1042
+ response = await fetch(url, {
1043
+ ...options,
1044
+ credentials: "include",
1045
+ headers: {
1046
+ "Content-Type": "application/json",
1047
+ ...sdkHeaders(),
1048
+ ...options.headers
1049
+ }
1050
+ });
1051
+ } catch (error) {
1052
+ logger.error("Network error:", error);
1053
+ return {
1054
+ error: {
1055
+ code: errorCodes.NETWORK_ERROR,
1056
+ message: error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
1057
+ }
1058
+ };
1059
+ }
1060
+ let raw;
1061
+ try {
1062
+ raw = await response.json();
1063
+ } catch (parseError) {
1064
+ logger.error("Parse error:", parseError, "Status:", response.status);
1065
+ return {
1066
+ error: {
1067
+ code: errorCodes.PARSE_ERROR,
1068
+ message: `\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u4E0D\u6B63\u306A\u30EC\u30B9\u30DD\u30F3\u30B9\u3092\u53D7\u4FE1\u3057\u307E\u3057\u305F (status: ${response.status})`
1069
+ }
1070
+ };
1071
+ }
1072
+ logger.debug("Response (public):", response.status, raw);
1073
+ checkVersionHeader(response, logger);
1074
+ if (!response.ok) {
1075
+ return {
1076
+ error: raw.error ?? {
1077
+ code: errorCodes.UNKNOWN_ERROR,
1078
+ message: "\u30D1\u30B9\u30EF\u30FC\u30C9\u30EA\u30BB\u30C3\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F"
1079
+ }
1080
+ };
1081
+ }
1082
+ if (raw.data === void 0) {
1083
+ return {
1084
+ error: {
1085
+ code: errorCodes.UNKNOWN_ERROR,
1086
+ message: "\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u30C7\u30FC\u30BF\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"
1087
+ }
1088
+ };
1089
+ }
1090
+ return { data: raw.data };
1091
+ }
1092
+ async function requestPasswordReset(email) {
1093
+ if (isBlank(email)) {
1094
+ return {
1095
+ error: createError("VALIDATION_ERROR", "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u5FC5\u9808\u3067\u3059")
1096
+ };
1097
+ }
1098
+ return fetchPublic(
1099
+ RESET_PASSWORD_BASE,
1100
+ {
1101
+ method: "POST",
1102
+ body: JSON.stringify({ email })
1103
+ }
1104
+ );
1105
+ }
1106
+ async function verifyPasswordResetToken(accessToken) {
1107
+ if (isBlank(accessToken)) {
1108
+ return {
1109
+ error: createError("VALIDATION_ERROR", "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u306F\u5FC5\u9808\u3067\u3059")
1110
+ };
1111
+ }
1112
+ const query = new URLSearchParams({
1113
+ access_token: accessToken,
1114
+ type: "recovery"
1115
+ });
1116
+ return fetchPublic(
1117
+ `${RESET_PASSWORD_BASE}/verify?${query.toString()}`
1118
+ );
1119
+ }
1120
+ async function establishResetSession(accessToken, refreshToken) {
1121
+ if (isBlank(accessToken)) {
1122
+ return {
1123
+ error: createError("VALIDATION_ERROR", "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u306F\u5FC5\u9808\u3067\u3059")
1124
+ };
1125
+ }
1126
+ if (isBlank(refreshToken)) {
1127
+ return {
1128
+ error: createError("VALIDATION_ERROR", "\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5\u30C8\u30FC\u30AF\u30F3\u306F\u5FC5\u9808\u3067\u3059")
1129
+ };
1130
+ }
1131
+ return fetchPublic(
1132
+ `${RESET_PASSWORD_BASE}/session`,
1133
+ {
1134
+ method: "POST",
1135
+ body: JSON.stringify({ accessToken, refreshToken })
1136
+ }
1137
+ );
1138
+ }
1139
+ async function confirmPasswordReset(password) {
1140
+ if (isBlank(password)) {
1141
+ return {
1142
+ error: createError("VALIDATION_ERROR", "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u5FC5\u9808\u3067\u3059")
1143
+ };
1144
+ }
1145
+ return fetchWithAuth(
1146
+ `${RESET_PASSWORD_BASE}/confirm`,
1147
+ {
1148
+ method: "POST",
1149
+ body: JSON.stringify({ password })
1150
+ }
1151
+ );
1152
+ }
1153
+ return {
1154
+ requestPasswordReset,
1155
+ verifyPasswordResetToken,
1156
+ establishResetSession,
1157
+ confirmPasswordReset
1158
+ };
1159
+ }
1160
+
1161
+ // src/client/otp.ts
1162
+ var OTP_BASE = "/api/v1/auth/otp";
1163
+ function isBlank2(value) {
1164
+ return !value || !value.trim();
1165
+ }
1166
+ function createOtpMethods(deps) {
1167
+ const { baseUrl, logger, createError, errorCodes } = deps;
1168
+ async function fetchPublic(endpoint, options = {}) {
1169
+ const url = `${baseUrl}${endpoint}`;
1170
+ logger.debug("Fetching (public):", url);
1171
+ let response;
1172
+ try {
1173
+ response = await fetch(url, {
1174
+ ...options,
1175
+ credentials: "include",
1176
+ headers: {
1177
+ "Content-Type": "application/json",
1178
+ ...sdkHeaders(),
1179
+ ...options.headers
1180
+ }
1181
+ });
1182
+ } catch (error) {
1183
+ logger.error("Network error:", error);
1184
+ return {
1185
+ error: {
1186
+ code: errorCodes.NETWORK_ERROR,
1187
+ message: error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
1188
+ }
1189
+ };
1190
+ }
1191
+ let raw;
1192
+ try {
1193
+ raw = await response.json();
1194
+ } catch (parseError) {
1195
+ logger.error("Parse error:", parseError, "Status:", response.status);
1196
+ return {
1197
+ error: {
1198
+ code: errorCodes.PARSE_ERROR,
1199
+ message: `\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u4E0D\u6B63\u306A\u30EC\u30B9\u30DD\u30F3\u30B9\u3092\u53D7\u4FE1\u3057\u307E\u3057\u305F (status: ${response.status})`
1200
+ }
1201
+ };
1202
+ }
1203
+ logger.debug("Response (public):", response.status, raw);
1204
+ checkVersionHeader(response, logger);
1205
+ if (!response.ok) {
1206
+ return {
1207
+ error: raw.error ?? {
1208
+ code: errorCodes.UNKNOWN_ERROR,
1209
+ message: "OTP\u8A8D\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F"
1210
+ }
1211
+ };
1212
+ }
1213
+ if (raw.data === void 0) {
1214
+ return {
1215
+ error: {
1216
+ code: errorCodes.UNKNOWN_ERROR,
1217
+ message: "\u30B5\u30FC\u30D0\u30FC\u304B\u3089\u30C7\u30FC\u30BF\u304C\u8FD4\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"
1218
+ }
1219
+ };
1220
+ }
1221
+ return { data: raw.data };
1222
+ }
1223
+ async function sendOtp(email, options) {
1224
+ if (isBlank2(email)) {
1225
+ return {
1226
+ error: createError("VALIDATION_ERROR", "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u5FC5\u9808\u3067\u3059")
1227
+ };
1228
+ }
1229
+ return fetchPublic(
1230
+ `${OTP_BASE}/send`,
1231
+ {
1232
+ method: "POST",
1233
+ body: JSON.stringify({
1234
+ email,
1235
+ ...options?.redirectUrl ? { redirectUrl: options.redirectUrl } : {}
1236
+ })
1237
+ }
1238
+ );
1239
+ }
1240
+ async function verifyOtp(params) {
1241
+ if (isBlank2(params.accessToken)) {
1242
+ return {
1243
+ error: createError("VALIDATION_ERROR", "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u306F\u5FC5\u9808\u3067\u3059")
1244
+ };
1245
+ }
1246
+ if (isBlank2(params.refreshToken)) {
1247
+ return {
1248
+ error: createError("VALIDATION_ERROR", "\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5\u30C8\u30FC\u30AF\u30F3\u306F\u5FC5\u9808\u3067\u3059")
1249
+ };
1250
+ }
1251
+ return fetchPublic(
1252
+ `${OTP_BASE}/verify`,
1253
+ {
1254
+ method: "POST",
1255
+ body: JSON.stringify({
1256
+ accessToken: params.accessToken,
1257
+ refreshToken: params.refreshToken
1258
+ })
1259
+ }
1260
+ );
1261
+ }
1262
+ return {
1263
+ sendOtp,
1264
+ verifyOtp
1265
+ };
1266
+ }
1267
+
969
1268
  // src/client/ffid-client.ts
970
1269
  var UNAUTHORIZED_STATUS2 = 401;
971
1270
  var SDK_LOG_PREFIX = "[FFID SDK]";
@@ -1098,6 +1397,9 @@ function createFFIDClient(config) {
1098
1397
  }
1099
1398
  };
1100
1399
  }
1400
+ } else {
1401
+ logger.warn("Token refresh failed, returning refresh error:", refreshResult.error);
1402
+ return { error: refreshResult.error };
1101
1403
  }
1102
1404
  }
1103
1405
  let raw;
@@ -1175,6 +1477,24 @@ function createFFIDClient(config) {
1175
1477
  fetchWithAuth,
1176
1478
  createError
1177
1479
  });
1480
+ const {
1481
+ requestPasswordReset,
1482
+ verifyPasswordResetToken,
1483
+ establishResetSession,
1484
+ confirmPasswordReset
1485
+ } = createPasswordResetMethods({
1486
+ baseUrl,
1487
+ logger,
1488
+ createError,
1489
+ fetchWithAuth,
1490
+ errorCodes: FFID_ERROR_CODES
1491
+ });
1492
+ const { sendOtp, verifyOtp } = createOtpMethods({
1493
+ baseUrl,
1494
+ logger,
1495
+ createError,
1496
+ errorCodes: FFID_ERROR_CODES
1497
+ });
1178
1498
  const verifyAccessToken = createVerifyAccessToken({
1179
1499
  authMode,
1180
1500
  baseUrl,
@@ -1200,6 +1520,12 @@ function createFFIDClient(config) {
1200
1520
  createCheckoutSession,
1201
1521
  createPortalSession,
1202
1522
  verifyAccessToken,
1523
+ requestPasswordReset,
1524
+ verifyPasswordResetToken,
1525
+ establishResetSession,
1526
+ confirmPasswordReset,
1527
+ sendOtp,
1528
+ verifyOtp,
1203
1529
  /** Token store (token mode only) */
1204
1530
  tokenStore,
1205
1531
  /** Resolved auth mode */
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunkWZZP7SQB_cjs = require('../chunk-WZZP7SQB.cjs');
3
+ var chunk7YV3SUEY_cjs = require('../chunk-7YV3SUEY.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunk7YV3SUEY_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunkWZZP7SQB_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunk7YV3SUEY_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDLoginButton", {
16
16
  enumerable: true,
17
- get: function () { return chunkWZZP7SQB_cjs.FFIDLoginButton; }
17
+ get: function () { return chunk7YV3SUEY_cjs.FFIDLoginButton; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
20
20
  enumerable: true,
21
- get: function () { return chunkWZZP7SQB_cjs.FFIDOrganizationSwitcher; }
21
+ get: function () { return chunk7YV3SUEY_cjs.FFIDOrganizationSwitcher; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
24
24
  enumerable: true,
25
- get: function () { return chunkWZZP7SQB_cjs.FFIDSubscriptionBadge; }
25
+ get: function () { return chunk7YV3SUEY_cjs.FFIDSubscriptionBadge; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDUserMenu", {
28
28
  enumerable: true,
29
- get: function () { return chunkWZZP7SQB_cjs.FFIDUserMenu; }
29
+ get: function () { return chunk7YV3SUEY_cjs.FFIDUserMenu; }
30
30
  });
@@ -1,3 +1,3 @@
1
- export { x as FFIDAnnouncementBadge, V as FFIDAnnouncementBadgeClassNames, W as FFIDAnnouncementBadgeProps, y as FFIDAnnouncementList, X as FFIDAnnouncementListClassNames, Y as FFIDAnnouncementListProps, H as FFIDLoginButton, Z as FFIDLoginButtonProps, M as FFIDOrganizationSwitcher, _ as FFIDOrganizationSwitcherClassNames, $ as FFIDOrganizationSwitcherProps, O as FFIDSubscriptionBadge, a0 as FFIDSubscriptionBadgeClassNames, a1 as FFIDSubscriptionBadgeProps, R as FFIDUserMenu, a2 as FFIDUserMenuClassNames, a3 as FFIDUserMenuProps } from '../index-DMgtXEt5.cjs';
1
+ export { y as FFIDAnnouncementBadge, W as FFIDAnnouncementBadgeClassNames, X as FFIDAnnouncementBadgeProps, z as FFIDAnnouncementList, Y as FFIDAnnouncementListClassNames, Z as FFIDAnnouncementListProps, I as FFIDLoginButton, _ as FFIDLoginButtonProps, N as FFIDOrganizationSwitcher, $ as FFIDOrganizationSwitcherClassNames, a0 as FFIDOrganizationSwitcherProps, P as FFIDSubscriptionBadge, a1 as FFIDSubscriptionBadgeClassNames, a2 as FFIDSubscriptionBadgeProps, S as FFIDUserMenu, a3 as FFIDUserMenuClassNames, a4 as FFIDUserMenuProps } from '../index-GrAWBpmf.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { x as FFIDAnnouncementBadge, V as FFIDAnnouncementBadgeClassNames, W as FFIDAnnouncementBadgeProps, y as FFIDAnnouncementList, X as FFIDAnnouncementListClassNames, Y as FFIDAnnouncementListProps, H as FFIDLoginButton, Z as FFIDLoginButtonProps, M as FFIDOrganizationSwitcher, _ as FFIDOrganizationSwitcherClassNames, $ as FFIDOrganizationSwitcherProps, O as FFIDSubscriptionBadge, a0 as FFIDSubscriptionBadgeClassNames, a1 as FFIDSubscriptionBadgeProps, R as FFIDUserMenu, a2 as FFIDUserMenuClassNames, a3 as FFIDUserMenuProps } from '../index-DMgtXEt5.js';
1
+ export { y as FFIDAnnouncementBadge, W as FFIDAnnouncementBadgeClassNames, X as FFIDAnnouncementBadgeProps, z as FFIDAnnouncementList, Y as FFIDAnnouncementListClassNames, Z as FFIDAnnouncementListProps, I as FFIDLoginButton, _ as FFIDLoginButtonProps, N as FFIDOrganizationSwitcher, $ as FFIDOrganizationSwitcherClassNames, a0 as FFIDOrganizationSwitcherProps, P as FFIDSubscriptionBadge, a1 as FFIDSubscriptionBadgeClassNames, a2 as FFIDSubscriptionBadgeProps, S as FFIDUserMenu, a3 as FFIDUserMenuClassNames, a4 as FFIDUserMenuProps } from '../index-GrAWBpmf.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-GW23IWNE.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-KFOIVZEY.js';
@@ -375,6 +375,18 @@ interface FFIDCreatePortalParams {
375
375
  /** URL to redirect when user exits the portal */
376
376
  returnUrl: string;
377
377
  }
378
+ /**
379
+ * Result of a redirect operation (redirectToLogin / redirectToAuthorize)
380
+ *
381
+ * Structured return type so callers can inspect failure reasons
382
+ * instead of receiving a bare `false`.
383
+ */
384
+ type FFIDRedirectResult = {
385
+ success: true;
386
+ } | {
387
+ success: false;
388
+ error: string;
389
+ };
378
390
  /**
379
391
  * OAuth 2.0 token response from FFID token endpoint
380
392
  */
@@ -776,4 +788,4 @@ interface FFIDAnnouncementListProps {
776
788
  */
777
789
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
778
790
 
779
- export { type FFIDOrganizationSwitcherProps as $, type AnnouncementListResponse as A, type FFIDAnnouncementsErrorCode as B, type FFIDAnnouncementsServerResponse as C, type FFIDCacheConfig as D, type FFIDContextValue as E, type FFIDConfig as F, type FFIDJwtClaims as G, FFIDLoginButton as H, type FFIDOAuthTokenResponse as I, type FFIDOAuthUserInfoMemberRole as J, type FFIDOAuthUserInfoSubscription as K, type ListAnnouncementsOptions as L, FFIDOrganizationSwitcher as M, type FFIDSeatModel as N, FFIDSubscriptionBadge as O, type FFIDSubscriptionStatus as P, type FFIDTokenIntrospectionResponse as Q, FFIDUserMenu as R, type UseFFIDAnnouncementsReturn as S, useFFIDAnnouncements as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementBadgeClassNames as V, type FFIDAnnouncementBadgeProps as W, type FFIDAnnouncementListClassNames as X, type FFIDAnnouncementListProps as Y, type FFIDLoginButtonProps as Z, type FFIDOrganizationSwitcherClassNames as _, type FFIDApiResponse as a, type FFIDSubscriptionBadgeClassNames as a0, type FFIDSubscriptionBadgeProps as a1, type FFIDUserMenuClassNames as a2, type FFIDUserMenuProps as a3, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDVerifyAccessTokenOptions as i, type FFIDOAuthUserInfo as j, type FFIDAuthMode as k, type FFIDLogger as l, type FFIDCacheAdapter as m, type FFIDUser as n, type FFIDOrganization as o, type FFIDSubscription as p, type FFIDSubscriptionContextValue as q, type FFIDAnnouncementsClientConfig as r, type FFIDAnnouncementsApiResponse as s, type FFIDAnnouncementsLogger as t, type Announcement as u, type AnnouncementStatus as v, type AnnouncementType as w, FFIDAnnouncementBadge as x, FFIDAnnouncementList as y, type FFIDAnnouncementsError as z };
791
+ export { type FFIDOrganizationSwitcherClassNames as $, type AnnouncementListResponse as A, type FFIDAnnouncementsError as B, type FFIDAnnouncementsErrorCode as C, type FFIDAnnouncementsServerResponse as D, type FFIDCacheConfig as E, type FFIDConfig as F, type FFIDContextValue as G, type FFIDJwtClaims as H, FFIDLoginButton as I, type FFIDOAuthTokenResponse as J, type FFIDOAuthUserInfoMemberRole as K, type ListAnnouncementsOptions as L, type FFIDOAuthUserInfoSubscription as M, FFIDOrganizationSwitcher as N, type FFIDSeatModel as O, FFIDSubscriptionBadge as P, type FFIDSubscriptionStatus as Q, type FFIDTokenIntrospectionResponse as R, FFIDUserMenu as S, type UseFFIDAnnouncementsReturn as T, type UseFFIDAnnouncementsOptions as U, useFFIDAnnouncements as V, type FFIDAnnouncementBadgeClassNames as W, type FFIDAnnouncementBadgeProps as X, type FFIDAnnouncementListClassNames as Y, type FFIDAnnouncementListProps as Z, type FFIDLoginButtonProps as _, type FFIDApiResponse as a, type FFIDOrganizationSwitcherProps as a0, type FFIDSubscriptionBadgeClassNames as a1, type FFIDSubscriptionBadgeProps as a2, type FFIDUserMenuClassNames as a3, type FFIDUserMenuProps as a4, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDCreateCheckoutParams as f, type FFIDCheckoutSessionResponse as g, type FFIDCreatePortalParams as h, type FFIDPortalSessionResponse as i, type FFIDVerifyAccessTokenOptions as j, type FFIDOAuthUserInfo as k, type FFIDAuthMode as l, type FFIDLogger as m, type FFIDCacheAdapter as n, type FFIDUser as o, type FFIDOrganization as p, type FFIDSubscription as q, type FFIDSubscriptionContextValue as r, type FFIDAnnouncementsClientConfig as s, type FFIDAnnouncementsApiResponse as t, type FFIDAnnouncementsLogger as u, type Announcement as v, type AnnouncementStatus as w, type AnnouncementType as x, FFIDAnnouncementBadge as y, FFIDAnnouncementList as z };
@@ -375,6 +375,18 @@ interface FFIDCreatePortalParams {
375
375
  /** URL to redirect when user exits the portal */
376
376
  returnUrl: string;
377
377
  }
378
+ /**
379
+ * Result of a redirect operation (redirectToLogin / redirectToAuthorize)
380
+ *
381
+ * Structured return type so callers can inspect failure reasons
382
+ * instead of receiving a bare `false`.
383
+ */
384
+ type FFIDRedirectResult = {
385
+ success: true;
386
+ } | {
387
+ success: false;
388
+ error: string;
389
+ };
378
390
  /**
379
391
  * OAuth 2.0 token response from FFID token endpoint
380
392
  */
@@ -776,4 +788,4 @@ interface FFIDAnnouncementListProps {
776
788
  */
777
789
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
778
790
 
779
- export { type FFIDOrganizationSwitcherProps as $, type AnnouncementListResponse as A, type FFIDAnnouncementsErrorCode as B, type FFIDAnnouncementsServerResponse as C, type FFIDCacheConfig as D, type FFIDContextValue as E, type FFIDConfig as F, type FFIDJwtClaims as G, FFIDLoginButton as H, type FFIDOAuthTokenResponse as I, type FFIDOAuthUserInfoMemberRole as J, type FFIDOAuthUserInfoSubscription as K, type ListAnnouncementsOptions as L, FFIDOrganizationSwitcher as M, type FFIDSeatModel as N, FFIDSubscriptionBadge as O, type FFIDSubscriptionStatus as P, type FFIDTokenIntrospectionResponse as Q, FFIDUserMenu as R, type UseFFIDAnnouncementsReturn as S, useFFIDAnnouncements as T, type UseFFIDAnnouncementsOptions as U, type FFIDAnnouncementBadgeClassNames as V, type FFIDAnnouncementBadgeProps as W, type FFIDAnnouncementListClassNames as X, type FFIDAnnouncementListProps as Y, type FFIDLoginButtonProps as Z, type FFIDOrganizationSwitcherClassNames as _, type FFIDApiResponse as a, type FFIDSubscriptionBadgeClassNames as a0, type FFIDSubscriptionBadgeProps as a1, type FFIDUserMenuClassNames as a2, type FFIDUserMenuProps as a3, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDCreateCheckoutParams as e, type FFIDCheckoutSessionResponse as f, type FFIDCreatePortalParams as g, type FFIDPortalSessionResponse as h, type FFIDVerifyAccessTokenOptions as i, type FFIDOAuthUserInfo as j, type FFIDAuthMode as k, type FFIDLogger as l, type FFIDCacheAdapter as m, type FFIDUser as n, type FFIDOrganization as o, type FFIDSubscription as p, type FFIDSubscriptionContextValue as q, type FFIDAnnouncementsClientConfig as r, type FFIDAnnouncementsApiResponse as s, type FFIDAnnouncementsLogger as t, type Announcement as u, type AnnouncementStatus as v, type AnnouncementType as w, FFIDAnnouncementBadge as x, FFIDAnnouncementList as y, type FFIDAnnouncementsError as z };
791
+ export { type FFIDOrganizationSwitcherClassNames as $, type AnnouncementListResponse as A, type FFIDAnnouncementsError as B, type FFIDAnnouncementsErrorCode as C, type FFIDAnnouncementsServerResponse as D, type FFIDCacheConfig as E, type FFIDConfig as F, type FFIDContextValue as G, type FFIDJwtClaims as H, FFIDLoginButton as I, type FFIDOAuthTokenResponse as J, type FFIDOAuthUserInfoMemberRole as K, type ListAnnouncementsOptions as L, type FFIDOAuthUserInfoSubscription as M, FFIDOrganizationSwitcher as N, type FFIDSeatModel as O, FFIDSubscriptionBadge as P, type FFIDSubscriptionStatus as Q, type FFIDTokenIntrospectionResponse as R, FFIDUserMenu as S, type UseFFIDAnnouncementsReturn as T, type UseFFIDAnnouncementsOptions as U, useFFIDAnnouncements as V, type FFIDAnnouncementBadgeClassNames as W, type FFIDAnnouncementBadgeProps as X, type FFIDAnnouncementListClassNames as Y, type FFIDAnnouncementListProps as Z, type FFIDLoginButtonProps as _, type FFIDApiResponse as a, type FFIDOrganizationSwitcherProps as a0, type FFIDSubscriptionBadgeClassNames as a1, type FFIDSubscriptionBadgeProps as a2, type FFIDUserMenuClassNames as a3, type FFIDUserMenuProps as a4, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDCreateCheckoutParams as f, type FFIDCheckoutSessionResponse as g, type FFIDCreatePortalParams as h, type FFIDPortalSessionResponse as i, type FFIDVerifyAccessTokenOptions as j, type FFIDOAuthUserInfo as k, type FFIDAuthMode as l, type FFIDLogger as m, type FFIDCacheAdapter as n, type FFIDUser as o, type FFIDOrganization as p, type FFIDSubscription as q, type FFIDSubscriptionContextValue as r, type FFIDAnnouncementsClientConfig as s, type FFIDAnnouncementsApiResponse as t, type FFIDAnnouncementsLogger as u, type Announcement as v, type AnnouncementStatus as w, type AnnouncementType as x, FFIDAnnouncementBadge as y, FFIDAnnouncementList as z };