@shipengine/alchemy 0.4.22 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +46 -62
- package/index.mjs +46 -62
- 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$
|
|
2480
|
-
var __hasOwnProp$
|
|
2481
|
-
var __propIsEnum$
|
|
2479
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
2480
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
2481
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
2482
2482
|
var __objRest$7 = (source, exclude) => {
|
|
2483
2483
|
var target = {};
|
|
2484
2484
|
for (var prop in source)
|
|
2485
|
-
if (__hasOwnProp$
|
|
2485
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2486
2486
|
target[prop] = source[prop];
|
|
2487
|
-
if (source != null && __getOwnPropSymbols$
|
|
2488
|
-
for (var prop of __getOwnPropSymbols$
|
|
2489
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2487
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
2488
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
2489
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
2490
2490
|
target[prop] = source[prop];
|
|
2491
2491
|
}
|
|
2492
2492
|
return target;
|
|
@@ -5262,21 +5262,21 @@ const getEndUserIpAddress = () => __async$q(void 0, null, function* () {
|
|
|
5262
5262
|
}
|
|
5263
5263
|
});
|
|
5264
5264
|
|
|
5265
|
-
var __defProp$
|
|
5265
|
+
var __defProp$4 = Object.defineProperty;
|
|
5266
5266
|
var __defProps$2 = Object.defineProperties;
|
|
5267
5267
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
5268
|
-
var __getOwnPropSymbols$
|
|
5269
|
-
var __hasOwnProp$
|
|
5270
|
-
var __propIsEnum$
|
|
5271
|
-
var __defNormalProp$
|
|
5272
|
-
var __spreadValues$
|
|
5268
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
5269
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
5270
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
5271
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5272
|
+
var __spreadValues$4 = (a, b) => {
|
|
5273
5273
|
for (var prop in b || (b = {}))
|
|
5274
|
-
if (__hasOwnProp$
|
|
5275
|
-
__defNormalProp$
|
|
5276
|
-
if (__getOwnPropSymbols$
|
|
5277
|
-
for (var prop of __getOwnPropSymbols$
|
|
5278
|
-
if (__propIsEnum$
|
|
5279
|
-
__defNormalProp$
|
|
5274
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
5275
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5276
|
+
if (__getOwnPropSymbols$9)
|
|
5277
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
5278
|
+
if (__propIsEnum$9.call(b, prop))
|
|
5279
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5280
5280
|
}
|
|
5281
5281
|
return a;
|
|
5282
5282
|
};
|
|
@@ -5284,11 +5284,11 @@ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
|
5284
5284
|
var __objRest$6 = (source, exclude) => {
|
|
5285
5285
|
var target = {};
|
|
5286
5286
|
for (var prop in source)
|
|
5287
|
-
if (__hasOwnProp$
|
|
5287
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5288
5288
|
target[prop] = source[prop];
|
|
5289
|
-
if (source != null && __getOwnPropSymbols$
|
|
5290
|
-
for (var prop of __getOwnPropSymbols$
|
|
5291
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5289
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
5290
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
5291
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
5292
5292
|
target[prop] = source[prop];
|
|
5293
5293
|
}
|
|
5294
5294
|
return target;
|
|
@@ -5327,7 +5327,7 @@ class CarriersAPI {
|
|
|
5327
5327
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5328
5328
|
if (!endUserIpAddress)
|
|
5329
5329
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5330
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$
|
|
5330
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$4({}, connection), {
|
|
5331
5331
|
endUserIpAddress
|
|
5332
5332
|
}));
|
|
5333
5333
|
});
|
|
@@ -7545,19 +7545,19 @@ class CustomPackagesAPI {
|
|
|
7545
7545
|
}
|
|
7546
7546
|
}
|
|
7547
7547
|
|
|
7548
|
-
var __defProp$
|
|
7549
|
-
var __getOwnPropSymbols$
|
|
7550
|
-
var __hasOwnProp$
|
|
7551
|
-
var __propIsEnum$
|
|
7552
|
-
var __defNormalProp$
|
|
7553
|
-
var __spreadValues$
|
|
7548
|
+
var __defProp$3 = Object.defineProperty;
|
|
7549
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7550
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7551
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7552
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7553
|
+
var __spreadValues$3 = (a, b) => {
|
|
7554
7554
|
for (var prop in b || (b = {}))
|
|
7555
|
-
if (__hasOwnProp$
|
|
7556
|
-
__defNormalProp$
|
|
7557
|
-
if (__getOwnPropSymbols$
|
|
7558
|
-
for (var prop of __getOwnPropSymbols$
|
|
7559
|
-
if (__propIsEnum$
|
|
7560
|
-
__defNormalProp$
|
|
7555
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
7556
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7557
|
+
if (__getOwnPropSymbols$8)
|
|
7558
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7559
|
+
if (__propIsEnum$8.call(b, prop))
|
|
7560
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7561
7561
|
}
|
|
7562
7562
|
return a;
|
|
7563
7563
|
};
|
|
@@ -7594,7 +7594,7 @@ class FundingSourcesAPI {
|
|
|
7594
7594
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7595
7595
|
if (!endUserIpAddress)
|
|
7596
7596
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7597
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
7597
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$3({
|
|
7598
7598
|
endUserIpAddress
|
|
7599
7599
|
}, fundingSource));
|
|
7600
7600
|
});
|
|
@@ -7611,7 +7611,7 @@ class FundingSourcesAPI {
|
|
|
7611
7611
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7612
7612
|
if (!endUserIpAddress)
|
|
7613
7613
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7614
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
7614
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$3({
|
|
7615
7615
|
endUserIpAddress
|
|
7616
7616
|
}, carrier));
|
|
7617
7617
|
});
|
|
@@ -7715,22 +7715,6 @@ class SalesOrdersAPI {
|
|
|
7715
7715
|
}
|
|
7716
7716
|
}
|
|
7717
7717
|
|
|
7718
|
-
var __defProp$3 = Object.defineProperty;
|
|
7719
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7720
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7721
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7722
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7723
|
-
var __spreadValues$3 = (a, b) => {
|
|
7724
|
-
for (var prop in b || (b = {}))
|
|
7725
|
-
if (__hasOwnProp$8.call(b, prop))
|
|
7726
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
7727
|
-
if (__getOwnPropSymbols$8)
|
|
7728
|
-
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7729
|
-
if (__propIsEnum$8.call(b, prop))
|
|
7730
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
7731
|
-
}
|
|
7732
|
-
return a;
|
|
7733
|
-
};
|
|
7734
7718
|
var __async$n = (__this, __arguments, generator) => {
|
|
7735
7719
|
return new Promise((resolve, reject) => {
|
|
7736
7720
|
var fulfilled = (value) => {
|
|
@@ -7760,11 +7744,9 @@ class ShipmentsAPI {
|
|
|
7760
7744
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
7761
7745
|
);
|
|
7762
7746
|
};
|
|
7763
|
-
this.create = (
|
|
7747
|
+
this.create = (...shipments) => __async$n(this, null, function* () {
|
|
7764
7748
|
return this.client.post("/v1/shipments", {
|
|
7765
|
-
shipments
|
|
7766
|
-
__spreadValues$3({}, shipment)
|
|
7767
|
-
]
|
|
7749
|
+
shipments
|
|
7768
7750
|
});
|
|
7769
7751
|
});
|
|
7770
7752
|
this.client = client;
|
|
@@ -8480,10 +8462,10 @@ const useGetShipment = (shipmentId) => {
|
|
|
8480
8462
|
enabled: shipmentId !== void 0,
|
|
8481
8463
|
onError,
|
|
8482
8464
|
queryFn: () => {
|
|
8483
|
-
if (shipmentId) {
|
|
8484
|
-
return
|
|
8465
|
+
if (!shipmentId) {
|
|
8466
|
+
return Promise.reject(new Error("shipmentId is required"));
|
|
8485
8467
|
}
|
|
8486
|
-
return
|
|
8468
|
+
return client.salesOrderShipments.get(shipmentId);
|
|
8487
8469
|
},
|
|
8488
8470
|
queryKey: ["useGetShipment", shipmentId],
|
|
8489
8471
|
select: (result) => result.data
|
|
@@ -8581,9 +8563,11 @@ const useListSalesOrders = (params = {}) => {
|
|
|
8581
8563
|
});
|
|
8582
8564
|
};
|
|
8583
8565
|
|
|
8584
|
-
const useListWarehouses = () => {
|
|
8566
|
+
const useListWarehouses = (options) => {
|
|
8567
|
+
var _a;
|
|
8585
8568
|
const { client } = useShipEngine();
|
|
8586
8569
|
return reactQuery.useQuery({
|
|
8570
|
+
enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
|
|
8587
8571
|
onError,
|
|
8588
8572
|
queryFn: () => client.warehouses.list(),
|
|
8589
8573
|
queryKey: ["useListWarehouses"],
|
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$
|
|
2458
|
-
var __hasOwnProp$
|
|
2459
|
-
var __propIsEnum$
|
|
2457
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
2458
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
2459
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
2460
2460
|
var __objRest$7 = (source, exclude) => {
|
|
2461
2461
|
var target = {};
|
|
2462
2462
|
for (var prop in source)
|
|
2463
|
-
if (__hasOwnProp$
|
|
2463
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2464
2464
|
target[prop] = source[prop];
|
|
2465
|
-
if (source != null && __getOwnPropSymbols$
|
|
2466
|
-
for (var prop of __getOwnPropSymbols$
|
|
2467
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2465
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
2466
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
2467
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
2468
2468
|
target[prop] = source[prop];
|
|
2469
2469
|
}
|
|
2470
2470
|
return target;
|
|
@@ -5240,21 +5240,21 @@ const getEndUserIpAddress = () => __async$q(void 0, null, function* () {
|
|
|
5240
5240
|
}
|
|
5241
5241
|
});
|
|
5242
5242
|
|
|
5243
|
-
var __defProp$
|
|
5243
|
+
var __defProp$4 = Object.defineProperty;
|
|
5244
5244
|
var __defProps$2 = Object.defineProperties;
|
|
5245
5245
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
5246
|
-
var __getOwnPropSymbols$
|
|
5247
|
-
var __hasOwnProp$
|
|
5248
|
-
var __propIsEnum$
|
|
5249
|
-
var __defNormalProp$
|
|
5250
|
-
var __spreadValues$
|
|
5246
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
5247
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
5248
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
5249
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5250
|
+
var __spreadValues$4 = (a, b) => {
|
|
5251
5251
|
for (var prop in b || (b = {}))
|
|
5252
|
-
if (__hasOwnProp$
|
|
5253
|
-
__defNormalProp$
|
|
5254
|
-
if (__getOwnPropSymbols$
|
|
5255
|
-
for (var prop of __getOwnPropSymbols$
|
|
5256
|
-
if (__propIsEnum$
|
|
5257
|
-
__defNormalProp$
|
|
5252
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
5253
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5254
|
+
if (__getOwnPropSymbols$9)
|
|
5255
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
5256
|
+
if (__propIsEnum$9.call(b, prop))
|
|
5257
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5258
5258
|
}
|
|
5259
5259
|
return a;
|
|
5260
5260
|
};
|
|
@@ -5262,11 +5262,11 @@ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
|
5262
5262
|
var __objRest$6 = (source, exclude) => {
|
|
5263
5263
|
var target = {};
|
|
5264
5264
|
for (var prop in source)
|
|
5265
|
-
if (__hasOwnProp$
|
|
5265
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5266
5266
|
target[prop] = source[prop];
|
|
5267
|
-
if (source != null && __getOwnPropSymbols$
|
|
5268
|
-
for (var prop of __getOwnPropSymbols$
|
|
5269
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5267
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
5268
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
5269
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
5270
5270
|
target[prop] = source[prop];
|
|
5271
5271
|
}
|
|
5272
5272
|
return target;
|
|
@@ -5305,7 +5305,7 @@ class CarriersAPI {
|
|
|
5305
5305
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5306
5306
|
if (!endUserIpAddress)
|
|
5307
5307
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5308
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$
|
|
5308
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$4({}, connection), {
|
|
5309
5309
|
endUserIpAddress
|
|
5310
5310
|
}));
|
|
5311
5311
|
});
|
|
@@ -7523,19 +7523,19 @@ class CustomPackagesAPI {
|
|
|
7523
7523
|
}
|
|
7524
7524
|
}
|
|
7525
7525
|
|
|
7526
|
-
var __defProp$
|
|
7527
|
-
var __getOwnPropSymbols$
|
|
7528
|
-
var __hasOwnProp$
|
|
7529
|
-
var __propIsEnum$
|
|
7530
|
-
var __defNormalProp$
|
|
7531
|
-
var __spreadValues$
|
|
7526
|
+
var __defProp$3 = Object.defineProperty;
|
|
7527
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7528
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7529
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7530
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7531
|
+
var __spreadValues$3 = (a, b) => {
|
|
7532
7532
|
for (var prop in b || (b = {}))
|
|
7533
|
-
if (__hasOwnProp$
|
|
7534
|
-
__defNormalProp$
|
|
7535
|
-
if (__getOwnPropSymbols$
|
|
7536
|
-
for (var prop of __getOwnPropSymbols$
|
|
7537
|
-
if (__propIsEnum$
|
|
7538
|
-
__defNormalProp$
|
|
7533
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
7534
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7535
|
+
if (__getOwnPropSymbols$8)
|
|
7536
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7537
|
+
if (__propIsEnum$8.call(b, prop))
|
|
7538
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7539
7539
|
}
|
|
7540
7540
|
return a;
|
|
7541
7541
|
};
|
|
@@ -7572,7 +7572,7 @@ class FundingSourcesAPI {
|
|
|
7572
7572
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7573
7573
|
if (!endUserIpAddress)
|
|
7574
7574
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7575
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
7575
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$3({
|
|
7576
7576
|
endUserIpAddress
|
|
7577
7577
|
}, fundingSource));
|
|
7578
7578
|
});
|
|
@@ -7589,7 +7589,7 @@ class FundingSourcesAPI {
|
|
|
7589
7589
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
7590
7590
|
if (!endUserIpAddress)
|
|
7591
7591
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
7592
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
7592
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$3({
|
|
7593
7593
|
endUserIpAddress
|
|
7594
7594
|
}, carrier));
|
|
7595
7595
|
});
|
|
@@ -7693,22 +7693,6 @@ class SalesOrdersAPI {
|
|
|
7693
7693
|
}
|
|
7694
7694
|
}
|
|
7695
7695
|
|
|
7696
|
-
var __defProp$3 = Object.defineProperty;
|
|
7697
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7698
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7699
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7700
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7701
|
-
var __spreadValues$3 = (a, b) => {
|
|
7702
|
-
for (var prop in b || (b = {}))
|
|
7703
|
-
if (__hasOwnProp$8.call(b, prop))
|
|
7704
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
7705
|
-
if (__getOwnPropSymbols$8)
|
|
7706
|
-
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7707
|
-
if (__propIsEnum$8.call(b, prop))
|
|
7708
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
7709
|
-
}
|
|
7710
|
-
return a;
|
|
7711
|
-
};
|
|
7712
7696
|
var __async$n = (__this, __arguments, generator) => {
|
|
7713
7697
|
return new Promise((resolve, reject) => {
|
|
7714
7698
|
var fulfilled = (value) => {
|
|
@@ -7738,11 +7722,9 @@ class ShipmentsAPI {
|
|
|
7738
7722
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
7739
7723
|
);
|
|
7740
7724
|
};
|
|
7741
|
-
this.create = (
|
|
7725
|
+
this.create = (...shipments) => __async$n(this, null, function* () {
|
|
7742
7726
|
return this.client.post("/v1/shipments", {
|
|
7743
|
-
shipments
|
|
7744
|
-
__spreadValues$3({}, shipment)
|
|
7745
|
-
]
|
|
7727
|
+
shipments
|
|
7746
7728
|
});
|
|
7747
7729
|
});
|
|
7748
7730
|
this.client = client;
|
|
@@ -8458,10 +8440,10 @@ const useGetShipment = (shipmentId) => {
|
|
|
8458
8440
|
enabled: shipmentId !== void 0,
|
|
8459
8441
|
onError,
|
|
8460
8442
|
queryFn: () => {
|
|
8461
|
-
if (shipmentId) {
|
|
8462
|
-
return
|
|
8443
|
+
if (!shipmentId) {
|
|
8444
|
+
return Promise.reject(new Error("shipmentId is required"));
|
|
8463
8445
|
}
|
|
8464
|
-
return
|
|
8446
|
+
return client.salesOrderShipments.get(shipmentId);
|
|
8465
8447
|
},
|
|
8466
8448
|
queryKey: ["useGetShipment", shipmentId],
|
|
8467
8449
|
select: (result) => result.data
|
|
@@ -8559,9 +8541,11 @@ const useListSalesOrders = (params = {}) => {
|
|
|
8559
8541
|
});
|
|
8560
8542
|
};
|
|
8561
8543
|
|
|
8562
|
-
const useListWarehouses = () => {
|
|
8544
|
+
const useListWarehouses = (options) => {
|
|
8545
|
+
var _a;
|
|
8563
8546
|
const { client } = useShipEngine();
|
|
8564
8547
|
return useQuery({
|
|
8548
|
+
enabled: (_a = options == null ? void 0 : options.enabled) != null ? _a : true,
|
|
8565
8549
|
onError,
|
|
8566
8550
|
queryFn: () => client.warehouses.list(),
|
|
8567
8551
|
queryKey: ["useListWarehouses"],
|