@feelflow/ffid-sdk 1.17.0 → 1.18.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-4L5JIETV.cjs → chunk-THHBQAFX.cjs} +63 -2
- package/dist/{chunk-4LRZTABD.js → chunk-ZJIZTYXQ.js} +63 -2
- 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-B9sSp8kZ.d.cts → index-BHh-uxYS.d.cts} +39 -1
- package/dist/{index-B9sSp8kZ.d.ts → index-BHh-uxYS.d.ts} +39 -1
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +63 -2
- package/dist/server/index.d.cts +50 -0
- package/dist/server/index.d.ts +50 -0
- package/dist/server/index.js +63 -2
- package/package.json +1 -1
|
@@ -125,7 +125,7 @@ function normalizeUserinfo(raw) {
|
|
|
125
125
|
seatModel: raw.subscription.seat_model ?? null,
|
|
126
126
|
memberRole: raw.subscription.member_role ?? null,
|
|
127
127
|
organizationId: raw.subscription.organization_id ?? null,
|
|
128
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
128
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
129
129
|
} : void 0
|
|
130
130
|
};
|
|
131
131
|
}
|
|
@@ -143,6 +143,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
143
143
|
planName: subscription.planCode,
|
|
144
144
|
status: subscription.status,
|
|
145
145
|
currentPeriodEnd: null,
|
|
146
|
+
trialEnd: null,
|
|
146
147
|
seatModel: subscription.seatModel ?? void 0,
|
|
147
148
|
memberRole: subscription.memberRole ?? void 0,
|
|
148
149
|
organizationId: subscription.organizationId
|
|
@@ -446,8 +447,60 @@ function createBillingMethods(deps) {
|
|
|
446
447
|
return { createCheckoutSession, createPortalSession };
|
|
447
448
|
}
|
|
448
449
|
|
|
450
|
+
// src/client/members-methods.ts
|
|
451
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
452
|
+
function createMembersMethods(deps) {
|
|
453
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
454
|
+
function buildQuery(organizationId) {
|
|
455
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
456
|
+
}
|
|
457
|
+
async function listMembers(params) {
|
|
458
|
+
if (!params.organizationId) {
|
|
459
|
+
return {
|
|
460
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
return fetchWithAuth(
|
|
464
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
async function updateMemberRole(params) {
|
|
468
|
+
if (!params.organizationId || !params.userId) {
|
|
469
|
+
return {
|
|
470
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
if (!params.role) {
|
|
474
|
+
return {
|
|
475
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
return fetchWithAuth(
|
|
479
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
480
|
+
{
|
|
481
|
+
method: "PUT",
|
|
482
|
+
body: JSON.stringify({ role: params.role })
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
async function removeMember(params) {
|
|
487
|
+
if (!params.organizationId || !params.userId) {
|
|
488
|
+
return {
|
|
489
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
return fetchWithAuth(
|
|
493
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
494
|
+
{
|
|
495
|
+
method: "DELETE"
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
500
|
+
}
|
|
501
|
+
|
|
449
502
|
// src/client/version-check.ts
|
|
450
|
-
var SDK_VERSION = "1.
|
|
503
|
+
var SDK_VERSION = "1.18.0";
|
|
451
504
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
452
505
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
453
506
|
function sdkHeaders() {
|
|
@@ -1520,6 +1573,11 @@ function createFFIDClient(config) {
|
|
|
1520
1573
|
fetchWithAuth,
|
|
1521
1574
|
createError
|
|
1522
1575
|
});
|
|
1576
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1577
|
+
fetchWithAuth,
|
|
1578
|
+
createError,
|
|
1579
|
+
serviceCode: config.serviceCode
|
|
1580
|
+
});
|
|
1523
1581
|
const {
|
|
1524
1582
|
requestPasswordReset,
|
|
1525
1583
|
verifyPasswordResetToken,
|
|
@@ -1563,6 +1621,9 @@ function createFFIDClient(config) {
|
|
|
1563
1621
|
exchangeCodeForTokens,
|
|
1564
1622
|
refreshAccessToken,
|
|
1565
1623
|
checkSubscription,
|
|
1624
|
+
listMembers,
|
|
1625
|
+
updateMemberRole,
|
|
1626
|
+
removeMember,
|
|
1566
1627
|
createCheckoutSession,
|
|
1567
1628
|
createPortalSession,
|
|
1568
1629
|
verifyAccessToken,
|
|
@@ -123,7 +123,7 @@ function normalizeUserinfo(raw) {
|
|
|
123
123
|
seatModel: raw.subscription.seat_model ?? null,
|
|
124
124
|
memberRole: raw.subscription.member_role ?? null,
|
|
125
125
|
organizationId: raw.subscription.organization_id ?? null,
|
|
126
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
126
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
127
127
|
} : void 0
|
|
128
128
|
};
|
|
129
129
|
}
|
|
@@ -141,6 +141,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
141
141
|
planName: subscription.planCode,
|
|
142
142
|
status: subscription.status,
|
|
143
143
|
currentPeriodEnd: null,
|
|
144
|
+
trialEnd: null,
|
|
144
145
|
seatModel: subscription.seatModel ?? void 0,
|
|
145
146
|
memberRole: subscription.memberRole ?? void 0,
|
|
146
147
|
organizationId: subscription.organizationId
|
|
@@ -444,8 +445,60 @@ function createBillingMethods(deps) {
|
|
|
444
445
|
return { createCheckoutSession, createPortalSession };
|
|
445
446
|
}
|
|
446
447
|
|
|
448
|
+
// src/client/members-methods.ts
|
|
449
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
450
|
+
function createMembersMethods(deps) {
|
|
451
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
452
|
+
function buildQuery(organizationId) {
|
|
453
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
454
|
+
}
|
|
455
|
+
async function listMembers(params) {
|
|
456
|
+
if (!params.organizationId) {
|
|
457
|
+
return {
|
|
458
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
return fetchWithAuth(
|
|
462
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
async function updateMemberRole(params) {
|
|
466
|
+
if (!params.organizationId || !params.userId) {
|
|
467
|
+
return {
|
|
468
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
if (!params.role) {
|
|
472
|
+
return {
|
|
473
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
return fetchWithAuth(
|
|
477
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
478
|
+
{
|
|
479
|
+
method: "PUT",
|
|
480
|
+
body: JSON.stringify({ role: params.role })
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
async function removeMember(params) {
|
|
485
|
+
if (!params.organizationId || !params.userId) {
|
|
486
|
+
return {
|
|
487
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
return fetchWithAuth(
|
|
491
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
492
|
+
{
|
|
493
|
+
method: "DELETE"
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
498
|
+
}
|
|
499
|
+
|
|
447
500
|
// src/client/version-check.ts
|
|
448
|
-
var SDK_VERSION = "1.
|
|
501
|
+
var SDK_VERSION = "1.18.0";
|
|
449
502
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
450
503
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
451
504
|
function sdkHeaders() {
|
|
@@ -1518,6 +1571,11 @@ function createFFIDClient(config) {
|
|
|
1518
1571
|
fetchWithAuth,
|
|
1519
1572
|
createError
|
|
1520
1573
|
});
|
|
1574
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1575
|
+
fetchWithAuth,
|
|
1576
|
+
createError,
|
|
1577
|
+
serviceCode: config.serviceCode
|
|
1578
|
+
});
|
|
1521
1579
|
const {
|
|
1522
1580
|
requestPasswordReset,
|
|
1523
1581
|
verifyPasswordResetToken,
|
|
@@ -1561,6 +1619,9 @@ function createFFIDClient(config) {
|
|
|
1561
1619
|
exchangeCodeForTokens,
|
|
1562
1620
|
refreshAccessToken,
|
|
1563
1621
|
checkSubscription,
|
|
1622
|
+
listMembers,
|
|
1623
|
+
updateMemberRole,
|
|
1624
|
+
removeMember,
|
|
1564
1625
|
createCheckoutSession,
|
|
1565
1626
|
createPortalSession,
|
|
1566
1627
|
verifyAccessToken,
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTHHBQAFX_cjs = require('../chunk-THHBQAFX.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 chunkTHHBQAFX_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDLoginButton; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDOrganizationSwitcher; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDSubscriptionBadge; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDUserMenu; }
|
|
30
30
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { D as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, E as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, N as FFIDLoginButton, a4 as FFIDLoginButtonProps, T as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, V as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-BHh-uxYS.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { D as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, E as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, N as FFIDLoginButton, a4 as FFIDLoginButtonProps, T as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, V as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-BHh-uxYS.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-ZJIZTYXQ.js';
|
|
@@ -390,6 +390,44 @@ interface FFIDCreatePortalParams {
|
|
|
390
390
|
/** URL to redirect when user exits the portal */
|
|
391
391
|
returnUrl: string;
|
|
392
392
|
}
|
|
393
|
+
/** Member role in an organization */
|
|
394
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
395
|
+
/** Member status in an organization */
|
|
396
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
397
|
+
/** Organization member returned by the ext members API */
|
|
398
|
+
interface FFIDOrganizationMember {
|
|
399
|
+
/** User ID (UUID) */
|
|
400
|
+
userId: string;
|
|
401
|
+
/** Email address */
|
|
402
|
+
email: string;
|
|
403
|
+
/** Display name */
|
|
404
|
+
displayName: string | null;
|
|
405
|
+
/** Avatar URL */
|
|
406
|
+
avatarUrl: string | null;
|
|
407
|
+
/** Role in the organization */
|
|
408
|
+
role: FFIDMemberRole;
|
|
409
|
+
/** Membership status */
|
|
410
|
+
status: FFIDMemberStatus;
|
|
411
|
+
/** When the user joined */
|
|
412
|
+
joinedAt: string | null;
|
|
413
|
+
/** When the user was invited */
|
|
414
|
+
invitedAt: string | null;
|
|
415
|
+
/** Last sign-in timestamp */
|
|
416
|
+
lastSignInAt: string | null;
|
|
417
|
+
}
|
|
418
|
+
/** Response from listMembers (ext) */
|
|
419
|
+
interface FFIDListMembersResponse {
|
|
420
|
+
organizationId: string;
|
|
421
|
+
members: FFIDOrganizationMember[];
|
|
422
|
+
}
|
|
423
|
+
/** Response from updateMemberRole (ext) */
|
|
424
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
425
|
+
member: FFIDOrganizationMember;
|
|
426
|
+
}
|
|
427
|
+
/** Response from removeMember (ext) */
|
|
428
|
+
interface FFIDRemoveMemberResponse {
|
|
429
|
+
message: string;
|
|
430
|
+
}
|
|
393
431
|
/**
|
|
394
432
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
395
433
|
*
|
|
@@ -808,4 +846,4 @@ interface FFIDAnnouncementListProps {
|
|
|
808
846
|
*/
|
|
809
847
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
810
848
|
|
|
811
|
-
export {
|
|
849
|
+
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, FFIDAnnouncementBadge as D, FFIDAnnouncementList as E, type FFIDConfig as F, type FFIDAnnouncementsError as G, type FFIDAnnouncementsErrorCode as H, type FFIDAnnouncementsServerResponse as I, type FFIDCacheConfig as J, type FFIDContextValue as K, type ListAnnouncementsOptions as L, type FFIDJwtClaims as M, FFIDLoginButton as N, type FFIDMemberStatus as O, type FFIDOAuthTokenResponse as P, type FFIDOAuthUserInfoMemberRole as Q, type FFIDOAuthUserInfoSubscription as R, type FFIDOrganizationMember as S, FFIDOrganizationSwitcher as T, type FFIDSeatModel as U, FFIDSubscriptionBadge as V, type FFIDSubscriptionStatus as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDApiResponse as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDListMembersResponse as f, type FFIDMemberRole as g, type FFIDUpdateMemberRoleResponse as h, type FFIDRemoveMemberResponse as i, type FFIDCreateCheckoutParams as j, type FFIDCheckoutSessionResponse as k, type FFIDCreatePortalParams as l, type FFIDPortalSessionResponse as m, type FFIDVerifyAccessTokenOptions as n, type FFIDOAuthUserInfo as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
|
|
@@ -390,6 +390,44 @@ interface FFIDCreatePortalParams {
|
|
|
390
390
|
/** URL to redirect when user exits the portal */
|
|
391
391
|
returnUrl: string;
|
|
392
392
|
}
|
|
393
|
+
/** Member role in an organization */
|
|
394
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
395
|
+
/** Member status in an organization */
|
|
396
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
397
|
+
/** Organization member returned by the ext members API */
|
|
398
|
+
interface FFIDOrganizationMember {
|
|
399
|
+
/** User ID (UUID) */
|
|
400
|
+
userId: string;
|
|
401
|
+
/** Email address */
|
|
402
|
+
email: string;
|
|
403
|
+
/** Display name */
|
|
404
|
+
displayName: string | null;
|
|
405
|
+
/** Avatar URL */
|
|
406
|
+
avatarUrl: string | null;
|
|
407
|
+
/** Role in the organization */
|
|
408
|
+
role: FFIDMemberRole;
|
|
409
|
+
/** Membership status */
|
|
410
|
+
status: FFIDMemberStatus;
|
|
411
|
+
/** When the user joined */
|
|
412
|
+
joinedAt: string | null;
|
|
413
|
+
/** When the user was invited */
|
|
414
|
+
invitedAt: string | null;
|
|
415
|
+
/** Last sign-in timestamp */
|
|
416
|
+
lastSignInAt: string | null;
|
|
417
|
+
}
|
|
418
|
+
/** Response from listMembers (ext) */
|
|
419
|
+
interface FFIDListMembersResponse {
|
|
420
|
+
organizationId: string;
|
|
421
|
+
members: FFIDOrganizationMember[];
|
|
422
|
+
}
|
|
423
|
+
/** Response from updateMemberRole (ext) */
|
|
424
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
425
|
+
member: FFIDOrganizationMember;
|
|
426
|
+
}
|
|
427
|
+
/** Response from removeMember (ext) */
|
|
428
|
+
interface FFIDRemoveMemberResponse {
|
|
429
|
+
message: string;
|
|
430
|
+
}
|
|
393
431
|
/**
|
|
394
432
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
395
433
|
*
|
|
@@ -808,4 +846,4 @@ interface FFIDAnnouncementListProps {
|
|
|
808
846
|
*/
|
|
809
847
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
810
848
|
|
|
811
|
-
export {
|
|
849
|
+
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, FFIDAnnouncementBadge as D, FFIDAnnouncementList as E, type FFIDConfig as F, type FFIDAnnouncementsError as G, type FFIDAnnouncementsErrorCode as H, type FFIDAnnouncementsServerResponse as I, type FFIDCacheConfig as J, type FFIDContextValue as K, type ListAnnouncementsOptions as L, type FFIDJwtClaims as M, FFIDLoginButton as N, type FFIDMemberStatus as O, type FFIDOAuthTokenResponse as P, type FFIDOAuthUserInfoMemberRole as Q, type FFIDOAuthUserInfoSubscription as R, type FFIDOrganizationMember as S, FFIDOrganizationSwitcher as T, type FFIDSeatModel as U, FFIDSubscriptionBadge as V, type FFIDSubscriptionStatus as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDApiResponse as a, type FFIDAnnouncementBadgeClassNames as a0, type FFIDAnnouncementBadgeProps as a1, type FFIDAnnouncementListClassNames as a2, type FFIDAnnouncementListProps as a3, type FFIDLoginButtonProps as a4, type FFIDOrganizationSwitcherClassNames as a5, type FFIDOrganizationSwitcherProps as a6, type FFIDSubscriptionBadgeClassNames as a7, type FFIDSubscriptionBadgeProps as a8, type FFIDUserMenuClassNames as a9, type FFIDUserMenuProps as aa, type FFIDSessionResponse as b, type FFIDRedirectResult as c, type FFIDError as d, type FFIDSubscriptionCheckResponse as e, type FFIDListMembersResponse as f, type FFIDMemberRole as g, type FFIDUpdateMemberRoleResponse as h, type FFIDRemoveMemberResponse as i, type FFIDCreateCheckoutParams as j, type FFIDCheckoutSessionResponse as k, type FFIDCreatePortalParams as l, type FFIDPortalSessionResponse as m, type FFIDVerifyAccessTokenOptions as n, type FFIDOAuthUserInfo as o, type FFIDAuthMode as p, type FFIDLogger as q, type FFIDCacheAdapter as r, type FFIDUser as s, type FFIDOrganization as t, type FFIDSubscription as u, type FFIDSubscriptionContextValue as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTHHBQAFX_cjs = require('./chunk-THHBQAFX.cjs');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
@@ -46,7 +46,7 @@ function createKVCacheAdapter(kv) {
|
|
|
46
46
|
}
|
|
47
47
|
function withFFIDAuth(Component, options = {}) {
|
|
48
48
|
const WrappedComponent = (props) => {
|
|
49
|
-
const { isLoading, isAuthenticated, login } =
|
|
49
|
+
const { isLoading, isAuthenticated, login } = chunkTHHBQAFX_cjs.useFFIDContext();
|
|
50
50
|
const hasRedirected = react.useRef(false);
|
|
51
51
|
react.useEffect(() => {
|
|
52
52
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -71,83 +71,83 @@ function withFFIDAuth(Component, options = {}) {
|
|
|
71
71
|
|
|
72
72
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkTHHBQAFX_cjs.DEFAULT_API_BASE_URL; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementBadge; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDAnnouncementList; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDLoginButton; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDOrganizationSwitcher; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDProvider; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDSubscriptionBadge; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkTHHBQAFX_cjs.FFIDUserMenu; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkTHHBQAFX_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkTHHBQAFX_cjs.createFFIDAnnouncementsClient; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkTHHBQAFX_cjs.createFFIDClient; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "createTokenStore", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkTHHBQAFX_cjs.createTokenStore; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkTHHBQAFX_cjs.generateCodeChallenge; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkTHHBQAFX_cjs.generateCodeVerifier; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkTHHBQAFX_cjs.retrieveCodeVerifier; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkTHHBQAFX_cjs.storeCodeVerifier; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "useFFID", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkTHHBQAFX_cjs.useFFID; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkTHHBQAFX_cjs.useFFIDAnnouncements; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "useSubscription", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkTHHBQAFX_cjs.useSubscription; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "withSubscription", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkTHHBQAFX_cjs.withSubscription; }
|
|
151
151
|
});
|
|
152
152
|
exports.createKVCacheAdapter = createKVCacheAdapter;
|
|
153
153
|
exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDRedirectResult, d as FFIDError, e as FFIDSubscriptionCheckResponse, f as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDRedirectResult, d as FFIDError, e as FFIDSubscriptionCheckResponse, f as FFIDListMembersResponse, g as FFIDMemberRole, h as FFIDUpdateMemberRoleResponse, i as FFIDRemoveMemberResponse, j as FFIDCreateCheckoutParams, k as FFIDCheckoutSessionResponse, l as FFIDCreatePortalParams, m as FFIDPortalSessionResponse, n as FFIDVerifyAccessTokenOptions, o as FFIDOAuthUserInfo, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-BHh-uxYS.cjs';
|
|
2
|
+
export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as FFIDAnnouncementBadge, E as FFIDAnnouncementList, G as FFIDAnnouncementsError, H as FFIDAnnouncementsErrorCode, I as FFIDAnnouncementsServerResponse, J as FFIDCacheConfig, K as FFIDContextValue, M as FFIDJwtClaims, N as FFIDLoginButton, O as FFIDMemberStatus, P as FFIDOAuthTokenResponse, Q as FFIDOAuthUserInfoMemberRole, R as FFIDOAuthUserInfoSubscription, S as FFIDOrganizationMember, T as FFIDOrganizationSwitcher, U as FFIDSeatModel, V as FFIDSubscriptionBadge, W as FFIDSubscriptionStatus, X as FFIDTokenIntrospectionResponse, Y as FFIDUserMenu, Z as UseFFIDAnnouncementsOptions, _ as UseFFIDAnnouncementsReturn, $ as useFFIDAnnouncements } from './index-BHh-uxYS.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
5
5
|
|
|
@@ -154,6 +154,18 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
154
154
|
userId: string;
|
|
155
155
|
organizationId: string;
|
|
156
156
|
}) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
|
|
157
|
+
listMembers: (params: {
|
|
158
|
+
organizationId: string;
|
|
159
|
+
}) => Promise<FFIDApiResponse<FFIDListMembersResponse>>;
|
|
160
|
+
updateMemberRole: (params: {
|
|
161
|
+
organizationId: string;
|
|
162
|
+
userId: string;
|
|
163
|
+
role: FFIDMemberRole;
|
|
164
|
+
}) => Promise<FFIDApiResponse<FFIDUpdateMemberRoleResponse>>;
|
|
165
|
+
removeMember: (params: {
|
|
166
|
+
organizationId: string;
|
|
167
|
+
userId: string;
|
|
168
|
+
}) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
|
|
157
169
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
158
170
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
159
171
|
verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
|
|
@@ -436,4 +448,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
|
|
|
436
448
|
/** Type of the FFID Announcements client */
|
|
437
449
|
type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
|
|
438
450
|
|
|
439
|
-
export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, type FFIDResetSessionResponse, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
|
|
451
|
+
export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDListMembersResponse, FFIDLogger, FFIDMemberRole, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, 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 FFIDRedirectResult, d as FFIDError, e as FFIDSubscriptionCheckResponse, f as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDConfig, a as FFIDApiResponse, b as FFIDSessionResponse, c as FFIDRedirectResult, d as FFIDError, e as FFIDSubscriptionCheckResponse, f as FFIDListMembersResponse, g as FFIDMemberRole, h as FFIDUpdateMemberRoleResponse, i as FFIDRemoveMemberResponse, j as FFIDCreateCheckoutParams, k as FFIDCheckoutSessionResponse, l as FFIDCreatePortalParams, m as FFIDPortalSessionResponse, n as FFIDVerifyAccessTokenOptions, o as FFIDOAuthUserInfo, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-BHh-uxYS.js';
|
|
2
|
+
export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as FFIDAnnouncementBadge, E as FFIDAnnouncementList, G as FFIDAnnouncementsError, H as FFIDAnnouncementsErrorCode, I as FFIDAnnouncementsServerResponse, J as FFIDCacheConfig, K as FFIDContextValue, M as FFIDJwtClaims, N as FFIDLoginButton, O as FFIDMemberStatus, P as FFIDOAuthTokenResponse, Q as FFIDOAuthUserInfoMemberRole, R as FFIDOAuthUserInfoSubscription, S as FFIDOrganizationMember, T as FFIDOrganizationSwitcher, U as FFIDSeatModel, V as FFIDSubscriptionBadge, W as FFIDSubscriptionStatus, X as FFIDTokenIntrospectionResponse, Y as FFIDUserMenu, Z as UseFFIDAnnouncementsOptions, _ as UseFFIDAnnouncementsReturn, $ as useFFIDAnnouncements } from './index-BHh-uxYS.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
5
5
|
|
|
@@ -154,6 +154,18 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
154
154
|
userId: string;
|
|
155
155
|
organizationId: string;
|
|
156
156
|
}) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
|
|
157
|
+
listMembers: (params: {
|
|
158
|
+
organizationId: string;
|
|
159
|
+
}) => Promise<FFIDApiResponse<FFIDListMembersResponse>>;
|
|
160
|
+
updateMemberRole: (params: {
|
|
161
|
+
organizationId: string;
|
|
162
|
+
userId: string;
|
|
163
|
+
role: FFIDMemberRole;
|
|
164
|
+
}) => Promise<FFIDApiResponse<FFIDUpdateMemberRoleResponse>>;
|
|
165
|
+
removeMember: (params: {
|
|
166
|
+
organizationId: string;
|
|
167
|
+
userId: string;
|
|
168
|
+
}) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
|
|
157
169
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
158
170
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
159
171
|
verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
|
|
@@ -436,4 +448,4 @@ declare function createFFIDAnnouncementsClient(config?: FFIDAnnouncementsClientC
|
|
|
436
448
|
/** Type of the FFID Announcements client */
|
|
437
449
|
type FFIDAnnouncementsClient = ReturnType<typeof createFFIDAnnouncementsClient>;
|
|
438
450
|
|
|
439
|
-
export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDLogger, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, type FFIDResetSessionResponse, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
|
|
451
|
+
export { AnnouncementListResponse, DEFAULT_API_BASE_URL, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, FFIDCacheAdapter, FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, FFIDCreateCheckoutParams, FFIDCreatePortalParams, FFIDError, FFIDListMembersResponse, FFIDLogger, FFIDMemberRole, FFIDOAuthUserInfo, FFIDOrganization, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, FFIDPortalSessionResponse, FFIDProvider, type FFIDProviderProps, FFIDRedirectResult, FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSessionResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, FFIDUpdateMemberRoleResponse, FFIDUser, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, type KVNamespaceLike, ListAnnouncementsOptions, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useSubscription, withFFIDAuth, withSubscription };
|
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, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext } from './chunk-ZJIZTYXQ.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-ZJIZTYXQ.js';
|
|
3
3
|
import { useRef, useEffect } from 'react';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
package/dist/server/index.cjs
CHANGED
|
@@ -121,7 +121,7 @@ function normalizeUserinfo(raw) {
|
|
|
121
121
|
seatModel: raw.subscription.seat_model ?? null,
|
|
122
122
|
memberRole: raw.subscription.member_role ?? null,
|
|
123
123
|
organizationId: raw.subscription.organization_id ?? null,
|
|
124
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
124
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
125
125
|
} : void 0
|
|
126
126
|
};
|
|
127
127
|
}
|
|
@@ -139,6 +139,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
139
139
|
planName: subscription.planCode,
|
|
140
140
|
status: subscription.status,
|
|
141
141
|
currentPeriodEnd: null,
|
|
142
|
+
trialEnd: null,
|
|
142
143
|
seatModel: subscription.seatModel ?? void 0,
|
|
143
144
|
memberRole: subscription.memberRole ?? void 0,
|
|
144
145
|
organizationId: subscription.organizationId
|
|
@@ -442,8 +443,60 @@ function createBillingMethods(deps) {
|
|
|
442
443
|
return { createCheckoutSession, createPortalSession };
|
|
443
444
|
}
|
|
444
445
|
|
|
446
|
+
// src/client/members-methods.ts
|
|
447
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
448
|
+
function createMembersMethods(deps) {
|
|
449
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
450
|
+
function buildQuery(organizationId) {
|
|
451
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
452
|
+
}
|
|
453
|
+
async function listMembers(params) {
|
|
454
|
+
if (!params.organizationId) {
|
|
455
|
+
return {
|
|
456
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
return fetchWithAuth(
|
|
460
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
async function updateMemberRole(params) {
|
|
464
|
+
if (!params.organizationId || !params.userId) {
|
|
465
|
+
return {
|
|
466
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (!params.role) {
|
|
470
|
+
return {
|
|
471
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
return fetchWithAuth(
|
|
475
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
476
|
+
{
|
|
477
|
+
method: "PUT",
|
|
478
|
+
body: JSON.stringify({ role: params.role })
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
async function removeMember(params) {
|
|
483
|
+
if (!params.organizationId || !params.userId) {
|
|
484
|
+
return {
|
|
485
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
return fetchWithAuth(
|
|
489
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
490
|
+
{
|
|
491
|
+
method: "DELETE"
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
496
|
+
}
|
|
497
|
+
|
|
445
498
|
// src/client/version-check.ts
|
|
446
|
-
var SDK_VERSION = "1.
|
|
499
|
+
var SDK_VERSION = "1.18.0";
|
|
447
500
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
448
501
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
449
502
|
function sdkHeaders() {
|
|
@@ -1503,6 +1556,11 @@ function createFFIDClient(config) {
|
|
|
1503
1556
|
fetchWithAuth,
|
|
1504
1557
|
createError
|
|
1505
1558
|
});
|
|
1559
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1560
|
+
fetchWithAuth,
|
|
1561
|
+
createError,
|
|
1562
|
+
serviceCode: config.serviceCode
|
|
1563
|
+
});
|
|
1506
1564
|
const {
|
|
1507
1565
|
requestPasswordReset,
|
|
1508
1566
|
verifyPasswordResetToken,
|
|
@@ -1546,6 +1604,9 @@ function createFFIDClient(config) {
|
|
|
1546
1604
|
exchangeCodeForTokens,
|
|
1547
1605
|
refreshAccessToken,
|
|
1548
1606
|
checkSubscription,
|
|
1607
|
+
listMembers,
|
|
1608
|
+
updateMemberRole,
|
|
1609
|
+
removeMember,
|
|
1549
1610
|
createCheckoutSession,
|
|
1550
1611
|
createPortalSession,
|
|
1551
1612
|
verifyAccessToken,
|
package/dist/server/index.d.cts
CHANGED
|
@@ -308,6 +308,44 @@ interface FFIDCreatePortalParams {
|
|
|
308
308
|
/** URL to redirect when user exits the portal */
|
|
309
309
|
returnUrl: string;
|
|
310
310
|
}
|
|
311
|
+
/** Member role in an organization */
|
|
312
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
313
|
+
/** Member status in an organization */
|
|
314
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
315
|
+
/** Organization member returned by the ext members API */
|
|
316
|
+
interface FFIDOrganizationMember {
|
|
317
|
+
/** User ID (UUID) */
|
|
318
|
+
userId: string;
|
|
319
|
+
/** Email address */
|
|
320
|
+
email: string;
|
|
321
|
+
/** Display name */
|
|
322
|
+
displayName: string | null;
|
|
323
|
+
/** Avatar URL */
|
|
324
|
+
avatarUrl: string | null;
|
|
325
|
+
/** Role in the organization */
|
|
326
|
+
role: FFIDMemberRole;
|
|
327
|
+
/** Membership status */
|
|
328
|
+
status: FFIDMemberStatus;
|
|
329
|
+
/** When the user joined */
|
|
330
|
+
joinedAt: string | null;
|
|
331
|
+
/** When the user was invited */
|
|
332
|
+
invitedAt: string | null;
|
|
333
|
+
/** Last sign-in timestamp */
|
|
334
|
+
lastSignInAt: string | null;
|
|
335
|
+
}
|
|
336
|
+
/** Response from listMembers (ext) */
|
|
337
|
+
interface FFIDListMembersResponse {
|
|
338
|
+
organizationId: string;
|
|
339
|
+
members: FFIDOrganizationMember[];
|
|
340
|
+
}
|
|
341
|
+
/** Response from updateMemberRole (ext) */
|
|
342
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
343
|
+
member: FFIDOrganizationMember;
|
|
344
|
+
}
|
|
345
|
+
/** Response from removeMember (ext) */
|
|
346
|
+
interface FFIDRemoveMemberResponse {
|
|
347
|
+
message: string;
|
|
348
|
+
}
|
|
311
349
|
/**
|
|
312
350
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
313
351
|
*
|
|
@@ -424,6 +462,18 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
424
462
|
userId: string;
|
|
425
463
|
organizationId: string;
|
|
426
464
|
}) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
|
|
465
|
+
listMembers: (params: {
|
|
466
|
+
organizationId: string;
|
|
467
|
+
}) => Promise<FFIDApiResponse<FFIDListMembersResponse>>;
|
|
468
|
+
updateMemberRole: (params: {
|
|
469
|
+
organizationId: string;
|
|
470
|
+
userId: string;
|
|
471
|
+
role: FFIDMemberRole;
|
|
472
|
+
}) => Promise<FFIDApiResponse<FFIDUpdateMemberRoleResponse>>;
|
|
473
|
+
removeMember: (params: {
|
|
474
|
+
organizationId: string;
|
|
475
|
+
userId: string;
|
|
476
|
+
}) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
|
|
427
477
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
428
478
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
429
479
|
verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -308,6 +308,44 @@ interface FFIDCreatePortalParams {
|
|
|
308
308
|
/** URL to redirect when user exits the portal */
|
|
309
309
|
returnUrl: string;
|
|
310
310
|
}
|
|
311
|
+
/** Member role in an organization */
|
|
312
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
313
|
+
/** Member status in an organization */
|
|
314
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
315
|
+
/** Organization member returned by the ext members API */
|
|
316
|
+
interface FFIDOrganizationMember {
|
|
317
|
+
/** User ID (UUID) */
|
|
318
|
+
userId: string;
|
|
319
|
+
/** Email address */
|
|
320
|
+
email: string;
|
|
321
|
+
/** Display name */
|
|
322
|
+
displayName: string | null;
|
|
323
|
+
/** Avatar URL */
|
|
324
|
+
avatarUrl: string | null;
|
|
325
|
+
/** Role in the organization */
|
|
326
|
+
role: FFIDMemberRole;
|
|
327
|
+
/** Membership status */
|
|
328
|
+
status: FFIDMemberStatus;
|
|
329
|
+
/** When the user joined */
|
|
330
|
+
joinedAt: string | null;
|
|
331
|
+
/** When the user was invited */
|
|
332
|
+
invitedAt: string | null;
|
|
333
|
+
/** Last sign-in timestamp */
|
|
334
|
+
lastSignInAt: string | null;
|
|
335
|
+
}
|
|
336
|
+
/** Response from listMembers (ext) */
|
|
337
|
+
interface FFIDListMembersResponse {
|
|
338
|
+
organizationId: string;
|
|
339
|
+
members: FFIDOrganizationMember[];
|
|
340
|
+
}
|
|
341
|
+
/** Response from updateMemberRole (ext) */
|
|
342
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
343
|
+
member: FFIDOrganizationMember;
|
|
344
|
+
}
|
|
345
|
+
/** Response from removeMember (ext) */
|
|
346
|
+
interface FFIDRemoveMemberResponse {
|
|
347
|
+
message: string;
|
|
348
|
+
}
|
|
311
349
|
/**
|
|
312
350
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
313
351
|
*
|
|
@@ -424,6 +462,18 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
424
462
|
userId: string;
|
|
425
463
|
organizationId: string;
|
|
426
464
|
}) => Promise<FFIDApiResponse<FFIDSubscriptionCheckResponse>>;
|
|
465
|
+
listMembers: (params: {
|
|
466
|
+
organizationId: string;
|
|
467
|
+
}) => Promise<FFIDApiResponse<FFIDListMembersResponse>>;
|
|
468
|
+
updateMemberRole: (params: {
|
|
469
|
+
organizationId: string;
|
|
470
|
+
userId: string;
|
|
471
|
+
role: FFIDMemberRole;
|
|
472
|
+
}) => Promise<FFIDApiResponse<FFIDUpdateMemberRoleResponse>>;
|
|
473
|
+
removeMember: (params: {
|
|
474
|
+
organizationId: string;
|
|
475
|
+
userId: string;
|
|
476
|
+
}) => Promise<FFIDApiResponse<FFIDRemoveMemberResponse>>;
|
|
427
477
|
createCheckoutSession: (params: FFIDCreateCheckoutParams) => Promise<FFIDApiResponse<FFIDCheckoutSessionResponse>>;
|
|
428
478
|
createPortalSession: (params: FFIDCreatePortalParams) => Promise<FFIDApiResponse<FFIDPortalSessionResponse>>;
|
|
429
479
|
verifyAccessToken: (accessToken: string, options?: FFIDVerifyAccessTokenOptions) => Promise<FFIDApiResponse<FFIDOAuthUserInfo>>;
|
package/dist/server/index.js
CHANGED
|
@@ -120,7 +120,7 @@ function normalizeUserinfo(raw) {
|
|
|
120
120
|
seatModel: raw.subscription.seat_model ?? null,
|
|
121
121
|
memberRole: raw.subscription.member_role ?? null,
|
|
122
122
|
organizationId: raw.subscription.organization_id ?? null,
|
|
123
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
123
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
124
124
|
} : void 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -138,6 +138,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
138
138
|
planName: subscription.planCode,
|
|
139
139
|
status: subscription.status,
|
|
140
140
|
currentPeriodEnd: null,
|
|
141
|
+
trialEnd: null,
|
|
141
142
|
seatModel: subscription.seatModel ?? void 0,
|
|
142
143
|
memberRole: subscription.memberRole ?? void 0,
|
|
143
144
|
organizationId: subscription.organizationId
|
|
@@ -441,8 +442,60 @@ function createBillingMethods(deps) {
|
|
|
441
442
|
return { createCheckoutSession, createPortalSession };
|
|
442
443
|
}
|
|
443
444
|
|
|
445
|
+
// src/client/members-methods.ts
|
|
446
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
447
|
+
function createMembersMethods(deps) {
|
|
448
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
449
|
+
function buildQuery(organizationId) {
|
|
450
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
451
|
+
}
|
|
452
|
+
async function listMembers(params) {
|
|
453
|
+
if (!params.organizationId) {
|
|
454
|
+
return {
|
|
455
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
return fetchWithAuth(
|
|
459
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
async function updateMemberRole(params) {
|
|
463
|
+
if (!params.organizationId || !params.userId) {
|
|
464
|
+
return {
|
|
465
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
if (!params.role) {
|
|
469
|
+
return {
|
|
470
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
return fetchWithAuth(
|
|
474
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
475
|
+
{
|
|
476
|
+
method: "PUT",
|
|
477
|
+
body: JSON.stringify({ role: params.role })
|
|
478
|
+
}
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
async function removeMember(params) {
|
|
482
|
+
if (!params.organizationId || !params.userId) {
|
|
483
|
+
return {
|
|
484
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
return fetchWithAuth(
|
|
488
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
489
|
+
{
|
|
490
|
+
method: "DELETE"
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
495
|
+
}
|
|
496
|
+
|
|
444
497
|
// src/client/version-check.ts
|
|
445
|
-
var SDK_VERSION = "1.
|
|
498
|
+
var SDK_VERSION = "1.18.0";
|
|
446
499
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
447
500
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
448
501
|
function sdkHeaders() {
|
|
@@ -1502,6 +1555,11 @@ function createFFIDClient(config) {
|
|
|
1502
1555
|
fetchWithAuth,
|
|
1503
1556
|
createError
|
|
1504
1557
|
});
|
|
1558
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1559
|
+
fetchWithAuth,
|
|
1560
|
+
createError,
|
|
1561
|
+
serviceCode: config.serviceCode
|
|
1562
|
+
});
|
|
1505
1563
|
const {
|
|
1506
1564
|
requestPasswordReset,
|
|
1507
1565
|
verifyPasswordResetToken,
|
|
@@ -1545,6 +1603,9 @@ function createFFIDClient(config) {
|
|
|
1545
1603
|
exchangeCodeForTokens,
|
|
1546
1604
|
refreshAccessToken,
|
|
1547
1605
|
checkSubscription,
|
|
1606
|
+
listMembers,
|
|
1607
|
+
updateMemberRole,
|
|
1608
|
+
removeMember,
|
|
1548
1609
|
createCheckoutSession,
|
|
1549
1610
|
createPortalSession,
|
|
1550
1611
|
verifyAccessToken,
|