@porulle/adapter-shopify 0.62.0 → 0.64.0
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/index.js +7 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/index.ts +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porulle/adapter-shopify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@porulle/core": "0.
|
|
13
|
+
"@porulle/core": "0.64.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^24.5.2",
|
|
17
17
|
"eslint": "^9.39.1",
|
|
18
18
|
"typescript": "5.9.2",
|
|
19
19
|
"vitest": "^3.2.4",
|
|
20
|
-
"@porulle/
|
|
21
|
-
"@porulle/
|
|
20
|
+
"@porulle/eslint-config": "0.1.0",
|
|
21
|
+
"@porulle/typescript-config": "0.1.0"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -99,6 +99,8 @@ type ShopifyProduct = {
|
|
|
99
99
|
weight_unit?: string | null;
|
|
100
100
|
/** Read-only aggregate available across ALL the shop's locations (Shopify's ProductVariant). */
|
|
101
101
|
inventory_quantity?: number | null;
|
|
102
|
+
/** Shopify's inventory item: what `inventory_levels/update` webhooks name, never the variant id. */
|
|
103
|
+
inventory_item_id?: number | string | null;
|
|
102
104
|
}>;
|
|
103
105
|
};
|
|
104
106
|
|
|
@@ -429,7 +431,13 @@ export function shopifyConnector(options: ShopifyConnectorOptions = {}): Channel
|
|
|
429
431
|
...(variant.barcode ? { barcode: variant.barcode } : {}),
|
|
430
432
|
...(Object.keys(optionValues).length > 0 ? { optionValues } : {}),
|
|
431
433
|
...(prices ? { prices } : {}),
|
|
432
|
-
|
|
434
|
+
// The inventory item id lets a stock webhook, which names only the item, find this variant.
|
|
435
|
+
...(weightGrams !== undefined || (variant.inventory_item_id !== undefined && variant.inventory_item_id !== null)
|
|
436
|
+
? { metadata: {
|
|
437
|
+
...(weightGrams !== undefined ? { weightGrams } : {}),
|
|
438
|
+
...(variant.inventory_item_id !== undefined && variant.inventory_item_id !== null ? { inventoryItemId: String(variant.inventory_item_id) } : {}),
|
|
439
|
+
} }
|
|
440
|
+
: {}),
|
|
433
441
|
};
|
|
434
442
|
});
|
|
435
443
|
const category = product.product_type ? slugify(product.product_type) : "";
|