@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.
@@ -67,6 +67,12 @@ declare namespace billingApi {
67
67
  ApiErrorToJSON,
68
68
  ApiErrorToJSONTyped,
69
69
  ApiError,
70
+ instanceOfBillingCreditGrantReason,
71
+ BillingCreditGrantReasonFromJSON,
72
+ BillingCreditGrantReasonFromJSONTyped,
73
+ BillingCreditGrantReasonToJSON,
74
+ BillingCreditGrantReasonToJSONTyped,
75
+ BillingCreditGrantReason,
70
76
  instanceOfBillingPlanCreditGrantResetCadence,
71
77
  BillingPlanCreditGrantResetCadenceFromJSON,
72
78
  BillingPlanCreditGrantResetCadenceFromJSONTyped,
@@ -115,6 +121,78 @@ declare namespace billingApi {
115
121
  CatalogPriceTierResponseDataToJSON,
116
122
  CatalogPriceTierResponseDataToJSONTyped,
117
123
  CatalogPriceTierResponseData,
124
+ instanceOfCompanyContextCustomPlanBillingResponseData,
125
+ CompanyContextCustomPlanBillingResponseDataFromJSON,
126
+ CompanyContextCustomPlanBillingResponseDataFromJSONTyped,
127
+ CompanyContextCustomPlanBillingResponseDataToJSON,
128
+ CompanyContextCustomPlanBillingResponseDataToJSONTyped,
129
+ CompanyContextCustomPlanBillingResponseData,
130
+ instanceOfCompanyContextPlanResponseData,
131
+ CompanyContextPlanResponseDataFromJSON,
132
+ CompanyContextPlanResponseDataFromJSONTyped,
133
+ CompanyContextPlanResponseDataToJSON,
134
+ CompanyContextPlanResponseDataToJSONTyped,
135
+ CompanyContextPlanResponseData,
136
+ instanceOfCompanyContextResponseData,
137
+ CompanyContextResponseDataFromJSON,
138
+ CompanyContextResponseDataFromJSONTyped,
139
+ CompanyContextResponseDataToJSON,
140
+ CompanyContextResponseDataToJSONTyped,
141
+ CompanyContextResponseData,
142
+ instanceOfCompanyContextScheduledDowngradeResponseData,
143
+ CompanyContextScheduledDowngradeResponseDataFromJSON,
144
+ CompanyContextScheduledDowngradeResponseDataFromJSONTyped,
145
+ CompanyContextScheduledDowngradeResponseDataToJSON,
146
+ CompanyContextScheduledDowngradeResponseDataToJSONTyped,
147
+ CompanyContextScheduledDowngradeResponseData,
148
+ instanceOfCompanyContextSubscriptionResponseData,
149
+ CompanyContextSubscriptionResponseDataFromJSON,
150
+ CompanyContextSubscriptionResponseDataFromJSONTyped,
151
+ CompanyContextSubscriptionResponseDataToJSON,
152
+ CompanyContextSubscriptionResponseDataToJSONTyped,
153
+ CompanyContextSubscriptionResponseData,
154
+ instanceOfCompanyCreditAutoTopupResponseData,
155
+ CompanyCreditAutoTopupResponseDataFromJSON,
156
+ CompanyCreditAutoTopupResponseDataFromJSONTyped,
157
+ CompanyCreditAutoTopupResponseDataToJSON,
158
+ CompanyCreditAutoTopupResponseDataToJSONTyped,
159
+ CompanyCreditAutoTopupResponseData,
160
+ instanceOfCompanyCreditBalanceResponseData,
161
+ CompanyCreditBalanceResponseDataFromJSON,
162
+ CompanyCreditBalanceResponseDataFromJSONTyped,
163
+ CompanyCreditBalanceResponseDataToJSON,
164
+ CompanyCreditBalanceResponseDataToJSONTyped,
165
+ CompanyCreditBalanceResponseData,
166
+ instanceOfCompanyCreditBalancesResponseData,
167
+ CompanyCreditBalancesResponseDataFromJSON,
168
+ CompanyCreditBalancesResponseDataFromJSONTyped,
169
+ CompanyCreditBalancesResponseDataToJSON,
170
+ CompanyCreditBalancesResponseDataToJSONTyped,
171
+ CompanyCreditBalancesResponseData,
172
+ instanceOfCompanyCreditCompositionResponseData,
173
+ CompanyCreditCompositionResponseDataFromJSON,
174
+ CompanyCreditCompositionResponseDataFromJSONTyped,
175
+ CompanyCreditCompositionResponseDataToJSON,
176
+ CompanyCreditCompositionResponseDataToJSONTyped,
177
+ CompanyCreditCompositionResponseData,
178
+ instanceOfCompanyCreditGrantResponseData,
179
+ CompanyCreditGrantResponseDataFromJSON,
180
+ CompanyCreditGrantResponseDataFromJSONTyped,
181
+ CompanyCreditGrantResponseDataToJSON,
182
+ CompanyCreditGrantResponseDataToJSONTyped,
183
+ CompanyCreditGrantResponseData,
184
+ instanceOfCompanyCreditUserUsageResponseData,
185
+ CompanyCreditUserUsageResponseDataFromJSON,
186
+ CompanyCreditUserUsageResponseDataFromJSONTyped,
187
+ CompanyCreditUserUsageResponseDataToJSON,
188
+ CompanyCreditUserUsageResponseDataToJSONTyped,
189
+ CompanyCreditUserUsageResponseData,
190
+ instanceOfCompanyCreditUserUsageRowResponseData,
191
+ CompanyCreditUserUsageRowResponseDataFromJSON,
192
+ CompanyCreditUserUsageRowResponseDataFromJSONTyped,
193
+ CompanyCreditUserUsageRowResponseDataToJSON,
194
+ CompanyCreditUserUsageRowResponseDataToJSONTyped,
195
+ CompanyCreditUserUsageRowResponseData,
118
196
  instanceOfCompanyDiscountResponseData,
119
197
  CompanyDiscountResponseDataFromJSON,
120
198
  CompanyDiscountResponseDataFromJSONTyped,
@@ -181,6 +259,18 @@ declare namespace billingApi {
181
259
  CreateSetupIntentResponseToJSON,
182
260
  CreateSetupIntentResponseToJSONTyped,
183
261
  CreateSetupIntentResponse,
262
+ instanceOfCurrency,
263
+ CurrencyFromJSON,
264
+ CurrencyFromJSONTyped,
265
+ CurrencyToJSON,
266
+ CurrencyToJSONTyped,
267
+ Currency,
268
+ instanceOfCustomPlanActivationStrategy,
269
+ CustomPlanActivationStrategyFromJSON,
270
+ CustomPlanActivationStrategyFromJSONTyped,
271
+ CustomPlanActivationStrategyToJSON,
272
+ CustomPlanActivationStrategyToJSONTyped,
273
+ CustomPlanActivationStrategy,
184
274
  instanceOfDeletePaymentMethodResponse,
185
275
  DeletePaymentMethodResponseFromJSON,
186
276
  DeletePaymentMethodResponseFromJSONTyped,
@@ -217,6 +307,24 @@ declare namespace billingApi {
217
307
  FeatureTypeToJSON,
218
308
  FeatureTypeToJSONTyped,
219
309
  FeatureType,
310
+ instanceOfGetCompanyCreditBalancesResponse,
311
+ GetCompanyCreditBalancesResponseFromJSON,
312
+ GetCompanyCreditBalancesResponseFromJSONTyped,
313
+ GetCompanyCreditBalancesResponseToJSON,
314
+ GetCompanyCreditBalancesResponseToJSONTyped,
315
+ GetCompanyCreditBalancesResponse,
316
+ instanceOfGetCompanyCreditUserUsageParams,
317
+ GetCompanyCreditUserUsageParamsFromJSON,
318
+ GetCompanyCreditUserUsageParamsFromJSONTyped,
319
+ GetCompanyCreditUserUsageParamsToJSON,
320
+ GetCompanyCreditUserUsageParamsToJSONTyped,
321
+ GetCompanyCreditUserUsageParams,
322
+ instanceOfGetCompanyCreditUserUsageResponse,
323
+ GetCompanyCreditUserUsageResponseFromJSON,
324
+ GetCompanyCreditUserUsageResponseFromJSONTyped,
325
+ GetCompanyCreditUserUsageResponseToJSON,
326
+ GetCompanyCreditUserUsageResponseToJSONTyped,
327
+ GetCompanyCreditUserUsageResponse,
220
328
  instanceOfGetCompanyFeatureUsageResponse,
221
329
  GetCompanyFeatureUsageResponseFromJSON,
222
330
  GetCompanyFeatureUsageResponseFromJSONTyped,
@@ -253,6 +361,12 @@ declare namespace billingApi {
253
361
  GetCompanyPaymentMethodsResponseToJSON,
254
362
  GetCompanyPaymentMethodsResponseToJSONTyped,
255
363
  GetCompanyPaymentMethodsResponse,
364
+ instanceOfGetCompanyResponse,
365
+ GetCompanyResponseFromJSON,
366
+ GetCompanyResponseFromJSONTyped,
367
+ GetCompanyResponseToJSON,
368
+ GetCompanyResponseToJSONTyped,
369
+ GetCompanyResponse,
256
370
  instanceOfGetCompanyUpcomingInvoiceResponse,
257
371
  GetCompanyUpcomingInvoiceResponseFromJSON,
258
372
  GetCompanyUpcomingInvoiceResponseFromJSONTyped,
@@ -332,6 +446,12 @@ declare interface BillingClient {
332
446
  fetchFeatureUsage(): Promise<FeatureUsage[]>;
333
447
  /** One event-based feature's usage by user over its metric period. */
334
448
  fetchFeatureUserUsage(params: FeatureUserUsageRequest): Promise<FeatureUserUsage>;
449
+ /** Empty when the company holds no credits and its plan draws on none. */
450
+ fetchCreditBalances(): Promise<CreditBalanceEntry[]>;
451
+ /** One credit's consumption by user over the span of its live grants. */
452
+ fetchCreditUserUsage(params: CreditUserUsageRequest): Promise<CreditUserUsage>;
453
+ /** The company's plan, add-ons, and subscription state. */
454
+ fetchCompany(): Promise<Company>;
335
455
  readonly sessionStatus: SessionStatus;
336
456
  readonly sessionKey: string | undefined;
337
457
  setSession(session: SessionInput): void;
@@ -340,6 +460,24 @@ declare interface BillingClient {
340
460
 
341
461
  declare type BillingClientOptions = SessionOptions;
342
462
 
463
+ /**
464
+ *
465
+ * @export
466
+ */
467
+ declare const BillingCreditGrantReason: {
468
+ readonly Adjustment: "adjustment";
469
+ readonly BillingCreditAutoTopup: "billing_credit_auto_topup";
470
+ readonly Free: "free";
471
+ readonly Plan: "plan";
472
+ readonly PostpaidForgiven: "postpaid_forgiven";
473
+ readonly PostpaidOverdraft: "postpaid_overdraft";
474
+ readonly PostpaidSettlement: "postpaid_settlement";
475
+ readonly Purchased: "purchased";
476
+ readonly Rollover: "rollover";
477
+ };
478
+
479
+ declare type BillingCreditGrantReason = (typeof BillingCreditGrantReason)[keyof typeof BillingCreditGrantReason];
480
+
343
481
  /**
344
482
  * A prefetch or fixture. An omitted key reports as pending; a keyed resource
345
483
  * seeds under `params`, or its defaults when absent, so a prefetch for a
@@ -357,13 +495,15 @@ export declare type BillingData = {
357
495
  sessionKey?: string;
358
496
  };
359
497
 
360
- export declare function BillingDataProvider({ actions, children, data, featureUserUsage, locale, onLoadMoreInvoices, onMissingString, onRefetch, status, strings, translate, }: BillingDataProviderProps): React_2.JSX.Element;
498
+ export declare function BillingDataProvider({ actions, children, creditUserUsage, data, featureUserUsage, locale, onLoadMoreInvoices, onMissingString, onRefetch, status, strings, translate, }: BillingDataProviderProps): React_2.JSX.Element;
361
499
 
362
500
  declare interface BillingDataProviderDataProps {
363
501
  /** A missing key reports as pending. */
364
502
  data: BillingData;
365
503
  /** Usage by user, by feature id; a feature left out reports as pending. */
366
504
  featureUserUsage?: Record<string, FeatureUserUsage>;
505
+ /** Consumption by user, by credit id; a credit left out reports as pending. */
506
+ creditUserUsage?: Record<string, CreditUserUsage>;
367
507
  /** Simulated loading / failure per resource; wins over `data`. */
368
508
  status?: BillingDataStatus;
369
509
  onRefetch?: (name: BillingResourceName) => void;
@@ -403,6 +543,9 @@ export declare interface BillingDataSource {
403
543
  */
404
544
  subscribeFeatureUserUsage(featureId: string, listener: () => void): () => void;
405
545
  featureUserUsage(featureId: string): ResourceHandle<FeatureUserUsage>;
546
+ /** One credit's consumption by user, keyed like `featureUserUsage`. */
547
+ subscribeCreditUserUsage(creditId: string, listener: () => void): () => void;
548
+ creditUserUsage(creditId: string): ResourceHandle<CreditUserUsage>;
406
549
  /** Never rejects: a failure lands on the resource's `error`. */
407
550
  loadMoreInvoices: (query: InvoiceQuery) => Promise<void>;
408
551
  invalidateAll: () => void;
@@ -483,7 +626,7 @@ export declare function BillingProvider({ billingClient, children, initialData,
483
626
  * much. Named apart from schematic-js's `BillingClient`, which is the whole
484
627
  * interface; this is the part the hooks here call.
485
628
  */
486
- export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod" | "fetchFeatureUsage" | "fetchFeatureUserUsage">;
629
+ export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod" | "fetchFeatureUsage" | "fetchFeatureUserUsage" | "fetchCreditBalances" | "fetchCreditUserUsage" | "fetchCompany">;
487
630
 
488
631
  declare interface BillingProviderDataProps {
489
632
  /**
@@ -523,7 +666,7 @@ declare interface BillingProviderDataProps {
523
666
  export declare type BillingProviderProps = BillingProviderDataProps & SchematicI18nConfig;
524
667
 
525
668
  /** The resources this package serves; a key of schematic-js's contract. */
526
- export declare type BillingResourceName = "invoices" | "upcomingInvoice" | "paymentMethods" | "featureUsage";
669
+ export declare type BillingResourceName = "invoices" | "upcomingInvoice" | "paymentMethods" | "featureUsage" | "creditBalances" | "company";
527
670
 
528
671
  declare type BillingResourceName_2 = keyof BillingResources_2;
529
672
 
@@ -535,6 +678,8 @@ declare interface BillingResourceParams_2 {
535
678
  upcomingInvoice: Record<string, never>;
536
679
  paymentMethods: Record<string, never>;
537
680
  featureUsage: Record<string, never>;
681
+ creditBalances: Record<string, never>;
682
+ company: Record<string, never>;
538
683
  }
539
684
 
540
685
  export declare type BillingResources = Pick<BillingResources_2, BillingResourceName>;
@@ -565,6 +710,14 @@ declare interface BillingResources_2 {
565
710
  * to nothing — so only `undefined` means not loaded.
566
711
  */
567
712
  featureUsage: FeatureUsage[];
713
+ /**
714
+ * `GET /company/credits`. Empty is a loaded value — the company holds no
715
+ * credits and its plan draws on none — so only `undefined` means not
716
+ * loaded.
717
+ */
718
+ creditBalances: CreditBalanceEntry[];
719
+ /** `GET /company`. */
720
+ company: Company;
568
721
  }
569
722
 
570
723
  /**
@@ -662,10 +815,10 @@ declare interface CatalogCreditGrantResponseData {
662
815
  declare interface CatalogPriceResponseData {
663
816
  /**
664
817
  *
665
- * @type {string}
818
+ * @type {Currency}
666
819
  * @memberof CatalogPriceResponseData
667
820
  */
668
- currency: string;
821
+ currency: Currency;
669
822
  /**
670
823
  *
671
824
  * @type {string}
@@ -1024,6 +1177,302 @@ declare const CheckPlanReturnFromJSON: (json: any) => CheckPlanReturn;
1024
1177
 
1025
1178
  declare type CheckPlanReturnListenerFn = (value: CheckPlanReturn) => void;
1026
1179
 
1180
+ /**
1181
+ * The company. The server has already made the embed's derivations from its
1182
+ * hydrated `company`:
1183
+ *
1184
+ * * `subscription` is absent when the company has none, or several.
1185
+ * * `subscription.period` comes from its first recurring product, else its
1186
+ * interval; `subscription.nextBillAt` is the embed's next bill date.
1187
+ * * `customPlanBilling` is the newest pending one, with its `dueAt`.
1188
+ */
1189
+ export declare type Company = CompanyContextResponseData;
1190
+
1191
+ /**
1192
+ *
1193
+ * @export
1194
+ * @interface CompanyContextCustomPlanBillingResponseData
1195
+ */
1196
+ declare interface CompanyContextCustomPlanBillingResponseData {
1197
+ /**
1198
+ * on_payment: the plan activates once the invoice is paid. on_publish: the plan is active and ends unless the invoice is paid.
1199
+ * @type {CustomPlanActivationStrategy}
1200
+ * @memberof CompanyContextCustomPlanBillingResponseData
1201
+ */
1202
+ activationStrategy: CustomPlanActivationStrategy;
1203
+ /**
1204
+ * When payment is due: days_until_due after the billing was published, else created.
1205
+ * @type {Date}
1206
+ * @memberof CompanyContextCustomPlanBillingResponseData
1207
+ */
1208
+ dueAt: Date;
1209
+ /**
1210
+ * Where the company pays the invoice.
1211
+ * @type {string}
1212
+ * @memberof CompanyContextCustomPlanBillingResponseData
1213
+ */
1214
+ invoiceUrl?: string | null;
1215
+ /**
1216
+ *
1217
+ * @type {string}
1218
+ * @memberof CompanyContextCustomPlanBillingResponseData
1219
+ */
1220
+ planId: string;
1221
+ /**
1222
+ *
1223
+ * @type {string}
1224
+ * @memberof CompanyContextCustomPlanBillingResponseData
1225
+ */
1226
+ planName?: string | null;
1227
+ }
1228
+
1229
+ /**
1230
+ * Schematic API
1231
+ * Schematic API
1232
+ *
1233
+ * The version of the OpenAPI document: 0.1
1234
+ *
1235
+ *
1236
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1237
+ * https://openapi-generator.tech
1238
+ * Do not edit the class manually.
1239
+ */
1240
+ /**
1241
+ *
1242
+ * @export
1243
+ * @interface CompanyContextPlanResponseData
1244
+ */
1245
+ declare interface CompanyContextPlanResponseData {
1246
+ /**
1247
+ *
1248
+ * @type {string}
1249
+ * @memberof CompanyContextPlanResponseData
1250
+ */
1251
+ description?: string | null;
1252
+ /**
1253
+ *
1254
+ * @type {string}
1255
+ * @memberof CompanyContextPlanResponseData
1256
+ */
1257
+ id: string;
1258
+ /**
1259
+ * The credits the plan grants, in the plan's order.
1260
+ * @type {Array<string>}
1261
+ * @memberof CompanyContextPlanResponseData
1262
+ */
1263
+ includedCreditIds: Array<string>;
1264
+ /**
1265
+ *
1266
+ * @type {string}
1267
+ * @memberof CompanyContextPlanResponseData
1268
+ */
1269
+ name: string;
1270
+ /**
1271
+ * The period the plan is billed in: day, week, month, quarter, year, or one-time. Null when it is not billed.
1272
+ * @type {string}
1273
+ * @memberof CompanyContextPlanResponseData
1274
+ */
1275
+ period?: string | null;
1276
+ /**
1277
+ * What the company is billed per period, in minor units of the subscription's currency. Null when it is not billed.
1278
+ * @type {number}
1279
+ * @memberof CompanyContextPlanResponseData
1280
+ */
1281
+ price?: number | null;
1282
+ }
1283
+
1284
+ /**
1285
+ *
1286
+ * @export
1287
+ * @interface CompanyContextResponseData
1288
+ */
1289
+ declare interface CompanyContextResponseData {
1290
+ /**
1291
+ * The add-ons the company holds.
1292
+ * @type {Array<CompanyContextPlanResponseData>}
1293
+ * @memberof CompanyContextResponseData
1294
+ */
1295
+ addOns: Array<CompanyContextPlanResponseData>;
1296
+ /**
1297
+ * The newest custom plan billing awaiting payment or activation; null when none is pending.
1298
+ * @type {CompanyContextCustomPlanBillingResponseData}
1299
+ * @memberof CompanyContextResponseData
1300
+ */
1301
+ customPlanBilling?: CompanyContextCustomPlanBillingResponseData;
1302
+ /**
1303
+ *
1304
+ * @type {string}
1305
+ * @memberof CompanyContextResponseData
1306
+ */
1307
+ id: string;
1308
+ /**
1309
+ *
1310
+ * @type {string}
1311
+ * @memberof CompanyContextResponseData
1312
+ */
1313
+ name: string;
1314
+ /**
1315
+ * The company's base plan; null when it has none.
1316
+ * @type {CompanyContextPlanResponseData}
1317
+ * @memberof CompanyContextResponseData
1318
+ */
1319
+ plan?: CompanyContextPlanResponseData;
1320
+ /**
1321
+ * A plan change scheduled for the end of the billing period; null when none is.
1322
+ * @type {CompanyContextScheduledDowngradeResponseData}
1323
+ * @memberof CompanyContextResponseData
1324
+ */
1325
+ scheduledDowngrade?: CompanyContextScheduledDowngradeResponseData;
1326
+ /**
1327
+ * The company's subscription; null when it has none, or several.
1328
+ * @type {CompanyContextSubscriptionResponseData}
1329
+ * @memberof CompanyContextResponseData
1330
+ */
1331
+ subscription?: CompanyContextSubscriptionResponseData;
1332
+ }
1333
+
1334
+ /**
1335
+ * Schematic API
1336
+ * Schematic API
1337
+ *
1338
+ * The version of the OpenAPI document: 0.1
1339
+ *
1340
+ *
1341
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1342
+ * https://openapi-generator.tech
1343
+ * Do not edit the class manually.
1344
+ */
1345
+ /**
1346
+ *
1347
+ * @export
1348
+ * @interface CompanyContextScheduledDowngradeResponseData
1349
+ */
1350
+ declare interface CompanyContextScheduledDowngradeResponseData {
1351
+ /**
1352
+ *
1353
+ * @type {string}
1354
+ * @memberof CompanyContextScheduledDowngradeResponseData
1355
+ */
1356
+ fromPlanId: string;
1357
+ /**
1358
+ *
1359
+ * @type {string}
1360
+ * @memberof CompanyContextScheduledDowngradeResponseData
1361
+ */
1362
+ fromPlanName: string;
1363
+ /**
1364
+ *
1365
+ * @type {string}
1366
+ * @memberof CompanyContextScheduledDowngradeResponseData
1367
+ */
1368
+ toPlanId: string;
1369
+ /**
1370
+ *
1371
+ * @type {string}
1372
+ * @memberof CompanyContextScheduledDowngradeResponseData
1373
+ */
1374
+ toPlanName: string;
1375
+ }
1376
+
1377
+ /**
1378
+ *
1379
+ * @export
1380
+ * @interface CompanyContextSubscriptionResponseData
1381
+ */
1382
+ declare interface CompanyContextSubscriptionResponseData {
1383
+ /**
1384
+ * When the subscription is set to end.
1385
+ * @type {Date}
1386
+ * @memberof CompanyContextSubscriptionResponseData
1387
+ */
1388
+ cancelAt?: Date | null;
1389
+ /**
1390
+ *
1391
+ * @type {boolean}
1392
+ * @memberof CompanyContextSubscriptionResponseData
1393
+ */
1394
+ cancelAtPeriodEnd: boolean;
1395
+ /**
1396
+ *
1397
+ * @type {Currency}
1398
+ * @memberof CompanyContextSubscriptionResponseData
1399
+ */
1400
+ currency: Currency;
1401
+ /**
1402
+ * When the current period ends, and the company is next billed unless its trial is set to cancel: the period end, else the stored next bill's due date. Null when the subscription cancels at period end or neither is known.
1403
+ * @type {Date}
1404
+ * @memberof CompanyContextSubscriptionResponseData
1405
+ */
1406
+ nextBillAt?: Date | null;
1407
+ /**
1408
+ * The period the subscription bills in: day, week, month, quarter, or year.
1409
+ * @type {string}
1410
+ * @memberof CompanyContextSubscriptionResponseData
1411
+ */
1412
+ period?: string | null;
1413
+ /**
1414
+ *
1415
+ * @type {Date}
1416
+ * @memberof CompanyContextSubscriptionResponseData
1417
+ */
1418
+ periodEnd?: Date | null;
1419
+ /**
1420
+ * Provider vocabulary: trialing, active, past_due, and so on.
1421
+ * @type {string}
1422
+ * @memberof CompanyContextSubscriptionResponseData
1423
+ */
1424
+ status: string;
1425
+ /**
1426
+ *
1427
+ * @type {Date}
1428
+ * @memberof CompanyContextSubscriptionResponseData
1429
+ */
1430
+ trialEnd?: Date | null;
1431
+ }
1432
+
1433
+ /**
1434
+ * Schematic API
1435
+ * Schematic API
1436
+ *
1437
+ * The version of the OpenAPI document: 0.1
1438
+ *
1439
+ *
1440
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1441
+ * https://openapi-generator.tech
1442
+ * Do not edit the class manually.
1443
+ */
1444
+ /**
1445
+ *
1446
+ * @export
1447
+ * @interface CompanyCreditAutoTopupResponseData
1448
+ */
1449
+ declare interface CompanyCreditAutoTopupResponseData {
1450
+ /**
1451
+ * Credits each top-up adds.
1452
+ * @type {number}
1453
+ * @memberof CompanyCreditAutoTopupResponseData
1454
+ */
1455
+ amount?: number | null;
1456
+ /**
1457
+ * Whether top-ups run: the company's choice when self_service, else the plan's; false when the plan turns top-ups off.
1458
+ * @type {boolean}
1459
+ * @memberof CompanyCreditAutoTopupResponseData
1460
+ */
1461
+ enabled: boolean;
1462
+ /**
1463
+ * Whether the company may change these settings itself.
1464
+ * @type {boolean}
1465
+ * @memberof CompanyCreditAutoTopupResponseData
1466
+ */
1467
+ selfService: boolean;
1468
+ /**
1469
+ * The remaining balance that triggers a top-up.
1470
+ * @type {number}
1471
+ * @memberof CompanyCreditAutoTopupResponseData
1472
+ */
1473
+ thresholdCredits?: number | null;
1474
+ }
1475
+
1027
1476
  /**
1028
1477
  * Schematic API
1029
1478
  * Schematic API
@@ -1061,6 +1510,319 @@ export declare interface CompanyCreditBalance {
1061
1510
  settled: number;
1062
1511
  }
1063
1512
 
1513
+ /**
1514
+ *
1515
+ * @export
1516
+ * @interface CompanyCreditBalanceResponseData
1517
+ */
1518
+ declare interface CompanyCreditBalanceResponseData {
1519
+ /**
1520
+ * How the credit tops itself up; null unless the company's base plan grants it.
1521
+ * @type {CompanyCreditAutoTopupResponseData}
1522
+ * @memberof CompanyCreditBalanceResponseData
1523
+ */
1524
+ autoTopup?: CompanyCreditAutoTopupResponseData;
1525
+ /**
1526
+ * How the plan's grants of this credit add up per period; null unless the plan grants it per license and the license count is known.
1527
+ * @type {CompanyCreditCompositionResponseData}
1528
+ * @memberof CompanyCreditBalanceResponseData
1529
+ */
1530
+ composition?: CompanyCreditCompositionResponseData;
1531
+ /**
1532
+ *
1533
+ * @type {string}
1534
+ * @memberof CompanyCreditBalanceResponseData
1535
+ */
1536
+ creditDescription: string;
1537
+ /**
1538
+ *
1539
+ * @type {string}
1540
+ * @memberof CompanyCreditBalanceResponseData
1541
+ */
1542
+ creditIcon?: string | null;
1543
+ /**
1544
+ *
1545
+ * @type {string}
1546
+ * @memberof CompanyCreditBalanceResponseData
1547
+ */
1548
+ creditId: string;
1549
+ /**
1550
+ *
1551
+ * @type {string}
1552
+ * @memberof CompanyCreditBalanceResponseData
1553
+ */
1554
+ creditName: string;
1555
+ /**
1556
+ *
1557
+ * @type {string}
1558
+ * @memberof CompanyCreditBalanceResponseData
1559
+ */
1560
+ creditPluralName?: string | null;
1561
+ /**
1562
+ *
1563
+ * @type {string}
1564
+ * @memberof CompanyCreditBalanceResponseData
1565
+ */
1566
+ creditSingularName?: string | null;
1567
+ /**
1568
+ * The earliest expiry among grants that will not be replaced.
1569
+ * @type {Date}
1570
+ * @memberof CompanyCreditBalanceResponseData
1571
+ */
1572
+ expiresAt?: Date | null;
1573
+ /**
1574
+ * The live grants behind the balance, newest first. Empty for a credit the plan draws on that the company holds none of.
1575
+ * @type {Array<CompanyCreditGrantResponseData>}
1576
+ * @memberof CompanyCreditBalanceResponseData
1577
+ */
1578
+ grants: Array<CompanyCreditGrantResponseData>;
1579
+ /**
1580
+ * Whether a bundle of this credit is on offer to the company's plan.
1581
+ * @type {boolean}
1582
+ * @memberof CompanyCreditBalanceResponseData
1583
+ */
1584
+ purchasable: boolean;
1585
+ /**
1586
+ *
1587
+ * @type {number}
1588
+ * @memberof CompanyCreditBalanceResponseData
1589
+ */
1590
+ remaining: number;
1591
+ /**
1592
+ * The earliest refresh among grants that renew.
1593
+ * @type {Date}
1594
+ * @memberof CompanyCreditBalanceResponseData
1595
+ */
1596
+ resetsAt?: Date | null;
1597
+ /**
1598
+ *
1599
+ * @type {number}
1600
+ * @memberof CompanyCreditBalanceResponseData
1601
+ */
1602
+ total: number;
1603
+ /**
1604
+ *
1605
+ * @type {number}
1606
+ * @memberof CompanyCreditBalanceResponseData
1607
+ */
1608
+ used: number;
1609
+ }
1610
+
1611
+ /**
1612
+ * Schematic API
1613
+ * Schematic API
1614
+ *
1615
+ * The version of the OpenAPI document: 0.1
1616
+ *
1617
+ *
1618
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1619
+ * https://openapi-generator.tech
1620
+ * Do not edit the class manually.
1621
+ */
1622
+ /**
1623
+ *
1624
+ * @export
1625
+ * @interface CompanyCreditCompositionResponseData
1626
+ */
1627
+ declare interface CompanyCreditCompositionResponseData {
1628
+ /**
1629
+ * Credits granted to the company once per period, on top of the per-license amount.
1630
+ * @type {number}
1631
+ * @memberof CompanyCreditCompositionResponseData
1632
+ */
1633
+ fixedQuantity: number;
1634
+ /**
1635
+ *
1636
+ * @type {string}
1637
+ * @memberof CompanyCreditCompositionResponseData
1638
+ */
1639
+ licenseId?: string | null;
1640
+ /**
1641
+ *
1642
+ * @type {string}
1643
+ * @memberof CompanyCreditCompositionResponseData
1644
+ */
1645
+ licenseName: string;
1646
+ /**
1647
+ *
1648
+ * @type {string}
1649
+ * @memberof CompanyCreditCompositionResponseData
1650
+ */
1651
+ licensePluralName?: string | null;
1652
+ /**
1653
+ *
1654
+ * @type {number}
1655
+ * @memberof CompanyCreditCompositionResponseData
1656
+ */
1657
+ licenseQuantity: number;
1658
+ /**
1659
+ *
1660
+ * @type {string}
1661
+ * @memberof CompanyCreditCompositionResponseData
1662
+ */
1663
+ licenseSingularName?: string | null;
1664
+ /**
1665
+ *
1666
+ * @type {number}
1667
+ * @memberof CompanyCreditCompositionResponseData
1668
+ */
1669
+ perLicenseAmount: number;
1670
+ /**
1671
+ * day, week, month or year.
1672
+ * @type {string}
1673
+ * @memberof CompanyCreditCompositionResponseData
1674
+ */
1675
+ period: string;
1676
+ /**
1677
+ * When the company's next bill renews the plan: the subscription's period end, else the stored next bill's due date. Null when the subscription cancels at period end, its trial cancels, or neither is known.
1678
+ * @type {Date}
1679
+ * @memberof CompanyCreditCompositionResponseData
1680
+ */
1681
+ renewsAt?: Date | null;
1682
+ /**
1683
+ *
1684
+ * @type {number}
1685
+ * @memberof CompanyCreditCompositionResponseData
1686
+ */
1687
+ total: number;
1688
+ }
1689
+
1690
+ /**
1691
+ *
1692
+ * @export
1693
+ * @interface CompanyCreditGrantResponseData
1694
+ */
1695
+ declare interface CompanyCreditGrantResponseData {
1696
+ /**
1697
+ *
1698
+ * @type {string}
1699
+ * @memberof CompanyCreditGrantResponseData
1700
+ */
1701
+ bundleId?: string | null;
1702
+ /**
1703
+ *
1704
+ * @type {string}
1705
+ * @memberof CompanyCreditGrantResponseData
1706
+ */
1707
+ bundleName?: string | null;
1708
+ /**
1709
+ *
1710
+ * @type {Date}
1711
+ * @memberof CompanyCreditGrantResponseData
1712
+ */
1713
+ createdAt: Date;
1714
+ /**
1715
+ * When these credits go away unreplaced; null if the grant renews or never expires.
1716
+ * @type {Date}
1717
+ * @memberof CompanyCreditGrantResponseData
1718
+ */
1719
+ expiresAt?: Date | null;
1720
+ /**
1721
+ *
1722
+ * @type {BillingCreditGrantReason}
1723
+ * @memberof CompanyCreditGrantResponseData
1724
+ */
1725
+ grantReason: BillingCreditGrantReason;
1726
+ /**
1727
+ *
1728
+ * @type {string}
1729
+ * @memberof CompanyCreditGrantResponseData
1730
+ */
1731
+ id: string;
1732
+ /**
1733
+ *
1734
+ * @type {string}
1735
+ * @memberof CompanyCreditGrantResponseData
1736
+ */
1737
+ planId?: string | null;
1738
+ /**
1739
+ *
1740
+ * @type {string}
1741
+ * @memberof CompanyCreditGrantResponseData
1742
+ */
1743
+ planName?: string | null;
1744
+ /**
1745
+ *
1746
+ * @type {number}
1747
+ * @memberof CompanyCreditGrantResponseData
1748
+ */
1749
+ quantity: number;
1750
+ /**
1751
+ *
1752
+ * @type {number}
1753
+ * @memberof CompanyCreditGrantResponseData
1754
+ */
1755
+ quantityRemaining: number;
1756
+ /**
1757
+ *
1758
+ * @type {number}
1759
+ * @memberof CompanyCreditGrantResponseData
1760
+ */
1761
+ quantityUsed: number;
1762
+ /**
1763
+ * The cadence a renewing grant refreshes on, when it is known.
1764
+ * @type {BillingPlanCreditGrantResetCadence}
1765
+ * @memberof CompanyCreditGrantResponseData
1766
+ */
1767
+ renewalPeriod?: BillingPlanCreditGrantResetCadence | null;
1768
+ /**
1769
+ * When this grant refreshes; null if it does not renew.
1770
+ * @type {Date}
1771
+ * @memberof CompanyCreditGrantResponseData
1772
+ */
1773
+ resetsAt?: Date | null;
1774
+ /**
1775
+ *
1776
+ * @type {Date}
1777
+ * @memberof CompanyCreditGrantResponseData
1778
+ */
1779
+ validFrom?: Date | null;
1780
+ }
1781
+
1782
+ /**
1783
+ *
1784
+ * @export
1785
+ * @interface CompanyCreditUserUsageResponseData
1786
+ */
1787
+ declare interface CompanyCreditUserUsageResponseData {
1788
+ /**
1789
+ * How many of the company's users the breakdown lists across every page, including those who consumed none of the credit in the span; 0 for a credit with no live grant. Unattributed consumption is not a user and is not counted.
1790
+ * @type {number}
1791
+ * @memberof CompanyCreditUserUsageResponseData
1792
+ */
1793
+ count: number;
1794
+ /**
1795
+ * End of the span; the time of the request for a credit the company holds no live grant of.
1796
+ * @type {Date}
1797
+ * @memberof CompanyCreditUserUsageResponseData
1798
+ */
1799
+ endTime?: Date | null;
1800
+ /**
1801
+ * Start of the span; equal to end_time for a credit the company holds no live grant of.
1802
+ * @type {Date}
1803
+ * @memberof CompanyCreditUserUsageResponseData
1804
+ */
1805
+ startTime?: Date | null;
1806
+ /**
1807
+ * Consumption across every user in the span, not just this page.
1808
+ * @type {number}
1809
+ * @memberof CompanyCreditUserUsageResponseData
1810
+ */
1811
+ total: number;
1812
+ /**
1813
+ * Consumption from events sent without a user; null when there is none.
1814
+ * @type {number}
1815
+ * @memberof CompanyCreditUserUsageResponseData
1816
+ */
1817
+ unattributed?: number | null;
1818
+ /**
1819
+ * This page of users, heaviest first.
1820
+ * @type {Array<CompanyCreditUserUsageRowResponseData>}
1821
+ * @memberof CompanyCreditUserUsageResponseData
1822
+ */
1823
+ users: Array<CompanyCreditUserUsageRowResponseData>;
1824
+ }
1825
+
1064
1826
  /**
1065
1827
  * Schematic API
1066
1828
  * Schematic API
@@ -1072,6 +1834,38 @@ export declare interface CompanyCreditBalance {
1072
1834
  * https://openapi-generator.tech
1073
1835
  * Do not edit the class manually.
1074
1836
  */
1837
+ /**
1838
+ *
1839
+ * @export
1840
+ * @interface CompanyCreditUserUsageRowResponseData
1841
+ */
1842
+ declare interface CompanyCreditUserUsageRowResponseData {
1843
+ /**
1844
+ *
1845
+ * @type {string}
1846
+ * @memberof CompanyCreditUserUsageRowResponseData
1847
+ */
1848
+ name?: string | null;
1849
+ /**
1850
+ * This user's fraction (0-1) of all consumption in the span, unattributed included.
1851
+ * @type {number}
1852
+ * @memberof CompanyCreditUserUsageRowResponseData
1853
+ */
1854
+ share: number;
1855
+ /**
1856
+ *
1857
+ * @type {number}
1858
+ * @memberof CompanyCreditUserUsageRowResponseData
1859
+ */
1860
+ used: number;
1861
+ /**
1862
+ *
1863
+ * @type {string}
1864
+ * @memberof CompanyCreditUserUsageRowResponseData
1865
+ */
1866
+ userId: string;
1867
+ }
1868
+
1075
1869
  /**
1076
1870
  *
1077
1871
  * @export
@@ -1092,10 +1886,10 @@ declare interface CompanyDiscountResponseData {
1092
1886
  couponName: string;
1093
1887
  /**
1094
1888
  *
1095
- * @type {string}
1889
+ * @type {Currency}
1096
1890
  * @memberof CompanyDiscountResponseData
1097
1891
  */
1098
- currency?: string | null;
1892
+ currency?: Currency | null;
1099
1893
  /**
1100
1894
  *
1101
1895
  * @type {string}
@@ -1392,10 +2186,10 @@ declare interface CompanyInvoiceResponseData {
1392
2186
  createdAt: Date;
1393
2187
  /**
1394
2188
  *
1395
- * @type {string}
2189
+ * @type {Currency}
1396
2190
  * @memberof CompanyInvoiceResponseData
1397
2191
  */
1398
- currency: string;
2192
+ currency: Currency;
1399
2193
  /**
1400
2194
  *
1401
2195
  * @type {Date}
@@ -1525,6 +2319,11 @@ declare interface CompanyPaymentMethodResponseData {
1525
2319
  type: string;
1526
2320
  }
1527
2321
 
2322
+ /** A plan or add-on the company holds, at the price it is billed. */
2323
+ export declare type CompanyPlan = CompanyContextPlanResponseData;
2324
+
2325
+ export declare type CompanySubscription = CompanyContextSubscriptionResponseData;
2326
+
1528
2327
  /**
1529
2328
  *
1530
2329
  * @export
@@ -1539,10 +2338,10 @@ declare interface CompanyUpcomingInvoiceResponseData {
1539
2338
  amountDue: number;
1540
2339
  /**
1541
2340
  *
1542
- * @type {string}
2341
+ * @type {Currency}
1543
2342
  * @memberof CompanyUpcomingInvoiceResponseData
1544
2343
  */
1545
- currency: string;
2344
+ currency: Currency;
1546
2345
  /**
1547
2346
  * How much of the company's existing balance this invoice consumes.
1548
2347
  * @type {number}
@@ -1654,6 +2453,8 @@ declare interface CompanyUserUsageResponseData {
1654
2453
  */
1655
2454
  declare type ContextSignatureProvider = (context: SchematicContext) => string | Promise<string>;
1656
2455
 
2456
+ export declare type CreditAutoTopup = CompanyCreditAutoTopupResponseData;
2457
+
1657
2458
  /** A company's lease-aware balance for a single credit type */
1658
2459
  export declare type CreditBalance = {
1659
2460
  /** Spendable balance including any open lease hold (remaining + reserved); the number to display to end users */
@@ -1664,6 +2465,22 @@ export declare type CreditBalance = {
1664
2465
  reserved: number;
1665
2466
  };
1666
2467
 
2468
+ /**
2469
+ * One credit's balance. What the server has already decided, so a consumer
2470
+ * never re-derives it:
2471
+ *
2472
+ * * `grants` are the live ones only, newest first; expired and zeroed-out
2473
+ * grants are gone, so `total` is `used` plus `remaining`.
2474
+ * * A credit the plan draws on that the company holds none of is a zero
2475
+ * balance with no grants.
2476
+ * * Each grant carries `resetsAt` or `expiresAt`, never both.
2477
+ * * `purchasable` — a bundle of it is on offer to the company's plan.
2478
+ * * `composition` — how a per-license plan grant adds up per period.
2479
+ * * `autoTopup` — auto top-up for a credit the base plan grants, with the
2480
+ * company's own settings applied.
2481
+ */
2482
+ export declare type CreditBalanceEntry = CompanyCreditBalanceResponseData;
2483
+
1667
2484
  declare type CreditBalanceListenerFn = CreditBalancesListenerFn | EmptyListenerFn;
1668
2485
 
1669
2486
  /** A company's lease-aware credit balances keyed by credit ID */
@@ -1673,6 +2490,10 @@ declare const CreditBalancesFromJSON: (json: any) => CreditBalances;
1673
2490
 
1674
2491
  declare type CreditBalancesListenerFn = (value: CreditBalances) => void;
1675
2492
 
2493
+ export declare type CreditComposition = CompanyCreditCompositionResponseData;
2494
+
2495
+ export declare type CreditGrant = CompanyCreditGrantResponseData;
2496
+
1676
2497
  /** Every spend policy binding the current context, company-scope first */
1677
2498
  export declare type CreditSpendPolicies = CreditSpendPolicy[];
1678
2499
 
@@ -1820,6 +2641,179 @@ declare interface CreditSpendWindow_2 {
1820
2641
  unit: string;
1821
2642
  }
1822
2643
 
2644
+ /**
2645
+ * One credit's consumption by user over the span of its live grants: a page
2646
+ * of `users`, heaviest first; `count` users in all; the span's `total`; and
2647
+ * `unattributed` consumption from events sent without a user. Empty for a
2648
+ * credit the company holds no live grant of.
2649
+ */
2650
+ export declare type CreditUserUsage = CompanyCreditUserUsageResponseData;
2651
+
2652
+ declare interface CreditUserUsageRequest {
2653
+ creditId: string;
2654
+ /** Users per page; the server's default when omitted. */
2655
+ limit?: number;
2656
+ offset?: number;
2657
+ }
2658
+
2659
+ export declare type CreditUserUsageRow = CompanyCreditUserUsageRowResponseData;
2660
+
2661
+ /**
2662
+ *
2663
+ * @export
2664
+ */
2665
+ declare const Currency: {
2666
+ readonly Aed: "aed";
2667
+ readonly Afn: "afn";
2668
+ readonly All: "all";
2669
+ readonly Amd: "amd";
2670
+ readonly Ang: "ang";
2671
+ readonly Aoa: "aoa";
2672
+ readonly Ars: "ars";
2673
+ readonly Aud: "aud";
2674
+ readonly Awg: "awg";
2675
+ readonly Azn: "azn";
2676
+ readonly Bam: "bam";
2677
+ readonly Bbd: "bbd";
2678
+ readonly Bdt: "bdt";
2679
+ readonly Bif: "bif";
2680
+ readonly Bmd: "bmd";
2681
+ readonly Bnd: "bnd";
2682
+ readonly Bob: "bob";
2683
+ readonly Brl: "brl";
2684
+ readonly Bsd: "bsd";
2685
+ readonly Bwp: "bwp";
2686
+ readonly Byn: "byn";
2687
+ readonly Bzd: "bzd";
2688
+ readonly Cad: "cad";
2689
+ readonly Cdf: "cdf";
2690
+ readonly Chf: "chf";
2691
+ readonly Clp: "clp";
2692
+ readonly Cny: "cny";
2693
+ readonly Cop: "cop";
2694
+ readonly Crc: "crc";
2695
+ readonly Cve: "cve";
2696
+ readonly Czk: "czk";
2697
+ readonly Djf: "djf";
2698
+ readonly Dkk: "dkk";
2699
+ readonly Dop: "dop";
2700
+ readonly Dzd: "dzd";
2701
+ readonly Egp: "egp";
2702
+ readonly Etb: "etb";
2703
+ readonly Eur: "eur";
2704
+ readonly Fjd: "fjd";
2705
+ readonly Fkp: "fkp";
2706
+ readonly Gbp: "gbp";
2707
+ readonly Gel: "gel";
2708
+ readonly Gip: "gip";
2709
+ readonly Gmd: "gmd";
2710
+ readonly Gnf: "gnf";
2711
+ readonly Gtq: "gtq";
2712
+ readonly Gyd: "gyd";
2713
+ readonly Hkd: "hkd";
2714
+ readonly Hnl: "hnl";
2715
+ readonly Htg: "htg";
2716
+ readonly Huf: "huf";
2717
+ readonly Idr: "idr";
2718
+ readonly Ils: "ils";
2719
+ readonly Inr: "inr";
2720
+ readonly Isk: "isk";
2721
+ readonly Jmd: "jmd";
2722
+ readonly Jpy: "jpy";
2723
+ readonly Kes: "kes";
2724
+ readonly Kgs: "kgs";
2725
+ readonly Khr: "khr";
2726
+ readonly Kmf: "kmf";
2727
+ readonly Krw: "krw";
2728
+ readonly Kyd: "kyd";
2729
+ readonly Kzt: "kzt";
2730
+ readonly Lak: "lak";
2731
+ readonly Lbp: "lbp";
2732
+ readonly Lkr: "lkr";
2733
+ readonly Lrd: "lrd";
2734
+ readonly Lsl: "lsl";
2735
+ readonly Mad: "mad";
2736
+ readonly Mdl: "mdl";
2737
+ readonly Mga: "mga";
2738
+ readonly Mkd: "mkd";
2739
+ readonly Mmk: "mmk";
2740
+ readonly Mnt: "mnt";
2741
+ readonly Mop: "mop";
2742
+ readonly Mur: "mur";
2743
+ readonly Mvr: "mvr";
2744
+ readonly Mwk: "mwk";
2745
+ readonly Mxn: "mxn";
2746
+ readonly Myr: "myr";
2747
+ readonly Mzn: "mzn";
2748
+ readonly Nad: "nad";
2749
+ readonly Ngn: "ngn";
2750
+ readonly Nio: "nio";
2751
+ readonly Nok: "nok";
2752
+ readonly Npr: "npr";
2753
+ readonly Nzd: "nzd";
2754
+ readonly Pab: "pab";
2755
+ readonly Pen: "pen";
2756
+ readonly Pgk: "pgk";
2757
+ readonly Php: "php";
2758
+ readonly Pkr: "pkr";
2759
+ readonly Pln: "pln";
2760
+ readonly Pyg: "pyg";
2761
+ readonly Qar: "qar";
2762
+ readonly Ron: "ron";
2763
+ readonly Rsd: "rsd";
2764
+ readonly Rub: "rub";
2765
+ readonly Rwf: "rwf";
2766
+ readonly Sar: "sar";
2767
+ readonly Sbd: "sbd";
2768
+ readonly Scr: "scr";
2769
+ readonly Sek: "sek";
2770
+ readonly Sgd: "sgd";
2771
+ readonly Shp: "shp";
2772
+ readonly Sle: "sle";
2773
+ readonly Sos: "sos";
2774
+ readonly Srd: "srd";
2775
+ readonly Std: "std";
2776
+ readonly Szl: "szl";
2777
+ readonly Thb: "thb";
2778
+ readonly Tjs: "tjs";
2779
+ readonly Top: "top";
2780
+ readonly Try: "try";
2781
+ readonly Ttd: "ttd";
2782
+ readonly Twd: "twd";
2783
+ readonly Tzs: "tzs";
2784
+ readonly Uah: "uah";
2785
+ readonly Ugx: "ugx";
2786
+ readonly Usd: "usd";
2787
+ readonly Uyu: "uyu";
2788
+ readonly Uzs: "uzs";
2789
+ readonly Vnd: "vnd";
2790
+ readonly Vuv: "vuv";
2791
+ readonly Wst: "wst";
2792
+ readonly Xaf: "xaf";
2793
+ readonly Xcd: "xcd";
2794
+ readonly Xcg: "xcg";
2795
+ readonly Xof: "xof";
2796
+ readonly Xpf: "xpf";
2797
+ readonly Yer: "yer";
2798
+ readonly Zar: "zar";
2799
+ readonly Zmw: "zmw";
2800
+ };
2801
+
2802
+ declare type Currency = (typeof Currency)[keyof typeof Currency];
2803
+
2804
+ /**
2805
+ *
2806
+ * @export
2807
+ */
2808
+ declare const CustomPlanActivationStrategy: {
2809
+ readonly Payment: "on_payment";
2810
+ readonly Publish: "on_publish";
2811
+ };
2812
+
2813
+ declare type CustomPlanActivationStrategy = (typeof CustomPlanActivationStrategy)[keyof typeof CustomPlanActivationStrategy];
2814
+
2815
+ export declare type CustomPlanBilling = CompanyContextCustomPlanBillingResponseData;
2816
+
1823
2817
  /**
1824
2818
  *
1825
2819
  * @export
@@ -2142,6 +3136,14 @@ declare interface FeatureEntitlement {
2142
3136
  * @memberof FeatureEntitlement
2143
3137
  */
2144
3138
  monthReset?: MetricPeriodMonthReset | null;
3139
+ /**
3140
+ * If the company has a credit-based entitlement for this feature, the credit cost per unit of each quantity an event carries, keyed by quantity key (per token for inference features). Absent when the entitlement prices requests only
3141
+ * @type {{ [key: string]: number; }}
3142
+ * @memberof FeatureEntitlement
3143
+ */
3144
+ quantityRates?: {
3145
+ [key: string]: number;
3146
+ };
2145
3147
  /**
2146
3148
  * For usage-based pricing, the soft limit for overage charges or the next tier boundary
2147
3149
  * @type {number}
@@ -2450,6 +3452,8 @@ declare const RuleType_2: {
2450
3452
 
2451
3453
  declare type RuleType_2 = (typeof RuleType_2)[keyof typeof RuleType_2];
2452
3454
 
3455
+ export declare type ScheduledDowngrade = CompanyContextScheduledDowngradeResponseData;
3456
+
2453
3457
  export declare class Schematic {
2454
3458
  private _additionalHeaders;
2455
3459
  private apiKey;
@@ -2763,6 +3767,9 @@ declare class SchematicBillingClient implements BillingClient {
2763
3767
  updatePaymentMethod(externalId: string): Promise<void>;
2764
3768
  deletePaymentMethod(id: string): Promise<void>;
2765
3769
  fetchFeatureUsage(): Promise<FeatureUsage[]>;
3770
+ fetchCompany(): Promise<Company>;
3771
+ fetchCreditBalances(): Promise<CreditBalanceEntry[]>;
3772
+ fetchCreditUserUsage(params: CreditUserUsageRequest): Promise<CreditUserUsage>;
2766
3773
  fetchFeatureUserUsage(params: FeatureUserUsageRequest): Promise<FeatureUserUsage>;
2767
3774
  }
2768
3775
 
@@ -2855,20 +3862,38 @@ declare namespace SchematicJS {
2855
3862
  CheckPlanReturn,
2856
3863
  CheckPlanReturnFromJSON,
2857
3864
  CheckPlanReturnListenerFn,
3865
+ Company,
3866
+ CompanyContextCustomPlanBillingResponseData,
3867
+ CompanyContextPlanResponseData,
3868
+ CompanyContextResponseData,
3869
+ CompanyContextScheduledDowngradeResponseData,
3870
+ CompanyContextSubscriptionResponseData,
3871
+ CompanyCreditAutoTopupResponseData,
2858
3872
  CompanyCreditBalance,
3873
+ CompanyCreditBalanceResponseData,
3874
+ CompanyCreditCompositionResponseData,
3875
+ CompanyCreditGrantResponseData,
3876
+ CompanyCreditUserUsageResponseData,
3877
+ CompanyCreditUserUsageRowResponseData,
2859
3878
  CompanyDiscountResponseData,
2860
3879
  CompanyFeatureUsageResponseData,
2861
3880
  CompanyFeatureUserUsageResponseData,
2862
3881
  CompanyInvoiceResponseData,
2863
3882
  CompanyPaymentMethodResponseData,
3883
+ CompanyPlan,
3884
+ CompanySubscription,
2864
3885
  CompanyUpcomingInvoiceResponseData,
2865
3886
  CompanyUserUsageResponseData,
2866
3887
  ContextSignatureProvider,
3888
+ CreditAutoTopup,
2867
3889
  CreditBalance,
3890
+ CreditBalanceEntry,
2868
3891
  CreditBalanceListenerFn,
2869
3892
  CreditBalances,
2870
3893
  CreditBalancesFromJSON,
2871
3894
  CreditBalancesListenerFn,
3895
+ CreditComposition,
3896
+ CreditGrant,
2872
3897
  CreditSpendPolicies,
2873
3898
  creditSpendPoliciesEqual,
2874
3899
  CreditSpendPoliciesFromJSON,
@@ -2878,6 +3903,9 @@ declare namespace SchematicJS {
2878
3903
  CreditSpendPolicyListenerFn,
2879
3904
  CreditSpendPolicyScope,
2880
3905
  CreditSpendWindow,
3906
+ CreditUserUsage,
3907
+ CreditUserUsageRow,
3908
+ CustomPlanBilling,
2881
3909
  DEFAULT_INVOICE_QUERY,
2882
3910
  Discount,
2883
3911
  EmptyListenerFn,
@@ -2908,6 +3936,7 @@ declare namespace SchematicJS {
2908
3936
  RequestOptions,
2909
3937
  ResourceState,
2910
3938
  RuleType,
3939
+ ScheduledDowngrade,
2911
3940
  Schematic,
2912
3941
  SchematicApiError,
2913
3942
  SchematicBillingClient,
@@ -3234,6 +4263,26 @@ export declare enum UsagePeriod {
3234
4263
 
3235
4264
  export declare function useBillingDataSource(): BillingDataSource;
3236
4265
 
4266
+ /**
4267
+ * The company's plan and add-ons at their billed prices, its subscription,
4268
+ * any scheduled downgrade and any pending custom plan billing. `undefined`
4269
+ * means not loaded.
4270
+ */
4271
+ export declare function useCompany(): ResourceHandle<Company>;
4272
+
4273
+ /**
4274
+ * The company's credit balances, one per credit. `data` is empty when it
4275
+ * holds no credits and its plan draws on none; `undefined` means not loaded.
4276
+ */
4277
+ export declare function useCreditBalances(): ResourceHandle<CreditBalanceEntry[]>;
4278
+
4279
+ /**
4280
+ * One credit's consumption by user over the span of its live grants: the
4281
+ * heaviest users, how many there are in all, and consumption from events
4282
+ * sent without a user. Empty for a credit the company holds no live grant of.
4283
+ */
4284
+ export declare function useCreditUserUsage(creditId: string): ResourceHandle<CreditUserUsage>;
4285
+
3237
4286
  /**
3238
4287
  * Every feature the company is entitled to, with its usage. `data` is empty
3239
4288
  * when it is entitled to nothing; `undefined` is what means not loaded yet.