@feelflow/ffid-sdk 1.17.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-4LRZTABD.js → chunk-3IV7STDJ.js} +180 -2
- package/dist/{chunk-4L5JIETV.cjs → chunk-543CO3HP.cjs} +180 -2
- package/dist/components/index.cjs +7 -7
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-B9sSp8kZ.d.cts → index-p4dJw3qR.d.cts} +42 -6
- package/dist/{index-B9sSp8kZ.d.ts → index-p4dJw3qR.d.ts} +42 -6
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +208 -3
- package/dist/index.d.ts +208 -3
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +180 -2
- package/dist/server/index.d.cts +246 -5
- package/dist/server/index.d.ts +246 -5
- package/dist/server/index.js +180 -2
- package/package.json +1 -1
|
@@ -123,7 +123,7 @@ function normalizeUserinfo(raw) {
|
|
|
123
123
|
seatModel: raw.subscription.seat_model ?? null,
|
|
124
124
|
memberRole: raw.subscription.member_role ?? null,
|
|
125
125
|
organizationId: raw.subscription.organization_id ?? null,
|
|
126
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
126
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
127
127
|
} : void 0
|
|
128
128
|
};
|
|
129
129
|
}
|
|
@@ -141,6 +141,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
141
141
|
planName: subscription.planCode,
|
|
142
142
|
status: subscription.status,
|
|
143
143
|
currentPeriodEnd: null,
|
|
144
|
+
trialEnd: null,
|
|
144
145
|
seatModel: subscription.seatModel ?? void 0,
|
|
145
146
|
memberRole: subscription.memberRole ?? void 0,
|
|
146
147
|
organizationId: subscription.organizationId
|
|
@@ -444,8 +445,160 @@ function createBillingMethods(deps) {
|
|
|
444
445
|
return { createCheckoutSession, createPortalSession };
|
|
445
446
|
}
|
|
446
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
|
+
|
|
548
|
+
// src/client/members-methods.ts
|
|
549
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
550
|
+
function createMembersMethods(deps) {
|
|
551
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
552
|
+
function buildQuery(organizationId) {
|
|
553
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
554
|
+
}
|
|
555
|
+
async function listMembers(params) {
|
|
556
|
+
if (!params.organizationId) {
|
|
557
|
+
return {
|
|
558
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
return fetchWithAuth(
|
|
562
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
async function updateMemberRole(params) {
|
|
566
|
+
if (!params.organizationId || !params.userId) {
|
|
567
|
+
return {
|
|
568
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
if (!params.role) {
|
|
572
|
+
return {
|
|
573
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
return fetchWithAuth(
|
|
577
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
578
|
+
{
|
|
579
|
+
method: "PUT",
|
|
580
|
+
body: JSON.stringify({ role: params.role })
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
}
|
|
584
|
+
async function removeMember(params) {
|
|
585
|
+
if (!params.organizationId || !params.userId) {
|
|
586
|
+
return {
|
|
587
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
return fetchWithAuth(
|
|
591
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
592
|
+
{
|
|
593
|
+
method: "DELETE"
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
598
|
+
}
|
|
599
|
+
|
|
447
600
|
// src/client/version-check.ts
|
|
448
|
-
var SDK_VERSION = "1.
|
|
601
|
+
var SDK_VERSION = "1.19.0";
|
|
449
602
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
450
603
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
451
604
|
function sdkHeaders() {
|
|
@@ -1518,6 +1671,22 @@ function createFFIDClient(config) {
|
|
|
1518
1671
|
fetchWithAuth,
|
|
1519
1672
|
createError
|
|
1520
1673
|
});
|
|
1674
|
+
const {
|
|
1675
|
+
listPlans,
|
|
1676
|
+
getSubscription,
|
|
1677
|
+
subscribe,
|
|
1678
|
+
changePlan,
|
|
1679
|
+
cancelSubscription,
|
|
1680
|
+
previewPlanChange
|
|
1681
|
+
} = createSubscriptionMethods({
|
|
1682
|
+
fetchWithAuth,
|
|
1683
|
+
createError
|
|
1684
|
+
});
|
|
1685
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1686
|
+
fetchWithAuth,
|
|
1687
|
+
createError,
|
|
1688
|
+
serviceCode: config.serviceCode
|
|
1689
|
+
});
|
|
1521
1690
|
const {
|
|
1522
1691
|
requestPasswordReset,
|
|
1523
1692
|
verifyPasswordResetToken,
|
|
@@ -1561,8 +1730,17 @@ function createFFIDClient(config) {
|
|
|
1561
1730
|
exchangeCodeForTokens,
|
|
1562
1731
|
refreshAccessToken,
|
|
1563
1732
|
checkSubscription,
|
|
1733
|
+
listMembers,
|
|
1734
|
+
updateMemberRole,
|
|
1735
|
+
removeMember,
|
|
1564
1736
|
createCheckoutSession,
|
|
1565
1737
|
createPortalSession,
|
|
1738
|
+
listPlans,
|
|
1739
|
+
getSubscription,
|
|
1740
|
+
subscribe,
|
|
1741
|
+
changePlan,
|
|
1742
|
+
cancelSubscription,
|
|
1743
|
+
previewPlanChange,
|
|
1566
1744
|
verifyAccessToken,
|
|
1567
1745
|
requestPasswordReset,
|
|
1568
1746
|
verifyPasswordResetToken,
|
|
@@ -125,7 +125,7 @@ function normalizeUserinfo(raw) {
|
|
|
125
125
|
seatModel: raw.subscription.seat_model ?? null,
|
|
126
126
|
memberRole: raw.subscription.member_role ?? null,
|
|
127
127
|
organizationId: raw.subscription.organization_id ?? null,
|
|
128
|
-
hasSeatAssignment: raw.subscription.has_seat_assignment ??
|
|
128
|
+
hasSeatAssignment: raw.subscription.has_seat_assignment ?? false
|
|
129
129
|
} : void 0
|
|
130
130
|
};
|
|
131
131
|
}
|
|
@@ -143,6 +143,7 @@ function mapUserinfoSubscriptionToSession(userinfo, serviceCode) {
|
|
|
143
143
|
planName: subscription.planCode,
|
|
144
144
|
status: subscription.status,
|
|
145
145
|
currentPeriodEnd: null,
|
|
146
|
+
trialEnd: null,
|
|
146
147
|
seatModel: subscription.seatModel ?? void 0,
|
|
147
148
|
memberRole: subscription.memberRole ?? void 0,
|
|
148
149
|
organizationId: subscription.organizationId
|
|
@@ -446,8 +447,160 @@ function createBillingMethods(deps) {
|
|
|
446
447
|
return { createCheckoutSession, createPortalSession };
|
|
447
448
|
}
|
|
448
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
|
+
|
|
550
|
+
// src/client/members-methods.ts
|
|
551
|
+
var EXT_MEMBERS_ENDPOINT = "/api/v1/organizations/ext/members";
|
|
552
|
+
function createMembersMethods(deps) {
|
|
553
|
+
const { fetchWithAuth, createError, serviceCode } = deps;
|
|
554
|
+
function buildQuery(organizationId) {
|
|
555
|
+
return new URLSearchParams({ organizationId, serviceCode }).toString();
|
|
556
|
+
}
|
|
557
|
+
async function listMembers(params) {
|
|
558
|
+
if (!params.organizationId) {
|
|
559
|
+
return {
|
|
560
|
+
error: createError("VALIDATION_ERROR", "organizationId \u306F\u5FC5\u9808\u3067\u3059")
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
return fetchWithAuth(
|
|
564
|
+
`${EXT_MEMBERS_ENDPOINT}?${buildQuery(params.organizationId)}`
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
async function updateMemberRole(params) {
|
|
568
|
+
if (!params.organizationId || !params.userId) {
|
|
569
|
+
return {
|
|
570
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
if (!params.role) {
|
|
574
|
+
return {
|
|
575
|
+
error: createError("VALIDATION_ERROR", "role \u306F\u5FC5\u9808\u3067\u3059")
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
return fetchWithAuth(
|
|
579
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
580
|
+
{
|
|
581
|
+
method: "PUT",
|
|
582
|
+
body: JSON.stringify({ role: params.role })
|
|
583
|
+
}
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
async function removeMember(params) {
|
|
587
|
+
if (!params.organizationId || !params.userId) {
|
|
588
|
+
return {
|
|
589
|
+
error: createError("VALIDATION_ERROR", "organizationId \u3068 userId \u306F\u5FC5\u9808\u3067\u3059")
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
return fetchWithAuth(
|
|
593
|
+
`${EXT_MEMBERS_ENDPOINT}/${encodeURIComponent(params.userId)}?${buildQuery(params.organizationId)}`,
|
|
594
|
+
{
|
|
595
|
+
method: "DELETE"
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
return { listMembers, updateMemberRole, removeMember };
|
|
600
|
+
}
|
|
601
|
+
|
|
449
602
|
// src/client/version-check.ts
|
|
450
|
-
var SDK_VERSION = "1.
|
|
603
|
+
var SDK_VERSION = "1.19.0";
|
|
451
604
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
452
605
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
453
606
|
function sdkHeaders() {
|
|
@@ -1520,6 +1673,22 @@ function createFFIDClient(config) {
|
|
|
1520
1673
|
fetchWithAuth,
|
|
1521
1674
|
createError
|
|
1522
1675
|
});
|
|
1676
|
+
const {
|
|
1677
|
+
listPlans,
|
|
1678
|
+
getSubscription,
|
|
1679
|
+
subscribe,
|
|
1680
|
+
changePlan,
|
|
1681
|
+
cancelSubscription,
|
|
1682
|
+
previewPlanChange
|
|
1683
|
+
} = createSubscriptionMethods({
|
|
1684
|
+
fetchWithAuth,
|
|
1685
|
+
createError
|
|
1686
|
+
});
|
|
1687
|
+
const { listMembers, updateMemberRole, removeMember } = createMembersMethods({
|
|
1688
|
+
fetchWithAuth,
|
|
1689
|
+
createError,
|
|
1690
|
+
serviceCode: config.serviceCode
|
|
1691
|
+
});
|
|
1523
1692
|
const {
|
|
1524
1693
|
requestPasswordReset,
|
|
1525
1694
|
verifyPasswordResetToken,
|
|
@@ -1563,8 +1732,17 @@ function createFFIDClient(config) {
|
|
|
1563
1732
|
exchangeCodeForTokens,
|
|
1564
1733
|
refreshAccessToken,
|
|
1565
1734
|
checkSubscription,
|
|
1735
|
+
listMembers,
|
|
1736
|
+
updateMemberRole,
|
|
1737
|
+
removeMember,
|
|
1566
1738
|
createCheckoutSession,
|
|
1567
1739
|
createPortalSession,
|
|
1740
|
+
listPlans,
|
|
1741
|
+
getSubscription,
|
|
1742
|
+
subscribe,
|
|
1743
|
+
changePlan,
|
|
1744
|
+
cancelSubscription,
|
|
1745
|
+
previewPlanChange,
|
|
1568
1746
|
verifyAccessToken,
|
|
1569
1747
|
requestPasswordReset,
|
|
1570
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,45 @@ interface FFIDCreatePortalParams {
|
|
|
390
387
|
/** URL to redirect when user exits the portal */
|
|
391
388
|
returnUrl: string;
|
|
392
389
|
}
|
|
390
|
+
|
|
391
|
+
/** Member role in an organization */
|
|
392
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
393
|
+
/** Member status in an organization */
|
|
394
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
395
|
+
/** Organization member returned by the ext members API */
|
|
396
|
+
interface FFIDOrganizationMember {
|
|
397
|
+
/** User ID (UUID) */
|
|
398
|
+
userId: string;
|
|
399
|
+
/** Email address */
|
|
400
|
+
email: string;
|
|
401
|
+
/** Display name */
|
|
402
|
+
displayName: string | null;
|
|
403
|
+
/** Avatar URL */
|
|
404
|
+
avatarUrl: string | null;
|
|
405
|
+
/** Role in the organization */
|
|
406
|
+
role: FFIDMemberRole;
|
|
407
|
+
/** Membership status */
|
|
408
|
+
status: FFIDMemberStatus;
|
|
409
|
+
/** When the user joined */
|
|
410
|
+
joinedAt: string | null;
|
|
411
|
+
/** When the user was invited */
|
|
412
|
+
invitedAt: string | null;
|
|
413
|
+
/** Last sign-in timestamp */
|
|
414
|
+
lastSignInAt: string | null;
|
|
415
|
+
}
|
|
416
|
+
/** Response from listMembers (ext) */
|
|
417
|
+
interface FFIDListMembersResponse {
|
|
418
|
+
organizationId: string;
|
|
419
|
+
members: FFIDOrganizationMember[];
|
|
420
|
+
}
|
|
421
|
+
/** Response from updateMemberRole (ext) */
|
|
422
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
423
|
+
member: FFIDOrganizationMember;
|
|
424
|
+
}
|
|
425
|
+
/** Response from removeMember (ext) */
|
|
426
|
+
interface FFIDRemoveMemberResponse {
|
|
427
|
+
message: string;
|
|
428
|
+
}
|
|
393
429
|
/**
|
|
394
430
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
395
431
|
*
|
|
@@ -808,4 +844,4 @@ interface FFIDAnnouncementListProps {
|
|
|
808
844
|
*/
|
|
809
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
810
846
|
|
|
811
|
-
export {
|
|
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,45 @@ interface FFIDCreatePortalParams {
|
|
|
390
387
|
/** URL to redirect when user exits the portal */
|
|
391
388
|
returnUrl: string;
|
|
392
389
|
}
|
|
390
|
+
|
|
391
|
+
/** Member role in an organization */
|
|
392
|
+
type FFIDMemberRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
393
|
+
/** Member status in an organization */
|
|
394
|
+
type FFIDMemberStatus = 'active' | 'invited' | 'suspended';
|
|
395
|
+
/** Organization member returned by the ext members API */
|
|
396
|
+
interface FFIDOrganizationMember {
|
|
397
|
+
/** User ID (UUID) */
|
|
398
|
+
userId: string;
|
|
399
|
+
/** Email address */
|
|
400
|
+
email: string;
|
|
401
|
+
/** Display name */
|
|
402
|
+
displayName: string | null;
|
|
403
|
+
/** Avatar URL */
|
|
404
|
+
avatarUrl: string | null;
|
|
405
|
+
/** Role in the organization */
|
|
406
|
+
role: FFIDMemberRole;
|
|
407
|
+
/** Membership status */
|
|
408
|
+
status: FFIDMemberStatus;
|
|
409
|
+
/** When the user joined */
|
|
410
|
+
joinedAt: string | null;
|
|
411
|
+
/** When the user was invited */
|
|
412
|
+
invitedAt: string | null;
|
|
413
|
+
/** Last sign-in timestamp */
|
|
414
|
+
lastSignInAt: string | null;
|
|
415
|
+
}
|
|
416
|
+
/** Response from listMembers (ext) */
|
|
417
|
+
interface FFIDListMembersResponse {
|
|
418
|
+
organizationId: string;
|
|
419
|
+
members: FFIDOrganizationMember[];
|
|
420
|
+
}
|
|
421
|
+
/** Response from updateMemberRole (ext) */
|
|
422
|
+
interface FFIDUpdateMemberRoleResponse {
|
|
423
|
+
member: FFIDOrganizationMember;
|
|
424
|
+
}
|
|
425
|
+
/** Response from removeMember (ext) */
|
|
426
|
+
interface FFIDRemoveMemberResponse {
|
|
427
|
+
message: string;
|
|
428
|
+
}
|
|
393
429
|
/**
|
|
394
430
|
* Result of a redirect operation (redirectToLogin / redirectToAuthorize / redirectToLogout)
|
|
395
431
|
*
|
|
@@ -808,4 +844,4 @@ interface FFIDAnnouncementListProps {
|
|
|
808
844
|
*/
|
|
809
845
|
declare function FFIDAnnouncementList({ announcements, isLoading, className, classNames, style, formatDate, emptyMessage, loadingRender, renderItem, maxContentLines, }: FFIDAnnouncementListProps): react_jsx_runtime.JSX.Element;
|
|
810
846
|
|
|
811
|
-
export {
|
|
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 };
|