@webround/commerce 0.3.5 → 0.3.7

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 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`, nullable `label`/`icon`, `quantityTable | null` were found that way).
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).
@@ -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;
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, QuantityTier, 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';
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webround/commerce",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",