@shipengine/js-api 1.5.0 → 1.7.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 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
  }
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Money } from "../payments";
3
- import { PageableQuery } from "../resources";
3
+ import { CreationRangeQuery, PageableQuery } from "../resources";
4
4
  import { AddFundsResponse, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceTransactionsResponse, MetadataResponse } from "./types";
5
5
  /**
6
6
  * # Funding Sources API module - /v1/funding_sources
@@ -52,5 +52,5 @@ export declare class FundingSourcesAPI {
52
52
  * The `transactions` method returns all the transactions of a funding source.
53
53
  * See the FundingSourceTransactions type for more information about return data.
54
54
  */
55
- transactions: (fundingSourceId: string, params?: PageableQuery) => Promise<import("axios").AxiosResponse<FundingSourceTransactionsResponse, any>>;
55
+ transactions: (fundingSourceId: string, params?: PageableQuery & CreationRangeQuery) => Promise<import("axios").AxiosResponse<FundingSourceTransactionsResponse, any>>;
56
56
  }
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
@@ -3781,6 +3781,35 @@ class SalesOrdersAPI {
3781
3781
  }
3782
3782
  }
3783
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
+
3784
3813
  var __defProp$1 = Object.defineProperty;
3785
3814
  var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3786
3815
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
@@ -4272,6 +4301,18 @@ class ShipEngineAPI {
4272
4301
  get shippingRules() {
4273
4302
  return new ShippingRulesAPI(this.client);
4274
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
+ }
4275
4316
  }
4276
4317
 
4277
4318
  exports.AccountSettingsAPI = AccountSettingsAPI;
@@ -4299,6 +4340,7 @@ exports.RatesAPI = RatesAPI;
4299
4340
  exports.SE = types;
4300
4341
  exports.SalesOrderShipmentsAPI = SalesOrderShipmentsAPI;
4301
4342
  exports.SalesOrdersAPI = SalesOrdersAPI;
4343
+ exports.SellersAPI = SellersAPI;
4302
4344
  exports.ServicePointsAPI = ServicePointsAPI;
4303
4345
  exports.ShipEngineAPI = ShipEngineAPI;
4304
4346
  exports.ShipmentsAPI = ShipmentsAPI;
package/index.mjs CHANGED
@@ -3777,6 +3777,35 @@ class SalesOrdersAPI {
3777
3777
  }
3778
3778
  }
3779
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
+
3780
3809
  var __defProp$1 = Object.defineProperty;
3781
3810
  var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3782
3811
  var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
@@ -4268,6 +4297,18 @@ class ShipEngineAPI {
4268
4297
  get shippingRules() {
4269
4298
  return new ShippingRulesAPI(this.client);
4270
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
+ }
4271
4312
  }
4272
4313
 
4273
- 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.5.0",
3
+ "version": "1.7.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";