@haus-storefront-react/vendure-plugin-configs 1.0.4-next.1 → 1.0.4-next.10

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 +102 -0
  2. package/badge.js +1 -21
  3. package/badge.mjs +449 -3058
  4. package/campaign.js +1 -1
  5. package/campaign.mjs +50 -106
  6. package/elastic.js +1 -1
  7. package/elastic.mjs +10 -26
  8. package/index.js +1 -1
  9. package/index.mjs +2 -4
  10. package/lib/configs/vendure-badge-plugin.d.ts +10 -2
  11. package/lib/configs/vendure-badge-plugin.types.d.ts +0 -1
  12. package/lib/configs/vendure-campaign-plugin.d.ts +1 -1
  13. package/lib/configs/vendure-elastic-search-plugin.d.ts +1 -1
  14. package/lib/configs/vendure-packagesize-plugin.d.ts +1 -1
  15. package/lib/configs/vendure-product-popularity-plugin.d.ts +1 -1
  16. package/lib/configs/vendure-product-variant-specifications-plugin.d.ts +55 -0
  17. package/lib/configs/vendure-product-variant-specifications-plugin.types.d.ts +8 -0
  18. package/lib/configs/vendure-products-by-sku-plugin.d.ts +11 -0
  19. package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +13 -0
  20. package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +14 -0
  21. package/lib/configs/vendure-purchase-order-payment-plugin.types.d.ts +7 -0
  22. package/lib/configs/vendure-related-products-plugin.d.ts +39 -0
  23. package/lib/configs/vendure-related-products-plugin.types.d.ts +16 -0
  24. package/lib/exports/product-variant-specifications.d.ts +2 -0
  25. package/lib/exports/products-by-sku.d.ts +3 -0
  26. package/lib/exports/purchase-order-payment.d.ts +3 -0
  27. package/lib/exports/related-products.d.ts +3 -0
  28. package/lib/hooks/use-add-purchase-order-payment.d.ts +13 -0
  29. package/lib/hooks/use-related-products.d.ts +2 -0
  30. package/lib/plugin-config.d.ts +2 -1
  31. package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +6 -0
  32. package/lib/types.d.ts +2 -0
  33. package/package.json +31 -4
  34. package/packagesize.js +1 -1
  35. package/packagesize.mjs +15 -59
  36. package/plugin-config-DrQQb9Ry.js +1 -0
  37. package/plugin-config-DywohMgp.mjs +903 -0
  38. package/product-popularity.js +1 -1
  39. package/product-popularity.mjs +12 -22
  40. package/product-variant-specifications.d.ts +2 -0
  41. package/product-variant-specifications.js +1 -0
  42. package/product-variant-specifications.mjs +9 -0
  43. package/products-by-sku.d.ts +2 -0
  44. package/products-by-sku.js +1 -0
  45. package/products-by-sku.mjs +54 -0
  46. package/purchase-order-payment.d.ts +2 -0
  47. package/purchase-order-payment.js +27 -0
  48. package/purchase-order-payment.mjs +209 -0
  49. package/related-products.d.ts +2 -0
  50. package/related-products.js +1 -0
  51. package/related-products.mjs +36 -0
  52. package/src-BCHcjT-q.mjs +455 -0
  53. package/src-BqcrcEUL.mjs +2718 -0
  54. package/src-Cj3iGasO.js +6 -0
  55. package/src-CvZOxNaX.js +21 -0
  56. package/index-BCrKAB0K.mjs +0 -311
  57. package/index-BRlTlK6a.mjs +0 -3768
  58. package/index-CgxqXyHf.js +0 -20
  59. package/index-DgRzu7XX.js +0 -10
package/campaign.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CgxqXyHf.js"),e=require("./index-DgRzu7XX.js"),d=new c.VendurePluginConfig({name:"campaign",enableFeatures:{ordinaryPrice:({variant:i,orderLine:r,searchResult:n,product:a})=>{if(r){const t=r.productVariant;return t?.ordinaryPrice?e.getPrice(t?.ordinaryPrice)*r.quantity:r.discountedLinePriceWithTax}return i?e.getPrice(i.ordinaryPrice||0):n?e.getPrice(n.ordinaryPrice||0):a?e.getProductPriceFromVariants(a.variants):0}},queryUpdates:{}});d.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:"PriceRange",fields:["min, max"],fragment:!0},{operation:"SinglePrice",fields:["value"],fragment:!0}]},{variants:["ordinaryPrice"]}]}]},activeOrder:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["ordinaryPrice"]}]}]}]}});const o=(i,r)=>{const n=e.getPrice(i),a=e.getPrice(r);return e.getPrice(i)===0?!1:a!==n};exports.VendureCampaignPlugin=d;exports.isCampaign=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-Cj3iGasO.js`);var t=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`campaign`,enableFeatures:{ordinaryPrice:({variant:t,orderLine:n,searchResult:r,product:i})=>{if(n){let t=n.productVariant;return t?.ordinaryPrice?e.t(t?.ordinaryPrice)*n.quantity:n.discountedLinePriceWithTax}return t?e.t(t.ordinaryPrice||0):r?e.t(r.ordinaryPrice||0):i?e.n(i.variants):0}},queryUpdates:{}});t.setQueryUpdates({search:{fields:[{items:[{ordinaryPrice:[{operation:`PriceRange`,fields:[`min, max`],fragment:!0},{operation:`SinglePrice`,fields:[`value`],fragment:!0}]}]}]},product:{fields:[{ordinaryPrice:[{operation:`PriceRange`,fields:[`min, max`],fragment:!0},{operation:`SinglePrice`,fields:[`value`],fragment:!0}]},{variants:[`ordinaryPrice`]}]},briefProducts:{fields:[{items:[{ordinaryPrice:[{operation:`PriceRange`,fields:[`min, max`],fragment:!0},{operation:`SinglePrice`,fields:[`value`],fragment:!0}]},{variants:[`ordinaryPrice`]}]}]},activeOrder:{fields:[{lines:[{productVariant:[`ordinaryPrice`]}]}]},orderByCode:{fields:[{lines:[{productVariant:[`ordinaryPrice`]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:[`ordinaryPrice`]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:[`ordinaryPrice`]}]}]}]}});var n=(t,n)=>{let r=e.t(t),i=e.t(n);return e.t(t)===0?!1:i!==r};exports.VendureCampaignPlugin=t,exports.isCampaign=n;
package/campaign.mjs CHANGED
@@ -1,109 +1,53 @@
1
- import { V as d } from "./index-BRlTlK6a.mjs";
2
- import { g as e, a as o } from "./index-BCrKAB0K.mjs";
3
- const s = new d({
4
- name: "campaign",
5
- enableFeatures: {
6
- ordinaryPrice: ({
7
- variant: i,
8
- orderLine: r,
9
- searchResult: a,
10
- product: n
11
- }) => {
12
- if (r) {
13
- const t = r.productVariant;
14
- return t?.ordinaryPrice ? e(t?.ordinaryPrice) * r.quantity : r.discountedLinePriceWithTax;
15
- }
16
- return i ? e(i.ordinaryPrice || 0) : a ? e(a.ordinaryPrice || 0) : n ? o(n.variants) : 0;
17
- }
18
- },
19
- queryUpdates: {}
1
+ import { n as e, t } from "./src-BCHcjT-q.mjs";
2
+ import { t as n } from "./plugin-config-DywohMgp.mjs";
3
+ //#region src/lib/configs/vendure-campaign-plugin.ts
4
+ var r = new n({
5
+ name: "campaign",
6
+ enableFeatures: { ordinaryPrice: ({ variant: n, orderLine: r, searchResult: i, product: a }) => {
7
+ if (r) {
8
+ let e = r.productVariant;
9
+ return e?.ordinaryPrice ? t(e?.ordinaryPrice) * r.quantity : r.discountedLinePriceWithTax;
10
+ }
11
+ return n ? t(n.ordinaryPrice || 0) : i ? t(i.ordinaryPrice || 0) : a ? e(a.variants) : 0;
12
+ } },
13
+ queryUpdates: {}
20
14
  });
21
- s.setQueryUpdates({
22
- search: {
23
- fields: [{
24
- items: [{
25
- ordinaryPrice: [{
26
- operation: "PriceRange",
27
- fields: ["min, max"],
28
- fragment: !0
29
- }, {
30
- operation: "SinglePrice",
31
- fields: ["value"],
32
- fragment: !0
33
- }]
34
- }]
35
- }]
36
- },
37
- product: {
38
- fields: [{
39
- ordinaryPrice: [{
40
- operation: "PriceRange",
41
- fields: ["min, max"],
42
- fragment: !0
43
- }, {
44
- operation: "SinglePrice",
45
- fields: ["value"],
46
- fragment: !0
47
- }]
48
- }, {
49
- variants: ["ordinaryPrice"]
50
- }]
51
- },
52
- briefProducts: {
53
- fields: [{
54
- items: [{
55
- ordinaryPrice: [{
56
- operation: "PriceRange",
57
- fields: ["min, max"],
58
- fragment: !0
59
- }, {
60
- operation: "SinglePrice",
61
- fields: ["value"],
62
- fragment: !0
63
- }]
64
- }, {
65
- variants: ["ordinaryPrice"]
66
- }]
67
- }]
68
- },
69
- activeOrder: {
70
- fields: [{
71
- lines: [{
72
- productVariant: ["ordinaryPrice"]
73
- }]
74
- }]
75
- },
76
- orderByCode: {
77
- fields: [{
78
- lines: [{
79
- productVariant: ["ordinaryPrice"]
80
- }]
81
- }]
82
- },
83
- adjustOrderLine: {
84
- fields: [{
85
- fields: [{
86
- lines: [{
87
- productVariant: ["ordinaryPrice"]
88
- }]
89
- }]
90
- }]
91
- },
92
- addItemToOrder: {
93
- fields: [{
94
- fields: [{
95
- lines: [{
96
- productVariant: ["ordinaryPrice"]
97
- }]
98
- }]
99
- }]
100
- }
15
+ r.setQueryUpdates({
16
+ search: { fields: [{ items: [{ ordinaryPrice: [{
17
+ operation: "PriceRange",
18
+ fields: ["min, max"],
19
+ fragment: !0
20
+ }, {
21
+ operation: "SinglePrice",
22
+ fields: ["value"],
23
+ fragment: !0
24
+ }] }] }] },
25
+ product: { fields: [{ ordinaryPrice: [{
26
+ operation: "PriceRange",
27
+ fields: ["min, max"],
28
+ fragment: !0
29
+ }, {
30
+ operation: "SinglePrice",
31
+ fields: ["value"],
32
+ fragment: !0
33
+ }] }, { variants: ["ordinaryPrice"] }] },
34
+ briefProducts: { fields: [{ items: [{ ordinaryPrice: [{
35
+ operation: "PriceRange",
36
+ fields: ["min, max"],
37
+ fragment: !0
38
+ }, {
39
+ operation: "SinglePrice",
40
+ fields: ["value"],
41
+ fragment: !0
42
+ }] }, { variants: ["ordinaryPrice"] }] }] },
43
+ activeOrder: { fields: [{ lines: [{ productVariant: ["ordinaryPrice"] }] }] },
44
+ orderByCode: { fields: [{ lines: [{ productVariant: ["ordinaryPrice"] }] }] },
45
+ adjustOrderLine: { fields: [{ fields: [{ lines: [{ productVariant: ["ordinaryPrice"] }] }] }] },
46
+ addItemToOrder: { fields: [{ fields: [{ lines: [{ productVariant: ["ordinaryPrice"] }] }] }] }
101
47
  });
102
- const f = (i, r) => {
103
- const a = e(i), n = e(r);
104
- return e(i) === 0 ? !1 : n !== a;
105
- };
106
- export {
107
- s as VendureCampaignPlugin,
108
- f as isCampaign
48
+ var i = (e, n) => {
49
+ let r = t(e), i = t(n);
50
+ return t(e) === 0 ? !1 : i !== r;
109
51
  };
52
+ //#endregion
53
+ export { r as VendureCampaignPlugin, i as isCampaign };
package/elastic.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CgxqXyHf.js"),i=new e.VendurePluginConfig({name:"vendure-elastic-search",queryUpdates:{search:{fields:[{prices:[{range:["min","max"]},{rangeWithTax:["min","max"]}]}]},searchField:{fields:[{prices:[{range:["min","max"]},{rangeWithTax:["min","max"]}]}]}}});exports.VendureElasticSearchPlugin=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`vendure-elastic-search`,queryUpdates:{search:{fields:[{prices:[{range:[`min`,`max`]},{rangeWithTax:[`min`,`max`]}]}]},searchField:{fields:[{prices:[{range:[`min`,`max`]},{rangeWithTax:[`min`,`max`]}]}]}}});exports.VendureElasticSearchPlugin=e;
package/elastic.mjs CHANGED
@@ -1,27 +1,11 @@
1
- import { V as e } from "./index-BRlTlK6a.mjs";
2
- const i = new e({
3
- name: "vendure-elastic-search",
4
- queryUpdates: {
5
- search: {
6
- fields: [{
7
- prices: [{
8
- range: ["min", "max"]
9
- }, {
10
- rangeWithTax: ["min", "max"]
11
- }]
12
- }]
13
- },
14
- searchField: {
15
- fields: [{
16
- prices: [{
17
- range: ["min", "max"]
18
- }, {
19
- rangeWithTax: ["min", "max"]
20
- }]
21
- }]
22
- }
23
- }
1
+ import { t as e } from "./plugin-config-DywohMgp.mjs";
2
+ //#region src/lib/configs/vendure-elastic-search-plugin.ts
3
+ var t = new e({
4
+ name: "vendure-elastic-search",
5
+ queryUpdates: {
6
+ search: { fields: [{ prices: [{ range: ["min", "max"] }, { rangeWithTax: ["min", "max"] }] }] },
7
+ searchField: { fields: [{ prices: [{ range: ["min", "max"] }, { rangeWithTax: ["min", "max"] }] }] }
8
+ }
24
9
  });
25
- export {
26
- i as VendureElasticSearchPlugin
27
- };
10
+ //#endregion
11
+ export { t as VendureElasticSearchPlugin };
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CgxqXyHf.js");exports.VendurePluginConfig=e.VendurePluginConfig;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugin-config-DrQQb9Ry.js`);exports.VendurePluginConfig=e.t;
package/index.mjs CHANGED
@@ -1,4 +1,2 @@
1
- import { V as o } from "./index-BRlTlK6a.mjs";
2
- export {
3
- o as VendurePluginConfig
4
- };
1
+ import { t as e } from "./plugin-config-DywohMgp.mjs";
2
+ export { e as VendurePluginConfig };
@@ -1,4 +1,4 @@
1
- import { Asset, Collection } from '@haus-storefront-react/shared-types';
1
+ import { Asset, Collection, ErrorResult, PaginatedList } from '@haus-storefront-react/shared-types';
2
2
  import { VendurePluginConfig } from '../plugin-config';
3
3
  import { BadgeFeatures, BadgePluginRequests, BadgePluginSettings } from './vendure-badge-plugin.types';
4
4
  declare module '@haus-storefront-react/shared-types' {
@@ -15,7 +15,15 @@ declare module '@haus-storefront-react/shared-types' {
15
15
  showBadges: BadgeFeatures['showBadges'];
16
16
  }
17
17
  }
18
- export declare const VendureBadgePlugin: VendurePluginConfig<BadgeFeatures, BadgePluginRequests, BadgePluginSettings, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
18
+ declare module '../../../../../providers/src/vendure/index.ts' {
19
+ interface VendureSDK {
20
+ /** Added by VendureBadgePlugin when enabled */
21
+ badges: (options: {
22
+ collectionId: string;
23
+ }) => Promise<PaginatedList<Badge> | ErrorResult>;
24
+ }
25
+ }
26
+ export declare const VendureBadgePlugin: VendurePluginConfig<BadgeFeatures, BadgePluginRequests, BadgePluginSettings, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
19
27
  export type Badge = {
20
28
  id: string;
21
29
  createdAt: string;
@@ -1,6 +1,5 @@
1
1
  import { Badge, ErrorResult, Maybe, PaginatedList, Product, ProductVariant, SearchResult } from '@haus-storefront-react/shared-types';
2
2
  export interface BadgePluginRequests {
3
- [key: string]: (...args: unknown[]) => unknown;
4
3
  getBadges: () => Promise<PaginatedList<Badge> | ErrorResult>;
5
4
  }
6
5
  export interface BadgeFeatures {
@@ -18,5 +18,5 @@ declare module '@haus-storefront-react/shared-types' {
18
18
  }
19
19
  export declare const VendureCampaignPlugin: VendurePluginConfig<CampaignFeatures, Record<string, (...args: any[]) => any>, {
20
20
  [x: string]: any;
21
- }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
21
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
22
22
  export declare const isCampaign: (ordinaryPrice: PriceRange | SinglePrice | number, currentPrice: PriceRange | SinglePrice | number) => boolean;
@@ -65,4 +65,4 @@ export declare const VendureElasticSearchPlugin: VendurePluginConfig<Partial<{
65
65
  sortByPopularity: boolean;
66
66
  }>, Record<string, (...args: any[]) => any>, {
67
67
  [x: string]: any;
68
- }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
68
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -33,4 +33,4 @@ declare module '@haus-storefront-react/shared-types' {
33
33
  }
34
34
  export declare const VendurePackageSizePlugin: VendurePluginConfig<PackageSizeFeatures, Record<string, (...args: any[]) => any>, {
35
35
  [x: string]: any;
36
- }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
36
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -40,4 +40,4 @@ declare module '@haus-storefront-react/shared-types' {
40
40
  }
41
41
  export declare const VendureProductPopularityPlugin: VendurePluginConfig<ProductPopularityFeatures, Record<string, (...args: any[]) => any>, {
42
42
  [x: string]: any;
43
- }, import('@haus-storefront-react/shared-types').IGraphQLSDK>;
43
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -0,0 +1,55 @@
1
+ import { VendurePluginConfig } from '../plugin-config';
2
+ import { ProductVariantSpecification } from './vendure-product-variant-specifications-plugin.types';
3
+ /**
4
+ * Extends ProductVariant.customFields (ProductVariantCustomFields) with specifications.
5
+ * Use with ProductVariantSpecificationsPlugin on the Vendure server.
6
+ * Access via productVariant.customFields.specifications
7
+ */
8
+ declare module '@haus-storefront-react/shared-types' {
9
+ interface ProductVariant {
10
+ customFields?: {
11
+ specifications?: ProductVariantSpecification[];
12
+ };
13
+ }
14
+ }
15
+ /**
16
+ * Storefront plugin config for ProductVariantSpecificationsPlugin.
17
+ * Adds `specifications` (key-value pairs) to product variant queries.
18
+ */
19
+ export declare const VendureProductVariantSpecificationsPlugin: VendurePluginConfig<Partial<{
20
+ showBadges: (props: {
21
+ product?: import('@haus-storefront-react/shared-types').Product | import('@haus-storefront-react/shared-types').SearchResult;
22
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
23
+ parentComponent?: keyof import('./vendure-badge-plugin.types').BadgePluginSettings["availablePositions"];
24
+ badges: import('@haus-storefront-react/shared-types').Maybe<import('@haus-storefront-react/shared-types').Badge[]>;
25
+ }) => {
26
+ badges: import('@haus-storefront-react/shared-types').Badge[];
27
+ availablePositions?: string[];
28
+ };
29
+ showCampaignPrices: boolean;
30
+ ordinaryPrice: (props: {
31
+ product?: import('@haus-storefront-react/shared-types').Product;
32
+ searchResult?: import('@haus-storefront-react/shared-types').SearchResult;
33
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
34
+ orderLine?: import('@haus-storefront-react/shared-types').OrderLine;
35
+ identifier?: string;
36
+ }) => import('@haus-storefront-react/shared-types').Price;
37
+ changeQuantityByPackageSize: (props: {
38
+ product?: import('@haus-storefront-react/shared-types').Product | import('@haus-storefront-react/shared-types').SearchResult;
39
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
40
+ identifier: string;
41
+ }) => boolean;
42
+ showPackageSize: (props: {
43
+ product?: import('@haus-storefront-react/shared-types').Product | import('@haus-storefront-react/shared-types').SearchResult;
44
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
45
+ identifier: string;
46
+ }) => boolean;
47
+ showCostPerPackage: (props: {
48
+ product?: import('@haus-storefront-react/shared-types').Product | import('@haus-storefront-react/shared-types').SearchResult;
49
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
50
+ identifier: string;
51
+ }) => boolean;
52
+ sortByPopularity: boolean;
53
+ }>, Record<string, (...args: any[]) => any>, {
54
+ [x: string]: any;
55
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Key-value pair for product variant specifications (e.g. Weight: 2.5 kg).
3
+ * Matches the struct custom field defined by ProductVariantSpecificationsPlugin.
4
+ */
5
+ export interface ProductVariantSpecification {
6
+ key: string;
7
+ value: string;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { VendurePluginConfig } from '../plugin-config';
2
+ import { ProductVariantBySkuResult, ProductsBySkuPluginRequests } from './vendure-products-by-sku-plugin.types';
3
+ declare module '@haus-storefront-react/core' {
4
+ interface VendureSDK {
5
+ /** Added by VendureProductsBySkuPlugin when enabled */
6
+ productVariantsBySkus?: (skus: string[]) => Promise<ProductVariantBySkuResult>;
7
+ }
8
+ }
9
+ export declare const VendureProductsBySkuPlugin: VendurePluginConfig<Record<string, never>, ProductsBySkuPluginRequests, {
10
+ [x: string]: any;
11
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -0,0 +1,13 @@
1
+ import { ErrorResult } from '@haus-storefront-react/shared-types';
2
+ interface ProductVariantBySku {
3
+ sku: string;
4
+ variantId: string | null;
5
+ }
6
+ export interface ProductVariantBySkuResult {
7
+ variantIdsBySku: Array<ProductVariantBySku>;
8
+ errorResults: Array<ErrorResult>;
9
+ }
10
+ export interface ProductsBySkuPluginRequests {
11
+ productVariantsBySkus: (skus: string[]) => Promise<ProductVariantBySkuResult | ErrorResult>;
12
+ }
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ import { VendurePluginConfig } from '../plugin-config';
3
+ import { AddPurchaseOrderPaymentToOrderInput, PurchaseOrderPaymentPluginRequests } from './vendure-purchase-order-payment-plugin.types';
4
+ declare module '@haus-storefront-react/core' {
5
+ interface VendureSDK {
6
+ addPurchaseOrderPaymentToOrder?: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<Order | ErrorResult>;
7
+ }
8
+ }
9
+ /**
10
+ * Extend Vendure SDK with Purchase Order payment mutation request.
11
+ */
12
+ export declare const VendurePurchaseOrderPaymentPlugin: VendurePluginConfig<Record<string, never>, PurchaseOrderPaymentPluginRequests, {
13
+ [x: string]: any;
14
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -0,0 +1,7 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ export interface AddPurchaseOrderPaymentToOrderInput {
3
+ poNumber: string;
4
+ }
5
+ export type PurchaseOrderPaymentPluginRequests = {
6
+ addPurchaseOrderPaymentToOrder: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<Order | ErrorResult>;
7
+ };
@@ -0,0 +1,39 @@
1
+ import { Product } from '@haus-storefront-react/shared-types';
2
+ import { VendurePluginConfig } from '../plugin-config';
3
+ export declare const VendureRelatedProductsPlugin: VendurePluginConfig<Partial<{
4
+ showBadges: (props: {
5
+ product?: Product | import('@haus-storefront-react/shared-types').SearchResult;
6
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
7
+ parentComponent?: keyof import('./vendure-badge-plugin.types').BadgePluginSettings["availablePositions"];
8
+ badges: import('@haus-storefront-react/shared-types').Maybe<import('@haus-storefront-react/shared-types').Badge[]>;
9
+ }) => {
10
+ badges: import('@haus-storefront-react/shared-types').Badge[];
11
+ availablePositions?: string[];
12
+ };
13
+ showCampaignPrices: boolean;
14
+ ordinaryPrice: (props: {
15
+ product?: Product;
16
+ searchResult?: import('@haus-storefront-react/shared-types').SearchResult;
17
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
18
+ orderLine?: import('@haus-storefront-react/shared-types').OrderLine;
19
+ identifier?: string;
20
+ }) => import('@haus-storefront-react/shared-types').Price;
21
+ changeQuantityByPackageSize: (props: {
22
+ product?: Product | import('@haus-storefront-react/shared-types').SearchResult;
23
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
24
+ identifier: string;
25
+ }) => boolean;
26
+ showPackageSize: (props: {
27
+ product?: Product | import('@haus-storefront-react/shared-types').SearchResult;
28
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
29
+ identifier: string;
30
+ }) => boolean;
31
+ showCostPerPackage: (props: {
32
+ product?: Product | import('@haus-storefront-react/shared-types').SearchResult;
33
+ variant?: import('@haus-storefront-react/shared-types').ProductVariant;
34
+ identifier: string;
35
+ }) => boolean;
36
+ sortByPopularity: boolean;
37
+ }>, Record<string, (...args: any[]) => any>, {
38
+ [x: string]: any;
39
+ }, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
@@ -0,0 +1,16 @@
1
+ import { ErrorResult, Product } from '@haus-storefront-react/shared-types';
2
+ declare module '@haus-storefront-react/shared-types' {
3
+ interface Product {
4
+ relatedProductIds?: string[];
5
+ }
6
+ }
7
+ declare module '../../../../../providers/src/vendure/index.ts' {
8
+ interface VendureSDK {
9
+ relatedProducts: (input: RelatedProductsInput) => Promise<Product[] | ErrorResult>;
10
+ }
11
+ }
12
+ export interface RelatedProductsInput {
13
+ id: string;
14
+ take?: number;
15
+ facetIds?: string[];
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from '../configs/vendure-product-variant-specifications-plugin';
2
+ export * from '../configs/vendure-product-variant-specifications-plugin.types';
@@ -0,0 +1,3 @@
1
+ export * from '../configs/vendure-products-by-sku-plugin';
2
+ export * from '../configs/vendure-products-by-sku-plugin.types';
3
+ export { quickOrderVariantSkuValidationStrategy } from '../strategies/quick-order-variant-sku-validation-strategy';
@@ -0,0 +1,3 @@
1
+ export * from '../configs/vendure-purchase-order-payment-plugin';
2
+ export * from '../configs/vendure-purchase-order-payment-plugin.types';
3
+ export * from '../hooks/use-add-purchase-order-payment';
@@ -0,0 +1,3 @@
1
+ export * from '../configs/vendure-related-products-plugin';
2
+ export * from '../configs/vendure-related-products-plugin.types';
3
+ export * from '../hooks/use-related-products';
@@ -0,0 +1,13 @@
1
+ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
2
+ import { AddPurchaseOrderPaymentToOrderInput } from '../configs/vendure-purchase-order-payment-plugin.types';
3
+ type AddPurchaseOrderPaymentResult = Order | ErrorResult;
4
+ export declare const useAddPurchaseOrderPayment: () => {
5
+ addPurchaseOrderPayment: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<AddPurchaseOrderPaymentResult>;
6
+ error: Error | null;
7
+ isLoading: boolean;
8
+ isError: boolean;
9
+ isSuccess: boolean;
10
+ data: AddPurchaseOrderPaymentResult | undefined;
11
+ reset: () => void;
12
+ };
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RelatedProductsInput } from '../configs/vendure-related-products-plugin.types';
2
+ export declare const useRelatedProducts: (input: RelatedProductsInput) => import('@tanstack/react-query').UseQueryResult<import('@haus-storefront-react/shared-types').ErrorResult | import('@haus-storefront-react/shared-types').Product[], Error>;
@@ -1,4 +1,5 @@
1
1
  import { BuilderQueryUpdates, IVendurePluginConfig, PluginFeatures, ProviderDataMap, IGraphQLSDK } from '@haus-storefront-react/shared-types';
2
+ import { VendureSDK } from '../../../../providers/src/vendure/index.ts';
2
3
  type PluginSettings = Record<string, any>;
3
4
  export type VendurePluginConfigInput<Features, R, S, T extends IGraphQLSDK = IGraphQLSDK> = {
4
5
  name: string;
@@ -10,7 +11,7 @@ export type VendurePluginConfigInput<Features, R, S, T extends IGraphQLSDK = IGr
10
11
  settings?: S;
11
12
  onSdkReady?: (sdk: T) => void | Promise<void>;
12
13
  };
13
- export declare class VendurePluginConfig<Features extends PluginFeatures = PluginFeatures, R extends Record<string, (...args: any[]) => any> = Record<string, (...args: any[]) => any>, S extends PluginSettings = PluginSettings, T extends IGraphQLSDK = IGraphQLSDK> implements IVendurePluginConfig<Features, R, S, T> {
14
+ export declare class VendurePluginConfig<Features extends PluginFeatures = PluginFeatures, R extends object = Record<string, (...args: any[]) => any>, S extends PluginSettings = PluginSettings, T extends VendureSDK = VendureSDK> implements IVendurePluginConfig<Features, R, S, T> {
14
15
  sdk: T;
15
16
  name: IVendurePluginConfig<Features, R, S, T>['name'];
16
17
  enabled: boolean;
@@ -0,0 +1,6 @@
1
+ import { QuickOrderVariantValidationStrategy } from '@haus-storefront-react/strategies';
2
+ /**
3
+ * Creates a validation strategy that resolves SKUs to variant IDs using productVariantsBySkus.
4
+ * Use with QuickOrder.Root validationStrategy prop when VendureProductsBySkuPlugin is enabled.
5
+ */
6
+ export declare function quickOrderVariantSkuValidationStrategy(): QuickOrderVariantValidationStrategy;
package/lib/types.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './configs/vendure-badge-plugin.types';
2
2
  export * from './configs/vendure-product-popularity-plugin.types';
3
+ export * from './configs/vendure-product-variant-specifications-plugin.types';
4
+ export * from './configs/vendure-purchase-order-payment-plugin.types';
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.1",
3
+ "version": "1.0.4-next.10",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -33,17 +33,44 @@
33
33
  "require": "./packagesize.js",
34
34
  "default": "./packagesize"
35
35
  },
36
+ "./purchase-order-payment": {
37
+ "types": "./lib/exports/purchase-order-payment.d.ts",
38
+ "import": "./purchase-order-payment.mjs",
39
+ "require": "./purchase-order-payment.js",
40
+ "default": "./purchase-order-payment"
41
+ },
36
42
  "./product-popularity": {
37
43
  "types": "./lib/exports/product-popularity.d.ts",
38
44
  "import": "./product-popularity.mjs",
39
45
  "require": "./product-popularity.js",
40
46
  "default": "./product-popularity"
47
+ },
48
+ "./related-products": {
49
+ "types": "./lib/exports/related-products.d.ts",
50
+ "import": "./related-products.mjs",
51
+ "require": "./related-products.js",
52
+ "default": "./related-products"
53
+ },
54
+ "./products-by-sku": {
55
+ "types": "./lib/exports/products-by-sku.d.ts",
56
+ "import": "./products-by-sku.mjs",
57
+ "require": "./products-by-sku.js",
58
+ "default": "./products-by-sku"
59
+ },
60
+ "./product-variant-specifications": {
61
+ "types": "./lib/exports/product-variant-specifications.d.ts",
62
+ "import": "./product-variant-specifications.mjs",
63
+ "require": "./product-variant-specifications.js",
64
+ "default": "./product-variant-specifications"
41
65
  }
42
66
  },
43
67
  "dependencies": {
44
- "@haus-storefront-react/common-utils": "1.0.4-next.1",
45
- "@haus-storefront-react/core": "1.0.4-next.1",
46
- "@haus-storefront-react/shared-types": "1.0.4-next.1"
68
+ "@haus-storefront-react/common-utils": "1.0.4-next.10",
69
+ "@haus-storefront-react/core": "1.0.4-next.10",
70
+ "@haus-storefront-react/providers": "1.0.4-next.10",
71
+ "@haus-storefront-react/quick-order": "1.0.0-next.4",
72
+ "@haus-storefront-react/shared-types": "1.0.4-next.10",
73
+ "@haus-storefront-react/strategies": "1.0.4-next.10"
47
74
  },
48
75
  "publishConfig": {
49
76
  "access": "restricted"
package/packagesize.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CgxqXyHf.js"),e=new a.VendurePluginConfig({name:"packageSize",enableFeatures:{},queryUpdates:{}});e.setQueryUpdates({activeOrder:{fields:[{lines:[{productVariant:["packageSize"]}]}]},orderByCode:{fields:[{lines:[{productVariant:["packageSize"]}]}]},product:{fields:[{variants:["packageSize"]}]},briefProducts:{fields:[{items:[{variants:["packageSize"]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:["packageSize"]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:["packageSize"]}]}]}]}});exports.VendurePackageSizePlugin=e;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new(require(`./plugin-config-DrQQb9Ry.js`)).t({name:`packageSize`,enableFeatures:{},queryUpdates:{}});e.setQueryUpdates({activeOrder:{fields:[{lines:[{productVariant:[`packageSize`]}]}]},orderByCode:{fields:[{lines:[{productVariant:[`packageSize`]}]}]},product:{fields:[{variants:[`packageSize`]}]},briefProducts:{fields:[{items:[{variants:[`packageSize`]}]}]},adjustOrderLine:{fields:[{fields:[{lines:[{productVariant:[`packageSize`]}]}]}]},addItemToOrder:{fields:[{fields:[{lines:[{productVariant:[`packageSize`]}]}]}]}}),exports.VendurePackageSizePlugin=e;