@haus-storefront-react/vendure-plugin-configs 1.0.4-next.7 → 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 +824 -793
- package/badge.js +1 -1
- package/badge.mjs +439 -424
- package/campaign.js +1 -1
- package/campaign.mjs +50 -106
- package/elastic.js +1 -1
- package/elastic.mjs +10 -26
- package/index.js +1 -1
- package/index.mjs +2 -4
- package/lib/configs/vendure-badge-plugin.d.ts +2 -2
- package/lib/configs/vendure-related-products-plugin.d.ts +39 -0
- package/lib/configs/vendure-related-products-plugin.types.d.ts +16 -0
- package/lib/exports/related-products.d.ts +3 -0
- package/lib/hooks/use-related-products.d.ts +2 -0
- package/package.json +13 -7
- package/packagesize.js +1 -1
- package/packagesize.mjs +15 -59
- package/plugin-config-DrQQb9Ry.js +1 -0
- package/plugin-config-DywohMgp.mjs +903 -0
- package/product-popularity.js +1 -1
- package/product-popularity.mjs +12 -22
- package/product-variant-specifications.js +1 -1
- package/product-variant-specifications.mjs +8 -18
- package/products-by-sku.d.ts +2 -0
- package/products-by-sku.js +1 -0
- package/products-by-sku.mjs +54 -0
- package/purchase-order-payment.js +5 -5
- package/purchase-order-payment.mjs +207 -631
- package/related-products.d.ts +2 -0
- package/related-products.js +1 -0
- package/related-products.mjs +36 -0
- package/src-BCHcjT-q.mjs +455 -0
- package/src-BqcrcEUL.mjs +2718 -0
- package/src-Cj3iGasO.js +6 -0
- package/src-CvZOxNaX.js +21 -0
- package/compiler-runtime-oPPev21o.js +0 -10
- package/compiler-runtime-qHgugrLy.mjs +0 -296
- package/index-BRlTlK6a.mjs +0 -3768
- package/index-BgBC_k8M.js +0 -1
- package/index-C0E-40z0.mjs +0 -19
- package/index-CgxqXyHf.js +0 -20
- package/useSdk-DOrZRSHz.mjs +0 -2634
- package/useSdk-YXpk8Wsi.js +0 -21
package/product-popularity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`productPopularity`,enableFeatures:{},queryUpdates:{}});e.setQueryUpdates({product:{fields:[`popularity`]},search:{fields:[{items:[`popularity`]}]},searchField:{fields:[{items:[`popularity`]}]}}),exports.VendureProductPopularityPlugin=e;
|
package/product-popularity.mjs
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { t as e } from "./plugin-config-DywohMgp.mjs";
|
|
2
|
+
//#region src/lib/configs/vendure-product-popularity-plugin.ts
|
|
3
|
+
var t = new e({
|
|
4
|
+
name: "productPopularity",
|
|
5
|
+
enableFeatures: {},
|
|
6
|
+
queryUpdates: {}
|
|
6
7
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
search: {
|
|
12
|
-
fields: [{
|
|
13
|
-
items: ["popularity"]
|
|
14
|
-
}]
|
|
15
|
-
},
|
|
16
|
-
searchField: {
|
|
17
|
-
fields: [{
|
|
18
|
-
items: ["popularity"]
|
|
19
|
-
}]
|
|
20
|
-
}
|
|
8
|
+
t.setQueryUpdates({
|
|
9
|
+
product: { fields: ["popularity"] },
|
|
10
|
+
search: { fields: [{ items: ["popularity"] }] },
|
|
11
|
+
searchField: { fields: [{ items: ["popularity"] }] }
|
|
21
12
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as VendureProductPopularityPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`productVariantSpecifications`,queryUpdates:{}});e.setQueryUpdates({product:{fields:[{variants:[{customFields:[{specifications:[`key`,`value`]}]}]}]}}),exports.VendureProductVariantSpecificationsPlugin=e;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { t as e } from "./plugin-config-DywohMgp.mjs";
|
|
2
|
+
//#region src/lib/configs/vendure-product-variant-specifications-plugin.ts
|
|
3
|
+
var t = new e({
|
|
4
|
+
name: "productVariantSpecifications",
|
|
5
|
+
queryUpdates: {}
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
variants: [{
|
|
10
|
-
customFields: [{
|
|
11
|
-
specifications: ["key", "value"]
|
|
12
|
-
}]
|
|
13
|
-
}]
|
|
14
|
-
}]
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
export {
|
|
18
|
-
i as VendureProductVariantSpecificationsPlugin
|
|
19
|
-
};
|
|
7
|
+
t.setQueryUpdates({ product: { fields: [{ variants: [{ customFields: [{ specifications: ["key", "value"] }] }] }] } });
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as VendureProductVariantSpecificationsPlugin };
|
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-Cj3iGasO.js`),t=require(`./plugin-config-DrQQb9Ry.js`),n=require(`./src-CvZOxNaX.js`);let r=require(`@tanstack/react-query`);var i=[`id`,`code`,`active`,`createdAt`,`updatedAt`,`orderPlacedAt`,`state`,`totalQuantity`,`currencyCode`,`total`,`totalWithTax`,`subTotal`,`subTotalWithTax`,`shipping`,{discounts:[`type`,`description`,`amount`,`amountWithTax`]},{promotions:[`couponCode`,`description`,`name`,`enabled`,`perCustomerUsageLimit`,`perCustomerUsageLimit`]},`couponCodes`,`shippingWithTax`,`currencyCode`,{taxSummary:[`description`,`taxRate`,`taxBase`,`taxTotal`]},{customer:[`id`,`firstName`,`lastName`,`emailAddress`,`phoneNumber`]},{billingAddress:[`fullName`,`streetLine1`,`streetLine2`,`company`,`city`,`province`,`postalCode`,`countryCode`,`phoneNumber`]},{shippingAddress:[`fullName`,`streetLine1`,`streetLine2`,`company`,`city`,`province`,`postalCode`,`countryCode`,`phoneNumber`]},{shippingLines:[{shippingMethod:[`id`,`name`]},`priceWithTax`,`price`]},{lines:[`id`,`unitPrice`,`unitPriceWithTax`,`linePrice`,`linePriceWithTax`,`discountedUnitPrice`,`discountedUnitPriceWithTax`,`discountedLinePrice`,`discountedLinePriceWithTax`,`proratedUnitPrice`,`proratedUnitPriceWithTax`,`proratedLinePrice`,`proratedLinePriceWithTax`,`quantity`,{featuredAsset:[`id`,`preview`]},{productVariant:[`id`,`name`,`sku`,`price`,`priceWithTax`,`currencyCode`,{facetValues:[{facet:[`id`,`code`,`name`]},`id`,`code`,`name`]},{featuredAsset:[`id`,`preview`]},{product:[`id`,`slug`,`description`,{facetValues:[{facet:[`id`,`code`,`name`]},`id`,`code`,`name`],collections:[`id`,`name`,`slug`,`parentId`,{breadcrumbs:[`id`,`name`,`slug`]}]}]}]}]},{payments:[`id`,`state`,`method`,`amount`,`metadata`]},{history:[{items:[`id`,`type`,`data`,`createdAt`,`updatedAt`]},`totalItems`]}];n.t(`
|
|
2
2
|
mutation transitionOrderToState($input: String!) {
|
|
3
3
|
transitionOrderToState(state: $input) {
|
|
4
4
|
... on ErrorResult {
|
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`)
|
|
10
|
+
`),n.t(`
|
|
11
11
|
query nextOrderStates {
|
|
12
12
|
nextOrderStates
|
|
13
13
|
}
|
|
14
|
-
`)
|
|
14
|
+
`),n.t(`
|
|
15
15
|
fragment EligiblePaymentMethods on PaymentMethodQuote {
|
|
16
16
|
id
|
|
17
17
|
name
|
|
18
18
|
description
|
|
19
19
|
code
|
|
20
20
|
}
|
|
21
|
-
`)
|
|
21
|
+
`),n.t(`
|
|
22
22
|
query EligiblePaymentMethods {
|
|
23
23
|
eligiblePaymentMethods {
|
|
24
24
|
...EligiblePaymentMethods
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`);
|
|
27
|
+
`);var a=new t.t({name:`purchase-order-payment`,queryUpdates:{}});a.setRequests({addPurchaseOrderPaymentToOrder:async t=>{try{return(await a.getSdk().createRequest({operation:`addPurchaseOrderPaymentToOrder`,fields:[{operation:`Order`,fields:i,fragment:!0},{operation:`ErrorResult`,fields:[`errorCode`,`message`],fragment:!0}],variables:{input:{type:`AddPurchaseOrderPaymentToOrderInput!`}}},{input:t},!0)).data}catch(t){return{errorCode:e.l.UnknownError,message:t instanceof Error?t.message:`Unknown payment error`}}}});var o=()=>{let t=n.i(),i=(0,r.useQueryClient)(),a=n.n({mutationFn:async e=>{let n=t.addPurchaseOrderPaymentToOrder;if(typeof n!=`function`)throw Error(`addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.`);return n(e)},onSuccess:t=>{t&&!(`errorCode`in t)&&i.invalidateQueries({queryKey:[e.u.ACTIVE_ORDER]})}});return{addPurchaseOrderPayment:async e=>a.mutateAsync(e),error:a.error,isLoading:a.isPending,isError:a.isError,isSuccess:a.isSuccess,data:a.data,reset:a.reset}};exports.VendurePurchaseOrderPaymentPlugin=a,exports.useAddPurchaseOrderPayment=o;
|