Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add exports for missing typescript definitions #434

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next Release

- Adds missing exports to Typescript definitions (ApiKey, Billing, Brand, EndShipper, Fee, PaymentMethod, Rate, Refund) - closes #433

## v7.1.0 (2024-01-08)

- Adds `allChildren` function in User service to get a paginated list of children
Expand Down
36 changes: 0 additions & 36 deletions types/CarbonOffset/CarbonOffset.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion types/CarbonOffset/index.d.ts

This file was deleted.

22 changes: 19 additions & 3 deletions types/EasyPost.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { Address } from './Address';
import { ApiKey } from './ApiKey';
import { Batch } from './Batch';
import { CarrierAccount, CarrierType, CarrierMetadata } from './Carrier';
import { Billing } from './Billing';
import { Brand } from './Brand';
import { CarrierAccount, CarrierMetadata, CarrierType } from './Carrier';
import { CustomsInfo, CustomsItem } from './Customs';
import { EndShipper } from './EndShipper';
import { Event } from './Event';
import { Fee } from './Fee';
import { Insurance } from './Insurance';
import { Order } from './Order';
import { Parcel } from './Parcel';
import { PaymentMethod } from './PaymentMethod';
import { Pickup } from './Pickup';
import { Rate } from './Rate';
import { Referral } from './Referral';
import { Refund } from './Refund';
import { Report } from './Report';
import { ScanForm } from './ScanForm';
import { Shipment } from './Shipment';
Expand Down Expand Up @@ -62,25 +70,33 @@ export interface IEasyPostOptions {

export default class EasyPost {
public Address: typeof Address;
public ApiKey: typeof ApiKey;
public Batch: typeof Batch;
public Billing: typeof Billing;
public Brand: typeof Brand;
public CarrierAccount: typeof CarrierAccount;
public CarrierMetadata: typeof CarrierMetadata;
public CarrierType: typeof CarrierType;
public CustomsInfo: typeof CustomsInfo;
public CustomsItem: typeof CustomsItem;
public EndShipper: typeof EndShipper;
public Event: typeof Event;
public Fee: typeof Fee; // TODO: Fix IFee
public Insurance: typeof Insurance;
public Order: typeof Order;
public Parcel: typeof Parcel;
public PaymentMethod: typeof PaymentMethod;
public Pickup: typeof Pickup;
public Report: typeof Report;
public Rate: typeof Rate;
public Referral: typeof Referral;
public Refund: typeof Refund;
public Report: typeof Report;
public ScanForm: typeof ScanForm;
public Shipment: typeof Shipment;
public Tracker: typeof Tracker;
public Webhook: typeof Webhook;
public User: typeof User;
public Utils: typeof Utils;
public Webhook: typeof Webhook;

public constructor(apiKey: string, options?: IEasyPostOptions);

Expand Down
12 changes: 10 additions & 2 deletions types/Fee/Fee.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IObjectWithId } from '../base';
import { IBaseObject } from '../base';
import { TFeeType } from './FeeType';

/**
Expand All @@ -12,7 +12,7 @@ import { TFeeType } from './FeeType';
*
* @see https://www.easypost.com/docs/api/node#fee-object
*/
export declare interface IFee extends IObjectWithId<'Fee'> {
export declare interface IFee extends IBaseObject<'Fee'> {
/**
* The name of the category of fee. Possible types are "LabelFee", "PostageFee", "InsuranceFee", and "TrackerFee"
*/
Expand All @@ -33,3 +33,11 @@ export declare interface IFee extends IObjectWithId<'Fee'> {
*/
refunded: boolean;
}

export declare class Fee implements IFee {
object: 'Fee';
type: TFeeType;
amount: string;
charged: boolean;
refunded: boolean;
}