@haus-storefront-react/vendure-plugin-configs 1.0.4-next.2 → 1.0.4-next.4
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 +17 -0
- package/badge.js +1 -21
- package/badge.mjs +244 -2868
- package/campaign.js +1 -1
- package/campaign.mjs +1 -1
- package/compiler-runtime-oPPev21o.js +10 -0
- package/{index-BCrKAB0K.mjs → compiler-runtime-qHgugrLy.mjs} +100 -115
- package/index-BgBC_k8M.js +1 -0
- package/index-C0E-40z0.mjs +19 -0
- package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +14 -0
- package/lib/configs/vendure-purchase-order-payment-plugin.types.d.ts +7 -0
- package/lib/exports/purchase-order-payment.d.ts +3 -0
- package/lib/hooks/use-add-purchase-order-payment.d.ts +13 -0
- package/lib/types.d.ts +1 -0
- package/package.json +11 -4
- package/purchase-order-payment.d.ts +2 -0
- package/purchase-order-payment.js +27 -0
- package/purchase-order-payment.mjs +633 -0
- package/useSdk-DOrZRSHz.mjs +2634 -0
- package/useSdk-YXpk8Wsi.js +21 -0
- 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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CgxqXyHf.js"),e=require("./index-BgBC_k8M.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;
|
package/campaign.mjs
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";const g=require("react");var v={exports:{}},d={};var L;function ue(){if(L)return d;L=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(f,u,s){var m=null;if(s!==void 0&&(m=""+s),u.key!==void 0&&(m=""+u.key),"key"in u){s={};for(var _ in u)_!=="key"&&(s[_]=u[_])}else s=u;return u=s.ref,{$$typeof:a,type:f,key:m,ref:u!==void 0?u:null,props:s}}return d.Fragment=i,d.jsx=l,d.jsxs=l,d}var R={};var q;function se(){return q||(q=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case X:return"Profiler";case z:return"StrictMode";case K:return"Suspense";case ee:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case J:return"Portal";case Z:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case Q:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case re:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case h:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function i(e){return""+e}function l(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),i(e)}}function f(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===h)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=O.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function m(e){if(j.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function _(e,r){function t(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=a(this.type);return I[e]||(I[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function H(e,r,t,n,E,S){var o=t.ref;return e={$$typeof:C,type:e,key:r,props:t,_owner:n},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:E}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,r,t,n,E,S){var o=r.children;if(o!==void 0)if(n)if(oe(o)){for(n=0;n<o.length;n++)y(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(o);if(j.call(r,"key")){o=a(e);var c=Object.keys(r).filter(function(ae){return ae!=="key"});n=0<c.length?"{key: someKey, "+c.join(": ..., ")+": ...}":"{key: someKey}",$[o+n]||(c=0<c.length?"{"+c.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,n,o,c,o),$[o+n]=!0)}if(o=null,t!==void 0&&(l(t),o=""+t),m(r)&&(l(r.key),o=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return o&&_(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),H(e,o,t,u(),E,S)}function y(e){w(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===h&&(e._payload.status==="fulfilled"?w(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function w(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}var p=g,C=Symbol.for("react.transitional.element"),J=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),O=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,oe=Array.isArray,k=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(e){return e()}};var Y,I={},D=p.react_stack_bottom_frame.bind(p,s)(),U=k(f(s)),$={};R.Fragment=T,R.jsx=function(e,r,t){var n=1e4>O.recentlyCreatedOwnerStacks++;return P(e,r,t,!1,n?Error("react-stack-top-frame"):D,n?k(f(e)):U)},R.jsxs=function(e,r,t){var n=1e4>O.recentlyCreatedOwnerStacks++;return P(e,r,t,!0,n?Error("react-stack-top-frame"):D,n?k(f(e)):U)}})()),R}var F;function ie(){return F||(F=1,process.env.NODE_ENV==="production"?v.exports=ue():v.exports=se()),v.exports}var le=ie(),b={exports:{}},N={};var M;function ce(){if(M)return N;M=1;var a=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return N.c=function(i){return a.H.useMemoCache(i)},N}var x={};var W;function fe(){return W||(W=1,process.env.NODE_ENV!=="production"&&(function(){var a=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;x.c=function(i){var l=a.H;return l===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
7
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
8
|
+
2. You might be breaking the Rules of Hooks
|
|
9
|
+
3. You might have more than one copy of React in the same app
|
|
10
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),l.useMemoCache(i)}})()),x}var V;function me(){return V||(V=1,process.env.NODE_ENV==="production"?b.exports=ce():b.exports=fe()),b.exports}var _e=me();exports.compilerRuntimeExports=_e;exports.jsxRuntimeExports=le;
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import "./index-BRlTlK6a.mjs";
|
|
2
1
|
import g from "react";
|
|
3
2
|
var v = { exports: {} }, d = {};
|
|
4
|
-
var
|
|
3
|
+
var $;
|
|
5
4
|
function ue() {
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
function
|
|
5
|
+
if ($) return d;
|
|
6
|
+
$ = 1;
|
|
7
|
+
var a = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function l(f, u, s) {
|
|
10
9
|
var m = null;
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
for (var _ in
|
|
14
|
-
_ !== "key" && (
|
|
15
|
-
} else
|
|
16
|
-
return
|
|
17
|
-
$$typeof:
|
|
18
|
-
type:
|
|
10
|
+
if (s !== void 0 && (m = "" + s), u.key !== void 0 && (m = "" + u.key), "key" in u) {
|
|
11
|
+
s = {};
|
|
12
|
+
for (var _ in u)
|
|
13
|
+
_ !== "key" && (s[_] = u[_]);
|
|
14
|
+
} else s = u;
|
|
15
|
+
return u = s.ref, {
|
|
16
|
+
$$typeof: a,
|
|
17
|
+
type: f,
|
|
19
18
|
key: m,
|
|
20
|
-
ref:
|
|
21
|
-
props:
|
|
19
|
+
ref: u !== void 0 ? u : null,
|
|
20
|
+
props: s
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
|
-
return d.Fragment =
|
|
23
|
+
return d.Fragment = i, d.jsx = l, d.jsxs = l, d;
|
|
25
24
|
}
|
|
26
25
|
var R = {};
|
|
27
|
-
var
|
|
26
|
+
var F;
|
|
28
27
|
function se() {
|
|
29
|
-
return
|
|
30
|
-
function
|
|
28
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function a(e) {
|
|
31
30
|
if (e == null) return null;
|
|
32
31
|
if (typeof e == "function")
|
|
33
32
|
return e.$$typeof === ne ? null : e.displayName || e.name || null;
|
|
@@ -37,7 +36,7 @@ function se() {
|
|
|
37
36
|
return "Fragment";
|
|
38
37
|
case X:
|
|
39
38
|
return "Profiler";
|
|
40
|
-
case
|
|
39
|
+
case z:
|
|
41
40
|
return "StrictMode";
|
|
42
41
|
case K:
|
|
43
42
|
return "Suspense";
|
|
@@ -50,7 +49,7 @@ function se() {
|
|
|
50
49
|
switch (typeof e.tag == "number" && console.error(
|
|
51
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
51
|
), e.$$typeof) {
|
|
53
|
-
case
|
|
52
|
+
case J:
|
|
54
53
|
return "Portal";
|
|
55
54
|
case Z:
|
|
56
55
|
return e.displayName || "Context";
|
|
@@ -60,52 +59,52 @@ function se() {
|
|
|
60
59
|
var r = e.render;
|
|
61
60
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
61
|
case re:
|
|
63
|
-
return r = e.displayName || null, r !== null ? r :
|
|
62
|
+
return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
|
|
64
63
|
case h:
|
|
65
64
|
r = e._payload, e = e._init;
|
|
66
65
|
try {
|
|
67
|
-
return
|
|
66
|
+
return a(e(r));
|
|
68
67
|
} catch {
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
return null;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
72
|
+
function i(e) {
|
|
74
73
|
return "" + e;
|
|
75
74
|
}
|
|
76
|
-
function
|
|
75
|
+
function l(e) {
|
|
77
76
|
try {
|
|
78
|
-
|
|
77
|
+
i(e);
|
|
79
78
|
var r = !1;
|
|
80
79
|
} catch {
|
|
81
80
|
r = !0;
|
|
82
81
|
}
|
|
83
82
|
if (r) {
|
|
84
83
|
r = console;
|
|
85
|
-
var
|
|
86
|
-
return
|
|
84
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return t.call(
|
|
87
86
|
r,
|
|
88
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
90
|
-
),
|
|
88
|
+
n
|
|
89
|
+
), i(e);
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
|
-
function
|
|
92
|
+
function f(e) {
|
|
94
93
|
if (e === T) return "<>";
|
|
95
94
|
if (typeof e == "object" && e !== null && e.$$typeof === h)
|
|
96
95
|
return "<...>";
|
|
97
96
|
try {
|
|
98
|
-
var r =
|
|
97
|
+
var r = a(e);
|
|
99
98
|
return r ? "<" + r + ">" : "<...>";
|
|
100
99
|
} catch {
|
|
101
100
|
return "<...>";
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
function
|
|
103
|
+
function u() {
|
|
105
104
|
var e = O.A;
|
|
106
105
|
return e === null ? null : e.getOwner();
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function s() {
|
|
109
108
|
return Error("react-stack-top-frame");
|
|
110
109
|
}
|
|
111
110
|
function m(e) {
|
|
@@ -116,34 +115,34 @@ function se() {
|
|
|
116
115
|
return e.key !== void 0;
|
|
117
116
|
}
|
|
118
117
|
function _(e, r) {
|
|
119
|
-
function
|
|
118
|
+
function t() {
|
|
120
119
|
Y || (Y = !0, console.error(
|
|
121
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
121
|
r
|
|
123
122
|
));
|
|
124
123
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
124
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: t,
|
|
127
126
|
configurable: !0
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
|
-
function
|
|
131
|
-
var e =
|
|
129
|
+
function G() {
|
|
130
|
+
var e = a(this.type);
|
|
132
131
|
return I[e] || (I[e] = !0, console.error(
|
|
133
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
134
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
135
|
+
function H(e, r, t, n, E, S) {
|
|
136
|
+
var o = t.ref;
|
|
138
137
|
return e = {
|
|
139
138
|
$$typeof: C,
|
|
140
139
|
type: e,
|
|
141
140
|
key: r,
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
141
|
+
props: t,
|
|
142
|
+
_owner: n
|
|
143
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
144
|
enumerable: !1,
|
|
146
|
-
get:
|
|
145
|
+
get: G
|
|
147
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
147
|
configurable: !1,
|
|
149
148
|
enumerable: !1,
|
|
@@ -166,50 +165,50 @@ function se() {
|
|
|
166
165
|
value: S
|
|
167
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
167
|
}
|
|
169
|
-
function P(e, r,
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (oe(
|
|
174
|
-
for (
|
|
175
|
-
y(
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function P(e, r, t, n, E, S) {
|
|
169
|
+
var o = r.children;
|
|
170
|
+
if (o !== void 0)
|
|
171
|
+
if (n)
|
|
172
|
+
if (oe(o)) {
|
|
173
|
+
for (n = 0; n < o.length; n++)
|
|
174
|
+
y(o[n]);
|
|
175
|
+
Object.freeze && Object.freeze(o);
|
|
177
176
|
} else
|
|
178
177
|
console.error(
|
|
179
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
179
|
);
|
|
181
|
-
else y(
|
|
180
|
+
else y(o);
|
|
182
181
|
if (j.call(r, "key")) {
|
|
183
|
-
|
|
184
|
-
var
|
|
182
|
+
o = a(e);
|
|
183
|
+
var c = Object.keys(r).filter(function(ae) {
|
|
185
184
|
return ae !== "key";
|
|
186
185
|
});
|
|
187
|
-
|
|
186
|
+
n = 0 < c.length ? "{key: someKey, " + c.join(": ..., ") + ": ...}" : "{key: someKey}", L[o + n] || (c = 0 < c.length ? "{" + c.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
188
|
let props = %s;
|
|
190
189
|
<%s {...props} />
|
|
191
190
|
React keys must be passed directly to JSX without using spread:
|
|
192
191
|
let props = %s;
|
|
193
192
|
<%s key={someKey} {...props} />`,
|
|
193
|
+
n,
|
|
194
194
|
o,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
), U[a + o] = !0);
|
|
195
|
+
c,
|
|
196
|
+
o
|
|
197
|
+
), L[o + n] = !0);
|
|
199
198
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
199
|
+
if (o = null, t !== void 0 && (l(t), o = "" + t), m(r) && (l(r.key), o = "" + r.key), "key" in r) {
|
|
200
|
+
t = {};
|
|
202
201
|
for (var A in r)
|
|
203
|
-
A !== "key" && (
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
202
|
+
A !== "key" && (t[A] = r[A]);
|
|
203
|
+
} else t = r;
|
|
204
|
+
return o && _(
|
|
205
|
+
t,
|
|
207
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
-
),
|
|
207
|
+
), H(
|
|
209
208
|
e,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
o,
|
|
210
|
+
t,
|
|
211
|
+
u(),
|
|
213
212
|
E,
|
|
214
213
|
S
|
|
215
214
|
);
|
|
@@ -220,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
219
|
function w(e) {
|
|
221
220
|
return typeof e == "object" && e !== null && e.$$typeof === C;
|
|
222
221
|
}
|
|
223
|
-
var p = g, C = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
222
|
+
var p = g, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), J = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), X = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), ee = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), O = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, oe = Array.isArray, k = console.createTask ? console.createTask : function() {
|
|
224
223
|
return null;
|
|
225
224
|
};
|
|
226
225
|
p = {
|
|
@@ -230,82 +229,68 @@ React keys must be passed directly to JSX without using spread:
|
|
|
230
229
|
};
|
|
231
230
|
var Y, I = {}, D = p.react_stack_bottom_frame.bind(
|
|
232
231
|
p,
|
|
233
|
-
|
|
234
|
-
)(),
|
|
235
|
-
R.Fragment = T, R.jsx = function(e, r,
|
|
236
|
-
var
|
|
232
|
+
s
|
|
233
|
+
)(), U = k(f(s)), L = {};
|
|
234
|
+
R.Fragment = T, R.jsx = function(e, r, t) {
|
|
235
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
237
236
|
return P(
|
|
238
237
|
e,
|
|
239
238
|
r,
|
|
240
|
-
|
|
239
|
+
t,
|
|
241
240
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
n ? Error("react-stack-top-frame") : D,
|
|
242
|
+
n ? k(f(e)) : U
|
|
244
243
|
);
|
|
245
|
-
}, R.jsxs = function(e, r,
|
|
246
|
-
var
|
|
244
|
+
}, R.jsxs = function(e, r, t) {
|
|
245
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
247
246
|
return P(
|
|
248
247
|
e,
|
|
249
248
|
r,
|
|
250
|
-
|
|
249
|
+
t,
|
|
251
250
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
n ? Error("react-stack-top-frame") : D,
|
|
252
|
+
n ? k(f(e)) : U
|
|
254
253
|
);
|
|
255
254
|
};
|
|
256
255
|
})()), R;
|
|
257
256
|
}
|
|
258
|
-
var
|
|
257
|
+
var M;
|
|
259
258
|
function ie() {
|
|
260
|
-
return
|
|
259
|
+
return M || (M = 1, process.env.NODE_ENV === "production" ? v.exports = ue() : v.exports = se()), v.exports;
|
|
261
260
|
}
|
|
262
|
-
var
|
|
261
|
+
var _e = ie(), b = { exports: {} }, N = {};
|
|
263
262
|
var q;
|
|
264
263
|
function le() {
|
|
265
264
|
if (q) return N;
|
|
266
265
|
q = 1;
|
|
267
|
-
var
|
|
268
|
-
return N.c = function(
|
|
269
|
-
return
|
|
266
|
+
var a = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
267
|
+
return N.c = function(i) {
|
|
268
|
+
return a.H.useMemoCache(i);
|
|
270
269
|
}, N;
|
|
271
270
|
}
|
|
272
271
|
var x = {};
|
|
273
272
|
var W;
|
|
274
273
|
function ce() {
|
|
275
274
|
return W || (W = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
276
|
-
var
|
|
277
|
-
x.c = function(
|
|
278
|
-
var
|
|
279
|
-
return
|
|
275
|
+
var a = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
276
|
+
x.c = function(i) {
|
|
277
|
+
var l = a.H;
|
|
278
|
+
return l === null && console.error(
|
|
280
279
|
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
281
280
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
282
281
|
2. You might be breaking the Rules of Hooks
|
|
283
282
|
3. You might have more than one copy of React in the same app
|
|
284
283
|
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
285
|
-
),
|
|
284
|
+
), l.useMemoCache(i);
|
|
286
285
|
};
|
|
287
286
|
})()), x;
|
|
288
287
|
}
|
|
289
|
-
var
|
|
288
|
+
var V;
|
|
290
289
|
function fe() {
|
|
291
|
-
return
|
|
290
|
+
return V || (V = 1, process.env.NODE_ENV === "production" ? b.exports = le() : b.exports = ce()), b.exports;
|
|
292
291
|
}
|
|
293
|
-
var
|
|
294
|
-
const me = (t) => t == null ? 0 : typeof t == "number" ? t : "value" in t ? t.value : "min" in t ? t.min : 0, Ee = (t) => {
|
|
295
|
-
const u = t.map((i) => me(i.price)), s = Math.min(...u), c = Math.max(...u);
|
|
296
|
-
return s === void 0 || c === void 0 ? {
|
|
297
|
-
value: 0
|
|
298
|
-
} : s === c ? {
|
|
299
|
-
value: s
|
|
300
|
-
} : {
|
|
301
|
-
min: s,
|
|
302
|
-
max: c
|
|
303
|
-
};
|
|
304
|
-
}, ve = (t, u) => typeof t == "function" ? t(u) : t;
|
|
292
|
+
var de = fe();
|
|
305
293
|
export {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
me as g,
|
|
309
|
-
Re as j,
|
|
310
|
-
ve as r
|
|
294
|
+
de as c,
|
|
295
|
+
_e as j
|
|
311
296
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("./index-CgxqXyHf.js");require("./compiler-runtime-oPPev21o.js");require("react");const i=r=>r==null?0:typeof r=="number"?r:"value"in r?r.value:"min"in r?r.min:0,o=r=>{const t=r.map(u=>i(u.price)),n=Math.min(...t),e=Math.max(...t);return n===void 0||e===void 0?{value:0}:n===e?{value:n}:{min:n,max:e}},s=(r,t)=>typeof r=="function"?r(t):r;exports.getPrice=i;exports.getProductPriceFromVariants=o;exports.renderChildren=s;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./index-BRlTlK6a.mjs";
|
|
2
|
+
import "./compiler-runtime-qHgugrLy.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
const e = (t) => t == null ? 0 : typeof t == "number" ? t : "value" in t ? t.value : "min" in t ? t.min : 0, f = (t) => {
|
|
5
|
+
const r = t.map((o) => e(o.price)), n = Math.min(...r), i = Math.max(...r);
|
|
6
|
+
return n === void 0 || i === void 0 ? {
|
|
7
|
+
value: 0
|
|
8
|
+
} : n === i ? {
|
|
9
|
+
value: n
|
|
10
|
+
} : {
|
|
11
|
+
min: n,
|
|
12
|
+
max: i
|
|
13
|
+
};
|
|
14
|
+
}, a = (t, r) => typeof t == "function" ? t(r) : t;
|
|
15
|
+
export {
|
|
16
|
+
f as a,
|
|
17
|
+
e as g,
|
|
18
|
+
a as r
|
|
19
|
+
};
|
|
@@ -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 IEcomSDK {
|
|
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('@haus-storefront-react/shared-types').IGraphQLSDK>;
|
|
@@ -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,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 {};
|
package/lib/types.d.ts
CHANGED
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.4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -33,6 +33,12 @@
|
|
|
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",
|
|
@@ -41,9 +47,10 @@
|
|
|
41
47
|
}
|
|
42
48
|
},
|
|
43
49
|
"dependencies": {
|
|
44
|
-
"@haus-storefront-react/common-utils": "1.0.4-next.
|
|
45
|
-
"@haus-storefront-react/core": "1.0.4-next.
|
|
46
|
-
"@haus-storefront-react/
|
|
50
|
+
"@haus-storefront-react/common-utils": "1.0.4-next.4",
|
|
51
|
+
"@haus-storefront-react/core": "1.0.4-next.4",
|
|
52
|
+
"@haus-storefront-react/providers": "1.0.4-next.4",
|
|
53
|
+
"@haus-storefront-react/shared-types": "1.0.4-next.4"
|
|
47
54
|
},
|
|
48
55
|
"publishConfig": {
|
|
49
56
|
"access": "restricted"
|
|
@@ -0,0 +1,27 @@
|
|
|
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(`
|
|
2
|
+
mutation transitionOrderToState($input: String!) {
|
|
3
|
+
transitionOrderToState(state: $input) {
|
|
4
|
+
... on ErrorResult {
|
|
5
|
+
errorCode
|
|
6
|
+
message
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`);m(`
|
|
11
|
+
query nextOrderStates {
|
|
12
|
+
nextOrderStates
|
|
13
|
+
}
|
|
14
|
+
`);m(`
|
|
15
|
+
fragment EligiblePaymentMethods on PaymentMethodQuote {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
description
|
|
19
|
+
code
|
|
20
|
+
}
|
|
21
|
+
`);m(`
|
|
22
|
+
query EligiblePaymentMethods {
|
|
23
|
+
eligiblePaymentMethods {
|
|
24
|
+
...EligiblePaymentMethods
|
|
25
|
+
}
|
|
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;
|