@schematichq/schematic-react 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schematic-react.cjs.js +1125 -14
- package/dist/schematic-react.d.ts +1060 -11
- package/dist/schematic-react.esm.js +1125 -14
- package/package.json +6 -6
|
@@ -46,6 +46,9 @@ __export(index_exports, {
|
|
|
46
46
|
UsagePeriod: () => UsagePeriod,
|
|
47
47
|
normalizeInvoiceQuery: () => normalizeInvoiceQuery2,
|
|
48
48
|
useBillingDataSource: () => useBillingDataSource,
|
|
49
|
+
useCompany: () => useCompany,
|
|
50
|
+
useCreditBalances: () => useCreditBalances,
|
|
51
|
+
useCreditUserUsage: () => useCreditUserUsage,
|
|
49
52
|
useFeatureUsage: () => useFeatureUsage,
|
|
50
53
|
useFeatureUserUsage: () => useFeatureUserUsage,
|
|
51
54
|
useInvalidateBillingData: () => useInvalidateBillingData,
|
|
@@ -69,7 +72,7 @@ __export(index_exports, {
|
|
|
69
72
|
});
|
|
70
73
|
module.exports = __toCommonJS(index_exports);
|
|
71
74
|
|
|
72
|
-
// node_modules/.pnpm/@schematichq+schematic-js@1.
|
|
75
|
+
// node_modules/.pnpm/@schematichq+schematic-js@1.13.0/node_modules/@schematichq/schematic-js/dist/schematic.esm.js
|
|
73
76
|
var __create2 = Object.create;
|
|
74
77
|
var __defProp2 = Object.defineProperty;
|
|
75
78
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -729,6 +732,7 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
729
732
|
metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
|
|
730
733
|
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
731
734
|
monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
|
|
735
|
+
quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
|
|
732
736
|
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
733
737
|
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
734
738
|
valueType: EntitlementValueTypeFromJSON(json["value_type"]),
|
|
@@ -1396,7 +1400,7 @@ var ContextSignatureManager = class {
|
|
|
1396
1400
|
}
|
|
1397
1401
|
}
|
|
1398
1402
|
};
|
|
1399
|
-
var version = "1.
|
|
1403
|
+
var version = "1.13.0";
|
|
1400
1404
|
var SINGLETON = {};
|
|
1401
1405
|
var models_exports = {};
|
|
1402
1406
|
__export2(models_exports, {
|
|
@@ -1404,6 +1408,11 @@ __export2(models_exports, {
|
|
|
1404
1408
|
ApiErrorFromJSONTyped: () => ApiErrorFromJSONTyped,
|
|
1405
1409
|
ApiErrorToJSON: () => ApiErrorToJSON,
|
|
1406
1410
|
ApiErrorToJSONTyped: () => ApiErrorToJSONTyped,
|
|
1411
|
+
BillingCreditGrantReason: () => BillingCreditGrantReason,
|
|
1412
|
+
BillingCreditGrantReasonFromJSON: () => BillingCreditGrantReasonFromJSON,
|
|
1413
|
+
BillingCreditGrantReasonFromJSONTyped: () => BillingCreditGrantReasonFromJSONTyped,
|
|
1414
|
+
BillingCreditGrantReasonToJSON: () => BillingCreditGrantReasonToJSON,
|
|
1415
|
+
BillingCreditGrantReasonToJSONTyped: () => BillingCreditGrantReasonToJSONTyped,
|
|
1407
1416
|
BillingPlanCreditGrantResetCadence: () => BillingPlanCreditGrantResetCadence,
|
|
1408
1417
|
BillingPlanCreditGrantResetCadenceFromJSON: () => BillingPlanCreditGrantResetCadenceFromJSON2,
|
|
1409
1418
|
BillingPlanCreditGrantResetCadenceFromJSONTyped: () => BillingPlanCreditGrantResetCadenceFromJSONTyped3,
|
|
@@ -1441,6 +1450,54 @@ __export2(models_exports, {
|
|
|
1441
1450
|
CatalogPriceTierResponseDataFromJSONTyped: () => CatalogPriceTierResponseDataFromJSONTyped,
|
|
1442
1451
|
CatalogPriceTierResponseDataToJSON: () => CatalogPriceTierResponseDataToJSON,
|
|
1443
1452
|
CatalogPriceTierResponseDataToJSONTyped: () => CatalogPriceTierResponseDataToJSONTyped,
|
|
1453
|
+
CompanyContextCustomPlanBillingResponseDataFromJSON: () => CompanyContextCustomPlanBillingResponseDataFromJSON,
|
|
1454
|
+
CompanyContextCustomPlanBillingResponseDataFromJSONTyped: () => CompanyContextCustomPlanBillingResponseDataFromJSONTyped,
|
|
1455
|
+
CompanyContextCustomPlanBillingResponseDataToJSON: () => CompanyContextCustomPlanBillingResponseDataToJSON,
|
|
1456
|
+
CompanyContextCustomPlanBillingResponseDataToJSONTyped: () => CompanyContextCustomPlanBillingResponseDataToJSONTyped,
|
|
1457
|
+
CompanyContextPlanResponseDataFromJSON: () => CompanyContextPlanResponseDataFromJSON,
|
|
1458
|
+
CompanyContextPlanResponseDataFromJSONTyped: () => CompanyContextPlanResponseDataFromJSONTyped,
|
|
1459
|
+
CompanyContextPlanResponseDataToJSON: () => CompanyContextPlanResponseDataToJSON,
|
|
1460
|
+
CompanyContextPlanResponseDataToJSONTyped: () => CompanyContextPlanResponseDataToJSONTyped,
|
|
1461
|
+
CompanyContextResponseDataFromJSON: () => CompanyContextResponseDataFromJSON,
|
|
1462
|
+
CompanyContextResponseDataFromJSONTyped: () => CompanyContextResponseDataFromJSONTyped,
|
|
1463
|
+
CompanyContextResponseDataToJSON: () => CompanyContextResponseDataToJSON,
|
|
1464
|
+
CompanyContextResponseDataToJSONTyped: () => CompanyContextResponseDataToJSONTyped,
|
|
1465
|
+
CompanyContextScheduledDowngradeResponseDataFromJSON: () => CompanyContextScheduledDowngradeResponseDataFromJSON,
|
|
1466
|
+
CompanyContextScheduledDowngradeResponseDataFromJSONTyped: () => CompanyContextScheduledDowngradeResponseDataFromJSONTyped,
|
|
1467
|
+
CompanyContextScheduledDowngradeResponseDataToJSON: () => CompanyContextScheduledDowngradeResponseDataToJSON,
|
|
1468
|
+
CompanyContextScheduledDowngradeResponseDataToJSONTyped: () => CompanyContextScheduledDowngradeResponseDataToJSONTyped,
|
|
1469
|
+
CompanyContextSubscriptionResponseDataFromJSON: () => CompanyContextSubscriptionResponseDataFromJSON,
|
|
1470
|
+
CompanyContextSubscriptionResponseDataFromJSONTyped: () => CompanyContextSubscriptionResponseDataFromJSONTyped,
|
|
1471
|
+
CompanyContextSubscriptionResponseDataToJSON: () => CompanyContextSubscriptionResponseDataToJSON,
|
|
1472
|
+
CompanyContextSubscriptionResponseDataToJSONTyped: () => CompanyContextSubscriptionResponseDataToJSONTyped,
|
|
1473
|
+
CompanyCreditAutoTopupResponseDataFromJSON: () => CompanyCreditAutoTopupResponseDataFromJSON,
|
|
1474
|
+
CompanyCreditAutoTopupResponseDataFromJSONTyped: () => CompanyCreditAutoTopupResponseDataFromJSONTyped,
|
|
1475
|
+
CompanyCreditAutoTopupResponseDataToJSON: () => CompanyCreditAutoTopupResponseDataToJSON,
|
|
1476
|
+
CompanyCreditAutoTopupResponseDataToJSONTyped: () => CompanyCreditAutoTopupResponseDataToJSONTyped,
|
|
1477
|
+
CompanyCreditBalanceResponseDataFromJSON: () => CompanyCreditBalanceResponseDataFromJSON,
|
|
1478
|
+
CompanyCreditBalanceResponseDataFromJSONTyped: () => CompanyCreditBalanceResponseDataFromJSONTyped,
|
|
1479
|
+
CompanyCreditBalanceResponseDataToJSON: () => CompanyCreditBalanceResponseDataToJSON,
|
|
1480
|
+
CompanyCreditBalanceResponseDataToJSONTyped: () => CompanyCreditBalanceResponseDataToJSONTyped,
|
|
1481
|
+
CompanyCreditBalancesResponseDataFromJSON: () => CompanyCreditBalancesResponseDataFromJSON,
|
|
1482
|
+
CompanyCreditBalancesResponseDataFromJSONTyped: () => CompanyCreditBalancesResponseDataFromJSONTyped,
|
|
1483
|
+
CompanyCreditBalancesResponseDataToJSON: () => CompanyCreditBalancesResponseDataToJSON,
|
|
1484
|
+
CompanyCreditBalancesResponseDataToJSONTyped: () => CompanyCreditBalancesResponseDataToJSONTyped,
|
|
1485
|
+
CompanyCreditCompositionResponseDataFromJSON: () => CompanyCreditCompositionResponseDataFromJSON,
|
|
1486
|
+
CompanyCreditCompositionResponseDataFromJSONTyped: () => CompanyCreditCompositionResponseDataFromJSONTyped,
|
|
1487
|
+
CompanyCreditCompositionResponseDataToJSON: () => CompanyCreditCompositionResponseDataToJSON,
|
|
1488
|
+
CompanyCreditCompositionResponseDataToJSONTyped: () => CompanyCreditCompositionResponseDataToJSONTyped,
|
|
1489
|
+
CompanyCreditGrantResponseDataFromJSON: () => CompanyCreditGrantResponseDataFromJSON,
|
|
1490
|
+
CompanyCreditGrantResponseDataFromJSONTyped: () => CompanyCreditGrantResponseDataFromJSONTyped,
|
|
1491
|
+
CompanyCreditGrantResponseDataToJSON: () => CompanyCreditGrantResponseDataToJSON,
|
|
1492
|
+
CompanyCreditGrantResponseDataToJSONTyped: () => CompanyCreditGrantResponseDataToJSONTyped,
|
|
1493
|
+
CompanyCreditUserUsageResponseDataFromJSON: () => CompanyCreditUserUsageResponseDataFromJSON,
|
|
1494
|
+
CompanyCreditUserUsageResponseDataFromJSONTyped: () => CompanyCreditUserUsageResponseDataFromJSONTyped,
|
|
1495
|
+
CompanyCreditUserUsageResponseDataToJSON: () => CompanyCreditUserUsageResponseDataToJSON,
|
|
1496
|
+
CompanyCreditUserUsageResponseDataToJSONTyped: () => CompanyCreditUserUsageResponseDataToJSONTyped,
|
|
1497
|
+
CompanyCreditUserUsageRowResponseDataFromJSON: () => CompanyCreditUserUsageRowResponseDataFromJSON,
|
|
1498
|
+
CompanyCreditUserUsageRowResponseDataFromJSONTyped: () => CompanyCreditUserUsageRowResponseDataFromJSONTyped,
|
|
1499
|
+
CompanyCreditUserUsageRowResponseDataToJSON: () => CompanyCreditUserUsageRowResponseDataToJSON,
|
|
1500
|
+
CompanyCreditUserUsageRowResponseDataToJSONTyped: () => CompanyCreditUserUsageRowResponseDataToJSONTyped,
|
|
1444
1501
|
CompanyDiscountResponseDataFromJSON: () => CompanyDiscountResponseDataFromJSON,
|
|
1445
1502
|
CompanyDiscountResponseDataFromJSONTyped: () => CompanyDiscountResponseDataFromJSONTyped,
|
|
1446
1503
|
CompanyDiscountResponseDataToJSON: () => CompanyDiscountResponseDataToJSON,
|
|
@@ -1485,6 +1542,16 @@ __export2(models_exports, {
|
|
|
1485
1542
|
CreateSetupIntentResponseFromJSONTyped: () => CreateSetupIntentResponseFromJSONTyped,
|
|
1486
1543
|
CreateSetupIntentResponseToJSON: () => CreateSetupIntentResponseToJSON,
|
|
1487
1544
|
CreateSetupIntentResponseToJSONTyped: () => CreateSetupIntentResponseToJSONTyped,
|
|
1545
|
+
Currency: () => Currency,
|
|
1546
|
+
CurrencyFromJSON: () => CurrencyFromJSON2,
|
|
1547
|
+
CurrencyFromJSONTyped: () => CurrencyFromJSONTyped8,
|
|
1548
|
+
CurrencyToJSON: () => CurrencyToJSON2,
|
|
1549
|
+
CurrencyToJSONTyped: () => CurrencyToJSONTyped8,
|
|
1550
|
+
CustomPlanActivationStrategy: () => CustomPlanActivationStrategy,
|
|
1551
|
+
CustomPlanActivationStrategyFromJSON: () => CustomPlanActivationStrategyFromJSON,
|
|
1552
|
+
CustomPlanActivationStrategyFromJSONTyped: () => CustomPlanActivationStrategyFromJSONTyped,
|
|
1553
|
+
CustomPlanActivationStrategyToJSON: () => CustomPlanActivationStrategyToJSON,
|
|
1554
|
+
CustomPlanActivationStrategyToJSONTyped: () => CustomPlanActivationStrategyToJSONTyped,
|
|
1488
1555
|
DeletePaymentMethodResponseFromJSON: () => DeletePaymentMethodResponseFromJSON,
|
|
1489
1556
|
DeletePaymentMethodResponseFromJSONTyped: () => DeletePaymentMethodResponseFromJSONTyped,
|
|
1490
1557
|
DeletePaymentMethodResponseToJSON: () => DeletePaymentMethodResponseToJSON,
|
|
@@ -1513,6 +1580,18 @@ __export2(models_exports, {
|
|
|
1513
1580
|
FeatureTypeFromJSONTyped: () => FeatureTypeFromJSONTyped3,
|
|
1514
1581
|
FeatureTypeToJSON: () => FeatureTypeToJSON2,
|
|
1515
1582
|
FeatureTypeToJSONTyped: () => FeatureTypeToJSONTyped3,
|
|
1583
|
+
GetCompanyCreditBalancesResponseFromJSON: () => GetCompanyCreditBalancesResponseFromJSON,
|
|
1584
|
+
GetCompanyCreditBalancesResponseFromJSONTyped: () => GetCompanyCreditBalancesResponseFromJSONTyped,
|
|
1585
|
+
GetCompanyCreditBalancesResponseToJSON: () => GetCompanyCreditBalancesResponseToJSON,
|
|
1586
|
+
GetCompanyCreditBalancesResponseToJSONTyped: () => GetCompanyCreditBalancesResponseToJSONTyped,
|
|
1587
|
+
GetCompanyCreditUserUsageParamsFromJSON: () => GetCompanyCreditUserUsageParamsFromJSON,
|
|
1588
|
+
GetCompanyCreditUserUsageParamsFromJSONTyped: () => GetCompanyCreditUserUsageParamsFromJSONTyped,
|
|
1589
|
+
GetCompanyCreditUserUsageParamsToJSON: () => GetCompanyCreditUserUsageParamsToJSON,
|
|
1590
|
+
GetCompanyCreditUserUsageParamsToJSONTyped: () => GetCompanyCreditUserUsageParamsToJSONTyped,
|
|
1591
|
+
GetCompanyCreditUserUsageResponseFromJSON: () => GetCompanyCreditUserUsageResponseFromJSON,
|
|
1592
|
+
GetCompanyCreditUserUsageResponseFromJSONTyped: () => GetCompanyCreditUserUsageResponseFromJSONTyped,
|
|
1593
|
+
GetCompanyCreditUserUsageResponseToJSON: () => GetCompanyCreditUserUsageResponseToJSON,
|
|
1594
|
+
GetCompanyCreditUserUsageResponseToJSONTyped: () => GetCompanyCreditUserUsageResponseToJSONTyped,
|
|
1516
1595
|
GetCompanyFeatureUsageResponseFromJSON: () => GetCompanyFeatureUsageResponseFromJSON,
|
|
1517
1596
|
GetCompanyFeatureUsageResponseFromJSONTyped: () => GetCompanyFeatureUsageResponseFromJSONTyped,
|
|
1518
1597
|
GetCompanyFeatureUsageResponseToJSON: () => GetCompanyFeatureUsageResponseToJSON,
|
|
@@ -1537,6 +1616,10 @@ __export2(models_exports, {
|
|
|
1537
1616
|
GetCompanyPaymentMethodsResponseFromJSONTyped: () => GetCompanyPaymentMethodsResponseFromJSONTyped,
|
|
1538
1617
|
GetCompanyPaymentMethodsResponseToJSON: () => GetCompanyPaymentMethodsResponseToJSON,
|
|
1539
1618
|
GetCompanyPaymentMethodsResponseToJSONTyped: () => GetCompanyPaymentMethodsResponseToJSONTyped,
|
|
1619
|
+
GetCompanyResponseFromJSON: () => GetCompanyResponseFromJSON,
|
|
1620
|
+
GetCompanyResponseFromJSONTyped: () => GetCompanyResponseFromJSONTyped,
|
|
1621
|
+
GetCompanyResponseToJSON: () => GetCompanyResponseToJSON,
|
|
1622
|
+
GetCompanyResponseToJSONTyped: () => GetCompanyResponseToJSONTyped,
|
|
1540
1623
|
GetCompanyUpcomingInvoiceResponseFromJSON: () => GetCompanyUpcomingInvoiceResponseFromJSON,
|
|
1541
1624
|
GetCompanyUpcomingInvoiceResponseFromJSONTyped: () => GetCompanyUpcomingInvoiceResponseFromJSONTyped,
|
|
1542
1625
|
GetCompanyUpcomingInvoiceResponseToJSON: () => GetCompanyUpcomingInvoiceResponseToJSON,
|
|
@@ -1578,6 +1661,7 @@ __export2(models_exports, {
|
|
|
1578
1661
|
UpdatePaymentMethodResponseToJSON: () => UpdatePaymentMethodResponseToJSON,
|
|
1579
1662
|
UpdatePaymentMethodResponseToJSONTyped: () => UpdatePaymentMethodResponseToJSONTyped,
|
|
1580
1663
|
instanceOfApiError: () => instanceOfApiError,
|
|
1664
|
+
instanceOfBillingCreditGrantReason: () => instanceOfBillingCreditGrantReason,
|
|
1581
1665
|
instanceOfBillingPlanCreditGrantResetCadence: () => instanceOfBillingPlanCreditGrantResetCadence,
|
|
1582
1666
|
instanceOfBillingPriceScheme: () => instanceOfBillingPriceScheme,
|
|
1583
1667
|
instanceOfBillingProductPriceInterval: () => instanceOfBillingProductPriceInterval,
|
|
@@ -1586,6 +1670,18 @@ __export2(models_exports, {
|
|
|
1586
1670
|
instanceOfCatalogCreditGrantResponseData: () => instanceOfCatalogCreditGrantResponseData,
|
|
1587
1671
|
instanceOfCatalogPriceResponseData: () => instanceOfCatalogPriceResponseData,
|
|
1588
1672
|
instanceOfCatalogPriceTierResponseData: () => instanceOfCatalogPriceTierResponseData,
|
|
1673
|
+
instanceOfCompanyContextCustomPlanBillingResponseData: () => instanceOfCompanyContextCustomPlanBillingResponseData,
|
|
1674
|
+
instanceOfCompanyContextPlanResponseData: () => instanceOfCompanyContextPlanResponseData,
|
|
1675
|
+
instanceOfCompanyContextResponseData: () => instanceOfCompanyContextResponseData,
|
|
1676
|
+
instanceOfCompanyContextScheduledDowngradeResponseData: () => instanceOfCompanyContextScheduledDowngradeResponseData,
|
|
1677
|
+
instanceOfCompanyContextSubscriptionResponseData: () => instanceOfCompanyContextSubscriptionResponseData,
|
|
1678
|
+
instanceOfCompanyCreditAutoTopupResponseData: () => instanceOfCompanyCreditAutoTopupResponseData,
|
|
1679
|
+
instanceOfCompanyCreditBalanceResponseData: () => instanceOfCompanyCreditBalanceResponseData,
|
|
1680
|
+
instanceOfCompanyCreditBalancesResponseData: () => instanceOfCompanyCreditBalancesResponseData,
|
|
1681
|
+
instanceOfCompanyCreditCompositionResponseData: () => instanceOfCompanyCreditCompositionResponseData,
|
|
1682
|
+
instanceOfCompanyCreditGrantResponseData: () => instanceOfCompanyCreditGrantResponseData,
|
|
1683
|
+
instanceOfCompanyCreditUserUsageResponseData: () => instanceOfCompanyCreditUserUsageResponseData,
|
|
1684
|
+
instanceOfCompanyCreditUserUsageRowResponseData: () => instanceOfCompanyCreditUserUsageRowResponseData,
|
|
1589
1685
|
instanceOfCompanyDiscountResponseData: () => instanceOfCompanyDiscountResponseData,
|
|
1590
1686
|
instanceOfCompanyFeatureUsageListResponseData: () => instanceOfCompanyFeatureUsageListResponseData,
|
|
1591
1687
|
instanceOfCompanyFeatureUsageResponseData: () => instanceOfCompanyFeatureUsageResponseData,
|
|
@@ -1597,18 +1693,24 @@ __export2(models_exports, {
|
|
|
1597
1693
|
instanceOfCompanyUpcomingInvoiceResponseData: () => instanceOfCompanyUpcomingInvoiceResponseData,
|
|
1598
1694
|
instanceOfCompanyUserUsageResponseData: () => instanceOfCompanyUserUsageResponseData,
|
|
1599
1695
|
instanceOfCreateSetupIntentResponse: () => instanceOfCreateSetupIntentResponse,
|
|
1696
|
+
instanceOfCurrency: () => instanceOfCurrency,
|
|
1697
|
+
instanceOfCustomPlanActivationStrategy: () => instanceOfCustomPlanActivationStrategy,
|
|
1600
1698
|
instanceOfDeletePaymentMethodResponse: () => instanceOfDeletePaymentMethodResponse,
|
|
1601
1699
|
instanceOfDeleteResponse: () => instanceOfDeleteResponse,
|
|
1602
1700
|
instanceOfEntitlementPriceBehavior: () => instanceOfEntitlementPriceBehavior,
|
|
1603
1701
|
instanceOfEntitlementType: () => instanceOfEntitlementType,
|
|
1604
1702
|
instanceOfEntitlementValueType: () => instanceOfEntitlementValueType,
|
|
1605
1703
|
instanceOfFeatureType: () => instanceOfFeatureType,
|
|
1704
|
+
instanceOfGetCompanyCreditBalancesResponse: () => instanceOfGetCompanyCreditBalancesResponse,
|
|
1705
|
+
instanceOfGetCompanyCreditUserUsageParams: () => instanceOfGetCompanyCreditUserUsageParams,
|
|
1706
|
+
instanceOfGetCompanyCreditUserUsageResponse: () => instanceOfGetCompanyCreditUserUsageResponse,
|
|
1606
1707
|
instanceOfGetCompanyFeatureUsageResponse: () => instanceOfGetCompanyFeatureUsageResponse,
|
|
1607
1708
|
instanceOfGetCompanyFeatureUserUsageParams: () => instanceOfGetCompanyFeatureUserUsageParams,
|
|
1608
1709
|
instanceOfGetCompanyFeatureUserUsageResponse: () => instanceOfGetCompanyFeatureUserUsageResponse,
|
|
1609
1710
|
instanceOfGetCompanyInvoicesParams: () => instanceOfGetCompanyInvoicesParams,
|
|
1610
1711
|
instanceOfGetCompanyInvoicesResponse: () => instanceOfGetCompanyInvoicesResponse,
|
|
1611
1712
|
instanceOfGetCompanyPaymentMethodsResponse: () => instanceOfGetCompanyPaymentMethodsResponse,
|
|
1713
|
+
instanceOfGetCompanyResponse: () => instanceOfGetCompanyResponse,
|
|
1612
1714
|
instanceOfGetCompanyUpcomingInvoiceResponse: () => instanceOfGetCompanyUpcomingInvoiceResponse,
|
|
1613
1715
|
instanceOfInvoiceStatus: () => instanceOfInvoiceStatus,
|
|
1614
1716
|
instanceOfMetricPeriod: () => instanceOfMetricPeriod,
|
|
@@ -1645,6 +1747,39 @@ function ApiErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1645
1747
|
error: value["error"]
|
|
1646
1748
|
};
|
|
1647
1749
|
}
|
|
1750
|
+
var BillingCreditGrantReason = {
|
|
1751
|
+
Adjustment: "adjustment",
|
|
1752
|
+
BillingCreditAutoTopup: "billing_credit_auto_topup",
|
|
1753
|
+
Free: "free",
|
|
1754
|
+
Plan: "plan",
|
|
1755
|
+
PostpaidForgiven: "postpaid_forgiven",
|
|
1756
|
+
PostpaidOverdraft: "postpaid_overdraft",
|
|
1757
|
+
PostpaidSettlement: "postpaid_settlement",
|
|
1758
|
+
Purchased: "purchased",
|
|
1759
|
+
Rollover: "rollover"
|
|
1760
|
+
};
|
|
1761
|
+
function instanceOfBillingCreditGrantReason(value) {
|
|
1762
|
+
for (const key in BillingCreditGrantReason) {
|
|
1763
|
+
if (Object.prototype.hasOwnProperty.call(BillingCreditGrantReason, key)) {
|
|
1764
|
+
if (BillingCreditGrantReason[key] === value) {
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
return false;
|
|
1770
|
+
}
|
|
1771
|
+
function BillingCreditGrantReasonFromJSON(json) {
|
|
1772
|
+
return BillingCreditGrantReasonFromJSONTyped(json, false);
|
|
1773
|
+
}
|
|
1774
|
+
function BillingCreditGrantReasonFromJSONTyped(json, ignoreDiscriminator) {
|
|
1775
|
+
return json;
|
|
1776
|
+
}
|
|
1777
|
+
function BillingCreditGrantReasonToJSON(value) {
|
|
1778
|
+
return value;
|
|
1779
|
+
}
|
|
1780
|
+
function BillingCreditGrantReasonToJSONTyped(value, ignoreDiscriminator) {
|
|
1781
|
+
return value;
|
|
1782
|
+
}
|
|
1648
1783
|
var BillingPlanCreditGrantResetCadence = {
|
|
1649
1784
|
Daily: "daily",
|
|
1650
1785
|
Every6Months: "every_6_months",
|
|
@@ -1902,6 +2037,164 @@ function CatalogPriceTierResponseDataToJSONTyped(value, ignoreDiscriminator = fa
|
|
|
1902
2037
|
to: value["to"]
|
|
1903
2038
|
};
|
|
1904
2039
|
}
|
|
2040
|
+
var Currency = {
|
|
2041
|
+
Aed: "aed",
|
|
2042
|
+
Afn: "afn",
|
|
2043
|
+
All: "all",
|
|
2044
|
+
Amd: "amd",
|
|
2045
|
+
Ang: "ang",
|
|
2046
|
+
Aoa: "aoa",
|
|
2047
|
+
Ars: "ars",
|
|
2048
|
+
Aud: "aud",
|
|
2049
|
+
Awg: "awg",
|
|
2050
|
+
Azn: "azn",
|
|
2051
|
+
Bam: "bam",
|
|
2052
|
+
Bbd: "bbd",
|
|
2053
|
+
Bdt: "bdt",
|
|
2054
|
+
Bif: "bif",
|
|
2055
|
+
Bmd: "bmd",
|
|
2056
|
+
Bnd: "bnd",
|
|
2057
|
+
Bob: "bob",
|
|
2058
|
+
Brl: "brl",
|
|
2059
|
+
Bsd: "bsd",
|
|
2060
|
+
Bwp: "bwp",
|
|
2061
|
+
Byn: "byn",
|
|
2062
|
+
Bzd: "bzd",
|
|
2063
|
+
Cad: "cad",
|
|
2064
|
+
Cdf: "cdf",
|
|
2065
|
+
Chf: "chf",
|
|
2066
|
+
Clp: "clp",
|
|
2067
|
+
Cny: "cny",
|
|
2068
|
+
Cop: "cop",
|
|
2069
|
+
Crc: "crc",
|
|
2070
|
+
Cve: "cve",
|
|
2071
|
+
Czk: "czk",
|
|
2072
|
+
Djf: "djf",
|
|
2073
|
+
Dkk: "dkk",
|
|
2074
|
+
Dop: "dop",
|
|
2075
|
+
Dzd: "dzd",
|
|
2076
|
+
Egp: "egp",
|
|
2077
|
+
Etb: "etb",
|
|
2078
|
+
Eur: "eur",
|
|
2079
|
+
Fjd: "fjd",
|
|
2080
|
+
Fkp: "fkp",
|
|
2081
|
+
Gbp: "gbp",
|
|
2082
|
+
Gel: "gel",
|
|
2083
|
+
Gip: "gip",
|
|
2084
|
+
Gmd: "gmd",
|
|
2085
|
+
Gnf: "gnf",
|
|
2086
|
+
Gtq: "gtq",
|
|
2087
|
+
Gyd: "gyd",
|
|
2088
|
+
Hkd: "hkd",
|
|
2089
|
+
Hnl: "hnl",
|
|
2090
|
+
Htg: "htg",
|
|
2091
|
+
Huf: "huf",
|
|
2092
|
+
Idr: "idr",
|
|
2093
|
+
Ils: "ils",
|
|
2094
|
+
Inr: "inr",
|
|
2095
|
+
Isk: "isk",
|
|
2096
|
+
Jmd: "jmd",
|
|
2097
|
+
Jpy: "jpy",
|
|
2098
|
+
Kes: "kes",
|
|
2099
|
+
Kgs: "kgs",
|
|
2100
|
+
Khr: "khr",
|
|
2101
|
+
Kmf: "kmf",
|
|
2102
|
+
Krw: "krw",
|
|
2103
|
+
Kyd: "kyd",
|
|
2104
|
+
Kzt: "kzt",
|
|
2105
|
+
Lak: "lak",
|
|
2106
|
+
Lbp: "lbp",
|
|
2107
|
+
Lkr: "lkr",
|
|
2108
|
+
Lrd: "lrd",
|
|
2109
|
+
Lsl: "lsl",
|
|
2110
|
+
Mad: "mad",
|
|
2111
|
+
Mdl: "mdl",
|
|
2112
|
+
Mga: "mga",
|
|
2113
|
+
Mkd: "mkd",
|
|
2114
|
+
Mmk: "mmk",
|
|
2115
|
+
Mnt: "mnt",
|
|
2116
|
+
Mop: "mop",
|
|
2117
|
+
Mur: "mur",
|
|
2118
|
+
Mvr: "mvr",
|
|
2119
|
+
Mwk: "mwk",
|
|
2120
|
+
Mxn: "mxn",
|
|
2121
|
+
Myr: "myr",
|
|
2122
|
+
Mzn: "mzn",
|
|
2123
|
+
Nad: "nad",
|
|
2124
|
+
Ngn: "ngn",
|
|
2125
|
+
Nio: "nio",
|
|
2126
|
+
Nok: "nok",
|
|
2127
|
+
Npr: "npr",
|
|
2128
|
+
Nzd: "nzd",
|
|
2129
|
+
Pab: "pab",
|
|
2130
|
+
Pen: "pen",
|
|
2131
|
+
Pgk: "pgk",
|
|
2132
|
+
Php: "php",
|
|
2133
|
+
Pkr: "pkr",
|
|
2134
|
+
Pln: "pln",
|
|
2135
|
+
Pyg: "pyg",
|
|
2136
|
+
Qar: "qar",
|
|
2137
|
+
Ron: "ron",
|
|
2138
|
+
Rsd: "rsd",
|
|
2139
|
+
Rub: "rub",
|
|
2140
|
+
Rwf: "rwf",
|
|
2141
|
+
Sar: "sar",
|
|
2142
|
+
Sbd: "sbd",
|
|
2143
|
+
Scr: "scr",
|
|
2144
|
+
Sek: "sek",
|
|
2145
|
+
Sgd: "sgd",
|
|
2146
|
+
Shp: "shp",
|
|
2147
|
+
Sle: "sle",
|
|
2148
|
+
Sos: "sos",
|
|
2149
|
+
Srd: "srd",
|
|
2150
|
+
Std: "std",
|
|
2151
|
+
Szl: "szl",
|
|
2152
|
+
Thb: "thb",
|
|
2153
|
+
Tjs: "tjs",
|
|
2154
|
+
Top: "top",
|
|
2155
|
+
Try: "try",
|
|
2156
|
+
Ttd: "ttd",
|
|
2157
|
+
Twd: "twd",
|
|
2158
|
+
Tzs: "tzs",
|
|
2159
|
+
Uah: "uah",
|
|
2160
|
+
Ugx: "ugx",
|
|
2161
|
+
Usd: "usd",
|
|
2162
|
+
Uyu: "uyu",
|
|
2163
|
+
Uzs: "uzs",
|
|
2164
|
+
Vnd: "vnd",
|
|
2165
|
+
Vuv: "vuv",
|
|
2166
|
+
Wst: "wst",
|
|
2167
|
+
Xaf: "xaf",
|
|
2168
|
+
Xcd: "xcd",
|
|
2169
|
+
Xcg: "xcg",
|
|
2170
|
+
Xof: "xof",
|
|
2171
|
+
Xpf: "xpf",
|
|
2172
|
+
Yer: "yer",
|
|
2173
|
+
Zar: "zar",
|
|
2174
|
+
Zmw: "zmw"
|
|
2175
|
+
};
|
|
2176
|
+
function instanceOfCurrency(value) {
|
|
2177
|
+
for (const key in Currency) {
|
|
2178
|
+
if (Object.prototype.hasOwnProperty.call(Currency, key)) {
|
|
2179
|
+
if (Currency[key] === value) {
|
|
2180
|
+
return true;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
return false;
|
|
2185
|
+
}
|
|
2186
|
+
function CurrencyFromJSON2(json) {
|
|
2187
|
+
return CurrencyFromJSONTyped8(json, false);
|
|
2188
|
+
}
|
|
2189
|
+
function CurrencyFromJSONTyped8(json, ignoreDiscriminator) {
|
|
2190
|
+
return json;
|
|
2191
|
+
}
|
|
2192
|
+
function CurrencyToJSON2(value) {
|
|
2193
|
+
return value;
|
|
2194
|
+
}
|
|
2195
|
+
function CurrencyToJSONTyped8(value, ignoreDiscriminator) {
|
|
2196
|
+
return value;
|
|
2197
|
+
}
|
|
1905
2198
|
function instanceOfCatalogPriceResponseData(value) {
|
|
1906
2199
|
if (!("currency" in value) || value["currency"] === void 0) return false;
|
|
1907
2200
|
if (!("id" in value) || value["id"] === void 0) return false;
|
|
@@ -1924,7 +2217,7 @@ function CatalogPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1924
2217
|
return json;
|
|
1925
2218
|
}
|
|
1926
2219
|
return {
|
|
1927
|
-
currency: json["currency"],
|
|
2220
|
+
currency: CurrencyFromJSON2(json["currency"]),
|
|
1928
2221
|
id: json["id"],
|
|
1929
2222
|
interval: BillingProductPriceIntervalFromJSON2(json["interval"]),
|
|
1930
2223
|
intervalCount: json["interval_count"],
|
|
@@ -1947,7 +2240,7 @@ function CatalogPriceResponseDataToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
1947
2240
|
return value;
|
|
1948
2241
|
}
|
|
1949
2242
|
return {
|
|
1950
|
-
currency: value["currency"],
|
|
2243
|
+
currency: CurrencyToJSON2(value["currency"]),
|
|
1951
2244
|
id: value["id"],
|
|
1952
2245
|
interval: BillingProductPriceIntervalToJSON2(value["interval"]),
|
|
1953
2246
|
interval_count: value["intervalCount"],
|
|
@@ -1962,6 +2255,575 @@ function CatalogPriceResponseDataToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
1962
2255
|
tiers_mode: BillingTiersModeToJSON2(value["tiersMode"])
|
|
1963
2256
|
};
|
|
1964
2257
|
}
|
|
2258
|
+
var CustomPlanActivationStrategy = {
|
|
2259
|
+
Payment: "on_payment",
|
|
2260
|
+
Publish: "on_publish"
|
|
2261
|
+
};
|
|
2262
|
+
function instanceOfCustomPlanActivationStrategy(value) {
|
|
2263
|
+
for (const key in CustomPlanActivationStrategy) {
|
|
2264
|
+
if (Object.prototype.hasOwnProperty.call(CustomPlanActivationStrategy, key)) {
|
|
2265
|
+
if (CustomPlanActivationStrategy[key] === value) {
|
|
2266
|
+
return true;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
return false;
|
|
2271
|
+
}
|
|
2272
|
+
function CustomPlanActivationStrategyFromJSON(json) {
|
|
2273
|
+
return CustomPlanActivationStrategyFromJSONTyped(json, false);
|
|
2274
|
+
}
|
|
2275
|
+
function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
|
|
2276
|
+
return json;
|
|
2277
|
+
}
|
|
2278
|
+
function CustomPlanActivationStrategyToJSON(value) {
|
|
2279
|
+
return value;
|
|
2280
|
+
}
|
|
2281
|
+
function CustomPlanActivationStrategyToJSONTyped(value, ignoreDiscriminator) {
|
|
2282
|
+
return value;
|
|
2283
|
+
}
|
|
2284
|
+
function instanceOfCompanyContextCustomPlanBillingResponseData(value) {
|
|
2285
|
+
if (!("activationStrategy" in value) || value["activationStrategy"] === void 0)
|
|
2286
|
+
return false;
|
|
2287
|
+
if (!("dueAt" in value) || value["dueAt"] === void 0) return false;
|
|
2288
|
+
if (!("planId" in value) || value["planId"] === void 0) return false;
|
|
2289
|
+
return true;
|
|
2290
|
+
}
|
|
2291
|
+
function CompanyContextCustomPlanBillingResponseDataFromJSON(json) {
|
|
2292
|
+
return CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, false);
|
|
2293
|
+
}
|
|
2294
|
+
function CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2295
|
+
if (json == null) {
|
|
2296
|
+
return json;
|
|
2297
|
+
}
|
|
2298
|
+
return {
|
|
2299
|
+
activationStrategy: CustomPlanActivationStrategyFromJSON(
|
|
2300
|
+
json["activation_strategy"]
|
|
2301
|
+
),
|
|
2302
|
+
dueAt: new Date(json["due_at"]),
|
|
2303
|
+
invoiceUrl: json["invoice_url"] == null ? void 0 : json["invoice_url"],
|
|
2304
|
+
planId: json["plan_id"],
|
|
2305
|
+
planName: json["plan_name"] == null ? void 0 : json["plan_name"]
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
function CompanyContextCustomPlanBillingResponseDataToJSON(json) {
|
|
2309
|
+
return CompanyContextCustomPlanBillingResponseDataToJSONTyped(json, false);
|
|
2310
|
+
}
|
|
2311
|
+
function CompanyContextCustomPlanBillingResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2312
|
+
if (value == null) {
|
|
2313
|
+
return value;
|
|
2314
|
+
}
|
|
2315
|
+
return {
|
|
2316
|
+
activation_strategy: CustomPlanActivationStrategyToJSON(
|
|
2317
|
+
value["activationStrategy"]
|
|
2318
|
+
),
|
|
2319
|
+
due_at: value["dueAt"].toISOString(),
|
|
2320
|
+
invoice_url: value["invoiceUrl"],
|
|
2321
|
+
plan_id: value["planId"],
|
|
2322
|
+
plan_name: value["planName"]
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
function instanceOfCompanyContextPlanResponseData(value) {
|
|
2326
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2327
|
+
if (!("includedCreditIds" in value) || value["includedCreditIds"] === void 0)
|
|
2328
|
+
return false;
|
|
2329
|
+
if (!("name" in value) || value["name"] === void 0) return false;
|
|
2330
|
+
return true;
|
|
2331
|
+
}
|
|
2332
|
+
function CompanyContextPlanResponseDataFromJSON(json) {
|
|
2333
|
+
return CompanyContextPlanResponseDataFromJSONTyped(json, false);
|
|
2334
|
+
}
|
|
2335
|
+
function CompanyContextPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2336
|
+
if (json == null) {
|
|
2337
|
+
return json;
|
|
2338
|
+
}
|
|
2339
|
+
return {
|
|
2340
|
+
description: json["description"] == null ? void 0 : json["description"],
|
|
2341
|
+
id: json["id"],
|
|
2342
|
+
includedCreditIds: json["included_credit_ids"],
|
|
2343
|
+
name: json["name"],
|
|
2344
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
2345
|
+
price: json["price"] == null ? void 0 : json["price"]
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
function CompanyContextPlanResponseDataToJSON(json) {
|
|
2349
|
+
return CompanyContextPlanResponseDataToJSONTyped(json, false);
|
|
2350
|
+
}
|
|
2351
|
+
function CompanyContextPlanResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2352
|
+
if (value == null) {
|
|
2353
|
+
return value;
|
|
2354
|
+
}
|
|
2355
|
+
return {
|
|
2356
|
+
description: value["description"],
|
|
2357
|
+
id: value["id"],
|
|
2358
|
+
included_credit_ids: value["includedCreditIds"],
|
|
2359
|
+
name: value["name"],
|
|
2360
|
+
period: value["period"],
|
|
2361
|
+
price: value["price"]
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
function instanceOfCompanyContextScheduledDowngradeResponseData(value) {
|
|
2365
|
+
if (!("fromPlanId" in value) || value["fromPlanId"] === void 0)
|
|
2366
|
+
return false;
|
|
2367
|
+
if (!("fromPlanName" in value) || value["fromPlanName"] === void 0)
|
|
2368
|
+
return false;
|
|
2369
|
+
if (!("toPlanId" in value) || value["toPlanId"] === void 0) return false;
|
|
2370
|
+
if (!("toPlanName" in value) || value["toPlanName"] === void 0)
|
|
2371
|
+
return false;
|
|
2372
|
+
return true;
|
|
2373
|
+
}
|
|
2374
|
+
function CompanyContextScheduledDowngradeResponseDataFromJSON(json) {
|
|
2375
|
+
return CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, false);
|
|
2376
|
+
}
|
|
2377
|
+
function CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2378
|
+
if (json == null) {
|
|
2379
|
+
return json;
|
|
2380
|
+
}
|
|
2381
|
+
return {
|
|
2382
|
+
fromPlanId: json["from_plan_id"],
|
|
2383
|
+
fromPlanName: json["from_plan_name"],
|
|
2384
|
+
toPlanId: json["to_plan_id"],
|
|
2385
|
+
toPlanName: json["to_plan_name"]
|
|
2386
|
+
};
|
|
2387
|
+
}
|
|
2388
|
+
function CompanyContextScheduledDowngradeResponseDataToJSON(json) {
|
|
2389
|
+
return CompanyContextScheduledDowngradeResponseDataToJSONTyped(json, false);
|
|
2390
|
+
}
|
|
2391
|
+
function CompanyContextScheduledDowngradeResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2392
|
+
if (value == null) {
|
|
2393
|
+
return value;
|
|
2394
|
+
}
|
|
2395
|
+
return {
|
|
2396
|
+
from_plan_id: value["fromPlanId"],
|
|
2397
|
+
from_plan_name: value["fromPlanName"],
|
|
2398
|
+
to_plan_id: value["toPlanId"],
|
|
2399
|
+
to_plan_name: value["toPlanName"]
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
function instanceOfCompanyContextSubscriptionResponseData(value) {
|
|
2403
|
+
if (!("cancelAtPeriodEnd" in value) || value["cancelAtPeriodEnd"] === void 0)
|
|
2404
|
+
return false;
|
|
2405
|
+
if (!("currency" in value) || value["currency"] === void 0) return false;
|
|
2406
|
+
if (!("status" in value) || value["status"] === void 0) return false;
|
|
2407
|
+
return true;
|
|
2408
|
+
}
|
|
2409
|
+
function CompanyContextSubscriptionResponseDataFromJSON(json) {
|
|
2410
|
+
return CompanyContextSubscriptionResponseDataFromJSONTyped(json, false);
|
|
2411
|
+
}
|
|
2412
|
+
function CompanyContextSubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2413
|
+
if (json == null) {
|
|
2414
|
+
return json;
|
|
2415
|
+
}
|
|
2416
|
+
return {
|
|
2417
|
+
cancelAt: json["cancel_at"] == null ? void 0 : new Date(json["cancel_at"]),
|
|
2418
|
+
cancelAtPeriodEnd: json["cancel_at_period_end"],
|
|
2419
|
+
currency: CurrencyFromJSON2(json["currency"]),
|
|
2420
|
+
nextBillAt: json["next_bill_at"] == null ? void 0 : new Date(json["next_bill_at"]),
|
|
2421
|
+
period: json["period"] == null ? void 0 : json["period"],
|
|
2422
|
+
periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
|
|
2423
|
+
status: json["status"],
|
|
2424
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
function CompanyContextSubscriptionResponseDataToJSON(json) {
|
|
2428
|
+
return CompanyContextSubscriptionResponseDataToJSONTyped(json, false);
|
|
2429
|
+
}
|
|
2430
|
+
function CompanyContextSubscriptionResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2431
|
+
if (value == null) {
|
|
2432
|
+
return value;
|
|
2433
|
+
}
|
|
2434
|
+
return {
|
|
2435
|
+
cancel_at: value["cancelAt"] == null ? void 0 : value["cancelAt"].toISOString(),
|
|
2436
|
+
cancel_at_period_end: value["cancelAtPeriodEnd"],
|
|
2437
|
+
currency: CurrencyToJSON2(value["currency"]),
|
|
2438
|
+
next_bill_at: value["nextBillAt"] == null ? void 0 : value["nextBillAt"].toISOString(),
|
|
2439
|
+
period: value["period"],
|
|
2440
|
+
period_end: value["periodEnd"] == null ? void 0 : value["periodEnd"].toISOString(),
|
|
2441
|
+
status: value["status"],
|
|
2442
|
+
trial_end: value["trialEnd"] == null ? void 0 : value["trialEnd"].toISOString()
|
|
2443
|
+
};
|
|
2444
|
+
}
|
|
2445
|
+
function instanceOfCompanyContextResponseData(value) {
|
|
2446
|
+
if (!("addOns" in value) || value["addOns"] === void 0) return false;
|
|
2447
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2448
|
+
if (!("name" in value) || value["name"] === void 0) return false;
|
|
2449
|
+
return true;
|
|
2450
|
+
}
|
|
2451
|
+
function CompanyContextResponseDataFromJSON(json) {
|
|
2452
|
+
return CompanyContextResponseDataFromJSONTyped(json, false);
|
|
2453
|
+
}
|
|
2454
|
+
function CompanyContextResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2455
|
+
if (json == null) {
|
|
2456
|
+
return json;
|
|
2457
|
+
}
|
|
2458
|
+
return {
|
|
2459
|
+
addOns: json["add_ons"].map(
|
|
2460
|
+
CompanyContextPlanResponseDataFromJSON
|
|
2461
|
+
),
|
|
2462
|
+
customPlanBilling: json["custom_plan_billing"] == null ? void 0 : CompanyContextCustomPlanBillingResponseDataFromJSON(
|
|
2463
|
+
json["custom_plan_billing"]
|
|
2464
|
+
),
|
|
2465
|
+
id: json["id"],
|
|
2466
|
+
name: json["name"],
|
|
2467
|
+
plan: json["plan"] == null ? void 0 : CompanyContextPlanResponseDataFromJSON(json["plan"]),
|
|
2468
|
+
scheduledDowngrade: json["scheduled_downgrade"] == null ? void 0 : CompanyContextScheduledDowngradeResponseDataFromJSON(
|
|
2469
|
+
json["scheduled_downgrade"]
|
|
2470
|
+
),
|
|
2471
|
+
subscription: json["subscription"] == null ? void 0 : CompanyContextSubscriptionResponseDataFromJSON(json["subscription"])
|
|
2472
|
+
};
|
|
2473
|
+
}
|
|
2474
|
+
function CompanyContextResponseDataToJSON(json) {
|
|
2475
|
+
return CompanyContextResponseDataToJSONTyped(json, false);
|
|
2476
|
+
}
|
|
2477
|
+
function CompanyContextResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2478
|
+
if (value == null) {
|
|
2479
|
+
return value;
|
|
2480
|
+
}
|
|
2481
|
+
return {
|
|
2482
|
+
add_ons: value["addOns"].map(
|
|
2483
|
+
CompanyContextPlanResponseDataToJSON
|
|
2484
|
+
),
|
|
2485
|
+
custom_plan_billing: CompanyContextCustomPlanBillingResponseDataToJSON(
|
|
2486
|
+
value["customPlanBilling"]
|
|
2487
|
+
),
|
|
2488
|
+
id: value["id"],
|
|
2489
|
+
name: value["name"],
|
|
2490
|
+
plan: CompanyContextPlanResponseDataToJSON(value["plan"]),
|
|
2491
|
+
scheduled_downgrade: CompanyContextScheduledDowngradeResponseDataToJSON(
|
|
2492
|
+
value["scheduledDowngrade"]
|
|
2493
|
+
),
|
|
2494
|
+
subscription: CompanyContextSubscriptionResponseDataToJSON(
|
|
2495
|
+
value["subscription"]
|
|
2496
|
+
)
|
|
2497
|
+
};
|
|
2498
|
+
}
|
|
2499
|
+
function instanceOfCompanyCreditAutoTopupResponseData(value) {
|
|
2500
|
+
if (!("enabled" in value) || value["enabled"] === void 0) return false;
|
|
2501
|
+
if (!("selfService" in value) || value["selfService"] === void 0)
|
|
2502
|
+
return false;
|
|
2503
|
+
return true;
|
|
2504
|
+
}
|
|
2505
|
+
function CompanyCreditAutoTopupResponseDataFromJSON(json) {
|
|
2506
|
+
return CompanyCreditAutoTopupResponseDataFromJSONTyped(json, false);
|
|
2507
|
+
}
|
|
2508
|
+
function CompanyCreditAutoTopupResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2509
|
+
if (json == null) {
|
|
2510
|
+
return json;
|
|
2511
|
+
}
|
|
2512
|
+
return {
|
|
2513
|
+
amount: json["amount"] == null ? void 0 : json["amount"],
|
|
2514
|
+
enabled: json["enabled"],
|
|
2515
|
+
selfService: json["self_service"],
|
|
2516
|
+
thresholdCredits: json["threshold_credits"] == null ? void 0 : json["threshold_credits"]
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
function CompanyCreditAutoTopupResponseDataToJSON(json) {
|
|
2520
|
+
return CompanyCreditAutoTopupResponseDataToJSONTyped(json, false);
|
|
2521
|
+
}
|
|
2522
|
+
function CompanyCreditAutoTopupResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2523
|
+
if (value == null) {
|
|
2524
|
+
return value;
|
|
2525
|
+
}
|
|
2526
|
+
return {
|
|
2527
|
+
amount: value["amount"],
|
|
2528
|
+
enabled: value["enabled"],
|
|
2529
|
+
self_service: value["selfService"],
|
|
2530
|
+
threshold_credits: value["thresholdCredits"]
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
function instanceOfCompanyCreditGrantResponseData(value) {
|
|
2534
|
+
if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
|
|
2535
|
+
if (!("grantReason" in value) || value["grantReason"] === void 0)
|
|
2536
|
+
return false;
|
|
2537
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2538
|
+
if (!("quantity" in value) || value["quantity"] === void 0) return false;
|
|
2539
|
+
if (!("quantityRemaining" in value) || value["quantityRemaining"] === void 0)
|
|
2540
|
+
return false;
|
|
2541
|
+
if (!("quantityUsed" in value) || value["quantityUsed"] === void 0)
|
|
2542
|
+
return false;
|
|
2543
|
+
return true;
|
|
2544
|
+
}
|
|
2545
|
+
function CompanyCreditGrantResponseDataFromJSON(json) {
|
|
2546
|
+
return CompanyCreditGrantResponseDataFromJSONTyped(json, false);
|
|
2547
|
+
}
|
|
2548
|
+
function CompanyCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2549
|
+
if (json == null) {
|
|
2550
|
+
return json;
|
|
2551
|
+
}
|
|
2552
|
+
return {
|
|
2553
|
+
bundleId: json["bundle_id"] == null ? void 0 : json["bundle_id"],
|
|
2554
|
+
bundleName: json["bundle_name"] == null ? void 0 : json["bundle_name"],
|
|
2555
|
+
createdAt: new Date(json["created_at"]),
|
|
2556
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
2557
|
+
grantReason: BillingCreditGrantReasonFromJSON(json["grant_reason"]),
|
|
2558
|
+
id: json["id"],
|
|
2559
|
+
planId: json["plan_id"] == null ? void 0 : json["plan_id"],
|
|
2560
|
+
planName: json["plan_name"] == null ? void 0 : json["plan_name"],
|
|
2561
|
+
quantity: json["quantity"],
|
|
2562
|
+
quantityRemaining: json["quantity_remaining"],
|
|
2563
|
+
quantityUsed: json["quantity_used"],
|
|
2564
|
+
renewalPeriod: json["renewal_period"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON2(json["renewal_period"]),
|
|
2565
|
+
resetsAt: json["resets_at"] == null ? void 0 : new Date(json["resets_at"]),
|
|
2566
|
+
validFrom: json["valid_from"] == null ? void 0 : new Date(json["valid_from"])
|
|
2567
|
+
};
|
|
2568
|
+
}
|
|
2569
|
+
function CompanyCreditGrantResponseDataToJSON(json) {
|
|
2570
|
+
return CompanyCreditGrantResponseDataToJSONTyped(json, false);
|
|
2571
|
+
}
|
|
2572
|
+
function CompanyCreditGrantResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2573
|
+
if (value == null) {
|
|
2574
|
+
return value;
|
|
2575
|
+
}
|
|
2576
|
+
return {
|
|
2577
|
+
bundle_id: value["bundleId"],
|
|
2578
|
+
bundle_name: value["bundleName"],
|
|
2579
|
+
created_at: value["createdAt"].toISOString(),
|
|
2580
|
+
expires_at: value["expiresAt"] == null ? void 0 : value["expiresAt"].toISOString(),
|
|
2581
|
+
grant_reason: BillingCreditGrantReasonToJSON(value["grantReason"]),
|
|
2582
|
+
id: value["id"],
|
|
2583
|
+
plan_id: value["planId"],
|
|
2584
|
+
plan_name: value["planName"],
|
|
2585
|
+
quantity: value["quantity"],
|
|
2586
|
+
quantity_remaining: value["quantityRemaining"],
|
|
2587
|
+
quantity_used: value["quantityUsed"],
|
|
2588
|
+
renewal_period: BillingPlanCreditGrantResetCadenceToJSON2(
|
|
2589
|
+
value["renewalPeriod"]
|
|
2590
|
+
),
|
|
2591
|
+
resets_at: value["resetsAt"] == null ? void 0 : value["resetsAt"].toISOString(),
|
|
2592
|
+
valid_from: value["validFrom"] == null ? void 0 : value["validFrom"].toISOString()
|
|
2593
|
+
};
|
|
2594
|
+
}
|
|
2595
|
+
function instanceOfCompanyCreditCompositionResponseData(value) {
|
|
2596
|
+
if (!("fixedQuantity" in value) || value["fixedQuantity"] === void 0)
|
|
2597
|
+
return false;
|
|
2598
|
+
if (!("licenseName" in value) || value["licenseName"] === void 0)
|
|
2599
|
+
return false;
|
|
2600
|
+
if (!("licenseQuantity" in value) || value["licenseQuantity"] === void 0)
|
|
2601
|
+
return false;
|
|
2602
|
+
if (!("perLicenseAmount" in value) || value["perLicenseAmount"] === void 0)
|
|
2603
|
+
return false;
|
|
2604
|
+
if (!("period" in value) || value["period"] === void 0) return false;
|
|
2605
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2606
|
+
return true;
|
|
2607
|
+
}
|
|
2608
|
+
function CompanyCreditCompositionResponseDataFromJSON(json) {
|
|
2609
|
+
return CompanyCreditCompositionResponseDataFromJSONTyped(json, false);
|
|
2610
|
+
}
|
|
2611
|
+
function CompanyCreditCompositionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2612
|
+
if (json == null) {
|
|
2613
|
+
return json;
|
|
2614
|
+
}
|
|
2615
|
+
return {
|
|
2616
|
+
fixedQuantity: json["fixed_quantity"],
|
|
2617
|
+
licenseId: json["license_id"] == null ? void 0 : json["license_id"],
|
|
2618
|
+
licenseName: json["license_name"],
|
|
2619
|
+
licensePluralName: json["license_plural_name"] == null ? void 0 : json["license_plural_name"],
|
|
2620
|
+
licenseQuantity: json["license_quantity"],
|
|
2621
|
+
licenseSingularName: json["license_singular_name"] == null ? void 0 : json["license_singular_name"],
|
|
2622
|
+
perLicenseAmount: json["per_license_amount"],
|
|
2623
|
+
period: json["period"],
|
|
2624
|
+
renewsAt: json["renews_at"] == null ? void 0 : new Date(json["renews_at"]),
|
|
2625
|
+
total: json["total"]
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
function CompanyCreditCompositionResponseDataToJSON(json) {
|
|
2629
|
+
return CompanyCreditCompositionResponseDataToJSONTyped(json, false);
|
|
2630
|
+
}
|
|
2631
|
+
function CompanyCreditCompositionResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2632
|
+
if (value == null) {
|
|
2633
|
+
return value;
|
|
2634
|
+
}
|
|
2635
|
+
return {
|
|
2636
|
+
fixed_quantity: value["fixedQuantity"],
|
|
2637
|
+
license_id: value["licenseId"],
|
|
2638
|
+
license_name: value["licenseName"],
|
|
2639
|
+
license_plural_name: value["licensePluralName"],
|
|
2640
|
+
license_quantity: value["licenseQuantity"],
|
|
2641
|
+
license_singular_name: value["licenseSingularName"],
|
|
2642
|
+
per_license_amount: value["perLicenseAmount"],
|
|
2643
|
+
period: value["period"],
|
|
2644
|
+
renews_at: value["renewsAt"] == null ? void 0 : value["renewsAt"].toISOString(),
|
|
2645
|
+
total: value["total"]
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
function instanceOfCompanyCreditBalanceResponseData(value) {
|
|
2649
|
+
if (!("creditDescription" in value) || value["creditDescription"] === void 0)
|
|
2650
|
+
return false;
|
|
2651
|
+
if (!("creditId" in value) || value["creditId"] === void 0) return false;
|
|
2652
|
+
if (!("creditName" in value) || value["creditName"] === void 0)
|
|
2653
|
+
return false;
|
|
2654
|
+
if (!("grants" in value) || value["grants"] === void 0) return false;
|
|
2655
|
+
if (!("purchasable" in value) || value["purchasable"] === void 0)
|
|
2656
|
+
return false;
|
|
2657
|
+
if (!("remaining" in value) || value["remaining"] === void 0) return false;
|
|
2658
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2659
|
+
if (!("used" in value) || value["used"] === void 0) return false;
|
|
2660
|
+
return true;
|
|
2661
|
+
}
|
|
2662
|
+
function CompanyCreditBalanceResponseDataFromJSON(json) {
|
|
2663
|
+
return CompanyCreditBalanceResponseDataFromJSONTyped(json, false);
|
|
2664
|
+
}
|
|
2665
|
+
function CompanyCreditBalanceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2666
|
+
if (json == null) {
|
|
2667
|
+
return json;
|
|
2668
|
+
}
|
|
2669
|
+
return {
|
|
2670
|
+
autoTopup: json["auto_topup"] == null ? void 0 : CompanyCreditAutoTopupResponseDataFromJSON(json["auto_topup"]),
|
|
2671
|
+
composition: json["composition"] == null ? void 0 : CompanyCreditCompositionResponseDataFromJSON(json["composition"]),
|
|
2672
|
+
creditDescription: json["credit_description"],
|
|
2673
|
+
creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
|
|
2674
|
+
creditId: json["credit_id"],
|
|
2675
|
+
creditName: json["credit_name"],
|
|
2676
|
+
creditPluralName: json["credit_plural_name"] == null ? void 0 : json["credit_plural_name"],
|
|
2677
|
+
creditSingularName: json["credit_singular_name"] == null ? void 0 : json["credit_singular_name"],
|
|
2678
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
2679
|
+
grants: json["grants"].map(
|
|
2680
|
+
CompanyCreditGrantResponseDataFromJSON
|
|
2681
|
+
),
|
|
2682
|
+
purchasable: json["purchasable"],
|
|
2683
|
+
remaining: json["remaining"],
|
|
2684
|
+
resetsAt: json["resets_at"] == null ? void 0 : new Date(json["resets_at"]),
|
|
2685
|
+
total: json["total"],
|
|
2686
|
+
used: json["used"]
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
function CompanyCreditBalanceResponseDataToJSON(json) {
|
|
2690
|
+
return CompanyCreditBalanceResponseDataToJSONTyped(json, false);
|
|
2691
|
+
}
|
|
2692
|
+
function CompanyCreditBalanceResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2693
|
+
if (value == null) {
|
|
2694
|
+
return value;
|
|
2695
|
+
}
|
|
2696
|
+
return {
|
|
2697
|
+
auto_topup: CompanyCreditAutoTopupResponseDataToJSON(value["autoTopup"]),
|
|
2698
|
+
composition: CompanyCreditCompositionResponseDataToJSON(
|
|
2699
|
+
value["composition"]
|
|
2700
|
+
),
|
|
2701
|
+
credit_description: value["creditDescription"],
|
|
2702
|
+
credit_icon: value["creditIcon"],
|
|
2703
|
+
credit_id: value["creditId"],
|
|
2704
|
+
credit_name: value["creditName"],
|
|
2705
|
+
credit_plural_name: value["creditPluralName"],
|
|
2706
|
+
credit_singular_name: value["creditSingularName"],
|
|
2707
|
+
expires_at: value["expiresAt"] == null ? void 0 : value["expiresAt"].toISOString(),
|
|
2708
|
+
grants: value["grants"].map(
|
|
2709
|
+
CompanyCreditGrantResponseDataToJSON
|
|
2710
|
+
),
|
|
2711
|
+
purchasable: value["purchasable"],
|
|
2712
|
+
remaining: value["remaining"],
|
|
2713
|
+
resets_at: value["resetsAt"] == null ? void 0 : value["resetsAt"].toISOString(),
|
|
2714
|
+
total: value["total"],
|
|
2715
|
+
used: value["used"]
|
|
2716
|
+
};
|
|
2717
|
+
}
|
|
2718
|
+
function instanceOfCompanyCreditBalancesResponseData(value) {
|
|
2719
|
+
if (!("balances" in value) || value["balances"] === void 0) return false;
|
|
2720
|
+
if (!("count" in value) || value["count"] === void 0) return false;
|
|
2721
|
+
return true;
|
|
2722
|
+
}
|
|
2723
|
+
function CompanyCreditBalancesResponseDataFromJSON(json) {
|
|
2724
|
+
return CompanyCreditBalancesResponseDataFromJSONTyped(json, false);
|
|
2725
|
+
}
|
|
2726
|
+
function CompanyCreditBalancesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2727
|
+
if (json == null) {
|
|
2728
|
+
return json;
|
|
2729
|
+
}
|
|
2730
|
+
return {
|
|
2731
|
+
balances: json["balances"].map(
|
|
2732
|
+
CompanyCreditBalanceResponseDataFromJSON
|
|
2733
|
+
),
|
|
2734
|
+
count: json["count"]
|
|
2735
|
+
};
|
|
2736
|
+
}
|
|
2737
|
+
function CompanyCreditBalancesResponseDataToJSON(json) {
|
|
2738
|
+
return CompanyCreditBalancesResponseDataToJSONTyped(json, false);
|
|
2739
|
+
}
|
|
2740
|
+
function CompanyCreditBalancesResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2741
|
+
if (value == null) {
|
|
2742
|
+
return value;
|
|
2743
|
+
}
|
|
2744
|
+
return {
|
|
2745
|
+
balances: value["balances"].map(
|
|
2746
|
+
CompanyCreditBalanceResponseDataToJSON
|
|
2747
|
+
),
|
|
2748
|
+
count: value["count"]
|
|
2749
|
+
};
|
|
2750
|
+
}
|
|
2751
|
+
function instanceOfCompanyCreditUserUsageRowResponseData(value) {
|
|
2752
|
+
if (!("share" in value) || value["share"] === void 0) return false;
|
|
2753
|
+
if (!("used" in value) || value["used"] === void 0) return false;
|
|
2754
|
+
if (!("userId" in value) || value["userId"] === void 0) return false;
|
|
2755
|
+
return true;
|
|
2756
|
+
}
|
|
2757
|
+
function CompanyCreditUserUsageRowResponseDataFromJSON(json) {
|
|
2758
|
+
return CompanyCreditUserUsageRowResponseDataFromJSONTyped(json, false);
|
|
2759
|
+
}
|
|
2760
|
+
function CompanyCreditUserUsageRowResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2761
|
+
if (json == null) {
|
|
2762
|
+
return json;
|
|
2763
|
+
}
|
|
2764
|
+
return {
|
|
2765
|
+
name: json["name"] == null ? void 0 : json["name"],
|
|
2766
|
+
share: json["share"],
|
|
2767
|
+
used: json["used"],
|
|
2768
|
+
userId: json["user_id"]
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
function CompanyCreditUserUsageRowResponseDataToJSON(json) {
|
|
2772
|
+
return CompanyCreditUserUsageRowResponseDataToJSONTyped(json, false);
|
|
2773
|
+
}
|
|
2774
|
+
function CompanyCreditUserUsageRowResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2775
|
+
if (value == null) {
|
|
2776
|
+
return value;
|
|
2777
|
+
}
|
|
2778
|
+
return {
|
|
2779
|
+
name: value["name"],
|
|
2780
|
+
share: value["share"],
|
|
2781
|
+
used: value["used"],
|
|
2782
|
+
user_id: value["userId"]
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2785
|
+
function instanceOfCompanyCreditUserUsageResponseData(value) {
|
|
2786
|
+
if (!("count" in value) || value["count"] === void 0) return false;
|
|
2787
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2788
|
+
if (!("users" in value) || value["users"] === void 0) return false;
|
|
2789
|
+
return true;
|
|
2790
|
+
}
|
|
2791
|
+
function CompanyCreditUserUsageResponseDataFromJSON(json) {
|
|
2792
|
+
return CompanyCreditUserUsageResponseDataFromJSONTyped(json, false);
|
|
2793
|
+
}
|
|
2794
|
+
function CompanyCreditUserUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2795
|
+
if (json == null) {
|
|
2796
|
+
return json;
|
|
2797
|
+
}
|
|
2798
|
+
return {
|
|
2799
|
+
count: json["count"],
|
|
2800
|
+
endTime: json["end_time"] == null ? void 0 : new Date(json["end_time"]),
|
|
2801
|
+
startTime: json["start_time"] == null ? void 0 : new Date(json["start_time"]),
|
|
2802
|
+
total: json["total"],
|
|
2803
|
+
unattributed: json["unattributed"] == null ? void 0 : json["unattributed"],
|
|
2804
|
+
users: json["users"].map(
|
|
2805
|
+
CompanyCreditUserUsageRowResponseDataFromJSON
|
|
2806
|
+
)
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
function CompanyCreditUserUsageResponseDataToJSON(json) {
|
|
2810
|
+
return CompanyCreditUserUsageResponseDataToJSONTyped(json, false);
|
|
2811
|
+
}
|
|
2812
|
+
function CompanyCreditUserUsageResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2813
|
+
if (value == null) {
|
|
2814
|
+
return value;
|
|
2815
|
+
}
|
|
2816
|
+
return {
|
|
2817
|
+
count: value["count"],
|
|
2818
|
+
end_time: value["endTime"] == null ? void 0 : value["endTime"].toISOString(),
|
|
2819
|
+
start_time: value["startTime"] == null ? void 0 : value["startTime"].toISOString(),
|
|
2820
|
+
total: value["total"],
|
|
2821
|
+
unattributed: value["unattributed"],
|
|
2822
|
+
users: value["users"].map(
|
|
2823
|
+
CompanyCreditUserUsageRowResponseDataToJSON
|
|
2824
|
+
)
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
1965
2827
|
function instanceOfCompanyDiscountResponseData(value) {
|
|
1966
2828
|
if (!("couponName" in value) || value["couponName"] === void 0)
|
|
1967
2829
|
return false;
|
|
@@ -1978,7 +2840,7 @@ function CompanyDiscountResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1978
2840
|
return {
|
|
1979
2841
|
amountOff: json["amount_off"] == null ? void 0 : json["amount_off"],
|
|
1980
2842
|
couponName: json["coupon_name"],
|
|
1981
|
-
currency: json["currency"] == null ? void 0 : json["currency"],
|
|
2843
|
+
currency: json["currency"] == null ? void 0 : CurrencyFromJSON2(json["currency"]),
|
|
1982
2844
|
customerFacingCode: json["customer_facing_code"] == null ? void 0 : json["customer_facing_code"],
|
|
1983
2845
|
duration: json["duration"],
|
|
1984
2846
|
durationInMonths: json["duration_in_months"] == null ? void 0 : json["duration_in_months"],
|
|
@@ -1995,7 +2857,7 @@ function CompanyDiscountResponseDataToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
1995
2857
|
return {
|
|
1996
2858
|
amount_off: value["amountOff"],
|
|
1997
2859
|
coupon_name: value["couponName"],
|
|
1998
|
-
currency: value["currency"],
|
|
2860
|
+
currency: CurrencyToJSON2(value["currency"]),
|
|
1999
2861
|
customer_facing_code: value["customerFacingCode"],
|
|
2000
2862
|
duration: value["duration"],
|
|
2001
2863
|
duration_in_months: value["durationInMonths"],
|
|
@@ -2436,7 +3298,7 @@ function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
2436
3298
|
return {
|
|
2437
3299
|
amountDue: json["amount_due"],
|
|
2438
3300
|
createdAt: new Date(json["created_at"]),
|
|
2439
|
-
currency: json["currency"],
|
|
3301
|
+
currency: CurrencyFromJSON2(json["currency"]),
|
|
2440
3302
|
dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
|
|
2441
3303
|
id: json["id"],
|
|
2442
3304
|
status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
|
|
@@ -2453,7 +3315,7 @@ function CompanyInvoiceResponseDataToJSONTyped(value, ignoreDiscriminator = fals
|
|
|
2453
3315
|
return {
|
|
2454
3316
|
amount_due: value["amountDue"],
|
|
2455
3317
|
created_at: value["createdAt"].toISOString(),
|
|
2456
|
-
currency: value["currency"],
|
|
3318
|
+
currency: CurrencyToJSON2(value["currency"]),
|
|
2457
3319
|
due_date: value["dueDate"] == null ? void 0 : value["dueDate"].toISOString(),
|
|
2458
3320
|
id: value["id"],
|
|
2459
3321
|
status: InvoiceStatusToJSON(value["status"]),
|
|
@@ -2604,7 +3466,7 @@ function CompanyUpcomingInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminat
|
|
|
2604
3466
|
}
|
|
2605
3467
|
return {
|
|
2606
3468
|
amountDue: json["amount_due"],
|
|
2607
|
-
currency: json["currency"],
|
|
3469
|
+
currency: CurrencyFromJSON2(json["currency"]),
|
|
2608
3470
|
customerBalanceApplied: json["customer_balance_applied"],
|
|
2609
3471
|
customerBalanceRemaining: json["customer_balance_remaining"],
|
|
2610
3472
|
discounts: json["discounts"].map(
|
|
@@ -2623,7 +3485,7 @@ function CompanyUpcomingInvoiceResponseDataToJSONTyped(value, ignoreDiscriminato
|
|
|
2623
3485
|
}
|
|
2624
3486
|
return {
|
|
2625
3487
|
amount_due: value["amountDue"],
|
|
2626
|
-
currency: value["currency"],
|
|
3488
|
+
currency: CurrencyToJSON2(value["currency"]),
|
|
2627
3489
|
customer_balance_applied: value["customerBalanceApplied"],
|
|
2628
3490
|
customer_balance_remaining: value["customerBalanceRemaining"],
|
|
2629
3491
|
discounts: value["discounts"].map(
|
|
@@ -2749,6 +3611,91 @@ function DeletePaymentMethodResponseToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
2749
3611
|
params: value["params"]
|
|
2750
3612
|
};
|
|
2751
3613
|
}
|
|
3614
|
+
function instanceOfGetCompanyCreditBalancesResponse(value) {
|
|
3615
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
3616
|
+
if (!("params" in value) || value["params"] === void 0) return false;
|
|
3617
|
+
return true;
|
|
3618
|
+
}
|
|
3619
|
+
function GetCompanyCreditBalancesResponseFromJSON(json) {
|
|
3620
|
+
return GetCompanyCreditBalancesResponseFromJSONTyped(json, false);
|
|
3621
|
+
}
|
|
3622
|
+
function GetCompanyCreditBalancesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
3623
|
+
if (json == null) {
|
|
3624
|
+
return json;
|
|
3625
|
+
}
|
|
3626
|
+
return {
|
|
3627
|
+
data: CompanyCreditBalancesResponseDataFromJSON(json["data"]),
|
|
3628
|
+
params: json["params"]
|
|
3629
|
+
};
|
|
3630
|
+
}
|
|
3631
|
+
function GetCompanyCreditBalancesResponseToJSON(json) {
|
|
3632
|
+
return GetCompanyCreditBalancesResponseToJSONTyped(json, false);
|
|
3633
|
+
}
|
|
3634
|
+
function GetCompanyCreditBalancesResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3635
|
+
if (value == null) {
|
|
3636
|
+
return value;
|
|
3637
|
+
}
|
|
3638
|
+
return {
|
|
3639
|
+
data: CompanyCreditBalancesResponseDataToJSON(value["data"]),
|
|
3640
|
+
params: value["params"]
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
function instanceOfGetCompanyCreditUserUsageParams(value) {
|
|
3644
|
+
return true;
|
|
3645
|
+
}
|
|
3646
|
+
function GetCompanyCreditUserUsageParamsFromJSON(json) {
|
|
3647
|
+
return GetCompanyCreditUserUsageParamsFromJSONTyped(json, false);
|
|
3648
|
+
}
|
|
3649
|
+
function GetCompanyCreditUserUsageParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
3650
|
+
if (json == null) {
|
|
3651
|
+
return json;
|
|
3652
|
+
}
|
|
3653
|
+
return {
|
|
3654
|
+
limit: json["limit"] == null ? void 0 : json["limit"],
|
|
3655
|
+
offset: json["offset"] == null ? void 0 : json["offset"]
|
|
3656
|
+
};
|
|
3657
|
+
}
|
|
3658
|
+
function GetCompanyCreditUserUsageParamsToJSON(json) {
|
|
3659
|
+
return GetCompanyCreditUserUsageParamsToJSONTyped(json, false);
|
|
3660
|
+
}
|
|
3661
|
+
function GetCompanyCreditUserUsageParamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3662
|
+
if (value == null) {
|
|
3663
|
+
return value;
|
|
3664
|
+
}
|
|
3665
|
+
return {
|
|
3666
|
+
limit: value["limit"],
|
|
3667
|
+
offset: value["offset"]
|
|
3668
|
+
};
|
|
3669
|
+
}
|
|
3670
|
+
function instanceOfGetCompanyCreditUserUsageResponse(value) {
|
|
3671
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
3672
|
+
if (!("params" in value) || value["params"] === void 0) return false;
|
|
3673
|
+
return true;
|
|
3674
|
+
}
|
|
3675
|
+
function GetCompanyCreditUserUsageResponseFromJSON(json) {
|
|
3676
|
+
return GetCompanyCreditUserUsageResponseFromJSONTyped(json, false);
|
|
3677
|
+
}
|
|
3678
|
+
function GetCompanyCreditUserUsageResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
3679
|
+
if (json == null) {
|
|
3680
|
+
return json;
|
|
3681
|
+
}
|
|
3682
|
+
return {
|
|
3683
|
+
data: CompanyCreditUserUsageResponseDataFromJSON(json["data"]),
|
|
3684
|
+
params: GetCompanyCreditUserUsageParamsFromJSON(json["params"])
|
|
3685
|
+
};
|
|
3686
|
+
}
|
|
3687
|
+
function GetCompanyCreditUserUsageResponseToJSON(json) {
|
|
3688
|
+
return GetCompanyCreditUserUsageResponseToJSONTyped(json, false);
|
|
3689
|
+
}
|
|
3690
|
+
function GetCompanyCreditUserUsageResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3691
|
+
if (value == null) {
|
|
3692
|
+
return value;
|
|
3693
|
+
}
|
|
3694
|
+
return {
|
|
3695
|
+
data: CompanyCreditUserUsageResponseDataToJSON(value["data"]),
|
|
3696
|
+
params: GetCompanyCreditUserUsageParamsToJSON(value["params"])
|
|
3697
|
+
};
|
|
3698
|
+
}
|
|
2752
3699
|
function instanceOfGetCompanyFeatureUsageResponse(value) {
|
|
2753
3700
|
if (!("data" in value) || value["data"] === void 0) return false;
|
|
2754
3701
|
if (!("params" in value) || value["params"] === void 0) return false;
|
|
@@ -2921,6 +3868,35 @@ function GetCompanyPaymentMethodsResponseToJSONTyped(value, ignoreDiscriminator
|
|
|
2921
3868
|
params: value["params"]
|
|
2922
3869
|
};
|
|
2923
3870
|
}
|
|
3871
|
+
function instanceOfGetCompanyResponse(value) {
|
|
3872
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
3873
|
+
if (!("params" in value) || value["params"] === void 0) return false;
|
|
3874
|
+
return true;
|
|
3875
|
+
}
|
|
3876
|
+
function GetCompanyResponseFromJSON(json) {
|
|
3877
|
+
return GetCompanyResponseFromJSONTyped(json, false);
|
|
3878
|
+
}
|
|
3879
|
+
function GetCompanyResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
3880
|
+
if (json == null) {
|
|
3881
|
+
return json;
|
|
3882
|
+
}
|
|
3883
|
+
return {
|
|
3884
|
+
data: CompanyContextResponseDataFromJSON(json["data"]),
|
|
3885
|
+
params: json["params"]
|
|
3886
|
+
};
|
|
3887
|
+
}
|
|
3888
|
+
function GetCompanyResponseToJSON(json) {
|
|
3889
|
+
return GetCompanyResponseToJSONTyped(json, false);
|
|
3890
|
+
}
|
|
3891
|
+
function GetCompanyResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3892
|
+
if (value == null) {
|
|
3893
|
+
return value;
|
|
3894
|
+
}
|
|
3895
|
+
return {
|
|
3896
|
+
data: CompanyContextResponseDataToJSON(value["data"]),
|
|
3897
|
+
params: value["params"]
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
2924
3900
|
function instanceOfGetCompanyUpcomingInvoiceResponse(value) {
|
|
2925
3901
|
if (!("data" in value) || value["data"] === void 0) return false;
|
|
2926
3902
|
if (!("params" in value) || value["params"] === void 0) return false;
|
|
@@ -3448,6 +4424,45 @@ var SchematicBillingClient = class {
|
|
|
3448
4424
|
return GetCompanyFeatureUsageResponseFromJSON(body).data.features;
|
|
3449
4425
|
});
|
|
3450
4426
|
}
|
|
4427
|
+
fetchCompany() {
|
|
4428
|
+
const path = "/company";
|
|
4429
|
+
return this.session.request(path).then((body) => {
|
|
4430
|
+
if (body === null || typeof body !== "object" || !("data" in body) || body.data == null) {
|
|
4431
|
+
throw new Error(`Malformed response from ${path}`);
|
|
4432
|
+
}
|
|
4433
|
+
return GetCompanyResponseFromJSON(body).data;
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4436
|
+
fetchCreditBalances() {
|
|
4437
|
+
const path = "/company/credits";
|
|
4438
|
+
return this.session.request(path).then((body) => {
|
|
4439
|
+
if (body === null || typeof body !== "object" || !("data" in body)) {
|
|
4440
|
+
throw new Error(`Malformed response from ${path}`);
|
|
4441
|
+
}
|
|
4442
|
+
const data = body.data;
|
|
4443
|
+
if (data == null || data.balances == null) {
|
|
4444
|
+
return [];
|
|
4445
|
+
}
|
|
4446
|
+
return GetCompanyCreditBalancesResponseFromJSON(body).data.balances;
|
|
4447
|
+
});
|
|
4448
|
+
}
|
|
4449
|
+
fetchCreditUserUsage(params) {
|
|
4450
|
+
const query = new URLSearchParams();
|
|
4451
|
+
if (params.limit !== void 0) {
|
|
4452
|
+
query.set("limit", String(params.limit));
|
|
4453
|
+
}
|
|
4454
|
+
if (params.offset !== void 0) {
|
|
4455
|
+
query.set("offset", String(params.offset));
|
|
4456
|
+
}
|
|
4457
|
+
const search = query.toString();
|
|
4458
|
+
const path = `/company/credits/${encodeURIComponent(params.creditId)}/users${search === "" ? "" : `?${search}`}`;
|
|
4459
|
+
return this.session.request(path).then((body) => {
|
|
4460
|
+
if (body === null || typeof body !== "object" || !("data" in body)) {
|
|
4461
|
+
throw new Error(`Malformed response from ${path}`);
|
|
4462
|
+
}
|
|
4463
|
+
return GetCompanyCreditUserUsageResponseFromJSON(body).data;
|
|
4464
|
+
});
|
|
4465
|
+
}
|
|
3451
4466
|
fetchFeatureUserUsage(params) {
|
|
3452
4467
|
const query = new URLSearchParams();
|
|
3453
4468
|
if (params.limit !== void 0) {
|
|
@@ -5738,6 +6753,20 @@ var BillingStore = class {
|
|
|
5738
6753
|
}),
|
|
5739
6754
|
{ readiness }
|
|
5740
6755
|
);
|
|
6756
|
+
this.creditBalances = new KeyedResource(
|
|
6757
|
+
() => this._client.fetchCreditBalances(),
|
|
6758
|
+
{ readiness }
|
|
6759
|
+
);
|
|
6760
|
+
this.company = new KeyedResource(() => this._client.fetchCompany(), {
|
|
6761
|
+
readiness
|
|
6762
|
+
});
|
|
6763
|
+
this.creditUserUsage = new KeyedResource(
|
|
6764
|
+
({ creditId }) => this._client.fetchCreditUserUsage({
|
|
6765
|
+
creditId,
|
|
6766
|
+
limit: FEATURE_USER_USAGE_LIMIT
|
|
6767
|
+
}),
|
|
6768
|
+
{ readiness }
|
|
6769
|
+
);
|
|
5741
6770
|
const held = { key: initialData.sessionKey };
|
|
5742
6771
|
if (initialData.invoices !== void 0) {
|
|
5743
6772
|
held.invoices = {
|
|
@@ -5758,7 +6787,13 @@ var BillingStore = class {
|
|
|
5758
6787
|
if (initialData.featureUsage !== void 0) {
|
|
5759
6788
|
held.featureUsage = initialData.featureUsage;
|
|
5760
6789
|
}
|
|
5761
|
-
if (
|
|
6790
|
+
if (initialData.creditBalances !== void 0) {
|
|
6791
|
+
held.creditBalances = initialData.creditBalances;
|
|
6792
|
+
}
|
|
6793
|
+
if (initialData.company !== void 0) {
|
|
6794
|
+
held.company = initialData.company;
|
|
6795
|
+
}
|
|
6796
|
+
if (held.invoices !== void 0 || held.upcomingInvoice !== void 0 || held.paymentMethods !== void 0 || held.featureUsage !== void 0 || held.creditBalances !== void 0 || held.company !== void 0) {
|
|
5762
6797
|
this._held = held;
|
|
5763
6798
|
this._settleSeed(claimFrom(options.session) ?? claimOf(this._client));
|
|
5764
6799
|
}
|
|
@@ -5768,6 +6803,9 @@ var BillingStore = class {
|
|
|
5768
6803
|
upcomingInvoice;
|
|
5769
6804
|
paymentMethods;
|
|
5770
6805
|
featureUsage;
|
|
6806
|
+
creditBalances;
|
|
6807
|
+
company;
|
|
6808
|
+
creditUserUsage;
|
|
5771
6809
|
featureUserUsage;
|
|
5772
6810
|
_pageSize;
|
|
5773
6811
|
_unsubscribe;
|
|
@@ -5850,6 +6888,12 @@ var BillingStore = class {
|
|
|
5850
6888
|
if (held.featureUsage !== void 0) {
|
|
5851
6889
|
this.featureUsage.seed(SINGLETON, held.featureUsage);
|
|
5852
6890
|
}
|
|
6891
|
+
if (held.creditBalances !== void 0) {
|
|
6892
|
+
this.creditBalances.seed(SINGLETON, held.creditBalances);
|
|
6893
|
+
}
|
|
6894
|
+
if (held.company !== void 0) {
|
|
6895
|
+
this.company.seed(SINGLETON, held.company);
|
|
6896
|
+
}
|
|
5853
6897
|
this._seedKey = held.key;
|
|
5854
6898
|
this._seeded = true;
|
|
5855
6899
|
}
|
|
@@ -5863,6 +6907,7 @@ var BillingStore = class {
|
|
|
5863
6907
|
this[name].resetAll();
|
|
5864
6908
|
}
|
|
5865
6909
|
this.featureUserUsage.resetAll();
|
|
6910
|
+
this.creditUserUsage.resetAll();
|
|
5866
6911
|
}
|
|
5867
6912
|
/** Forgets every resource and leaves them empty; nothing reloads. */
|
|
5868
6913
|
clearAll() {
|
|
@@ -5870,6 +6915,7 @@ var BillingStore = class {
|
|
|
5870
6915
|
this[name].clearAll();
|
|
5871
6916
|
}
|
|
5872
6917
|
this.featureUserUsage.clearAll();
|
|
6918
|
+
this.creditUserUsage.clearAll();
|
|
5873
6919
|
}
|
|
5874
6920
|
/** Loads every resource that is subscribed and has nothing yet. */
|
|
5875
6921
|
resumeAll() {
|
|
@@ -5877,6 +6923,7 @@ var BillingStore = class {
|
|
|
5877
6923
|
this[name].resumeAll();
|
|
5878
6924
|
}
|
|
5879
6925
|
this.featureUserUsage.resumeAll();
|
|
6926
|
+
this.creditUserUsage.resumeAll();
|
|
5880
6927
|
}
|
|
5881
6928
|
/** Reloads every resource that has been loaded, keeping its current data. */
|
|
5882
6929
|
invalidateAll() {
|
|
@@ -5884,6 +6931,7 @@ var BillingStore = class {
|
|
|
5884
6931
|
this[name].invalidateAll();
|
|
5885
6932
|
}
|
|
5886
6933
|
this.featureUserUsage.invalidateAll();
|
|
6934
|
+
this.creditUserUsage.invalidateAll();
|
|
5887
6935
|
}
|
|
5888
6936
|
/**
|
|
5889
6937
|
* Appends the next page to the invoices list for `query`, when there is
|
|
@@ -5996,7 +7044,9 @@ var RESOURCE_NAMES = [
|
|
|
5996
7044
|
"invoices",
|
|
5997
7045
|
"upcomingInvoice",
|
|
5998
7046
|
"paymentMethods",
|
|
5999
|
-
"featureUsage"
|
|
7047
|
+
"featureUsage",
|
|
7048
|
+
"creditBalances",
|
|
7049
|
+
"company"
|
|
6000
7050
|
];
|
|
6001
7051
|
|
|
6002
7052
|
// src/billing/context.tsx
|
|
@@ -6079,6 +7129,9 @@ var missingBillingSource = {
|
|
|
6079
7129
|
subscribeFeatureUserUsage: () => () => {
|
|
6080
7130
|
},
|
|
6081
7131
|
featureUserUsage: () => missingHandle,
|
|
7132
|
+
subscribeCreditUserUsage: () => () => {
|
|
7133
|
+
},
|
|
7134
|
+
creditUserUsage: () => missingHandle,
|
|
6082
7135
|
loadMoreInvoices: () => Promise.resolve(),
|
|
6083
7136
|
invalidateAll: () => {
|
|
6084
7137
|
},
|
|
@@ -6092,6 +7145,7 @@ function useBillingDataSource() {
|
|
|
6092
7145
|
function BillingDataProvider({
|
|
6093
7146
|
actions,
|
|
6094
7147
|
children,
|
|
7148
|
+
creditUserUsage,
|
|
6095
7149
|
data,
|
|
6096
7150
|
featureUserUsage,
|
|
6097
7151
|
locale,
|
|
@@ -6105,6 +7159,7 @@ function BillingDataProvider({
|
|
|
6105
7159
|
const source = (0, import_react2.useMemo)(() => {
|
|
6106
7160
|
const handles = /* @__PURE__ */ new Map();
|
|
6107
7161
|
const userUsageHandles = /* @__PURE__ */ new Map();
|
|
7162
|
+
const creditUsageHandles = /* @__PURE__ */ new Map();
|
|
6108
7163
|
return {
|
|
6109
7164
|
actions: rejectingActions(
|
|
6110
7165
|
(name) => new Error(BILLING_ACTION_UNAVAILABLE_MESSAGE(name)),
|
|
@@ -6146,6 +7201,24 @@ function BillingDataProvider({
|
|
|
6146
7201
|
userUsageHandles.set(featureId, handle);
|
|
6147
7202
|
return handle;
|
|
6148
7203
|
},
|
|
7204
|
+
subscribeCreditUserUsage: () => () => {
|
|
7205
|
+
},
|
|
7206
|
+
creditUserUsage: (creditId) => {
|
|
7207
|
+
const cached = creditUsageHandles.get(creditId);
|
|
7208
|
+
if (cached !== void 0) {
|
|
7209
|
+
return cached;
|
|
7210
|
+
}
|
|
7211
|
+
const value = creditUserUsage?.[creditId];
|
|
7212
|
+
const handle = {
|
|
7213
|
+
data: value,
|
|
7214
|
+
error: void 0,
|
|
7215
|
+
isPending: value === void 0,
|
|
7216
|
+
refetch: () => {
|
|
7217
|
+
}
|
|
7218
|
+
};
|
|
7219
|
+
creditUsageHandles.set(creditId, handle);
|
|
7220
|
+
return handle;
|
|
7221
|
+
},
|
|
6149
7222
|
loadMoreInvoices: (query) => {
|
|
6150
7223
|
onLoadMoreInvoices?.(query);
|
|
6151
7224
|
return Promise.resolve();
|
|
@@ -6153,7 +7226,15 @@ function BillingDataProvider({
|
|
|
6153
7226
|
invalidateAll: () => {
|
|
6154
7227
|
}
|
|
6155
7228
|
};
|
|
6156
|
-
}, [
|
|
7229
|
+
}, [
|
|
7230
|
+
actions,
|
|
7231
|
+
creditUserUsage,
|
|
7232
|
+
data,
|
|
7233
|
+
featureUserUsage,
|
|
7234
|
+
onLoadMoreInvoices,
|
|
7235
|
+
onRefetch,
|
|
7236
|
+
status
|
|
7237
|
+
]);
|
|
6157
7238
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BillingDataContext.Provider, { value: source, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
6158
7239
|
SchematicI18nProvider,
|
|
6159
7240
|
{
|
|
@@ -6258,6 +7339,24 @@ function useFeatureUserUsage(featureId) {
|
|
|
6258
7339
|
);
|
|
6259
7340
|
return (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
6260
7341
|
}
|
|
7342
|
+
function useCompany() {
|
|
7343
|
+
return useBillingResource("company", SINGLETON);
|
|
7344
|
+
}
|
|
7345
|
+
function useCreditBalances() {
|
|
7346
|
+
return useBillingResource("creditBalances", SINGLETON);
|
|
7347
|
+
}
|
|
7348
|
+
function useCreditUserUsage(creditId) {
|
|
7349
|
+
const source = useBillingDataSource();
|
|
7350
|
+
const subscribe = (0, import_react3.useCallback)(
|
|
7351
|
+
(listener) => source.subscribeCreditUserUsage(creditId, listener),
|
|
7352
|
+
[creditId, source]
|
|
7353
|
+
);
|
|
7354
|
+
const getSnapshot = (0, import_react3.useCallback)(
|
|
7355
|
+
() => source.creditUserUsage(creditId),
|
|
7356
|
+
[creditId, source]
|
|
7357
|
+
);
|
|
7358
|
+
return (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
7359
|
+
}
|
|
6261
7360
|
function useInvalidateBillingData() {
|
|
6262
7361
|
return useBillingDataSource().invalidateAll;
|
|
6263
7362
|
}
|
|
@@ -6335,6 +7434,8 @@ function BillingProvider({
|
|
|
6335
7434
|
handle,
|
|
6336
7435
|
subscribeFeatureUserUsage: (featureId, listener) => store.featureUserUsage.subscribe({ featureId }, listener),
|
|
6337
7436
|
featureUserUsage: (featureId) => handleOf(store.featureUserUsage.get({ featureId })),
|
|
7437
|
+
subscribeCreditUserUsage: (creditId, listener) => store.creditUserUsage.subscribe({ creditId }, listener),
|
|
7438
|
+
creditUserUsage: (creditId) => handleOf(store.creditUserUsage.get({ creditId })),
|
|
6338
7439
|
loadMoreInvoices: (query) => store.loadMoreInvoices(query),
|
|
6339
7440
|
invalidateAll: () => store.invalidateAll(),
|
|
6340
7441
|
actions: {
|
|
@@ -6368,10 +7469,20 @@ function staticSource(data) {
|
|
|
6368
7469
|
refetch: () => {
|
|
6369
7470
|
}
|
|
6370
7471
|
};
|
|
7472
|
+
const pendingCreditUsage = {
|
|
7473
|
+
data: void 0,
|
|
7474
|
+
error: void 0,
|
|
7475
|
+
isPending: true,
|
|
7476
|
+
refetch: () => {
|
|
7477
|
+
}
|
|
7478
|
+
};
|
|
6371
7479
|
return {
|
|
6372
7480
|
subscribeFeatureUserUsage: () => () => {
|
|
6373
7481
|
},
|
|
6374
7482
|
featureUserUsage: () => pendingUserUsage,
|
|
7483
|
+
subscribeCreditUserUsage: () => () => {
|
|
7484
|
+
},
|
|
7485
|
+
creditUserUsage: () => pendingCreditUsage,
|
|
6375
7486
|
subscribe: () => () => {
|
|
6376
7487
|
},
|
|
6377
7488
|
handle: (name) => {
|
|
@@ -6397,7 +7508,7 @@ function staticSource(data) {
|
|
|
6397
7508
|
}
|
|
6398
7509
|
|
|
6399
7510
|
// src/version.ts
|
|
6400
|
-
var version2 = "1.
|
|
7511
|
+
var version2 = "1.13.0";
|
|
6401
7512
|
|
|
6402
7513
|
// src/context/schematic.tsx
|
|
6403
7514
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|