@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.
|
@@ -7259,6 +7259,22 @@ var JSONApiResponse = class {
|
|
|
7259
7259
|
}
|
|
7260
7260
|
};
|
|
7261
7261
|
|
|
7262
|
+
// src/api/checkoutexternal/models/BillingArrearsAnchor.ts
|
|
7263
|
+
function BillingArrearsAnchorFromJSON(json) {
|
|
7264
|
+
return BillingArrearsAnchorFromJSONTyped(json, false);
|
|
7265
|
+
}
|
|
7266
|
+
function BillingArrearsAnchorFromJSONTyped(json, ignoreDiscriminator) {
|
|
7267
|
+
return json;
|
|
7268
|
+
}
|
|
7269
|
+
|
|
7270
|
+
// src/api/checkoutexternal/models/BillingArrearsCadence.ts
|
|
7271
|
+
function BillingArrearsCadenceFromJSON(json) {
|
|
7272
|
+
return BillingArrearsCadenceFromJSONTyped(json, false);
|
|
7273
|
+
}
|
|
7274
|
+
function BillingArrearsCadenceFromJSONTyped(json, ignoreDiscriminator) {
|
|
7275
|
+
return json;
|
|
7276
|
+
}
|
|
7277
|
+
|
|
7262
7278
|
// src/api/checkoutexternal/models/BillingCollectionMethod.ts
|
|
7263
7279
|
function BillingCollectionMethodFromJSON(json) {
|
|
7264
7280
|
return BillingCollectionMethodFromJSONTyped(json, false);
|
|
@@ -7809,6 +7825,8 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
7809
7825
|
return json;
|
|
7810
7826
|
}
|
|
7811
7827
|
return {
|
|
7828
|
+
arrearsAnchor: json["arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["arrears_anchor"]),
|
|
7829
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
7812
7830
|
autoTopupAmount: json["auto_topup_amount"] == null ? void 0 : json["auto_topup_amount"],
|
|
7813
7831
|
autoTopupAmountType: json["auto_topup_amount_type"] == null ? void 0 : json["auto_topup_amount_type"],
|
|
7814
7832
|
autoTopupAvailability: BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -7835,10 +7853,14 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
7835
7853
|
expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
|
|
7836
7854
|
id: json["id"],
|
|
7837
7855
|
licenseId: json["license_id"] == null ? void 0 : json["license_id"],
|
|
7856
|
+
overdraftLimit: json["overdraft_limit"] == null ? void 0 : json["overdraft_limit"],
|
|
7838
7857
|
plan: json["plan"] == null ? void 0 : PreviewObjectResponseDataFromJSON(json["plan"]),
|
|
7839
7858
|
planId: json["plan_id"],
|
|
7840
7859
|
planName: json["plan_name"],
|
|
7841
7860
|
planVersionId: json["plan_version_id"] == null ? void 0 : json["plan_version_id"],
|
|
7861
|
+
postpaidEnabled: json["postpaid_enabled"],
|
|
7862
|
+
postpaidRatePerUnit: json["postpaid_rate_per_unit"] == null ? void 0 : json["postpaid_rate_per_unit"],
|
|
7863
|
+
postpaidRatePerUnitDecimal: json["postpaid_rate_per_unit_decimal"] == null ? void 0 : json["postpaid_rate_per_unit_decimal"],
|
|
7842
7864
|
resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
|
|
7843
7865
|
resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
|
|
7844
7866
|
resetType: json["reset_type"] == null ? void 0 : BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
|
|
@@ -8416,6 +8438,8 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8416
8438
|
return json;
|
|
8417
8439
|
}
|
|
8418
8440
|
return {
|
|
8441
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
8442
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
8419
8443
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
8420
8444
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
8421
8445
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -8433,6 +8457,10 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8433
8457
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
8434
8458
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
8435
8459
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
8460
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
8461
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
8462
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
8463
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
8436
8464
|
companyAutoTopupAmount: json["company_auto_topup_amount"] == null ? void 0 : json["company_auto_topup_amount"],
|
|
8437
8465
|
companyAutoTopupEnabled: json["company_auto_topup_enabled"] == null ? void 0 : json["company_auto_topup_enabled"],
|
|
8438
8466
|
companyAutoTopupThresholdCredits: json["company_auto_topup_threshold_credits"] == null ? void 0 : json["company_auto_topup_threshold_credits"],
|
|
@@ -8944,6 +8972,41 @@ function CompanyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8944
8972
|
};
|
|
8945
8973
|
}
|
|
8946
8974
|
|
|
8975
|
+
// src/api/checkoutexternal/models/CompanyInvoiceResponseData.ts
|
|
8976
|
+
function CompanyInvoiceResponseDataFromJSON(json) {
|
|
8977
|
+
return CompanyInvoiceResponseDataFromJSONTyped(json, false);
|
|
8978
|
+
}
|
|
8979
|
+
function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8980
|
+
if (json == null) {
|
|
8981
|
+
return json;
|
|
8982
|
+
}
|
|
8983
|
+
return {
|
|
8984
|
+
amountDue: json["amount_due"],
|
|
8985
|
+
createdAt: new Date(json["created_at"]),
|
|
8986
|
+
currency: json["currency"],
|
|
8987
|
+
dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
|
|
8988
|
+
id: json["id"],
|
|
8989
|
+
status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
|
|
8990
|
+
url: json["url"] == null ? void 0 : json["url"]
|
|
8991
|
+
};
|
|
8992
|
+
}
|
|
8993
|
+
|
|
8994
|
+
// src/api/checkoutexternal/models/CompanyInvoicesResponseData.ts
|
|
8995
|
+
function CompanyInvoicesResponseDataFromJSON(json) {
|
|
8996
|
+
return CompanyInvoicesResponseDataFromJSONTyped(json, false);
|
|
8997
|
+
}
|
|
8998
|
+
function CompanyInvoicesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
8999
|
+
if (json == null) {
|
|
9000
|
+
return json;
|
|
9001
|
+
}
|
|
9002
|
+
return {
|
|
9003
|
+
count: json["count"],
|
|
9004
|
+
invoices: json["invoices"].map(
|
|
9005
|
+
CompanyInvoiceResponseDataFromJSON
|
|
9006
|
+
)
|
|
9007
|
+
};
|
|
9008
|
+
}
|
|
9009
|
+
|
|
8947
9010
|
// src/api/checkoutexternal/models/CompanyOverrideNoteResponseData.ts
|
|
8948
9011
|
function CompanyOverrideNoteResponseDataFromJSON(json) {
|
|
8949
9012
|
return CompanyOverrideNoteResponseDataFromJSONTyped(json, false);
|
|
@@ -9434,6 +9497,8 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9434
9497
|
return json;
|
|
9435
9498
|
}
|
|
9436
9499
|
return {
|
|
9500
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
9501
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
9437
9502
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
9438
9503
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
9439
9504
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -9451,6 +9516,10 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9451
9516
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
9452
9517
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
9453
9518
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
9519
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
9520
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
9521
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
9522
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
9454
9523
|
companyCreditAmount: json["company_credit_amount"],
|
|
9455
9524
|
createdAt: new Date(json["created_at"]),
|
|
9456
9525
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON(json["credit"]),
|
|
@@ -9943,6 +10012,7 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9943
10012
|
return json;
|
|
9944
10013
|
}
|
|
9945
10014
|
return {
|
|
10015
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
9946
10016
|
billingCreditBundleId: json["billing_credit_bundle_id"] == null ? void 0 : json["billing_credit_bundle_id"],
|
|
9947
10017
|
billingCreditId: json["billing_credit_id"],
|
|
9948
10018
|
companyId: json["company_id"],
|
|
@@ -9964,6 +10034,12 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9964
10034
|
planId: json["plan_id"] == null ? void 0 : json["plan_id"],
|
|
9965
10035
|
planName: json["plan_name"] == null ? void 0 : json["plan_name"],
|
|
9966
10036
|
pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
|
|
10037
|
+
postpaidChargeAmount: json["postpaid_charge_amount"] == null ? void 0 : json["postpaid_charge_amount"],
|
|
10038
|
+
postpaidChargeCurrency: json["postpaid_charge_currency"] == null ? void 0 : json["postpaid_charge_currency"],
|
|
10039
|
+
postpaidChargedCredits: json["postpaid_charged_credits"] == null ? void 0 : json["postpaid_charged_credits"],
|
|
10040
|
+
postpaidPeriodEnd: json["postpaid_period_end"] == null ? void 0 : new Date(json["postpaid_period_end"]),
|
|
10041
|
+
postpaidRate: json["postpaid_rate"] == null ? void 0 : json["postpaid_rate"],
|
|
10042
|
+
postpaidRateDecimal: json["postpaid_rate_decimal"] == null ? void 0 : json["postpaid_rate_decimal"],
|
|
9967
10043
|
price: json["price"] == null ? void 0 : BillingProductPriceResponseDataFromJSON(json["price"]),
|
|
9968
10044
|
quantity: json["quantity"],
|
|
9969
10045
|
quantityRemaining: json["quantity_remaining"],
|
|
@@ -10287,6 +10363,35 @@ function GetCheckoutTaxIDResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10287
10363
|
};
|
|
10288
10364
|
}
|
|
10289
10365
|
|
|
10366
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesParams.ts
|
|
10367
|
+
function GetCompanyInvoicesParamsFromJSON(json) {
|
|
10368
|
+
return GetCompanyInvoicesParamsFromJSONTyped(json, false);
|
|
10369
|
+
}
|
|
10370
|
+
function GetCompanyInvoicesParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
10371
|
+
if (json == null) {
|
|
10372
|
+
return json;
|
|
10373
|
+
}
|
|
10374
|
+
return {
|
|
10375
|
+
includePending: json["include_pending"] == null ? void 0 : json["include_pending"],
|
|
10376
|
+
limit: json["limit"] == null ? void 0 : json["limit"],
|
|
10377
|
+
offset: json["offset"] == null ? void 0 : json["offset"]
|
|
10378
|
+
};
|
|
10379
|
+
}
|
|
10380
|
+
|
|
10381
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesResponse.ts
|
|
10382
|
+
function GetCompanyInvoicesResponseFromJSON(json) {
|
|
10383
|
+
return GetCompanyInvoicesResponseFromJSONTyped(json, false);
|
|
10384
|
+
}
|
|
10385
|
+
function GetCompanyInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
10386
|
+
if (json == null) {
|
|
10387
|
+
return json;
|
|
10388
|
+
}
|
|
10389
|
+
return {
|
|
10390
|
+
data: CompanyInvoicesResponseDataFromJSON(json["data"]),
|
|
10391
|
+
params: GetCompanyInvoicesParamsFromJSON(json["params"])
|
|
10392
|
+
};
|
|
10393
|
+
}
|
|
10394
|
+
|
|
10290
10395
|
// src/api/checkoutexternal/models/GetCreditUsageByUserParams.ts
|
|
10291
10396
|
function GetCreditUsageByUserParamsFromJSON(json) {
|
|
10292
10397
|
return GetCreditUsageByUserParamsFromJSONTyped(json, false);
|
|
@@ -10897,6 +11002,50 @@ var CheckoutexternalApi = class extends BaseAPI {
|
|
|
10897
11002
|
const response = await this.getCheckoutTaxIDRaw(initOverrides);
|
|
10898
11003
|
return await response.value();
|
|
10899
11004
|
}
|
|
11005
|
+
/**
|
|
11006
|
+
* Get company invoices
|
|
11007
|
+
*/
|
|
11008
|
+
async getCompanyInvoicesRaw(requestParameters, initOverrides) {
|
|
11009
|
+
const queryParameters = {};
|
|
11010
|
+
if (requestParameters["includePending"] != null) {
|
|
11011
|
+
queryParameters["include_pending"] = requestParameters["includePending"];
|
|
11012
|
+
}
|
|
11013
|
+
if (requestParameters["limit"] != null) {
|
|
11014
|
+
queryParameters["limit"] = requestParameters["limit"];
|
|
11015
|
+
}
|
|
11016
|
+
if (requestParameters["offset"] != null) {
|
|
11017
|
+
queryParameters["offset"] = requestParameters["offset"];
|
|
11018
|
+
}
|
|
11019
|
+
const headerParameters = {};
|
|
11020
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
11021
|
+
headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
|
|
11022
|
+
"X-Schematic-Api-Key"
|
|
11023
|
+
);
|
|
11024
|
+
}
|
|
11025
|
+
const response = await this.request(
|
|
11026
|
+
{
|
|
11027
|
+
path: `/company/invoices`,
|
|
11028
|
+
method: "GET",
|
|
11029
|
+
headers: headerParameters,
|
|
11030
|
+
query: queryParameters
|
|
11031
|
+
},
|
|
11032
|
+
initOverrides
|
|
11033
|
+
);
|
|
11034
|
+
return new JSONApiResponse(
|
|
11035
|
+
response,
|
|
11036
|
+
(jsonValue) => GetCompanyInvoicesResponseFromJSON(jsonValue)
|
|
11037
|
+
);
|
|
11038
|
+
}
|
|
11039
|
+
/**
|
|
11040
|
+
* Get company invoices
|
|
11041
|
+
*/
|
|
11042
|
+
async getCompanyInvoices(requestParameters = {}, initOverrides) {
|
|
11043
|
+
const response = await this.getCompanyInvoicesRaw(
|
|
11044
|
+
requestParameters,
|
|
11045
|
+
initOverrides
|
|
11046
|
+
);
|
|
11047
|
+
return await response.value();
|
|
11048
|
+
}
|
|
10900
11049
|
/**
|
|
10901
11050
|
* Get credit usage by user
|
|
10902
11051
|
*/
|
|
@@ -11646,6 +11795,22 @@ var JSONApiResponse2 = class {
|
|
|
11646
11795
|
}
|
|
11647
11796
|
};
|
|
11648
11797
|
|
|
11798
|
+
// src/api/componentspublic/models/BillingArrearsAnchor.ts
|
|
11799
|
+
function BillingArrearsAnchorFromJSON2(json) {
|
|
11800
|
+
return BillingArrearsAnchorFromJSONTyped5(json, false);
|
|
11801
|
+
}
|
|
11802
|
+
function BillingArrearsAnchorFromJSONTyped5(json, ignoreDiscriminator) {
|
|
11803
|
+
return json;
|
|
11804
|
+
}
|
|
11805
|
+
|
|
11806
|
+
// src/api/componentspublic/models/BillingArrearsCadence.ts
|
|
11807
|
+
function BillingArrearsCadenceFromJSON2(json) {
|
|
11808
|
+
return BillingArrearsCadenceFromJSONTyped6(json, false);
|
|
11809
|
+
}
|
|
11810
|
+
function BillingArrearsCadenceFromJSONTyped6(json, ignoreDiscriminator) {
|
|
11811
|
+
return json;
|
|
11812
|
+
}
|
|
11813
|
+
|
|
11649
11814
|
// src/api/componentspublic/models/BillingCreditAutoTopupAvailability.ts
|
|
11650
11815
|
function BillingCreditAutoTopupAvailabilityFromJSON2(json) {
|
|
11651
11816
|
return BillingCreditAutoTopupAvailabilityFromJSONTyped5(json, false);
|
|
@@ -12623,6 +12788,8 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12623
12788
|
return json;
|
|
12624
12789
|
}
|
|
12625
12790
|
return {
|
|
12791
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON2(json["billing_credit_arrears_anchor"]),
|
|
12792
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON2(json["billing_credit_arrears_cadence"]),
|
|
12626
12793
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
12627
12794
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
12628
12795
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON2(
|
|
@@ -12640,6 +12807,10 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12640
12807
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
12641
12808
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
12642
12809
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
12810
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
12811
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
12812
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
12813
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
12643
12814
|
companyCreditAmount: json["company_credit_amount"],
|
|
12644
12815
|
createdAt: new Date(json["created_at"]),
|
|
12645
12816
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON2(json["credit"]),
|
|
@@ -13831,6 +14002,18 @@ function buildCreditBundlesRequestBody(creditBundles) {
|
|
|
13831
14002
|
[]
|
|
13832
14003
|
);
|
|
13833
14004
|
}
|
|
14005
|
+
function isCreditOnlyCheckout(options) {
|
|
14006
|
+
const { plan, creditBundles, addOns, period, currency } = options;
|
|
14007
|
+
if (plan) {
|
|
14008
|
+
return false;
|
|
14009
|
+
}
|
|
14010
|
+
if (!creditBundles.some((bundle) => bundle.count > 0)) {
|
|
14011
|
+
return false;
|
|
14012
|
+
}
|
|
14013
|
+
return !addOns.some(
|
|
14014
|
+
(addOn) => addOn.isSelected && !!getAddOnPrice(addOn, period, currency)?.id
|
|
14015
|
+
);
|
|
14016
|
+
}
|
|
13834
14017
|
|
|
13835
14018
|
// src/utils/api/entitlement.ts
|
|
13836
14019
|
var PeriodName = {
|
|
@@ -15100,7 +15283,7 @@ var reducer = (state, action) => {
|
|
|
15100
15283
|
// src/context/EmbedProvider.tsx
|
|
15101
15284
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
15102
15285
|
var getCustomHeaders = (sessionId) => ({
|
|
15103
|
-
"X-Schematic-Components-Version": "2.25.
|
|
15286
|
+
"X-Schematic-Components-Version": "2.25.1",
|
|
15104
15287
|
"X-Schematic-Session-ID": sessionId
|
|
15105
15288
|
});
|
|
15106
15289
|
var normalizeCurrencyFilter = (filter2) => {
|
|
@@ -19504,48 +19687,26 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19504
19687
|
bundleCounts
|
|
19505
19688
|
);
|
|
19506
19689
|
}, [bundleGatingPlanId, data?.creditBundles, bundleCounts]);
|
|
19507
|
-
const selectedPlanPriceId = (0, import_react39.useMemo)(() => {
|
|
19508
|
-
if (!selectedPlan) {
|
|
19509
|
-
return void 0;
|
|
19510
|
-
}
|
|
19511
|
-
const currencyPrice = getPlanPrice(
|
|
19512
|
-
selectedPlan,
|
|
19513
|
-
planPeriod,
|
|
19514
|
-
{ useSelectedPeriod: true },
|
|
19515
|
-
hasCurrency ? effectiveCurrency : void 0
|
|
19516
|
-
);
|
|
19517
|
-
return currencyPrice?.id ?? (planPeriod === "year" ? selectedPlan.yearlyPrice?.id : planPeriod === "quarter" ? selectedPlan.quarterlyPrice?.id : selectedPlan.monthlyPrice?.id);
|
|
19518
|
-
}, [selectedPlan, planPeriod, hasCurrency, effectiveCurrency]);
|
|
19519
19690
|
const [hasInitialPaymentMethod] = (0, import_react39.useState)(
|
|
19520
19691
|
() => !!(data?.subscription?.paymentMethod?.externalId || data?.company?.defaultPaymentMethod?.externalId)
|
|
19521
19692
|
);
|
|
19522
|
-
const isCreditOnlyPurchase = (0, import_react39.useMemo)(
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
return !hasPaidAddOn;
|
|
19540
|
-
}, [
|
|
19541
|
-
data?.company?.billingSubscription,
|
|
19542
|
-
selectedPlanPriceId,
|
|
19543
|
-
creditBundles,
|
|
19544
|
-
addOns,
|
|
19545
|
-
planPeriod,
|
|
19546
|
-
hasCurrency,
|
|
19547
|
-
effectiveCurrency
|
|
19548
|
-
]);
|
|
19693
|
+
const isCreditOnlyPurchase = (0, import_react39.useMemo)(
|
|
19694
|
+
() => isCreditOnlyCheckout({
|
|
19695
|
+
plan: selectedPlan,
|
|
19696
|
+
creditBundles,
|
|
19697
|
+
addOns,
|
|
19698
|
+
period: planPeriod,
|
|
19699
|
+
currency: hasCurrency ? effectiveCurrency : void 0
|
|
19700
|
+
}),
|
|
19701
|
+
[
|
|
19702
|
+
selectedPlan,
|
|
19703
|
+
creditBundles,
|
|
19704
|
+
addOns,
|
|
19705
|
+
planPeriod,
|
|
19706
|
+
hasCurrency,
|
|
19707
|
+
effectiveCurrency
|
|
19708
|
+
]
|
|
19709
|
+
);
|
|
19549
19710
|
const [usageBasedEntitlements, setUsageBasedEntitlements] = (0, import_react39.useState)(
|
|
19550
19711
|
() => applyPrefilledQuantities(
|
|
19551
19712
|
(selectedPlan?.entitlements || []).reduce(
|
|
@@ -19840,9 +20001,13 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19840
20001
|
updates.creditBundles || creditBundles,
|
|
19841
20002
|
plan?.id ?? data?.company?.plan?.id
|
|
19842
20003
|
);
|
|
19843
|
-
const isCreditOnly =
|
|
19844
|
-
|
|
19845
|
-
|
|
20004
|
+
const isCreditOnly = isCreditOnlyCheckout({
|
|
20005
|
+
plan,
|
|
20006
|
+
creditBundles: resolvedCreditBundles,
|
|
20007
|
+
addOns: updates.addOns || addOns,
|
|
20008
|
+
period,
|
|
20009
|
+
currency: resolvedCurrency
|
|
20010
|
+
});
|
|
19846
20011
|
if ((!plan || !planPriceId) && !isCreditOnly) {
|
|
19847
20012
|
++previewRequestIdRef.current;
|
|
19848
20013
|
setError(void 0);
|
|
@@ -19982,7 +20147,6 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19982
20147
|
addOnCompatibilityLookup,
|
|
19983
20148
|
data?.company?.plan?.id,
|
|
19984
20149
|
data?.company?.plan?.includedCreditGrants,
|
|
19985
|
-
data?.company?.billingSubscription,
|
|
19986
20150
|
previewCheckout,
|
|
19987
20151
|
planPeriod,
|
|
19988
20152
|
selectedPlan,
|
|
@@ -25508,7 +25672,7 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
25508
25672
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
25509
25673
|
var import_react_stripe_js2 = require("@stripe/react-stripe-js");
|
|
25510
25674
|
|
|
25511
|
-
// node_modules/.pnpm/@stripe+stripe-js@9.
|
|
25675
|
+
// node_modules/.pnpm/@stripe+stripe-js@9.15.0/node_modules/@stripe/stripe-js/dist/index.mjs
|
|
25512
25676
|
function _typeof(obj) {
|
|
25513
25677
|
"@babel/helpers - typeof";
|
|
25514
25678
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -25562,7 +25726,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
|
25562
25726
|
}
|
|
25563
25727
|
stripe._registerWrapper({
|
|
25564
25728
|
name: "stripe-js",
|
|
25565
|
-
version: "9.
|
|
25729
|
+
version: "9.15.0",
|
|
25566
25730
|
startTime
|
|
25567
25731
|
});
|
|
25568
25732
|
};
|
|
@@ -25640,7 +25804,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
|
25640
25804
|
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
25641
25805
|
var expectedVersion = RELEASE_TRAIN;
|
|
25642
25806
|
if (isTestKey && version !== expectedVersion) {
|
|
25643
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.
|
|
25807
|
+
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"));
|
|
25644
25808
|
}
|
|
25645
25809
|
var stripe = maybeStripe.apply(void 0, args);
|
|
25646
25810
|
registerWrapper(stripe, startTime);
|