@shipengine/react-api 2.0.3 → 2.1.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 +1 @@
1
- export declare const useGetAccountBillingPlan: () => import("@tanstack/react-query").UseQueryResult<import("packages/shipengine-api/javascript/src/types").AccountBillingPlanResponse, import("@shipengine/js-api").CodedError[]>;
1
+ export declare const useGetAccountBillingPlan: () => import("@tanstack/react-query").UseQueryResult<import("packages/shipengine-api/javascript/src/account-billing-plan").AccountBillingPlanResponse, import("@shipengine/js-api").CodedError[]>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @category ShipEngine API Hooks
3
3
  * */
4
- export declare const useUpdateAccountBillingPlan: () => import("@tanstack/react-query").UseMutationResult<import("packages/shipengine-api/javascript/src/types").UpdateAccountBillingPlanResponse, import("@shipengine/js-api").CodedError[], string, unknown>;
4
+ export declare const useUpdateAccountBillingPlan: () => import("@tanstack/react-query").UseMutationResult<import("packages/shipengine-api/javascript/src/account-billing-plan").UpdateAccountBillingPlanResponse, import("@shipengine/js-api").CodedError[], string, unknown>;
@@ -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
@@ -15,28 +15,24 @@ const ShipEngine = ({
15
15
  getToken,
16
16
  onApiError
17
17
  }) => {
18
+ const [client, setClient] = react.useState();
18
19
  const [queryClient] = react.useState(() => new reactQuery.QueryClient());
19
- const [client, setClient] = react.useState(() => {
20
+ react.useEffect(() => {
20
21
  const token = getToken();
21
- if (typeof token === "string")
22
- return new jsApi.ShipEngineAPI(token, {
23
- baseURL,
24
- getToken,
25
- headers: headers != null ? headers : {},
26
- onApiError
22
+ const commonClientProps = {
23
+ baseURL,
24
+ getToken,
25
+ headers: headers != null ? headers : {},
26
+ onApiError
27
+ };
28
+ if (typeof token === "string") {
29
+ setClient(new jsApi.ShipEngineAPI(token, commonClientProps));
30
+ } else {
31
+ token.then((t) => {
32
+ setClient(new jsApi.ShipEngineAPI(t, commonClientProps));
27
33
  });
28
- token.then(
29
- (t) => setClient(
30
- new jsApi.ShipEngineAPI(t, {
31
- baseURL,
32
- getToken,
33
- headers: headers != null ? headers : {},
34
- onApiError
35
- })
36
- )
37
- );
38
- return void 0;
39
- });
34
+ }
35
+ }, []);
40
36
  if (!client) {
41
37
  return /* @__PURE__ */ jsxRuntime.jsx(
42
38
  "div",
@@ -79,17 +75,17 @@ var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){r
79
75
  var __defProp$1 = Object.defineProperty;
80
76
  var __defProps$1 = Object.defineProperties;
81
77
  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;
78
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
79
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
80
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
85
81
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
86
82
  var __spreadValues$1 = (a, b) => {
87
83
  for (var prop in b || (b = {}))
88
- if (__hasOwnProp$b.call(b, prop))
84
+ if (__hasOwnProp$c.call(b, prop))
89
85
  __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))
86
+ if (__getOwnPropSymbols$c)
87
+ for (var prop of __getOwnPropSymbols$c(b)) {
88
+ if (__propIsEnum$c.call(b, prop))
93
89
  __defNormalProp$1(a, prop, b[prop]);
94
90
  }
95
91
  return a;
@@ -128,7 +124,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
128
124
  throw error;
129
125
  });
130
126
 
131
- var __async$x = (__this, __arguments, generator) => {
127
+ var __async$y = (__this, __arguments, generator) => {
132
128
  return new Promise((resolve, reject) => {
133
129
  var fulfilled = (value) => {
134
130
  try {
@@ -151,7 +147,7 @@ var __async$x = (__this, __arguments, generator) => {
151
147
  const useCreateAccountImage = () => {
152
148
  const { client } = useShipEngine();
153
149
  return reactQuery.useMutation({
154
- mutationFn: (data) => __async$x(void 0, null, function* () {
150
+ mutationFn: (data) => __async$y(void 0, null, function* () {
155
151
  const result = yield client.accountSettings.createImage(data);
156
152
  return result.data;
157
153
  }),
@@ -160,7 +156,7 @@ const useCreateAccountImage = () => {
160
156
  });
161
157
  };
162
158
 
163
- var __async$w = (__this, __arguments, generator) => {
159
+ var __async$x = (__this, __arguments, generator) => {
164
160
  return new Promise((resolve, reject) => {
165
161
  var fulfilled = (value) => {
166
162
  try {
@@ -183,7 +179,7 @@ var __async$w = (__this, __arguments, generator) => {
183
179
  const useDeleteAccountImage = () => {
184
180
  const { client } = useShipEngine();
185
181
  return reactQuery.useMutation({
186
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
182
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
187
183
  const result = yield client.accountSettings.deleteImage(labelImageId);
188
184
  return result.data;
189
185
  }),
@@ -212,7 +208,7 @@ const useGetAccountSettings = () => {
212
208
  });
213
209
  };
214
210
 
215
- var __async$v = (__this, __arguments, generator) => {
211
+ var __async$w = (__this, __arguments, generator) => {
216
212
  return new Promise((resolve, reject) => {
217
213
  var fulfilled = (value) => {
218
214
  try {
@@ -235,7 +231,7 @@ var __async$v = (__this, __arguments, generator) => {
235
231
  const useUpdateAccountImage = () => {
236
232
  const { client } = useShipEngine();
237
233
  return reactQuery.useMutation({
238
- mutationFn: (data) => __async$v(void 0, null, function* () {
234
+ mutationFn: (data) => __async$w(void 0, null, function* () {
239
235
  const result = yield client.accountSettings.updateImage(data);
240
236
  return result.data;
241
237
  }),
@@ -244,7 +240,7 @@ const useUpdateAccountImage = () => {
244
240
  });
245
241
  };
246
242
 
247
- var __async$u = (__this, __arguments, generator) => {
243
+ var __async$v = (__this, __arguments, generator) => {
248
244
  return new Promise((resolve, reject) => {
249
245
  var fulfilled = (value) => {
250
246
  try {
@@ -267,7 +263,7 @@ var __async$u = (__this, __arguments, generator) => {
267
263
  const useUpdateAccountSettings = () => {
268
264
  const { client } = useShipEngine();
269
265
  return reactQuery.useMutation({
270
- mutationFn: (settings) => __async$u(void 0, null, function* () {
266
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
271
267
  const result = yield client.accountSettings.update(settings);
272
268
  return result.data;
273
269
  }),
@@ -276,7 +272,7 @@ const useUpdateAccountSettings = () => {
276
272
  });
277
273
  };
278
274
 
279
- var __async$t = (__this, __arguments, generator) => {
275
+ var __async$u = (__this, __arguments, generator) => {
280
276
  return new Promise((resolve, reject) => {
281
277
  var fulfilled = (value) => {
282
278
  try {
@@ -299,7 +295,7 @@ var __async$t = (__this, __arguments, generator) => {
299
295
  const useParseAddress = () => {
300
296
  const { client } = useShipEngine();
301
297
  return reactQuery.useMutation({
302
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
298
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
303
299
  const result = yield client.addresses.parse(text, address);
304
300
  return result.data;
305
301
  }),
@@ -308,7 +304,7 @@ const useParseAddress = () => {
308
304
  });
309
305
  };
310
306
 
311
- var __async$s = (__this, __arguments, generator) => {
307
+ var __async$t = (__this, __arguments, generator) => {
312
308
  return new Promise((resolve, reject) => {
313
309
  var fulfilled = (value) => {
314
310
  try {
@@ -331,7 +327,7 @@ var __async$s = (__this, __arguments, generator) => {
331
327
  const useValidateAddresses = () => {
332
328
  const { client } = useShipEngine();
333
329
  return reactQuery.useMutation({
334
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
330
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
335
331
  const result = yield client.addresses.validate(addresses);
336
332
  return result.data;
337
333
  }),
@@ -340,7 +336,7 @@ const useValidateAddresses = () => {
340
336
  });
341
337
  };
342
338
 
343
- var __async$r = (__this, __arguments, generator) => {
339
+ var __async$s = (__this, __arguments, generator) => {
344
340
  return new Promise((resolve, reject) => {
345
341
  var fulfilled = (value) => {
346
342
  try {
@@ -363,7 +359,7 @@ var __async$r = (__this, __arguments, generator) => {
363
359
  const useAddFunds = () => {
364
360
  const { client } = useShipEngine();
365
361
  return reactQuery.useMutation({
366
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
362
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
367
363
  const result = yield client.carriers.addFunds(carrierId, funds);
368
364
  return result.data;
369
365
  }),
@@ -372,7 +368,7 @@ const useAddFunds = () => {
372
368
  });
373
369
  };
374
370
 
375
- var __async$q = (__this, __arguments, generator) => {
371
+ var __async$r = (__this, __arguments, generator) => {
376
372
  return new Promise((resolve, reject) => {
377
373
  var fulfilled = (value) => {
378
374
  try {
@@ -395,7 +391,7 @@ var __async$q = (__this, __arguments, generator) => {
395
391
  const useConnectCarrier = () => {
396
392
  const { client } = useShipEngine();
397
393
  return reactQuery.useMutation({
398
- mutationFn: (params) => __async$q(void 0, null, function* () {
394
+ mutationFn: (params) => __async$r(void 0, null, function* () {
399
395
  const result = yield client.carriers.connect(params);
400
396
  return result.data;
401
397
  }),
@@ -514,22 +510,22 @@ const useListCarriers = () => {
514
510
  });
515
511
  };
516
512
 
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) => {
513
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
514
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
515
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
516
+ var __objRest$a = (source, exclude) => {
521
517
  var target = {};
522
518
  for (var prop in source)
523
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
519
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
524
520
  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))
521
+ if (source != null && __getOwnPropSymbols$b)
522
+ for (var prop of __getOwnPropSymbols$b(source)) {
523
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
528
524
  target[prop] = source[prop];
529
525
  }
530
526
  return target;
531
527
  };
532
- var __async$p = (__this, __arguments, generator) => {
528
+ var __async$q = (__this, __arguments, generator) => {
533
529
  return new Promise((resolve, reject) => {
534
530
  var fulfilled = (value) => {
535
531
  try {
@@ -553,8 +549,8 @@ const useUpdateAutoFunding = () => {
553
549
  const { client } = useShipEngine();
554
550
  const queryClient = reactQuery.useQueryClient();
555
551
  return reactQuery.useMutation({
556
- mutationFn: (_a) => __async$p(void 0, null, function* () {
557
- var _b = _a, { carrierId } = _b, options = __objRest$9(_b, ["carrierId"]);
552
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
553
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
558
554
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
559
555
  return result.data;
560
556
  }),
@@ -583,24 +579,24 @@ const useGetZonesByCarrier = (carrierId) => {
583
579
  });
584
580
  };
585
581
 
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) => {
582
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
583
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
584
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
585
+ var __objRest$9 = (source, exclude) => {
590
586
  var target = {};
591
587
  for (var prop in source)
592
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
588
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
593
589
  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))
590
+ if (source != null && __getOwnPropSymbols$a)
591
+ for (var prop of __getOwnPropSymbols$a(source)) {
592
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
597
593
  target[prop] = source[prop];
598
594
  }
599
595
  return target;
600
596
  };
601
597
  const useGetCarrierConnectionForm = (_params) => {
602
598
  const { client } = useShipEngine();
603
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$8(_a, ["carrierName", "enabled"]);
599
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
604
600
  return reactQuery.useQuery({
605
601
  enabled,
606
602
  onError,
@@ -610,24 +606,24 @@ const useGetCarrierConnectionForm = (_params) => {
610
606
  });
611
607
  };
612
608
 
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) => {
609
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
610
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
611
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
612
+ var __objRest$8 = (source, exclude) => {
617
613
  var target = {};
618
614
  for (var prop in source)
619
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
615
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
620
616
  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))
617
+ if (source != null && __getOwnPropSymbols$9)
618
+ for (var prop of __getOwnPropSymbols$9(source)) {
619
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
624
620
  target[prop] = source[prop];
625
621
  }
626
622
  return target;
627
623
  };
628
624
  const useListCarrierConnections = (_params) => {
629
625
  const { client } = useShipEngine();
630
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$7(_a, ["enabled"]);
626
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
631
627
  return reactQuery.useQuery({
632
628
  enabled,
633
629
  onError,
@@ -647,7 +643,7 @@ const useListCustomPackageTypes = () => {
647
643
  });
648
644
  };
649
645
 
650
- var __async$o = (__this, __arguments, generator) => {
646
+ var __async$p = (__this, __arguments, generator) => {
651
647
  return new Promise((resolve, reject) => {
652
648
  var fulfilled = (value) => {
653
649
  try {
@@ -670,7 +666,7 @@ var __async$o = (__this, __arguments, generator) => {
670
666
  const useCreateFundingSource = () => {
671
667
  const { client } = useShipEngine();
672
668
  return reactQuery.useMutation({
673
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
669
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
674
670
  const result = yield client.fundingSources.create(fundingSource);
675
671
  return result.data;
676
672
  }),
@@ -679,7 +675,7 @@ const useCreateFundingSource = () => {
679
675
  });
680
676
  };
681
677
 
682
- var __async$n = (__this, __arguments, generator) => {
678
+ var __async$o = (__this, __arguments, generator) => {
683
679
  return new Promise((resolve, reject) => {
684
680
  var fulfilled = (value) => {
685
681
  try {
@@ -702,7 +698,7 @@ var __async$n = (__this, __arguments, generator) => {
702
698
  const useFundingSourcesAddFunds = () => {
703
699
  const { client } = useShipEngine();
704
700
  return reactQuery.useMutation({
705
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
701
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
706
702
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
707
703
  return result.data;
708
704
  }),
@@ -731,7 +727,7 @@ const useListFundingSources = () => {
731
727
  });
732
728
  };
733
729
 
734
- var __async$m = (__this, __arguments, generator) => {
730
+ var __async$n = (__this, __arguments, generator) => {
735
731
  return new Promise((resolve, reject) => {
736
732
  var fulfilled = (value) => {
737
733
  try {
@@ -754,7 +750,7 @@ var __async$m = (__this, __arguments, generator) => {
754
750
  const useRegisterCarrier = () => {
755
751
  const { client } = useShipEngine();
756
752
  return reactQuery.useMutation({
757
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
753
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
758
754
  const result = yield client.fundingSources.registerCarrier(carrier);
759
755
  return result.data;
760
756
  }),
@@ -763,7 +759,7 @@ const useRegisterCarrier = () => {
763
759
  });
764
760
  };
765
761
 
766
- var __async$l = (__this, __arguments, generator) => {
762
+ var __async$m = (__this, __arguments, generator) => {
767
763
  return new Promise((resolve, reject) => {
768
764
  var fulfilled = (value) => {
769
765
  try {
@@ -786,7 +782,7 @@ var __async$l = (__this, __arguments, generator) => {
786
782
  const useUpdateFundingSource = () => {
787
783
  const { client } = useShipEngine();
788
784
  return reactQuery.useMutation({
789
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
785
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
790
786
  billingInfo,
791
787
  creditCardInfo,
792
788
  fundingSourceId
@@ -840,6 +836,54 @@ const useGetInsuranceAccount = (insuranceProvider) => {
840
836
  });
841
837
  };
842
838
 
839
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
840
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
841
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
842
+ var __objRest$7 = (source, exclude) => {
843
+ var target = {};
844
+ for (var prop in source)
845
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
846
+ target[prop] = source[prop];
847
+ if (source != null && __getOwnPropSymbols$8)
848
+ for (var prop of __getOwnPropSymbols$8(source)) {
849
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
850
+ target[prop] = source[prop];
851
+ }
852
+ return target;
853
+ };
854
+ var __async$l = (__this, __arguments, generator) => {
855
+ return new Promise((resolve, reject) => {
856
+ var fulfilled = (value) => {
857
+ try {
858
+ step(generator.next(value));
859
+ } catch (e) {
860
+ reject(e);
861
+ }
862
+ };
863
+ var rejected = (value) => {
864
+ try {
865
+ step(generator.throw(value));
866
+ } catch (e) {
867
+ reject(e);
868
+ }
869
+ };
870
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
871
+ step((generator = generator.apply(__this, __arguments)).next());
872
+ });
873
+ };
874
+ const useAddInsuranceFunds = () => {
875
+ const { client } = useShipEngine();
876
+ return reactQuery.useMutation({
877
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
878
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$7(_b, ["insuranceProvider"]);
879
+ const result = yield client.insurance.addFunds(insuranceProvider, rest);
880
+ return result.data;
881
+ }),
882
+ mutationKey: ["useAddInsuranceFunds"],
883
+ onError
884
+ });
885
+ };
886
+
843
887
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
844
888
  var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
845
889
  var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
@@ -1928,6 +1972,7 @@ exports.logger = logger;
1928
1972
  exports.onError = onError;
1929
1973
  exports.retryUntil = retryUntil;
1930
1974
  exports.useAddFunds = useAddFunds;
1975
+ exports.useAddInsuranceFunds = useAddInsuranceFunds;
1931
1976
  exports.useCalculateRates = useCalculateRates;
1932
1977
  exports.useConnectCarrier = useConnectCarrier;
1933
1978
  exports.useCreateAccountImage = useCreateAccountImage;
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { createContext, useState, useContext } from 'react';
3
+ import { createContext, useState, useEffect, useContext } from 'react';
4
4
  import { ShipEngineAPI, SE } from '@shipengine/js-api';
5
5
  export * from '@shipengine/js-api';
6
6
 
@@ -12,28 +12,24 @@ const ShipEngine = ({
12
12
  getToken,
13
13
  onApiError
14
14
  }) => {
15
+ const [client, setClient] = useState();
15
16
  const [queryClient] = useState(() => new QueryClient());
16
- const [client, setClient] = useState(() => {
17
+ useEffect(() => {
17
18
  const token = getToken();
18
- if (typeof token === "string")
19
- return new ShipEngineAPI(token, {
20
- baseURL,
21
- getToken,
22
- headers: headers != null ? headers : {},
23
- onApiError
19
+ const commonClientProps = {
20
+ baseURL,
21
+ getToken,
22
+ headers: headers != null ? headers : {},
23
+ onApiError
24
+ };
25
+ if (typeof token === "string") {
26
+ setClient(new ShipEngineAPI(token, commonClientProps));
27
+ } else {
28
+ token.then((t) => {
29
+ setClient(new ShipEngineAPI(t, commonClientProps));
24
30
  });
25
- token.then(
26
- (t) => setClient(
27
- new ShipEngineAPI(t, {
28
- baseURL,
29
- getToken,
30
- headers: headers != null ? headers : {},
31
- onApiError
32
- })
33
- )
34
- );
35
- return void 0;
36
- });
31
+ }
32
+ }, []);
37
33
  if (!client) {
38
34
  return /* @__PURE__ */ jsx(
39
35
  "div",
@@ -76,17 +72,17 @@ var o={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},l={};function a(e){r
76
72
  var __defProp$1 = Object.defineProperty;
77
73
  var __defProps$1 = Object.defineProperties;
78
74
  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;
75
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
76
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
77
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
82
78
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
83
79
  var __spreadValues$1 = (a, b) => {
84
80
  for (var prop in b || (b = {}))
85
- if (__hasOwnProp$b.call(b, prop))
81
+ if (__hasOwnProp$c.call(b, prop))
86
82
  __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))
83
+ if (__getOwnPropSymbols$c)
84
+ for (var prop of __getOwnPropSymbols$c(b)) {
85
+ if (__propIsEnum$c.call(b, prop))
90
86
  __defNormalProp$1(a, prop, b[prop]);
91
87
  }
92
88
  return a;
@@ -125,7 +121,7 @@ const retryUntil = (callbackFn, retries = 10, timeoutBetweenAttempts = 1e3) => P
125
121
  throw error;
126
122
  });
127
123
 
128
- var __async$x = (__this, __arguments, generator) => {
124
+ var __async$y = (__this, __arguments, generator) => {
129
125
  return new Promise((resolve, reject) => {
130
126
  var fulfilled = (value) => {
131
127
  try {
@@ -148,7 +144,7 @@ var __async$x = (__this, __arguments, generator) => {
148
144
  const useCreateAccountImage = () => {
149
145
  const { client } = useShipEngine();
150
146
  return useMutation({
151
- mutationFn: (data) => __async$x(void 0, null, function* () {
147
+ mutationFn: (data) => __async$y(void 0, null, function* () {
152
148
  const result = yield client.accountSettings.createImage(data);
153
149
  return result.data;
154
150
  }),
@@ -157,7 +153,7 @@ const useCreateAccountImage = () => {
157
153
  });
158
154
  };
159
155
 
160
- var __async$w = (__this, __arguments, generator) => {
156
+ var __async$x = (__this, __arguments, generator) => {
161
157
  return new Promise((resolve, reject) => {
162
158
  var fulfilled = (value) => {
163
159
  try {
@@ -180,7 +176,7 @@ var __async$w = (__this, __arguments, generator) => {
180
176
  const useDeleteAccountImage = () => {
181
177
  const { client } = useShipEngine();
182
178
  return useMutation({
183
- mutationFn: (labelImageId) => __async$w(void 0, null, function* () {
179
+ mutationFn: (labelImageId) => __async$x(void 0, null, function* () {
184
180
  const result = yield client.accountSettings.deleteImage(labelImageId);
185
181
  return result.data;
186
182
  }),
@@ -209,7 +205,7 @@ const useGetAccountSettings = () => {
209
205
  });
210
206
  };
211
207
 
212
- var __async$v = (__this, __arguments, generator) => {
208
+ var __async$w = (__this, __arguments, generator) => {
213
209
  return new Promise((resolve, reject) => {
214
210
  var fulfilled = (value) => {
215
211
  try {
@@ -232,7 +228,7 @@ var __async$v = (__this, __arguments, generator) => {
232
228
  const useUpdateAccountImage = () => {
233
229
  const { client } = useShipEngine();
234
230
  return useMutation({
235
- mutationFn: (data) => __async$v(void 0, null, function* () {
231
+ mutationFn: (data) => __async$w(void 0, null, function* () {
236
232
  const result = yield client.accountSettings.updateImage(data);
237
233
  return result.data;
238
234
  }),
@@ -241,7 +237,7 @@ const useUpdateAccountImage = () => {
241
237
  });
242
238
  };
243
239
 
244
- var __async$u = (__this, __arguments, generator) => {
240
+ var __async$v = (__this, __arguments, generator) => {
245
241
  return new Promise((resolve, reject) => {
246
242
  var fulfilled = (value) => {
247
243
  try {
@@ -264,7 +260,7 @@ var __async$u = (__this, __arguments, generator) => {
264
260
  const useUpdateAccountSettings = () => {
265
261
  const { client } = useShipEngine();
266
262
  return useMutation({
267
- mutationFn: (settings) => __async$u(void 0, null, function* () {
263
+ mutationFn: (settings) => __async$v(void 0, null, function* () {
268
264
  const result = yield client.accountSettings.update(settings);
269
265
  return result.data;
270
266
  }),
@@ -273,7 +269,7 @@ const useUpdateAccountSettings = () => {
273
269
  });
274
270
  };
275
271
 
276
- var __async$t = (__this, __arguments, generator) => {
272
+ var __async$u = (__this, __arguments, generator) => {
277
273
  return new Promise((resolve, reject) => {
278
274
  var fulfilled = (value) => {
279
275
  try {
@@ -296,7 +292,7 @@ var __async$t = (__this, __arguments, generator) => {
296
292
  const useParseAddress = () => {
297
293
  const { client } = useShipEngine();
298
294
  return useMutation({
299
- mutationFn: (_0) => __async$t(void 0, [_0], function* ({ address, text }) {
295
+ mutationFn: (_0) => __async$u(void 0, [_0], function* ({ address, text }) {
300
296
  const result = yield client.addresses.parse(text, address);
301
297
  return result.data;
302
298
  }),
@@ -305,7 +301,7 @@ const useParseAddress = () => {
305
301
  });
306
302
  };
307
303
 
308
- var __async$s = (__this, __arguments, generator) => {
304
+ var __async$t = (__this, __arguments, generator) => {
309
305
  return new Promise((resolve, reject) => {
310
306
  var fulfilled = (value) => {
311
307
  try {
@@ -328,7 +324,7 @@ var __async$s = (__this, __arguments, generator) => {
328
324
  const useValidateAddresses = () => {
329
325
  const { client } = useShipEngine();
330
326
  return useMutation({
331
- mutationFn: (addresses) => __async$s(void 0, null, function* () {
327
+ mutationFn: (addresses) => __async$t(void 0, null, function* () {
332
328
  const result = yield client.addresses.validate(addresses);
333
329
  return result.data;
334
330
  }),
@@ -337,7 +333,7 @@ const useValidateAddresses = () => {
337
333
  });
338
334
  };
339
335
 
340
- var __async$r = (__this, __arguments, generator) => {
336
+ var __async$s = (__this, __arguments, generator) => {
341
337
  return new Promise((resolve, reject) => {
342
338
  var fulfilled = (value) => {
343
339
  try {
@@ -360,7 +356,7 @@ var __async$r = (__this, __arguments, generator) => {
360
356
  const useAddFunds = () => {
361
357
  const { client } = useShipEngine();
362
358
  return useMutation({
363
- mutationFn: (_0) => __async$r(void 0, [_0], function* ({ carrierId, funds }) {
359
+ mutationFn: (_0) => __async$s(void 0, [_0], function* ({ carrierId, funds }) {
364
360
  const result = yield client.carriers.addFunds(carrierId, funds);
365
361
  return result.data;
366
362
  }),
@@ -369,7 +365,7 @@ const useAddFunds = () => {
369
365
  });
370
366
  };
371
367
 
372
- var __async$q = (__this, __arguments, generator) => {
368
+ var __async$r = (__this, __arguments, generator) => {
373
369
  return new Promise((resolve, reject) => {
374
370
  var fulfilled = (value) => {
375
371
  try {
@@ -392,7 +388,7 @@ var __async$q = (__this, __arguments, generator) => {
392
388
  const useConnectCarrier = () => {
393
389
  const { client } = useShipEngine();
394
390
  return useMutation({
395
- mutationFn: (params) => __async$q(void 0, null, function* () {
391
+ mutationFn: (params) => __async$r(void 0, null, function* () {
396
392
  const result = yield client.carriers.connect(params);
397
393
  return result.data;
398
394
  }),
@@ -511,22 +507,22 @@ const useListCarriers = () => {
511
507
  });
512
508
  };
513
509
 
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) => {
510
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
511
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
512
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
513
+ var __objRest$a = (source, exclude) => {
518
514
  var target = {};
519
515
  for (var prop in source)
520
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
516
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
521
517
  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))
518
+ if (source != null && __getOwnPropSymbols$b)
519
+ for (var prop of __getOwnPropSymbols$b(source)) {
520
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
525
521
  target[prop] = source[prop];
526
522
  }
527
523
  return target;
528
524
  };
529
- var __async$p = (__this, __arguments, generator) => {
525
+ var __async$q = (__this, __arguments, generator) => {
530
526
  return new Promise((resolve, reject) => {
531
527
  var fulfilled = (value) => {
532
528
  try {
@@ -550,8 +546,8 @@ const useUpdateAutoFunding = () => {
550
546
  const { client } = useShipEngine();
551
547
  const queryClient = useQueryClient();
552
548
  return useMutation({
553
- mutationFn: (_a) => __async$p(void 0, null, function* () {
554
- var _b = _a, { carrierId } = _b, options = __objRest$9(_b, ["carrierId"]);
549
+ mutationFn: (_a) => __async$q(void 0, null, function* () {
550
+ var _b = _a, { carrierId } = _b, options = __objRest$a(_b, ["carrierId"]);
555
551
  const result = yield client.carriers.updateAutoFunding(carrierId, options);
556
552
  return result.data;
557
553
  }),
@@ -580,24 +576,24 @@ const useGetZonesByCarrier = (carrierId) => {
580
576
  });
581
577
  };
582
578
 
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) => {
579
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
580
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
581
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
582
+ var __objRest$9 = (source, exclude) => {
587
583
  var target = {};
588
584
  for (var prop in source)
589
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
585
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
590
586
  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))
587
+ if (source != null && __getOwnPropSymbols$a)
588
+ for (var prop of __getOwnPropSymbols$a(source)) {
589
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
594
590
  target[prop] = source[prop];
595
591
  }
596
592
  return target;
597
593
  };
598
594
  const useGetCarrierConnectionForm = (_params) => {
599
595
  const { client } = useShipEngine();
600
- const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$8(_a, ["carrierName", "enabled"]);
596
+ const _a = _params || {}, { carrierName, enabled = true } = _a, params = __objRest$9(_a, ["carrierName", "enabled"]);
601
597
  return useQuery({
602
598
  enabled,
603
599
  onError,
@@ -607,24 +603,24 @@ const useGetCarrierConnectionForm = (_params) => {
607
603
  });
608
604
  };
609
605
 
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) => {
606
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
607
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
608
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
609
+ var __objRest$8 = (source, exclude) => {
614
610
  var target = {};
615
611
  for (var prop in source)
616
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
612
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
617
613
  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))
614
+ if (source != null && __getOwnPropSymbols$9)
615
+ for (var prop of __getOwnPropSymbols$9(source)) {
616
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
621
617
  target[prop] = source[prop];
622
618
  }
623
619
  return target;
624
620
  };
625
621
  const useListCarrierConnections = (_params) => {
626
622
  const { client } = useShipEngine();
627
- const _a = _params || {}, { enabled = true } = _a, params = __objRest$7(_a, ["enabled"]);
623
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$8(_a, ["enabled"]);
628
624
  return useQuery({
629
625
  enabled,
630
626
  onError,
@@ -644,7 +640,7 @@ const useListCustomPackageTypes = () => {
644
640
  });
645
641
  };
646
642
 
647
- var __async$o = (__this, __arguments, generator) => {
643
+ var __async$p = (__this, __arguments, generator) => {
648
644
  return new Promise((resolve, reject) => {
649
645
  var fulfilled = (value) => {
650
646
  try {
@@ -667,7 +663,7 @@ var __async$o = (__this, __arguments, generator) => {
667
663
  const useCreateFundingSource = () => {
668
664
  const { client } = useShipEngine();
669
665
  return useMutation({
670
- mutationFn: (fundingSource) => __async$o(void 0, null, function* () {
666
+ mutationFn: (fundingSource) => __async$p(void 0, null, function* () {
671
667
  const result = yield client.fundingSources.create(fundingSource);
672
668
  return result.data;
673
669
  }),
@@ -676,7 +672,7 @@ const useCreateFundingSource = () => {
676
672
  });
677
673
  };
678
674
 
679
- var __async$n = (__this, __arguments, generator) => {
675
+ var __async$o = (__this, __arguments, generator) => {
680
676
  return new Promise((resolve, reject) => {
681
677
  var fulfilled = (value) => {
682
678
  try {
@@ -699,7 +695,7 @@ var __async$n = (__this, __arguments, generator) => {
699
695
  const useFundingSourcesAddFunds = () => {
700
696
  const { client } = useShipEngine();
701
697
  return useMutation({
702
- mutationFn: (_0) => __async$n(void 0, [_0], function* ({ funds, fundingSourceId }) {
698
+ mutationFn: (_0) => __async$o(void 0, [_0], function* ({ funds, fundingSourceId }) {
703
699
  const result = yield client.fundingSources.addFunds(funds, fundingSourceId);
704
700
  return result.data;
705
701
  }),
@@ -728,7 +724,7 @@ const useListFundingSources = () => {
728
724
  });
729
725
  };
730
726
 
731
- var __async$m = (__this, __arguments, generator) => {
727
+ var __async$n = (__this, __arguments, generator) => {
732
728
  return new Promise((resolve, reject) => {
733
729
  var fulfilled = (value) => {
734
730
  try {
@@ -751,7 +747,7 @@ var __async$m = (__this, __arguments, generator) => {
751
747
  const useRegisterCarrier = () => {
752
748
  const { client } = useShipEngine();
753
749
  return useMutation({
754
- mutationFn: (carrier) => __async$m(void 0, null, function* () {
750
+ mutationFn: (carrier) => __async$n(void 0, null, function* () {
755
751
  const result = yield client.fundingSources.registerCarrier(carrier);
756
752
  return result.data;
757
753
  }),
@@ -760,7 +756,7 @@ const useRegisterCarrier = () => {
760
756
  });
761
757
  };
762
758
 
763
- var __async$l = (__this, __arguments, generator) => {
759
+ var __async$m = (__this, __arguments, generator) => {
764
760
  return new Promise((resolve, reject) => {
765
761
  var fulfilled = (value) => {
766
762
  try {
@@ -783,7 +779,7 @@ var __async$l = (__this, __arguments, generator) => {
783
779
  const useUpdateFundingSource = () => {
784
780
  const { client } = useShipEngine();
785
781
  return useMutation({
786
- mutationFn: (_0) => __async$l(void 0, [_0], function* ({
782
+ mutationFn: (_0) => __async$m(void 0, [_0], function* ({
787
783
  billingInfo,
788
784
  creditCardInfo,
789
785
  fundingSourceId
@@ -837,6 +833,54 @@ const useGetInsuranceAccount = (insuranceProvider) => {
837
833
  });
838
834
  };
839
835
 
836
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
837
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
838
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
839
+ var __objRest$7 = (source, exclude) => {
840
+ var target = {};
841
+ for (var prop in source)
842
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
843
+ target[prop] = source[prop];
844
+ if (source != null && __getOwnPropSymbols$8)
845
+ for (var prop of __getOwnPropSymbols$8(source)) {
846
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
847
+ target[prop] = source[prop];
848
+ }
849
+ return target;
850
+ };
851
+ var __async$l = (__this, __arguments, generator) => {
852
+ return new Promise((resolve, reject) => {
853
+ var fulfilled = (value) => {
854
+ try {
855
+ step(generator.next(value));
856
+ } catch (e) {
857
+ reject(e);
858
+ }
859
+ };
860
+ var rejected = (value) => {
861
+ try {
862
+ step(generator.throw(value));
863
+ } catch (e) {
864
+ reject(e);
865
+ }
866
+ };
867
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
868
+ step((generator = generator.apply(__this, __arguments)).next());
869
+ });
870
+ };
871
+ const useAddInsuranceFunds = () => {
872
+ const { client } = useShipEngine();
873
+ return useMutation({
874
+ mutationFn: (_a) => __async$l(void 0, null, function* () {
875
+ var _b = _a, { insuranceProvider } = _b, rest = __objRest$7(_b, ["insuranceProvider"]);
876
+ const result = yield client.insurance.addFunds(insuranceProvider, rest);
877
+ return result.data;
878
+ }),
879
+ mutationKey: ["useAddInsuranceFunds"],
880
+ onError
881
+ });
882
+ };
883
+
840
884
  var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
841
885
  var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
842
886
  var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
@@ -1918,4 +1962,4 @@ const useUpdateAccountBillingPlan = () => {
1918
1962
  });
1919
1963
  };
1920
1964
 
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 };
1965
+ 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.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {