API generation

This commit is contained in:
delvedor
2021-11-03 14:28:43 +01:00
parent 88933ad39e
commit 76659b604f
46 changed files with 1326 additions and 1103 deletions

View File

@ -114,16 +114,15 @@ export default class AsyncSearch {
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument>>
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggs', 'aggregations', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -131,7 +130,12 @@ export default class AsyncSearch {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
querystring[key] = params[key]
} else {
// @ts-expect-error
body[key] = params[key]
}
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {

View File

@ -72,14 +72,13 @@ export default class Ccr {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['leader_index', 'max_outstanding_read_requests', 'max_outstanding_write_requests', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size', 'read_poll_timeout', 'remote_cluster']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -151,14 +150,13 @@ export default class Ccr {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['follower_cluster', 'follower_index', 'follower_index_uuid', 'leader_remote_cluster']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -260,14 +258,13 @@ export default class Ccr {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['remote_cluster', 'follow_index_pattern', 'leader_index_patterns', 'leader_index_exclusion_patterns', 'max_outstanding_read_requests', 'settings', 'max_outstanding_write_requests', 'read_poll_timeout', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -317,14 +314,13 @@ export default class Ccr {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['max_outstanding_read_requests', 'max_outstanding_write_requests', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size', 'read_poll_timeout']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll
const acceptedPath: string[] = []
const acceptedBody: string[] = ['scroll_id']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo
const acceptedPath: string[] = []
const acceptedBody: string[] = ['id']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -50,14 +50,13 @@ export default class Cluster {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['current_node', 'index', 'primary', 'shard']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -282,14 +281,13 @@ export default class Cluster {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['template', 'aliases', 'mappings', 'settings', 'version', '_meta']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -317,14 +315,13 @@ export default class Cluster {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['persistent', 'transient']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -376,14 +373,13 @@ export default class Cluster {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['commands']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function CountApi (this: That, params?: T.CountRequest | TB
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['query']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['max_docs', 'query', 'slice']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -124,14 +124,13 @@ export default class Enrich {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['geo_match', 'match']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -116,14 +116,13 @@ export default class Eql {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'size', 'fields', 'result_position']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function ExplainApi<TDocument = unknown> (this: That, param
const acceptedPath: string[] = ['id', 'index']
const acceptedBody: string[] = ['query']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -86,10 +86,10 @@ export default class Fleet {
let path = ''
if (params.index != null) {
method = body != null ? 'POST' : 'GET'
path = `/${encodeURIComponent(params.index.toString())}/_fleet/_msearch`
path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_msearch`
} else {
method = body != null ? 'POST' : 'GET'
path = '/_fleet/_msearch'
path = '/_fleet/_fleet_msearch'
}
return await this.transport.request({ path, method, querystring, bulkBody: body }, options)
}
@ -112,7 +112,7 @@ export default class Fleet {
}
const method = body != null ? 'POST' : 'GET'
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_search`
const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search`
return await this.transport.request({ path, method, querystring, body }, options)
}
}

View File

@ -50,14 +50,13 @@ export default class Graph {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['connections', 'controls', 'query', 'vertices']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -169,14 +169,13 @@ export default class Ilm {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['current_step', 'next_step']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -204,14 +203,13 @@ export default class Ilm {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['policy']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -72,14 +72,13 @@ export default class Indices {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['analyzer', 'attributes', 'char_filter', 'explain', 'field', 'filter', 'normalizer', 'text', 'tokenizer']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -145,14 +144,13 @@ export default class Indices {
const acceptedPath: string[] = ['index', 'target']
const acceptedBody: string[] = ['aliases', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -202,14 +200,13 @@ export default class Indices {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aliases', 'mappings', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -620,28 +617,6 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body }, options)
}
async freeze (this: That, params: T.IndicesFreezeRequest | TB.IndicesFreezeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesFreezeResponse>
async freeze (this: That, params: T.IndicesFreezeRequest | TB.IndicesFreezeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesFreezeResponse, unknown>>
async freeze (this: That, params: T.IndicesFreezeRequest | TB.IndicesFreezeRequest, options?: TransportRequestOptions): Promise<T.IndicesFreezeResponse>
async freeze (this: That, params: T.IndicesFreezeRequest | TB.IndicesFreezeRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_freeze`
return await this.transport.request({ path, method, querystring, body }, options)
}
async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetResponse>
async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetResponse, unknown>>
async get (this: That, params: T.IndicesGetRequest | TB.IndicesGetRequest, options?: TransportRequestOptions): Promise<T.IndicesGetResponse>
@ -980,14 +955,13 @@ export default class Indices {
const acceptedPath: string[] = ['index', 'name']
const acceptedBody: string[] = ['filter', 'index_routing', 'is_write_index', 'routing', 'search_routing']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1022,14 +996,13 @@ export default class Indices {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1057,14 +1030,13 @@ export default class Indices {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['date_detection', 'dynamic', 'dynamic_date_formats', 'dynamic_templates', '_field_names', '_meta', 'numeric_detection', 'properties', '_routing', '_source', 'runtime']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1126,14 +1098,13 @@ export default class Indices {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1265,14 +1236,13 @@ export default class Indices {
const acceptedPath: string[] = ['alias', 'new_index']
const acceptedBody: string[] = ['aliases', 'conditions', 'mappings', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1367,14 +1337,13 @@ export default class Indices {
const acceptedPath: string[] = ['index', 'target']
const acceptedBody: string[] = ['aliases', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1402,14 +1371,13 @@ export default class Indices {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['index_patterns', 'composed_of', 'overlapping', 'template']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1471,14 +1439,13 @@ export default class Indices {
const acceptedPath: string[] = ['index', 'target']
const acceptedBody: string[] = ['aliases', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1564,14 +1531,13 @@ export default class Indices {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['actions']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -1600,14 +1566,13 @@ export default class Indices {
const acceptedPath: string[] = ['index', 'type']
const acceptedBody: string[] = ['query']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -148,14 +148,13 @@ export default class Ingest {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['_meta', 'description', 'on_failure', 'processors', 'version']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -183,14 +182,13 @@ export default class Ingest {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['docs', 'pipeline']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -37,19 +37,31 @@ import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default async function KnnSearchApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
export default async function KnnSearchApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
export default async function KnnSearchApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
export default async function KnnSearchApi (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.KnnSearchResponse<TDocument>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.KnnSearchResponse<TDocument>, unknown>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<T.KnnSearchResponse<TDocument>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'knn']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}

View File

@ -142,14 +142,13 @@ export default class License {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['license', 'licenses']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function MgetApi<TDocument = unknown> (this: That, params?:
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['docs', 'ids']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -182,14 +182,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['requests_per_second', 'timeout']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -364,14 +363,13 @@ export default class Ml {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['analysis_config', 'max_bucket_cardinality', 'overall_cardinality']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -400,14 +398,13 @@ export default class Ml {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['evaluation', 'index', 'query']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -435,14 +432,13 @@ export default class Ml {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['source', 'dest', 'analysis', 'description', 'model_memory_limit', 'max_num_threads', 'analyzed_fields', 'allow_lazy_start']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -477,14 +473,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['advance_time', 'calc_interim', 'end', 'start']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -512,14 +507,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['duration', 'expires_in', 'max_model_memory']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -545,16 +539,15 @@ export default class Ml {
async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptions): Promise<T.MlGetBucketsResponse>
async getBuckets (this: That, params: T.MlGetBucketsRequest | TB.MlGetBucketsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id', 'timestamp']
const acceptedBody: string[] = ['anomaly_score', 'desc', 'exclude_interim', 'expand', 'page', 'sort', 'start', 'end']
const acceptedBody: string[] = ['anomaly_score', 'desc', 'exclude_interim', 'expand', 'sort', 'start', 'end']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -611,14 +604,13 @@ export default class Ml {
const acceptedPath: string[] = ['calendar_id']
const acceptedBody: string[] = ['page']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -654,14 +646,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id', 'category_id']
const acceptedBody: string[] = ['page']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -846,14 +837,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['page']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -941,14 +931,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
const acceptedBody: string[] = ['start', 'end']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -981,24 +970,11 @@ export default class Ml {
async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise<T.MlGetOverallBucketsResponse>
async getOverallBuckets (this: That, params: T.MlGetOverallBucketsRequest | TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['allow_no_jobs']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
}
const body = undefined
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
@ -1018,14 +994,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['desc', 'exclude_interim', 'page', 'record_score', 'sort', 'start', 'end']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1180,14 +1155,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['timeout']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1215,14 +1189,13 @@ export default class Ml {
const acceptedPath: string[] = ['calendar_id']
const acceptedBody: string[] = ['events']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1277,14 +1250,13 @@ export default class Ml {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['config']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -1318,16 +1290,15 @@ export default class Ml {
async previewDatafeed<TDocument = unknown> (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise<T.MlPreviewDatafeedResponse<TDocument>>
async previewDatafeed<TDocument = unknown> (this: That, params?: T.MlPreviewDatafeedRequest | TB.MlPreviewDatafeedRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['datafeed_id']
const acceptedBody: string[] = ['job_config', 'datafeed_config']
const acceptedBody: string[] = ['datafeed_config', 'job_config']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -1363,14 +1334,13 @@ export default class Ml {
const acceptedPath: string[] = ['calendar_id']
const acceptedBody: string[] = ['description']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1420,14 +1390,13 @@ export default class Ml {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1455,14 +1424,13 @@ export default class Ml {
const acceptedPath: string[] = ['datafeed_id']
const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1490,14 +1458,13 @@ export default class Ml {
const acceptedPath: string[] = ['filter_id']
const acceptedBody: string[] = ['description', 'items']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1525,14 +1492,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_config', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'daily_model_snapshot_retention_after_days', 'data_description', 'datafeed_config', 'description', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1560,14 +1526,13 @@ export default class Ml {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'tags']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1683,14 +1648,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
const acceptedBody: string[] = ['delete_intervening_results']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1763,14 +1727,13 @@ export default class Ml {
const acceptedPath: string[] = ['datafeed_id']
const acceptedBody: string[] = ['end', 'start', 'timeout']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1842,14 +1805,13 @@ export default class Ml {
const acceptedPath: string[] = ['datafeed_id']
const acceptedBody: string[] = ['force', 'timeout']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1899,14 +1861,13 @@ export default class Ml {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['description', 'model_memory_limit', 'max_num_threads', 'allow_lazy_start']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1956,14 +1917,13 @@ export default class Ml {
const acceptedPath: string[] = ['filter_id']
const acceptedBody: string[] = ['add_items', 'description', 'remove_items']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1991,14 +1951,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -2026,14 +1985,13 @@ export default class Ml {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
const acceptedBody: string[] = ['description', 'retain']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -2083,14 +2041,13 @@ export default class Ml {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_retention_days', 'results_index_name']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function MtermvectorsApi (this: That, params?: T.Mtermvecto
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['docs', 'ids']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -160,14 +160,13 @@ export default class Nodes {
const acceptedPath: string[] = ['node_id']
const acceptedBody: string[] = ['secure_settings_password']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque
const acceptedPath: string[] = ['id', 'context']
const acceptedBody: string[] = ['script']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['requests', 'metric']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function ReindexApi (this: That, params?: T.ReindexRequest
const acceptedPath: string[] = []
const acceptedBody: string[] = ['conflicts', 'dest', 'max_docs', 'script', 'size', 'source']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['file', 'params', 'source']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -154,14 +154,13 @@ export default class Rollup {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['cron', 'groups', 'index_pattern', 'metrics', 'page_size', 'rollup_index']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -214,16 +213,15 @@ export default class Rollup {
async rollupSearch<TDocument = unknown> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise<T.RollupRollupSearchResponse<TDocument>>
async rollupSearch<TDocument = unknown> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index', 'type']
const acceptedBody: string[] = ['aggs', 'query', 'size']
const acceptedBody: string[] = ['aggregations', 'query', 'size']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function ScriptsPainlessExecuteApi<TResult = unknown> (this
const acceptedPath: string[] = []
const acceptedBody: string[] = ['context', 'context_setup', 'script']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -44,14 +44,13 @@ export default async function ScrollApi<TDocument = unknown> (this: That, params
const acceptedPath: string[] = []
const acceptedBody: string[] = ['scroll', 'scroll_id']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -42,16 +42,15 @@ export default async function SearchApi<TDocument = unknown> (this: That, params
export default async function SearchApi<TDocument = unknown> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument>>
export default async function SearchApi<TDocument = unknown> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggs', 'aggregations', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -59,7 +58,12 @@ export default async function SearchApi<TDocument = unknown> (this: That, params
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
querystring[key] = params[key]
} else {
// @ts-expect-error
body[key] = params[key]
}
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {

View File

@ -44,14 +44,13 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque
const acceptedPath: string[] = ['index', 'field', 'zoom', 'x', 'y']
const acceptedBody: string[] = ['aggs', 'exact_bounds', 'extent', 'fields', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function SearchTemplateApi<TDocument = unknown> (this: That
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['explain', 'id', 'params', 'profile', 'source']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -109,14 +109,13 @@ export default class SearchableSnapshots {
const acceptedPath: string[] = ['repository', 'snapshot']
const acceptedBody: string[] = ['index', 'renamed_index', 'index_settings', 'ignore_index_settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -73,14 +73,13 @@ export default class Security {
const acceptedPath: string[] = ['username']
const acceptedBody: string[] = ['password']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -226,14 +225,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['expiration', 'name', 'role_descriptors', 'metadata']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -683,14 +681,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['grant_type', 'scope', 'password', 'kerberos_ticket', 'refresh_token', 'username']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -772,14 +769,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['api_key', 'grant_type', 'access_token', 'username', 'password']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -807,14 +803,13 @@ export default class Security {
const acceptedPath: string[] = ['user']
const acceptedBody: string[] = ['application', 'cluster', 'index']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -850,14 +845,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['id', 'ids', 'name', 'owner', 'realm_name', 'username']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -886,14 +880,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['token', 'refresh_token', 'realm_name', 'username']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -949,14 +942,13 @@ export default class Security {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['applications', 'cluster', 'global', 'indices', 'metadata', 'run_as', 'transient_metadata']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -984,14 +976,13 @@ export default class Security {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['enabled', 'metadata', 'roles', 'rules', 'run_as']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -1019,14 +1010,13 @@ export default class Security {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['username', 'email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -193,14 +193,13 @@ export default class Slm {
const acceptedPath: string[] = ['policy_id']
const acceptedBody: string[] = ['config', 'name', 'repository', 'retention', 'schedule']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -72,14 +72,13 @@ export default class Snapshot {
const acceptedPath: string[] = ['repository', 'snapshot', 'target_snapshot']
const acceptedBody: string[] = ['indices']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -107,14 +106,13 @@ export default class Snapshot {
const acceptedPath: string[] = ['repository', 'snapshot']
const acceptedBody: string[] = ['ignore_unavailable', 'include_global_state', 'indices', 'feature_states', 'metadata', 'partial']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -142,14 +140,13 @@ export default class Snapshot {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['repository', 'type', 'settings']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -295,14 +292,13 @@ export default class Snapshot {
const acceptedPath: string[] = ['repository', 'snapshot']
const acceptedBody: string[] = ['ignore_index_settings', 'ignore_unavailable', 'include_aliases', 'include_global_state', 'index_settings', 'indices', 'partial', 'rename_pattern', 'rename_replacement']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -50,14 +50,13 @@ export default class Sql {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['cursor']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -151,14 +150,13 @@ export default class Sql {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['columnar', 'cursor', 'fetch_size', 'filter', 'query', 'request_timeout', 'page_timeout', 'time_zone', 'field_multi_value_leniency']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -187,14 +185,13 @@ export default class Sql {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['fetch_size', 'filter', 'query', 'time_zone']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function TermsEnumApi (this: That, params: T.TermsEnumReque
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['field', 'size', 'timeout', 'case_insensitive', 'index_filter', 'string', 'search_after']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function TermvectorsApi<TDocument = unknown> (this: That, p
const acceptedPath: string[] = ['index', 'id']
const acceptedBody: string[] = ['doc', 'filter', 'per_field_analyzer']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -124,14 +124,13 @@ export default class Transform {
const acceptedPath: string[] = ['transform_id']
const acceptedBody: string[] = ['dest', 'description', 'frequency', 'pivot', 'source', 'settings', 'sync', 'retention_policy', 'latest']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -167,14 +166,13 @@ export default class Transform {
const acceptedPath: string[] = ['transform_id']
const acceptedBody: string[] = ['dest', 'description', 'frequency', 'pivot', 'source', 'settings', 'sync', 'retention_policy', 'latest']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -246,14 +244,13 @@ export default class Transform {
const acceptedPath: string[] = ['transform_id']
const acceptedBody: string[] = ['dest', 'description', 'frequency', 'source', 'settings', 'sync', 'retention_policy']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function UpdateApi<TDocument = unknown, TPartialDocument =
const acceptedPath: string[] = ['id', 'index', 'type']
const acceptedBody: string[] = ['detect_noop', 'doc', 'doc_as_upsert', 'script', 'scripted_upsert', '_source', 'upsert']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -44,14 +44,13 @@ export default async function UpdateByQueryApi (this: That, params: T.UpdateByQu
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['max_docs', 'query', 'script', 'slice', 'conflicts']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {

View File

@ -145,14 +145,13 @@ export default class Watcher {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['action_modes', 'alternative_input', 'ignore_condition', 'record_execution', 'simulated_actions', 'trigger_data', 'watch']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
@ -210,14 +209,13 @@ export default class Watcher {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['actions', 'condition', 'input', 'metadata', 'throttle_period', 'transform', 'trigger']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
@ -245,14 +243,13 @@ export default class Watcher {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['from', 'size', 'query', 'sort', 'search_after']
const querystring: Record<string, any> = {}
let body: Record<string, any> | string
// @ts-expect-error
if (typeof params?.body === 'string') {
// @ts-expect-error
body = params.body
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
// @ts-expect-error
body = params?.body != null ? { ...params.body } : undefined
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}

View File

@ -207,7 +207,6 @@ interface KibanaClient {
fieldUsageStats: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
flush: <TContext = unknown>(params?: T.IndicesFlushRequest| TB.IndicesFlushRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesFlushResponse, TContext>>
forcemerge: <TContext = unknown>(params?: T.IndicesForcemergeRequest| TB.IndicesForcemergeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesForcemergeResponse, TContext>>
freeze: <TContext = unknown>(params: T.IndicesFreezeRequest| TB.IndicesFreezeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesFreezeResponse, TContext>>
get: <TContext = unknown>(params: T.IndicesGetRequest| TB.IndicesGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetResponse, TContext>>
getAlias: <TContext = unknown>(params?: T.IndicesGetAliasRequest| TB.IndicesGetAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetAliasResponse, TContext>>
getDataStream: <TContext = unknown>(params?: T.IndicesGetDataStreamRequest| TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetDataStreamResponse, TContext>>
@ -250,7 +249,7 @@ interface KibanaClient {
putPipeline: <TContext = unknown>(params: T.IngestPutPipelineRequest| TB.IngestPutPipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestPutPipelineResponse, TContext>>
simulate: <TContext = unknown>(params?: T.IngestSimulateRequest| TB.IngestSimulateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestSimulateResponse, TContext>>
}
knnSearch: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
knnSearch: <TDocument = unknown, TContext = unknown>(params: T.KnnSearchRequest| TB.KnnSearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.KnnSearchResponse<TDocument>, TContext>>
license: {
delete: <TContext = unknown>(params?: T.LicenseDeleteRequest| TB.LicenseDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseDeleteResponse, TContext>>
get: <TContext = unknown>(params?: T.LicenseGetRequest| TB.LicenseGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseGetResponse, TContext>>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff