@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.
Files changed (43) hide show
  1. package/CHANGELOG.md +824 -793
  2. package/badge.js +1 -1
  3. package/badge.mjs +439 -424
  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 +2 -2
  11. package/lib/configs/vendure-related-products-plugin.d.ts +39 -0
  12. package/lib/configs/vendure-related-products-plugin.types.d.ts +16 -0
  13. package/lib/exports/related-products.d.ts +3 -0
  14. package/lib/hooks/use-related-products.d.ts +2 -0
  15. package/package.json +13 -7
  16. package/packagesize.js +1 -1
  17. package/packagesize.mjs +15 -59
  18. package/plugin-config-DrQQb9Ry.js +1 -0
  19. package/plugin-config-DywohMgp.mjs +903 -0
  20. package/product-popularity.js +1 -1
  21. package/product-popularity.mjs +12 -22
  22. package/product-variant-specifications.js +1 -1
  23. package/product-variant-specifications.mjs +8 -18
  24. package/products-by-sku.d.ts +2 -0
  25. package/products-by-sku.js +1 -0
  26. package/products-by-sku.mjs +54 -0
  27. package/purchase-order-payment.js +5 -5
  28. package/purchase-order-payment.mjs +207 -631
  29. package/related-products.d.ts +2 -0
  30. package/related-products.js +1 -0
  31. package/related-products.mjs +36 -0
  32. package/src-BCHcjT-q.mjs +455 -0
  33. package/src-BqcrcEUL.mjs +2718 -0
  34. package/src-Cj3iGasO.js +6 -0
  35. package/src-CvZOxNaX.js +21 -0
  36. package/compiler-runtime-oPPev21o.js +0 -10
  37. package/compiler-runtime-qHgugrLy.mjs +0 -296
  38. package/index-BRlTlK6a.mjs +0 -3768
  39. package/index-BgBC_k8M.js +0 -1
  40. package/index-C0E-40z0.mjs +0 -19
  41. package/index-CgxqXyHf.js +0 -20
  42. package/useSdk-DOrZRSHz.mjs +0 -2634
  43. package/useSdk-YXpk8Wsi.js +0 -21
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CgxqXyHf.js"),e=new r.VendurePluginConfig({name:"productPopularity",enableFeatures:{},queryUpdates:{}});e.setQueryUpdates({product:{fields:["popularity"]},search:{fields:[{items:["popularity"]}]},searchField:{fields:[{items:["popularity"]}]}});exports.VendureProductPopularityPlugin=e;
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;
@@ -1,24 +1,14 @@
1
- import { V as e } from "./index-BRlTlK6a.mjs";
2
- const r = new e({
3
- name: "productPopularity",
4
- enableFeatures: {},
5
- queryUpdates: {}
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
- r.setQueryUpdates({
8
- product: {
9
- fields: ["popularity"]
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
- export {
23
- r as VendureProductPopularityPlugin
24
- };
13
+ //#endregion
14
+ export { t as VendureProductPopularityPlugin };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CgxqXyHf.js"),e=new i.VendurePluginConfig({name:"productVariantSpecifications",queryUpdates:{}});e.setQueryUpdates({product:{fields:[{variants:[{customFields:[{specifications:["key","value"]}]}]}]}});exports.VendureProductVariantSpecificationsPlugin=e;
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 { V as e } from "./index-BRlTlK6a.mjs";
2
- const i = new e({
3
- name: "productVariantSpecifications",
4
- queryUpdates: {}
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
- i.setQueryUpdates({
7
- product: {
8
- fields: [{
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,2 @@
1
+ export * from './lib/exports/products-by-sku'
2
+ export {}
@@ -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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./useSdk-YXpk8Wsi.js"),S=require("./index-CgxqXyHf.js"),T=require("./compiler-runtime-oPPev21o.js");require("react");const k=require("@tanstack/react-query");var p=(e=>(e.ACTIVE_ORDER="activeOrder",e.ACTIVE_CHANNEL="activeChannel",e.ACTIVE_CUSTOMER="activeCustomer",e.ACTIVE_CUSTOMER_ORDERS="activeCustomerOrders",e.AVAILABLE_COUNTRIES="availableCountries",e.FACETS="facets",e.ORDER_BY_CODE="orderByCode",e.ORDER_STATES="orderStates",e.PRODUCT="product",e.PAYMENT_METHODS="paymentMethods",e.SEARCH="search",e.SEARCH_FIELD="searchField",e.SHIPPING_METHODS="shippingMethods",e))(p||{}),N=(e=>(e.AlreadyLoggedInError="ALREADY_LOGGED_IN_ERROR",e.CouponCodeExpiredError="COUPON_CODE_EXPIRED_ERROR",e.CouponCodeInvalidError="COUPON_CODE_INVALID_ERROR",e.CouponCodeLimitError="COUPON_CODE_LIMIT_ERROR",e.EmailAddressConflictError="EMAIL_ADDRESS_CONFLICT_ERROR",e.GuestCheckoutError="GUEST_CHECKOUT_ERROR",e.IdentifierChangeTokenExpiredError="IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR",e.IdentifierChangeTokenInvalidError="IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR",e.IneligiblePaymentMethodError="INELIGIBLE_PAYMENT_METHOD_ERROR",e.IneligibleShippingMethodError="INELIGIBLE_SHIPPING_METHOD_ERROR",e.InsufficientStockError="INSUFFICIENT_STOCK_ERROR",e.InvalidCredentialsError="INVALID_CREDENTIALS_ERROR",e.MissingPasswordError="MISSING_PASSWORD_ERROR",e.NativeAuthStrategyError="NATIVE_AUTH_STRATEGY_ERROR",e.NegativeQuantityError="NEGATIVE_QUANTITY_ERROR",e.NotVerifiedError="NOT_VERIFIED_ERROR",e.NoActiveOrderError="NO_ACTIVE_ORDER_ERROR",e.OrderLimitError="ORDER_LIMIT_ERROR",e.OrderModificationError="ORDER_MODIFICATION_ERROR",e.OrderPaymentStateError="ORDER_PAYMENT_STATE_ERROR",e.OrderStateTransitionError="ORDER_STATE_TRANSITION_ERROR",e.PasswordAlreadySetError="PASSWORD_ALREADY_SET_ERROR",e.PasswordResetTokenExpiredError="PASSWORD_RESET_TOKEN_EXPIRED_ERROR",e.PasswordResetTokenInvalidError="PASSWORD_RESET_TOKEN_INVALID_ERROR",e.PasswordValidationError="PASSWORD_VALIDATION_ERROR",e.PaymentDeclinedError="PAYMENT_DECLINED_ERROR",e.PaymentFailedError="PAYMENT_FAILED_ERROR",e.UnknownError="UNKNOWN_ERROR",e.VerificationTokenExpiredError="VERIFICATION_TOKEN_EXPIRED_ERROR",e.VerificationTokenInvalidError="VERIFICATION_TOKEN_INVALID_ERROR",e))(N||{});const _=(e,i)=>{const d=k.useQueryClient();return k.useMutation(e,d)},g={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"EligiblePaymentMethods"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaymentMethodQuote"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"code"}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"login"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"password"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"rememberMe"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"},arguments:[{kind:"Argument",name:{kind:"Name",value:"username"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}},{kind:"Argument",name:{kind:"Name",value:"password"},value:{kind:"Variable",name:{kind:"Name",value:"password"}}},{kind:"Argument",name:{kind:"Name",value:"rememberMe"},value:{kind:"Variable",name:{kind:"Name",value:"rememberMe"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrentUser"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"identifier"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorResult"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"logout"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logout"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}}]}}]}}]},v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"transitionOrderToState"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transitionOrderToState"},arguments:[{kind:"Argument",name:{kind:"Name",value:"state"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorResult"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"nextOrderStates"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nextOrderStates"}}]}}]},A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"EligiblePaymentMethods"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"eligiblePaymentMethods"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"EligiblePaymentMethods"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"EligiblePaymentMethods"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaymentMethodQuote"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"code"}}]}}]},h={"\n mutation login($email: String!, $password: String!, $rememberMe: Boolean) {\n login(username: $email, password: $password, rememberMe: $rememberMe) {\n __typename\n ... on CurrentUser {\n id\n identifier\n }\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n":P,"\n mutation logout {\n logout {\n success\n }\n }\n":I,"\n query me {\n me {\n id\n }\n }\n":v,"\n mutation transitionOrderToState($input: String!) {\n transitionOrderToState(state: $input) {\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n":y,"\n query nextOrderStates {\n nextOrderStates\n }\n":D,"\n fragment EligiblePaymentMethods on PaymentMethodQuote {\n id\n name\n description\n code\n }\n":g,"\n query EligiblePaymentMethods {\n eligiblePaymentMethods {\n ...EligiblePaymentMethods\n }\n }\n":A};function m(e){return h[e]??{}}const f=["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"]}];m(`
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
- `);m(`
10
+ `),n.t(`
11
11
  query nextOrderStates {
12
12
  nextOrderStates
13
13
  }
14
- `);m(`
14
+ `),n.t(`
15
15
  fragment EligiblePaymentMethods on PaymentMethodQuote {
16
16
  id
17
17
  name
18
18
  description
19
19
  code
20
20
  }
21
- `);m(`
21
+ `),n.t(`
22
22
  query EligiblePaymentMethods {
23
23
  eligiblePaymentMethods {
24
24
  ...EligiblePaymentMethods
25
25
  }
26
26
  }
27
- `);const E=new S.VendurePluginConfig({name:"purchase-order-payment",queryUpdates:{}});E.setRequests({addPurchaseOrderPaymentToOrder:async e=>{try{return(await E.getSdk().createRequest({operation:"addPurchaseOrderPaymentToOrder",fields:[{operation:"Order",fields:f,fragment:!0},{operation:"ErrorResult",fields:["errorCode","message"],fragment:!0}],variables:{input:{type:"AddPurchaseOrderPaymentToOrderInput!"}}},{input:e},!0)).data}catch(i){return{errorCode:N.UnknownError,message:i instanceof Error?i.message:"Unknown payment error"}}}});const b=()=>{const e=T.compilerRuntimeExports.c(17),i=O.useSdk(),d=k.useQueryClient();let t;e[0]!==i?(t=async r=>{const R=i.addPurchaseOrderPaymentToOrder;if(typeof R!="function")throw new Error("addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.");return R(r)},e[0]=i,e[1]=t):t=e[1];let a;e[2]!==d?(a=r=>{r&&!("errorCode"in r)&&d.invalidateQueries({queryKey:[p.ACTIVE_ORDER]})},e[2]=d,e[3]=a):a=e[3];let o;e[4]!==t||e[5]!==a?(o={mutationFn:t,onSuccess:a},e[4]=t,e[5]=a,e[6]=o):o=e[6];const n=_(o);let s;e[7]!==n?(s=async r=>n.mutateAsync(r),e[7]=n,e[8]=s):s=e[8];const u=s,c=n.error;let l;return e[9]!==u||e[10]!==n.data||e[11]!==n.isError||e[12]!==n.isPending||e[13]!==n.isSuccess||e[14]!==n.reset||e[15]!==c?(l={addPurchaseOrderPayment:u,error:c,isLoading:n.isPending,isError:n.isError,isSuccess:n.isSuccess,data:n.data,reset:n.reset},e[9]=u,e[10]=n.data,e[11]=n.isError,e[12]=n.isPending,e[13]=n.isSuccess,e[14]=n.reset,e[15]=c,e[16]=l):l=e[16],l};exports.VendurePurchaseOrderPaymentPlugin=E;exports.useAddPurchaseOrderPayment=b;
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;