@shipengine/js-api 1.11.0 → 1.13.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,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { ConnectCarrierAccount, ConnectCarrierAccountResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
2
+ import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
3
3
  /**
4
4
  * # Connections API module - /v1/connections
5
5
  */
@@ -19,4 +19,9 @@ export declare class ConnectionsAPI {
19
19
  * The `connectCarrier` method connects a carrier to account.
20
20
  */
21
21
  connectCarrier: (carrierName: string, formData: ConnectCarrierAccount) => Promise<import("axios").AxiosResponse<ConnectCarrierAccountResponse, any>>;
22
+ /**
23
+ * The `getCarrierConnectionsServicesList` method retrieves a list of services available for a given carrier,
24
+ * identified by the `carrier_code`.
25
+ */
26
+ getCarrierConnectionsServicesList: (carrierCode: string) => Promise<import("axios").AxiosResponse<CarrierServicesListResponse, any>>;
22
27
  }
@@ -1,3 +1,4 @@
1
+ import { CarrierService } from "../carriers/types";
1
2
  import { GenericObject, LocaleBasedQuery } from "../resources";
2
3
  /**
3
4
  * @category Entities
@@ -38,3 +39,13 @@ export type ConnectCarrierAccountResponse = {
38
39
  carrierId?: string;
39
40
  redirectUrl?: string;
40
41
  };
42
+ export type ServicesListSupportedCountries = {
43
+ fromCountry: string;
44
+ };
45
+ export type CarrierProviderService = Pick<CarrierService, "name" | "serviceCode" | "international"> & {
46
+ description: string;
47
+ supportedCountries: ServicesListSupportedCountries[];
48
+ };
49
+ export type CarrierServicesListResponse = {
50
+ services: CarrierProviderService[];
51
+ };
@@ -61,10 +61,17 @@ export interface Term {
61
61
  termType: string;
62
62
  version: string;
63
63
  }
64
- export type MetadataRequiredTerm = {
65
- termType: string;
66
- version: string;
67
- };
64
+ export interface MetadataTermLink {
65
+ link: string;
66
+ locale: string;
67
+ title: string;
68
+ }
69
+ export interface MetadataOptionalTerm extends Term {
70
+ links: MetadataTermLink[];
71
+ }
72
+ export interface MetadataRequiredTerm extends Term {
73
+ links: MetadataTermLink[];
74
+ }
68
75
  export declare enum MetadataCapability {
69
76
  AutoFunding = "auto_funding",
70
77
  UpdatePaymentMethod = "update_payment_method",
@@ -133,6 +140,7 @@ export interface MetadataResponse {
133
140
  capabilities: MetadataCapability[] | null;
134
141
  countryCode: string;
135
142
  currencyCode: string;
143
+ optionalTerms: MetadataOptionalTerm[];
136
144
  registrationRequirements: MetadataRegistrationRequirement[];
137
145
  requiredTerms: MetadataRequiredTerm[];
138
146
  };
package/index.js CHANGED
@@ -1204,6 +1204,15 @@ class ConnectionsAPI {
1204
1204
  formData
1205
1205
  );
1206
1206
  });
1207
+ /**
1208
+ * The `getCarrierConnectionsServicesList` method retrieves a list of services available for a given carrier,
1209
+ * identified by the `carrier_code`.
1210
+ */
1211
+ this.getCarrierConnectionsServicesList = (carrierCode) => {
1212
+ return this.client.get(
1213
+ `/v1/connections/carriers/${carrierCode}/services`
1214
+ );
1215
+ };
1207
1216
  this.client = client;
1208
1217
  }
1209
1218
  }
package/index.mjs CHANGED
@@ -1200,6 +1200,15 @@ class ConnectionsAPI {
1200
1200
  formData
1201
1201
  );
1202
1202
  });
1203
+ /**
1204
+ * The `getCarrierConnectionsServicesList` method retrieves a list of services available for a given carrier,
1205
+ * identified by the `carrier_code`.
1206
+ */
1207
+ this.getCarrierConnectionsServicesList = (carrierCode) => {
1208
+ return this.client.get(
1209
+ `/v1/connections/carriers/${carrierCode}/services`
1210
+ );
1211
+ };
1203
1212
  this.client = client;
1204
1213
  }
1205
1214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {