@shipengine/react-api 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hooks/index.d.ts +7 -6
- package/hooks/use-get-account-settings.d.ts +1 -1
- package/hooks/use-update-account-settings.d.ts +10 -0
- package/hooks/use-update-billing.d.ts +4 -1
- package/index.js +5 -5
- package/index.mjs +159 -149
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ function w() {
|
|
|
39
39
|
}, w.apply(this, arguments);
|
|
40
40
|
}
|
|
41
41
|
var Ke = typeof window > "u";
|
|
42
|
-
function
|
|
42
|
+
function N() {
|
|
43
43
|
}
|
|
44
44
|
function mi(t, e) {
|
|
45
45
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -423,7 +423,7 @@ var Fi = /* @__PURE__ */ function() {
|
|
|
423
423
|
});
|
|
424
424
|
}, e.cancel = function(n) {
|
|
425
425
|
var i, a = this.promise;
|
|
426
|
-
return (i = this.retryer) == null || i.cancel(n), a ? a.then(
|
|
426
|
+
return (i = this.retryer) == null || i.cancel(n), a ? a.then(N).catch(N) : Promise.resolve();
|
|
427
427
|
}, e.destroy = function() {
|
|
428
428
|
this.clearGcTimeout(), this.cancel({
|
|
429
429
|
silent: !0
|
|
@@ -731,7 +731,7 @@ var Fi = /* @__PURE__ */ function() {
|
|
|
731
731
|
return i !== n;
|
|
732
732
|
});
|
|
733
733
|
}, e.cancel = function() {
|
|
734
|
-
return this.retryer ? (this.retryer.cancel(), this.retryer.promise.then(
|
|
734
|
+
return this.retryer ? (this.retryer.cancel(), this.retryer.promise.then(N).catch(N)) : Promise.resolve();
|
|
735
735
|
}, e.continue = function() {
|
|
736
736
|
return this.retryer ? (this.retryer.continue(), this.retryer.promise) : this.execute();
|
|
737
737
|
}, e.execute = function() {
|
|
@@ -920,7 +920,7 @@ var qi = /* @__PURE__ */ function(t) {
|
|
|
920
920
|
return F.batch(function() {
|
|
921
921
|
return i.reduce(function(a, s) {
|
|
922
922
|
return a.then(function() {
|
|
923
|
-
return s.continue().catch(
|
|
923
|
+
return s.continue().catch(N);
|
|
924
924
|
});
|
|
925
925
|
}, Promise.resolve());
|
|
926
926
|
});
|
|
@@ -1065,7 +1065,7 @@ var Di = /* @__PURE__ */ function() {
|
|
|
1065
1065
|
return h.cancel(c);
|
|
1066
1066
|
});
|
|
1067
1067
|
});
|
|
1068
|
-
return Promise.all(u).then(
|
|
1068
|
+
return Promise.all(u).then(N).catch(N);
|
|
1069
1069
|
}, e.invalidateQueries = function(n, i, a) {
|
|
1070
1070
|
var s, o, l, f = this, c = re(n, i, a), u = c[0], h = c[1], d = w({}, u, {
|
|
1071
1071
|
// if filters.refetchActive is not provided and filters.active is explicitly false,
|
|
@@ -1087,27 +1087,27 @@ var Di = /* @__PURE__ */ function() {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
}));
|
|
1089
1089
|
});
|
|
1090
|
-
}), u = Promise.all(c).then(
|
|
1091
|
-
return f?.throwOnError || (u = u.catch(
|
|
1090
|
+
}), u = Promise.all(c).then(N);
|
|
1091
|
+
return f?.throwOnError || (u = u.catch(N)), u;
|
|
1092
1092
|
}, e.fetchQuery = function(n, i, a) {
|
|
1093
1093
|
var s = Qe(n, i, a), o = this.defaultQueryOptions(s);
|
|
1094
1094
|
typeof o.retry > "u" && (o.retry = !1);
|
|
1095
1095
|
var l = this.queryCache.build(this, o);
|
|
1096
1096
|
return l.isStaleByTime(o.staleTime) ? l.fetch(o) : Promise.resolve(l.state.data);
|
|
1097
1097
|
}, e.prefetchQuery = function(n, i, a) {
|
|
1098
|
-
return this.fetchQuery(n, i, a).then(
|
|
1098
|
+
return this.fetchQuery(n, i, a).then(N).catch(N);
|
|
1099
1099
|
}, e.fetchInfiniteQuery = function(n, i, a) {
|
|
1100
1100
|
var s = Qe(n, i, a);
|
|
1101
1101
|
return s.behavior = $i(), this.fetchQuery(s);
|
|
1102
1102
|
}, e.prefetchInfiniteQuery = function(n, i, a) {
|
|
1103
|
-
return this.fetchInfiniteQuery(n, i, a).then(
|
|
1103
|
+
return this.fetchInfiniteQuery(n, i, a).then(N).catch(N);
|
|
1104
1104
|
}, e.cancelMutations = function() {
|
|
1105
1105
|
var n = this, i = F.batch(function() {
|
|
1106
1106
|
return n.mutationCache.getAll().map(function(a) {
|
|
1107
1107
|
return a.cancel();
|
|
1108
1108
|
});
|
|
1109
1109
|
});
|
|
1110
|
-
return Promise.all(i).then(
|
|
1110
|
+
return Promise.all(i).then(N).catch(N);
|
|
1111
1111
|
}, e.resumePausedMutations = function() {
|
|
1112
1112
|
return this.getMutationCache().resumePausedMutations();
|
|
1113
1113
|
}, e.executeMutation = function(n) {
|
|
@@ -1238,7 +1238,7 @@ var Di = /* @__PURE__ */ function() {
|
|
|
1238
1238
|
}, r.executeFetch = function(i) {
|
|
1239
1239
|
this.updateQuery();
|
|
1240
1240
|
var a = this.currentQuery.fetch(this.options, i);
|
|
1241
|
-
return i?.throwOnError || (a = a.catch(
|
|
1241
|
+
return i?.throwOnError || (a = a.catch(N)), a;
|
|
1242
1242
|
}, r.updateStaleTimeout = function() {
|
|
1243
1243
|
var i = this;
|
|
1244
1244
|
if (this.clearStaleTimeout(), !(Ke || this.currentResult.isStale || !Nt(this.options.staleTime))) {
|
|
@@ -1480,7 +1480,7 @@ var ji = /* @__PURE__ */ M.createContext(Bi()), zi = function() {
|
|
|
1480
1480
|
function In(t, e, r) {
|
|
1481
1481
|
return typeof e == "function" ? e.apply(void 0, r) : typeof e == "boolean" ? e : !!t;
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function T(t, e, r) {
|
|
1484
1484
|
var n = M.useRef(!1), i = M.useState(0), a = i[1], s = gi(t, e, r), o = or(), l = M.useRef();
|
|
1485
1485
|
l.current ? l.current.setOptions(s) : l.current = new Ni(o, s);
|
|
1486
1486
|
var f = l.current.getCurrentResult();
|
|
@@ -1496,7 +1496,7 @@ function L(t, e, r) {
|
|
|
1496
1496
|
};
|
|
1497
1497
|
}, []);
|
|
1498
1498
|
var c = M.useCallback(function(u, h) {
|
|
1499
|
-
l.current.mutate(u, h).catch(
|
|
1499
|
+
l.current.mutate(u, h).catch(N);
|
|
1500
1500
|
}, []);
|
|
1501
1501
|
if (f.error && In(void 0, l.current.options.useErrorBoundary, [f.error]))
|
|
1502
1502
|
throw f.error;
|
|
@@ -1886,7 +1886,7 @@ class te {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
class Zi {
|
|
1888
1888
|
constructor(e) {
|
|
1889
|
-
this.client = e, this.
|
|
1889
|
+
this.client = e, this.get = () => this.client.get("/v1/account/settings"), this.update = (r) => this.client.put("/v1/account/settings", r), this.client = e;
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
class ea {
|
|
@@ -2366,20 +2366,20 @@ function Br() {
|
|
|
2366
2366
|
});
|
|
2367
2367
|
}, bt;
|
|
2368
2368
|
}
|
|
2369
|
-
var
|
|
2369
|
+
var L = K, jr = Pa, _a = Qn, qa = kn, $a = {
|
|
2370
2370
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
2371
2371
|
};
|
|
2372
2372
|
function zr(t, e) {
|
|
2373
|
-
!
|
|
2373
|
+
!L.isUndefined(t) && L.isUndefined(t["Content-Type"]) && (t["Content-Type"] = e);
|
|
2374
2374
|
}
|
|
2375
2375
|
function Ma() {
|
|
2376
2376
|
var t;
|
|
2377
2377
|
return (typeof XMLHttpRequest < "u" || typeof process < "u" && Object.prototype.toString.call(process) === "[object process]") && (t = Br()), t;
|
|
2378
2378
|
}
|
|
2379
2379
|
function Da(t, e, r) {
|
|
2380
|
-
if (
|
|
2380
|
+
if (L.isString(t))
|
|
2381
2381
|
try {
|
|
2382
|
-
return (e || JSON.parse)(t),
|
|
2382
|
+
return (e || JSON.parse)(t), L.trim(t);
|
|
2383
2383
|
} catch (n) {
|
|
2384
2384
|
if (n.name !== "SyntaxError")
|
|
2385
2385
|
throw n;
|
|
@@ -2390,11 +2390,11 @@ var at = {
|
|
|
2390
2390
|
transitional: qa,
|
|
2391
2391
|
adapter: Ma(),
|
|
2392
2392
|
transformRequest: [function(e, r) {
|
|
2393
|
-
return jr(r, "Accept"), jr(r, "Content-Type"),
|
|
2393
|
+
return jr(r, "Accept"), jr(r, "Content-Type"), L.isFormData(e) || L.isArrayBuffer(e) || L.isBuffer(e) || L.isStream(e) || L.isFile(e) || L.isBlob(e) ? e : L.isArrayBufferView(e) ? e.buffer : L.isURLSearchParams(e) ? (zr(r, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : L.isObject(e) || r && r["Content-Type"] === "application/json" ? (zr(r, "application/json"), Da(e)) : e;
|
|
2394
2394
|
}],
|
|
2395
2395
|
transformResponse: [function(e) {
|
|
2396
2396
|
var r = this.transitional || at.transitional, n = r && r.silentJSONParsing, i = r && r.forcedJSONParsing, a = !n && this.responseType === "json";
|
|
2397
|
-
if (a || i &&
|
|
2397
|
+
if (a || i && L.isString(e) && e.length)
|
|
2398
2398
|
try {
|
|
2399
2399
|
return JSON.parse(e);
|
|
2400
2400
|
} catch (s) {
|
|
@@ -2421,11 +2421,11 @@ var at = {
|
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
2423
|
};
|
|
2424
|
-
|
|
2424
|
+
L.forEach(["delete", "get", "head"], function(e) {
|
|
2425
2425
|
at.headers[e] = {};
|
|
2426
2426
|
});
|
|
2427
|
-
|
|
2428
|
-
at.headers[e] =
|
|
2427
|
+
L.forEach(["post", "put", "patch"], function(e) {
|
|
2428
|
+
at.headers[e] = L.merge($a);
|
|
2429
2429
|
});
|
|
2430
2430
|
var hr = at, Ta = K, Ua = hr, Na = function(e, r, n) {
|
|
2431
2431
|
var i = this || Ua;
|
|
@@ -4052,7 +4052,7 @@ var br = yr, Ae = Cs, ao = Qs, so = br("%TypeError%"), Ne = br("%WeakMap%", !0),
|
|
|
4052
4052
|
}
|
|
4053
4053
|
}, ee = Array.isArray, qo = String.prototype.split, $o = Array.prototype.push, ci = function(t, e) {
|
|
4054
4054
|
$o.apply(t, ee(e) ? e : [e]);
|
|
4055
|
-
}, Mo = Date.prototype.toISOString, gn = qe.default,
|
|
4055
|
+
}, Mo = Date.prototype.toISOString, gn = qe.default, U = {
|
|
4056
4056
|
addQueryPrefix: !1,
|
|
4057
4057
|
allowDots: !1,
|
|
4058
4058
|
charset: "utf-8",
|
|
@@ -4086,18 +4086,18 @@ var br = yr, Ae = Cs, ao = Qs, so = br("%TypeError%"), Ne = br("%WeakMap%", !0),
|
|
|
4086
4086
|
return V instanceof Date ? u(V) : V;
|
|
4087
4087
|
})), y === null) {
|
|
4088
4088
|
if (a)
|
|
4089
|
-
return o && !p ? o(r,
|
|
4089
|
+
return o && !p ? o(r, U.encoder, v, "key", h) : r;
|
|
4090
4090
|
y = "";
|
|
4091
4091
|
}
|
|
4092
4092
|
if (Do(y) || nr.isBuffer(y)) {
|
|
4093
4093
|
if (o) {
|
|
4094
|
-
var P = p ? r : o(r,
|
|
4094
|
+
var P = p ? r : o(r, U.encoder, v, "key", h);
|
|
4095
4095
|
if (n === "comma" && p) {
|
|
4096
4096
|
for (var _ = qo.call(String(y), ","), G = "", Q = 0; Q < _.length; ++Q)
|
|
4097
|
-
G += (Q === 0 ? "" : ",") + d(o(_[Q],
|
|
4097
|
+
G += (Q === 0 ? "" : ",") + d(o(_[Q], U.encoder, v, "value", h));
|
|
4098
4098
|
return [d(P) + (i && ee(y) && _.length === 1 ? "[]" : "") + "=" + G];
|
|
4099
4099
|
}
|
|
4100
|
-
return [d(P) + "=" + d(o(y,
|
|
4100
|
+
return [d(P) + "=" + d(o(y, U.encoder, v, "value", h))];
|
|
4101
4101
|
}
|
|
4102
4102
|
return [d(r) + "=" + d(String(y))];
|
|
4103
4103
|
}
|
|
@@ -4142,10 +4142,10 @@ var br = yr, Ae = Cs, ao = Qs, so = br("%TypeError%"), Ne = br("%WeakMap%", !0),
|
|
|
4142
4142
|
return A;
|
|
4143
4143
|
}, Uo = function(e) {
|
|
4144
4144
|
if (!e)
|
|
4145
|
-
return
|
|
4145
|
+
return U;
|
|
4146
4146
|
if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
|
|
4147
4147
|
throw new TypeError("Encoder has to be a function.");
|
|
4148
|
-
var r = e.charset ||
|
|
4148
|
+
var r = e.charset || U.charset;
|
|
4149
4149
|
if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
|
|
4150
4150
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
4151
4151
|
var n = qe.default;
|
|
@@ -4154,23 +4154,23 @@ var br = yr, Ae = Cs, ao = Qs, so = br("%TypeError%"), Ne = br("%WeakMap%", !0),
|
|
|
4154
4154
|
throw new TypeError("Unknown format option provided.");
|
|
4155
4155
|
n = e.format;
|
|
4156
4156
|
}
|
|
4157
|
-
var i = qe.formatters[n], a =
|
|
4157
|
+
var i = qe.formatters[n], a = U.filter;
|
|
4158
4158
|
return (typeof e.filter == "function" || ee(e.filter)) && (a = e.filter), {
|
|
4159
|
-
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix :
|
|
4160
|
-
allowDots: typeof e.allowDots > "u" ?
|
|
4159
|
+
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
|
|
4160
|
+
allowDots: typeof e.allowDots > "u" ? U.allowDots : !!e.allowDots,
|
|
4161
4161
|
charset: r,
|
|
4162
|
-
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel :
|
|
4163
|
-
delimiter: typeof e.delimiter > "u" ?
|
|
4164
|
-
encode: typeof e.encode == "boolean" ? e.encode :
|
|
4165
|
-
encoder: typeof e.encoder == "function" ? e.encoder :
|
|
4166
|
-
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly :
|
|
4162
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : U.charsetSentinel,
|
|
4163
|
+
delimiter: typeof e.delimiter > "u" ? U.delimiter : e.delimiter,
|
|
4164
|
+
encode: typeof e.encode == "boolean" ? e.encode : U.encode,
|
|
4165
|
+
encoder: typeof e.encoder == "function" ? e.encoder : U.encoder,
|
|
4166
|
+
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : U.encodeValuesOnly,
|
|
4167
4167
|
filter: a,
|
|
4168
4168
|
format: n,
|
|
4169
4169
|
formatter: i,
|
|
4170
|
-
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate :
|
|
4171
|
-
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls :
|
|
4170
|
+
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : U.serializeDate,
|
|
4171
|
+
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : U.skipNulls,
|
|
4172
4172
|
sort: typeof e.sort == "function" ? e.sort : null,
|
|
4173
|
-
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling :
|
|
4173
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
|
|
4174
4174
|
};
|
|
4175
4175
|
}, No = function(t, e) {
|
|
4176
4176
|
var r = t, n = Uo(e), i, a;
|
|
@@ -4513,63 +4513,61 @@ const fi = pi(void 0), hu = ({
|
|
|
4513
4513
|
return t;
|
|
4514
4514
|
}, du = (t) => {
|
|
4515
4515
|
const { client: e } = R();
|
|
4516
|
-
return
|
|
4516
|
+
return T({
|
|
4517
4517
|
mutationFn: async (r) => (await e.carriers.addFunds(t, r)).data,
|
|
4518
4518
|
mutationKey: ["useAddFunds"],
|
|
4519
4519
|
onError: E
|
|
4520
4520
|
});
|
|
4521
4521
|
}, pu = () => {
|
|
4522
4522
|
const { client: t } = R();
|
|
4523
|
-
return
|
|
4523
|
+
return T({
|
|
4524
4524
|
mutationFn: async ({ rateOptions: e, shipmentId: r }) => (await t.rates.calculateByShipmentId(r, e)).data,
|
|
4525
4525
|
mutationKey: ["useCalculateRates"],
|
|
4526
4526
|
onError: E
|
|
4527
4527
|
});
|
|
4528
|
-
}, yu = (
|
|
4529
|
-
const { client: e } = R(), r = or();
|
|
4530
|
-
return L({
|
|
4531
|
-
mutationFn: async (n) => (await e.carriers.updateAutoFunding(t, n)).data,
|
|
4532
|
-
mutationKey: ["useUpdateAutoFunding"],
|
|
4533
|
-
onError: E,
|
|
4534
|
-
onSuccess: (n) => {
|
|
4535
|
-
r.invalidateQueries(["useGetAutoFunding", t], { exact: !0 });
|
|
4536
|
-
}
|
|
4537
|
-
});
|
|
4538
|
-
}, vu = () => {
|
|
4528
|
+
}, yu = () => {
|
|
4539
4529
|
const { client: t } = R();
|
|
4540
|
-
return
|
|
4530
|
+
return T({
|
|
4541
4531
|
mutationFn: async (e) => (await t.carriers.connect(e)).data,
|
|
4542
4532
|
mutationKey: ["useConnectCarrier"],
|
|
4543
4533
|
onError: E
|
|
4544
4534
|
});
|
|
4545
|
-
},
|
|
4535
|
+
}, vu = () => {
|
|
4546
4536
|
const { client: t } = R();
|
|
4547
|
-
return
|
|
4537
|
+
return T({
|
|
4548
4538
|
mutationFn: async ({ rateId: e, ...r }) => (await t.labels.createByRateId(e, r)).data,
|
|
4549
4539
|
mutationKey: ["useCreateLabel"],
|
|
4550
4540
|
onError: E
|
|
4551
4541
|
});
|
|
4552
|
-
},
|
|
4542
|
+
}, mu = () => {
|
|
4553
4543
|
const { client: t } = R();
|
|
4554
|
-
return
|
|
4544
|
+
return T({
|
|
4555
4545
|
mutationFn: async ({ salesOrderId: e, ...r }) => (await t.salesOrderShipments.create(e, r)).data,
|
|
4556
4546
|
mutationKey: ["useCreateSalesOrderShipment"],
|
|
4557
4547
|
onError: E
|
|
4558
4548
|
});
|
|
4559
|
-
},
|
|
4549
|
+
}, gu = () => {
|
|
4560
4550
|
const { client: t } = R();
|
|
4561
|
-
return
|
|
4551
|
+
return T({
|
|
4562
4552
|
mutationFn: async (e) => (await t.warehouses.create(e)).data,
|
|
4563
4553
|
mutationKey: ["useCreateWarehouse"],
|
|
4564
4554
|
onError: E
|
|
4565
4555
|
});
|
|
4566
|
-
},
|
|
4556
|
+
}, bu = () => {
|
|
4567
4557
|
const { client: t } = R();
|
|
4568
|
-
return
|
|
4558
|
+
return T({
|
|
4569
4559
|
mutationFn: async ({ warehouseId: e }) => (await t.warehouses.delete(e)).data,
|
|
4570
4560
|
mutationKey: ["useDeleteWarehouse"],
|
|
4571
4561
|
onError: E
|
|
4572
4562
|
});
|
|
4563
|
+
}, Su = () => {
|
|
4564
|
+
const { client: t } = R();
|
|
4565
|
+
return z({
|
|
4566
|
+
onError: E,
|
|
4567
|
+
queryFn: () => t.accountSettings.get(),
|
|
4568
|
+
queryKey: ["getAccountSettings"],
|
|
4569
|
+
select: (e) => e.data
|
|
4570
|
+
});
|
|
4573
4571
|
}, wu = (t) => {
|
|
4574
4572
|
const { client: e } = R();
|
|
4575
4573
|
return z({
|
|
@@ -4608,15 +4606,34 @@ const fi = pi(void 0), hu = ({
|
|
|
4608
4606
|
queryKey: ["useGetLabel", t],
|
|
4609
4607
|
select: (r) => r.data
|
|
4610
4608
|
});
|
|
4611
|
-
}, Ru = () => {
|
|
4612
|
-
const { client:
|
|
4609
|
+
}, Ru = (t) => {
|
|
4610
|
+
const { client: e } = R();
|
|
4613
4611
|
return z({
|
|
4612
|
+
enabled: t !== void 0,
|
|
4614
4613
|
onError: E,
|
|
4615
|
-
queryFn: () => t.
|
|
4616
|
-
queryKey: ["
|
|
4617
|
-
select: (
|
|
4614
|
+
queryFn: () => t ? e.salesOrders.get(t) : Promise.reject(new Error("salesOrderId is required")),
|
|
4615
|
+
queryKey: ["useGetSalesOrder", t],
|
|
4616
|
+
select: (r) => r.data
|
|
4617
|
+
});
|
|
4618
|
+
}, Au = (t) => {
|
|
4619
|
+
const { client: e } = R();
|
|
4620
|
+
return z({
|
|
4621
|
+
enabled: t !== void 0,
|
|
4622
|
+
onError: E,
|
|
4623
|
+
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4624
|
+
queryKey: ["useGetSalesOrderShipment", t],
|
|
4625
|
+
select: (r) => r.data
|
|
4626
|
+
});
|
|
4627
|
+
}, Cu = (t) => {
|
|
4628
|
+
const { client: e } = R();
|
|
4629
|
+
return z({
|
|
4630
|
+
enabled: t !== void 0,
|
|
4631
|
+
onError: E,
|
|
4632
|
+
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4633
|
+
queryKey: ["useGetShipment", t],
|
|
4634
|
+
select: (r) => r.data
|
|
4618
4635
|
});
|
|
4619
|
-
},
|
|
4636
|
+
}, Fu = () => ({
|
|
4620
4637
|
links: {
|
|
4621
4638
|
transactionHistoryReport: "http://link.to.entire.dataset.as.csv"
|
|
4622
4639
|
},
|
|
@@ -4645,25 +4662,7 @@ const fi = pi(void 0), hu = ({
|
|
|
4645
4662
|
transactionType: "purchase"
|
|
4646
4663
|
}
|
|
4647
4664
|
]
|
|
4648
|
-
}),
|
|
4649
|
-
const { client: e } = R();
|
|
4650
|
-
return z({
|
|
4651
|
-
enabled: t !== void 0,
|
|
4652
|
-
onError: E,
|
|
4653
|
-
queryFn: () => t ? e.salesOrders.get(t) : Promise.reject(new Error("salesOrderId is required")),
|
|
4654
|
-
queryKey: ["useGetSalesOrder", t],
|
|
4655
|
-
select: (r) => r.data
|
|
4656
|
-
});
|
|
4657
|
-
}, Fu = (t) => {
|
|
4658
|
-
const { client: e } = R();
|
|
4659
|
-
return z({
|
|
4660
|
-
enabled: t !== void 0,
|
|
4661
|
-
onError: E,
|
|
4662
|
-
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4663
|
-
queryKey: ["useGetSalesOrderShipment", t],
|
|
4664
|
-
select: (r) => r.data
|
|
4665
|
-
});
|
|
4666
|
-
}, xu = () => {
|
|
4665
|
+
}), xu = () => {
|
|
4667
4666
|
const { client: t } = R();
|
|
4668
4667
|
return z({
|
|
4669
4668
|
onError: E,
|
|
@@ -4671,7 +4670,15 @@ const fi = pi(void 0), hu = ({
|
|
|
4671
4670
|
queryKey: ["useListCarriers"],
|
|
4672
4671
|
select: (e) => e.data.carriers
|
|
4673
4672
|
});
|
|
4674
|
-
}, Iu = (
|
|
4673
|
+
}, Iu = () => {
|
|
4674
|
+
const { client: t } = R();
|
|
4675
|
+
return z({
|
|
4676
|
+
onError: E,
|
|
4677
|
+
queryFn: () => t.customPackages.list(),
|
|
4678
|
+
queryKey: ["useListCustomPackageTypes"],
|
|
4679
|
+
select: (e) => e.data.packages
|
|
4680
|
+
});
|
|
4681
|
+
}, _u = (t) => {
|
|
4675
4682
|
const { client: e } = R();
|
|
4676
4683
|
return z({
|
|
4677
4684
|
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
@@ -4680,7 +4687,7 @@ const fi = pi(void 0), hu = ({
|
|
|
4680
4687
|
queryKey: ["useListLabels", t],
|
|
4681
4688
|
select: (r) => r.data.labels
|
|
4682
4689
|
});
|
|
4683
|
-
},
|
|
4690
|
+
}, qu = () => {
|
|
4684
4691
|
const { client: t } = R();
|
|
4685
4692
|
return z({
|
|
4686
4693
|
onError: E,
|
|
@@ -4688,15 +4695,16 @@ const fi = pi(void 0), hu = ({
|
|
|
4688
4695
|
queryKey: ["useListOrderSources"],
|
|
4689
4696
|
select: (e) => e.data.orderSources
|
|
4690
4697
|
});
|
|
4691
|
-
},
|
|
4692
|
-
const { client:
|
|
4698
|
+
}, $u = (t) => {
|
|
4699
|
+
const { client: e } = R();
|
|
4693
4700
|
return z({
|
|
4701
|
+
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
4694
4702
|
onError: E,
|
|
4695
|
-
queryFn: () =>
|
|
4696
|
-
queryKey: ["
|
|
4697
|
-
select: (
|
|
4703
|
+
queryFn: () => e.salesOrderShipments.list(t),
|
|
4704
|
+
queryKey: ["useListSalesOrderShipments", t],
|
|
4705
|
+
select: (r) => r.data.shipments
|
|
4698
4706
|
});
|
|
4699
|
-
},
|
|
4707
|
+
}, Mu = (t = {}) => {
|
|
4700
4708
|
const { client: e } = R();
|
|
4701
4709
|
return z({
|
|
4702
4710
|
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
@@ -4705,15 +4713,6 @@ const fi = pi(void 0), hu = ({
|
|
|
4705
4713
|
queryKey: ["useListSalesOrders", t],
|
|
4706
4714
|
select: (r) => r.data.salesOrders
|
|
4707
4715
|
});
|
|
4708
|
-
}, Mu = (t) => {
|
|
4709
|
-
const { client: e } = R();
|
|
4710
|
-
return z({
|
|
4711
|
-
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
4712
|
-
onError: E,
|
|
4713
|
-
queryFn: () => e.salesOrderShipments.list(t),
|
|
4714
|
-
queryKey: ["useListSalesOrderShipments", t],
|
|
4715
|
-
select: (r) => r.data.shipments
|
|
4716
|
-
});
|
|
4717
4716
|
}, Du = () => {
|
|
4718
4717
|
const { client: t } = R();
|
|
4719
4718
|
return z({
|
|
@@ -4724,27 +4723,27 @@ const fi = pi(void 0), hu = ({
|
|
|
4724
4723
|
});
|
|
4725
4724
|
}, Tu = () => {
|
|
4726
4725
|
const { client: t } = R();
|
|
4727
|
-
return
|
|
4726
|
+
return T({
|
|
4728
4727
|
mutationFn: async ({ salesOrderId: e, ...r }) => (await t.salesOrders.notifyShipped(e, r)).data,
|
|
4729
4728
|
mutationKey: ["useNotifySalesOrder"],
|
|
4730
4729
|
onError: E
|
|
4731
4730
|
});
|
|
4732
4731
|
}, Uu = () => {
|
|
4733
4732
|
const { client: t } = R();
|
|
4734
|
-
return
|
|
4733
|
+
return T({
|
|
4735
4734
|
mutationFn: async ({ address: e, text: r }) => (await t.addresses.parse(r, e)).data,
|
|
4736
4735
|
mutationKey: ["useParseAddress"],
|
|
4737
4736
|
onError: E
|
|
4738
4737
|
});
|
|
4739
4738
|
}, ou = () => {
|
|
4740
4739
|
const { client: t } = R();
|
|
4741
|
-
return
|
|
4740
|
+
return T({
|
|
4742
4741
|
mutationFn: async (e) => (await t.orderSources.refresh(e)).data,
|
|
4743
4742
|
mutationKey: ["useRefreshOrderSourceAsync"]
|
|
4744
4743
|
});
|
|
4745
4744
|
}, Nu = () => {
|
|
4746
4745
|
const { client: t } = R(), { mutateAsync: e } = ou();
|
|
4747
|
-
return
|
|
4746
|
+
return T({
|
|
4748
4747
|
mutationFn: async (r) => (await e(r), await Yi(async () => {
|
|
4749
4748
|
const { data: i } = await t.orderSources.get(r);
|
|
4750
4749
|
if (["preparing_update", "updating"].includes(i.refreshInfo.status))
|
|
@@ -4754,8 +4753,27 @@ const fi = pi(void 0), hu = ({
|
|
|
4754
4753
|
mutationKey: ["useRefreshOrderSource"],
|
|
4755
4754
|
onError: E
|
|
4756
4755
|
});
|
|
4757
|
-
}, Lu = () =>
|
|
4758
|
-
mutationFn: async () => (await Promise.resolve({
|
|
4756
|
+
}, Lu = () => T({
|
|
4757
|
+
mutationFn: async (t) => (await Promise.resolve({
|
|
4758
|
+
data: { defaultLabelLayout: "4x6", dimension: "inch", weight: "ounce" },
|
|
4759
|
+
errors: [],
|
|
4760
|
+
isLoading: !1,
|
|
4761
|
+
isValidating: !1
|
|
4762
|
+
})).data,
|
|
4763
|
+
mutationKey: ["useUpdateAccountSettings"],
|
|
4764
|
+
onError: E
|
|
4765
|
+
}), Qu = (t) => {
|
|
4766
|
+
const { client: e } = R(), r = or();
|
|
4767
|
+
return T({
|
|
4768
|
+
mutationFn: async (n) => (await e.carriers.updateAutoFunding(t, n)).data,
|
|
4769
|
+
mutationKey: ["useUpdateAutoFunding"],
|
|
4770
|
+
onError: E,
|
|
4771
|
+
onSuccess: (n) => {
|
|
4772
|
+
r.invalidateQueries(["useGetAutoFunding", t], { exact: !0 });
|
|
4773
|
+
}
|
|
4774
|
+
});
|
|
4775
|
+
}, ku = () => T({
|
|
4776
|
+
mutationFn: async (t) => (await Promise.resolve({
|
|
4759
4777
|
data: {},
|
|
4760
4778
|
errors: [],
|
|
4761
4779
|
isLoading: !1,
|
|
@@ -4763,43 +4781,34 @@ const fi = pi(void 0), hu = ({
|
|
|
4763
4781
|
})).data,
|
|
4764
4782
|
mutationKey: ["useUpdateBilling"],
|
|
4765
4783
|
onError: E
|
|
4766
|
-
}),
|
|
4784
|
+
}), Bu = () => {
|
|
4767
4785
|
const { client: t } = R();
|
|
4768
|
-
return
|
|
4786
|
+
return T({
|
|
4769
4787
|
mutationFn: async ({ shipmentId: e, ...r }) => (await t.salesOrderShipments.update(e, r)).data,
|
|
4770
4788
|
mutationKey: ["useUpdateSalesOrderShipment"],
|
|
4771
4789
|
onError: E
|
|
4772
4790
|
});
|
|
4773
|
-
},
|
|
4791
|
+
}, ju = () => {
|
|
4774
4792
|
const { client: t } = R();
|
|
4775
|
-
return
|
|
4793
|
+
return T({
|
|
4776
4794
|
mutationFn: async ({ warehouseId: e, ...r }) => (await t.warehouses.update(e, r)).data,
|
|
4777
4795
|
mutationKey: ["useUpdateWarehouse"],
|
|
4778
4796
|
onError: E
|
|
4779
4797
|
});
|
|
4780
|
-
},
|
|
4798
|
+
}, zu = () => {
|
|
4781
4799
|
const { client: t } = R();
|
|
4782
|
-
return
|
|
4800
|
+
return T({
|
|
4783
4801
|
mutationFn: async (e) => (await t.addresses.validate(e)).data,
|
|
4784
4802
|
mutationKey: ["useValidateAddresses"],
|
|
4785
4803
|
onError: E
|
|
4786
4804
|
});
|
|
4787
|
-
},
|
|
4805
|
+
}, Ku = () => {
|
|
4788
4806
|
const { client: t } = R();
|
|
4789
|
-
return
|
|
4807
|
+
return T({
|
|
4790
4808
|
mutationFn: async (e) => (await t.labels.void(e)).data,
|
|
4791
4809
|
mutationKey: ["useVoidLabel"],
|
|
4792
4810
|
onError: E
|
|
4793
4811
|
});
|
|
4794
|
-
}, zu = (t) => {
|
|
4795
|
-
const { client: e } = R();
|
|
4796
|
-
return z({
|
|
4797
|
-
enabled: t !== void 0,
|
|
4798
|
-
onError: E,
|
|
4799
|
-
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4800
|
-
queryKey: ["useGetShipment", t],
|
|
4801
|
-
select: (r) => r.data
|
|
4802
|
-
});
|
|
4803
4812
|
};
|
|
4804
4813
|
export {
|
|
4805
4814
|
fi as ShipEngineContext,
|
|
@@ -4810,35 +4819,36 @@ export {
|
|
|
4810
4819
|
Yi as retryUntil,
|
|
4811
4820
|
du as useAddFunds,
|
|
4812
4821
|
pu as useCalculateRates,
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4822
|
+
yu as useConnectCarrier,
|
|
4823
|
+
vu as useCreateLabel,
|
|
4824
|
+
mu as useCreateSalesOrderShipment,
|
|
4825
|
+
gu as useCreateWarehouse,
|
|
4826
|
+
bu as useDeleteWarehouse,
|
|
4827
|
+
Su as useGetAccountSettings,
|
|
4819
4828
|
wu as useGetAutoFundingConfiguration,
|
|
4820
4829
|
Ou as useGetCarrierById,
|
|
4821
4830
|
Pu as useGetInsuranceAccount,
|
|
4822
4831
|
Eu as useGetLabel,
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4832
|
+
Ru as useGetSalesOrder,
|
|
4833
|
+
Au as useGetSalesOrderShipment,
|
|
4834
|
+
Cu as useGetShipment,
|
|
4835
|
+
Fu as useGetWalletTransactionHistory,
|
|
4827
4836
|
xu as useListCarriers,
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4837
|
+
Iu as useListCustomPackageTypes,
|
|
4838
|
+
_u as useListLabels,
|
|
4839
|
+
qu as useListOrderSources,
|
|
4840
|
+
$u as useListSalesOrderShipments,
|
|
4841
|
+
Mu as useListSalesOrders,
|
|
4833
4842
|
Du as useListWarehouses,
|
|
4834
4843
|
Tu as useNotifySalesOrderShipped,
|
|
4835
4844
|
Uu as useParseAddress,
|
|
4836
4845
|
Nu as useRefreshOrderSource,
|
|
4837
4846
|
ou as useRefreshOrderSourceAsync,
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4847
|
+
Lu as useUpdateAccountSettings,
|
|
4848
|
+
Qu as useUpdateAutoFunding,
|
|
4849
|
+
ku as useUpdateBilling,
|
|
4850
|
+
Bu as useUpdateSalesOrderShipment,
|
|
4851
|
+
ju as useUpdateWarehouse,
|
|
4852
|
+
zu as useValidateAddresses,
|
|
4853
|
+
Ku as useVoidLabel
|
|
4844
4854
|
};
|