@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.
|
@@ -7615,6 +7615,22 @@ var JSONApiResponse = class {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
};
|
|
7617
7617
|
|
|
7618
|
+
// src/api/checkoutexternal/models/BillingArrearsAnchor.ts
|
|
7619
|
+
function BillingArrearsAnchorFromJSON(json) {
|
|
7620
|
+
return BillingArrearsAnchorFromJSONTyped(json, false);
|
|
7621
|
+
}
|
|
7622
|
+
function BillingArrearsAnchorFromJSONTyped(json, ignoreDiscriminator) {
|
|
7623
|
+
return json;
|
|
7624
|
+
}
|
|
7625
|
+
|
|
7626
|
+
// src/api/checkoutexternal/models/BillingArrearsCadence.ts
|
|
7627
|
+
function BillingArrearsCadenceFromJSON(json) {
|
|
7628
|
+
return BillingArrearsCadenceFromJSONTyped(json, false);
|
|
7629
|
+
}
|
|
7630
|
+
function BillingArrearsCadenceFromJSONTyped(json, ignoreDiscriminator) {
|
|
7631
|
+
return json;
|
|
7632
|
+
}
|
|
7633
|
+
|
|
7618
7634
|
// src/api/checkoutexternal/models/BillingCollectionMethod.ts
|
|
7619
7635
|
function BillingCollectionMethodFromJSON(json) {
|
|
7620
7636
|
return BillingCollectionMethodFromJSONTyped(json, false);
|
|
@@ -8165,6 +8181,8 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
8165
8181
|
return json;
|
|
8166
8182
|
}
|
|
8167
8183
|
return {
|
|
8184
|
+
arrearsAnchor: json["arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["arrears_anchor"]),
|
|
8185
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
8168
8186
|
autoTopupAmount: json["auto_topup_amount"] == null ? void 0 : json["auto_topup_amount"],
|
|
8169
8187
|
autoTopupAmountType: json["auto_topup_amount_type"] == null ? void 0 : json["auto_topup_amount_type"],
|
|
8170
8188
|
autoTopupAvailability: BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -8191,10 +8209,14 @@ function BillingPlanCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
8191
8209
|
expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
|
|
8192
8210
|
id: json["id"],
|
|
8193
8211
|
licenseId: json["license_id"] == null ? void 0 : json["license_id"],
|
|
8212
|
+
overdraftLimit: json["overdraft_limit"] == null ? void 0 : json["overdraft_limit"],
|
|
8194
8213
|
plan: json["plan"] == null ? void 0 : PreviewObjectResponseDataFromJSON(json["plan"]),
|
|
8195
8214
|
planId: json["plan_id"],
|
|
8196
8215
|
planName: json["plan_name"],
|
|
8197
8216
|
planVersionId: json["plan_version_id"] == null ? void 0 : json["plan_version_id"],
|
|
8217
|
+
postpaidEnabled: json["postpaid_enabled"],
|
|
8218
|
+
postpaidRatePerUnit: json["postpaid_rate_per_unit"] == null ? void 0 : json["postpaid_rate_per_unit"],
|
|
8219
|
+
postpaidRatePerUnitDecimal: json["postpaid_rate_per_unit_decimal"] == null ? void 0 : json["postpaid_rate_per_unit_decimal"],
|
|
8198
8220
|
resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
|
|
8199
8221
|
resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON(json["reset_start"]),
|
|
8200
8222
|
resetType: json["reset_type"] == null ? void 0 : BillingPlanCreditGrantResetTypeFromJSON(json["reset_type"]),
|
|
@@ -8772,6 +8794,8 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8772
8794
|
return json;
|
|
8773
8795
|
}
|
|
8774
8796
|
return {
|
|
8797
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
8798
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
8775
8799
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
8776
8800
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
8777
8801
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -8789,6 +8813,10 @@ function CompanyPlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
8789
8813
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
8790
8814
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
8791
8815
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
8816
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
8817
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
8818
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
8819
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
8792
8820
|
companyAutoTopupAmount: json["company_auto_topup_amount"] == null ? void 0 : json["company_auto_topup_amount"],
|
|
8793
8821
|
companyAutoTopupEnabled: json["company_auto_topup_enabled"] == null ? void 0 : json["company_auto_topup_enabled"],
|
|
8794
8822
|
companyAutoTopupThresholdCredits: json["company_auto_topup_threshold_credits"] == null ? void 0 : json["company_auto_topup_threshold_credits"],
|
|
@@ -9300,6 +9328,41 @@ function CompanyDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9300
9328
|
};
|
|
9301
9329
|
}
|
|
9302
9330
|
|
|
9331
|
+
// src/api/checkoutexternal/models/CompanyInvoiceResponseData.ts
|
|
9332
|
+
function CompanyInvoiceResponseDataFromJSON(json) {
|
|
9333
|
+
return CompanyInvoiceResponseDataFromJSONTyped(json, false);
|
|
9334
|
+
}
|
|
9335
|
+
function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
9336
|
+
if (json == null) {
|
|
9337
|
+
return json;
|
|
9338
|
+
}
|
|
9339
|
+
return {
|
|
9340
|
+
amountDue: json["amount_due"],
|
|
9341
|
+
createdAt: new Date(json["created_at"]),
|
|
9342
|
+
currency: json["currency"],
|
|
9343
|
+
dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
|
|
9344
|
+
id: json["id"],
|
|
9345
|
+
status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
|
|
9346
|
+
url: json["url"] == null ? void 0 : json["url"]
|
|
9347
|
+
};
|
|
9348
|
+
}
|
|
9349
|
+
|
|
9350
|
+
// src/api/checkoutexternal/models/CompanyInvoicesResponseData.ts
|
|
9351
|
+
function CompanyInvoicesResponseDataFromJSON(json) {
|
|
9352
|
+
return CompanyInvoicesResponseDataFromJSONTyped(json, false);
|
|
9353
|
+
}
|
|
9354
|
+
function CompanyInvoicesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
9355
|
+
if (json == null) {
|
|
9356
|
+
return json;
|
|
9357
|
+
}
|
|
9358
|
+
return {
|
|
9359
|
+
count: json["count"],
|
|
9360
|
+
invoices: json["invoices"].map(
|
|
9361
|
+
CompanyInvoiceResponseDataFromJSON
|
|
9362
|
+
)
|
|
9363
|
+
};
|
|
9364
|
+
}
|
|
9365
|
+
|
|
9303
9366
|
// src/api/checkoutexternal/models/CompanyOverrideNoteResponseData.ts
|
|
9304
9367
|
function CompanyOverrideNoteResponseDataFromJSON(json) {
|
|
9305
9368
|
return CompanyOverrideNoteResponseDataFromJSONTyped(json, false);
|
|
@@ -9790,6 +9853,8 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9790
9853
|
return json;
|
|
9791
9854
|
}
|
|
9792
9855
|
return {
|
|
9856
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON(json["billing_credit_arrears_anchor"]),
|
|
9857
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["billing_credit_arrears_cadence"]),
|
|
9793
9858
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
9794
9859
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
9795
9860
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON(
|
|
@@ -9807,6 +9872,10 @@ function PlanCreditGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9807
9872
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
9808
9873
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
9809
9874
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
9875
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
9876
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
9877
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
9878
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
9810
9879
|
companyCreditAmount: json["company_credit_amount"],
|
|
9811
9880
|
createdAt: new Date(json["created_at"]),
|
|
9812
9881
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON(json["credit"]),
|
|
@@ -10299,6 +10368,7 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10299
10368
|
return json;
|
|
10300
10369
|
}
|
|
10301
10370
|
return {
|
|
10371
|
+
arrearsCadence: json["arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON(json["arrears_cadence"]),
|
|
10302
10372
|
billingCreditBundleId: json["billing_credit_bundle_id"] == null ? void 0 : json["billing_credit_bundle_id"],
|
|
10303
10373
|
billingCreditId: json["billing_credit_id"],
|
|
10304
10374
|
companyId: json["company_id"],
|
|
@@ -10320,6 +10390,12 @@ function CreditCompanyGrantViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10320
10390
|
planId: json["plan_id"] == null ? void 0 : json["plan_id"],
|
|
10321
10391
|
planName: json["plan_name"] == null ? void 0 : json["plan_name"],
|
|
10322
10392
|
pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
|
|
10393
|
+
postpaidChargeAmount: json["postpaid_charge_amount"] == null ? void 0 : json["postpaid_charge_amount"],
|
|
10394
|
+
postpaidChargeCurrency: json["postpaid_charge_currency"] == null ? void 0 : json["postpaid_charge_currency"],
|
|
10395
|
+
postpaidChargedCredits: json["postpaid_charged_credits"] == null ? void 0 : json["postpaid_charged_credits"],
|
|
10396
|
+
postpaidPeriodEnd: json["postpaid_period_end"] == null ? void 0 : new Date(json["postpaid_period_end"]),
|
|
10397
|
+
postpaidRate: json["postpaid_rate"] == null ? void 0 : json["postpaid_rate"],
|
|
10398
|
+
postpaidRateDecimal: json["postpaid_rate_decimal"] == null ? void 0 : json["postpaid_rate_decimal"],
|
|
10323
10399
|
price: json["price"] == null ? void 0 : BillingProductPriceResponseDataFromJSON(json["price"]),
|
|
10324
10400
|
quantity: json["quantity"],
|
|
10325
10401
|
quantityRemaining: json["quantity_remaining"],
|
|
@@ -10643,6 +10719,35 @@ function GetCheckoutTaxIDResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10643
10719
|
};
|
|
10644
10720
|
}
|
|
10645
10721
|
|
|
10722
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesParams.ts
|
|
10723
|
+
function GetCompanyInvoicesParamsFromJSON(json) {
|
|
10724
|
+
return GetCompanyInvoicesParamsFromJSONTyped(json, false);
|
|
10725
|
+
}
|
|
10726
|
+
function GetCompanyInvoicesParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
10727
|
+
if (json == null) {
|
|
10728
|
+
return json;
|
|
10729
|
+
}
|
|
10730
|
+
return {
|
|
10731
|
+
includePending: json["include_pending"] == null ? void 0 : json["include_pending"],
|
|
10732
|
+
limit: json["limit"] == null ? void 0 : json["limit"],
|
|
10733
|
+
offset: json["offset"] == null ? void 0 : json["offset"]
|
|
10734
|
+
};
|
|
10735
|
+
}
|
|
10736
|
+
|
|
10737
|
+
// src/api/checkoutexternal/models/GetCompanyInvoicesResponse.ts
|
|
10738
|
+
function GetCompanyInvoicesResponseFromJSON(json) {
|
|
10739
|
+
return GetCompanyInvoicesResponseFromJSONTyped(json, false);
|
|
10740
|
+
}
|
|
10741
|
+
function GetCompanyInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
10742
|
+
if (json == null) {
|
|
10743
|
+
return json;
|
|
10744
|
+
}
|
|
10745
|
+
return {
|
|
10746
|
+
data: CompanyInvoicesResponseDataFromJSON(json["data"]),
|
|
10747
|
+
params: GetCompanyInvoicesParamsFromJSON(json["params"])
|
|
10748
|
+
};
|
|
10749
|
+
}
|
|
10750
|
+
|
|
10646
10751
|
// src/api/checkoutexternal/models/GetCreditUsageByUserParams.ts
|
|
10647
10752
|
function GetCreditUsageByUserParamsFromJSON(json) {
|
|
10648
10753
|
return GetCreditUsageByUserParamsFromJSONTyped(json, false);
|
|
@@ -11253,6 +11358,50 @@ var CheckoutexternalApi = class extends BaseAPI {
|
|
|
11253
11358
|
const response = await this.getCheckoutTaxIDRaw(initOverrides);
|
|
11254
11359
|
return await response.value();
|
|
11255
11360
|
}
|
|
11361
|
+
/**
|
|
11362
|
+
* Get company invoices
|
|
11363
|
+
*/
|
|
11364
|
+
async getCompanyInvoicesRaw(requestParameters, initOverrides) {
|
|
11365
|
+
const queryParameters = {};
|
|
11366
|
+
if (requestParameters["includePending"] != null) {
|
|
11367
|
+
queryParameters["include_pending"] = requestParameters["includePending"];
|
|
11368
|
+
}
|
|
11369
|
+
if (requestParameters["limit"] != null) {
|
|
11370
|
+
queryParameters["limit"] = requestParameters["limit"];
|
|
11371
|
+
}
|
|
11372
|
+
if (requestParameters["offset"] != null) {
|
|
11373
|
+
queryParameters["offset"] = requestParameters["offset"];
|
|
11374
|
+
}
|
|
11375
|
+
const headerParameters = {};
|
|
11376
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
11377
|
+
headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
|
|
11378
|
+
"X-Schematic-Api-Key"
|
|
11379
|
+
);
|
|
11380
|
+
}
|
|
11381
|
+
const response = await this.request(
|
|
11382
|
+
{
|
|
11383
|
+
path: `/company/invoices`,
|
|
11384
|
+
method: "GET",
|
|
11385
|
+
headers: headerParameters,
|
|
11386
|
+
query: queryParameters
|
|
11387
|
+
},
|
|
11388
|
+
initOverrides
|
|
11389
|
+
);
|
|
11390
|
+
return new JSONApiResponse(
|
|
11391
|
+
response,
|
|
11392
|
+
(jsonValue) => GetCompanyInvoicesResponseFromJSON(jsonValue)
|
|
11393
|
+
);
|
|
11394
|
+
}
|
|
11395
|
+
/**
|
|
11396
|
+
* Get company invoices
|
|
11397
|
+
*/
|
|
11398
|
+
async getCompanyInvoices(requestParameters = {}, initOverrides) {
|
|
11399
|
+
const response = await this.getCompanyInvoicesRaw(
|
|
11400
|
+
requestParameters,
|
|
11401
|
+
initOverrides
|
|
11402
|
+
);
|
|
11403
|
+
return await response.value();
|
|
11404
|
+
}
|
|
11256
11405
|
/**
|
|
11257
11406
|
* Get credit usage by user
|
|
11258
11407
|
*/
|
|
@@ -12002,6 +12151,22 @@ var JSONApiResponse2 = class {
|
|
|
12002
12151
|
}
|
|
12003
12152
|
};
|
|
12004
12153
|
|
|
12154
|
+
// src/api/componentspublic/models/BillingArrearsAnchor.ts
|
|
12155
|
+
function BillingArrearsAnchorFromJSON2(json) {
|
|
12156
|
+
return BillingArrearsAnchorFromJSONTyped5(json, false);
|
|
12157
|
+
}
|
|
12158
|
+
function BillingArrearsAnchorFromJSONTyped5(json, ignoreDiscriminator) {
|
|
12159
|
+
return json;
|
|
12160
|
+
}
|
|
12161
|
+
|
|
12162
|
+
// src/api/componentspublic/models/BillingArrearsCadence.ts
|
|
12163
|
+
function BillingArrearsCadenceFromJSON2(json) {
|
|
12164
|
+
return BillingArrearsCadenceFromJSONTyped6(json, false);
|
|
12165
|
+
}
|
|
12166
|
+
function BillingArrearsCadenceFromJSONTyped6(json, ignoreDiscriminator) {
|
|
12167
|
+
return json;
|
|
12168
|
+
}
|
|
12169
|
+
|
|
12005
12170
|
// src/api/componentspublic/models/BillingCreditAutoTopupAvailability.ts
|
|
12006
12171
|
function BillingCreditAutoTopupAvailabilityFromJSON2(json) {
|
|
12007
12172
|
return BillingCreditAutoTopupAvailabilityFromJSONTyped5(json, false);
|
|
@@ -12979,6 +13144,8 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12979
13144
|
return json;
|
|
12980
13145
|
}
|
|
12981
13146
|
return {
|
|
13147
|
+
billingCreditArrearsAnchor: json["billing_credit_arrears_anchor"] == null ? void 0 : BillingArrearsAnchorFromJSON2(json["billing_credit_arrears_anchor"]),
|
|
13148
|
+
billingCreditArrearsCadence: json["billing_credit_arrears_cadence"] == null ? void 0 : BillingArrearsCadenceFromJSON2(json["billing_credit_arrears_cadence"]),
|
|
12982
13149
|
billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
|
|
12983
13150
|
billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
|
|
12984
13151
|
billingCreditAutoTopupAvailability: json["billing_credit_auto_topup_availability"] == null ? void 0 : BillingCreditAutoTopupAvailabilityFromJSON2(
|
|
@@ -12996,6 +13163,10 @@ function PlanCreditGrantViewFromJSONTyped3(json, ignoreDiscriminator) {
|
|
|
12996
13163
|
billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
|
|
12997
13164
|
billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
|
|
12998
13165
|
billingCreditCanBuyBundles: json["billing_credit_can_buy_bundles"],
|
|
13166
|
+
billingCreditOverdraftLimit: json["billing_credit_overdraft_limit"] == null ? void 0 : json["billing_credit_overdraft_limit"],
|
|
13167
|
+
billingCreditPostpaidEnabled: json["billing_credit_postpaid_enabled"],
|
|
13168
|
+
billingCreditPostpaidRatePerUnit: json["billing_credit_postpaid_rate_per_unit"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit"],
|
|
13169
|
+
billingCreditPostpaidRatePerUnitDecimal: json["billing_credit_postpaid_rate_per_unit_decimal"] == null ? void 0 : json["billing_credit_postpaid_rate_per_unit_decimal"],
|
|
12999
13170
|
companyCreditAmount: json["company_credit_amount"],
|
|
13000
13171
|
createdAt: new Date(json["created_at"]),
|
|
13001
13172
|
credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON2(json["credit"]),
|
|
@@ -14187,6 +14358,18 @@ function buildCreditBundlesRequestBody(creditBundles) {
|
|
|
14187
14358
|
[]
|
|
14188
14359
|
);
|
|
14189
14360
|
}
|
|
14361
|
+
function isCreditOnlyCheckout(options) {
|
|
14362
|
+
const { plan, creditBundles, addOns, period, currency } = options;
|
|
14363
|
+
if (plan) {
|
|
14364
|
+
return false;
|
|
14365
|
+
}
|
|
14366
|
+
if (!creditBundles.some((bundle) => bundle.count > 0)) {
|
|
14367
|
+
return false;
|
|
14368
|
+
}
|
|
14369
|
+
return !addOns.some(
|
|
14370
|
+
(addOn) => addOn.isSelected && !!getAddOnPrice(addOn, period, currency)?.id
|
|
14371
|
+
);
|
|
14372
|
+
}
|
|
14190
14373
|
|
|
14191
14374
|
// src/utils/api/entitlement.ts
|
|
14192
14375
|
var PeriodName = {
|
|
@@ -15457,7 +15640,7 @@ var reducer = (state, action) => {
|
|
|
15457
15640
|
// src/context/EmbedProvider.tsx
|
|
15458
15641
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
15459
15642
|
var getCustomHeaders = (sessionId) => ({
|
|
15460
|
-
"X-Schematic-Components-Version": "2.25.
|
|
15643
|
+
"X-Schematic-Components-Version": "2.25.1",
|
|
15461
15644
|
"X-Schematic-Session-ID": sessionId
|
|
15462
15645
|
});
|
|
15463
15646
|
var normalizeCurrencyFilter = (filter) => {
|
|
@@ -19880,48 +20063,26 @@ var CheckoutDialog = ({ top }) => {
|
|
|
19880
20063
|
bundleCounts
|
|
19881
20064
|
);
|
|
19882
20065
|
}, [bundleGatingPlanId, data?.creditBundles, bundleCounts]);
|
|
19883
|
-
const selectedPlanPriceId = (0, import_react38.useMemo)(() => {
|
|
19884
|
-
if (!selectedPlan) {
|
|
19885
|
-
return void 0;
|
|
19886
|
-
}
|
|
19887
|
-
const currencyPrice = getPlanPrice(
|
|
19888
|
-
selectedPlan,
|
|
19889
|
-
planPeriod,
|
|
19890
|
-
{ useSelectedPeriod: true },
|
|
19891
|
-
hasCurrency ? effectiveCurrency : void 0
|
|
19892
|
-
);
|
|
19893
|
-
return currencyPrice?.id ?? (planPeriod === "year" ? selectedPlan.yearlyPrice?.id : planPeriod === "quarter" ? selectedPlan.quarterlyPrice?.id : selectedPlan.monthlyPrice?.id);
|
|
19894
|
-
}, [selectedPlan, planPeriod, hasCurrency, effectiveCurrency]);
|
|
19895
20066
|
const [hasInitialPaymentMethod] = (0, import_react38.useState)(
|
|
19896
20067
|
() => !!(data?.subscription?.paymentMethod?.externalId || data?.company?.defaultPaymentMethod?.externalId)
|
|
19897
20068
|
);
|
|
19898
|
-
const isCreditOnlyPurchase = (0, import_react38.useMemo)(
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19913
|
-
|
|
19914
|
-
|
|
19915
|
-
return !hasPaidAddOn;
|
|
19916
|
-
}, [
|
|
19917
|
-
data?.company?.billingSubscription,
|
|
19918
|
-
selectedPlanPriceId,
|
|
19919
|
-
creditBundles,
|
|
19920
|
-
addOns,
|
|
19921
|
-
planPeriod,
|
|
19922
|
-
hasCurrency,
|
|
19923
|
-
effectiveCurrency
|
|
19924
|
-
]);
|
|
20069
|
+
const isCreditOnlyPurchase = (0, import_react38.useMemo)(
|
|
20070
|
+
() => isCreditOnlyCheckout({
|
|
20071
|
+
plan: selectedPlan,
|
|
20072
|
+
creditBundles,
|
|
20073
|
+
addOns,
|
|
20074
|
+
period: planPeriod,
|
|
20075
|
+
currency: hasCurrency ? effectiveCurrency : void 0
|
|
20076
|
+
}),
|
|
20077
|
+
[
|
|
20078
|
+
selectedPlan,
|
|
20079
|
+
creditBundles,
|
|
20080
|
+
addOns,
|
|
20081
|
+
planPeriod,
|
|
20082
|
+
hasCurrency,
|
|
20083
|
+
effectiveCurrency
|
|
20084
|
+
]
|
|
20085
|
+
);
|
|
19925
20086
|
const [usageBasedEntitlements, setUsageBasedEntitlements] = (0, import_react38.useState)(
|
|
19926
20087
|
() => applyPrefilledQuantities(
|
|
19927
20088
|
(selectedPlan?.entitlements || []).reduce(
|
|
@@ -20216,9 +20377,13 @@ var CheckoutDialog = ({ top }) => {
|
|
|
20216
20377
|
updates.creditBundles || creditBundles,
|
|
20217
20378
|
plan?.id ?? data?.company?.plan?.id
|
|
20218
20379
|
);
|
|
20219
|
-
const isCreditOnly =
|
|
20220
|
-
|
|
20221
|
-
|
|
20380
|
+
const isCreditOnly = isCreditOnlyCheckout({
|
|
20381
|
+
plan,
|
|
20382
|
+
creditBundles: resolvedCreditBundles,
|
|
20383
|
+
addOns: updates.addOns || addOns,
|
|
20384
|
+
period,
|
|
20385
|
+
currency: resolvedCurrency
|
|
20386
|
+
});
|
|
20222
20387
|
if ((!plan || !planPriceId) && !isCreditOnly) {
|
|
20223
20388
|
++previewRequestIdRef.current;
|
|
20224
20389
|
setError(void 0);
|
|
@@ -20358,7 +20523,6 @@ var CheckoutDialog = ({ top }) => {
|
|
|
20358
20523
|
addOnCompatibilityLookup,
|
|
20359
20524
|
data?.company?.plan?.id,
|
|
20360
20525
|
data?.company?.plan?.includedCreditGrants,
|
|
20361
|
-
data?.company?.billingSubscription,
|
|
20362
20526
|
previewCheckout,
|
|
20363
20527
|
planPeriod,
|
|
20364
20528
|
selectedPlan,
|
|
@@ -25886,7 +26050,7 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
25886
26050
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
25887
26051
|
var import_react_stripe_js2 = require("@stripe/react-stripe-js");
|
|
25888
26052
|
|
|
25889
|
-
// node_modules/.pnpm/@stripe+stripe-js@9.
|
|
26053
|
+
// node_modules/.pnpm/@stripe+stripe-js@9.15.0/node_modules/@stripe/stripe-js/dist/index.mjs
|
|
25890
26054
|
function _typeof(obj) {
|
|
25891
26055
|
"@babel/helpers - typeof";
|
|
25892
26056
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -25940,7 +26104,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
|
25940
26104
|
}
|
|
25941
26105
|
stripe._registerWrapper({
|
|
25942
26106
|
name: "stripe-js",
|
|
25943
|
-
version: "9.
|
|
26107
|
+
version: "9.15.0",
|
|
25944
26108
|
startTime
|
|
25945
26109
|
});
|
|
25946
26110
|
};
|
|
@@ -26018,7 +26182,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
|
26018
26182
|
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
26019
26183
|
var expectedVersion = RELEASE_TRAIN;
|
|
26020
26184
|
if (isTestKey && version !== expectedVersion) {
|
|
26021
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.
|
|
26185
|
+
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"));
|
|
26022
26186
|
}
|
|
26023
26187
|
var stripe = maybeStripe.apply(void 0, args);
|
|
26024
26188
|
registerWrapper(stripe, startTime);
|