@shipengine/alchemy 0.5.11 → 0.5.13

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.
Files changed (3) hide show
  1. package/index.js +103 -70
  2. package/index.mjs +103 -71
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -2476,17 +2476,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
2476
2476
  var _default = dist.default = (function () {
2477
2477
  });
2478
2478
 
2479
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2480
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2481
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2482
- var __objRest$7 = (source, exclude) => {
2479
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2480
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2481
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2482
+ var __objRest$8 = (source, exclude) => {
2483
2483
  var target = {};
2484
2484
  for (var prop in source)
2485
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
2485
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
2486
2486
  target[prop] = source[prop];
2487
- if (source != null && __getOwnPropSymbols$b)
2488
- for (var prop of __getOwnPropSymbols$b(source)) {
2489
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
2487
+ if (source != null && __getOwnPropSymbols$c)
2488
+ for (var prop of __getOwnPropSymbols$c(source)) {
2489
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
2490
2490
  target[prop] = source[prop];
2491
2491
  }
2492
2492
  return target;
@@ -2500,7 +2500,7 @@ class CodedError {
2500
2500
  this.message = message;
2501
2501
  }
2502
2502
  static fromObject(_a) {
2503
- var _b = _a, { message } = _b, options = __objRest$7(_b, ["message"]);
2503
+ var _b = _a, { message } = _b, options = __objRest$8(_b, ["message"]);
2504
2504
  return new CodedError(message, options);
2505
2505
  }
2506
2506
  }
@@ -5265,30 +5265,30 @@ const getEndUserIpAddress = () => __async$s(void 0, null, function* () {
5265
5265
  var __defProp$5 = Object.defineProperty;
5266
5266
  var __defProps$3 = Object.defineProperties;
5267
5267
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
5268
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
5269
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
5270
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
5268
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
5269
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
5270
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
5271
5271
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5272
5272
  var __spreadValues$5 = (a, b) => {
5273
5273
  for (var prop in b || (b = {}))
5274
- if (__hasOwnProp$a.call(b, prop))
5274
+ if (__hasOwnProp$b.call(b, prop))
5275
5275
  __defNormalProp$5(a, prop, b[prop]);
5276
- if (__getOwnPropSymbols$a)
5277
- for (var prop of __getOwnPropSymbols$a(b)) {
5278
- if (__propIsEnum$a.call(b, prop))
5276
+ if (__getOwnPropSymbols$b)
5277
+ for (var prop of __getOwnPropSymbols$b(b)) {
5278
+ if (__propIsEnum$b.call(b, prop))
5279
5279
  __defNormalProp$5(a, prop, b[prop]);
5280
5280
  }
5281
5281
  return a;
5282
5282
  };
5283
5283
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
5284
- var __objRest$6 = (source, exclude) => {
5284
+ var __objRest$7 = (source, exclude) => {
5285
5285
  var target = {};
5286
5286
  for (var prop in source)
5287
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
5287
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
5288
5288
  target[prop] = source[prop];
5289
- if (source != null && __getOwnPropSymbols$a)
5290
- for (var prop of __getOwnPropSymbols$a(source)) {
5291
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
5289
+ if (source != null && __getOwnPropSymbols$b)
5290
+ for (var prop of __getOwnPropSymbols$b(source)) {
5291
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
5292
5292
  target[prop] = source[prop];
5293
5293
  }
5294
5294
  return target;
@@ -5323,7 +5323,7 @@ class CarriersAPI {
5323
5323
  return this.client.get(`/v1/carriers/${carrierId}`);
5324
5324
  };
5325
5325
  this.connect = (_a) => __async$r(this, null, function* () {
5326
- var _b = _a, { carrierCode } = _b, connection = __objRest$6(_b, ["carrierCode"]);
5326
+ var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
5327
5327
  const endUserIpAddress = yield getEndUserIpAddress();
5328
5328
  if (!endUserIpAddress)
5329
5329
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -7560,17 +7560,17 @@ class CustomPackagesAPI {
7560
7560
  }
7561
7561
 
7562
7562
  var __defProp$4 = Object.defineProperty;
7563
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
7564
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
7565
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
7563
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
7564
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
7565
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
7566
7566
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7567
7567
  var __spreadValues$4 = (a, b) => {
7568
7568
  for (var prop in b || (b = {}))
7569
- if (__hasOwnProp$9.call(b, prop))
7569
+ if (__hasOwnProp$a.call(b, prop))
7570
7570
  __defNormalProp$4(a, prop, b[prop]);
7571
- if (__getOwnPropSymbols$9)
7572
- for (var prop of __getOwnPropSymbols$9(b)) {
7573
- if (__propIsEnum$9.call(b, prop))
7571
+ if (__getOwnPropSymbols$a)
7572
+ for (var prop of __getOwnPropSymbols$a(b)) {
7573
+ if (__propIsEnum$a.call(b, prop))
7574
7574
  __defNormalProp$4(a, prop, b[prop]);
7575
7575
  }
7576
7576
  return a;
@@ -7713,8 +7713,10 @@ class RatesAPI {
7713
7713
  class SalesOrderShipmentsAPI {
7714
7714
  constructor(client) {
7715
7715
  this.client = client;
7716
- this.list = (params = {}) => {
7717
- return this.client.post("/v-beta/shipments/list", params);
7716
+ this.list = (body = {}, params) => {
7717
+ return this.client.post("/v-beta/shipments/list", body, {
7718
+ params
7719
+ });
7718
7720
  };
7719
7721
  this.get = (shipmentId) => {
7720
7722
  return this.client.get(`/v-beta/shipments/${shipmentId}`);
@@ -7777,6 +7779,9 @@ class ShipmentsAPI {
7777
7779
  createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
7778
7780
  );
7779
7781
  };
7782
+ this.list = (options) => {
7783
+ return this.client.get("/v1/shipments", { params: options });
7784
+ };
7780
7785
  this.create = (...shipments) => __async$p(this, null, function* () {
7781
7786
  return this.client.post("/v1/shipments", {
7782
7787
  shipments
@@ -7808,17 +7813,17 @@ class WarehousesAPI {
7808
7813
  var __defProp$3 = Object.defineProperty;
7809
7814
  var __defProps$2 = Object.defineProperties;
7810
7815
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
7811
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
7812
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
7813
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
7816
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
7817
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
7818
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
7814
7819
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7815
7820
  var __spreadValues$3 = (a, b) => {
7816
7821
  for (var prop in b || (b = {}))
7817
- if (__hasOwnProp$8.call(b, prop))
7822
+ if (__hasOwnProp$9.call(b, prop))
7818
7823
  __defNormalProp$3(a, prop, b[prop]);
7819
- if (__getOwnPropSymbols$8)
7820
- for (var prop of __getOwnPropSymbols$8(b)) {
7821
- if (__propIsEnum$8.call(b, prop))
7824
+ if (__getOwnPropSymbols$9)
7825
+ for (var prop of __getOwnPropSymbols$9(b)) {
7826
+ if (__propIsEnum$9.call(b, prop))
7822
7827
  __defNormalProp$3(a, prop, b[prop]);
7823
7828
  }
7824
7829
  return a;
@@ -8043,17 +8048,17 @@ const onError = (errors) => errors.forEach(console.log);
8043
8048
  var __defProp$2 = Object.defineProperty;
8044
8049
  var __defProps$1 = Object.defineProperties;
8045
8050
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
8046
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8047
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8048
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8051
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8052
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8053
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8049
8054
  var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8050
8055
  var __spreadValues$2 = (a, b) => {
8051
8056
  for (var prop in b || (b = {}))
8052
- if (__hasOwnProp$7.call(b, prop))
8057
+ if (__hasOwnProp$8.call(b, prop))
8053
8058
  __defNormalProp$2(a, prop, b[prop]);
8054
- if (__getOwnPropSymbols$7)
8055
- for (var prop of __getOwnPropSymbols$7(b)) {
8056
- if (__propIsEnum$7.call(b, prop))
8059
+ if (__getOwnPropSymbols$8)
8060
+ for (var prop of __getOwnPropSymbols$8(b)) {
8061
+ if (__propIsEnum$8.call(b, prop))
8057
8062
  __defNormalProp$2(a, prop, b[prop]);
8058
8063
  }
8059
8064
  return a;
@@ -8220,17 +8225,17 @@ const useCreateFundingSource = () => {
8220
8225
  });
8221
8226
  };
8222
8227
 
8223
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8224
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8225
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8226
- var __objRest$5 = (source, exclude) => {
8228
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8229
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8230
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8231
+ var __objRest$6 = (source, exclude) => {
8227
8232
  var target = {};
8228
8233
  for (var prop in source)
8229
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
8234
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
8230
8235
  target[prop] = source[prop];
8231
- if (source != null && __getOwnPropSymbols$6)
8232
- for (var prop of __getOwnPropSymbols$6(source)) {
8233
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
8236
+ if (source != null && __getOwnPropSymbols$7)
8237
+ for (var prop of __getOwnPropSymbols$7(source)) {
8238
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
8234
8239
  target[prop] = source[prop];
8235
8240
  }
8236
8241
  return target;
@@ -8259,7 +8264,7 @@ const useCreateLabel = () => {
8259
8264
  const { client } = useShipEngine();
8260
8265
  return reactQuery.useMutation({
8261
8266
  mutationFn: (_a) => __async$j(void 0, null, function* () {
8262
- var _b = _a, { rateId } = _b, options = __objRest$5(_b, ["rateId"]);
8267
+ var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
8263
8268
  const result = yield client.labels.createByRateId(rateId, options);
8264
8269
  return result.data;
8265
8270
  }),
@@ -8300,17 +8305,17 @@ const useCreateRateCard = () => {
8300
8305
  });
8301
8306
  };
8302
8307
 
8303
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
8304
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
8305
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
8306
- var __objRest$4 = (source, exclude) => {
8308
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8309
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8310
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8311
+ var __objRest$5 = (source, exclude) => {
8307
8312
  var target = {};
8308
8313
  for (var prop in source)
8309
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
8314
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
8310
8315
  target[prop] = source[prop];
8311
- if (source != null && __getOwnPropSymbols$5)
8312
- for (var prop of __getOwnPropSymbols$5(source)) {
8313
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
8316
+ if (source != null && __getOwnPropSymbols$6)
8317
+ for (var prop of __getOwnPropSymbols$6(source)) {
8318
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
8314
8319
  target[prop] = source[prop];
8315
8320
  }
8316
8321
  return target;
@@ -8339,7 +8344,7 @@ const useCreateSalesOrderShipment = () => {
8339
8344
  const { client } = useShipEngine();
8340
8345
  return reactQuery.useMutation({
8341
8346
  mutationFn: (_a) => __async$h(void 0, null, function* () {
8342
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
8347
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$5(_b, ["salesOrderId"]);
8343
8348
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
8344
8349
  return result.data;
8345
8350
  }),
@@ -8351,17 +8356,17 @@ const useCreateSalesOrderShipment = () => {
8351
8356
  var __defProp$1 = Object.defineProperty;
8352
8357
  var __defProps = Object.defineProperties;
8353
8358
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8354
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
8355
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
8356
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
8359
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
8360
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
8361
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
8357
8362
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8358
8363
  var __spreadValues$1 = (a, b) => {
8359
8364
  for (var prop in b || (b = {}))
8360
- if (__hasOwnProp$4.call(b, prop))
8365
+ if (__hasOwnProp$5.call(b, prop))
8361
8366
  __defNormalProp$1(a, prop, b[prop]);
8362
- if (__getOwnPropSymbols$4)
8363
- for (var prop of __getOwnPropSymbols$4(b)) {
8364
- if (__propIsEnum$4.call(b, prop))
8367
+ if (__getOwnPropSymbols$5)
8368
+ for (var prop of __getOwnPropSymbols$5(b)) {
8369
+ if (__propIsEnum$5.call(b, prop))
8365
8370
  __defNormalProp$1(a, prop, b[prop]);
8366
8371
  }
8367
8372
  return a;
@@ -8747,6 +8752,33 @@ const useListSalesOrders = (params = {}) => {
8747
8752
  });
8748
8753
  };
8749
8754
 
8755
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
8756
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
8757
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
8758
+ var __objRest$4 = (source, exclude) => {
8759
+ var target = {};
8760
+ for (var prop in source)
8761
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
8762
+ target[prop] = source[prop];
8763
+ if (source != null && __getOwnPropSymbols$4)
8764
+ for (var prop of __getOwnPropSymbols$4(source)) {
8765
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
8766
+ target[prop] = source[prop];
8767
+ }
8768
+ return target;
8769
+ };
8770
+ const useListShipments = (_params) => {
8771
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
8772
+ const { client } = useShipEngine();
8773
+ return reactQuery.useQuery({
8774
+ enabled,
8775
+ onError,
8776
+ queryFn: () => client.shipments.list(params),
8777
+ queryKey: ["useListShipments", params],
8778
+ select: (result) => result.data
8779
+ });
8780
+ };
8781
+
8750
8782
  const useListWarehouses = (options) => {
8751
8783
  var _a;
8752
8784
  const { client } = useShipEngine();
@@ -10043,6 +10075,7 @@ exports.useListOrderSources = useListOrderSources;
10043
10075
  exports.useListRateCards = useListRateCards;
10044
10076
  exports.useListSalesOrderShipments = useListSalesOrderShipments;
10045
10077
  exports.useListSalesOrders = useListSalesOrders;
10078
+ exports.useListShipments = useListShipments;
10046
10079
  exports.useListWarehouses = useListWarehouses;
10047
10080
  exports.useLoadFonts = useLoadFonts;
10048
10081
  exports.useLoadIcons = useLoadIcons;
package/index.mjs CHANGED
@@ -2454,17 +2454,17 @@ Object.defineProperty(dist, "__esModule", { value: true });
2454
2454
  var _default = dist.default = (function () {
2455
2455
  });
2456
2456
 
2457
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2458
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2459
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2460
- var __objRest$7 = (source, exclude) => {
2457
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2458
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2459
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2460
+ var __objRest$8 = (source, exclude) => {
2461
2461
  var target = {};
2462
2462
  for (var prop in source)
2463
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
2463
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
2464
2464
  target[prop] = source[prop];
2465
- if (source != null && __getOwnPropSymbols$b)
2466
- for (var prop of __getOwnPropSymbols$b(source)) {
2467
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
2465
+ if (source != null && __getOwnPropSymbols$c)
2466
+ for (var prop of __getOwnPropSymbols$c(source)) {
2467
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
2468
2468
  target[prop] = source[prop];
2469
2469
  }
2470
2470
  return target;
@@ -2478,7 +2478,7 @@ class CodedError {
2478
2478
  this.message = message;
2479
2479
  }
2480
2480
  static fromObject(_a) {
2481
- var _b = _a, { message } = _b, options = __objRest$7(_b, ["message"]);
2481
+ var _b = _a, { message } = _b, options = __objRest$8(_b, ["message"]);
2482
2482
  return new CodedError(message, options);
2483
2483
  }
2484
2484
  }
@@ -5243,30 +5243,30 @@ const getEndUserIpAddress = () => __async$s(void 0, null, function* () {
5243
5243
  var __defProp$5 = Object.defineProperty;
5244
5244
  var __defProps$3 = Object.defineProperties;
5245
5245
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
5246
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
5247
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
5248
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
5246
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
5247
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
5248
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
5249
5249
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5250
5250
  var __spreadValues$5 = (a, b) => {
5251
5251
  for (var prop in b || (b = {}))
5252
- if (__hasOwnProp$a.call(b, prop))
5252
+ if (__hasOwnProp$b.call(b, prop))
5253
5253
  __defNormalProp$5(a, prop, b[prop]);
5254
- if (__getOwnPropSymbols$a)
5255
- for (var prop of __getOwnPropSymbols$a(b)) {
5256
- if (__propIsEnum$a.call(b, prop))
5254
+ if (__getOwnPropSymbols$b)
5255
+ for (var prop of __getOwnPropSymbols$b(b)) {
5256
+ if (__propIsEnum$b.call(b, prop))
5257
5257
  __defNormalProp$5(a, prop, b[prop]);
5258
5258
  }
5259
5259
  return a;
5260
5260
  };
5261
5261
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
5262
- var __objRest$6 = (source, exclude) => {
5262
+ var __objRest$7 = (source, exclude) => {
5263
5263
  var target = {};
5264
5264
  for (var prop in source)
5265
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
5265
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
5266
5266
  target[prop] = source[prop];
5267
- if (source != null && __getOwnPropSymbols$a)
5268
- for (var prop of __getOwnPropSymbols$a(source)) {
5269
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
5267
+ if (source != null && __getOwnPropSymbols$b)
5268
+ for (var prop of __getOwnPropSymbols$b(source)) {
5269
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
5270
5270
  target[prop] = source[prop];
5271
5271
  }
5272
5272
  return target;
@@ -5301,7 +5301,7 @@ class CarriersAPI {
5301
5301
  return this.client.get(`/v1/carriers/${carrierId}`);
5302
5302
  };
5303
5303
  this.connect = (_a) => __async$r(this, null, function* () {
5304
- var _b = _a, { carrierCode } = _b, connection = __objRest$6(_b, ["carrierCode"]);
5304
+ var _b = _a, { carrierCode } = _b, connection = __objRest$7(_b, ["carrierCode"]);
5305
5305
  const endUserIpAddress = yield getEndUserIpAddress();
5306
5306
  if (!endUserIpAddress)
5307
5307
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -7538,17 +7538,17 @@ class CustomPackagesAPI {
7538
7538
  }
7539
7539
 
7540
7540
  var __defProp$4 = Object.defineProperty;
7541
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
7542
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
7543
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
7541
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
7542
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
7543
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
7544
7544
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7545
7545
  var __spreadValues$4 = (a, b) => {
7546
7546
  for (var prop in b || (b = {}))
7547
- if (__hasOwnProp$9.call(b, prop))
7547
+ if (__hasOwnProp$a.call(b, prop))
7548
7548
  __defNormalProp$4(a, prop, b[prop]);
7549
- if (__getOwnPropSymbols$9)
7550
- for (var prop of __getOwnPropSymbols$9(b)) {
7551
- if (__propIsEnum$9.call(b, prop))
7549
+ if (__getOwnPropSymbols$a)
7550
+ for (var prop of __getOwnPropSymbols$a(b)) {
7551
+ if (__propIsEnum$a.call(b, prop))
7552
7552
  __defNormalProp$4(a, prop, b[prop]);
7553
7553
  }
7554
7554
  return a;
@@ -7691,8 +7691,10 @@ class RatesAPI {
7691
7691
  class SalesOrderShipmentsAPI {
7692
7692
  constructor(client) {
7693
7693
  this.client = client;
7694
- this.list = (params = {}) => {
7695
- return this.client.post("/v-beta/shipments/list", params);
7694
+ this.list = (body = {}, params) => {
7695
+ return this.client.post("/v-beta/shipments/list", body, {
7696
+ params
7697
+ });
7696
7698
  };
7697
7699
  this.get = (shipmentId) => {
7698
7700
  return this.client.get(`/v-beta/shipments/${shipmentId}`);
@@ -7755,6 +7757,9 @@ class ShipmentsAPI {
7755
7757
  createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
7756
7758
  );
7757
7759
  };
7760
+ this.list = (options) => {
7761
+ return this.client.get("/v1/shipments", { params: options });
7762
+ };
7758
7763
  this.create = (...shipments) => __async$p(this, null, function* () {
7759
7764
  return this.client.post("/v1/shipments", {
7760
7765
  shipments
@@ -7786,17 +7791,17 @@ class WarehousesAPI {
7786
7791
  var __defProp$3 = Object.defineProperty;
7787
7792
  var __defProps$2 = Object.defineProperties;
7788
7793
  var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
7789
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
7790
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
7791
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
7794
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
7795
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
7796
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
7792
7797
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7793
7798
  var __spreadValues$3 = (a, b) => {
7794
7799
  for (var prop in b || (b = {}))
7795
- if (__hasOwnProp$8.call(b, prop))
7800
+ if (__hasOwnProp$9.call(b, prop))
7796
7801
  __defNormalProp$3(a, prop, b[prop]);
7797
- if (__getOwnPropSymbols$8)
7798
- for (var prop of __getOwnPropSymbols$8(b)) {
7799
- if (__propIsEnum$8.call(b, prop))
7802
+ if (__getOwnPropSymbols$9)
7803
+ for (var prop of __getOwnPropSymbols$9(b)) {
7804
+ if (__propIsEnum$9.call(b, prop))
7800
7805
  __defNormalProp$3(a, prop, b[prop]);
7801
7806
  }
7802
7807
  return a;
@@ -8021,17 +8026,17 @@ const onError = (errors) => errors.forEach(console.log);
8021
8026
  var __defProp$2 = Object.defineProperty;
8022
8027
  var __defProps$1 = Object.defineProperties;
8023
8028
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
8024
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8025
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8026
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8029
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8030
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8031
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8027
8032
  var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8028
8033
  var __spreadValues$2 = (a, b) => {
8029
8034
  for (var prop in b || (b = {}))
8030
- if (__hasOwnProp$7.call(b, prop))
8035
+ if (__hasOwnProp$8.call(b, prop))
8031
8036
  __defNormalProp$2(a, prop, b[prop]);
8032
- if (__getOwnPropSymbols$7)
8033
- for (var prop of __getOwnPropSymbols$7(b)) {
8034
- if (__propIsEnum$7.call(b, prop))
8037
+ if (__getOwnPropSymbols$8)
8038
+ for (var prop of __getOwnPropSymbols$8(b)) {
8039
+ if (__propIsEnum$8.call(b, prop))
8035
8040
  __defNormalProp$2(a, prop, b[prop]);
8036
8041
  }
8037
8042
  return a;
@@ -8198,17 +8203,17 @@ const useCreateFundingSource = () => {
8198
8203
  });
8199
8204
  };
8200
8205
 
8201
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8202
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8203
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8204
- var __objRest$5 = (source, exclude) => {
8206
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8207
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8208
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8209
+ var __objRest$6 = (source, exclude) => {
8205
8210
  var target = {};
8206
8211
  for (var prop in source)
8207
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
8212
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
8208
8213
  target[prop] = source[prop];
8209
- if (source != null && __getOwnPropSymbols$6)
8210
- for (var prop of __getOwnPropSymbols$6(source)) {
8211
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
8214
+ if (source != null && __getOwnPropSymbols$7)
8215
+ for (var prop of __getOwnPropSymbols$7(source)) {
8216
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
8212
8217
  target[prop] = source[prop];
8213
8218
  }
8214
8219
  return target;
@@ -8237,7 +8242,7 @@ const useCreateLabel = () => {
8237
8242
  const { client } = useShipEngine();
8238
8243
  return useMutation({
8239
8244
  mutationFn: (_a) => __async$j(void 0, null, function* () {
8240
- var _b = _a, { rateId } = _b, options = __objRest$5(_b, ["rateId"]);
8245
+ var _b = _a, { rateId } = _b, options = __objRest$6(_b, ["rateId"]);
8241
8246
  const result = yield client.labels.createByRateId(rateId, options);
8242
8247
  return result.data;
8243
8248
  }),
@@ -8278,17 +8283,17 @@ const useCreateRateCard = () => {
8278
8283
  });
8279
8284
  };
8280
8285
 
8281
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
8282
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
8283
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
8284
- var __objRest$4 = (source, exclude) => {
8286
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8287
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8288
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8289
+ var __objRest$5 = (source, exclude) => {
8285
8290
  var target = {};
8286
8291
  for (var prop in source)
8287
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
8292
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
8288
8293
  target[prop] = source[prop];
8289
- if (source != null && __getOwnPropSymbols$5)
8290
- for (var prop of __getOwnPropSymbols$5(source)) {
8291
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
8294
+ if (source != null && __getOwnPropSymbols$6)
8295
+ for (var prop of __getOwnPropSymbols$6(source)) {
8296
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
8292
8297
  target[prop] = source[prop];
8293
8298
  }
8294
8299
  return target;
@@ -8317,7 +8322,7 @@ const useCreateSalesOrderShipment = () => {
8317
8322
  const { client } = useShipEngine();
8318
8323
  return useMutation({
8319
8324
  mutationFn: (_a) => __async$h(void 0, null, function* () {
8320
- var _b = _a, { salesOrderId } = _b, shipment = __objRest$4(_b, ["salesOrderId"]);
8325
+ var _b = _a, { salesOrderId } = _b, shipment = __objRest$5(_b, ["salesOrderId"]);
8321
8326
  const result = yield client.salesOrderShipments.create(salesOrderId, shipment);
8322
8327
  return result.data;
8323
8328
  }),
@@ -8329,17 +8334,17 @@ const useCreateSalesOrderShipment = () => {
8329
8334
  var __defProp$1 = Object.defineProperty;
8330
8335
  var __defProps = Object.defineProperties;
8331
8336
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8332
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
8333
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
8334
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
8337
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
8338
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
8339
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
8335
8340
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8336
8341
  var __spreadValues$1 = (a, b) => {
8337
8342
  for (var prop in b || (b = {}))
8338
- if (__hasOwnProp$4.call(b, prop))
8343
+ if (__hasOwnProp$5.call(b, prop))
8339
8344
  __defNormalProp$1(a, prop, b[prop]);
8340
- if (__getOwnPropSymbols$4)
8341
- for (var prop of __getOwnPropSymbols$4(b)) {
8342
- if (__propIsEnum$4.call(b, prop))
8345
+ if (__getOwnPropSymbols$5)
8346
+ for (var prop of __getOwnPropSymbols$5(b)) {
8347
+ if (__propIsEnum$5.call(b, prop))
8343
8348
  __defNormalProp$1(a, prop, b[prop]);
8344
8349
  }
8345
8350
  return a;
@@ -8725,6 +8730,33 @@ const useListSalesOrders = (params = {}) => {
8725
8730
  });
8726
8731
  };
8727
8732
 
8733
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
8734
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
8735
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
8736
+ var __objRest$4 = (source, exclude) => {
8737
+ var target = {};
8738
+ for (var prop in source)
8739
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
8740
+ target[prop] = source[prop];
8741
+ if (source != null && __getOwnPropSymbols$4)
8742
+ for (var prop of __getOwnPropSymbols$4(source)) {
8743
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
8744
+ target[prop] = source[prop];
8745
+ }
8746
+ return target;
8747
+ };
8748
+ const useListShipments = (_params) => {
8749
+ const _a = _params || {}, { enabled = true } = _a, params = __objRest$4(_a, ["enabled"]);
8750
+ const { client } = useShipEngine();
8751
+ return useQuery({
8752
+ enabled,
8753
+ onError,
8754
+ queryFn: () => client.shipments.list(params),
8755
+ queryKey: ["useListShipments", params],
8756
+ select: (result) => result.data
8757
+ });
8758
+ };
8759
+
8728
8760
  const useListWarehouses = (options) => {
8729
8761
  var _a;
8730
8762
  const { client } = useShipEngine();
@@ -9949,4 +9981,4 @@ const alchemy = {
9949
9981
  createElement
9950
9982
  };
9951
9983
 
9952
- export { AccountSettingsAPI, AddressesAPI, Alchemy, AlchemyContext, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListWarehouses, useLoadFonts, useLoadIcons, useLoadTheme, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
9984
+ export { AccountSettingsAPI, AddressesAPI, Alchemy, AlchemyContext, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, WarehousesAPI, alchemy, alchemy as default, delay, getEndUserIpAddress, isCodedError, isCodedErrors, logger, memoizedCreateCache, onError, retryUntil, useAddFunds, useAlchemy, useCalculateRates, useConnectCarrier, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateShipment, useCreateWarehouse, useDeleteWarehouse, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetInsuranceAccount, useGetLabel, useGetSalesOrder, useGetSalesOrderShipment, useGetShipment, useGetShipmentRates, useGetWalletHistory, useI18n, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListShipments, useListWarehouses, useLoadFonts, useLoadIcons, useLoadTheme, useNotifySalesOrderShipped, useParseAddress, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateSalesOrderShipment, useUpdateWarehouse, useValidateAddresses, useVoidLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {