typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
393 stars 74 forks source link

Missing 'curated' type property for 'SearchResponseHit' interface #164

Closed cdoe closed 1 year ago

cdoe commented 1 year ago

Description

I noticed when running a search including a pinned hit, the hit contains a very helpful curated: true flag. However, curated doesn't seem to be defined on the SearchResponseHit type.

Steps to reproduce

// Referencing
search_results.hits[0].curated
// throws the following type error:
// Property 'curated' does not exist on type 'SearchResponseHit<{ ... }>'

Suggested Solution

https://github.com/typesense/typesense-js/blob/749d3e78a2d586ef88c5e0c88524a3d6060610b8/lib/Typesense/Documents.d.ts#L82 to include:

curated?: true

Metadata

Typesense Version: typesense-js 1.5.4

jasonbosco commented 1 year ago

Ah, that was an oversight. Thank you for catching this. Do you want to do a PR for this? If not, I can add this in.

cdoe commented 1 year ago

@jasonbosco Just submitted PR #165. I added a couple other things that stood out to me. Happy to discuss further.

jasonbosco commented 1 year ago

Thanks @cdoe! I just published your changes in v1.7.0-3. Could you give it a shot?

cdoe commented 1 year ago

@jasonbosco I've been running it through all my use cases, and everything seems to be working pretty nicely!