From 69302003080d45a6a019380768a22abe29815031 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:10:41 -0600 Subject: [PATCH] feat: carrier metadata typescript definitions --- CHANGELOG.md | 5 ++ package-lock.json | 2 +- package.json | 2 +- .../CarrierMetadata/CarrierMetadata.d.ts | 64 +++++++++++++++++++ types/Carrier/CarrierMetadata/index.d.ts | 1 + types/Carrier/index.d.ts | 1 + 6 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 types/Carrier/CarrierMetadata/CarrierMetadata.d.ts create mode 100644 types/Carrier/CarrierMetadata/index.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index def25d540..20d451dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## v6.3.0 (2023-04-24) + +- Fixes the Beta client, previously the beta functions were not accessible due to how they were exported. This has now changed so each service is prepended with `Beta` (eg: `BetaCarrierMetadata`) +- Adds `CarrierMetadata` typescript definitions + ## v6.2.0 (2023-04-18) - Adds beta `retrieveCarrierMetadata` function diff --git a/package-lock.json b/package-lock.json index 49fe6afb6..9a260d6e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@easypost/api", - "version": "6.2.0", + "version": "6.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a686fcac7..4b1a62998 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@easypost/api", "description": "EasyPost Node Client Library", - "version": "6.2.0", + "version": "6.3.0", "author": "Easypost Engineering ", "homepage": "https://easypost.com", "bin": { diff --git a/types/Carrier/CarrierMetadata/CarrierMetadata.d.ts b/types/Carrier/CarrierMetadata/CarrierMetadata.d.ts new file mode 100644 index 000000000..06b6a6956 --- /dev/null +++ b/types/Carrier/CarrierMetadata/CarrierMetadata.d.ts @@ -0,0 +1,64 @@ +/** + * The Carrier Metadata endpoint returns information about all the carriers available on the EasyPost platform. + * This information may include service levels, predefined packages, shipment options, supported features, and + * more that are available per carrier. This metadata can be useful during onboarding and integration or when + * determining the ideal carrier mix for your setup. + * + * @see https://www.easypost.com/docs/api/node#carriermetadata-object + */ +export declare interface ICarrierMetadata { + /** + * The single-word name of a carrier such as "royalmail" + */ + carrier: string; + + /** + * The human-readable name of the carrier + */ + human_readable?: string | null; + + /** + * A list of service level objects for this carrier + */ + service_levels?: Array | null; + + /** + * A list of predefined package objects for this carrier + */ + predefined_packages?: Array | null; + + /** + * A list of supported feature objects for this carrier + */ + supported_features?: Array | null; + + /** + * A list of shipment option objects for this carrier + */ + shipment_options?: Array | null; +} + +export declare class CarrierMetadata implements ICarrierMetadata { + carrier: string; + human_readable?: string | null; + service_levels?: Array | null; + predefined_packages?: Array | null; + supported_features?: Array | null; + shipment_options?: Array | null; + + /** + * Retrieve all Carrier Metadata for all carriers on the EasyPost platform. Optionally, + * filter the response by specifying a list of carriers or metadata types. + * + * @param {Array} carriers A comma-delimited list of single-word carriers you'd like to filter the response by + * @param {Array} types A comma-delimited list of the metadata types you'd like to filter the response by + * + * @see https://www.easypost.com/docs/api/node#retrieve-carrier-metadata + * + * @returns {Promise} The {@link CarrierMetadata} object. + */ + static retrieveCarrierMetadata( + carriers: Array, + types: Array, + ): Promise; +} diff --git a/types/Carrier/CarrierMetadata/index.d.ts b/types/Carrier/CarrierMetadata/index.d.ts new file mode 100644 index 000000000..109e687de --- /dev/null +++ b/types/Carrier/CarrierMetadata/index.d.ts @@ -0,0 +1 @@ +export * from './CarrierMetadata'; diff --git a/types/Carrier/index.d.ts b/types/Carrier/index.d.ts index 0e5acc236..8a86777f2 100644 --- a/types/Carrier/index.d.ts +++ b/types/Carrier/index.d.ts @@ -1,2 +1,3 @@ export * from './CarrierAccount'; +export * from './CarrierMetadata'; export * from './CarrierType';