@shipengine/react-api 3.8.3 → 3.10.0
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/hooks/index.d.ts +1 -0
- package/hooks/invoice-address/index.d.ts +3 -0
- package/hooks/invoice-address/use-create-invoice-address.d.ts +7 -0
- package/hooks/invoice-address/use-get-invoice-address.d.ts +7 -0
- package/hooks/invoice-address/use-update-invoice-address.d.ts +7 -0
- package/hooks/sales-orders/index.d.ts +1 -0
- package/hooks/sales-orders/use-get-sales-order-by-external-order-id.d.ts +8 -0
- package/hooks/sales-orders/use-get-sales-order.d.ts +3 -1
- package/hooks/sales-orders-shipment/index.d.ts +1 -0
- package/hooks/sales-orders-shipment/use-list-sales-order-shipments-by-external-order-id.d.ts +4 -0
- package/hooks/sales-orders-shipment/use-list-sales-order-shipments.d.ts +2 -2
- package/index.js +325 -158
- package/index.mjs +321 -159
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -76,25 +76,25 @@ const onError = (_errors) => _default();
|
|
|
76
76
|
|
|
77
77
|
var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){return "string"==typeof e?o[e.toLowerCase()]:e}function c(e,r){return c=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},c(e,r)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return !1}}function f(e,r,t){return f=u()?Reflect.construct:function(e,r,t){var s=[null];s.push.apply(s,r);var i=new(Function.bind.apply(e,s));return t&&c(i,t.prototype),i},f.apply(null,arguments)}function h(e){if(null==e)return e;if(Array.isArray(e))return e.slice();if("object"==typeof e){var r={};return Object.keys(e).forEach(function(t){r[t]=e[t];}),r}return e}function v(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"[ "+e.map(function(e){return v(e)}).join(", ")+" ]":"object"==typeof e?JSON.stringify(e):"function"==typeof e?"[Function: "+e.name+"]":"boolean"==typeof e||"number"==typeof e?e:"'"+e.toString()+"'"}function p(e){if("string"!=typeof e){for(var r=new Array(arguments.length),t=0;t<arguments.length;t++)r[t]=v(arguments[t]);return r.join(" ")}for(var s=/%[sdj%]/g,i=1,n=arguments,o=n.length,l=String(e).replace(s,function(e){if("%%"===e)return "%";if(i>=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return "[Circular]"}default:return e}}),a=n[i];i<o;a=n[++i])l+=null===a||"object"!=typeof a?" "+a:" "+v(a);return l}function m(e,r){var t=e.split("\n");t[0]&&t[0].indexOf("call-stack-error")>=0&&t.shift();var s=t[r],i=null;if(s){var n=/^\s*(at|.*@)\s*(.+)?$/.exec(s);i=Array.isArray(n)&&n[2]?n[2]:s;}return i}Object.keys(o).forEach(function(e){l[o[e]]=e;});var y={};function d(e,r){if(r){if(y[r])return;y[r]=!0;}console.error(e+"\n");}function g(e){return y[e]}function w(){var e=[];return function(r,t){return t&&"object"==typeof t?-1!==e.indexOf(t)?"[Circular]":(e.push(t),t):t}}var b=/*#__PURE__*/function(){function e(){}return e.prototype.write=function(e){e.level<30?console.log(e):e.level<40?console.info(e):e.level<50?console.warn(e):console.error(e),e.err&&e.err.stack&&console.error(e.err.stack),e.obj&&console.log(e.obj);},e}(),j=/*#__PURE__*/function(){function e(r,t,s){var i,n,o,l,a=this;if(!(this instanceof e))return new e(r,t);if(void 0!==t&&(i=r,r=t,!(i instanceof e)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(i){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&("object"!=typeof r.serializers||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(i&&s){this._level=i._level,this.streams=i.streams,this.serializers=i.serializers,this.src=i.src,n=this.fields={};var c=Object.keys(i.fields);for(l=0;l<c.length;l++)n[o=c[l]]=i.fields[o];var u=Object.keys(r);for(l=0;l<u.length;l++)n[o=u[l]]=r[o];}else {if(i){for(this._level=i._level,this.streams=[],l=0;l<i.streams.length;l++){var f=h(i.streams[l]);this.streams.push(f);}this.serializers=h(i.serializers),this.src=i.src,this.fields=h(i.fields),r.level&&this.level(r.level);}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};r.stream?this.addStream({type:"stream",stream:r.stream,level:r.level}):r.streams?r.streams.forEach(function(e){a.addStream(e,r.level);}):i&&r.level?this.level(r.level):i||this.addStream({type:"raw",stream:new b,level:r.level}),r.serializers&&this.addSerializers(r.serializers),r.src&&(this.src=!0),delete(n=h(r)).stream,delete n.level,delete n.streams,delete n.serializers,delete n.src,this.serializers&&this._applySerializers(n),Object.keys(n).forEach(function(e){a.fields[e]=n[e];});}}var r=e.prototype;return r.addStream=function(e,r){void 0===r&&(r=30),(e=h(e)).type="raw",e.level=a(e.level||r),e.level<this._level&&(this._level=e.level),this.streams.push(e),delete this.haveNonRawStreams;},r.addSerializers=function(e){var r=this;this.serializers||(this.serializers={}),Object.keys(e).forEach(function(t){var s=e[t];if("function"!=typeof s)throw new TypeError(p('invalid serializer for "%s" field: must be a function',t));r.serializers[t]=s;});},r.child=function(e,r){return new this.constructor(this,e||{},r)},r.level=function(e){if(void 0===e)return this._level;for(var r=a(e),t=this.streams.length,s=0;s<t;s++)this.streams[s].level=r;this._level=r;},r.levels=function(e,r){if(void 0===e)return this.streams.map(function(e){return e.level});var t;if("number"==typeof e){if(void 0===(t=this.streams[e]))throw new Error("invalid stream index: "+e)}else {for(var s=this.streams.length,i=0;i<s;i++){var n=this.streams[i];if(n.name===e){t=n;break}}if(!t)throw new Error(p('no stream with name "%s"',e))}if(void 0===r)return t.level;var o=a(r);t.level=o,o<this._level&&(this._level=o);},r._applySerializers=function(e,r){var t=this;Object.keys(this.serializers).forEach(function(s){if(!(void 0===e[s]||r&&r[s]))try{e[s]=t.serializers[s](e[s]);}catch(r){d(p('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.\n%s',s,r.stack||r)),e[s]=p('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',s);}});},r._emit=function(e,r){var t,s;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}if(r||this.haveNonRawStreams)try{s=JSON.stringify(e,w())+"\n";}catch(r){var i=r.stack.split(/\n/g,2).join("\n");d('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+function(e,r){return r||(r=" "),r+e.split(/\r?\n/g).join("\n"+r)}(p("%s\n%s",e,r.stack)),i),s=p("(Exception in JSON.stringify(rec): %j. See stderr for details.)\n",r.message);}if(r)return s;var n=e.level;for(t=0;t<this.streams.length;t++){var o=this.streams[t];o.level<=n&&o.stream.write(e);}return s},e}();function z(e){return function(){var r=this;function t(t){var n;t[0]instanceof Error?(s={err:r.serializers&&r.serializers.err?r.serializers.err(t[0]):k.err(t[0])},n={err:!0},i=1===t.length?[s.err.message]:Array.prototype.slice.call(t,1)):"object"!=typeof t[0]&&null!==t[0]||Array.isArray(t[0])?(s=null,i=Array.prototype.slice.call(t)):(s=t[0],i=1===t.length&&s.err&&s.err instanceof Error?[s.err.message]:Array.prototype.slice.call(t,1));var o=h(r.fields);o.level=e;var a=s?h(s):null;if(a&&(r.serializers&&r._applySerializers(a,n),Object.keys(a).forEach(function(e){o[e]=a[e];})),o.levelName=l[e],o.msg=i.length?p.apply(r,i):"",o.time||(o.time=new Date),r.src&&!o.src)try{throw new Error("call-stack-error")}catch(e){var c=e.stack?m(e.stack,2):"";c||g("src")||d("Unable to determine src line info","src"),o.src=c||"";}return o.v=1,o}var s=null,i=arguments,n=null;if(0===arguments.length)return this._level<=e;this._level>e||(n=t(i),this._emit(n));}}function S(e){var r=e.stack||e.toString();if(e.cause&&"function"==typeof e.cause){var t=e.cause();t&&(r+="\nCaused by: "+S(t));}return r}j.prototype.trace=z(10),j.prototype.debug=z(20),j.prototype.info=z(30),j.prototype.warn=z(40),j.prototype.error=z(50),j.prototype.fatal=z(60);var k={err:function(e){return e&&e.stack?{message:e.message,name:e.name,stack:S(e),code:e.code,signal:e.signal}:e}};function E(){return f(j,[].slice.call(arguments))}var A={levels:{trace:"color: DeepPink",debug:"color: GoldenRod",info:"color: DarkTurquoise",warn:"color: Purple",error:"color: Crimson",fatal:"color: Black"},def:"color: DimGray",msg:"color: SteelBlue",src:"color: DimGray; font-style: italic; font-size: 0.9em"},R=/*#__PURE__*/function(){function e(e){var r=void 0===e?{}:e,t=r.logByLevel,s=r.css,i=void 0===s?A:s;this.logByLevel=void 0!==t&&t,this.css=i;}return e.prototype.write=function(e){var r,t,s=this.css.def,i=this.css.msg,n=this.css.src,o=e.childName?e.name+"/"+e.childName:e.name,a=l[e.level],c=(Array(6-a.length).join(" ")+a).toUpperCase();this.logByLevel?(10===e.level?a="debug":60===e.level&&(a="error"),t="function"==typeof console[a]?console[a]:console.log):t=console.log,r=e.level<20?this.css.levels.trace:e.level<30?this.css.levels.debug:e.level<40?this.css.levels.info:e.level<50?this.css.levels.warn:e.level<60?this.css.levels.error:this.css.levels.fatal;var u=function(e,r){return Array(r+1-(e+"").length).join("0")+e},f=[];f.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s "+(e.src?"%c%s":"")),f.push(u(e.time.getHours(),2)),f.push(u(e.time.getMinutes(),2)),f.push(u(e.time.getSeconds(),2)),f.push(u(e.time.getMilliseconds(),4)),f.push(r),f.push(c),f.push(s),f.push(o),f.push(i),f.push(e.msg),e.src&&(f.push(n),f.push(e.src)),e.obj&&(f.push("\n"),f.push(e.obj)),e.err&&e.err.stack&&(f.push("\n"),f.push(e.err.stack)),t.apply(console,f);},e.getDefaultCss=function(){return A},e}();
|
|
78
78
|
|
|
79
|
-
var __defProp$
|
|
80
|
-
var __defProps$
|
|
81
|
-
var __getOwnPropDescs$
|
|
82
|
-
var __getOwnPropSymbols$
|
|
83
|
-
var __hasOwnProp$
|
|
84
|
-
var __propIsEnum$
|
|
85
|
-
var __defNormalProp$
|
|
86
|
-
var __spreadValues$
|
|
79
|
+
var __defProp$n = Object.defineProperty;
|
|
80
|
+
var __defProps$m = Object.defineProperties;
|
|
81
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
|
82
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
83
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
84
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
85
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
86
|
+
var __spreadValues$n = (a, b) => {
|
|
87
87
|
for (var prop in b || (b = {}))
|
|
88
|
-
if (__hasOwnProp$
|
|
89
|
-
__defNormalProp$
|
|
90
|
-
if (__getOwnPropSymbols$
|
|
91
|
-
for (var prop of __getOwnPropSymbols$
|
|
92
|
-
if (__propIsEnum$
|
|
93
|
-
__defNormalProp$
|
|
88
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
89
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
90
|
+
if (__getOwnPropSymbols$x)
|
|
91
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
92
|
+
if (__propIsEnum$x.call(b, prop))
|
|
93
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
94
94
|
}
|
|
95
95
|
return a;
|
|
96
96
|
};
|
|
97
|
-
var __spreadProps$
|
|
97
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
|
98
98
|
const streams = [];
|
|
99
99
|
if (process.env.NODE_ENV === "production") {
|
|
100
100
|
streams.push({
|
|
@@ -103,7 +103,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
103
103
|
}
|
|
104
104
|
const logger = E({
|
|
105
105
|
name: "shipengine",
|
|
106
|
-
serializers: __spreadProps$
|
|
106
|
+
serializers: __spreadProps$m(__spreadValues$n({}, k), {
|
|
107
107
|
req: (req) => ({
|
|
108
108
|
headers: req.headers,
|
|
109
109
|
method: req.method,
|
|
@@ -128,7 +128,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
|
|
|
128
128
|
throw error;
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
var __async$
|
|
131
|
+
var __async$O = (__this, __arguments, generator) => {
|
|
132
132
|
return new Promise((resolve, reject) => {
|
|
133
133
|
var fulfilled = (value) => {
|
|
134
134
|
try {
|
|
@@ -151,7 +151,7 @@ var __async$M = (__this, __arguments, generator) => {
|
|
|
151
151
|
const useCreateAccountImage = () => {
|
|
152
152
|
const { client } = useShipEngine();
|
|
153
153
|
return useMutation({
|
|
154
|
-
mutationFn: (data) => __async$
|
|
154
|
+
mutationFn: (data) => __async$O(void 0, null, function* () {
|
|
155
155
|
const result = yield client.accountSettings.createImage(data);
|
|
156
156
|
return result.data;
|
|
157
157
|
}),
|
|
@@ -160,7 +160,7 @@ const useCreateAccountImage = () => {
|
|
|
160
160
|
});
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
-
var __async$
|
|
163
|
+
var __async$N = (__this, __arguments, generator) => {
|
|
164
164
|
return new Promise((resolve, reject) => {
|
|
165
165
|
var fulfilled = (value) => {
|
|
166
166
|
try {
|
|
@@ -183,7 +183,7 @@ var __async$L = (__this, __arguments, generator) => {
|
|
|
183
183
|
const useDeleteAccountImage = () => {
|
|
184
184
|
const { client } = useShipEngine();
|
|
185
185
|
return useMutation({
|
|
186
|
-
mutationFn: (labelImageId) => __async$
|
|
186
|
+
mutationFn: (labelImageId) => __async$N(void 0, null, function* () {
|
|
187
187
|
const result = yield client.accountSettings.deleteImage(labelImageId);
|
|
188
188
|
return result.data;
|
|
189
189
|
}),
|
|
@@ -212,7 +212,7 @@ const useGetAccountSettings = () => {
|
|
|
212
212
|
});
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
-
var __async$
|
|
215
|
+
var __async$M = (__this, __arguments, generator) => {
|
|
216
216
|
return new Promise((resolve, reject) => {
|
|
217
217
|
var fulfilled = (value) => {
|
|
218
218
|
try {
|
|
@@ -235,7 +235,7 @@ var __async$K = (__this, __arguments, generator) => {
|
|
|
235
235
|
const useUpdateAccountImage = () => {
|
|
236
236
|
const { client } = useShipEngine();
|
|
237
237
|
return useMutation({
|
|
238
|
-
mutationFn: (data) => __async$
|
|
238
|
+
mutationFn: (data) => __async$M(void 0, null, function* () {
|
|
239
239
|
const result = yield client.accountSettings.updateImage(data);
|
|
240
240
|
return result.data;
|
|
241
241
|
}),
|
|
@@ -244,7 +244,7 @@ const useUpdateAccountImage = () => {
|
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
var __async$
|
|
247
|
+
var __async$L = (__this, __arguments, generator) => {
|
|
248
248
|
return new Promise((resolve, reject) => {
|
|
249
249
|
var fulfilled = (value) => {
|
|
250
250
|
try {
|
|
@@ -267,7 +267,7 @@ var __async$J = (__this, __arguments, generator) => {
|
|
|
267
267
|
const useUpdateAccountSettings = () => {
|
|
268
268
|
const { client } = useShipEngine();
|
|
269
269
|
return useMutation({
|
|
270
|
-
mutationFn: (settings) => __async$
|
|
270
|
+
mutationFn: (settings) => __async$L(void 0, null, function* () {
|
|
271
271
|
const result = yield client.accountSettings.update(settings);
|
|
272
272
|
return result.data;
|
|
273
273
|
}),
|
|
@@ -276,7 +276,7 @@ const useUpdateAccountSettings = () => {
|
|
|
276
276
|
});
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
-
var __async$
|
|
279
|
+
var __async$K = (__this, __arguments, generator) => {
|
|
280
280
|
return new Promise((resolve, reject) => {
|
|
281
281
|
var fulfilled = (value) => {
|
|
282
282
|
try {
|
|
@@ -299,7 +299,7 @@ var __async$I = (__this, __arguments, generator) => {
|
|
|
299
299
|
const useParseAddress = () => {
|
|
300
300
|
const { client } = useShipEngine();
|
|
301
301
|
return useMutation({
|
|
302
|
-
mutationFn: (_0) => __async$
|
|
302
|
+
mutationFn: (_0) => __async$K(void 0, [_0], function* ({ address, text }) {
|
|
303
303
|
const result = yield client.addresses.parse(text, address);
|
|
304
304
|
return result.data;
|
|
305
305
|
}),
|
|
@@ -308,7 +308,7 @@ const useParseAddress = () => {
|
|
|
308
308
|
});
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
-
var __async$
|
|
311
|
+
var __async$J = (__this, __arguments, generator) => {
|
|
312
312
|
return new Promise((resolve, reject) => {
|
|
313
313
|
var fulfilled = (value) => {
|
|
314
314
|
try {
|
|
@@ -331,7 +331,7 @@ var __async$H = (__this, __arguments, generator) => {
|
|
|
331
331
|
const useValidateAddresses = () => {
|
|
332
332
|
const { client } = useShipEngine();
|
|
333
333
|
return useMutation({
|
|
334
|
-
mutationFn: (addresses) => __async$
|
|
334
|
+
mutationFn: (addresses) => __async$J(void 0, null, function* () {
|
|
335
335
|
const result = yield client.addresses.validate(addresses);
|
|
336
336
|
return result.data;
|
|
337
337
|
}),
|
|
@@ -340,7 +340,7 @@ const useValidateAddresses = () => {
|
|
|
340
340
|
});
|
|
341
341
|
};
|
|
342
342
|
|
|
343
|
-
var __async$
|
|
343
|
+
var __async$I = (__this, __arguments, generator) => {
|
|
344
344
|
return new Promise((resolve, reject) => {
|
|
345
345
|
var fulfilled = (value) => {
|
|
346
346
|
try {
|
|
@@ -363,7 +363,7 @@ var __async$G = (__this, __arguments, generator) => {
|
|
|
363
363
|
const useAddFunds = () => {
|
|
364
364
|
const { client } = useShipEngine();
|
|
365
365
|
return useMutation({
|
|
366
|
-
mutationFn: (_0) => __async$
|
|
366
|
+
mutationFn: (_0) => __async$I(void 0, [_0], function* ({ carrierId, funds }) {
|
|
367
367
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
368
368
|
return result.data;
|
|
369
369
|
}),
|
|
@@ -372,7 +372,7 @@ const useAddFunds = () => {
|
|
|
372
372
|
});
|
|
373
373
|
};
|
|
374
374
|
|
|
375
|
-
var __async$
|
|
375
|
+
var __async$H = (__this, __arguments, generator) => {
|
|
376
376
|
return new Promise((resolve, reject) => {
|
|
377
377
|
var fulfilled = (value) => {
|
|
378
378
|
try {
|
|
@@ -395,7 +395,7 @@ var __async$F = (__this, __arguments, generator) => {
|
|
|
395
395
|
const useConnectCarrier = () => {
|
|
396
396
|
const { client } = useShipEngine();
|
|
397
397
|
return useMutation({
|
|
398
|
-
mutationFn: (params) => __async$
|
|
398
|
+
mutationFn: (params) => __async$H(void 0, null, function* () {
|
|
399
399
|
const result = yield client.carriers.connect(params);
|
|
400
400
|
return result.data;
|
|
401
401
|
}),
|
|
@@ -504,41 +504,41 @@ const useGetServicesByCarrier = (carrierId) => {
|
|
|
504
504
|
});
|
|
505
505
|
};
|
|
506
506
|
|
|
507
|
-
var __defProp$
|
|
508
|
-
var __defProps$
|
|
509
|
-
var __getOwnPropDescs$
|
|
510
|
-
var __getOwnPropSymbols$
|
|
511
|
-
var __hasOwnProp$
|
|
512
|
-
var __propIsEnum$
|
|
513
|
-
var __defNormalProp$
|
|
514
|
-
var __spreadValues$
|
|
507
|
+
var __defProp$m = Object.defineProperty;
|
|
508
|
+
var __defProps$l = Object.defineProperties;
|
|
509
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
510
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
511
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
512
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
513
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
514
|
+
var __spreadValues$m = (a, b) => {
|
|
515
515
|
for (var prop in b || (b = {}))
|
|
516
|
-
if (__hasOwnProp$
|
|
517
|
-
__defNormalProp$
|
|
518
|
-
if (__getOwnPropSymbols$
|
|
519
|
-
for (var prop of __getOwnPropSymbols$
|
|
520
|
-
if (__propIsEnum$
|
|
521
|
-
__defNormalProp$
|
|
516
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
517
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
518
|
+
if (__getOwnPropSymbols$w)
|
|
519
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
520
|
+
if (__propIsEnum$w.call(b, prop))
|
|
521
|
+
__defNormalProp$m(a, prop, b[prop]);
|
|
522
522
|
}
|
|
523
523
|
return a;
|
|
524
524
|
};
|
|
525
|
-
var __spreadProps$
|
|
525
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
526
526
|
var __objRest$k = (source, exclude) => {
|
|
527
527
|
var target = {};
|
|
528
528
|
for (var prop in source)
|
|
529
|
-
if (__hasOwnProp$
|
|
529
|
+
if (__hasOwnProp$w.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
530
530
|
target[prop] = source[prop];
|
|
531
|
-
if (source != null && __getOwnPropSymbols$
|
|
532
|
-
for (var prop of __getOwnPropSymbols$
|
|
533
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
531
|
+
if (source != null && __getOwnPropSymbols$w)
|
|
532
|
+
for (var prop of __getOwnPropSymbols$w(source)) {
|
|
533
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$w.call(source, prop))
|
|
534
534
|
target[prop] = source[prop];
|
|
535
535
|
}
|
|
536
536
|
return target;
|
|
537
537
|
};
|
|
538
538
|
const useListCarriers = (params) => {
|
|
539
539
|
const { client } = useShipEngine();
|
|
540
|
-
const _a = __spreadValues$
|
|
541
|
-
return useQuery(__spreadProps$
|
|
540
|
+
const _a = __spreadValues$m({}, params), { queryFnParams } = _a, rest = __objRest$k(_a, ["queryFnParams"]);
|
|
541
|
+
return useQuery(__spreadProps$l(__spreadValues$m({}, rest), {
|
|
542
542
|
onError,
|
|
543
543
|
queryFn: () => client.carriers.list(queryFnParams),
|
|
544
544
|
queryKey: ["useListCarriers", queryFnParams],
|
|
@@ -546,22 +546,22 @@ const useListCarriers = (params) => {
|
|
|
546
546
|
}));
|
|
547
547
|
};
|
|
548
548
|
|
|
549
|
-
var __getOwnPropSymbols$
|
|
550
|
-
var __hasOwnProp$
|
|
551
|
-
var __propIsEnum$
|
|
549
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
550
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
551
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
552
552
|
var __objRest$j = (source, exclude) => {
|
|
553
553
|
var target = {};
|
|
554
554
|
for (var prop in source)
|
|
555
|
-
if (__hasOwnProp$
|
|
555
|
+
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
556
556
|
target[prop] = source[prop];
|
|
557
|
-
if (source != null && __getOwnPropSymbols$
|
|
558
|
-
for (var prop of __getOwnPropSymbols$
|
|
559
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
557
|
+
if (source != null && __getOwnPropSymbols$v)
|
|
558
|
+
for (var prop of __getOwnPropSymbols$v(source)) {
|
|
559
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
|
|
560
560
|
target[prop] = source[prop];
|
|
561
561
|
}
|
|
562
562
|
return target;
|
|
563
563
|
};
|
|
564
|
-
var __async$
|
|
564
|
+
var __async$G = (__this, __arguments, generator) => {
|
|
565
565
|
return new Promise((resolve, reject) => {
|
|
566
566
|
var fulfilled = (value) => {
|
|
567
567
|
try {
|
|
@@ -585,7 +585,7 @@ const useUpdateAutoFunding = () => {
|
|
|
585
585
|
const { client } = useShipEngine();
|
|
586
586
|
const queryClient = useQueryClient();
|
|
587
587
|
return useMutation({
|
|
588
|
-
mutationFn: (_a) => __async$
|
|
588
|
+
mutationFn: (_a) => __async$G(void 0, null, function* () {
|
|
589
589
|
var _b = _a, { carrierId } = _b, options = __objRest$j(_b, ["carrierId"]);
|
|
590
590
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
591
591
|
return result.data;
|
|
@@ -615,7 +615,7 @@ const useGetZonesByCarrier = (carrierId) => {
|
|
|
615
615
|
});
|
|
616
616
|
};
|
|
617
617
|
|
|
618
|
-
var __async$
|
|
618
|
+
var __async$F = (__this, __arguments, generator) => {
|
|
619
619
|
return new Promise((resolve, reject) => {
|
|
620
620
|
var fulfilled = (value) => {
|
|
621
621
|
try {
|
|
@@ -638,7 +638,7 @@ var __async$D = (__this, __arguments, generator) => {
|
|
|
638
638
|
const useDeleteCarrier = () => {
|
|
639
639
|
const { client } = useShipEngine();
|
|
640
640
|
return useMutation({
|
|
641
|
-
mutationFn: (carrierId) => __async$
|
|
641
|
+
mutationFn: (carrierId) => __async$F(void 0, null, function* () {
|
|
642
642
|
const result = yield client.carriers.delete(carrierId);
|
|
643
643
|
return result.data;
|
|
644
644
|
}),
|
|
@@ -647,17 +647,17 @@ const useDeleteCarrier = () => {
|
|
|
647
647
|
});
|
|
648
648
|
};
|
|
649
649
|
|
|
650
|
-
var __getOwnPropSymbols$
|
|
651
|
-
var __hasOwnProp$
|
|
652
|
-
var __propIsEnum$
|
|
650
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
651
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
652
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
653
653
|
var __objRest$i = (source, exclude) => {
|
|
654
654
|
var target = {};
|
|
655
655
|
for (var prop in source)
|
|
656
|
-
if (__hasOwnProp$
|
|
656
|
+
if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
657
657
|
target[prop] = source[prop];
|
|
658
|
-
if (source != null && __getOwnPropSymbols$
|
|
659
|
-
for (var prop of __getOwnPropSymbols$
|
|
660
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
658
|
+
if (source != null && __getOwnPropSymbols$u)
|
|
659
|
+
for (var prop of __getOwnPropSymbols$u(source)) {
|
|
660
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
|
|
661
661
|
target[prop] = source[prop];
|
|
662
662
|
}
|
|
663
663
|
return target;
|
|
@@ -674,17 +674,17 @@ const useGetCarrierConnectionForm = (_params) => {
|
|
|
674
674
|
});
|
|
675
675
|
};
|
|
676
676
|
|
|
677
|
-
var __getOwnPropSymbols$
|
|
678
|
-
var __hasOwnProp$
|
|
679
|
-
var __propIsEnum$
|
|
677
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
678
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
679
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
680
680
|
var __objRest$h = (source, exclude) => {
|
|
681
681
|
var target = {};
|
|
682
682
|
for (var prop in source)
|
|
683
|
-
if (__hasOwnProp$
|
|
683
|
+
if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
684
684
|
target[prop] = source[prop];
|
|
685
|
-
if (source != null && __getOwnPropSymbols$
|
|
686
|
-
for (var prop of __getOwnPropSymbols$
|
|
687
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
685
|
+
if (source != null && __getOwnPropSymbols$t)
|
|
686
|
+
for (var prop of __getOwnPropSymbols$t(source)) {
|
|
687
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
|
|
688
688
|
target[prop] = source[prop];
|
|
689
689
|
}
|
|
690
690
|
return target;
|
|
@@ -701,7 +701,7 @@ const useListCarrierConnections = (_params) => {
|
|
|
701
701
|
});
|
|
702
702
|
};
|
|
703
703
|
|
|
704
|
-
var __async$
|
|
704
|
+
var __async$E = (__this, __arguments, generator) => {
|
|
705
705
|
return new Promise((resolve, reject) => {
|
|
706
706
|
var fulfilled = (value) => {
|
|
707
707
|
try {
|
|
@@ -724,7 +724,7 @@ var __async$C = (__this, __arguments, generator) => {
|
|
|
724
724
|
const useConnectCarrierAccount = () => {
|
|
725
725
|
const { client } = useShipEngine();
|
|
726
726
|
return useMutation({
|
|
727
|
-
mutationFn: (_0) => __async$
|
|
727
|
+
mutationFn: (_0) => __async$E(void 0, [_0], function* ({ carrierName, formData }) {
|
|
728
728
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
729
729
|
return result.data;
|
|
730
730
|
}),
|
|
@@ -744,33 +744,33 @@ const useCarrierConnectionsServicesList = (carrierCode) => {
|
|
|
744
744
|
});
|
|
745
745
|
};
|
|
746
746
|
|
|
747
|
-
var __defProp$
|
|
748
|
-
var __defProps$
|
|
749
|
-
var __getOwnPropDescs$
|
|
750
|
-
var __getOwnPropSymbols$
|
|
751
|
-
var __hasOwnProp$
|
|
752
|
-
var __propIsEnum$
|
|
753
|
-
var __defNormalProp$
|
|
754
|
-
var __spreadValues$
|
|
747
|
+
var __defProp$l = Object.defineProperty;
|
|
748
|
+
var __defProps$k = Object.defineProperties;
|
|
749
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
|
750
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
751
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
752
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
753
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
754
|
+
var __spreadValues$l = (a, b) => {
|
|
755
755
|
for (var prop in b || (b = {}))
|
|
756
|
-
if (__hasOwnProp$
|
|
757
|
-
__defNormalProp$
|
|
758
|
-
if (__getOwnPropSymbols$
|
|
759
|
-
for (var prop of __getOwnPropSymbols$
|
|
760
|
-
if (__propIsEnum$
|
|
761
|
-
__defNormalProp$
|
|
756
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
757
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
758
|
+
if (__getOwnPropSymbols$s)
|
|
759
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
760
|
+
if (__propIsEnum$s.call(b, prop))
|
|
761
|
+
__defNormalProp$l(a, prop, b[prop]);
|
|
762
762
|
}
|
|
763
763
|
return a;
|
|
764
764
|
};
|
|
765
|
-
var __spreadProps$
|
|
765
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
766
766
|
var __objRest$g = (source, exclude) => {
|
|
767
767
|
var target = {};
|
|
768
768
|
for (var prop in source)
|
|
769
|
-
if (__hasOwnProp$
|
|
769
|
+
if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
770
770
|
target[prop] = source[prop];
|
|
771
|
-
if (source != null && __getOwnPropSymbols$
|
|
772
|
-
for (var prop of __getOwnPropSymbols$
|
|
773
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
771
|
+
if (source != null && __getOwnPropSymbols$s)
|
|
772
|
+
for (var prop of __getOwnPropSymbols$s(source)) {
|
|
773
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
|
|
774
774
|
target[prop] = source[prop];
|
|
775
775
|
}
|
|
776
776
|
return target;
|
|
@@ -783,7 +783,7 @@ const useGetConnectionsCarrierSettings = (_a) => {
|
|
|
783
783
|
]);
|
|
784
784
|
const { client } = useShipEngine();
|
|
785
785
|
const { carrierName, carrierId } = queryFnParams;
|
|
786
|
-
return useQuery(__spreadProps$
|
|
786
|
+
return useQuery(__spreadProps$k(__spreadValues$l({}, params), {
|
|
787
787
|
onError,
|
|
788
788
|
queryFn: () => client.connections.getCarrierSettings(carrierName, carrierId),
|
|
789
789
|
queryKey: ["useGetConnectionsCarrierSettings", carrierName, carrierId],
|
|
@@ -791,26 +791,26 @@ const useGetConnectionsCarrierSettings = (_a) => {
|
|
|
791
791
|
}));
|
|
792
792
|
};
|
|
793
793
|
|
|
794
|
-
var __defProp$
|
|
795
|
-
var __defProps$
|
|
796
|
-
var __getOwnPropDescs$
|
|
797
|
-
var __getOwnPropSymbols$
|
|
798
|
-
var __hasOwnProp$
|
|
799
|
-
var __propIsEnum$
|
|
800
|
-
var __defNormalProp$
|
|
801
|
-
var __spreadValues$
|
|
794
|
+
var __defProp$k = Object.defineProperty;
|
|
795
|
+
var __defProps$j = Object.defineProperties;
|
|
796
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
797
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
798
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
799
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
800
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
801
|
+
var __spreadValues$k = (a, b) => {
|
|
802
802
|
for (var prop in b || (b = {}))
|
|
803
|
-
if (__hasOwnProp$
|
|
804
|
-
__defNormalProp$
|
|
805
|
-
if (__getOwnPropSymbols$
|
|
806
|
-
for (var prop of __getOwnPropSymbols$
|
|
807
|
-
if (__propIsEnum$
|
|
808
|
-
__defNormalProp$
|
|
803
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
804
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
805
|
+
if (__getOwnPropSymbols$r)
|
|
806
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
807
|
+
if (__propIsEnum$r.call(b, prop))
|
|
808
|
+
__defNormalProp$k(a, prop, b[prop]);
|
|
809
809
|
}
|
|
810
810
|
return a;
|
|
811
811
|
};
|
|
812
|
-
var __spreadProps$
|
|
813
|
-
var __async$
|
|
812
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
813
|
+
var __async$D = (__this, __arguments, generator) => {
|
|
814
814
|
return new Promise((resolve, reject) => {
|
|
815
815
|
var fulfilled = (value) => {
|
|
816
816
|
try {
|
|
@@ -832,8 +832,8 @@ var __async$B = (__this, __arguments, generator) => {
|
|
|
832
832
|
};
|
|
833
833
|
const useUpdateConnectionsCarrierSettings = (params) => {
|
|
834
834
|
const { client } = useShipEngine();
|
|
835
|
-
return useMutation(__spreadProps$
|
|
836
|
-
mutationFn: (_0) => __async$
|
|
835
|
+
return useMutation(__spreadProps$j(__spreadValues$k({}, params), {
|
|
836
|
+
mutationFn: (_0) => __async$D(void 0, [_0], function* ({
|
|
837
837
|
carrierName,
|
|
838
838
|
carrierId,
|
|
839
839
|
formData
|
|
@@ -860,7 +860,7 @@ const useListCustomPackageTypes = () => {
|
|
|
860
860
|
});
|
|
861
861
|
};
|
|
862
862
|
|
|
863
|
-
var __async$
|
|
863
|
+
var __async$C = (__this, __arguments, generator) => {
|
|
864
864
|
return new Promise((resolve, reject) => {
|
|
865
865
|
var fulfilled = (value) => {
|
|
866
866
|
try {
|
|
@@ -883,7 +883,7 @@ var __async$A = (__this, __arguments, generator) => {
|
|
|
883
883
|
const useCreateFundingSource = () => {
|
|
884
884
|
const { client } = useShipEngine();
|
|
885
885
|
return useMutation({
|
|
886
|
-
mutationFn: (fundingSource) => __async$
|
|
886
|
+
mutationFn: (fundingSource) => __async$C(void 0, null, function* () {
|
|
887
887
|
const result = yield client.fundingSources.create(fundingSource);
|
|
888
888
|
return result.data;
|
|
889
889
|
}),
|
|
@@ -892,7 +892,7 @@ const useCreateFundingSource = () => {
|
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
894
|
|
|
895
|
-
var __async$
|
|
895
|
+
var __async$B = (__this, __arguments, generator) => {
|
|
896
896
|
return new Promise((resolve, reject) => {
|
|
897
897
|
var fulfilled = (value) => {
|
|
898
898
|
try {
|
|
@@ -915,7 +915,7 @@ var __async$z = (__this, __arguments, generator) => {
|
|
|
915
915
|
const useFundingSourcesAddFunds = () => {
|
|
916
916
|
const { client } = useShipEngine();
|
|
917
917
|
return useMutation({
|
|
918
|
-
mutationFn: (_0) => __async$
|
|
918
|
+
mutationFn: (_0) => __async$B(void 0, [_0], function* ({ funds, fundingSourceId }) {
|
|
919
919
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
920
920
|
return result.data;
|
|
921
921
|
}),
|
|
@@ -944,7 +944,7 @@ const useListFundingSources = () => {
|
|
|
944
944
|
});
|
|
945
945
|
};
|
|
946
946
|
|
|
947
|
-
var __async$
|
|
947
|
+
var __async$A = (__this, __arguments, generator) => {
|
|
948
948
|
return new Promise((resolve, reject) => {
|
|
949
949
|
var fulfilled = (value) => {
|
|
950
950
|
try {
|
|
@@ -967,7 +967,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
967
967
|
const useRegisterCarrier = () => {
|
|
968
968
|
const { client } = useShipEngine();
|
|
969
969
|
return useMutation({
|
|
970
|
-
mutationFn: (carrier) => __async$
|
|
970
|
+
mutationFn: (carrier) => __async$A(void 0, null, function* () {
|
|
971
971
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
972
972
|
return result.data;
|
|
973
973
|
}),
|
|
@@ -976,7 +976,7 @@ const useRegisterCarrier = () => {
|
|
|
976
976
|
});
|
|
977
977
|
};
|
|
978
978
|
|
|
979
|
-
var __async$
|
|
979
|
+
var __async$z = (__this, __arguments, generator) => {
|
|
980
980
|
return new Promise((resolve, reject) => {
|
|
981
981
|
var fulfilled = (value) => {
|
|
982
982
|
try {
|
|
@@ -999,7 +999,7 @@ var __async$x = (__this, __arguments, generator) => {
|
|
|
999
999
|
const useUpdateFundingSource = () => {
|
|
1000
1000
|
const { client } = useShipEngine();
|
|
1001
1001
|
return useMutation({
|
|
1002
|
-
mutationFn: (_0) => __async$
|
|
1002
|
+
mutationFn: (_0) => __async$z(void 0, [_0], function* ({
|
|
1003
1003
|
billingInfo,
|
|
1004
1004
|
creditCardInfo,
|
|
1005
1005
|
fundingSourceId
|
|
@@ -1038,29 +1038,29 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
|
|
|
1038
1038
|
});
|
|
1039
1039
|
};
|
|
1040
1040
|
|
|
1041
|
-
var __defProp$
|
|
1042
|
-
var __defProps$
|
|
1043
|
-
var __getOwnPropDescs$
|
|
1044
|
-
var __getOwnPropSymbols$
|
|
1045
|
-
var __hasOwnProp$
|
|
1046
|
-
var __propIsEnum$
|
|
1047
|
-
var __defNormalProp$
|
|
1048
|
-
var __spreadValues$
|
|
1041
|
+
var __defProp$j = Object.defineProperty;
|
|
1042
|
+
var __defProps$i = Object.defineProperties;
|
|
1043
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
1044
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
1045
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
1046
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
1047
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1048
|
+
var __spreadValues$j = (a, b) => {
|
|
1049
1049
|
for (var prop in b || (b = {}))
|
|
1050
|
-
if (__hasOwnProp$
|
|
1051
|
-
__defNormalProp$
|
|
1052
|
-
if (__getOwnPropSymbols$
|
|
1053
|
-
for (var prop of __getOwnPropSymbols$
|
|
1054
|
-
if (__propIsEnum$
|
|
1055
|
-
__defNormalProp$
|
|
1050
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
1051
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1052
|
+
if (__getOwnPropSymbols$q)
|
|
1053
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
1054
|
+
if (__propIsEnum$q.call(b, prop))
|
|
1055
|
+
__defNormalProp$j(a, prop, b[prop]);
|
|
1056
1056
|
}
|
|
1057
1057
|
return a;
|
|
1058
1058
|
};
|
|
1059
|
-
var __spreadProps$
|
|
1059
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
1060
1060
|
const useGetInsuranceFundingSourceAcceptedTerms = (params) => {
|
|
1061
1061
|
const { client } = useShipEngine();
|
|
1062
|
-
const queryParams = __spreadValues$
|
|
1063
|
-
return useQuery(__spreadProps$
|
|
1062
|
+
const queryParams = __spreadValues$j({}, params);
|
|
1063
|
+
return useQuery(__spreadProps$i(__spreadValues$j({}, queryParams), {
|
|
1064
1064
|
onError,
|
|
1065
1065
|
queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
|
|
1066
1066
|
queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
|
|
@@ -1083,22 +1083,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
1083
1083
|
});
|
|
1084
1084
|
};
|
|
1085
1085
|
|
|
1086
|
-
var __getOwnPropSymbols$
|
|
1087
|
-
var __hasOwnProp$
|
|
1088
|
-
var __propIsEnum$
|
|
1086
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
1087
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
1088
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
1089
1089
|
var __objRest$f = (source, exclude) => {
|
|
1090
1090
|
var target = {};
|
|
1091
1091
|
for (var prop in source)
|
|
1092
|
-
if (__hasOwnProp$
|
|
1092
|
+
if (__hasOwnProp$p.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1093
1093
|
target[prop] = source[prop];
|
|
1094
|
-
if (source != null && __getOwnPropSymbols$
|
|
1095
|
-
for (var prop of __getOwnPropSymbols$
|
|
1096
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1094
|
+
if (source != null && __getOwnPropSymbols$p)
|
|
1095
|
+
for (var prop of __getOwnPropSymbols$p(source)) {
|
|
1096
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$p.call(source, prop))
|
|
1097
1097
|
target[prop] = source[prop];
|
|
1098
1098
|
}
|
|
1099
1099
|
return target;
|
|
1100
1100
|
};
|
|
1101
|
-
var __async$
|
|
1101
|
+
var __async$y = (__this, __arguments, generator) => {
|
|
1102
1102
|
return new Promise((resolve, reject) => {
|
|
1103
1103
|
var fulfilled = (value) => {
|
|
1104
1104
|
try {
|
|
@@ -1121,7 +1121,7 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
1121
1121
|
const useAddInsuranceFunds = () => {
|
|
1122
1122
|
const { client } = useShipEngine();
|
|
1123
1123
|
return useMutation({
|
|
1124
|
-
mutationFn: (_a) => __async$
|
|
1124
|
+
mutationFn: (_a) => __async$y(void 0, null, function* () {
|
|
1125
1125
|
var _b = _a, { insuranceProvider } = _b, rest = __objRest$f(_b, ["insuranceProvider"]);
|
|
1126
1126
|
const result = yield client.insurance.addFunds(insuranceProvider, rest);
|
|
1127
1127
|
return result.data;
|
|
@@ -1131,6 +1131,137 @@ const useAddInsuranceFunds = () => {
|
|
|
1131
1131
|
});
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
|
+
var __defProp$i = Object.defineProperty;
|
|
1135
|
+
var __defProps$h = Object.defineProperties;
|
|
1136
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
1137
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
1138
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
1139
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
1140
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1141
|
+
var __spreadValues$i = (a, b) => {
|
|
1142
|
+
for (var prop in b || (b = {}))
|
|
1143
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
1144
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1145
|
+
if (__getOwnPropSymbols$o)
|
|
1146
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
1147
|
+
if (__propIsEnum$o.call(b, prop))
|
|
1148
|
+
__defNormalProp$i(a, prop, b[prop]);
|
|
1149
|
+
}
|
|
1150
|
+
return a;
|
|
1151
|
+
};
|
|
1152
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
1153
|
+
var __async$x = (__this, __arguments, generator) => {
|
|
1154
|
+
return new Promise((resolve, reject) => {
|
|
1155
|
+
var fulfilled = (value) => {
|
|
1156
|
+
try {
|
|
1157
|
+
step(generator.next(value));
|
|
1158
|
+
} catch (e) {
|
|
1159
|
+
reject(e);
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1162
|
+
var rejected = (value) => {
|
|
1163
|
+
try {
|
|
1164
|
+
step(generator.throw(value));
|
|
1165
|
+
} catch (e) {
|
|
1166
|
+
reject(e);
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1170
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
const useCreateInvoiceAddress = (params) => {
|
|
1174
|
+
const { client } = useShipEngine();
|
|
1175
|
+
return useMutation(__spreadProps$h(__spreadValues$i({}, params), {
|
|
1176
|
+
mutationFn: (invoiceAddress) => __async$x(void 0, null, function* () {
|
|
1177
|
+
const result = yield client.invoiceAddress.create(invoiceAddress);
|
|
1178
|
+
return result.data;
|
|
1179
|
+
}),
|
|
1180
|
+
mutationKey: ["useCreateInvoiceAddress"],
|
|
1181
|
+
onError
|
|
1182
|
+
}));
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1185
|
+
var __defProp$h = Object.defineProperty;
|
|
1186
|
+
var __defProps$g = Object.defineProperties;
|
|
1187
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
1188
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
|
1189
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
|
1190
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
|
1191
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1192
|
+
var __spreadValues$h = (a, b) => {
|
|
1193
|
+
for (var prop in b || (b = {}))
|
|
1194
|
+
if (__hasOwnProp$n.call(b, prop))
|
|
1195
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1196
|
+
if (__getOwnPropSymbols$n)
|
|
1197
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
|
1198
|
+
if (__propIsEnum$n.call(b, prop))
|
|
1199
|
+
__defNormalProp$h(a, prop, b[prop]);
|
|
1200
|
+
}
|
|
1201
|
+
return a;
|
|
1202
|
+
};
|
|
1203
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
1204
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
1205
|
+
return new Promise((resolve, reject) => {
|
|
1206
|
+
var fulfilled = (value) => {
|
|
1207
|
+
try {
|
|
1208
|
+
step(generator.next(value));
|
|
1209
|
+
} catch (e) {
|
|
1210
|
+
reject(e);
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
var rejected = (value) => {
|
|
1214
|
+
try {
|
|
1215
|
+
step(generator.throw(value));
|
|
1216
|
+
} catch (e) {
|
|
1217
|
+
reject(e);
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1221
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1222
|
+
});
|
|
1223
|
+
};
|
|
1224
|
+
const useUpdateInvoiceAddress = (params) => {
|
|
1225
|
+
const { client } = useShipEngine();
|
|
1226
|
+
return useMutation(__spreadProps$g(__spreadValues$h({}, params), {
|
|
1227
|
+
mutationFn: (invoiceAddress) => __async$w(void 0, null, function* () {
|
|
1228
|
+
const result = yield client.invoiceAddress.update(invoiceAddress);
|
|
1229
|
+
return result.data;
|
|
1230
|
+
}),
|
|
1231
|
+
mutationKey: ["useUpdateInvoiceAddress"],
|
|
1232
|
+
onError
|
|
1233
|
+
}));
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
var __defProp$g = Object.defineProperty;
|
|
1237
|
+
var __defProps$f = Object.defineProperties;
|
|
1238
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
1239
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
|
1240
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
|
1241
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
|
1242
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1243
|
+
var __spreadValues$g = (a, b) => {
|
|
1244
|
+
for (var prop in b || (b = {}))
|
|
1245
|
+
if (__hasOwnProp$m.call(b, prop))
|
|
1246
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1247
|
+
if (__getOwnPropSymbols$m)
|
|
1248
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
|
1249
|
+
if (__propIsEnum$m.call(b, prop))
|
|
1250
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
1251
|
+
}
|
|
1252
|
+
return a;
|
|
1253
|
+
};
|
|
1254
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
1255
|
+
const useGetInvoiceAddress = (params) => {
|
|
1256
|
+
const { client } = useShipEngine();
|
|
1257
|
+
return useQuery(__spreadProps$f(__spreadValues$g({}, params), {
|
|
1258
|
+
onError,
|
|
1259
|
+
queryFn: () => client.invoiceAddress.get(),
|
|
1260
|
+
queryKey: ["useGetInvoiceAddress"],
|
|
1261
|
+
select: (result) => result.data
|
|
1262
|
+
}));
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1134
1265
|
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
1135
1266
|
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
1136
1267
|
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
|
@@ -1682,10 +1813,12 @@ const useRatesEstimate = () => {
|
|
|
1682
1813
|
});
|
|
1683
1814
|
};
|
|
1684
1815
|
|
|
1685
|
-
const useGetSalesOrder = (salesOrderId) => {
|
|
1816
|
+
const useGetSalesOrder = (salesOrderId, config) => {
|
|
1817
|
+
var _a;
|
|
1686
1818
|
const { client } = useShipEngine();
|
|
1819
|
+
const enabled = (_a = config == null ? void 0 : config.enabled) != null ? _a : true;
|
|
1687
1820
|
return useQuery({
|
|
1688
|
-
enabled: salesOrderId !== void 0,
|
|
1821
|
+
enabled: salesOrderId !== void 0 && enabled,
|
|
1689
1822
|
onError,
|
|
1690
1823
|
queryFn: () => {
|
|
1691
1824
|
if (salesOrderId)
|
|
@@ -1697,6 +1830,23 @@ const useGetSalesOrder = (salesOrderId) => {
|
|
|
1697
1830
|
});
|
|
1698
1831
|
};
|
|
1699
1832
|
|
|
1833
|
+
const useGetSalesOrderByExternalOrderId = (externalOrderId, config) => {
|
|
1834
|
+
var _a;
|
|
1835
|
+
const { client } = useShipEngine();
|
|
1836
|
+
const enabled = (_a = config == null ? void 0 : config.enabled) != null ? _a : true;
|
|
1837
|
+
return useQuery({
|
|
1838
|
+
enabled: externalOrderId !== void 0 && enabled,
|
|
1839
|
+
onError,
|
|
1840
|
+
queryFn: () => {
|
|
1841
|
+
if (externalOrderId)
|
|
1842
|
+
return client.salesOrders.getByExternalId(externalOrderId);
|
|
1843
|
+
return Promise.reject(new Error("externalOrderId is required"));
|
|
1844
|
+
},
|
|
1845
|
+
queryKey: ["useGetSalesOrderByExternalOrderId", externalOrderId],
|
|
1846
|
+
select: (result) => result.data
|
|
1847
|
+
});
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1700
1850
|
const useListSalesOrders = (params = {}) => {
|
|
1701
1851
|
const { client } = useShipEngine();
|
|
1702
1852
|
return useQuery({
|
|
@@ -1819,13 +1969,14 @@ const useGetSalesOrderShipment = (shipmentId) => {
|
|
|
1819
1969
|
});
|
|
1820
1970
|
};
|
|
1821
1971
|
|
|
1822
|
-
const useListSalesOrderShipments = (
|
|
1972
|
+
const useListSalesOrderShipments = (body) => {
|
|
1823
1973
|
const { client } = useShipEngine();
|
|
1974
|
+
const { shipmentIds, salesOrderIds, externalOrderIds } = body;
|
|
1824
1975
|
return useQuery({
|
|
1825
|
-
enabled:
|
|
1976
|
+
enabled: !!((shipmentIds == null ? void 0 : shipmentIds.length) || (salesOrderIds == null ? void 0 : salesOrderIds.length) || (externalOrderIds == null ? void 0 : externalOrderIds.length)),
|
|
1826
1977
|
onError,
|
|
1827
|
-
queryFn: () => client.salesOrderShipments.list(
|
|
1828
|
-
queryKey: ["useListSalesOrderShipments",
|
|
1978
|
+
queryFn: () => client.salesOrderShipments.list(body),
|
|
1979
|
+
queryKey: ["useListSalesOrderShipments", body],
|
|
1829
1980
|
select: (result) => result.data.shipments
|
|
1830
1981
|
});
|
|
1831
1982
|
};
|
|
@@ -1878,6 +2029,17 @@ const useUpdateSalesOrderShipment = () => {
|
|
|
1878
2029
|
});
|
|
1879
2030
|
};
|
|
1880
2031
|
|
|
2032
|
+
const useListSalesOrderShipmentsByExternalOrderId = (externalOrderId) => {
|
|
2033
|
+
const { client } = useShipEngine();
|
|
2034
|
+
return useQuery({
|
|
2035
|
+
enabled: externalOrderId !== null && externalOrderId.length > 0,
|
|
2036
|
+
onError,
|
|
2037
|
+
queryFn: () => client.salesOrderShipments.listShipmentsByExternalOrderId(externalOrderId),
|
|
2038
|
+
queryKey: ["useListSalesOrderShipments", externalOrderId],
|
|
2039
|
+
select: (result) => result.data.shipments
|
|
2040
|
+
});
|
|
2041
|
+
};
|
|
2042
|
+
|
|
1881
2043
|
var __defProp$d = Object.defineProperty;
|
|
1882
2044
|
var __defProps$c = Object.defineProperties;
|
|
1883
2045
|
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
|
@@ -3065,4 +3227,4 @@ const useUpdateWebhook = (params) => {
|
|
|
3065
3227
|
}));
|
|
3066
3228
|
};
|
|
3067
3229
|
|
|
3068
|
-
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateOrderSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|
|
3230
|
+
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateInvoiceAddress, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetInvoiceAddress, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderByExternalOrderId, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrderShipmentsByExternalOrderId, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateInvoiceAddress, useUpdateOrderSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|