Skip to content

[Bug]: Type export issues with ReferralCustomer #515

@annatarviola

Description

@annatarviola

Software Version

8.1.0

Language Version

v21.7.2

Operating System

macOS 15.5

What happened?

  1. When using TypeScript, run const referralCustomer = await client.ReferralCustomer.create({ name: 'Test Referral', email: 'test@example.com', phone: '1111111111', }); as indicated in EasyPost docs
  2. Get TypeScript error "Property 'ReferralCustomer' does not exist on type 'EasyPost'."
  3. Instead run const referralCustomer = await client.Referral.create({ name: 'Test Referral', email: 'test@example.com', phone: '1111111111', }); based on code in library
  4. Get error TypeError: Cannot read properties of undefined (reading 'create')

The code in 1 does work without issues when using regular JS scripts, but the issue arises with TS.

Note: Referral interface may be missing "api_keys" as a type as well which is expected in the response based on the docs.

Issue #456 — past export issue

What was expected?

ReferralCustomer should be exported

Sample Code

// Based on docs:
const referralCustomer = await client.ReferralCustomer.create({
    name: 'Test Referral',
    email: 'test@example.com',
    phone: '1111111111',
  });

// Based on library types:
const referralCustomer = await client.Referral.create({
    name: 'Test Referral',
    email: 'test@example.com',
    phone: '1111111111',
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssue is being researched

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions