@schematichq/schematic-react 1.10.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 +1770 -36
- package/dist/schematic-react.d.ts +1472 -53
- package/dist/schematic-react.esm.js +1770 -36
- package/package.json +9 -9
|
@@ -67,18 +67,120 @@ declare namespace billingApi {
|
|
|
67
67
|
ApiErrorToJSON,
|
|
68
68
|
ApiErrorToJSONTyped,
|
|
69
69
|
ApiError,
|
|
70
|
+
instanceOfBillingCreditGrantReason,
|
|
71
|
+
BillingCreditGrantReasonFromJSON,
|
|
72
|
+
BillingCreditGrantReasonFromJSONTyped,
|
|
73
|
+
BillingCreditGrantReasonToJSON,
|
|
74
|
+
BillingCreditGrantReasonToJSONTyped,
|
|
75
|
+
BillingCreditGrantReason,
|
|
76
|
+
instanceOfBillingPlanCreditGrantResetCadence,
|
|
77
|
+
BillingPlanCreditGrantResetCadenceFromJSON,
|
|
78
|
+
BillingPlanCreditGrantResetCadenceFromJSONTyped,
|
|
79
|
+
BillingPlanCreditGrantResetCadenceToJSON,
|
|
80
|
+
BillingPlanCreditGrantResetCadenceToJSONTyped,
|
|
81
|
+
BillingPlanCreditGrantResetCadence,
|
|
82
|
+
instanceOfBillingPriceScheme,
|
|
83
|
+
BillingPriceSchemeFromJSON,
|
|
84
|
+
BillingPriceSchemeFromJSONTyped,
|
|
85
|
+
BillingPriceSchemeToJSON,
|
|
86
|
+
BillingPriceSchemeToJSONTyped,
|
|
87
|
+
BillingPriceScheme,
|
|
88
|
+
instanceOfBillingProductPriceInterval,
|
|
89
|
+
BillingProductPriceIntervalFromJSON,
|
|
90
|
+
BillingProductPriceIntervalFromJSONTyped,
|
|
91
|
+
BillingProductPriceIntervalToJSON,
|
|
92
|
+
BillingProductPriceIntervalToJSONTyped,
|
|
93
|
+
BillingProductPriceInterval,
|
|
70
94
|
instanceOfBillingProviderType,
|
|
71
95
|
BillingProviderTypeFromJSON,
|
|
72
96
|
BillingProviderTypeFromJSONTyped,
|
|
73
97
|
BillingProviderTypeToJSON,
|
|
74
98
|
BillingProviderTypeToJSONTyped,
|
|
75
99
|
BillingProviderType,
|
|
100
|
+
instanceOfBillingTiersMode,
|
|
101
|
+
BillingTiersModeFromJSON,
|
|
102
|
+
BillingTiersModeFromJSONTyped,
|
|
103
|
+
BillingTiersModeToJSON,
|
|
104
|
+
BillingTiersModeToJSONTyped,
|
|
105
|
+
BillingTiersMode,
|
|
106
|
+
instanceOfCatalogCreditGrantResponseData,
|
|
107
|
+
CatalogCreditGrantResponseDataFromJSON,
|
|
108
|
+
CatalogCreditGrantResponseDataFromJSONTyped,
|
|
109
|
+
CatalogCreditGrantResponseDataToJSON,
|
|
110
|
+
CatalogCreditGrantResponseDataToJSONTyped,
|
|
111
|
+
CatalogCreditGrantResponseData,
|
|
112
|
+
instanceOfCatalogPriceResponseData,
|
|
113
|
+
CatalogPriceResponseDataFromJSON,
|
|
114
|
+
CatalogPriceResponseDataFromJSONTyped,
|
|
115
|
+
CatalogPriceResponseDataToJSON,
|
|
116
|
+
CatalogPriceResponseDataToJSONTyped,
|
|
117
|
+
CatalogPriceResponseData,
|
|
118
|
+
instanceOfCatalogPriceTierResponseData,
|
|
119
|
+
CatalogPriceTierResponseDataFromJSON,
|
|
120
|
+
CatalogPriceTierResponseDataFromJSONTyped,
|
|
121
|
+
CatalogPriceTierResponseDataToJSON,
|
|
122
|
+
CatalogPriceTierResponseDataToJSONTyped,
|
|
123
|
+
CatalogPriceTierResponseData,
|
|
124
|
+
instanceOfCompanyCreditBalanceResponseData,
|
|
125
|
+
CompanyCreditBalanceResponseDataFromJSON,
|
|
126
|
+
CompanyCreditBalanceResponseDataFromJSONTyped,
|
|
127
|
+
CompanyCreditBalanceResponseDataToJSON,
|
|
128
|
+
CompanyCreditBalanceResponseDataToJSONTyped,
|
|
129
|
+
CompanyCreditBalanceResponseData,
|
|
130
|
+
instanceOfCompanyCreditBalancesResponseData,
|
|
131
|
+
CompanyCreditBalancesResponseDataFromJSON,
|
|
132
|
+
CompanyCreditBalancesResponseDataFromJSONTyped,
|
|
133
|
+
CompanyCreditBalancesResponseDataToJSON,
|
|
134
|
+
CompanyCreditBalancesResponseDataToJSONTyped,
|
|
135
|
+
CompanyCreditBalancesResponseData,
|
|
136
|
+
instanceOfCompanyCreditCompositionResponseData,
|
|
137
|
+
CompanyCreditCompositionResponseDataFromJSON,
|
|
138
|
+
CompanyCreditCompositionResponseDataFromJSONTyped,
|
|
139
|
+
CompanyCreditCompositionResponseDataToJSON,
|
|
140
|
+
CompanyCreditCompositionResponseDataToJSONTyped,
|
|
141
|
+
CompanyCreditCompositionResponseData,
|
|
142
|
+
instanceOfCompanyCreditGrantResponseData,
|
|
143
|
+
CompanyCreditGrantResponseDataFromJSON,
|
|
144
|
+
CompanyCreditGrantResponseDataFromJSONTyped,
|
|
145
|
+
CompanyCreditGrantResponseDataToJSON,
|
|
146
|
+
CompanyCreditGrantResponseDataToJSONTyped,
|
|
147
|
+
CompanyCreditGrantResponseData,
|
|
148
|
+
instanceOfCompanyCreditUserUsageResponseData,
|
|
149
|
+
CompanyCreditUserUsageResponseDataFromJSON,
|
|
150
|
+
CompanyCreditUserUsageResponseDataFromJSONTyped,
|
|
151
|
+
CompanyCreditUserUsageResponseDataToJSON,
|
|
152
|
+
CompanyCreditUserUsageResponseDataToJSONTyped,
|
|
153
|
+
CompanyCreditUserUsageResponseData,
|
|
154
|
+
instanceOfCompanyCreditUserUsageRowResponseData,
|
|
155
|
+
CompanyCreditUserUsageRowResponseDataFromJSON,
|
|
156
|
+
CompanyCreditUserUsageRowResponseDataFromJSONTyped,
|
|
157
|
+
CompanyCreditUserUsageRowResponseDataToJSON,
|
|
158
|
+
CompanyCreditUserUsageRowResponseDataToJSONTyped,
|
|
159
|
+
CompanyCreditUserUsageRowResponseData,
|
|
76
160
|
instanceOfCompanyDiscountResponseData,
|
|
77
161
|
CompanyDiscountResponseDataFromJSON,
|
|
78
162
|
CompanyDiscountResponseDataFromJSONTyped,
|
|
79
163
|
CompanyDiscountResponseDataToJSON,
|
|
80
164
|
CompanyDiscountResponseDataToJSONTyped,
|
|
81
165
|
CompanyDiscountResponseData,
|
|
166
|
+
instanceOfCompanyFeatureUsageListResponseData,
|
|
167
|
+
CompanyFeatureUsageListResponseDataFromJSON,
|
|
168
|
+
CompanyFeatureUsageListResponseDataFromJSONTyped,
|
|
169
|
+
CompanyFeatureUsageListResponseDataToJSON,
|
|
170
|
+
CompanyFeatureUsageListResponseDataToJSONTyped,
|
|
171
|
+
CompanyFeatureUsageListResponseData,
|
|
172
|
+
instanceOfCompanyFeatureUsageResponseData,
|
|
173
|
+
CompanyFeatureUsageResponseDataFromJSON,
|
|
174
|
+
CompanyFeatureUsageResponseDataFromJSONTyped,
|
|
175
|
+
CompanyFeatureUsageResponseDataToJSON,
|
|
176
|
+
CompanyFeatureUsageResponseDataToJSONTyped,
|
|
177
|
+
CompanyFeatureUsageResponseData,
|
|
178
|
+
instanceOfCompanyFeatureUserUsageResponseData,
|
|
179
|
+
CompanyFeatureUserUsageResponseDataFromJSON,
|
|
180
|
+
CompanyFeatureUserUsageResponseDataFromJSONTyped,
|
|
181
|
+
CompanyFeatureUserUsageResponseDataToJSON,
|
|
182
|
+
CompanyFeatureUserUsageResponseDataToJSONTyped,
|
|
183
|
+
CompanyFeatureUserUsageResponseData,
|
|
82
184
|
instanceOfCompanyInvoiceResponseData,
|
|
83
185
|
CompanyInvoiceResponseDataFromJSON,
|
|
84
186
|
CompanyInvoiceResponseDataFromJSONTyped,
|
|
@@ -109,6 +211,12 @@ declare namespace billingApi {
|
|
|
109
211
|
CompanyUpcomingInvoiceResponseDataToJSON,
|
|
110
212
|
CompanyUpcomingInvoiceResponseDataToJSONTyped,
|
|
111
213
|
CompanyUpcomingInvoiceResponseData,
|
|
214
|
+
instanceOfCompanyUserUsageResponseData,
|
|
215
|
+
CompanyUserUsageResponseDataFromJSON,
|
|
216
|
+
CompanyUserUsageResponseDataFromJSONTyped,
|
|
217
|
+
CompanyUserUsageResponseDataToJSON,
|
|
218
|
+
CompanyUserUsageResponseDataToJSONTyped,
|
|
219
|
+
CompanyUserUsageResponseData,
|
|
112
220
|
instanceOfCreateSetupIntentResponse,
|
|
113
221
|
CreateSetupIntentResponseFromJSON,
|
|
114
222
|
CreateSetupIntentResponseFromJSONTyped,
|
|
@@ -127,6 +235,66 @@ declare namespace billingApi {
|
|
|
127
235
|
DeleteResponseToJSON,
|
|
128
236
|
DeleteResponseToJSONTyped,
|
|
129
237
|
DeleteResponse,
|
|
238
|
+
instanceOfEntitlementPriceBehavior,
|
|
239
|
+
EntitlementPriceBehaviorFromJSON,
|
|
240
|
+
EntitlementPriceBehaviorFromJSONTyped,
|
|
241
|
+
EntitlementPriceBehaviorToJSON,
|
|
242
|
+
EntitlementPriceBehaviorToJSONTyped,
|
|
243
|
+
EntitlementPriceBehavior,
|
|
244
|
+
instanceOfEntitlementType,
|
|
245
|
+
EntitlementTypeFromJSON,
|
|
246
|
+
EntitlementTypeFromJSONTyped,
|
|
247
|
+
EntitlementTypeToJSON,
|
|
248
|
+
EntitlementTypeToJSONTyped,
|
|
249
|
+
EntitlementType,
|
|
250
|
+
instanceOfEntitlementValueType,
|
|
251
|
+
EntitlementValueTypeFromJSON,
|
|
252
|
+
EntitlementValueTypeFromJSONTyped,
|
|
253
|
+
EntitlementValueTypeToJSON,
|
|
254
|
+
EntitlementValueTypeToJSONTyped,
|
|
255
|
+
EntitlementValueType_2 as EntitlementValueType,
|
|
256
|
+
instanceOfFeatureType,
|
|
257
|
+
FeatureTypeFromJSON,
|
|
258
|
+
FeatureTypeFromJSONTyped,
|
|
259
|
+
FeatureTypeToJSON,
|
|
260
|
+
FeatureTypeToJSONTyped,
|
|
261
|
+
FeatureType,
|
|
262
|
+
instanceOfGetCompanyCreditBalancesResponse,
|
|
263
|
+
GetCompanyCreditBalancesResponseFromJSON,
|
|
264
|
+
GetCompanyCreditBalancesResponseFromJSONTyped,
|
|
265
|
+
GetCompanyCreditBalancesResponseToJSON,
|
|
266
|
+
GetCompanyCreditBalancesResponseToJSONTyped,
|
|
267
|
+
GetCompanyCreditBalancesResponse,
|
|
268
|
+
instanceOfGetCompanyCreditUserUsageParams,
|
|
269
|
+
GetCompanyCreditUserUsageParamsFromJSON,
|
|
270
|
+
GetCompanyCreditUserUsageParamsFromJSONTyped,
|
|
271
|
+
GetCompanyCreditUserUsageParamsToJSON,
|
|
272
|
+
GetCompanyCreditUserUsageParamsToJSONTyped,
|
|
273
|
+
GetCompanyCreditUserUsageParams,
|
|
274
|
+
instanceOfGetCompanyCreditUserUsageResponse,
|
|
275
|
+
GetCompanyCreditUserUsageResponseFromJSON,
|
|
276
|
+
GetCompanyCreditUserUsageResponseFromJSONTyped,
|
|
277
|
+
GetCompanyCreditUserUsageResponseToJSON,
|
|
278
|
+
GetCompanyCreditUserUsageResponseToJSONTyped,
|
|
279
|
+
GetCompanyCreditUserUsageResponse,
|
|
280
|
+
instanceOfGetCompanyFeatureUsageResponse,
|
|
281
|
+
GetCompanyFeatureUsageResponseFromJSON,
|
|
282
|
+
GetCompanyFeatureUsageResponseFromJSONTyped,
|
|
283
|
+
GetCompanyFeatureUsageResponseToJSON,
|
|
284
|
+
GetCompanyFeatureUsageResponseToJSONTyped,
|
|
285
|
+
GetCompanyFeatureUsageResponse,
|
|
286
|
+
instanceOfGetCompanyFeatureUserUsageParams,
|
|
287
|
+
GetCompanyFeatureUserUsageParamsFromJSON,
|
|
288
|
+
GetCompanyFeatureUserUsageParamsFromJSONTyped,
|
|
289
|
+
GetCompanyFeatureUserUsageParamsToJSON,
|
|
290
|
+
GetCompanyFeatureUserUsageParamsToJSONTyped,
|
|
291
|
+
GetCompanyFeatureUserUsageParams,
|
|
292
|
+
instanceOfGetCompanyFeatureUserUsageResponse,
|
|
293
|
+
GetCompanyFeatureUserUsageResponseFromJSON,
|
|
294
|
+
GetCompanyFeatureUserUsageResponseFromJSONTyped,
|
|
295
|
+
GetCompanyFeatureUserUsageResponseToJSON,
|
|
296
|
+
GetCompanyFeatureUserUsageResponseToJSONTyped,
|
|
297
|
+
GetCompanyFeatureUserUsageResponse,
|
|
130
298
|
instanceOfGetCompanyInvoicesParams,
|
|
131
299
|
GetCompanyInvoicesParamsFromJSON,
|
|
132
300
|
GetCompanyInvoicesParamsFromJSONTyped,
|
|
@@ -157,12 +325,30 @@ declare namespace billingApi {
|
|
|
157
325
|
InvoiceStatusToJSON,
|
|
158
326
|
InvoiceStatusToJSONTyped,
|
|
159
327
|
InvoiceStatus,
|
|
328
|
+
instanceOfMetricPeriod,
|
|
329
|
+
MetricPeriodFromJSON,
|
|
330
|
+
MetricPeriodFromJSONTyped,
|
|
331
|
+
MetricPeriodToJSON,
|
|
332
|
+
MetricPeriodToJSONTyped,
|
|
333
|
+
MetricPeriod_2 as MetricPeriod,
|
|
334
|
+
instanceOfMetricPeriodMonthReset,
|
|
335
|
+
MetricPeriodMonthResetFromJSON,
|
|
336
|
+
MetricPeriodMonthResetFromJSONTyped,
|
|
337
|
+
MetricPeriodMonthResetToJSON,
|
|
338
|
+
MetricPeriodMonthResetToJSONTyped,
|
|
339
|
+
MetricPeriodMonthReset_2 as MetricPeriodMonthReset,
|
|
160
340
|
instanceOfPaymentMethodResponseData,
|
|
161
341
|
PaymentMethodResponseDataFromJSON,
|
|
162
342
|
PaymentMethodResponseDataFromJSONTyped,
|
|
163
343
|
PaymentMethodResponseDataToJSON,
|
|
164
344
|
PaymentMethodResponseDataToJSONTyped,
|
|
165
345
|
PaymentMethodResponseData,
|
|
346
|
+
instanceOfPlanCreditGrantScaling,
|
|
347
|
+
PlanCreditGrantScalingFromJSON,
|
|
348
|
+
PlanCreditGrantScalingFromJSONTyped,
|
|
349
|
+
PlanCreditGrantScalingToJSON,
|
|
350
|
+
PlanCreditGrantScalingToJSONTyped,
|
|
351
|
+
PlanCreditGrantScaling,
|
|
166
352
|
instanceOfSetupIntentResponseData,
|
|
167
353
|
SetupIntentResponseDataFromJSON,
|
|
168
354
|
SetupIntentResponseDataFromJSONTyped,
|
|
@@ -202,6 +388,14 @@ declare interface BillingClient {
|
|
|
202
388
|
updatePaymentMethod(externalId: string): Promise<void>;
|
|
203
389
|
/** Removes the method, by Schematic's id (`id`). */
|
|
204
390
|
deletePaymentMethod(id: string): Promise<void>;
|
|
391
|
+
/** Empty when the company is entitled to nothing. */
|
|
392
|
+
fetchFeatureUsage(): Promise<FeatureUsage[]>;
|
|
393
|
+
/** One event-based feature's usage by user over its metric period. */
|
|
394
|
+
fetchFeatureUserUsage(params: FeatureUserUsageRequest): Promise<FeatureUserUsage>;
|
|
395
|
+
/** Empty when the company holds no credits and its plan draws on none. */
|
|
396
|
+
fetchCreditBalances(): Promise<CreditBalanceEntry[]>;
|
|
397
|
+
/** One credit's consumption by user over the span of its live grants. */
|
|
398
|
+
fetchCreditUserUsage(params: CreditUserUsageRequest): Promise<CreditUserUsage>;
|
|
205
399
|
readonly sessionStatus: SessionStatus;
|
|
206
400
|
readonly sessionKey: string | undefined;
|
|
207
401
|
setSession(session: SessionInput): void;
|
|
@@ -210,6 +404,24 @@ declare interface BillingClient {
|
|
|
210
404
|
|
|
211
405
|
declare type BillingClientOptions = SessionOptions;
|
|
212
406
|
|
|
407
|
+
/**
|
|
408
|
+
*
|
|
409
|
+
* @export
|
|
410
|
+
*/
|
|
411
|
+
declare const BillingCreditGrantReason: {
|
|
412
|
+
readonly Adjustment: "adjustment";
|
|
413
|
+
readonly BillingCreditAutoTopup: "billing_credit_auto_topup";
|
|
414
|
+
readonly Free: "free";
|
|
415
|
+
readonly Plan: "plan";
|
|
416
|
+
readonly PostpaidForgiven: "postpaid_forgiven";
|
|
417
|
+
readonly PostpaidOverdraft: "postpaid_overdraft";
|
|
418
|
+
readonly PostpaidSettlement: "postpaid_settlement";
|
|
419
|
+
readonly Purchased: "purchased";
|
|
420
|
+
readonly Rollover: "rollover";
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
declare type BillingCreditGrantReason = (typeof BillingCreditGrantReason)[keyof typeof BillingCreditGrantReason];
|
|
424
|
+
|
|
213
425
|
/**
|
|
214
426
|
* A prefetch or fixture. An omitted key reports as pending; a keyed resource
|
|
215
427
|
* seeds under `params`, or its defaults when absent, so a prefetch for a
|
|
@@ -227,11 +439,15 @@ export declare type BillingData = {
|
|
|
227
439
|
sessionKey?: string;
|
|
228
440
|
};
|
|
229
441
|
|
|
230
|
-
export declare function BillingDataProvider({ actions, children, data, locale, onLoadMoreInvoices, onMissingString, onRefetch, status, strings, translate, }: BillingDataProviderProps): React_2.JSX.Element;
|
|
442
|
+
export declare function BillingDataProvider({ actions, children, creditUserUsage, data, featureUserUsage, locale, onLoadMoreInvoices, onMissingString, onRefetch, status, strings, translate, }: BillingDataProviderProps): React_2.JSX.Element;
|
|
231
443
|
|
|
232
444
|
declare interface BillingDataProviderDataProps {
|
|
233
445
|
/** A missing key reports as pending. */
|
|
234
446
|
data: BillingData;
|
|
447
|
+
/** Usage by user, by feature id; a feature left out reports as pending. */
|
|
448
|
+
featureUserUsage?: Record<string, FeatureUserUsage>;
|
|
449
|
+
/** Consumption by user, by credit id; a credit left out reports as pending. */
|
|
450
|
+
creditUserUsage?: Record<string, CreditUserUsage>;
|
|
235
451
|
/** Simulated loading / failure per resource; wins over `data`. */
|
|
236
452
|
status?: BillingDataStatus;
|
|
237
453
|
onRefetch?: (name: BillingResourceName) => void;
|
|
@@ -264,6 +480,16 @@ export declare interface BillingDataSource {
|
|
|
264
480
|
*/
|
|
265
481
|
subscribe<K extends BillingResourceName>(name: K, params: BillingResourceParams[K], listener: () => void): () => void;
|
|
266
482
|
handle<K extends BillingResourceName>(name: K, params: BillingResourceParams[K]): ResourceHandle<BillingResources[K]>;
|
|
483
|
+
/**
|
|
484
|
+
* One feature's usage by user. Keyed by feature, so it sits beside the
|
|
485
|
+
* named resources rather than among them: a source that holds one value
|
|
486
|
+
* per name has no slot for it.
|
|
487
|
+
*/
|
|
488
|
+
subscribeFeatureUserUsage(featureId: string, listener: () => void): () => void;
|
|
489
|
+
featureUserUsage(featureId: string): ResourceHandle<FeatureUserUsage>;
|
|
490
|
+
/** One credit's consumption by user, keyed like `featureUserUsage`. */
|
|
491
|
+
subscribeCreditUserUsage(creditId: string, listener: () => void): () => void;
|
|
492
|
+
creditUserUsage(creditId: string): ResourceHandle<CreditUserUsage>;
|
|
267
493
|
/** Never rejects: a failure lands on the resource's `error`. */
|
|
268
494
|
loadMoreInvoices: (query: InvoiceQuery) => Promise<void>;
|
|
269
495
|
invalidateAll: () => void;
|
|
@@ -279,6 +505,21 @@ export declare type BillingDataStatus = {
|
|
|
279
505
|
};
|
|
280
506
|
};
|
|
281
507
|
|
|
508
|
+
/**
|
|
509
|
+
*
|
|
510
|
+
* @export
|
|
511
|
+
*/
|
|
512
|
+
declare const BillingPlanCreditGrantResetCadence: {
|
|
513
|
+
readonly Daily: "daily";
|
|
514
|
+
readonly Every6Months: "every_6_months";
|
|
515
|
+
readonly Monthly: "monthly";
|
|
516
|
+
readonly Quarterly: "quarterly";
|
|
517
|
+
readonly Weekly: "weekly";
|
|
518
|
+
readonly Yearly: "yearly";
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
declare type BillingPlanCreditGrantResetCadence = (typeof BillingPlanCreditGrantResetCadence)[keyof typeof BillingPlanCreditGrantResetCadence];
|
|
522
|
+
|
|
282
523
|
declare interface BillingPrefetchOptions {
|
|
283
524
|
/**
|
|
284
525
|
* The resources the page renders, and no default: each one is a request
|
|
@@ -291,6 +532,30 @@ declare interface BillingPrefetchOptions {
|
|
|
291
532
|
invoices?: InvoiceQuery;
|
|
292
533
|
}
|
|
293
534
|
|
|
535
|
+
/**
|
|
536
|
+
*
|
|
537
|
+
* @export
|
|
538
|
+
*/
|
|
539
|
+
declare const BillingPriceScheme: {
|
|
540
|
+
readonly PerUnit: "per_unit";
|
|
541
|
+
readonly Tiered: "tiered";
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
declare type BillingPriceScheme = (typeof BillingPriceScheme)[keyof typeof BillingPriceScheme];
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
*
|
|
548
|
+
* @export
|
|
549
|
+
*/
|
|
550
|
+
declare const BillingProductPriceInterval: {
|
|
551
|
+
readonly Day: "day";
|
|
552
|
+
readonly Month: "month";
|
|
553
|
+
readonly OneTime: "one-time";
|
|
554
|
+
readonly Year: "year";
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
declare type BillingProductPriceInterval = (typeof BillingProductPriceInterval)[keyof typeof BillingProductPriceInterval];
|
|
558
|
+
|
|
294
559
|
/**
|
|
295
560
|
* Provides the billing hooks from a `BillingStore` over a `BillingProviderClient`.
|
|
296
561
|
* Rendered by `SchematicProvider`; usable on its own with a client.
|
|
@@ -305,7 +570,7 @@ export declare function BillingProvider({ billingClient, children, initialData,
|
|
|
305
570
|
* much. Named apart from schematic-js's `BillingClient`, which is the whole
|
|
306
571
|
* interface; this is the part the hooks here call.
|
|
307
572
|
*/
|
|
308
|
-
export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod">;
|
|
573
|
+
export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod" | "fetchFeatureUsage" | "fetchFeatureUserUsage" | "fetchCreditBalances" | "fetchCreditUserUsage">;
|
|
309
574
|
|
|
310
575
|
declare interface BillingProviderDataProps {
|
|
311
576
|
/**
|
|
@@ -345,7 +610,7 @@ declare interface BillingProviderDataProps {
|
|
|
345
610
|
export declare type BillingProviderProps = BillingProviderDataProps & SchematicI18nConfig;
|
|
346
611
|
|
|
347
612
|
/** The resources this package serves; a key of schematic-js's contract. */
|
|
348
|
-
export declare type BillingResourceName = "invoices" | "upcomingInvoice" | "paymentMethods";
|
|
613
|
+
export declare type BillingResourceName = "invoices" | "upcomingInvoice" | "paymentMethods" | "featureUsage" | "creditBalances";
|
|
349
614
|
|
|
350
615
|
declare type BillingResourceName_2 = keyof BillingResources_2;
|
|
351
616
|
|
|
@@ -356,6 +621,8 @@ declare interface BillingResourceParams_2 {
|
|
|
356
621
|
invoices: InvoiceQuery;
|
|
357
622
|
upcomingInvoice: Record<string, never>;
|
|
358
623
|
paymentMethods: Record<string, never>;
|
|
624
|
+
featureUsage: Record<string, never>;
|
|
625
|
+
creditBalances: Record<string, never>;
|
|
359
626
|
}
|
|
360
627
|
|
|
361
628
|
export declare type BillingResources = Pick<BillingResources_2, BillingResourceName>;
|
|
@@ -381,10 +648,229 @@ declare interface BillingResources_2 {
|
|
|
381
648
|
* has no method on file — so only `undefined` means not loaded.
|
|
382
649
|
*/
|
|
383
650
|
paymentMethods: PaymentMethod[];
|
|
651
|
+
/**
|
|
652
|
+
* `GET /company/usage`. Empty is a loaded value — the company is entitled
|
|
653
|
+
* to nothing — so only `undefined` means not loaded.
|
|
654
|
+
*/
|
|
655
|
+
featureUsage: FeatureUsage[];
|
|
656
|
+
/**
|
|
657
|
+
* `GET /company/credits`. Empty is a loaded value — the company holds no
|
|
658
|
+
* credits and its plan draws on none — so only `undefined` means not
|
|
659
|
+
* loaded.
|
|
660
|
+
*/
|
|
661
|
+
creditBalances: CreditBalanceEntry[];
|
|
384
662
|
}
|
|
385
663
|
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* @export
|
|
667
|
+
*/
|
|
668
|
+
declare const BillingTiersMode: {
|
|
669
|
+
readonly Graduated: "graduated";
|
|
670
|
+
readonly Volume: "volume";
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
declare type BillingTiersMode = (typeof BillingTiersMode)[keyof typeof BillingTiersMode];
|
|
674
|
+
|
|
386
675
|
declare type BooleanListenerFn = (value: boolean) => void;
|
|
387
676
|
|
|
677
|
+
/**
|
|
678
|
+
*
|
|
679
|
+
* @export
|
|
680
|
+
* @interface CatalogCreditGrantResponseData
|
|
681
|
+
*/
|
|
682
|
+
declare interface CatalogCreditGrantResponseData {
|
|
683
|
+
/**
|
|
684
|
+
* Flat credit amount granted to the company regardless of scaling.
|
|
685
|
+
* @type {number}
|
|
686
|
+
* @memberof CatalogCreditGrantResponseData
|
|
687
|
+
*/
|
|
688
|
+
companyCreditAmount: number;
|
|
689
|
+
/**
|
|
690
|
+
* Credits granted; for per_license scaling this is the amount per license unit.
|
|
691
|
+
* @type {number}
|
|
692
|
+
* @memberof CatalogCreditGrantResponseData
|
|
693
|
+
*/
|
|
694
|
+
creditAmount: number;
|
|
695
|
+
/**
|
|
696
|
+
*
|
|
697
|
+
* @type {string}
|
|
698
|
+
* @memberof CatalogCreditGrantResponseData
|
|
699
|
+
*/
|
|
700
|
+
creditIcon?: string | null;
|
|
701
|
+
/**
|
|
702
|
+
*
|
|
703
|
+
* @type {string}
|
|
704
|
+
* @memberof CatalogCreditGrantResponseData
|
|
705
|
+
*/
|
|
706
|
+
creditId: string;
|
|
707
|
+
/**
|
|
708
|
+
*
|
|
709
|
+
* @type {string}
|
|
710
|
+
* @memberof CatalogCreditGrantResponseData
|
|
711
|
+
*/
|
|
712
|
+
creditName: string;
|
|
713
|
+
/**
|
|
714
|
+
*
|
|
715
|
+
* @type {string}
|
|
716
|
+
* @memberof CatalogCreditGrantResponseData
|
|
717
|
+
*/
|
|
718
|
+
creditPluralName?: string | null;
|
|
719
|
+
/**
|
|
720
|
+
*
|
|
721
|
+
* @type {string}
|
|
722
|
+
* @memberof CatalogCreditGrantResponseData
|
|
723
|
+
*/
|
|
724
|
+
creditSingularName?: string | null;
|
|
725
|
+
/**
|
|
726
|
+
*
|
|
727
|
+
* @type {string}
|
|
728
|
+
* @memberof CatalogCreditGrantResponseData
|
|
729
|
+
*/
|
|
730
|
+
id: string;
|
|
731
|
+
/**
|
|
732
|
+
*
|
|
733
|
+
* @type {string}
|
|
734
|
+
* @memberof CatalogCreditGrantResponseData
|
|
735
|
+
*/
|
|
736
|
+
licenseId?: string | null;
|
|
737
|
+
/**
|
|
738
|
+
*
|
|
739
|
+
* @type {BillingPlanCreditGrantResetCadence}
|
|
740
|
+
* @memberof CatalogCreditGrantResponseData
|
|
741
|
+
*/
|
|
742
|
+
resetCadence?: BillingPlanCreditGrantResetCadence | null;
|
|
743
|
+
/**
|
|
744
|
+
*
|
|
745
|
+
* @type {PlanCreditGrantScaling}
|
|
746
|
+
* @memberof CatalogCreditGrantResponseData
|
|
747
|
+
*/
|
|
748
|
+
scaling: PlanCreditGrantScaling;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
*
|
|
753
|
+
* @export
|
|
754
|
+
* @interface CatalogPriceResponseData
|
|
755
|
+
*/
|
|
756
|
+
declare interface CatalogPriceResponseData {
|
|
757
|
+
/**
|
|
758
|
+
*
|
|
759
|
+
* @type {string}
|
|
760
|
+
* @memberof CatalogPriceResponseData
|
|
761
|
+
*/
|
|
762
|
+
currency: string;
|
|
763
|
+
/**
|
|
764
|
+
*
|
|
765
|
+
* @type {string}
|
|
766
|
+
* @memberof CatalogPriceResponseData
|
|
767
|
+
*/
|
|
768
|
+
id: string;
|
|
769
|
+
/**
|
|
770
|
+
*
|
|
771
|
+
* @type {BillingProductPriceInterval}
|
|
772
|
+
* @memberof CatalogPriceResponseData
|
|
773
|
+
*/
|
|
774
|
+
interval: BillingProductPriceInterval;
|
|
775
|
+
/**
|
|
776
|
+
*
|
|
777
|
+
* @type {number}
|
|
778
|
+
* @memberof CatalogPriceResponseData
|
|
779
|
+
*/
|
|
780
|
+
intervalCount: number;
|
|
781
|
+
/**
|
|
782
|
+
* Per-unit price of the final tier, precomputed for overage display.
|
|
783
|
+
* @type {string}
|
|
784
|
+
* @memberof CatalogPriceResponseData
|
|
785
|
+
*/
|
|
786
|
+
overageUnitPriceDecimal?: string | null;
|
|
787
|
+
/**
|
|
788
|
+
* Units covered per priced package; a price of $10 with package_size 1000 charges $10 per 1000 units.
|
|
789
|
+
* @type {number}
|
|
790
|
+
* @memberof CatalogPriceResponseData
|
|
791
|
+
*/
|
|
792
|
+
packageSize: number;
|
|
793
|
+
/**
|
|
794
|
+
*
|
|
795
|
+
* @type {number}
|
|
796
|
+
* @memberof CatalogPriceResponseData
|
|
797
|
+
*/
|
|
798
|
+
price: number;
|
|
799
|
+
/**
|
|
800
|
+
*
|
|
801
|
+
* @type {string}
|
|
802
|
+
* @memberof CatalogPriceResponseData
|
|
803
|
+
*/
|
|
804
|
+
priceDecimal?: string | null;
|
|
805
|
+
/**
|
|
806
|
+
*
|
|
807
|
+
* @type {Array<CatalogPriceTierResponseData>}
|
|
808
|
+
* @memberof CatalogPriceResponseData
|
|
809
|
+
*/
|
|
810
|
+
priceTiers: Array<CatalogPriceTierResponseData>;
|
|
811
|
+
/**
|
|
812
|
+
*
|
|
813
|
+
* @type {BillingPriceScheme}
|
|
814
|
+
* @memberof CatalogPriceResponseData
|
|
815
|
+
*/
|
|
816
|
+
scheme: BillingPriceScheme;
|
|
817
|
+
/**
|
|
818
|
+
*
|
|
819
|
+
* @type {BillingTiersMode}
|
|
820
|
+
* @memberof CatalogPriceResponseData
|
|
821
|
+
*/
|
|
822
|
+
tiersMode?: BillingTiersMode | null;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Schematic API
|
|
827
|
+
* Schematic API
|
|
828
|
+
*
|
|
829
|
+
* The version of the OpenAPI document: 0.1
|
|
830
|
+
*
|
|
831
|
+
*
|
|
832
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
833
|
+
* https://openapi-generator.tech
|
|
834
|
+
* Do not edit the class manually.
|
|
835
|
+
*/
|
|
836
|
+
/**
|
|
837
|
+
*
|
|
838
|
+
* @export
|
|
839
|
+
* @interface CatalogPriceTierResponseData
|
|
840
|
+
*/
|
|
841
|
+
declare interface CatalogPriceTierResponseData {
|
|
842
|
+
/**
|
|
843
|
+
*
|
|
844
|
+
* @type {number}
|
|
845
|
+
* @memberof CatalogPriceTierResponseData
|
|
846
|
+
*/
|
|
847
|
+
flatPrice?: number | null;
|
|
848
|
+
/**
|
|
849
|
+
* Lower bound of the tier (inclusive).
|
|
850
|
+
* @type {number}
|
|
851
|
+
* @memberof CatalogPriceTierResponseData
|
|
852
|
+
*/
|
|
853
|
+
from: number;
|
|
854
|
+
/**
|
|
855
|
+
*
|
|
856
|
+
* @type {number}
|
|
857
|
+
* @memberof CatalogPriceTierResponseData
|
|
858
|
+
*/
|
|
859
|
+
perUnitPrice?: number | null;
|
|
860
|
+
/**
|
|
861
|
+
*
|
|
862
|
+
* @type {string}
|
|
863
|
+
* @memberof CatalogPriceTierResponseData
|
|
864
|
+
*/
|
|
865
|
+
perUnitPriceDecimal?: string | null;
|
|
866
|
+
/**
|
|
867
|
+
* Upper bound of the tier (inclusive); null means unbounded.
|
|
868
|
+
* @type {number}
|
|
869
|
+
* @memberof CatalogPriceTierResponseData
|
|
870
|
+
*/
|
|
871
|
+
to?: number | null;
|
|
872
|
+
}
|
|
873
|
+
|
|
388
874
|
/**
|
|
389
875
|
*
|
|
390
876
|
* @export
|
|
@@ -650,84 +1136,684 @@ declare type CheckPlanReturnListenerFn = (value: CheckPlanReturn) => void;
|
|
|
650
1136
|
*/
|
|
651
1137
|
export declare interface CompanyCreditBalance {
|
|
652
1138
|
/**
|
|
653
|
-
* Remaining credit, excluding any open lease hold (the value SDKs gate on)
|
|
1139
|
+
* Remaining credit, excluding any open lease hold (the value SDKs gate on)
|
|
1140
|
+
* @type {number}
|
|
1141
|
+
* @memberof CompanyCreditBalance
|
|
1142
|
+
*/
|
|
1143
|
+
remaining: number;
|
|
1144
|
+
/**
|
|
1145
|
+
* Amount held by the company's open credit lease, 0 when none is open
|
|
1146
|
+
* @type {number}
|
|
1147
|
+
* @memberof CompanyCreditBalance
|
|
1148
|
+
*/
|
|
1149
|
+
reserved: number;
|
|
1150
|
+
/**
|
|
1151
|
+
* Spendable balance including the open lease hold (remaining + reserved)
|
|
1152
|
+
* @type {number}
|
|
1153
|
+
* @memberof CompanyCreditBalance
|
|
1154
|
+
*/
|
|
1155
|
+
settled: number;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
*
|
|
1160
|
+
* @export
|
|
1161
|
+
* @interface CompanyCreditBalanceResponseData
|
|
1162
|
+
*/
|
|
1163
|
+
declare interface CompanyCreditBalanceResponseData {
|
|
1164
|
+
/**
|
|
1165
|
+
* 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.
|
|
1166
|
+
* @type {CompanyCreditCompositionResponseData}
|
|
1167
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1168
|
+
*/
|
|
1169
|
+
composition?: CompanyCreditCompositionResponseData;
|
|
1170
|
+
/**
|
|
1171
|
+
*
|
|
1172
|
+
* @type {string}
|
|
1173
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1174
|
+
*/
|
|
1175
|
+
creditDescription: string;
|
|
1176
|
+
/**
|
|
1177
|
+
*
|
|
1178
|
+
* @type {string}
|
|
1179
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1180
|
+
*/
|
|
1181
|
+
creditIcon?: string | null;
|
|
1182
|
+
/**
|
|
1183
|
+
*
|
|
1184
|
+
* @type {string}
|
|
1185
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1186
|
+
*/
|
|
1187
|
+
creditId: string;
|
|
1188
|
+
/**
|
|
1189
|
+
*
|
|
1190
|
+
* @type {string}
|
|
1191
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1192
|
+
*/
|
|
1193
|
+
creditName: string;
|
|
1194
|
+
/**
|
|
1195
|
+
*
|
|
1196
|
+
* @type {string}
|
|
1197
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1198
|
+
*/
|
|
1199
|
+
creditPluralName?: string | null;
|
|
1200
|
+
/**
|
|
1201
|
+
*
|
|
1202
|
+
* @type {string}
|
|
1203
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1204
|
+
*/
|
|
1205
|
+
creditSingularName?: string | null;
|
|
1206
|
+
/**
|
|
1207
|
+
* The earliest expiry among grants that will not be replaced.
|
|
1208
|
+
* @type {Date}
|
|
1209
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1210
|
+
*/
|
|
1211
|
+
expiresAt?: Date | null;
|
|
1212
|
+
/**
|
|
1213
|
+
* The live grants behind the balance, newest first. Empty for a credit the plan draws on that the company holds none of.
|
|
1214
|
+
* @type {Array<CompanyCreditGrantResponseData>}
|
|
1215
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1216
|
+
*/
|
|
1217
|
+
grants: Array<CompanyCreditGrantResponseData>;
|
|
1218
|
+
/**
|
|
1219
|
+
* Whether a bundle of this credit is on offer to the company's plan.
|
|
1220
|
+
* @type {boolean}
|
|
1221
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1222
|
+
*/
|
|
1223
|
+
purchasable: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
*
|
|
1226
|
+
* @type {number}
|
|
1227
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1228
|
+
*/
|
|
1229
|
+
remaining: number;
|
|
1230
|
+
/**
|
|
1231
|
+
* The earliest refresh among grants that renew.
|
|
1232
|
+
* @type {Date}
|
|
1233
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1234
|
+
*/
|
|
1235
|
+
resetsAt?: Date | null;
|
|
1236
|
+
/**
|
|
1237
|
+
*
|
|
1238
|
+
* @type {number}
|
|
1239
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1240
|
+
*/
|
|
1241
|
+
total: number;
|
|
1242
|
+
/**
|
|
1243
|
+
*
|
|
1244
|
+
* @type {number}
|
|
1245
|
+
* @memberof CompanyCreditBalanceResponseData
|
|
1246
|
+
*/
|
|
1247
|
+
used: number;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Schematic API
|
|
1252
|
+
* Schematic API
|
|
1253
|
+
*
|
|
1254
|
+
* The version of the OpenAPI document: 0.1
|
|
1255
|
+
*
|
|
1256
|
+
*
|
|
1257
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
1258
|
+
* https://openapi-generator.tech
|
|
1259
|
+
* Do not edit the class manually.
|
|
1260
|
+
*/
|
|
1261
|
+
/**
|
|
1262
|
+
*
|
|
1263
|
+
* @export
|
|
1264
|
+
* @interface CompanyCreditCompositionResponseData
|
|
1265
|
+
*/
|
|
1266
|
+
declare interface CompanyCreditCompositionResponseData {
|
|
1267
|
+
/**
|
|
1268
|
+
* Credits granted to the company once per period, on top of the per-license amount.
|
|
1269
|
+
* @type {number}
|
|
1270
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1271
|
+
*/
|
|
1272
|
+
fixedQuantity: number;
|
|
1273
|
+
/**
|
|
1274
|
+
*
|
|
1275
|
+
* @type {string}
|
|
1276
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1277
|
+
*/
|
|
1278
|
+
licenseId?: string | null;
|
|
1279
|
+
/**
|
|
1280
|
+
*
|
|
1281
|
+
* @type {string}
|
|
1282
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1283
|
+
*/
|
|
1284
|
+
licenseName: string;
|
|
1285
|
+
/**
|
|
1286
|
+
*
|
|
1287
|
+
* @type {string}
|
|
1288
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1289
|
+
*/
|
|
1290
|
+
licensePluralName?: string | null;
|
|
1291
|
+
/**
|
|
1292
|
+
*
|
|
1293
|
+
* @type {number}
|
|
1294
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1295
|
+
*/
|
|
1296
|
+
licenseQuantity: number;
|
|
1297
|
+
/**
|
|
1298
|
+
*
|
|
1299
|
+
* @type {string}
|
|
1300
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1301
|
+
*/
|
|
1302
|
+
licenseSingularName?: string | null;
|
|
1303
|
+
/**
|
|
1304
|
+
*
|
|
1305
|
+
* @type {number}
|
|
1306
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1307
|
+
*/
|
|
1308
|
+
perLicenseAmount: number;
|
|
1309
|
+
/**
|
|
1310
|
+
* day, week, month or year.
|
|
1311
|
+
* @type {string}
|
|
1312
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1313
|
+
*/
|
|
1314
|
+
period: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* 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.
|
|
1317
|
+
* @type {Date}
|
|
1318
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1319
|
+
*/
|
|
1320
|
+
renewsAt?: Date | null;
|
|
1321
|
+
/**
|
|
1322
|
+
*
|
|
1323
|
+
* @type {number}
|
|
1324
|
+
* @memberof CompanyCreditCompositionResponseData
|
|
1325
|
+
*/
|
|
1326
|
+
total: number;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
*
|
|
1331
|
+
* @export
|
|
1332
|
+
* @interface CompanyCreditGrantResponseData
|
|
1333
|
+
*/
|
|
1334
|
+
declare interface CompanyCreditGrantResponseData {
|
|
1335
|
+
/**
|
|
1336
|
+
*
|
|
1337
|
+
* @type {string}
|
|
1338
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1339
|
+
*/
|
|
1340
|
+
bundleId?: string | null;
|
|
1341
|
+
/**
|
|
1342
|
+
*
|
|
1343
|
+
* @type {string}
|
|
1344
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1345
|
+
*/
|
|
1346
|
+
bundleName?: string | null;
|
|
1347
|
+
/**
|
|
1348
|
+
*
|
|
1349
|
+
* @type {Date}
|
|
1350
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1351
|
+
*/
|
|
1352
|
+
createdAt: Date;
|
|
1353
|
+
/**
|
|
1354
|
+
* When these credits go away unreplaced; null if the grant renews or never expires.
|
|
1355
|
+
* @type {Date}
|
|
1356
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1357
|
+
*/
|
|
1358
|
+
expiresAt?: Date | null;
|
|
1359
|
+
/**
|
|
1360
|
+
*
|
|
1361
|
+
* @type {BillingCreditGrantReason}
|
|
1362
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1363
|
+
*/
|
|
1364
|
+
grantReason: BillingCreditGrantReason;
|
|
1365
|
+
/**
|
|
1366
|
+
*
|
|
1367
|
+
* @type {string}
|
|
1368
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1369
|
+
*/
|
|
1370
|
+
id: string;
|
|
1371
|
+
/**
|
|
1372
|
+
*
|
|
1373
|
+
* @type {string}
|
|
1374
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1375
|
+
*/
|
|
1376
|
+
planId?: string | null;
|
|
1377
|
+
/**
|
|
1378
|
+
*
|
|
1379
|
+
* @type {string}
|
|
1380
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1381
|
+
*/
|
|
1382
|
+
planName?: string | null;
|
|
1383
|
+
/**
|
|
1384
|
+
*
|
|
1385
|
+
* @type {number}
|
|
1386
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1387
|
+
*/
|
|
1388
|
+
quantity: number;
|
|
1389
|
+
/**
|
|
1390
|
+
*
|
|
1391
|
+
* @type {number}
|
|
1392
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1393
|
+
*/
|
|
1394
|
+
quantityRemaining: number;
|
|
1395
|
+
/**
|
|
1396
|
+
*
|
|
1397
|
+
* @type {number}
|
|
1398
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1399
|
+
*/
|
|
1400
|
+
quantityUsed: number;
|
|
1401
|
+
/**
|
|
1402
|
+
* The cadence a renewing grant refreshes on, when it is known.
|
|
1403
|
+
* @type {BillingPlanCreditGrantResetCadence}
|
|
1404
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1405
|
+
*/
|
|
1406
|
+
renewalPeriod?: BillingPlanCreditGrantResetCadence | null;
|
|
1407
|
+
/**
|
|
1408
|
+
* When this grant refreshes; null if it does not renew.
|
|
1409
|
+
* @type {Date}
|
|
1410
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1411
|
+
*/
|
|
1412
|
+
resetsAt?: Date | null;
|
|
1413
|
+
/**
|
|
1414
|
+
*
|
|
1415
|
+
* @type {Date}
|
|
1416
|
+
* @memberof CompanyCreditGrantResponseData
|
|
1417
|
+
*/
|
|
1418
|
+
validFrom?: Date | null;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
*
|
|
1423
|
+
* @export
|
|
1424
|
+
* @interface CompanyCreditUserUsageResponseData
|
|
1425
|
+
*/
|
|
1426
|
+
declare interface CompanyCreditUserUsageResponseData {
|
|
1427
|
+
/**
|
|
1428
|
+
* 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.
|
|
1429
|
+
* @type {number}
|
|
1430
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1431
|
+
*/
|
|
1432
|
+
count: number;
|
|
1433
|
+
/**
|
|
1434
|
+
* End of the span; the time of the request for a credit the company holds no live grant of.
|
|
1435
|
+
* @type {Date}
|
|
1436
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1437
|
+
*/
|
|
1438
|
+
endTime?: Date | null;
|
|
1439
|
+
/**
|
|
1440
|
+
* Start of the span; equal to end_time for a credit the company holds no live grant of.
|
|
1441
|
+
* @type {Date}
|
|
1442
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1443
|
+
*/
|
|
1444
|
+
startTime?: Date | null;
|
|
1445
|
+
/**
|
|
1446
|
+
* Consumption across every user in the span, not just this page.
|
|
1447
|
+
* @type {number}
|
|
1448
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1449
|
+
*/
|
|
1450
|
+
total: number;
|
|
1451
|
+
/**
|
|
1452
|
+
* Consumption from events sent without a user; null when there is none.
|
|
1453
|
+
* @type {number}
|
|
1454
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1455
|
+
*/
|
|
1456
|
+
unattributed?: number | null;
|
|
1457
|
+
/**
|
|
1458
|
+
* This page of users, heaviest first.
|
|
1459
|
+
* @type {Array<CompanyCreditUserUsageRowResponseData>}
|
|
1460
|
+
* @memberof CompanyCreditUserUsageResponseData
|
|
1461
|
+
*/
|
|
1462
|
+
users: Array<CompanyCreditUserUsageRowResponseData>;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Schematic API
|
|
1467
|
+
* Schematic API
|
|
1468
|
+
*
|
|
1469
|
+
* The version of the OpenAPI document: 0.1
|
|
1470
|
+
*
|
|
1471
|
+
*
|
|
1472
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
1473
|
+
* https://openapi-generator.tech
|
|
1474
|
+
* Do not edit the class manually.
|
|
1475
|
+
*/
|
|
1476
|
+
/**
|
|
1477
|
+
*
|
|
1478
|
+
* @export
|
|
1479
|
+
* @interface CompanyCreditUserUsageRowResponseData
|
|
1480
|
+
*/
|
|
1481
|
+
declare interface CompanyCreditUserUsageRowResponseData {
|
|
1482
|
+
/**
|
|
1483
|
+
*
|
|
1484
|
+
* @type {string}
|
|
1485
|
+
* @memberof CompanyCreditUserUsageRowResponseData
|
|
1486
|
+
*/
|
|
1487
|
+
name?: string | null;
|
|
1488
|
+
/**
|
|
1489
|
+
* This user's fraction (0-1) of all consumption in the span, unattributed included.
|
|
1490
|
+
* @type {number}
|
|
1491
|
+
* @memberof CompanyCreditUserUsageRowResponseData
|
|
1492
|
+
*/
|
|
1493
|
+
share: number;
|
|
1494
|
+
/**
|
|
1495
|
+
*
|
|
1496
|
+
* @type {number}
|
|
1497
|
+
* @memberof CompanyCreditUserUsageRowResponseData
|
|
1498
|
+
*/
|
|
1499
|
+
used: number;
|
|
1500
|
+
/**
|
|
1501
|
+
*
|
|
1502
|
+
* @type {string}
|
|
1503
|
+
* @memberof CompanyCreditUserUsageRowResponseData
|
|
1504
|
+
*/
|
|
1505
|
+
userId: string;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Schematic API
|
|
1510
|
+
* Schematic API
|
|
1511
|
+
*
|
|
1512
|
+
* The version of the OpenAPI document: 0.1
|
|
1513
|
+
*
|
|
1514
|
+
*
|
|
1515
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
1516
|
+
* https://openapi-generator.tech
|
|
1517
|
+
* Do not edit the class manually.
|
|
1518
|
+
*/
|
|
1519
|
+
/**
|
|
1520
|
+
*
|
|
1521
|
+
* @export
|
|
1522
|
+
* @interface CompanyDiscountResponseData
|
|
1523
|
+
*/
|
|
1524
|
+
declare interface CompanyDiscountResponseData {
|
|
1525
|
+
/**
|
|
1526
|
+
*
|
|
1527
|
+
* @type {number}
|
|
1528
|
+
* @memberof CompanyDiscountResponseData
|
|
1529
|
+
*/
|
|
1530
|
+
amountOff?: number | null;
|
|
1531
|
+
/**
|
|
1532
|
+
*
|
|
1533
|
+
* @type {string}
|
|
1534
|
+
* @memberof CompanyDiscountResponseData
|
|
1535
|
+
*/
|
|
1536
|
+
couponName: string;
|
|
1537
|
+
/**
|
|
1538
|
+
*
|
|
1539
|
+
* @type {string}
|
|
1540
|
+
* @memberof CompanyDiscountResponseData
|
|
1541
|
+
*/
|
|
1542
|
+
currency?: string | null;
|
|
1543
|
+
/**
|
|
1544
|
+
*
|
|
1545
|
+
* @type {string}
|
|
1546
|
+
* @memberof CompanyDiscountResponseData
|
|
1547
|
+
*/
|
|
1548
|
+
customerFacingCode?: string | null;
|
|
1549
|
+
/**
|
|
1550
|
+
* Provider vocabulary: once, repeating, or forever.
|
|
1551
|
+
* @type {string}
|
|
1552
|
+
* @memberof CompanyDiscountResponseData
|
|
1553
|
+
*/
|
|
1554
|
+
duration: string;
|
|
1555
|
+
/**
|
|
1556
|
+
*
|
|
1557
|
+
* @type {number}
|
|
1558
|
+
* @memberof CompanyDiscountResponseData
|
|
1559
|
+
*/
|
|
1560
|
+
durationInMonths?: number | null;
|
|
1561
|
+
/**
|
|
1562
|
+
*
|
|
1563
|
+
* @type {number}
|
|
1564
|
+
* @memberof CompanyDiscountResponseData
|
|
1565
|
+
*/
|
|
1566
|
+
percentOff?: number | null;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
*
|
|
1571
|
+
* @export
|
|
1572
|
+
* @interface CompanyFeatureUsageResponseData
|
|
1573
|
+
*/
|
|
1574
|
+
declare interface CompanyFeatureUsageResponseData {
|
|
1575
|
+
/**
|
|
1576
|
+
* Whether the company may use the feature right now.
|
|
1577
|
+
* @type {boolean}
|
|
1578
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1579
|
+
*/
|
|
1580
|
+
access: boolean;
|
|
1581
|
+
/**
|
|
1582
|
+
* The entitlement's own limit before any price behavior applies: the numeric value, or the trait's value for a trait-based entitlement. For a credit entitlement, the credits granted in the current billing period (all time without a subscription). Null for unlimited and boolean entitlements.
|
|
1583
|
+
* @type {number}
|
|
1584
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1585
|
+
*/
|
|
1586
|
+
allocation?: number | null;
|
|
1587
|
+
/**
|
|
1588
|
+
* Set when entitlement_type is company_override.
|
|
1589
|
+
* @type {string}
|
|
1590
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1591
|
+
*/
|
|
1592
|
+
companyOverrideId?: string | null;
|
|
1593
|
+
/**
|
|
1594
|
+
* Credits consumed per unit of usage, for entitlements that burn credits.
|
|
1595
|
+
* @type {number}
|
|
1596
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1597
|
+
*/
|
|
1598
|
+
consumptionRate?: number | null;
|
|
1599
|
+
/**
|
|
1600
|
+
*
|
|
1601
|
+
* @type {string}
|
|
1602
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1603
|
+
*/
|
|
1604
|
+
creditIcon?: string | null;
|
|
1605
|
+
/**
|
|
1606
|
+
*
|
|
1607
|
+
* @type {string}
|
|
1608
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1609
|
+
*/
|
|
1610
|
+
creditId?: string | null;
|
|
1611
|
+
/**
|
|
1612
|
+
*
|
|
1613
|
+
* @type {string}
|
|
1614
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1615
|
+
*/
|
|
1616
|
+
creditName?: string | null;
|
|
1617
|
+
/**
|
|
1618
|
+
*
|
|
1619
|
+
* @type {string}
|
|
1620
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1621
|
+
*/
|
|
1622
|
+
creditPluralName?: string | null;
|
|
1623
|
+
/**
|
|
1624
|
+
*
|
|
1625
|
+
* @type {string}
|
|
1626
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1627
|
+
*/
|
|
1628
|
+
creditSingularName?: string | null;
|
|
1629
|
+
/**
|
|
1630
|
+
* What the feature costs at price, in its minor units: the allocation for pay_in_advance, usage for tier and pay_as_you_go, and usage above soft_limit for overage. Null when there is no price, the price behavior bills nothing, or there is nothing yet to bill it on (no allocation for pay_in_advance, unknown usage for tier, no usage for pay_as_you_go and overage); tier at zero usage, and overage within soft_limit, cost 0.
|
|
1631
|
+
* @type {number}
|
|
1632
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1633
|
+
*/
|
|
1634
|
+
currentCost?: number | null;
|
|
1635
|
+
/**
|
|
1636
|
+
*
|
|
1637
|
+
* @type {EntitlementType}
|
|
1638
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1639
|
+
*/
|
|
1640
|
+
entitlementType: EntitlementType;
|
|
1641
|
+
/**
|
|
1642
|
+
* When a company override ends; plan entitlements do not expire.
|
|
1643
|
+
* @type {Date}
|
|
1644
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1645
|
+
*/
|
|
1646
|
+
expiresAt?: Date | null;
|
|
1647
|
+
/**
|
|
1648
|
+
*
|
|
1649
|
+
* @type {string}
|
|
1650
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1651
|
+
*/
|
|
1652
|
+
featureDescription: string;
|
|
1653
|
+
/**
|
|
1654
|
+
*
|
|
1655
|
+
* @type {string}
|
|
1656
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1657
|
+
*/
|
|
1658
|
+
featureIcon: string;
|
|
1659
|
+
/**
|
|
1660
|
+
*
|
|
1661
|
+
* @type {string}
|
|
1662
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1663
|
+
*/
|
|
1664
|
+
featureId: string;
|
|
1665
|
+
/**
|
|
1666
|
+
*
|
|
1667
|
+
* @type {string}
|
|
1668
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1669
|
+
*/
|
|
1670
|
+
featureName: string;
|
|
1671
|
+
/**
|
|
1672
|
+
*
|
|
1673
|
+
* @type {string}
|
|
1674
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1675
|
+
*/
|
|
1676
|
+
featurePluralName?: string | null;
|
|
1677
|
+
/**
|
|
1678
|
+
*
|
|
1679
|
+
* @type {string}
|
|
1680
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1681
|
+
*/
|
|
1682
|
+
featureSingularName?: string | null;
|
|
1683
|
+
/**
|
|
1684
|
+
*
|
|
1685
|
+
* @type {FeatureType}
|
|
1686
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1687
|
+
*/
|
|
1688
|
+
featureType: FeatureType;
|
|
1689
|
+
/**
|
|
1690
|
+
*
|
|
1691
|
+
* @type {string}
|
|
1692
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1693
|
+
*/
|
|
1694
|
+
licenseId?: string | null;
|
|
1695
|
+
/**
|
|
1696
|
+
*
|
|
1697
|
+
* @type {MetricPeriod}
|
|
1698
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1699
|
+
*/
|
|
1700
|
+
metricPeriod?: MetricPeriod_2 | null;
|
|
1701
|
+
/**
|
|
1702
|
+
*
|
|
1703
|
+
* @type {MetricPeriodMonthReset}
|
|
1704
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1705
|
+
*/
|
|
1706
|
+
metricPeriodMonthReset?: MetricPeriodMonthReset_2 | null;
|
|
1707
|
+
/**
|
|
1708
|
+
* The plan's credit grants that scale with the license this feature counts.
|
|
1709
|
+
* @type {Array<CatalogCreditGrantResponseData>}
|
|
1710
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1711
|
+
*/
|
|
1712
|
+
perLicenseCreditGrants: Array<CatalogCreditGrantResponseData>;
|
|
1713
|
+
/**
|
|
1714
|
+
* Set when entitlement_type is plan_entitlement.
|
|
1715
|
+
* @type {string}
|
|
1716
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1717
|
+
*/
|
|
1718
|
+
planEntitlementId?: string | null;
|
|
1719
|
+
/**
|
|
1720
|
+
* The metered price the company is billed at: the slot for its billing period, in the subscription's currency, or in none when the price predates multi-currency (any currency without a subscription). Null when the feature has no such price for that period.
|
|
1721
|
+
* @type {CatalogPriceResponseData}
|
|
1722
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1723
|
+
*/
|
|
1724
|
+
price?: CatalogPriceResponseData;
|
|
1725
|
+
/**
|
|
1726
|
+
*
|
|
1727
|
+
* @type {EntitlementPriceBehavior}
|
|
1728
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1729
|
+
*/
|
|
1730
|
+
priceBehavior?: EntitlementPriceBehavior | null;
|
|
1731
|
+
/**
|
|
1732
|
+
* When the usage metric next resets.
|
|
1733
|
+
* @type {Date}
|
|
1734
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1735
|
+
*/
|
|
1736
|
+
resetsAt?: Date | null;
|
|
1737
|
+
/**
|
|
1738
|
+
*
|
|
654
1739
|
* @type {number}
|
|
655
|
-
* @memberof
|
|
1740
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
656
1741
|
*/
|
|
657
|
-
|
|
1742
|
+
softLimit?: number | null;
|
|
658
1743
|
/**
|
|
659
|
-
*
|
|
1744
|
+
* Usage in the current metric period; null for features that are not metered.
|
|
660
1745
|
* @type {number}
|
|
661
|
-
* @memberof
|
|
1746
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
662
1747
|
*/
|
|
663
|
-
|
|
1748
|
+
usage?: number | null;
|
|
664
1749
|
/**
|
|
665
|
-
*
|
|
1750
|
+
*
|
|
1751
|
+
* @type {boolean}
|
|
1752
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1753
|
+
*/
|
|
1754
|
+
valueBool?: boolean | null;
|
|
1755
|
+
/**
|
|
1756
|
+
*
|
|
666
1757
|
* @type {number}
|
|
667
|
-
* @memberof
|
|
1758
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
668
1759
|
*/
|
|
669
|
-
|
|
1760
|
+
valueNumeric?: number | null;
|
|
1761
|
+
/**
|
|
1762
|
+
*
|
|
1763
|
+
* @type {EntitlementValueType}
|
|
1764
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1765
|
+
*/
|
|
1766
|
+
valueType: EntitlementValueType_2;
|
|
1767
|
+
/**
|
|
1768
|
+
* The default warning-tier value, when configured.
|
|
1769
|
+
* @type {number}
|
|
1770
|
+
* @memberof CompanyFeatureUsageResponseData
|
|
1771
|
+
*/
|
|
1772
|
+
warningThreshold?: number | null;
|
|
670
1773
|
}
|
|
671
1774
|
|
|
672
|
-
/**
|
|
673
|
-
* Schematic API
|
|
674
|
-
* Schematic API
|
|
675
|
-
*
|
|
676
|
-
* The version of the OpenAPI document: 0.1
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
680
|
-
* https://openapi-generator.tech
|
|
681
|
-
* Do not edit the class manually.
|
|
682
|
-
*/
|
|
683
1775
|
/**
|
|
684
1776
|
*
|
|
685
1777
|
* @export
|
|
686
|
-
* @interface
|
|
1778
|
+
* @interface CompanyFeatureUserUsageResponseData
|
|
687
1779
|
*/
|
|
688
|
-
declare interface
|
|
1780
|
+
declare interface CompanyFeatureUserUsageResponseData {
|
|
689
1781
|
/**
|
|
690
|
-
*
|
|
1782
|
+
* How many of the company's users the breakdown lists across every page, including those without usage in the period; unattributed usage is not a user and is not counted.
|
|
691
1783
|
* @type {number}
|
|
692
|
-
* @memberof
|
|
693
|
-
*/
|
|
694
|
-
amountOff?: number | null;
|
|
695
|
-
/**
|
|
696
|
-
*
|
|
697
|
-
* @type {string}
|
|
698
|
-
* @memberof CompanyDiscountResponseData
|
|
1784
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
699
1785
|
*/
|
|
700
|
-
|
|
1786
|
+
count: number;
|
|
701
1787
|
/**
|
|
702
|
-
*
|
|
703
|
-
* @type {
|
|
704
|
-
* @memberof
|
|
1788
|
+
* End of the feature's current metric period (exclusive).
|
|
1789
|
+
* @type {Date}
|
|
1790
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
705
1791
|
*/
|
|
706
|
-
|
|
1792
|
+
endTime: Date;
|
|
707
1793
|
/**
|
|
708
|
-
*
|
|
709
|
-
* @type {
|
|
710
|
-
* @memberof
|
|
1794
|
+
* Start of the feature's current metric period.
|
|
1795
|
+
* @type {Date}
|
|
1796
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
711
1797
|
*/
|
|
712
|
-
|
|
1798
|
+
startTime: Date;
|
|
713
1799
|
/**
|
|
714
|
-
*
|
|
715
|
-
* @type {
|
|
716
|
-
* @memberof
|
|
1800
|
+
* Usage across every user in the period, not just this page.
|
|
1801
|
+
* @type {number}
|
|
1802
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
717
1803
|
*/
|
|
718
|
-
|
|
1804
|
+
total: number;
|
|
719
1805
|
/**
|
|
720
|
-
*
|
|
1806
|
+
* Usage from events sent without a user; null when the period has none.
|
|
721
1807
|
* @type {number}
|
|
722
|
-
* @memberof
|
|
1808
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
723
1809
|
*/
|
|
724
|
-
|
|
1810
|
+
unattributed?: number | null;
|
|
725
1811
|
/**
|
|
726
|
-
*
|
|
727
|
-
* @type {
|
|
728
|
-
* @memberof
|
|
1812
|
+
* This page of users, highest usage first.
|
|
1813
|
+
* @type {Array<CompanyUserUsageResponseData>}
|
|
1814
|
+
* @memberof CompanyFeatureUserUsageResponseData
|
|
729
1815
|
*/
|
|
730
|
-
|
|
1816
|
+
users: Array<CompanyUserUsageResponseData>;
|
|
731
1817
|
}
|
|
732
1818
|
|
|
733
1819
|
/**
|
|
@@ -933,6 +2019,85 @@ declare interface CompanyUpcomingInvoiceResponseData {
|
|
|
933
2019
|
subtotal: number;
|
|
934
2020
|
}
|
|
935
2021
|
|
|
2022
|
+
/**
|
|
2023
|
+
* Schematic API
|
|
2024
|
+
* Schematic API
|
|
2025
|
+
*
|
|
2026
|
+
* The version of the OpenAPI document: 0.1
|
|
2027
|
+
*
|
|
2028
|
+
*
|
|
2029
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2030
|
+
* https://openapi-generator.tech
|
|
2031
|
+
* Do not edit the class manually.
|
|
2032
|
+
*/
|
|
2033
|
+
/**
|
|
2034
|
+
*
|
|
2035
|
+
* @export
|
|
2036
|
+
* @interface CompanyUserUsageResponseData
|
|
2037
|
+
*/
|
|
2038
|
+
declare interface CompanyUserUsageResponseData {
|
|
2039
|
+
/**
|
|
2040
|
+
* When the user last used the feature in the period.
|
|
2041
|
+
* @type {Date}
|
|
2042
|
+
* @memberof CompanyUserUsageResponseData
|
|
2043
|
+
*/
|
|
2044
|
+
lastSeen: Date;
|
|
2045
|
+
/**
|
|
2046
|
+
*
|
|
2047
|
+
* @type {string}
|
|
2048
|
+
* @memberof CompanyUserUsageResponseData
|
|
2049
|
+
*/
|
|
2050
|
+
name?: string | null;
|
|
2051
|
+
/**
|
|
2052
|
+
* This user's fraction (0-1) of all usage in the period, unattributed usage included.
|
|
2053
|
+
* @type {number}
|
|
2054
|
+
* @memberof CompanyUserUsageResponseData
|
|
2055
|
+
*/
|
|
2056
|
+
share: number;
|
|
2057
|
+
/**
|
|
2058
|
+
*
|
|
2059
|
+
* @type {number}
|
|
2060
|
+
* @memberof CompanyUserUsageResponseData
|
|
2061
|
+
*/
|
|
2062
|
+
usage: number;
|
|
2063
|
+
/**
|
|
2064
|
+
*
|
|
2065
|
+
* @type {string}
|
|
2066
|
+
* @memberof CompanyUserUsageResponseData
|
|
2067
|
+
*/
|
|
2068
|
+
userId: string;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Function supplied by the integrating application that returns an HMAC context
|
|
2073
|
+
* signature (`iat.exp.sig`) for the given context.
|
|
2074
|
+
*
|
|
2075
|
+
* Because a publishable key is public, the signature must be produced by the
|
|
2076
|
+
* customer's backend, which holds the matching secret API key. A typical
|
|
2077
|
+
* implementation forwards the context to that backend and returns the
|
|
2078
|
+
* `X-Schematic-Context-Sig` value it computes:
|
|
2079
|
+
*
|
|
2080
|
+
* ```ts
|
|
2081
|
+
* const schematic = new Schematic(pubKey, {
|
|
2082
|
+
* getContextSignature: async (context) => {
|
|
2083
|
+
* const res = await fetch("/api/schematic/sign", {
|
|
2084
|
+
* method: "POST",
|
|
2085
|
+
* credentials: "include",
|
|
2086
|
+
* headers: { "Content-Type": "application/json" },
|
|
2087
|
+
* body: JSON.stringify(context),
|
|
2088
|
+
* });
|
|
2089
|
+
* const { signature } = await res.json();
|
|
2090
|
+
* return signature; // "iat.exp.sig"
|
|
2091
|
+
* },
|
|
2092
|
+
* });
|
|
2093
|
+
* ```
|
|
2094
|
+
*
|
|
2095
|
+
* The SDK derives the expiry from the returned string (its middle segment) and
|
|
2096
|
+
* caches it per context, so the function is only invoked when no fresh
|
|
2097
|
+
* signature is available.
|
|
2098
|
+
*/
|
|
2099
|
+
declare type ContextSignatureProvider = (context: SchematicContext) => string | Promise<string>;
|
|
2100
|
+
|
|
936
2101
|
/** A company's lease-aware balance for a single credit type */
|
|
937
2102
|
export declare type CreditBalance = {
|
|
938
2103
|
/** Spendable balance including any open lease hold (remaining + reserved); the number to display to end users */
|
|
@@ -943,6 +2108,20 @@ export declare type CreditBalance = {
|
|
|
943
2108
|
reserved: number;
|
|
944
2109
|
};
|
|
945
2110
|
|
|
2111
|
+
/**
|
|
2112
|
+
* One credit's balance. What the server has already decided, so a consumer
|
|
2113
|
+
* never re-derives it:
|
|
2114
|
+
*
|
|
2115
|
+
* * `grants` are the live ones only, newest first; expired and zeroed-out
|
|
2116
|
+
* grants are gone, so `total` is `used` plus `remaining`.
|
|
2117
|
+
* * A credit the plan draws on that the company holds none of is a zero
|
|
2118
|
+
* balance with no grants.
|
|
2119
|
+
* * Each grant carries `resetsAt` or `expiresAt`, never both.
|
|
2120
|
+
* * `purchasable` — a bundle of it is on offer to the company's plan.
|
|
2121
|
+
* * `composition` — how a per-license plan grant adds up per period.
|
|
2122
|
+
*/
|
|
2123
|
+
export declare type CreditBalanceEntry = CompanyCreditBalanceResponseData;
|
|
2124
|
+
|
|
946
2125
|
declare type CreditBalanceListenerFn = CreditBalancesListenerFn | EmptyListenerFn;
|
|
947
2126
|
|
|
948
2127
|
/** A company's lease-aware credit balances keyed by credit ID */
|
|
@@ -952,6 +2131,10 @@ declare const CreditBalancesFromJSON: (json: any) => CreditBalances;
|
|
|
952
2131
|
|
|
953
2132
|
declare type CreditBalancesListenerFn = (value: CreditBalances) => void;
|
|
954
2133
|
|
|
2134
|
+
export declare type CreditComposition = CompanyCreditCompositionResponseData;
|
|
2135
|
+
|
|
2136
|
+
export declare type CreditGrant = CompanyCreditGrantResponseData;
|
|
2137
|
+
|
|
955
2138
|
/** Every spend policy binding the current context, company-scope first */
|
|
956
2139
|
export declare type CreditSpendPolicies = CreditSpendPolicy[];
|
|
957
2140
|
|
|
@@ -1099,6 +2282,23 @@ declare interface CreditSpendWindow_2 {
|
|
|
1099
2282
|
unit: string;
|
|
1100
2283
|
}
|
|
1101
2284
|
|
|
2285
|
+
/**
|
|
2286
|
+
* One credit's consumption by user over the span of its live grants: a page
|
|
2287
|
+
* of `users`, heaviest first; `count` users in all; the span's `total`; and
|
|
2288
|
+
* `unattributed` consumption from events sent without a user. Empty for a
|
|
2289
|
+
* credit the company holds no live grant of.
|
|
2290
|
+
*/
|
|
2291
|
+
export declare type CreditUserUsage = CompanyCreditUserUsageResponseData;
|
|
2292
|
+
|
|
2293
|
+
declare interface CreditUserUsageRequest {
|
|
2294
|
+
creditId: string;
|
|
2295
|
+
/** Users per page; the server's default when omitted. */
|
|
2296
|
+
limit?: number;
|
|
2297
|
+
offset?: number;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
export declare type CreditUserUsageRow = CompanyCreditUserUsageRowResponseData;
|
|
2301
|
+
|
|
1102
2302
|
/**
|
|
1103
2303
|
*
|
|
1104
2304
|
* @export
|
|
@@ -1139,6 +2339,32 @@ export declare type Discount = CompanyDiscountResponseData;
|
|
|
1139
2339
|
|
|
1140
2340
|
declare type EmptyListenerFn = () => void;
|
|
1141
2341
|
|
|
2342
|
+
/**
|
|
2343
|
+
*
|
|
2344
|
+
* @export
|
|
2345
|
+
*/
|
|
2346
|
+
declare const EntitlementPriceBehavior: {
|
|
2347
|
+
readonly CreditBurndown: "credit_burndown";
|
|
2348
|
+
readonly Overage: "overage";
|
|
2349
|
+
readonly PayAsYouGo: "pay_as_you_go";
|
|
2350
|
+
readonly PayInAdvance: "pay_in_advance";
|
|
2351
|
+
readonly Tier: "tier";
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
declare type EntitlementPriceBehavior = (typeof EntitlementPriceBehavior)[keyof typeof EntitlementPriceBehavior];
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
*
|
|
2358
|
+
* @export
|
|
2359
|
+
*/
|
|
2360
|
+
declare const EntitlementType: {
|
|
2361
|
+
readonly CompanyOverride: "company_override";
|
|
2362
|
+
readonly PlanEntitlement: "plan_entitlement";
|
|
2363
|
+
readonly Unknown: "unknown";
|
|
2364
|
+
};
|
|
2365
|
+
|
|
2366
|
+
declare type EntitlementType = (typeof EntitlementType)[keyof typeof EntitlementType];
|
|
2367
|
+
|
|
1142
2368
|
/**
|
|
1143
2369
|
*
|
|
1144
2370
|
* @export
|
|
@@ -1154,6 +2380,21 @@ declare const EntitlementValueType: {
|
|
|
1154
2380
|
|
|
1155
2381
|
declare type EntitlementValueType = (typeof EntitlementValueType)[keyof typeof EntitlementValueType];
|
|
1156
2382
|
|
|
2383
|
+
/**
|
|
2384
|
+
*
|
|
2385
|
+
* @export
|
|
2386
|
+
*/
|
|
2387
|
+
declare const EntitlementValueType_2: {
|
|
2388
|
+
readonly Boolean: "boolean";
|
|
2389
|
+
readonly Credit: "credit";
|
|
2390
|
+
readonly Numeric: "numeric";
|
|
2391
|
+
readonly Trait: "trait";
|
|
2392
|
+
readonly Unknown: "unknown";
|
|
2393
|
+
readonly Unlimited: "unlimited";
|
|
2394
|
+
};
|
|
2395
|
+
|
|
2396
|
+
declare type EntitlementValueType_2 = (typeof EntitlementValueType_2)[keyof typeof EntitlementValueType_2];
|
|
2397
|
+
|
|
1157
2398
|
declare type Event_2 = {
|
|
1158
2399
|
api_key: string;
|
|
1159
2400
|
body: EventBody;
|
|
@@ -1278,6 +2519,12 @@ export declare type EventBodyTrack = SchematicContext & {
|
|
|
1278
2519
|
|
|
1279
2520
|
export declare type EventType = "identify" | "track" | "flag_check";
|
|
1280
2521
|
|
|
2522
|
+
/**
|
|
2523
|
+
* Users fetched for one feature's breakdown. The breakdown is read once, not
|
|
2524
|
+
* paged: it lists the heaviest users and says how many more there are.
|
|
2525
|
+
*/
|
|
2526
|
+
export declare const FEATURE_USER_USAGE_LIMIT = 20;
|
|
2527
|
+
|
|
1281
2528
|
/**
|
|
1282
2529
|
*
|
|
1283
2530
|
* @export
|
|
@@ -1374,6 +2621,14 @@ declare interface FeatureEntitlement {
|
|
|
1374
2621
|
* @memberof FeatureEntitlement
|
|
1375
2622
|
*/
|
|
1376
2623
|
monthReset?: MetricPeriodMonthReset | null;
|
|
2624
|
+
/**
|
|
2625
|
+
* 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
|
|
2626
|
+
* @type {{ [key: string]: number; }}
|
|
2627
|
+
* @memberof FeatureEntitlement
|
|
2628
|
+
*/
|
|
2629
|
+
quantityRates?: {
|
|
2630
|
+
[key: string]: number;
|
|
2631
|
+
};
|
|
1377
2632
|
/**
|
|
1378
2633
|
* For usage-based pricing, the soft limit for overage charges or the next tier boundary
|
|
1379
2634
|
* @type {number}
|
|
@@ -1400,6 +2655,48 @@ declare interface FeatureEntitlement {
|
|
|
1400
2655
|
warningTiers?: Array<WarningTier>;
|
|
1401
2656
|
}
|
|
1402
2657
|
|
|
2658
|
+
/**
|
|
2659
|
+
*
|
|
2660
|
+
* @export
|
|
2661
|
+
*/
|
|
2662
|
+
declare const FeatureType: {
|
|
2663
|
+
readonly Boolean: "boolean";
|
|
2664
|
+
readonly Event: "event";
|
|
2665
|
+
readonly License: "license";
|
|
2666
|
+
readonly Trait: "trait";
|
|
2667
|
+
};
|
|
2668
|
+
|
|
2669
|
+
declare type FeatureType = (typeof FeatureType)[keyof typeof FeatureType];
|
|
2670
|
+
|
|
2671
|
+
/**
|
|
2672
|
+
* One feature the company is entitled to, and its usage. What the server has
|
|
2673
|
+
* already decided, so a consumer never re-derives it:
|
|
2674
|
+
*
|
|
2675
|
+
* * `price` — the one metered price the company is billed at: its billing
|
|
2676
|
+
* period's slot, in the subscription's currency when the feature is priced
|
|
2677
|
+
* in it. Absent when the period has none; another cadence's price is never
|
|
2678
|
+
* substituted.
|
|
2679
|
+
* * `currentCost` — what the feature costs at `price`, in its minor units.
|
|
2680
|
+
* * `perLicenseCreditGrants` — the plan's credit grants that scale with the
|
|
2681
|
+
* license this feature counts.
|
|
2682
|
+
*/
|
|
2683
|
+
export declare type FeatureUsage = CompanyFeatureUsageResponseData;
|
|
2684
|
+
|
|
2685
|
+
/**
|
|
2686
|
+
* One event-based feature's usage by user over its current metric period:
|
|
2687
|
+
* a page of `users`, highest usage first; `count` users in all; the period's
|
|
2688
|
+
* `total`; and `unattributed` usage from events sent without a user, which is
|
|
2689
|
+
* not a user and never on the page.
|
|
2690
|
+
*/
|
|
2691
|
+
export declare type FeatureUserUsage = CompanyFeatureUserUsageResponseData;
|
|
2692
|
+
|
|
2693
|
+
declare interface FeatureUserUsageRequest {
|
|
2694
|
+
featureId: string;
|
|
2695
|
+
/** Users per page; the server's default when omitted. */
|
|
2696
|
+
limit?: number;
|
|
2697
|
+
offset?: number;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
1403
2700
|
/**
|
|
1404
2701
|
* Server prefetch for a provider's `initialData`. A resource that fails is
|
|
1405
2702
|
* left out rather than thrown, so one of them cannot block a page.
|
|
@@ -1468,6 +2765,9 @@ export declare type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceS
|
|
|
1468
2765
|
/** A record of unique key-value pairs used for identifying a company or user */
|
|
1469
2766
|
export declare type Keys = Record<string, string>;
|
|
1470
2767
|
|
|
2768
|
+
/** A metered price, tiers included. */
|
|
2769
|
+
export declare type MeteredPrice = CatalogPriceResponseData;
|
|
2770
|
+
|
|
1471
2771
|
/**
|
|
1472
2772
|
*
|
|
1473
2773
|
* @export
|
|
@@ -1481,6 +2781,19 @@ declare const MetricPeriod: {
|
|
|
1481
2781
|
|
|
1482
2782
|
declare type MetricPeriod = (typeof MetricPeriod)[keyof typeof MetricPeriod];
|
|
1483
2783
|
|
|
2784
|
+
/**
|
|
2785
|
+
*
|
|
2786
|
+
* @export
|
|
2787
|
+
*/
|
|
2788
|
+
declare const MetricPeriod_2: {
|
|
2789
|
+
readonly AllTime: "all_time";
|
|
2790
|
+
readonly CurrentDay: "current_day";
|
|
2791
|
+
readonly CurrentMonth: "current_month";
|
|
2792
|
+
readonly CurrentWeek: "current_week";
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2795
|
+
declare type MetricPeriod_2 = (typeof MetricPeriod_2)[keyof typeof MetricPeriod_2];
|
|
2796
|
+
|
|
1484
2797
|
/**
|
|
1485
2798
|
*
|
|
1486
2799
|
* @export
|
|
@@ -1492,6 +2805,17 @@ declare const MetricPeriodMonthReset: {
|
|
|
1492
2805
|
|
|
1493
2806
|
declare type MetricPeriodMonthReset = (typeof MetricPeriodMonthReset)[keyof typeof MetricPeriodMonthReset];
|
|
1494
2807
|
|
|
2808
|
+
/**
|
|
2809
|
+
*
|
|
2810
|
+
* @export
|
|
2811
|
+
*/
|
|
2812
|
+
declare const MetricPeriodMonthReset_2: {
|
|
2813
|
+
readonly BillingCycle: "billing_cycle";
|
|
2814
|
+
readonly FirstOfMonth: "first_of_month";
|
|
2815
|
+
};
|
|
2816
|
+
|
|
2817
|
+
declare type MetricPeriodMonthReset_2 = (typeof MetricPeriodMonthReset_2)[keyof typeof MetricPeriodMonthReset_2];
|
|
2818
|
+
|
|
1495
2819
|
/**
|
|
1496
2820
|
* Keeps only the fields the request reads. The store keys a row set by the
|
|
1497
2821
|
* query's shape, so a field the API never sees would key a row set of its
|
|
@@ -1538,6 +2862,20 @@ export declare interface PaymentMethodsHandle extends ResourceHandle<PaymentMeth
|
|
|
1538
2862
|
|
|
1539
2863
|
declare type PendingListenerFn = BooleanListenerFn | EmptyListenerFn;
|
|
1540
2864
|
|
|
2865
|
+
/** A plan credit grant that scales per license. */
|
|
2866
|
+
export declare type PerLicenseCreditGrant = CatalogCreditGrantResponseData;
|
|
2867
|
+
|
|
2868
|
+
/**
|
|
2869
|
+
*
|
|
2870
|
+
* @export
|
|
2871
|
+
*/
|
|
2872
|
+
declare const PlanCreditGrantScaling: {
|
|
2873
|
+
readonly Fixed: "fixed";
|
|
2874
|
+
readonly PerLicense: "per_license";
|
|
2875
|
+
};
|
|
2876
|
+
|
|
2877
|
+
declare type PlanCreditGrantScaling = (typeof PlanCreditGrantScaling)[keyof typeof PlanCreditGrantScaling];
|
|
2878
|
+
|
|
1541
2879
|
declare type PlanListenerFn = CheckPlanReturnListenerFn | EmptyListenerFn;
|
|
1542
2880
|
|
|
1543
2881
|
declare interface RequestOptions {
|
|
@@ -1602,6 +2940,7 @@ declare type RuleType_2 = (typeof RuleType_2)[keyof typeof RuleType_2];
|
|
|
1602
2940
|
export declare class Schematic {
|
|
1603
2941
|
private _additionalHeaders;
|
|
1604
2942
|
private apiKey;
|
|
2943
|
+
private contextSignatureManager?;
|
|
1605
2944
|
private _apiUrl;
|
|
1606
2945
|
private conn;
|
|
1607
2946
|
private context;
|
|
@@ -1680,6 +3019,22 @@ export declare class Schematic {
|
|
|
1680
3019
|
* Only logs if debug mode is enabled
|
|
1681
3020
|
*/
|
|
1682
3021
|
debug(message: string, ...args: unknown[]): void;
|
|
3022
|
+
/**
|
|
3023
|
+
* Resolve the HMAC context-signature value for a context, if a signature
|
|
3024
|
+
* provider is configured. Returns undefined when no provider is set, when
|
|
3025
|
+
* offline, or when the signature could not be obtained.
|
|
3026
|
+
*/
|
|
3027
|
+
private contextSignature;
|
|
3028
|
+
/**
|
|
3029
|
+
* Build the `X-Schematic-Context-Sig` header for a context, or an empty
|
|
3030
|
+
* object when no signature is available. Spread into request headers.
|
|
3031
|
+
*
|
|
3032
|
+
* Returns synchronously (not a Promise) when no signature provider is
|
|
3033
|
+
* configured, so callers that dispatch on the same tick (e.g. fire-and-forget
|
|
3034
|
+
* event sends) keep their existing timing; only a configured provider, which
|
|
3035
|
+
* must fetch a signature, yields a Promise.
|
|
3036
|
+
*/
|
|
3037
|
+
private contextSignatureHeaders;
|
|
1683
3038
|
/**
|
|
1684
3039
|
* Create a persistent message handler for websocket flag updates
|
|
1685
3040
|
*/
|
|
@@ -1894,6 +3249,10 @@ declare class SchematicBillingClient implements BillingClient {
|
|
|
1894
3249
|
createSetupIntent(): Promise<SetupIntent>;
|
|
1895
3250
|
updatePaymentMethod(externalId: string): Promise<void>;
|
|
1896
3251
|
deletePaymentMethod(id: string): Promise<void>;
|
|
3252
|
+
fetchFeatureUsage(): Promise<FeatureUsage[]>;
|
|
3253
|
+
fetchCreditBalances(): Promise<CreditBalanceEntry[]>;
|
|
3254
|
+
fetchCreditUserUsage(params: CreditUserUsageRequest): Promise<CreditUserUsage>;
|
|
3255
|
+
fetchFeatureUserUsage(params: FeatureUserUsageRequest): Promise<FeatureUserUsage>;
|
|
1897
3256
|
}
|
|
1898
3257
|
|
|
1899
3258
|
/** Context for checking flags and sending events */
|
|
@@ -1974,6 +3333,9 @@ declare namespace SchematicJS {
|
|
|
1974
3333
|
BillingResourceParams_2 as BillingResourceParams,
|
|
1975
3334
|
BillingResources_2 as BillingResources,
|
|
1976
3335
|
BooleanListenerFn,
|
|
3336
|
+
CatalogCreditGrantResponseData,
|
|
3337
|
+
CatalogPriceResponseData,
|
|
3338
|
+
CatalogPriceTierResponseData,
|
|
1977
3339
|
CheckFlagResponseData,
|
|
1978
3340
|
CheckFlagReturn,
|
|
1979
3341
|
CheckFlagReturnFromJSON,
|
|
@@ -1983,15 +3345,27 @@ declare namespace SchematicJS {
|
|
|
1983
3345
|
CheckPlanReturnFromJSON,
|
|
1984
3346
|
CheckPlanReturnListenerFn,
|
|
1985
3347
|
CompanyCreditBalance,
|
|
3348
|
+
CompanyCreditBalanceResponseData,
|
|
3349
|
+
CompanyCreditCompositionResponseData,
|
|
3350
|
+
CompanyCreditGrantResponseData,
|
|
3351
|
+
CompanyCreditUserUsageResponseData,
|
|
3352
|
+
CompanyCreditUserUsageRowResponseData,
|
|
1986
3353
|
CompanyDiscountResponseData,
|
|
3354
|
+
CompanyFeatureUsageResponseData,
|
|
3355
|
+
CompanyFeatureUserUsageResponseData,
|
|
1987
3356
|
CompanyInvoiceResponseData,
|
|
1988
3357
|
CompanyPaymentMethodResponseData,
|
|
1989
3358
|
CompanyUpcomingInvoiceResponseData,
|
|
3359
|
+
CompanyUserUsageResponseData,
|
|
3360
|
+
ContextSignatureProvider,
|
|
1990
3361
|
CreditBalance,
|
|
3362
|
+
CreditBalanceEntry,
|
|
1991
3363
|
CreditBalanceListenerFn,
|
|
1992
3364
|
CreditBalances,
|
|
1993
3365
|
CreditBalancesFromJSON,
|
|
1994
3366
|
CreditBalancesListenerFn,
|
|
3367
|
+
CreditComposition,
|
|
3368
|
+
CreditGrant,
|
|
1995
3369
|
CreditSpendPolicies,
|
|
1996
3370
|
creditSpendPoliciesEqual,
|
|
1997
3371
|
CreditSpendPoliciesFromJSON,
|
|
@@ -2001,6 +3375,8 @@ declare namespace SchematicJS {
|
|
|
2001
3375
|
CreditSpendPolicyListenerFn,
|
|
2002
3376
|
CreditSpendPolicyScope,
|
|
2003
3377
|
CreditSpendWindow,
|
|
3378
|
+
CreditUserUsage,
|
|
3379
|
+
CreditUserUsageRow,
|
|
2004
3380
|
DEFAULT_INVOICE_QUERY,
|
|
2005
3381
|
Discount,
|
|
2006
3382
|
EmptyListenerFn,
|
|
@@ -2010,6 +3386,8 @@ declare namespace SchematicJS {
|
|
|
2010
3386
|
EventBodyIdentify,
|
|
2011
3387
|
EventBodyTrack,
|
|
2012
3388
|
EventType,
|
|
3389
|
+
FeatureUsage,
|
|
3390
|
+
FeatureUserUsage,
|
|
2013
3391
|
FlagCheckListenerFn,
|
|
2014
3392
|
FlagValueListenerFn,
|
|
2015
3393
|
Invoice,
|
|
@@ -2021,8 +3399,10 @@ declare namespace SchematicJS {
|
|
|
2021
3399
|
InvoicesResult,
|
|
2022
3400
|
InvoiceStatus,
|
|
2023
3401
|
Keys,
|
|
3402
|
+
MeteredPrice,
|
|
2024
3403
|
PaymentMethod,
|
|
2025
3404
|
PendingListenerFn,
|
|
3405
|
+
PerLicenseCreditGrant,
|
|
2026
3406
|
PlanListenerFn,
|
|
2027
3407
|
RequestOptions,
|
|
2028
3408
|
ResourceState,
|
|
@@ -2047,6 +3427,7 @@ declare namespace SchematicJS {
|
|
|
2047
3427
|
TrialStatus,
|
|
2048
3428
|
UpcomingInvoice,
|
|
2049
3429
|
UsagePeriod,
|
|
3430
|
+
UserUsage,
|
|
2050
3431
|
WarningTier
|
|
2051
3432
|
}
|
|
2052
3433
|
}
|
|
@@ -2061,6 +3442,16 @@ export declare type SchematicOptions = {
|
|
|
2061
3442
|
debug?: boolean;
|
|
2062
3443
|
/** Optionally provide a custom event URL */
|
|
2063
3444
|
eventUrl?: string;
|
|
3445
|
+
/** Optionally provide a function that returns an HMAC context signature
|
|
3446
|
+
* (`iat.exp.sig`) for a given context. Required only when the Schematic
|
|
3447
|
+
* environment has context-signature verification enabled. Because a
|
|
3448
|
+
* publishable key is public, the signature must be produced by your backend
|
|
3449
|
+
* (which holds the matching secret API key); this function typically forwards
|
|
3450
|
+
* the context to that backend and returns the value it computes. The SDK
|
|
3451
|
+
* caches the signature per context, derives its expiry from the returned
|
|
3452
|
+
* string, and attaches it as the `X-Schematic-Context-Sig` header on flag
|
|
3453
|
+
* checks, the WebSocket bootstrap, and events. */
|
|
3454
|
+
getContextSignature?: ContextSignatureProvider;
|
|
2064
3455
|
/** Enable offline mode to prevent all network requests.
|
|
2065
3456
|
* When enabled, events are only logged not sent, and flag checks return fallback values.
|
|
2066
3457
|
* Can also be enabled at runtime via URL query parameter "schematic_offline=true" */
|
|
@@ -2342,6 +3733,32 @@ export declare enum UsagePeriod {
|
|
|
2342
3733
|
|
|
2343
3734
|
export declare function useBillingDataSource(): BillingDataSource;
|
|
2344
3735
|
|
|
3736
|
+
/**
|
|
3737
|
+
* The company's credit balances, one per credit. `data` is empty when it
|
|
3738
|
+
* holds no credits and its plan draws on none; `undefined` means not loaded.
|
|
3739
|
+
*/
|
|
3740
|
+
export declare function useCreditBalances(): ResourceHandle<CreditBalanceEntry[]>;
|
|
3741
|
+
|
|
3742
|
+
/**
|
|
3743
|
+
* One credit's consumption by user over the span of its live grants: the
|
|
3744
|
+
* heaviest users, how many there are in all, and consumption from events
|
|
3745
|
+
* sent without a user. Empty for a credit the company holds no live grant of.
|
|
3746
|
+
*/
|
|
3747
|
+
export declare function useCreditUserUsage(creditId: string): ResourceHandle<CreditUserUsage>;
|
|
3748
|
+
|
|
3749
|
+
/**
|
|
3750
|
+
* Every feature the company is entitled to, with its usage. `data` is empty
|
|
3751
|
+
* when it is entitled to nothing; `undefined` is what means not loaded yet.
|
|
3752
|
+
*/
|
|
3753
|
+
export declare function useFeatureUsage(): ResourceHandle<FeatureUsage[]>;
|
|
3754
|
+
|
|
3755
|
+
/**
|
|
3756
|
+
* One event-based feature's usage by user over its metric period: the
|
|
3757
|
+
* heaviest users, how many there are in all, and usage sent without a user.
|
|
3758
|
+
* A feature the company has no event-based entitlement to fails with a 404.
|
|
3759
|
+
*/
|
|
3760
|
+
export declare function useFeatureUserUsage(featureId: string): ResourceHandle<FeatureUserUsage>;
|
|
3761
|
+
|
|
2345
3762
|
/** Reloads every loaded billing resource (after a plan change, for instance). */
|
|
2346
3763
|
export declare function useInvalidateBillingData(): () => void;
|
|
2347
3764
|
|
|
@@ -2364,6 +3781,8 @@ export declare function useInvoices(query?: InvoiceQuery): InvoicesHandle;
|
|
|
2364
3781
|
*/
|
|
2365
3782
|
export declare function usePaymentMethods(): PaymentMethodsHandle;
|
|
2366
3783
|
|
|
3784
|
+
export declare type UserUsage = CompanyUserUsageResponseData;
|
|
3785
|
+
|
|
2367
3786
|
export declare const useSchematic: () => SchematicContextProps;
|
|
2368
3787
|
|
|
2369
3788
|
export declare const useSchematicContext: (opts?: SchematicHookOpts) => {
|