@schematichq/schematic-components 2.25.0 → 2.25.1
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.
|
@@ -7290,6 +7290,22 @@ var JSONApiResponse = class {
|
|
|
7290
7290
|
}
|
|
7291
7291
|
};
|
|
7292
7292
|
|
|
7293
|
+
// src/api/checkoutexternal/models/BillingArrearsAnchor.ts
|
|
7294
|
+
function BillingArrearsAnchorFromJSON(json) {
|
|
7295
|
+
return BillingArrearsAnchorFromJSONTyped(json, false);
|
|
7296
|
+
}
|
|
7297
|
+
function BillingArrearsAnchorFromJSONTyped(json, ignoreDiscriminator) {
|
|
7298
|
+
return json;
|
|
7299
|
+
}
|
|
7300
|
+
|
|
7301
|
+
// src/api/checkoutexternal/models/BillingArrearsCadence.ts
|
|
7302
|
+
function BillingArrearsCadenceFromJSON(json) {
|
|
7303
|
+
return BillingArrearsCadenceFromJSONTyped(json, false);
|
|
7304
|
+
}
|
|
7305
|
+
function BillingArrearsCadenceFromJSONTyped(json, ignoreDiscriminator) {
|
|
7306
|
+
return json;
|
|
7307
|
+
}
|
|
7308
|
+
|
|
7293
7309
|
// src/api/checkoutexternal/models/BillingCollectionMethod.ts
|
|
7294
7310
|
function BillingCollectionMethodFromJSON(json) {
|
|
7295
7311
|
return BillingCollectionMethodFromJSONTyped(json, false);
|
|
@@ -7840,6 +7856,8 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
7840
7856
|
return json;
|
|
7841
7857
|
}
|
|
7842
7858
|
return {
|
|
7859
|
+
arrearsAnchor: json["arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["arrears_anchor"]),
|
|
7860
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
7843
7861
|
autoTopupAmount: json["auto_topup_amount"] == null ? void 0 : json["auto_topup_amount"],
|
|
7844
7862
|
autoTopupAmountType: json["auto_topup_amount_type"] == null ? void 0 : json["auto_topup_amount_type"],
|
|
7845
7863
|
autoTopupAvailability: BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -7866,10 +7884,14 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
7866
7884
|
expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
|
|
7867
7885
|
id: json["id"],
|
|
7868
7886
|
licenseId: json["license_id"] == null ? void 0 : json["license_id"],
|
|
7887
|
+
overdraftLimit: json["overdraft_limit"] == null ? void 0 : json["overdraft_limit"],
|
|
7869
7888
|
plan: json["plan"] == null ? void 0 : PreviewObjectResponseDataFromJSON(json["plan"]),
|
|
7870
7889
|
planId: json["plan_id"],
|
|
7871
7890
|
planName: json["plan_name"],
|
|
7872
7891
|
planVersionId: json["plan_version_id"] == null ? void 0 : json["plan_version_id"],
|
|
7892
|
+
postpaidEnabled: json["postpaid_enabled"],
|
|
7893
|
+
postpaidRatePerUnit: json["postpaid_rate_per_unit"] == null ? void 0 : json["postpaid_rate_per_unit"],
|
|
7894
|
+
postpaidRatePerUnitDecimal: json["postpaid_rate_per_unit_decimal"] == null ? void 0 : json["postpaid_rate_per_unit_decimal"],
|
|
7873
7895
|
resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
|
|
7874
7896
|
resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
|
|
7875
7897
|
resetType: json["reset_type"] == null ? void 0 : BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
|
|
@@ -8447,6 +8469,8 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8447
8469
|
return json;
|
|
8448
8470
|
}
|
|
8449
8471
|
return {
|
|
8472
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
8473
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
8450
8474
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
8451
8475
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
8452
8476
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -8464,6 +8488,10 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8464
8488
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
8465
8489
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
8466
8490
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
8491
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
8492
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
8493
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
8494
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
8467
8495
|
companyAutoTopupAmount: json["company_auto_topup_amount"] == null ? void 0 : json["company_auto_topup_amount"],
|
|
8468
8496
|
companyAutoTopupEnabled: json["company_auto_topup_enabled"] == null ? void 0 : json["company_auto_topup_enabled"],
|
|
8469
8497
|
companyAutoTopupThresholdCredits: json["company_auto_topup_threshold_credits"] == null ? void 0 : json["company_auto_topup_threshold_credits"],
|
|
@@ -8975,6 +9003,41 @@ function CompanyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8975
9003
|
};
|
|
8976
9004
|
}
|
|
8977
9005
|
|
|
9006
|
+
// src/api/checkoutexternal/models/CompanyInvoiceResponseData.ts
|
|
9007
|
+
function CompanyInvoiceResponseDataFromJSON(json) {
|
|
9008
|
+
return CompanyInvoiceResponseDataFromJSONTyped(json, false);
|
|
9009
|
+
}
|
|
9010
|
+
function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
9011
|
+
if (json == null) {
|
|
9012
|
+
return json;
|
|
9013
|
+
}
|
|
9014
|
+
return {
|
|
9015
|
+
amountDue: json["amount_due"],
|
|
9016
|
+
createdAt: new Date(json["created_at"]),
|
|
9017
|
+
currency: json["currency"],
|
|
9018
|
+
dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
|
|
9019
|
+
id: json["id"],
|
|
9020
|
+
status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
|
|
9021
|
+
url: json["url"] == null ? void 0 : json["url"]
|
|
9022
|
+
};
|
|
9023
|
+
}
|
|
9024
|
+
|
|
9025
|
+
// src/api/checkoutexternal/models/CompanyInvoicesResponseData.ts
|
|
9026
|
+
function CompanyInvoicesResponseDataFromJSON(json) {
|
|
9027
|
+
return CompanyInvoicesResponseDataFromJSONTyped(json, false);
|
|
9028
|
+
}
|
|
9029
|
+
function CompanyInvoicesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
9030
|
+
if (json == null) {
|
|
9031
|
+
return json;
|
|
9032
|
+
}
|
|
9033
|
+
return {
|
|
9034
|
+
count: json["count"],
|
|
9035
|
+
invoices: json["invoices"].map(
|
|
9036
|
+
CompanyInvoiceResponseDataFromJSON
|
|
9037
|
+
)
|
|
9038
|
+
};
|
|
9039
|
+
}
|
|
9040
|
+
|
|
8978
9041
|
// src/api/checkoutexternal/models/CompanyOverrideNoteResponseData.ts
|
|
8979
9042
|
function CompanyOverrideNoteResponseDataFromJSON(json) {
|
|
8980
9043
|
return CompanyOverrideNoteResponseDataFromJSONTyped(json, false);
|
|
@@ -9465,6 +9528,8 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9465
9528
|
return json;
|
|
9466
9529
|
}
|
|
9467
9530
|
return {
|
|
9531
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
9532
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
9468
9533
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
9469
9534
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
9470
9535
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -9482,6 +9547,10 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9482
9547
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
9483
9548
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
9484
9549
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
9550
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
9551
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
9552
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
9553
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
9485
9554
|
companyCreditAmount: json["company_credit_amount"],
|
|
9486
9555
|
createdAt: new Date(json["created_at"]),
|
|
9487
9556
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON(json["credit"]),
|
|
@@ -9974,6 +10043,7 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9974
10043
|
return json;
|
|
9975
10044
|
}
|
|
9976
10045
|
return {
|
|
10046
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
9977
10047
|
billingCreditBundleId: json["billing_credit_bundle_id"] == null ? void 0 : json["billing_credit_bundle_id"],
|
|
9978
10048
|
billingCreditId: json["billing_credit_id"],
|
|
9979
10049
|
companyId: json["company_id"],
|
|
@@ -9995,6 +10065,12 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9995
10065
|
planId: json["plan_id"] == null ? void 0 : json["plan_id"],
|
|
9996
10066
|
planName: json["plan_name"] == null ? void 0 : json["plan_name"],
|
|
9997
10067
|
pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
|
|
10068
|
+
postpaidChargeAmount: json["postpaid_charge_amount"] == null ? void 0 : json["postpaid_charge_amount"],
|
|
10069
|
+
postpaidChargeCurrency: json["postpaid_charge_currency"] == null ? void 0 : json["postpaid_charge_currency"],
|
|
10070
|
+
postpaidChargedCredits: json["postpaid_charged_credits"] == null ? void 0 : json["postpaid_charged_credits"],
|
|
10071
|
+
postpaidPeriodEnd: json["postpaid_period_end"] == null ? void 0 : new Date(json["postpaid_period_end"]),
|
|
10072
|
+
postpaidRate: json["postpaid_rate"] == null ? void 0 : json["postpaid_rate"],
|
|
10073
|
+
postpaidRateDecimal: json["postpaid_rate_decimal"] == null ? void 0 : json["postpaid_rate_decimal"],
|
|
9998
10074
|
price: json["price"] == null ? void 0 : BillingProductPriceResponseDataFromJSON(json["price"]),
|
|
9999
10075
|
quantity: json["quantity"],
|
|
10000
10076
|
quantityRemaining: json["quantity_remaining"],
|
|
@@ -10318,6 +10394,35 @@ function GetCheckoutTaxIDResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10318
10394
|
};
|
|
10319
10395
|
}
|
|
10320
10396
|
|
|
10397
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesParams.ts
|
|
10398
|
+
function GetCompanyInvoicesParamsFromJSON(json) {
|
|
10399
|
+
return GetCompanyInvoicesParamsFromJSONTyped(json, false);
|
|
10400
|
+
}
|
|
10401
|
+
function GetCompanyInvoicesParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
10402
|
+
if (json == null) {
|
|
10403
|
+
return json;
|
|
10404
|
+
}
|
|
10405
|
+
return {
|
|
10406
|
+
includePending: json["include_pending"] == null ? void 0 : json["include_pending"],
|
|
10407
|
+
limit: json["limit"] == null ? void 0 : json["limit"],
|
|
10408
|
+
offset: json["offset"] == null ? void 0 : json["offset"]
|
|
10409
|
+
};
|
|
10410
|
+
}
|
|
10411
|
+
|
|
10412
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesResponse.ts
|
|
10413
|
+
function GetCompanyInvoicesResponseFromJSON(json) {
|
|
10414
|
+
return GetCompanyInvoicesResponseFromJSONTyped(json, false);
|
|
10415
|
+
}
|
|
10416
|
+
function GetCompanyInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
10417
|
+
if (json == null) {
|
|
10418
|
+
return json;
|
|
10419
|
+
}
|
|
10420
|
+
return {
|
|
10421
|
+
data: CompanyInvoicesResponseDataFromJSON(json["data"]),
|
|
10422
|
+
params: GetCompanyInvoicesParamsFromJSON(json["params"])
|
|
10423
|
+
};
|
|
10424
|
+
}
|
|
10425
|
+
|
|
10321
10426
|
// src/api/checkoutexternal/models/GetCreditUsageByUserParams.ts
|
|
10322
10427
|
function GetCreditUsageByUserParamsFromJSON(json) {
|
|
10323
10428
|
return GetCreditUsageByUserParamsFromJSONTyped(json, false);
|
|
@@ -10928,6 +11033,50 @@ var CheckoutexternalApi = class extends BaseAPI {
|
|
|
10928
11033
|
const response = await this.getCheckoutTaxIDRaw(initOverrides);
|
|
10929
11034
|
return await response.value();
|
|
10930
11035
|
}
|
|
11036
|
+
/**
|
|
11037
|
+
* Get company invoices
|
|
11038
|
+
*/
|
|
11039
|
+
async getCompanyInvoicesRaw(requestParameters, initOverrides) {
|
|
11040
|
+
const queryParameters = {};
|
|
11041
|
+
if (requestParameters["includePending"] != null) {
|
|
11042
|
+
queryParameters["include_pending"] = requestParameters["includePending"];
|
|
11043
|
+
}
|
|
11044
|
+
if (requestParameters["limit"] != null) {
|
|
11045
|
+
queryParameters["limit"] = requestParameters["limit"];
|
|
11046
|
+
}
|
|
11047
|
+
if (requestParameters["offset"] != null) {
|
|
11048
|
+
queryParameters["offset"] = requestParameters["offset"];
|
|
11049
|
+
}
|
|
11050
|
+
const headerParameters = {};
|
|
11051
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
11052
|
+
headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
|
|
11053
|
+
"X-Schematic-Api-Key"
|
|
11054
|
+
);
|
|
11055
|
+
}
|
|
11056
|
+
const response = await this.request(
|
|
11057
|
+
{
|
|
11058
|
+
path: `/company/invoices`,
|
|
11059
|
+
method: "GET",
|
|
11060
|
+
headers: headerParameters,
|
|
11061
|
+
query: queryParameters
|
|
11062
|
+
},
|
|
11063
|
+
initOverrides
|
|
11064
|
+
);
|
|
11065
|
+
return new JSONApiResponse(
|
|
11066
|
+
response,
|
|
11067
|
+
(jsonValue) => GetCompanyInvoicesResponseFromJSON(jsonValue)
|
|
11068
|
+
);
|
|
11069
|
+
}
|
|
11070
|
+
/**
|
|
11071
|
+
* Get company invoices
|
|
11072
|
+
*/
|
|
11073
|
+
async getCompanyInvoices(requestParameters = {}, initOverrides) {
|
|
11074
|
+
const response = await this.getCompanyInvoicesRaw(
|
|
11075
|
+
requestParameters,
|
|
11076
|
+
initOverrides
|
|
11077
|
+
);
|
|
11078
|
+
return await response.value();
|
|
11079
|
+
}
|
|
10931
11080
|
/**
|
|
10932
11081
|
* Get credit usage by user
|
|
10933
11082
|
*/
|
|
@@ -11677,6 +11826,22 @@ var JSONApiResponse2 = class {
|
|
|
11677
11826
|
}
|
|
11678
11827
|
};
|
|
11679
11828
|
|
|
11829
|
+
// src/api/componentspublic/models/BillingArrearsAnchor.ts
|
|
11830
|
+
function BillingArrearsAnchorFromJSON2(json) {
|
|
11831
|
+
return BillingArrearsAnchorFromJSONTyped5(json, false);
|
|
11832
|
+
}
|
|
11833
|
+
function BillingArrearsAnchorFromJSONTyped5(json, ignoreDiscriminator) {
|
|
11834
|
+
return json;
|
|
11835
|
+
}
|
|
11836
|
+
|
|
11837
|
+
// src/api/componentspublic/models/BillingArrearsCadence.ts
|
|
11838
|
+
function BillingArrearsCadenceFromJSON2(json) {
|
|
11839
|
+
return BillingArrearsCadenceFromJSONTyped6(json, false);
|
|
11840
|
+
}
|
|
11841
|
+
function BillingArrearsCadenceFromJSONTyped6(json, ignoreDiscriminator) {
|
|
11842
|
+
return json;
|
|
11843
|
+
}
|
|
11844
|
+
|
|
11680
11845
|
// src/api/componentspublic/models/BillingCreditAutoTopupAvailability.ts
|
|
11681
11846
|
function BillingCreditAutoTopupAvailabilityFromJSON2(json) {
|
|
11682
11847
|
return BillingCreditAutoTopupAvailabilityFromJSONTyped5(json, false);
|
|
@@ -12654,6 +12819,8 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12654
12819
|
return json;
|
|
12655
12820
|
}
|
|
12656
12821
|
return {
|
|
12822
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON2(json["billing_credit_arrears_anchor"]),
|
|
12823
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON2(json["billing_credit_arrears_cadence"]),
|
|
12657
12824
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
12658
12825
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
12659
12826
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON2(
|
|
@@ -12671,6 +12838,10 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12671
12838
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
12672
12839
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
12673
12840
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
12841
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
12842
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
12843
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
12844
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
12674
12845
|
companyCreditAmount: json["company_credit_amount"],
|
|
12675
12846
|
createdAt: new Date(json["created_at"]),
|
|
12676
12847
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON2(json["credit"]),
|
|
@@ -13862,6 +14033,18 @@ function buildCreditBundlesRequestBody(creditBundles) {
|
|
|
13862
14033
|
[]
|
|
13863
14034
|
);
|
|
13864
14035
|
}
|
|
14036
|
+
function isCreditOnlyCheckout(options) {
|
|
14037
|
+
const { plan, creditBundles, addOns, period, currency } = options;
|
|
14038
|
+
if (plan) {
|
|
14039
|
+
return false;
|
|
14040
|
+
}
|
|
14041
|
+
if (!creditBundles.some((bundle) => bundle.count > 0)) {
|
|
14042
|
+
return false;
|
|
14043
|
+
}
|
|
14044
|
+
return !addOns.some(
|
|
14045
|
+
(addOn) => addOn.isSelected && !!getAddOnPrice(addOn, period, currency)?.id
|
|
14046
|
+
);
|
|
14047
|
+
}
|
|
13865
14048
|
|
|
13866
14049
|
// src/utils/api/entitlement.ts
|
|
13867
14050
|
var PeriodName = {
|
|
@@ -15131,7 +15314,7 @@ var reducer = (state, action) => {
|
|
|
15131
15314
|
// src/context/EmbedProvider.tsx
|
|
15132
15315
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
15133
15316
|
var getCustomHeaders = (sessionId) => ({
|
|
15134
|
-
"X-Schematic-Components-Version": "2.25.
|
|
15317
|
+
"X-Schematic-Components-Version": "2.25.1",
|
|
15135
15318
|
"X-Schematic-Session-ID": sessionId
|
|
15136
15319
|
});
|
|
15137
15320
|
var normalizeCurrencyFilter = (filter2) => {
|
|
@@ -19554,48 +19737,26 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19554
19737
|
bundleCounts
|
|
19555
19738
|
);
|
|
19556
19739
|
}, [bundleGatingPlanId, data?.creditBundles, bundleCounts]);
|
|
19557
|
-
const selectedPlanPriceId = useMemo15(() => {
|
|
19558
|
-
if (!selectedPlan) {
|
|
19559
|
-
return void 0;
|
|
19560
|
-
}
|
|
19561
|
-
const currencyPrice = getPlanPrice(
|
|
19562
|
-
selectedPlan,
|
|
19563
|
-
planPeriod,
|
|
19564
|
-
{ useSelectedPeriod: true },
|
|
19565
|
-
hasCurrency ? effectiveCurrency : void 0
|
|
19566
|
-
);
|
|
19567
|
-
return currencyPrice?.id ?? (planPeriod === "year" ? selectedPlan.yearlyPrice?.id : planPeriod === "quarter" ? selectedPlan.quarterlyPrice?.id : selectedPlan.monthlyPrice?.id);
|
|
19568
|
-
}, [selectedPlan, planPeriod, hasCurrency, effectiveCurrency]);
|
|
19569
19740
|
const [hasInitialPaymentMethod] = useState9(
|
|
19570
19741
|
() => !!(data?.subscription?.paymentMethod?.externalId || data?.company?.defaultPaymentMethod?.externalId)
|
|
19571
19742
|
);
|
|
19572
|
-
const isCreditOnlyPurchase = useMemo15(
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
return !hasPaidAddOn;
|
|
19590
|
-
}, [
|
|
19591
|
-
data?.company?.billingSubscription,
|
|
19592
|
-
selectedPlanPriceId,
|
|
19593
|
-
creditBundles,
|
|
19594
|
-
addOns,
|
|
19595
|
-
planPeriod,
|
|
19596
|
-
hasCurrency,
|
|
19597
|
-
effectiveCurrency
|
|
19598
|
-
]);
|
|
19743
|
+
const isCreditOnlyPurchase = useMemo15(
|
|
19744
|
+
() => isCreditOnlyCheckout({
|
|
19745
|
+
plan: selectedPlan,
|
|
19746
|
+
creditBundles,
|
|
19747
|
+
addOns,
|
|
19748
|
+
period: planPeriod,
|
|
19749
|
+
currency: hasCurrency ? effectiveCurrency : void 0
|
|
19750
|
+
}),
|
|
19751
|
+
[
|
|
19752
|
+
selectedPlan,
|
|
19753
|
+
creditBundles,
|
|
19754
|
+
addOns,
|
|
19755
|
+
planPeriod,
|
|
19756
|
+
hasCurrency,
|
|
19757
|
+
effectiveCurrency
|
|
19758
|
+
]
|
|
19759
|
+
);
|
|
19599
19760
|
const [usageBasedEntitlements, setUsageBasedEntitlements] = useState9(
|
|
19600
19761
|
() => applyPrefilledQuantities(
|
|
19601
19762
|
(selectedPlan?.entitlements || []).reduce(
|
|
@@ -19890,9 +20051,13 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19890
20051
|
updates.creditBundles || creditBundles,
|
|
19891
20052
|
plan?.id ?? data?.company?.plan?.id
|
|
19892
20053
|
);
|
|
19893
|
-
const isCreditOnly =
|
|
19894
|
-
|
|
19895
|
-
|
|
20054
|
+
const isCreditOnly = isCreditOnlyCheckout({
|
|
20055
|
+
plan,
|
|
20056
|
+
creditBundles: resolvedCreditBundles,
|
|
20057
|
+
addOns: updates.addOns || addOns,
|
|
20058
|
+
period,
|
|
20059
|
+
currency: resolvedCurrency
|
|
20060
|
+
});
|
|
19896
20061
|
if ((!plan || !planPriceId) && !isCreditOnly) {
|
|
19897
20062
|
++previewRequestIdRef.current;
|
|
19898
20063
|
setError(void 0);
|
|
@@ -20032,7 +20197,6 @@ var CheckoutDialog = ({ top }) => {
|
|
|
20032
20197
|
addOnCompatibilityLookup,
|
|
20033
20198
|
data?.company?.plan?.id,
|
|
20034
20199
|
data?.company?.plan?.includedCreditGrants,
|
|
20035
|
-
data?.company?.billingSubscription,
|
|
20036
20200
|
previewCheckout,
|
|
20037
20201
|
planPeriod,
|
|
20038
20202
|
selectedPlan,
|
|
@@ -25570,7 +25734,7 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
25570
25734
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
25571
25735
|
import { Elements } from "@stripe/react-stripe-js";
|
|
25572
25736
|
|
|
25573
|
-
// node_modules/.pnpm/@stripe+stripe-js@9.
|
|
25737
|
+
// node_modules/.pnpm/@stripe+stripe-js@9.15.0/node_modules/@stripe/stripe-js/dist/index.mjs
|
|
25574
25738
|
function _typeof(obj) {
|
|
25575
25739
|
"@babel/helpers - typeof";
|
|
25576
25740
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -25624,7 +25788,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
|
25624
25788
|
}
|
|
25625
25789
|
stripe._registerWrapper({
|
|
25626
25790
|
name: "stripe-js",
|
|
25627
|
-
version: "9.
|
|
25791
|
+
version: "9.15.0",
|
|
25628
25792
|
startTime
|
|
25629
25793
|
});
|
|
25630
25794
|
};
|
|
@@ -25702,7 +25866,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
|
25702
25866
|
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
25703
25867
|
var expectedVersion = RELEASE_TRAIN;
|
|
25704
25868
|
if (isTestKey && version !== expectedVersion) {
|
|
25705
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.
|
|
25869
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.15.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
25706
25870
|
}
|
|
25707
25871
|
var stripe = maybeStripe.apply(void 0, args);
|
|
25708
25872
|
registerWrapper(stripe, startTime);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematichq/schematic-components",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"main": "dist/schematic-components.cjs.js",
|
|
5
5
|
"module": "dist/schematic-components.esm.js",
|
|
6
6
|
"types": "dist/schematic-components.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@schematichq/schematic-icons": "^0.8.0",
|
|
58
|
-
"@stripe/stripe-js": "^9.
|
|
58
|
+
"@stripe/stripe-js": "^9.15.0",
|
|
59
59
|
"i18next": "^26.4.1",
|
|
60
60
|
"lodash": "^4.18.1",
|
|
61
61
|
"pako": "^3.0.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^10.0.1",
|
|
68
|
-
"@eslint/json": "^2.0
|
|
68
|
+
"@eslint/json": "^2.1.0",
|
|
69
69
|
"@eslint/markdown": "^8.0.3",
|
|
70
70
|
"@microsoft/api-extractor": "^7.59.0",
|
|
71
71
|
"@openapitools/openapi-generator-cli": "^2.41.0",
|
|
@@ -78,16 +78,16 @@
|
|
|
78
78
|
"@types/pako": "^3.0.0",
|
|
79
79
|
"@types/react": "^19.2.18",
|
|
80
80
|
"@types/react-dom": "^19.2.7",
|
|
81
|
-
"@vitest/browser": "^
|
|
81
|
+
"@vitest/browser": "^5.0.0",
|
|
82
82
|
"csstype": "^3.2.3",
|
|
83
83
|
"esbuild": "^0.28.2",
|
|
84
|
-
"eslint": "^10.
|
|
84
|
+
"eslint": "^10.10.0",
|
|
85
85
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
86
86
|
"eslint-plugin-import-x": "^4.17.1",
|
|
87
87
|
"eslint-plugin-react": "^7.37.5",
|
|
88
88
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
89
89
|
"globals": "^17.12.0",
|
|
90
|
-
"happy-dom": "^20.
|
|
90
|
+
"happy-dom": "^20.14.0",
|
|
91
91
|
"jsdom": "^30.0.1",
|
|
92
92
|
"msw": "^2.15.0",
|
|
93
93
|
"prettier": "^3.9.6",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"react-dom": "^19.2.8",
|
|
96
96
|
"typescript": "^6.0.3",
|
|
97
97
|
"typescript-eslint": "^8.69.0",
|
|
98
|
-
"vitest": "^
|
|
98
|
+
"vitest": "^5.0.0"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"@stripe/react-stripe-js": ">=3",
|