@shipengine/react-api 4.10.0 → 4.11.1
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PaymentAccountResponse } from "@shipengine/js-api";
|
|
2
|
+
import { QueryProps } from "../../utilities";
|
|
3
|
+
/**
|
|
4
|
+
* @category ShipEngine API Hooks
|
|
5
|
+
* @see https://auctane.atlassian.net/wiki/spaces/SEEU/pages/5906662077/AUCTANE+PAY+ENDPOINTS+FOR+SHIPSTATION+API
|
|
6
|
+
*/
|
|
7
|
+
export declare const useGetPaymentAccount: (params?: QueryProps<PaymentAccountResponse>) => import("@tanstack/react-query").UseQueryResult<PaymentAccountResponse, import("@shipengine/js-api").CodedError[]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SE } from "@shipengine/js-api";
|
|
2
|
+
import { MutationProps } from "../../utilities";
|
|
3
|
+
/**
|
|
4
|
+
* @category ShipEngine API Hooks
|
|
5
|
+
* @see https://auctane.atlassian.net/wiki/spaces/SEEU/pages/5906662077/AUCTANE+PAY+ENDPOINTS+FOR+SHIPSTATION+API
|
|
6
|
+
*/
|
|
7
|
+
export declare const useIdentityVerification: (params?: MutationProps<unknown, SE.IdentityVerificationResponse>) => import("@tanstack/react-query").UseMutationResult<SE.IdentityVerificationResponse, SE.CodedError[], void, unknown>;
|
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$H = Object.defineProperty;
|
|
83
|
+
var __defProps$G = Object.defineProperties;
|
|
84
|
+
var __getOwnPropDescs$G = Object.getOwnPropertyDescriptors;
|
|
85
|
+
var __getOwnPropSymbols$Q = Object.getOwnPropertySymbols;
|
|
86
|
+
var __hasOwnProp$Q = Object.prototype.hasOwnProperty;
|
|
87
|
+
var __propIsEnum$Q = Object.prototype.propertyIsEnumerable;
|
|
88
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
89
|
+
var __spreadValues$H = (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$Q.call(b, prop))
|
|
92
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
93
|
+
if (__getOwnPropSymbols$Q)
|
|
94
|
+
for (var prop of __getOwnPropSymbols$Q(b)) {
|
|
95
|
+
if (__propIsEnum$Q.call(b, prop))
|
|
96
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
97
97
|
}
|
|
98
98
|
return a;
|
|
99
99
|
};
|
|
100
|
-
var __spreadProps$
|
|
100
|
+
var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(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$G(__spreadValues$H({}, 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$Y = (__this, __arguments, generator) => {
|
|
135
135
|
return new Promise((resolve, reject) => {
|
|
136
136
|
var fulfilled = (value) => {
|
|
137
137
|
try {
|
|
@@ -154,7 +154,7 @@ var __async$X = (__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$Y(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$X = (__this, __arguments, generator) => {
|
|
167
167
|
return new Promise((resolve, reject) => {
|
|
168
168
|
var fulfilled = (value) => {
|
|
169
169
|
try {
|
|
@@ -186,7 +186,7 @@ var __async$W = (__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$X(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$W = (__this, __arguments, generator) => {
|
|
219
219
|
return new Promise((resolve, reject) => {
|
|
220
220
|
var fulfilled = (value) => {
|
|
221
221
|
try {
|
|
@@ -238,7 +238,7 @@ var __async$V = (__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$W(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$V = (__this, __arguments, generator) => {
|
|
251
251
|
return new Promise((resolve, reject) => {
|
|
252
252
|
var fulfilled = (value) => {
|
|
253
253
|
try {
|
|
@@ -270,7 +270,7 @@ var __async$U = (__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$V(void 0, null, function* () {
|
|
274
274
|
const result = yield client.accountSettings.update(settings);
|
|
275
275
|
return result.data;
|
|
276
276
|
}),
|
|
@@ -279,28 +279,28 @@ const useUpdateAccountSettings = () => {
|
|
|
279
279
|
});
|
|
280
280
|
};
|
|
281
281
|
|
|
282
|
-
var __defProp$
|
|
283
|
-
var __defProps$
|
|
284
|
-
var __getOwnPropDescs$
|
|
285
|
-
var __getOwnPropSymbols$
|
|
286
|
-
var __hasOwnProp$
|
|
287
|
-
var __propIsEnum$
|
|
288
|
-
var __defNormalProp$
|
|
289
|
-
var __spreadValues$
|
|
282
|
+
var __defProp$G = Object.defineProperty;
|
|
283
|
+
var __defProps$F = Object.defineProperties;
|
|
284
|
+
var __getOwnPropDescs$F = Object.getOwnPropertyDescriptors;
|
|
285
|
+
var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
|
|
286
|
+
var __hasOwnProp$P = Object.prototype.hasOwnProperty;
|
|
287
|
+
var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
|
|
288
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
289
|
+
var __spreadValues$G = (a, b) => {
|
|
290
290
|
for (var prop in b || (b = {}))
|
|
291
|
-
if (__hasOwnProp$
|
|
292
|
-
__defNormalProp$
|
|
293
|
-
if (__getOwnPropSymbols$
|
|
294
|
-
for (var prop of __getOwnPropSymbols$
|
|
295
|
-
if (__propIsEnum$
|
|
296
|
-
__defNormalProp$
|
|
291
|
+
if (__hasOwnProp$P.call(b, prop))
|
|
292
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
293
|
+
if (__getOwnPropSymbols$P)
|
|
294
|
+
for (var prop of __getOwnPropSymbols$P(b)) {
|
|
295
|
+
if (__propIsEnum$P.call(b, prop))
|
|
296
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
297
297
|
}
|
|
298
298
|
return a;
|
|
299
299
|
};
|
|
300
|
-
var __spreadProps$
|
|
300
|
+
var __spreadProps$F = (a, b) => __defProps$F(a, __getOwnPropDescs$F(b));
|
|
301
301
|
const useListAccountAddons = (params) => {
|
|
302
302
|
const { client } = useShipEngine();
|
|
303
|
-
return reactQuery.useQuery(__spreadProps$
|
|
303
|
+
return reactQuery.useQuery(__spreadProps$F(__spreadValues$G({}, params), {
|
|
304
304
|
onError,
|
|
305
305
|
queryFn: () => client.accountAddons.list(),
|
|
306
306
|
queryKey: ["useListAccountAddons"],
|
|
@@ -308,7 +308,7 @@ const useListAccountAddons = (params) => {
|
|
|
308
308
|
}));
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
-
var __async$
|
|
311
|
+
var __async$U = (__this, __arguments, generator) => {
|
|
312
312
|
return new Promise((resolve, reject) => {
|
|
313
313
|
var fulfilled = (value) => {
|
|
314
314
|
try {
|
|
@@ -331,7 +331,7 @@ var __async$T = (__this, __arguments, generator) => {
|
|
|
331
331
|
const useParseAddress = () => {
|
|
332
332
|
const { client } = useShipEngine();
|
|
333
333
|
return reactQuery.useMutation({
|
|
334
|
-
mutationFn: (_0) => __async$
|
|
334
|
+
mutationFn: (_0) => __async$U(void 0, [_0], function* ({ address, text }) {
|
|
335
335
|
const result = yield client.addresses.parse(text, address);
|
|
336
336
|
return result.data;
|
|
337
337
|
}),
|
|
@@ -340,7 +340,7 @@ const useParseAddress = () => {
|
|
|
340
340
|
});
|
|
341
341
|
};
|
|
342
342
|
|
|
343
|
-
var __async$
|
|
343
|
+
var __async$T = (__this, __arguments, generator) => {
|
|
344
344
|
return new Promise((resolve, reject) => {
|
|
345
345
|
var fulfilled = (value) => {
|
|
346
346
|
try {
|
|
@@ -363,7 +363,7 @@ var __async$S = (__this, __arguments, generator) => {
|
|
|
363
363
|
const useValidateAddresses = () => {
|
|
364
364
|
const { client } = useShipEngine();
|
|
365
365
|
return reactQuery.useMutation({
|
|
366
|
-
mutationFn: (addresses) => __async$
|
|
366
|
+
mutationFn: (addresses) => __async$T(void 0, null, function* () {
|
|
367
367
|
const result = yield client.addresses.validate(addresses);
|
|
368
368
|
return result.data;
|
|
369
369
|
}),
|
|
@@ -372,6 +372,87 @@ const useValidateAddresses = () => {
|
|
|
372
372
|
});
|
|
373
373
|
};
|
|
374
374
|
|
|
375
|
+
var __defProp$F = Object.defineProperty;
|
|
376
|
+
var __defProps$E = Object.defineProperties;
|
|
377
|
+
var __getOwnPropDescs$E = Object.getOwnPropertyDescriptors;
|
|
378
|
+
var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
|
|
379
|
+
var __hasOwnProp$O = Object.prototype.hasOwnProperty;
|
|
380
|
+
var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
|
|
381
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
382
|
+
var __spreadValues$F = (a, b) => {
|
|
383
|
+
for (var prop in b || (b = {}))
|
|
384
|
+
if (__hasOwnProp$O.call(b, prop))
|
|
385
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
386
|
+
if (__getOwnPropSymbols$O)
|
|
387
|
+
for (var prop of __getOwnPropSymbols$O(b)) {
|
|
388
|
+
if (__propIsEnum$O.call(b, prop))
|
|
389
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
390
|
+
}
|
|
391
|
+
return a;
|
|
392
|
+
};
|
|
393
|
+
var __spreadProps$E = (a, b) => __defProps$E(a, __getOwnPropDescs$E(b));
|
|
394
|
+
var __async$S = (__this, __arguments, generator) => {
|
|
395
|
+
return new Promise((resolve, reject) => {
|
|
396
|
+
var fulfilled = (value) => {
|
|
397
|
+
try {
|
|
398
|
+
step(generator.next(value));
|
|
399
|
+
} catch (e) {
|
|
400
|
+
reject(e);
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
var rejected = (value) => {
|
|
404
|
+
try {
|
|
405
|
+
step(generator.throw(value));
|
|
406
|
+
} catch (e) {
|
|
407
|
+
reject(e);
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
411
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const useCreateAuctanePaySession = (params) => {
|
|
415
|
+
const { client } = useShipEngine();
|
|
416
|
+
return reactQuery.useMutation(__spreadProps$E(__spreadValues$F({}, params), {
|
|
417
|
+
mutationFn: (request) => __async$S(void 0, null, function* () {
|
|
418
|
+
const result = yield client.auctanePay.createSession(request);
|
|
419
|
+
return result.data;
|
|
420
|
+
}),
|
|
421
|
+
mutationKey: ["useCreateAuctanePaySession"],
|
|
422
|
+
onError
|
|
423
|
+
}));
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
var __defProp$E = Object.defineProperty;
|
|
427
|
+
var __defProps$D = Object.defineProperties;
|
|
428
|
+
var __getOwnPropDescs$D = Object.getOwnPropertyDescriptors;
|
|
429
|
+
var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
|
|
430
|
+
var __hasOwnProp$N = Object.prototype.hasOwnProperty;
|
|
431
|
+
var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
|
|
432
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
433
|
+
var __spreadValues$E = (a, b) => {
|
|
434
|
+
for (var prop in b || (b = {}))
|
|
435
|
+
if (__hasOwnProp$N.call(b, prop))
|
|
436
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
437
|
+
if (__getOwnPropSymbols$N)
|
|
438
|
+
for (var prop of __getOwnPropSymbols$N(b)) {
|
|
439
|
+
if (__propIsEnum$N.call(b, prop))
|
|
440
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
441
|
+
}
|
|
442
|
+
return a;
|
|
443
|
+
};
|
|
444
|
+
var __spreadProps$D = (a, b) => __defProps$D(a, __getOwnPropDescs$D(b));
|
|
445
|
+
const useGetAuctanePayConfig = (params) => {
|
|
446
|
+
const { client } = useShipEngine();
|
|
447
|
+
const queryParams = __spreadValues$E({}, params);
|
|
448
|
+
return reactQuery.useQuery(__spreadProps$D(__spreadValues$E({}, queryParams), {
|
|
449
|
+
onError,
|
|
450
|
+
queryFn: () => client.auctanePay.getConfig(),
|
|
451
|
+
queryKey: ["useGetAuctanePayConfig"],
|
|
452
|
+
select: (result) => result.data
|
|
453
|
+
}));
|
|
454
|
+
};
|
|
455
|
+
|
|
375
456
|
var __defProp$D = Object.defineProperty;
|
|
376
457
|
var __defProps$C = Object.defineProperties;
|
|
377
458
|
var __getOwnPropDescs$C = Object.getOwnPropertyDescriptors;
|
|
@@ -411,14 +492,18 @@ var __async$R = (__this, __arguments, generator) => {
|
|
|
411
492
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
412
493
|
});
|
|
413
494
|
};
|
|
414
|
-
const
|
|
495
|
+
const usePreviewTransaction = (params) => {
|
|
415
496
|
const { client } = useShipEngine();
|
|
416
497
|
return reactQuery.useMutation(__spreadProps$C(__spreadValues$D({}, params), {
|
|
417
|
-
mutationFn: (
|
|
418
|
-
const
|
|
498
|
+
mutationFn: (_0) => __async$R(void 0, [_0], function* ({ amount, transactionCategory = "add_funds" }) {
|
|
499
|
+
const request = {
|
|
500
|
+
amount,
|
|
501
|
+
transactionCategory
|
|
502
|
+
};
|
|
503
|
+
const result = yield client.auctanePay.previewTransaction(request);
|
|
419
504
|
return result.data;
|
|
420
505
|
}),
|
|
421
|
-
mutationKey: ["
|
|
506
|
+
mutationKey: ["usePreviewTransaction"],
|
|
422
507
|
onError
|
|
423
508
|
}));
|
|
424
509
|
};
|
|
@@ -442,13 +527,13 @@ var __spreadValues$C = (a, b) => {
|
|
|
442
527
|
return a;
|
|
443
528
|
};
|
|
444
529
|
var __spreadProps$B = (a, b) => __defProps$B(a, __getOwnPropDescs$B(b));
|
|
445
|
-
const
|
|
530
|
+
const useGetPaymentMethods = (params) => {
|
|
446
531
|
const { client } = useShipEngine();
|
|
447
532
|
const queryParams = __spreadValues$C({}, params);
|
|
448
533
|
return reactQuery.useQuery(__spreadProps$B(__spreadValues$C({}, queryParams), {
|
|
449
534
|
onError,
|
|
450
|
-
queryFn: () => client.auctanePay.
|
|
451
|
-
queryKey: ["
|
|
535
|
+
queryFn: () => client.auctanePay.getPaymentMethods(),
|
|
536
|
+
queryKey: ["useGetPaymentMethods"],
|
|
452
537
|
select: (result) => result.data
|
|
453
538
|
}));
|
|
454
539
|
};
|
|
@@ -492,18 +577,14 @@ var __async$Q = (__this, __arguments, generator) => {
|
|
|
492
577
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
493
578
|
});
|
|
494
579
|
};
|
|
495
|
-
const
|
|
580
|
+
const useDeletePaymentMethod = (params) => {
|
|
496
581
|
const { client } = useShipEngine();
|
|
497
582
|
return reactQuery.useMutation(__spreadProps$A(__spreadValues$B({}, params), {
|
|
498
|
-
mutationFn: (
|
|
499
|
-
const
|
|
500
|
-
amount,
|
|
501
|
-
transactionCategory
|
|
502
|
-
};
|
|
503
|
-
const result = yield client.auctanePay.previewTransaction(request);
|
|
583
|
+
mutationFn: (paymentMethodId) => __async$Q(void 0, null, function* () {
|
|
584
|
+
const result = yield client.auctanePay.deletePaymentMethod(paymentMethodId);
|
|
504
585
|
return result.data;
|
|
505
586
|
}),
|
|
506
|
-
mutationKey: ["
|
|
587
|
+
mutationKey: ["useDeletePaymentMethod"],
|
|
507
588
|
onError
|
|
508
589
|
}));
|
|
509
590
|
};
|
|
@@ -527,14 +608,35 @@ var __spreadValues$A = (a, b) => {
|
|
|
527
608
|
return a;
|
|
528
609
|
};
|
|
529
610
|
var __spreadProps$z = (a, b) => __defProps$z(a, __getOwnPropDescs$z(b));
|
|
530
|
-
|
|
611
|
+
var __async$P = (__this, __arguments, generator) => {
|
|
612
|
+
return new Promise((resolve, reject) => {
|
|
613
|
+
var fulfilled = (value) => {
|
|
614
|
+
try {
|
|
615
|
+
step(generator.next(value));
|
|
616
|
+
} catch (e) {
|
|
617
|
+
reject(e);
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
var rejected = (value) => {
|
|
621
|
+
try {
|
|
622
|
+
step(generator.throw(value));
|
|
623
|
+
} catch (e) {
|
|
624
|
+
reject(e);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
628
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
const useUpdatePaymentMethod = (params) => {
|
|
531
632
|
const { client } = useShipEngine();
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
633
|
+
return reactQuery.useMutation(__spreadProps$z(__spreadValues$A({}, params), {
|
|
634
|
+
mutationFn: (_0) => __async$P(void 0, [_0], function* ({ paymentMethodId, payload }) {
|
|
635
|
+
const result = yield client.auctanePay.updatePaymentMethod(paymentMethodId, payload);
|
|
636
|
+
return result.data;
|
|
637
|
+
}),
|
|
638
|
+
mutationKey: ["useUpdatePaymentMethod"],
|
|
639
|
+
onError
|
|
538
640
|
}));
|
|
539
641
|
};
|
|
540
642
|
|
|
@@ -557,7 +659,7 @@ var __spreadValues$z = (a, b) => {
|
|
|
557
659
|
return a;
|
|
558
660
|
};
|
|
559
661
|
var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
|
|
560
|
-
var __async$
|
|
662
|
+
var __async$O = (__this, __arguments, generator) => {
|
|
561
663
|
return new Promise((resolve, reject) => {
|
|
562
664
|
var fulfilled = (value) => {
|
|
563
665
|
try {
|
|
@@ -577,14 +679,14 @@ var __async$P = (__this, __arguments, generator) => {
|
|
|
577
679
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
578
680
|
});
|
|
579
681
|
};
|
|
580
|
-
const
|
|
682
|
+
const useIdentityVerification = (params) => {
|
|
581
683
|
const { client } = useShipEngine();
|
|
582
684
|
return reactQuery.useMutation(__spreadProps$y(__spreadValues$z({}, params), {
|
|
583
|
-
mutationFn: (
|
|
584
|
-
const result = yield client.auctanePay.
|
|
685
|
+
mutationFn: () => __async$O(void 0, null, function* () {
|
|
686
|
+
const result = yield client.auctanePay.identityVerification();
|
|
585
687
|
return result.data;
|
|
586
688
|
}),
|
|
587
|
-
mutationKey: ["
|
|
689
|
+
mutationKey: ["useIdentityVerification"],
|
|
588
690
|
onError
|
|
589
691
|
}));
|
|
590
692
|
};
|
|
@@ -608,35 +710,14 @@ var __spreadValues$y = (a, b) => {
|
|
|
608
710
|
return a;
|
|
609
711
|
};
|
|
610
712
|
var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
|
|
611
|
-
|
|
612
|
-
return new Promise((resolve, reject) => {
|
|
613
|
-
var fulfilled = (value) => {
|
|
614
|
-
try {
|
|
615
|
-
step(generator.next(value));
|
|
616
|
-
} catch (e) {
|
|
617
|
-
reject(e);
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
var rejected = (value) => {
|
|
621
|
-
try {
|
|
622
|
-
step(generator.throw(value));
|
|
623
|
-
} catch (e) {
|
|
624
|
-
reject(e);
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
628
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
629
|
-
});
|
|
630
|
-
};
|
|
631
|
-
const useUpdatePaymentMethod = (params) => {
|
|
713
|
+
const useGetPaymentAccount = (params) => {
|
|
632
714
|
const { client } = useShipEngine();
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
onError
|
|
715
|
+
const queryParams = __spreadValues$y({}, params);
|
|
716
|
+
return reactQuery.useQuery(__spreadProps$x(__spreadValues$y({}, queryParams), {
|
|
717
|
+
onError,
|
|
718
|
+
queryFn: () => client.auctanePay.getPaymentAccount(),
|
|
719
|
+
queryKey: ["useGetPaymentAccount"],
|
|
720
|
+
select: (result) => result.data
|
|
640
721
|
}));
|
|
641
722
|
};
|
|
642
723
|
|
|
@@ -4088,6 +4169,7 @@ exports.useGetInsuranceFundingSourceAcceptedTerms = useGetInsuranceFundingSource
|
|
|
4088
4169
|
exports.useGetInvoiceAddress = useGetInvoiceAddress;
|
|
4089
4170
|
exports.useGetLabel = useGetLabel;
|
|
4090
4171
|
exports.useGetPackageRatingGroupByCarrier = useGetPackageRatingGroupByCarrier;
|
|
4172
|
+
exports.useGetPaymentAccount = useGetPaymentAccount;
|
|
4091
4173
|
exports.useGetPaymentMethods = useGetPaymentMethods;
|
|
4092
4174
|
exports.useGetRateCardById = useGetRateCardById;
|
|
4093
4175
|
exports.useGetSalesOrder = useGetSalesOrder;
|
|
@@ -4102,6 +4184,7 @@ exports.useGetShippingRuleById = useGetShippingRuleById;
|
|
|
4102
4184
|
exports.useGetShippingRuleConditionsOptions = useGetShippingRuleConditionsOptions;
|
|
4103
4185
|
exports.useGetThemeById = useGetThemeById;
|
|
4104
4186
|
exports.useGetZonesByCarrier = useGetZonesByCarrier;
|
|
4187
|
+
exports.useIdentityVerification = useIdentityVerification;
|
|
4105
4188
|
exports.useListAccountAddons = useListAccountAddons;
|
|
4106
4189
|
exports.useListCarrierConnections = useListCarrierConnections;
|
|
4107
4190
|
exports.useListCarriers = useListCarriers;
|
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$H = Object.defineProperty;
|
|
80
|
+
var __defProps$G = Object.defineProperties;
|
|
81
|
+
var __getOwnPropDescs$G = Object.getOwnPropertyDescriptors;
|
|
82
|
+
var __getOwnPropSymbols$Q = Object.getOwnPropertySymbols;
|
|
83
|
+
var __hasOwnProp$Q = Object.prototype.hasOwnProperty;
|
|
84
|
+
var __propIsEnum$Q = Object.prototype.propertyIsEnumerable;
|
|
85
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
86
|
+
var __spreadValues$H = (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$Q.call(b, prop))
|
|
89
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
90
|
+
if (__getOwnPropSymbols$Q)
|
|
91
|
+
for (var prop of __getOwnPropSymbols$Q(b)) {
|
|
92
|
+
if (__propIsEnum$Q.call(b, prop))
|
|
93
|
+
__defNormalProp$H(a, prop, b[prop]);
|
|
94
94
|
}
|
|
95
95
|
return a;
|
|
96
96
|
};
|
|
97
|
-
var __spreadProps$
|
|
97
|
+
var __spreadProps$G = (a, b) => __defProps$G(a, __getOwnPropDescs$G(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$G(__spreadValues$H({}, 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$Y = (__this, __arguments, generator) => {
|
|
132
132
|
return new Promise((resolve, reject) => {
|
|
133
133
|
var fulfilled = (value) => {
|
|
134
134
|
try {
|
|
@@ -151,7 +151,7 @@ var __async$X = (__this, __arguments, generator) => {
|
|
|
151
151
|
const useCreateAccountImage = () => {
|
|
152
152
|
const { client } = useShipEngine();
|
|
153
153
|
return useMutation({
|
|
154
|
-
mutationFn: (data) => __async$
|
|
154
|
+
mutationFn: (data) => __async$Y(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$X = (__this, __arguments, generator) => {
|
|
164
164
|
return new Promise((resolve, reject) => {
|
|
165
165
|
var fulfilled = (value) => {
|
|
166
166
|
try {
|
|
@@ -183,7 +183,7 @@ var __async$W = (__this, __arguments, generator) => {
|
|
|
183
183
|
const useDeleteAccountImage = () => {
|
|
184
184
|
const { client } = useShipEngine();
|
|
185
185
|
return useMutation({
|
|
186
|
-
mutationFn: (labelImageId) => __async$
|
|
186
|
+
mutationFn: (labelImageId) => __async$X(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$W = (__this, __arguments, generator) => {
|
|
216
216
|
return new Promise((resolve, reject) => {
|
|
217
217
|
var fulfilled = (value) => {
|
|
218
218
|
try {
|
|
@@ -235,7 +235,7 @@ var __async$V = (__this, __arguments, generator) => {
|
|
|
235
235
|
const useUpdateAccountImage = () => {
|
|
236
236
|
const { client } = useShipEngine();
|
|
237
237
|
return useMutation({
|
|
238
|
-
mutationFn: (data) => __async$
|
|
238
|
+
mutationFn: (data) => __async$W(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$V = (__this, __arguments, generator) => {
|
|
248
248
|
return new Promise((resolve, reject) => {
|
|
249
249
|
var fulfilled = (value) => {
|
|
250
250
|
try {
|
|
@@ -267,7 +267,7 @@ var __async$U = (__this, __arguments, generator) => {
|
|
|
267
267
|
const useUpdateAccountSettings = () => {
|
|
268
268
|
const { client } = useShipEngine();
|
|
269
269
|
return useMutation({
|
|
270
|
-
mutationFn: (settings) => __async$
|
|
270
|
+
mutationFn: (settings) => __async$V(void 0, null, function* () {
|
|
271
271
|
const result = yield client.accountSettings.update(settings);
|
|
272
272
|
return result.data;
|
|
273
273
|
}),
|
|
@@ -276,28 +276,28 @@ const useUpdateAccountSettings = () => {
|
|
|
276
276
|
});
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
-
var __defProp$
|
|
280
|
-
var __defProps$
|
|
281
|
-
var __getOwnPropDescs$
|
|
282
|
-
var __getOwnPropSymbols$
|
|
283
|
-
var __hasOwnProp$
|
|
284
|
-
var __propIsEnum$
|
|
285
|
-
var __defNormalProp$
|
|
286
|
-
var __spreadValues$
|
|
279
|
+
var __defProp$G = Object.defineProperty;
|
|
280
|
+
var __defProps$F = Object.defineProperties;
|
|
281
|
+
var __getOwnPropDescs$F = Object.getOwnPropertyDescriptors;
|
|
282
|
+
var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
|
|
283
|
+
var __hasOwnProp$P = Object.prototype.hasOwnProperty;
|
|
284
|
+
var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
|
|
285
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
286
|
+
var __spreadValues$G = (a, b) => {
|
|
287
287
|
for (var prop in b || (b = {}))
|
|
288
|
-
if (__hasOwnProp$
|
|
289
|
-
__defNormalProp$
|
|
290
|
-
if (__getOwnPropSymbols$
|
|
291
|
-
for (var prop of __getOwnPropSymbols$
|
|
292
|
-
if (__propIsEnum$
|
|
293
|
-
__defNormalProp$
|
|
288
|
+
if (__hasOwnProp$P.call(b, prop))
|
|
289
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
290
|
+
if (__getOwnPropSymbols$P)
|
|
291
|
+
for (var prop of __getOwnPropSymbols$P(b)) {
|
|
292
|
+
if (__propIsEnum$P.call(b, prop))
|
|
293
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
294
294
|
}
|
|
295
295
|
return a;
|
|
296
296
|
};
|
|
297
|
-
var __spreadProps$
|
|
297
|
+
var __spreadProps$F = (a, b) => __defProps$F(a, __getOwnPropDescs$F(b));
|
|
298
298
|
const useListAccountAddons = (params) => {
|
|
299
299
|
const { client } = useShipEngine();
|
|
300
|
-
return useQuery(__spreadProps$
|
|
300
|
+
return useQuery(__spreadProps$F(__spreadValues$G({}, params), {
|
|
301
301
|
onError,
|
|
302
302
|
queryFn: () => client.accountAddons.list(),
|
|
303
303
|
queryKey: ["useListAccountAddons"],
|
|
@@ -305,7 +305,7 @@ const useListAccountAddons = (params) => {
|
|
|
305
305
|
}));
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
-
var __async$
|
|
308
|
+
var __async$U = (__this, __arguments, generator) => {
|
|
309
309
|
return new Promise((resolve, reject) => {
|
|
310
310
|
var fulfilled = (value) => {
|
|
311
311
|
try {
|
|
@@ -328,7 +328,7 @@ var __async$T = (__this, __arguments, generator) => {
|
|
|
328
328
|
const useParseAddress = () => {
|
|
329
329
|
const { client } = useShipEngine();
|
|
330
330
|
return useMutation({
|
|
331
|
-
mutationFn: (_0) => __async$
|
|
331
|
+
mutationFn: (_0) => __async$U(void 0, [_0], function* ({ address, text }) {
|
|
332
332
|
const result = yield client.addresses.parse(text, address);
|
|
333
333
|
return result.data;
|
|
334
334
|
}),
|
|
@@ -337,7 +337,7 @@ const useParseAddress = () => {
|
|
|
337
337
|
});
|
|
338
338
|
};
|
|
339
339
|
|
|
340
|
-
var __async$
|
|
340
|
+
var __async$T = (__this, __arguments, generator) => {
|
|
341
341
|
return new Promise((resolve, reject) => {
|
|
342
342
|
var fulfilled = (value) => {
|
|
343
343
|
try {
|
|
@@ -360,7 +360,7 @@ var __async$S = (__this, __arguments, generator) => {
|
|
|
360
360
|
const useValidateAddresses = () => {
|
|
361
361
|
const { client } = useShipEngine();
|
|
362
362
|
return useMutation({
|
|
363
|
-
mutationFn: (addresses) => __async$
|
|
363
|
+
mutationFn: (addresses) => __async$T(void 0, null, function* () {
|
|
364
364
|
const result = yield client.addresses.validate(addresses);
|
|
365
365
|
return result.data;
|
|
366
366
|
}),
|
|
@@ -369,6 +369,87 @@ const useValidateAddresses = () => {
|
|
|
369
369
|
});
|
|
370
370
|
};
|
|
371
371
|
|
|
372
|
+
var __defProp$F = Object.defineProperty;
|
|
373
|
+
var __defProps$E = Object.defineProperties;
|
|
374
|
+
var __getOwnPropDescs$E = Object.getOwnPropertyDescriptors;
|
|
375
|
+
var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
|
|
376
|
+
var __hasOwnProp$O = Object.prototype.hasOwnProperty;
|
|
377
|
+
var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
|
|
378
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
379
|
+
var __spreadValues$F = (a, b) => {
|
|
380
|
+
for (var prop in b || (b = {}))
|
|
381
|
+
if (__hasOwnProp$O.call(b, prop))
|
|
382
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
383
|
+
if (__getOwnPropSymbols$O)
|
|
384
|
+
for (var prop of __getOwnPropSymbols$O(b)) {
|
|
385
|
+
if (__propIsEnum$O.call(b, prop))
|
|
386
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
387
|
+
}
|
|
388
|
+
return a;
|
|
389
|
+
};
|
|
390
|
+
var __spreadProps$E = (a, b) => __defProps$E(a, __getOwnPropDescs$E(b));
|
|
391
|
+
var __async$S = (__this, __arguments, generator) => {
|
|
392
|
+
return new Promise((resolve, reject) => {
|
|
393
|
+
var fulfilled = (value) => {
|
|
394
|
+
try {
|
|
395
|
+
step(generator.next(value));
|
|
396
|
+
} catch (e) {
|
|
397
|
+
reject(e);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
var rejected = (value) => {
|
|
401
|
+
try {
|
|
402
|
+
step(generator.throw(value));
|
|
403
|
+
} catch (e) {
|
|
404
|
+
reject(e);
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
408
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
409
|
+
});
|
|
410
|
+
};
|
|
411
|
+
const useCreateAuctanePaySession = (params) => {
|
|
412
|
+
const { client } = useShipEngine();
|
|
413
|
+
return useMutation(__spreadProps$E(__spreadValues$F({}, params), {
|
|
414
|
+
mutationFn: (request) => __async$S(void 0, null, function* () {
|
|
415
|
+
const result = yield client.auctanePay.createSession(request);
|
|
416
|
+
return result.data;
|
|
417
|
+
}),
|
|
418
|
+
mutationKey: ["useCreateAuctanePaySession"],
|
|
419
|
+
onError
|
|
420
|
+
}));
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
var __defProp$E = Object.defineProperty;
|
|
424
|
+
var __defProps$D = Object.defineProperties;
|
|
425
|
+
var __getOwnPropDescs$D = Object.getOwnPropertyDescriptors;
|
|
426
|
+
var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
|
|
427
|
+
var __hasOwnProp$N = Object.prototype.hasOwnProperty;
|
|
428
|
+
var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
|
|
429
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
430
|
+
var __spreadValues$E = (a, b) => {
|
|
431
|
+
for (var prop in b || (b = {}))
|
|
432
|
+
if (__hasOwnProp$N.call(b, prop))
|
|
433
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
434
|
+
if (__getOwnPropSymbols$N)
|
|
435
|
+
for (var prop of __getOwnPropSymbols$N(b)) {
|
|
436
|
+
if (__propIsEnum$N.call(b, prop))
|
|
437
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
438
|
+
}
|
|
439
|
+
return a;
|
|
440
|
+
};
|
|
441
|
+
var __spreadProps$D = (a, b) => __defProps$D(a, __getOwnPropDescs$D(b));
|
|
442
|
+
const useGetAuctanePayConfig = (params) => {
|
|
443
|
+
const { client } = useShipEngine();
|
|
444
|
+
const queryParams = __spreadValues$E({}, params);
|
|
445
|
+
return useQuery(__spreadProps$D(__spreadValues$E({}, queryParams), {
|
|
446
|
+
onError,
|
|
447
|
+
queryFn: () => client.auctanePay.getConfig(),
|
|
448
|
+
queryKey: ["useGetAuctanePayConfig"],
|
|
449
|
+
select: (result) => result.data
|
|
450
|
+
}));
|
|
451
|
+
};
|
|
452
|
+
|
|
372
453
|
var __defProp$D = Object.defineProperty;
|
|
373
454
|
var __defProps$C = Object.defineProperties;
|
|
374
455
|
var __getOwnPropDescs$C = Object.getOwnPropertyDescriptors;
|
|
@@ -408,14 +489,18 @@ var __async$R = (__this, __arguments, generator) => {
|
|
|
408
489
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
409
490
|
});
|
|
410
491
|
};
|
|
411
|
-
const
|
|
492
|
+
const usePreviewTransaction = (params) => {
|
|
412
493
|
const { client } = useShipEngine();
|
|
413
494
|
return useMutation(__spreadProps$C(__spreadValues$D({}, params), {
|
|
414
|
-
mutationFn: (
|
|
415
|
-
const
|
|
495
|
+
mutationFn: (_0) => __async$R(void 0, [_0], function* ({ amount, transactionCategory = "add_funds" }) {
|
|
496
|
+
const request = {
|
|
497
|
+
amount,
|
|
498
|
+
transactionCategory
|
|
499
|
+
};
|
|
500
|
+
const result = yield client.auctanePay.previewTransaction(request);
|
|
416
501
|
return result.data;
|
|
417
502
|
}),
|
|
418
|
-
mutationKey: ["
|
|
503
|
+
mutationKey: ["usePreviewTransaction"],
|
|
419
504
|
onError
|
|
420
505
|
}));
|
|
421
506
|
};
|
|
@@ -439,13 +524,13 @@ var __spreadValues$C = (a, b) => {
|
|
|
439
524
|
return a;
|
|
440
525
|
};
|
|
441
526
|
var __spreadProps$B = (a, b) => __defProps$B(a, __getOwnPropDescs$B(b));
|
|
442
|
-
const
|
|
527
|
+
const useGetPaymentMethods = (params) => {
|
|
443
528
|
const { client } = useShipEngine();
|
|
444
529
|
const queryParams = __spreadValues$C({}, params);
|
|
445
530
|
return useQuery(__spreadProps$B(__spreadValues$C({}, queryParams), {
|
|
446
531
|
onError,
|
|
447
|
-
queryFn: () => client.auctanePay.
|
|
448
|
-
queryKey: ["
|
|
532
|
+
queryFn: () => client.auctanePay.getPaymentMethods(),
|
|
533
|
+
queryKey: ["useGetPaymentMethods"],
|
|
449
534
|
select: (result) => result.data
|
|
450
535
|
}));
|
|
451
536
|
};
|
|
@@ -489,18 +574,14 @@ var __async$Q = (__this, __arguments, generator) => {
|
|
|
489
574
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
490
575
|
});
|
|
491
576
|
};
|
|
492
|
-
const
|
|
577
|
+
const useDeletePaymentMethod = (params) => {
|
|
493
578
|
const { client } = useShipEngine();
|
|
494
579
|
return useMutation(__spreadProps$A(__spreadValues$B({}, params), {
|
|
495
|
-
mutationFn: (
|
|
496
|
-
const
|
|
497
|
-
amount,
|
|
498
|
-
transactionCategory
|
|
499
|
-
};
|
|
500
|
-
const result = yield client.auctanePay.previewTransaction(request);
|
|
580
|
+
mutationFn: (paymentMethodId) => __async$Q(void 0, null, function* () {
|
|
581
|
+
const result = yield client.auctanePay.deletePaymentMethod(paymentMethodId);
|
|
501
582
|
return result.data;
|
|
502
583
|
}),
|
|
503
|
-
mutationKey: ["
|
|
584
|
+
mutationKey: ["useDeletePaymentMethod"],
|
|
504
585
|
onError
|
|
505
586
|
}));
|
|
506
587
|
};
|
|
@@ -524,14 +605,35 @@ var __spreadValues$A = (a, b) => {
|
|
|
524
605
|
return a;
|
|
525
606
|
};
|
|
526
607
|
var __spreadProps$z = (a, b) => __defProps$z(a, __getOwnPropDescs$z(b));
|
|
527
|
-
|
|
608
|
+
var __async$P = (__this, __arguments, generator) => {
|
|
609
|
+
return new Promise((resolve, reject) => {
|
|
610
|
+
var fulfilled = (value) => {
|
|
611
|
+
try {
|
|
612
|
+
step(generator.next(value));
|
|
613
|
+
} catch (e) {
|
|
614
|
+
reject(e);
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
var rejected = (value) => {
|
|
618
|
+
try {
|
|
619
|
+
step(generator.throw(value));
|
|
620
|
+
} catch (e) {
|
|
621
|
+
reject(e);
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
625
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
626
|
+
});
|
|
627
|
+
};
|
|
628
|
+
const useUpdatePaymentMethod = (params) => {
|
|
528
629
|
const { client } = useShipEngine();
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
630
|
+
return useMutation(__spreadProps$z(__spreadValues$A({}, params), {
|
|
631
|
+
mutationFn: (_0) => __async$P(void 0, [_0], function* ({ paymentMethodId, payload }) {
|
|
632
|
+
const result = yield client.auctanePay.updatePaymentMethod(paymentMethodId, payload);
|
|
633
|
+
return result.data;
|
|
634
|
+
}),
|
|
635
|
+
mutationKey: ["useUpdatePaymentMethod"],
|
|
636
|
+
onError
|
|
535
637
|
}));
|
|
536
638
|
};
|
|
537
639
|
|
|
@@ -554,7 +656,7 @@ var __spreadValues$z = (a, b) => {
|
|
|
554
656
|
return a;
|
|
555
657
|
};
|
|
556
658
|
var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
|
|
557
|
-
var __async$
|
|
659
|
+
var __async$O = (__this, __arguments, generator) => {
|
|
558
660
|
return new Promise((resolve, reject) => {
|
|
559
661
|
var fulfilled = (value) => {
|
|
560
662
|
try {
|
|
@@ -574,14 +676,14 @@ var __async$P = (__this, __arguments, generator) => {
|
|
|
574
676
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
575
677
|
});
|
|
576
678
|
};
|
|
577
|
-
const
|
|
679
|
+
const useIdentityVerification = (params) => {
|
|
578
680
|
const { client } = useShipEngine();
|
|
579
681
|
return useMutation(__spreadProps$y(__spreadValues$z({}, params), {
|
|
580
|
-
mutationFn: (
|
|
581
|
-
const result = yield client.auctanePay.
|
|
682
|
+
mutationFn: () => __async$O(void 0, null, function* () {
|
|
683
|
+
const result = yield client.auctanePay.identityVerification();
|
|
582
684
|
return result.data;
|
|
583
685
|
}),
|
|
584
|
-
mutationKey: ["
|
|
686
|
+
mutationKey: ["useIdentityVerification"],
|
|
585
687
|
onError
|
|
586
688
|
}));
|
|
587
689
|
};
|
|
@@ -605,35 +707,14 @@ var __spreadValues$y = (a, b) => {
|
|
|
605
707
|
return a;
|
|
606
708
|
};
|
|
607
709
|
var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
|
|
608
|
-
|
|
609
|
-
return new Promise((resolve, reject) => {
|
|
610
|
-
var fulfilled = (value) => {
|
|
611
|
-
try {
|
|
612
|
-
step(generator.next(value));
|
|
613
|
-
} catch (e) {
|
|
614
|
-
reject(e);
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
var rejected = (value) => {
|
|
618
|
-
try {
|
|
619
|
-
step(generator.throw(value));
|
|
620
|
-
} catch (e) {
|
|
621
|
-
reject(e);
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
625
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
626
|
-
});
|
|
627
|
-
};
|
|
628
|
-
const useUpdatePaymentMethod = (params) => {
|
|
710
|
+
const useGetPaymentAccount = (params) => {
|
|
629
711
|
const { client } = useShipEngine();
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
onError
|
|
712
|
+
const queryParams = __spreadValues$y({}, params);
|
|
713
|
+
return useQuery(__spreadProps$x(__spreadValues$y({}, queryParams), {
|
|
714
|
+
onError,
|
|
715
|
+
queryFn: () => client.auctanePay.getPaymentAccount(),
|
|
716
|
+
queryKey: ["useGetPaymentAccount"],
|
|
717
|
+
select: (result) => result.data
|
|
637
718
|
}));
|
|
638
719
|
};
|
|
639
720
|
|
|
@@ -4022,4 +4103,4 @@ const useListUsers = (params) => {
|
|
|
4022
4103
|
}));
|
|
4023
4104
|
};
|
|
4024
4105
|
|
|
4025
|
-
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateAuctanePaySession, useCreateFundingSource, useCreateInvoiceAddress, useCreateLabel, useCreateLabelByRateId, useCreateLabelByShipmentId, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeletePaymentMethod, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useExportLabels, useExportShipments, useFundingSourcesAddFunds, useGetAccountBilling, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAuctanePayConfig, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetInvoiceAddress, useGetLabel, useGetPackageRatingGroupByCarrier, useGetPaymentMethods, useGetRateCardById, useGetSalesOrder, useGetSalesOrderByExternalOrderId, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListAccountAddons, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListLabelsInfinite, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrderShipmentsByExternalOrderId, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListUsers, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePreviewTransaction, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useRequestStampsAccountUrls, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateInvoiceAddress, useUpdateOrderSource, useUpdatePaymentMethod, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useUpsertAccountBilling, useValidateAddresses, useVoidLabel };
|
|
4106
|
+
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCancelShipment, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateAuctanePaySession, useCreateFundingSource, useCreateInvoiceAddress, useCreateLabel, useCreateLabelByRateId, useCreateLabelByShipmentId, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateSellerApiKey, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeletePaymentMethod, useDeleteRateCard, useDeleteSellerApiKey, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useExportLabels, useExportShipments, useFundingSourcesAddFunds, useGetAccountBilling, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAuctanePayConfig, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetConnectionsCarrierSettings, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetInvoiceAddress, useGetLabel, useGetPackageRatingGroupByCarrier, useGetPaymentAccount, useGetPaymentMethods, useGetRateCardById, useGetSalesOrder, useGetSalesOrderByExternalOrderId, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentByExternalId, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useIdentityVerification, useListAccountAddons, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListLabelsInfinite, useListOrderSources, useListOrderSourcesConnections, useListRateCards, useListSalesOrderShipments, useListSalesOrderShipmentsByExternalOrderId, useListSalesOrders, useListSandboxSellerIds, useListSellerApiKeys, useListServicePoints, useListShipments, useListShippingRules, useListUsers, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePreviewTransaction, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useRequestStampsAccountUrls, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateConnectionsCarrierSettings, useUpdateFundingSource, useUpdateInvoiceAddress, useUpdateOrderSource, useUpdatePaymentMethod, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useUpsertAccountBilling, useValidateAddresses, useVoidLabel };
|