@shipengine/alchemy 0.4.15 → 0.4.16
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 +66 -27
- package/index.mjs +66 -27
- 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;
|
|
@@ -5230,21 +5230,21 @@ var ipaddr = {
|
|
|
5230
5230
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
5231
5231
|
const isCodedError = (err) => !!err.errorCode;
|
|
5232
5232
|
|
|
5233
|
-
var __defProp$
|
|
5233
|
+
var __defProp$4 = Object.defineProperty;
|
|
5234
5234
|
var __defProps$2 = Object.defineProperties;
|
|
5235
5235
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
5236
|
-
var __getOwnPropSymbols$
|
|
5237
|
-
var __hasOwnProp$
|
|
5238
|
-
var __propIsEnum$
|
|
5239
|
-
var __defNormalProp$
|
|
5240
|
-
var __spreadValues$
|
|
5236
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
5237
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
5238
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
5239
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5240
|
+
var __spreadValues$4 = (a, b) => {
|
|
5241
5241
|
for (var prop in b || (b = {}))
|
|
5242
|
-
if (__hasOwnProp$
|
|
5243
|
-
__defNormalProp$
|
|
5244
|
-
if (__getOwnPropSymbols$
|
|
5245
|
-
for (var prop of __getOwnPropSymbols$
|
|
5246
|
-
if (__propIsEnum$
|
|
5247
|
-
__defNormalProp$
|
|
5242
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
5243
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5244
|
+
if (__getOwnPropSymbols$9)
|
|
5245
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
5246
|
+
if (__propIsEnum$9.call(b, prop))
|
|
5247
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5248
5248
|
}
|
|
5249
5249
|
return a;
|
|
5250
5250
|
};
|
|
@@ -5252,16 +5252,16 @@ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
|
5252
5252
|
var __objRest$6 = (source, exclude) => {
|
|
5253
5253
|
var target = {};
|
|
5254
5254
|
for (var prop in source)
|
|
5255
|
-
if (__hasOwnProp$
|
|
5255
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5256
5256
|
target[prop] = source[prop];
|
|
5257
|
-
if (source != null && __getOwnPropSymbols$
|
|
5258
|
-
for (var prop of __getOwnPropSymbols$
|
|
5259
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5257
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
5258
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
5259
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
5260
5260
|
target[prop] = source[prop];
|
|
5261
5261
|
}
|
|
5262
5262
|
return target;
|
|
5263
5263
|
};
|
|
5264
|
-
var __async$
|
|
5264
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
5265
5265
|
return new Promise((resolve, reject) => {
|
|
5266
5266
|
var fulfilled = (value) => {
|
|
5267
5267
|
try {
|
|
@@ -5281,7 +5281,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
5281
5281
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5282
5282
|
});
|
|
5283
5283
|
};
|
|
5284
|
-
const getEndUserIpAddress = () => __async$
|
|
5284
|
+
const getEndUserIpAddress = () => __async$m(void 0, null, function* () {
|
|
5285
5285
|
try {
|
|
5286
5286
|
const response = yield axios.get("https://api.ipify.org/?format=json");
|
|
5287
5287
|
if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
|
|
@@ -5301,12 +5301,12 @@ class CarriersAPI {
|
|
|
5301
5301
|
this.get = (carrierId) => {
|
|
5302
5302
|
return this.client.get(`/v1/carriers/${carrierId}`);
|
|
5303
5303
|
};
|
|
5304
|
-
this.connect = (_a) => __async$
|
|
5304
|
+
this.connect = (_a) => __async$m(this, null, function* () {
|
|
5305
5305
|
var _b = _a, { carrierCode } = _b, connection = __objRest$6(_b, ["carrierCode"]);
|
|
5306
5306
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5307
5307
|
if (!endUserIpAddress)
|
|
5308
5308
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5309
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$
|
|
5309
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$4({}, connection), {
|
|
5310
5310
|
endUserIpAddress
|
|
5311
5311
|
}));
|
|
5312
5312
|
});
|
|
@@ -7620,6 +7620,42 @@ class SalesOrdersAPI {
|
|
|
7620
7620
|
}
|
|
7621
7621
|
}
|
|
7622
7622
|
|
|
7623
|
+
var __defProp$3 = Object.defineProperty;
|
|
7624
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7625
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7626
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7627
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7628
|
+
var __spreadValues$3 = (a, b) => {
|
|
7629
|
+
for (var prop in b || (b = {}))
|
|
7630
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
7631
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7632
|
+
if (__getOwnPropSymbols$8)
|
|
7633
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7634
|
+
if (__propIsEnum$8.call(b, prop))
|
|
7635
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7636
|
+
}
|
|
7637
|
+
return a;
|
|
7638
|
+
};
|
|
7639
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
7640
|
+
return new Promise((resolve, reject) => {
|
|
7641
|
+
var fulfilled = (value) => {
|
|
7642
|
+
try {
|
|
7643
|
+
step(generator.next(value));
|
|
7644
|
+
} catch (e) {
|
|
7645
|
+
reject(e);
|
|
7646
|
+
}
|
|
7647
|
+
};
|
|
7648
|
+
var rejected = (value) => {
|
|
7649
|
+
try {
|
|
7650
|
+
step(generator.throw(value));
|
|
7651
|
+
} catch (e) {
|
|
7652
|
+
reject(e);
|
|
7653
|
+
}
|
|
7654
|
+
};
|
|
7655
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
7656
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
7657
|
+
});
|
|
7658
|
+
};
|
|
7623
7659
|
class ShipmentsAPI {
|
|
7624
7660
|
constructor(client) {
|
|
7625
7661
|
this.client = client;
|
|
@@ -7629,6 +7665,9 @@ class ShipmentsAPI {
|
|
|
7629
7665
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
7630
7666
|
);
|
|
7631
7667
|
};
|
|
7668
|
+
this.create = (shipment) => __async$l(this, null, function* () {
|
|
7669
|
+
return this.client.post("/v1/shipments", __spreadValues$3({}, shipment));
|
|
7670
|
+
});
|
|
7632
7671
|
this.client = client;
|
|
7633
7672
|
}
|
|
7634
7673
|
}
|
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;
|
|
@@ -5208,21 +5208,21 @@ var ipaddr = {
|
|
|
5208
5208
|
const isCodedErrors = (errs) => Array.isArray(errs) && errs.every((err) => isCodedError(err));
|
|
5209
5209
|
const isCodedError = (err) => !!err.errorCode;
|
|
5210
5210
|
|
|
5211
|
-
var __defProp$
|
|
5211
|
+
var __defProp$4 = Object.defineProperty;
|
|
5212
5212
|
var __defProps$2 = Object.defineProperties;
|
|
5213
5213
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
5214
|
-
var __getOwnPropSymbols$
|
|
5215
|
-
var __hasOwnProp$
|
|
5216
|
-
var __propIsEnum$
|
|
5217
|
-
var __defNormalProp$
|
|
5218
|
-
var __spreadValues$
|
|
5214
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
5215
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
5216
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
5217
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5218
|
+
var __spreadValues$4 = (a, b) => {
|
|
5219
5219
|
for (var prop in b || (b = {}))
|
|
5220
|
-
if (__hasOwnProp$
|
|
5221
|
-
__defNormalProp$
|
|
5222
|
-
if (__getOwnPropSymbols$
|
|
5223
|
-
for (var prop of __getOwnPropSymbols$
|
|
5224
|
-
if (__propIsEnum$
|
|
5225
|
-
__defNormalProp$
|
|
5220
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
5221
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5222
|
+
if (__getOwnPropSymbols$9)
|
|
5223
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
5224
|
+
if (__propIsEnum$9.call(b, prop))
|
|
5225
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
5226
5226
|
}
|
|
5227
5227
|
return a;
|
|
5228
5228
|
};
|
|
@@ -5230,16 +5230,16 @@ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
|
5230
5230
|
var __objRest$6 = (source, exclude) => {
|
|
5231
5231
|
var target = {};
|
|
5232
5232
|
for (var prop in source)
|
|
5233
|
-
if (__hasOwnProp$
|
|
5233
|
+
if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
5234
5234
|
target[prop] = source[prop];
|
|
5235
|
-
if (source != null && __getOwnPropSymbols$
|
|
5236
|
-
for (var prop of __getOwnPropSymbols$
|
|
5237
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
5235
|
+
if (source != null && __getOwnPropSymbols$9)
|
|
5236
|
+
for (var prop of __getOwnPropSymbols$9(source)) {
|
|
5237
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
|
|
5238
5238
|
target[prop] = source[prop];
|
|
5239
5239
|
}
|
|
5240
5240
|
return target;
|
|
5241
5241
|
};
|
|
5242
|
-
var __async$
|
|
5242
|
+
var __async$m = (__this, __arguments, generator) => {
|
|
5243
5243
|
return new Promise((resolve, reject) => {
|
|
5244
5244
|
var fulfilled = (value) => {
|
|
5245
5245
|
try {
|
|
@@ -5259,7 +5259,7 @@ var __async$l = (__this, __arguments, generator) => {
|
|
|
5259
5259
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
5260
5260
|
});
|
|
5261
5261
|
};
|
|
5262
|
-
const getEndUserIpAddress = () => __async$
|
|
5262
|
+
const getEndUserIpAddress = () => __async$m(void 0, null, function* () {
|
|
5263
5263
|
try {
|
|
5264
5264
|
const response = yield axios.get("https://api.ipify.org/?format=json");
|
|
5265
5265
|
if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
|
|
@@ -5279,12 +5279,12 @@ class CarriersAPI {
|
|
|
5279
5279
|
this.get = (carrierId) => {
|
|
5280
5280
|
return this.client.get(`/v1/carriers/${carrierId}`);
|
|
5281
5281
|
};
|
|
5282
|
-
this.connect = (_a) => __async$
|
|
5282
|
+
this.connect = (_a) => __async$m(this, null, function* () {
|
|
5283
5283
|
var _b = _a, { carrierCode } = _b, connection = __objRest$6(_b, ["carrierCode"]);
|
|
5284
5284
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5285
5285
|
if (!endUserIpAddress)
|
|
5286
5286
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5287
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$
|
|
5287
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$2(__spreadValues$4({}, connection), {
|
|
5288
5288
|
endUserIpAddress
|
|
5289
5289
|
}));
|
|
5290
5290
|
});
|
|
@@ -7598,6 +7598,42 @@ class SalesOrdersAPI {
|
|
|
7598
7598
|
}
|
|
7599
7599
|
}
|
|
7600
7600
|
|
|
7601
|
+
var __defProp$3 = Object.defineProperty;
|
|
7602
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
7603
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
7604
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
7605
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7606
|
+
var __spreadValues$3 = (a, b) => {
|
|
7607
|
+
for (var prop in b || (b = {}))
|
|
7608
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
7609
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7610
|
+
if (__getOwnPropSymbols$8)
|
|
7611
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
7612
|
+
if (__propIsEnum$8.call(b, prop))
|
|
7613
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
7614
|
+
}
|
|
7615
|
+
return a;
|
|
7616
|
+
};
|
|
7617
|
+
var __async$l = (__this, __arguments, generator) => {
|
|
7618
|
+
return new Promise((resolve, reject) => {
|
|
7619
|
+
var fulfilled = (value) => {
|
|
7620
|
+
try {
|
|
7621
|
+
step(generator.next(value));
|
|
7622
|
+
} catch (e) {
|
|
7623
|
+
reject(e);
|
|
7624
|
+
}
|
|
7625
|
+
};
|
|
7626
|
+
var rejected = (value) => {
|
|
7627
|
+
try {
|
|
7628
|
+
step(generator.throw(value));
|
|
7629
|
+
} catch (e) {
|
|
7630
|
+
reject(e);
|
|
7631
|
+
}
|
|
7632
|
+
};
|
|
7633
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
7634
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
7635
|
+
});
|
|
7636
|
+
};
|
|
7601
7637
|
class ShipmentsAPI {
|
|
7602
7638
|
constructor(client) {
|
|
7603
7639
|
this.client = client;
|
|
@@ -7607,6 +7643,9 @@ class ShipmentsAPI {
|
|
|
7607
7643
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
7608
7644
|
);
|
|
7609
7645
|
};
|
|
7646
|
+
this.create = (shipment) => __async$l(this, null, function* () {
|
|
7647
|
+
return this.client.post("/v1/shipments", __spreadValues$3({}, shipment));
|
|
7648
|
+
});
|
|
7610
7649
|
this.client = client;
|
|
7611
7650
|
}
|
|
7612
7651
|
}
|