@feelflow/ffid-sdk 1.18.0 → 1.19.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-ZJIZTYXQ.js → chunk-3IV7STDJ.js} +118 -1
- package/dist/{chunk-THHBQAFX.cjs → chunk-543CO3HP.cjs} +118 -1
- 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-BHh-uxYS.d.cts → index-p4dJw3qR.d.cts} +4 -6
- package/dist/{index-BHh-uxYS.d.ts → index-p4dJw3qR.d.ts} +4 -6
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +196 -3
- package/dist/index.d.ts +196 -3
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +118 -1
- package/dist/server/index.d.cts +196 -5
- package/dist/server/index.d.ts +196 -5
- package/dist/server/index.js +118 -1
- package/package.json +1 -1
|
@@ -445,6 +445,106 @@ function createBillingMethods(deps) {
|
|
|
445
445
|
return { createCheckoutSession, createPortalSession };
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
+
// src/client/subscription-methods.ts
|
|
449
|
+
var EXT_PLANS_ENDPOINT = "/api/v1/subscriptions/ext/plans";
|
|
450
|
+
var EXT_SUBSCRIPTION_ENDPOINT = "/api/v1/subscriptions/ext";
|
|
451
|
+
var EXT_SUBSCRIBE_ENDPOINT = "/api/v1/subscriptions/ext/subscribe";
|
|
452
|
+
function createSubscriptionMethods(deps) {
|
|
453
|
+
const { fetchWithAuth, createError } = deps;
|
|
454
|
+
async function listPlans() {
|
|
455
|
+
return fetchWithAuth(EXT_PLANS_ENDPOINT);
|
|
456
|
+
}
|
|
457
|
+
async function getSubscription(subscriptionId) {
|
|
458
|
+
if (!subscriptionId) {
|
|
459
|
+
return {
|
|
460
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
return fetchWithAuth(
|
|
464
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(subscriptionId)}`
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
async function subscribe(params) {
|
|
468
|
+
if (!params.organizationId || !params.planCode) {
|
|
469
|
+
return {
|
|
470
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
return fetchWithAuth(
|
|
474
|
+
EXT_SUBSCRIBE_ENDPOINT,
|
|
475
|
+
{
|
|
476
|
+
method: "POST",
|
|
477
|
+
body: JSON.stringify({
|
|
478
|
+
organizationId: params.organizationId,
|
|
479
|
+
planCode: params.planCode,
|
|
480
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {},
|
|
481
|
+
...params.quantity !== void 0 ? { quantity: params.quantity } : {},
|
|
482
|
+
...params.userId ? { userId: params.userId } : {}
|
|
483
|
+
})
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
async function changePlan(params) {
|
|
488
|
+
if (!params.subscriptionId || !params.planCode) {
|
|
489
|
+
return {
|
|
490
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
return fetchWithAuth(
|
|
494
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan`,
|
|
495
|
+
{
|
|
496
|
+
method: "PUT",
|
|
497
|
+
body: JSON.stringify({
|
|
498
|
+
planCode: params.planCode,
|
|
499
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {}
|
|
500
|
+
})
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
async function cancelSubscription(params) {
|
|
505
|
+
if (!params.subscriptionId) {
|
|
506
|
+
return {
|
|
507
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
const body = {};
|
|
511
|
+
if (params.reason) body.reason = params.reason;
|
|
512
|
+
if (params.reasonDetails) body.reasonDetails = params.reasonDetails;
|
|
513
|
+
return fetchWithAuth(
|
|
514
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}`,
|
|
515
|
+
{
|
|
516
|
+
method: "DELETE",
|
|
517
|
+
...Object.keys(body).length > 0 ? { body: JSON.stringify(body) } : {}
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
async function previewPlanChange(params) {
|
|
522
|
+
if (!params.subscriptionId || !params.planCode) {
|
|
523
|
+
return {
|
|
524
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
return fetchWithAuth(
|
|
528
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan/preview`,
|
|
529
|
+
{
|
|
530
|
+
method: "POST",
|
|
531
|
+
body: JSON.stringify({
|
|
532
|
+
planCode: params.planCode,
|
|
533
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {}
|
|
534
|
+
})
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
return {
|
|
539
|
+
listPlans,
|
|
540
|
+
getSubscription,
|
|
541
|
+
subscribe,
|
|
542
|
+
changePlan,
|
|
543
|
+
cancelSubscription,
|
|
544
|
+
previewPlanChange
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
448
548
|
// src/client/members-methods.ts
|
|
449
549
|
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
450
550
|
function createMembersMethods(deps) {
|
|
@@ -498,7 +598,7 @@ function createMembersMethods(deps) {
|
|
|
498
598
|
}
|
|
499
599
|
|
|
500
600
|
// src/client/version-check.ts
|
|
501
|
-
var SDK_VERSION = "1.
|
|
601
|
+
var SDK_VERSION = "1.19.0";
|
|
502
602
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
503
603
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
504
604
|
function sdkHeaders() {
|
|
@@ -1571,6 +1671,17 @@ function createFFIDClient(config) {
|
|
|
1571
1671
|
fetchWithAuth,
|
|
1572
1672
|
createError
|
|
1573
1673
|
});
|
|
1674
|
+
const {
|
|
1675
|
+
listPlans,
|
|
1676
|
+
getSubscription,
|
|
1677
|
+
subscribe,
|
|
1678
|
+
changePlan,
|
|
1679
|
+
cancelSubscription,
|
|
1680
|
+
previewPlanChange
|
|
1681
|
+
} = createSubscriptionMethods({
|
|
1682
|
+
fetchWithAuth,
|
|
1683
|
+
createError
|
|
1684
|
+
});
|
|
1574
1685
|
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1575
1686
|
fetchWithAuth,
|
|
1576
1687
|
createError,
|
|
@@ -1624,6 +1735,12 @@ function createFFIDClient(config) {
|
|
|
1624
1735
|
removeMember,
|
|
1625
1736
|
createCheckoutSession,
|
|
1626
1737
|
createPortalSession,
|
|
1738
|
+
listPlans,
|
|
1739
|
+
getSubscription,
|
|
1740
|
+
subscribe,
|
|
1741
|
+
changePlan,
|
|
1742
|
+
cancelSubscription,
|
|
1743
|
+
previewPlanChange,
|
|
1627
1744
|
verifyAccessToken,
|
|
1628
1745
|
requestPasswordReset,
|
|
1629
1746
|
verifyPasswordResetToken,
|
|
@@ -447,6 +447,106 @@ function createBillingMethods(deps) {
|
|
|
447
447
|
return { createCheckoutSession, createPortalSession };
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
// src/client/subscription-methods.ts
|
|
451
|
+
var EXT_PLANS_ENDPOINT = "/api/v1/subscriptions/ext/plans";
|
|
452
|
+
var EXT_SUBSCRIPTION_ENDPOINT = "/api/v1/subscriptions/ext";
|
|
453
|
+
var EXT_SUBSCRIBE_ENDPOINT = "/api/v1/subscriptions/ext/subscribe";
|
|
454
|
+
function createSubscriptionMethods(deps) {
|
|
455
|
+
const { fetchWithAuth, createError } = deps;
|
|
456
|
+
async function listPlans() {
|
|
457
|
+
return fetchWithAuth(EXT_PLANS_ENDPOINT);
|
|
458
|
+
}
|
|
459
|
+
async function getSubscription(subscriptionId) {
|
|
460
|
+
if (!subscriptionId) {
|
|
461
|
+
return {
|
|
462
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
return fetchWithAuth(
|
|
466
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(subscriptionId)}`
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
async function subscribe(params) {
|
|
470
|
+
if (!params.organizationId || !params.planCode) {
|
|
471
|
+
return {
|
|
472
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
return fetchWithAuth(
|
|
476
|
+
EXT_SUBSCRIBE_ENDPOINT,
|
|
477
|
+
{
|
|
478
|
+
method: "POST",
|
|
479
|
+
body: JSON.stringify({
|
|
480
|
+
organizationId: params.organizationId,
|
|
481
|
+
planCode: params.planCode,
|
|
482
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {},
|
|
483
|
+
...params.quantity !== void 0 ? { quantity: params.quantity } : {},
|
|
484
|
+
...params.userId ? { userId: params.userId } : {}
|
|
485
|
+
})
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
async function changePlan(params) {
|
|
490
|
+
if (!params.subscriptionId || !params.planCode) {
|
|
491
|
+
return {
|
|
492
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
return fetchWithAuth(
|
|
496
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan`,
|
|
497
|
+
{
|
|
498
|
+
method: "PUT",
|
|
499
|
+
body: JSON.stringify({
|
|
500
|
+
planCode: params.planCode,
|
|
501
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {}
|
|
502
|
+
})
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
async function cancelSubscription(params) {
|
|
507
|
+
if (!params.subscriptionId) {
|
|
508
|
+
return {
|
|
509
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
const body = {};
|
|
513
|
+
if (params.reason) body.reason = params.reason;
|
|
514
|
+
if (params.reasonDetails) body.reasonDetails = params.reasonDetails;
|
|
515
|
+
return fetchWithAuth(
|
|
516
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}`,
|
|
517
|
+
{
|
|
518
|
+
method: "DELETE",
|
|
519
|
+
...Object.keys(body).length > 0 ? { body: JSON.stringify(body) } : {}
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
async function previewPlanChange(params) {
|
|
524
|
+
if (!params.subscriptionId || !params.planCode) {
|
|
525
|
+
return {
|
|
526
|
+
error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
return fetchWithAuth(
|
|
530
|
+
`${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan/preview`,
|
|
531
|
+
{
|
|
532
|
+
method: "POST",
|
|
533
|
+
body: JSON.stringify({
|
|
534
|
+
planCode: params.planCode,
|
|
535
|
+
...params.billingInterval ? { billingInterval: params.billingInterval } : {}
|
|
536
|
+
})
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
return {
|
|
541
|
+
listPlans,
|
|
542
|
+
getSubscription,
|
|
543
|
+
subscribe,
|
|
544
|
+
changePlan,
|
|
545
|
+
cancelSubscription,
|
|
546
|
+
previewPlanChange
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
|
|
450
550
|
// src/client/members-methods.ts
|
|
451
551
|
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
452
552
|
function createMembersMethods(deps) {
|
|
@@ -500,7 +600,7 @@ function createMembersMethods(deps) {
|
|
|
500
600
|
}
|
|
501
601
|
|
|
502
602
|
// src/client/version-check.ts
|
|
503
|
-
var SDK_VERSION = "1.
|
|
603
|
+
var SDK_VERSION = "1.19.0";
|
|
504
604
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
505
605
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
506
606
|
function sdkHeaders() {
|
|
@@ -1573,6 +1673,17 @@ function createFFIDClient(config) {
|
|
|
1573
1673
|
fetchWithAuth,
|
|
1574
1674
|
createError
|
|
1575
1675
|
});
|
|
1676
|
+
const {
|
|
1677
|
+
listPlans,
|
|
1678
|
+
getSubscription,
|
|
1679
|
+
subscribe,
|
|
1680
|
+
changePlan,
|
|
1681
|
+
cancelSubscription,
|
|
1682
|
+
previewPlanChange
|
|
1683
|
+
} = createSubscriptionMethods({
|
|
1684
|
+
fetchWithAuth,
|
|
1685
|
+
createError
|
|
1686
|
+
});
|
|
1576
1687
|
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1577
1688
|
fetchWithAuth,
|
|
1578
1689
|
createError,
|
|
@@ -1626,6 +1737,12 @@ function createFFIDClient(config) {
|
|
|
1626
1737
|
removeMember,
|
|
1627
1738
|
createCheckoutSession,
|
|
1628
1739
|
createPortalSession,
|
|
1740
|
+
listPlans,
|
|
1741
|
+
getSubscription,
|
|
1742
|
+
subscribe,
|
|
1743
|
+
changePlan,
|
|
1744
|
+
cancelSubscription,
|
|
1745
|
+
previewPlanChange,
|
|
1629
1746
|
verifyAccessToken,
|
|
1630
1747
|
requestPasswordReset,
|
|
1631
1748
|
verifyPasswordResetToken,
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk543CO3HP_cjs = require('../chunk-543CO3HP.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 chunk543CO3HP_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk543CO3HP_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk543CO3HP_cjs.FFIDLoginButton; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk543CO3HP_cjs.FFIDOrganizationSwitcher; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk543CO3HP_cjs.FFIDSubscriptionBadge; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk543CO3HP_cjs.FFIDUserMenu; }
|
|
30
30
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { E as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, G as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, O as FFIDLoginButton, a4 as FFIDLoginButtonProps, U as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, W as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-p4dJw3qR.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { E as FFIDAnnouncementBadge, a0 as FFIDAnnouncementBadgeClassNames, a1 as FFIDAnnouncementBadgeProps, G as FFIDAnnouncementList, a2 as FFIDAnnouncementListClassNames, a3 as FFIDAnnouncementListProps, O as FFIDLoginButton, a4 as FFIDLoginButtonProps, U as FFIDOrganizationSwitcher, a5 as FFIDOrganizationSwitcherClassNames, a6 as FFIDOrganizationSwitcherProps, W as FFIDSubscriptionBadge, a7 as FFIDSubscriptionBadgeClassNames, a8 as FFIDSubscriptionBadgeProps, Y as FFIDUserMenu, a9 as FFIDUserMenuClassNames, aa as FFIDUserMenuProps } from '../index-p4dJw3qR.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-3IV7STDJ.js';
|
|
@@ -104,7 +104,7 @@ interface FFIDSubscription {
|
|
|
104
104
|
/** Plan display name */
|
|
105
105
|
planName: string;
|
|
106
106
|
/** Subscription status */
|
|
107
|
-
status:
|
|
107
|
+
status: FFIDSubscriptionStatus;
|
|
108
108
|
/** Current billing period end date */
|
|
109
109
|
currentPeriodEnd: string | null;
|
|
110
110
|
/** Trial end date (null if not a trial or no trial_end set) */
|
|
@@ -119,7 +119,7 @@ interface FFIDSubscription {
|
|
|
119
119
|
/** OAuth userinfo subscription summary */
|
|
120
120
|
interface FFIDOAuthUserInfoSubscription {
|
|
121
121
|
subscriptionId: string | null;
|
|
122
|
-
status:
|
|
122
|
+
status: FFIDSubscriptionStatus | null;
|
|
123
123
|
planCode: string | null;
|
|
124
124
|
seatModel: FFIDSeatModel | null;
|
|
125
125
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
@@ -337,9 +337,6 @@ type FFIDApiResponse<T> = {
|
|
|
337
337
|
data?: undefined;
|
|
338
338
|
error: FFIDError;
|
|
339
339
|
};
|
|
340
|
-
/**
|
|
341
|
-
* Subscription check response from ext/check endpoint
|
|
342
|
-
*/
|
|
343
340
|
/** Subscription status values matching the FFID platform's SubscriptionStatus type */
|
|
344
341
|
type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
|
|
345
342
|
interface FFIDSubscriptionCheckResponse {
|
|
@@ -390,6 +387,7 @@ interface FFIDCreatePortalParams {
|
|
|
390
387
|
/** URL to redirect when user exits the portal */
|
|
391
388
|
returnUrl: string;
|
|
392
389
|
}
|
|
390
|
+
|
|
393
391
|
/** Member role in an organization */
|
|
394
392
|
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
395
393
|
/** Member status in an organization */
|
|
@@ -846,4 +844,4 @@ interface FFIDAnnouncementListProps {
|
|
|
846
844
|
*/
|
|
847
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
848
846
|
|
|
849
|
-
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type
|
|
847
|
+
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, type FFIDJwtClaims as N, FFIDLoginButton as O, type FFIDMemberStatus as P, type FFIDOAuthTokenResponse as Q, type FFIDOAuthUserInfoMemberRole as R, type FFIDOAuthUserInfoSubscription as S, type FFIDOrganizationMember as T, FFIDOrganizationSwitcher as U, type FFIDSeatModel as V, FFIDSubscriptionBadge as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDConfig 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 FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
|
@@ -104,7 +104,7 @@ interface FFIDSubscription {
|
|
|
104
104
|
/** Plan display name */
|
|
105
105
|
planName: string;
|
|
106
106
|
/** Subscription status */
|
|
107
|
-
status:
|
|
107
|
+
status: FFIDSubscriptionStatus;
|
|
108
108
|
/** Current billing period end date */
|
|
109
109
|
currentPeriodEnd: string | null;
|
|
110
110
|
/** Trial end date (null if not a trial or no trial_end set) */
|
|
@@ -119,7 +119,7 @@ interface FFIDSubscription {
|
|
|
119
119
|
/** OAuth userinfo subscription summary */
|
|
120
120
|
interface FFIDOAuthUserInfoSubscription {
|
|
121
121
|
subscriptionId: string | null;
|
|
122
|
-
status:
|
|
122
|
+
status: FFIDSubscriptionStatus | null;
|
|
123
123
|
planCode: string | null;
|
|
124
124
|
seatModel: FFIDSeatModel | null;
|
|
125
125
|
memberRole: FFIDOAuthUserInfoMemberRole | null;
|
|
@@ -337,9 +337,6 @@ type FFIDApiResponse<T> = {
|
|
|
337
337
|
data?: undefined;
|
|
338
338
|
error: FFIDError;
|
|
339
339
|
};
|
|
340
|
-
/**
|
|
341
|
-
* Subscription check response from ext/check endpoint
|
|
342
|
-
*/
|
|
343
340
|
/** Subscription status values matching the FFID platform's SubscriptionStatus type */
|
|
344
341
|
type FFIDSubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'canceled' | 'pending_invoice' | 'paused' | 'incomplete' | 'incomplete_expired' | 'unpaid';
|
|
345
342
|
interface FFIDSubscriptionCheckResponse {
|
|
@@ -390,6 +387,7 @@ interface FFIDCreatePortalParams {
|
|
|
390
387
|
/** URL to redirect when user exits the portal */
|
|
391
388
|
returnUrl: string;
|
|
392
389
|
}
|
|
390
|
+
|
|
393
391
|
/** Member role in an organization */
|
|
394
392
|
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
395
393
|
/** Member status in an organization */
|
|
@@ -846,4 +844,4 @@ interface FFIDAnnouncementListProps {
|
|
|
846
844
|
*/
|
|
847
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
848
846
|
|
|
849
|
-
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type
|
|
847
|
+
export { useFFIDAnnouncements as $, type AnnouncementListResponse as A, type Announcement as B, type AnnouncementStatus as C, type AnnouncementType as D, FFIDAnnouncementBadge as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementList as G, type FFIDAnnouncementsError as H, type FFIDAnnouncementsErrorCode as I, type FFIDAnnouncementsServerResponse as J, type FFIDCacheConfig as K, type ListAnnouncementsOptions as L, type FFIDContextValue as M, type FFIDJwtClaims as N, FFIDLoginButton as O, type FFIDMemberStatus as P, type FFIDOAuthTokenResponse as Q, type FFIDOAuthUserInfoMemberRole as R, type FFIDOAuthUserInfoSubscription as S, type FFIDOrganizationMember as T, FFIDOrganizationSwitcher as U, type FFIDSeatModel as V, FFIDSubscriptionBadge as W, type FFIDTokenIntrospectionResponse as X, FFIDUserMenu as Y, type UseFFIDAnnouncementsOptions as Z, type UseFFIDAnnouncementsReturn as _, type FFIDConfig 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 FFIDApiResponse as b, type FFIDSessionResponse as c, type FFIDRedirectResult as d, type FFIDError as e, type FFIDSubscriptionCheckResponse as f, type FFIDListMembersResponse as g, type FFIDMemberRole as h, type FFIDUpdateMemberRoleResponse as i, type FFIDRemoveMemberResponse as j, type FFIDCreateCheckoutParams as k, type FFIDCheckoutSessionResponse as l, type FFIDCreatePortalParams as m, type FFIDPortalSessionResponse as n, type FFIDVerifyAccessTokenOptions as o, type FFIDOAuthUserInfo as p, type FFIDAuthMode as q, type FFIDLogger as r, type FFIDCacheAdapter as s, type FFIDUser as t, type FFIDOrganization as u, type FFIDSubscription as v, type FFIDSubscriptionContextValue as w, type FFIDAnnouncementsClientConfig as x, type FFIDAnnouncementsApiResponse as y, type FFIDAnnouncementsLogger as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk543CO3HP_cjs = require('./chunk-543CO3HP.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 } = chunk543CO3HP_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 chunk543CO3HP_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 chunk543CO3HP_cjs.FFIDAnnouncementBadge; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk543CO3HP_cjs.FFIDAnnouncementList; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunk543CO3HP_cjs.FFIDLoginButton; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunk543CO3HP_cjs.FFIDOrganizationSwitcher; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunk543CO3HP_cjs.FFIDProvider; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunk543CO3HP_cjs.FFIDSubscriptionBadge; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunk543CO3HP_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 chunk543CO3HP_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 chunk543CO3HP_cjs.createFFIDAnnouncementsClient; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunk543CO3HP_cjs.createFFIDClient; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "createTokenStore", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunk543CO3HP_cjs.createTokenStore; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunk543CO3HP_cjs.generateCodeChallenge; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunk543CO3HP_cjs.generateCodeVerifier; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunk543CO3HP_cjs.retrieveCodeVerifier; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunk543CO3HP_cjs.storeCodeVerifier; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "useFFID", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunk543CO3HP_cjs.useFFID; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunk543CO3HP_cjs.useFFIDAnnouncements; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "useSubscription", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunk543CO3HP_cjs.useSubscription; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "withSubscription", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunk543CO3HP_cjs.withSubscription; }
|
|
151
151
|
});
|
|
152
152
|
exports.createKVCacheAdapter = createKVCacheAdapter;
|
|
153
153
|
exports.createMemoryCacheAdapter = createMemoryCacheAdapter;
|