@feelflow/ffid-sdk 1.2.1 → 1.4.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.
@@ -179,6 +179,117 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
179
179
  ];
180
180
  }
181
181
 
182
+ // src/client/verify-access-token.ts
183
+ var OAUTH_INTROSPECT_ENDPOINT = "/api/v1/oauth/introspect";
184
+ function createVerifyAccessToken(deps) {
185
+ const { authMode, baseUrl, serviceApiKey, logger, createError, errorCodes } = deps;
186
+ async function verifyAccessToken(accessToken) {
187
+ if (authMode !== "service-key") {
188
+ return {
189
+ error: createError(
190
+ errorCodes.TOKEN_VERIFICATION_ERROR,
191
+ "verifyAccessToken \u306F service-key \u30E2\u30FC\u30C9\u3067\u306E\u307F\u5229\u7528\u53EF\u80FD\u3067\u3059"
192
+ )
193
+ };
194
+ }
195
+ if (!accessToken || !accessToken.trim()) {
196
+ return {
197
+ error: createError(
198
+ errorCodes.TOKEN_VERIFICATION_ERROR,
199
+ "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"
200
+ )
201
+ };
202
+ }
203
+ if (!serviceApiKey) {
204
+ return {
205
+ error: createError(
206
+ errorCodes.TOKEN_VERIFICATION_ERROR,
207
+ "serviceApiKey \u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"
208
+ )
209
+ };
210
+ }
211
+ const url = `${baseUrl}${OAUTH_INTROSPECT_ENDPOINT}`;
212
+ logger.debug("Verifying access token:", url);
213
+ let response;
214
+ try {
215
+ response = await fetch(url, {
216
+ method: "POST",
217
+ credentials: "omit",
218
+ headers: {
219
+ "Content-Type": "application/x-www-form-urlencoded",
220
+ "X-Service-Api-Key": serviceApiKey
221
+ },
222
+ body: new URLSearchParams({ token: accessToken }).toString()
223
+ });
224
+ } catch (error) {
225
+ logger.error("Network error during token verification:", error);
226
+ return {
227
+ error: {
228
+ code: errorCodes.NETWORK_ERROR,
229
+ message: error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
230
+ }
231
+ };
232
+ }
233
+ let introspectResponse;
234
+ try {
235
+ introspectResponse = await response.json();
236
+ } catch (parseError) {
237
+ logger.error("Parse error during token verification:", parseError);
238
+ return {
239
+ error: {
240
+ code: errorCodes.PARSE_ERROR,
241
+ 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})`
242
+ }
243
+ };
244
+ }
245
+ if (!response.ok) {
246
+ const errorBody = introspectResponse;
247
+ return {
248
+ error: {
249
+ code: errorBody.error?.code ?? errorCodes.TOKEN_VERIFICATION_ERROR,
250
+ message: errorBody.error?.message ?? "\u30C8\u30FC\u30AF\u30F3\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F"
251
+ }
252
+ };
253
+ }
254
+ if (!introspectResponse.active) {
255
+ return {
256
+ error: {
257
+ code: errorCodes.TOKEN_VERIFICATION_ERROR,
258
+ message: "\u30C8\u30FC\u30AF\u30F3\u304C\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\u3067\u3059"
259
+ }
260
+ };
261
+ }
262
+ if (!introspectResponse.sub) {
263
+ logger.error("Active token introspection returned no sub claim");
264
+ return {
265
+ error: {
266
+ code: errorCodes.TOKEN_VERIFICATION_ERROR,
267
+ message: "\u30C8\u30FC\u30AF\u30F3\u691C\u8A3C\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u30E6\u30FC\u30B6\u30FCID\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093"
268
+ }
269
+ };
270
+ }
271
+ const base = {
272
+ sub: introspectResponse.sub,
273
+ email: introspectResponse.email ?? null,
274
+ name: introspectResponse.name ?? null,
275
+ picture: introspectResponse.picture ?? null,
276
+ organization_id: introspectResponse.organization_id ?? null
277
+ };
278
+ const raw = introspectResponse.subscription ? {
279
+ ...base,
280
+ subscription: {
281
+ status: introspectResponse.subscription.status,
282
+ plan_code: introspectResponse.subscription.plan_code,
283
+ seat_model: introspectResponse.subscription.seat_model,
284
+ member_role: introspectResponse.subscription.member_role,
285
+ organization_id: introspectResponse.subscription.organization_id
286
+ }
287
+ } : base;
288
+ return { data: normalizeUserinfo(raw) };
289
+ }
290
+ return verifyAccessToken;
291
+ }
292
+
182
293
  // src/client/ffid-client.ts
183
294
  var NO_CONTENT_STATUS = 204;
184
295
  var SESSION_ENDPOINT = "/api/v1/auth/session";
@@ -214,7 +325,8 @@ var FFID_ERROR_CODES = {
214
325
  UNKNOWN_ERROR: "UNKNOWN_ERROR",
215
326
  TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
216
327
  TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
217
- NO_TOKENS: "NO_TOKENS"
328
+ NO_TOKENS: "NO_TOKENS",
329
+ TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR"
218
330
  };
219
331
  function createFFIDClient(config) {
220
332
  if (!config.serviceCode || !config.serviceCode.trim()) {
@@ -630,6 +742,11 @@ function createFFIDClient(config) {
630
742
  if (!response.ok) {
631
743
  const errorBody = tokenResponse;
632
744
  logger.error("Token refresh failed:", errorBody);
745
+ const irrecoverableErrors = ["token_revoked", "invalid_grant"];
746
+ if (errorBody.error && irrecoverableErrors.includes(errorBody.error)) {
747
+ tokenStore.clearTokens();
748
+ logger.debug("Cleared tokens due to irrecoverable refresh error:", errorBody.error);
749
+ }
633
750
  return {
634
751
  error: {
635
752
  code: errorBody.error ?? FFID_ERROR_CODES.TOKEN_REFRESH_ERROR,
@@ -707,6 +824,14 @@ function createFFIDClient(config) {
707
824
  `${EXT_CHECK_ENDPOINT}?${query.toString()}`
708
825
  );
709
826
  }
827
+ const verifyAccessToken = createVerifyAccessToken({
828
+ authMode,
829
+ baseUrl,
830
+ serviceApiKey,
831
+ logger,
832
+ createError,
833
+ errorCodes: FFID_ERROR_CODES
834
+ });
710
835
  return {
711
836
  getSession,
712
837
  signOut,
@@ -717,6 +842,7 @@ function createFFIDClient(config) {
717
842
  exchangeCodeForTokens,
718
843
  refreshAccessToken,
719
844
  checkSubscription,
845
+ verifyAccessToken,
720
846
  /** Token store (token mode only) */
721
847
  tokenStore,
722
848
  /** Resolved auth mode */
@@ -177,6 +177,117 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
177
177
  ];
178
178
  }
179
179
 
180
+ // src/client/verify-access-token.ts
181
+ var OAUTH_INTROSPECT_ENDPOINT = "/api/v1/oauth/introspect";
182
+ function createVerifyAccessToken(deps) {
183
+ const { authMode, baseUrl, serviceApiKey, logger, createError, errorCodes } = deps;
184
+ async function verifyAccessToken(accessToken) {
185
+ if (authMode !== "service-key") {
186
+ return {
187
+ error: createError(
188
+ errorCodes.TOKEN_VERIFICATION_ERROR,
189
+ "verifyAccessToken \u306F service-key \u30E2\u30FC\u30C9\u3067\u306E\u307F\u5229\u7528\u53EF\u80FD\u3067\u3059"
190
+ )
191
+ };
192
+ }
193
+ if (!accessToken || !accessToken.trim()) {
194
+ return {
195
+ error: createError(
196
+ errorCodes.TOKEN_VERIFICATION_ERROR,
197
+ "\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"
198
+ )
199
+ };
200
+ }
201
+ if (!serviceApiKey) {
202
+ return {
203
+ error: createError(
204
+ errorCodes.TOKEN_VERIFICATION_ERROR,
205
+ "serviceApiKey \u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"
206
+ )
207
+ };
208
+ }
209
+ const url = `${baseUrl}${OAUTH_INTROSPECT_ENDPOINT}`;
210
+ logger.debug("Verifying access token:", url);
211
+ let response;
212
+ try {
213
+ response = await fetch(url, {
214
+ method: "POST",
215
+ credentials: "omit",
216
+ headers: {
217
+ "Content-Type": "application/x-www-form-urlencoded",
218
+ "X-Service-Api-Key": serviceApiKey
219
+ },
220
+ body: new URLSearchParams({ token: accessToken }).toString()
221
+ });
222
+ } catch (error) {
223
+ logger.error("Network error during token verification:", error);
224
+ return {
225
+ error: {
226
+ code: errorCodes.NETWORK_ERROR,
227
+ message: error instanceof Error ? error.message : "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"
228
+ }
229
+ };
230
+ }
231
+ let introspectResponse;
232
+ try {
233
+ introspectResponse = await response.json();
234
+ } catch (parseError) {
235
+ logger.error("Parse error during token verification:", parseError);
236
+ return {
237
+ error: {
238
+ code: errorCodes.PARSE_ERROR,
239
+ 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})`
240
+ }
241
+ };
242
+ }
243
+ if (!response.ok) {
244
+ const errorBody = introspectResponse;
245
+ return {
246
+ error: {
247
+ code: errorBody.error?.code ?? errorCodes.TOKEN_VERIFICATION_ERROR,
248
+ message: errorBody.error?.message ?? "\u30C8\u30FC\u30AF\u30F3\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F"
249
+ }
250
+ };
251
+ }
252
+ if (!introspectResponse.active) {
253
+ return {
254
+ error: {
255
+ code: errorCodes.TOKEN_VERIFICATION_ERROR,
256
+ message: "\u30C8\u30FC\u30AF\u30F3\u304C\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\u3067\u3059"
257
+ }
258
+ };
259
+ }
260
+ if (!introspectResponse.sub) {
261
+ logger.error("Active token introspection returned no sub claim");
262
+ return {
263
+ error: {
264
+ code: errorCodes.TOKEN_VERIFICATION_ERROR,
265
+ message: "\u30C8\u30FC\u30AF\u30F3\u691C\u8A3C\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u30E6\u30FC\u30B6\u30FCID\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093"
266
+ }
267
+ };
268
+ }
269
+ const base = {
270
+ sub: introspectResponse.sub,
271
+ email: introspectResponse.email ?? null,
272
+ name: introspectResponse.name ?? null,
273
+ picture: introspectResponse.picture ?? null,
274
+ organization_id: introspectResponse.organization_id ?? null
275
+ };
276
+ const raw = introspectResponse.subscription ? {
277
+ ...base,
278
+ subscription: {
279
+ status: introspectResponse.subscription.status,
280
+ plan_code: introspectResponse.subscription.plan_code,
281
+ seat_model: introspectResponse.subscription.seat_model,
282
+ member_role: introspectResponse.subscription.member_role,
283
+ organization_id: introspectResponse.subscription.organization_id
284
+ }
285
+ } : base;
286
+ return { data: normalizeUserinfo(raw) };
287
+ }
288
+ return verifyAccessToken;
289
+ }
290
+
180
291
  // src/client/ffid-client.ts
181
292
  var NO_CONTENT_STATUS = 204;
182
293
  var SESSION_ENDPOINT = "/api/v1/auth/session";
@@ -212,7 +323,8 @@ var FFID_ERROR_CODES = {
212
323
  UNKNOWN_ERROR: "UNKNOWN_ERROR",
213
324
  TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
214
325
  TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
215
- NO_TOKENS: "NO_TOKENS"
326
+ NO_TOKENS: "NO_TOKENS",
327
+ TOKEN_VERIFICATION_ERROR: "TOKEN_VERIFICATION_ERROR"
216
328
  };
217
329
  function createFFIDClient(config) {
218
330
  if (!config.serviceCode || !config.serviceCode.trim()) {
@@ -628,6 +740,11 @@ function createFFIDClient(config) {
628
740
  if (!response.ok) {
629
741
  const errorBody = tokenResponse;
630
742
  logger.error("Token refresh failed:", errorBody);
743
+ const irrecoverableErrors = ["token_revoked", "invalid_grant"];
744
+ if (errorBody.error && irrecoverableErrors.includes(errorBody.error)) {
745
+ tokenStore.clearTokens();
746
+ logger.debug("Cleared tokens due to irrecoverable refresh error:", errorBody.error);
747
+ }
631
748
  return {
632
749
  error: {
633
750
  code: errorBody.error ?? FFID_ERROR_CODES.TOKEN_REFRESH_ERROR,
@@ -705,6 +822,14 @@ function createFFIDClient(config) {
705
822
  `${EXT_CHECK_ENDPOINT}?${query.toString()}`
706
823
  );
707
824
  }
825
+ const verifyAccessToken = createVerifyAccessToken({
826
+ authMode,
827
+ baseUrl,
828
+ serviceApiKey,
829
+ logger,
830
+ createError,
831
+ errorCodes: FFID_ERROR_CODES
832
+ });
708
833
  return {
709
834
  getSession,
710
835
  signOut,
@@ -715,6 +840,7 @@ function createFFIDClient(config) {
715
840
  exchangeCodeForTokens,
716
841
  refreshAccessToken,
717
842
  checkSubscription,
843
+ verifyAccessToken,
718
844
  /** Token store (token mode only) */
719
845
  tokenStore,
720
846
  /** Resolved auth mode */
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunk5SXV6Y7Z_cjs = require('../chunk-5SXV6Y7Z.cjs');
3
+ var chunk5XOQIUEZ_cjs = require('../chunk-5XOQIUEZ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
8
8
  enumerable: true,
9
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDAnnouncementBadge; }
9
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDAnnouncementBadge; }
10
10
  });
11
11
  Object.defineProperty(exports, "FFIDAnnouncementList", {
12
12
  enumerable: true,
13
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDAnnouncementList; }
13
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDAnnouncementList; }
14
14
  });
15
15
  Object.defineProperty(exports, "FFIDLoginButton", {
16
16
  enumerable: true,
17
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDLoginButton; }
17
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDLoginButton; }
18
18
  });
19
19
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
20
20
  enumerable: true,
21
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDOrganizationSwitcher; }
21
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDOrganizationSwitcher; }
22
22
  });
23
23
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
24
24
  enumerable: true,
25
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDSubscriptionBadge; }
25
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDSubscriptionBadge; }
26
26
  });
27
27
  Object.defineProperty(exports, "FFIDUserMenu", {
28
28
  enumerable: true,
29
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDUserMenu; }
29
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDUserMenu; }
30
30
  });
@@ -1,3 +1,3 @@
1
- export { o as FFIDAnnouncementBadge, J as FFIDAnnouncementBadgeClassNames, K as FFIDAnnouncementBadgeProps, p as FFIDAnnouncementList, M as FFIDAnnouncementListClassNames, N as FFIDAnnouncementListProps, u as FFIDLoginButton, O as FFIDLoginButtonProps, z as FFIDOrganizationSwitcher, P as FFIDOrganizationSwitcherClassNames, Q as FFIDOrganizationSwitcherProps, D as FFIDSubscriptionBadge, R as FFIDSubscriptionBadgeClassNames, S as FFIDSubscriptionBadgeProps, G as FFIDUserMenu, T as FFIDUserMenuClassNames, V as FFIDUserMenuProps } from '../index-Bzwet6m2.cjs';
1
+ export { p as FFIDAnnouncementBadge, K as FFIDAnnouncementBadgeClassNames, M as FFIDAnnouncementBadgeProps, q as FFIDAnnouncementList, N as FFIDAnnouncementListClassNames, O as FFIDAnnouncementListProps, v as FFIDLoginButton, P as FFIDLoginButtonProps, z as FFIDOrganizationSwitcher, Q as FFIDOrganizationSwitcherClassNames, R as FFIDOrganizationSwitcherProps, D as FFIDSubscriptionBadge, S as FFIDSubscriptionBadgeClassNames, T as FFIDSubscriptionBadgeProps, H as FFIDUserMenu, V as FFIDUserMenuClassNames, W as FFIDUserMenuProps } from '../index-DHmt43kQ.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { o as FFIDAnnouncementBadge, J as FFIDAnnouncementBadgeClassNames, K as FFIDAnnouncementBadgeProps, p as FFIDAnnouncementList, M as FFIDAnnouncementListClassNames, N as FFIDAnnouncementListProps, u as FFIDLoginButton, O as FFIDLoginButtonProps, z as FFIDOrganizationSwitcher, P as FFIDOrganizationSwitcherClassNames, Q as FFIDOrganizationSwitcherProps, D as FFIDSubscriptionBadge, R as FFIDSubscriptionBadgeClassNames, S as FFIDSubscriptionBadgeProps, G as FFIDUserMenu, T as FFIDUserMenuClassNames, V as FFIDUserMenuProps } from '../index-Bzwet6m2.js';
1
+ export { p as FFIDAnnouncementBadge, K as FFIDAnnouncementBadgeClassNames, M as FFIDAnnouncementBadgeProps, q as FFIDAnnouncementList, N as FFIDAnnouncementListClassNames, O as FFIDAnnouncementListProps, v as FFIDLoginButton, P as FFIDLoginButtonProps, z as FFIDOrganizationSwitcher, Q as FFIDOrganizationSwitcherClassNames, R as FFIDOrganizationSwitcherProps, D as FFIDSubscriptionBadge, S as FFIDSubscriptionBadgeClassNames, T as FFIDSubscriptionBadgeProps, H as FFIDUserMenu, V as FFIDUserMenuClassNames, W as FFIDUserMenuProps } from '../index-DHmt43kQ.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
@@ -1 +1 @@
1
- export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-ELCMZ7KU.js';
1
+ export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-S2YL5Y4O.js';
@@ -9,7 +9,7 @@ import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
9
9
  /**
10
10
  * User information from FFID
11
11
  */
12
- type FFIDSeatModel = 'organization' | 'individual';
12
+ type FFIDSeatModel = 'organization';
13
13
  /** Userinfo member role for OAuth responses */
14
14
  type FFIDOAuthUserInfoMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
15
15
  interface FFIDUser {
@@ -104,8 +104,8 @@ interface FFIDOAuthUserInfo {
104
104
  email: string | null;
105
105
  name: string | null;
106
106
  picture: string | null;
107
- organizationId?: string | null;
108
- subscription?: FFIDOAuthUserInfoSubscription;
107
+ organizationId?: string | null | undefined;
108
+ subscription?: FFIDOAuthUserInfoSubscription | undefined;
109
109
  }
110
110
  /**
111
111
  * SDK configuration options
@@ -256,6 +256,35 @@ interface FFIDOAuthTokenResponse {
256
256
  expires_in: number;
257
257
  refresh_token: string;
258
258
  }
259
+ /**
260
+ * RFC 7662 Token Introspection response (raw format from server)
261
+ *
262
+ * Used internally by verifyAccessToken(). Consumers receive the normalized
263
+ * FFIDOAuthUserInfo type instead.
264
+ *
265
+ * @see https://tools.ietf.org/html/rfc7662
266
+ */
267
+ interface FFIDTokenIntrospectionResponse {
268
+ active: boolean;
269
+ sub?: string;
270
+ email?: string;
271
+ name?: string;
272
+ picture?: string | null;
273
+ scope?: string | null;
274
+ exp?: number;
275
+ iat?: number;
276
+ iss?: string;
277
+ token_type?: 'Bearer';
278
+ client_id?: string;
279
+ organization_id?: string | null;
280
+ subscription?: {
281
+ status: FFIDOAuthUserInfoSubscription['status'];
282
+ plan_code: string | null;
283
+ seat_model: FFIDOAuthUserInfoSubscription['seatModel'];
284
+ member_role: FFIDOAuthUserInfoSubscription['memberRole'];
285
+ organization_id: string | null;
286
+ };
287
+ }
259
288
 
260
289
  /**
261
290
  * FFID Announcements SDK Type Definitions
@@ -618,4 +647,4 @@ interface FFIDAnnouncementListProps {
618
647
  */
619
648
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
620
649
 
621
- export { type AnnouncementListResponse as A, type FFIDSeatModel as B, type FFIDSubscription as C, FFIDSubscriptionBadge as D, type FFIDSubscriptionStatus as E, type FFIDConfig as F, FFIDUserMenu as G, type UseFFIDAnnouncementsReturn as H, useFFIDAnnouncements as I, type FFIDAnnouncementBadgeClassNames as J, type FFIDAnnouncementBadgeProps as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementListClassNames as M, type FFIDAnnouncementListProps as N, type FFIDLoginButtonProps as O, type FFIDOrganizationSwitcherClassNames as P, type FFIDOrganizationSwitcherProps as Q, type FFIDSubscriptionBadgeClassNames as R, type FFIDSubscriptionBadgeProps as S, type FFIDUserMenuClassNames as T, type UseFFIDAnnouncementsOptions as U, type FFIDUserMenuProps as V, type FFIDApiResponse as a, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDLogger as e, type FFIDUser as f, type FFIDOrganization as g, type FFIDSubscriptionContextValue as h, type FFIDAnnouncementsClientConfig as i, type FFIDAnnouncementsApiResponse as j, type FFIDAnnouncementsLogger as k, type Announcement as l, type AnnouncementStatus as m, type AnnouncementType as n, FFIDAnnouncementBadge as o, FFIDAnnouncementList as p, type FFIDAnnouncementsError as q, type FFIDAnnouncementsErrorCode as r, type FFIDAnnouncementsServerResponse as s, type FFIDContextValue as t, FFIDLoginButton as u, type FFIDOAuthTokenResponse as v, type FFIDOAuthUserInfo as w, type FFIDOAuthUserInfoMemberRole as x, type FFIDOAuthUserInfoSubscription as y, FFIDOrganizationSwitcher as z };
650
+ export { type AnnouncementListResponse as A, type FFIDSeatModel as B, type FFIDSubscription as C, FFIDSubscriptionBadge as D, type FFIDSubscriptionStatus as E, type FFIDConfig as F, type FFIDTokenIntrospectionResponse as G, FFIDUserMenu as H, type UseFFIDAnnouncementsReturn as I, useFFIDAnnouncements as J, type FFIDAnnouncementBadgeClassNames as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementBadgeProps as M, type FFIDAnnouncementListClassNames as N, type FFIDAnnouncementListProps as O, type FFIDLoginButtonProps as P, type FFIDOrganizationSwitcherClassNames as Q, type FFIDOrganizationSwitcherProps as R, type FFIDSubscriptionBadgeClassNames as S, type FFIDSubscriptionBadgeProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDUserMenuClassNames as V, type FFIDUserMenuProps as W, type FFIDApiResponse as a, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDOAuthUserInfo as e, type FFIDLogger as f, type FFIDUser as g, type FFIDOrganization as h, type FFIDSubscriptionContextValue as i, type FFIDAnnouncementsClientConfig as j, type FFIDAnnouncementsApiResponse as k, type FFIDAnnouncementsLogger as l, type Announcement as m, type AnnouncementStatus as n, type AnnouncementType as o, FFIDAnnouncementBadge as p, FFIDAnnouncementList as q, type FFIDAnnouncementsError as r, type FFIDAnnouncementsErrorCode as s, type FFIDAnnouncementsServerResponse as t, type FFIDContextValue as u, FFIDLoginButton as v, type FFIDOAuthTokenResponse as w, type FFIDOAuthUserInfoMemberRole as x, type FFIDOAuthUserInfoSubscription as y, FFIDOrganizationSwitcher as z };
@@ -9,7 +9,7 @@ import { ButtonHTMLAttributes, ReactNode, CSSProperties } from 'react';
9
9
  /**
10
10
  * User information from FFID
11
11
  */
12
- type FFIDSeatModel = 'organization' | 'individual';
12
+ type FFIDSeatModel = 'organization';
13
13
  /** Userinfo member role for OAuth responses */
14
14
  type FFIDOAuthUserInfoMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
15
15
  interface FFIDUser {
@@ -104,8 +104,8 @@ interface FFIDOAuthUserInfo {
104
104
  email: string | null;
105
105
  name: string | null;
106
106
  picture: string | null;
107
- organizationId?: string | null;
108
- subscription?: FFIDOAuthUserInfoSubscription;
107
+ organizationId?: string | null | undefined;
108
+ subscription?: FFIDOAuthUserInfoSubscription | undefined;
109
109
  }
110
110
  /**
111
111
  * SDK configuration options
@@ -256,6 +256,35 @@ interface FFIDOAuthTokenResponse {
256
256
  expires_in: number;
257
257
  refresh_token: string;
258
258
  }
259
+ /**
260
+ * RFC 7662 Token Introspection response (raw format from server)
261
+ *
262
+ * Used internally by verifyAccessToken(). Consumers receive the normalized
263
+ * FFIDOAuthUserInfo type instead.
264
+ *
265
+ * @see https://tools.ietf.org/html/rfc7662
266
+ */
267
+ interface FFIDTokenIntrospectionResponse {
268
+ active: boolean;
269
+ sub?: string;
270
+ email?: string;
271
+ name?: string;
272
+ picture?: string | null;
273
+ scope?: string | null;
274
+ exp?: number;
275
+ iat?: number;
276
+ iss?: string;
277
+ token_type?: 'Bearer';
278
+ client_id?: string;
279
+ organization_id?: string | null;
280
+ subscription?: {
281
+ status: FFIDOAuthUserInfoSubscription['status'];
282
+ plan_code: string | null;
283
+ seat_model: FFIDOAuthUserInfoSubscription['seatModel'];
284
+ member_role: FFIDOAuthUserInfoSubscription['memberRole'];
285
+ organization_id: string | null;
286
+ };
287
+ }
259
288
 
260
289
  /**
261
290
  * FFID Announcements SDK Type Definitions
@@ -618,4 +647,4 @@ interface FFIDAnnouncementListProps {
618
647
  */
619
648
  declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
620
649
 
621
- export { type AnnouncementListResponse as A, type FFIDSeatModel as B, type FFIDSubscription as C, FFIDSubscriptionBadge as D, type FFIDSubscriptionStatus as E, type FFIDConfig as F, FFIDUserMenu as G, type UseFFIDAnnouncementsReturn as H, useFFIDAnnouncements as I, type FFIDAnnouncementBadgeClassNames as J, type FFIDAnnouncementBadgeProps as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementListClassNames as M, type FFIDAnnouncementListProps as N, type FFIDLoginButtonProps as O, type FFIDOrganizationSwitcherClassNames as P, type FFIDOrganizationSwitcherProps as Q, type FFIDSubscriptionBadgeClassNames as R, type FFIDSubscriptionBadgeProps as S, type FFIDUserMenuClassNames as T, type UseFFIDAnnouncementsOptions as U, type FFIDUserMenuProps as V, type FFIDApiResponse as a, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDLogger as e, type FFIDUser as f, type FFIDOrganization as g, type FFIDSubscriptionContextValue as h, type FFIDAnnouncementsClientConfig as i, type FFIDAnnouncementsApiResponse as j, type FFIDAnnouncementsLogger as k, type Announcement as l, type AnnouncementStatus as m, type AnnouncementType as n, FFIDAnnouncementBadge as o, FFIDAnnouncementList as p, type FFIDAnnouncementsError as q, type FFIDAnnouncementsErrorCode as r, type FFIDAnnouncementsServerResponse as s, type FFIDContextValue as t, FFIDLoginButton as u, type FFIDOAuthTokenResponse as v, type FFIDOAuthUserInfo as w, type FFIDOAuthUserInfoMemberRole as x, type FFIDOAuthUserInfoSubscription as y, FFIDOrganizationSwitcher as z };
650
+ export { type AnnouncementListResponse as A, type FFIDSeatModel as B, type FFIDSubscription as C, FFIDSubscriptionBadge as D, type FFIDSubscriptionStatus as E, type FFIDConfig as F, type FFIDTokenIntrospectionResponse as G, FFIDUserMenu as H, type UseFFIDAnnouncementsReturn as I, useFFIDAnnouncements as J, type FFIDAnnouncementBadgeClassNames as K, type ListAnnouncementsOptions as L, type FFIDAnnouncementBadgeProps as M, type FFIDAnnouncementListClassNames as N, type FFIDAnnouncementListProps as O, type FFIDLoginButtonProps as P, type FFIDOrganizationSwitcherClassNames as Q, type FFIDOrganizationSwitcherProps as R, type FFIDSubscriptionBadgeClassNames as S, type FFIDSubscriptionBadgeProps as T, type UseFFIDAnnouncementsOptions as U, type FFIDUserMenuClassNames as V, type FFIDUserMenuProps as W, type FFIDApiResponse as a, type FFIDSessionResponse as b, type FFIDError as c, type FFIDSubscriptionCheckResponse as d, type FFIDOAuthUserInfo as e, type FFIDLogger as f, type FFIDUser as g, type FFIDOrganization as h, type FFIDSubscriptionContextValue as i, type FFIDAnnouncementsClientConfig as j, type FFIDAnnouncementsApiResponse as k, type FFIDAnnouncementsLogger as l, type Announcement as m, type AnnouncementStatus as n, type AnnouncementType as o, FFIDAnnouncementBadge as p, FFIDAnnouncementList as q, type FFIDAnnouncementsError as r, type FFIDAnnouncementsErrorCode as s, type FFIDAnnouncementsServerResponse as t, type FFIDContextValue as u, FFIDLoginButton as v, type FFIDOAuthTokenResponse as w, type FFIDOAuthUserInfoMemberRole as x, type FFIDOAuthUserInfoSubscription as y, FFIDOrganizationSwitcher as z };
package/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunk5SXV6Y7Z_cjs = require('./chunk-5SXV6Y7Z.cjs');
3
+ var chunk5XOQIUEZ_cjs = require('./chunk-5XOQIUEZ.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
7
7
  function withFFIDAuth(Component, options = {}) {
8
8
  const WrappedComponent = (props) => {
9
- const { isLoading, isAuthenticated, login } = chunk5SXV6Y7Z_cjs.useFFIDContext();
9
+ const { isLoading, isAuthenticated, login } = chunk5XOQIUEZ_cjs.useFFIDContext();
10
10
  const hasRedirected = react.useRef(false);
11
11
  react.useEffect(() => {
12
12
  if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
@@ -31,82 +31,82 @@ function withFFIDAuth(Component, options = {}) {
31
31
 
32
32
  Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
33
33
  enumerable: true,
34
- get: function () { return chunk5SXV6Y7Z_cjs.DEFAULT_API_BASE_URL; }
34
+ get: function () { return chunk5XOQIUEZ_cjs.DEFAULT_API_BASE_URL; }
35
35
  });
36
36
  Object.defineProperty(exports, "FFIDAnnouncementBadge", {
37
37
  enumerable: true,
38
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDAnnouncementBadge; }
38
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDAnnouncementBadge; }
39
39
  });
40
40
  Object.defineProperty(exports, "FFIDAnnouncementList", {
41
41
  enumerable: true,
42
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDAnnouncementList; }
42
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDAnnouncementList; }
43
43
  });
44
44
  Object.defineProperty(exports, "FFIDLoginButton", {
45
45
  enumerable: true,
46
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDLoginButton; }
46
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDLoginButton; }
47
47
  });
48
48
  Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
49
49
  enumerable: true,
50
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDOrganizationSwitcher; }
50
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDOrganizationSwitcher; }
51
51
  });
52
52
  Object.defineProperty(exports, "FFIDProvider", {
53
53
  enumerable: true,
54
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDProvider; }
54
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDProvider; }
55
55
  });
56
56
  Object.defineProperty(exports, "FFIDSubscriptionBadge", {
57
57
  enumerable: true,
58
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDSubscriptionBadge; }
58
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDSubscriptionBadge; }
59
59
  });
60
60
  Object.defineProperty(exports, "FFIDUserMenu", {
61
61
  enumerable: true,
62
- get: function () { return chunk5SXV6Y7Z_cjs.FFIDUserMenu; }
62
+ get: function () { return chunk5XOQIUEZ_cjs.FFIDUserMenu; }
63
63
  });
64
64
  Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
65
65
  enumerable: true,
66
- get: function () { return chunk5SXV6Y7Z_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
66
+ get: function () { return chunk5XOQIUEZ_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
67
67
  });
68
68
  Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
69
69
  enumerable: true,
70
- get: function () { return chunk5SXV6Y7Z_cjs.createFFIDAnnouncementsClient; }
70
+ get: function () { return chunk5XOQIUEZ_cjs.createFFIDAnnouncementsClient; }
71
71
  });
72
72
  Object.defineProperty(exports, "createFFIDClient", {
73
73
  enumerable: true,
74
- get: function () { return chunk5SXV6Y7Z_cjs.createFFIDClient; }
74
+ get: function () { return chunk5XOQIUEZ_cjs.createFFIDClient; }
75
75
  });
76
76
  Object.defineProperty(exports, "createTokenStore", {
77
77
  enumerable: true,
78
- get: function () { return chunk5SXV6Y7Z_cjs.createTokenStore; }
78
+ get: function () { return chunk5XOQIUEZ_cjs.createTokenStore; }
79
79
  });
80
80
  Object.defineProperty(exports, "generateCodeChallenge", {
81
81
  enumerable: true,
82
- get: function () { return chunk5SXV6Y7Z_cjs.generateCodeChallenge; }
82
+ get: function () { return chunk5XOQIUEZ_cjs.generateCodeChallenge; }
83
83
  });
84
84
  Object.defineProperty(exports, "generateCodeVerifier", {
85
85
  enumerable: true,
86
- get: function () { return chunk5SXV6Y7Z_cjs.generateCodeVerifier; }
86
+ get: function () { return chunk5XOQIUEZ_cjs.generateCodeVerifier; }
87
87
  });
88
88
  Object.defineProperty(exports, "retrieveCodeVerifier", {
89
89
  enumerable: true,
90
- get: function () { return chunk5SXV6Y7Z_cjs.retrieveCodeVerifier; }
90
+ get: function () { return chunk5XOQIUEZ_cjs.retrieveCodeVerifier; }
91
91
  });
92
92
  Object.defineProperty(exports, "storeCodeVerifier", {
93
93
  enumerable: true,
94
- get: function () { return chunk5SXV6Y7Z_cjs.storeCodeVerifier; }
94
+ get: function () { return chunk5XOQIUEZ_cjs.storeCodeVerifier; }
95
95
  });
96
96
  Object.defineProperty(exports, "useFFID", {
97
97
  enumerable: true,
98
- get: function () { return chunk5SXV6Y7Z_cjs.useFFID; }
98
+ get: function () { return chunk5XOQIUEZ_cjs.useFFID; }
99
99
  });
100
100
  Object.defineProperty(exports, "useFFIDAnnouncements", {
101
101
  enumerable: true,
102
- get: function () { return chunk5SXV6Y7Z_cjs.useFFIDAnnouncements; }
102
+ get: function () { return chunk5XOQIUEZ_cjs.useFFIDAnnouncements; }
103
103
  });
104
104
  Object.defineProperty(exports, "useSubscription", {
105
105
  enumerable: true,
106
- get: function () { return chunk5SXV6Y7Z_cjs.useSubscription; }
106
+ get: function () { return chunk5XOQIUEZ_cjs.useSubscription; }
107
107
  });
108
108
  Object.defineProperty(exports, "withSubscription", {
109
109
  enumerable: true,
110
- get: function () { return chunk5SXV6Y7Z_cjs.withSubscription; }
110
+ get: function () { return chunk5XOQIUEZ_cjs.withSubscription; }
111
111
  });
112
112
  exports.withFFIDAuth = withFFIDAuth;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDLogger, f as FFIDUser, g as FFIDOrganization, h as FFIDSubscriptionContextValue, i as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, j as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, k as FFIDAnnouncementsLogger } from './index-Bzwet6m2.cjs';
2
- export { l as Announcement, m as AnnouncementStatus, n as AnnouncementType, o as FFIDAnnouncementBadge, p as FFIDAnnouncementList, q as FFIDAnnouncementsError, r as FFIDAnnouncementsErrorCode, s as FFIDAnnouncementsServerResponse, t as FFIDContextValue, u as FFIDLoginButton, v as FFIDOAuthTokenResponse, w as FFIDOAuthUserInfo, x as FFIDOAuthUserInfoMemberRole, y as FFIDOAuthUserInfoSubscription, z as FFIDOrganizationSwitcher, B as FFIDSeatModel, C as FFIDSubscription, D as FFIDSubscriptionBadge, E as FFIDSubscriptionStatus, G as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, H as UseFFIDAnnouncementsReturn, I as useFFIDAnnouncements } from './index-Bzwet6m2.cjs';
1
+ import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDOAuthUserInfo, f as FFIDLogger, g as FFIDUser, h as FFIDOrganization, i as FFIDSubscriptionContextValue, j as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, k as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, l as FFIDAnnouncementsLogger } from './index-DHmt43kQ.cjs';
2
+ export { m as Announcement, n as AnnouncementStatus, o as AnnouncementType, p as FFIDAnnouncementBadge, q as FFIDAnnouncementList, r as FFIDAnnouncementsError, s as FFIDAnnouncementsErrorCode, t as FFIDAnnouncementsServerResponse, u as FFIDContextValue, v as FFIDLoginButton, w as FFIDOAuthTokenResponse, x as FFIDOAuthUserInfoMemberRole, y as FFIDOAuthUserInfoSubscription, z as FFIDOrganizationSwitcher, B as FFIDSeatModel, C as FFIDSubscription, D as FFIDSubscriptionBadge, E as FFIDSubscriptionStatus, G as FFIDTokenIntrospectionResponse, H as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, I as UseFFIDAnnouncementsReturn, J as useFFIDAnnouncements } from './index-DHmt43kQ.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -84,8 +84,6 @@ declare function storeCodeVerifier(verifier: string): void;
84
84
  */
85
85
  declare function retrieveCodeVerifier(): string | null;
86
86
 
87
- /** FFID API Client - Supports cookie, token, and service-key auth modes */
88
-
89
87
  /** Creates an FFID API client instance */
90
88
  declare function createFFIDClient(config: FFIDConfig): {
91
89
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
@@ -100,6 +98,7 @@ declare function createFFIDClient(config: FFIDConfig): {
100
98
  userId: string;
101
99
  organizationId: string;
102
100
  }) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
101
+ verifyAccessToken: (accessToken: string) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
103
102
  /** Token store (token mode only) */
104
103
  tokenStore: TokenStore;
105
104
  /** Resolved auth mode */
@@ -339,4 +338,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
339
338
  /** Type of the FFID Announcements client */
340
339
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
341
340
 
342
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDClient, FFIDConfig, FFIDError, FFIDLogger, FFIDOrganization, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
341
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDClient, FFIDConfig, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDLogger, f as FFIDUser, g as FFIDOrganization, h as FFIDSubscriptionContextValue, i as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, j as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, k as FFIDAnnouncementsLogger } from './index-Bzwet6m2.js';
2
- export { l as Announcement, m as AnnouncementStatus, n as AnnouncementType, o as FFIDAnnouncementBadge, p as FFIDAnnouncementList, q as FFIDAnnouncementsError, r as FFIDAnnouncementsErrorCode, s as FFIDAnnouncementsServerResponse, t as FFIDContextValue, u as FFIDLoginButton, v as FFIDOAuthTokenResponse, w as FFIDOAuthUserInfo, x as FFIDOAuthUserInfoMemberRole, y as FFIDOAuthUserInfoSubscription, z as FFIDOrganizationSwitcher, B as FFIDSeatModel, C as FFIDSubscription, D as FFIDSubscriptionBadge, E as FFIDSubscriptionStatus, G as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, H as UseFFIDAnnouncementsReturn, I as useFFIDAnnouncements } from './index-Bzwet6m2.js';
1
+ import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDError, d as FFIDSubscriptionCheckResponse, e as FFIDOAuthUserInfo, f as FFIDLogger, g as FFIDUser, h as FFIDOrganization, i as FFIDSubscriptionContextValue, j as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, k as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, l as FFIDAnnouncementsLogger } from './index-DHmt43kQ.js';
2
+ export { m as Announcement, n as AnnouncementStatus, o as AnnouncementType, p as FFIDAnnouncementBadge, q as FFIDAnnouncementList, r as FFIDAnnouncementsError, s as FFIDAnnouncementsErrorCode, t as FFIDAnnouncementsServerResponse, u as FFIDContextValue, v as FFIDLoginButton, w as FFIDOAuthTokenResponse, x as FFIDOAuthUserInfoMemberRole, y as FFIDOAuthUserInfoSubscription, z as FFIDOrganizationSwitcher, B as FFIDSeatModel, C as FFIDSubscription, D as FFIDSubscriptionBadge, E as FFIDSubscriptionStatus, G as FFIDTokenIntrospectionResponse, H as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, I as UseFFIDAnnouncementsReturn, J as useFFIDAnnouncements } from './index-DHmt43kQ.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReactNode, ComponentType, FC } from 'react';
5
5
 
@@ -84,8 +84,6 @@ declare function storeCodeVerifier(verifier: string): void;
84
84
  */
85
85
  declare function retrieveCodeVerifier(): string | null;
86
86
 
87
- /** FFID API Client - Supports cookie, token, and service-key auth modes */
88
-
89
87
  /** Creates an FFID API client instance */
90
88
  declare function createFFIDClient(config: FFIDConfig): {
91
89
  getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
@@ -100,6 +98,7 @@ declare function createFFIDClient(config: FFIDConfig): {
100
98
  userId: string;
101
99
  organizationId: string;
102
100
  }) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
101
+ verifyAccessToken: (accessToken: string) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
103
102
  /** Token store (token mode only) */
104
103
  tokenStore: TokenStore;
105
104
  /** Resolved auth mode */
@@ -339,4 +338,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
339
338
  /** Type of the FFID Announcements client */
340
339
  type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
341
340
 
342
- export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDClient, FFIDConfig, FFIDError, FFIDLogger, FFIDOrganization, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
341
+ export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDClient, FFIDConfig, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, FFIDProvider, type FFIDProviderProps, FFIDSessionResponse, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFID_ANNOUNCEMENTS_ERROR_CODES, ListAnnouncementsOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useFFIDContext } from './chunk-ELCMZ7KU.js';
2
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-ELCMZ7KU.js';
1
+ import { useFFIDContext } from './chunk-S2YL5Y4O.js';
2
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-S2YL5Y4O.js';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, Fragment } from 'react/jsx-runtime';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",