intercom / intercom-node

Node.js bindings for the Intercom API
https://developers.intercom.com
Other
366 stars 116 forks source link

client.conversations.search types are incorrect #296

Closed jesseyay closed 2 years ago

jesseyay commented 2 years ago

Please use the following template to submit your issue. Following this template will allow us to quickly investigate and help you with your issue. Please be aware that issues which do not conform to this template may be closed.

For feature requests please contact us at team@intercom.io

Version info

Expected behavior

Types for conversations search parameters and return values matches library types.

Actual behavior

Types do not match:

Steps to reproduce

Screenshot to show ts errors: image

> yarn tsc
yarn run v1.22.11
$ /Users/jesseaero/Repos/internal-integrations/node_modules/.bin/tsc
src/modules/external/intercom/IntercomService.ts:102:33 - error TS2322: Type '"tag_ids"' is not assignable to type '"type" | "id" | "created_at" | "updated_at" | "title" | "admin_assignee_id" | "team_assignee_id" | "open" | "state" | "read" | "waiting_since" | "snoozed_until" | "priority" | ... 60 more ... | `statistics.last_closed_by.team_ids.${number}`'.

102                                 field: 'tag_ids',
                                    ~~~~~

src/modules/external/intercom/IntercomService.ts:104:41 - error TS2322: Type 'number' is not assignable to type 'FlatQuery<ConversationObject> | NestedQueries<ConversationObject>'.

104                                 value: [123, 123],
                                            ~~~

src/modules/external/intercom/IntercomService.ts:104:46 - error TS2322: Type 'number' is not assignable to type 'FlatQuery<ConversationObject> | NestedQueries<ConversationObject>'.

104                                 value: [123, 123],

Logs

jesseyay commented 2 years ago

Amazing, thanks!