@porulle/adapter-woocommerce 0.74.4 → 0.74.5
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/catalog.d.ts +3 -0
- package/dist/catalog.js +3 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/catalog.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porulle/adapter-woocommerce",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"zod": "^4.1.11",
|
|
19
|
-
"@porulle/core": "0.74.
|
|
19
|
+
"@porulle/core": "0.74.5"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^24.5.2",
|
package/src/catalog.ts
CHANGED
|
@@ -38,6 +38,8 @@ export const wooProductSchema = z.object({
|
|
|
38
38
|
attributes: z.array(z.object({ name: z.string(), position: z.number().nullish(), variation: z.boolean().nullish(), options: z.array(z.string()).default([]) })).default([]),
|
|
39
39
|
tags: z.array(z.object({ slug: z.string().nullish() })).default([]),
|
|
40
40
|
categories: z.array(z.object({ slug: z.string().nullish() })).default([]),
|
|
41
|
+
/** Core since WooCommerce 9.6; absent on older stores. */
|
|
42
|
+
brands: z.array(z.object({ name: z.string() })).default([]),
|
|
41
43
|
variations: z.array(id).default([]),
|
|
42
44
|
manage_stock: z.boolean().nullish(),
|
|
43
45
|
stock_quantity: z.number().nullish(),
|
|
@@ -166,6 +168,7 @@ export function catalogItem(product: WooProduct, variations: WooVariation[], cur
|
|
|
166
168
|
...(options.length > 0 ? { options } : {}),
|
|
167
169
|
tags: product.tags.flatMap((tag) => (tag.slug ? [tag.slug] : [])),
|
|
168
170
|
categories: product.categories.flatMap((category) => (category.slug ? [category.slug] : [])),
|
|
171
|
+
...(product.brands[0] ? { brand: product.brands[0].name } : {}),
|
|
169
172
|
...(itemStatus ? { status: itemStatus } : {}),
|
|
170
173
|
...(product.permalink ? { storefrontUrl: product.permalink } : {}),
|
|
171
174
|
};
|