Skip to content

Auto-generated code for main #2261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2826,7 +2826,6 @@ client.esql.query({ query })
** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.
** *`locale` (Optional, string)*
** *`params` (Optional, number | number | string | boolean | null[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.
** *`version` (Optional, Enum("2024.04.01"))*: The version of the ES|QL language in which the "query" field was written.
** *`format` (Optional, string)*: A short version of the Accept header, e.g. json, yaml.
** *`delimiter` (Optional, string)*: The character to use between values within a CSV row. Only valid for the CSV format.

Expand Down
8 changes: 1 addition & 7 deletions src/api/api/esql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Esql {
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>
async query (this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query', 'version']
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'query']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
Expand All @@ -63,12 +63,6 @@ export default class Esql {
body = userBody != null ? { ...userBody } : undefined
}

// a version number is required for all ES|QL queries.
// inject a default value if none is provided.
if (typeof body === 'object' && body.version == null) {
body.version = '2024.04.01'
}

for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
Expand Down
9 changes: 1 addition & 8 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9693,12 +9693,6 @@ export type EqlSearchResponse<TEvent = unknown> = EqlEqlSearchResponseBase<TEven

export type EqlSearchResultPosition = 'tail' | 'head'

export type EsqlBaseServerlessEsqlVersion = '2024.04.01'

export type EsqlBaseStatefulEsqlVersion = '2024.04.01'

export type EsqlEsqlVersion = '2024.04.01'

export interface EsqlQueryRequest extends RequestBase {
format?: string
delimiter?: string
Expand All @@ -9707,7 +9701,6 @@ export interface EsqlQueryRequest extends RequestBase {
locale?: string
params?: ScalarValue[]
query: string
version?: EsqlEsqlVersion
}

export type EsqlQueryResponse = EsqlColumns
Expand Down Expand Up @@ -10555,7 +10548,7 @@ export interface IndicesStorage {
allow_mmap?: boolean
}

export type IndicesStorageType = 'fs' | '' | 'niofs' | 'mmapfs' | 'hybridfs' | string
export type IndicesStorageType = 'fs' | 'niofs' | 'mmapfs' | 'hybridfs' | string

export interface IndicesTemplateMapping {
aliases: Record<IndexName, IndicesAlias>
Expand Down
9 changes: 1 addition & 8 deletions src/api/typesWithBodyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9848,12 +9848,6 @@ export type EqlSearchResponse<TEvent = unknown> = EqlEqlSearchResponseBase<TEven

export type EqlSearchResultPosition = 'tail' | 'head'

export type EsqlBaseServerlessEsqlVersion = '2024.04.01'

export type EsqlBaseStatefulEsqlVersion = '2024.04.01'

export type EsqlEsqlVersion = '2024.04.01'

export interface EsqlQueryRequest extends RequestBase {
format?: string
delimiter?: string
Expand All @@ -9864,7 +9858,6 @@ export interface EsqlQueryRequest extends RequestBase {
locale?: string
params?: ScalarValue[]
query: string
version?: EsqlEsqlVersion
}
}

Expand Down Expand Up @@ -10729,7 +10722,7 @@ export interface IndicesStorage {
allow_mmap?: boolean
}

export type IndicesStorageType = 'fs' | '' | 'niofs' | 'mmapfs' | 'hybridfs' | string
export type IndicesStorageType = 'fs' | 'niofs' | 'mmapfs' | 'hybridfs' | string

export interface IndicesTemplateMapping {
aliases: Record<IndexName, IndicesAlias>
Expand Down
Loading