@tallyui/connector-medusa 3.4.0 → 3.5.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 CHANGED
@@ -440,7 +440,8 @@ var medusaProductTraits = {
440
440
  const variant = doc.variants?.[0];
441
441
  return variant?.barcode || variant?.ean || variant?.upc || void 0;
442
442
  },
443
- getCategoryNames: (doc) => (doc.categories ?? []).map((cat) => cat.name).filter(Boolean)
443
+ getCategoryNames: (doc) => (doc.categories ?? []).map((cat) => cat.name).filter(Boolean),
444
+ getCategories: (doc) => (doc.categories ?? []).filter((cat) => cat.name).map((cat) => ({ id: cat.id != null ? String(cat.id) : cat.name, name: cat.name }))
444
445
  };
445
446
 
446
447
  // src/sync/products.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tallyui/connector-medusa",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "type": "module",
5
5
  "description": "MedusaJS v2 connector for Tally UI",
6
6
  "main": "./dist/index.js",
@@ -27,10 +27,10 @@
27
27
  "directory": "connectors/medusa"
28
28
  },
29
29
  "peerDependencies": {
30
- "@tallyui/core": "^3.4.0"
30
+ "@tallyui/core": "^3.5.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@tallyui/database": "3.4.0",
33
+ "@tallyui/database": "3.5.0",
34
34
  "rxdb": "17.5.0"
35
35
  },
36
36
  "scripts": {
@@ -222,4 +222,8 @@ export const medusaProductTraits: ProductTraits = {
222
222
 
223
223
  getCategoryNames: (doc) =>
224
224
  (doc.categories ?? []).map((cat: any) => cat.name).filter(Boolean),
225
+
226
+ getCategories: (doc) =>
227
+ (doc.categories ?? []).filter((cat: any) => cat.name)
228
+ .map((cat: any) => ({ id: cat.id != null ? String(cat.id) : cat.name, name: cat.name })),
225
229
  };