@shoppexio/storefront 1.0.95 → 1.0.97
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/CHANGELOG.md +8 -0
- package/dist/customer.cjs +8 -4
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +13 -1
- package/dist/customer.d.ts +13 -1
- package/dist/customer.js +8 -4
- package/dist/customer.js.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.97
|
|
4
|
+
|
|
5
|
+
- `Shop.stock_display` (`'low_stock' | 'exact'`): the merchant's Stock Display setting (Settings › Storefront › Catalog). `'exact'` asks for the unit count at every stock level, `'low_stock'` only while stock runs low. `hide_stock_counter` (shop or product) still hides every count. Optional: the field is absent until the API that sends it is deployed, and on partial shop records.
|
|
6
|
+
|
|
7
|
+
## 1.0.96
|
|
8
|
+
|
|
9
|
+
- `submitOrderReview(orderId, { anonymous })` (`@shoppexio/storefront/customer`): `false` posts the review under the buyer's public name; omitted or `true` posts it anonymously, as every review did before. `orderReview()` returns that name as `reviewer_name` (`null` for a guest or when the shop holds no name it may show, e.g. one that looks like an email or a link) and `anonymous`: the saved review's choice, or for a new review whether it starts anonymous. Offer the choice only when `reviewer_name` is a string: both fields are absent until the API that answers them is deployed.
|
|
10
|
+
|
|
3
11
|
## 1.0.95
|
|
4
12
|
|
|
5
13
|
- `Product.sku` and `ProductVariant.sku` / `PriceVariant.sku` carry the merchant's SKU (`null` when they set none). `getProduct` keeps each option's SKU on `product.variants`; before, the mapper dropped it (PR #3719).
|
package/dist/customer.cjs
CHANGED
|
@@ -20207,7 +20207,9 @@ var customerPortalOrderReviewSchema = external_exports.object({
|
|
|
20207
20207
|
score: external_exports.union([external_exports.literal(1), external_exports.literal(3), external_exports.literal(5)]).nullable(),
|
|
20208
20208
|
is_automated: external_exports.boolean(),
|
|
20209
20209
|
message: nullableStringSchema2,
|
|
20210
|
-
submitted_at: nullableStringSchema2
|
|
20210
|
+
submitted_at: nullableStringSchema2,
|
|
20211
|
+
reviewer_name: nullableStringSchema2,
|
|
20212
|
+
anonymous: external_exports.boolean()
|
|
20211
20213
|
});
|
|
20212
20214
|
var customerPortalWalletTopupQuoteSchema = external_exports.object({
|
|
20213
20215
|
quote: external_exports.object({
|
|
@@ -20531,6 +20533,7 @@ function storefrontStorageKey(key, scope = globalThis) {
|
|
|
20531
20533
|
// ../sdk/src/headless-customer.ts
|
|
20532
20534
|
var DEFAULT_API_ORIGIN = "https://api.shoppex.io";
|
|
20533
20535
|
var SESSION_STORAGE_PREFIX = "shoppex_headless_customer_session:";
|
|
20536
|
+
var orderReviewSchema = customerPortalOrderReviewSchema.partial({ reviewer_name: true, anonymous: true });
|
|
20534
20537
|
var HeadlessCustomerError = class extends Error {
|
|
20535
20538
|
constructor(status, message, code) {
|
|
20536
20539
|
super(message);
|
|
@@ -20878,7 +20881,7 @@ var HeadlessCustomerClient = class {
|
|
|
20878
20881
|
orderReview(orderId) {
|
|
20879
20882
|
return this.request(`/invoices/${encodeURIComponent(orderId)}/review`, {
|
|
20880
20883
|
authenticated: true,
|
|
20881
|
-
schema:
|
|
20884
|
+
schema: orderReviewSchema
|
|
20882
20885
|
});
|
|
20883
20886
|
}
|
|
20884
20887
|
submitOrderReview(orderId, input2) {
|
|
@@ -20887,9 +20890,10 @@ var HeadlessCustomerClient = class {
|
|
|
20887
20890
|
authenticated: true,
|
|
20888
20891
|
body: {
|
|
20889
20892
|
score: input2.score,
|
|
20890
|
-
message: input2.message
|
|
20893
|
+
message: input2.message,
|
|
20894
|
+
...input2.anonymous === void 0 ? {} : { anonymous: input2.anonymous }
|
|
20891
20895
|
},
|
|
20892
|
-
schema:
|
|
20896
|
+
schema: orderReviewSchema
|
|
20893
20897
|
});
|
|
20894
20898
|
}
|
|
20895
20899
|
invoicePdf(orderId) {
|