@feelflow/ffid-sdk 1.1.1 → 1.2.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-USE5Q2OF.js → chunk-4CVQ5THN.js} +32 -6
- package/dist/{chunk-4QMSVP3G.cjs → chunk-DFZPKRHW.cjs} +32 -6
- package/dist/components/index.cjs +7 -7
- 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/{index-CyYHo3-R.d.cts → index-BqhbNrX_.d.cts} +18 -3
- package/dist/{index-CyYHo3-R.d.ts → index-BqhbNrX_.d.ts} +18 -3
- package/dist/index.cjs +21 -21
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -185,6 +185,7 @@ var OAUTH_TOKEN_ENDPOINT = "/api/v1/oauth/token";
|
|
|
185
185
|
var OAUTH_USERINFO_ENDPOINT = "/api/v1/oauth/userinfo";
|
|
186
186
|
var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
|
|
187
187
|
var OAUTH_REVOKE_ENDPOINT = "/api/v1/oauth/revoke";
|
|
188
|
+
var EXT_CHECK_ENDPOINT = "/api/v1/subscriptions/ext/check";
|
|
188
189
|
var SDK_LOG_PREFIX = "[FFID SDK]";
|
|
189
190
|
var MS_PER_SECOND = 1e3;
|
|
190
191
|
var UNAUTHORIZED_STATUS = 401;
|
|
@@ -206,17 +207,11 @@ var consoleLogger = {
|
|
|
206
207
|
error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
|
|
207
208
|
};
|
|
208
209
|
var FFID_ERROR_CODES = {
|
|
209
|
-
/** Network request failed (fetch threw) */
|
|
210
210
|
NETWORK_ERROR: "NETWORK_ERROR",
|
|
211
|
-
/** Server returned non-JSON response (e.g., HTML error page) */
|
|
212
211
|
PARSE_ERROR: "PARSE_ERROR",
|
|
213
|
-
/** Server returned error without structured error body */
|
|
214
212
|
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
215
|
-
/** Token exchange failed */
|
|
216
213
|
TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
|
|
217
|
-
/** Token refresh failed */
|
|
218
214
|
TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
|
|
219
|
-
/** No tokens available */
|
|
220
215
|
NO_TOKENS: "NO_TOKENS"
|
|
221
216
|
};
|
|
222
217
|
function createFFIDClient(config) {
|
|
@@ -226,6 +221,10 @@ function createFFIDClient(config) {
|
|
|
226
221
|
const baseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
227
222
|
const authMode = config.authMode ?? "cookie";
|
|
228
223
|
const clientId = config.clientId ?? config.serviceCode;
|
|
224
|
+
const serviceApiKey = config.serviceApiKey?.trim();
|
|
225
|
+
if (authMode === "service-key" && !serviceApiKey) {
|
|
226
|
+
throw new Error("FFID Client: service-key \u30E2\u30FC\u30C9\u3067\u306F serviceApiKey \u304C\u5FC5\u9808\u3067\u3059");
|
|
227
|
+
}
|
|
229
228
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
230
229
|
const tokenStore = authMode === "token" ? createTokenStore() : createTokenStore("memory");
|
|
231
230
|
async function fetchWithAuth(endpoint, options = {}) {
|
|
@@ -294,6 +293,17 @@ function createFFIDClient(config) {
|
|
|
294
293
|
return { data: raw.data };
|
|
295
294
|
}
|
|
296
295
|
function buildFetchOptions(options) {
|
|
296
|
+
if (authMode === "service-key") {
|
|
297
|
+
return {
|
|
298
|
+
...options,
|
|
299
|
+
credentials: "omit",
|
|
300
|
+
headers: {
|
|
301
|
+
"Content-Type": "application/json",
|
|
302
|
+
"X-Service-Api-Key": serviceApiKey,
|
|
303
|
+
...options.headers
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
297
307
|
if (authMode === "token") {
|
|
298
308
|
const tokens = tokenStore.getTokens();
|
|
299
309
|
const headers = {
|
|
@@ -680,6 +690,21 @@ function createFFIDClient(config) {
|
|
|
680
690
|
function createError(code, message) {
|
|
681
691
|
return { code, message };
|
|
682
692
|
}
|
|
693
|
+
async function checkSubscription(params) {
|
|
694
|
+
if (!params.userId || !params.organizationId) {
|
|
695
|
+
return {
|
|
696
|
+
error: createError("VALIDATION_ERROR", "userId \u3068 organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
const query = new URLSearchParams({
|
|
700
|
+
userId: params.userId,
|
|
701
|
+
organizationId: params.organizationId,
|
|
702
|
+
serviceCode: config.serviceCode
|
|
703
|
+
});
|
|
704
|
+
return fetchWithAuth(
|
|
705
|
+
`${EXT_CHECK_ENDPOINT}?${query.toString()}`
|
|
706
|
+
);
|
|
707
|
+
}
|
|
683
708
|
return {
|
|
684
709
|
getSession,
|
|
685
710
|
signOut,
|
|
@@ -689,6 +714,7 @@ function createFFIDClient(config) {
|
|
|
689
714
|
createError,
|
|
690
715
|
exchangeCodeForTokens,
|
|
691
716
|
refreshAccessToken,
|
|
717
|
+
checkSubscription,
|
|
692
718
|
/** Token store (token mode only) */
|
|
693
719
|
tokenStore,
|
|
694
720
|
/** Resolved auth mode */
|
|
@@ -187,6 +187,7 @@ var OAUTH_TOKEN_ENDPOINT = "/api/v1/oauth/token";
|
|
|
187
187
|
var OAUTH_USERINFO_ENDPOINT = "/api/v1/oauth/userinfo";
|
|
188
188
|
var OAUTH_AUTHORIZE_ENDPOINT = "/api/v1/oauth/authorize";
|
|
189
189
|
var OAUTH_REVOKE_ENDPOINT = "/api/v1/oauth/revoke";
|
|
190
|
+
var EXT_CHECK_ENDPOINT = "/api/v1/subscriptions/ext/check";
|
|
190
191
|
var SDK_LOG_PREFIX = "[FFID SDK]";
|
|
191
192
|
var MS_PER_SECOND = 1e3;
|
|
192
193
|
var UNAUTHORIZED_STATUS = 401;
|
|
@@ -208,17 +209,11 @@ var consoleLogger = {
|
|
|
208
209
|
error: (...args) => console.error(SDK_LOG_PREFIX, ...args)
|
|
209
210
|
};
|
|
210
211
|
var FFID_ERROR_CODES = {
|
|
211
|
-
/** Network request failed (fetch threw) */
|
|
212
212
|
NETWORK_ERROR: "NETWORK_ERROR",
|
|
213
|
-
/** Server returned non-JSON response (e.g., HTML error page) */
|
|
214
213
|
PARSE_ERROR: "PARSE_ERROR",
|
|
215
|
-
/** Server returned error without structured error body */
|
|
216
214
|
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
217
|
-
/** Token exchange failed */
|
|
218
215
|
TOKEN_EXCHANGE_ERROR: "TOKEN_EXCHANGE_ERROR",
|
|
219
|
-
/** Token refresh failed */
|
|
220
216
|
TOKEN_REFRESH_ERROR: "TOKEN_REFRESH_ERROR",
|
|
221
|
-
/** No tokens available */
|
|
222
217
|
NO_TOKENS: "NO_TOKENS"
|
|
223
218
|
};
|
|
224
219
|
function createFFIDClient(config) {
|
|
@@ -228,6 +223,10 @@ function createFFIDClient(config) {
|
|
|
228
223
|
const baseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
229
224
|
const authMode = config.authMode ?? "cookie";
|
|
230
225
|
const clientId = config.clientId ?? config.serviceCode;
|
|
226
|
+
const serviceApiKey = config.serviceApiKey?.trim();
|
|
227
|
+
if (authMode === "service-key" && !serviceApiKey) {
|
|
228
|
+
throw new Error("FFID Client: service-key \u30E2\u30FC\u30C9\u3067\u306F serviceApiKey \u304C\u5FC5\u9808\u3067\u3059");
|
|
229
|
+
}
|
|
231
230
|
const logger = config.logger ?? (config.debug ? consoleLogger : noopLogger);
|
|
232
231
|
const tokenStore = authMode === "token" ? createTokenStore() : createTokenStore("memory");
|
|
233
232
|
async function fetchWithAuth(endpoint, options = {}) {
|
|
@@ -296,6 +295,17 @@ function createFFIDClient(config) {
|
|
|
296
295
|
return { data: raw.data };
|
|
297
296
|
}
|
|
298
297
|
function buildFetchOptions(options) {
|
|
298
|
+
if (authMode === "service-key") {
|
|
299
|
+
return {
|
|
300
|
+
...options,
|
|
301
|
+
credentials: "omit",
|
|
302
|
+
headers: {
|
|
303
|
+
"Content-Type": "application/json",
|
|
304
|
+
"X-Service-Api-Key": serviceApiKey,
|
|
305
|
+
...options.headers
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
299
309
|
if (authMode === "token") {
|
|
300
310
|
const tokens = tokenStore.getTokens();
|
|
301
311
|
const headers = {
|
|
@@ -682,6 +692,21 @@ function createFFIDClient(config) {
|
|
|
682
692
|
function createError(code, message) {
|
|
683
693
|
return { code, message };
|
|
684
694
|
}
|
|
695
|
+
async function checkSubscription(params) {
|
|
696
|
+
if (!params.userId || !params.organizationId) {
|
|
697
|
+
return {
|
|
698
|
+
error: createError("VALIDATION_ERROR", "userId \u3068 organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
const query = new URLSearchParams({
|
|
702
|
+
userId: params.userId,
|
|
703
|
+
organizationId: params.organizationId,
|
|
704
|
+
serviceCode: config.serviceCode
|
|
705
|
+
});
|
|
706
|
+
return fetchWithAuth(
|
|
707
|
+
`${EXT_CHECK_ENDPOINT}?${query.toString()}`
|
|
708
|
+
);
|
|
709
|
+
}
|
|
685
710
|
return {
|
|
686
711
|
getSession,
|
|
687
712
|
signOut,
|
|
@@ -691,6 +716,7 @@ function createFFIDClient(config) {
|
|
|
691
716
|
createError,
|
|
692
717
|
exchangeCodeForTokens,
|
|
693
718
|
refreshAccessToken,
|
|
719
|
+
checkSubscription,
|
|
694
720
|
/** Token store (token mode only) */
|
|
695
721
|
tokenStore,
|
|
696
722
|
/** Resolved auth mode */
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDFZPKRHW_cjs = require('../chunk-DFZPKRHW.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 chunkDFZPKRHW_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDLoginButton; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDOrganizationSwitcher; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDSubscriptionBadge; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDUserMenu; }
|
|
30
30
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { k as FFIDAnnouncementBadge,
|
|
1
|
+
export { k as FFIDAnnouncementBadge, J as FFIDAnnouncementBadgeClassNames, K as FFIDAnnouncementBadgeProps, l as FFIDAnnouncementList, M as FFIDAnnouncementListClassNames, N as FFIDAnnouncementListProps, s as FFIDLoginButton, O as FFIDLoginButtonProps, x as FFIDOrganizationSwitcher, P as FFIDOrganizationSwitcherClassNames, Q as FFIDOrganizationSwitcherProps, C as FFIDSubscriptionBadge, R as FFIDSubscriptionBadgeClassNames, S as FFIDSubscriptionBadgeProps, G as FFIDUserMenu, T as FFIDUserMenuClassNames, V as FFIDUserMenuProps } from '../index-BqhbNrX_.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { k as FFIDAnnouncementBadge,
|
|
1
|
+
export { k as FFIDAnnouncementBadge, J as FFIDAnnouncementBadgeClassNames, K as FFIDAnnouncementBadgeProps, l as FFIDAnnouncementList, M as FFIDAnnouncementListClassNames, N as FFIDAnnouncementListProps, s as FFIDLoginButton, O as FFIDLoginButtonProps, x as FFIDOrganizationSwitcher, P as FFIDOrganizationSwitcherClassNames, Q as FFIDOrganizationSwitcherProps, C as FFIDSubscriptionBadge, R as FFIDSubscriptionBadgeClassNames, S as FFIDSubscriptionBadgeProps, G as FFIDUserMenu, T as FFIDUserMenuClassNames, V as FFIDUserMenuProps } from '../index-BqhbNrX_.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-
|
|
1
|
+
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-4CVQ5THN.js';
|
|
@@ -133,10 +133,12 @@ interface FFIDConfig {
|
|
|
133
133
|
onAuthStateChange?: ((user: FFIDUser | null) => void) | undefined;
|
|
134
134
|
/** Callback on authentication error */
|
|
135
135
|
onError?: ((error: FFIDError) => void) | undefined;
|
|
136
|
-
/** Authentication mode: 'cookie' (default)
|
|
137
|
-
authMode?: 'cookie' | 'token' | undefined;
|
|
136
|
+
/** Authentication mode: 'cookie' (default), 'token' (OAuth Bearer), or 'service-key' (server-to-server) */
|
|
137
|
+
authMode?: 'cookie' | 'token' | 'service-key' | undefined;
|
|
138
138
|
/** Client ID for token mode (defaults to serviceCode if not set) */
|
|
139
139
|
clientId?: string | undefined;
|
|
140
|
+
/** Service API key for service-key mode (X-Service-Api-Key header) */
|
|
141
|
+
serviceApiKey?: string | undefined;
|
|
140
142
|
}
|
|
141
143
|
/**
|
|
142
144
|
* FFID context value provided to consumers
|
|
@@ -232,6 +234,19 @@ type FFIDApiResponse<T> = {
|
|
|
232
234
|
data?: undefined;
|
|
233
235
|
error: FFIDError;
|
|
234
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Subscription check response from ext/check endpoint
|
|
239
|
+
*/
|
|
240
|
+
/** Subscription status values matching the FFID platform's SubscriptionStatus type */
|
|
241
|
+
type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
|
|
242
|
+
interface FFIDSubscriptionCheckResponse {
|
|
243
|
+
hasActiveSubscription: boolean;
|
|
244
|
+
organizationId: string | null;
|
|
245
|
+
subscriptionId: string | null;
|
|
246
|
+
status: FFIDSubscriptionStatus | null;
|
|
247
|
+
planCode: string | null;
|
|
248
|
+
currentPeriodEnd: string | null;
|
|
249
|
+
}
|
|
235
250
|
/**
|
|
236
251
|
* OAuth 2.0 token response from FFID token endpoint
|
|
237
252
|
*/
|
|
@@ -603,4 +618,4 @@ interface FFIDAnnouncementListProps {
|
|
|
603
618
|
*/
|
|
604
619
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
605
620
|
|
|
606
|
-
export { type AnnouncementListResponse as A, type FFIDSubscription as B, FFIDSubscriptionBadge as C,
|
|
621
|
+
export { type AnnouncementListResponse as A, type FFIDSubscription as B, FFIDSubscriptionBadge as C, type FFIDSubscriptionCheckResponse 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 FFIDUser as a, type FFIDOrganization as b, type FFIDError as c, type FFIDSubscriptionContextValue as d, type FFIDAnnouncementsClientConfig as e, type FFIDAnnouncementsApiResponse as f, type FFIDAnnouncementsLogger as g, type Announcement as h, type AnnouncementStatus as i, type AnnouncementType as j, FFIDAnnouncementBadge as k, FFIDAnnouncementList as l, type FFIDAnnouncementsError as m, type FFIDAnnouncementsErrorCode as n, type FFIDAnnouncementsServerResponse as o, type FFIDApiResponse as p, type FFIDContextValue as q, type FFIDLogger as r, FFIDLoginButton as s, type FFIDOAuthTokenResponse as t, type FFIDOAuthUserInfo as u, type FFIDOAuthUserInfoMemberRole as v, type FFIDOAuthUserInfoSubscription as w, FFIDOrganizationSwitcher as x, type FFIDSeatModel as y, type FFIDSessionResponse as z };
|
|
@@ -133,10 +133,12 @@ interface FFIDConfig {
|
|
|
133
133
|
onAuthStateChange?: ((user: FFIDUser | null) => void) | undefined;
|
|
134
134
|
/** Callback on authentication error */
|
|
135
135
|
onError?: ((error: FFIDError) => void) | undefined;
|
|
136
|
-
/** Authentication mode: 'cookie' (default)
|
|
137
|
-
authMode?: 'cookie' | 'token' | undefined;
|
|
136
|
+
/** Authentication mode: 'cookie' (default), 'token' (OAuth Bearer), or 'service-key' (server-to-server) */
|
|
137
|
+
authMode?: 'cookie' | 'token' | 'service-key' | undefined;
|
|
138
138
|
/** Client ID for token mode (defaults to serviceCode if not set) */
|
|
139
139
|
clientId?: string | undefined;
|
|
140
|
+
/** Service API key for service-key mode (X-Service-Api-Key header) */
|
|
141
|
+
serviceApiKey?: string | undefined;
|
|
140
142
|
}
|
|
141
143
|
/**
|
|
142
144
|
* FFID context value provided to consumers
|
|
@@ -232,6 +234,19 @@ type FFIDApiResponse<T> = {
|
|
|
232
234
|
data?: undefined;
|
|
233
235
|
error: FFIDError;
|
|
234
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Subscription check response from ext/check endpoint
|
|
239
|
+
*/
|
|
240
|
+
/** Subscription status values matching the FFID platform's SubscriptionStatus type */
|
|
241
|
+
type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
|
|
242
|
+
interface FFIDSubscriptionCheckResponse {
|
|
243
|
+
hasActiveSubscription: boolean;
|
|
244
|
+
organizationId: string | null;
|
|
245
|
+
subscriptionId: string | null;
|
|
246
|
+
status: FFIDSubscriptionStatus | null;
|
|
247
|
+
planCode: string | null;
|
|
248
|
+
currentPeriodEnd: string | null;
|
|
249
|
+
}
|
|
235
250
|
/**
|
|
236
251
|
* OAuth 2.0 token response from FFID token endpoint
|
|
237
252
|
*/
|
|
@@ -603,4 +618,4 @@ interface FFIDAnnouncementListProps {
|
|
|
603
618
|
*/
|
|
604
619
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
605
620
|
|
|
606
|
-
export { type AnnouncementListResponse as A, type FFIDSubscription as B, FFIDSubscriptionBadge as C,
|
|
621
|
+
export { type AnnouncementListResponse as A, type FFIDSubscription as B, FFIDSubscriptionBadge as C, type FFIDSubscriptionCheckResponse 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 FFIDUser as a, type FFIDOrganization as b, type FFIDError as c, type FFIDSubscriptionContextValue as d, type FFIDAnnouncementsClientConfig as e, type FFIDAnnouncementsApiResponse as f, type FFIDAnnouncementsLogger as g, type Announcement as h, type AnnouncementStatus as i, type AnnouncementType as j, FFIDAnnouncementBadge as k, FFIDAnnouncementList as l, type FFIDAnnouncementsError as m, type FFIDAnnouncementsErrorCode as n, type FFIDAnnouncementsServerResponse as o, type FFIDApiResponse as p, type FFIDContextValue as q, type FFIDLogger as r, FFIDLoginButton as s, type FFIDOAuthTokenResponse as t, type FFIDOAuthUserInfo as u, type FFIDOAuthUserInfoMemberRole as v, type FFIDOAuthUserInfoSubscription as w, FFIDOrganizationSwitcher as x, type FFIDSeatModel as y, type FFIDSessionResponse as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDFZPKRHW_cjs = require('./chunk-DFZPKRHW.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 } =
|
|
9
|
+
const { isLoading, isAuthenticated, login } = chunkDFZPKRHW_cjs.useFFIDContext();
|
|
10
10
|
const hasRedirected = react.useRef(false);
|
|
11
11
|
react.useEffect(() => {
|
|
12
12
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -31,78 +31,78 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
31
31
|
|
|
32
32
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkDFZPKRHW_cjs.DEFAULT_API_BASE_URL; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDAnnouncementBadge; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDAnnouncementList; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDLoginButton; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDOrganizationSwitcher; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDProvider; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDSubscriptionBadge; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkDFZPKRHW_cjs.FFIDUserMenu; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkDFZPKRHW_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkDFZPKRHW_cjs.createFFIDAnnouncementsClient; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "createTokenStore", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkDFZPKRHW_cjs.createTokenStore; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkDFZPKRHW_cjs.generateCodeChallenge; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkDFZPKRHW_cjs.generateCodeVerifier; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkDFZPKRHW_cjs.retrieveCodeVerifier; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkDFZPKRHW_cjs.storeCodeVerifier; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "useFFID", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkDFZPKRHW_cjs.useFFID; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkDFZPKRHW_cjs.useFFIDAnnouncements; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "useSubscription", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkDFZPKRHW_cjs.useSubscription; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "withSubscription", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkDFZPKRHW_cjs.withSubscription; }
|
|
107
107
|
});
|
|
108
108
|
exports.withFFIDAuth = withFFIDAuth;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
3
|
-
import { F as FFIDConfig, a as FFIDUser, b as FFIDOrganization, c as FFIDError, d as FFIDSubscriptionContextValue, e as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, f as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, g as FFIDAnnouncementsLogger } from './index-
|
|
4
|
-
export { h as Announcement, i as AnnouncementStatus, j as AnnouncementType, k as FFIDAnnouncementBadge, l as FFIDAnnouncementList, m as FFIDAnnouncementsError, n as FFIDAnnouncementsErrorCode, o as FFIDAnnouncementsServerResponse, p as FFIDApiResponse, q as FFIDContextValue, r as FFIDLogger, s as FFIDLoginButton, t as FFIDOAuthTokenResponse, u as FFIDOAuthUserInfo, v as FFIDOAuthUserInfoMemberRole, w as FFIDOAuthUserInfoSubscription, x as FFIDOrganizationSwitcher, y as FFIDSeatModel, z as FFIDSessionResponse, B as FFIDSubscription, C as FFIDSubscriptionBadge, D as FFIDUserMenu, U as UseFFIDAnnouncementsOptions,
|
|
3
|
+
import { F as FFIDConfig, a as FFIDUser, b as FFIDOrganization, c as FFIDError, d as FFIDSubscriptionContextValue, e as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, f as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, g as FFIDAnnouncementsLogger } from './index-BqhbNrX_.cjs';
|
|
4
|
+
export { h as Announcement, i as AnnouncementStatus, j as AnnouncementType, k as FFIDAnnouncementBadge, l as FFIDAnnouncementList, m as FFIDAnnouncementsError, n as FFIDAnnouncementsErrorCode, o as FFIDAnnouncementsServerResponse, p as FFIDApiResponse, q as FFIDContextValue, r as FFIDLogger, s as FFIDLoginButton, t as FFIDOAuthTokenResponse, u as FFIDOAuthUserInfo, v as FFIDOAuthUserInfoMemberRole, w as FFIDOAuthUserInfoSubscription, x as FFIDOrganizationSwitcher, y as FFIDSeatModel, z as FFIDSessionResponse, B as FFIDSubscription, C as FFIDSubscriptionBadge, D as FFIDSubscriptionCheckResponse, E as FFIDSubscriptionStatus, G as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, H as UseFFIDAnnouncementsReturn, I as useFFIDAnnouncements } from './index-BqhbNrX_.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* FFID SDK Shared Constants
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
3
|
-
import { F as FFIDConfig, a as FFIDUser, b as FFIDOrganization, c as FFIDError, d as FFIDSubscriptionContextValue, e as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, f as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, g as FFIDAnnouncementsLogger } from './index-
|
|
4
|
-
export { h as Announcement, i as AnnouncementStatus, j as AnnouncementType, k as FFIDAnnouncementBadge, l as FFIDAnnouncementList, m as FFIDAnnouncementsError, n as FFIDAnnouncementsErrorCode, o as FFIDAnnouncementsServerResponse, p as FFIDApiResponse, q as FFIDContextValue, r as FFIDLogger, s as FFIDLoginButton, t as FFIDOAuthTokenResponse, u as FFIDOAuthUserInfo, v as FFIDOAuthUserInfoMemberRole, w as FFIDOAuthUserInfoSubscription, x as FFIDOrganizationSwitcher, y as FFIDSeatModel, z as FFIDSessionResponse, B as FFIDSubscription, C as FFIDSubscriptionBadge, D as FFIDUserMenu, U as UseFFIDAnnouncementsOptions,
|
|
3
|
+
import { F as FFIDConfig, a as FFIDUser, b as FFIDOrganization, c as FFIDError, d as FFIDSubscriptionContextValue, e as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, f as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, g as FFIDAnnouncementsLogger } from './index-BqhbNrX_.js';
|
|
4
|
+
export { h as Announcement, i as AnnouncementStatus, j as AnnouncementType, k as FFIDAnnouncementBadge, l as FFIDAnnouncementList, m as FFIDAnnouncementsError, n as FFIDAnnouncementsErrorCode, o as FFIDAnnouncementsServerResponse, p as FFIDApiResponse, q as FFIDContextValue, r as FFIDLogger, s as FFIDLoginButton, t as FFIDOAuthTokenResponse, u as FFIDOAuthUserInfo, v as FFIDOAuthUserInfoMemberRole, w as FFIDOAuthUserInfoSubscription, x as FFIDOrganizationSwitcher, y as FFIDSeatModel, z as FFIDSessionResponse, B as FFIDSubscription, C as FFIDSubscriptionBadge, D as FFIDSubscriptionCheckResponse, E as FFIDSubscriptionStatus, G as FFIDUserMenu, U as UseFFIDAnnouncementsOptions, H as UseFFIDAnnouncementsReturn, I as useFFIDAnnouncements } from './index-BqhbNrX_.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* FFID SDK Shared Constants
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFFIDContext } from './chunk-
|
|
2
|
-
export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext } from './chunk-4CVQ5THN.js';
|
|
2
|
+
export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, createFFIDAnnouncementsClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-4CVQ5THN.js';
|
|
3
3
|
import { useRef, useEffect } from 'react';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|