@shipengine/react-api 2.11.8 → 2.12.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/rates/index.d.ts +1 -0
- package/hooks/rates/use-rates-estimate.d.ts +10 -0
- package/index.js +87 -54
- package/index.mjs +87 -55
- package/package.json +1 -1
package/hooks/rates/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RatesEstimateParams } from "@shipengine/js-api";
|
|
2
|
+
export type RatesEstimateData = {
|
|
3
|
+
rateParams: RatesEstimateParams;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* @category ShipEngine API Hooks
|
|
7
|
+
*
|
|
8
|
+
* @see [ShipEngine API Reference](https://shipengine.github.io/shipengine-openapi/#operation/estimate_rates)
|
|
9
|
+
*/
|
|
10
|
+
export declare const useRatesEstimate: () => import("@tanstack/react-query").UseMutationResult<import("@shipengine/js-api").RatesEstimateResponse, import("@shipengine/js-api").CodedError[], RatesEstimateData, unknown>;
|
package/index.js
CHANGED
|
@@ -129,7 +129,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
|
|
|
129
129
|
throw error;
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
var __async$
|
|
132
|
+
var __async$G = (__this, __arguments, generator) => {
|
|
133
133
|
return new Promise((resolve, reject) => {
|
|
134
134
|
var fulfilled = (value) => {
|
|
135
135
|
try {
|
|
@@ -152,7 +152,7 @@ var __async$F = (__this, __arguments, generator) => {
|
|
|
152
152
|
const useCreateAccountImage = () => {
|
|
153
153
|
const { client } = useShipEngine();
|
|
154
154
|
return reactQuery.useMutation({
|
|
155
|
-
mutationFn: (data) => __async$
|
|
155
|
+
mutationFn: (data) => __async$G(void 0, null, function* () {
|
|
156
156
|
const result = yield client.accountSettings.createImage(data);
|
|
157
157
|
return result.data;
|
|
158
158
|
}),
|
|
@@ -161,7 +161,7 @@ const useCreateAccountImage = () => {
|
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
var __async$
|
|
164
|
+
var __async$F = (__this, __arguments, generator) => {
|
|
165
165
|
return new Promise((resolve, reject) => {
|
|
166
166
|
var fulfilled = (value) => {
|
|
167
167
|
try {
|
|
@@ -184,7 +184,7 @@ var __async$E = (__this, __arguments, generator) => {
|
|
|
184
184
|
const useDeleteAccountImage = () => {
|
|
185
185
|
const { client } = useShipEngine();
|
|
186
186
|
return reactQuery.useMutation({
|
|
187
|
-
mutationFn: (labelImageId) => __async$
|
|
187
|
+
mutationFn: (labelImageId) => __async$F(void 0, null, function* () {
|
|
188
188
|
const result = yield client.accountSettings.deleteImage(labelImageId);
|
|
189
189
|
return result.data;
|
|
190
190
|
}),
|
|
@@ -213,7 +213,7 @@ const useGetAccountSettings = () => {
|
|
|
213
213
|
});
|
|
214
214
|
};
|
|
215
215
|
|
|
216
|
-
var __async$
|
|
216
|
+
var __async$E = (__this, __arguments, generator) => {
|
|
217
217
|
return new Promise((resolve, reject) => {
|
|
218
218
|
var fulfilled = (value) => {
|
|
219
219
|
try {
|
|
@@ -236,7 +236,7 @@ var __async$D = (__this, __arguments, generator) => {
|
|
|
236
236
|
const useUpdateAccountImage = () => {
|
|
237
237
|
const { client } = useShipEngine();
|
|
238
238
|
return reactQuery.useMutation({
|
|
239
|
-
mutationFn: (data) => __async$
|
|
239
|
+
mutationFn: (data) => __async$E(void 0, null, function* () {
|
|
240
240
|
const result = yield client.accountSettings.updateImage(data);
|
|
241
241
|
return result.data;
|
|
242
242
|
}),
|
|
@@ -245,7 +245,7 @@ const useUpdateAccountImage = () => {
|
|
|
245
245
|
});
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
var __async$
|
|
248
|
+
var __async$D = (__this, __arguments, generator) => {
|
|
249
249
|
return new Promise((resolve, reject) => {
|
|
250
250
|
var fulfilled = (value) => {
|
|
251
251
|
try {
|
|
@@ -268,7 +268,7 @@ var __async$C = (__this, __arguments, generator) => {
|
|
|
268
268
|
const useUpdateAccountSettings = () => {
|
|
269
269
|
const { client } = useShipEngine();
|
|
270
270
|
return reactQuery.useMutation({
|
|
271
|
-
mutationFn: (settings) => __async$
|
|
271
|
+
mutationFn: (settings) => __async$D(void 0, null, function* () {
|
|
272
272
|
const result = yield client.accountSettings.update(settings);
|
|
273
273
|
return result.data;
|
|
274
274
|
}),
|
|
@@ -277,7 +277,7 @@ const useUpdateAccountSettings = () => {
|
|
|
277
277
|
});
|
|
278
278
|
};
|
|
279
279
|
|
|
280
|
-
var __async$
|
|
280
|
+
var __async$C = (__this, __arguments, generator) => {
|
|
281
281
|
return new Promise((resolve, reject) => {
|
|
282
282
|
var fulfilled = (value) => {
|
|
283
283
|
try {
|
|
@@ -300,7 +300,7 @@ var __async$B = (__this, __arguments, generator) => {
|
|
|
300
300
|
const useParseAddress = () => {
|
|
301
301
|
const { client } = useShipEngine();
|
|
302
302
|
return reactQuery.useMutation({
|
|
303
|
-
mutationFn: (_0) => __async$
|
|
303
|
+
mutationFn: (_0) => __async$C(void 0, [_0], function* ({ address, text }) {
|
|
304
304
|
const result = yield client.addresses.parse(text, address);
|
|
305
305
|
return result.data;
|
|
306
306
|
}),
|
|
@@ -309,7 +309,7 @@ const useParseAddress = () => {
|
|
|
309
309
|
});
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
-
var __async$
|
|
312
|
+
var __async$B = (__this, __arguments, generator) => {
|
|
313
313
|
return new Promise((resolve, reject) => {
|
|
314
314
|
var fulfilled = (value) => {
|
|
315
315
|
try {
|
|
@@ -332,7 +332,7 @@ var __async$A = (__this, __arguments, generator) => {
|
|
|
332
332
|
const useValidateAddresses = () => {
|
|
333
333
|
const { client } = useShipEngine();
|
|
334
334
|
return reactQuery.useMutation({
|
|
335
|
-
mutationFn: (addresses) => __async$
|
|
335
|
+
mutationFn: (addresses) => __async$B(void 0, null, function* () {
|
|
336
336
|
const result = yield client.addresses.validate(addresses);
|
|
337
337
|
return result.data;
|
|
338
338
|
}),
|
|
@@ -341,7 +341,7 @@ const useValidateAddresses = () => {
|
|
|
341
341
|
});
|
|
342
342
|
};
|
|
343
343
|
|
|
344
|
-
var __async$
|
|
344
|
+
var __async$A = (__this, __arguments, generator) => {
|
|
345
345
|
return new Promise((resolve, reject) => {
|
|
346
346
|
var fulfilled = (value) => {
|
|
347
347
|
try {
|
|
@@ -364,7 +364,7 @@ var __async$z = (__this, __arguments, generator) => {
|
|
|
364
364
|
const useAddFunds = () => {
|
|
365
365
|
const { client } = useShipEngine();
|
|
366
366
|
return reactQuery.useMutation({
|
|
367
|
-
mutationFn: (_0) => __async$
|
|
367
|
+
mutationFn: (_0) => __async$A(void 0, [_0], function* ({ carrierId, funds }) {
|
|
368
368
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
369
369
|
return result.data;
|
|
370
370
|
}),
|
|
@@ -373,7 +373,7 @@ const useAddFunds = () => {
|
|
|
373
373
|
});
|
|
374
374
|
};
|
|
375
375
|
|
|
376
|
-
var __async$
|
|
376
|
+
var __async$z = (__this, __arguments, generator) => {
|
|
377
377
|
return new Promise((resolve, reject) => {
|
|
378
378
|
var fulfilled = (value) => {
|
|
379
379
|
try {
|
|
@@ -396,7 +396,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
396
396
|
const useConnectCarrier = () => {
|
|
397
397
|
const { client } = useShipEngine();
|
|
398
398
|
return reactQuery.useMutation({
|
|
399
|
-
mutationFn: (params) => __async$
|
|
399
|
+
mutationFn: (params) => __async$z(void 0, null, function* () {
|
|
400
400
|
const result = yield client.carriers.connect(params);
|
|
401
401
|
return result.data;
|
|
402
402
|
}),
|
|
@@ -530,7 +530,7 @@ var __objRest$b = (source, exclude) => {
|
|
|
530
530
|
}
|
|
531
531
|
return target;
|
|
532
532
|
};
|
|
533
|
-
var __async$
|
|
533
|
+
var __async$y = (__this, __arguments, generator) => {
|
|
534
534
|
return new Promise((resolve, reject) => {
|
|
535
535
|
var fulfilled = (value) => {
|
|
536
536
|
try {
|
|
@@ -554,7 +554,7 @@ const useUpdateAutoFunding = () => {
|
|
|
554
554
|
const { client } = useShipEngine();
|
|
555
555
|
const queryClient = reactQuery.useQueryClient();
|
|
556
556
|
return reactQuery.useMutation({
|
|
557
|
-
mutationFn: (_a) => __async$
|
|
557
|
+
mutationFn: (_a) => __async$y(void 0, null, function* () {
|
|
558
558
|
var _b = _a, { carrierId } = _b, options = __objRest$b(_b, ["carrierId"]);
|
|
559
559
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
560
560
|
return result.data;
|
|
@@ -584,7 +584,7 @@ const useGetZonesByCarrier = (carrierId) => {
|
|
|
584
584
|
});
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
var __async$
|
|
587
|
+
var __async$x = (__this, __arguments, generator) => {
|
|
588
588
|
return new Promise((resolve, reject) => {
|
|
589
589
|
var fulfilled = (value) => {
|
|
590
590
|
try {
|
|
@@ -607,7 +607,7 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
607
607
|
const useDeleteCarrier = () => {
|
|
608
608
|
const { client } = useShipEngine();
|
|
609
609
|
return reactQuery.useMutation({
|
|
610
|
-
mutationFn: (carrierId) => __async$
|
|
610
|
+
mutationFn: (carrierId) => __async$x(void 0, null, function* () {
|
|
611
611
|
const result = yield client.carriers.delete(carrierId);
|
|
612
612
|
return result.data;
|
|
613
613
|
}),
|
|
@@ -670,7 +670,7 @@ const useListCarrierConnections = (_params) => {
|
|
|
670
670
|
});
|
|
671
671
|
};
|
|
672
672
|
|
|
673
|
-
var __async$
|
|
673
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
674
674
|
return new Promise((resolve, reject) => {
|
|
675
675
|
var fulfilled = (value) => {
|
|
676
676
|
try {
|
|
@@ -693,7 +693,7 @@ var __async$v = (__this, __arguments, generator) => {
|
|
|
693
693
|
const useConnectCarrierAccount = () => {
|
|
694
694
|
const { client } = useShipEngine();
|
|
695
695
|
return reactQuery.useMutation({
|
|
696
|
-
mutationFn: (_0) => __async$
|
|
696
|
+
mutationFn: (_0) => __async$w(void 0, [_0], function* ({ carrierName, formData }) {
|
|
697
697
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
698
698
|
return result.data;
|
|
699
699
|
}),
|
|
@@ -723,7 +723,7 @@ const useListCustomPackageTypes = () => {
|
|
|
723
723
|
});
|
|
724
724
|
};
|
|
725
725
|
|
|
726
|
-
var __async$
|
|
726
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
727
727
|
return new Promise((resolve, reject) => {
|
|
728
728
|
var fulfilled = (value) => {
|
|
729
729
|
try {
|
|
@@ -746,7 +746,7 @@ var __async$u = (__this, __arguments, generator) => {
|
|
|
746
746
|
const useCreateFundingSource = () => {
|
|
747
747
|
const { client } = useShipEngine();
|
|
748
748
|
return reactQuery.useMutation({
|
|
749
|
-
mutationFn: (fundingSource) => __async$
|
|
749
|
+
mutationFn: (fundingSource) => __async$v(void 0, null, function* () {
|
|
750
750
|
const result = yield client.fundingSources.create(fundingSource);
|
|
751
751
|
return result.data;
|
|
752
752
|
}),
|
|
@@ -755,7 +755,7 @@ const useCreateFundingSource = () => {
|
|
|
755
755
|
});
|
|
756
756
|
};
|
|
757
757
|
|
|
758
|
-
var __async$
|
|
758
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
759
759
|
return new Promise((resolve, reject) => {
|
|
760
760
|
var fulfilled = (value) => {
|
|
761
761
|
try {
|
|
@@ -778,7 +778,7 @@ var __async$t = (__this, __arguments, generator) => {
|
|
|
778
778
|
const useFundingSourcesAddFunds = () => {
|
|
779
779
|
const { client } = useShipEngine();
|
|
780
780
|
return reactQuery.useMutation({
|
|
781
|
-
mutationFn: (_0) => __async$
|
|
781
|
+
mutationFn: (_0) => __async$u(void 0, [_0], function* ({ funds, fundingSourceId }) {
|
|
782
782
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
783
783
|
return result.data;
|
|
784
784
|
}),
|
|
@@ -807,7 +807,7 @@ const useListFundingSources = () => {
|
|
|
807
807
|
});
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
-
var __async$
|
|
810
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
811
811
|
return new Promise((resolve, reject) => {
|
|
812
812
|
var fulfilled = (value) => {
|
|
813
813
|
try {
|
|
@@ -830,7 +830,7 @@ var __async$s = (__this, __arguments, generator) => {
|
|
|
830
830
|
const useRegisterCarrier = () => {
|
|
831
831
|
const { client } = useShipEngine();
|
|
832
832
|
return reactQuery.useMutation({
|
|
833
|
-
mutationFn: (carrier) => __async$
|
|
833
|
+
mutationFn: (carrier) => __async$t(void 0, null, function* () {
|
|
834
834
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
835
835
|
return result.data;
|
|
836
836
|
}),
|
|
@@ -839,7 +839,7 @@ const useRegisterCarrier = () => {
|
|
|
839
839
|
});
|
|
840
840
|
};
|
|
841
841
|
|
|
842
|
-
var __async$
|
|
842
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
843
843
|
return new Promise((resolve, reject) => {
|
|
844
844
|
var fulfilled = (value) => {
|
|
845
845
|
try {
|
|
@@ -862,7 +862,7 @@ var __async$r = (__this, __arguments, generator) => {
|
|
|
862
862
|
const useUpdateFundingSource = () => {
|
|
863
863
|
const { client } = useShipEngine();
|
|
864
864
|
return reactQuery.useMutation({
|
|
865
|
-
mutationFn: (_0) => __async$
|
|
865
|
+
mutationFn: (_0) => __async$s(void 0, [_0], function* ({
|
|
866
866
|
billingInfo,
|
|
867
867
|
creditCardInfo,
|
|
868
868
|
fundingSourceId
|
|
@@ -941,7 +941,7 @@ var __objRest$8 = (source, exclude) => {
|
|
|
941
941
|
}
|
|
942
942
|
return target;
|
|
943
943
|
};
|
|
944
|
-
var __async$
|
|
944
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
945
945
|
return new Promise((resolve, reject) => {
|
|
946
946
|
var fulfilled = (value) => {
|
|
947
947
|
try {
|
|
@@ -964,7 +964,7 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
964
964
|
const useAddInsuranceFunds = () => {
|
|
965
965
|
const { client } = useShipEngine();
|
|
966
966
|
return reactQuery.useMutation({
|
|
967
|
-
mutationFn: (_a) => __async$
|
|
967
|
+
mutationFn: (_a) => __async$r(void 0, null, function* () {
|
|
968
968
|
var _b = _a, { insuranceProvider } = _b, rest = __objRest$8(_b, ["insuranceProvider"]);
|
|
969
969
|
const result = yield client.insurance.addFunds(insuranceProvider, rest);
|
|
970
970
|
return result.data;
|
|
@@ -989,7 +989,7 @@ var __objRest$7 = (source, exclude) => {
|
|
|
989
989
|
}
|
|
990
990
|
return target;
|
|
991
991
|
};
|
|
992
|
-
var __async$
|
|
992
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
993
993
|
return new Promise((resolve, reject) => {
|
|
994
994
|
var fulfilled = (value) => {
|
|
995
995
|
try {
|
|
@@ -1012,7 +1012,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
1012
1012
|
const useCreateLabel = () => {
|
|
1013
1013
|
const { client } = useShipEngine();
|
|
1014
1014
|
return reactQuery.useMutation({
|
|
1015
|
-
mutationFn: (_a) => __async$
|
|
1015
|
+
mutationFn: (_a) => __async$q(void 0, null, function* () {
|
|
1016
1016
|
var _b = _a, { rateId } = _b, options = __objRest$7(_b, ["rateId"]);
|
|
1017
1017
|
const result = yield client.labels.createByRateId(rateId, options);
|
|
1018
1018
|
return result.data;
|
|
@@ -1064,7 +1064,7 @@ const useListLabels = (_params) => {
|
|
|
1064
1064
|
});
|
|
1065
1065
|
};
|
|
1066
1066
|
|
|
1067
|
-
var __async$
|
|
1067
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
1068
1068
|
return new Promise((resolve, reject) => {
|
|
1069
1069
|
var fulfilled = (value) => {
|
|
1070
1070
|
try {
|
|
@@ -1087,7 +1087,7 @@ var __async$o = (__this, __arguments, generator) => {
|
|
|
1087
1087
|
const useVoidLabel = () => {
|
|
1088
1088
|
const { client } = useShipEngine();
|
|
1089
1089
|
return reactQuery.useMutation({
|
|
1090
|
-
mutationFn: (labelId) => __async$
|
|
1090
|
+
mutationFn: (labelId) => __async$p(void 0, null, function* () {
|
|
1091
1091
|
const result = yield client.labels.void(labelId);
|
|
1092
1092
|
return result.data;
|
|
1093
1093
|
}),
|
|
@@ -1106,7 +1106,7 @@ const useListOrderSources = () => {
|
|
|
1106
1106
|
});
|
|
1107
1107
|
};
|
|
1108
1108
|
|
|
1109
|
-
var __async$
|
|
1109
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
1110
1110
|
return new Promise((resolve, reject) => {
|
|
1111
1111
|
var fulfilled = (value) => {
|
|
1112
1112
|
try {
|
|
@@ -1129,7 +1129,7 @@ var __async$n = (__this, __arguments, generator) => {
|
|
|
1129
1129
|
const useRefreshOrderSourceAsync = () => {
|
|
1130
1130
|
const { client } = useShipEngine();
|
|
1131
1131
|
return reactQuery.useMutation({
|
|
1132
|
-
mutationFn: (orderSourceId) => __async$
|
|
1132
|
+
mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
|
|
1133
1133
|
const result = yield client.orderSources.refresh(orderSourceId);
|
|
1134
1134
|
return result.data;
|
|
1135
1135
|
}),
|
|
@@ -1140,9 +1140,9 @@ const useRefreshOrderSource = () => {
|
|
|
1140
1140
|
const { client } = useShipEngine();
|
|
1141
1141
|
const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
|
|
1142
1142
|
return reactQuery.useMutation({
|
|
1143
|
-
mutationFn: (orderSourceId) => __async$
|
|
1143
|
+
mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
|
|
1144
1144
|
yield refreshOrderSourceAsync(orderSourceId);
|
|
1145
|
-
const waitResult = yield retryUntil(() => __async$
|
|
1145
|
+
const waitResult = yield retryUntil(() => __async$o(void 0, null, function* () {
|
|
1146
1146
|
const { data: checkResult } = yield client.orderSources.get(orderSourceId);
|
|
1147
1147
|
if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
|
|
1148
1148
|
throw new jsApi.SE.CodedError("Order source is still refreshing");
|
|
@@ -1156,7 +1156,7 @@ const useRefreshOrderSource = () => {
|
|
|
1156
1156
|
});
|
|
1157
1157
|
};
|
|
1158
1158
|
|
|
1159
|
-
var __async$
|
|
1159
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
1160
1160
|
return new Promise((resolve, reject) => {
|
|
1161
1161
|
var fulfilled = (value) => {
|
|
1162
1162
|
try {
|
|
@@ -1179,7 +1179,7 @@ var __async$m = (__this, __arguments, generator) => {
|
|
|
1179
1179
|
const useDeactivateOrderSource = () => {
|
|
1180
1180
|
const { client } = useShipEngine();
|
|
1181
1181
|
return reactQuery.useMutation({
|
|
1182
|
-
mutationFn: (orderSourceId) => __async$
|
|
1182
|
+
mutationFn: (orderSourceId) => __async$n(void 0, null, function* () {
|
|
1183
1183
|
const result = yield client.orderSources.deactivate(orderSourceId);
|
|
1184
1184
|
return result.data;
|
|
1185
1185
|
}),
|
|
@@ -1188,7 +1188,7 @@ const useDeactivateOrderSource = () => {
|
|
|
1188
1188
|
});
|
|
1189
1189
|
};
|
|
1190
1190
|
|
|
1191
|
-
var __async$
|
|
1191
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
1192
1192
|
return new Promise((resolve, reject) => {
|
|
1193
1193
|
var fulfilled = (value) => {
|
|
1194
1194
|
try {
|
|
@@ -1211,7 +1211,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
1211
1211
|
const useCreateRateCard = () => {
|
|
1212
1212
|
const { client } = useShipEngine();
|
|
1213
1213
|
return reactQuery.useMutation({
|
|
1214
|
-
mutationFn: (rateCard) => __async$
|
|
1214
|
+
mutationFn: (rateCard) => __async$m(void 0, null, function* () {
|
|
1215
1215
|
const result = yield client.rateCards.create(rateCard);
|
|
1216
1216
|
return result.data;
|
|
1217
1217
|
}),
|
|
@@ -1258,7 +1258,7 @@ const useListRateCards = (carrierIds) => {
|
|
|
1258
1258
|
});
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
-
var __async$
|
|
1261
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
1262
1262
|
return new Promise((resolve, reject) => {
|
|
1263
1263
|
var fulfilled = (value) => {
|
|
1264
1264
|
try {
|
|
@@ -1281,7 +1281,7 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
1281
1281
|
const usePublishRateCard = () => {
|
|
1282
1282
|
const { client } = useShipEngine();
|
|
1283
1283
|
return reactQuery.useMutation({
|
|
1284
|
-
mutationFn: (rateCardId) => __async$
|
|
1284
|
+
mutationFn: (rateCardId) => __async$l(void 0, null, function* () {
|
|
1285
1285
|
return yield client.rateCards.publish(rateCardId);
|
|
1286
1286
|
}),
|
|
1287
1287
|
mutationKey: ["usePublishRateCard"],
|
|
@@ -1289,7 +1289,7 @@ const usePublishRateCard = () => {
|
|
|
1289
1289
|
});
|
|
1290
1290
|
};
|
|
1291
1291
|
|
|
1292
|
-
var __async$
|
|
1292
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
1293
1293
|
return new Promise((resolve, reject) => {
|
|
1294
1294
|
var fulfilled = (value) => {
|
|
1295
1295
|
try {
|
|
@@ -1312,7 +1312,7 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
1312
1312
|
const useUpdateRateCard = () => {
|
|
1313
1313
|
const { client } = useShipEngine();
|
|
1314
1314
|
return reactQuery.useMutation({
|
|
1315
|
-
mutationFn: (rateCard) => __async$
|
|
1315
|
+
mutationFn: (rateCard) => __async$k(void 0, null, function* () {
|
|
1316
1316
|
const result = yield client.rateCards.update(rateCard);
|
|
1317
1317
|
return result.data;
|
|
1318
1318
|
}),
|
|
@@ -1321,7 +1321,7 @@ const useUpdateRateCard = () => {
|
|
|
1321
1321
|
});
|
|
1322
1322
|
};
|
|
1323
1323
|
|
|
1324
|
-
var __async$
|
|
1324
|
+
var __async$j = (__this, __arguments, generator) => {
|
|
1325
1325
|
return new Promise((resolve, reject) => {
|
|
1326
1326
|
var fulfilled = (value) => {
|
|
1327
1327
|
try {
|
|
@@ -1344,7 +1344,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
1344
1344
|
const useUploadRateCard = () => {
|
|
1345
1345
|
const { client } = useShipEngine();
|
|
1346
1346
|
return reactQuery.useMutation({
|
|
1347
|
-
mutationFn: (_0) => __async$
|
|
1347
|
+
mutationFn: (_0) => __async$j(void 0, [_0], function* ({ rateCardId, file }) {
|
|
1348
1348
|
const result = yield client.rateCards.upload(rateCardId, file);
|
|
1349
1349
|
return result.data;
|
|
1350
1350
|
}),
|
|
@@ -1353,7 +1353,7 @@ const useUploadRateCard = () => {
|
|
|
1353
1353
|
});
|
|
1354
1354
|
};
|
|
1355
1355
|
|
|
1356
|
-
var __async$
|
|
1356
|
+
var __async$i = (__this, __arguments, generator) => {
|
|
1357
1357
|
return new Promise((resolve, reject) => {
|
|
1358
1358
|
var fulfilled = (value) => {
|
|
1359
1359
|
try {
|
|
@@ -1376,7 +1376,7 @@ var __async$h = (__this, __arguments, generator) => {
|
|
|
1376
1376
|
const useDeleteRateCard = () => {
|
|
1377
1377
|
const { client } = useShipEngine();
|
|
1378
1378
|
return reactQuery.useMutation({
|
|
1379
|
-
mutationFn: (rateCardId) => __async$
|
|
1379
|
+
mutationFn: (rateCardId) => __async$i(void 0, null, function* () {
|
|
1380
1380
|
const result = yield client.rateCards.delete(rateCardId);
|
|
1381
1381
|
return result.data;
|
|
1382
1382
|
}),
|
|
@@ -1385,7 +1385,7 @@ const useDeleteRateCard = () => {
|
|
|
1385
1385
|
});
|
|
1386
1386
|
};
|
|
1387
1387
|
|
|
1388
|
-
var __async$
|
|
1388
|
+
var __async$h = (__this, __arguments, generator) => {
|
|
1389
1389
|
return new Promise((resolve, reject) => {
|
|
1390
1390
|
var fulfilled = (value) => {
|
|
1391
1391
|
try {
|
|
@@ -1408,7 +1408,7 @@ var __async$g = (__this, __arguments, generator) => {
|
|
|
1408
1408
|
const useCalculateRates = () => {
|
|
1409
1409
|
const { client } = useShipEngine();
|
|
1410
1410
|
return reactQuery.useMutation({
|
|
1411
|
-
mutationFn: (_0) => __async$
|
|
1411
|
+
mutationFn: (_0) => __async$h(void 0, [_0], function* ({ rateOptions, shipmentId }) {
|
|
1412
1412
|
const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
|
|
1413
1413
|
return result.data;
|
|
1414
1414
|
}),
|
|
@@ -1417,6 +1417,38 @@ const useCalculateRates = () => {
|
|
|
1417
1417
|
});
|
|
1418
1418
|
};
|
|
1419
1419
|
|
|
1420
|
+
var __async$g = (__this, __arguments, generator) => {
|
|
1421
|
+
return new Promise((resolve, reject) => {
|
|
1422
|
+
var fulfilled = (value) => {
|
|
1423
|
+
try {
|
|
1424
|
+
step(generator.next(value));
|
|
1425
|
+
} catch (e) {
|
|
1426
|
+
reject(e);
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
var rejected = (value) => {
|
|
1430
|
+
try {
|
|
1431
|
+
step(generator.throw(value));
|
|
1432
|
+
} catch (e) {
|
|
1433
|
+
reject(e);
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1437
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1438
|
+
});
|
|
1439
|
+
};
|
|
1440
|
+
const useRatesEstimate = () => {
|
|
1441
|
+
const { client } = useShipEngine();
|
|
1442
|
+
return reactQuery.useMutation({
|
|
1443
|
+
mutationFn: (_0) => __async$g(void 0, [_0], function* ({ rateParams }) {
|
|
1444
|
+
const result = yield client.rates.estimate(rateParams);
|
|
1445
|
+
return result.data;
|
|
1446
|
+
}),
|
|
1447
|
+
mutationKey: ["useRatesEstimate"],
|
|
1448
|
+
onError
|
|
1449
|
+
});
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1420
1452
|
const useGetSalesOrder = (salesOrderId) => {
|
|
1421
1453
|
const { client } = useShipEngine();
|
|
1422
1454
|
return reactQuery.useQuery({
|
|
@@ -2491,6 +2523,7 @@ exports.useListWebhooks = useListWebhooks;
|
|
|
2491
2523
|
exports.useNotifySalesOrderShipped = useNotifySalesOrderShipped;
|
|
2492
2524
|
exports.useParseAddress = useParseAddress;
|
|
2493
2525
|
exports.usePublishRateCard = usePublishRateCard;
|
|
2526
|
+
exports.useRatesEstimate = useRatesEstimate;
|
|
2494
2527
|
exports.useRefreshOrderSource = useRefreshOrderSource;
|
|
2495
2528
|
exports.useRefreshOrderSourceAsync = useRefreshOrderSourceAsync;
|
|
2496
2529
|
exports.useRegisterCarrier = useRegisterCarrier;
|
package/index.mjs
CHANGED
|
@@ -126,7 +126,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
|
|
|
126
126
|
throw error;
|
|
127
127
|
});
|
|
128
128
|
|
|
129
|
-
var __async$
|
|
129
|
+
var __async$G = (__this, __arguments, generator) => {
|
|
130
130
|
return new Promise((resolve, reject) => {
|
|
131
131
|
var fulfilled = (value) => {
|
|
132
132
|
try {
|
|
@@ -149,7 +149,7 @@ var __async$F = (__this, __arguments, generator) => {
|
|
|
149
149
|
const useCreateAccountImage = () => {
|
|
150
150
|
const { client } = useShipEngine();
|
|
151
151
|
return useMutation({
|
|
152
|
-
mutationFn: (data) => __async$
|
|
152
|
+
mutationFn: (data) => __async$G(void 0, null, function* () {
|
|
153
153
|
const result = yield client.accountSettings.createImage(data);
|
|
154
154
|
return result.data;
|
|
155
155
|
}),
|
|
@@ -158,7 +158,7 @@ const useCreateAccountImage = () => {
|
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
var __async$
|
|
161
|
+
var __async$F = (__this, __arguments, generator) => {
|
|
162
162
|
return new Promise((resolve, reject) => {
|
|
163
163
|
var fulfilled = (value) => {
|
|
164
164
|
try {
|
|
@@ -181,7 +181,7 @@ var __async$E = (__this, __arguments, generator) => {
|
|
|
181
181
|
const useDeleteAccountImage = () => {
|
|
182
182
|
const { client } = useShipEngine();
|
|
183
183
|
return useMutation({
|
|
184
|
-
mutationFn: (labelImageId) => __async$
|
|
184
|
+
mutationFn: (labelImageId) => __async$F(void 0, null, function* () {
|
|
185
185
|
const result = yield client.accountSettings.deleteImage(labelImageId);
|
|
186
186
|
return result.data;
|
|
187
187
|
}),
|
|
@@ -210,7 +210,7 @@ const useGetAccountSettings = () => {
|
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
var __async$
|
|
213
|
+
var __async$E = (__this, __arguments, generator) => {
|
|
214
214
|
return new Promise((resolve, reject) => {
|
|
215
215
|
var fulfilled = (value) => {
|
|
216
216
|
try {
|
|
@@ -233,7 +233,7 @@ var __async$D = (__this, __arguments, generator) => {
|
|
|
233
233
|
const useUpdateAccountImage = () => {
|
|
234
234
|
const { client } = useShipEngine();
|
|
235
235
|
return useMutation({
|
|
236
|
-
mutationFn: (data) => __async$
|
|
236
|
+
mutationFn: (data) => __async$E(void 0, null, function* () {
|
|
237
237
|
const result = yield client.accountSettings.updateImage(data);
|
|
238
238
|
return result.data;
|
|
239
239
|
}),
|
|
@@ -242,7 +242,7 @@ const useUpdateAccountImage = () => {
|
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
var __async$
|
|
245
|
+
var __async$D = (__this, __arguments, generator) => {
|
|
246
246
|
return new Promise((resolve, reject) => {
|
|
247
247
|
var fulfilled = (value) => {
|
|
248
248
|
try {
|
|
@@ -265,7 +265,7 @@ var __async$C = (__this, __arguments, generator) => {
|
|
|
265
265
|
const useUpdateAccountSettings = () => {
|
|
266
266
|
const { client } = useShipEngine();
|
|
267
267
|
return useMutation({
|
|
268
|
-
mutationFn: (settings) => __async$
|
|
268
|
+
mutationFn: (settings) => __async$D(void 0, null, function* () {
|
|
269
269
|
const result = yield client.accountSettings.update(settings);
|
|
270
270
|
return result.data;
|
|
271
271
|
}),
|
|
@@ -274,7 +274,7 @@ const useUpdateAccountSettings = () => {
|
|
|
274
274
|
});
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
var __async$
|
|
277
|
+
var __async$C = (__this, __arguments, generator) => {
|
|
278
278
|
return new Promise((resolve, reject) => {
|
|
279
279
|
var fulfilled = (value) => {
|
|
280
280
|
try {
|
|
@@ -297,7 +297,7 @@ var __async$B = (__this, __arguments, generator) => {
|
|
|
297
297
|
const useParseAddress = () => {
|
|
298
298
|
const { client } = useShipEngine();
|
|
299
299
|
return useMutation({
|
|
300
|
-
mutationFn: (_0) => __async$
|
|
300
|
+
mutationFn: (_0) => __async$C(void 0, [_0], function* ({ address, text }) {
|
|
301
301
|
const result = yield client.addresses.parse(text, address);
|
|
302
302
|
return result.data;
|
|
303
303
|
}),
|
|
@@ -306,7 +306,7 @@ const useParseAddress = () => {
|
|
|
306
306
|
});
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
var __async$
|
|
309
|
+
var __async$B = (__this, __arguments, generator) => {
|
|
310
310
|
return new Promise((resolve, reject) => {
|
|
311
311
|
var fulfilled = (value) => {
|
|
312
312
|
try {
|
|
@@ -329,7 +329,7 @@ var __async$A = (__this, __arguments, generator) => {
|
|
|
329
329
|
const useValidateAddresses = () => {
|
|
330
330
|
const { client } = useShipEngine();
|
|
331
331
|
return useMutation({
|
|
332
|
-
mutationFn: (addresses) => __async$
|
|
332
|
+
mutationFn: (addresses) => __async$B(void 0, null, function* () {
|
|
333
333
|
const result = yield client.addresses.validate(addresses);
|
|
334
334
|
return result.data;
|
|
335
335
|
}),
|
|
@@ -338,7 +338,7 @@ const useValidateAddresses = () => {
|
|
|
338
338
|
});
|
|
339
339
|
};
|
|
340
340
|
|
|
341
|
-
var __async$
|
|
341
|
+
var __async$A = (__this, __arguments, generator) => {
|
|
342
342
|
return new Promise((resolve, reject) => {
|
|
343
343
|
var fulfilled = (value) => {
|
|
344
344
|
try {
|
|
@@ -361,7 +361,7 @@ var __async$z = (__this, __arguments, generator) => {
|
|
|
361
361
|
const useAddFunds = () => {
|
|
362
362
|
const { client } = useShipEngine();
|
|
363
363
|
return useMutation({
|
|
364
|
-
mutationFn: (_0) => __async$
|
|
364
|
+
mutationFn: (_0) => __async$A(void 0, [_0], function* ({ carrierId, funds }) {
|
|
365
365
|
const result = yield client.carriers.addFunds(carrierId, funds);
|
|
366
366
|
return result.data;
|
|
367
367
|
}),
|
|
@@ -370,7 +370,7 @@ const useAddFunds = () => {
|
|
|
370
370
|
});
|
|
371
371
|
};
|
|
372
372
|
|
|
373
|
-
var __async$
|
|
373
|
+
var __async$z = (__this, __arguments, generator) => {
|
|
374
374
|
return new Promise((resolve, reject) => {
|
|
375
375
|
var fulfilled = (value) => {
|
|
376
376
|
try {
|
|
@@ -393,7 +393,7 @@ var __async$y = (__this, __arguments, generator) => {
|
|
|
393
393
|
const useConnectCarrier = () => {
|
|
394
394
|
const { client } = useShipEngine();
|
|
395
395
|
return useMutation({
|
|
396
|
-
mutationFn: (params) => __async$
|
|
396
|
+
mutationFn: (params) => __async$z(void 0, null, function* () {
|
|
397
397
|
const result = yield client.carriers.connect(params);
|
|
398
398
|
return result.data;
|
|
399
399
|
}),
|
|
@@ -527,7 +527,7 @@ var __objRest$b = (source, exclude) => {
|
|
|
527
527
|
}
|
|
528
528
|
return target;
|
|
529
529
|
};
|
|
530
|
-
var __async$
|
|
530
|
+
var __async$y = (__this, __arguments, generator) => {
|
|
531
531
|
return new Promise((resolve, reject) => {
|
|
532
532
|
var fulfilled = (value) => {
|
|
533
533
|
try {
|
|
@@ -551,7 +551,7 @@ const useUpdateAutoFunding = () => {
|
|
|
551
551
|
const { client } = useShipEngine();
|
|
552
552
|
const queryClient = useQueryClient();
|
|
553
553
|
return useMutation({
|
|
554
|
-
mutationFn: (_a) => __async$
|
|
554
|
+
mutationFn: (_a) => __async$y(void 0, null, function* () {
|
|
555
555
|
var _b = _a, { carrierId } = _b, options = __objRest$b(_b, ["carrierId"]);
|
|
556
556
|
const result = yield client.carriers.updateAutoFunding(carrierId, options);
|
|
557
557
|
return result.data;
|
|
@@ -581,7 +581,7 @@ const useGetZonesByCarrier = (carrierId) => {
|
|
|
581
581
|
});
|
|
582
582
|
};
|
|
583
583
|
|
|
584
|
-
var __async$
|
|
584
|
+
var __async$x = (__this, __arguments, generator) => {
|
|
585
585
|
return new Promise((resolve, reject) => {
|
|
586
586
|
var fulfilled = (value) => {
|
|
587
587
|
try {
|
|
@@ -604,7 +604,7 @@ var __async$w = (__this, __arguments, generator) => {
|
|
|
604
604
|
const useDeleteCarrier = () => {
|
|
605
605
|
const { client } = useShipEngine();
|
|
606
606
|
return useMutation({
|
|
607
|
-
mutationFn: (carrierId) => __async$
|
|
607
|
+
mutationFn: (carrierId) => __async$x(void 0, null, function* () {
|
|
608
608
|
const result = yield client.carriers.delete(carrierId);
|
|
609
609
|
return result.data;
|
|
610
610
|
}),
|
|
@@ -667,7 +667,7 @@ const useListCarrierConnections = (_params) => {
|
|
|
667
667
|
});
|
|
668
668
|
};
|
|
669
669
|
|
|
670
|
-
var __async$
|
|
670
|
+
var __async$w = (__this, __arguments, generator) => {
|
|
671
671
|
return new Promise((resolve, reject) => {
|
|
672
672
|
var fulfilled = (value) => {
|
|
673
673
|
try {
|
|
@@ -690,7 +690,7 @@ var __async$v = (__this, __arguments, generator) => {
|
|
|
690
690
|
const useConnectCarrierAccount = () => {
|
|
691
691
|
const { client } = useShipEngine();
|
|
692
692
|
return useMutation({
|
|
693
|
-
mutationFn: (_0) => __async$
|
|
693
|
+
mutationFn: (_0) => __async$w(void 0, [_0], function* ({ carrierName, formData }) {
|
|
694
694
|
const result = yield client.connections.connectCarrier(carrierName, formData);
|
|
695
695
|
return result.data;
|
|
696
696
|
}),
|
|
@@ -720,7 +720,7 @@ const useListCustomPackageTypes = () => {
|
|
|
720
720
|
});
|
|
721
721
|
};
|
|
722
722
|
|
|
723
|
-
var __async$
|
|
723
|
+
var __async$v = (__this, __arguments, generator) => {
|
|
724
724
|
return new Promise((resolve, reject) => {
|
|
725
725
|
var fulfilled = (value) => {
|
|
726
726
|
try {
|
|
@@ -743,7 +743,7 @@ var __async$u = (__this, __arguments, generator) => {
|
|
|
743
743
|
const useCreateFundingSource = () => {
|
|
744
744
|
const { client } = useShipEngine();
|
|
745
745
|
return useMutation({
|
|
746
|
-
mutationFn: (fundingSource) => __async$
|
|
746
|
+
mutationFn: (fundingSource) => __async$v(void 0, null, function* () {
|
|
747
747
|
const result = yield client.fundingSources.create(fundingSource);
|
|
748
748
|
return result.data;
|
|
749
749
|
}),
|
|
@@ -752,7 +752,7 @@ const useCreateFundingSource = () => {
|
|
|
752
752
|
});
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
var __async$
|
|
755
|
+
var __async$u = (__this, __arguments, generator) => {
|
|
756
756
|
return new Promise((resolve, reject) => {
|
|
757
757
|
var fulfilled = (value) => {
|
|
758
758
|
try {
|
|
@@ -775,7 +775,7 @@ var __async$t = (__this, __arguments, generator) => {
|
|
|
775
775
|
const useFundingSourcesAddFunds = () => {
|
|
776
776
|
const { client } = useShipEngine();
|
|
777
777
|
return useMutation({
|
|
778
|
-
mutationFn: (_0) => __async$
|
|
778
|
+
mutationFn: (_0) => __async$u(void 0, [_0], function* ({ funds, fundingSourceId }) {
|
|
779
779
|
const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
|
|
780
780
|
return result.data;
|
|
781
781
|
}),
|
|
@@ -804,7 +804,7 @@ const useListFundingSources = () => {
|
|
|
804
804
|
});
|
|
805
805
|
};
|
|
806
806
|
|
|
807
|
-
var __async$
|
|
807
|
+
var __async$t = (__this, __arguments, generator) => {
|
|
808
808
|
return new Promise((resolve, reject) => {
|
|
809
809
|
var fulfilled = (value) => {
|
|
810
810
|
try {
|
|
@@ -827,7 +827,7 @@ var __async$s = (__this, __arguments, generator) => {
|
|
|
827
827
|
const useRegisterCarrier = () => {
|
|
828
828
|
const { client } = useShipEngine();
|
|
829
829
|
return useMutation({
|
|
830
|
-
mutationFn: (carrier) => __async$
|
|
830
|
+
mutationFn: (carrier) => __async$t(void 0, null, function* () {
|
|
831
831
|
const result = yield client.fundingSources.registerCarrier(carrier);
|
|
832
832
|
return result.data;
|
|
833
833
|
}),
|
|
@@ -836,7 +836,7 @@ const useRegisterCarrier = () => {
|
|
|
836
836
|
});
|
|
837
837
|
};
|
|
838
838
|
|
|
839
|
-
var __async$
|
|
839
|
+
var __async$s = (__this, __arguments, generator) => {
|
|
840
840
|
return new Promise((resolve, reject) => {
|
|
841
841
|
var fulfilled = (value) => {
|
|
842
842
|
try {
|
|
@@ -859,7 +859,7 @@ var __async$r = (__this, __arguments, generator) => {
|
|
|
859
859
|
const useUpdateFundingSource = () => {
|
|
860
860
|
const { client } = useShipEngine();
|
|
861
861
|
return useMutation({
|
|
862
|
-
mutationFn: (_0) => __async$
|
|
862
|
+
mutationFn: (_0) => __async$s(void 0, [_0], function* ({
|
|
863
863
|
billingInfo,
|
|
864
864
|
creditCardInfo,
|
|
865
865
|
fundingSourceId
|
|
@@ -938,7 +938,7 @@ var __objRest$8 = (source, exclude) => {
|
|
|
938
938
|
}
|
|
939
939
|
return target;
|
|
940
940
|
};
|
|
941
|
-
var __async$
|
|
941
|
+
var __async$r = (__this, __arguments, generator) => {
|
|
942
942
|
return new Promise((resolve, reject) => {
|
|
943
943
|
var fulfilled = (value) => {
|
|
944
944
|
try {
|
|
@@ -961,7 +961,7 @@ var __async$q = (__this, __arguments, generator) => {
|
|
|
961
961
|
const useAddInsuranceFunds = () => {
|
|
962
962
|
const { client } = useShipEngine();
|
|
963
963
|
return useMutation({
|
|
964
|
-
mutationFn: (_a) => __async$
|
|
964
|
+
mutationFn: (_a) => __async$r(void 0, null, function* () {
|
|
965
965
|
var _b = _a, { insuranceProvider } = _b, rest = __objRest$8(_b, ["insuranceProvider"]);
|
|
966
966
|
const result = yield client.insurance.addFunds(insuranceProvider, rest);
|
|
967
967
|
return result.data;
|
|
@@ -986,7 +986,7 @@ var __objRest$7 = (source, exclude) => {
|
|
|
986
986
|
}
|
|
987
987
|
return target;
|
|
988
988
|
};
|
|
989
|
-
var __async$
|
|
989
|
+
var __async$q = (__this, __arguments, generator) => {
|
|
990
990
|
return new Promise((resolve, reject) => {
|
|
991
991
|
var fulfilled = (value) => {
|
|
992
992
|
try {
|
|
@@ -1009,7 +1009,7 @@ var __async$p = (__this, __arguments, generator) => {
|
|
|
1009
1009
|
const useCreateLabel = () => {
|
|
1010
1010
|
const { client } = useShipEngine();
|
|
1011
1011
|
return useMutation({
|
|
1012
|
-
mutationFn: (_a) => __async$
|
|
1012
|
+
mutationFn: (_a) => __async$q(void 0, null, function* () {
|
|
1013
1013
|
var _b = _a, { rateId } = _b, options = __objRest$7(_b, ["rateId"]);
|
|
1014
1014
|
const result = yield client.labels.createByRateId(rateId, options);
|
|
1015
1015
|
return result.data;
|
|
@@ -1061,7 +1061,7 @@ const useListLabels = (_params) => {
|
|
|
1061
1061
|
});
|
|
1062
1062
|
};
|
|
1063
1063
|
|
|
1064
|
-
var __async$
|
|
1064
|
+
var __async$p = (__this, __arguments, generator) => {
|
|
1065
1065
|
return new Promise((resolve, reject) => {
|
|
1066
1066
|
var fulfilled = (value) => {
|
|
1067
1067
|
try {
|
|
@@ -1084,7 +1084,7 @@ var __async$o = (__this, __arguments, generator) => {
|
|
|
1084
1084
|
const useVoidLabel = () => {
|
|
1085
1085
|
const { client } = useShipEngine();
|
|
1086
1086
|
return useMutation({
|
|
1087
|
-
mutationFn: (labelId) => __async$
|
|
1087
|
+
mutationFn: (labelId) => __async$p(void 0, null, function* () {
|
|
1088
1088
|
const result = yield client.labels.void(labelId);
|
|
1089
1089
|
return result.data;
|
|
1090
1090
|
}),
|
|
@@ -1103,7 +1103,7 @@ const useListOrderSources = () => {
|
|
|
1103
1103
|
});
|
|
1104
1104
|
};
|
|
1105
1105
|
|
|
1106
|
-
var __async$
|
|
1106
|
+
var __async$o = (__this, __arguments, generator) => {
|
|
1107
1107
|
return new Promise((resolve, reject) => {
|
|
1108
1108
|
var fulfilled = (value) => {
|
|
1109
1109
|
try {
|
|
@@ -1126,7 +1126,7 @@ var __async$n = (__this, __arguments, generator) => {
|
|
|
1126
1126
|
const useRefreshOrderSourceAsync = () => {
|
|
1127
1127
|
const { client } = useShipEngine();
|
|
1128
1128
|
return useMutation({
|
|
1129
|
-
mutationFn: (orderSourceId) => __async$
|
|
1129
|
+
mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
|
|
1130
1130
|
const result = yield client.orderSources.refresh(orderSourceId);
|
|
1131
1131
|
return result.data;
|
|
1132
1132
|
}),
|
|
@@ -1137,9 +1137,9 @@ const useRefreshOrderSource = () => {
|
|
|
1137
1137
|
const { client } = useShipEngine();
|
|
1138
1138
|
const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
|
|
1139
1139
|
return useMutation({
|
|
1140
|
-
mutationFn: (orderSourceId) => __async$
|
|
1140
|
+
mutationFn: (orderSourceId) => __async$o(void 0, null, function* () {
|
|
1141
1141
|
yield refreshOrderSourceAsync(orderSourceId);
|
|
1142
|
-
const waitResult = yield retryUntil(() => __async$
|
|
1142
|
+
const waitResult = yield retryUntil(() => __async$o(void 0, null, function* () {
|
|
1143
1143
|
const { data: checkResult } = yield client.orderSources.get(orderSourceId);
|
|
1144
1144
|
if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
|
|
1145
1145
|
throw new SE.CodedError("Order source is still refreshing");
|
|
@@ -1153,7 +1153,7 @@ const useRefreshOrderSource = () => {
|
|
|
1153
1153
|
});
|
|
1154
1154
|
};
|
|
1155
1155
|
|
|
1156
|
-
var __async$
|
|
1156
|
+
var __async$n = (__this, __arguments, generator) => {
|
|
1157
1157
|
return new Promise((resolve, reject) => {
|
|
1158
1158
|
var fulfilled = (value) => {
|
|
1159
1159
|
try {
|
|
@@ -1176,7 +1176,7 @@ var __async$m = (__this, __arguments, generator) => {
|
|
|
1176
1176
|
const useDeactivateOrderSource = () => {
|
|
1177
1177
|
const { client } = useShipEngine();
|
|
1178
1178
|
return useMutation({
|
|
1179
|
-
mutationFn: (orderSourceId) => __async$
|
|
1179
|
+
mutationFn: (orderSourceId) => __async$n(void 0, null, function* () {
|
|
1180
1180
|
const result = yield client.orderSources.deactivate(orderSourceId);
|
|
1181
1181
|
return result.data;
|
|
1182
1182
|
}),
|
|
@@ -1185,7 +1185,7 @@ const useDeactivateOrderSource = () => {
|
|
|
1185
1185
|
});
|
|
1186
1186
|
};
|
|
1187
1187
|
|
|
1188
|
-
var __async$
|
|
1188
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
1189
1189
|
return new Promise((resolve, reject) => {
|
|
1190
1190
|
var fulfilled = (value) => {
|
|
1191
1191
|
try {
|
|
@@ -1208,7 +1208,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
1208
1208
|
const useCreateRateCard = () => {
|
|
1209
1209
|
const { client } = useShipEngine();
|
|
1210
1210
|
return useMutation({
|
|
1211
|
-
mutationFn: (rateCard) => __async$
|
|
1211
|
+
mutationFn: (rateCard) => __async$m(void 0, null, function* () {
|
|
1212
1212
|
const result = yield client.rateCards.create(rateCard);
|
|
1213
1213
|
return result.data;
|
|
1214
1214
|
}),
|
|
@@ -1255,7 +1255,7 @@ const useListRateCards = (carrierIds) => {
|
|
|
1255
1255
|
});
|
|
1256
1256
|
};
|
|
1257
1257
|
|
|
1258
|
-
var __async$
|
|
1258
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
1259
1259
|
return new Promise((resolve, reject) => {
|
|
1260
1260
|
var fulfilled = (value) => {
|
|
1261
1261
|
try {
|
|
@@ -1278,7 +1278,7 @@ var __async$k = (__this, __arguments, generator) => {
|
|
|
1278
1278
|
const usePublishRateCard = () => {
|
|
1279
1279
|
const { client } = useShipEngine();
|
|
1280
1280
|
return useMutation({
|
|
1281
|
-
mutationFn: (rateCardId) => __async$
|
|
1281
|
+
mutationFn: (rateCardId) => __async$l(void 0, null, function* () {
|
|
1282
1282
|
return yield client.rateCards.publish(rateCardId);
|
|
1283
1283
|
}),
|
|
1284
1284
|
mutationKey: ["usePublishRateCard"],
|
|
@@ -1286,7 +1286,7 @@ const usePublishRateCard = () => {
|
|
|
1286
1286
|
});
|
|
1287
1287
|
};
|
|
1288
1288
|
|
|
1289
|
-
var __async$
|
|
1289
|
+
var __async$k = (__this, __arguments, generator) => {
|
|
1290
1290
|
return new Promise((resolve, reject) => {
|
|
1291
1291
|
var fulfilled = (value) => {
|
|
1292
1292
|
try {
|
|
@@ -1309,7 +1309,7 @@ var __async$j = (__this, __arguments, generator) => {
|
|
|
1309
1309
|
const useUpdateRateCard = () => {
|
|
1310
1310
|
const { client } = useShipEngine();
|
|
1311
1311
|
return useMutation({
|
|
1312
|
-
mutationFn: (rateCard) => __async$
|
|
1312
|
+
mutationFn: (rateCard) => __async$k(void 0, null, function* () {
|
|
1313
1313
|
const result = yield client.rateCards.update(rateCard);
|
|
1314
1314
|
return result.data;
|
|
1315
1315
|
}),
|
|
@@ -1318,7 +1318,7 @@ const useUpdateRateCard = () => {
|
|
|
1318
1318
|
});
|
|
1319
1319
|
};
|
|
1320
1320
|
|
|
1321
|
-
var __async$
|
|
1321
|
+
var __async$j = (__this, __arguments, generator) => {
|
|
1322
1322
|
return new Promise((resolve, reject) => {
|
|
1323
1323
|
var fulfilled = (value) => {
|
|
1324
1324
|
try {
|
|
@@ -1341,7 +1341,7 @@ var __async$i = (__this, __arguments, generator) => {
|
|
|
1341
1341
|
const useUploadRateCard = () => {
|
|
1342
1342
|
const { client } = useShipEngine();
|
|
1343
1343
|
return useMutation({
|
|
1344
|
-
mutationFn: (_0) => __async$
|
|
1344
|
+
mutationFn: (_0) => __async$j(void 0, [_0], function* ({ rateCardId, file }) {
|
|
1345
1345
|
const result = yield client.rateCards.upload(rateCardId, file);
|
|
1346
1346
|
return result.data;
|
|
1347
1347
|
}),
|
|
@@ -1350,7 +1350,7 @@ const useUploadRateCard = () => {
|
|
|
1350
1350
|
});
|
|
1351
1351
|
};
|
|
1352
1352
|
|
|
1353
|
-
var __async$
|
|
1353
|
+
var __async$i = (__this, __arguments, generator) => {
|
|
1354
1354
|
return new Promise((resolve, reject) => {
|
|
1355
1355
|
var fulfilled = (value) => {
|
|
1356
1356
|
try {
|
|
@@ -1373,7 +1373,7 @@ var __async$h = (__this, __arguments, generator) => {
|
|
|
1373
1373
|
const useDeleteRateCard = () => {
|
|
1374
1374
|
const { client } = useShipEngine();
|
|
1375
1375
|
return useMutation({
|
|
1376
|
-
mutationFn: (rateCardId) => __async$
|
|
1376
|
+
mutationFn: (rateCardId) => __async$i(void 0, null, function* () {
|
|
1377
1377
|
const result = yield client.rateCards.delete(rateCardId);
|
|
1378
1378
|
return result.data;
|
|
1379
1379
|
}),
|
|
@@ -1382,7 +1382,7 @@ const useDeleteRateCard = () => {
|
|
|
1382
1382
|
});
|
|
1383
1383
|
};
|
|
1384
1384
|
|
|
1385
|
-
var __async$
|
|
1385
|
+
var __async$h = (__this, __arguments, generator) => {
|
|
1386
1386
|
return new Promise((resolve, reject) => {
|
|
1387
1387
|
var fulfilled = (value) => {
|
|
1388
1388
|
try {
|
|
@@ -1405,7 +1405,7 @@ var __async$g = (__this, __arguments, generator) => {
|
|
|
1405
1405
|
const useCalculateRates = () => {
|
|
1406
1406
|
const { client } = useShipEngine();
|
|
1407
1407
|
return useMutation({
|
|
1408
|
-
mutationFn: (_0) => __async$
|
|
1408
|
+
mutationFn: (_0) => __async$h(void 0, [_0], function* ({ rateOptions, shipmentId }) {
|
|
1409
1409
|
const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
|
|
1410
1410
|
return result.data;
|
|
1411
1411
|
}),
|
|
@@ -1414,6 +1414,38 @@ const useCalculateRates = () => {
|
|
|
1414
1414
|
});
|
|
1415
1415
|
};
|
|
1416
1416
|
|
|
1417
|
+
var __async$g = (__this, __arguments, generator) => {
|
|
1418
|
+
return new Promise((resolve, reject) => {
|
|
1419
|
+
var fulfilled = (value) => {
|
|
1420
|
+
try {
|
|
1421
|
+
step(generator.next(value));
|
|
1422
|
+
} catch (e) {
|
|
1423
|
+
reject(e);
|
|
1424
|
+
}
|
|
1425
|
+
};
|
|
1426
|
+
var rejected = (value) => {
|
|
1427
|
+
try {
|
|
1428
|
+
step(generator.throw(value));
|
|
1429
|
+
} catch (e) {
|
|
1430
|
+
reject(e);
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1434
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
const useRatesEstimate = () => {
|
|
1438
|
+
const { client } = useShipEngine();
|
|
1439
|
+
return useMutation({
|
|
1440
|
+
mutationFn: (_0) => __async$g(void 0, [_0], function* ({ rateParams }) {
|
|
1441
|
+
const result = yield client.rates.estimate(rateParams);
|
|
1442
|
+
return result.data;
|
|
1443
|
+
}),
|
|
1444
|
+
mutationKey: ["useRatesEstimate"],
|
|
1445
|
+
onError
|
|
1446
|
+
});
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1417
1449
|
const useGetSalesOrder = (salesOrderId) => {
|
|
1418
1450
|
const { client } = useShipEngine();
|
|
1419
1451
|
return useQuery({
|
|
@@ -2410,4 +2442,4 @@ const useUpdateWebhook = (params) => {
|
|
|
2410
2442
|
}));
|
|
2411
2443
|
};
|
|
2412
2444
|
|
|
2413
|
-
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|
|
2445
|
+
export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetHereToken, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRatesEstimate, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
|