@feelflow/ffid-sdk 5.24.2 → 5.25.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.
- package/dist/{chunk-Q7ZEF3EN.js → chunk-HIKX4AVY.js} +68 -33
- package/dist/{chunk-QMWUOVZK.cjs → chunk-ZFKXOTFF.cjs} +68 -33
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{ffid-client-D0Jh4bO7.d.cts → ffid-client-BZERrMAF.d.cts} +133 -82
- package/dist/{ffid-client-DX2PTTFr.d.ts → ffid-client-CFZPX5ej.d.ts} +133 -82
- package/dist/{index-GqflEaKi.d.cts → index-Dd6CMIBd.d.cts} +90 -92
- package/dist/{index-GqflEaKi.d.ts → index-Dd6CMIBd.d.ts} +90 -92
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +123 -45
- package/dist/index.d.ts +123 -45
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +58 -51
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +58 -51
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -114,6 +114,14 @@ function isSessionEligibleSubscriptionStatus(value) {
|
|
|
114
114
|
function hasOwnKey(value, key) {
|
|
115
115
|
return Object.prototype.hasOwnProperty.call(value, key);
|
|
116
116
|
}
|
|
117
|
+
function normalizeEntitlements(raw) {
|
|
118
|
+
if (!Array.isArray(raw)) return [];
|
|
119
|
+
return raw.flatMap((code) => {
|
|
120
|
+
if (typeof code !== "string") return [];
|
|
121
|
+
const trimmed = code.trim();
|
|
122
|
+
return trimmed.length > 0 ? [trimmed] : [];
|
|
123
|
+
});
|
|
124
|
+
}
|
|
117
125
|
function normalizeUserinfo(raw) {
|
|
118
126
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
119
127
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
@@ -154,7 +162,10 @@ function normalizeUserinfo(raw) {
|
|
|
154
162
|
// `'active_canceling'`) for legacy backends. Defaulting to `false`
|
|
155
163
|
// here keeps the downstream contract a plain boolean.
|
|
156
164
|
cancelAtPeriodEnd: raw.subscription.cancel_at_period_end ?? false,
|
|
157
|
-
currentPeriodEnd: raw.subscription.current_period_end ?? null
|
|
165
|
+
currentPeriodEnd: raw.subscription.current_period_end ?? null,
|
|
166
|
+
// #4333: legacy FFID (< this issue) omits the field on the wire; the
|
|
167
|
+
// guard defaults to `[]` so consumers always get a plain string[].
|
|
168
|
+
entitlements: normalizeEntitlements(raw.subscription.entitlements)
|
|
158
169
|
} : void 0
|
|
159
170
|
};
|
|
160
171
|
}
|
|
@@ -441,7 +452,11 @@ function createVerifyAccessToken(deps) {
|
|
|
441
452
|
member_role: introspectResponse.subscription.member_role,
|
|
442
453
|
organization_id: introspectResponse.subscription.organization_id,
|
|
443
454
|
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
444
|
-
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
455
|
+
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false,
|
|
456
|
+
// #4333: forward pack entitlement codes through the introspect →
|
|
457
|
+
// userinfo normalization boundary. normalizeUserinfo guards the
|
|
458
|
+
// value, so an older FFID that omits it degrades to `[]`.
|
|
459
|
+
entitlements: introspectResponse.subscription.entitlements
|
|
445
460
|
}
|
|
446
461
|
} : base;
|
|
447
462
|
const userinfo = normalizeUserinfo(raw);
|
|
@@ -1226,8 +1241,35 @@ function createNonContractMethods(deps) {
|
|
|
1226
1241
|
};
|
|
1227
1242
|
}
|
|
1228
1243
|
|
|
1244
|
+
// src/shared/token-response.ts
|
|
1245
|
+
function invalidTokenFields(tokenResponse) {
|
|
1246
|
+
const invalid = [];
|
|
1247
|
+
if (typeof tokenResponse.access_token !== "string" || tokenResponse.access_token.length === 0) {
|
|
1248
|
+
invalid.push("access_token");
|
|
1249
|
+
}
|
|
1250
|
+
if (typeof tokenResponse.refresh_token !== "string" || tokenResponse.refresh_token.length === 0) {
|
|
1251
|
+
invalid.push("refresh_token");
|
|
1252
|
+
}
|
|
1253
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1254
|
+
invalid.push("expires_in");
|
|
1255
|
+
}
|
|
1256
|
+
return invalid;
|
|
1257
|
+
}
|
|
1258
|
+
function hasValidatedTokens(tokenResponse) {
|
|
1259
|
+
return invalidTokenFields(tokenResponse).length === 0;
|
|
1260
|
+
}
|
|
1261
|
+
function validateTokenResponse(tokenResponse) {
|
|
1262
|
+
if (hasValidatedTokens(tokenResponse)) {
|
|
1263
|
+
return { ok: true, tokens: tokenResponse };
|
|
1264
|
+
}
|
|
1265
|
+
return {
|
|
1266
|
+
ok: false,
|
|
1267
|
+
message: `\u30C8\u30FC\u30AF\u30F3\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059: ${invalidTokenFields(tokenResponse).join(", ")}`
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1229
1271
|
// src/client/version-check.ts
|
|
1230
|
-
var SDK_VERSION = "5.
|
|
1272
|
+
var SDK_VERSION = "5.25.0";
|
|
1231
1273
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1232
1274
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1233
1275
|
function sdkHeaders() {
|
|
@@ -1274,31 +1316,6 @@ npm install @feelflow/ffid-sdk@latest \u3067\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8
|
|
|
1274
1316
|
var OAUTH_TOKEN_ENDPOINT = "/api/v1/oauth/token";
|
|
1275
1317
|
var OAUTH_REVOKE_ENDPOINT = "/api/v1/oauth/revoke";
|
|
1276
1318
|
var MS_PER_SECOND = 1e3;
|
|
1277
|
-
function invalidTokenFields(tokenResponse) {
|
|
1278
|
-
const invalid = [];
|
|
1279
|
-
if (!tokenResponse.access_token) {
|
|
1280
|
-
invalid.push("access_token");
|
|
1281
|
-
}
|
|
1282
|
-
if (!tokenResponse.refresh_token) {
|
|
1283
|
-
invalid.push("refresh_token");
|
|
1284
|
-
}
|
|
1285
|
-
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1286
|
-
invalid.push("expires_in");
|
|
1287
|
-
}
|
|
1288
|
-
return invalid;
|
|
1289
|
-
}
|
|
1290
|
-
function hasValidatedTokens(tokenResponse) {
|
|
1291
|
-
return invalidTokenFields(tokenResponse).length === 0;
|
|
1292
|
-
}
|
|
1293
|
-
function validateTokenResponse(tokenResponse) {
|
|
1294
|
-
if (hasValidatedTokens(tokenResponse)) {
|
|
1295
|
-
return { ok: true, tokens: tokenResponse };
|
|
1296
|
-
}
|
|
1297
|
-
return {
|
|
1298
|
-
ok: false,
|
|
1299
|
-
message: `\u30C8\u30FC\u30AF\u30F3\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059: ${invalidTokenFields(tokenResponse).join(", ")}`
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
1319
|
function createOAuthTokenMethods(deps) {
|
|
1303
1320
|
const {
|
|
1304
1321
|
baseUrl,
|
|
@@ -3019,10 +3036,16 @@ function createFFIDClient(config) {
|
|
|
3019
3036
|
}
|
|
3020
3037
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
3021
3038
|
const resolvedRedirectUri = resolveRedirectUri(rawRedirectUri, logger);
|
|
3022
|
-
const tokenStore = authMode === "token" ? createTokenStore() : createTokenStore("memory");
|
|
3039
|
+
const tokenStore = authMode === "token" ? config.tokenStore ?? createTokenStore() : createTokenStore("memory");
|
|
3023
3040
|
function createError(code, message) {
|
|
3024
3041
|
return { code, message };
|
|
3025
3042
|
}
|
|
3043
|
+
function getAccessToken() {
|
|
3044
|
+
if (authMode !== "token") return null;
|
|
3045
|
+
if (tokenStore.isAccessTokenExpired()) return null;
|
|
3046
|
+
const accessToken = tokenStore.getTokens()?.accessToken;
|
|
3047
|
+
return accessToken && accessToken.length > 0 ? accessToken : null;
|
|
3048
|
+
}
|
|
3026
3049
|
function buildFetchOptions(options, authOverride) {
|
|
3027
3050
|
if (authOverride) {
|
|
3028
3051
|
return {
|
|
@@ -3432,6 +3455,11 @@ function createFFIDClient(config) {
|
|
|
3432
3455
|
inquiry,
|
|
3433
3456
|
/** Token store (token mode only) */
|
|
3434
3457
|
tokenStore,
|
|
3458
|
+
/**
|
|
3459
|
+
* Return the currently-valid access token, or null (token mode only; #4318).
|
|
3460
|
+
* Live-reads the store and applies the 30s expiry buffer.
|
|
3461
|
+
*/
|
|
3462
|
+
getAccessToken,
|
|
3435
3463
|
/** Resolved auth mode */
|
|
3436
3464
|
authMode,
|
|
3437
3465
|
/** Resolved logger instance */
|
|
@@ -3556,6 +3584,7 @@ function FFIDProvider({
|
|
|
3556
3584
|
authMode,
|
|
3557
3585
|
clientId,
|
|
3558
3586
|
timeout,
|
|
3587
|
+
tokenStore,
|
|
3559
3588
|
cleanCallbackUrl = true
|
|
3560
3589
|
}) {
|
|
3561
3590
|
const [user, setUser] = useState(null);
|
|
@@ -3581,9 +3610,10 @@ function FFIDProvider({
|
|
|
3581
3610
|
logger,
|
|
3582
3611
|
authMode,
|
|
3583
3612
|
clientId,
|
|
3584
|
-
timeout
|
|
3613
|
+
timeout,
|
|
3614
|
+
tokenStore
|
|
3585
3615
|
}),
|
|
3586
|
-
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId, timeout]
|
|
3616
|
+
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId, timeout, tokenStore]
|
|
3587
3617
|
);
|
|
3588
3618
|
const refresh = useCallback(async () => {
|
|
3589
3619
|
client.logger.debug("Refreshing session...");
|
|
@@ -3797,7 +3827,10 @@ function FFIDProvider({
|
|
|
3797
3827
|
login,
|
|
3798
3828
|
logout,
|
|
3799
3829
|
switchOrganization,
|
|
3800
|
-
refresh
|
|
3830
|
+
refresh,
|
|
3831
|
+
// Stable across renders (client is memoized): live-reads the shared store
|
|
3832
|
+
// so refreshed/cleared tokens are reflected without host polling (#4318).
|
|
3833
|
+
getAccessToken: client.getAccessToken
|
|
3801
3834
|
}),
|
|
3802
3835
|
[
|
|
3803
3836
|
user,
|
|
@@ -3809,7 +3842,8 @@ function FFIDProvider({
|
|
|
3809
3842
|
login,
|
|
3810
3843
|
logout,
|
|
3811
3844
|
switchOrganization,
|
|
3812
|
-
refresh
|
|
3845
|
+
refresh,
|
|
3846
|
+
client
|
|
3813
3847
|
]
|
|
3814
3848
|
);
|
|
3815
3849
|
return /* @__PURE__ */ jsx(FFIDClientContext.Provider, { value: client, children: /* @__PURE__ */ jsx(FFIDContext.Provider, { value: contextValue, children }) });
|
|
@@ -3848,6 +3882,7 @@ function useFFID() {
|
|
|
3848
3882
|
switchAccount: client.switchAccount,
|
|
3849
3883
|
switchOrganization: context.switchOrganization,
|
|
3850
3884
|
refresh: context.refresh,
|
|
3885
|
+
getAccessToken: context.getAccessToken,
|
|
3851
3886
|
getLoginUrl: client.getLoginUrl,
|
|
3852
3887
|
getSignupUrl: client.getSignupUrl,
|
|
3853
3888
|
getSubscribeUrl: client.getSubscribeUrl,
|
|
@@ -116,6 +116,14 @@ function isSessionEligibleSubscriptionStatus(value) {
|
|
|
116
116
|
function hasOwnKey(value, key) {
|
|
117
117
|
return Object.prototype.hasOwnProperty.call(value, key);
|
|
118
118
|
}
|
|
119
|
+
function normalizeEntitlements(raw) {
|
|
120
|
+
if (!Array.isArray(raw)) return [];
|
|
121
|
+
return raw.flatMap((code) => {
|
|
122
|
+
if (typeof code !== "string") return [];
|
|
123
|
+
const trimmed = code.trim();
|
|
124
|
+
return trimmed.length > 0 ? [trimmed] : [];
|
|
125
|
+
});
|
|
126
|
+
}
|
|
119
127
|
function normalizeUserinfo(raw) {
|
|
120
128
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
121
129
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
@@ -156,7 +164,10 @@ function normalizeUserinfo(raw) {
|
|
|
156
164
|
// `'active_canceling'`) for legacy backends. Defaulting to `false`
|
|
157
165
|
// here keeps the downstream contract a plain boolean.
|
|
158
166
|
cancelAtPeriodEnd: raw.subscription.cancel_at_period_end ?? false,
|
|
159
|
-
currentPeriodEnd: raw.subscription.current_period_end ?? null
|
|
167
|
+
currentPeriodEnd: raw.subscription.current_period_end ?? null,
|
|
168
|
+
// #4333: legacy FFID (< this issue) omits the field on the wire; the
|
|
169
|
+
// guard defaults to `[]` so consumers always get a plain string[].
|
|
170
|
+
entitlements: normalizeEntitlements(raw.subscription.entitlements)
|
|
160
171
|
} : void 0
|
|
161
172
|
};
|
|
162
173
|
}
|
|
@@ -443,7 +454,11 @@ function createVerifyAccessToken(deps) {
|
|
|
443
454
|
member_role: introspectResponse.subscription.member_role,
|
|
444
455
|
organization_id: introspectResponse.subscription.organization_id,
|
|
445
456
|
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
446
|
-
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
457
|
+
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false,
|
|
458
|
+
// #4333: forward pack entitlement codes through the introspect →
|
|
459
|
+
// userinfo normalization boundary. normalizeUserinfo guards the
|
|
460
|
+
// value, so an older FFID that omits it degrades to `[]`.
|
|
461
|
+
entitlements: introspectResponse.subscription.entitlements
|
|
447
462
|
}
|
|
448
463
|
} : base;
|
|
449
464
|
const userinfo = normalizeUserinfo(raw);
|
|
@@ -1228,8 +1243,35 @@ function createNonContractMethods(deps) {
|
|
|
1228
1243
|
};
|
|
1229
1244
|
}
|
|
1230
1245
|
|
|
1246
|
+
// src/shared/token-response.ts
|
|
1247
|
+
function invalidTokenFields(tokenResponse) {
|
|
1248
|
+
const invalid = [];
|
|
1249
|
+
if (typeof tokenResponse.access_token !== "string" || tokenResponse.access_token.length === 0) {
|
|
1250
|
+
invalid.push("access_token");
|
|
1251
|
+
}
|
|
1252
|
+
if (typeof tokenResponse.refresh_token !== "string" || tokenResponse.refresh_token.length === 0) {
|
|
1253
|
+
invalid.push("refresh_token");
|
|
1254
|
+
}
|
|
1255
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1256
|
+
invalid.push("expires_in");
|
|
1257
|
+
}
|
|
1258
|
+
return invalid;
|
|
1259
|
+
}
|
|
1260
|
+
function hasValidatedTokens(tokenResponse) {
|
|
1261
|
+
return invalidTokenFields(tokenResponse).length === 0;
|
|
1262
|
+
}
|
|
1263
|
+
function validateTokenResponse(tokenResponse) {
|
|
1264
|
+
if (hasValidatedTokens(tokenResponse)) {
|
|
1265
|
+
return { ok: true, tokens: tokenResponse };
|
|
1266
|
+
}
|
|
1267
|
+
return {
|
|
1268
|
+
ok: false,
|
|
1269
|
+
message: `\u30C8\u30FC\u30AF\u30F3\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059: ${invalidTokenFields(tokenResponse).join(", ")}`
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1231
1273
|
// src/client/version-check.ts
|
|
1232
|
-
var SDK_VERSION = "5.
|
|
1274
|
+
var SDK_VERSION = "5.25.0";
|
|
1233
1275
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1234
1276
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1235
1277
|
function sdkHeaders() {
|
|
@@ -1276,31 +1318,6 @@ npm install @feelflow/ffid-sdk@latest \u3067\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8
|
|
|
1276
1318
|
var OAUTH_TOKEN_ENDPOINT = "/api/v1/oauth/token";
|
|
1277
1319
|
var OAUTH_REVOKE_ENDPOINT = "/api/v1/oauth/revoke";
|
|
1278
1320
|
var MS_PER_SECOND = 1e3;
|
|
1279
|
-
function invalidTokenFields(tokenResponse) {
|
|
1280
|
-
const invalid = [];
|
|
1281
|
-
if (!tokenResponse.access_token) {
|
|
1282
|
-
invalid.push("access_token");
|
|
1283
|
-
}
|
|
1284
|
-
if (!tokenResponse.refresh_token) {
|
|
1285
|
-
invalid.push("refresh_token");
|
|
1286
|
-
}
|
|
1287
|
-
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1288
|
-
invalid.push("expires_in");
|
|
1289
|
-
}
|
|
1290
|
-
return invalid;
|
|
1291
|
-
}
|
|
1292
|
-
function hasValidatedTokens(tokenResponse) {
|
|
1293
|
-
return invalidTokenFields(tokenResponse).length === 0;
|
|
1294
|
-
}
|
|
1295
|
-
function validateTokenResponse(tokenResponse) {
|
|
1296
|
-
if (hasValidatedTokens(tokenResponse)) {
|
|
1297
|
-
return { ok: true, tokens: tokenResponse };
|
|
1298
|
-
}
|
|
1299
|
-
return {
|
|
1300
|
-
ok: false,
|
|
1301
|
-
message: `\u30C8\u30FC\u30AF\u30F3\u30EC\u30B9\u30DD\u30F3\u30B9\u306B\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059: ${invalidTokenFields(tokenResponse).join(", ")}`
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
1321
|
function createOAuthTokenMethods(deps) {
|
|
1305
1322
|
const {
|
|
1306
1323
|
baseUrl,
|
|
@@ -3021,10 +3038,16 @@ function createFFIDClient(config) {
|
|
|
3021
3038
|
}
|
|
3022
3039
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
3023
3040
|
const resolvedRedirectUri = resolveRedirectUri(rawRedirectUri, logger);
|
|
3024
|
-
const tokenStore = authMode === "token" ? createTokenStore() : createTokenStore("memory");
|
|
3041
|
+
const tokenStore = authMode === "token" ? config.tokenStore ?? createTokenStore() : createTokenStore("memory");
|
|
3025
3042
|
function createError(code, message) {
|
|
3026
3043
|
return { code, message };
|
|
3027
3044
|
}
|
|
3045
|
+
function getAccessToken() {
|
|
3046
|
+
if (authMode !== "token") return null;
|
|
3047
|
+
if (tokenStore.isAccessTokenExpired()) return null;
|
|
3048
|
+
const accessToken = tokenStore.getTokens()?.accessToken;
|
|
3049
|
+
return accessToken && accessToken.length > 0 ? accessToken : null;
|
|
3050
|
+
}
|
|
3028
3051
|
function buildFetchOptions(options, authOverride) {
|
|
3029
3052
|
if (authOverride) {
|
|
3030
3053
|
return {
|
|
@@ -3434,6 +3457,11 @@ function createFFIDClient(config) {
|
|
|
3434
3457
|
inquiry,
|
|
3435
3458
|
/** Token store (token mode only) */
|
|
3436
3459
|
tokenStore,
|
|
3460
|
+
/**
|
|
3461
|
+
* Return the currently-valid access token, or null (token mode only; #4318).
|
|
3462
|
+
* Live-reads the store and applies the 30s expiry buffer.
|
|
3463
|
+
*/
|
|
3464
|
+
getAccessToken,
|
|
3437
3465
|
/** Resolved auth mode */
|
|
3438
3466
|
authMode,
|
|
3439
3467
|
/** Resolved logger instance */
|
|
@@ -3558,6 +3586,7 @@ function FFIDProvider({
|
|
|
3558
3586
|
authMode,
|
|
3559
3587
|
clientId,
|
|
3560
3588
|
timeout,
|
|
3589
|
+
tokenStore,
|
|
3561
3590
|
cleanCallbackUrl = true
|
|
3562
3591
|
}) {
|
|
3563
3592
|
const [user, setUser] = react.useState(null);
|
|
@@ -3583,9 +3612,10 @@ function FFIDProvider({
|
|
|
3583
3612
|
logger,
|
|
3584
3613
|
authMode,
|
|
3585
3614
|
clientId,
|
|
3586
|
-
timeout
|
|
3615
|
+
timeout,
|
|
3616
|
+
tokenStore
|
|
3587
3617
|
}),
|
|
3588
|
-
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId, timeout]
|
|
3618
|
+
[serviceCode, scope, apiBaseUrl, debug, logger, authMode, clientId, timeout, tokenStore]
|
|
3589
3619
|
);
|
|
3590
3620
|
const refresh = react.useCallback(async () => {
|
|
3591
3621
|
client.logger.debug("Refreshing session...");
|
|
@@ -3799,7 +3829,10 @@ function FFIDProvider({
|
|
|
3799
3829
|
login,
|
|
3800
3830
|
logout,
|
|
3801
3831
|
switchOrganization,
|
|
3802
|
-
refresh
|
|
3832
|
+
refresh,
|
|
3833
|
+
// Stable across renders (client is memoized): live-reads the shared store
|
|
3834
|
+
// so refreshed/cleared tokens are reflected without host polling (#4318).
|
|
3835
|
+
getAccessToken: client.getAccessToken
|
|
3803
3836
|
}),
|
|
3804
3837
|
[
|
|
3805
3838
|
user,
|
|
@@ -3811,7 +3844,8 @@ function FFIDProvider({
|
|
|
3811
3844
|
login,
|
|
3812
3845
|
logout,
|
|
3813
3846
|
switchOrganization,
|
|
3814
|
-
refresh
|
|
3847
|
+
refresh,
|
|
3848
|
+
client
|
|
3815
3849
|
]
|
|
3816
3850
|
);
|
|
3817
3851
|
return /* @__PURE__ */ jsxRuntime.jsx(FFIDClientContext.Provider, { value: client, children: /* @__PURE__ */ jsxRuntime.jsx(FFIDContext.Provider, { value: contextValue, children }) });
|
|
@@ -3850,6 +3884,7 @@ function useFFID() {
|
|
|
3850
3884
|
switchAccount: client.switchAccount,
|
|
3851
3885
|
switchOrganization: context.switchOrganization,
|
|
3852
3886
|
refresh: context.refresh,
|
|
3887
|
+
getAccessToken: context.getAccessToken,
|
|
3853
3888
|
getLoginUrl: client.getLoginUrl,
|
|
3854
3889
|
getSignupUrl: client.getSignupUrl,
|
|
3855
3890
|
getSubscribeUrl: client.getSubscribeUrl,
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZFKXOTFF_cjs = require('../chunk-ZFKXOTFF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkZFKXOTFF_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { G as FFIDAnnouncementBadge, ah as FFIDAnnouncementBadgeClassNames, ai as FFIDAnnouncementBadgeProps, H as FFIDAnnouncementList, aj as FFIDAnnouncementListClassNames, ak as FFIDAnnouncementListProps, R as FFIDInquiryForm, S as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a1 as FFIDLoginButton, al as FFIDLoginButtonProps, a3 as FFIDOrganizationSwitcher, am as FFIDOrganizationSwitcherClassNames, an as FFIDOrganizationSwitcherProps, a7 as FFIDSubscriptionBadge, ao as FFIDSubscriptionBadgeClassNames, ap as FFIDSubscriptionBadgeProps, a8 as FFIDUserMenu, aq as FFIDUserMenuClassNames, ar as FFIDUserMenuProps } from '../index-Dd6CMIBd.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { G as FFIDAnnouncementBadge, ah as FFIDAnnouncementBadgeClassNames, ai as FFIDAnnouncementBadgeProps, H as FFIDAnnouncementList, aj as FFIDAnnouncementListClassNames, ak as FFIDAnnouncementListProps, R as FFIDInquiryForm, S as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a1 as FFIDLoginButton, al as FFIDLoginButtonProps, a3 as FFIDOrganizationSwitcher, am as FFIDOrganizationSwitcherClassNames, an as FFIDOrganizationSwitcherProps, a7 as FFIDSubscriptionBadge, ao as FFIDSubscriptionBadgeClassNames, ap as FFIDSubscriptionBadgeProps, a8 as FFIDUserMenu, aq as FFIDUserMenuClassNames, ar as FFIDUserMenuProps } from '../index-Dd6CMIBd.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-
|
|
1
|
+
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-HIKX4AVY.js';
|