@shipengine/js-api 1.22.0 → 1.23.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/connections/api.d.ts +11 -1
- package/connections/settings-types.d.ts +42 -0
- package/connections/types.d.ts +1 -0
- package/index.js +19 -0
- package/index.mjs +19 -0
- package/package.json +1 -1
package/connections/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
|
|
2
|
+
import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, ConnectionsCarrierName, ConnectionsCarrierSettingsData, ConnectionsCarrierSettingsResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* # Connections API module - /v1/connections
|
|
5
5
|
*/
|
|
@@ -24,4 +24,14 @@ export declare class ConnectionsAPI {
|
|
|
24
24
|
* identified by the `carrier_code`.
|
|
25
25
|
*/
|
|
26
26
|
getCarrierConnectionsServicesList: (carrierCode: string) => Promise<import("axios").AxiosResponse<CarrierServicesListResponse, any>>;
|
|
27
|
+
/**
|
|
28
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
29
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
30
|
+
*/
|
|
31
|
+
getCarrierSettings: <T extends ConnectionsCarrierName>(carrierName: T, carrierCode: string) => Promise<import("axios").AxiosResponse<ConnectionsCarrierSettingsResponse<T>, any>>;
|
|
32
|
+
/**
|
|
33
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
34
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
35
|
+
*/
|
|
36
|
+
updateCarrierSettings: <T extends ConnectionsCarrierName>(carrierName: T, carrierCode: string, formData: ConnectionsCarrierSettingsData<T>) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
27
37
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type DHLExpressSettings = {
|
|
2
|
+
isPrimaryAccount: boolean;
|
|
3
|
+
nickname: string;
|
|
4
|
+
shouldHideAccountNumberOnArchiveDoc: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type FedexSettings = {
|
|
7
|
+
isPrimaryAccount: boolean;
|
|
8
|
+
letterheadImage?: string;
|
|
9
|
+
nickname: string;
|
|
10
|
+
pickupType: "none" | "regular_pickup" | "request_courier" | "drop_box" | "business_service_center" | "station";
|
|
11
|
+
signatureImage?: string;
|
|
12
|
+
smartPostEndorsement: "none" | "return_service_requested" | "forwarding_service_requested" | "address_service_requested" | "change_service_requested" | "leave_if_no_response";
|
|
13
|
+
smartPostHub: "none" | "allentown_pa" | "atlanta_ga" | "baltimore_md" | "charlotte_nc" | "chino_ca" | "dallas_tx" | "denver_co" | "detroit_mi" | "edison_nj" | "grove_city_oh" | "groveport_oh" | "houston_tx" | "indianapolis_in" | "kansas_city_ks" | "los_angeles_ca" | "martinsburg_wv" | "memphis_tn" | "minneapolis_mn" | "new_berlin_wi" | "northborough_ma" | "orlando_fl" | "phoneix_az" | "pittsburgh_pa" | "reno_nv" | "sacramento_ca" | "salt_lake_city_ut" | "seattle_wa" | "st_louis_mo" | "windsor_ct" | "newark_ny" | "south_brunswick_nj" | "scranton_pa" | "wheeling_il";
|
|
14
|
+
};
|
|
15
|
+
export type UPSSettings = {
|
|
16
|
+
accountCountryCode: string;
|
|
17
|
+
accountNumber: string;
|
|
18
|
+
accountPostalCode: string;
|
|
19
|
+
invoice?: {
|
|
20
|
+
controlId: string;
|
|
21
|
+
invoiceAmount: number;
|
|
22
|
+
invoiceCurrencyCode: string;
|
|
23
|
+
invoiceDate: string;
|
|
24
|
+
invoiceNumber: string;
|
|
25
|
+
};
|
|
26
|
+
isPrimaryAccount: boolean;
|
|
27
|
+
mailInnovationsCostCenter?: string;
|
|
28
|
+
mailInnovationsCustomerGuid?: string;
|
|
29
|
+
mailInnovationsCustomerId?: string;
|
|
30
|
+
mailInnovationsEndorsement: "none" | "return_service_requested" | "forwarding_service_requested" | "address_service_requested" | "change_service_requested" | "leave_if_no_response";
|
|
31
|
+
nickname: string;
|
|
32
|
+
pickupType: "daily_pickup" | "occasional_pickup" | "customer_counter";
|
|
33
|
+
useCarbonNeutralShippingProgram: boolean;
|
|
34
|
+
useConsolidationServices: boolean;
|
|
35
|
+
useGroundFreightPricing: boolean;
|
|
36
|
+
useNegotiatedRates: boolean;
|
|
37
|
+
useOrderNumberOnMailInnovationsLabels: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type UPSUpdateSettings = Omit<UPSSettings, "accountNumber">;
|
|
40
|
+
export type ConnectionsCarrierName = "dhl_express" | "fedex" | "ups";
|
|
41
|
+
export type ConnectionsCarrierSettingsResponse<Name extends ConnectionsCarrierName = ConnectionsCarrierName> = Name extends "dhl_express" ? DHLExpressSettings : Name extends "fedex" ? FedexSettings : Name extends "ups" ? UPSSettings : never;
|
|
42
|
+
export type ConnectionsCarrierSettingsData<Name extends ConnectionsCarrierName = ConnectionsCarrierName> = Name extends "dhl_express" ? DHLExpressSettings : Name extends "fedex" ? FedexSettings : Name extends "ups" ? UPSUpdateSettings : never;
|
package/connections/types.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1221,6 +1221,25 @@ class ConnectionsAPI {
|
|
|
1221
1221
|
`/v1/connections/carriers/${carrierCode}/services`
|
|
1222
1222
|
);
|
|
1223
1223
|
};
|
|
1224
|
+
/**
|
|
1225
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
1226
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1227
|
+
*/
|
|
1228
|
+
this.getCarrierSettings = (carrierName, carrierCode) => {
|
|
1229
|
+
return this.client.get(
|
|
1230
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`
|
|
1231
|
+
);
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
1235
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1236
|
+
*/
|
|
1237
|
+
this.updateCarrierSettings = (carrierName, carrierCode, formData) => {
|
|
1238
|
+
return this.client.put(
|
|
1239
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`,
|
|
1240
|
+
formData
|
|
1241
|
+
);
|
|
1242
|
+
};
|
|
1224
1243
|
this.client = client;
|
|
1225
1244
|
}
|
|
1226
1245
|
}
|
package/index.mjs
CHANGED
|
@@ -1217,6 +1217,25 @@ class ConnectionsAPI {
|
|
|
1217
1217
|
`/v1/connections/carriers/${carrierCode}/services`
|
|
1218
1218
|
);
|
|
1219
1219
|
};
|
|
1220
|
+
/**
|
|
1221
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
1222
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1223
|
+
*/
|
|
1224
|
+
this.getCarrierSettings = (carrierName, carrierCode) => {
|
|
1225
|
+
return this.client.get(
|
|
1226
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`
|
|
1227
|
+
);
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
1231
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1232
|
+
*/
|
|
1233
|
+
this.updateCarrierSettings = (carrierName, carrierCode, formData) => {
|
|
1234
|
+
return this.client.put(
|
|
1235
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`,
|
|
1236
|
+
formData
|
|
1237
|
+
);
|
|
1238
|
+
};
|
|
1220
1239
|
this.client = client;
|
|
1221
1240
|
}
|
|
1222
1241
|
}
|