@shipengine/js-api 4.0.0 → 4.1.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.
@@ -24,16 +24,16 @@ export type AuctanePayTransactionCategory = "add_funds" | "subscription" | "stor
24
24
  * @category Entities
25
25
  */
26
26
  export interface CreateSessionRequest {
27
+ /**
28
+ * Category of the transaction
29
+ * @example "add_funds"
30
+ */
31
+ paymentPreferences: AuctanePayTransactionCategory[];
27
32
  /**
28
33
  * URL to redirect after payment session completion
29
34
  * @example "https://dashboard.shipengine.com/?sessionId=:id"
30
35
  */
31
36
  returnUrl?: string;
32
- /**
33
- * Category of the transaction
34
- * @example "add_funds"
35
- */
36
- transactionCategory: AuctanePayTransactionCategory;
37
37
  }
38
38
  /**
39
39
  * @category Entities
package/index.js CHANGED
@@ -3723,6 +3723,18 @@ class LabelsAPI {
3723
3723
  this.void = (labelId) => {
3724
3724
  return this.client.put(`/v1/labels/${labelId}/void`);
3725
3725
  };
3726
+ /**
3727
+ * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
3728
+ */
3729
+ this.download = (params) => {
3730
+ return this.client.get("/v1/labels/downloads", {
3731
+ headers: {
3732
+ Accept: "text/csv"
3733
+ },
3734
+ params,
3735
+ responseType: "blob"
3736
+ });
3737
+ };
3726
3738
  this.client = client;
3727
3739
  }
3728
3740
  }
package/index.mjs CHANGED
@@ -3719,6 +3719,18 @@ class LabelsAPI {
3719
3719
  this.void = (labelId) => {
3720
3720
  return this.client.put(`/v1/labels/${labelId}/void`);
3721
3721
  };
3722
+ /**
3723
+ * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
3724
+ */
3725
+ this.download = (params) => {
3726
+ return this.client.get("/v1/labels/downloads", {
3727
+ headers: {
3728
+ Accept: "text/csv"
3729
+ },
3730
+ params,
3731
+ responseType: "blob"
3732
+ });
3733
+ };
3722
3734
  this.client = client;
3723
3735
  }
3724
3736
  }
package/labels/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { CreateLabelOptions, Label, ListLabelsParams, ListLabelsResult, VoidRequest } from "./types";
2
+ import { CreateLabelOptions, DownloadLabelsParams, Label, ListLabelsParams, ListLabelsResult, VoidRequest } from "./types";
3
3
  /**
4
4
  * # Labels API module - /v1/labels
5
5
  */
@@ -32,4 +32,8 @@ export declare class LabelsAPI {
32
32
  * The `void` method allows a user to void a label by `labelId`.
33
33
  */
34
34
  void: (labelId: string) => Promise<import("axios").AxiosResponse<VoidRequest, any>>;
35
+ /**
36
+ * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
37
+ */
38
+ download: (params?: DownloadLabelsParams) => Promise<import("axios").AxiosResponse<Blob, any>>;
35
39
  }
package/labels/types.d.ts CHANGED
@@ -10,6 +10,7 @@ export type LabelFormat = "pdf" | "png" | "zpl";
10
10
  export type LabelLayout = "4x6" | "letter";
11
11
  export type LabelStatus = "processing" | "completed" | "error" | "voided";
12
12
  export type LabelTrackingStatus = "unknown" | "in_transit" | "delivered" | "error";
13
+ export type LabelColumns = "shipment_id" | "label_id" | "external_order_id" | "external_shipment_id" | "packages" | "recipient" | "shipping_service" | "created_date" | "ship_date" | "status" | "tracking_status";
13
14
  export type Label = {
14
15
  alternativeIdentifiers?: string[];
15
16
  batchId: string;
@@ -142,3 +143,13 @@ export interface CreateLabelOptions {
142
143
  */
143
144
  validateAddress?: string;
144
145
  }
146
+ export type DownloadLabelsParams = {
147
+ /**
148
+ * CSV column names to export
149
+ */
150
+ columns?: LabelColumns[];
151
+ /**
152
+ * Specific label ID to filter by
153
+ */
154
+ labelId?: string;
155
+ } & ListLabelsParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {