larksuite / node-sdk

larksuite open sdk for nodejs
MIT License
136 stars 27 forks source link

Wrong typescript declarations for bitable.appTableRecord.list #21

Closed felix98765 closed 1 year ago

felix98765 commented 1 year ago

The API bitable.appTableRecord.list (and listWithIterator) returns a plain object in data.items.fields, but the typescript declaration said it is a Map<string, ...>, which is incorrect, it should be a Record<...>.

fields: Map<string, string | boolean | {
    text?: string;
    link?: string;
} | {
    location?: string;
    pname?: string;
    cityname?: string;
    adname?: string;
    address?: string;
    name?: string;
    full_address?: string;
} | Array<string> | Array<{
    id?: string;
    name?: string;
    en_name?: string;
    email?: string;
}> | Array<{
    file_token?: string;
    name?: string;
    type?: string;
    size?: number;
    url?: string;
    tmp_url?: string;
}>>
mazhe-nerd commented 1 year ago

I checked the generation logic, it should be record, but I still need to confirm it。you can useas to manually declare the type first, I will fix it as soon as possible after confirmation.

mazhe-nerd commented 1 year ago

Fixed in 1.8.1