@schematichq/schematic-react 1.15.0 → 1.16.1
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 +385 -15
- package/dist/schematic-react.d.ts +308 -9
- package/dist/schematic-react.esm.js +385 -15
- package/package.json +3 -3
|
@@ -222,6 +222,12 @@ declare namespace billingApi {
|
|
|
222
222
|
CatalogPlanRefResponseDataToJSON,
|
|
223
223
|
CatalogPlanRefResponseDataToJSONTyped,
|
|
224
224
|
CatalogPlanRefResponseData,
|
|
225
|
+
instanceOfCatalogPlanResponseData,
|
|
226
|
+
CatalogPlanResponseDataFromJSON,
|
|
227
|
+
CatalogPlanResponseDataFromJSONTyped,
|
|
228
|
+
CatalogPlanResponseDataToJSON,
|
|
229
|
+
CatalogPlanResponseDataToJSONTyped,
|
|
230
|
+
CatalogPlanResponseData,
|
|
225
231
|
instanceOfCatalogPriceResponseData,
|
|
226
232
|
CatalogPriceResponseDataFromJSON,
|
|
227
233
|
CatalogPriceResponseDataFromJSONTyped,
|
|
@@ -660,6 +666,18 @@ declare namespace billingApi {
|
|
|
660
666
|
GetCompanyUpcomingInvoiceResponseToJSON,
|
|
661
667
|
GetCompanyUpcomingInvoiceResponseToJSONTyped,
|
|
662
668
|
GetCompanyUpcomingInvoiceResponse,
|
|
669
|
+
instanceOfGetPublicCatalogByIDResponse,
|
|
670
|
+
GetPublicCatalogByIDResponseFromJSON,
|
|
671
|
+
GetPublicCatalogByIDResponseFromJSONTyped,
|
|
672
|
+
GetPublicCatalogByIDResponseToJSON,
|
|
673
|
+
GetPublicCatalogByIDResponseToJSONTyped,
|
|
674
|
+
GetPublicCatalogByIDResponse,
|
|
675
|
+
instanceOfGetPublicCatalogResponse,
|
|
676
|
+
GetPublicCatalogResponseFromJSON,
|
|
677
|
+
GetPublicCatalogResponseFromJSONTyped,
|
|
678
|
+
GetPublicCatalogResponseToJSON,
|
|
679
|
+
GetPublicCatalogResponseToJSONTyped,
|
|
680
|
+
GetPublicCatalogResponse,
|
|
663
681
|
instanceOfInvoiceStatus,
|
|
664
682
|
InvoiceStatusFromJSON,
|
|
665
683
|
InvoiceStatusFromJSONTyped,
|
|
@@ -720,6 +738,12 @@ declare namespace billingApi {
|
|
|
720
738
|
ProrationLineKindToJSON,
|
|
721
739
|
ProrationLineKindToJSONTyped,
|
|
722
740
|
ProrationLineKind,
|
|
741
|
+
instanceOfPublicCatalogResponseData,
|
|
742
|
+
PublicCatalogResponseDataFromJSON,
|
|
743
|
+
PublicCatalogResponseDataFromJSONTyped,
|
|
744
|
+
PublicCatalogResponseDataToJSON,
|
|
745
|
+
PublicCatalogResponseDataToJSONTyped,
|
|
746
|
+
PublicCatalogResponseData,
|
|
723
747
|
instanceOfScheduledDowngradeConfigBehavior,
|
|
724
748
|
ScheduledDowngradeConfigBehaviorFromJSON,
|
|
725
749
|
ScheduledDowngradeConfigBehaviorFromJSONTyped,
|
|
@@ -822,6 +846,13 @@ declare namespace billingApi {
|
|
|
822
846
|
declare interface BillingClient {
|
|
823
847
|
/** The environment's catalog, or the one `catalogId` names. */
|
|
824
848
|
fetchCatalog(query?: CatalogQuery): Promise<Catalog>;
|
|
849
|
+
/**
|
|
850
|
+
* The same catalog with no company's standing in it, read with the
|
|
851
|
+
* publishable key whether or not a session is active.
|
|
852
|
+
*/
|
|
853
|
+
fetchPublicCatalog(query?: CatalogQuery): Promise<PublicCatalog>;
|
|
854
|
+
/** Whether `fetchPublicCatalog` has a key to read with. */
|
|
855
|
+
readonly hasPublishableKey: boolean;
|
|
825
856
|
/** Opens a checkout, priced when the cart is priceable. */
|
|
826
857
|
createCheckout(selections: CheckoutSelections): Promise<CheckoutWrite>;
|
|
827
858
|
getCheckout(id: string): Promise<Checkout>;
|
|
@@ -1020,6 +1051,11 @@ export declare interface BillingDataSource {
|
|
|
1020
1051
|
* on a source whose session never changes.
|
|
1021
1052
|
*/
|
|
1022
1053
|
onSessionChange?: (listener: (event: SessionEvent) => void) => () => void;
|
|
1054
|
+
/**
|
|
1055
|
+
* Which catalog a reader sees now; it changes only with the session, so
|
|
1056
|
+
* `onSessionChange` says when to ask again. Absent, the company's view.
|
|
1057
|
+
*/
|
|
1058
|
+
catalogSource?: () => CatalogSource;
|
|
1023
1059
|
}
|
|
1024
1060
|
|
|
1025
1061
|
/** Per-resource status overrides, for fixtures that simulate loading and failure. */
|
|
@@ -1055,7 +1091,10 @@ declare interface BillingPrefetchOptions {
|
|
|
1055
1091
|
names: BillingResourceName_2[];
|
|
1056
1092
|
/** The invoice query to prefetch for; the element must ask the same one. */
|
|
1057
1093
|
invoices?: InvoiceQuery;
|
|
1058
|
-
/**
|
|
1094
|
+
/**
|
|
1095
|
+
* The catalog to prefetch, as `catalog` or `publicCatalog`; the element
|
|
1096
|
+
* must ask the same one.
|
|
1097
|
+
*/
|
|
1059
1098
|
catalog?: CatalogQuery;
|
|
1060
1099
|
}
|
|
1061
1100
|
|
|
@@ -1097,7 +1136,7 @@ export declare function BillingProvider({ billingClient, children, initialData,
|
|
|
1097
1136
|
* much. Named apart from schematic-js's `BillingClient`, which is the whole
|
|
1098
1137
|
* interface; this is the part the hooks here call.
|
|
1099
1138
|
*/
|
|
1100
|
-
export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchCatalog" | "createCheckout" | "getCheckout" | "updateCheckout" | "finalizeCheckout" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod" | "fetchFeatureUsage" | "fetchFeatureUserUsage" | "fetchCreditBalances" | "fetchCreditUserUsage" | "fetchCompany" | "cancelSubscription" | "fetchTaxIds" | "updateTaxId"
|
|
1139
|
+
export declare type BillingProviderClient = Pick<BillingClient, "sessionStatus" | "sessionKey" | "setSession" | "onSessionChange" | "fetchCatalog" | "createCheckout" | "getCheckout" | "updateCheckout" | "finalizeCheckout" | "fetchInvoices" | "fetchUpcomingInvoice" | "fetchPaymentMethods" | "createSetupIntent" | "updatePaymentMethod" | "deletePaymentMethod" | "fetchFeatureUsage" | "fetchFeatureUserUsage" | "fetchCreditBalances" | "fetchCreditUserUsage" | "fetchCompany" | "cancelSubscription" | "fetchTaxIds" | "updateTaxId"> & Partial<Pick<BillingClient, "fetchPublicCatalog" | "hasPublishableKey">>;
|
|
1101
1140
|
|
|
1102
1141
|
declare interface BillingProviderDataProps {
|
|
1103
1142
|
/**
|
|
@@ -1150,7 +1189,7 @@ declare const BillingProviderType: {
|
|
|
1150
1189
|
declare type BillingProviderType = (typeof BillingProviderType)[keyof typeof BillingProviderType];
|
|
1151
1190
|
|
|
1152
1191
|
/** The resources this package serves; a key of schematic-js's contract. */
|
|
1153
|
-
export declare type BillingResourceName = "catalog" | "invoices" | "upcomingInvoice" | "paymentMethods" | "featureUsage" | "creditBalances" | "company" | "taxIds";
|
|
1192
|
+
export declare type BillingResourceName = "catalog" | "publicCatalog" | "invoices" | "upcomingInvoice" | "paymentMethods" | "featureUsage" | "creditBalances" | "company" | "taxIds";
|
|
1154
1193
|
|
|
1155
1194
|
declare type BillingResourceName_2 = keyof BillingResources_2;
|
|
1156
1195
|
|
|
@@ -1159,6 +1198,7 @@ export declare type BillingResourceParams = Pick<BillingResourceParams_2, Billin
|
|
|
1159
1198
|
/** `Record<string, never>` marks a singleton; anything else is keyed. */
|
|
1160
1199
|
declare interface BillingResourceParams_2 {
|
|
1161
1200
|
catalog: CatalogQuery;
|
|
1201
|
+
publicCatalog: CatalogQuery;
|
|
1162
1202
|
invoices: InvoiceQuery;
|
|
1163
1203
|
upcomingInvoice: Record<string, never>;
|
|
1164
1204
|
paymentMethods: Record<string, never>;
|
|
@@ -1183,6 +1223,12 @@ declare interface BillingResources_2 {
|
|
|
1183
1223
|
* `catalogId`: the catalog as the company sees it.
|
|
1184
1224
|
*/
|
|
1185
1225
|
catalog: Catalog;
|
|
1226
|
+
/**
|
|
1227
|
+
* `GET /public/catalog`, or `GET /public/catalogs/{catalog_id}`: the
|
|
1228
|
+
* catalog read with the publishable key. It belongs to no session, so a
|
|
1229
|
+
* session starting, changing or ending leaves it loaded.
|
|
1230
|
+
*/
|
|
1231
|
+
publicCatalog: PublicCatalog;
|
|
1186
1232
|
/** `GET /company/invoices?limit&offset&include_pending`. */
|
|
1187
1233
|
invoices: InvoicePage;
|
|
1188
1234
|
/**
|
|
@@ -1829,6 +1875,12 @@ declare interface CatalogCreditGrantResponseData {
|
|
|
1829
1875
|
* @memberof CatalogCreditGrantResponseData
|
|
1830
1876
|
*/
|
|
1831
1877
|
scaling: PlanCreditGrantScaling;
|
|
1878
|
+
/**
|
|
1879
|
+
* Whether the catalog shows this credit on the plan. Display-only: a hidden grant is still granted and priced at checkout.
|
|
1880
|
+
* @type {boolean}
|
|
1881
|
+
* @memberof CatalogCreditGrantResponseData
|
|
1882
|
+
*/
|
|
1883
|
+
visible: boolean;
|
|
1832
1884
|
}
|
|
1833
1885
|
|
|
1834
1886
|
/**
|
|
@@ -2117,6 +2169,116 @@ declare interface CatalogPlanRefResponseData {
|
|
|
2117
2169
|
name: string;
|
|
2118
2170
|
}
|
|
2119
2171
|
|
|
2172
|
+
/**
|
|
2173
|
+
*
|
|
2174
|
+
* @export
|
|
2175
|
+
* @interface CatalogPlanResponseData
|
|
2176
|
+
*/
|
|
2177
|
+
declare interface CatalogPlanResponseData {
|
|
2178
|
+
/**
|
|
2179
|
+
*
|
|
2180
|
+
* @type {Array<PlanPriceCadence>}
|
|
2181
|
+
* @memberof CatalogPlanResponseData
|
|
2182
|
+
*/
|
|
2183
|
+
availablePeriods: Array<PlanPriceCadence>;
|
|
2184
|
+
/**
|
|
2185
|
+
*
|
|
2186
|
+
* @type {BillingStrategy}
|
|
2187
|
+
* @memberof CatalogPlanResponseData
|
|
2188
|
+
*/
|
|
2189
|
+
billingStrategy: BillingStrategy;
|
|
2190
|
+
/**
|
|
2191
|
+
*
|
|
2192
|
+
* @type {ChargeType}
|
|
2193
|
+
* @memberof CatalogPlanResponseData
|
|
2194
|
+
*/
|
|
2195
|
+
chargeType: ChargeType;
|
|
2196
|
+
/**
|
|
2197
|
+
* For add-ons, the plans this add-on may be purchased with. Null means compatible with every plan.
|
|
2198
|
+
* @type {Array<string>}
|
|
2199
|
+
* @memberof CatalogPlanResponseData
|
|
2200
|
+
*/
|
|
2201
|
+
compatiblePlanIds?: Array<string> | null;
|
|
2202
|
+
/**
|
|
2203
|
+
*
|
|
2204
|
+
* @type {Array<CatalogCurrencyPricesResponseData>}
|
|
2205
|
+
* @memberof CatalogPlanResponseData
|
|
2206
|
+
*/
|
|
2207
|
+
currencyPrices: Array<CatalogCurrencyPricesResponseData>;
|
|
2208
|
+
/**
|
|
2209
|
+
*
|
|
2210
|
+
* @type {string}
|
|
2211
|
+
* @memberof CatalogPlanResponseData
|
|
2212
|
+
*/
|
|
2213
|
+
description: string;
|
|
2214
|
+
/**
|
|
2215
|
+
*
|
|
2216
|
+
* @type {Array<CatalogPlanEntitlementResponseData>}
|
|
2217
|
+
* @memberof CatalogPlanResponseData
|
|
2218
|
+
*/
|
|
2219
|
+
entitlements: Array<CatalogPlanEntitlementResponseData>;
|
|
2220
|
+
/**
|
|
2221
|
+
*
|
|
2222
|
+
* @type {string}
|
|
2223
|
+
* @memberof CatalogPlanResponseData
|
|
2224
|
+
*/
|
|
2225
|
+
icon: string;
|
|
2226
|
+
/**
|
|
2227
|
+
*
|
|
2228
|
+
* @type {string}
|
|
2229
|
+
* @memberof CatalogPlanResponseData
|
|
2230
|
+
*/
|
|
2231
|
+
id: string;
|
|
2232
|
+
/**
|
|
2233
|
+
*
|
|
2234
|
+
* @type {Array<CatalogCreditGrantResponseData>}
|
|
2235
|
+
* @memberof CatalogPlanResponseData
|
|
2236
|
+
*/
|
|
2237
|
+
includedCreditGrants: Array<CatalogCreditGrantResponseData>;
|
|
2238
|
+
/**
|
|
2239
|
+
*
|
|
2240
|
+
* @type {boolean}
|
|
2241
|
+
* @memberof CatalogPlanResponseData
|
|
2242
|
+
*/
|
|
2243
|
+
isTrialable: boolean;
|
|
2244
|
+
/**
|
|
2245
|
+
*
|
|
2246
|
+
* @type {CatalogPriceResponseData}
|
|
2247
|
+
* @memberof CatalogPlanResponseData
|
|
2248
|
+
*/
|
|
2249
|
+
monthlyPrice?: CatalogPriceResponseData;
|
|
2250
|
+
/**
|
|
2251
|
+
*
|
|
2252
|
+
* @type {string}
|
|
2253
|
+
* @memberof CatalogPlanResponseData
|
|
2254
|
+
*/
|
|
2255
|
+
name: string;
|
|
2256
|
+
/**
|
|
2257
|
+
*
|
|
2258
|
+
* @type {CatalogPriceResponseData}
|
|
2259
|
+
* @memberof CatalogPlanResponseData
|
|
2260
|
+
*/
|
|
2261
|
+
oneTimePrice?: CatalogPriceResponseData;
|
|
2262
|
+
/**
|
|
2263
|
+
*
|
|
2264
|
+
* @type {CatalogPriceResponseData}
|
|
2265
|
+
* @memberof CatalogPlanResponseData
|
|
2266
|
+
*/
|
|
2267
|
+
quarterlyPrice?: CatalogPriceResponseData;
|
|
2268
|
+
/**
|
|
2269
|
+
*
|
|
2270
|
+
* @type {number}
|
|
2271
|
+
* @memberof CatalogPlanResponseData
|
|
2272
|
+
*/
|
|
2273
|
+
trialDays?: number | null;
|
|
2274
|
+
/**
|
|
2275
|
+
*
|
|
2276
|
+
* @type {CatalogPriceResponseData}
|
|
2277
|
+
* @memberof CatalogPlanResponseData
|
|
2278
|
+
*/
|
|
2279
|
+
yearlyPrice?: CatalogPriceResponseData;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2120
2282
|
/**
|
|
2121
2283
|
*
|
|
2122
2284
|
* @export
|
|
@@ -2245,6 +2407,9 @@ export declare interface CatalogQuery {
|
|
|
2245
2407
|
catalogId?: string;
|
|
2246
2408
|
}
|
|
2247
2409
|
|
|
2410
|
+
/** Which catalog `useCatalog` reads: `catalog` or `publicCatalog`. */
|
|
2411
|
+
export declare type CatalogSource = CatalogView["source"];
|
|
2412
|
+
|
|
2248
2413
|
/**
|
|
2249
2414
|
* Schematic API
|
|
2250
2415
|
* Schematic API
|
|
@@ -2288,6 +2453,19 @@ declare interface CatalogUsageViolationResponseData {
|
|
|
2288
2453
|
usage: number;
|
|
2289
2454
|
}
|
|
2290
2455
|
|
|
2456
|
+
/**
|
|
2457
|
+
* A catalog as whoever is reading it sees it. Tagged rather than merged: a
|
|
2458
|
+
* public plan is not one the company has no standing against, and filling
|
|
2459
|
+
* `valid` in for it would say something the server did not.
|
|
2460
|
+
*/
|
|
2461
|
+
export declare type CatalogView = {
|
|
2462
|
+
source: "company";
|
|
2463
|
+
catalog: Catalog;
|
|
2464
|
+
} | {
|
|
2465
|
+
source: "public";
|
|
2466
|
+
catalog: PublicCatalog;
|
|
2467
|
+
};
|
|
2468
|
+
|
|
2291
2469
|
/**
|
|
2292
2470
|
*
|
|
2293
2471
|
* @export
|
|
@@ -2585,6 +2763,8 @@ export declare class CheckoutDraft {
|
|
|
2585
2763
|
/** Bumped by reset, so an answer for a discarded draft lands nowhere. */
|
|
2586
2764
|
private generation;
|
|
2587
2765
|
private inFlight;
|
|
2766
|
+
/** The read of a resumed checkout, while one is out. */
|
|
2767
|
+
private loading;
|
|
2588
2768
|
private queued;
|
|
2589
2769
|
constructor(transport: CheckoutTransport, options?: CheckoutDraftOptions);
|
|
2590
2770
|
/**
|
|
@@ -2596,7 +2776,8 @@ export declare class CheckoutDraft {
|
|
|
2596
2776
|
subscribe(listener: () => void): () => void;
|
|
2597
2777
|
/**
|
|
2598
2778
|
* Reads the checkout this draft was opened on, for a resume. A draft with
|
|
2599
|
-
* no checkout yet has nothing to read.
|
|
2779
|
+
* no checkout yet has nothing to read. A call while a read is out shares
|
|
2780
|
+
* its answer.
|
|
2600
2781
|
*/
|
|
2601
2782
|
load(): Promise<Checkout | undefined>;
|
|
2602
2783
|
/**
|
|
@@ -2624,13 +2805,22 @@ export declare class CheckoutDraft {
|
|
|
2624
2805
|
*/
|
|
2625
2806
|
private updateWithReplay;
|
|
2626
2807
|
private finalizeOnce;
|
|
2808
|
+
/**
|
|
2809
|
+
* A resumed checkout is read before it is written or finalized: a write
|
|
2810
|
+
* ahead of the read would open a second checkout beside it, and the read's
|
|
2811
|
+
* answer would then point the draft back at the first.
|
|
2812
|
+
*/
|
|
2813
|
+
private readResumed;
|
|
2627
2814
|
private refresh;
|
|
2628
2815
|
private adopt;
|
|
2629
2816
|
private update;
|
|
2630
2817
|
}
|
|
2631
2818
|
|
|
2632
2819
|
declare interface CheckoutDraftOptions {
|
|
2633
|
-
/**
|
|
2820
|
+
/**
|
|
2821
|
+
* Resume this checkout rather than opening one on the first write. The
|
|
2822
|
+
* draft reads it before the first write or finalize.
|
|
2823
|
+
*/
|
|
2634
2824
|
checkoutId?: string;
|
|
2635
2825
|
}
|
|
2636
2826
|
|
|
@@ -6033,6 +6223,89 @@ declare const ProrationLineKind: {
|
|
|
6033
6223
|
|
|
6034
6224
|
declare type ProrationLineKind = (typeof ProrationLineKind)[keyof typeof ProrationLineKind];
|
|
6035
6225
|
|
|
6226
|
+
/**
|
|
6227
|
+
* The catalog with no company to stand against it: no `current`, `valid` or
|
|
6228
|
+
* trial standing on its plans, and no checkout settings, since nobody is
|
|
6229
|
+
* signed in to check out.
|
|
6230
|
+
*/
|
|
6231
|
+
export declare type PublicCatalog = PublicCatalogResponseData;
|
|
6232
|
+
|
|
6233
|
+
export declare type PublicCatalogPlan = CatalogPlanResponseData;
|
|
6234
|
+
|
|
6235
|
+
/**
|
|
6236
|
+
*
|
|
6237
|
+
* @export
|
|
6238
|
+
* @interface PublicCatalogResponseData
|
|
6239
|
+
*/
|
|
6240
|
+
declare interface PublicCatalogResponseData {
|
|
6241
|
+
/**
|
|
6242
|
+
*
|
|
6243
|
+
* @type {Array<CatalogPlanResponseData>}
|
|
6244
|
+
* @memberof PublicCatalogResponseData
|
|
6245
|
+
*/
|
|
6246
|
+
addOns: Array<CatalogPlanResponseData>;
|
|
6247
|
+
/**
|
|
6248
|
+
*
|
|
6249
|
+
* @type {CatalogCapabilitiesResponseData}
|
|
6250
|
+
* @memberof PublicCatalogResponseData
|
|
6251
|
+
*/
|
|
6252
|
+
capabilities: CatalogCapabilitiesResponseData;
|
|
6253
|
+
/**
|
|
6254
|
+
*
|
|
6255
|
+
* @type {Array<CatalogCreditBundleResponseData>}
|
|
6256
|
+
* @memberof PublicCatalogResponseData
|
|
6257
|
+
*/
|
|
6258
|
+
creditBundles: Array<CatalogCreditBundleResponseData>;
|
|
6259
|
+
/**
|
|
6260
|
+
* Present when the catalog offers a custom plan; absent when custom plans are hidden.
|
|
6261
|
+
* @type {CatalogCustomPlanCTAResponseData}
|
|
6262
|
+
* @memberof PublicCatalogResponseData
|
|
6263
|
+
*/
|
|
6264
|
+
customPlanCta?: CatalogCustomPlanCTAResponseData;
|
|
6265
|
+
/**
|
|
6266
|
+
* ISO 4217 currency of every top-level price slot; currency_prices carries the others.
|
|
6267
|
+
* @type {Currency}
|
|
6268
|
+
* @memberof PublicCatalogResponseData
|
|
6269
|
+
*/
|
|
6270
|
+
defaultCurrency: Currency;
|
|
6271
|
+
/**
|
|
6272
|
+
*
|
|
6273
|
+
* @type {string}
|
|
6274
|
+
* @memberof PublicCatalogResponseData
|
|
6275
|
+
*/
|
|
6276
|
+
description?: string | null;
|
|
6277
|
+
/**
|
|
6278
|
+
*
|
|
6279
|
+
* @type {string}
|
|
6280
|
+
* @memberof PublicCatalogResponseData
|
|
6281
|
+
*/
|
|
6282
|
+
id: string;
|
|
6283
|
+
/**
|
|
6284
|
+
*
|
|
6285
|
+
* @type {string}
|
|
6286
|
+
* @memberof PublicCatalogResponseData
|
|
6287
|
+
*/
|
|
6288
|
+
name: string;
|
|
6289
|
+
/**
|
|
6290
|
+
*
|
|
6291
|
+
* @type {Array<CatalogPlanResponseData>}
|
|
6292
|
+
* @memberof PublicCatalogResponseData
|
|
6293
|
+
*/
|
|
6294
|
+
plans: Array<CatalogPlanResponseData>;
|
|
6295
|
+
/**
|
|
6296
|
+
*
|
|
6297
|
+
* @type {string}
|
|
6298
|
+
* @memberof PublicCatalogResponseData
|
|
6299
|
+
*/
|
|
6300
|
+
pricingModel?: string | null;
|
|
6301
|
+
/**
|
|
6302
|
+
*
|
|
6303
|
+
* @type {string}
|
|
6304
|
+
* @memberof PublicCatalogResponseData
|
|
6305
|
+
*/
|
|
6306
|
+
pricingUrl?: string | null;
|
|
6307
|
+
}
|
|
6308
|
+
|
|
6036
6309
|
declare interface RequestOptions {
|
|
6037
6310
|
method?: string;
|
|
6038
6311
|
body?: unknown;
|
|
@@ -6163,6 +6436,8 @@ export declare class Schematic {
|
|
|
6163
6436
|
constructor(apiKey: string, options?: SchematicOptions);
|
|
6164
6437
|
get apiUrl(): string;
|
|
6165
6438
|
get additionalHeaders(): Record<string, string>;
|
|
6439
|
+
/** The key flags are read with, for a billing client reading beside it. */
|
|
6440
|
+
get publishableKey(): string;
|
|
6166
6441
|
/**
|
|
6167
6442
|
* Resolve fallback value according to priority order:
|
|
6168
6443
|
* 1. Callsite fallback value (if provided)
|
|
@@ -6414,9 +6689,11 @@ declare class SchematicBillingClient implements BillingClient {
|
|
|
6414
6689
|
constructor(options?: BillingClientOptions | SchematicSession);
|
|
6415
6690
|
get sessionKey(): string | undefined;
|
|
6416
6691
|
get sessionStatus(): SessionStatus;
|
|
6692
|
+
get hasPublishableKey(): boolean;
|
|
6417
6693
|
setSession(session: SessionInput): void;
|
|
6418
6694
|
onSessionChange(listener: (event: SessionEvent) => void): () => void;
|
|
6419
6695
|
fetchCatalog(query?: CatalogQuery): Promise<Catalog>;
|
|
6696
|
+
fetchPublicCatalog(query?: CatalogQuery): Promise<PublicCatalog>;
|
|
6420
6697
|
createCheckout(selections: CheckoutSelections): Promise<CheckoutWrite>;
|
|
6421
6698
|
getCheckout(id: string): Promise<Checkout>;
|
|
6422
6699
|
updateCheckout(id: string, version: number, selections: CheckoutSelections): Promise<CheckoutWrite>;
|
|
@@ -6536,9 +6813,11 @@ declare namespace SchematicJS {
|
|
|
6536
6813
|
CatalogEntitlement,
|
|
6537
6814
|
CatalogPlan,
|
|
6538
6815
|
CatalogPlanEntitlementResponseData,
|
|
6816
|
+
CatalogPlanResponseData,
|
|
6539
6817
|
CatalogPriceResponseData,
|
|
6540
6818
|
CatalogPriceTierResponseData,
|
|
6541
6819
|
CatalogQuery,
|
|
6820
|
+
CatalogView,
|
|
6542
6821
|
CheckFlagResponseData,
|
|
6543
6822
|
CheckFlagReturn,
|
|
6544
6823
|
CheckFlagReturnFromJSON,
|
|
@@ -6639,6 +6918,9 @@ declare namespace SchematicJS {
|
|
|
6639
6918
|
PendingListenerFn,
|
|
6640
6919
|
PerLicenseCreditGrant,
|
|
6641
6920
|
PlanListenerFn,
|
|
6921
|
+
PublicCatalog,
|
|
6922
|
+
PublicCatalogPlan,
|
|
6923
|
+
PublicCatalogResponseData,
|
|
6642
6924
|
RequestOptions,
|
|
6643
6925
|
ResourceState,
|
|
6644
6926
|
RuleType,
|
|
@@ -6761,6 +7043,7 @@ declare class SchematicSession {
|
|
|
6761
7043
|
private readonly _apiUrl;
|
|
6762
7044
|
private readonly _headers;
|
|
6763
7045
|
private readonly _fetch;
|
|
7046
|
+
private readonly _publishableKey;
|
|
6764
7047
|
private _session;
|
|
6765
7048
|
private readonly _tokens;
|
|
6766
7049
|
private readonly _resolving;
|
|
@@ -6773,6 +7056,7 @@ declare class SchematicSession {
|
|
|
6773
7056
|
private readonly _listeners;
|
|
6774
7057
|
constructor(options?: SessionOptions);
|
|
6775
7058
|
get key(): string | undefined;
|
|
7059
|
+
get hasPublishableKey(): boolean;
|
|
6776
7060
|
get status(): SessionStatus;
|
|
6777
7061
|
/** Only a statement that changes which pair is read counts as a change. */
|
|
6778
7062
|
set(session: SessionInput): void;
|
|
@@ -6793,6 +7077,13 @@ declare class SchematicSession {
|
|
|
6793
7077
|
* otherwise come back as the answer to a question asked for another pair.
|
|
6794
7078
|
*/
|
|
6795
7079
|
request(path: string, options?: RequestOptions): Promise<unknown>;
|
|
7080
|
+
/**
|
|
7081
|
+
* A read under the publishable key, whatever the session. Nothing is
|
|
7082
|
+
* refreshed or retried, since the key does not expire, and a session
|
|
7083
|
+
* changing mid-flight does not void the answer: it is the same for
|
|
7084
|
+
* everyone.
|
|
7085
|
+
*/
|
|
7086
|
+
requestPublic(path: string): Promise<unknown>;
|
|
6796
7087
|
/**
|
|
6797
7088
|
* `request`, with the headers the answer came back with — for a resource
|
|
6798
7089
|
* whose protocol rides beside the body, as a checkout's session does.
|
|
@@ -6851,6 +7142,11 @@ declare function sessionKey(session: Session): string;
|
|
|
6851
7142
|
|
|
6852
7143
|
declare interface SessionOptions {
|
|
6853
7144
|
session?: SessionInput;
|
|
7145
|
+
/**
|
|
7146
|
+
* For the reads that belong to no session: the public catalog, which a
|
|
7147
|
+
* page renders before anyone has signed in.
|
|
7148
|
+
*/
|
|
7149
|
+
publishableKey?: string;
|
|
6854
7150
|
apiUrl?: string;
|
|
6855
7151
|
additionalHeaders?: Record<string, string>;
|
|
6856
7152
|
/** Override for tests and non-browser runtimes. */
|
|
@@ -7214,11 +7510,14 @@ export declare enum UsagePeriod {
|
|
|
7214
7510
|
export declare function useBillingDataSource(): BillingDataSource;
|
|
7215
7511
|
|
|
7216
7512
|
/**
|
|
7217
|
-
* The catalog as
|
|
7218
|
-
* stands against each plan and add-on.
|
|
7219
|
-
*
|
|
7513
|
+
* The catalog as whoever is reading sees it. Signed in, the company's view:
|
|
7514
|
+
* what it can buy, and how it stands against each plan and add-on. Signed
|
|
7515
|
+
* out, or before the session resolves, the public catalog, read with the
|
|
7516
|
+
* publishable key; `data.source` says which, and a session starting swaps
|
|
7517
|
+
* one for the other. Without a `catalogId`, the catalog the environment
|
|
7518
|
+
* sells; an inline object literal is fine, the hook keys by value.
|
|
7220
7519
|
*/
|
|
7221
|
-
export declare function useCatalog(query?: CatalogQuery): ResourceHandle<
|
|
7520
|
+
export declare function useCatalog(query?: CatalogQuery): ResourceHandle<CatalogView>;
|
|
7222
7521
|
|
|
7223
7522
|
/**
|
|
7224
7523
|
* A persisted checkout: the first `setSelections` opens it, each later one
|