@shipengine/react-api 1.9.2 → 1.10.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.
@@ -1,3 +1,4 @@
1
1
  export * from "./use-list-shipping-rules";
2
2
  export * from "./use-create-shipping-rule";
3
3
  export * from "./use-delete-shipping-rule";
4
+ export * from "./use-edit-shipping-rule";
@@ -0,0 +1,6 @@
1
+ import { ShippingRule } from "@shipengine/js-api";
2
+ /**
3
+ * @category ShipEngine API Hooks
4
+ *
5
+ */
6
+ export declare const useEditShippingRule: () => import("@tanstack/react-query").UseMutationResult<ShippingRule, import("@shipengine/js-api").CodedError[], ShippingRule, unknown>;
package/index.js CHANGED
@@ -114,7 +114,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
114
114
  throw error;
115
115
  });
116
116
 
117
- var __async$v = (__this, __arguments, generator) => {
117
+ var __async$w = (__this, __arguments, generator) => {
118
118
  return new Promise((resolve, reject) => {
119
119
  var fulfilled = (value) => {
120
120
  try {
@@ -137,7 +137,7 @@ var __async$v = (__this, __arguments, generator) => {
137
137
  const useCreateAccountImage = () => {
138
138
  const { client } = useShipEngine();
139
139
  return reactQuery.useMutation({
140
- mutationFn: (data) => __async$v(void 0, null, function* () {
140
+ mutationFn: (data) => __async$w(void 0, null, function* () {
141
141
  const result = yield client.accountSettings.createImage(data);
142
142
  return result.data;
143
143
  }),
@@ -146,7 +146,7 @@ const useCreateAccountImage = () => {
146
146
  });
147
147
  };
148
148
 
149
- var __async$u = (__this, __arguments, generator) => {
149
+ var __async$v = (__this, __arguments, generator) => {
150
150
  return new Promise((resolve, reject) => {
151
151
  var fulfilled = (value) => {
152
152
  try {
@@ -169,7 +169,7 @@ var __async$u = (__this, __arguments, generator) => {
169
169
  const useDeleteAccountImage = () => {
170
170
  const { client } = useShipEngine();
171
171
  return reactQuery.useMutation({
172
- mutationFn: (labelImageId) => __async$u(void 0, null, function* () {
172
+ mutationFn: (labelImageId) => __async$v(void 0, null, function* () {
173
173
  const result = yield client.accountSettings.deleteImage(labelImageId);
174
174
  return result.data;
175
175
  }),
@@ -198,7 +198,7 @@ const useGetAccountSettings = () => {
198
198
  });
199
199
  };
200
200
 
201
- var __async$t = (__this, __arguments, generator) => {
201
+ var __async$u = (__this, __arguments, generator) => {
202
202
  return new Promise((resolve, reject) => {
203
203
  var fulfilled = (value) => {
204
204
  try {
@@ -221,7 +221,7 @@ var __async$t = (__this, __arguments, generator) => {
221
221
  const useUpdateAccountImage = () => {
222
222
  const { client } = useShipEngine();
223
223
  return reactQuery.useMutation({
224
- mutationFn: (data) => __async$t(void 0, null, function* () {
224
+ mutationFn: (data) => __async$u(void 0, null, function* () {
225
225
  const result = yield client.accountSettings.updateImage(data);
226
226
  return result.data;
227
227
  }),
@@ -230,7 +230,7 @@ const useUpdateAccountImage = () => {
230
230
  });
231
231
  };
232
232
 
233
- var __async$s = (__this, __arguments, generator) => {
233
+ var __async$t = (__this, __arguments, generator) => {
234
234
  return new Promise((resolve, reject) => {
235
235
  var fulfilled = (value) => {
236
236
  try {
@@ -253,7 +253,7 @@ var __async$s = (__this, __arguments, generator) => {
253
253
  const useUpdateAccountSettings = () => {
254
254
  const { client } = useShipEngine();
255
255
  return reactQuery.useMutation({
256
- mutationFn: (settings) => __async$s(void 0, null, function* () {
256
+ mutationFn: (settings) => __async$t(void 0, null, function* () {
257
257
  const result = yield client.accountSettings.update(settings);
258
258
  return result.data;
259
259
  }),
@@ -262,7 +262,7 @@ const useUpdateAccountSettings = () => {
262
262
  });
263
263
  };
264
264
 
265
- var __async$r = (__this, __arguments, generator) => {
265
+ var __async$s = (__this, __arguments, generator) => {
266
266
  return new Promise((resolve, reject) => {
267
267
  var fulfilled = (value) => {
268
268
  try {
@@ -285,7 +285,7 @@ var __async$r = (__this, __arguments, generator) => {
285
285
  const useParseAddress = () => {
286
286
  const { client } = useShipEngine();
287
287
  return reactQuery.useMutation({
288
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ address, text }) {
288
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ address, text }) {
289
289
  const result = yield client.addresses.parse(text, address);
290
290
  return result.data;
291
291
  }),
@@ -294,7 +294,7 @@ const useParseAddress = () => {
294
294
  });
295
295
  };
296
296
 
297
- var __async$q = (__this, __arguments, generator) => {
297
+ var __async$r = (__this, __arguments, generator) => {
298
298
  return new Promise((resolve, reject) => {
299
299
  var fulfilled = (value) => {
300
300
  try {
@@ -317,7 +317,7 @@ var __async$q = (__this, __arguments, generator) => {
317
317
  const useValidateAddresses = () => {
318
318
  const { client } = useShipEngine();
319
319
  return reactQuery.useMutation({
320
- mutationFn: (addresses) => __async$q(void 0, null, function* () {
320
+ mutationFn: (addresses) => __async$r(void 0, null, function* () {
321
321
  const result = yield client.addresses.validate(addresses);
322
322
  return result.data;
323
323
  }),
@@ -326,7 +326,7 @@ const useValidateAddresses = () => {
326
326
  });
327
327
  };
328
328
 
329
- var __async$p = (__this, __arguments, generator) => {
329
+ var __async$q = (__this, __arguments, generator) => {
330
330
  return new Promise((resolve, reject) => {
331
331
  var fulfilled = (value) => {
332
332
  try {
@@ -349,7 +349,7 @@ var __async$p = (__this, __arguments, generator) => {
349
349
  const useAddFunds = () => {
350
350
  const { client } = useShipEngine();
351
351
  return reactQuery.useMutation({
352
- mutationFn: (_0) => __async$p(void 0, [_0], function* ({ carrierId, funds }) {
352
+ mutationFn: (_0) => __async$q(void 0, [_0], function* ({ carrierId, funds }) {
353
353
  const result = yield client.carriers.addFunds(carrierId, funds);
354
354
  return result.data;
355
355
  }),
@@ -358,7 +358,7 @@ const useAddFunds = () => {
358
358
  });
359
359
  };
360
360
 
361
- var __async$o = (__this, __arguments, generator) => {
361
+ var __async$p = (__this, __arguments, generator) => {
362
362
  return new Promise((resolve, reject) => {
363
363
  var fulfilled = (value) => {
364
364
  try {
@@ -381,7 +381,7 @@ var __async$o = (__this, __arguments, generator) => {
381
381
  const useConnectCarrier = () => {
382
382
  const { client } = useShipEngine();
383
383
  return reactQuery.useMutation({
384
- mutationFn: (params) => __async$o(void 0, null, function* () {
384
+ mutationFn: (params) => __async$p(void 0, null, function* () {
385
385
  const result = yield client.carriers.connect(params);
386
386
  return result.data;
387
387
  }),
@@ -518,7 +518,7 @@ const useListCarriers = () => {
518
518
  });
519
519
  };
520
520
 
521
- var __async$n = (__this, __arguments, generator) => {
521
+ var __async$o = (__this, __arguments, generator) => {
522
522
  return new Promise((resolve, reject) => {
523
523
  var fulfilled = (value) => {
524
524
  try {
@@ -542,7 +542,7 @@ const useUpdateAutoFunding = (carrierId) => {
542
542
  const { client } = useShipEngine();
543
543
  const queryClient = reactQuery.useQueryClient();
544
544
  return reactQuery.useMutation({
545
- mutationFn: (options) => __async$n(void 0, null, function* () {
545
+ mutationFn: (options) => __async$o(void 0, null, function* () {
546
546
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
547
547
  return result.data;
548
548
  }),
@@ -581,7 +581,7 @@ const useListCustomPackageTypes = () => {
581
581
  });
582
582
  };
583
583
 
584
- var __async$m = (__this, __arguments, generator) => {
584
+ var __async$n = (__this, __arguments, generator) => {
585
585
  return new Promise((resolve, reject) => {
586
586
  var fulfilled = (value) => {
587
587
  try {
@@ -604,7 +604,7 @@ var __async$m = (__this, __arguments, generator) => {
604
604
  const useCreateFundingSource = () => {
605
605
  const { client } = useShipEngine();
606
606
  return reactQuery.useMutation({
607
- mutationFn: (fundingSource) => __async$m(void 0, null, function* () {
607
+ mutationFn: (fundingSource) => __async$n(void 0, null, function* () {
608
608
  const result = yield client.fundingSources.create(fundingSource);
609
609
  return result.data;
610
610
  }),
@@ -613,7 +613,7 @@ const useCreateFundingSource = () => {
613
613
  });
614
614
  };
615
615
 
616
- var __async$l = (__this, __arguments, generator) => {
616
+ var __async$m = (__this, __arguments, generator) => {
617
617
  return new Promise((resolve, reject) => {
618
618
  var fulfilled = (value) => {
619
619
  try {
@@ -636,7 +636,7 @@ var __async$l = (__this, __arguments, generator) => {
636
636
  const useFundingSourcesAddFunds = (fundingSourceId) => {
637
637
  const { client } = useShipEngine();
638
638
  return reactQuery.useMutation({
639
- mutationFn: (funds) => __async$l(void 0, null, function* () {
639
+ mutationFn: (funds) => __async$m(void 0, null, function* () {
640
640
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
641
641
  return result.data;
642
642
  }),
@@ -665,7 +665,7 @@ const useListFundingSources = () => {
665
665
  });
666
666
  };
667
667
 
668
- var __async$k = (__this, __arguments, generator) => {
668
+ var __async$l = (__this, __arguments, generator) => {
669
669
  return new Promise((resolve, reject) => {
670
670
  var fulfilled = (value) => {
671
671
  try {
@@ -688,7 +688,7 @@ var __async$k = (__this, __arguments, generator) => {
688
688
  const useRegisterCarrier = () => {
689
689
  const { client } = useShipEngine();
690
690
  return reactQuery.useMutation({
691
- mutationFn: (carrier) => __async$k(void 0, null, function* () {
691
+ mutationFn: (carrier) => __async$l(void 0, null, function* () {
692
692
  const result = yield client.fundingSources.registerCarrier(carrier);
693
693
  return result.data;
694
694
  }),
@@ -697,7 +697,7 @@ const useRegisterCarrier = () => {
697
697
  });
698
698
  };
699
699
 
700
- var __async$j = (__this, __arguments, generator) => {
700
+ var __async$k = (__this, __arguments, generator) => {
701
701
  return new Promise((resolve, reject) => {
702
702
  var fulfilled = (value) => {
703
703
  try {
@@ -720,7 +720,7 @@ var __async$j = (__this, __arguments, generator) => {
720
720
  const useUpdateFundingSource = () => {
721
721
  const { client } = useShipEngine();
722
722
  return reactQuery.useMutation({
723
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({
723
+ mutationFn: (_0) => __async$k(void 0, [_0], function* ({
724
724
  billingInfo,
725
725
  creditCardInfo,
726
726
  fundingSourceId
@@ -787,7 +787,7 @@ var __objRest$5 = (source, exclude) => {
787
787
  }
788
788
  return target;
789
789
  };
790
- var __async$i = (__this, __arguments, generator) => {
790
+ var __async$j = (__this, __arguments, generator) => {
791
791
  return new Promise((resolve, reject) => {
792
792
  var fulfilled = (value) => {
793
793
  try {
@@ -810,7 +810,7 @@ var __async$i = (__this, __arguments, generator) => {
810
810
  const useCreateLabel = () => {
811
811
  const { client } = useShipEngine();
812
812
  return reactQuery.useMutation({
813
- mutationFn: (_a) => __async$i(void 0, null, function* () {
813
+ mutationFn: (_a) => __async$j(void 0, null, function* () {
814
814
  var _b = _a, { rateId } = _b, options = __objRest$5(_b, ["rateId"]);
815
815
  const result = yield client.labels.createByRateId(rateId, options);
816
816
  return result.data;
@@ -846,7 +846,7 @@ const useListLabels = (params) => {
846
846
  });
847
847
  };
848
848
 
849
- var __async$h = (__this, __arguments, generator) => {
849
+ var __async$i = (__this, __arguments, generator) => {
850
850
  return new Promise((resolve, reject) => {
851
851
  var fulfilled = (value) => {
852
852
  try {
@@ -869,7 +869,7 @@ var __async$h = (__this, __arguments, generator) => {
869
869
  const useVoidLabel = () => {
870
870
  const { client } = useShipEngine();
871
871
  return reactQuery.useMutation({
872
- mutationFn: (labelId) => __async$h(void 0, null, function* () {
872
+ mutationFn: (labelId) => __async$i(void 0, null, function* () {
873
873
  const result = yield client.labels.void(labelId);
874
874
  return result.data;
875
875
  }),
@@ -888,7 +888,7 @@ const useListOrderSources = () => {
888
888
  });
889
889
  };
890
890
 
891
- var __async$g = (__this, __arguments, generator) => {
891
+ var __async$h = (__this, __arguments, generator) => {
892
892
  return new Promise((resolve, reject) => {
893
893
  var fulfilled = (value) => {
894
894
  try {
@@ -911,7 +911,7 @@ var __async$g = (__this, __arguments, generator) => {
911
911
  const useRefreshOrderSourceAsync = () => {
912
912
  const { client } = useShipEngine();
913
913
  return reactQuery.useMutation({
914
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
914
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
915
915
  const result = yield client.orderSources.refresh(orderSourceId);
916
916
  return result.data;
917
917
  }),
@@ -922,9 +922,9 @@ const useRefreshOrderSource = () => {
922
922
  const { client } = useShipEngine();
923
923
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
924
924
  return reactQuery.useMutation({
925
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
925
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
926
926
  yield refreshOrderSourceAsync(orderSourceId);
927
- const waitResult = yield retryUntil(() => __async$g(void 0, null, function* () {
927
+ const waitResult = yield retryUntil(() => __async$h(void 0, null, function* () {
928
928
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
929
929
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
930
930
  throw new jsApi.SE.CodedError("Order source is still refreshing");
@@ -938,7 +938,7 @@ const useRefreshOrderSource = () => {
938
938
  });
939
939
  };
940
940
 
941
- var __async$f = (__this, __arguments, generator) => {
941
+ var __async$g = (__this, __arguments, generator) => {
942
942
  return new Promise((resolve, reject) => {
943
943
  var fulfilled = (value) => {
944
944
  try {
@@ -961,7 +961,7 @@ var __async$f = (__this, __arguments, generator) => {
961
961
  const useCreateRateCard = () => {
962
962
  const { client } = useShipEngine();
963
963
  return reactQuery.useMutation({
964
- mutationFn: (rateCard) => __async$f(void 0, null, function* () {
964
+ mutationFn: (rateCard) => __async$g(void 0, null, function* () {
965
965
  const result = yield client.rateCards.create(rateCard);
966
966
  return result.data;
967
967
  }),
@@ -1008,7 +1008,7 @@ const useListRateCards = (carrierIds) => {
1008
1008
  });
1009
1009
  };
1010
1010
 
1011
- var __async$e = (__this, __arguments, generator) => {
1011
+ var __async$f = (__this, __arguments, generator) => {
1012
1012
  return new Promise((resolve, reject) => {
1013
1013
  var fulfilled = (value) => {
1014
1014
  try {
@@ -1031,7 +1031,7 @@ var __async$e = (__this, __arguments, generator) => {
1031
1031
  const usePublishRateCard = () => {
1032
1032
  const { client } = useShipEngine();
1033
1033
  return reactQuery.useMutation({
1034
- mutationFn: (rateCardId) => __async$e(void 0, null, function* () {
1034
+ mutationFn: (rateCardId) => __async$f(void 0, null, function* () {
1035
1035
  return yield client.rateCards.publish(rateCardId);
1036
1036
  }),
1037
1037
  mutationKey: ["usePublishRateCard"],
@@ -1039,7 +1039,7 @@ const usePublishRateCard = () => {
1039
1039
  });
1040
1040
  };
1041
1041
 
1042
- var __async$d = (__this, __arguments, generator) => {
1042
+ var __async$e = (__this, __arguments, generator) => {
1043
1043
  return new Promise((resolve, reject) => {
1044
1044
  var fulfilled = (value) => {
1045
1045
  try {
@@ -1062,7 +1062,7 @@ var __async$d = (__this, __arguments, generator) => {
1062
1062
  const useUpdateRateCard = () => {
1063
1063
  const { client } = useShipEngine();
1064
1064
  return reactQuery.useMutation({
1065
- mutationFn: (rateCard) => __async$d(void 0, null, function* () {
1065
+ mutationFn: (rateCard) => __async$e(void 0, null, function* () {
1066
1066
  const result = yield client.rateCards.update(rateCard);
1067
1067
  return result.data;
1068
1068
  }),
@@ -1071,7 +1071,7 @@ const useUpdateRateCard = () => {
1071
1071
  });
1072
1072
  };
1073
1073
 
1074
- var __async$c = (__this, __arguments, generator) => {
1074
+ var __async$d = (__this, __arguments, generator) => {
1075
1075
  return new Promise((resolve, reject) => {
1076
1076
  var fulfilled = (value) => {
1077
1077
  try {
@@ -1094,7 +1094,7 @@ var __async$c = (__this, __arguments, generator) => {
1094
1094
  const useUploadRateCard = () => {
1095
1095
  const { client } = useShipEngine();
1096
1096
  return reactQuery.useMutation({
1097
- mutationFn: (_0) => __async$c(void 0, [_0], function* ({ rateCardId, file }) {
1097
+ mutationFn: (_0) => __async$d(void 0, [_0], function* ({ rateCardId, file }) {
1098
1098
  const result = yield client.rateCards.upload(rateCardId, file);
1099
1099
  return result.data;
1100
1100
  }),
@@ -1103,7 +1103,7 @@ const useUploadRateCard = () => {
1103
1103
  });
1104
1104
  };
1105
1105
 
1106
- var __async$b = (__this, __arguments, generator) => {
1106
+ var __async$c = (__this, __arguments, generator) => {
1107
1107
  return new Promise((resolve, reject) => {
1108
1108
  var fulfilled = (value) => {
1109
1109
  try {
@@ -1126,7 +1126,7 @@ var __async$b = (__this, __arguments, generator) => {
1126
1126
  const useDeleteRateCard = () => {
1127
1127
  const { client } = useShipEngine();
1128
1128
  return reactQuery.useMutation({
1129
- mutationFn: (rateCardId) => __async$b(void 0, null, function* () {
1129
+ mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
1130
1130
  const result = yield client.rateCards.delete(rateCardId);
1131
1131
  return result.data;
1132
1132
  }),
@@ -1135,7 +1135,7 @@ const useDeleteRateCard = () => {
1135
1135
  });
1136
1136
  };
1137
1137
 
1138
- var __async$a = (__this, __arguments, generator) => {
1138
+ var __async$b = (__this, __arguments, generator) => {
1139
1139
  return new Promise((resolve, reject) => {
1140
1140
  var fulfilled = (value) => {
1141
1141
  try {
@@ -1158,7 +1158,7 @@ var __async$a = (__this, __arguments, generator) => {
1158
1158
  const useCalculateRates = () => {
1159
1159
  const { client } = useShipEngine();
1160
1160
  return reactQuery.useMutation({
1161
- mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateOptions, shipmentId }) {
1161
+ mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateOptions, shipmentId }) {
1162
1162
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
1163
1163
  return result.data;
1164
1164
  }),
@@ -1208,7 +1208,7 @@ var __objRest$4 = (source, exclude) => {
1208
1208
  }
1209
1209
  return target;
1210
1210
  };
1211
- var __async$9 = (__this, __arguments, generator) => {
1211
+ var __async$a = (__this, __arguments, generator) => {
1212
1212
  return new Promise((resolve, reject) => {
1213
1213
  var fulfilled = (value) => {
1214
1214
  try {
@@ -1231,7 +1231,7 @@ var __async$9 = (__this, __arguments, generator) => {
1231
1231
  const useNotifySalesOrderShipped = () => {
1232
1232
  const { client } = useShipEngine();
1233
1233
  return reactQuery.useMutation({
1234
- mutationFn: (_a) => __async$9(void 0, null, function* () {
1234
+ mutationFn: (_a) => __async$a(void 0, null, function* () {
1235
1235
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$4(_b, ["salesOrderId"]);
1236
1236
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
1237
1237
  return result.data;
@@ -1256,7 +1256,7 @@ var __objRest$3 = (source, exclude) => {
1256
1256
  }
1257
1257
  return target;
1258
1258
  };
1259
- var __async$8 = (__this, __arguments, generator) => {
1259
+ var __async$9 = (__this, __arguments, generator) => {
1260
1260
  return new Promise((resolve, reject) => {
1261
1261
  var fulfilled = (value) => {
1262
1262
  try {
@@ -1279,7 +1279,7 @@ var __async$8 = (__this, __arguments, generator) => {
1279
1279
  const useCreateSalesOrderShipment = () => {
1280
1280
  const { client } = useShipEngine();
1281
1281
  return reactQuery.useMutation({
1282
- mutationFn: (_a) => __async$8(void 0, null, function* () {
1282
+ mutationFn: (_a) => __async$9(void 0, null, function* () {
1283
1283
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$3(_b, ["salesOrderId"]);
1284
1284
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
1285
1285
  return result.data;
@@ -1330,7 +1330,7 @@ var __objRest$2 = (source, exclude) => {
1330
1330
  }
1331
1331
  return target;
1332
1332
  };
1333
- var __async$7 = (__this, __arguments, generator) => {
1333
+ var __async$8 = (__this, __arguments, generator) => {
1334
1334
  return new Promise((resolve, reject) => {
1335
1335
  var fulfilled = (value) => {
1336
1336
  try {
@@ -1353,7 +1353,7 @@ var __async$7 = (__this, __arguments, generator) => {
1353
1353
  const useUpdateSalesOrderShipment = () => {
1354
1354
  const { client } = useShipEngine();
1355
1355
  return reactQuery.useMutation({
1356
- mutationFn: (_a) => __async$7(void 0, null, function* () {
1356
+ mutationFn: (_a) => __async$8(void 0, null, function* () {
1357
1357
  var _b = _a, { shipmentId } = _b, shipment = __objRest$2(_b, ["shipmentId"]);
1358
1358
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
1359
1359
  return result.data;
@@ -1382,7 +1382,7 @@ var __spreadValues = (a, b) => {
1382
1382
  return a;
1383
1383
  };
1384
1384
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1385
- var __async$6 = (__this, __arguments, generator) => {
1385
+ var __async$7 = (__this, __arguments, generator) => {
1386
1386
  return new Promise((resolve, reject) => {
1387
1387
  var fulfilled = (value) => {
1388
1388
  try {
@@ -1405,7 +1405,7 @@ var __async$6 = (__this, __arguments, generator) => {
1405
1405
  const useCreateShipment = () => {
1406
1406
  const { client } = useShipEngine();
1407
1407
  return reactQuery.useMutation({
1408
- mutationFn: (shipment) => __async$6(void 0, null, function* () {
1408
+ mutationFn: (shipment) => __async$7(void 0, null, function* () {
1409
1409
  var _a;
1410
1410
  if (shipment.warehouseId === void 0) {
1411
1411
  throw new jsApi.SE.CodedError("errorMessages.noWarehouses", {
@@ -1503,7 +1503,7 @@ const useListShippingRules = () => {
1503
1503
  });
1504
1504
  };
1505
1505
 
1506
- var __async$5 = (__this, __arguments, generator) => {
1506
+ var __async$6 = (__this, __arguments, generator) => {
1507
1507
  return new Promise((resolve, reject) => {
1508
1508
  var fulfilled = (value) => {
1509
1509
  try {
@@ -1526,7 +1526,7 @@ var __async$5 = (__this, __arguments, generator) => {
1526
1526
  const useCreateShippingRule = () => {
1527
1527
  const { client } = useShipEngine();
1528
1528
  return reactQuery.useMutation({
1529
- mutationFn: (shippingRule) => __async$5(void 0, null, function* () {
1529
+ mutationFn: (shippingRule) => __async$6(void 0, null, function* () {
1530
1530
  const result = yield client.shippingRules.create(shippingRule);
1531
1531
  return result.data;
1532
1532
  }),
@@ -1535,7 +1535,7 @@ const useCreateShippingRule = () => {
1535
1535
  });
1536
1536
  };
1537
1537
 
1538
- var __async$4 = (__this, __arguments, generator) => {
1538
+ var __async$5 = (__this, __arguments, generator) => {
1539
1539
  return new Promise((resolve, reject) => {
1540
1540
  var fulfilled = (value) => {
1541
1541
  try {
@@ -1558,7 +1558,7 @@ var __async$4 = (__this, __arguments, generator) => {
1558
1558
  const useDeleteShippingRule = () => {
1559
1559
  const { client } = useShipEngine();
1560
1560
  return reactQuery.useMutation({
1561
- mutationFn: (shippingRuleId) => __async$4(void 0, null, function* () {
1561
+ mutationFn: (shippingRuleId) => __async$5(void 0, null, function* () {
1562
1562
  const result = yield client.shippingRules.delete(shippingRuleId);
1563
1563
  return result.data;
1564
1564
  }),
@@ -1567,6 +1567,38 @@ const useDeleteShippingRule = () => {
1567
1567
  });
1568
1568
  };
1569
1569
 
1570
+ var __async$4 = (__this, __arguments, generator) => {
1571
+ return new Promise((resolve, reject) => {
1572
+ var fulfilled = (value) => {
1573
+ try {
1574
+ step(generator.next(value));
1575
+ } catch (e) {
1576
+ reject(e);
1577
+ }
1578
+ };
1579
+ var rejected = (value) => {
1580
+ try {
1581
+ step(generator.throw(value));
1582
+ } catch (e) {
1583
+ reject(e);
1584
+ }
1585
+ };
1586
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1587
+ step((generator = generator.apply(__this, __arguments)).next());
1588
+ });
1589
+ };
1590
+ const useEditShippingRule = () => {
1591
+ const { client } = useShipEngine();
1592
+ return reactQuery.useMutation({
1593
+ mutationFn: (shippingRule) => __async$4(void 0, null, function* () {
1594
+ const result = yield client.shippingRules.edit(shippingRule);
1595
+ return result.data;
1596
+ }),
1597
+ mutationKey: ["useEditShippingRule"],
1598
+ onError
1599
+ });
1600
+ };
1601
+
1570
1602
  var __async$3 = (__this, __arguments, generator) => {
1571
1603
  return new Promise((resolve, reject) => {
1572
1604
  var fulfilled = (value) => {
@@ -1755,6 +1787,7 @@ exports.useDeleteRateCard = useDeleteRateCard;
1755
1787
  exports.useDeleteShippingRule = useDeleteShippingRule;
1756
1788
  exports.useDeleteWarehouse = useDeleteWarehouse;
1757
1789
  exports.useDownloadRateCard = useDownloadRateCard;
1790
+ exports.useEditShippingRule = useEditShippingRule;
1758
1791
  exports.useFundingSourcesAddFunds = useFundingSourcesAddFunds;
1759
1792
  exports.useGetAccountBillingPlan = useGetAccountBillingPlan;
1760
1793
  exports.useGetAccountImages = useGetAccountImages;
package/index.mjs CHANGED
@@ -111,7 +111,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
111
111
  throw error;
112
112
  });
113
113
 
114
- var __async$v = (__this, __arguments, generator) => {
114
+ var __async$w = (__this, __arguments, generator) => {
115
115
  return new Promise((resolve, reject) => {
116
116
  var fulfilled = (value) => {
117
117
  try {
@@ -134,7 +134,7 @@ var __async$v = (__this, __arguments, generator) => {
134
134
  const useCreateAccountImage = () => {
135
135
  const { client } = useShipEngine();
136
136
  return useMutation({
137
- mutationFn: (data) => __async$v(void 0, null, function* () {
137
+ mutationFn: (data) => __async$w(void 0, null, function* () {
138
138
  const result = yield client.accountSettings.createImage(data);
139
139
  return result.data;
140
140
  }),
@@ -143,7 +143,7 @@ const useCreateAccountImage = () => {
143
143
  });
144
144
  };
145
145
 
146
- var __async$u = (__this, __arguments, generator) => {
146
+ var __async$v = (__this, __arguments, generator) => {
147
147
  return new Promise((resolve, reject) => {
148
148
  var fulfilled = (value) => {
149
149
  try {
@@ -166,7 +166,7 @@ var __async$u = (__this, __arguments, generator) => {
166
166
  const useDeleteAccountImage = () => {
167
167
  const { client } = useShipEngine();
168
168
  return useMutation({
169
- mutationFn: (labelImageId) => __async$u(void 0, null, function* () {
169
+ mutationFn: (labelImageId) => __async$v(void 0, null, function* () {
170
170
  const result = yield client.accountSettings.deleteImage(labelImageId);
171
171
  return result.data;
172
172
  }),
@@ -195,7 +195,7 @@ const useGetAccountSettings = () => {
195
195
  });
196
196
  };
197
197
 
198
- var __async$t = (__this, __arguments, generator) => {
198
+ var __async$u = (__this, __arguments, generator) => {
199
199
  return new Promise((resolve, reject) => {
200
200
  var fulfilled = (value) => {
201
201
  try {
@@ -218,7 +218,7 @@ var __async$t = (__this, __arguments, generator) => {
218
218
  const useUpdateAccountImage = () => {
219
219
  const { client } = useShipEngine();
220
220
  return useMutation({
221
- mutationFn: (data) => __async$t(void 0, null, function* () {
221
+ mutationFn: (data) => __async$u(void 0, null, function* () {
222
222
  const result = yield client.accountSettings.updateImage(data);
223
223
  return result.data;
224
224
  }),
@@ -227,7 +227,7 @@ const useUpdateAccountImage = () => {
227
227
  });
228
228
  };
229
229
 
230
- var __async$s = (__this, __arguments, generator) => {
230
+ var __async$t = (__this, __arguments, generator) => {
231
231
  return new Promise((resolve, reject) => {
232
232
  var fulfilled = (value) => {
233
233
  try {
@@ -250,7 +250,7 @@ var __async$s = (__this, __arguments, generator) => {
250
250
  const useUpdateAccountSettings = () => {
251
251
  const { client } = useShipEngine();
252
252
  return useMutation({
253
- mutationFn: (settings) => __async$s(void 0, null, function* () {
253
+ mutationFn: (settings) => __async$t(void 0, null, function* () {
254
254
  const result = yield client.accountSettings.update(settings);
255
255
  return result.data;
256
256
  }),
@@ -259,7 +259,7 @@ const useUpdateAccountSettings = () => {
259
259
  });
260
260
  };
261
261
 
262
- var __async$r = (__this, __arguments, generator) => {
262
+ var __async$s = (__this, __arguments, generator) => {
263
263
  return new Promise((resolve, reject) => {
264
264
  var fulfilled = (value) => {
265
265
  try {
@@ -282,7 +282,7 @@ var __async$r = (__this, __arguments, generator) => {
282
282
  const useParseAddress = () => {
283
283
  const { client } = useShipEngine();
284
284
  return useMutation({
285
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ address, text }) {
285
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ address, text }) {
286
286
  const result = yield client.addresses.parse(text, address);
287
287
  return result.data;
288
288
  }),
@@ -291,7 +291,7 @@ const useParseAddress = () => {
291
291
  });
292
292
  };
293
293
 
294
- var __async$q = (__this, __arguments, generator) => {
294
+ var __async$r = (__this, __arguments, generator) => {
295
295
  return new Promise((resolve, reject) => {
296
296
  var fulfilled = (value) => {
297
297
  try {
@@ -314,7 +314,7 @@ var __async$q = (__this, __arguments, generator) => {
314
314
  const useValidateAddresses = () => {
315
315
  const { client } = useShipEngine();
316
316
  return useMutation({
317
- mutationFn: (addresses) => __async$q(void 0, null, function* () {
317
+ mutationFn: (addresses) => __async$r(void 0, null, function* () {
318
318
  const result = yield client.addresses.validate(addresses);
319
319
  return result.data;
320
320
  }),
@@ -323,7 +323,7 @@ const useValidateAddresses = () => {
323
323
  });
324
324
  };
325
325
 
326
- var __async$p = (__this, __arguments, generator) => {
326
+ var __async$q = (__this, __arguments, generator) => {
327
327
  return new Promise((resolve, reject) => {
328
328
  var fulfilled = (value) => {
329
329
  try {
@@ -346,7 +346,7 @@ var __async$p = (__this, __arguments, generator) => {
346
346
  const useAddFunds = () => {
347
347
  const { client } = useShipEngine();
348
348
  return useMutation({
349
- mutationFn: (_0) => __async$p(void 0, [_0], function* ({ carrierId, funds }) {
349
+ mutationFn: (_0) => __async$q(void 0, [_0], function* ({ carrierId, funds }) {
350
350
  const result = yield client.carriers.addFunds(carrierId, funds);
351
351
  return result.data;
352
352
  }),
@@ -355,7 +355,7 @@ const useAddFunds = () => {
355
355
  });
356
356
  };
357
357
 
358
- var __async$o = (__this, __arguments, generator) => {
358
+ var __async$p = (__this, __arguments, generator) => {
359
359
  return new Promise((resolve, reject) => {
360
360
  var fulfilled = (value) => {
361
361
  try {
@@ -378,7 +378,7 @@ var __async$o = (__this, __arguments, generator) => {
378
378
  const useConnectCarrier = () => {
379
379
  const { client } = useShipEngine();
380
380
  return useMutation({
381
- mutationFn: (params) => __async$o(void 0, null, function* () {
381
+ mutationFn: (params) => __async$p(void 0, null, function* () {
382
382
  const result = yield client.carriers.connect(params);
383
383
  return result.data;
384
384
  }),
@@ -515,7 +515,7 @@ const useListCarriers = () => {
515
515
  });
516
516
  };
517
517
 
518
- var __async$n = (__this, __arguments, generator) => {
518
+ var __async$o = (__this, __arguments, generator) => {
519
519
  return new Promise((resolve, reject) => {
520
520
  var fulfilled = (value) => {
521
521
  try {
@@ -539,7 +539,7 @@ const useUpdateAutoFunding = (carrierId) => {
539
539
  const { client } = useShipEngine();
540
540
  const queryClient = useQueryClient();
541
541
  return useMutation({
542
- mutationFn: (options) => __async$n(void 0, null, function* () {
542
+ mutationFn: (options) => __async$o(void 0, null, function* () {
543
543
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
544
544
  return result.data;
545
545
  }),
@@ -578,7 +578,7 @@ const useListCustomPackageTypes = () => {
578
578
  });
579
579
  };
580
580
 
581
- var __async$m = (__this, __arguments, generator) => {
581
+ var __async$n = (__this, __arguments, generator) => {
582
582
  return new Promise((resolve, reject) => {
583
583
  var fulfilled = (value) => {
584
584
  try {
@@ -601,7 +601,7 @@ var __async$m = (__this, __arguments, generator) => {
601
601
  const useCreateFundingSource = () => {
602
602
  const { client } = useShipEngine();
603
603
  return useMutation({
604
- mutationFn: (fundingSource) => __async$m(void 0, null, function* () {
604
+ mutationFn: (fundingSource) => __async$n(void 0, null, function* () {
605
605
  const result = yield client.fundingSources.create(fundingSource);
606
606
  return result.data;
607
607
  }),
@@ -610,7 +610,7 @@ const useCreateFundingSource = () => {
610
610
  });
611
611
  };
612
612
 
613
- var __async$l = (__this, __arguments, generator) => {
613
+ var __async$m = (__this, __arguments, generator) => {
614
614
  return new Promise((resolve, reject) => {
615
615
  var fulfilled = (value) => {
616
616
  try {
@@ -633,7 +633,7 @@ var __async$l = (__this, __arguments, generator) => {
633
633
  const useFundingSourcesAddFunds = (fundingSourceId) => {
634
634
  const { client } = useShipEngine();
635
635
  return useMutation({
636
- mutationFn: (funds) => __async$l(void 0, null, function* () {
636
+ mutationFn: (funds) => __async$m(void 0, null, function* () {
637
637
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
638
638
  return result.data;
639
639
  }),
@@ -662,7 +662,7 @@ const useListFundingSources = () => {
662
662
  });
663
663
  };
664
664
 
665
- var __async$k = (__this, __arguments, generator) => {
665
+ var __async$l = (__this, __arguments, generator) => {
666
666
  return new Promise((resolve, reject) => {
667
667
  var fulfilled = (value) => {
668
668
  try {
@@ -685,7 +685,7 @@ var __async$k = (__this, __arguments, generator) => {
685
685
  const useRegisterCarrier = () => {
686
686
  const { client } = useShipEngine();
687
687
  return useMutation({
688
- mutationFn: (carrier) => __async$k(void 0, null, function* () {
688
+ mutationFn: (carrier) => __async$l(void 0, null, function* () {
689
689
  const result = yield client.fundingSources.registerCarrier(carrier);
690
690
  return result.data;
691
691
  }),
@@ -694,7 +694,7 @@ const useRegisterCarrier = () => {
694
694
  });
695
695
  };
696
696
 
697
- var __async$j = (__this, __arguments, generator) => {
697
+ var __async$k = (__this, __arguments, generator) => {
698
698
  return new Promise((resolve, reject) => {
699
699
  var fulfilled = (value) => {
700
700
  try {
@@ -717,7 +717,7 @@ var __async$j = (__this, __arguments, generator) => {
717
717
  const useUpdateFundingSource = () => {
718
718
  const { client } = useShipEngine();
719
719
  return useMutation({
720
- mutationFn: (_0) => __async$j(void 0, [_0], function* ({
720
+ mutationFn: (_0) => __async$k(void 0, [_0], function* ({
721
721
  billingInfo,
722
722
  creditCardInfo,
723
723
  fundingSourceId
@@ -784,7 +784,7 @@ var __objRest$5 = (source, exclude) => {
784
784
  }
785
785
  return target;
786
786
  };
787
- var __async$i = (__this, __arguments, generator) => {
787
+ var __async$j = (__this, __arguments, generator) => {
788
788
  return new Promise((resolve, reject) => {
789
789
  var fulfilled = (value) => {
790
790
  try {
@@ -807,7 +807,7 @@ var __async$i = (__this, __arguments, generator) => {
807
807
  const useCreateLabel = () => {
808
808
  const { client } = useShipEngine();
809
809
  return useMutation({
810
- mutationFn: (_a) => __async$i(void 0, null, function* () {
810
+ mutationFn: (_a) => __async$j(void 0, null, function* () {
811
811
  var _b = _a, { rateId } = _b, options = __objRest$5(_b, ["rateId"]);
812
812
  const result = yield client.labels.createByRateId(rateId, options);
813
813
  return result.data;
@@ -843,7 +843,7 @@ const useListLabels = (params) => {
843
843
  });
844
844
  };
845
845
 
846
- var __async$h = (__this, __arguments, generator) => {
846
+ var __async$i = (__this, __arguments, generator) => {
847
847
  return new Promise((resolve, reject) => {
848
848
  var fulfilled = (value) => {
849
849
  try {
@@ -866,7 +866,7 @@ var __async$h = (__this, __arguments, generator) => {
866
866
  const useVoidLabel = () => {
867
867
  const { client } = useShipEngine();
868
868
  return useMutation({
869
- mutationFn: (labelId) => __async$h(void 0, null, function* () {
869
+ mutationFn: (labelId) => __async$i(void 0, null, function* () {
870
870
  const result = yield client.labels.void(labelId);
871
871
  return result.data;
872
872
  }),
@@ -885,7 +885,7 @@ const useListOrderSources = () => {
885
885
  });
886
886
  };
887
887
 
888
- var __async$g = (__this, __arguments, generator) => {
888
+ var __async$h = (__this, __arguments, generator) => {
889
889
  return new Promise((resolve, reject) => {
890
890
  var fulfilled = (value) => {
891
891
  try {
@@ -908,7 +908,7 @@ var __async$g = (__this, __arguments, generator) => {
908
908
  const useRefreshOrderSourceAsync = () => {
909
909
  const { client } = useShipEngine();
910
910
  return useMutation({
911
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
911
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
912
912
  const result = yield client.orderSources.refresh(orderSourceId);
913
913
  return result.data;
914
914
  }),
@@ -919,9 +919,9 @@ const useRefreshOrderSource = () => {
919
919
  const { client } = useShipEngine();
920
920
  const { mutateAsync: refreshOrderSourceAsync } = useRefreshOrderSourceAsync();
921
921
  return useMutation({
922
- mutationFn: (orderSourceId) => __async$g(void 0, null, function* () {
922
+ mutationFn: (orderSourceId) => __async$h(void 0, null, function* () {
923
923
  yield refreshOrderSourceAsync(orderSourceId);
924
- const waitResult = yield retryUntil(() => __async$g(void 0, null, function* () {
924
+ const waitResult = yield retryUntil(() => __async$h(void 0, null, function* () {
925
925
  const { data: checkResult } = yield client.orderSources.get(orderSourceId);
926
926
  if (["preparing_update", "updating"].includes(checkResult.refreshInfo.status)) {
927
927
  throw new SE.CodedError("Order source is still refreshing");
@@ -935,7 +935,7 @@ const useRefreshOrderSource = () => {
935
935
  });
936
936
  };
937
937
 
938
- var __async$f = (__this, __arguments, generator) => {
938
+ var __async$g = (__this, __arguments, generator) => {
939
939
  return new Promise((resolve, reject) => {
940
940
  var fulfilled = (value) => {
941
941
  try {
@@ -958,7 +958,7 @@ var __async$f = (__this, __arguments, generator) => {
958
958
  const useCreateRateCard = () => {
959
959
  const { client } = useShipEngine();
960
960
  return useMutation({
961
- mutationFn: (rateCard) => __async$f(void 0, null, function* () {
961
+ mutationFn: (rateCard) => __async$g(void 0, null, function* () {
962
962
  const result = yield client.rateCards.create(rateCard);
963
963
  return result.data;
964
964
  }),
@@ -1005,7 +1005,7 @@ const useListRateCards = (carrierIds) => {
1005
1005
  });
1006
1006
  };
1007
1007
 
1008
- var __async$e = (__this, __arguments, generator) => {
1008
+ var __async$f = (__this, __arguments, generator) => {
1009
1009
  return new Promise((resolve, reject) => {
1010
1010
  var fulfilled = (value) => {
1011
1011
  try {
@@ -1028,7 +1028,7 @@ var __async$e = (__this, __arguments, generator) => {
1028
1028
  const usePublishRateCard = () => {
1029
1029
  const { client } = useShipEngine();
1030
1030
  return useMutation({
1031
- mutationFn: (rateCardId) => __async$e(void 0, null, function* () {
1031
+ mutationFn: (rateCardId) => __async$f(void 0, null, function* () {
1032
1032
  return yield client.rateCards.publish(rateCardId);
1033
1033
  }),
1034
1034
  mutationKey: ["usePublishRateCard"],
@@ -1036,7 +1036,7 @@ const usePublishRateCard = () => {
1036
1036
  });
1037
1037
  };
1038
1038
 
1039
- var __async$d = (__this, __arguments, generator) => {
1039
+ var __async$e = (__this, __arguments, generator) => {
1040
1040
  return new Promise((resolve, reject) => {
1041
1041
  var fulfilled = (value) => {
1042
1042
  try {
@@ -1059,7 +1059,7 @@ var __async$d = (__this, __arguments, generator) => {
1059
1059
  const useUpdateRateCard = () => {
1060
1060
  const { client } = useShipEngine();
1061
1061
  return useMutation({
1062
- mutationFn: (rateCard) => __async$d(void 0, null, function* () {
1062
+ mutationFn: (rateCard) => __async$e(void 0, null, function* () {
1063
1063
  const result = yield client.rateCards.update(rateCard);
1064
1064
  return result.data;
1065
1065
  }),
@@ -1068,7 +1068,7 @@ const useUpdateRateCard = () => {
1068
1068
  });
1069
1069
  };
1070
1070
 
1071
- var __async$c = (__this, __arguments, generator) => {
1071
+ var __async$d = (__this, __arguments, generator) => {
1072
1072
  return new Promise((resolve, reject) => {
1073
1073
  var fulfilled = (value) => {
1074
1074
  try {
@@ -1091,7 +1091,7 @@ var __async$c = (__this, __arguments, generator) => {
1091
1091
  const useUploadRateCard = () => {
1092
1092
  const { client } = useShipEngine();
1093
1093
  return useMutation({
1094
- mutationFn: (_0) => __async$c(void 0, [_0], function* ({ rateCardId, file }) {
1094
+ mutationFn: (_0) => __async$d(void 0, [_0], function* ({ rateCardId, file }) {
1095
1095
  const result = yield client.rateCards.upload(rateCardId, file);
1096
1096
  return result.data;
1097
1097
  }),
@@ -1100,7 +1100,7 @@ const useUploadRateCard = () => {
1100
1100
  });
1101
1101
  };
1102
1102
 
1103
- var __async$b = (__this, __arguments, generator) => {
1103
+ var __async$c = (__this, __arguments, generator) => {
1104
1104
  return new Promise((resolve, reject) => {
1105
1105
  var fulfilled = (value) => {
1106
1106
  try {
@@ -1123,7 +1123,7 @@ var __async$b = (__this, __arguments, generator) => {
1123
1123
  const useDeleteRateCard = () => {
1124
1124
  const { client } = useShipEngine();
1125
1125
  return useMutation({
1126
- mutationFn: (rateCardId) => __async$b(void 0, null, function* () {
1126
+ mutationFn: (rateCardId) => __async$c(void 0, null, function* () {
1127
1127
  const result = yield client.rateCards.delete(rateCardId);
1128
1128
  return result.data;
1129
1129
  }),
@@ -1132,7 +1132,7 @@ const useDeleteRateCard = () => {
1132
1132
  });
1133
1133
  };
1134
1134
 
1135
- var __async$a = (__this, __arguments, generator) => {
1135
+ var __async$b = (__this, __arguments, generator) => {
1136
1136
  return new Promise((resolve, reject) => {
1137
1137
  var fulfilled = (value) => {
1138
1138
  try {
@@ -1155,7 +1155,7 @@ var __async$a = (__this, __arguments, generator) => {
1155
1155
  const useCalculateRates = () => {
1156
1156
  const { client } = useShipEngine();
1157
1157
  return useMutation({
1158
- mutationFn: (_0) => __async$a(void 0, [_0], function* ({ rateOptions, shipmentId }) {
1158
+ mutationFn: (_0) => __async$b(void 0, [_0], function* ({ rateOptions, shipmentId }) {
1159
1159
  const result = yield client.rates.calculateByShipmentId(shipmentId, rateOptions);
1160
1160
  return result.data;
1161
1161
  }),
@@ -1205,7 +1205,7 @@ var __objRest$4 = (source, exclude) => {
1205
1205
  }
1206
1206
  return target;
1207
1207
  };
1208
- var __async$9 = (__this, __arguments, generator) => {
1208
+ var __async$a = (__this, __arguments, generator) => {
1209
1209
  return new Promise((resolve, reject) => {
1210
1210
  var fulfilled = (value) => {
1211
1211
  try {
@@ -1228,7 +1228,7 @@ var __async$9 = (__this, __arguments, generator) => {
1228
1228
  const useNotifySalesOrderShipped = () => {
1229
1229
  const { client } = useShipEngine();
1230
1230
  return useMutation({
1231
- mutationFn: (_a) => __async$9(void 0, null, function* () {
1231
+ mutationFn: (_a) => __async$a(void 0, null, function* () {
1232
1232
  var _b = _a, { salesOrderId } = _b, tracking = __objRest$4(_b, ["salesOrderId"]);
1233
1233
  const result = yield client.salesOrders.notifyShipped(salesOrderId, tracking);
1234
1234
  return result.data;
@@ -1253,7 +1253,7 @@ var __objRest$3 = (source, exclude) => {
1253
1253
  }
1254
1254
  return target;
1255
1255
  };
1256
- var __async$8 = (__this, __arguments, generator) => {
1256
+ var __async$9 = (__this, __arguments, generator) => {
1257
1257
  return new Promise((resolve, reject) => {
1258
1258
  var fulfilled = (value) => {
1259
1259
  try {
@@ -1276,7 +1276,7 @@ var __async$8 = (__this, __arguments, generator) => {
1276
1276
  const useCreateSalesOrderShipment = () => {
1277
1277
  const { client } = useShipEngine();
1278
1278
  return useMutation({
1279
- mutationFn: (_a) => __async$8(void 0, null, function* () {
1279
+ mutationFn: (_a) => __async$9(void 0, null, function* () {
1280
1280
  var _b = _a, { salesOrderId } = _b, shipment = __objRest$3(_b, ["salesOrderId"]);
1281
1281
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
1282
1282
  return result.data;
@@ -1327,7 +1327,7 @@ var __objRest$2 = (source, exclude) => {
1327
1327
  }
1328
1328
  return target;
1329
1329
  };
1330
- var __async$7 = (__this, __arguments, generator) => {
1330
+ var __async$8 = (__this, __arguments, generator) => {
1331
1331
  return new Promise((resolve, reject) => {
1332
1332
  var fulfilled = (value) => {
1333
1333
  try {
@@ -1350,7 +1350,7 @@ var __async$7 = (__this, __arguments, generator) => {
1350
1350
  const useUpdateSalesOrderShipment = () => {
1351
1351
  const { client } = useShipEngine();
1352
1352
  return useMutation({
1353
- mutationFn: (_a) => __async$7(void 0, null, function* () {
1353
+ mutationFn: (_a) => __async$8(void 0, null, function* () {
1354
1354
  var _b = _a, { shipmentId } = _b, shipment = __objRest$2(_b, ["shipmentId"]);
1355
1355
  const result = yield client.salesOrderShipments.update(shipmentId, shipment);
1356
1356
  return result.data;
@@ -1379,7 +1379,7 @@ var __spreadValues = (a, b) => {
1379
1379
  return a;
1380
1380
  };
1381
1381
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1382
- var __async$6 = (__this, __arguments, generator) => {
1382
+ var __async$7 = (__this, __arguments, generator) => {
1383
1383
  return new Promise((resolve, reject) => {
1384
1384
  var fulfilled = (value) => {
1385
1385
  try {
@@ -1402,7 +1402,7 @@ var __async$6 = (__this, __arguments, generator) => {
1402
1402
  const useCreateShipment = () => {
1403
1403
  const { client } = useShipEngine();
1404
1404
  return useMutation({
1405
- mutationFn: (shipment) => __async$6(void 0, null, function* () {
1405
+ mutationFn: (shipment) => __async$7(void 0, null, function* () {
1406
1406
  var _a;
1407
1407
  if (shipment.warehouseId === void 0) {
1408
1408
  throw new SE.CodedError("errorMessages.noWarehouses", {
@@ -1500,7 +1500,7 @@ const useListShippingRules = () => {
1500
1500
  });
1501
1501
  };
1502
1502
 
1503
- var __async$5 = (__this, __arguments, generator) => {
1503
+ var __async$6 = (__this, __arguments, generator) => {
1504
1504
  return new Promise((resolve, reject) => {
1505
1505
  var fulfilled = (value) => {
1506
1506
  try {
@@ -1523,7 +1523,7 @@ var __async$5 = (__this, __arguments, generator) => {
1523
1523
  const useCreateShippingRule = () => {
1524
1524
  const { client } = useShipEngine();
1525
1525
  return useMutation({
1526
- mutationFn: (shippingRule) => __async$5(void 0, null, function* () {
1526
+ mutationFn: (shippingRule) => __async$6(void 0, null, function* () {
1527
1527
  const result = yield client.shippingRules.create(shippingRule);
1528
1528
  return result.data;
1529
1529
  }),
@@ -1532,7 +1532,7 @@ const useCreateShippingRule = () => {
1532
1532
  });
1533
1533
  };
1534
1534
 
1535
- var __async$4 = (__this, __arguments, generator) => {
1535
+ var __async$5 = (__this, __arguments, generator) => {
1536
1536
  return new Promise((resolve, reject) => {
1537
1537
  var fulfilled = (value) => {
1538
1538
  try {
@@ -1555,7 +1555,7 @@ var __async$4 = (__this, __arguments, generator) => {
1555
1555
  const useDeleteShippingRule = () => {
1556
1556
  const { client } = useShipEngine();
1557
1557
  return useMutation({
1558
- mutationFn: (shippingRuleId) => __async$4(void 0, null, function* () {
1558
+ mutationFn: (shippingRuleId) => __async$5(void 0, null, function* () {
1559
1559
  const result = yield client.shippingRules.delete(shippingRuleId);
1560
1560
  return result.data;
1561
1561
  }),
@@ -1564,6 +1564,38 @@ const useDeleteShippingRule = () => {
1564
1564
  });
1565
1565
  };
1566
1566
 
1567
+ var __async$4 = (__this, __arguments, generator) => {
1568
+ return new Promise((resolve, reject) => {
1569
+ var fulfilled = (value) => {
1570
+ try {
1571
+ step(generator.next(value));
1572
+ } catch (e) {
1573
+ reject(e);
1574
+ }
1575
+ };
1576
+ var rejected = (value) => {
1577
+ try {
1578
+ step(generator.throw(value));
1579
+ } catch (e) {
1580
+ reject(e);
1581
+ }
1582
+ };
1583
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1584
+ step((generator = generator.apply(__this, __arguments)).next());
1585
+ });
1586
+ };
1587
+ const useEditShippingRule = () => {
1588
+ const { client } = useShipEngine();
1589
+ return useMutation({
1590
+ mutationFn: (shippingRule) => __async$4(void 0, null, function* () {
1591
+ const result = yield client.shippingRules.edit(shippingRule);
1592
+ return result.data;
1593
+ }),
1594
+ mutationKey: ["useEditShippingRule"],
1595
+ onError
1596
+ });
1597
+ };
1598
+
1567
1599
  var __async$3 = (__this, __arguments, generator) => {
1568
1600
  return new Promise((resolve, reject) => {
1569
1601
  var fulfilled = (value) => {
@@ -1730,4 +1762,4 @@ const useUpdateAccountBillingPlan = () => {
1730
1762
  });
1731
1763
  };
1732
1764
 
1733
- export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useGetZonesByCarrier, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
1765
+ export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetWalletHistory, useGetZonesByCarrier, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListShippingRules, useListWarehouses, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUploadRateCard, useValidateAddresses, useVoidLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/react-api",
3
- "version": "1.9.2",
3
+ "version": "1.10.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {