@haus-storefront-react/vendure-plugin-configs 1.0.4-next.15 → 1.0.4-next.2

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +0 -153
  2. package/badge.js +21 -1
  3. package/badge.mjs +3058 -449
  4. package/campaign.js +1 -1
  5. package/campaign.mjs +106 -50
  6. package/elastic.js +1 -1
  7. package/elastic.mjs +26 -10
  8. package/index-BCrKAB0K.mjs +311 -0
  9. package/index-BRlTlK6a.mjs +3768 -0
  10. package/index-CgxqXyHf.js +20 -0
  11. package/index-DgRzu7XX.js +10 -0
  12. package/index.js +1 -1
  13. package/index.mjs +4 -2
  14. package/lib/configs/vendure-badge-plugin.d.ts +2 -10
  15. package/lib/configs/vendure-badge-plugin.types.d.ts +1 -0
  16. package/lib/configs/vendure-campaign-plugin.d.ts +1 -1
  17. package/lib/configs/vendure-elastic-search-plugin.d.ts +1 -1
  18. package/lib/configs/vendure-packagesize-plugin.d.ts +1 -1
  19. package/lib/configs/vendure-product-popularity-plugin.d.ts +1 -1
  20. package/lib/plugin-config.d.ts +1 -2
  21. package/lib/types.d.ts +0 -2
  22. package/package.json +4 -31
  23. package/packagesize.js +1 -1
  24. package/packagesize.mjs +59 -15
  25. package/product-popularity.js +1 -1
  26. package/product-popularity.mjs +22 -12
  27. package/lib/configs/vendure-product-variant-specifications-plugin.d.ts +0 -55
  28. package/lib/configs/vendure-product-variant-specifications-plugin.types.d.ts +0 -8
  29. package/lib/configs/vendure-products-by-sku-plugin.d.ts +0 -11
  30. package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +0 -13
  31. package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +0 -14
  32. package/lib/configs/vendure-purchase-order-payment-plugin.types.d.ts +0 -7
  33. package/lib/configs/vendure-related-products-plugin.d.ts +0 -39
  34. package/lib/configs/vendure-related-products-plugin.types.d.ts +0 -16
  35. package/lib/exports/product-variant-specifications.d.ts +0 -2
  36. package/lib/exports/products-by-sku.d.ts +0 -3
  37. package/lib/exports/purchase-order-payment.d.ts +0 -3
  38. package/lib/exports/related-products.d.ts +0 -3
  39. package/lib/hooks/use-add-purchase-order-payment.d.ts +0 -13
  40. package/lib/hooks/use-related-products.d.ts +0 -2
  41. package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +0 -6
  42. package/plugin-config-DrQQb9Ry.js +0 -1
  43. package/plugin-config-DywohMgp.mjs +0 -903
  44. package/product-variant-specifications.d.ts +0 -2
  45. package/product-variant-specifications.js +0 -1
  46. package/product-variant-specifications.mjs +0 -9
  47. package/products-by-sku.d.ts +0 -2
  48. package/products-by-sku.js +0 -1
  49. package/products-by-sku.mjs +0 -54
  50. package/purchase-order-payment.d.ts +0 -2
  51. package/purchase-order-payment.js +0 -27
  52. package/purchase-order-payment.mjs +0 -209
  53. package/related-products.d.ts +0 -2
  54. package/related-products.js +0 -1
  55. package/related-products.mjs +0 -36
  56. package/src-BCHcjT-q.mjs +0 -455
  57. package/src-BqcrcEUL.mjs +0 -2718
  58. package/src-Cj3iGasO.js +0 -6
  59. package/src-CvZOxNaX.js +0 -21
@@ -1,2 +0,0 @@
1
- export * from './lib/exports/product-variant-specifications'
2
- export {}
@@ -1 +0,0 @@
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,9 +0,0 @@
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: {}
6
- });
7
- t.setQueryUpdates({ product: { fields: [{ variants: [{ customFields: [{ specifications: ["key", "value"] }] }] }] } });
8
- //#endregion
9
- export { t as VendureProductVariantSpecificationsPlugin };
@@ -1,2 +0,0 @@
1
- export * from './lib/exports/products-by-sku'
2
- export {}
@@ -1 +0,0 @@
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;
@@ -1,54 +0,0 @@
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,2 +0,0 @@
1
- export * from './lib/exports/purchase-order-payment'
2
- export {}
@@ -1,27 +0,0 @@
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
- mutation transitionOrderToState($input: String!) {
3
- transitionOrderToState(state: $input) {
4
- ... on ErrorResult {
5
- errorCode
6
- message
7
- }
8
- }
9
- }
10
- `),n.t(`
11
- query nextOrderStates {
12
- nextOrderStates
13
- }
14
- `),n.t(`
15
- fragment EligiblePaymentMethods on PaymentMethodQuote {
16
- id
17
- name
18
- description
19
- code
20
- }
21
- `),n.t(`
22
- query EligiblePaymentMethods {
23
- eligiblePaymentMethods {
24
- ...EligiblePaymentMethods
25
- }
26
- }
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;
@@ -1,209 +0,0 @@
1
- import { l as e, u as t } from "./src-BCHcjT-q.mjs";
2
- import { t as n } from "./plugin-config-DywohMgp.mjs";
3
- import { a as r, n as i, r as a, t as o } from "./src-BqcrcEUL.mjs";
4
- //#region ../../providers/src/vendure/queries/order/fragments/orderDetailFragment.ts
5
- var s = [
6
- "id",
7
- "code",
8
- "active",
9
- "createdAt",
10
- "updatedAt",
11
- "orderPlacedAt",
12
- "state",
13
- "totalQuantity",
14
- "currencyCode",
15
- "total",
16
- "totalWithTax",
17
- "subTotal",
18
- "subTotalWithTax",
19
- "shipping",
20
- { discounts: [
21
- "type",
22
- "description",
23
- "amount",
24
- "amountWithTax"
25
- ] },
26
- { promotions: [
27
- "couponCode",
28
- "description",
29
- "name",
30
- "enabled",
31
- "perCustomerUsageLimit",
32
- "perCustomerUsageLimit"
33
- ] },
34
- "couponCodes",
35
- "shippingWithTax",
36
- "currencyCode",
37
- { taxSummary: [
38
- "description",
39
- "taxRate",
40
- "taxBase",
41
- "taxTotal"
42
- ] },
43
- { customer: [
44
- "id",
45
- "firstName",
46
- "lastName",
47
- "emailAddress",
48
- "phoneNumber"
49
- ] },
50
- { billingAddress: [
51
- "fullName",
52
- "streetLine1",
53
- "streetLine2",
54
- "company",
55
- "city",
56
- "province",
57
- "postalCode",
58
- "countryCode",
59
- "phoneNumber"
60
- ] },
61
- { shippingAddress: [
62
- "fullName",
63
- "streetLine1",
64
- "streetLine2",
65
- "company",
66
- "city",
67
- "province",
68
- "postalCode",
69
- "countryCode",
70
- "phoneNumber"
71
- ] },
72
- { shippingLines: [
73
- { shippingMethod: ["id", "name"] },
74
- "priceWithTax",
75
- "price"
76
- ] },
77
- { lines: [
78
- "id",
79
- "unitPrice",
80
- "unitPriceWithTax",
81
- "linePrice",
82
- "linePriceWithTax",
83
- "discountedUnitPrice",
84
- "discountedUnitPriceWithTax",
85
- "discountedLinePrice",
86
- "discountedLinePriceWithTax",
87
- "proratedUnitPrice",
88
- "proratedUnitPriceWithTax",
89
- "proratedLinePrice",
90
- "proratedLinePriceWithTax",
91
- "quantity",
92
- { featuredAsset: ["id", "preview"] },
93
- { productVariant: [
94
- "id",
95
- "name",
96
- "sku",
97
- "price",
98
- "priceWithTax",
99
- "currencyCode",
100
- { facetValues: [
101
- { facet: [
102
- "id",
103
- "code",
104
- "name"
105
- ] },
106
- "id",
107
- "code",
108
- "name"
109
- ] },
110
- { featuredAsset: ["id", "preview"] },
111
- { product: [
112
- "id",
113
- "slug",
114
- "description",
115
- {
116
- facetValues: [
117
- { facet: [
118
- "id",
119
- "code",
120
- "name"
121
- ] },
122
- "id",
123
- "code",
124
- "name"
125
- ],
126
- collections: [
127
- "id",
128
- "name",
129
- "slug",
130
- "parentId",
131
- { breadcrumbs: [
132
- "id",
133
- "name",
134
- "slug"
135
- ] }
136
- ]
137
- }
138
- ] }
139
- ] }
140
- ] },
141
- { payments: [
142
- "id",
143
- "state",
144
- "method",
145
- "amount",
146
- "metadata"
147
- ] },
148
- { history: [{ items: [
149
- "id",
150
- "type",
151
- "data",
152
- "createdAt",
153
- "updatedAt"
154
- ] }, "totalItems"] }
155
- ];
156
- i("\n mutation transitionOrderToState($input: String!) {\n transitionOrderToState(state: $input) {\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n"), i("\n query nextOrderStates {\n nextOrderStates\n }\n"), i("\n fragment EligiblePaymentMethods on PaymentMethodQuote {\n id\n name\n description\n code\n }\n"), i("\n query EligiblePaymentMethods {\n eligiblePaymentMethods {\n ...EligiblePaymentMethods\n }\n }\n");
157
- //#endregion
158
- //#region src/lib/configs/vendure-purchase-order-payment-plugin.ts
159
- var c = new n({
160
- name: "purchase-order-payment",
161
- queryUpdates: {}
162
- });
163
- c.setRequests({ addPurchaseOrderPaymentToOrder: async (t) => {
164
- try {
165
- return (await c.getSdk().createRequest({
166
- operation: "addPurchaseOrderPaymentToOrder",
167
- fields: [{
168
- operation: "Order",
169
- fields: s,
170
- fragment: !0
171
- }, {
172
- operation: "ErrorResult",
173
- fields: ["errorCode", "message"],
174
- fragment: !0
175
- }],
176
- variables: { input: { type: "AddPurchaseOrderPaymentToOrderInput!" } }
177
- }, { input: t }, !0)).data;
178
- } catch (t) {
179
- return {
180
- errorCode: e.UnknownError,
181
- message: t instanceof Error ? t.message : "Unknown payment error"
182
- };
183
- }
184
- } });
185
- //#endregion
186
- //#region src/lib/hooks/use-add-purchase-order-payment.ts
187
- var l = () => {
188
- let e = r(), n = o(), i = a({
189
- mutationFn: async (t) => {
190
- let n = e.addPurchaseOrderPaymentToOrder;
191
- if (typeof n != "function") throw Error("addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.");
192
- return n(t);
193
- },
194
- onSuccess: (e) => {
195
- e && !("errorCode" in e) && n.invalidateQueries({ queryKey: [t.ACTIVE_ORDER] });
196
- }
197
- });
198
- return {
199
- addPurchaseOrderPayment: async (e) => i.mutateAsync(e),
200
- error: i.error,
201
- isLoading: i.isPending,
202
- isError: i.isError,
203
- isSuccess: i.isSuccess,
204
- data: i.data,
205
- reset: i.reset
206
- };
207
- };
208
- //#endregion
209
- export { c as VendurePurchaseOrderPaymentPlugin, l as useAddPurchaseOrderPayment };
@@ -1,2 +0,0 @@
1
- export * from './lib/exports/related-products'
2
- export {}
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./src-Cj3iGasO.js`);const e=require(`./plugin-config-DrQQb9Ry.js`),t=require(`./src-CvZOxNaX.js`);let n=require(`@tanstack/react-query`);var r=new e.t({name:`relatedProducts`,enableFeatures:{},queryUpdates:{product:{fields:[`relatedProductIds`]},briefProducts:{fields:[`relatedProductIds`]}}});r.setRequests({relatedProducts:async e=>(await r.getSdk().createRequest({operation:`relatedProducts`,inheritFieldsFrom:`product`,variables:{input:{type:`RelatedProductsInput!`}}},{input:e},!1)).data});var i=e=>{let r=t.i();if(!r.relatedProducts)throw Error(`relatedProducts method not found in SDK. Need to register VendureRelatedProductsPlugin.`);return(0,n.useQuery)({queryKey:[`relatedProducts`,e.id,e.take,e.facetValueIds],queryFn:()=>r.relatedProducts(e),enabled:!!e.id})};exports.VendureRelatedProductsPlugin=r,exports.useRelatedProducts=i;
@@ -1,36 +0,0 @@
1
- import "./src-BCHcjT-q.mjs";
2
- import { t as e } from "./plugin-config-DywohMgp.mjs";
3
- import { a as t } from "./src-BqcrcEUL.mjs";
4
- import { useQuery as n } from "@tanstack/react-query";
5
- //#region src/lib/configs/vendure-related-products-plugin.ts
6
- var r = new e({
7
- name: "relatedProducts",
8
- enableFeatures: {},
9
- queryUpdates: {
10
- product: { fields: ["relatedProductIds"] },
11
- briefProducts: { fields: ["relatedProductIds"] }
12
- }
13
- });
14
- r.setRequests({ relatedProducts: async (e) => (await r.getSdk().createRequest({
15
- operation: "relatedProducts",
16
- inheritFieldsFrom: "product",
17
- variables: { input: { type: "RelatedProductsInput!" } }
18
- }, { input: e }, !1)).data });
19
- //#endregion
20
- //#region src/lib/hooks/use-related-products.ts
21
- var i = (e) => {
22
- let r = t();
23
- if (!r.relatedProducts) throw Error("relatedProducts method not found in SDK. Need to register VendureRelatedProductsPlugin.");
24
- return n({
25
- queryKey: [
26
- "relatedProducts",
27
- e.id,
28
- e.take,
29
- e.facetValueIds
30
- ],
31
- queryFn: () => r.relatedProducts(e),
32
- enabled: !!e.id
33
- });
34
- };
35
- //#endregion
36
- export { r as VendureRelatedProductsPlugin, i as useRelatedProducts };