@shipengine/js-api 4.2.0 → 4.3.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,4 +1,15 @@
1
1
  export type AccountBillingProvider = "visa" | "mastercard" | "americanExpress" | "discover";
2
+ type PaymentMethod = {
3
+ bankAccountInfo: {
4
+ lastFour: string;
5
+ provider: string;
6
+ } | null;
7
+ creditCardInfo: {
8
+ cardNumberLastFour: string;
9
+ provider: AccountBillingProvider;
10
+ } | null;
11
+ paymentMethodId?: string;
12
+ };
2
13
  export type AccountBillingResponse = {
3
14
  addressLine1: string;
4
15
  addressLine2?: string;
@@ -7,12 +18,7 @@ export type AccountBillingResponse = {
7
18
  countryCode: string;
8
19
  email: string;
9
20
  fullName: string;
10
- paymentMethod?: {
11
- creditCardInfo: {
12
- cardNumberLastFour: string;
13
- provider: AccountBillingProvider;
14
- };
15
- };
21
+ paymentMethod?: PaymentMethod;
16
22
  phone: string;
17
23
  postalCode: string;
18
24
  stateProvince: string;
@@ -32,3 +38,4 @@ export type UpsertAccountBillingRequestBody = {
32
38
  postalCode: string;
33
39
  stateProvince: string;
34
40
  };
41
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { Money } from "../payments";
3
3
  import { CreationRangeQuery, PageableQuery } from "../resources";
4
- import { AddFundsResponse, AuctanePayInfo, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceCreateResponse, FundingSourceTransactionsResponse, InsuranceFundingSourceAcceptedTermsResponse, MetadataResponse } from "./types";
4
+ import { AddFundsResponse, AuctanePayInfo, BankAccountInfo, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress, FundingSourceCreateResponse, FundingSourceTransactionsResponse, InsuranceFundingSourceAcceptedTermsResponse, MetadataResponse } from "./types";
5
5
  /**
6
6
  * @internal
7
7
  * # Funding Sources API module - /v1/funding_sources
@@ -30,7 +30,7 @@ export declare class FundingSourcesAPI {
30
30
  * user to update the billing address or payment information associated with the
31
31
  * funding source.
32
32
  */
33
- update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo | undefined, auctanePayInfo: AuctanePayInfo | undefined, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
33
+ update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo | undefined, bankAccountInfo: BankAccountInfo | undefined, auctanePayInfo: AuctanePayInfo | undefined, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
34
34
  fundingSource: FundingSource;
35
35
  }, any>>;
36
36
  /**
@@ -12,6 +12,7 @@ export type CreateFundingSource = {
12
12
  billingInfo: FundingSourceAddress;
13
13
  iovationBlackBox: IovationBlackBox;
14
14
  paymentMethod: {
15
+ bankAccountInfo?: BankAccountInfo;
15
16
  creditCardInfo?: CreditCardInfo;
16
17
  paymentMethodId?: string;
17
18
  sessionId?: string;
@@ -25,6 +26,7 @@ export type FundingSource = {
25
26
  defaultCarrierId: string;
26
27
  fundingSourceId: string;
27
28
  paymentMethod: {
29
+ bankAccountInfo: BankAccountInfo | null;
28
30
  creditCardInfo: AbbreviatedCreditCardInfo | null;
29
31
  paymentMethodId?: string;
30
32
  sessionId?: string;
@@ -92,6 +94,10 @@ export interface CreditCardInfo {
92
94
  name: string;
93
95
  provider: Provider;
94
96
  }
97
+ export interface BankAccountInfo {
98
+ lastFour: string;
99
+ provider: string;
100
+ }
95
101
  /** @internal */
96
102
  export interface Term {
97
103
  termType: string;
package/index.js CHANGED
@@ -3545,7 +3545,7 @@ class FundingSourcesAPI {
3545
3545
  * user to update the billing address or payment information associated with the
3546
3546
  * funding source.
3547
3547
  */
3548
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3548
+ this.update = (billingInfo, creditCardInfo, bankAccountInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3549
3549
  const endUserIpAddress = yield getEndUserIpAddress();
3550
3550
  if (!endUserIpAddress) {
3551
3551
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3556,6 +3556,7 @@ class FundingSourcesAPI {
3556
3556
  billingInfo,
3557
3557
  endUserIpAddress,
3558
3558
  paymentMethod: __spreadValues$3({
3559
+ bankAccountInfo,
3559
3560
  creditCardInfo
3560
3561
  }, auctanePayInfo)
3561
3562
  }
@@ -3724,10 +3725,10 @@ class LabelsAPI {
3724
3725
  return this.client.put(`/v1/labels/${labelId}/void`);
3725
3726
  };
3726
3727
  /**
3727
- * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
3728
+ * The `export` method allows to export a CSV document of labels based on the provided parameters.
3728
3729
  */
3729
- this.download = (params) => {
3730
- return this.client.get("/v1/labels/downloads", {
3730
+ this.export = (params) => {
3731
+ return this.client.get("/v1/labels/export", {
3731
3732
  headers: {
3732
3733
  Accept: "text/csv"
3733
3734
  },
@@ -4196,10 +4197,10 @@ class ShipmentsAPI {
4196
4197
  return this.client.put(`/v1/shipments/${shipmentId}/cancel`);
4197
4198
  };
4198
4199
  /**
4199
- * The `download` method allows for downloading a CSV document of shipments based on the provided parameters.
4200
+ * The `export` method allows to export a CSV document of shipments based on the provided parameters.
4200
4201
  */
4201
- this.download = (params) => {
4202
- return this.client.get("/v1/shipments/downloads", {
4202
+ this.export = (params) => {
4203
+ return this.client.get("/v1/shipments/export", {
4203
4204
  headers: {
4204
4205
  Accept: "text/csv"
4205
4206
  },
package/index.mjs CHANGED
@@ -3541,7 +3541,7 @@ class FundingSourcesAPI {
3541
3541
  * user to update the billing address or payment information associated with the
3542
3542
  * funding source.
3543
3543
  */
3544
- this.update = (billingInfo, creditCardInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3544
+ this.update = (billingInfo, creditCardInfo, bankAccountInfo, auctanePayInfo, fundingSourceId) => __async$4(this, null, function* () {
3545
3545
  const endUserIpAddress = yield getEndUserIpAddress();
3546
3546
  if (!endUserIpAddress) {
3547
3547
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3552,6 +3552,7 @@ class FundingSourcesAPI {
3552
3552
  billingInfo,
3553
3553
  endUserIpAddress,
3554
3554
  paymentMethod: __spreadValues$3({
3555
+ bankAccountInfo,
3555
3556
  creditCardInfo
3556
3557
  }, auctanePayInfo)
3557
3558
  }
@@ -3720,10 +3721,10 @@ class LabelsAPI {
3720
3721
  return this.client.put(`/v1/labels/${labelId}/void`);
3721
3722
  };
3722
3723
  /**
3723
- * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
3724
+ * The `export` method allows to export a CSV document of labels based on the provided parameters.
3724
3725
  */
3725
- this.download = (params) => {
3726
- return this.client.get("/v1/labels/downloads", {
3726
+ this.export = (params) => {
3727
+ return this.client.get("/v1/labels/export", {
3727
3728
  headers: {
3728
3729
  Accept: "text/csv"
3729
3730
  },
@@ -4192,10 +4193,10 @@ class ShipmentsAPI {
4192
4193
  return this.client.put(`/v1/shipments/${shipmentId}/cancel`);
4193
4194
  };
4194
4195
  /**
4195
- * The `download` method allows for downloading a CSV document of shipments based on the provided parameters.
4196
+ * The `export` method allows to export a CSV document of shipments based on the provided parameters.
4196
4197
  */
4197
- this.download = (params) => {
4198
- return this.client.get("/v1/shipments/downloads", {
4198
+ this.export = (params) => {
4199
+ return this.client.get("/v1/shipments/export", {
4199
4200
  headers: {
4200
4201
  Accept: "text/csv"
4201
4202
  },
package/labels/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { CreateLabelOptions, DownloadLabelsParams, Label, ListLabelsParams, ListLabelsResult, VoidRequest } from "./types";
2
+ import { CreateLabelOptions, ExportLabelsParams, Label, ListLabelsParams, ListLabelsResult, VoidRequest } from "./types";
3
3
  /**
4
4
  * # Labels API module - /v1/labels
5
5
  */
@@ -33,7 +33,7 @@ export declare class LabelsAPI {
33
33
  */
34
34
  void: (labelId: string) => Promise<import("axios").AxiosResponse<VoidRequest, any>>;
35
35
  /**
36
- * The `download` method allows for downloading a CSV document of labels based on the provided parameters.
36
+ * The `export` method allows to export a CSV document of labels based on the provided parameters.
37
37
  */
38
- download: (params?: DownloadLabelsParams) => Promise<import("axios").AxiosResponse<Blob, any>>;
38
+ export: (params?: ExportLabelsParams) => Promise<import("axios").AxiosResponse<Blob, any>>;
39
39
  }
package/labels/types.d.ts CHANGED
@@ -143,7 +143,7 @@ export interface CreateLabelOptions {
143
143
  */
144
144
  validateAddress?: string;
145
145
  }
146
- export type DownloadLabelsParams = {
146
+ export type ExportLabelsParams = {
147
147
  /**
148
148
  * CSV column names to export
149
149
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import { PageableResult } from "../resources";
3
- import { DownloadShipmentsParams, ListShipmentOptions, Shipment, ShipmentRateResponse } from "./types";
3
+ import { ExportShipmentsParams, ListShipmentOptions, Shipment, ShipmentRateResponse } from "./types";
4
4
  /**
5
5
  * # Shipments - Get Shipment Rates Options
6
6
  */
@@ -72,7 +72,7 @@ export declare class ShipmentsAPI {
72
72
  */
73
73
  cancel: (shipmentId: string) => Promise<import("axios").AxiosResponse<any, any>>;
74
74
  /**
75
- * The `download` method allows for downloading a CSV document of shipments based on the provided parameters.
75
+ * The `export` method allows to export a CSV document of shipments based on the provided parameters.
76
76
  */
77
- download: (params?: DownloadShipmentsParams) => Promise<import("axios").AxiosResponse<Blob, any>>;
77
+ export: (params?: ExportShipmentsParams) => Promise<import("axios").AxiosResponse<Blob, any>>;
78
78
  }
@@ -274,7 +274,7 @@ export type ListShipmentOptions = {
274
274
  shipmentStatus?: ShipmentStatus;
275
275
  } & BatchableQuery & PageableQuery & CreationRangeQuery & ModificationRangeQuery & SortableQuery & TaggableQuery;
276
276
  export type ShipmentColumns = "shipment_id" | "packages" | "recipient" | "shipping_service" | "created_date" | "modified_at" | "status";
277
- export type DownloadShipmentsParams = {
277
+ export type ExportShipmentsParams = {
278
278
  /**
279
279
  * CSV column names to export
280
280
  */