@shipengine/js-api 0.32.0 → 0.33.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.
@@ -1,11 +1,24 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { OrderSource } from "./types";
3
+ /**
4
+ * # Order Sources API module - /v-beta/order_sources
5
+ */
3
6
  export declare class OrderSourcesAPI {
4
7
  private client;
5
8
  constructor(client: AxiosInstance);
9
+ /**
10
+ * The `list` method retrieves a list of connected order sources for a given user.
11
+ */
6
12
  list: () => Promise<import("axios").AxiosResponse<{
7
13
  orderSources: OrderSource[];
8
14
  }, any>>;
15
+ /**
16
+ * The `get` method retrieves a specific order source by `orderSourceId`.
17
+ */
9
18
  get: (orderSourceId: string) => Promise<import("axios").AxiosResponse<OrderSource, any>>;
19
+ /**
20
+ * The `refresh` method refreshes a specific order source by `orderSourceId`.
21
+ * This will pull in any `new orders` since the last order import.
22
+ */
10
23
  refresh: (orderSourceId: string) => Promise<import("axios").AxiosResponse<OrderSource, any>>;
11
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,16 +1,41 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { RateCard, RateCardInput } from "./types";
3
+ /**
4
+ * # Rate Cards API module - /v1/rate_cards
5
+ */
3
6
  export declare class RateCardsAPI {
4
7
  private client;
5
8
  constructor(client: AxiosInstance);
9
+ /**
10
+ * The `list` method retrieves a list of rate cards for a given list of carrier ID's.
11
+ */
6
12
  list: (carrierIds: string[]) => Promise<import("axios").AxiosResponse<{
7
13
  rateCards: RateCard[];
8
14
  }, any>>;
15
+ /**
16
+ * The `get` method retrieves a specific rate card by `rateCardId`.
17
+ */
9
18
  get: (rateCardId: string) => Promise<import("axios").AxiosResponse<RateCard, any>>;
19
+ /**
20
+ * The `create` method creates a new rate card for a given user.
21
+ */
10
22
  create: (rateCardInput: RateCardInput) => Promise<import("axios").AxiosResponse<RateCard, any>>;
23
+ /**
24
+ * The `update` method updates a specific rate card by `rateCardId` with a new
25
+ * `RateCard`.
26
+ */
11
27
  update: (rateCard: RateCard) => Promise<import("axios").AxiosResponse<RateCard, any>>;
28
+ /**
29
+ * The `download` method allows for downloading a given rate card by `rateCardId`.
30
+ */
12
31
  download: (rateCardId: string) => Promise<import("axios").AxiosResponse<Blob, any>>;
32
+ /**
33
+ * The `upload` method allows for uploading a given rate card as a spreadsheet file.
34
+ */
13
35
  upload: (rateCardId: string, file: File) => Promise<import("axios").AxiosResponse<RateCard, any>>;
36
+ /**
37
+ * The `publish` method allows for publishing a given rate card by `rateCardId`.
38
+ */
14
39
  publish: (rateCardId: string) => Promise<import("axios").AxiosResponse<any, any>>;
15
40
  /**
16
41
  * @description https://auctane.atlassian.net/wiki/spaces/TE/pages/3837431603/Inc+1+3.+Rate+Card+Details#Delete-Rate-Card
package/rates/api.d.ts CHANGED
@@ -1,16 +1,42 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Currency } from "../payments";
3
3
  import { RateResponse } from "./types";
4
+ /**
5
+ * # Rates API - Calculate Rates Options
6
+ */
4
7
  export interface CalculateRatesOptions {
8
+ /**
9
+ * `calculateTaxAmount` is an optional boolean that indicates rates returned
10
+ * should include the tax amount.
11
+ */
5
12
  calculateTaxAmount?: boolean;
13
+ /**
14
+ * `carrierIds` is an array of carrier IDs to filter rates by.
15
+ */
6
16
  carrierIds: string[];
17
+ /**
18
+ * `packageTypes` is an optional array of package types to filter rates by.
19
+ */
7
20
  packageTypes?: string[];
21
+ /**
22
+ * `preferredCurrency` is an optional indicator of the currency to return rates in.
23
+ */
8
24
  preferredCurrency?: Currency;
25
+ /**
26
+ * `serviceCodes` is an optional array of specific carrier service codes to filter rates by.
27
+ */
9
28
  serviceCodes?: string[];
10
29
  }
30
+ /**
31
+ * # Rates API module - /v1/rates
32
+ */
11
33
  export declare class RatesAPI {
12
34
  private client;
13
35
  constructor(client: AxiosInstance);
36
+ /**
37
+ * The `calculate` method calculates rates for a shipment by shipment ID based
38
+ * on the shipment's options.
39
+ */
14
40
  calculateByShipmentId: (shipmentId: string, options: CalculateRatesOptions) => Promise<import("axios").AxiosResponse<Omit<import("..").Shipment, "items"> & {
15
41
  items: import("../sales-order-shipments").SalesOrderShipmentItem[];
16
42
  salesOrderIds: string[];
@@ -2,29 +2,99 @@ import { AxiosInstance } from "axios";
2
2
  import { CreationRangeQuery, ISOString, ModificationRangeQuery, PageableQuery, PageableResult, SortableQuery } from "../resources";
3
3
  import { FulfillmentStatus, PaymentStatus } from "../sales-orders";
4
4
  import { SalesOrderShipment } from "./types";
5
+ /**
6
+ *
7
+ */
5
8
  export type ListSalesOrderShipmentsParams = {
9
+ /**
10
+ * `cancelled` is an optional boolean indicating if cancelled shipments
11
+ * should be included in the response.
12
+ */
6
13
  cancelled?: boolean;
14
+ /**
15
+ * `externalOrderId` is an optional unique ID that can be set by the user to
16
+ * associate shipments with an external system.
17
+ */
7
18
  externalOrderId?: string;
19
+ /**
20
+ * `externalOrderNumber` is an optional unique ID that can be set by the
21
+ * user to associate orders with an external system.
22
+ */
8
23
  externalOrderNumber?: string;
24
+ /**
25
+ * `fulfillmentStatus` is an optional string that indicates the fulfillment
26
+ * status of the shipments to be returned.
27
+ */
9
28
  fulfillmentStatus?: FulfillmentStatus;
29
+ /**
30
+ * `orderDateEnd` is an optional ISO 8601 string that indicates the end of the
31
+ * date range to query orders from.
32
+ */
10
33
  orderDateEnd?: ISOString;
34
+ /**
35
+ * `orderDateStart` is an optional ISO 8601 string that indicates the start of
36
+ * the date range to query orders from.
37
+ */
11
38
  orderDateStart?: ISOString;
39
+ /**
40
+ * `orderSourceId` is an optional string that indicates the order source ID
41
+ * to query orders from.
42
+ */
12
43
  orderSourceId?: string;
44
+ /**
45
+ * `paymentStatus` is an optional string that indicates the payment status of
46
+ * the shipments to be returned.
47
+ */
13
48
  paymentStatus?: PaymentStatus;
49
+ /**
50
+ * `salesOrderIds` is an optional array of sales order IDs to be used when
51
+ * querying sales orders.
52
+ */
14
53
  salesOrderIds?: string[];
15
54
  } & PageableQuery & CreationRangeQuery & ModificationRangeQuery & SortableQuery<"created_at" | "modified_at" | "order_date">;
55
+ /**
56
+ * # Sales Order Shipments - List Sales Order Shipments Body
57
+ */
16
58
  export type ListSalesOrderShipmentBody = {
59
+ /**
60
+ * `salesOrderIds` is an array of sales order IDs to be used when listing sales
61
+ * orders.
62
+ */
17
63
  salesOrderIds?: string[];
64
+ /**
65
+ * `shipments` is an array of shipments associated with the sales orders.
66
+ */
18
67
  shipments?: SalesOrderShipment[];
19
68
  };
69
+ /**
70
+ * # Sales Order Shipments - List Sales Order Shipments Result
71
+ */
20
72
  export type ListSalesOrderShipmentsResult = {
73
+ /**
74
+ * `shipments` is an array of sales order shipments.
75
+ */
21
76
  shipments: SalesOrderShipment[];
22
77
  } & PageableResult;
78
+ /**
79
+ * # Sales Order Shipments API module - /v-beta/shipments
80
+ */
23
81
  export declare class SalesOrderShipmentsAPI {
24
82
  private client;
25
83
  constructor(client: AxiosInstance);
84
+ /**
85
+ * The `list` method retrieves a list of sales order shipments for a given user.
86
+ */
26
87
  list: (body?: ListSalesOrderShipmentBody | undefined, params?: ListSalesOrderShipmentsParams) => Promise<import("axios").AxiosResponse<ListSalesOrderShipmentsResult, any>>;
88
+ /**
89
+ * The `get` method retrieves a specific sales order shipment by `shipmentId`.
90
+ */
27
91
  get: (shipmentId: string) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
92
+ /**
93
+ * The `create` method creates a new shipment for a sales order.
94
+ */
28
95
  create: (salesOrderId: string, shipment: Partial<SalesOrderShipment>) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
96
+ /**
97
+ * The `update` method updates a specific sales order shipment by `shipmentId`.
98
+ */
29
99
  update: (shipmentId: string, shipment: Partial<SalesOrderShipment>) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
30
100
  }
@@ -1,15 +1,40 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { SalesOrder, SalesOrderTracking } from "./types";
3
+ /**
4
+ * # Sales Orders - List Sales Orders Params
5
+ */
3
6
  export interface ListSalesOrdersParams {
7
+ /**
8
+ * `externalOrderId` is an optional unique ID that can be set by the user to
9
+ * associate shipments with an external system.
10
+ */
4
11
  externalOrderId?: string;
12
+ /**
13
+ * `externalOrderNumber` is an optional unique identifier that can be set by
14
+ * the user to associate shipments with an external order system.
15
+ */
5
16
  externalOrderNumber?: string;
6
17
  }
18
+ /**
19
+ * # Sales Orders API module - /v-beta/sales_orders
20
+ */
7
21
  export declare class SalesOrdersAPI {
8
22
  private client;
9
23
  constructor(client: AxiosInstance);
24
+ /**
25
+ * The `list` method retrieves a list of sales orders.
26
+ */
10
27
  list: (params?: ListSalesOrdersParams) => Promise<import("axios").AxiosResponse<{
11
28
  salesOrders: SalesOrder[];
12
29
  }, any>>;
30
+ /**
31
+ * The `get` method retrieves a specific sales order by `salesOrderId`.
32
+ */
13
33
  get: (salesOrderId: string) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
34
+ /**
35
+ * The `notifyShipped` method notifies order source that the order has been
36
+ * shipped. Typically, the order source will then notify the user based on
37
+ * this update from ShipEngine API.
38
+ */
14
39
  notifyShipped: (salesOrderId: string, tracking: SalesOrderTracking) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
15
40
  }
@@ -1,29 +1,72 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { BatchableQuery, CreationRangeQuery, ModificationRangeQuery, PageableQuery, PageableResult, SortableQuery, TaggableQuery } from "../resources";
3
3
  import { Shipment, ShipmentRateResponse, ShipmentStatus } from "./types";
4
+ /**
5
+ * # Shipments - Get Shipment Rates Options
6
+ */
4
7
  export type GetShipmentRatesOptions = {
5
8
  /**
6
9
  * Date to filter rates by (they must be more recent than this date if passed)
7
10
  * @example "2019-03-12T19:24:13.657Z"
8
11
  */
9
12
  createdAtStart?: string;
13
+ /**
14
+ * `shipmentId` is the unique identifier of the shipment to retrieve.
15
+ */
10
16
  shipmentId: string;
11
17
  };
12
18
  export type ListShipmentOptions = {
19
+ /**
20
+ * `salesOrderIds` is an array of sales order IDs to be used when listing sales
21
+ * orders.
22
+ */
13
23
  salesOrderId?: string;
24
+ /**
25
+ * `shipmentStatus` is the current fulfillment status of the shipment.
26
+ */
14
27
  shipmentStatus?: ShipmentStatus;
15
28
  } & BatchableQuery & PageableQuery & CreationRangeQuery & ModificationRangeQuery & SortableQuery & TaggableQuery;
29
+ /**
30
+ * # Shipments - List Shipments Result
31
+ */
16
32
  export type ListShipmentResult = {
33
+ /**
34
+ * `shipments` is an array of shipments to be returned.
35
+ */
17
36
  shipments: Shipment[];
18
37
  } & PageableResult;
38
+ /**
39
+ * # Shipments - Create Shipments Result
40
+ */
19
41
  export type CreateShipmentResult = {
42
+ /**
43
+ * `hasErrors` is a boolean that indicates if any errors occurred during the
44
+ * creation of the shipments.
45
+ */
20
46
  hasErrors: boolean;
47
+ /**
48
+ * `shipments` is an array of shipments that were created.
49
+ */
21
50
  shipments: Shipment[];
22
51
  };
52
+ /**
53
+ * # Shipments API module - /v1/shipments
54
+ */
23
55
  export declare class ShipmentsAPI {
24
56
  private client;
25
57
  constructor(client: AxiosInstance);
58
+ /**
59
+ * The `getShipmentRates` method retrieves rates for a given shipment by
60
+ * shipment ID.
61
+ */
26
62
  getShipmentRates: ({ shipmentId, createdAtStart }: GetShipmentRatesOptions) => Promise<import("axios").AxiosResponse<ShipmentRateResponse, any>>;
63
+ /**
64
+ * The `list` method retrieves a list of shipments for a given user.
65
+ */
27
66
  list: (options?: ListShipmentOptions) => Promise<import("axios").AxiosResponse<ListShipmentResult, any>>;
67
+ /**
68
+ * The `create` method allows for creating shipments based on a list of shipment
69
+ * items passed into this method.
70
+ */
28
71
  create: (...shipments: Partial<Omit<Shipment, "items">>[]) => Promise<import("axios").AxiosResponse<CreateShipmentResult, any>>;
29
72
  }
@@ -1,12 +1,31 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Warehouse } from "./types";
3
+ /**
4
+ * # Warehouses API module - /v1/warehouses
5
+ */
3
6
  export declare class WarehousesAPI {
4
7
  private client;
5
8
  constructor(client: AxiosInstance);
9
+ /**
10
+ * The `list` method retrieves a list of `warehouses` (Ship From Locations)
11
+ * for a given user.
12
+ */
6
13
  list: () => Promise<import("axios").AxiosResponse<{
7
14
  warehouses: Warehouse[];
8
15
  }, any>>;
16
+ /**
17
+ * The `create` method allows for creation of warehouses (Ship From Locations)
18
+ * on a users ShipEngine account.
19
+ */
9
20
  create: (warehouse: Partial<Warehouse>) => Promise<import("axios").AxiosResponse<Warehouse, any>>;
21
+ /**
22
+ * The `update` method updates a specific warehouse (Ship From Location) for a
23
+ * given user by `warehouseId`.
24
+ */
10
25
  update: (warehouseId: string, warehouse: Partial<Warehouse>) => Promise<import("axios").AxiosResponse<void, any>>;
26
+ /**
27
+ * The `delete` method deletes a specific warehouse (Ship From Location) by
28
+ * `warehouseId` from a users ShipEngine account.
29
+ */
11
30
  delete: (warehouseId: string) => Promise<import("axios").AxiosResponse<void, any>>;
12
31
  }