Skip to content

Add missing recipients.create type #218

@chuwong35122

Description

@chuwong35122

Expected behavior

According to this documentation, bank_account.number existed and is a required value for recipients creation. This is the expected code (with no errors).

const recp = await omise.recipients.create({
    name: "Somchai Prasert",
    email: "somchai.prasert@example.com",
    type: "individual",
    bank_account: {
      brand: "bbl",
      number: "1234567890",
      name: "SOMCHAI PRASERT",
    },
  });

  console.log(recp);

Actual behavior

Upon completing the omise.recipients.create 's parameter, the following type error occurs...

Object literal may only specify known properties, and 'number' does not exist in type 'IBankAccount'.ts(2353)
index.d.ts(621, 7): The expected type comes from property 'bank_account' which is declared here on type 'IRequest'

The IBankAccount object type is missing its number property.

Update: It seems like the Omise.Recipients object type is missing several attributes written in the documentation.

interface IRequest {
      name: string;
      email?: string;
      description?: string;
      type: string;
      tax_id?: string;
      bank_account: IBankAccount;
      metadata?: { [key: string]: any };
    }

  interface IBankAccount {
    object: string;
    brand: string;
    last_digits: string;
    name: string;
    created: string;
  }

Steps to reproduce the issue

Using "omise": "^0.12.1" installed using bun

Logs

This is only a type error, filling complate type ensures good developer experiences.

Screenshots

No response

Name and version information

bun --version: 1.1.3
node --version: v20.10.0

Using Macbook Air M1
❯ sw_vers
ProductName: macOS
ProductVersion: 14.0
BuildVersion: 23A344

❯ uname
Darwin

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions