@shipengine/react-api 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
1
  export * from "./use-get-insurance-account";
2
+ export * from "./use-add-insurance-funds";
@@ -0,0 +1,12 @@
1
+ import { InsuranceAccount, SE } from "@shipengine/js-api";
2
+ type AddFundsParams = {
3
+ insuranceProvider: SE.InsuranceProvider;
4
+ } & InsuranceAccount;
5
+ /**
6
+ * @category ShipEngine API Hooks
7
+ *
8
+ * @see [ShipEngine Developer Docs](https://www.shipengine.com/docs/shipping/insurance/#adding-insurance-funds)
9
+ * @see [ShipEngine API Reference](https://shipengine.github.io/shipengine-openapi/#operation/add_funds_to_insurance)
10
+ */
11
+ export declare const useAddInsuranceFunds: () => import("@tanstack/react-query").UseMutationResult<InsuranceAccount, SE.CodedError[], AddFundsParams, unknown>;
12
+ export {};
package/index.js CHANGED
@@ -79,17 +79,17 @@ var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){r
79
79
  var __defProp$1 = Object.defineProperty;
80
80
  var __defProps$1 = Object.defineProperties;
81
81
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
82
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
83
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
84
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
82
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
83
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
84
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
85
85
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
86
86
  var __spreadValues$1 = (a, b) => {
87
87
  for (var prop in b || (b = {}))
88
- if (__hasOwnProp$b.call(b, prop))
88
+ if (__hasOwnProp$c.call(b, prop))
89
89
  __defNormalProp$1(a, prop, b[prop]);
90
- if (__getOwnPropSymbols$b)
91
- for (var prop of __getOwnPropSymbols$b(b)) {
92
- if (__propIsEnum$b.call(b, prop))
90
+ if (__getOwnPropSymbols$c)
91
+ for (var prop of __getOwnPropSymbols$c(b)) {
92
+ if (__propIsEnum$c.call(b, prop))
93
93
  __defNormalProp$1(a, prop, b[prop]);
94
94
  }
95
95
  return a;
@@ -128,7 +128,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
128
128
  throw error;
129
129
  });
130
130
 
131
- var __async$x = (__this, __arguments, generator) => {
131
+ var __async$y = (__this, __arguments, generator) => {
132
132
  return new Promise((resolve, reject) => {
133
133
  var fulfilled = (value) => {
134
134
  try {
@@ -151,7 +151,7 @@ var __async$x = (__this, __arguments, generator) => {
151
151
  const useCreateAccountImage = () => {
152
152
  const { client } = useShipEngine();
153
153
  return reactQuery.useMutation({
154
- mutationFn: (data) => __async$x(void 0, null, function* () {
154
+ mutationFn: (data) => __async$y(void 0, null, function* () {
155
155
  const result = yield client.accountSettings.createImage(data);
156
156
  return result.data;
157
157
  }),
@@ -160,7 +160,7 @@ const useCreateAccountImage = () => {
160
160
  });
161
161
  };
162
162
 
163
- var __async$w = (__this, __arguments, generator) => {
163
+ var __async$x = (__this, __arguments, generator) => {
164
164
  return new Promise((resolve, reject) => {
165
165
  var fulfilled = (value) => {
166
166
  try {
@@ -183,7 +183,7 @@ var __async$w = (__this, __arguments, generator) => {
183
183
  const useDeleteAccountImage = () => {
184
184
  const { client } = useShipEngine();
185
185
  return reactQuery.useMutation({
186
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
186
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
187
187
  const result = yield client.accountSettings.deleteImage(labelImageId);
188
188
  return result.data;
189
189
  }),
@@ -212,7 +212,7 @@ const useGetAccountSettings = () => {
212
212
  });
213
213
  };
214
214
 
215
- var __async$v = (__this, __arguments, generator) => {
215
+ var __async$w = (__this, __arguments, generator) => {
216
216
  return new Promise((resolve, reject) => {
217
217
  var fulfilled = (value) => {
218
218
  try {
@@ -235,7 +235,7 @@ var __async$v = (__this, __arguments, generator) => {
235
235
  const useUpdateAccountImage = () => {
236
236
  const { client } = useShipEngine();
237
237
  return reactQuery.useMutation({
238
- mutationFn: (data) => __async$v(void 0, null, function* () {
238
+ mutationFn: (data) => __async$w(void 0, null, function* () {
239
239
  const result = yield client.accountSettings.updateImage(data);
240
240
  return result.data;
241
241
  }),
@@ -244,7 +244,7 @@ const useUpdateAccountImage = () => {
244
244
  });
245
245
  };
246
246
 
247
- var __async$u = (__this, __arguments, generator) => {
247
+ var __async$v = (__this, __arguments, generator) => {
248
248
  return new Promise((resolve, reject) => {
249
249
  var fulfilled = (value) => {
250
250
  try {
@@ -267,7 +267,7 @@ var __async$u = (__this, __arguments, generator) => {
267
267
  const useUpdateAccountSettings = () => {
268
268
  const { client } = useShipEngine();
269
269
  return reactQuery.useMutation({
270
- mutationFn: (settings) => __async$u(void 0, null, function* () {
270
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
271
271
  const result = yield client.accountSettings.update(settings);
272
272
  return result.data;
273
273
  }),
@@ -276,7 +276,7 @@ const useUpdateAccountSettings = () => {
276
276
  });
277
277
  };
278
278
 
279
- var __async$t = (__this, __arguments, generator) => {
279
+ var __async$u = (__this, __arguments, generator) => {
280
280
  return new Promise((resolve, reject) => {
281
281
  var fulfilled = (value) => {
282
282
  try {
@@ -299,7 +299,7 @@ var __async$t = (__this, __arguments, generator) => {
299
299
  const useParseAddress = () => {
300
300
  const { client } = useShipEngine();
301
301
  return reactQuery.useMutation({
302
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
302
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
303
303
  const result = yield client.addresses.parse(text, address);
304
304
  return result.data;
305
305
  }),
@@ -308,7 +308,7 @@ const useParseAddress = () => {
308
308
  });
309
309
  };
310
310
 
311
- var __async$s = (__this, __arguments, generator) => {
311
+ var __async$t = (__this, __arguments, generator) => {
312
312
  return new Promise((resolve, reject) => {
313
313
  var fulfilled = (value) => {
314
314
  try {
@@ -331,7 +331,7 @@ var __async$s = (__this, __arguments, generator) => {
331
331
  const useValidateAddresses = () => {
332
332
  const { client } = useShipEngine();
333
333
  return reactQuery.useMutation({
334
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
334
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
335
335
  const result = yield client.addresses.validate(addresses);
336
336
  return result.data;
337
337
  }),
@@ -340,7 +340,7 @@ const useValidateAddresses = () => {
340
340
  });
341
341
  };
342
342
 
343
- var __async$r = (__this, __arguments, generator) => {
343
+ var __async$s = (__this, __arguments, generator) => {
344
344
  return new Promise((resolve, reject) => {
345
345
  var fulfilled = (value) => {
346
346
  try {
@@ -363,7 +363,7 @@ var __async$r = (__this, __arguments, generator) => {
363
363
  const useAddFunds = () => {
364
364
  const { client } = useShipEngine();
365
365
  return reactQuery.useMutation({
366
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
366
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
367
367
  const result = yield client.carriers.addFunds(carrierId, funds);
368
368
  return result.data;
369
369
  }),
@@ -372,7 +372,7 @@ const useAddFunds = () => {
372
372
  });
373
373
  };
374
374
 
375
- var __async$q = (__this, __arguments, generator) => {
375
+ var __async$r = (__this, __arguments, generator) => {
376
376
  return new Promise((resolve, reject) => {
377
377
  var fulfilled = (value) => {
378
378
  try {
@@ -395,7 +395,7 @@ var __async$q = (__this, __arguments, generator) => {
395
395
  const useConnectCarrier = () => {
396
396
  const { client } = useShipEngine();
397
397
  return reactQuery.useMutation({
398
- mutationFn: (params) => __async$q(void 0, null, function* () {
398
+ mutationFn: (params) => __async$r(void 0, null, function* () {
399
399
  const result = yield client.carriers.connect(params);
400
400
  return result.data;
401
401
  }),
@@ -514,22 +514,22 @@ const useListCarriers = () => {
514
514
  });
515
515
  };
516
516
 
517
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
518
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
519
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
520
- var __objRest$9 = (source, exclude) => {
517
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
518
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
519
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
520
+ var __objRest$a = (source, exclude) => {
521
521
  var target = {};
522
522
  for (var prop in source)
523
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
523
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
524
524
  target[prop] = source[prop];
525
- if (source != null && __getOwnPropSymbols$a)
526
- for (var prop of __getOwnPropSymbols$a(source)) {
527
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
525
+ if (source != null && __getOwnPropSymbols$b)
526
+ for (var prop of __getOwnPropSymbols$b(source)) {
527
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
528
528
  target[prop] = source[prop];
529
529
  }
530
530
  return target;
531
531
  };
532
- var __async$p = (__this, __arguments, generator) => {
532
+ var __async$q = (__this, __arguments, generator) => {
533
533
  return new Promise((resolve, reject) => {
534
534
  var fulfilled = (value) => {
535
535
  try {
@@ -553,8 +553,8 @@ const useUpdateAutoFunding = () => {
553
553
  const { client } = useShipEngine();
554
554
  const queryClient = reactQuery.useQueryClient();
555
555
  return reactQuery.useMutation({
556
- mutationFn: (_a) => __async$p(void 0, null, function* () {
557
- var _b = _a, { carrierId } = _b, options = __objRest$9(_b, ["carrierId"]);
556
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
557
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
558
558
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
559
559
  return result.data;
560
560
  }),
@@ -583,24 +583,24 @@ const useGetZonesByCarrier = (carrierId) => {
583
583
  });
584
584
  };
585
585
 
586
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
587
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
588
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
589
- var __objRest$8 = (source, exclude) => {
586
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
587
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
588
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
589
+ var __objRest$9 = (source, exclude) => {
590
590
  var target = {};
591
591
  for (var prop in source)
592
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
592
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
593
593
  target[prop] = source[prop];
594
- if (source != null && __getOwnPropSymbols$9)
595
- for (var prop of __getOwnPropSymbols$9(source)) {
596
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
594
+ if (source != null && __getOwnPropSymbols$a)
595
+ for (var prop of __getOwnPropSymbols$a(source)) {
596
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
597
597
  target[prop] = source[prop];
598
598
  }
599
599
  return target;
600
600
  };
601
601
  const useGetCarrierConnectionForm = (_params) => {
602
602
  const { client } = useShipEngine();
603
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$8(_a, ["carrierName", "enabled"]);
603
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
604
604
  return reactQuery.useQuery({
605
605
  enabled,
606
606
  onError,
@@ -610,24 +610,24 @@ const useGetCarrierConnectionForm = (_params) => {
610
610
  });
611
611
  };
612
612
 
613
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
614
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
615
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
616
- var __objRest$7 = (source, exclude) => {
613
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
614
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
615
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
616
+ var __objRest$8 = (source, exclude) => {
617
617
  var target = {};
618
618
  for (var prop in source)
619
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
619
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
620
620
  target[prop] = source[prop];
621
- if (source != null && __getOwnPropSymbols$8)
622
- for (var prop of __getOwnPropSymbols$8(source)) {
623
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
621
+ if (source != null && __getOwnPropSymbols$9)
622
+ for (var prop of __getOwnPropSymbols$9(source)) {
623
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
624
624
  target[prop] = source[prop];
625
625
  }
626
626
  return target;
627
627
  };
628
628
  const useListCarrierConnections = (_params) => {
629
629
  const { client } = useShipEngine();
630
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$7(_a, ["enabled"]);
630
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
631
631
  return reactQuery.useQuery({
632
632
  enabled,
633
633
  onError,
@@ -647,7 +647,7 @@ const useListCustomPackageTypes = () => {
647
647
  });
648
648
  };
649
649
 
650
- var __async$o = (__this, __arguments, generator) => {
650
+ var __async$p = (__this, __arguments, generator) => {
651
651
  return new Promise((resolve, reject) => {
652
652
  var fulfilled = (value) => {
653
653
  try {
@@ -670,7 +670,7 @@ var __async$o = (__this, __arguments, generator) => {
670
670
  const useCreateFundingSource = () => {
671
671
  const { client } = useShipEngine();
672
672
  return reactQuery.useMutation({
673
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
673
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
674
674
  const result = yield client.fundingSources.create(fundingSource);
675
675
  return result.data;
676
676
  }),
@@ -679,7 +679,7 @@ const useCreateFundingSource = () => {
679
679
  });
680
680
  };
681
681
 
682
- var __async$n = (__this, __arguments, generator) => {
682
+ var __async$o = (__this, __arguments, generator) => {
683
683
  return new Promise((resolve, reject) => {
684
684
  var fulfilled = (value) => {
685
685
  try {
@@ -702,7 +702,7 @@ var __async$n = (__this, __arguments, generator) => {
702
702
  const useFundingSourcesAddFunds = () => {
703
703
  const { client } = useShipEngine();
704
704
  return reactQuery.useMutation({
705
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
705
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
706
706
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
707
707
  return result.data;
708
708
  }),
@@ -731,7 +731,7 @@ const useListFundingSources = () => {
731
731
  });
732
732
  };
733
733
 
734
- var __async$m = (__this, __arguments, generator) => {
734
+ var __async$n = (__this, __arguments, generator) => {
735
735
  return new Promise((resolve, reject) => {
736
736
  var fulfilled = (value) => {
737
737
  try {
@@ -754,7 +754,7 @@ var __async$m = (__this, __arguments, generator) => {
754
754
  const useRegisterCarrier = () => {
755
755
  const { client } = useShipEngine();
756
756
  return reactQuery.useMutation({
757
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
757
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
758
758
  const result = yield client.fundingSources.registerCarrier(carrier);
759
759
  return result.data;
760
760
  }),
@@ -763,7 +763,7 @@ const useRegisterCarrier = () => {
763
763
  });
764
764
  };
765
765
 
766
- var __async$l = (__this, __arguments, generator) => {
766
+ var __async$m = (__this, __arguments, generator) => {
767
767
  return new Promise((resolve, reject) => {
768
768
  var fulfilled = (value) => {
769
769
  try {
@@ -786,7 +786,7 @@ var __async$l = (__this, __arguments, generator) => {
786
786
  const useUpdateFundingSource = () => {
787
787
  const { client } = useShipEngine();
788
788
  return reactQuery.useMutation({
789
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
789
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
790
790
  billingInfo,
791
791
  creditCardInfo,
792
792
  fundingSourceId
@@ -840,6 +840,54 @@ const useGetInsuranceAccount = (insuranceProvider) => {
840
840
  });
841
841
  };
842
842
 
843
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
844
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
845
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
846
+ var __objRest$7 = (source, exclude) => {
847
+ var target = {};
848
+ for (var prop in source)
849
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
850
+ target[prop] = source[prop];
851
+ if (source != null && __getOwnPropSymbols$8)
852
+ for (var prop of __getOwnPropSymbols$8(source)) {
853
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
854
+ target[prop] = source[prop];
855
+ }
856
+ return target;
857
+ };
858
+ var __async$l = (__this, __arguments, generator) => {
859
+ return new Promise((resolve, reject) => {
860
+ var fulfilled = (value) => {
861
+ try {
862
+ step(generator.next(value));
863
+ } catch (e) {
864
+ reject(e);
865
+ }
866
+ };
867
+ var rejected = (value) => {
868
+ try {
869
+ step(generator.throw(value));
870
+ } catch (e) {
871
+ reject(e);
872
+ }
873
+ };
874
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
875
+ step((generator = generator.apply(__this, __arguments)).next());
876
+ });
877
+ };
878
+ const useAddInsuranceFunds = () => {
879
+ const { client } = useShipEngine();
880
+ return reactQuery.useMutation({
881
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
882
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$7(_b, ["insuranceProvider"]);
883
+ const result = yield client.insurance.addFunds(insuranceProvider, rest);
884
+ return result.data;
885
+ }),
886
+ mutationKey: ["useAddInsuranceFunds"],
887
+ onError
888
+ });
889
+ };
890
+
843
891
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
844
892
  var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
845
893
  var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
@@ -1928,6 +1976,7 @@ exports.logger = logger;
1928
1976
  exports.onError = onError;
1929
1977
  exports.retryUntil = retryUntil;
1930
1978
  exports.useAddFunds = useAddFunds;
1979
+ exports.useAddInsuranceFunds = useAddInsuranceFunds;
1931
1980
  exports.useCalculateRates = useCalculateRates;
1932
1981
  exports.useConnectCarrier = useConnectCarrier;
1933
1982
  exports.useCreateAccountImage = useCreateAccountImage;
package/index.mjs CHANGED
@@ -76,17 +76,17 @@ var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){r
76
76
  var __defProp$1 = Object.defineProperty;
77
77
  var __defProps$1 = Object.defineProperties;
78
78
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
79
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
80
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
81
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
79
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
80
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
81
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
82
82
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
83
83
  var __spreadValues$1 = (a, b) => {
84
84
  for (var prop in b || (b = {}))
85
- if (__hasOwnProp$b.call(b, prop))
85
+ if (__hasOwnProp$c.call(b, prop))
86
86
  __defNormalProp$1(a, prop, b[prop]);
87
- if (__getOwnPropSymbols$b)
88
- for (var prop of __getOwnPropSymbols$b(b)) {
89
- if (__propIsEnum$b.call(b, prop))
87
+ if (__getOwnPropSymbols$c)
88
+ for (var prop of __getOwnPropSymbols$c(b)) {
89
+ if (__propIsEnum$c.call(b, prop))
90
90
  __defNormalProp$1(a, prop, b[prop]);
91
91
  }
92
92
  return a;
@@ -125,7 +125,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
125
125
  throw error;
126
126
  });
127
127
 
128
- var __async$x = (__this, __arguments, generator) => {
128
+ var __async$y = (__this, __arguments, generator) => {
129
129
  return new Promise((resolve, reject) => {
130
130
  var fulfilled = (value) => {
131
131
  try {
@@ -148,7 +148,7 @@ var __async$x = (__this, __arguments, generator) => {
148
148
  const useCreateAccountImage = () => {
149
149
  const { client } = useShipEngine();
150
150
  return useMutation({
151
- mutationFn: (data) => __async$x(void 0, null, function* () {
151
+ mutationFn: (data) => __async$y(void 0, null, function* () {
152
152
  const result = yield client.accountSettings.createImage(data);
153
153
  return result.data;
154
154
  }),
@@ -157,7 +157,7 @@ const useCreateAccountImage = () => {
157
157
  });
158
158
  };
159
159
 
160
- var __async$w = (__this, __arguments, generator) => {
160
+ var __async$x = (__this, __arguments, generator) => {
161
161
  return new Promise((resolve, reject) => {
162
162
  var fulfilled = (value) => {
163
163
  try {
@@ -180,7 +180,7 @@ var __async$w = (__this, __arguments, generator) => {
180
180
  const useDeleteAccountImage = () => {
181
181
  const { client } = useShipEngine();
182
182
  return useMutation({
183
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
183
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
184
184
  const result = yield client.accountSettings.deleteImage(labelImageId);
185
185
  return result.data;
186
186
  }),
@@ -209,7 +209,7 @@ const useGetAccountSettings = () => {
209
209
  });
210
210
  };
211
211
 
212
- var __async$v = (__this, __arguments, generator) => {
212
+ var __async$w = (__this, __arguments, generator) => {
213
213
  return new Promise((resolve, reject) => {
214
214
  var fulfilled = (value) => {
215
215
  try {
@@ -232,7 +232,7 @@ var __async$v = (__this, __arguments, generator) => {
232
232
  const useUpdateAccountImage = () => {
233
233
  const { client } = useShipEngine();
234
234
  return useMutation({
235
- mutationFn: (data) => __async$v(void 0, null, function* () {
235
+ mutationFn: (data) => __async$w(void 0, null, function* () {
236
236
  const result = yield client.accountSettings.updateImage(data);
237
237
  return result.data;
238
238
  }),
@@ -241,7 +241,7 @@ const useUpdateAccountImage = () => {
241
241
  });
242
242
  };
243
243
 
244
- var __async$u = (__this, __arguments, generator) => {
244
+ var __async$v = (__this, __arguments, generator) => {
245
245
  return new Promise((resolve, reject) => {
246
246
  var fulfilled = (value) => {
247
247
  try {
@@ -264,7 +264,7 @@ var __async$u = (__this, __arguments, generator) => {
264
264
  const useUpdateAccountSettings = () => {
265
265
  const { client } = useShipEngine();
266
266
  return useMutation({
267
- mutationFn: (settings) => __async$u(void 0, null, function* () {
267
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
268
268
  const result = yield client.accountSettings.update(settings);
269
269
  return result.data;
270
270
  }),
@@ -273,7 +273,7 @@ const useUpdateAccountSettings = () => {
273
273
  });
274
274
  };
275
275
 
276
- var __async$t = (__this, __arguments, generator) => {
276
+ var __async$u = (__this, __arguments, generator) => {
277
277
  return new Promise((resolve, reject) => {
278
278
  var fulfilled = (value) => {
279
279
  try {
@@ -296,7 +296,7 @@ var __async$t = (__this, __arguments, generator) => {
296
296
  const useParseAddress = () => {
297
297
  const { client } = useShipEngine();
298
298
  return useMutation({
299
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
299
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
300
300
  const result = yield client.addresses.parse(text, address);
301
301
  return result.data;
302
302
  }),
@@ -305,7 +305,7 @@ const useParseAddress = () => {
305
305
  });
306
306
  };
307
307
 
308
- var __async$s = (__this, __arguments, generator) => {
308
+ var __async$t = (__this, __arguments, generator) => {
309
309
  return new Promise((resolve, reject) => {
310
310
  var fulfilled = (value) => {
311
311
  try {
@@ -328,7 +328,7 @@ var __async$s = (__this, __arguments, generator) => {
328
328
  const useValidateAddresses = () => {
329
329
  const { client } = useShipEngine();
330
330
  return useMutation({
331
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
331
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
332
332
  const result = yield client.addresses.validate(addresses);
333
333
  return result.data;
334
334
  }),
@@ -337,7 +337,7 @@ const useValidateAddresses = () => {
337
337
  });
338
338
  };
339
339
 
340
- var __async$r = (__this, __arguments, generator) => {
340
+ var __async$s = (__this, __arguments, generator) => {
341
341
  return new Promise((resolve, reject) => {
342
342
  var fulfilled = (value) => {
343
343
  try {
@@ -360,7 +360,7 @@ var __async$r = (__this, __arguments, generator) => {
360
360
  const useAddFunds = () => {
361
361
  const { client } = useShipEngine();
362
362
  return useMutation({
363
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
363
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
364
364
  const result = yield client.carriers.addFunds(carrierId, funds);
365
365
  return result.data;
366
366
  }),
@@ -369,7 +369,7 @@ const useAddFunds = () => {
369
369
  });
370
370
  };
371
371
 
372
- var __async$q = (__this, __arguments, generator) => {
372
+ var __async$r = (__this, __arguments, generator) => {
373
373
  return new Promise((resolve, reject) => {
374
374
  var fulfilled = (value) => {
375
375
  try {
@@ -392,7 +392,7 @@ var __async$q = (__this, __arguments, generator) => {
392
392
  const useConnectCarrier = () => {
393
393
  const { client } = useShipEngine();
394
394
  return useMutation({
395
- mutationFn: (params) => __async$q(void 0, null, function* () {
395
+ mutationFn: (params) => __async$r(void 0, null, function* () {
396
396
  const result = yield client.carriers.connect(params);
397
397
  return result.data;
398
398
  }),
@@ -511,22 +511,22 @@ const useListCarriers = () => {
511
511
  });
512
512
  };
513
513
 
514
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
515
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
516
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
517
- var __objRest$9 = (source, exclude) => {
514
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
515
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
516
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
517
+ var __objRest$a = (source, exclude) => {
518
518
  var target = {};
519
519
  for (var prop in source)
520
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
520
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
521
521
  target[prop] = source[prop];
522
- if (source != null && __getOwnPropSymbols$a)
523
- for (var prop of __getOwnPropSymbols$a(source)) {
524
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
522
+ if (source != null && __getOwnPropSymbols$b)
523
+ for (var prop of __getOwnPropSymbols$b(source)) {
524
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
525
525
  target[prop] = source[prop];
526
526
  }
527
527
  return target;
528
528
  };
529
- var __async$p = (__this, __arguments, generator) => {
529
+ var __async$q = (__this, __arguments, generator) => {
530
530
  return new Promise((resolve, reject) => {
531
531
  var fulfilled = (value) => {
532
532
  try {
@@ -550,8 +550,8 @@ const useUpdateAutoFunding = () => {
550
550
  const { client } = useShipEngine();
551
551
  const queryClient = useQueryClient();
552
552
  return useMutation({
553
- mutationFn: (_a) => __async$p(void 0, null, function* () {
554
- var _b = _a, { carrierId } = _b, options = __objRest$9(_b, ["carrierId"]);
553
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
554
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
555
555
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
556
556
  return result.data;
557
557
  }),
@@ -580,24 +580,24 @@ const useGetZonesByCarrier = (carrierId) => {
580
580
  });
581
581
  };
582
582
 
583
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
584
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
585
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
586
- var __objRest$8 = (source, exclude) => {
583
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
584
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
585
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
586
+ var __objRest$9 = (source, exclude) => {
587
587
  var target = {};
588
588
  for (var prop in source)
589
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
589
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
590
590
  target[prop] = source[prop];
591
- if (source != null && __getOwnPropSymbols$9)
592
- for (var prop of __getOwnPropSymbols$9(source)) {
593
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
591
+ if (source != null && __getOwnPropSymbols$a)
592
+ for (var prop of __getOwnPropSymbols$a(source)) {
593
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
594
594
  target[prop] = source[prop];
595
595
  }
596
596
  return target;
597
597
  };
598
598
  const useGetCarrierConnectionForm = (_params) => {
599
599
  const { client } = useShipEngine();
600
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$8(_a, ["carrierName", "enabled"]);
600
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
601
601
  return useQuery({
602
602
  enabled,
603
603
  onError,
@@ -607,24 +607,24 @@ const useGetCarrierConnectionForm = (_params) => {
607
607
  });
608
608
  };
609
609
 
610
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
611
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
612
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
613
- var __objRest$7 = (source, exclude) => {
610
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
611
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
612
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
613
+ var __objRest$8 = (source, exclude) => {
614
614
  var target = {};
615
615
  for (var prop in source)
616
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
616
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
617
617
  target[prop] = source[prop];
618
- if (source != null && __getOwnPropSymbols$8)
619
- for (var prop of __getOwnPropSymbols$8(source)) {
620
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
618
+ if (source != null && __getOwnPropSymbols$9)
619
+ for (var prop of __getOwnPropSymbols$9(source)) {
620
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
621
621
  target[prop] = source[prop];
622
622
  }
623
623
  return target;
624
624
  };
625
625
  const useListCarrierConnections = (_params) => {
626
626
  const { client } = useShipEngine();
627
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$7(_a, ["enabled"]);
627
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
628
628
  return useQuery({
629
629
  enabled,
630
630
  onError,
@@ -644,7 +644,7 @@ const useListCustomPackageTypes = () => {
644
644
  });
645
645
  };
646
646
 
647
- var __async$o = (__this, __arguments, generator) => {
647
+ var __async$p = (__this, __arguments, generator) => {
648
648
  return new Promise((resolve, reject) => {
649
649
  var fulfilled = (value) => {
650
650
  try {
@@ -667,7 +667,7 @@ var __async$o = (__this, __arguments, generator) => {
667
667
  const useCreateFundingSource = () => {
668
668
  const { client } = useShipEngine();
669
669
  return useMutation({
670
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
670
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
671
671
  const result = yield client.fundingSources.create(fundingSource);
672
672
  return result.data;
673
673
  }),
@@ -676,7 +676,7 @@ const useCreateFundingSource = () => {
676
676
  });
677
677
  };
678
678
 
679
- var __async$n = (__this, __arguments, generator) => {
679
+ var __async$o = (__this, __arguments, generator) => {
680
680
  return new Promise((resolve, reject) => {
681
681
  var fulfilled = (value) => {
682
682
  try {
@@ -699,7 +699,7 @@ var __async$n = (__this, __arguments, generator) => {
699
699
  const useFundingSourcesAddFunds = () => {
700
700
  const { client } = useShipEngine();
701
701
  return useMutation({
702
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
702
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
703
703
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
704
704
  return result.data;
705
705
  }),
@@ -728,7 +728,7 @@ const useListFundingSources = () => {
728
728
  });
729
729
  };
730
730
 
731
- var __async$m = (__this, __arguments, generator) => {
731
+ var __async$n = (__this, __arguments, generator) => {
732
732
  return new Promise((resolve, reject) => {
733
733
  var fulfilled = (value) => {
734
734
  try {
@@ -751,7 +751,7 @@ var __async$m = (__this, __arguments, generator) => {
751
751
  const useRegisterCarrier = () => {
752
752
  const { client } = useShipEngine();
753
753
  return useMutation({
754
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
754
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
755
755
  const result = yield client.fundingSources.registerCarrier(carrier);
756
756
  return result.data;
757
757
  }),
@@ -760,7 +760,7 @@ const useRegisterCarrier = () => {
760
760
  });
761
761
  };
762
762
 
763
- var __async$l = (__this, __arguments, generator) => {
763
+ var __async$m = (__this, __arguments, generator) => {
764
764
  return new Promise((resolve, reject) => {
765
765
  var fulfilled = (value) => {
766
766
  try {
@@ -783,7 +783,7 @@ var __async$l = (__this, __arguments, generator) => {
783
783
  const useUpdateFundingSource = () => {
784
784
  const { client } = useShipEngine();
785
785
  return useMutation({
786
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
786
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
787
787
  billingInfo,
788
788
  creditCardInfo,
789
789
  fundingSourceId
@@ -837,6 +837,54 @@ const useGetInsuranceAccount = (insuranceProvider) => {
837
837
  });
838
838
  };
839
839
 
840
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
841
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
842
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
843
+ var __objRest$7 = (source, exclude) => {
844
+ var target = {};
845
+ for (var prop in source)
846
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
847
+ target[prop] = source[prop];
848
+ if (source != null && __getOwnPropSymbols$8)
849
+ for (var prop of __getOwnPropSymbols$8(source)) {
850
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
851
+ target[prop] = source[prop];
852
+ }
853
+ return target;
854
+ };
855
+ var __async$l = (__this, __arguments, generator) => {
856
+ return new Promise((resolve, reject) => {
857
+ var fulfilled = (value) => {
858
+ try {
859
+ step(generator.next(value));
860
+ } catch (e) {
861
+ reject(e);
862
+ }
863
+ };
864
+ var rejected = (value) => {
865
+ try {
866
+ step(generator.throw(value));
867
+ } catch (e) {
868
+ reject(e);
869
+ }
870
+ };
871
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
872
+ step((generator = generator.apply(__this, __arguments)).next());
873
+ });
874
+ };
875
+ const useAddInsuranceFunds = () => {
876
+ const { client } = useShipEngine();
877
+ return useMutation({
878
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
879
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$7(_b, ["insuranceProvider"]);
880
+ const result = yield client.insurance.addFunds(insuranceProvider, rest);
881
+ return result.data;
882
+ }),
883
+ mutationKey: ["useAddInsuranceFunds"],
884
+ onError
885
+ });
886
+ };
887
+
840
888
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
841
889
  var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
842
890
  var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
@@ -1918,4 +1966,4 @@ const useUpdateAccountBillingPlan = () => {
1918
1966
  });
1919
1967
  };
1920
1968
 
1921
- export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeactivateOrderSource, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, 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 };
1969
+ export { ShipEngine, ShipEngineContext, delay, logger, onError, retryUntil, useAddFunds, useAddInsuranceFunds, useCalculateRates, useConnectCarrier, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useDeactivateOrderSource, useDeleteAccountImage, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useListCarrierConnections, 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": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {