@shipengine/js-api 1.10.0 → 1.12.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.
- package/account-settings/types.d.ts +1 -0
- package/connections/api.d.ts +6 -1
- package/connections/types.d.ts +11 -0
- package/index.js +9 -0
- package/index.mjs +9 -0
- package/package.json +1 -1
package/connections/api.d.ts
CHANGED
|
@@ -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
|
}
|
package/connections/types.d.ts
CHANGED
|
@@ -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
|
+
};
|
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
|
}
|