@reactionary/medusa 0.10.7 → 0.10.8
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.
|
@@ -17,6 +17,10 @@ class MedusaProductAssociationsCapability extends ProductAssociationsCapability
|
|
|
17
17
|
config;
|
|
18
18
|
medusa;
|
|
19
19
|
factory;
|
|
20
|
+
alwaysIncludedFields = [
|
|
21
|
+
"+metadata",
|
|
22
|
+
"+external_id"
|
|
23
|
+
];
|
|
20
24
|
constructor(config, cache, context, medusa, factory) {
|
|
21
25
|
super(cache, context);
|
|
22
26
|
this.config = config;
|
|
@@ -29,7 +33,7 @@ class MedusaProductAssociationsCapability extends ProductAssociationsCapability
|
|
|
29
33
|
external_id: productKey.key,
|
|
30
34
|
limit: 1,
|
|
31
35
|
offset: 0,
|
|
32
|
-
fields: "
|
|
36
|
+
fields: this.alwaysIncludedFields.join(",")
|
|
33
37
|
});
|
|
34
38
|
let product;
|
|
35
39
|
if (!productResponse.products || productResponse.products.length === 0)
|
|
@@ -39,6 +43,7 @@ class MedusaProductAssociationsCapability extends ProductAssociationsCapability
|
|
|
39
43
|
if (!product) {
|
|
40
44
|
return [];
|
|
41
45
|
}
|
|
46
|
+
console.log("Product metadata:", product.metadata);
|
|
42
47
|
const associationsMetadata = (product.metadata?.[attributeName] || "").split(";");
|
|
43
48
|
if (!associationsMetadata || associationsMetadata.length === 0 || associationsMetadata[0] === "") {
|
|
44
49
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/medusa",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@medusajs/js-sdk": "^2.13.3",
|
|
13
|
-
"@reactionary/core": "0.10.
|
|
13
|
+
"@reactionary/core": "0.10.8",
|
|
14
14
|
"debug": "^4.4.3",
|
|
15
15
|
"@medusajs/types": "^2.13.3",
|
|
16
16
|
"zod": "4.1.9"
|
|
@@ -7,6 +7,7 @@ export declare class MedusaProductAssociationsCapability<TFactory extends Produc
|
|
|
7
7
|
protected config: MedusaConfiguration;
|
|
8
8
|
protected medusa: MedusaAPI;
|
|
9
9
|
protected factory: ProductAssociationsFactoryWithOutput<TFactory>;
|
|
10
|
+
protected alwaysIncludedFields: string[];
|
|
10
11
|
constructor(config: MedusaConfiguration, cache: Cache, context: RequestContext, medusa: MedusaAPI, factory: ProductAssociationsFactoryWithOutput<TFactory>);
|
|
11
12
|
protected fetchAssociatedProductsFor(productKey: ProductIdentifier, maxNumberOfAssociations: number, attributeName: string): Promise<import("@medusajs/types").StoreProduct[]>;
|
|
12
13
|
getAccessories(query: ProductAssociationsGetAccessoriesQuery): Promise<Result<ProductAssociationsFactoryOutput<TFactory>[]>>;
|