@shipengine/react-api 4.0.0 → 4.1.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/labels/index.d.ts +2 -0
- package/hooks/labels/use-create-label.d.ts +13 -0
- package/hooks/labels/use-download-labels.d.ts +7 -0
- package/index.js +418 -311
- package/index.mjs +417 -312
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -79,25 +79,25 @@ const onError = (_errors) => _default();
|
|
|
79
79
|
|
|
80
80
|
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}();
|
|
81
81
|
|
|
82
|
-
var __defProp$
|
|
83
|
-
var __defProps$
|
|
84
|
-
var __getOwnPropDescs$
|
|
85
|
-
var __getOwnPropSymbols$
|
|
86
|
-
var __hasOwnProp$
|
|
87
|
-
var __propIsEnum$
|
|
88
|
-
var __defNormalProp$
|
|
89
|
-
var __spreadValues$
|
|
82
|
+
var __defProp$w = Object.defineProperty;
|
|
83
|
+
var __defProps$v = Object.defineProperties;
|
|
84
|
+
var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
|
|
85
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
86
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
87
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
88
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
89
|
+
var __spreadValues$w = (a, b) => {
|
|
90
90
|
for (var prop in b || (b = {}))
|
|
91
|
-
if (__hasOwnProp$
|
|
92
|
-
__defNormalProp$
|
|
93
|
-
if (__getOwnPropSymbols$
|
|
94
|
-
for (var prop of __getOwnPropSymbols$
|
|
95
|
-
if (__propIsEnum$
|
|
96
|
-
__defNormalProp$
|
|
91
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
92
|
+
__defNormalProp$w(a, prop, b[prop]);
|
|
93
|
+
if (__getOwnPropSymbols$F)
|
|
94
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
95
|
+
if (__propIsEnum$F.call(b, prop))
|
|
96
|
+
__defNormalProp$w(a, prop, b[prop]);
|
|
97
97
|
}
|
|
98
98
|
return a;
|
|
99
99
|
};
|
|
100
|
-
var __spreadProps$
|
|
100
|
+
var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
|
|
101
101
|
const streams = [];
|
|
102
102
|
if (process.env.NODE_ENV === "production") {
|
|
103
103
|
streams.push({
|
|
@@ -106,7 +106,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
106
106
|
}
|
|
107
107
|
const logger = E({
|
|
108
108
|
name: "shipengine",
|
|
109
|
-
serializers: __spreadProps$
|
|
109
|
+
serializers: __spreadProps$v(__spreadValues$w({}, k), {
|
|
110
110
|
req: (req) => ({
|
|
111
111
|
headers: req.headers,
|
|
112
112
|
method: req.method,
|
|
@@ -131,7 +131,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
|
|
|
131
131
|
throw error;
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
var __async$
|
|
134
|
+
var __async$T = (__this, __arguments, generator) => {
|
|
135
135
|
return new Promise((resolve, reject) => {
|
|
136
136
|
var fulfilled = (value) => {
|
|
137
137
|
try {
|
|
@@ -154,7 +154,7 @@ var __async$S = (__this, __arguments, generator) => {
|
|
|
154
154
|
const useCreateAccountImage = () => {
|
|
155
155
|
const { client } = useShipEngine();
|
|
156
156
|
return reactQuery.useMutation({
|
|
157
|
-
mutationFn: (data) => __async$
|
|
157
|
+
mutationFn: (data) => __async$T(void 0, null, function* () {
|
|
158
158
|
const result = yield client.accountSettings.createImage(data);
|
|
159
159
|
return result.data;
|
|
160
160
|
}),
|
|
@@ -163,7 +163,7 @@ const useCreateAccountImage = () => {
|
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
-
var __async$
|
|
166
|
+
var __async$S = (__this, __arguments, generator) => {
|
|
167
167
|
return new Promise((resolve, reject) => {
|
|
168
168
|
var fulfilled = (value) => {
|
|
169
169
|
try {
|
|
@@ -186,7 +186,7 @@ var __async$R = (__this, __arguments, generator) => {
|
|
|
186
186
|
const useDeleteAccountImage = () => {
|
|
187
187
|
const { client } = useShipEngine();
|
|
188
188
|
return reactQuery.useMutation({
|
|
189
|
-
mutationFn: (labelImageId) => __async$
|
|
189
|
+
mutationFn: (labelImageId) => __async$S(void 0, null, function* () {
|
|
190
190
|
const result = yield client.accountSettings.deleteImage(labelImageId);
|
|
191
191
|
return result.data;
|
|
192
192
|
}),
|
|
@@ -215,7 +215,7 @@ const useGetAccountSettings = () => {
|
|
|
215
215
|
});
|
|
216
216
|
};
|
|
217
217
|
|
|
218
|
-
var __async$
|
|
218
|
+
var __async$R = (__this, __arguments, generator) => {
|
|
219
219
|
return new Promise((resolve, reject) => {
|
|
220
220
|
var fulfilled = (value) => {
|
|
221
221
|
try {
|
|
@@ -238,7 +238,7 @@ var __async$Q = (__this, __arguments, generator) => {
|
|
|
238
238
|
const useUpdateAccountImage = () => {
|
|
239
239
|
const { client } = useShipEngine();
|
|
240
240
|
return reactQuery.useMutation({
|
|
241
|
-
mutationFn: (data) => __async$
|
|
241
|
+
mutationFn: (data) => __async$R(void 0, null, function* () {
|
|
242
242
|
const result = yield client.accountSettings.updateImage(data);
|
|
243
243
|
return result.data;
|
|
244
244
|
}),
|
|
@@ -247,7 +247,7 @@ const useUpdateAccountImage = () => {
|
|
|
247
247
|
});
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
-
var __async$
|
|
250
|
+
var __async$Q = (__this, __arguments, generator) => {
|
|
251
251
|
return new Promise((resolve, reject) => {
|
|
252
252
|
var fulfilled = (value) => {
|
|
253
253
|
try {
|
|
@@ -270,7 +270,7 @@ var __async$P = (__this, __arguments, generator) => {
|
|
|
270
270
|
const useUpdateAccountSettings = () => {
|
|
271
271
|
const { client } = useShipEngine();
|
|
272
272
|
return reactQuery.useMutation({
|
|
273
|
-
mutationFn: (settings) => __async$
|
|
273
|
+
mutationFn: (settings) => __async$Q(void 0, null, function* () {
|
|
274
274
|
const result = yield client.accountSettings.update(settings);
|
|
275
275
|
return result.data;
|
|
276
276
|
}),
|
|
@@ -279,7 +279,7 @@ const useUpdateAccountSettings = () => {
|
|
|
279
279
|
});
|
|
280
280
|
};
|
|
281
281
|
|
|
282
|
-
var __async$
|
|
282
|
+
var __async$P = (__this, __arguments, generator) => {
|
|
283
283
|
return new Promise((resolve, reject) => {
|
|
284
284
|
var fulfilled = (value) => {
|
|
285
285
|
try {
|
|
@@ -302,7 +302,7 @@ var __async$O = (__this, __arguments, generator) => {
|
|
|
302
302
|
const useParseAddress = () => {
|
|
303
303
|
const { client } = useShipEngine();
|
|
304
304
|
return reactQuery.useMutation({
|
|
305
|
-
mutationFn: (_0) => __async$
|
|
305
|
+
mutationFn: (_0) => __async$P(void 0, [_0], function* ({ address, text }) {
|
|
306
306
|
const result = yield client.addresses.parse(text, address);
|
|
307
307
|
return result.data;
|
|
308
308
|
}),
|
|
@@ -311,7 +311,7 @@ const useParseAddress = () => {
|
|
|
311
311
|
});
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
-
var __async$
|
|
314
|
+
var __async$O = (__this, __arguments, generator) => {
|
|
315
315
|
return new Promise((resolve, reject) => {
|
|
316
316
|
var fulfilled = (value) => {
|
|
317
317
|
try {
|
|
@@ -334,7 +334,7 @@ var __async$N = (__this, __arguments, generator) => {
|
|
|
334
334
|
const useValidateAddresses = () => {
|
|
335
335
|
const { client } = useShipEngine();
|
|
336
336
|
return reactQuery.useMutation({
|
|
337
|
-
mutationFn: (addresses) => __async$
|
|
337
|
+
mutationFn: (addresses) => __async$O(void 0, null, function* () {
|
|
338
338
|
const result = yield client.addresses.validate(addresses);
|
|
339
339
|
return result.data;
|
|
340
340
|
}),
|
|
@@ -343,26 +343,26 @@ const useValidateAddresses = () => {
|
|
|
343
343
|
});
|
|
344
344
|
};
|
|
345
345
|
|
|
346
|
-
var __defProp$
|
|
347
|
-
var __defProps$
|
|
348
|
-
var __getOwnPropDescs$
|
|
349
|
-
var __getOwnPropSymbols$
|
|
350
|
-
var __hasOwnProp$
|
|
351
|
-
var __propIsEnum$
|
|
352
|
-
var __defNormalProp$
|
|
353
|
-
var __spreadValues$
|
|
346
|
+
var __defProp$v = Object.defineProperty;
|
|
347
|
+
var __defProps$u = Object.defineProperties;
|
|
348
|
+
var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
|
|
349
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
350
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
351
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
352
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
353
|
+
var __spreadValues$v = (a, b) => {
|
|
354
354
|
for (var prop in b || (b = {}))
|
|
355
|
-
if (__hasOwnProp$
|
|
356
|
-
__defNormalProp$
|
|
357
|
-
if (__getOwnPropSymbols$
|
|
358
|
-
for (var prop of __getOwnPropSymbols$
|
|
359
|
-
if (__propIsEnum$
|
|
360
|
-
__defNormalProp$
|
|
355
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
356
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
357
|
+
if (__getOwnPropSymbols$E)
|
|
358
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
359
|
+
if (__propIsEnum$E.call(b, prop))
|
|
360
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
361
361
|
}
|
|
362
362
|
return a;
|
|
363
363
|
};
|
|
364
|
-
var __spreadProps$
|
|
365
|
-
var __async$
|
|
364
|
+
var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
|
|
365
|
+
var __async$N = (__this, __arguments, generator) => {
|
|
366
366
|
return new Promise((resolve, reject) => {
|
|
367
367
|
var fulfilled = (value) => {
|
|
368
368
|
try {
|
|
@@ -384,8 +384,8 @@ var __async$M = (__this, __arguments, generator) => {
|
|
|
384
384
|
};
|
|
385
385
|
const useCreateAuctanePaySession = (params) => {
|
|
386
386
|
const { client } = useShipEngine();
|
|
387
|
-
return reactQuery.useMutation(__spreadProps$
|
|
388
|
-
mutationFn: (request) => __async$
|
|
387
|
+
return reactQuery.useMutation(__spreadProps$u(__spreadValues$v({}, params), {
|
|
388
|
+
mutationFn: (request) => __async$N(void 0, null, function* () {
|
|
389
389
|
const result = yield client.auctanePay.createSession(request);
|
|
390
390
|
return result.data;
|
|
391
391
|
}),
|
|
@@ -394,29 +394,29 @@ const useCreateAuctanePaySession = (params) => {
|
|
|
394
394
|
}));
|
|
395
395
|
};
|
|
396
396
|
|
|
397
|
-
var __defProp$
|
|
398
|
-
var __defProps$
|
|
399
|
-
var __getOwnPropDescs$
|
|
400
|
-
var __getOwnPropSymbols$
|
|
401
|
-
var __hasOwnProp$
|
|
402
|
-
var __propIsEnum$
|
|
403
|
-
var __defNormalProp$
|
|
404
|
-
var __spreadValues$
|
|
397
|
+
var __defProp$u = Object.defineProperty;
|
|
398
|
+
var __defProps$t = Object.defineProperties;
|
|
399
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
|
400
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
401
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
402
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
403
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
404
|
+
var __spreadValues$u = (a, b) => {
|
|
405
405
|
for (var prop in b || (b = {}))
|
|
406
|
-
if (__hasOwnProp$
|
|
407
|
-
__defNormalProp$
|
|
408
|
-
if (__getOwnPropSymbols$
|
|
409
|
-
for (var prop of __getOwnPropSymbols$
|
|
410
|
-
if (__propIsEnum$
|
|
411
|
-
__defNormalProp$
|
|
406
|
+
if (__hasOwnProp$D.call(b, prop))
|
|
407
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
408
|
+
if (__getOwnPropSymbols$D)
|
|
409
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
|
410
|
+
if (__propIsEnum$D.call(b, prop))
|
|
411
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
412
412
|
}
|
|
413
413
|
return a;
|
|
414
414
|
};
|
|
415
|
-
var __spreadProps$
|
|
415
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
|
416
416
|
const useGetAuctanePayConfig = (params) => {
|
|
417
417
|
const { client } = useShipEngine();
|
|
418
|
-
const queryParams = __spreadValues$
|
|
419
|
-
return reactQuery.useQuery(__spreadProps$
|
|
418
|
+
const queryParams = __spreadValues$u({}, params);
|
|
419
|
+
return reactQuery.useQuery(__spreadProps$t(__spreadValues$u({}, queryParams), {
|
|
420
420
|
onError,
|
|
421
421
|
queryFn: () => client.auctanePay.getConfig(),
|
|
422
422
|
queryKey: ["useGetAuctanePayConfig"],
|
|
@@ -424,7 +424,7 @@ const useGetAuctanePayConfig = (params) => {
|
|
|
424
424
|
}));
|
|
425
425
|
};
|
|
426
426
|
|
|
427
|
-
var __async$
|
|
427
|
+
var __async$M = (__this, __arguments, generator) => {
|
|
428
428
|
return new Promise((resolve, reject) => {
|
|
429
429
|
var fulfilled = (value) => {
|
|
430
430
|
try {
|
|
@@ -447,7 +447,7 @@ var __async$L = (__this, __arguments, generator) => {
|
|
|
447
447
|
const useAddFunds = () => {
|
|
448
448
|
const { client } = useShipEngine();
|
|
449
449
|
return reactQuery.useMutation({
|
|
450
|
-
mutationFn: (_0) => __async$
|
|
450
|
+
mutationFn: (_0) => __async$M(void 0, [_0], function* ({ carrierId, funds }) {
|
|
451
451
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
452
452
|
return result.data;
|
|
453
453
|
}),
|
|
@@ -456,7 +456,7 @@ const useAddFunds = () => {
|
|
|
456
456
|
});
|
|
457
457
|
};
|
|
458
458
|
|
|
459
|
-
var __async$
|
|
459
|
+
var __async$L = (__this, __arguments, generator) => {
|
|
460
460
|
return new Promise((resolve, reject) => {
|
|
461
461
|
var fulfilled = (value) => {
|
|
462
462
|
try {
|
|
@@ -479,7 +479,7 @@ var __async$K = (__this, __arguments, generator) => {
|
|
|
479
479
|
const useConnectCarrier = () => {
|
|
480
480
|
const { client } = useShipEngine();
|
|
481
481
|
return reactQuery.useMutation({
|
|
482
|
-
mutationFn: (params) => __async$
|
|
482
|
+
mutationFn: (params) => __async$L(void 0, null, function* () {
|
|
483
483
|
const result = yield client.carriers.connect(params);
|
|
484
484
|
return result.data;
|
|
485
485
|
}),
|
|
@@ -588,41 +588,41 @@ const useGetServicesByCarrier = (carrierId) => {
|
|
|
588
588
|
});
|
|
589
589
|
};
|
|
590
590
|
|
|
591
|
-
var __defProp$
|
|
592
|
-
var __defProps$
|
|
593
|
-
var __getOwnPropDescs$
|
|
594
|
-
var __getOwnPropSymbols$
|
|
595
|
-
var __hasOwnProp$
|
|
596
|
-
var __propIsEnum$
|
|
597
|
-
var __defNormalProp$
|
|
598
|
-
var __spreadValues$
|
|
591
|
+
var __defProp$t = Object.defineProperty;
|
|
592
|
+
var __defProps$s = Object.defineProperties;
|
|
593
|
+
var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
|
|
594
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
595
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
596
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
597
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
598
|
+
var __spreadValues$t = (a, b) => {
|
|
599
599
|
for (var prop in b || (b = {}))
|
|
600
|
-
if (__hasOwnProp$
|
|
601
|
-
__defNormalProp$
|
|
602
|
-
if (__getOwnPropSymbols$
|
|
603
|
-
for (var prop of __getOwnPropSymbols$
|
|
604
|
-
if (__propIsEnum$
|
|
605
|
-
__defNormalProp$
|
|
600
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
601
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
602
|
+
if (__getOwnPropSymbols$C)
|
|
603
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
604
|
+
if (__propIsEnum$C.call(b, prop))
|
|
605
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
606
606
|
}
|
|
607
607
|
return a;
|
|
608
608
|
};
|
|
609
|
-
var __spreadProps$
|
|
610
|
-
var __objRest$
|
|
609
|
+
var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
|
|
610
|
+
var __objRest$o = (source, exclude) => {
|
|
611
611
|
var target = {};
|
|
612
612
|
for (var prop in source)
|
|
613
|
-
if (__hasOwnProp$
|
|
613
|
+
if (__hasOwnProp$C.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
614
614
|
target[prop] = source[prop];
|
|
615
|
-
if (source != null && __getOwnPropSymbols$
|
|
616
|
-
for (var prop of __getOwnPropSymbols$
|
|
617
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
615
|
+
if (source != null && __getOwnPropSymbols$C)
|
|
616
|
+
for (var prop of __getOwnPropSymbols$C(source)) {
|
|
617
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$C.call(source, prop))
|
|
618
618
|
target[prop] = source[prop];
|
|
619
619
|
}
|
|
620
620
|
return target;
|
|
621
621
|
};
|
|
622
622
|
const useListCarriers = (params) => {
|
|
623
623
|
const { client } = useShipEngine();
|
|
624
|
-
const _a = __spreadValues$
|
|
625
|
-
return reactQuery.useQuery(__spreadProps$
|
|
624
|
+
const _a = __spreadValues$t({}, params), { queryFnParams } = _a, rest = __objRest$o(_a, ["queryFnParams"]);
|
|
625
|
+
return reactQuery.useQuery(__spreadProps$s(__spreadValues$t({}, rest), {
|
|
626
626
|
onError,
|
|
627
627
|
queryFn: () => client.carriers.list(queryFnParams),
|
|
628
628
|
queryKey: ["useListCarriers", queryFnParams],
|
|
@@ -630,22 +630,22 @@ const useListCarriers = (params) => {
|
|
|
630
630
|
}));
|
|
631
631
|
};
|
|
632
632
|
|
|
633
|
-
var __getOwnPropSymbols$
|
|
634
|
-
var __hasOwnProp$
|
|
635
|
-
var __propIsEnum$
|
|
636
|
-
var __objRest$
|
|
633
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
634
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
635
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
636
|
+
var __objRest$n = (source, exclude) => {
|
|
637
637
|
var target = {};
|
|
638
638
|
for (var prop in source)
|
|
639
|
-
if (__hasOwnProp$
|
|
639
|
+
if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
640
640
|
target[prop] = source[prop];
|
|
641
|
-
if (source != null && __getOwnPropSymbols$
|
|
642
|
-
for (var prop of __getOwnPropSymbols$
|
|
643
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
641
|
+
if (source != null && __getOwnPropSymbols$B)
|
|
642
|
+
for (var prop of __getOwnPropSymbols$B(source)) {
|
|
643
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
|
|
644
644
|
target[prop] = source[prop];
|
|
645
645
|
}
|
|
646
646
|
return target;
|
|
647
647
|
};
|
|
648
|
-
var __async$
|
|
648
|
+
var __async$K = (__this, __arguments, generator) => {
|
|
649
649
|
return new Promise((resolve, reject) => {
|
|
650
650
|
var fulfilled = (value) => {
|
|
651
651
|
try {
|
|
@@ -669,8 +669,8 @@ const useUpdateAutoFunding = () => {
|
|
|
669
669
|
const { client } = useShipEngine();
|
|
670
670
|
const queryClient = reactQuery.useQueryClient();
|
|
671
671
|
return reactQuery.useMutation({
|
|
672
|
-
mutationFn: (_a) => __async$
|
|
673
|
-
var _b = _a, { carrierId } = _b, options = __objRest$
|
|
672
|
+
mutationFn: (_a) => __async$K(void 0, null, function* () {
|
|
673
|
+
var _b = _a, { carrierId } = _b, options = __objRest$n(_b, ["carrierId"]);
|
|
674
674
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
675
675
|
return result.data;
|
|
676
676
|
}),
|
|
@@ -699,7 +699,7 @@ const useGetZonesByCarrier = (carrierId) => {
|
|
|
699
699
|
});
|
|
700
700
|
};
|
|
701
701
|
|
|
702
|
-
var __async$
|
|
702
|
+
var __async$J = (__this, __arguments, generator) => {
|
|
703
703
|
return new Promise((resolve, reject) => {
|
|
704
704
|
var fulfilled = (value) => {
|
|
705
705
|
try {
|
|
@@ -722,7 +722,7 @@ var __async$I = (__this, __arguments, generator) => {
|
|
|
722
722
|
const useDeleteCarrier = () => {
|
|
723
723
|
const { client } = useShipEngine();
|
|
724
724
|
return reactQuery.useMutation({
|
|
725
|
-
mutationFn: (carrierId) => __async$
|
|
725
|
+
mutationFn: (carrierId) => __async$J(void 0, null, function* () {
|
|
726
726
|
const result = yield client.carriers.delete(carrierId);
|
|
727
727
|
return result.data;
|
|
728
728
|
}),
|
|
@@ -731,24 +731,24 @@ const useDeleteCarrier = () => {
|
|
|
731
731
|
});
|
|
732
732
|
};
|
|
733
733
|
|
|
734
|
-
var __getOwnPropSymbols$
|
|
735
|
-
var __hasOwnProp$
|
|
736
|
-
var __propIsEnum$
|
|
737
|
-
var __objRest$
|
|
734
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
735
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
736
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
737
|
+
var __objRest$m = (source, exclude) => {
|
|
738
738
|
var target = {};
|
|
739
739
|
for (var prop in source)
|
|
740
|
-
if (__hasOwnProp$
|
|
740
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
741
741
|
target[prop] = source[prop];
|
|
742
|
-
if (source != null && __getOwnPropSymbols$
|
|
743
|
-
for (var prop of __getOwnPropSymbols$
|
|
744
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
742
|
+
if (source != null && __getOwnPropSymbols$A)
|
|
743
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
|
744
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
|
745
745
|
target[prop] = source[prop];
|
|
746
746
|
}
|
|
747
747
|
return target;
|
|
748
748
|
};
|
|
749
749
|
const useGetCarrierConnectionForm = (_params) => {
|
|
750
750
|
const { client } = useShipEngine();
|
|
751
|
-
const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$
|
|
751
|
+
const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$m(_a, ["carrierName", "enabled"]);
|
|
752
752
|
return reactQuery.useQuery({
|
|
753
753
|
enabled,
|
|
754
754
|
onError,
|
|
@@ -758,24 +758,24 @@ const useGetCarrierConnectionForm = (_params) => {
|
|
|
758
758
|
});
|
|
759
759
|
};
|
|
760
760
|
|
|
761
|
-
var __getOwnPropSymbols$
|
|
762
|
-
var __hasOwnProp$
|
|
763
|
-
var __propIsEnum$
|
|
764
|
-
var __objRest$
|
|
761
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
762
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
763
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
764
|
+
var __objRest$l = (source, exclude) => {
|
|
765
765
|
var target = {};
|
|
766
766
|
for (var prop in source)
|
|
767
|
-
if (__hasOwnProp$
|
|
767
|
+
if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
768
768
|
target[prop] = source[prop];
|
|
769
|
-
if (source != null && __getOwnPropSymbols$
|
|
770
|
-
for (var prop of __getOwnPropSymbols$
|
|
771
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
769
|
+
if (source != null && __getOwnPropSymbols$z)
|
|
770
|
+
for (var prop of __getOwnPropSymbols$z(source)) {
|
|
771
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
|
|
772
772
|
target[prop] = source[prop];
|
|
773
773
|
}
|
|
774
774
|
return target;
|
|
775
775
|
};
|
|
776
776
|
const useListCarrierConnections = (_params) => {
|
|
777
777
|
const { client } = useShipEngine();
|
|
778
|
-
const _a = _params || {}, { enabled = true } = _a, params = __objRest$
|
|
778
|
+
const _a = _params || {}, { enabled = true } = _a, params = __objRest$l(_a, ["enabled"]);
|
|
779
779
|
return reactQuery.useQuery({
|
|
780
780
|
enabled,
|
|
781
781
|
onError,
|
|
@@ -785,7 +785,7 @@ const useListCarrierConnections = (_params) => {
|
|
|
785
785
|
});
|
|
786
786
|
};
|
|
787
787
|
|
|
788
|
-
var __async$
|
|
788
|
+
var __async$I = (__this, __arguments, generator) => {
|
|
789
789
|
return new Promise((resolve, reject) => {
|
|
790
790
|
var fulfilled = (value) => {
|
|
791
791
|
try {
|
|
@@ -808,7 +808,7 @@ var __async$H = (__this, __arguments, generator) => {
|
|
|
808
808
|
const useConnectCarrierAccount = () => {
|
|
809
809
|
const { client } = useShipEngine();
|
|
810
810
|
return reactQuery.useMutation({
|
|
811
|
-
mutationFn: (_0) => __async$
|
|
811
|
+
mutationFn: (_0) => __async$I(void 0, [_0], function* ({ carrierName, formData }) {
|
|
812
812
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
813
813
|
return result.data;
|
|
814
814
|
}),
|
|
@@ -828,33 +828,33 @@ const useCarrierConnectionsServicesList = (carrierCode) => {
|
|
|
828
828
|
});
|
|
829
829
|
};
|
|
830
830
|
|
|
831
|
-
var __defProp$
|
|
832
|
-
var __defProps$
|
|
833
|
-
var __getOwnPropDescs$
|
|
834
|
-
var __getOwnPropSymbols$
|
|
835
|
-
var __hasOwnProp$
|
|
836
|
-
var __propIsEnum$
|
|
837
|
-
var __defNormalProp$
|
|
838
|
-
var __spreadValues$
|
|
831
|
+
var __defProp$s = Object.defineProperty;
|
|
832
|
+
var __defProps$r = Object.defineProperties;
|
|
833
|
+
var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
|
|
834
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
835
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
836
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
837
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
838
|
+
var __spreadValues$s = (a, b) => {
|
|
839
839
|
for (var prop in b || (b = {}))
|
|
840
|
-
if (__hasOwnProp$
|
|
841
|
-
__defNormalProp$
|
|
842
|
-
if (__getOwnPropSymbols$
|
|
843
|
-
for (var prop of __getOwnPropSymbols$
|
|
844
|
-
if (__propIsEnum$
|
|
845
|
-
__defNormalProp$
|
|
840
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
841
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
842
|
+
if (__getOwnPropSymbols$y)
|
|
843
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
844
|
+
if (__propIsEnum$y.call(b, prop))
|
|
845
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
846
846
|
}
|
|
847
847
|
return a;
|
|
848
848
|
};
|
|
849
|
-
var __spreadProps$
|
|
850
|
-
var __objRest$
|
|
849
|
+
var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
|
|
850
|
+
var __objRest$k = (source, exclude) => {
|
|
851
851
|
var target = {};
|
|
852
852
|
for (var prop in source)
|
|
853
|
-
if (__hasOwnProp$
|
|
853
|
+
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
854
854
|
target[prop] = source[prop];
|
|
855
|
-
if (source != null && __getOwnPropSymbols$
|
|
856
|
-
for (var prop of __getOwnPropSymbols$
|
|
857
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
855
|
+
if (source != null && __getOwnPropSymbols$y)
|
|
856
|
+
for (var prop of __getOwnPropSymbols$y(source)) {
|
|
857
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
|
|
858
858
|
target[prop] = source[prop];
|
|
859
859
|
}
|
|
860
860
|
return target;
|
|
@@ -862,12 +862,12 @@ var __objRest$i = (source, exclude) => {
|
|
|
862
862
|
const useGetConnectionsCarrierSettings = (_a) => {
|
|
863
863
|
var _b = _a, {
|
|
864
864
|
queryFnParams
|
|
865
|
-
} = _b, params = __objRest$
|
|
865
|
+
} = _b, params = __objRest$k(_b, [
|
|
866
866
|
"queryFnParams"
|
|
867
867
|
]);
|
|
868
868
|
const { client } = useShipEngine();
|
|
869
869
|
const { carrierName, carrierId } = queryFnParams;
|
|
870
|
-
return reactQuery.useQuery(__spreadProps$
|
|
870
|
+
return reactQuery.useQuery(__spreadProps$r(__spreadValues$s({}, params), {
|
|
871
871
|
onError,
|
|
872
872
|
queryFn: () => client.connections.getCarrierSettings(carrierName, carrierId),
|
|
873
873
|
queryKey: ["useGetConnectionsCarrierSettings", carrierName, carrierId],
|
|
@@ -875,26 +875,26 @@ const useGetConnectionsCarrierSettings = (_a) => {
|
|
|
875
875
|
}));
|
|
876
876
|
};
|
|
877
877
|
|
|
878
|
-
var __defProp$
|
|
879
|
-
var __defProps$
|
|
880
|
-
var __getOwnPropDescs$
|
|
881
|
-
var __getOwnPropSymbols$
|
|
882
|
-
var __hasOwnProp$
|
|
883
|
-
var __propIsEnum$
|
|
884
|
-
var __defNormalProp$
|
|
885
|
-
var __spreadValues$
|
|
878
|
+
var __defProp$r = Object.defineProperty;
|
|
879
|
+
var __defProps$q = Object.defineProperties;
|
|
880
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
|
881
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
882
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
883
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
884
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
885
|
+
var __spreadValues$r = (a, b) => {
|
|
886
886
|
for (var prop in b || (b = {}))
|
|
887
|
-
if (__hasOwnProp$
|
|
888
|
-
__defNormalProp$
|
|
889
|
-
if (__getOwnPropSymbols$
|
|
890
|
-
for (var prop of __getOwnPropSymbols$
|
|
891
|
-
if (__propIsEnum$
|
|
892
|
-
__defNormalProp$
|
|
887
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
888
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
889
|
+
if (__getOwnPropSymbols$x)
|
|
890
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
891
|
+
if (__propIsEnum$x.call(b, prop))
|
|
892
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
893
893
|
}
|
|
894
894
|
return a;
|
|
895
895
|
};
|
|
896
|
-
var __spreadProps$
|
|
897
|
-
var __async$
|
|
896
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
|
897
|
+
var __async$H = (__this, __arguments, generator) => {
|
|
898
898
|
return new Promise((resolve, reject) => {
|
|
899
899
|
var fulfilled = (value) => {
|
|
900
900
|
try {
|
|
@@ -916,8 +916,8 @@ var __async$G = (__this, __arguments, generator) => {
|
|
|
916
916
|
};
|
|
917
917
|
const useUpdateConnectionsCarrierSettings = (params) => {
|
|
918
918
|
const { client } = useShipEngine();
|
|
919
|
-
return reactQuery.useMutation(__spreadProps$
|
|
920
|
-
mutationFn: (_0) => __async$
|
|
919
|
+
return reactQuery.useMutation(__spreadProps$q(__spreadValues$r({}, params), {
|
|
920
|
+
mutationFn: (_0) => __async$H(void 0, [_0], function* ({
|
|
921
921
|
carrierName,
|
|
922
922
|
carrierId,
|
|
923
923
|
formData
|
|
@@ -944,7 +944,7 @@ const useListCustomPackageTypes = () => {
|
|
|
944
944
|
});
|
|
945
945
|
};
|
|
946
946
|
|
|
947
|
-
var __async$
|
|
947
|
+
var __async$G = (__this, __arguments, generator) => {
|
|
948
948
|
return new Promise((resolve, reject) => {
|
|
949
949
|
var fulfilled = (value) => {
|
|
950
950
|
try {
|
|
@@ -967,7 +967,7 @@ var __async$F = (__this, __arguments, generator) => {
|
|
|
967
967
|
const useCreateFundingSource = () => {
|
|
968
968
|
const { client } = useShipEngine();
|
|
969
969
|
return reactQuery.useMutation({
|
|
970
|
-
mutationFn: (fundingSource) => __async$
|
|
970
|
+
mutationFn: (fundingSource) => __async$G(void 0, null, function* () {
|
|
971
971
|
const result = yield client.fundingSources.create(fundingSource);
|
|
972
972
|
return result.data;
|
|
973
973
|
}),
|
|
@@ -976,7 +976,7 @@ const useCreateFundingSource = () => {
|
|
|
976
976
|
});
|
|
977
977
|
};
|
|
978
978
|
|
|
979
|
-
var __async$
|
|
979
|
+
var __async$F = (__this, __arguments, generator) => {
|
|
980
980
|
return new Promise((resolve, reject) => {
|
|
981
981
|
var fulfilled = (value) => {
|
|
982
982
|
try {
|
|
@@ -999,7 +999,7 @@ var __async$E = (__this, __arguments, generator) => {
|
|
|
999
999
|
const useFundingSourcesAddFunds = () => {
|
|
1000
1000
|
const { client } = useShipEngine();
|
|
1001
1001
|
return reactQuery.useMutation({
|
|
1002
|
-
mutationFn: (_0) => __async$
|
|
1002
|
+
mutationFn: (_0) => __async$F(void 0, [_0], function* ({ funds, fundingSourceId }) {
|
|
1003
1003
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
1004
1004
|
return result.data;
|
|
1005
1005
|
}),
|
|
@@ -1028,7 +1028,7 @@ const useListFundingSources = () => {
|
|
|
1028
1028
|
});
|
|
1029
1029
|
};
|
|
1030
1030
|
|
|
1031
|
-
var __async$
|
|
1031
|
+
var __async$E = (__this, __arguments, generator) => {
|
|
1032
1032
|
return new Promise((resolve, reject) => {
|
|
1033
1033
|
var fulfilled = (value) => {
|
|
1034
1034
|
try {
|
|
@@ -1051,7 +1051,7 @@ var __async$D = (__this, __arguments, generator) => {
|
|
|
1051
1051
|
const useRegisterCarrier = () => {
|
|
1052
1052
|
const { client } = useShipEngine();
|
|
1053
1053
|
return reactQuery.useMutation({
|
|
1054
|
-
mutationFn: (carrier) => __async$
|
|
1054
|
+
mutationFn: (carrier) => __async$E(void 0, null, function* () {
|
|
1055
1055
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
1056
1056
|
return result.data;
|
|
1057
1057
|
}),
|
|
@@ -1060,7 +1060,7 @@ const useRegisterCarrier = () => {
|
|
|
1060
1060
|
});
|
|
1061
1061
|
};
|
|
1062
1062
|
|
|
1063
|
-
var __async$
|
|
1063
|
+
var __async$D = (__this, __arguments, generator) => {
|
|
1064
1064
|
return new Promise((resolve, reject) => {
|
|
1065
1065
|
var fulfilled = (value) => {
|
|
1066
1066
|
try {
|
|
@@ -1083,7 +1083,7 @@ var __async$C = (__this, __arguments, generator) => {
|
|
|
1083
1083
|
const useUpdateFundingSource = () => {
|
|
1084
1084
|
const { client } = useShipEngine();
|
|
1085
1085
|
return reactQuery.useMutation({
|
|
1086
|
-
mutationFn: (_0) => __async$
|
|
1086
|
+
mutationFn: (_0) => __async$D(void 0, [_0], function* ({
|
|
1087
1087
|
billingInfo,
|
|
1088
1088
|
creditCardInfo,
|
|
1089
1089
|
fundingSourceId,
|
|
@@ -1124,29 +1124,29 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
|
|
|
1124
1124
|
});
|
|
1125
1125
|
};
|
|
1126
1126
|
|
|
1127
|
-
var __defProp$
|
|
1128
|
-
var __defProps$
|
|
1129
|
-
var __getOwnPropDescs$
|
|
1130
|
-
var __getOwnPropSymbols$
|
|
1131
|
-
var __hasOwnProp$
|
|
1132
|
-
var __propIsEnum$
|
|
1133
|
-
var __defNormalProp$
|
|
1134
|
-
var __spreadValues$
|
|
1127
|
+
var __defProp$q = Object.defineProperty;
|
|
1128
|
+
var __defProps$p = Object.defineProperties;
|
|
1129
|
+
var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
|
|
1130
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
1131
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
1132
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
1133
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1134
|
+
var __spreadValues$q = (a, b) => {
|
|
1135
1135
|
for (var prop in b || (b = {}))
|
|
1136
|
-
if (__hasOwnProp$
|
|
1137
|
-
__defNormalProp$
|
|
1138
|
-
if (__getOwnPropSymbols$
|
|
1139
|
-
for (var prop of __getOwnPropSymbols$
|
|
1140
|
-
if (__propIsEnum$
|
|
1141
|
-
__defNormalProp$
|
|
1136
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
1137
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
1138
|
+
if (__getOwnPropSymbols$w)
|
|
1139
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
1140
|
+
if (__propIsEnum$w.call(b, prop))
|
|
1141
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
1142
1142
|
}
|
|
1143
1143
|
return a;
|
|
1144
1144
|
};
|
|
1145
|
-
var __spreadProps$
|
|
1145
|
+
var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
|
|
1146
1146
|
const useGetInsuranceFundingSourceAcceptedTerms = (params) => {
|
|
1147
1147
|
const { client } = useShipEngine();
|
|
1148
|
-
const queryParams = __spreadValues$
|
|
1149
|
-
return reactQuery.useQuery(__spreadProps$
|
|
1148
|
+
const queryParams = __spreadValues$q({}, params);
|
|
1149
|
+
return reactQuery.useQuery(__spreadProps$p(__spreadValues$q({}, queryParams), {
|
|
1150
1150
|
onError,
|
|
1151
1151
|
queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
|
|
1152
1152
|
queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
|
|
@@ -1169,22 +1169,22 @@ const useGetInsuranceAccount = (insuranceProvider) => {
|
|
|
1169
1169
|
});
|
|
1170
1170
|
};
|
|
1171
1171
|
|
|
1172
|
-
var __getOwnPropSymbols$
|
|
1173
|
-
var __hasOwnProp$
|
|
1174
|
-
var __propIsEnum$
|
|
1175
|
-
var __objRest$
|
|
1172
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
1173
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
1174
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
1175
|
+
var __objRest$j = (source, exclude) => {
|
|
1176
1176
|
var target = {};
|
|
1177
1177
|
for (var prop in source)
|
|
1178
|
-
if (__hasOwnProp$
|
|
1178
|
+
if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1179
1179
|
target[prop] = source[prop];
|
|
1180
|
-
if (source != null && __getOwnPropSymbols$
|
|
1181
|
-
for (var prop of __getOwnPropSymbols$
|
|
1182
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1180
|
+
if (source != null && __getOwnPropSymbols$v)
|
|
1181
|
+
for (var prop of __getOwnPropSymbols$v(source)) {
|
|
1182
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
|
|
1183
1183
|
target[prop] = source[prop];
|
|
1184
1184
|
}
|
|
1185
1185
|
return target;
|
|
1186
1186
|
};
|
|
1187
|
-
var __async$
|
|
1187
|
+
var __async$C = (__this, __arguments, generator) => {
|
|
1188
1188
|
return new Promise((resolve, reject) => {
|
|
1189
1189
|
var fulfilled = (value) => {
|
|
1190
1190
|
try {
|
|
@@ -1207,8 +1207,8 @@ var __async$B = (__this, __arguments, generator) => {
|
|
|
1207
1207
|
const useAddInsuranceFunds = () => {
|
|
1208
1208
|
const { client } = useShipEngine();
|
|
1209
1209
|
return reactQuery.useMutation({
|
|
1210
|
-
mutationFn: (_a) => __async$
|
|
1211
|
-
var _b = _a, { insuranceProvider } = _b, rest = __objRest$
|
|
1210
|
+
mutationFn: (_a) => __async$C(void 0, null, function* () {
|
|
1211
|
+
var _b = _a, { insuranceProvider } = _b, rest = __objRest$j(_b, ["insuranceProvider"]);
|
|
1212
1212
|
const result = yield client.insurance.addFunds(insuranceProvider, rest);
|
|
1213
1213
|
return result.data;
|
|
1214
1214
|
}),
|
|
@@ -1217,26 +1217,26 @@ const useAddInsuranceFunds = () => {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
};
|
|
1219
1219
|
|
|
1220
|
-
var __defProp$
|
|
1221
|
-
var __defProps$
|
|
1222
|
-
var __getOwnPropDescs$
|
|
1223
|
-
var __getOwnPropSymbols$
|
|
1224
|
-
var __hasOwnProp$
|
|
1225
|
-
var __propIsEnum$
|
|
1226
|
-
var __defNormalProp$
|
|
1227
|
-
var __spreadValues$
|
|
1220
|
+
var __defProp$p = Object.defineProperty;
|
|
1221
|
+
var __defProps$o = Object.defineProperties;
|
|
1222
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
|
1223
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
1224
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
1225
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
1226
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1227
|
+
var __spreadValues$p = (a, b) => {
|
|
1228
1228
|
for (var prop in b || (b = {}))
|
|
1229
|
-
if (__hasOwnProp$
|
|
1230
|
-
__defNormalProp$
|
|
1231
|
-
if (__getOwnPropSymbols$
|
|
1232
|
-
for (var prop of __getOwnPropSymbols$
|
|
1233
|
-
if (__propIsEnum$
|
|
1234
|
-
__defNormalProp$
|
|
1229
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
1230
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
1231
|
+
if (__getOwnPropSymbols$u)
|
|
1232
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
1233
|
+
if (__propIsEnum$u.call(b, prop))
|
|
1234
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
1235
1235
|
}
|
|
1236
1236
|
return a;
|
|
1237
1237
|
};
|
|
1238
|
-
var __spreadProps$
|
|
1239
|
-
var __async$
|
|
1238
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
|
1239
|
+
var __async$B = (__this, __arguments, generator) => {
|
|
1240
1240
|
return new Promise((resolve, reject) => {
|
|
1241
1241
|
var fulfilled = (value) => {
|
|
1242
1242
|
try {
|
|
@@ -1258,8 +1258,8 @@ var __async$A = (__this, __arguments, generator) => {
|
|
|
1258
1258
|
};
|
|
1259
1259
|
const useCreateInvoiceAddress = (params) => {
|
|
1260
1260
|
const { client } = useShipEngine();
|
|
1261
|
-
return reactQuery.useMutation(__spreadProps$
|
|
1262
|
-
mutationFn: (invoiceAddress) => __async$
|
|
1261
|
+
return reactQuery.useMutation(__spreadProps$o(__spreadValues$p({}, params), {
|
|
1262
|
+
mutationFn: (invoiceAddress) => __async$B(void 0, null, function* () {
|
|
1263
1263
|
const result = yield client.invoiceAddress.create(invoiceAddress);
|
|
1264
1264
|
return result.data;
|
|
1265
1265
|
}),
|
|
@@ -1268,6 +1268,86 @@ const useCreateInvoiceAddress = (params) => {
|
|
|
1268
1268
|
}));
|
|
1269
1269
|
};
|
|
1270
1270
|
|
|
1271
|
+
var __defProp$o = Object.defineProperty;
|
|
1272
|
+
var __defProps$n = Object.defineProperties;
|
|
1273
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
|
1274
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
1275
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
1276
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
1277
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1278
|
+
var __spreadValues$o = (a, b) => {
|
|
1279
|
+
for (var prop in b || (b = {}))
|
|
1280
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
1281
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
1282
|
+
if (__getOwnPropSymbols$t)
|
|
1283
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
1284
|
+
if (__propIsEnum$t.call(b, prop))
|
|
1285
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
1286
|
+
}
|
|
1287
|
+
return a;
|
|
1288
|
+
};
|
|
1289
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
1290
|
+
var __async$A = (__this, __arguments, generator) => {
|
|
1291
|
+
return new Promise((resolve, reject) => {
|
|
1292
|
+
var fulfilled = (value) => {
|
|
1293
|
+
try {
|
|
1294
|
+
step(generator.next(value));
|
|
1295
|
+
} catch (e) {
|
|
1296
|
+
reject(e);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
var rejected = (value) => {
|
|
1300
|
+
try {
|
|
1301
|
+
step(generator.throw(value));
|
|
1302
|
+
} catch (e) {
|
|
1303
|
+
reject(e);
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1307
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1308
|
+
});
|
|
1309
|
+
};
|
|
1310
|
+
const useUpdateInvoiceAddress = (params) => {
|
|
1311
|
+
const { client } = useShipEngine();
|
|
1312
|
+
return reactQuery.useMutation(__spreadProps$n(__spreadValues$o({}, params), {
|
|
1313
|
+
mutationFn: (invoiceAddress) => __async$A(void 0, null, function* () {
|
|
1314
|
+
const result = yield client.invoiceAddress.update(invoiceAddress);
|
|
1315
|
+
return result.data;
|
|
1316
|
+
}),
|
|
1317
|
+
mutationKey: ["useUpdateInvoiceAddress"],
|
|
1318
|
+
onError
|
|
1319
|
+
}));
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
var __defProp$n = Object.defineProperty;
|
|
1323
|
+
var __defProps$m = Object.defineProperties;
|
|
1324
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
|
1325
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
1326
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
1327
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
1328
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1329
|
+
var __spreadValues$n = (a, b) => {
|
|
1330
|
+
for (var prop in b || (b = {}))
|
|
1331
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
1332
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
1333
|
+
if (__getOwnPropSymbols$s)
|
|
1334
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
1335
|
+
if (__propIsEnum$s.call(b, prop))
|
|
1336
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
1337
|
+
}
|
|
1338
|
+
return a;
|
|
1339
|
+
};
|
|
1340
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
|
1341
|
+
const useGetInvoiceAddress = (params) => {
|
|
1342
|
+
const { client } = useShipEngine();
|
|
1343
|
+
return reactQuery.useQuery(__spreadProps$m(__spreadValues$n({}, params), {
|
|
1344
|
+
onError,
|
|
1345
|
+
queryFn: () => client.invoiceAddress.get(),
|
|
1346
|
+
queryKey: ["useGetInvoiceAddress"],
|
|
1347
|
+
select: (result) => result.data
|
|
1348
|
+
}));
|
|
1349
|
+
};
|
|
1350
|
+
|
|
1271
1351
|
var __defProp$m = Object.defineProperty;
|
|
1272
1352
|
var __defProps$l = Object.defineProperties;
|
|
1273
1353
|
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
@@ -1287,6 +1367,18 @@ var __spreadValues$m = (a, b) => {
|
|
|
1287
1367
|
return a;
|
|
1288
1368
|
};
|
|
1289
1369
|
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
1370
|
+
var __objRest$i = (source, exclude) => {
|
|
1371
|
+
var target = {};
|
|
1372
|
+
for (var prop in source)
|
|
1373
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1374
|
+
target[prop] = source[prop];
|
|
1375
|
+
if (source != null && __getOwnPropSymbols$r)
|
|
1376
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
|
1377
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
|
1378
|
+
target[prop] = source[prop];
|
|
1379
|
+
}
|
|
1380
|
+
return target;
|
|
1381
|
+
};
|
|
1290
1382
|
var __async$z = (__this, __arguments, generator) => {
|
|
1291
1383
|
return new Promise((resolve, reject) => {
|
|
1292
1384
|
var fulfilled = (value) => {
|
|
@@ -1307,14 +1399,15 @@ var __async$z = (__this, __arguments, generator) => {
|
|
|
1307
1399
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
1308
1400
|
});
|
|
1309
1401
|
};
|
|
1310
|
-
const
|
|
1402
|
+
const useCreateLabelByRateId = (params) => {
|
|
1311
1403
|
const { client } = useShipEngine();
|
|
1312
1404
|
return reactQuery.useMutation(__spreadProps$l(__spreadValues$m({}, params), {
|
|
1313
|
-
mutationFn: (
|
|
1314
|
-
|
|
1405
|
+
mutationFn: (_a) => __async$z(void 0, null, function* () {
|
|
1406
|
+
var _b = _a, { rateId } = _b, options = __objRest$i(_b, ["rateId"]);
|
|
1407
|
+
const result = yield client.labels.createByRateId(rateId, options);
|
|
1315
1408
|
return result.data;
|
|
1316
1409
|
}),
|
|
1317
|
-
mutationKey: ["
|
|
1410
|
+
mutationKey: ["useCreateLabelByRateId"],
|
|
1318
1411
|
onError
|
|
1319
1412
|
}));
|
|
1320
1413
|
};
|
|
@@ -1338,13 +1431,48 @@ var __spreadValues$l = (a, b) => {
|
|
|
1338
1431
|
return a;
|
|
1339
1432
|
};
|
|
1340
1433
|
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
1341
|
-
|
|
1434
|
+
var __objRest$h = (source, exclude) => {
|
|
1435
|
+
var target = {};
|
|
1436
|
+
for (var prop in source)
|
|
1437
|
+
if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1438
|
+
target[prop] = source[prop];
|
|
1439
|
+
if (source != null && __getOwnPropSymbols$q)
|
|
1440
|
+
for (var prop of __getOwnPropSymbols$q(source)) {
|
|
1441
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
|
|
1442
|
+
target[prop] = source[prop];
|
|
1443
|
+
}
|
|
1444
|
+
return target;
|
|
1445
|
+
};
|
|
1446
|
+
var __async$y = (__this, __arguments, generator) => {
|
|
1447
|
+
return new Promise((resolve, reject) => {
|
|
1448
|
+
var fulfilled = (value) => {
|
|
1449
|
+
try {
|
|
1450
|
+
step(generator.next(value));
|
|
1451
|
+
} catch (e) {
|
|
1452
|
+
reject(e);
|
|
1453
|
+
}
|
|
1454
|
+
};
|
|
1455
|
+
var rejected = (value) => {
|
|
1456
|
+
try {
|
|
1457
|
+
step(generator.throw(value));
|
|
1458
|
+
} catch (e) {
|
|
1459
|
+
reject(e);
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1463
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1464
|
+
});
|
|
1465
|
+
};
|
|
1466
|
+
const useCreateLabelByShipmentId = (params) => {
|
|
1342
1467
|
const { client } = useShipEngine();
|
|
1343
|
-
return reactQuery.
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1468
|
+
return reactQuery.useMutation(__spreadProps$k(__spreadValues$l({}, params), {
|
|
1469
|
+
mutationFn: (_a) => __async$y(void 0, null, function* () {
|
|
1470
|
+
var _b = _a, { shipmentId } = _b, options = __objRest$h(_b, ["shipmentId"]);
|
|
1471
|
+
const result = yield client.labels.createByShipmentId(shipmentId, options);
|
|
1472
|
+
return result.data;
|
|
1473
|
+
}),
|
|
1474
|
+
mutationKey: ["useCreateLabelByShipmentId"],
|
|
1475
|
+
onError
|
|
1348
1476
|
}));
|
|
1349
1477
|
};
|
|
1350
1478
|
|
|
@@ -1379,7 +1507,7 @@ var __objRest$g = (source, exclude) => {
|
|
|
1379
1507
|
}
|
|
1380
1508
|
return target;
|
|
1381
1509
|
};
|
|
1382
|
-
var __async$
|
|
1510
|
+
var __async$x = (__this, __arguments, generator) => {
|
|
1383
1511
|
return new Promise((resolve, reject) => {
|
|
1384
1512
|
var fulfilled = (value) => {
|
|
1385
1513
|
try {
|
|
@@ -1399,10 +1527,10 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
1399
1527
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
1400
1528
|
});
|
|
1401
1529
|
};
|
|
1402
|
-
const
|
|
1530
|
+
const useCreateLabel = (params) => {
|
|
1403
1531
|
const { client } = useShipEngine();
|
|
1404
1532
|
return reactQuery.useMutation(__spreadProps$j(__spreadValues$k({}, params), {
|
|
1405
|
-
mutationFn: (_a) => __async$
|
|
1533
|
+
mutationFn: (_a) => __async$x(void 0, null, function* () {
|
|
1406
1534
|
var _b = _a, { rateId } = _b, options = __objRest$g(_b, ["rateId"]);
|
|
1407
1535
|
const result = yield client.labels.createByRateId(rateId, options);
|
|
1408
1536
|
return result.data;
|
|
@@ -1412,6 +1540,21 @@ const useCreateLabelByRateId = (params) => {
|
|
|
1412
1540
|
}));
|
|
1413
1541
|
};
|
|
1414
1542
|
|
|
1543
|
+
const useGetLabel = (labelId) => {
|
|
1544
|
+
const { client } = useShipEngine();
|
|
1545
|
+
return reactQuery.useQuery({
|
|
1546
|
+
enabled: labelId !== void 0,
|
|
1547
|
+
onError,
|
|
1548
|
+
queryFn: () => {
|
|
1549
|
+
if (labelId)
|
|
1550
|
+
return client.labels.get(labelId);
|
|
1551
|
+
return Promise.reject(new Error("labelId is require"));
|
|
1552
|
+
},
|
|
1553
|
+
queryKey: ["useGetLabel", labelId],
|
|
1554
|
+
select: (result) => result.data
|
|
1555
|
+
});
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1415
1558
|
var __defProp$j = Object.defineProperty;
|
|
1416
1559
|
var __defProps$i = Object.defineProperties;
|
|
1417
1560
|
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
@@ -1443,7 +1586,18 @@ var __objRest$f = (source, exclude) => {
|
|
|
1443
1586
|
}
|
|
1444
1587
|
return target;
|
|
1445
1588
|
};
|
|
1446
|
-
|
|
1589
|
+
const useListLabels = (params) => {
|
|
1590
|
+
const { client } = useShipEngine();
|
|
1591
|
+
const _a = __spreadValues$j({}, params), { queryFnParams } = _a, rest = __objRest$f(_a, ["queryFnParams"]);
|
|
1592
|
+
return reactQuery.useQuery(__spreadProps$i(__spreadValues$j({}, rest), {
|
|
1593
|
+
onError,
|
|
1594
|
+
queryFn: () => client.labels.list(queryFnParams),
|
|
1595
|
+
queryKey: ["useListLabels", params],
|
|
1596
|
+
select: (result) => result.data
|
|
1597
|
+
}));
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
1447
1601
|
return new Promise((resolve, reject) => {
|
|
1448
1602
|
var fulfilled = (value) => {
|
|
1449
1603
|
try {
|
|
@@ -1463,31 +1617,15 @@ var __async$x = (__this, __arguments, generator) => {
|
|
|
1463
1617
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
1464
1618
|
});
|
|
1465
1619
|
};
|
|
1466
|
-
const
|
|
1620
|
+
const useVoidLabel = () => {
|
|
1467
1621
|
const { client } = useShipEngine();
|
|
1468
|
-
return reactQuery.useMutation(
|
|
1469
|
-
mutationFn: (
|
|
1470
|
-
|
|
1471
|
-
const result = yield client.labels.createByShipmentId(shipmentId, options);
|
|
1622
|
+
return reactQuery.useMutation({
|
|
1623
|
+
mutationFn: (labelId) => __async$w(void 0, null, function* () {
|
|
1624
|
+
const result = yield client.labels.void(labelId);
|
|
1472
1625
|
return result.data;
|
|
1473
1626
|
}),
|
|
1474
|
-
mutationKey: ["
|
|
1627
|
+
mutationKey: ["useVoidLabel"],
|
|
1475
1628
|
onError
|
|
1476
|
-
}));
|
|
1477
|
-
};
|
|
1478
|
-
|
|
1479
|
-
const useGetLabel = (labelId) => {
|
|
1480
|
-
const { client } = useShipEngine();
|
|
1481
|
-
return reactQuery.useQuery({
|
|
1482
|
-
enabled: labelId !== void 0,
|
|
1483
|
-
onError,
|
|
1484
|
-
queryFn: () => {
|
|
1485
|
-
if (labelId)
|
|
1486
|
-
return client.labels.get(labelId);
|
|
1487
|
-
return Promise.reject(new Error("labelId is require"));
|
|
1488
|
-
},
|
|
1489
|
-
queryKey: ["useGetLabel", labelId],
|
|
1490
|
-
select: (result) => result.data
|
|
1491
1629
|
});
|
|
1492
1630
|
};
|
|
1493
1631
|
|
|
@@ -1522,18 +1660,7 @@ var __objRest$e = (source, exclude) => {
|
|
|
1522
1660
|
}
|
|
1523
1661
|
return target;
|
|
1524
1662
|
};
|
|
1525
|
-
|
|
1526
|
-
const { client } = useShipEngine();
|
|
1527
|
-
const _a = __spreadValues$i({}, params), { queryFnParams } = _a, rest = __objRest$e(_a, ["queryFnParams"]);
|
|
1528
|
-
return reactQuery.useQuery(__spreadProps$h(__spreadValues$i({}, rest), {
|
|
1529
|
-
onError,
|
|
1530
|
-
queryFn: () => client.labels.list(queryFnParams),
|
|
1531
|
-
queryKey: ["useListLabels", params],
|
|
1532
|
-
select: (result) => result.data
|
|
1533
|
-
}));
|
|
1534
|
-
};
|
|
1535
|
-
|
|
1536
|
-
var __async$w = (__this, __arguments, generator) => {
|
|
1663
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
1537
1664
|
return new Promise((resolve, reject) => {
|
|
1538
1665
|
var fulfilled = (value) => {
|
|
1539
1666
|
try {
|
|
@@ -1553,16 +1680,30 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
1553
1680
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
1554
1681
|
});
|
|
1555
1682
|
};
|
|
1556
|
-
const
|
|
1683
|
+
const useListLabelsInfinite = (params) => {
|
|
1557
1684
|
const { client } = useShipEngine();
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1685
|
+
const _a = __spreadValues$i({}, params), { queryFnParams } = _a, rest = __objRest$e(_a, ["queryFnParams"]);
|
|
1686
|
+
return reactQuery.useInfiniteQuery(__spreadProps$h(__spreadValues$i({}, rest), {
|
|
1687
|
+
getNextPageParam: (lastPage) => {
|
|
1688
|
+
if (lastPage.page < lastPage.pages) {
|
|
1689
|
+
return lastPage.page + 1;
|
|
1690
|
+
}
|
|
1691
|
+
return void 0;
|
|
1692
|
+
},
|
|
1693
|
+
onError,
|
|
1694
|
+
queryFn: (_0) => __async$v(void 0, [_0], function* ({ pageParam = 1 }) {
|
|
1695
|
+
const response = yield client.labels.list(__spreadProps$h(__spreadValues$i({}, queryFnParams), { page: pageParam }));
|
|
1696
|
+
return response.data;
|
|
1562
1697
|
}),
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1698
|
+
queryKey: ["useListLabelsInfinite", params],
|
|
1699
|
+
select: (data) => {
|
|
1700
|
+
return {
|
|
1701
|
+
labels: data.pages.flatMap((page) => page.labels),
|
|
1702
|
+
pageParams: data.pageParams,
|
|
1703
|
+
pages: data.pages
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
}));
|
|
1566
1707
|
};
|
|
1567
1708
|
|
|
1568
1709
|
var __defProp$h = Object.defineProperty;
|
|
@@ -1596,49 +1737,13 @@ var __objRest$d = (source, exclude) => {
|
|
|
1596
1737
|
}
|
|
1597
1738
|
return target;
|
|
1598
1739
|
};
|
|
1599
|
-
|
|
1600
|
-
return new Promise((resolve, reject) => {
|
|
1601
|
-
var fulfilled = (value) => {
|
|
1602
|
-
try {
|
|
1603
|
-
step(generator.next(value));
|
|
1604
|
-
} catch (e) {
|
|
1605
|
-
reject(e);
|
|
1606
|
-
}
|
|
1607
|
-
};
|
|
1608
|
-
var rejected = (value) => {
|
|
1609
|
-
try {
|
|
1610
|
-
step(generator.throw(value));
|
|
1611
|
-
} catch (e) {
|
|
1612
|
-
reject(e);
|
|
1613
|
-
}
|
|
1614
|
-
};
|
|
1615
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1616
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
1617
|
-
});
|
|
1618
|
-
};
|
|
1619
|
-
const useListLabelsInfinite = (params) => {
|
|
1740
|
+
const useDownloadLabels = (params) => {
|
|
1620
1741
|
const { client } = useShipEngine();
|
|
1621
1742
|
const _a = __spreadValues$h({}, params), { queryFnParams } = _a, rest = __objRest$d(_a, ["queryFnParams"]);
|
|
1622
|
-
return reactQuery.
|
|
1623
|
-
getNextPageParam: (lastPage) => {
|
|
1624
|
-
if (lastPage.page < lastPage.pages) {
|
|
1625
|
-
return lastPage.page + 1;
|
|
1626
|
-
}
|
|
1627
|
-
return void 0;
|
|
1628
|
-
},
|
|
1743
|
+
return reactQuery.useQuery(__spreadProps$g(__spreadValues$h({}, rest), {
|
|
1629
1744
|
onError,
|
|
1630
|
-
queryFn: (
|
|
1631
|
-
|
|
1632
|
-
return response.data;
|
|
1633
|
-
}),
|
|
1634
|
-
queryKey: ["useListLabelsInfinite", params],
|
|
1635
|
-
select: (data) => {
|
|
1636
|
-
return {
|
|
1637
|
-
labels: data.pages.flatMap((page) => page.labels),
|
|
1638
|
-
pageParams: data.pageParams,
|
|
1639
|
-
pages: data.pages
|
|
1640
|
-
};
|
|
1641
|
-
}
|
|
1745
|
+
queryFn: () => client.labels.download(queryFnParams),
|
|
1746
|
+
queryKey: ["useDownloadLabels", params]
|
|
1642
1747
|
}));
|
|
1643
1748
|
};
|
|
1644
1749
|
|
|
@@ -3568,6 +3673,7 @@ exports.useCreateAccountImage = useCreateAccountImage;
|
|
|
3568
3673
|
exports.useCreateAuctanePaySession = useCreateAuctanePaySession;
|
|
3569
3674
|
exports.useCreateFundingSource = useCreateFundingSource;
|
|
3570
3675
|
exports.useCreateInvoiceAddress = useCreateInvoiceAddress;
|
|
3676
|
+
exports.useCreateLabel = useCreateLabel;
|
|
3571
3677
|
exports.useCreateLabelByRateId = useCreateLabelByRateId;
|
|
3572
3678
|
exports.useCreateLabelByShipmentId = useCreateLabelByShipmentId;
|
|
3573
3679
|
exports.useCreateRateCard = useCreateRateCard;
|
|
@@ -3586,6 +3692,7 @@ exports.useDeleteSellerApiKey = useDeleteSellerApiKey;
|
|
|
3586
3692
|
exports.useDeleteShippingRule = useDeleteShippingRule;
|
|
3587
3693
|
exports.useDeleteWarehouse = useDeleteWarehouse;
|
|
3588
3694
|
exports.useDeleteWebhook = useDeleteWebhook;
|
|
3695
|
+
exports.useDownloadLabels = useDownloadLabels;
|
|
3589
3696
|
exports.useDownloadRateCard = useDownloadRateCard;
|
|
3590
3697
|
exports.useEditShippingRule = useEditShippingRule;
|
|
3591
3698
|
exports.useFundingSourcesAddFunds = useFundingSourcesAddFunds;
|