@shipengine/js-api 1.4.1 → 1.6.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
@@ -81,4 +81,9 @@ export declare class CarriersAPI {
81
81
  getZones: (carrierId: string) => Promise<import("axios").AxiosResponse<{
82
82
  zones: CarrierZone[];
83
83
  }, any>>;
84
+ /**
85
+ * Disconnect a Carrier of the given ID from the account.
86
+ * https://shipengine.github.io/shipengine-openapi/#operation/disconnect_carrier_by_id
87
+ */
88
+ delete: (carrierId: string) => Promise<import("axios").AxiosResponse<void, any>>;
84
89
  }
package/client.d.ts CHANGED
@@ -14,6 +14,7 @@ import { RateCardsAPI } from "./rate-cards";
14
14
  import { RatesAPI } from "./rates";
15
15
  import { SalesOrderShipmentsAPI } from "./sales-order-shipments";
16
16
  import { SalesOrdersAPI } from "./sales-orders";
17
+ import { SellersAPI } from "./sellers";
17
18
  import { ServicePointsAPI } from "./service-points";
18
19
  import { ShipmentsAPI } from "./shipments";
19
20
  import { ShippingRulesAPI } from "./shipping-rules";
@@ -187,4 +188,14 @@ export declare class ShipEngineAPI {
187
188
  * @see {@link ShippingRulesAPI | The Shipping Rules API module}
188
189
  */
189
190
  get shippingRules(): ShippingRulesAPI;
191
+ /**
192
+ * The `sellers` method provides access to the Sellers endpoints in ShipEngine
193
+ * API.
194
+ *
195
+ * These endpoints are old and do not follow the ShipEngine API standards that current endpoints follow.
196
+ * It is very likely that in the future these endpoints will be deprecated by other endpoints.
197
+ *
198
+ * @see {@link SellersAPI | The Sellers API module}
199
+ */
200
+ get sellers(): SellersAPI;
190
201
  }
package/index.d.ts CHANGED
@@ -26,3 +26,4 @@ export * from "./themes";
26
26
  export * from "./warehouses";
27
27
  export * from "./weight";
28
28
  export * from "./zones";
29
+ export * from "./sellers";
package/index.js CHANGED
@@ -1145,6 +1145,13 @@ class CarriersAPI {
1145
1145
  this.getZones = (carrierId) => {
1146
1146
  return this.client.get(`/v1/carriers/${carrierId}/zones`);
1147
1147
  };
1148
+ /**
1149
+ * Disconnect a Carrier of the given ID from the account.
1150
+ * https://shipengine.github.io/shipengine-openapi/#operation/disconnect_carrier_by_id
1151
+ */
1152
+ this.delete = (carrierId) => {
1153
+ return this.client.delete(`/v1/carriers/${carrierId}`);
1154
+ };
1148
1155
  this.client = client;
1149
1156
  }
1150
1157
  }
@@ -3774,6 +3781,35 @@ class SalesOrdersAPI {
3774
3781
  }
3775
3782
  }
3776
3783
 
3784
+ class SellersAPI {
3785
+ constructor(client) {
3786
+ /**
3787
+ * Given a seller ID, returns a list of sandbox seller IDs for that seller.
3788
+ */
3789
+ this.listSandboxSellerIds = ({ sellerId }) => {
3790
+ return this.client.get(`/v1/sellers/sandbox_sellers/${sellerId}`);
3791
+ };
3792
+ /**
3793
+ * Creates a sandbox seller account for a given seller ID
3794
+ * you can pass in a flag to try to reuse the carrier connection.
3795
+ */
3796
+ this.createSandboxSeller = ({ sellerId, tryReuseCarrierConnection }) => {
3797
+ return this.client.post(`/v1/sellers/create_sandbox_seller/${sellerId}`, {
3798
+ tryReuseCarrierConnection
3799
+ });
3800
+ };
3801
+ /**
3802
+ * Adds sandbox carriers to a seller, you can pass in a flag to try to reuse the carrier connection.
3803
+ */
3804
+ this.addSandboxCarriers = ({ sellerId, tryReuseCarrierConnection }) => {
3805
+ return this.client.post(`/v1/sellers/add_sandbox_carriers/${sellerId}`, {
3806
+ tryReuseCarrierConnection
3807
+ });
3808
+ };
3809
+ this.client = client;
3810
+ }
3811
+ }
3812
+
3777
3813
  var __defProp$1 = Object.defineProperty;
3778
3814
  var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3779
3815
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
@@ -4265,6 +4301,18 @@ class ShipEngineAPI {
4265
4301
  get shippingRules() {
4266
4302
  return new ShippingRulesAPI(this.client);
4267
4303
  }
4304
+ /**
4305
+ * The `sellers` method provides access to the Sellers endpoints in ShipEngine
4306
+ * API.
4307
+ *
4308
+ * These endpoints are old and do not follow the ShipEngine API standards that current endpoints follow.
4309
+ * It is very likely that in the future these endpoints will be deprecated by other endpoints.
4310
+ *
4311
+ * @see {@link SellersAPI | The Sellers API module}
4312
+ */
4313
+ get sellers() {
4314
+ return new SellersAPI(this.client);
4315
+ }
4268
4316
  }
4269
4317
 
4270
4318
  exports.AccountSettingsAPI = AccountSettingsAPI;
@@ -4292,6 +4340,7 @@ exports.RatesAPI = RatesAPI;
4292
4340
  exports.SE = types;
4293
4341
  exports.SalesOrderShipmentsAPI = SalesOrderShipmentsAPI;
4294
4342
  exports.SalesOrdersAPI = SalesOrdersAPI;
4343
+ exports.SellersAPI = SellersAPI;
4295
4344
  exports.ServicePointsAPI = ServicePointsAPI;
4296
4345
  exports.ShipEngineAPI = ShipEngineAPI;
4297
4346
  exports.ShipmentsAPI = ShipmentsAPI;
package/index.mjs CHANGED
@@ -1141,6 +1141,13 @@ class CarriersAPI {
1141
1141
  this.getZones = (carrierId) => {
1142
1142
  return this.client.get(`/v1/carriers/${carrierId}/zones`);
1143
1143
  };
1144
+ /**
1145
+ * Disconnect a Carrier of the given ID from the account.
1146
+ * https://shipengine.github.io/shipengine-openapi/#operation/disconnect_carrier_by_id
1147
+ */
1148
+ this.delete = (carrierId) => {
1149
+ return this.client.delete(`/v1/carriers/${carrierId}`);
1150
+ };
1144
1151
  this.client = client;
1145
1152
  }
1146
1153
  }
@@ -3770,6 +3777,35 @@ class SalesOrdersAPI {
3770
3777
  }
3771
3778
  }
3772
3779
 
3780
+ class SellersAPI {
3781
+ constructor(client) {
3782
+ /**
3783
+ * Given a seller ID, returns a list of sandbox seller IDs for that seller.
3784
+ */
3785
+ this.listSandboxSellerIds = ({ sellerId }) => {
3786
+ return this.client.get(`/v1/sellers/sandbox_sellers/${sellerId}`);
3787
+ };
3788
+ /**
3789
+ * Creates a sandbox seller account for a given seller ID
3790
+ * you can pass in a flag to try to reuse the carrier connection.
3791
+ */
3792
+ this.createSandboxSeller = ({ sellerId, tryReuseCarrierConnection }) => {
3793
+ return this.client.post(`/v1/sellers/create_sandbox_seller/${sellerId}`, {
3794
+ tryReuseCarrierConnection
3795
+ });
3796
+ };
3797
+ /**
3798
+ * Adds sandbox carriers to a seller, you can pass in a flag to try to reuse the carrier connection.
3799
+ */
3800
+ this.addSandboxCarriers = ({ sellerId, tryReuseCarrierConnection }) => {
3801
+ return this.client.post(`/v1/sellers/add_sandbox_carriers/${sellerId}`, {
3802
+ tryReuseCarrierConnection
3803
+ });
3804
+ };
3805
+ this.client = client;
3806
+ }
3807
+ }
3808
+
3773
3809
  var __defProp$1 = Object.defineProperty;
3774
3810
  var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3775
3811
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
@@ -4261,6 +4297,18 @@ class ShipEngineAPI {
4261
4297
  get shippingRules() {
4262
4298
  return new ShippingRulesAPI(this.client);
4263
4299
  }
4300
+ /**
4301
+ * The `sellers` method provides access to the Sellers endpoints in ShipEngine
4302
+ * API.
4303
+ *
4304
+ * These endpoints are old and do not follow the ShipEngine API standards that current endpoints follow.
4305
+ * It is very likely that in the future these endpoints will be deprecated by other endpoints.
4306
+ *
4307
+ * @see {@link SellersAPI | The Sellers API module}
4308
+ */
4309
+ get sellers() {
4310
+ return new SellersAPI(this.client);
4311
+ }
4264
4312
  }
4265
4313
 
4266
- export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
4314
+ export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "1.4.1",
3
+ "version": "1.6.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -0,0 +1,22 @@
1
+ import { AxiosInstance } from "axios";
2
+ import type { ListSandboxSellersParams, SandboxMethodParams } from "./types";
3
+ /**
4
+ * Sellers API endpoints
5
+ */
6
+ export declare class SellersAPI {
7
+ private client;
8
+ constructor(client: AxiosInstance);
9
+ /**
10
+ * Given a seller ID, returns a list of sandbox seller IDs for that seller.
11
+ */
12
+ listSandboxSellerIds: ({ sellerId }: ListSandboxSellersParams) => Promise<import("axios").AxiosResponse<string[], any>>;
13
+ /**
14
+ * Creates a sandbox seller account for a given seller ID
15
+ * you can pass in a flag to try to reuse the carrier connection.
16
+ */
17
+ createSandboxSeller: ({ sellerId, tryReuseCarrierConnection }: SandboxMethodParams) => Promise<import("axios").AxiosResponse<void, any>>;
18
+ /**
19
+ * Adds sandbox carriers to a seller, you can pass in a flag to try to reuse the carrier connection.
20
+ */
21
+ addSandboxCarriers: ({ sellerId, tryReuseCarrierConnection }: SandboxMethodParams) => Promise<import("axios").AxiosResponse<void, any>>;
22
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./api";
@@ -0,0 +1,7 @@
1
+ export type ListSandboxSellersParams = {
2
+ sellerId: string;
3
+ };
4
+ export type SandboxMethodParams = {
5
+ sellerId: string;
6
+ tryReuseCarrierConnection?: boolean;
7
+ };
package/types.d.ts CHANGED
@@ -26,3 +26,4 @@ export * from "./warehouses/types";
26
26
  export * from "./weight/types";
27
27
  export * from "./weight-band/types";
28
28
  export * from "./zones/types";
29
+ export * from "./sellers/types";