@feelflow/ffid-sdk 5.8.0 → 5.9.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-MRHDPB7H.cjs → chunk-A6MOPB7D.cjs} +17 -4
- package/dist/{chunk-Z6COUAR6.js → chunk-KENJXMSG.js} +17 -4
- 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-BhopNmnq.d.cts → ffid-client-DRjzfAaS.d.cts} +16 -3
- package/dist/{ffid-client-DoGYvIll.d.ts → ffid-client-gboJROw0.d.ts} +16 -3
- package/dist/{index-DeegKrLW.d.cts → index-DSvX4q8E.d.cts} +18 -3
- package/dist/{index-DeegKrLW.d.ts → index-DSvX4q8E.d.ts} +18 -3
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +17 -4
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +17 -4
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -111,7 +111,16 @@ var SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES = [
|
|
|
111
111
|
function isSessionEligibleSubscriptionStatus(value) {
|
|
112
112
|
return typeof value === "string" && SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES.includes(value);
|
|
113
113
|
}
|
|
114
|
+
function hasOwnKey(value, key) {
|
|
115
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
116
|
+
}
|
|
114
117
|
function normalizeUserinfo(raw) {
|
|
118
|
+
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
119
|
+
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
120
|
+
const organizationFields = hasOrganizationId ? {
|
|
121
|
+
organizationId: raw.organization_id ?? null,
|
|
122
|
+
organizationName: hasOrganizationName ? raw.organization_name ?? null : null
|
|
123
|
+
} : hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {};
|
|
115
124
|
return {
|
|
116
125
|
sub: raw.sub,
|
|
117
126
|
email: raw.email,
|
|
@@ -121,7 +130,7 @@ function normalizeUserinfo(raw) {
|
|
|
121
130
|
department: raw.department ?? null,
|
|
122
131
|
position: raw.position ?? null,
|
|
123
132
|
phoneNumber: raw.phone_number ?? null,
|
|
124
|
-
|
|
133
|
+
...organizationFields,
|
|
125
134
|
subscription: raw.subscription ? {
|
|
126
135
|
subscriptionId: raw.subscription.subscription_id ?? null,
|
|
127
136
|
status: raw.subscription.status ?? null,
|
|
@@ -130,6 +139,7 @@ function normalizeUserinfo(raw) {
|
|
|
130
139
|
seatModel: raw.subscription.seat_model ?? null,
|
|
131
140
|
memberRole: raw.subscription.member_role ?? null,
|
|
132
141
|
organizationId: raw.subscription.organization_id ?? null,
|
|
142
|
+
organizationName: hasOwnKey(raw.subscription, "organization_name") ? raw.subscription.organization_name ?? null : null,
|
|
133
143
|
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false,
|
|
134
144
|
// #3464: legacy FFID (< this issue) omits the field on the wire.
|
|
135
145
|
// The "unknown" axis is unused — no consumer differentiates "server
|
|
@@ -165,7 +175,8 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
165
175
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd,
|
|
166
176
|
seatModel: subscription.seatModel ?? void 0,
|
|
167
177
|
memberRole: subscription.memberRole ?? void 0,
|
|
168
|
-
organizationId: subscription.organizationId
|
|
178
|
+
organizationId: subscription.organizationId,
|
|
179
|
+
organizationName: subscription.organizationName ?? void 0
|
|
169
180
|
}
|
|
170
181
|
];
|
|
171
182
|
}
|
|
@@ -374,7 +385,8 @@ function createVerifyAccessToken(deps) {
|
|
|
374
385
|
department: introspectResponse.department ?? null,
|
|
375
386
|
position: introspectResponse.position ?? null,
|
|
376
387
|
phone_number: introspectResponse.phone_number ?? null,
|
|
377
|
-
organization_id: introspectResponse.organization_id ?? null
|
|
388
|
+
organization_id: introspectResponse.organization_id ?? null,
|
|
389
|
+
organization_name: introspectResponse.organization_name ?? null
|
|
378
390
|
};
|
|
379
391
|
const raw = introspectResponse.subscription ? {
|
|
380
392
|
...base,
|
|
@@ -386,6 +398,7 @@ function createVerifyAccessToken(deps) {
|
|
|
386
398
|
seat_model: introspectResponse.subscription.seat_model,
|
|
387
399
|
member_role: introspectResponse.subscription.member_role,
|
|
388
400
|
organization_id: introspectResponse.subscription.organization_id,
|
|
401
|
+
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
389
402
|
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
390
403
|
}
|
|
391
404
|
} : base;
|
|
@@ -856,7 +869,7 @@ function createProfileMethods(deps) {
|
|
|
856
869
|
}
|
|
857
870
|
|
|
858
871
|
// src/client/version-check.ts
|
|
859
|
-
var SDK_VERSION = "5.
|
|
872
|
+
var SDK_VERSION = "5.9.0";
|
|
860
873
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
861
874
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
862
875
|
function sdkHeaders() {
|
|
@@ -109,7 +109,16 @@ var SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES = [
|
|
|
109
109
|
function isSessionEligibleSubscriptionStatus(value) {
|
|
110
110
|
return typeof value === "string" && SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES.includes(value);
|
|
111
111
|
}
|
|
112
|
+
function hasOwnKey(value, key) {
|
|
113
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
114
|
+
}
|
|
112
115
|
function normalizeUserinfo(raw) {
|
|
116
|
+
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
117
|
+
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
118
|
+
const organizationFields = hasOrganizationId ? {
|
|
119
|
+
organizationId: raw.organization_id ?? null,
|
|
120
|
+
organizationName: hasOrganizationName ? raw.organization_name ?? null : null
|
|
121
|
+
} : hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {};
|
|
113
122
|
return {
|
|
114
123
|
sub: raw.sub,
|
|
115
124
|
email: raw.email,
|
|
@@ -119,7 +128,7 @@ function normalizeUserinfo(raw) {
|
|
|
119
128
|
department: raw.department ?? null,
|
|
120
129
|
position: raw.position ?? null,
|
|
121
130
|
phoneNumber: raw.phone_number ?? null,
|
|
122
|
-
|
|
131
|
+
...organizationFields,
|
|
123
132
|
subscription: raw.subscription ? {
|
|
124
133
|
subscriptionId: raw.subscription.subscription_id ?? null,
|
|
125
134
|
status: raw.subscription.status ?? null,
|
|
@@ -128,6 +137,7 @@ function normalizeUserinfo(raw) {
|
|
|
128
137
|
seatModel: raw.subscription.seat_model ?? null,
|
|
129
138
|
memberRole: raw.subscription.member_role ?? null,
|
|
130
139
|
organizationId: raw.subscription.organization_id ?? null,
|
|
140
|
+
organizationName: hasOwnKey(raw.subscription, "organization_name") ? raw.subscription.organization_name ?? null : null,
|
|
131
141
|
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false,
|
|
132
142
|
// #3464: legacy FFID (< this issue) omits the field on the wire.
|
|
133
143
|
// The "unknown" axis is unused — no consumer differentiates "server
|
|
@@ -163,7 +173,8 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
163
173
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd,
|
|
164
174
|
seatModel: subscription.seatModel ?? void 0,
|
|
165
175
|
memberRole: subscription.memberRole ?? void 0,
|
|
166
|
-
organizationId: subscription.organizationId
|
|
176
|
+
organizationId: subscription.organizationId,
|
|
177
|
+
organizationName: subscription.organizationName ?? void 0
|
|
167
178
|
}
|
|
168
179
|
];
|
|
169
180
|
}
|
|
@@ -372,7 +383,8 @@ function createVerifyAccessToken(deps) {
|
|
|
372
383
|
department: introspectResponse.department ?? null,
|
|
373
384
|
position: introspectResponse.position ?? null,
|
|
374
385
|
phone_number: introspectResponse.phone_number ?? null,
|
|
375
|
-
organization_id: introspectResponse.organization_id ?? null
|
|
386
|
+
organization_id: introspectResponse.organization_id ?? null,
|
|
387
|
+
organization_name: introspectResponse.organization_name ?? null
|
|
376
388
|
};
|
|
377
389
|
const raw = introspectResponse.subscription ? {
|
|
378
390
|
...base,
|
|
@@ -384,6 +396,7 @@ function createVerifyAccessToken(deps) {
|
|
|
384
396
|
seat_model: introspectResponse.subscription.seat_model,
|
|
385
397
|
member_role: introspectResponse.subscription.member_role,
|
|
386
398
|
organization_id: introspectResponse.subscription.organization_id,
|
|
399
|
+
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
387
400
|
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
388
401
|
}
|
|
389
402
|
} : base;
|
|
@@ -854,7 +867,7 @@ function createProfileMethods(deps) {
|
|
|
854
867
|
}
|
|
855
868
|
|
|
856
869
|
// src/client/version-check.ts
|
|
857
|
-
var SDK_VERSION = "5.
|
|
870
|
+
var SDK_VERSION = "5.9.0";
|
|
858
871
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
859
872
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
860
873
|
function sdkHeaders() {
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA6MOPB7D_cjs = require('../chunk-A6MOPB7D.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 chunkA6MOPB7D_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, ap as FFIDLoginButtonProps, a7 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-
|
|
1
|
+
export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, ap as FFIDLoginButtonProps, a7 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-DSvX4q8E.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, ap as FFIDLoginButtonProps, a7 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-
|
|
1
|
+
export { M as FFIDAnnouncementBadge, al as FFIDAnnouncementBadgeClassNames, am as FFIDAnnouncementBadgeProps, N as FFIDAnnouncementList, an as FFIDAnnouncementListClassNames, ao as FFIDAnnouncementListProps, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a4 as FFIDLoginButton, ap as FFIDLoginButtonProps, a7 as FFIDOrganizationSwitcher, aq as FFIDOrganizationSwitcherClassNames, ar as FFIDOrganizationSwitcherProps, ac as FFIDSubscriptionBadge, as as FFIDSubscriptionBadgeClassNames, at as FFIDSubscriptionBadgeProps, ae as FFIDUserMenu, au as FFIDUserMenuClassNames, av as FFIDUserMenuProps } from '../index-DSvX4q8E.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-KENJXMSG.js';
|
|
@@ -740,6 +740,8 @@ interface FFIDSubscription {
|
|
|
740
740
|
memberRole?: FFIDOAuthUserInfoMemberRole | undefined;
|
|
741
741
|
/** Organization ID used to resolve subscription access */
|
|
742
742
|
organizationId?: string | null | undefined;
|
|
743
|
+
/** Organization display name for UI rendering; not used for access resolution */
|
|
744
|
+
organizationName?: string | null | undefined;
|
|
743
745
|
}
|
|
744
746
|
/** OAuth userinfo subscription summary */
|
|
745
747
|
interface FFIDOAuthUserInfoSubscription {
|
|
@@ -757,6 +759,7 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
757
759
|
seatModel: FFIDSeatModel | null;
|
|
758
760
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
759
761
|
organizationId: string | null;
|
|
762
|
+
organizationName?: string | null | undefined;
|
|
760
763
|
hasSeatAssignment: boolean | null;
|
|
761
764
|
/**
|
|
762
765
|
* Stripe `cancel_at_period_end` (#3464, SDK 5.8.0). `true` while the
|
|
@@ -780,9 +783,11 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
780
783
|
}
|
|
781
784
|
/**
|
|
782
785
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
783
|
-
* and `verifyAccessToken()` (JWT or introspect path). `subscription
|
|
784
|
-
* `organizationId` are scope-gated on `/oauth/userinfo`
|
|
785
|
-
* `subscription:read`); JWT-verify additionally
|
|
786
|
+
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
787
|
+
* `organizationId`, and `organizationName` are scope-gated on `/oauth/userinfo`
|
|
788
|
+
* (FFID #3380, requires `subscription:read`); JWT-only verify additionally
|
|
789
|
+
* omits `subscription` and `organizationName` when `includeProfile` is false
|
|
790
|
+
* because the JWT has `org_id` but no `org_name` claim.
|
|
786
791
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
787
792
|
*/
|
|
788
793
|
interface FFIDOAuthUserInfo {
|
|
@@ -800,6 +805,14 @@ interface FFIDOAuthUserInfo {
|
|
|
800
805
|
* — NOT "no organization").
|
|
801
806
|
*/
|
|
802
807
|
organizationId?: string | null | undefined;
|
|
808
|
+
/**
|
|
809
|
+
* Organization display name, `null` if the resolved organization has no name,
|
|
810
|
+
* or `undefined` if the granted scope omits `subscription:read` on
|
|
811
|
+
* `/oauth/userinfo` (FFID #3514), or if the caller used JWT verification
|
|
812
|
+
* without `includeProfile`. JWT payloads carry `org_id` but no `org_name`
|
|
813
|
+
* claim.
|
|
814
|
+
*/
|
|
815
|
+
organizationName?: string | null | undefined;
|
|
803
816
|
/**
|
|
804
817
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
805
818
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -740,6 +740,8 @@ interface FFIDSubscription {
|
|
|
740
740
|
memberRole?: FFIDOAuthUserInfoMemberRole | undefined;
|
|
741
741
|
/** Organization ID used to resolve subscription access */
|
|
742
742
|
organizationId?: string | null | undefined;
|
|
743
|
+
/** Organization display name for UI rendering; not used for access resolution */
|
|
744
|
+
organizationName?: string | null | undefined;
|
|
743
745
|
}
|
|
744
746
|
/** OAuth userinfo subscription summary */
|
|
745
747
|
interface FFIDOAuthUserInfoSubscription {
|
|
@@ -757,6 +759,7 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
757
759
|
seatModel: FFIDSeatModel | null;
|
|
758
760
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
759
761
|
organizationId: string | null;
|
|
762
|
+
organizationName?: string | null | undefined;
|
|
760
763
|
hasSeatAssignment: boolean | null;
|
|
761
764
|
/**
|
|
762
765
|
* Stripe `cancel_at_period_end` (#3464, SDK 5.8.0). `true` while the
|
|
@@ -780,9 +783,11 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
780
783
|
}
|
|
781
784
|
/**
|
|
782
785
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
783
|
-
* and `verifyAccessToken()` (JWT or introspect path). `subscription
|
|
784
|
-
* `organizationId` are scope-gated on `/oauth/userinfo`
|
|
785
|
-
* `subscription:read`); JWT-verify additionally
|
|
786
|
+
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
787
|
+
* `organizationId`, and `organizationName` are scope-gated on `/oauth/userinfo`
|
|
788
|
+
* (FFID #3380, requires `subscription:read`); JWT-only verify additionally
|
|
789
|
+
* omits `subscription` and `organizationName` when `includeProfile` is false
|
|
790
|
+
* because the JWT has `org_id` but no `org_name` claim.
|
|
786
791
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
787
792
|
*/
|
|
788
793
|
interface FFIDOAuthUserInfo {
|
|
@@ -800,6 +805,14 @@ interface FFIDOAuthUserInfo {
|
|
|
800
805
|
* — NOT "no organization").
|
|
801
806
|
*/
|
|
802
807
|
organizationId?: string | null | undefined;
|
|
808
|
+
/**
|
|
809
|
+
* Organization display name, `null` if the resolved organization has no name,
|
|
810
|
+
* or `undefined` if the granted scope omits `subscription:read` on
|
|
811
|
+
* `/oauth/userinfo` (FFID #3514), or if the caller used JWT verification
|
|
812
|
+
* without `includeProfile`. JWT payloads carry `org_id` but no `org_name`
|
|
813
|
+
* claim.
|
|
814
|
+
*/
|
|
815
|
+
organizationName?: string | null | undefined;
|
|
803
816
|
/**
|
|
804
817
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
805
818
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -263,6 +263,8 @@ interface FFIDSubscription {
|
|
|
263
263
|
memberRole?: FFIDOAuthUserInfoMemberRole | undefined;
|
|
264
264
|
/** Organization ID used to resolve subscription access */
|
|
265
265
|
organizationId?: string | null | undefined;
|
|
266
|
+
/** Organization display name for UI rendering; not used for access resolution */
|
|
267
|
+
organizationName?: string | null | undefined;
|
|
266
268
|
}
|
|
267
269
|
/** OAuth userinfo subscription summary */
|
|
268
270
|
interface FFIDOAuthUserInfoSubscription {
|
|
@@ -280,6 +282,7 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
280
282
|
seatModel: FFIDSeatModel | null;
|
|
281
283
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
282
284
|
organizationId: string | null;
|
|
285
|
+
organizationName?: string | null | undefined;
|
|
283
286
|
hasSeatAssignment: boolean | null;
|
|
284
287
|
/**
|
|
285
288
|
* Stripe `cancel_at_period_end` (#3464, SDK 5.8.0). `true` while the
|
|
@@ -303,9 +306,11 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
303
306
|
}
|
|
304
307
|
/**
|
|
305
308
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
306
|
-
* and `verifyAccessToken()` (JWT or introspect path). `subscription
|
|
307
|
-
* `organizationId` are scope-gated on `/oauth/userinfo`
|
|
308
|
-
* `subscription:read`); JWT-verify additionally
|
|
309
|
+
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
310
|
+
* `organizationId`, and `organizationName` are scope-gated on `/oauth/userinfo`
|
|
311
|
+
* (FFID #3380, requires `subscription:read`); JWT-only verify additionally
|
|
312
|
+
* omits `subscription` and `organizationName` when `includeProfile` is false
|
|
313
|
+
* because the JWT has `org_id` but no `org_name` claim.
|
|
309
314
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
310
315
|
*/
|
|
311
316
|
interface FFIDOAuthUserInfo {
|
|
@@ -323,6 +328,14 @@ interface FFIDOAuthUserInfo {
|
|
|
323
328
|
* — NOT "no organization").
|
|
324
329
|
*/
|
|
325
330
|
organizationId?: string | null | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Organization display name, `null` if the resolved organization has no name,
|
|
333
|
+
* or `undefined` if the granted scope omits `subscription:read` on
|
|
334
|
+
* `/oauth/userinfo` (FFID #3514), or if the caller used JWT verification
|
|
335
|
+
* without `includeProfile`. JWT payloads carry `org_id` but no `org_name`
|
|
336
|
+
* claim.
|
|
337
|
+
*/
|
|
338
|
+
organizationName?: string | null | undefined;
|
|
326
339
|
/**
|
|
327
340
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
328
341
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -851,6 +864,7 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
851
864
|
token_type?: 'Bearer';
|
|
852
865
|
client_id?: string;
|
|
853
866
|
organization_id?: string | null;
|
|
867
|
+
organization_name?: string | null;
|
|
854
868
|
subscription?: {
|
|
855
869
|
subscription_id: string | null;
|
|
856
870
|
status: FFIDOAuthUserInfoSubscription['status'];
|
|
@@ -860,6 +874,7 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
860
874
|
seat_model: FFIDOAuthUserInfoSubscription['seatModel'];
|
|
861
875
|
member_role: FFIDOAuthUserInfoSubscription['memberRole'];
|
|
862
876
|
organization_id: string | null;
|
|
877
|
+
organization_name?: string | null;
|
|
863
878
|
has_seat_assignment?: boolean;
|
|
864
879
|
};
|
|
865
880
|
}
|
|
@@ -263,6 +263,8 @@ interface FFIDSubscription {
|
|
|
263
263
|
memberRole?: FFIDOAuthUserInfoMemberRole | undefined;
|
|
264
264
|
/** Organization ID used to resolve subscription access */
|
|
265
265
|
organizationId?: string | null | undefined;
|
|
266
|
+
/** Organization display name for UI rendering; not used for access resolution */
|
|
267
|
+
organizationName?: string | null | undefined;
|
|
266
268
|
}
|
|
267
269
|
/** OAuth userinfo subscription summary */
|
|
268
270
|
interface FFIDOAuthUserInfoSubscription {
|
|
@@ -280,6 +282,7 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
280
282
|
seatModel: FFIDSeatModel | null;
|
|
281
283
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
282
284
|
organizationId: string | null;
|
|
285
|
+
organizationName?: string | null | undefined;
|
|
283
286
|
hasSeatAssignment: boolean | null;
|
|
284
287
|
/**
|
|
285
288
|
* Stripe `cancel_at_period_end` (#3464, SDK 5.8.0). `true` while the
|
|
@@ -303,9 +306,11 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
303
306
|
}
|
|
304
307
|
/**
|
|
305
308
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
306
|
-
* and `verifyAccessToken()` (JWT or introspect path). `subscription
|
|
307
|
-
* `organizationId` are scope-gated on `/oauth/userinfo`
|
|
308
|
-
* `subscription:read`); JWT-verify additionally
|
|
309
|
+
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
310
|
+
* `organizationId`, and `organizationName` are scope-gated on `/oauth/userinfo`
|
|
311
|
+
* (FFID #3380, requires `subscription:read`); JWT-only verify additionally
|
|
312
|
+
* omits `subscription` and `organizationName` when `includeProfile` is false
|
|
313
|
+
* because the JWT has `org_id` but no `org_name` claim.
|
|
309
314
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
310
315
|
*/
|
|
311
316
|
interface FFIDOAuthUserInfo {
|
|
@@ -323,6 +328,14 @@ interface FFIDOAuthUserInfo {
|
|
|
323
328
|
* — NOT "no organization").
|
|
324
329
|
*/
|
|
325
330
|
organizationId?: string | null | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Organization display name, `null` if the resolved organization has no name,
|
|
333
|
+
* or `undefined` if the granted scope omits `subscription:read` on
|
|
334
|
+
* `/oauth/userinfo` (FFID #3514), or if the caller used JWT verification
|
|
335
|
+
* without `includeProfile`. JWT payloads carry `org_id` but no `org_name`
|
|
336
|
+
* claim.
|
|
337
|
+
*/
|
|
338
|
+
organizationName?: string | null | undefined;
|
|
326
339
|
/**
|
|
327
340
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
328
341
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -851,6 +864,7 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
851
864
|
token_type?: 'Bearer';
|
|
852
865
|
client_id?: string;
|
|
853
866
|
organization_id?: string | null;
|
|
867
|
+
organization_name?: string | null;
|
|
854
868
|
subscription?: {
|
|
855
869
|
subscription_id: string | null;
|
|
856
870
|
status: FFIDOAuthUserInfoSubscription['status'];
|
|
@@ -860,6 +874,7 @@ interface FFIDTokenIntrospectionResponse {
|
|
|
860
874
|
seat_model: FFIDOAuthUserInfoSubscription['seatModel'];
|
|
861
875
|
member_role: FFIDOAuthUserInfoSubscription['memberRole'];
|
|
862
876
|
organization_id: string | null;
|
|
877
|
+
organization_name?: string | null;
|
|
863
878
|
has_seat_assignment?: boolean;
|
|
864
879
|
};
|
|
865
880
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA6MOPB7D_cjs = require('./chunk-A6MOPB7D.cjs');
|
|
4
4
|
var chunkQ5SZVLNB_cjs = require('./chunk-Q5SZVLNB.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -54,8 +54,8 @@ function defaultRedirect(url) {
|
|
|
54
54
|
}
|
|
55
55
|
function useRequireActiveSubscription(options) {
|
|
56
56
|
const { redirectTo, allowGrace = true, onRedirect } = options;
|
|
57
|
-
const { isLoading, error } =
|
|
58
|
-
const { effectiveStatus, isBlocked, isGrace } =
|
|
57
|
+
const { isLoading, error } = chunkA6MOPB7D_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkA6MOPB7D_cjs.useSubscription();
|
|
59
59
|
const hasFetchError = error !== null && effectiveStatus === null;
|
|
60
60
|
const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
|
|
61
61
|
react.useEffect(() => {
|
|
@@ -76,7 +76,7 @@ function useRequireActiveSubscription(options) {
|
|
|
76
76
|
}
|
|
77
77
|
function withFFIDAuth(Component, options = {}) {
|
|
78
78
|
const WrappedComponent = (props) => {
|
|
79
|
-
const { isLoading, isAuthenticated, login } =
|
|
79
|
+
const { isLoading, isAuthenticated, login } = chunkA6MOPB7D_cjs.useFFIDContext();
|
|
80
80
|
const hasRedirected = react.useRef(false);
|
|
81
81
|
react.useEffect(() => {
|
|
82
82
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -105,131 +105,131 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
|
105
105
|
|
|
106
106
|
Object.defineProperty(exports, "ACCESS_GRANTING_EFFECTIVE_STATUSES", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkA6MOPB7D_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkA6MOPB7D_cjs.BLOCKING_EFFECTIVE_STATUSES; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkA6MOPB7D_cjs.DEFAULT_API_BASE_URL; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkA6MOPB7D_cjs.DEFAULT_OAUTH_SCOPES; }
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDAnnouncementBadge; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDAnnouncementList; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDInquiryForm; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDLoginButton; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDOrganizationSwitcher; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDProvider; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDSDKError; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDSubscriptionBadge; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkA6MOPB7D_cjs.FFIDUserMenu; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkA6MOPB7D_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
164
|
+
get: function () { return chunkA6MOPB7D_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
165
165
|
});
|
|
166
166
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
167
167
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkA6MOPB7D_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkA6MOPB7D_cjs.computeEffectiveStatusFromSession; }
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkA6MOPB7D_cjs.createFFIDAnnouncementsClient; }
|
|
177
177
|
});
|
|
178
178
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
179
179
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkA6MOPB7D_cjs.createFFIDClient; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "createTokenStore", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkA6MOPB7D_cjs.createTokenStore; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkA6MOPB7D_cjs.generateCodeChallenge; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkA6MOPB7D_cjs.generateCodeVerifier; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkA6MOPB7D_cjs.hasAccessFromUserinfo; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkA6MOPB7D_cjs.isBlockedFromUserinfo; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkA6MOPB7D_cjs.isFFIDInquiryCategorySite2026; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkA6MOPB7D_cjs.normalizeRedirectUri; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkA6MOPB7D_cjs.retrieveCodeVerifier; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkA6MOPB7D_cjs.storeCodeVerifier; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "useFFID", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkA6MOPB7D_cjs.useFFID; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkA6MOPB7D_cjs.useFFIDAnnouncements; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "useSubscription", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkA6MOPB7D_cjs.useSubscription; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "withSubscription", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkA6MOPB7D_cjs.withSubscription; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
235
235
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDCheckServiceAccessParams, h as FFIDServiceAccessDecision, i as FFIDProfileCallOptions, j as FFIDUserProfile, k as FFIDUpdateUserProfileRequest, l as FFIDAnalyticsConfig, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, B as FFIDOAuthUserInfoSubscription, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-
|
|
2
|
-
export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOrganizationSwitcher, a8 as FFIDRedirectErrorCode, a9 as FFIDSeatModel, aa as FFIDServiceAccessDenialReason, ab as FFIDServiceAccessFailPolicy, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDCheckServiceAccessParams, h as FFIDServiceAccessDecision, i as FFIDProfileCallOptions, j as FFIDUserProfile, k as FFIDUpdateUserProfileRequest, l as FFIDAnalyticsConfig, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, B as FFIDOAuthUserInfoSubscription, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-DSvX4q8E.cjs';
|
|
2
|
+
export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOrganizationSwitcher, a8 as FFIDRedirectErrorCode, a9 as FFIDSeatModel, aa as FFIDServiceAccessDenialReason, ab as FFIDServiceAccessFailPolicy, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-DSvX4q8E.cjs';
|
|
3
3
|
export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-CE01gYc4.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode, ComponentType, FC } from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDCheckServiceAccessParams, h as FFIDServiceAccessDecision, i as FFIDProfileCallOptions, j as FFIDUserProfile, k as FFIDUpdateUserProfileRequest, l as FFIDAnalyticsConfig, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, B as FFIDOAuthUserInfoSubscription, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-
|
|
2
|
-
export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOrganizationSwitcher, a8 as FFIDRedirectErrorCode, a9 as FFIDSeatModel, aa as FFIDServiceAccessDenialReason, ab as FFIDServiceAccessFailPolicy, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDConfig, b as FFIDApiResponse, c as FFIDSessionResponse, d as FFIDRedirectResult, e as FFIDError, f as FFIDSubscriptionCheckResponse, g as FFIDCheckServiceAccessParams, h as FFIDServiceAccessDecision, i as FFIDProfileCallOptions, j as FFIDUserProfile, k as FFIDUpdateUserProfileRequest, l as FFIDAnalyticsConfig, m as FFIDCreateCheckoutParams, n as FFIDCheckoutSessionResponse, o as FFIDCreatePortalParams, p as FFIDPortalSessionResponse, q as FFIDVerifyAccessTokenOptions, r as FFIDOAuthUserInfo, s as FFIDInquiryCreateParams, t as FFIDInquiryCreateResponse, u as FFIDAuthMode, v as FFIDLogger, w as FFIDCacheAdapter, x as FFIDUser, y as FFIDOrganization, z as FFIDSubscription, A as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, B as FFIDOAuthUserInfoSubscription, C as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, D as FFIDAnnouncementsApiResponse, G as AnnouncementListResponse, H as FFIDAnnouncementsLogger } from './index-DSvX4q8E.js';
|
|
2
|
+
export { I as Announcement, J as AnnouncementStatus, K as AnnouncementType, M as FFIDAnnouncementBadge, N as FFIDAnnouncementList, O as FFIDAnnouncementsError, P as FFIDAnnouncementsErrorCode, Q as FFIDAnnouncementsServerResponse, R as FFIDCacheConfig, S as FFIDContextValue, T as FFIDInquiryCategory, U as FFIDInquiryCategorySite2026, V as FFIDInquiryForm, W as FFIDInquiryFormCategoryItem, X as FFIDInquiryFormClassNames, Y as FFIDInquiryFormLegalLayout, Z as FFIDInquiryFormOrganization, _ as FFIDInquiryFormPlaceholderContext, $ as FFIDInquiryFormPrefill, a0 as FFIDInquiryFormProps, a1 as FFIDInquiryFormSubmitData, a2 as FFIDInquiryFormSubmitResult, a3 as FFIDJwtClaims, a4 as FFIDLoginButton, a5 as FFIDOAuthTokenResponse, a6 as FFIDOAuthUserInfoMemberRole, a7 as FFIDOrganizationSwitcher, a8 as FFIDRedirectErrorCode, a9 as FFIDSeatModel, aa as FFIDServiceAccessDenialReason, ab as FFIDServiceAccessFailPolicy, ac as FFIDSubscriptionBadge, ad as FFIDTokenIntrospectionResponse, ae as FFIDUserMenu, af as FFID_INQUIRY_CATEGORIES, ag as FFID_INQUIRY_CATEGORIES_SITE_2026, ah as UseFFIDAnnouncementsOptions, ai as UseFFIDAnnouncementsReturn, aj as isFFIDInquiryCategorySite2026, ak as useFFIDAnnouncements } from './index-DSvX4q8E.js';
|
|
3
3
|
export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-CE01gYc4.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode, ComponentType, FC } from 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFFIDContext, useSubscription } from './chunk-
|
|
2
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext, useSubscription } from './chunk-KENJXMSG.js';
|
|
2
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-KENJXMSG.js';
|
|
3
3
|
export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-KJ7FUNA6.js';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
5
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
package/dist/server/index.cjs
CHANGED
|
@@ -106,7 +106,16 @@ var SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES = [
|
|
|
106
106
|
function isSessionEligibleSubscriptionStatus(value) {
|
|
107
107
|
return typeof value === "string" && SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES.includes(value);
|
|
108
108
|
}
|
|
109
|
+
function hasOwnKey(value, key) {
|
|
110
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
111
|
+
}
|
|
109
112
|
function normalizeUserinfo(raw) {
|
|
113
|
+
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
114
|
+
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
115
|
+
const organizationFields = hasOrganizationId ? {
|
|
116
|
+
organizationId: raw.organization_id ?? null,
|
|
117
|
+
organizationName: hasOrganizationName ? raw.organization_name ?? null : null
|
|
118
|
+
} : hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {};
|
|
110
119
|
return {
|
|
111
120
|
sub: raw.sub,
|
|
112
121
|
email: raw.email,
|
|
@@ -116,7 +125,7 @@ function normalizeUserinfo(raw) {
|
|
|
116
125
|
department: raw.department ?? null,
|
|
117
126
|
position: raw.position ?? null,
|
|
118
127
|
phoneNumber: raw.phone_number ?? null,
|
|
119
|
-
|
|
128
|
+
...organizationFields,
|
|
120
129
|
subscription: raw.subscription ? {
|
|
121
130
|
subscriptionId: raw.subscription.subscription_id ?? null,
|
|
122
131
|
status: raw.subscription.status ?? null,
|
|
@@ -125,6 +134,7 @@ function normalizeUserinfo(raw) {
|
|
|
125
134
|
seatModel: raw.subscription.seat_model ?? null,
|
|
126
135
|
memberRole: raw.subscription.member_role ?? null,
|
|
127
136
|
organizationId: raw.subscription.organization_id ?? null,
|
|
137
|
+
organizationName: hasOwnKey(raw.subscription, "organization_name") ? raw.subscription.organization_name ?? null : null,
|
|
128
138
|
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false,
|
|
129
139
|
// #3464: legacy FFID (< this issue) omits the field on the wire.
|
|
130
140
|
// The "unknown" axis is unused — no consumer differentiates "server
|
|
@@ -160,7 +170,8 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
160
170
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd,
|
|
161
171
|
seatModel: subscription.seatModel ?? void 0,
|
|
162
172
|
memberRole: subscription.memberRole ?? void 0,
|
|
163
|
-
organizationId: subscription.organizationId
|
|
173
|
+
organizationId: subscription.organizationId,
|
|
174
|
+
organizationName: subscription.organizationName ?? void 0
|
|
164
175
|
}
|
|
165
176
|
];
|
|
166
177
|
}
|
|
@@ -369,7 +380,8 @@ function createVerifyAccessToken(deps) {
|
|
|
369
380
|
department: introspectResponse.department ?? null,
|
|
370
381
|
position: introspectResponse.position ?? null,
|
|
371
382
|
phone_number: introspectResponse.phone_number ?? null,
|
|
372
|
-
organization_id: introspectResponse.organization_id ?? null
|
|
383
|
+
organization_id: introspectResponse.organization_id ?? null,
|
|
384
|
+
organization_name: introspectResponse.organization_name ?? null
|
|
373
385
|
};
|
|
374
386
|
const raw = introspectResponse.subscription ? {
|
|
375
387
|
...base,
|
|
@@ -381,6 +393,7 @@ function createVerifyAccessToken(deps) {
|
|
|
381
393
|
seat_model: introspectResponse.subscription.seat_model,
|
|
382
394
|
member_role: introspectResponse.subscription.member_role,
|
|
383
395
|
organization_id: introspectResponse.subscription.organization_id,
|
|
396
|
+
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
384
397
|
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
385
398
|
}
|
|
386
399
|
} : base;
|
|
@@ -851,7 +864,7 @@ function createProfileMethods(deps) {
|
|
|
851
864
|
}
|
|
852
865
|
|
|
853
866
|
// src/client/version-check.ts
|
|
854
|
-
var SDK_VERSION = "5.
|
|
867
|
+
var SDK_VERSION = "5.9.0";
|
|
855
868
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
856
869
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
857
870
|
function sdkHeaders() {
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-
|
|
2
|
-
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-DRjzfAaS.cjs';
|
|
2
|
+
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-DRjzfAaS.cjs';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-BYdtyO_2.cjs';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-
|
|
2
|
-
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-gboJROw0.js';
|
|
2
|
+
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-gboJROw0.js';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-BYdtyO_2.js';
|
package/dist/server/index.js
CHANGED
|
@@ -105,7 +105,16 @@ var SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES = [
|
|
|
105
105
|
function isSessionEligibleSubscriptionStatus(value) {
|
|
106
106
|
return typeof value === "string" && SESSION_ELIGIBLE_SUBSCRIPTION_STATUSES.includes(value);
|
|
107
107
|
}
|
|
108
|
+
function hasOwnKey(value, key) {
|
|
109
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
110
|
+
}
|
|
108
111
|
function normalizeUserinfo(raw) {
|
|
112
|
+
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
113
|
+
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
114
|
+
const organizationFields = hasOrganizationId ? {
|
|
115
|
+
organizationId: raw.organization_id ?? null,
|
|
116
|
+
organizationName: hasOrganizationName ? raw.organization_name ?? null : null
|
|
117
|
+
} : hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {};
|
|
109
118
|
return {
|
|
110
119
|
sub: raw.sub,
|
|
111
120
|
email: raw.email,
|
|
@@ -115,7 +124,7 @@ function normalizeUserinfo(raw) {
|
|
|
115
124
|
department: raw.department ?? null,
|
|
116
125
|
position: raw.position ?? null,
|
|
117
126
|
phoneNumber: raw.phone_number ?? null,
|
|
118
|
-
|
|
127
|
+
...organizationFields,
|
|
119
128
|
subscription: raw.subscription ? {
|
|
120
129
|
subscriptionId: raw.subscription.subscription_id ?? null,
|
|
121
130
|
status: raw.subscription.status ?? null,
|
|
@@ -124,6 +133,7 @@ function normalizeUserinfo(raw) {
|
|
|
124
133
|
seatModel: raw.subscription.seat_model ?? null,
|
|
125
134
|
memberRole: raw.subscription.member_role ?? null,
|
|
126
135
|
organizationId: raw.subscription.organization_id ?? null,
|
|
136
|
+
organizationName: hasOwnKey(raw.subscription, "organization_name") ? raw.subscription.organization_name ?? null : null,
|
|
127
137
|
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false,
|
|
128
138
|
// #3464: legacy FFID (< this issue) omits the field on the wire.
|
|
129
139
|
// The "unknown" axis is unused — no consumer differentiates "server
|
|
@@ -159,7 +169,8 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
159
169
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd,
|
|
160
170
|
seatModel: subscription.seatModel ?? void 0,
|
|
161
171
|
memberRole: subscription.memberRole ?? void 0,
|
|
162
|
-
organizationId: subscription.organizationId
|
|
172
|
+
organizationId: subscription.organizationId,
|
|
173
|
+
organizationName: subscription.organizationName ?? void 0
|
|
163
174
|
}
|
|
164
175
|
];
|
|
165
176
|
}
|
|
@@ -368,7 +379,8 @@ function createVerifyAccessToken(deps) {
|
|
|
368
379
|
department: introspectResponse.department ?? null,
|
|
369
380
|
position: introspectResponse.position ?? null,
|
|
370
381
|
phone_number: introspectResponse.phone_number ?? null,
|
|
371
|
-
organization_id: introspectResponse.organization_id ?? null
|
|
382
|
+
organization_id: introspectResponse.organization_id ?? null,
|
|
383
|
+
organization_name: introspectResponse.organization_name ?? null
|
|
372
384
|
};
|
|
373
385
|
const raw = introspectResponse.subscription ? {
|
|
374
386
|
...base,
|
|
@@ -380,6 +392,7 @@ function createVerifyAccessToken(deps) {
|
|
|
380
392
|
seat_model: introspectResponse.subscription.seat_model,
|
|
381
393
|
member_role: introspectResponse.subscription.member_role,
|
|
382
394
|
organization_id: introspectResponse.subscription.organization_id,
|
|
395
|
+
organization_name: introspectResponse.subscription.organization_name ?? null,
|
|
383
396
|
has_seat_assignment: introspectResponse.subscription.has_seat_assignment ?? false
|
|
384
397
|
}
|
|
385
398
|
} : base;
|
|
@@ -850,7 +863,7 @@ function createProfileMethods(deps) {
|
|
|
850
863
|
}
|
|
851
864
|
|
|
852
865
|
// src/client/version-check.ts
|
|
853
|
-
var SDK_VERSION = "5.
|
|
866
|
+
var SDK_VERSION = "5.9.0";
|
|
854
867
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
855
868
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
856
869
|
function sdkHeaders() {
|