@feelflow/ffid-sdk 9.0.0 → 10.0.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/README.md +1010 -960
- package/dist/{chunk-Q2ZQJS36.cjs → chunk-2LU2F3F2.cjs} +279 -5
- package/dist/{chunk-TUXIJEEZ.js → chunk-OXW6QSTO.js} +266 -6
- 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-B0cORHac.d.ts → ffid-client-5uxXRgIO.d.ts} +686 -376
- package/dist/{ffid-client-6aLs9Fqc.d.cts → ffid-client-CumygXXz.d.cts} +686 -376
- package/dist/{index-BG7g99pK.d.cts → index-KjewcNn1.d.cts} +813 -2
- package/dist/{index-BG7g99pK.d.ts → index-KjewcNn1.d.ts} +813 -2
- package/dist/index.cjs +130 -74
- package/dist/index.d.cts +115 -504
- package/dist/index.d.ts +115 -504
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +249 -5
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +249 -5
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/dist/webhooks/index.d.cts +74 -2
- package/dist/webhooks/index.d.ts +74 -2
- package/package.json +131 -131
|
@@ -1374,7 +1374,7 @@ var FFID_ORGANIZATION_PROFILE_ERROR_CODES = {
|
|
|
1374
1374
|
};
|
|
1375
1375
|
|
|
1376
1376
|
// src/client/version-check.ts
|
|
1377
|
-
var SDK_VERSION = "
|
|
1377
|
+
var SDK_VERSION = "10.0.0";
|
|
1378
1378
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1379
1379
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1380
1380
|
function sdkHeaders() {
|
|
@@ -1730,8 +1730,11 @@ function createProvisioningMethods(deps) {
|
|
|
1730
1730
|
}
|
|
1731
1731
|
|
|
1732
1732
|
// src/client/seat-methods.ts
|
|
1733
|
+
function seatSummaryEndpoint(subscriptionId) {
|
|
1734
|
+
return `/api/v1/subscriptions/ext/${encodeURIComponent(subscriptionId)}/seats`;
|
|
1735
|
+
}
|
|
1733
1736
|
function seatsEndpoint(subscriptionId) {
|
|
1734
|
-
return
|
|
1737
|
+
return `${seatSummaryEndpoint(subscriptionId)}/assignments`;
|
|
1735
1738
|
}
|
|
1736
1739
|
function createSeatMethods(deps) {
|
|
1737
1740
|
const { fetchWithAuth, createError } = deps;
|
|
@@ -1741,6 +1744,12 @@ function createSeatMethods(deps) {
|
|
|
1741
1744
|
}
|
|
1742
1745
|
return fetchWithAuth(seatsEndpoint(params.subscriptionId));
|
|
1743
1746
|
}
|
|
1747
|
+
async function getSeats(subscriptionId) {
|
|
1748
|
+
if (!subscriptionId || !subscriptionId.trim()) {
|
|
1749
|
+
return { error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059") };
|
|
1750
|
+
}
|
|
1751
|
+
return fetchWithAuth(seatSummaryEndpoint(subscriptionId));
|
|
1752
|
+
}
|
|
1744
1753
|
async function assignSeats(params) {
|
|
1745
1754
|
if (!params.subscriptionId) {
|
|
1746
1755
|
return { error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059") };
|
|
@@ -1765,7 +1774,7 @@ function createSeatMethods(deps) {
|
|
|
1765
1774
|
{ method: "DELETE" }
|
|
1766
1775
|
);
|
|
1767
1776
|
}
|
|
1768
|
-
return { listSeatAssignments, assignSeats, unassignSeat };
|
|
1777
|
+
return { listSeatAssignments, getSeats, assignSeats, unassignSeat };
|
|
1769
1778
|
}
|
|
1770
1779
|
|
|
1771
1780
|
// src/client/profile-methods.ts
|
|
@@ -3630,6 +3639,225 @@ function createInquiryMethods(deps) {
|
|
|
3630
3639
|
return { create };
|
|
3631
3640
|
}
|
|
3632
3641
|
|
|
3642
|
+
// src/types/credits.ts
|
|
3643
|
+
var FFID_CREDITS_LOW_THRESHOLD_PERCENT = 20;
|
|
3644
|
+
var FFID_CREDITS_CONSUME_MIN_AMOUNT = 1;
|
|
3645
|
+
var FFID_CREDITS_CONSUME_MAX_AMOUNT = 1e6;
|
|
3646
|
+
var FFID_CREDITS_METADATA_MAX_BYTES = 4096;
|
|
3647
|
+
var FFID_CREDITS_HISTORY_MIN_LIMIT = 1;
|
|
3648
|
+
var FFID_CREDITS_HISTORY_MAX_LIMIT = 100;
|
|
3649
|
+
var FFID_CREDITS_HISTORY_DEFAULT_LIMIT = 20;
|
|
3650
|
+
var FFID_CREDIT_PACK_MIN_QUANTITY = 1;
|
|
3651
|
+
var FFID_CREDIT_PACK_MAX_QUANTITY = 10;
|
|
3652
|
+
var FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN = /^[A-Za-z0-9._:-]{8,128}$/;
|
|
3653
|
+
var FFID_CREDITS_FEATURE_PATTERN = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
3654
|
+
var FFID_CREDIT_HISTORY_TYPES = ["grant", "consumption", "revocation"];
|
|
3655
|
+
var FFID_CREDIT_GRANT_KINDS = ["monthly", "manual", "pack"];
|
|
3656
|
+
|
|
3657
|
+
// src/client/credits-methods.ts
|
|
3658
|
+
var EXT_SUBSCRIPTIONS_PATH = "/api/v1/subscriptions/ext";
|
|
3659
|
+
var CREDIT_PACKS_ENDPOINT = `${EXT_SUBSCRIPTIONS_PATH}/credits/packs`;
|
|
3660
|
+
var CREDIT_PACK_CHECKOUT_ENDPOINT = `${CREDIT_PACKS_ENDPOINT}/checkout`;
|
|
3661
|
+
var PORTAL_SUBSCRIPTION_PATH = "/subscriptions";
|
|
3662
|
+
var BUY_CREDITS_QUERY = { key: "purchase", value: "credits" };
|
|
3663
|
+
var ORG_QUERY_KEY = "org";
|
|
3664
|
+
var FFID_CONTRACT_ID_PREFIX = "ffid:";
|
|
3665
|
+
var STRIPE_SUBSCRIPTION_ID_PREFIX = "sub_";
|
|
3666
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3667
|
+
var VALIDATION_ERROR = "VALIDATION_ERROR";
|
|
3668
|
+
var FORBIDDEN = "FORBIDDEN";
|
|
3669
|
+
var utf8Encoder = new TextEncoder();
|
|
3670
|
+
function creditsEndpoint(subscriptionId, action) {
|
|
3671
|
+
return `${EXT_SUBSCRIPTIONS_PATH}/${encodeURIComponent(subscriptionId)}/credits/${action}`;
|
|
3672
|
+
}
|
|
3673
|
+
function isPlainObject2(value) {
|
|
3674
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3675
|
+
}
|
|
3676
|
+
function isIntegerInRange(value, min, max) {
|
|
3677
|
+
return typeof value === "number" && Number.isInteger(value) && value >= min && value <= max;
|
|
3678
|
+
}
|
|
3679
|
+
function createCreditsMethods(deps) {
|
|
3680
|
+
const { fetchWithAuth, createError, authMode, baseUrl, serviceCode, logger } = deps;
|
|
3681
|
+
function validationError(field, message) {
|
|
3682
|
+
return { error: { ...createError(VALIDATION_ERROR, message), details: { field } } };
|
|
3683
|
+
}
|
|
3684
|
+
function forbidden(reason, message) {
|
|
3685
|
+
return { error: { ...createError(FORBIDDEN, message), details: { reason } } };
|
|
3686
|
+
}
|
|
3687
|
+
function missingSubscriptionId(subscriptionId) {
|
|
3688
|
+
return subscriptionId && subscriptionId.trim() ? null : validationError("subscriptionId", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059");
|
|
3689
|
+
}
|
|
3690
|
+
async function getBalance(subscriptionId) {
|
|
3691
|
+
const invalid = missingSubscriptionId(subscriptionId);
|
|
3692
|
+
if (invalid) return invalid;
|
|
3693
|
+
return fetchWithAuth(creditsEndpoint(subscriptionId, "balance"));
|
|
3694
|
+
}
|
|
3695
|
+
async function listHistory(subscriptionId, options = {}) {
|
|
3696
|
+
const invalid = missingSubscriptionId(subscriptionId);
|
|
3697
|
+
if (invalid) return invalid;
|
|
3698
|
+
const query = new URLSearchParams();
|
|
3699
|
+
if (options.cursor !== void 0) query.set("cursor", options.cursor);
|
|
3700
|
+
if (options.limit !== void 0) {
|
|
3701
|
+
if (!isIntegerInRange(options.limit, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT)) {
|
|
3702
|
+
return validationError(
|
|
3703
|
+
"limit",
|
|
3704
|
+
`limit \u306F ${FFID_CREDITS_HISTORY_MIN_LIMIT}\u301C${FFID_CREDITS_HISTORY_MAX_LIMIT} \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
3705
|
+
);
|
|
3706
|
+
}
|
|
3707
|
+
query.set("limit", String(options.limit));
|
|
3708
|
+
}
|
|
3709
|
+
if (options.type !== void 0) {
|
|
3710
|
+
if (!FFID_CREDIT_HISTORY_TYPES.includes(options.type)) {
|
|
3711
|
+
return validationError("type", `type \u306F ${FFID_CREDIT_HISTORY_TYPES.join(" / ")} \u306E\u3044\u305A\u308C\u304B\u3067\u3059`);
|
|
3712
|
+
}
|
|
3713
|
+
query.set("type", options.type);
|
|
3714
|
+
}
|
|
3715
|
+
const qs = query.toString();
|
|
3716
|
+
return fetchWithAuth(
|
|
3717
|
+
`${creditsEndpoint(subscriptionId, "history")}${qs ? `?${qs}` : ""}`
|
|
3718
|
+
);
|
|
3719
|
+
}
|
|
3720
|
+
async function listPacks(packServiceCode) {
|
|
3721
|
+
const resolved = packServiceCode ?? (authMode === "service-key" ? void 0 : serviceCode);
|
|
3722
|
+
if (resolved !== void 0 && !resolved.trim()) {
|
|
3723
|
+
return validationError("serviceCode", "serviceCode \u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u7A7A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093");
|
|
3724
|
+
}
|
|
3725
|
+
const qs = resolved === void 0 ? "" : `?${new URLSearchParams({ serviceCode: resolved }).toString()}`;
|
|
3726
|
+
return fetchWithAuth(`${CREDIT_PACKS_ENDPOINT}${qs}`);
|
|
3727
|
+
}
|
|
3728
|
+
async function createPackCheckout(params) {
|
|
3729
|
+
if (authMode !== "token") {
|
|
3730
|
+
return forbidden(
|
|
3731
|
+
"bearer_required",
|
|
3732
|
+
"createPackCheckout \u306F token \u30E2\u30FC\u30C9\uFF08Bearer\uFF09\u3067\u306E\u307F\u5229\u7528\u3067\u304D\u307E\u3059\u3002\u8CFC\u5165\u8005\u306E\u8A18\u9332\u306B\u5B9F\u30E6\u30FC\u30B6\u30FC\u304C\u5FC5\u8981\u306A\u305F\u3081\u3067\u3059"
|
|
3733
|
+
);
|
|
3734
|
+
}
|
|
3735
|
+
const invalid = missingSubscriptionId(params.subscriptionId);
|
|
3736
|
+
if (invalid) return invalid;
|
|
3737
|
+
for (const field of ["packCode", "successUrl", "cancelUrl"]) {
|
|
3738
|
+
if (!params[field] || !params[field].trim()) {
|
|
3739
|
+
return validationError(field, `${field} \u306F\u5FC5\u9808\u3067\u3059`);
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
if (params.quantity !== void 0 && !isIntegerInRange(params.quantity, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_CREDIT_PACK_MAX_QUANTITY)) {
|
|
3743
|
+
return validationError(
|
|
3744
|
+
"quantity",
|
|
3745
|
+
`quantity \u306F ${FFID_CREDIT_PACK_MIN_QUANTITY}\u301C${FFID_CREDIT_PACK_MAX_QUANTITY} \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
3746
|
+
);
|
|
3747
|
+
}
|
|
3748
|
+
const body = {
|
|
3749
|
+
subscriptionId: params.subscriptionId,
|
|
3750
|
+
packCode: params.packCode,
|
|
3751
|
+
successUrl: params.successUrl,
|
|
3752
|
+
cancelUrl: params.cancelUrl
|
|
3753
|
+
};
|
|
3754
|
+
if (params.quantity !== void 0) body.quantity = params.quantity;
|
|
3755
|
+
return fetchWithAuth(CREDIT_PACK_CHECKOUT_ENDPOINT, {
|
|
3756
|
+
method: "POST",
|
|
3757
|
+
body: JSON.stringify(body)
|
|
3758
|
+
});
|
|
3759
|
+
}
|
|
3760
|
+
function validateConsume(params) {
|
|
3761
|
+
const invalid = missingSubscriptionId(params.subscriptionId);
|
|
3762
|
+
if (invalid) return invalid;
|
|
3763
|
+
if (!isIntegerInRange(params.amount, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_CONSUME_MAX_AMOUNT)) {
|
|
3764
|
+
return validationError(
|
|
3765
|
+
"amount",
|
|
3766
|
+
`amount \u306F ${FFID_CREDITS_CONSUME_MIN_AMOUNT}\u301C${FFID_CREDITS_CONSUME_MAX_AMOUNT} \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
3767
|
+
);
|
|
3768
|
+
}
|
|
3769
|
+
if (typeof params.idempotencyKey !== "string" || !FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN.test(params.idempotencyKey)) {
|
|
3770
|
+
return validationError(
|
|
3771
|
+
"idempotencyKey",
|
|
3772
|
+
"idempotencyKey \u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059\uFF08\u82F1\u6570\u5B57\u3068 . _ : - \u306E 8\u301C128 \u6587\u5B57\u3002\u63A8\u5968\u306F feature:requestId\uFF09"
|
|
3773
|
+
);
|
|
3774
|
+
}
|
|
3775
|
+
if (typeof params.feature !== "string" || !FFID_CREDITS_FEATURE_PATTERN.test(params.feature)) {
|
|
3776
|
+
return validationError("feature", "feature \u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059\uFF08\u5C0F\u6587\u5B57\u82F1\u6570\u5B57\u3067\u59CB\u307E\u308B\u3001\u5C0F\u6587\u5B57\u82F1\u6570\u5B57\u3068 . _ - \u306E 1\u301C64 \u6587\u5B57\uFF09");
|
|
3777
|
+
}
|
|
3778
|
+
if (params.metadata !== void 0) {
|
|
3779
|
+
if (!isPlainObject2(params.metadata)) {
|
|
3780
|
+
return validationError("metadata", "metadata \u306F JSON \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059");
|
|
3781
|
+
}
|
|
3782
|
+
let serialized;
|
|
3783
|
+
try {
|
|
3784
|
+
serialized = JSON.stringify(params.metadata);
|
|
3785
|
+
} catch {
|
|
3786
|
+
return validationError("metadata", "metadata \u306F JSON \u306B\u5909\u63DB\u3067\u304D\u308B\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF08BigInt\u30FB\u5FAA\u74B0\u53C2\u7167\u306F\u4E0D\u53EF\uFF09");
|
|
3787
|
+
}
|
|
3788
|
+
if (utf8Encoder.encode(serialized).byteLength > FFID_CREDITS_METADATA_MAX_BYTES) {
|
|
3789
|
+
return validationError("metadata", `metadata \u306F ${FFID_CREDITS_METADATA_MAX_BYTES} \u30D0\u30A4\u30C8\u4EE5\u4E0B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`);
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
if (params.userId !== void 0 && !UUID_PATTERN.test(params.userId)) {
|
|
3793
|
+
return validationError("userId", "userId \u306F\u6709\u52B9\u306AUUID\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059");
|
|
3794
|
+
}
|
|
3795
|
+
return null;
|
|
3796
|
+
}
|
|
3797
|
+
async function consume(params) {
|
|
3798
|
+
if (authMode !== "service-key") {
|
|
3799
|
+
return forbidden(
|
|
3800
|
+
"api_key_required",
|
|
3801
|
+
"credits.consume \u306F service-key \u8A8D\u8A3C\uFF08X-Service-Api-Key\uFF09\u3067\u306E\u307F\u5229\u7528\u3067\u304D\u307E\u3059\u3002\u6D88\u8CBB\u306E\u5831\u544A\u306F\u30B5\u30FC\u30D3\u30B9\u306E\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u884C\u3063\u3066\u304F\u3060\u3055\u3044"
|
|
3802
|
+
);
|
|
3803
|
+
}
|
|
3804
|
+
const invalid = validateConsume(params);
|
|
3805
|
+
if (invalid) return invalid;
|
|
3806
|
+
const body = {
|
|
3807
|
+
amount: params.amount,
|
|
3808
|
+
idempotencyKey: params.idempotencyKey,
|
|
3809
|
+
feature: params.feature
|
|
3810
|
+
};
|
|
3811
|
+
if (params.metadata !== void 0) body.metadata = params.metadata;
|
|
3812
|
+
if (params.userId !== void 0) body.userId = params.userId;
|
|
3813
|
+
return fetchWithAuth(creditsEndpoint(params.subscriptionId, "consume"), {
|
|
3814
|
+
method: "POST",
|
|
3815
|
+
body: JSON.stringify(body)
|
|
3816
|
+
});
|
|
3817
|
+
}
|
|
3818
|
+
function getBuyCreditsUrl(params) {
|
|
3819
|
+
const raw = params.subscriptionId?.trim() ?? "";
|
|
3820
|
+
if (raw.startsWith(STRIPE_SUBSCRIPTION_ID_PREFIX)) {
|
|
3821
|
+
return validationError(
|
|
3822
|
+
"subscriptionId",
|
|
3823
|
+
"getBuyCreditsUrl \u306B\u306F\u5951\u7D04\u306E UUID\uFF08\u307E\u305F\u306F ffid:<uuid>\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Stripe \u306E sub_... \u306F\u4F7F\u3048\u307E\u305B\u3093"
|
|
3824
|
+
);
|
|
3825
|
+
}
|
|
3826
|
+
const uuid = raw.startsWith(FFID_CONTRACT_ID_PREFIX) ? raw.slice(FFID_CONTRACT_ID_PREFIX.length) : raw;
|
|
3827
|
+
if (!UUID_PATTERN.test(uuid)) {
|
|
3828
|
+
return validationError("subscriptionId", "subscriptionId \u306F\u5951\u7D04\u306E UUID\uFF08\u307E\u305F\u306F ffid:<uuid>\uFF09\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059");
|
|
3829
|
+
}
|
|
3830
|
+
const query = new URLSearchParams({ [BUY_CREDITS_QUERY.key]: BUY_CREDITS_QUERY.value });
|
|
3831
|
+
if (params.orgId !== void 0 && params.orgId.trim()) {
|
|
3832
|
+
query.set(ORG_QUERY_KEY, params.orgId);
|
|
3833
|
+
}
|
|
3834
|
+
return { data: `${baseUrl}${PORTAL_SUBSCRIPTION_PATH}/${encodeURIComponent(uuid)}?${query.toString()}` };
|
|
3835
|
+
}
|
|
3836
|
+
function redirectToBuyCredits(params) {
|
|
3837
|
+
const result = getBuyCreditsUrl(params);
|
|
3838
|
+
if (result.error) {
|
|
3839
|
+
logger.warn("redirectToBuyCredits:", result.error.message);
|
|
3840
|
+
return { success: false, error: result.error.message };
|
|
3841
|
+
}
|
|
3842
|
+
if (typeof window === "undefined") {
|
|
3843
|
+
logger.warn("SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093");
|
|
3844
|
+
return { success: false, error: "SSR \u74B0\u5883\u3067\u306F\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3067\u304D\u307E\u305B\u3093" };
|
|
3845
|
+
}
|
|
3846
|
+
logger.debug("Redirecting to buy credits:", result.data);
|
|
3847
|
+
window.location.href = result.data;
|
|
3848
|
+
return { success: true };
|
|
3849
|
+
}
|
|
3850
|
+
return {
|
|
3851
|
+
getBalance,
|
|
3852
|
+
listHistory,
|
|
3853
|
+
listPacks,
|
|
3854
|
+
createPackCheckout,
|
|
3855
|
+
consume,
|
|
3856
|
+
getBuyCreditsUrl,
|
|
3857
|
+
redirectToBuyCredits
|
|
3858
|
+
};
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3633
3861
|
// src/subscriptions/types.ts
|
|
3634
3862
|
var EFFECTIVE_SUBSCRIPTION_STATUSES = [
|
|
3635
3863
|
"active",
|
|
@@ -3763,7 +3991,12 @@ function toServiceAccessDecision(response, allowGrace) {
|
|
|
3763
3991
|
planCode: response.planCode,
|
|
3764
3992
|
currentPeriodEnd: response.currentPeriodEnd,
|
|
3765
3993
|
gracePeriodEndsAt: response.gracePeriodEndsAt ?? null,
|
|
3766
|
-
reactivatable: response.reactivatable ?? false
|
|
3994
|
+
reactivatable: response.reactivatable ?? false,
|
|
3995
|
+
// Informational pass-through (10.0.0). Deliberately not part of hasAccess /
|
|
3996
|
+
// denialReason: credits and the member limit never gate access (CREDITS_API §1-5).
|
|
3997
|
+
...response.pricingModel !== void 0 ? { pricingModel: response.pricingModel } : {},
|
|
3998
|
+
...response.credits !== void 0 ? { credits: response.credits } : {},
|
|
3999
|
+
...response.memberLimitReached !== void 0 ? { memberLimitReached: response.memberLimitReached } : {}
|
|
3767
4000
|
};
|
|
3768
4001
|
}
|
|
3769
4002
|
function failClosedServiceAccessDecision(params, error) {
|
|
@@ -3810,6 +4043,19 @@ var FFID_SUBSCRIPTION_ERROR_CODES = {
|
|
|
3810
4043
|
FREE_DOWNGRADE_NOT_ALLOWED: "FREE_DOWNGRADE_NOT_ALLOWED",
|
|
3811
4044
|
PAYMENT_METHOD_REQUIRED: "PAYMENT_METHOD_REQUIRED"
|
|
3812
4045
|
};
|
|
4046
|
+
var FFID_CREDITS_ERROR_CODES = {
|
|
4047
|
+
CREDITS_INSUFFICIENT: "CREDITS_INSUFFICIENT",
|
|
4048
|
+
CREDITS_IDEMPOTENCY_CONFLICT: "CREDITS_IDEMPOTENCY_CONFLICT",
|
|
4049
|
+
CREDITS_NOT_APPLICABLE: "CREDITS_NOT_APPLICABLE",
|
|
4050
|
+
CREDITS_BALANCE_CAP_EXCEEDED: "CREDITS_BALANCE_CAP_EXCEEDED",
|
|
4051
|
+
SEAT_BILLING_NOT_APPLICABLE: "SEAT_BILLING_NOT_APPLICABLE",
|
|
4052
|
+
MEMBER_LIMIT_REACHED: "MEMBER_LIMIT_REACHED",
|
|
4053
|
+
CREDIT_PACK_NOT_FOUND: "CREDIT_PACK_NOT_FOUND",
|
|
4054
|
+
CREDIT_PACK_REGION_NOT_SUPPORTED: "CREDIT_PACK_REGION_NOT_SUPPORTED",
|
|
4055
|
+
CREDIT_PACK_STRIPE_NOT_SYNCED: "CREDIT_PACK_STRIPE_NOT_SYNCED",
|
|
4056
|
+
CREDIT_PACK_STRIPE_OUT_OF_SYNC: "CREDIT_PACK_STRIPE_OUT_OF_SYNC",
|
|
4057
|
+
CREDIT_PACK_CHANGED: "CREDIT_PACK_CHANGED"
|
|
4058
|
+
};
|
|
3813
4059
|
|
|
3814
4060
|
// src/client/ffid-client.ts
|
|
3815
4061
|
var UNAUTHORIZED_STATUS2 = 401;
|
|
@@ -4137,7 +4383,7 @@ function createFFIDClient(config) {
|
|
|
4137
4383
|
fetchWithAuth,
|
|
4138
4384
|
createError
|
|
4139
4385
|
});
|
|
4140
|
-
const { listSeatAssignments, assignSeats, unassignSeat } = createSeatMethods({
|
|
4386
|
+
const { listSeatAssignments, getSeats, assignSeats, unassignSeat } = createSeatMethods({
|
|
4141
4387
|
fetchWithAuth,
|
|
4142
4388
|
createError
|
|
4143
4389
|
});
|
|
@@ -4244,6 +4490,14 @@ function createFFIDClient(config) {
|
|
|
4244
4490
|
fetchWithAuth,
|
|
4245
4491
|
createError
|
|
4246
4492
|
});
|
|
4493
|
+
const credits = createCreditsMethods({
|
|
4494
|
+
fetchWithAuth,
|
|
4495
|
+
createError,
|
|
4496
|
+
authMode,
|
|
4497
|
+
baseUrl,
|
|
4498
|
+
serviceCode: config.serviceCode,
|
|
4499
|
+
logger
|
|
4500
|
+
});
|
|
4247
4501
|
const verifyAccessToken = createVerifyAccessToken({
|
|
4248
4502
|
authMode,
|
|
4249
4503
|
baseUrl,
|
|
@@ -4299,6 +4553,7 @@ function createFFIDClient(config) {
|
|
|
4299
4553
|
getInvoice,
|
|
4300
4554
|
retryPayment,
|
|
4301
4555
|
listSeatAssignments,
|
|
4556
|
+
getSeats,
|
|
4302
4557
|
assignSeats,
|
|
4303
4558
|
unassignSeat,
|
|
4304
4559
|
listPlans,
|
|
@@ -4309,13 +4564,16 @@ function createFFIDClient(config) {
|
|
|
4309
4564
|
cancelSubscription,
|
|
4310
4565
|
cancelPendingDowngrade,
|
|
4311
4566
|
previewPlanChange,
|
|
4567
|
+
/** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
|
|
4312
4568
|
previewSeatChange,
|
|
4313
4569
|
verifyAccessToken,
|
|
4314
4570
|
getSubscribeUrl,
|
|
4315
4571
|
redirectToSubscribe,
|
|
4316
4572
|
getChangePlanUrl,
|
|
4317
4573
|
redirectToChangePlan,
|
|
4574
|
+
/** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
|
|
4318
4575
|
getChangeSeatsUrl,
|
|
4576
|
+
/** @deprecated 10.0.0: per_seat (praxis) only; removed in 11.0.0 */
|
|
4319
4577
|
redirectToChangeSeats,
|
|
4320
4578
|
getRecoverPaymentUrl,
|
|
4321
4579
|
redirectToRecoverPayment,
|
|
@@ -4331,6 +4589,8 @@ function createFFIDClient(config) {
|
|
|
4331
4589
|
newsletter,
|
|
4332
4590
|
/** Inquiry methods (create) */
|
|
4333
4591
|
inquiry,
|
|
4592
|
+
/** Credits methods for flat plans (consume / balance / history / packs) */
|
|
4593
|
+
credits,
|
|
4334
4594
|
/** Token store (token mode only) */
|
|
4335
4595
|
tokenStore,
|
|
4336
4596
|
/**
|
|
@@ -6477,4 +6737,4 @@ function FFIDInquiryForm({
|
|
|
6477
6737
|
);
|
|
6478
6738
|
}
|
|
6479
6739
|
|
|
6480
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, cleanupStateStorage, clearAgencyInviteToken, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, validatePublishedCatalog, withSubscription };
|
|
6740
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AGENCY_INVITE_COOKIE_MAX_AGE_SEC, AGENCY_INVITE_COOKIE_NAME, AGENCY_INVITE_TOKEN_PARAM, AGENCY_INVITE_TOKEN_REDACTION, BLOCKING_EFFECTIVE_STATUSES, CATALOG_HASH_PATTERN, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDCatalogHashError, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ALLOWED_ORGANIZATION_LOGO_MIME_TYPES, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_CATALOG_ENVIRONMENTS, FFID_CATALOG_PUBLICATION_STATUSES, FFID_COMPANY_SIZE_CODES, FFID_CREDITS_CONSUME_MAX_AMOUNT, FFID_CREDITS_CONSUME_MIN_AMOUNT, FFID_CREDITS_ERROR_CODES, FFID_CREDITS_FEATURE_PATTERN, FFID_CREDITS_HISTORY_DEFAULT_LIMIT, FFID_CREDITS_HISTORY_MAX_LIMIT, FFID_CREDITS_HISTORY_MIN_LIMIT, FFID_CREDITS_IDEMPOTENCY_KEY_PATTERN, FFID_CREDITS_LOW_THRESHOLD_PERCENT, FFID_CREDITS_METADATA_MAX_BYTES, FFID_CREDIT_GRANT_KINDS, FFID_CREDIT_HISTORY_TYPES, FFID_CREDIT_PACK_MAX_QUANTITY, FFID_CREDIT_PACK_MIN_QUANTITY, FFID_ERROR_CODES, FFID_INDUSTRY_CODES, FFID_INQUIRY_ACQUISITION_SOURCES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_BYTES, FFID_MAX_ORGANIZATION_LOGO_FILE_SIZE_MB, FFID_ORGANIZATION_PROFILE_ERROR_CODES, FFID_SUBSCRIPTION_ERROR_CODES, canonicalizeCatalogValue, captureAgencyInviteToken, cleanupStateStorage, clearAgencyInviteToken, computeEffectiveStatusFromSession, computeFFIDCheckoutCopyHash, computeLegalDisclosureHash, computePaymentConfigurationHash, computePraxisCopyHash, computeScopeHash, computeTaxConfigurationHash, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, hashCanonicalJson, isBlockedFromUserinfo, isFFIDInquiryAcquisitionSource, isFFIDInquiryCategorySite2026, normalizeRedirectUri, readAgencyInviteCookie, readAgencyInviteToken, redactAgencyInviteToken, retrieveCodeVerifier, retrieveState, sha256Hex, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, validatePublishedCatalog, withSubscription };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2LU2F3F2_cjs = require('../chunk-2LU2F3F2.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 chunk2LU2F3F2_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk2LU2F3F2_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { a8 as FFIDAnnouncementBadge, bk as FFIDAnnouncementBadgeClassNames, bl as FFIDAnnouncementBadgeProps, a9 as FFIDAnnouncementList, bm as FFIDAnnouncementListClassNames, bn as FFIDAnnouncementListProps, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aC as FFIDLoginButton, bo as FFIDLoginButtonProps, aE as FFIDOrganizationSwitcher, bp as FFIDOrganizationSwitcherClassNames, bq as FFIDOrganizationSwitcherProps, aS as FFIDSubscriptionBadge, br as FFIDSubscriptionBadgeClassNames, bs as FFIDSubscriptionBadgeProps, aW as FFIDUserMenu, bt as FFIDUserMenuClassNames, bu as FFIDUserMenuProps } from '../index-KjewcNn1.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { a8 as FFIDAnnouncementBadge, bk as FFIDAnnouncementBadgeClassNames, bl as FFIDAnnouncementBadgeProps, a9 as FFIDAnnouncementList, bm as FFIDAnnouncementListClassNames, bn as FFIDAnnouncementListProps, ar as FFIDInquiryForm, as as FFIDInquiryFormCategoryItem, at as FFIDInquiryFormClassNames, au as FFIDInquiryFormLegalLayout, av as FFIDInquiryFormOrganization, aw as FFIDInquiryFormPlaceholderContext, ax as FFIDInquiryFormPrefill, ay as FFIDInquiryFormProps, az as FFIDInquiryFormSubmitData, aA as FFIDInquiryFormSubmitResult, aC as FFIDLoginButton, bo as FFIDLoginButtonProps, aE as FFIDOrganizationSwitcher, bp as FFIDOrganizationSwitcherClassNames, bq as FFIDOrganizationSwitcherProps, aS as FFIDSubscriptionBadge, br as FFIDSubscriptionBadgeClassNames, bs as FFIDSubscriptionBadgeProps, aW as FFIDUserMenu, bt as FFIDUserMenuClassNames, bu as FFIDUserMenuProps } from '../index-KjewcNn1.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-OXW6QSTO.js';
|