@schematichq/schematic-react 1.12.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.
@@ -1,4 +1,4 @@
1
- // node_modules/.pnpm/@schematichq+schematic-js@1.12.0/node_modules/@schematichq/schematic-js/dist/schematic.esm.js
1
+ // node_modules/.pnpm/@schematichq+schematic-js@1.13.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;
@@ -1326,7 +1326,7 @@ var ContextSignatureManager = class {
1326
1326
  }
1327
1327
  }
1328
1328
  };
1329
- var version = "1.12.0";
1329
+ var version = "1.13.0";
1330
1330
  var SINGLETON = {};
1331
1331
  var models_exports = {};
1332
1332
  __export(models_exports, {
@@ -1376,6 +1376,30 @@ __export(models_exports, {
1376
1376
  CatalogPriceTierResponseDataFromJSONTyped: () => CatalogPriceTierResponseDataFromJSONTyped,
1377
1377
  CatalogPriceTierResponseDataToJSON: () => CatalogPriceTierResponseDataToJSON,
1378
1378
  CatalogPriceTierResponseDataToJSONTyped: () => CatalogPriceTierResponseDataToJSONTyped,
1379
+ CompanyContextCustomPlanBillingResponseDataFromJSON: () => CompanyContextCustomPlanBillingResponseDataFromJSON,
1380
+ CompanyContextCustomPlanBillingResponseDataFromJSONTyped: () => CompanyContextCustomPlanBillingResponseDataFromJSONTyped,
1381
+ CompanyContextCustomPlanBillingResponseDataToJSON: () => CompanyContextCustomPlanBillingResponseDataToJSON,
1382
+ CompanyContextCustomPlanBillingResponseDataToJSONTyped: () => CompanyContextCustomPlanBillingResponseDataToJSONTyped,
1383
+ CompanyContextPlanResponseDataFromJSON: () => CompanyContextPlanResponseDataFromJSON,
1384
+ CompanyContextPlanResponseDataFromJSONTyped: () => CompanyContextPlanResponseDataFromJSONTyped,
1385
+ CompanyContextPlanResponseDataToJSON: () => CompanyContextPlanResponseDataToJSON,
1386
+ CompanyContextPlanResponseDataToJSONTyped: () => CompanyContextPlanResponseDataToJSONTyped,
1387
+ CompanyContextResponseDataFromJSON: () => CompanyContextResponseDataFromJSON,
1388
+ CompanyContextResponseDataFromJSONTyped: () => CompanyContextResponseDataFromJSONTyped,
1389
+ CompanyContextResponseDataToJSON: () => CompanyContextResponseDataToJSON,
1390
+ CompanyContextResponseDataToJSONTyped: () => CompanyContextResponseDataToJSONTyped,
1391
+ CompanyContextScheduledDowngradeResponseDataFromJSON: () => CompanyContextScheduledDowngradeResponseDataFromJSON,
1392
+ CompanyContextScheduledDowngradeResponseDataFromJSONTyped: () => CompanyContextScheduledDowngradeResponseDataFromJSONTyped,
1393
+ CompanyContextScheduledDowngradeResponseDataToJSON: () => CompanyContextScheduledDowngradeResponseDataToJSON,
1394
+ CompanyContextScheduledDowngradeResponseDataToJSONTyped: () => CompanyContextScheduledDowngradeResponseDataToJSONTyped,
1395
+ CompanyContextSubscriptionResponseDataFromJSON: () => CompanyContextSubscriptionResponseDataFromJSON,
1396
+ CompanyContextSubscriptionResponseDataFromJSONTyped: () => CompanyContextSubscriptionResponseDataFromJSONTyped,
1397
+ CompanyContextSubscriptionResponseDataToJSON: () => CompanyContextSubscriptionResponseDataToJSON,
1398
+ CompanyContextSubscriptionResponseDataToJSONTyped: () => CompanyContextSubscriptionResponseDataToJSONTyped,
1399
+ CompanyCreditAutoTopupResponseDataFromJSON: () => CompanyCreditAutoTopupResponseDataFromJSON,
1400
+ CompanyCreditAutoTopupResponseDataFromJSONTyped: () => CompanyCreditAutoTopupResponseDataFromJSONTyped,
1401
+ CompanyCreditAutoTopupResponseDataToJSON: () => CompanyCreditAutoTopupResponseDataToJSON,
1402
+ CompanyCreditAutoTopupResponseDataToJSONTyped: () => CompanyCreditAutoTopupResponseDataToJSONTyped,
1379
1403
  CompanyCreditBalanceResponseDataFromJSON: () => CompanyCreditBalanceResponseDataFromJSON,
1380
1404
  CompanyCreditBalanceResponseDataFromJSONTyped: () => CompanyCreditBalanceResponseDataFromJSONTyped,
1381
1405
  CompanyCreditBalanceResponseDataToJSON: () => CompanyCreditBalanceResponseDataToJSON,
@@ -1444,6 +1468,16 @@ __export(models_exports, {
1444
1468
  CreateSetupIntentResponseFromJSONTyped: () => CreateSetupIntentResponseFromJSONTyped,
1445
1469
  CreateSetupIntentResponseToJSON: () => CreateSetupIntentResponseToJSON,
1446
1470
  CreateSetupIntentResponseToJSONTyped: () => CreateSetupIntentResponseToJSONTyped,
1471
+ Currency: () => Currency,
1472
+ CurrencyFromJSON: () => CurrencyFromJSON2,
1473
+ CurrencyFromJSONTyped: () => CurrencyFromJSONTyped8,
1474
+ CurrencyToJSON: () => CurrencyToJSON2,
1475
+ CurrencyToJSONTyped: () => CurrencyToJSONTyped8,
1476
+ CustomPlanActivationStrategy: () => CustomPlanActivationStrategy,
1477
+ CustomPlanActivationStrategyFromJSON: () => CustomPlanActivationStrategyFromJSON,
1478
+ CustomPlanActivationStrategyFromJSONTyped: () => CustomPlanActivationStrategyFromJSONTyped,
1479
+ CustomPlanActivationStrategyToJSON: () => CustomPlanActivationStrategyToJSON,
1480
+ CustomPlanActivationStrategyToJSONTyped: () => CustomPlanActivationStrategyToJSONTyped,
1447
1481
  DeletePaymentMethodResponseFromJSON: () => DeletePaymentMethodResponseFromJSON,
1448
1482
  DeletePaymentMethodResponseFromJSONTyped: () => DeletePaymentMethodResponseFromJSONTyped,
1449
1483
  DeletePaymentMethodResponseToJSON: () => DeletePaymentMethodResponseToJSON,
@@ -1508,6 +1542,10 @@ __export(models_exports, {
1508
1542
  GetCompanyPaymentMethodsResponseFromJSONTyped: () => GetCompanyPaymentMethodsResponseFromJSONTyped,
1509
1543
  GetCompanyPaymentMethodsResponseToJSON: () => GetCompanyPaymentMethodsResponseToJSON,
1510
1544
  GetCompanyPaymentMethodsResponseToJSONTyped: () => GetCompanyPaymentMethodsResponseToJSONTyped,
1545
+ GetCompanyResponseFromJSON: () => GetCompanyResponseFromJSON,
1546
+ GetCompanyResponseFromJSONTyped: () => GetCompanyResponseFromJSONTyped,
1547
+ GetCompanyResponseToJSON: () => GetCompanyResponseToJSON,
1548
+ GetCompanyResponseToJSONTyped: () => GetCompanyResponseToJSONTyped,
1511
1549
  GetCompanyUpcomingInvoiceResponseFromJSON: () => GetCompanyUpcomingInvoiceResponseFromJSON,
1512
1550
  GetCompanyUpcomingInvoiceResponseFromJSONTyped: () => GetCompanyUpcomingInvoiceResponseFromJSONTyped,
1513
1551
  GetCompanyUpcomingInvoiceResponseToJSON: () => GetCompanyUpcomingInvoiceResponseToJSON,
@@ -1558,6 +1596,12 @@ __export(models_exports, {
1558
1596
  instanceOfCatalogCreditGrantResponseData: () => instanceOfCatalogCreditGrantResponseData,
1559
1597
  instanceOfCatalogPriceResponseData: () => instanceOfCatalogPriceResponseData,
1560
1598
  instanceOfCatalogPriceTierResponseData: () => instanceOfCatalogPriceTierResponseData,
1599
+ instanceOfCompanyContextCustomPlanBillingResponseData: () => instanceOfCompanyContextCustomPlanBillingResponseData,
1600
+ instanceOfCompanyContextPlanResponseData: () => instanceOfCompanyContextPlanResponseData,
1601
+ instanceOfCompanyContextResponseData: () => instanceOfCompanyContextResponseData,
1602
+ instanceOfCompanyContextScheduledDowngradeResponseData: () => instanceOfCompanyContextScheduledDowngradeResponseData,
1603
+ instanceOfCompanyContextSubscriptionResponseData: () => instanceOfCompanyContextSubscriptionResponseData,
1604
+ instanceOfCompanyCreditAutoTopupResponseData: () => instanceOfCompanyCreditAutoTopupResponseData,
1561
1605
  instanceOfCompanyCreditBalanceResponseData: () => instanceOfCompanyCreditBalanceResponseData,
1562
1606
  instanceOfCompanyCreditBalancesResponseData: () => instanceOfCompanyCreditBalancesResponseData,
1563
1607
  instanceOfCompanyCreditCompositionResponseData: () => instanceOfCompanyCreditCompositionResponseData,
@@ -1575,6 +1619,8 @@ __export(models_exports, {
1575
1619
  instanceOfCompanyUpcomingInvoiceResponseData: () => instanceOfCompanyUpcomingInvoiceResponseData,
1576
1620
  instanceOfCompanyUserUsageResponseData: () => instanceOfCompanyUserUsageResponseData,
1577
1621
  instanceOfCreateSetupIntentResponse: () => instanceOfCreateSetupIntentResponse,
1622
+ instanceOfCurrency: () => instanceOfCurrency,
1623
+ instanceOfCustomPlanActivationStrategy: () => instanceOfCustomPlanActivationStrategy,
1578
1624
  instanceOfDeletePaymentMethodResponse: () => instanceOfDeletePaymentMethodResponse,
1579
1625
  instanceOfDeleteResponse: () => instanceOfDeleteResponse,
1580
1626
  instanceOfEntitlementPriceBehavior: () => instanceOfEntitlementPriceBehavior,
@@ -1590,6 +1636,7 @@ __export(models_exports, {
1590
1636
  instanceOfGetCompanyInvoicesParams: () => instanceOfGetCompanyInvoicesParams,
1591
1637
  instanceOfGetCompanyInvoicesResponse: () => instanceOfGetCompanyInvoicesResponse,
1592
1638
  instanceOfGetCompanyPaymentMethodsResponse: () => instanceOfGetCompanyPaymentMethodsResponse,
1639
+ instanceOfGetCompanyResponse: () => instanceOfGetCompanyResponse,
1593
1640
  instanceOfGetCompanyUpcomingInvoiceResponse: () => instanceOfGetCompanyUpcomingInvoiceResponse,
1594
1641
  instanceOfInvoiceStatus: () => instanceOfInvoiceStatus,
1595
1642
  instanceOfMetricPeriod: () => instanceOfMetricPeriod,
@@ -1916,6 +1963,164 @@ function CatalogPriceTierResponseDataToJSONTyped(value, ignoreDiscriminator = fa
1916
1963
  to: value["to"]
1917
1964
  };
1918
1965
  }
1966
+ var Currency = {
1967
+ Aed: "aed",
1968
+ Afn: "afn",
1969
+ All: "all",
1970
+ Amd: "amd",
1971
+ Ang: "ang",
1972
+ Aoa: "aoa",
1973
+ Ars: "ars",
1974
+ Aud: "aud",
1975
+ Awg: "awg",
1976
+ Azn: "azn",
1977
+ Bam: "bam",
1978
+ Bbd: "bbd",
1979
+ Bdt: "bdt",
1980
+ Bif: "bif",
1981
+ Bmd: "bmd",
1982
+ Bnd: "bnd",
1983
+ Bob: "bob",
1984
+ Brl: "brl",
1985
+ Bsd: "bsd",
1986
+ Bwp: "bwp",
1987
+ Byn: "byn",
1988
+ Bzd: "bzd",
1989
+ Cad: "cad",
1990
+ Cdf: "cdf",
1991
+ Chf: "chf",
1992
+ Clp: "clp",
1993
+ Cny: "cny",
1994
+ Cop: "cop",
1995
+ Crc: "crc",
1996
+ Cve: "cve",
1997
+ Czk: "czk",
1998
+ Djf: "djf",
1999
+ Dkk: "dkk",
2000
+ Dop: "dop",
2001
+ Dzd: "dzd",
2002
+ Egp: "egp",
2003
+ Etb: "etb",
2004
+ Eur: "eur",
2005
+ Fjd: "fjd",
2006
+ Fkp: "fkp",
2007
+ Gbp: "gbp",
2008
+ Gel: "gel",
2009
+ Gip: "gip",
2010
+ Gmd: "gmd",
2011
+ Gnf: "gnf",
2012
+ Gtq: "gtq",
2013
+ Gyd: "gyd",
2014
+ Hkd: "hkd",
2015
+ Hnl: "hnl",
2016
+ Htg: "htg",
2017
+ Huf: "huf",
2018
+ Idr: "idr",
2019
+ Ils: "ils",
2020
+ Inr: "inr",
2021
+ Isk: "isk",
2022
+ Jmd: "jmd",
2023
+ Jpy: "jpy",
2024
+ Kes: "kes",
2025
+ Kgs: "kgs",
2026
+ Khr: "khr",
2027
+ Kmf: "kmf",
2028
+ Krw: "krw",
2029
+ Kyd: "kyd",
2030
+ Kzt: "kzt",
2031
+ Lak: "lak",
2032
+ Lbp: "lbp",
2033
+ Lkr: "lkr",
2034
+ Lrd: "lrd",
2035
+ Lsl: "lsl",
2036
+ Mad: "mad",
2037
+ Mdl: "mdl",
2038
+ Mga: "mga",
2039
+ Mkd: "mkd",
2040
+ Mmk: "mmk",
2041
+ Mnt: "mnt",
2042
+ Mop: "mop",
2043
+ Mur: "mur",
2044
+ Mvr: "mvr",
2045
+ Mwk: "mwk",
2046
+ Mxn: "mxn",
2047
+ Myr: "myr",
2048
+ Mzn: "mzn",
2049
+ Nad: "nad",
2050
+ Ngn: "ngn",
2051
+ Nio: "nio",
2052
+ Nok: "nok",
2053
+ Npr: "npr",
2054
+ Nzd: "nzd",
2055
+ Pab: "pab",
2056
+ Pen: "pen",
2057
+ Pgk: "pgk",
2058
+ Php: "php",
2059
+ Pkr: "pkr",
2060
+ Pln: "pln",
2061
+ Pyg: "pyg",
2062
+ Qar: "qar",
2063
+ Ron: "ron",
2064
+ Rsd: "rsd",
2065
+ Rub: "rub",
2066
+ Rwf: "rwf",
2067
+ Sar: "sar",
2068
+ Sbd: "sbd",
2069
+ Scr: "scr",
2070
+ Sek: "sek",
2071
+ Sgd: "sgd",
2072
+ Shp: "shp",
2073
+ Sle: "sle",
2074
+ Sos: "sos",
2075
+ Srd: "srd",
2076
+ Std: "std",
2077
+ Szl: "szl",
2078
+ Thb: "thb",
2079
+ Tjs: "tjs",
2080
+ Top: "top",
2081
+ Try: "try",
2082
+ Ttd: "ttd",
2083
+ Twd: "twd",
2084
+ Tzs: "tzs",
2085
+ Uah: "uah",
2086
+ Ugx: "ugx",
2087
+ Usd: "usd",
2088
+ Uyu: "uyu",
2089
+ Uzs: "uzs",
2090
+ Vnd: "vnd",
2091
+ Vuv: "vuv",
2092
+ Wst: "wst",
2093
+ Xaf: "xaf",
2094
+ Xcd: "xcd",
2095
+ Xcg: "xcg",
2096
+ Xof: "xof",
2097
+ Xpf: "xpf",
2098
+ Yer: "yer",
2099
+ Zar: "zar",
2100
+ Zmw: "zmw"
2101
+ };
2102
+ function instanceOfCurrency(value) {
2103
+ for (const key in Currency) {
2104
+ if (Object.prototype.hasOwnProperty.call(Currency, key)) {
2105
+ if (Currency[key] === value) {
2106
+ return true;
2107
+ }
2108
+ }
2109
+ }
2110
+ return false;
2111
+ }
2112
+ function CurrencyFromJSON2(json) {
2113
+ return CurrencyFromJSONTyped8(json, false);
2114
+ }
2115
+ function CurrencyFromJSONTyped8(json, ignoreDiscriminator) {
2116
+ return json;
2117
+ }
2118
+ function CurrencyToJSON2(value) {
2119
+ return value;
2120
+ }
2121
+ function CurrencyToJSONTyped8(value, ignoreDiscriminator) {
2122
+ return value;
2123
+ }
1919
2124
  function instanceOfCatalogPriceResponseData(value) {
1920
2125
  if (!("currency" in value) || value["currency"] === void 0) return false;
1921
2126
  if (!("id" in value) || value["id"] === void 0) return false;
@@ -1938,7 +2143,7 @@ function CatalogPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
1938
2143
  return json;
1939
2144
  }
1940
2145
  return {
1941
- currency: json["currency"],
2146
+ currency: CurrencyFromJSON2(json["currency"]),
1942
2147
  id: json["id"],
1943
2148
  interval: BillingProductPriceIntervalFromJSON2(json["interval"]),
1944
2149
  intervalCount: json["interval_count"],
@@ -1961,7 +2166,7 @@ function CatalogPriceResponseDataToJSONTyped(value, ignoreDiscriminator = false)
1961
2166
  return value;
1962
2167
  }
1963
2168
  return {
1964
- currency: value["currency"],
2169
+ currency: CurrencyToJSON2(value["currency"]),
1965
2170
  id: value["id"],
1966
2171
  interval: BillingProductPriceIntervalToJSON2(value["interval"]),
1967
2172
  interval_count: value["intervalCount"],
@@ -1976,6 +2181,281 @@ function CatalogPriceResponseDataToJSONTyped(value, ignoreDiscriminator = false)
1976
2181
  tiers_mode: BillingTiersModeToJSON2(value["tiersMode"])
1977
2182
  };
1978
2183
  }
2184
+ var CustomPlanActivationStrategy = {
2185
+ Payment: "on_payment",
2186
+ Publish: "on_publish"
2187
+ };
2188
+ function instanceOfCustomPlanActivationStrategy(value) {
2189
+ for (const key in CustomPlanActivationStrategy) {
2190
+ if (Object.prototype.hasOwnProperty.call(CustomPlanActivationStrategy, key)) {
2191
+ if (CustomPlanActivationStrategy[key] === value) {
2192
+ return true;
2193
+ }
2194
+ }
2195
+ }
2196
+ return false;
2197
+ }
2198
+ function CustomPlanActivationStrategyFromJSON(json) {
2199
+ return CustomPlanActivationStrategyFromJSONTyped(json, false);
2200
+ }
2201
+ function CustomPlanActivationStrategyFromJSONTyped(json, ignoreDiscriminator) {
2202
+ return json;
2203
+ }
2204
+ function CustomPlanActivationStrategyToJSON(value) {
2205
+ return value;
2206
+ }
2207
+ function CustomPlanActivationStrategyToJSONTyped(value, ignoreDiscriminator) {
2208
+ return value;
2209
+ }
2210
+ function instanceOfCompanyContextCustomPlanBillingResponseData(value) {
2211
+ if (!("activationStrategy" in value) || value["activationStrategy"] === void 0)
2212
+ return false;
2213
+ if (!("dueAt" in value) || value["dueAt"] === void 0) return false;
2214
+ if (!("planId" in value) || value["planId"] === void 0) return false;
2215
+ return true;
2216
+ }
2217
+ function CompanyContextCustomPlanBillingResponseDataFromJSON(json) {
2218
+ return CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, false);
2219
+ }
2220
+ function CompanyContextCustomPlanBillingResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2221
+ if (json == null) {
2222
+ return json;
2223
+ }
2224
+ return {
2225
+ activationStrategy: CustomPlanActivationStrategyFromJSON(
2226
+ json["activation_strategy"]
2227
+ ),
2228
+ dueAt: new Date(json["due_at"]),
2229
+ invoiceUrl: json["invoice_url"] == null ? void 0 : json["invoice_url"],
2230
+ planId: json["plan_id"],
2231
+ planName: json["plan_name"] == null ? void 0 : json["plan_name"]
2232
+ };
2233
+ }
2234
+ function CompanyContextCustomPlanBillingResponseDataToJSON(json) {
2235
+ return CompanyContextCustomPlanBillingResponseDataToJSONTyped(json, false);
2236
+ }
2237
+ function CompanyContextCustomPlanBillingResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2238
+ if (value == null) {
2239
+ return value;
2240
+ }
2241
+ return {
2242
+ activation_strategy: CustomPlanActivationStrategyToJSON(
2243
+ value["activationStrategy"]
2244
+ ),
2245
+ due_at: value["dueAt"].toISOString(),
2246
+ invoice_url: value["invoiceUrl"],
2247
+ plan_id: value["planId"],
2248
+ plan_name: value["planName"]
2249
+ };
2250
+ }
2251
+ function instanceOfCompanyContextPlanResponseData(value) {
2252
+ if (!("id" in value) || value["id"] === void 0) return false;
2253
+ if (!("includedCreditIds" in value) || value["includedCreditIds"] === void 0)
2254
+ return false;
2255
+ if (!("name" in value) || value["name"] === void 0) return false;
2256
+ return true;
2257
+ }
2258
+ function CompanyContextPlanResponseDataFromJSON(json) {
2259
+ return CompanyContextPlanResponseDataFromJSONTyped(json, false);
2260
+ }
2261
+ function CompanyContextPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2262
+ if (json == null) {
2263
+ return json;
2264
+ }
2265
+ return {
2266
+ description: json["description"] == null ? void 0 : json["description"],
2267
+ id: json["id"],
2268
+ includedCreditIds: json["included_credit_ids"],
2269
+ name: json["name"],
2270
+ period: json["period"] == null ? void 0 : json["period"],
2271
+ price: json["price"] == null ? void 0 : json["price"]
2272
+ };
2273
+ }
2274
+ function CompanyContextPlanResponseDataToJSON(json) {
2275
+ return CompanyContextPlanResponseDataToJSONTyped(json, false);
2276
+ }
2277
+ function CompanyContextPlanResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2278
+ if (value == null) {
2279
+ return value;
2280
+ }
2281
+ return {
2282
+ description: value["description"],
2283
+ id: value["id"],
2284
+ included_credit_ids: value["includedCreditIds"],
2285
+ name: value["name"],
2286
+ period: value["period"],
2287
+ price: value["price"]
2288
+ };
2289
+ }
2290
+ function instanceOfCompanyContextScheduledDowngradeResponseData(value) {
2291
+ if (!("fromPlanId" in value) || value["fromPlanId"] === void 0)
2292
+ return false;
2293
+ if (!("fromPlanName" in value) || value["fromPlanName"] === void 0)
2294
+ return false;
2295
+ if (!("toPlanId" in value) || value["toPlanId"] === void 0) return false;
2296
+ if (!("toPlanName" in value) || value["toPlanName"] === void 0)
2297
+ return false;
2298
+ return true;
2299
+ }
2300
+ function CompanyContextScheduledDowngradeResponseDataFromJSON(json) {
2301
+ return CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, false);
2302
+ }
2303
+ function CompanyContextScheduledDowngradeResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2304
+ if (json == null) {
2305
+ return json;
2306
+ }
2307
+ return {
2308
+ fromPlanId: json["from_plan_id"],
2309
+ fromPlanName: json["from_plan_name"],
2310
+ toPlanId: json["to_plan_id"],
2311
+ toPlanName: json["to_plan_name"]
2312
+ };
2313
+ }
2314
+ function CompanyContextScheduledDowngradeResponseDataToJSON(json) {
2315
+ return CompanyContextScheduledDowngradeResponseDataToJSONTyped(json, false);
2316
+ }
2317
+ function CompanyContextScheduledDowngradeResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2318
+ if (value == null) {
2319
+ return value;
2320
+ }
2321
+ return {
2322
+ from_plan_id: value["fromPlanId"],
2323
+ from_plan_name: value["fromPlanName"],
2324
+ to_plan_id: value["toPlanId"],
2325
+ to_plan_name: value["toPlanName"]
2326
+ };
2327
+ }
2328
+ function instanceOfCompanyContextSubscriptionResponseData(value) {
2329
+ if (!("cancelAtPeriodEnd" in value) || value["cancelAtPeriodEnd"] === void 0)
2330
+ return false;
2331
+ if (!("currency" in value) || value["currency"] === void 0) return false;
2332
+ if (!("status" in value) || value["status"] === void 0) return false;
2333
+ return true;
2334
+ }
2335
+ function CompanyContextSubscriptionResponseDataFromJSON(json) {
2336
+ return CompanyContextSubscriptionResponseDataFromJSONTyped(json, false);
2337
+ }
2338
+ function CompanyContextSubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2339
+ if (json == null) {
2340
+ return json;
2341
+ }
2342
+ return {
2343
+ cancelAt: json["cancel_at"] == null ? void 0 : new Date(json["cancel_at"]),
2344
+ cancelAtPeriodEnd: json["cancel_at_period_end"],
2345
+ currency: CurrencyFromJSON2(json["currency"]),
2346
+ nextBillAt: json["next_bill_at"] == null ? void 0 : new Date(json["next_bill_at"]),
2347
+ period: json["period"] == null ? void 0 : json["period"],
2348
+ periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
2349
+ status: json["status"],
2350
+ trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
2351
+ };
2352
+ }
2353
+ function CompanyContextSubscriptionResponseDataToJSON(json) {
2354
+ return CompanyContextSubscriptionResponseDataToJSONTyped(json, false);
2355
+ }
2356
+ function CompanyContextSubscriptionResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2357
+ if (value == null) {
2358
+ return value;
2359
+ }
2360
+ return {
2361
+ cancel_at: value["cancelAt"] == null ? void 0 : value["cancelAt"].toISOString(),
2362
+ cancel_at_period_end: value["cancelAtPeriodEnd"],
2363
+ currency: CurrencyToJSON2(value["currency"]),
2364
+ next_bill_at: value["nextBillAt"] == null ? void 0 : value["nextBillAt"].toISOString(),
2365
+ period: value["period"],
2366
+ period_end: value["periodEnd"] == null ? void 0 : value["periodEnd"].toISOString(),
2367
+ status: value["status"],
2368
+ trial_end: value["trialEnd"] == null ? void 0 : value["trialEnd"].toISOString()
2369
+ };
2370
+ }
2371
+ function instanceOfCompanyContextResponseData(value) {
2372
+ if (!("addOns" in value) || value["addOns"] === void 0) return false;
2373
+ if (!("id" in value) || value["id"] === void 0) return false;
2374
+ if (!("name" in value) || value["name"] === void 0) return false;
2375
+ return true;
2376
+ }
2377
+ function CompanyContextResponseDataFromJSON(json) {
2378
+ return CompanyContextResponseDataFromJSONTyped(json, false);
2379
+ }
2380
+ function CompanyContextResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2381
+ if (json == null) {
2382
+ return json;
2383
+ }
2384
+ return {
2385
+ addOns: json["add_ons"].map(
2386
+ CompanyContextPlanResponseDataFromJSON
2387
+ ),
2388
+ customPlanBilling: json["custom_plan_billing"] == null ? void 0 : CompanyContextCustomPlanBillingResponseDataFromJSON(
2389
+ json["custom_plan_billing"]
2390
+ ),
2391
+ id: json["id"],
2392
+ name: json["name"],
2393
+ plan: json["plan"] == null ? void 0 : CompanyContextPlanResponseDataFromJSON(json["plan"]),
2394
+ scheduledDowngrade: json["scheduled_downgrade"] == null ? void 0 : CompanyContextScheduledDowngradeResponseDataFromJSON(
2395
+ json["scheduled_downgrade"]
2396
+ ),
2397
+ subscription: json["subscription"] == null ? void 0 : CompanyContextSubscriptionResponseDataFromJSON(json["subscription"])
2398
+ };
2399
+ }
2400
+ function CompanyContextResponseDataToJSON(json) {
2401
+ return CompanyContextResponseDataToJSONTyped(json, false);
2402
+ }
2403
+ function CompanyContextResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2404
+ if (value == null) {
2405
+ return value;
2406
+ }
2407
+ return {
2408
+ add_ons: value["addOns"].map(
2409
+ CompanyContextPlanResponseDataToJSON
2410
+ ),
2411
+ custom_plan_billing: CompanyContextCustomPlanBillingResponseDataToJSON(
2412
+ value["customPlanBilling"]
2413
+ ),
2414
+ id: value["id"],
2415
+ name: value["name"],
2416
+ plan: CompanyContextPlanResponseDataToJSON(value["plan"]),
2417
+ scheduled_downgrade: CompanyContextScheduledDowngradeResponseDataToJSON(
2418
+ value["scheduledDowngrade"]
2419
+ ),
2420
+ subscription: CompanyContextSubscriptionResponseDataToJSON(
2421
+ value["subscription"]
2422
+ )
2423
+ };
2424
+ }
2425
+ function instanceOfCompanyCreditAutoTopupResponseData(value) {
2426
+ if (!("enabled" in value) || value["enabled"] === void 0) return false;
2427
+ if (!("selfService" in value) || value["selfService"] === void 0)
2428
+ return false;
2429
+ return true;
2430
+ }
2431
+ function CompanyCreditAutoTopupResponseDataFromJSON(json) {
2432
+ return CompanyCreditAutoTopupResponseDataFromJSONTyped(json, false);
2433
+ }
2434
+ function CompanyCreditAutoTopupResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2435
+ if (json == null) {
2436
+ return json;
2437
+ }
2438
+ return {
2439
+ amount: json["amount"] == null ? void 0 : json["amount"],
2440
+ enabled: json["enabled"],
2441
+ selfService: json["self_service"],
2442
+ thresholdCredits: json["threshold_credits"] == null ? void 0 : json["threshold_credits"]
2443
+ };
2444
+ }
2445
+ function CompanyCreditAutoTopupResponseDataToJSON(json) {
2446
+ return CompanyCreditAutoTopupResponseDataToJSONTyped(json, false);
2447
+ }
2448
+ function CompanyCreditAutoTopupResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
2449
+ if (value == null) {
2450
+ return value;
2451
+ }
2452
+ return {
2453
+ amount: value["amount"],
2454
+ enabled: value["enabled"],
2455
+ self_service: value["selfService"],
2456
+ threshold_credits: value["thresholdCredits"]
2457
+ };
2458
+ }
1979
2459
  function instanceOfCompanyCreditGrantResponseData(value) {
1980
2460
  if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1981
2461
  if (!("grantReason" in value) || value["grantReason"] === void 0)
@@ -2113,6 +2593,7 @@ function CompanyCreditBalanceResponseDataFromJSONTyped(json, ignoreDiscriminator
2113
2593
  return json;
2114
2594
  }
2115
2595
  return {
2596
+ autoTopup: json["auto_topup"] == null ? void 0 : CompanyCreditAutoTopupResponseDataFromJSON(json["auto_topup"]),
2116
2597
  composition: json["composition"] == null ? void 0 : CompanyCreditCompositionResponseDataFromJSON(json["composition"]),
2117
2598
  creditDescription: json["credit_description"],
2118
2599
  creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
@@ -2139,6 +2620,7 @@ function CompanyCreditBalanceResponseDataToJSONTyped(value, ignoreDiscriminator
2139
2620
  return value;
2140
2621
  }
2141
2622
  return {
2623
+ auto_topup: CompanyCreditAutoTopupResponseDataToJSON(value["autoTopup"]),
2142
2624
  composition: CompanyCreditCompositionResponseDataToJSON(
2143
2625
  value["composition"]
2144
2626
  ),
@@ -2284,7 +2766,7 @@ function CompanyDiscountResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2284
2766
  return {
2285
2767
  amountOff: json["amount_off"] == null ? void 0 : json["amount_off"],
2286
2768
  couponName: json["coupon_name"],
2287
- currency: json["currency"] == null ? void 0 : json["currency"],
2769
+ currency: json["currency"] == null ? void 0 : CurrencyFromJSON2(json["currency"]),
2288
2770
  customerFacingCode: json["customer_facing_code"] == null ? void 0 : json["customer_facing_code"],
2289
2771
  duration: json["duration"],
2290
2772
  durationInMonths: json["duration_in_months"] == null ? void 0 : json["duration_in_months"],
@@ -2301,7 +2783,7 @@ function CompanyDiscountResponseDataToJSONTyped(value, ignoreDiscriminator = fal
2301
2783
  return {
2302
2784
  amount_off: value["amountOff"],
2303
2785
  coupon_name: value["couponName"],
2304
- currency: value["currency"],
2786
+ currency: CurrencyToJSON2(value["currency"]),
2305
2787
  customer_facing_code: value["customerFacingCode"],
2306
2788
  duration: value["duration"],
2307
2789
  duration_in_months: value["durationInMonths"],
@@ -2742,7 +3224,7 @@ function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
2742
3224
  return {
2743
3225
  amountDue: json["amount_due"],
2744
3226
  createdAt: new Date(json["created_at"]),
2745
- currency: json["currency"],
3227
+ currency: CurrencyFromJSON2(json["currency"]),
2746
3228
  dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
2747
3229
  id: json["id"],
2748
3230
  status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
@@ -2759,7 +3241,7 @@ function CompanyInvoiceResponseDataToJSONTyped(value, ignoreDiscriminator = fals
2759
3241
  return {
2760
3242
  amount_due: value["amountDue"],
2761
3243
  created_at: value["createdAt"].toISOString(),
2762
- currency: value["currency"],
3244
+ currency: CurrencyToJSON2(value["currency"]),
2763
3245
  due_date: value["dueDate"] == null ? void 0 : value["dueDate"].toISOString(),
2764
3246
  id: value["id"],
2765
3247
  status: InvoiceStatusToJSON(value["status"]),
@@ -2910,7 +3392,7 @@ function CompanyUpcomingInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminat
2910
3392
  }
2911
3393
  return {
2912
3394
  amountDue: json["amount_due"],
2913
- currency: json["currency"],
3395
+ currency: CurrencyFromJSON2(json["currency"]),
2914
3396
  customerBalanceApplied: json["customer_balance_applied"],
2915
3397
  customerBalanceRemaining: json["customer_balance_remaining"],
2916
3398
  discounts: json["discounts"].map(
@@ -2929,7 +3411,7 @@ function CompanyUpcomingInvoiceResponseDataToJSONTyped(value, ignoreDiscriminato
2929
3411
  }
2930
3412
  return {
2931
3413
  amount_due: value["amountDue"],
2932
- currency: value["currency"],
3414
+ currency: CurrencyToJSON2(value["currency"]),
2933
3415
  customer_balance_applied: value["customerBalanceApplied"],
2934
3416
  customer_balance_remaining: value["customerBalanceRemaining"],
2935
3417
  discounts: value["discounts"].map(
@@ -3312,6 +3794,35 @@ function GetCompanyPaymentMethodsResponseToJSONTyped(value, ignoreDiscriminator
3312
3794
  params: value["params"]
3313
3795
  };
3314
3796
  }
3797
+ function instanceOfGetCompanyResponse(value) {
3798
+ if (!("data" in value) || value["data"] === void 0) return false;
3799
+ if (!("params" in value) || value["params"] === void 0) return false;
3800
+ return true;
3801
+ }
3802
+ function GetCompanyResponseFromJSON(json) {
3803
+ return GetCompanyResponseFromJSONTyped(json, false);
3804
+ }
3805
+ function GetCompanyResponseFromJSONTyped(json, ignoreDiscriminator) {
3806
+ if (json == null) {
3807
+ return json;
3808
+ }
3809
+ return {
3810
+ data: CompanyContextResponseDataFromJSON(json["data"]),
3811
+ params: json["params"]
3812
+ };
3813
+ }
3814
+ function GetCompanyResponseToJSON(json) {
3815
+ return GetCompanyResponseToJSONTyped(json, false);
3816
+ }
3817
+ function GetCompanyResponseToJSONTyped(value, ignoreDiscriminator = false) {
3818
+ if (value == null) {
3819
+ return value;
3820
+ }
3821
+ return {
3822
+ data: CompanyContextResponseDataToJSON(value["data"]),
3823
+ params: value["params"]
3824
+ };
3825
+ }
3315
3826
  function instanceOfGetCompanyUpcomingInvoiceResponse(value) {
3316
3827
  if (!("data" in value) || value["data"] === void 0) return false;
3317
3828
  if (!("params" in value) || value["params"] === void 0) return false;
@@ -3839,6 +4350,15 @@ var SchematicBillingClient = class {
3839
4350
  return GetCompanyFeatureUsageResponseFromJSON(body).data.features;
3840
4351
  });
3841
4352
  }
4353
+ fetchCompany() {
4354
+ const path = "/company";
4355
+ return this.session.request(path).then((body) => {
4356
+ if (body === null || typeof body !== "object" || !("data" in body) || body.data == null) {
4357
+ throw new Error(`Malformed response from ${path}`);
4358
+ }
4359
+ return GetCompanyResponseFromJSON(body).data;
4360
+ });
4361
+ }
3842
4362
  fetchCreditBalances() {
3843
4363
  const path = "/company/credits";
3844
4364
  return this.session.request(path).then((body) => {
@@ -6163,6 +6683,9 @@ var BillingStore = class {
6163
6683
  () => this._client.fetchCreditBalances(),
6164
6684
  { readiness }
6165
6685
  );
6686
+ this.company = new KeyedResource(() => this._client.fetchCompany(), {
6687
+ readiness
6688
+ });
6166
6689
  this.creditUserUsage = new KeyedResource(
6167
6690
  ({ creditId }) => this._client.fetchCreditUserUsage({
6168
6691
  creditId,
@@ -6193,7 +6716,10 @@ var BillingStore = class {
6193
6716
  if (initialData.creditBalances !== void 0) {
6194
6717
  held.creditBalances = initialData.creditBalances;
6195
6718
  }
6196
- if (held.invoices !== void 0 || held.upcomingInvoice !== void 0 || held.paymentMethods !== void 0 || held.featureUsage !== void 0 || held.creditBalances !== void 0) {
6719
+ if (initialData.company !== void 0) {
6720
+ held.company = initialData.company;
6721
+ }
6722
+ 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) {
6197
6723
  this._held = held;
6198
6724
  this._settleSeed(claimFrom(options.session) ?? claimOf(this._client));
6199
6725
  }
@@ -6204,6 +6730,7 @@ var BillingStore = class {
6204
6730
  paymentMethods;
6205
6731
  featureUsage;
6206
6732
  creditBalances;
6733
+ company;
6207
6734
  creditUserUsage;
6208
6735
  featureUserUsage;
6209
6736
  _pageSize;
@@ -6290,6 +6817,9 @@ var BillingStore = class {
6290
6817
  if (held.creditBalances !== void 0) {
6291
6818
  this.creditBalances.seed(SINGLETON, held.creditBalances);
6292
6819
  }
6820
+ if (held.company !== void 0) {
6821
+ this.company.seed(SINGLETON, held.company);
6822
+ }
6293
6823
  this._seedKey = held.key;
6294
6824
  this._seeded = true;
6295
6825
  }
@@ -6441,7 +6971,8 @@ var RESOURCE_NAMES = [
6441
6971
  "upcomingInvoice",
6442
6972
  "paymentMethods",
6443
6973
  "featureUsage",
6444
- "creditBalances"
6974
+ "creditBalances",
6975
+ "company"
6445
6976
  ];
6446
6977
 
6447
6978
  // src/billing/context.tsx
@@ -6740,6 +7271,9 @@ function useFeatureUserUsage(featureId) {
6740
7271
  );
6741
7272
  return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
6742
7273
  }
7274
+ function useCompany() {
7275
+ return useBillingResource("company", SINGLETON);
7276
+ }
6743
7277
  function useCreditBalances() {
6744
7278
  return useBillingResource("creditBalances", SINGLETON);
6745
7279
  }
@@ -6906,7 +7440,7 @@ function staticSource(data) {
6906
7440
  }
6907
7441
 
6908
7442
  // src/version.ts
6909
- var version2 = "1.12.0";
7443
+ var version2 = "1.13.0";
6910
7444
 
6911
7445
  // src/context/schematic.tsx
6912
7446
  import { jsx as jsx4 } from "react/jsx-runtime";
@@ -7169,6 +7703,7 @@ export {
7169
7703
  UsagePeriod,
7170
7704
  normalizeInvoiceQuery2 as normalizeInvoiceQuery,
7171
7705
  useBillingDataSource,
7706
+ useCompany,
7172
7707
  useCreditBalances,
7173
7708
  useCreditUserUsage,
7174
7709
  useFeatureUsage,