You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following was considered valid with previous library version. Also, it works correctly with the new 6.0.0 library version, if the types are supressed, as in the example:
constresult=awaitintercom.contacts.search({query: {operator: MultipleFilterSearchRequest.Operator.Or,value: [{field: 'external_id',operator: SingleFilterSearchRequest.Operator.Equals,value: 'some_external_id',},{// @ts-expect-error TODO remove this once the types in the library are correct, as it works this way.operator: MultipleFilterSearchRequest.Operator.And,// @ts-expect-error TODO remove this once the types in the library are correct, as it works this way.value: [{field: 'role',operator: SingleFilterSearchRequest.Operator.Equals,value: 'user',},{field: 'email',operator: SingleFilterSearchRequest.Operator.Equals,value: `some_email`,},],},],},});
The types don't seem to work correctly around the MultipleFilterSearchRequest variant.
The text was updated successfully, but these errors were encountered:
Thanks for the issue @jaska120! It looks like this is a gap in Intercom's OpenAPI spec here. The request value is defined as either an array of single element filters or an array of multiple element filters (but they cannot be intermixed).
To be clear, the interface is currently typed as the following:
/** * Search using Intercoms Search APIs with more than one filter. */exportinterfaceMultipleFilterSearchRequest{/** An operator to allow boolean inspection between multiple fields. */operator?: MultipleFilterSearchRequest.Operator;value?: MultipleFilterSearchRequest.Value;}exportnamespaceMultipleFilterSearchRequest{/** * An operator to allow boolean inspection between multiple fields. */exporttypeOperator="AND"|"OR";exportconstOperator={And: "AND",Or: "OR",}asconst;exporttypeValue=/** * Add mutiple filters. */|Intercom.MultipleFilterSearchRequest[]/** * Add a single filter field. */|Intercom.SingleFilterSearchRequest[];}
For your use case to work, we will need to:
Confirm with the Intercom team that your use case is actually intended by the API.
Update Intercom's OpenAPI specification to include this new ability.
The following was considered valid with previous library version. Also, it works correctly with the new
6.0.0
library version, if the types are supressed, as in the example:The types don't seem to work correctly around the
MultipleFilterSearchRequest
variant.The text was updated successfully, but these errors were encountered: