@schematichq/schematic-react 1.11.0 → 1.12.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 +582 -6
- package/dist/schematic-react.d.ts +515 -3
- package/dist/schematic-react.esm.js +582 -6
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.pnpm/@schematichq+schematic-js@1.
|
|
1
|
+
// node_modules/.pnpm/@schematichq+schematic-js@1.12.0/node_modules/@schematichq/schematic-js/dist/schematic.esm.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -658,6 +658,7 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
658
658
|
metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
|
|
659
659
|
metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
|
|
660
660
|
monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
|
|
661
|
+
quantityRates: json["quantity_rates"] == null ? void 0 : json["quantity_rates"],
|
|
661
662
|
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
662
663
|
usage: json["usage"] == null ? void 0 : json["usage"],
|
|
663
664
|
valueType: EntitlementValueTypeFromJSON(json["value_type"]),
|
|
@@ -1325,7 +1326,7 @@ var ContextSignatureManager = class {
|
|
|
1325
1326
|
}
|
|
1326
1327
|
}
|
|
1327
1328
|
};
|
|
1328
|
-
var version = "1.
|
|
1329
|
+
var version = "1.12.0";
|
|
1329
1330
|
var SINGLETON = {};
|
|
1330
1331
|
var models_exports = {};
|
|
1331
1332
|
__export(models_exports, {
|
|
@@ -1333,6 +1334,11 @@ __export(models_exports, {
|
|
|
1333
1334
|
ApiErrorFromJSONTyped: () => ApiErrorFromJSONTyped,
|
|
1334
1335
|
ApiErrorToJSON: () => ApiErrorToJSON,
|
|
1335
1336
|
ApiErrorToJSONTyped: () => ApiErrorToJSONTyped,
|
|
1337
|
+
BillingCreditGrantReason: () => BillingCreditGrantReason,
|
|
1338
|
+
BillingCreditGrantReasonFromJSON: () => BillingCreditGrantReasonFromJSON,
|
|
1339
|
+
BillingCreditGrantReasonFromJSONTyped: () => BillingCreditGrantReasonFromJSONTyped,
|
|
1340
|
+
BillingCreditGrantReasonToJSON: () => BillingCreditGrantReasonToJSON,
|
|
1341
|
+
BillingCreditGrantReasonToJSONTyped: () => BillingCreditGrantReasonToJSONTyped,
|
|
1336
1342
|
BillingPlanCreditGrantResetCadence: () => BillingPlanCreditGrantResetCadence,
|
|
1337
1343
|
BillingPlanCreditGrantResetCadenceFromJSON: () => BillingPlanCreditGrantResetCadenceFromJSON2,
|
|
1338
1344
|
BillingPlanCreditGrantResetCadenceFromJSONTyped: () => BillingPlanCreditGrantResetCadenceFromJSONTyped3,
|
|
@@ -1370,6 +1376,30 @@ __export(models_exports, {
|
|
|
1370
1376
|
CatalogPriceTierResponseDataFromJSONTyped: () => CatalogPriceTierResponseDataFromJSONTyped,
|
|
1371
1377
|
CatalogPriceTierResponseDataToJSON: () => CatalogPriceTierResponseDataToJSON,
|
|
1372
1378
|
CatalogPriceTierResponseDataToJSONTyped: () => CatalogPriceTierResponseDataToJSONTyped,
|
|
1379
|
+
CompanyCreditBalanceResponseDataFromJSON: () => CompanyCreditBalanceResponseDataFromJSON,
|
|
1380
|
+
CompanyCreditBalanceResponseDataFromJSONTyped: () => CompanyCreditBalanceResponseDataFromJSONTyped,
|
|
1381
|
+
CompanyCreditBalanceResponseDataToJSON: () => CompanyCreditBalanceResponseDataToJSON,
|
|
1382
|
+
CompanyCreditBalanceResponseDataToJSONTyped: () => CompanyCreditBalanceResponseDataToJSONTyped,
|
|
1383
|
+
CompanyCreditBalancesResponseDataFromJSON: () => CompanyCreditBalancesResponseDataFromJSON,
|
|
1384
|
+
CompanyCreditBalancesResponseDataFromJSONTyped: () => CompanyCreditBalancesResponseDataFromJSONTyped,
|
|
1385
|
+
CompanyCreditBalancesResponseDataToJSON: () => CompanyCreditBalancesResponseDataToJSON,
|
|
1386
|
+
CompanyCreditBalancesResponseDataToJSONTyped: () => CompanyCreditBalancesResponseDataToJSONTyped,
|
|
1387
|
+
CompanyCreditCompositionResponseDataFromJSON: () => CompanyCreditCompositionResponseDataFromJSON,
|
|
1388
|
+
CompanyCreditCompositionResponseDataFromJSONTyped: () => CompanyCreditCompositionResponseDataFromJSONTyped,
|
|
1389
|
+
CompanyCreditCompositionResponseDataToJSON: () => CompanyCreditCompositionResponseDataToJSON,
|
|
1390
|
+
CompanyCreditCompositionResponseDataToJSONTyped: () => CompanyCreditCompositionResponseDataToJSONTyped,
|
|
1391
|
+
CompanyCreditGrantResponseDataFromJSON: () => CompanyCreditGrantResponseDataFromJSON,
|
|
1392
|
+
CompanyCreditGrantResponseDataFromJSONTyped: () => CompanyCreditGrantResponseDataFromJSONTyped,
|
|
1393
|
+
CompanyCreditGrantResponseDataToJSON: () => CompanyCreditGrantResponseDataToJSON,
|
|
1394
|
+
CompanyCreditGrantResponseDataToJSONTyped: () => CompanyCreditGrantResponseDataToJSONTyped,
|
|
1395
|
+
CompanyCreditUserUsageResponseDataFromJSON: () => CompanyCreditUserUsageResponseDataFromJSON,
|
|
1396
|
+
CompanyCreditUserUsageResponseDataFromJSONTyped: () => CompanyCreditUserUsageResponseDataFromJSONTyped,
|
|
1397
|
+
CompanyCreditUserUsageResponseDataToJSON: () => CompanyCreditUserUsageResponseDataToJSON,
|
|
1398
|
+
CompanyCreditUserUsageResponseDataToJSONTyped: () => CompanyCreditUserUsageResponseDataToJSONTyped,
|
|
1399
|
+
CompanyCreditUserUsageRowResponseDataFromJSON: () => CompanyCreditUserUsageRowResponseDataFromJSON,
|
|
1400
|
+
CompanyCreditUserUsageRowResponseDataFromJSONTyped: () => CompanyCreditUserUsageRowResponseDataFromJSONTyped,
|
|
1401
|
+
CompanyCreditUserUsageRowResponseDataToJSON: () => CompanyCreditUserUsageRowResponseDataToJSON,
|
|
1402
|
+
CompanyCreditUserUsageRowResponseDataToJSONTyped: () => CompanyCreditUserUsageRowResponseDataToJSONTyped,
|
|
1373
1403
|
CompanyDiscountResponseDataFromJSON: () => CompanyDiscountResponseDataFromJSON,
|
|
1374
1404
|
CompanyDiscountResponseDataFromJSONTyped: () => CompanyDiscountResponseDataFromJSONTyped,
|
|
1375
1405
|
CompanyDiscountResponseDataToJSON: () => CompanyDiscountResponseDataToJSON,
|
|
@@ -1442,6 +1472,18 @@ __export(models_exports, {
|
|
|
1442
1472
|
FeatureTypeFromJSONTyped: () => FeatureTypeFromJSONTyped3,
|
|
1443
1473
|
FeatureTypeToJSON: () => FeatureTypeToJSON2,
|
|
1444
1474
|
FeatureTypeToJSONTyped: () => FeatureTypeToJSONTyped3,
|
|
1475
|
+
GetCompanyCreditBalancesResponseFromJSON: () => GetCompanyCreditBalancesResponseFromJSON,
|
|
1476
|
+
GetCompanyCreditBalancesResponseFromJSONTyped: () => GetCompanyCreditBalancesResponseFromJSONTyped,
|
|
1477
|
+
GetCompanyCreditBalancesResponseToJSON: () => GetCompanyCreditBalancesResponseToJSON,
|
|
1478
|
+
GetCompanyCreditBalancesResponseToJSONTyped: () => GetCompanyCreditBalancesResponseToJSONTyped,
|
|
1479
|
+
GetCompanyCreditUserUsageParamsFromJSON: () => GetCompanyCreditUserUsageParamsFromJSON,
|
|
1480
|
+
GetCompanyCreditUserUsageParamsFromJSONTyped: () => GetCompanyCreditUserUsageParamsFromJSONTyped,
|
|
1481
|
+
GetCompanyCreditUserUsageParamsToJSON: () => GetCompanyCreditUserUsageParamsToJSON,
|
|
1482
|
+
GetCompanyCreditUserUsageParamsToJSONTyped: () => GetCompanyCreditUserUsageParamsToJSONTyped,
|
|
1483
|
+
GetCompanyCreditUserUsageResponseFromJSON: () => GetCompanyCreditUserUsageResponseFromJSON,
|
|
1484
|
+
GetCompanyCreditUserUsageResponseFromJSONTyped: () => GetCompanyCreditUserUsageResponseFromJSONTyped,
|
|
1485
|
+
GetCompanyCreditUserUsageResponseToJSON: () => GetCompanyCreditUserUsageResponseToJSON,
|
|
1486
|
+
GetCompanyCreditUserUsageResponseToJSONTyped: () => GetCompanyCreditUserUsageResponseToJSONTyped,
|
|
1445
1487
|
GetCompanyFeatureUsageResponseFromJSON: () => GetCompanyFeatureUsageResponseFromJSON,
|
|
1446
1488
|
GetCompanyFeatureUsageResponseFromJSONTyped: () => GetCompanyFeatureUsageResponseFromJSONTyped,
|
|
1447
1489
|
GetCompanyFeatureUsageResponseToJSON: () => GetCompanyFeatureUsageResponseToJSON,
|
|
@@ -1507,6 +1549,7 @@ __export(models_exports, {
|
|
|
1507
1549
|
UpdatePaymentMethodResponseToJSON: () => UpdatePaymentMethodResponseToJSON,
|
|
1508
1550
|
UpdatePaymentMethodResponseToJSONTyped: () => UpdatePaymentMethodResponseToJSONTyped,
|
|
1509
1551
|
instanceOfApiError: () => instanceOfApiError,
|
|
1552
|
+
instanceOfBillingCreditGrantReason: () => instanceOfBillingCreditGrantReason,
|
|
1510
1553
|
instanceOfBillingPlanCreditGrantResetCadence: () => instanceOfBillingPlanCreditGrantResetCadence,
|
|
1511
1554
|
instanceOfBillingPriceScheme: () => instanceOfBillingPriceScheme,
|
|
1512
1555
|
instanceOfBillingProductPriceInterval: () => instanceOfBillingProductPriceInterval,
|
|
@@ -1515,6 +1558,12 @@ __export(models_exports, {
|
|
|
1515
1558
|
instanceOfCatalogCreditGrantResponseData: () => instanceOfCatalogCreditGrantResponseData,
|
|
1516
1559
|
instanceOfCatalogPriceResponseData: () => instanceOfCatalogPriceResponseData,
|
|
1517
1560
|
instanceOfCatalogPriceTierResponseData: () => instanceOfCatalogPriceTierResponseData,
|
|
1561
|
+
instanceOfCompanyCreditBalanceResponseData: () => instanceOfCompanyCreditBalanceResponseData,
|
|
1562
|
+
instanceOfCompanyCreditBalancesResponseData: () => instanceOfCompanyCreditBalancesResponseData,
|
|
1563
|
+
instanceOfCompanyCreditCompositionResponseData: () => instanceOfCompanyCreditCompositionResponseData,
|
|
1564
|
+
instanceOfCompanyCreditGrantResponseData: () => instanceOfCompanyCreditGrantResponseData,
|
|
1565
|
+
instanceOfCompanyCreditUserUsageResponseData: () => instanceOfCompanyCreditUserUsageResponseData,
|
|
1566
|
+
instanceOfCompanyCreditUserUsageRowResponseData: () => instanceOfCompanyCreditUserUsageRowResponseData,
|
|
1518
1567
|
instanceOfCompanyDiscountResponseData: () => instanceOfCompanyDiscountResponseData,
|
|
1519
1568
|
instanceOfCompanyFeatureUsageListResponseData: () => instanceOfCompanyFeatureUsageListResponseData,
|
|
1520
1569
|
instanceOfCompanyFeatureUsageResponseData: () => instanceOfCompanyFeatureUsageResponseData,
|
|
@@ -1532,6 +1581,9 @@ __export(models_exports, {
|
|
|
1532
1581
|
instanceOfEntitlementType: () => instanceOfEntitlementType,
|
|
1533
1582
|
instanceOfEntitlementValueType: () => instanceOfEntitlementValueType,
|
|
1534
1583
|
instanceOfFeatureType: () => instanceOfFeatureType,
|
|
1584
|
+
instanceOfGetCompanyCreditBalancesResponse: () => instanceOfGetCompanyCreditBalancesResponse,
|
|
1585
|
+
instanceOfGetCompanyCreditUserUsageParams: () => instanceOfGetCompanyCreditUserUsageParams,
|
|
1586
|
+
instanceOfGetCompanyCreditUserUsageResponse: () => instanceOfGetCompanyCreditUserUsageResponse,
|
|
1535
1587
|
instanceOfGetCompanyFeatureUsageResponse: () => instanceOfGetCompanyFeatureUsageResponse,
|
|
1536
1588
|
instanceOfGetCompanyFeatureUserUsageParams: () => instanceOfGetCompanyFeatureUserUsageParams,
|
|
1537
1589
|
instanceOfGetCompanyFeatureUserUsageResponse: () => instanceOfGetCompanyFeatureUserUsageResponse,
|
|
@@ -1574,6 +1626,39 @@ function ApiErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1574
1626
|
error: value["error"]
|
|
1575
1627
|
};
|
|
1576
1628
|
}
|
|
1629
|
+
var BillingCreditGrantReason = {
|
|
1630
|
+
Adjustment: "adjustment",
|
|
1631
|
+
BillingCreditAutoTopup: "billing_credit_auto_topup",
|
|
1632
|
+
Free: "free",
|
|
1633
|
+
Plan: "plan",
|
|
1634
|
+
PostpaidForgiven: "postpaid_forgiven",
|
|
1635
|
+
PostpaidOverdraft: "postpaid_overdraft",
|
|
1636
|
+
PostpaidSettlement: "postpaid_settlement",
|
|
1637
|
+
Purchased: "purchased",
|
|
1638
|
+
Rollover: "rollover"
|
|
1639
|
+
};
|
|
1640
|
+
function instanceOfBillingCreditGrantReason(value) {
|
|
1641
|
+
for (const key in BillingCreditGrantReason) {
|
|
1642
|
+
if (Object.prototype.hasOwnProperty.call(BillingCreditGrantReason, key)) {
|
|
1643
|
+
if (BillingCreditGrantReason[key] === value) {
|
|
1644
|
+
return true;
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
return false;
|
|
1649
|
+
}
|
|
1650
|
+
function BillingCreditGrantReasonFromJSON(json) {
|
|
1651
|
+
return BillingCreditGrantReasonFromJSONTyped(json, false);
|
|
1652
|
+
}
|
|
1653
|
+
function BillingCreditGrantReasonFromJSONTyped(json, ignoreDiscriminator) {
|
|
1654
|
+
return json;
|
|
1655
|
+
}
|
|
1656
|
+
function BillingCreditGrantReasonToJSON(value) {
|
|
1657
|
+
return value;
|
|
1658
|
+
}
|
|
1659
|
+
function BillingCreditGrantReasonToJSONTyped(value, ignoreDiscriminator) {
|
|
1660
|
+
return value;
|
|
1661
|
+
}
|
|
1577
1662
|
var BillingPlanCreditGrantResetCadence = {
|
|
1578
1663
|
Daily: "daily",
|
|
1579
1664
|
Every6Months: "every_6_months",
|
|
@@ -1891,6 +1976,298 @@ function CatalogPriceResponseDataToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
1891
1976
|
tiers_mode: BillingTiersModeToJSON2(value["tiersMode"])
|
|
1892
1977
|
};
|
|
1893
1978
|
}
|
|
1979
|
+
function instanceOfCompanyCreditGrantResponseData(value) {
|
|
1980
|
+
if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
|
|
1981
|
+
if (!("grantReason" in value) || value["grantReason"] === void 0)
|
|
1982
|
+
return false;
|
|
1983
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1984
|
+
if (!("quantity" in value) || value["quantity"] === void 0) return false;
|
|
1985
|
+
if (!("quantityRemaining" in value) || value["quantityRemaining"] === void 0)
|
|
1986
|
+
return false;
|
|
1987
|
+
if (!("quantityUsed" in value) || value["quantityUsed"] === void 0)
|
|
1988
|
+
return false;
|
|
1989
|
+
return true;
|
|
1990
|
+
}
|
|
1991
|
+
function CompanyCreditGrantResponseDataFromJSON(json) {
|
|
1992
|
+
return CompanyCreditGrantResponseDataFromJSONTyped(json, false);
|
|
1993
|
+
}
|
|
1994
|
+
function CompanyCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
1995
|
+
if (json == null) {
|
|
1996
|
+
return json;
|
|
1997
|
+
}
|
|
1998
|
+
return {
|
|
1999
|
+
bundleId: json["bundle_id"] == null ? void 0 : json["bundle_id"],
|
|
2000
|
+
bundleName: json["bundle_name"] == null ? void 0 : json["bundle_name"],
|
|
2001
|
+
createdAt: new Date(json["created_at"]),
|
|
2002
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
2003
|
+
grantReason: BillingCreditGrantReasonFromJSON(json["grant_reason"]),
|
|
2004
|
+
id: json["id"],
|
|
2005
|
+
planId: json["plan_id"] == null ? void 0 : json["plan_id"],
|
|
2006
|
+
planName: json["plan_name"] == null ? void 0 : json["plan_name"],
|
|
2007
|
+
quantity: json["quantity"],
|
|
2008
|
+
quantityRemaining: json["quantity_remaining"],
|
|
2009
|
+
quantityUsed: json["quantity_used"],
|
|
2010
|
+
renewalPeriod: json["renewal_period"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON2(json["renewal_period"]),
|
|
2011
|
+
resetsAt: json["resets_at"] == null ? void 0 : new Date(json["resets_at"]),
|
|
2012
|
+
validFrom: json["valid_from"] == null ? void 0 : new Date(json["valid_from"])
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
function CompanyCreditGrantResponseDataToJSON(json) {
|
|
2016
|
+
return CompanyCreditGrantResponseDataToJSONTyped(json, false);
|
|
2017
|
+
}
|
|
2018
|
+
function CompanyCreditGrantResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2019
|
+
if (value == null) {
|
|
2020
|
+
return value;
|
|
2021
|
+
}
|
|
2022
|
+
return {
|
|
2023
|
+
bundle_id: value["bundleId"],
|
|
2024
|
+
bundle_name: value["bundleName"],
|
|
2025
|
+
created_at: value["createdAt"].toISOString(),
|
|
2026
|
+
expires_at: value["expiresAt"] == null ? void 0 : value["expiresAt"].toISOString(),
|
|
2027
|
+
grant_reason: BillingCreditGrantReasonToJSON(value["grantReason"]),
|
|
2028
|
+
id: value["id"],
|
|
2029
|
+
plan_id: value["planId"],
|
|
2030
|
+
plan_name: value["planName"],
|
|
2031
|
+
quantity: value["quantity"],
|
|
2032
|
+
quantity_remaining: value["quantityRemaining"],
|
|
2033
|
+
quantity_used: value["quantityUsed"],
|
|
2034
|
+
renewal_period: BillingPlanCreditGrantResetCadenceToJSON2(
|
|
2035
|
+
value["renewalPeriod"]
|
|
2036
|
+
),
|
|
2037
|
+
resets_at: value["resetsAt"] == null ? void 0 : value["resetsAt"].toISOString(),
|
|
2038
|
+
valid_from: value["validFrom"] == null ? void 0 : value["validFrom"].toISOString()
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
function instanceOfCompanyCreditCompositionResponseData(value) {
|
|
2042
|
+
if (!("fixedQuantity" in value) || value["fixedQuantity"] === void 0)
|
|
2043
|
+
return false;
|
|
2044
|
+
if (!("licenseName" in value) || value["licenseName"] === void 0)
|
|
2045
|
+
return false;
|
|
2046
|
+
if (!("licenseQuantity" in value) || value["licenseQuantity"] === void 0)
|
|
2047
|
+
return false;
|
|
2048
|
+
if (!("perLicenseAmount" in value) || value["perLicenseAmount"] === void 0)
|
|
2049
|
+
return false;
|
|
2050
|
+
if (!("period" in value) || value["period"] === void 0) return false;
|
|
2051
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2052
|
+
return true;
|
|
2053
|
+
}
|
|
2054
|
+
function CompanyCreditCompositionResponseDataFromJSON(json) {
|
|
2055
|
+
return CompanyCreditCompositionResponseDataFromJSONTyped(json, false);
|
|
2056
|
+
}
|
|
2057
|
+
function CompanyCreditCompositionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2058
|
+
if (json == null) {
|
|
2059
|
+
return json;
|
|
2060
|
+
}
|
|
2061
|
+
return {
|
|
2062
|
+
fixedQuantity: json["fixed_quantity"],
|
|
2063
|
+
licenseId: json["license_id"] == null ? void 0 : json["license_id"],
|
|
2064
|
+
licenseName: json["license_name"],
|
|
2065
|
+
licensePluralName: json["license_plural_name"] == null ? void 0 : json["license_plural_name"],
|
|
2066
|
+
licenseQuantity: json["license_quantity"],
|
|
2067
|
+
licenseSingularName: json["license_singular_name"] == null ? void 0 : json["license_singular_name"],
|
|
2068
|
+
perLicenseAmount: json["per_license_amount"],
|
|
2069
|
+
period: json["period"],
|
|
2070
|
+
renewsAt: json["renews_at"] == null ? void 0 : new Date(json["renews_at"]),
|
|
2071
|
+
total: json["total"]
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
function CompanyCreditCompositionResponseDataToJSON(json) {
|
|
2075
|
+
return CompanyCreditCompositionResponseDataToJSONTyped(json, false);
|
|
2076
|
+
}
|
|
2077
|
+
function CompanyCreditCompositionResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2078
|
+
if (value == null) {
|
|
2079
|
+
return value;
|
|
2080
|
+
}
|
|
2081
|
+
return {
|
|
2082
|
+
fixed_quantity: value["fixedQuantity"],
|
|
2083
|
+
license_id: value["licenseId"],
|
|
2084
|
+
license_name: value["licenseName"],
|
|
2085
|
+
license_plural_name: value["licensePluralName"],
|
|
2086
|
+
license_quantity: value["licenseQuantity"],
|
|
2087
|
+
license_singular_name: value["licenseSingularName"],
|
|
2088
|
+
per_license_amount: value["perLicenseAmount"],
|
|
2089
|
+
period: value["period"],
|
|
2090
|
+
renews_at: value["renewsAt"] == null ? void 0 : value["renewsAt"].toISOString(),
|
|
2091
|
+
total: value["total"]
|
|
2092
|
+
};
|
|
2093
|
+
}
|
|
2094
|
+
function instanceOfCompanyCreditBalanceResponseData(value) {
|
|
2095
|
+
if (!("creditDescription" in value) || value["creditDescription"] === void 0)
|
|
2096
|
+
return false;
|
|
2097
|
+
if (!("creditId" in value) || value["creditId"] === void 0) return false;
|
|
2098
|
+
if (!("creditName" in value) || value["creditName"] === void 0)
|
|
2099
|
+
return false;
|
|
2100
|
+
if (!("grants" in value) || value["grants"] === void 0) return false;
|
|
2101
|
+
if (!("purchasable" in value) || value["purchasable"] === void 0)
|
|
2102
|
+
return false;
|
|
2103
|
+
if (!("remaining" in value) || value["remaining"] === void 0) return false;
|
|
2104
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2105
|
+
if (!("used" in value) || value["used"] === void 0) return false;
|
|
2106
|
+
return true;
|
|
2107
|
+
}
|
|
2108
|
+
function CompanyCreditBalanceResponseDataFromJSON(json) {
|
|
2109
|
+
return CompanyCreditBalanceResponseDataFromJSONTyped(json, false);
|
|
2110
|
+
}
|
|
2111
|
+
function CompanyCreditBalanceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2112
|
+
if (json == null) {
|
|
2113
|
+
return json;
|
|
2114
|
+
}
|
|
2115
|
+
return {
|
|
2116
|
+
composition: json["composition"] == null ? void 0 : CompanyCreditCompositionResponseDataFromJSON(json["composition"]),
|
|
2117
|
+
creditDescription: json["credit_description"],
|
|
2118
|
+
creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
|
|
2119
|
+
creditId: json["credit_id"],
|
|
2120
|
+
creditName: json["credit_name"],
|
|
2121
|
+
creditPluralName: json["credit_plural_name"] == null ? void 0 : json["credit_plural_name"],
|
|
2122
|
+
creditSingularName: json["credit_singular_name"] == null ? void 0 : json["credit_singular_name"],
|
|
2123
|
+
expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
|
|
2124
|
+
grants: json["grants"].map(
|
|
2125
|
+
CompanyCreditGrantResponseDataFromJSON
|
|
2126
|
+
),
|
|
2127
|
+
purchasable: json["purchasable"],
|
|
2128
|
+
remaining: json["remaining"],
|
|
2129
|
+
resetsAt: json["resets_at"] == null ? void 0 : new Date(json["resets_at"]),
|
|
2130
|
+
total: json["total"],
|
|
2131
|
+
used: json["used"]
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
function CompanyCreditBalanceResponseDataToJSON(json) {
|
|
2135
|
+
return CompanyCreditBalanceResponseDataToJSONTyped(json, false);
|
|
2136
|
+
}
|
|
2137
|
+
function CompanyCreditBalanceResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2138
|
+
if (value == null) {
|
|
2139
|
+
return value;
|
|
2140
|
+
}
|
|
2141
|
+
return {
|
|
2142
|
+
composition: CompanyCreditCompositionResponseDataToJSON(
|
|
2143
|
+
value["composition"]
|
|
2144
|
+
),
|
|
2145
|
+
credit_description: value["creditDescription"],
|
|
2146
|
+
credit_icon: value["creditIcon"],
|
|
2147
|
+
credit_id: value["creditId"],
|
|
2148
|
+
credit_name: value["creditName"],
|
|
2149
|
+
credit_plural_name: value["creditPluralName"],
|
|
2150
|
+
credit_singular_name: value["creditSingularName"],
|
|
2151
|
+
expires_at: value["expiresAt"] == null ? void 0 : value["expiresAt"].toISOString(),
|
|
2152
|
+
grants: value["grants"].map(
|
|
2153
|
+
CompanyCreditGrantResponseDataToJSON
|
|
2154
|
+
),
|
|
2155
|
+
purchasable: value["purchasable"],
|
|
2156
|
+
remaining: value["remaining"],
|
|
2157
|
+
resets_at: value["resetsAt"] == null ? void 0 : value["resetsAt"].toISOString(),
|
|
2158
|
+
total: value["total"],
|
|
2159
|
+
used: value["used"]
|
|
2160
|
+
};
|
|
2161
|
+
}
|
|
2162
|
+
function instanceOfCompanyCreditBalancesResponseData(value) {
|
|
2163
|
+
if (!("balances" in value) || value["balances"] === void 0) return false;
|
|
2164
|
+
if (!("count" in value) || value["count"] === void 0) return false;
|
|
2165
|
+
return true;
|
|
2166
|
+
}
|
|
2167
|
+
function CompanyCreditBalancesResponseDataFromJSON(json) {
|
|
2168
|
+
return CompanyCreditBalancesResponseDataFromJSONTyped(json, false);
|
|
2169
|
+
}
|
|
2170
|
+
function CompanyCreditBalancesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2171
|
+
if (json == null) {
|
|
2172
|
+
return json;
|
|
2173
|
+
}
|
|
2174
|
+
return {
|
|
2175
|
+
balances: json["balances"].map(
|
|
2176
|
+
CompanyCreditBalanceResponseDataFromJSON
|
|
2177
|
+
),
|
|
2178
|
+
count: json["count"]
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
function CompanyCreditBalancesResponseDataToJSON(json) {
|
|
2182
|
+
return CompanyCreditBalancesResponseDataToJSONTyped(json, false);
|
|
2183
|
+
}
|
|
2184
|
+
function CompanyCreditBalancesResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2185
|
+
if (value == null) {
|
|
2186
|
+
return value;
|
|
2187
|
+
}
|
|
2188
|
+
return {
|
|
2189
|
+
balances: value["balances"].map(
|
|
2190
|
+
CompanyCreditBalanceResponseDataToJSON
|
|
2191
|
+
),
|
|
2192
|
+
count: value["count"]
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2195
|
+
function instanceOfCompanyCreditUserUsageRowResponseData(value) {
|
|
2196
|
+
if (!("share" in value) || value["share"] === void 0) return false;
|
|
2197
|
+
if (!("used" in value) || value["used"] === void 0) return false;
|
|
2198
|
+
if (!("userId" in value) || value["userId"] === void 0) return false;
|
|
2199
|
+
return true;
|
|
2200
|
+
}
|
|
2201
|
+
function CompanyCreditUserUsageRowResponseDataFromJSON(json) {
|
|
2202
|
+
return CompanyCreditUserUsageRowResponseDataFromJSONTyped(json, false);
|
|
2203
|
+
}
|
|
2204
|
+
function CompanyCreditUserUsageRowResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2205
|
+
if (json == null) {
|
|
2206
|
+
return json;
|
|
2207
|
+
}
|
|
2208
|
+
return {
|
|
2209
|
+
name: json["name"] == null ? void 0 : json["name"],
|
|
2210
|
+
share: json["share"],
|
|
2211
|
+
used: json["used"],
|
|
2212
|
+
userId: json["user_id"]
|
|
2213
|
+
};
|
|
2214
|
+
}
|
|
2215
|
+
function CompanyCreditUserUsageRowResponseDataToJSON(json) {
|
|
2216
|
+
return CompanyCreditUserUsageRowResponseDataToJSONTyped(json, false);
|
|
2217
|
+
}
|
|
2218
|
+
function CompanyCreditUserUsageRowResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2219
|
+
if (value == null) {
|
|
2220
|
+
return value;
|
|
2221
|
+
}
|
|
2222
|
+
return {
|
|
2223
|
+
name: value["name"],
|
|
2224
|
+
share: value["share"],
|
|
2225
|
+
used: value["used"],
|
|
2226
|
+
user_id: value["userId"]
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
function instanceOfCompanyCreditUserUsageResponseData(value) {
|
|
2230
|
+
if (!("count" in value) || value["count"] === void 0) return false;
|
|
2231
|
+
if (!("total" in value) || value["total"] === void 0) return false;
|
|
2232
|
+
if (!("users" in value) || value["users"] === void 0) return false;
|
|
2233
|
+
return true;
|
|
2234
|
+
}
|
|
2235
|
+
function CompanyCreditUserUsageResponseDataFromJSON(json) {
|
|
2236
|
+
return CompanyCreditUserUsageResponseDataFromJSONTyped(json, false);
|
|
2237
|
+
}
|
|
2238
|
+
function CompanyCreditUserUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2239
|
+
if (json == null) {
|
|
2240
|
+
return json;
|
|
2241
|
+
}
|
|
2242
|
+
return {
|
|
2243
|
+
count: json["count"],
|
|
2244
|
+
endTime: json["end_time"] == null ? void 0 : new Date(json["end_time"]),
|
|
2245
|
+
startTime: json["start_time"] == null ? void 0 : new Date(json["start_time"]),
|
|
2246
|
+
total: json["total"],
|
|
2247
|
+
unattributed: json["unattributed"] == null ? void 0 : json["unattributed"],
|
|
2248
|
+
users: json["users"].map(
|
|
2249
|
+
CompanyCreditUserUsageRowResponseDataFromJSON
|
|
2250
|
+
)
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
function CompanyCreditUserUsageResponseDataToJSON(json) {
|
|
2254
|
+
return CompanyCreditUserUsageResponseDataToJSONTyped(json, false);
|
|
2255
|
+
}
|
|
2256
|
+
function CompanyCreditUserUsageResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2257
|
+
if (value == null) {
|
|
2258
|
+
return value;
|
|
2259
|
+
}
|
|
2260
|
+
return {
|
|
2261
|
+
count: value["count"],
|
|
2262
|
+
end_time: value["endTime"] == null ? void 0 : value["endTime"].toISOString(),
|
|
2263
|
+
start_time: value["startTime"] == null ? void 0 : value["startTime"].toISOString(),
|
|
2264
|
+
total: value["total"],
|
|
2265
|
+
unattributed: value["unattributed"],
|
|
2266
|
+
users: value["users"].map(
|
|
2267
|
+
CompanyCreditUserUsageRowResponseDataToJSON
|
|
2268
|
+
)
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
1894
2271
|
function instanceOfCompanyDiscountResponseData(value) {
|
|
1895
2272
|
if (!("couponName" in value) || value["couponName"] === void 0)
|
|
1896
2273
|
return false;
|
|
@@ -2678,6 +3055,91 @@ function DeletePaymentMethodResponseToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
2678
3055
|
params: value["params"]
|
|
2679
3056
|
};
|
|
2680
3057
|
}
|
|
3058
|
+
function instanceOfGetCompanyCreditBalancesResponse(value) {
|
|
3059
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
3060
|
+
if (!("params" in value) || value["params"] === void 0) return false;
|
|
3061
|
+
return true;
|
|
3062
|
+
}
|
|
3063
|
+
function GetCompanyCreditBalancesResponseFromJSON(json) {
|
|
3064
|
+
return GetCompanyCreditBalancesResponseFromJSONTyped(json, false);
|
|
3065
|
+
}
|
|
3066
|
+
function GetCompanyCreditBalancesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
3067
|
+
if (json == null) {
|
|
3068
|
+
return json;
|
|
3069
|
+
}
|
|
3070
|
+
return {
|
|
3071
|
+
data: CompanyCreditBalancesResponseDataFromJSON(json["data"]),
|
|
3072
|
+
params: json["params"]
|
|
3073
|
+
};
|
|
3074
|
+
}
|
|
3075
|
+
function GetCompanyCreditBalancesResponseToJSON(json) {
|
|
3076
|
+
return GetCompanyCreditBalancesResponseToJSONTyped(json, false);
|
|
3077
|
+
}
|
|
3078
|
+
function GetCompanyCreditBalancesResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3079
|
+
if (value == null) {
|
|
3080
|
+
return value;
|
|
3081
|
+
}
|
|
3082
|
+
return {
|
|
3083
|
+
data: CompanyCreditBalancesResponseDataToJSON(value["data"]),
|
|
3084
|
+
params: value["params"]
|
|
3085
|
+
};
|
|
3086
|
+
}
|
|
3087
|
+
function instanceOfGetCompanyCreditUserUsageParams(value) {
|
|
3088
|
+
return true;
|
|
3089
|
+
}
|
|
3090
|
+
function GetCompanyCreditUserUsageParamsFromJSON(json) {
|
|
3091
|
+
return GetCompanyCreditUserUsageParamsFromJSONTyped(json, false);
|
|
3092
|
+
}
|
|
3093
|
+
function GetCompanyCreditUserUsageParamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
3094
|
+
if (json == null) {
|
|
3095
|
+
return json;
|
|
3096
|
+
}
|
|
3097
|
+
return {
|
|
3098
|
+
limit: json["limit"] == null ? void 0 : json["limit"],
|
|
3099
|
+
offset: json["offset"] == null ? void 0 : json["offset"]
|
|
3100
|
+
};
|
|
3101
|
+
}
|
|
3102
|
+
function GetCompanyCreditUserUsageParamsToJSON(json) {
|
|
3103
|
+
return GetCompanyCreditUserUsageParamsToJSONTyped(json, false);
|
|
3104
|
+
}
|
|
3105
|
+
function GetCompanyCreditUserUsageParamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3106
|
+
if (value == null) {
|
|
3107
|
+
return value;
|
|
3108
|
+
}
|
|
3109
|
+
return {
|
|
3110
|
+
limit: value["limit"],
|
|
3111
|
+
offset: value["offset"]
|
|
3112
|
+
};
|
|
3113
|
+
}
|
|
3114
|
+
function instanceOfGetCompanyCreditUserUsageResponse(value) {
|
|
3115
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
3116
|
+
if (!("params" in value) || value["params"] === void 0) return false;
|
|
3117
|
+
return true;
|
|
3118
|
+
}
|
|
3119
|
+
function GetCompanyCreditUserUsageResponseFromJSON(json) {
|
|
3120
|
+
return GetCompanyCreditUserUsageResponseFromJSONTyped(json, false);
|
|
3121
|
+
}
|
|
3122
|
+
function GetCompanyCreditUserUsageResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
3123
|
+
if (json == null) {
|
|
3124
|
+
return json;
|
|
3125
|
+
}
|
|
3126
|
+
return {
|
|
3127
|
+
data: CompanyCreditUserUsageResponseDataFromJSON(json["data"]),
|
|
3128
|
+
params: GetCompanyCreditUserUsageParamsFromJSON(json["params"])
|
|
3129
|
+
};
|
|
3130
|
+
}
|
|
3131
|
+
function GetCompanyCreditUserUsageResponseToJSON(json) {
|
|
3132
|
+
return GetCompanyCreditUserUsageResponseToJSONTyped(json, false);
|
|
3133
|
+
}
|
|
3134
|
+
function GetCompanyCreditUserUsageResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3135
|
+
if (value == null) {
|
|
3136
|
+
return value;
|
|
3137
|
+
}
|
|
3138
|
+
return {
|
|
3139
|
+
data: CompanyCreditUserUsageResponseDataToJSON(value["data"]),
|
|
3140
|
+
params: GetCompanyCreditUserUsageParamsToJSON(value["params"])
|
|
3141
|
+
};
|
|
3142
|
+
}
|
|
2681
3143
|
function instanceOfGetCompanyFeatureUsageResponse(value) {
|
|
2682
3144
|
if (!("data" in value) || value["data"] === void 0) return false;
|
|
2683
3145
|
if (!("params" in value) || value["params"] === void 0) return false;
|
|
@@ -3377,6 +3839,36 @@ var SchematicBillingClient = class {
|
|
|
3377
3839
|
return GetCompanyFeatureUsageResponseFromJSON(body).data.features;
|
|
3378
3840
|
});
|
|
3379
3841
|
}
|
|
3842
|
+
fetchCreditBalances() {
|
|
3843
|
+
const path = "/company/credits";
|
|
3844
|
+
return this.session.request(path).then((body) => {
|
|
3845
|
+
if (body === null || typeof body !== "object" || !("data" in body)) {
|
|
3846
|
+
throw new Error(`Malformed response from ${path}`);
|
|
3847
|
+
}
|
|
3848
|
+
const data = body.data;
|
|
3849
|
+
if (data == null || data.balances == null) {
|
|
3850
|
+
return [];
|
|
3851
|
+
}
|
|
3852
|
+
return GetCompanyCreditBalancesResponseFromJSON(body).data.balances;
|
|
3853
|
+
});
|
|
3854
|
+
}
|
|
3855
|
+
fetchCreditUserUsage(params) {
|
|
3856
|
+
const query = new URLSearchParams();
|
|
3857
|
+
if (params.limit !== void 0) {
|
|
3858
|
+
query.set("limit", String(params.limit));
|
|
3859
|
+
}
|
|
3860
|
+
if (params.offset !== void 0) {
|
|
3861
|
+
query.set("offset", String(params.offset));
|
|
3862
|
+
}
|
|
3863
|
+
const search = query.toString();
|
|
3864
|
+
const path = `/company/credits/${encodeURIComponent(params.creditId)}/users${search === "" ? "" : `?${search}`}`;
|
|
3865
|
+
return this.session.request(path).then((body) => {
|
|
3866
|
+
if (body === null || typeof body !== "object" || !("data" in body)) {
|
|
3867
|
+
throw new Error(`Malformed response from ${path}`);
|
|
3868
|
+
}
|
|
3869
|
+
return GetCompanyCreditUserUsageResponseFromJSON(body).data;
|
|
3870
|
+
});
|
|
3871
|
+
}
|
|
3380
3872
|
fetchFeatureUserUsage(params) {
|
|
3381
3873
|
const query = new URLSearchParams();
|
|
3382
3874
|
if (params.limit !== void 0) {
|
|
@@ -5667,6 +6159,17 @@ var BillingStore = class {
|
|
|
5667
6159
|
}),
|
|
5668
6160
|
{ readiness }
|
|
5669
6161
|
);
|
|
6162
|
+
this.creditBalances = new KeyedResource(
|
|
6163
|
+
() => this._client.fetchCreditBalances(),
|
|
6164
|
+
{ readiness }
|
|
6165
|
+
);
|
|
6166
|
+
this.creditUserUsage = new KeyedResource(
|
|
6167
|
+
({ creditId }) => this._client.fetchCreditUserUsage({
|
|
6168
|
+
creditId,
|
|
6169
|
+
limit: FEATURE_USER_USAGE_LIMIT
|
|
6170
|
+
}),
|
|
6171
|
+
{ readiness }
|
|
6172
|
+
);
|
|
5670
6173
|
const held = { key: initialData.sessionKey };
|
|
5671
6174
|
if (initialData.invoices !== void 0) {
|
|
5672
6175
|
held.invoices = {
|
|
@@ -5687,7 +6190,10 @@ var BillingStore = class {
|
|
|
5687
6190
|
if (initialData.featureUsage !== void 0) {
|
|
5688
6191
|
held.featureUsage = initialData.featureUsage;
|
|
5689
6192
|
}
|
|
5690
|
-
if (
|
|
6193
|
+
if (initialData.creditBalances !== void 0) {
|
|
6194
|
+
held.creditBalances = initialData.creditBalances;
|
|
6195
|
+
}
|
|
6196
|
+
if (held.invoices !== void 0 || held.upcomingInvoice !== void 0 || held.paymentMethods !== void 0 || held.featureUsage !== void 0 || held.creditBalances !== void 0) {
|
|
5691
6197
|
this._held = held;
|
|
5692
6198
|
this._settleSeed(claimFrom(options.session) ?? claimOf(this._client));
|
|
5693
6199
|
}
|
|
@@ -5697,6 +6203,8 @@ var BillingStore = class {
|
|
|
5697
6203
|
upcomingInvoice;
|
|
5698
6204
|
paymentMethods;
|
|
5699
6205
|
featureUsage;
|
|
6206
|
+
creditBalances;
|
|
6207
|
+
creditUserUsage;
|
|
5700
6208
|
featureUserUsage;
|
|
5701
6209
|
_pageSize;
|
|
5702
6210
|
_unsubscribe;
|
|
@@ -5779,6 +6287,9 @@ var BillingStore = class {
|
|
|
5779
6287
|
if (held.featureUsage !== void 0) {
|
|
5780
6288
|
this.featureUsage.seed(SINGLETON, held.featureUsage);
|
|
5781
6289
|
}
|
|
6290
|
+
if (held.creditBalances !== void 0) {
|
|
6291
|
+
this.creditBalances.seed(SINGLETON, held.creditBalances);
|
|
6292
|
+
}
|
|
5782
6293
|
this._seedKey = held.key;
|
|
5783
6294
|
this._seeded = true;
|
|
5784
6295
|
}
|
|
@@ -5792,6 +6303,7 @@ var BillingStore = class {
|
|
|
5792
6303
|
this[name].resetAll();
|
|
5793
6304
|
}
|
|
5794
6305
|
this.featureUserUsage.resetAll();
|
|
6306
|
+
this.creditUserUsage.resetAll();
|
|
5795
6307
|
}
|
|
5796
6308
|
/** Forgets every resource and leaves them empty; nothing reloads. */
|
|
5797
6309
|
clearAll() {
|
|
@@ -5799,6 +6311,7 @@ var BillingStore = class {
|
|
|
5799
6311
|
this[name].clearAll();
|
|
5800
6312
|
}
|
|
5801
6313
|
this.featureUserUsage.clearAll();
|
|
6314
|
+
this.creditUserUsage.clearAll();
|
|
5802
6315
|
}
|
|
5803
6316
|
/** Loads every resource that is subscribed and has nothing yet. */
|
|
5804
6317
|
resumeAll() {
|
|
@@ -5806,6 +6319,7 @@ var BillingStore = class {
|
|
|
5806
6319
|
this[name].resumeAll();
|
|
5807
6320
|
}
|
|
5808
6321
|
this.featureUserUsage.resumeAll();
|
|
6322
|
+
this.creditUserUsage.resumeAll();
|
|
5809
6323
|
}
|
|
5810
6324
|
/** Reloads every resource that has been loaded, keeping its current data. */
|
|
5811
6325
|
invalidateAll() {
|
|
@@ -5813,6 +6327,7 @@ var BillingStore = class {
|
|
|
5813
6327
|
this[name].invalidateAll();
|
|
5814
6328
|
}
|
|
5815
6329
|
this.featureUserUsage.invalidateAll();
|
|
6330
|
+
this.creditUserUsage.invalidateAll();
|
|
5816
6331
|
}
|
|
5817
6332
|
/**
|
|
5818
6333
|
* Appends the next page to the invoices list for `query`, when there is
|
|
@@ -5925,7 +6440,8 @@ var RESOURCE_NAMES = [
|
|
|
5925
6440
|
"invoices",
|
|
5926
6441
|
"upcomingInvoice",
|
|
5927
6442
|
"paymentMethods",
|
|
5928
|
-
"featureUsage"
|
|
6443
|
+
"featureUsage",
|
|
6444
|
+
"creditBalances"
|
|
5929
6445
|
];
|
|
5930
6446
|
|
|
5931
6447
|
// src/billing/context.tsx
|
|
@@ -6008,6 +6524,9 @@ var missingBillingSource = {
|
|
|
6008
6524
|
subscribeFeatureUserUsage: () => () => {
|
|
6009
6525
|
},
|
|
6010
6526
|
featureUserUsage: () => missingHandle,
|
|
6527
|
+
subscribeCreditUserUsage: () => () => {
|
|
6528
|
+
},
|
|
6529
|
+
creditUserUsage: () => missingHandle,
|
|
6011
6530
|
loadMoreInvoices: () => Promise.resolve(),
|
|
6012
6531
|
invalidateAll: () => {
|
|
6013
6532
|
},
|
|
@@ -6021,6 +6540,7 @@ function useBillingDataSource() {
|
|
|
6021
6540
|
function BillingDataProvider({
|
|
6022
6541
|
actions,
|
|
6023
6542
|
children,
|
|
6543
|
+
creditUserUsage,
|
|
6024
6544
|
data,
|
|
6025
6545
|
featureUserUsage,
|
|
6026
6546
|
locale,
|
|
@@ -6034,6 +6554,7 @@ function BillingDataProvider({
|
|
|
6034
6554
|
const source = useMemo2(() => {
|
|
6035
6555
|
const handles = /* @__PURE__ */ new Map();
|
|
6036
6556
|
const userUsageHandles = /* @__PURE__ */ new Map();
|
|
6557
|
+
const creditUsageHandles = /* @__PURE__ */ new Map();
|
|
6037
6558
|
return {
|
|
6038
6559
|
actions: rejectingActions(
|
|
6039
6560
|
(name) => new Error(BILLING_ACTION_UNAVAILABLE_MESSAGE(name)),
|
|
@@ -6075,6 +6596,24 @@ function BillingDataProvider({
|
|
|
6075
6596
|
userUsageHandles.set(featureId, handle);
|
|
6076
6597
|
return handle;
|
|
6077
6598
|
},
|
|
6599
|
+
subscribeCreditUserUsage: () => () => {
|
|
6600
|
+
},
|
|
6601
|
+
creditUserUsage: (creditId) => {
|
|
6602
|
+
const cached = creditUsageHandles.get(creditId);
|
|
6603
|
+
if (cached !== void 0) {
|
|
6604
|
+
return cached;
|
|
6605
|
+
}
|
|
6606
|
+
const value = creditUserUsage?.[creditId];
|
|
6607
|
+
const handle = {
|
|
6608
|
+
data: value,
|
|
6609
|
+
error: void 0,
|
|
6610
|
+
isPending: value === void 0,
|
|
6611
|
+
refetch: () => {
|
|
6612
|
+
}
|
|
6613
|
+
};
|
|
6614
|
+
creditUsageHandles.set(creditId, handle);
|
|
6615
|
+
return handle;
|
|
6616
|
+
},
|
|
6078
6617
|
loadMoreInvoices: (query) => {
|
|
6079
6618
|
onLoadMoreInvoices?.(query);
|
|
6080
6619
|
return Promise.resolve();
|
|
@@ -6082,7 +6621,15 @@ function BillingDataProvider({
|
|
|
6082
6621
|
invalidateAll: () => {
|
|
6083
6622
|
}
|
|
6084
6623
|
};
|
|
6085
|
-
}, [
|
|
6624
|
+
}, [
|
|
6625
|
+
actions,
|
|
6626
|
+
creditUserUsage,
|
|
6627
|
+
data,
|
|
6628
|
+
featureUserUsage,
|
|
6629
|
+
onLoadMoreInvoices,
|
|
6630
|
+
onRefetch,
|
|
6631
|
+
status
|
|
6632
|
+
]);
|
|
6086
6633
|
return /* @__PURE__ */ jsx2(BillingDataContext.Provider, { value: source, children: /* @__PURE__ */ jsx2(
|
|
6087
6634
|
SchematicI18nProvider,
|
|
6088
6635
|
{
|
|
@@ -6193,6 +6740,21 @@ function useFeatureUserUsage(featureId) {
|
|
|
6193
6740
|
);
|
|
6194
6741
|
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
6195
6742
|
}
|
|
6743
|
+
function useCreditBalances() {
|
|
6744
|
+
return useBillingResource("creditBalances", SINGLETON);
|
|
6745
|
+
}
|
|
6746
|
+
function useCreditUserUsage(creditId) {
|
|
6747
|
+
const source = useBillingDataSource();
|
|
6748
|
+
const subscribe = useCallback(
|
|
6749
|
+
(listener) => source.subscribeCreditUserUsage(creditId, listener),
|
|
6750
|
+
[creditId, source]
|
|
6751
|
+
);
|
|
6752
|
+
const getSnapshot = useCallback(
|
|
6753
|
+
() => source.creditUserUsage(creditId),
|
|
6754
|
+
[creditId, source]
|
|
6755
|
+
);
|
|
6756
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
6757
|
+
}
|
|
6196
6758
|
function useInvalidateBillingData() {
|
|
6197
6759
|
return useBillingDataSource().invalidateAll;
|
|
6198
6760
|
}
|
|
@@ -6270,6 +6832,8 @@ function BillingProvider({
|
|
|
6270
6832
|
handle,
|
|
6271
6833
|
subscribeFeatureUserUsage: (featureId, listener) => store.featureUserUsage.subscribe({ featureId }, listener),
|
|
6272
6834
|
featureUserUsage: (featureId) => handleOf(store.featureUserUsage.get({ featureId })),
|
|
6835
|
+
subscribeCreditUserUsage: (creditId, listener) => store.creditUserUsage.subscribe({ creditId }, listener),
|
|
6836
|
+
creditUserUsage: (creditId) => handleOf(store.creditUserUsage.get({ creditId })),
|
|
6273
6837
|
loadMoreInvoices: (query) => store.loadMoreInvoices(query),
|
|
6274
6838
|
invalidateAll: () => store.invalidateAll(),
|
|
6275
6839
|
actions: {
|
|
@@ -6303,10 +6867,20 @@ function staticSource(data) {
|
|
|
6303
6867
|
refetch: () => {
|
|
6304
6868
|
}
|
|
6305
6869
|
};
|
|
6870
|
+
const pendingCreditUsage = {
|
|
6871
|
+
data: void 0,
|
|
6872
|
+
error: void 0,
|
|
6873
|
+
isPending: true,
|
|
6874
|
+
refetch: () => {
|
|
6875
|
+
}
|
|
6876
|
+
};
|
|
6306
6877
|
return {
|
|
6307
6878
|
subscribeFeatureUserUsage: () => () => {
|
|
6308
6879
|
},
|
|
6309
6880
|
featureUserUsage: () => pendingUserUsage,
|
|
6881
|
+
subscribeCreditUserUsage: () => () => {
|
|
6882
|
+
},
|
|
6883
|
+
creditUserUsage: () => pendingCreditUsage,
|
|
6310
6884
|
subscribe: () => () => {
|
|
6311
6885
|
},
|
|
6312
6886
|
handle: (name) => {
|
|
@@ -6332,7 +6906,7 @@ function staticSource(data) {
|
|
|
6332
6906
|
}
|
|
6333
6907
|
|
|
6334
6908
|
// src/version.ts
|
|
6335
|
-
var version2 = "1.
|
|
6909
|
+
var version2 = "1.12.0";
|
|
6336
6910
|
|
|
6337
6911
|
// src/context/schematic.tsx
|
|
6338
6912
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -6595,6 +7169,8 @@ export {
|
|
|
6595
7169
|
UsagePeriod,
|
|
6596
7170
|
normalizeInvoiceQuery2 as normalizeInvoiceQuery,
|
|
6597
7171
|
useBillingDataSource,
|
|
7172
|
+
useCreditBalances,
|
|
7173
|
+
useCreditUserUsage,
|
|
6598
7174
|
useFeatureUsage,
|
|
6599
7175
|
useFeatureUserUsage,
|
|
6600
7176
|
useInvalidateBillingData,
|