@webround/commerce 0.3.4 → 0.3.6
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/README.md +1 -1
- package/dist/catalog/types.d.ts +4 -13
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ running development API: a hook (it needs an `https` address and the key service
|
|
|
96
96
|
1. **The backend's answers are never altered.** Methods return exactly what the API says, `{ data }` envelope included (no unwrapping, no renaming, no "cleaning"). If a
|
|
97
97
|
field looks wrong, say so; do not fix it here. `wr-commerce-catalog` (the catalog API) is never modified from this repo's work.
|
|
98
98
|
2. **Types come from what the catalog really sends, not from its OpenAPI** (it is wrong in places). `smoke/` checks the types against a real store; when a real answer
|
|
99
|
-
does not match, the TYPE changes (`Format
|
|
99
|
+
does not match, the TYPE changes (`Format` and nullable `label`/`icon` were found that way).
|
|
100
100
|
3. **No defaults for what the caller chooses.** `include*` options are sent only when given. This is a data layer, not a set of opinions.
|
|
101
101
|
4. **No framework, no environment, no storage in the core.** Anything that needs one comes in as an argument (`fetch`, `getHeaders`, later a storage adapter).
|
|
102
102
|
5. **Errors are `CommerceError`** (`kind`: http, network, timeout, aborted, parse; the server's `code` for the interface to translate; never headers, body or query).
|
package/dist/catalog/types.d.ts
CHANGED
|
@@ -257,17 +257,6 @@ export interface OptionDetail {
|
|
|
257
257
|
position: number;
|
|
258
258
|
values: OptionValueDetail[];
|
|
259
259
|
}
|
|
260
|
-
/**
|
|
261
|
-
* A discount by quantity: from `min` to `max` (`null`: with no end) of a variant bought, the price has `discountValue` (a percentage, for `discountType: "percentage"`) off. The catalog declares
|
|
262
|
-
* `quantityTable` as `any`; this shape is the one seen on a real catalog (`rounding` was `"00"` and `"99"`) and the one the v1 template uses. Only `percentage` has been seen as a `discountType`.
|
|
263
|
-
*/
|
|
264
|
-
export interface QuantityTier {
|
|
265
|
-
min: number;
|
|
266
|
-
max: number | null;
|
|
267
|
-
rounding: string;
|
|
268
|
-
discountType: string;
|
|
269
|
-
discountValue: number;
|
|
270
|
-
}
|
|
271
260
|
/** A price of a variant: the list price (`amount` is the net one) and what it is gross, with the tax rate of the visitor's country. */
|
|
272
261
|
export interface PriceDetail {
|
|
273
262
|
id: string;
|
|
@@ -276,8 +265,6 @@ export interface PriceDetail {
|
|
|
276
265
|
amount: number;
|
|
277
266
|
comparePrice: number;
|
|
278
267
|
isDefault?: boolean;
|
|
279
|
-
/** `null` when the price has no discounts by quantity (seen on a real catalog). */
|
|
280
|
-
quantityTable?: QuantityTier[] | null;
|
|
281
268
|
netAmount: number;
|
|
282
269
|
grossAmount: number;
|
|
283
270
|
rate: number;
|
|
@@ -344,6 +331,10 @@ export interface StoreSettings {
|
|
|
344
331
|
cadences: string[];
|
|
345
332
|
/** The link to Stripe's customer portal, to manage a subscription: an empty text when the store has none. */
|
|
346
333
|
stripeCustomerPortalUrl: string;
|
|
334
|
+
/** `false` when the store has turned reviews off: the site shows none, in the product's page and in the account. Absent from a catalog that does not say it: on. */
|
|
335
|
+
reviewsEnabled?: boolean;
|
|
336
|
+
/** `false` when the store has turned the wishlist off: the site shows none, on the product's card and page and in the account. Absent from a catalog that does not say it: on. */
|
|
337
|
+
wishlistEnabled?: boolean;
|
|
347
338
|
}
|
|
348
339
|
export interface StoreTagValue {
|
|
349
340
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export * from './wishlist/index.js';
|
|
|
28
28
|
export * from './shop/index.js';
|
|
29
29
|
export type { ProductsApi } from './catalog/products.js';
|
|
30
30
|
export type { StoreDataApi } from './catalog/store-data.js';
|
|
31
|
-
export type { AssetDetail, AssetSummary, AssetType, AttributeDetail, AttributeSummary, Availability, CallOptions, Format, OptionDetail, OptionValueDetail, Pagination, PriceDetail, PriceRange, ProductByIdInput, ProductBySlugInput, ProductDetail, ProductDetailInput, ProductDetailResponse, ProductLoad, ProductPage, ProductRelatedInput, ProductReviewsInput, ProductSearch, ProductSortField, ProductSummary,
|
|
31
|
+
export type { AssetDetail, AssetSummary, AssetType, AttributeDetail, AttributeSummary, Availability, CallOptions, Format, OptionDetail, OptionValueDetail, Pagination, PriceDetail, PriceRange, ProductByIdInput, ProductBySlugInput, ProductDetail, ProductDetailInput, ProductDetailResponse, ProductLoad, ProductPage, ProductRelatedInput, ProductReviewsInput, ProductSearch, ProductSortField, ProductSummary, Review, ReviewPage, ReviewStats, SortDirection, StoreAttribute, StoreCollection, StoreData, StoreDataResponse, StoreFilter, StoreFilterCondition, StoreSettings, StoreTag, StoreTagValue, TagDetail, TagSummary, TagType, TagValueDetail, TagValueSummary, ValueFormat, VariantDetail, VariantSummary, } from './catalog/types.js';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|