@shipengine/js-api 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +56 -58
- package/index.mjs +56 -59
- package/package.json +1 -1
- package/rate-cards/api.d.ts +9 -0
- package/rate-cards/index.d.ts +2 -0
- package/rate-cards/types.d.ts +21 -0
- package/shipments/api.d.ts +3 -2
- package/types.d.ts +1 -0
package/client.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { FundingSourcesAPI } from "./funding-sources";
|
|
|
7
7
|
import { InsuranceAPI } from "./insurance";
|
|
8
8
|
import { LabelsAPI } from "./labels";
|
|
9
9
|
import { OrderSourcesAPI } from "./order-sources";
|
|
10
|
+
import { RateCardsAPI } from "./rate-cards";
|
|
10
11
|
import { RatesAPI } from "./rates";
|
|
11
12
|
import { SalesOrderShipmentsAPI } from "./sales-order-shipments";
|
|
12
13
|
import { SalesOrdersAPI } from "./sales-orders";
|
|
@@ -30,6 +31,7 @@ export declare class ShipEngineAPI {
|
|
|
30
31
|
get insurance(): InsuranceAPI;
|
|
31
32
|
get labels(): LabelsAPI;
|
|
32
33
|
get orderSources(): OrderSourcesAPI;
|
|
34
|
+
get rateCards(): RateCardsAPI;
|
|
33
35
|
get rates(): RatesAPI;
|
|
34
36
|
get salesOrderShipments(): SalesOrderShipmentsAPI;
|
|
35
37
|
get salesOrders(): SalesOrdersAPI;
|
package/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./labels";
|
|
|
12
12
|
export * from "./order-sources";
|
|
13
13
|
export * from "./payments";
|
|
14
14
|
export * from "./rates";
|
|
15
|
+
export * from "./rate-cards";
|
|
15
16
|
export * from "./relay-points";
|
|
16
17
|
export * from "./resources";
|
|
17
18
|
export * from "./sales-order-shipments";
|
package/index.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
var __getOwnPropSymbols$
|
|
6
|
-
var __hasOwnProp$
|
|
7
|
-
var __propIsEnum$
|
|
5
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
8
8
|
var __objRest$1 = (source, exclude) => {
|
|
9
9
|
var target = {};
|
|
10
10
|
for (var prop in source)
|
|
11
|
-
if (__hasOwnProp$
|
|
11
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
12
12
|
target[prop] = source[prop];
|
|
13
|
-
if (source != null && __getOwnPropSymbols$
|
|
14
|
-
for (var prop of __getOwnPropSymbols$
|
|
15
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
13
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
14
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
15
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
16
16
|
target[prop] = source[prop];
|
|
17
17
|
}
|
|
18
18
|
return target;
|
|
@@ -2822,21 +2822,21 @@ const getEndUserIpAddress = () => __async$4(void 0, null, function* () {
|
|
|
2822
2822
|
}
|
|
2823
2823
|
});
|
|
2824
2824
|
|
|
2825
|
-
var __defProp$
|
|
2825
|
+
var __defProp$2 = Object.defineProperty;
|
|
2826
2826
|
var __defProps$1 = Object.defineProperties;
|
|
2827
2827
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
2828
|
-
var __getOwnPropSymbols$
|
|
2829
|
-
var __hasOwnProp$
|
|
2830
|
-
var __propIsEnum$
|
|
2831
|
-
var __defNormalProp$
|
|
2832
|
-
var __spreadValues$
|
|
2828
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
2829
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
2830
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
2831
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2832
|
+
var __spreadValues$2 = (a, b) => {
|
|
2833
2833
|
for (var prop in b || (b = {}))
|
|
2834
|
-
if (__hasOwnProp$
|
|
2835
|
-
__defNormalProp$
|
|
2836
|
-
if (__getOwnPropSymbols$
|
|
2837
|
-
for (var prop of __getOwnPropSymbols$
|
|
2838
|
-
if (__propIsEnum$
|
|
2839
|
-
__defNormalProp$
|
|
2834
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
2835
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
2836
|
+
if (__getOwnPropSymbols$2)
|
|
2837
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
2838
|
+
if (__propIsEnum$2.call(b, prop))
|
|
2839
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
2840
2840
|
}
|
|
2841
2841
|
return a;
|
|
2842
2842
|
};
|
|
@@ -2844,11 +2844,11 @@ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
|
2844
2844
|
var __objRest = (source, exclude) => {
|
|
2845
2845
|
var target = {};
|
|
2846
2846
|
for (var prop in source)
|
|
2847
|
-
if (__hasOwnProp$
|
|
2847
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2848
2848
|
target[prop] = source[prop];
|
|
2849
|
-
if (source != null && __getOwnPropSymbols$
|
|
2850
|
-
for (var prop of __getOwnPropSymbols$
|
|
2851
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2849
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
2850
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
2851
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
2852
2852
|
target[prop] = source[prop];
|
|
2853
2853
|
}
|
|
2854
2854
|
return target;
|
|
@@ -2887,7 +2887,7 @@ class CarriersAPI {
|
|
|
2887
2887
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
2888
2888
|
if (!endUserIpAddress)
|
|
2889
2889
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
2890
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$1(__spreadValues$
|
|
2890
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$1(__spreadValues$2({}, connection), {
|
|
2891
2891
|
endUserIpAddress
|
|
2892
2892
|
}));
|
|
2893
2893
|
});
|
|
@@ -5105,19 +5105,19 @@ class CustomPackagesAPI {
|
|
|
5105
5105
|
}
|
|
5106
5106
|
}
|
|
5107
5107
|
|
|
5108
|
-
var __defProp$
|
|
5109
|
-
var __getOwnPropSymbols$
|
|
5110
|
-
var __hasOwnProp$
|
|
5111
|
-
var __propIsEnum$
|
|
5112
|
-
var __defNormalProp$
|
|
5113
|
-
var __spreadValues$
|
|
5108
|
+
var __defProp$1 = Object.defineProperty;
|
|
5109
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5110
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5111
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
5112
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5113
|
+
var __spreadValues$1 = (a, b) => {
|
|
5114
5114
|
for (var prop in b || (b = {}))
|
|
5115
|
-
if (__hasOwnProp$
|
|
5116
|
-
__defNormalProp$
|
|
5117
|
-
if (__getOwnPropSymbols$
|
|
5118
|
-
for (var prop of __getOwnPropSymbols$
|
|
5119
|
-
if (__propIsEnum$
|
|
5120
|
-
__defNormalProp$
|
|
5115
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
5116
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5117
|
+
if (__getOwnPropSymbols$1)
|
|
5118
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
5119
|
+
if (__propIsEnum$1.call(b, prop))
|
|
5120
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5121
5121
|
}
|
|
5122
5122
|
return a;
|
|
5123
5123
|
};
|
|
@@ -5154,7 +5154,7 @@ class FundingSourcesAPI {
|
|
|
5154
5154
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5155
5155
|
if (!endUserIpAddress)
|
|
5156
5156
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5157
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
5157
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$1({
|
|
5158
5158
|
endUserIpAddress
|
|
5159
5159
|
}, fundingSource));
|
|
5160
5160
|
});
|
|
@@ -5171,7 +5171,7 @@ class FundingSourcesAPI {
|
|
|
5171
5171
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5172
5172
|
if (!endUserIpAddress)
|
|
5173
5173
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5174
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
5174
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$1({
|
|
5175
5175
|
endUserIpAddress
|
|
5176
5176
|
}, carrier));
|
|
5177
5177
|
});
|
|
@@ -5224,6 +5224,18 @@ class OrderSourcesAPI {
|
|
|
5224
5224
|
}
|
|
5225
5225
|
}
|
|
5226
5226
|
|
|
5227
|
+
class RateCardsAPI {
|
|
5228
|
+
constructor(client) {
|
|
5229
|
+
this.client = client;
|
|
5230
|
+
this.list = (carrierIds) => {
|
|
5231
|
+
return this.client.get(
|
|
5232
|
+
`/v1/rate-cards?carrier_ids=${carrierIds.toString()}`
|
|
5233
|
+
);
|
|
5234
|
+
};
|
|
5235
|
+
this.client = client;
|
|
5236
|
+
}
|
|
5237
|
+
}
|
|
5238
|
+
|
|
5227
5239
|
class RatesAPI {
|
|
5228
5240
|
constructor(client) {
|
|
5229
5241
|
this.client = client;
|
|
@@ -5275,22 +5287,6 @@ class SalesOrdersAPI {
|
|
|
5275
5287
|
}
|
|
5276
5288
|
}
|
|
5277
5289
|
|
|
5278
|
-
var __defProp$1 = Object.defineProperty;
|
|
5279
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5280
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5281
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
5282
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5283
|
-
var __spreadValues$1 = (a, b) => {
|
|
5284
|
-
for (var prop in b || (b = {}))
|
|
5285
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
5286
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
5287
|
-
if (__getOwnPropSymbols$1)
|
|
5288
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
5289
|
-
if (__propIsEnum$1.call(b, prop))
|
|
5290
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
5291
|
-
}
|
|
5292
|
-
return a;
|
|
5293
|
-
};
|
|
5294
5290
|
var __async$1 = (__this, __arguments, generator) => {
|
|
5295
5291
|
return new Promise((resolve, reject) => {
|
|
5296
5292
|
var fulfilled = (value) => {
|
|
@@ -5320,11 +5316,9 @@ class ShipmentsAPI {
|
|
|
5320
5316
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
5321
5317
|
);
|
|
5322
5318
|
};
|
|
5323
|
-
this.create = (
|
|
5319
|
+
this.create = (...shipments) => __async$1(this, null, function* () {
|
|
5324
5320
|
return this.client.post("/v1/shipments", {
|
|
5325
|
-
shipments
|
|
5326
|
-
__spreadValues$1({}, shipment)
|
|
5327
|
-
]
|
|
5321
|
+
shipments
|
|
5328
5322
|
});
|
|
5329
5323
|
});
|
|
5330
5324
|
this.client = client;
|
|
@@ -5512,6 +5506,9 @@ class ShipEngineAPI {
|
|
|
5512
5506
|
get orderSources() {
|
|
5513
5507
|
return new OrderSourcesAPI(this.client);
|
|
5514
5508
|
}
|
|
5509
|
+
get rateCards() {
|
|
5510
|
+
return new RateCardsAPI(this.client);
|
|
5511
|
+
}
|
|
5515
5512
|
get rates() {
|
|
5516
5513
|
return new RatesAPI(this.client);
|
|
5517
5514
|
}
|
|
@@ -5544,6 +5541,7 @@ exports.InsuranceAPI = InsuranceAPI;
|
|
|
5544
5541
|
exports.InsuranceProviderType = InsuranceProviderType;
|
|
5545
5542
|
exports.LabelsAPI = LabelsAPI;
|
|
5546
5543
|
exports.OrderSourcesAPI = OrderSourcesAPI;
|
|
5544
|
+
exports.RateCardsAPI = RateCardsAPI;
|
|
5547
5545
|
exports.RatesAPI = RatesAPI;
|
|
5548
5546
|
exports.SE = types;
|
|
5549
5547
|
exports.SalesOrderShipmentsAPI = SalesOrderShipmentsAPI;
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var __getOwnPropSymbols$
|
|
2
|
-
var __hasOwnProp$
|
|
3
|
-
var __propIsEnum$
|
|
1
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
4
4
|
var __objRest$1 = (source, exclude) => {
|
|
5
5
|
var target = {};
|
|
6
6
|
for (var prop in source)
|
|
7
|
-
if (__hasOwnProp$
|
|
7
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
8
|
target[prop] = source[prop];
|
|
9
|
-
if (source != null && __getOwnPropSymbols$
|
|
10
|
-
for (var prop of __getOwnPropSymbols$
|
|
11
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
9
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
10
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
12
12
|
target[prop] = source[prop];
|
|
13
13
|
}
|
|
14
14
|
return target;
|
|
@@ -2818,21 +2818,21 @@ const getEndUserIpAddress = () => __async$4(void 0, null, function* () {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
});
|
|
2820
2820
|
|
|
2821
|
-
var __defProp$
|
|
2821
|
+
var __defProp$2 = Object.defineProperty;
|
|
2822
2822
|
var __defProps$1 = Object.defineProperties;
|
|
2823
2823
|
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
2824
|
-
var __getOwnPropSymbols$
|
|
2825
|
-
var __hasOwnProp$
|
|
2826
|
-
var __propIsEnum$
|
|
2827
|
-
var __defNormalProp$
|
|
2828
|
-
var __spreadValues$
|
|
2824
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
2825
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
2826
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
2827
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2828
|
+
var __spreadValues$2 = (a, b) => {
|
|
2829
2829
|
for (var prop in b || (b = {}))
|
|
2830
|
-
if (__hasOwnProp$
|
|
2831
|
-
__defNormalProp$
|
|
2832
|
-
if (__getOwnPropSymbols$
|
|
2833
|
-
for (var prop of __getOwnPropSymbols$
|
|
2834
|
-
if (__propIsEnum$
|
|
2835
|
-
__defNormalProp$
|
|
2830
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
2831
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
2832
|
+
if (__getOwnPropSymbols$2)
|
|
2833
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
2834
|
+
if (__propIsEnum$2.call(b, prop))
|
|
2835
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
2836
2836
|
}
|
|
2837
2837
|
return a;
|
|
2838
2838
|
};
|
|
@@ -2840,11 +2840,11 @@ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
|
2840
2840
|
var __objRest = (source, exclude) => {
|
|
2841
2841
|
var target = {};
|
|
2842
2842
|
for (var prop in source)
|
|
2843
|
-
if (__hasOwnProp$
|
|
2843
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2844
2844
|
target[prop] = source[prop];
|
|
2845
|
-
if (source != null && __getOwnPropSymbols$
|
|
2846
|
-
for (var prop of __getOwnPropSymbols$
|
|
2847
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2845
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
2846
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
2847
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
2848
2848
|
target[prop] = source[prop];
|
|
2849
2849
|
}
|
|
2850
2850
|
return target;
|
|
@@ -2883,7 +2883,7 @@ class CarriersAPI {
|
|
|
2883
2883
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
2884
2884
|
if (!endUserIpAddress)
|
|
2885
2885
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
2886
|
-
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$1(__spreadValues$
|
|
2886
|
+
return yield this.client.post(`/v1/registration/${carrierCode}`, __spreadProps$1(__spreadValues$2({}, connection), {
|
|
2887
2887
|
endUserIpAddress
|
|
2888
2888
|
}));
|
|
2889
2889
|
});
|
|
@@ -5101,19 +5101,19 @@ class CustomPackagesAPI {
|
|
|
5101
5101
|
}
|
|
5102
5102
|
}
|
|
5103
5103
|
|
|
5104
|
-
var __defProp$
|
|
5105
|
-
var __getOwnPropSymbols$
|
|
5106
|
-
var __hasOwnProp$
|
|
5107
|
-
var __propIsEnum$
|
|
5108
|
-
var __defNormalProp$
|
|
5109
|
-
var __spreadValues$
|
|
5104
|
+
var __defProp$1 = Object.defineProperty;
|
|
5105
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5106
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5107
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
5108
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5109
|
+
var __spreadValues$1 = (a, b) => {
|
|
5110
5110
|
for (var prop in b || (b = {}))
|
|
5111
|
-
if (__hasOwnProp$
|
|
5112
|
-
__defNormalProp$
|
|
5113
|
-
if (__getOwnPropSymbols$
|
|
5114
|
-
for (var prop of __getOwnPropSymbols$
|
|
5115
|
-
if (__propIsEnum$
|
|
5116
|
-
__defNormalProp$
|
|
5111
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
5112
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5113
|
+
if (__getOwnPropSymbols$1)
|
|
5114
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
5115
|
+
if (__propIsEnum$1.call(b, prop))
|
|
5116
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
5117
5117
|
}
|
|
5118
5118
|
return a;
|
|
5119
5119
|
};
|
|
@@ -5150,7 +5150,7 @@ class FundingSourcesAPI {
|
|
|
5150
5150
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5151
5151
|
if (!endUserIpAddress)
|
|
5152
5152
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5153
|
-
return yield this.client.post("/v1/funding_sources", __spreadValues$
|
|
5153
|
+
return yield this.client.post("/v1/funding_sources", __spreadValues$1({
|
|
5154
5154
|
endUserIpAddress
|
|
5155
5155
|
}, fundingSource));
|
|
5156
5156
|
});
|
|
@@ -5167,7 +5167,7 @@ class FundingSourcesAPI {
|
|
|
5167
5167
|
const endUserIpAddress = yield getEndUserIpAddress();
|
|
5168
5168
|
if (!endUserIpAddress)
|
|
5169
5169
|
return Promise.reject([new CodedError("Unable to get IP address")]);
|
|
5170
|
-
return yield this.client.post("/v1/registration/funding_source", __spreadValues$
|
|
5170
|
+
return yield this.client.post("/v1/registration/funding_source", __spreadValues$1({
|
|
5171
5171
|
endUserIpAddress
|
|
5172
5172
|
}, carrier));
|
|
5173
5173
|
});
|
|
@@ -5220,6 +5220,18 @@ class OrderSourcesAPI {
|
|
|
5220
5220
|
}
|
|
5221
5221
|
}
|
|
5222
5222
|
|
|
5223
|
+
class RateCardsAPI {
|
|
5224
|
+
constructor(client) {
|
|
5225
|
+
this.client = client;
|
|
5226
|
+
this.list = (carrierIds) => {
|
|
5227
|
+
return this.client.get(
|
|
5228
|
+
`/v1/rate-cards?carrier_ids=${carrierIds.toString()}`
|
|
5229
|
+
);
|
|
5230
|
+
};
|
|
5231
|
+
this.client = client;
|
|
5232
|
+
}
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5223
5235
|
class RatesAPI {
|
|
5224
5236
|
constructor(client) {
|
|
5225
5237
|
this.client = client;
|
|
@@ -5271,22 +5283,6 @@ class SalesOrdersAPI {
|
|
|
5271
5283
|
}
|
|
5272
5284
|
}
|
|
5273
5285
|
|
|
5274
|
-
var __defProp$1 = Object.defineProperty;
|
|
5275
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5276
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5277
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
5278
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5279
|
-
var __spreadValues$1 = (a, b) => {
|
|
5280
|
-
for (var prop in b || (b = {}))
|
|
5281
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
5282
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
5283
|
-
if (__getOwnPropSymbols$1)
|
|
5284
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
5285
|
-
if (__propIsEnum$1.call(b, prop))
|
|
5286
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
5287
|
-
}
|
|
5288
|
-
return a;
|
|
5289
|
-
};
|
|
5290
5286
|
var __async$1 = (__this, __arguments, generator) => {
|
|
5291
5287
|
return new Promise((resolve, reject) => {
|
|
5292
5288
|
var fulfilled = (value) => {
|
|
@@ -5316,11 +5312,9 @@ class ShipmentsAPI {
|
|
|
5316
5312
|
createdAtStart !== void 0 ? { params: { createdAtStart } } : void 0
|
|
5317
5313
|
);
|
|
5318
5314
|
};
|
|
5319
|
-
this.create = (
|
|
5315
|
+
this.create = (...shipments) => __async$1(this, null, function* () {
|
|
5320
5316
|
return this.client.post("/v1/shipments", {
|
|
5321
|
-
shipments
|
|
5322
|
-
__spreadValues$1({}, shipment)
|
|
5323
|
-
]
|
|
5317
|
+
shipments
|
|
5324
5318
|
});
|
|
5325
5319
|
});
|
|
5326
5320
|
this.client = client;
|
|
@@ -5508,6 +5502,9 @@ class ShipEngineAPI {
|
|
|
5508
5502
|
get orderSources() {
|
|
5509
5503
|
return new OrderSourcesAPI(this.client);
|
|
5510
5504
|
}
|
|
5505
|
+
get rateCards() {
|
|
5506
|
+
return new RateCardsAPI(this.client);
|
|
5507
|
+
}
|
|
5511
5508
|
get rates() {
|
|
5512
5509
|
return new RatesAPI(this.client);
|
|
5513
5510
|
}
|
|
@@ -5525,4 +5522,4 @@ class ShipEngineAPI {
|
|
|
5525
5522
|
}
|
|
5526
5523
|
}
|
|
5527
5524
|
|
|
5528
|
-
export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngineAPI, ShipmentsAPI, WarehousesAPI, getEndUserIpAddress, isCodedError, isCodedErrors };
|
|
5525
|
+
export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, OrderSourcesAPI, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ShipEngineAPI, ShipmentsAPI, WarehousesAPI, getEndUserIpAddress, isCodedError, isCodedErrors };
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { RateCard } from "./types";
|
|
3
|
+
export declare class RateCardsAPI {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
list: (carrierIds: string[]) => Promise<import("axios").AxiosResponse<{
|
|
7
|
+
rateCards: RateCard[];
|
|
8
|
+
}, any>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Currency } from "../payments";
|
|
2
|
+
/**
|
|
3
|
+
* @category Entities
|
|
4
|
+
*/
|
|
5
|
+
export interface ShipFromLocation {
|
|
6
|
+
countryCode: string;
|
|
7
|
+
postalCode?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @category Entities
|
|
11
|
+
*/
|
|
12
|
+
export interface RateCard {
|
|
13
|
+
carrierId: string;
|
|
14
|
+
currency: Currency;
|
|
15
|
+
endDate?: string;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
shipFrom: ShipFromLocation;
|
|
19
|
+
startDate: string;
|
|
20
|
+
status: string;
|
|
21
|
+
}
|
package/shipments/api.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export declare class ShipmentsAPI {
|
|
|
12
12
|
private client;
|
|
13
13
|
constructor(client: AxiosInstance);
|
|
14
14
|
getShipmentRates: ({ shipmentId, createdAtStart }: GetShipmentRatesOptions) => Promise<import("axios").AxiosResponse<ShipmentRateResponse, any>>;
|
|
15
|
-
create: (
|
|
16
|
-
|
|
15
|
+
create: (...shipments: Partial<Omit<Shipment, "items">>[]) => Promise<import("axios").AxiosResponse<{
|
|
16
|
+
has_errors: boolean;
|
|
17
|
+
shipments: Shipment[];
|
|
17
18
|
}, any>>;
|
|
18
19
|
}
|
package/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./labels/types";
|
|
|
10
10
|
export * from "./order-sources/types";
|
|
11
11
|
export * from "./payments/types";
|
|
12
12
|
export * from "./rates/types";
|
|
13
|
+
export * from "./rate-cards/types";
|
|
13
14
|
export * from "./relay-points/types";
|
|
14
15
|
export * from "./resources/types";
|
|
15
16
|
export * from "./sales-order-shipments/types";
|