hookwright 1.12.0 → 1.12.2
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/cli.js +14 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ var init_package = __esm({
|
|
|
24
24
|
"package.json"() {
|
|
25
25
|
package_default = {
|
|
26
26
|
name: "hookwright",
|
|
27
|
-
version: "1.12.
|
|
27
|
+
version: "1.12.2",
|
|
28
28
|
description: "Build real, signed e-commerce webhooks from a live Shopify catalogue \u2014 interactive terminal UI, no backend",
|
|
29
29
|
keywords: [
|
|
30
30
|
"webhook",
|
|
@@ -381,6 +381,7 @@ function normalizeProduct(product) {
|
|
|
381
381
|
title: v.title,
|
|
382
382
|
sku: v.sku || "",
|
|
383
383
|
price: v.price != null ? Number(v.price) : null,
|
|
384
|
+
compareAtPrice: v.compare_at_price != null ? Number(v.compare_at_price) : null,
|
|
384
385
|
available: v.inventory_quantity == null ? true : v.inventory_quantity > 0,
|
|
385
386
|
imageId: v.image_id ? String(v.image_id) : null
|
|
386
387
|
}));
|
|
@@ -1175,7 +1176,6 @@ var CART_FIELDS = [
|
|
|
1175
1176
|
{ source: "line_items[].title", target: "product_details", required: true, note: "the first PAID line wins; freebies rank last" },
|
|
1176
1177
|
{ source: "line_items[].title", target: "product_name", note: 'the featured line alone, without the "and N more"' },
|
|
1177
1178
|
{ source: "line_items[].image", target: "product_image_url", note: "looked up from product_id when the line has none" },
|
|
1178
|
-
{ source: "\u2014 (store domain + handle)", target: "product_url", note: "resolved, not sent" },
|
|
1179
1179
|
{ source: "\u2014 (store domain + line ids)", target: "cart_link", note: "resolved, not sent" },
|
|
1180
1180
|
{ source: "\u2014 (company shopify integration)", target: "store_url", note: "resolved, not sent" },
|
|
1181
1181
|
{ source: "line_items[].price", target: "\u2014 (ranking only)", note: "a zero price marks the line a freebie" },
|
|
@@ -1578,7 +1578,7 @@ var COLLECTION_VIEWED_FIELDS = [
|
|
|
1578
1578
|
{ source: "payload.collection_viewed.handle", target: "payload.collection_viewed.handle", required: true, note: "the url is built from this" },
|
|
1579
1579
|
{ source: "payload.collection_viewed.image", target: "payload.collection_viewed.image" },
|
|
1580
1580
|
{ source: "payload.collection_viewed.collection_id", target: "payload.collection_viewed.collection_id" },
|
|
1581
|
-
{ source: "
|
|
1581
|
+
{ source: "store.shopify_domain / store.main_domain", target: "collection_url", note: "derived: {domain}/collections/{handle}" }
|
|
1582
1582
|
];
|
|
1583
1583
|
var PRODUCT_VIEWED_FIELDS = [
|
|
1584
1584
|
...ENVELOPE_FIELDS,
|
|
@@ -1586,7 +1586,7 @@ var PRODUCT_VIEWED_FIELDS = [
|
|
|
1586
1586
|
{ source: "payload.product_viewed.handle", target: "payload.product_viewed.handle", required: true, note: "the url is built from this" },
|
|
1587
1587
|
{ source: "payload.product_viewed.image", target: "payload.product_viewed.image" },
|
|
1588
1588
|
{ source: "payload.product_viewed.product_id", target: "payload.product_viewed.product_id" },
|
|
1589
|
-
{ source: "
|
|
1589
|
+
{ source: "store.shopify_domain / store.main_domain", target: "product_url", note: "derived: {domain}/products/{handle}" }
|
|
1590
1590
|
];
|
|
1591
1591
|
var FIELD_MAPS3 = {
|
|
1592
1592
|
ABANDONED_CHECKOUT: fieldMap5,
|
|
@@ -1649,7 +1649,7 @@ function buildPayload5(ctx) {
|
|
|
1649
1649
|
collection_id: Number(collection?.id) || 0,
|
|
1650
1650
|
name: collection?.title ?? "",
|
|
1651
1651
|
handle: collection?.handle ?? "",
|
|
1652
|
-
image: collection?.image
|
|
1652
|
+
image: collection?.image ?? "",
|
|
1653
1653
|
timestamp: now.toISOString()
|
|
1654
1654
|
}
|
|
1655
1655
|
}
|
|
@@ -3033,6 +3033,15 @@ async function runAll({ payload, body, provider, config, checkImageUrls = true,
|
|
|
3033
3033
|
ok: missing.length === 0,
|
|
3034
3034
|
detail: missing.length === 0 ? `all ${cov.length} mapped fields resolved` : `missing: ${missing.map((m) => m.field).join(", ")}`
|
|
3035
3035
|
});
|
|
3036
|
+
const empty = cov.filter((c2) => c2.status === "empty");
|
|
3037
|
+
if (empty.length) {
|
|
3038
|
+
checks.push({
|
|
3039
|
+
name: "Empty optional fields",
|
|
3040
|
+
ok: true,
|
|
3041
|
+
warn: true,
|
|
3042
|
+
detail: `${empty.map((e) => e.maps_to).join(", ")} \u2014 a journey param bound to one of these needs a fallback, or the send fails`
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3036
3045
|
return {
|
|
3037
3046
|
checks,
|
|
3038
3047
|
coverage: cov,
|