@shipengine/js-api 4.13.0 → 4.15.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.
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { Addon } from "./types";
3
+ /**
4
+ * # Account Addons API module - /v1/account/addons
5
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6364332064/Add-ons+New+endpoints+definition
6
+ */
7
+ export declare class AccountAddonsAPI {
8
+ private client;
9
+ constructor(client: AxiosInstance);
10
+ /**
11
+ * The `list` method retrieves a list of all available addons, also includes
12
+ * if its avaiable for the current user
13
+ */
14
+ list: () => Promise<import("axios").AxiosResponse<Addon[], any>>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,7 @@
1
+ export type AddonTypes = "ss_api_analytics";
2
+ export type Addon = {
3
+ code: AddonTypes;
4
+ isActive: boolean;
5
+ isAvailableToConnect: boolean;
6
+ name: string;
7
+ };
@@ -20,6 +20,14 @@ export type AccountBillingResponse = {
20
20
  stateProvince: string;
21
21
  };
22
22
  /** @internal */
23
+ type PaymentMethodWithId = {
24
+ paymentMethodId: string;
25
+ };
26
+ /** @internal */
27
+ type PaymentMethodWithSession = {
28
+ sessionId: string;
29
+ };
30
+ /** @internal */
23
31
  export type UpsertAccountBillingRequestBody = {
24
32
  addressLine1: string;
25
33
  addressLine2?: string;
@@ -28,9 +36,13 @@ export type UpsertAccountBillingRequestBody = {
28
36
  countryCode: string;
29
37
  email: string;
30
38
  fullName: string;
31
- paymentMethod: {
32
- sessionId: string;
33
- };
39
+ /**
40
+ * In the request , payment method has to pass either a paymentMethodId or a sessionId
41
+ * Cases:
42
+ * 1. When we want to assign a newly created payment method where you don't yet know the payment method ID -> session ID.
43
+ * 2. If we already know the payment method ID because it was created previously -> payment method ID.
44
+ */
45
+ paymentMethod: PaymentMethodWithId | PaymentMethodWithSession;
34
46
  phone: string;
35
47
  postalCode: string;
36
48
  stateProvince: string;
package/client.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AxiosError, AxiosRequestHeaders } from "axios";
2
+ import { AccountAddonsAPI } from "./account-addons";
2
3
  import { AccountBillingAPI } from "./account-billing";
3
4
  import { AccountBillingPlanAPI } from "./account-billing-plan";
4
5
  import { AccountSettingsAPI } from "./account-settings";
@@ -105,6 +106,11 @@ export declare class ShipEngineAPI {
105
106
  * in ShipEngine API.
106
107
  */
107
108
  get accountBillingPlan(): AccountBillingPlanAPI;
109
+ /**
110
+ * The `accountAddons` method provides access to the Account Addons endpoints
111
+ * in ShipEngine API.
112
+ */
113
+ get accountAddons(): AccountAddonsAPI;
108
114
  /**
109
115
  * The `accountBilling` method provides access to the Account Billing (Recurly) endpoints
110
116
  * in ShipEngine API.
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as SE from "./types";
2
2
  export * from "./account-settings";
3
+ export * from "./account-addons";
3
4
  export * from "./addresses";
4
5
  export * from "./auctane-pay";
5
6
  export * from "./account-billing-plan";
package/index.js CHANGED
@@ -216,6 +216,20 @@ class AccountSettingsAPI {
216
216
  }
217
217
  }
218
218
 
219
+ class AccountAddonsAPI {
220
+ constructor(client) {
221
+ this.client = client;
222
+ /**
223
+ * The `list` method retrieves a list of all available addons, also includes
224
+ * if its avaiable for the current user
225
+ */
226
+ this.list = () => {
227
+ return this.client.get("/v1/account/addons");
228
+ };
229
+ this.client = client;
230
+ }
231
+ }
232
+
219
233
  class AddressesAPI {
220
234
  constructor(client) {
221
235
  this.client = client;
@@ -21891,6 +21905,13 @@ class ShipEngineAPI {
21891
21905
  get accountBillingPlan() {
21892
21906
  return new AccountBillingPlanAPI(this.client);
21893
21907
  }
21908
+ /**
21909
+ * The `accountAddons` method provides access to the Account Addons endpoints
21910
+ * in ShipEngine API.
21911
+ */
21912
+ get accountAddons() {
21913
+ return new AccountAddonsAPI(this.client);
21914
+ }
21894
21915
  /**
21895
21916
  * The `accountBilling` method provides access to the Account Billing (Recurly) endpoints
21896
21917
  * in ShipEngine API.
@@ -22093,6 +22114,7 @@ class ShipEngineAPI {
22093
22114
  }
22094
22115
  }
22095
22116
 
22117
+ exports.AccountAddonsAPI = AccountAddonsAPI;
22096
22118
  exports.AccountBillingAPI = AccountBillingAPI;
22097
22119
  exports.AccountBillingPlanAPI = AccountBillingPlanAPI;
22098
22120
  exports.AccountBillingPlanChangeType = AccountBillingPlanChangeType;
package/index.mjs CHANGED
@@ -212,6 +212,20 @@ class AccountSettingsAPI {
212
212
  }
213
213
  }
214
214
 
215
+ class AccountAddonsAPI {
216
+ constructor(client) {
217
+ this.client = client;
218
+ /**
219
+ * The `list` method retrieves a list of all available addons, also includes
220
+ * if its avaiable for the current user
221
+ */
222
+ this.list = () => {
223
+ return this.client.get("/v1/account/addons");
224
+ };
225
+ this.client = client;
226
+ }
227
+ }
228
+
215
229
  class AddressesAPI {
216
230
  constructor(client) {
217
231
  this.client = client;
@@ -21887,6 +21901,13 @@ class ShipEngineAPI {
21887
21901
  get accountBillingPlan() {
21888
21902
  return new AccountBillingPlanAPI(this.client);
21889
21903
  }
21904
+ /**
21905
+ * The `accountAddons` method provides access to the Account Addons endpoints
21906
+ * in ShipEngine API.
21907
+ */
21908
+ get accountAddons() {
21909
+ return new AccountAddonsAPI(this.client);
21910
+ }
21890
21911
  /**
21891
21912
  * The `accountBilling` method provides access to the Account Billing (Recurly) endpoints
21892
21913
  * in ShipEngine API.
@@ -22089,4 +22110,4 @@ class ShipEngineAPI {
22089
22110
  }
22090
22111
  }
22091
22112
 
22092
- export { AccountBillingAPI, AccountBillingPlanAPI, AccountBillingPlanChangeType, AccountSettingsAPI, AddressesAPI, AuctanePayAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, UsersApi, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
22113
+ export { AccountAddonsAPI, AccountBillingAPI, AccountBillingPlanAPI, AccountBillingPlanChangeType, AccountSettingsAPI, AddressesAPI, AuctanePayAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, UsersApi, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.13.0",
3
+ "version": "4.15.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
package/types.d.ts CHANGED
@@ -2,6 +2,7 @@ export type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
2
2
  export * from "./account-settings/types";
3
3
  export * from "./account-billing-plan/types";
4
4
  export * from "./account-billing/types";
5
+ export * from "./account-addons/types";
5
6
  export * from "./addresses/types";
6
7
  export * from "./auctane-pay/types";
7
8
  export * from "./carriers/types";