@shipengine/js-api 0.32.1 → 0.34.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/carriers/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Currency, Money } from "../payments";
3
- import { Carrier, CarrierAutoFundingSettings, CarrierAutoFundingSettingsResponse, CarrierConnection, CarrierService, PackageRatingType, WalletTransactionHistory } from "./types";
3
+ import { Carrier, CarrierAutoFundingSettings, CarrierAutoFundingSettingsResponse, CarrierConnection, CarrierService, CarrierZone, PackageRatingType, WalletTransactionHistory } from "./types";
4
4
  /**
5
5
  * # Carriers API module - /v1/carriers
6
6
  */
@@ -79,4 +79,11 @@ export declare class CarriersAPI {
79
79
  getCurrencies: (carrierId: string) => Promise<import("axios").AxiosResponse<{
80
80
  currencies: Currency[];
81
81
  }, any>>;
82
+ /**
83
+ * The `getZones` method retrieves a list of zones for which the attached carrier
84
+ * provides support to.
85
+ */
86
+ getZones: (carrierId: string) => Promise<import("axios").AxiosResponse<{
87
+ zones: CarrierZone[];
88
+ }, any>>;
82
89
  }
@@ -121,3 +121,7 @@ export type WalletTransactionHistory = {
121
121
  total: number;
122
122
  transactions: WalletTransaction[];
123
123
  };
124
+ export type CarrierZone = {
125
+ apiCode: string;
126
+ name: string;
127
+ };
package/index.js CHANGED
@@ -52,6 +52,7 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
52
52
 
53
53
  var RateCardStatus = /* @__PURE__ */ ((RateCardStatus2) => {
54
54
  RateCardStatus2["DRAFT"] = "Draft";
55
+ RateCardStatus2["DELETED"] = "Deleted";
55
56
  RateCardStatus2["PUBLISHED"] = "Published";
56
57
  return RateCardStatus2;
57
58
  })(RateCardStatus || {});
@@ -1038,6 +1039,13 @@ class CarriersAPI {
1038
1039
  this.getCurrencies = (carrierId) => {
1039
1040
  return this.client.get(`/v1/carriers/${carrierId}/currencies`);
1040
1041
  };
1042
+ /**
1043
+ * The `getZones` method retrieves a list of zones for which the attached carrier
1044
+ * provides support to.
1045
+ */
1046
+ this.getZones = (carrierId) => {
1047
+ return this.client.get(`/v1/carriers/${carrierId}/zones`);
1048
+ };
1041
1049
  this.client = client;
1042
1050
  }
1043
1051
  }
package/index.mjs CHANGED
@@ -48,6 +48,7 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
48
48
 
49
49
  var RateCardStatus = /* @__PURE__ */ ((RateCardStatus2) => {
50
50
  RateCardStatus2["DRAFT"] = "Draft";
51
+ RateCardStatus2["DELETED"] = "Deleted";
51
52
  RateCardStatus2["PUBLISHED"] = "Published";
52
53
  return RateCardStatus2;
53
54
  })(RateCardStatus || {});
@@ -1034,6 +1035,13 @@ class CarriersAPI {
1034
1035
  this.getCurrencies = (carrierId) => {
1035
1036
  return this.client.get(`/v1/carriers/${carrierId}/currencies`);
1036
1037
  };
1038
+ /**
1039
+ * The `getZones` method retrieves a list of zones for which the attached carrier
1040
+ * provides support to.
1041
+ */
1042
+ this.getZones = (carrierId) => {
1043
+ return this.client.get(`/v1/carriers/${carrierId}/zones`);
1044
+ };
1037
1045
  this.client = client;
1038
1046
  }
1039
1047
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "0.32.1",
3
+ "version": "0.34.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -62,6 +62,7 @@ export type RatePackageType = Pick<PackageRatingType, "packageId" | "name" | "de
62
62
  */
63
63
  export declare enum RateCardStatus {
64
64
  DRAFT = "Draft",
65
+ DELETED = "Deleted",
65
66
  PUBLISHED = "Published"
66
67
  }
67
68
  /**