Skip to content

Missing TS types for hidden setting and data stream property on Get indices response #532

@cjcenizal

Description

@cjcenizal

🐛 Wrong type

The indices.get response's indices are missing two properties:

  • settings.index.hidden
  • data_stream

Definition

If I attempt to access the hidden property of an index's settings, e.g. index.settings.index.hidden, TS complains:

Property 'index' does not exist on type 'IndicesIndexSettings | IndicesIndexStatePrefixedSettings'.
  Property 'index' does not exist on type 'IndicesIndexSettings'. ts(2339)

However, this property exists and is accessible in the response. It looks like it's defined as an alias here: https://github.com/elastic/elasticsearch-specification/blob/main/specification/indices/_types/IndexSettings.ts#L74. My TS fu is not strong enough to suggest a fix for this.

If I attempt to access the data_stream property of an index, e.g. index.data_stream, TS complains:

Property 'data_stream' does not exist on type 'IndicesIndexState'.ts(2339)

I believe we need to update IndexState to have this property, defined here: https://github.com/elastic/elasticsearch-specification/blob/main/specification/indices/_types/IndexState.ts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions