Skip to content

Commit

Permalink
Merge pull request EasyPost#373 from EasyPost/carrier_metadata_typesc…
Browse files Browse the repository at this point in the history
…ript

feat: carrier metadata typescript definitions
  • Loading branch information
Justintime50 authored Apr 24, 2023
2 parents 2a190ca + 6930200 commit d21b15b
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@easypost/api",
"description": "EasyPost Node Client Library",
"version": "6.2.0",
"version": "6.3.0",
"author": "Easypost Engineering <[email protected]>",
"homepage": "https://easypost.com",
"bin": {
Expand Down
64 changes: 64 additions & 0 deletions types/Carrier/CarrierMetadata/CarrierMetadata.d.ts
Original file line number Diff line number Diff line change
@@ -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<Object> | null;

/**
* A list of predefined package objects for this carrier
*/
predefined_packages?: Array<Object> | null;

/**
* A list of supported feature objects for this carrier
*/
supported_features?: Array<Object> | null;

/**
* A list of shipment option objects for this carrier
*/
shipment_options?: Array<Object> | null;
}

export declare class CarrierMetadata implements ICarrierMetadata {
carrier: string;
human_readable?: string | null;
service_levels?: Array<Object> | null;
predefined_packages?: Array<Object> | null;
supported_features?: Array<Object> | null;
shipment_options?: Array<Object> | 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<CarrierMetadata[]>} The {@link CarrierMetadata} object.
*/
static retrieveCarrierMetadata(
carriers: Array<string>,
types: Array<string>,
): Promise<CarrierMetadata>;
}
1 change: 1 addition & 0 deletions types/Carrier/CarrierMetadata/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './CarrierMetadata';
1 change: 1 addition & 0 deletions types/Carrier/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './CarrierAccount';
export * from './CarrierMetadata';
export * from './CarrierType';

0 comments on commit d21b15b

Please sign in to comment.