@haus-storefront-react/vendure-plugin-configs 1.0.4-next.8 → 1.0.4-next.9
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/CHANGELOG.md +16 -0
- package/package.json +7 -7
- package/products-by-sku.d.ts +2 -0
- package/products-by-sku.js +1 -0
- package/products-by-sku.mjs +54 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 1.0.4-next.8 (2026-03-13)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Switch out lodash for lodash-es
|
|
6
|
+
- **vendure:** add related products plugin and types
|
|
7
|
+
|
|
8
|
+
### 🧱 Updated Dependencies
|
|
9
|
+
|
|
10
|
+
- Updated store/components/quick-order to 1.0.0-next.2
|
|
11
|
+
- Updated store/strategies to 1.0.4-next.8
|
|
12
|
+
- Updated core to 1.0.4-next.8
|
|
13
|
+
- Updated common/utils to 1.0.4-next.8
|
|
14
|
+
- Updated shared/types to 1.0.4-next.8
|
|
15
|
+
- Updated providers to 1.0.4-next.8
|
|
16
|
+
|
|
1
17
|
## 1.0.4-next.7 (2026-03-11)
|
|
2
18
|
|
|
3
19
|
### 🚀 Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-storefront-react/vendure-plugin-configs",
|
|
3
|
-
"version": "1.0.4-next.
|
|
3
|
+
"version": "1.0.4-next.9",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@haus-storefront-react/common-utils": "1.0.4-next.
|
|
69
|
-
"@haus-storefront-react/core": "1.0.4-next.
|
|
70
|
-
"@haus-storefront-react/providers": "1.0.4-next.
|
|
71
|
-
"@haus-storefront-react/quick-order": "1.0.0-next.
|
|
72
|
-
"@haus-storefront-react/shared-types": "1.0.4-next.
|
|
73
|
-
"@haus-storefront-react/strategies": "1.0.4-next.
|
|
68
|
+
"@haus-storefront-react/common-utils": "1.0.4-next.9",
|
|
69
|
+
"@haus-storefront-react/core": "1.0.4-next.9",
|
|
70
|
+
"@haus-storefront-react/providers": "1.0.4-next.9",
|
|
71
|
+
"@haus-storefront-react/quick-order": "1.0.0-next.3",
|
|
72
|
+
"@haus-storefront-react/shared-types": "1.0.4-next.9",
|
|
73
|
+
"@haus-storefront-react/strategies": "1.0.4-next.9"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "restricted"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`products-by-sku`,queryUpdates:{}});e.setRequests({productVariantsBySkus:async t=>e.getSdk().createRequest({operation:`productVariantsBySkus`,variables:{skus:{type:`[String!]!`}},fields:[{variantIdsBySku:[`sku`,`variantId`],errorResults:[`message`,`errorCode`]}]},{skus:t},!1).then(e=>e.data).catch(e=>({message:e.message,errorCode:e.code||`unknown`}))});var t=e=>typeof e==`object`&&!!e&&`productVariantsBySkus`in e&&typeof e.productVariantsBySkus==`function`,n=e=>e&&`errorCode`in e;function r(){return{validate:async r=>{let i=e.getSdk();if(!t(i))throw Error(`quickOrderVariantSkuValidationStrategy requires VendureProductsBySkuPlugin to be enabled.`);let a=[...new Set(r.map(e=>e.identifier))],o=await i.productVariantsBySkus(a);if(n(o))return{items:[],invalidIdentifiers:a,errorResults:[{message:o.message,errorCode:o.errorCode}]};let s=o.variantIdsBySku.filter(e=>e.variantId==null).map(e=>e.sku);if(s.length>0)return{items:[],invalidIdentifiers:s,errorResults:o.errorResults.map(e=>({message:e.message,errorCode:e.errorCode}))};let c=new Map(o.variantIdsBySku.map(e=>[e.sku,e.variantId]));return{items:r.map(e=>({productVariantId:c.get(e.identifier)??e.identifier,quantity:e.quantity})),errorResults:[]}}}}exports.VendureProductsBySkuPlugin=e,exports.quickOrderVariantSkuValidationStrategy=r;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as e } from "./plugin-config-DywohMgp.mjs";
|
|
2
|
+
//#region src/lib/configs/vendure-products-by-sku-plugin.ts
|
|
3
|
+
var t = new e({
|
|
4
|
+
name: "products-by-sku",
|
|
5
|
+
queryUpdates: {}
|
|
6
|
+
});
|
|
7
|
+
t.setRequests({ productVariantsBySkus: async (e) => t.getSdk().createRequest({
|
|
8
|
+
operation: "productVariantsBySkus",
|
|
9
|
+
variables: { skus: { type: "[String!]!" } },
|
|
10
|
+
fields: [{
|
|
11
|
+
variantIdsBySku: ["sku", "variantId"],
|
|
12
|
+
errorResults: ["message", "errorCode"]
|
|
13
|
+
}]
|
|
14
|
+
}, { skus: e }, !1).then((e) => e.data).catch((e) => ({
|
|
15
|
+
message: e.message,
|
|
16
|
+
errorCode: e.code || "unknown"
|
|
17
|
+
})) });
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/lib/strategies/quick-order-variant-sku-validation-strategy.ts
|
|
20
|
+
var n = (e) => typeof e == "object" && !!e && "productVariantsBySkus" in e && typeof e.productVariantsBySkus == "function", r = (e) => e && "errorCode" in e;
|
|
21
|
+
function i() {
|
|
22
|
+
return { validate: async (e) => {
|
|
23
|
+
let i = t.getSdk();
|
|
24
|
+
if (!n(i)) throw Error("quickOrderVariantSkuValidationStrategy requires VendureProductsBySkuPlugin to be enabled.");
|
|
25
|
+
let a = [...new Set(e.map((e) => e.identifier))], o = await i.productVariantsBySkus(a);
|
|
26
|
+
if (r(o)) return {
|
|
27
|
+
items: [],
|
|
28
|
+
invalidIdentifiers: a,
|
|
29
|
+
errorResults: [{
|
|
30
|
+
message: o.message,
|
|
31
|
+
errorCode: o.errorCode
|
|
32
|
+
}]
|
|
33
|
+
};
|
|
34
|
+
let s = o.variantIdsBySku.filter((e) => e.variantId == null).map((e) => e.sku);
|
|
35
|
+
if (s.length > 0) return {
|
|
36
|
+
items: [],
|
|
37
|
+
invalidIdentifiers: s,
|
|
38
|
+
errorResults: o.errorResults.map((e) => ({
|
|
39
|
+
message: e.message,
|
|
40
|
+
errorCode: e.errorCode
|
|
41
|
+
}))
|
|
42
|
+
};
|
|
43
|
+
let c = new Map(o.variantIdsBySku.map((e) => [e.sku, e.variantId]));
|
|
44
|
+
return {
|
|
45
|
+
items: e.map((e) => ({
|
|
46
|
+
productVariantId: c.get(e.identifier) ?? e.identifier,
|
|
47
|
+
quantity: e.quantity
|
|
48
|
+
})),
|
|
49
|
+
errorResults: []
|
|
50
|
+
};
|
|
51
|
+
} };
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { t as VendureProductsBySkuPlugin, i as quickOrderVariantSkuValidationStrategy };
|