diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index bd35b10a4..501465a52 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -8420,6 +8420,7 @@ client.logstash.putPipeline({ id }) #### Request (object) [_request_logstash.put_pipeline] - **`id` (string)**: An identifier for the pipeline. +Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers. - **`pipeline` (Optional, { description, on_failure, processors, version, deprecated, _meta })** ## client.migration.deprecations [_migration.deprecations] diff --git a/src/api/api/async_search.ts b/src/api/api/async_search.ts index 4e9a0cf16..7ea7e9fd4 100644 --- a/src/api/api/async_search.ts +++ b/src/api/api/async_search.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class AsyncSearch { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'async_search.delete': { path: [ 'id' @@ -160,7 +161,7 @@ export default class AsyncSearch { async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.delete'] + } = this[kAcceptedParams]['async_search.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -190,7 +191,10 @@ export default class AsyncSearch { name: 'async_search.delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -205,7 +209,7 @@ export default class AsyncSearch { async get> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.get'] + } = this[kAcceptedParams]['async_search.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -235,7 +239,13 @@ export default class AsyncSearch { name: 'async_search.get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive', + 'typed_keys', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -250,7 +260,7 @@ export default class AsyncSearch { async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['async_search.status'] + } = this[kAcceptedParams]['async_search.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -280,7 +290,11 @@ export default class AsyncSearch { name: 'async_search.status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -297,7 +311,7 @@ export default class AsyncSearch { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['async_search.submit'] + } = this[kAcceptedParams]['async_search.submit'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -349,7 +363,86 @@ export default class AsyncSearch { name: 'async_search.submit', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'collapse', + 'explain', + 'ext', + 'from', + 'highlight', + 'track_total_hits', + 'indices_boost', + 'docvalue_fields', + 'knn', + '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', + 'wait_for_completion_timeout', + 'keep_alive', + 'keep_on_completion', + 'allow_no_indices', + 'allow_partial_search_results', + 'analyzer', + 'analyze_wildcard', + 'batched_reduce_size', + 'ccs_minimize_roundtrips', + 'default_operator', + 'df', + 'docvalue_fields', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'lenient', + 'max_concurrent_shard_requests', + 'preference', + 'request_cache', + 'routing', + 'search_type', + 'stats', + 'stored_fields', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'terminate_after', + 'timeout', + 'track_total_hits', + 'track_scores', + 'typed_keys', + 'rest_total_hits_as_int', + 'version', + '_source', + '_source_excludes', + '_source_includes', + 'seq_no_primary_term', + 'q', + 'size', + 'from', + 'sort' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/autoscaling.ts b/src/api/api/autoscaling.ts index f6036e466..8e5141505 100644 --- a/src/api/api/autoscaling.ts +++ b/src/api/api/autoscaling.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Autoscaling { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'autoscaling.delete_autoscaling_policy': { path: [ 'name' @@ -86,7 +87,7 @@ export default class Autoscaling { async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.delete_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.delete_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -116,7 +117,12 @@ export default class Autoscaling { name: 'autoscaling.delete_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -131,7 +137,7 @@ export default class Autoscaling { async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.get_autoscaling_capacity'] + } = this[kAcceptedParams]['autoscaling.get_autoscaling_capacity'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -159,7 +165,10 @@ export default class Autoscaling { const method = 'GET' const path = '/_autoscaling/capacity' const meta: TransportRequestMetadata = { - name: 'autoscaling.get_autoscaling_capacity' + name: 'autoscaling.get_autoscaling_capacity', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -174,7 +183,7 @@ export default class Autoscaling { async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['autoscaling.get_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.get_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -204,7 +213,11 @@ export default class Autoscaling { name: 'autoscaling.get_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -221,7 +234,7 @@ export default class Autoscaling { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['autoscaling.put_autoscaling_policy'] + } = this[kAcceptedParams]['autoscaling.put_autoscaling_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -251,7 +264,13 @@ export default class Autoscaling { name: 'autoscaling.put_autoscaling_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/bulk.ts b/src/api/api/bulk.ts index 413e9461b..4460fca66 100644 --- a/src/api/api/bulk.ts +++ b/src/api/api/bulk.ts @@ -102,7 +102,23 @@ export default async function BulkApi + [kAcceptedParams]: Record } export default class Cat { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'cat.aliases': { path: [ 'name' @@ -363,7 +364,7 @@ export default class Cat { async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.aliases'] + } = this[kAcceptedParams]['cat.aliases'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -401,7 +402,14 @@ export default class Cat { name: 'cat.aliases', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'expand_wildcards', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +424,7 @@ export default class Cat { async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.allocation'] + } = this[kAcceptedParams]['cat.allocation'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -454,7 +462,15 @@ export default class Cat { name: 'cat.allocation', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'bytes', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -469,7 +485,7 @@ export default class Cat { async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.component_templates'] + } = this[kAcceptedParams]['cat.component_templates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -507,7 +523,14 @@ export default class Cat { name: 'cat.component_templates', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -522,7 +545,7 @@ export default class Cat { async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.count'] + } = this[kAcceptedParams]['cat.count'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -560,7 +583,12 @@ export default class Cat { name: 'cat.count', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -575,7 +603,7 @@ export default class Cat { async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.fielddata'] + } = this[kAcceptedParams]['cat.fielddata'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -613,7 +641,14 @@ export default class Cat { name: 'cat.fielddata', pathParts: { fields: params.fields - } + }, + acceptedParams: [ + 'fields', + 'bytes', + 'fields', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -628,7 +663,7 @@ export default class Cat { async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.health'] + } = this[kAcceptedParams]['cat.health'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -656,7 +691,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/health' const meta: TransportRequestMetadata = { - name: 'cat.health' + name: 'cat.health', + acceptedParams: [ + 'time', + 'ts', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -671,7 +712,7 @@ export default class Cat { async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.help'] + } = this[kAcceptedParams]['cat.help'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -699,7 +740,9 @@ export default class Cat { const method = 'GET' const path = '/_cat' const meta: TransportRequestMetadata = { - name: 'cat.help' + name: 'cat.help', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -714,7 +757,7 @@ export default class Cat { async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.indices'] + } = this[kAcceptedParams]['cat.indices'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -752,7 +795,19 @@ export default class Cat { name: 'cat.indices', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'bytes', + 'expand_wildcards', + 'health', + 'include_unloaded_segments', + 'pri', + 'time', + 'master_timeout', + 'h', + 's' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -767,7 +822,7 @@ export default class Cat { async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.master'] + } = this[kAcceptedParams]['cat.master'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -795,7 +850,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/master' const meta: TransportRequestMetadata = { - name: 'cat.master' + name: 'cat.master', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -810,7 +871,7 @@ export default class Cat { async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_data_frame_analytics'] + } = this[kAcceptedParams]['cat.ml_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -848,7 +909,15 @@ export default class Cat { name: 'cat.ml_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'bytes', + 'h', + 's', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -863,7 +932,7 @@ export default class Cat { async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_datafeeds'] + } = this[kAcceptedParams]['cat.ml_datafeeds'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -901,7 +970,14 @@ export default class Cat { name: 'cat.ml_datafeeds', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'h', + 's', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -916,7 +992,7 @@ export default class Cat { async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_jobs'] + } = this[kAcceptedParams]['cat.ml_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -954,7 +1030,15 @@ export default class Cat { name: 'cat.ml_jobs', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'bytes', + 'h', + 's', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -969,7 +1053,7 @@ export default class Cat { async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.ml_trained_models'] + } = this[kAcceptedParams]['cat.ml_trained_models'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1007,7 +1091,17 @@ export default class Cat { name: 'cat.ml_trained_models', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'bytes', + 'h', + 's', + 'from', + 'size', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1022,7 +1116,7 @@ export default class Cat { async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.nodeattrs'] + } = this[kAcceptedParams]['cat.nodeattrs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1050,7 +1144,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodeattrs' const meta: TransportRequestMetadata = { - name: 'cat.nodeattrs' + name: 'cat.nodeattrs', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1065,7 +1165,7 @@ export default class Cat { async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.nodes'] + } = this[kAcceptedParams]['cat.nodes'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1093,7 +1193,16 @@ export default class Cat { const method = 'GET' const path = '/_cat/nodes' const meta: TransportRequestMetadata = { - name: 'cat.nodes' + name: 'cat.nodes', + acceptedParams: [ + 'bytes', + 'full_id', + 'include_unloaded_segments', + 'h', + 's', + 'master_timeout', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1108,7 +1217,7 @@ export default class Cat { async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.pending_tasks'] + } = this[kAcceptedParams]['cat.pending_tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1136,7 +1245,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/pending_tasks' const meta: TransportRequestMetadata = { - name: 'cat.pending_tasks' + name: 'cat.pending_tasks', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1151,7 +1267,7 @@ export default class Cat { async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.plugins'] + } = this[kAcceptedParams]['cat.plugins'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1179,7 +1295,14 @@ export default class Cat { const method = 'GET' const path = '/_cat/plugins' const meta: TransportRequestMetadata = { - name: 'cat.plugins' + name: 'cat.plugins', + acceptedParams: [ + 'h', + 's', + 'include_bootstrap', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1194,7 +1317,7 @@ export default class Cat { async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.recovery'] + } = this[kAcceptedParams]['cat.recovery'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1232,7 +1355,17 @@ export default class Cat { name: 'cat.recovery', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'active_only', + 'bytes', + 'detailed', + 'index', + 'h', + 's', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1247,7 +1380,7 @@ export default class Cat { async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.repositories'] + } = this[kAcceptedParams]['cat.repositories'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1275,7 +1408,13 @@ export default class Cat { const method = 'GET' const path = '/_cat/repositories' const meta: TransportRequestMetadata = { - name: 'cat.repositories' + name: 'cat.repositories', + acceptedParams: [ + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1290,7 +1429,7 @@ export default class Cat { async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.segments'] + } = this[kAcceptedParams]['cat.segments'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1328,7 +1467,15 @@ export default class Cat { name: 'cat.segments', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'bytes', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1343,7 +1490,7 @@ export default class Cat { async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.shards'] + } = this[kAcceptedParams]['cat.shards'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1381,7 +1528,15 @@ export default class Cat { name: 'cat.shards', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'bytes', + 'h', + 's', + 'master_timeout', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1396,7 +1551,7 @@ export default class Cat { async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.snapshots'] + } = this[kAcceptedParams]['cat.snapshots'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1434,7 +1589,15 @@ export default class Cat { name: 'cat.snapshots', pathParts: { repository: params.repository - } + }, + acceptedParams: [ + 'repository', + 'ignore_unavailable', + 'h', + 's', + 'master_timeout', + 'time' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1449,7 +1612,7 @@ export default class Cat { async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.tasks'] + } = this[kAcceptedParams]['cat.tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1477,7 +1640,18 @@ export default class Cat { const method = 'GET' const path = '/_cat/tasks' const meta: TransportRequestMetadata = { - name: 'cat.tasks' + name: 'cat.tasks', + acceptedParams: [ + 'actions', + 'detailed', + 'nodes', + 'parent_task_id', + 'h', + 's', + 'time', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1492,7 +1666,7 @@ export default class Cat { async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.templates'] + } = this[kAcceptedParams]['cat.templates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1530,7 +1704,14 @@ export default class Cat { name: 'cat.templates', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'h', + 's', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1545,7 +1726,7 @@ export default class Cat { async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.thread_pool'] + } = this[kAcceptedParams]['cat.thread_pool'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1583,7 +1764,15 @@ export default class Cat { name: 'cat.thread_pool', pathParts: { thread_pool_patterns: params.thread_pool_patterns - } + }, + acceptedParams: [ + 'thread_pool_patterns', + 'h', + 's', + 'time', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1598,7 +1787,7 @@ export default class Cat { async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cat.transforms'] + } = this[kAcceptedParams]['cat.transforms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1636,7 +1825,16 @@ export default class Cat { name: 'cat.transforms', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'h', + 's', + 'time', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ccr.ts b/src/api/api/ccr.ts index 778fba020..61aabf30d 100644 --- a/src/api/api/ccr.ts +++ b/src/api/api/ccr.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ccr { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ccr.delete_auto_follow_pattern': { path: [ 'name' @@ -212,7 +213,7 @@ export default class Ccr { async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.delete_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.delete_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -242,7 +243,11 @@ export default class Ccr { name: 'ccr.delete_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -259,7 +264,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.follow'] + } = this[kAcceptedParams]['ccr.follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -299,7 +304,26 @@ export default class Ccr { name: 'ccr.follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'data_stream_name', + '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', + 'settings', + 'master_timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -314,7 +338,7 @@ export default class Ccr { async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.follow_info'] + } = this[kAcceptedParams]['ccr.follow_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -344,7 +368,11 @@ export default class Ccr { name: 'ccr.follow_info', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -359,7 +387,7 @@ export default class Ccr { async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.follow_stats'] + } = this[kAcceptedParams]['ccr.follow_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -389,7 +417,11 @@ export default class Ccr { name: 'ccr.follow_stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -406,7 +438,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.forget_follower'] + } = this[kAcceptedParams]['ccr.forget_follower'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -446,7 +478,15 @@ export default class Ccr { name: 'ccr.forget_follower', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'follower_cluster', + 'follower_index', + 'follower_index_uuid', + 'leader_remote_cluster', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -461,7 +501,7 @@ export default class Ccr { async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.get_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.get_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -499,7 +539,11 @@ export default class Ccr { name: 'ccr.get_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -514,7 +558,7 @@ export default class Ccr { async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.pause_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.pause_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -544,7 +588,11 @@ export default class Ccr { name: 'ccr.pause_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -559,7 +607,7 @@ export default class Ccr { async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.pause_follow'] + } = this[kAcceptedParams]['ccr.pause_follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +637,11 @@ export default class Ccr { name: 'ccr.pause_follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +658,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.put_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.put_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -646,7 +698,26 @@ export default class Ccr { name: 'ccr.put_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + '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', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -661,7 +732,7 @@ export default class Ccr { async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.resume_auto_follow_pattern'] + } = this[kAcceptedParams]['ccr.resume_auto_follow_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -691,7 +762,11 @@ export default class Ccr { name: 'ccr.resume_auto_follow_pattern', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -708,7 +783,7 @@ export default class Ccr { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ccr.resume_follow'] + } = this[kAcceptedParams]['ccr.resume_follow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -748,7 +823,21 @@ export default class Ccr { name: 'ccr.resume_follow', pathParts: { index: params.index - } + }, + acceptedParams: [ + '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', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -763,7 +852,7 @@ export default class Ccr { async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.stats'] + } = this[kAcceptedParams]['ccr.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -791,7 +880,11 @@ export default class Ccr { const method = 'GET' const path = '/_ccr/stats' const meta: TransportRequestMetadata = { - name: 'ccr.stats' + name: 'ccr.stats', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -806,7 +899,7 @@ export default class Ccr { async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ccr.unfollow'] + } = this[kAcceptedParams]['ccr.unfollow'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -836,7 +929,11 @@ export default class Ccr { name: 'ccr.unfollow', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/clear_scroll.ts b/src/api/api/clear_scroll.ts index da942a980..d86f4be91 100644 --- a/src/api/api/clear_scroll.ts +++ b/src/api/api/clear_scroll.ts @@ -91,7 +91,11 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll name: 'clear_scroll', pathParts: { scroll_id: params.scroll_id - } + }, + acceptedParams: [ + 'scroll_id', + 'scroll_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/close_point_in_time.ts b/src/api/api/close_point_in_time.ts index b7dc4a7dd..4e6857dee 100644 --- a/src/api/api/close_point_in_time.ts +++ b/src/api/api/close_point_in_time.ts @@ -87,7 +87,10 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo const method = 'DELETE' const path = '/_pit' const meta: TransportRequestMetadata = { - name: 'close_point_in_time' + name: 'close_point_in_time', + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/cluster.ts b/src/api/api/cluster.ts index 94f1d2d7b..6ed867fbf 100644 --- a/src/api/api/cluster.ts +++ b/src/api/api/cluster.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Cluster { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'cluster.allocation_explain': { path: [], body: [ @@ -233,7 +234,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.allocation_explain'] + } = this[kAcceptedParams]['cluster.allocation_explain'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -271,7 +272,16 @@ export default class Cluster { const method = body != null ? 'POST' : 'GET' const path = '/_cluster/allocation/explain' const meta: TransportRequestMetadata = { - name: 'cluster.allocation_explain' + name: 'cluster.allocation_explain', + acceptedParams: [ + 'current_node', + 'index', + 'primary', + 'shard', + 'include_disk_info', + 'include_yes_decisions', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -286,7 +296,7 @@ export default class Cluster { async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.delete_component_template'] + } = this[kAcceptedParams]['cluster.delete_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -316,7 +326,12 @@ export default class Cluster { name: 'cluster.delete_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -331,7 +346,7 @@ export default class Cluster { async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.delete_voting_config_exclusions'] + } = this[kAcceptedParams]['cluster.delete_voting_config_exclusions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -359,7 +374,11 @@ export default class Cluster { const method = 'DELETE' const path = '/_cluster/voting_config_exclusions' const meta: TransportRequestMetadata = { - name: 'cluster.delete_voting_config_exclusions' + name: 'cluster.delete_voting_config_exclusions', + acceptedParams: [ + 'master_timeout', + 'wait_for_removal' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -374,7 +393,7 @@ export default class Cluster { async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.exists_component_template'] + } = this[kAcceptedParams]['cluster.exists_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -404,7 +423,12 @@ export default class Cluster { name: 'cluster.exists_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -419,7 +443,7 @@ export default class Cluster { async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.get_component_template'] + } = this[kAcceptedParams]['cluster.get_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -457,7 +481,15 @@ export default class Cluster { name: 'cluster.get_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'settings_filter', + 'include_defaults', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -472,7 +504,7 @@ export default class Cluster { async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.get_settings'] + } = this[kAcceptedParams]['cluster.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -500,7 +532,13 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/settings' const meta: TransportRequestMetadata = { - name: 'cluster.get_settings' + name: 'cluster.get_settings', + acceptedParams: [ + 'flat_settings', + 'include_defaults', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -515,7 +553,7 @@ export default class Cluster { async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.health'] + } = this[kAcceptedParams]['cluster.health'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -553,7 +591,21 @@ export default class Cluster { name: 'cluster.health', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'expand_wildcards', + 'level', + 'local', + 'master_timeout', + 'timeout', + 'wait_for_active_shards', + 'wait_for_events', + 'wait_for_nodes', + 'wait_for_no_initializing_shards', + 'wait_for_no_relocating_shards', + 'wait_for_status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -568,7 +620,7 @@ export default class Cluster { async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.info'] + } = this[kAcceptedParams]['cluster.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -598,7 +650,10 @@ export default class Cluster { name: 'cluster.info', pathParts: { target: params.target - } + }, + acceptedParams: [ + 'target' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -613,7 +668,7 @@ export default class Cluster { async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.pending_tasks'] + } = this[kAcceptedParams]['cluster.pending_tasks'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -641,7 +696,11 @@ export default class Cluster { const method = 'GET' const path = '/_cluster/pending_tasks' const meta: TransportRequestMetadata = { - name: 'cluster.pending_tasks' + name: 'cluster.pending_tasks', + acceptedParams: [ + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -656,7 +715,7 @@ export default class Cluster { async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.post_voting_config_exclusions'] + } = this[kAcceptedParams]['cluster.post_voting_config_exclusions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -684,7 +743,13 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/voting_config_exclusions' const meta: TransportRequestMetadata = { - name: 'cluster.post_voting_config_exclusions' + name: 'cluster.post_voting_config_exclusions', + acceptedParams: [ + 'node_names', + 'node_ids', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -701,7 +766,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.put_component_template'] + } = this[kAcceptedParams]['cluster.put_component_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -741,7 +806,17 @@ export default class Cluster { name: 'cluster.put_component_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'template', + 'version', + '_meta', + 'deprecated', + 'create', + 'cause', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -758,7 +833,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.put_settings'] + } = this[kAcceptedParams]['cluster.put_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -796,7 +871,14 @@ export default class Cluster { const method = 'PUT' const path = '/_cluster/settings' const meta: TransportRequestMetadata = { - name: 'cluster.put_settings' + name: 'cluster.put_settings', + acceptedParams: [ + 'persistent', + 'transient', + 'flat_settings', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -811,7 +893,7 @@ export default class Cluster { async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.remote_info'] + } = this[kAcceptedParams]['cluster.remote_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -839,7 +921,9 @@ export default class Cluster { const method = 'GET' const path = '/_remote/info' const meta: TransportRequestMetadata = { - name: 'cluster.remote_info' + name: 'cluster.remote_info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -856,7 +940,7 @@ export default class Cluster { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['cluster.reroute'] + } = this[kAcceptedParams]['cluster.reroute'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -894,7 +978,16 @@ export default class Cluster { const method = 'POST' const path = '/_cluster/reroute' const meta: TransportRequestMetadata = { - name: 'cluster.reroute' + name: 'cluster.reroute', + acceptedParams: [ + 'commands', + 'dry_run', + 'explain', + 'metric', + 'retry_failed', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -909,7 +1002,7 @@ export default class Cluster { async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.state'] + } = this[kAcceptedParams]['cluster.state'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -951,7 +1044,19 @@ export default class Cluster { pathParts: { metric: params.metric, index: params.index - } + }, + acceptedParams: [ + 'metric', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'local', + 'master_timeout', + 'wait_for_metadata_version', + 'wait_for_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -966,7 +1071,7 @@ export default class Cluster { async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['cluster.stats'] + } = this[kAcceptedParams]['cluster.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1004,7 +1109,12 @@ export default class Cluster { name: 'cluster.stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'include_remotes', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/connector.ts b/src/api/api/connector.ts index c5b306e50..d2e8094a6 100644 --- a/src/api/api/connector.ts +++ b/src/api/api/connector.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Connector { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'connector.check_in': { path: [ 'connector_id' @@ -369,7 +370,7 @@ export default class Connector { async checkIn (this: That, params: T.ConnectorCheckInRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.check_in'] + } = this[kAcceptedParams]['connector.check_in'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +400,10 @@ export default class Connector { name: 'connector.check_in', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -414,7 +418,7 @@ export default class Connector { async delete (this: That, params: T.ConnectorDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.delete'] + } = this[kAcceptedParams]['connector.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -444,7 +448,12 @@ export default class Connector { name: 'connector.delete', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'delete_sync_jobs', + 'hard' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -459,7 +468,7 @@ export default class Connector { async get (this: That, params: T.ConnectorGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.get'] + } = this[kAcceptedParams]['connector.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -489,7 +498,11 @@ export default class Connector { name: 'connector.get', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'include_deleted' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -506,7 +519,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.last_sync'] + } = this[kAcceptedParams]['connector.last_sync'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -546,7 +559,22 @@ export default class Connector { name: 'connector.last_sync', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'last_access_control_sync_error', + 'last_access_control_sync_scheduled_at', + 'last_access_control_sync_status', + 'last_deleted_document_count', + 'last_incremental_sync_scheduled_at', + 'last_indexed_document_count', + 'last_seen', + 'last_sync_error', + 'last_sync_scheduled_at', + 'last_sync_status', + 'last_synced', + 'sync_cursor' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -561,7 +589,7 @@ export default class Connector { async list (this: That, params?: T.ConnectorListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.list'] + } = this[kAcceptedParams]['connector.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +617,16 @@ export default class Connector { const method = 'GET' const path = '/_connector' const meta: TransportRequestMetadata = { - name: 'connector.list' + name: 'connector.list', + acceptedParams: [ + 'from', + 'size', + 'index_name', + 'connector_name', + 'service_type', + 'include_deleted', + 'query' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +643,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.post'] + } = this[kAcceptedParams]['connector.post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -644,7 +681,15 @@ export default class Connector { const method = 'POST' const path = '/_connector' const meta: TransportRequestMetadata = { - name: 'connector.post' + name: 'connector.post', + acceptedParams: [ + 'description', + 'index_name', + 'is_native', + 'language', + 'name', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -661,7 +706,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.put'] + } = this[kAcceptedParams]['connector.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -709,7 +754,16 @@ export default class Connector { name: 'connector.put', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'description', + 'index_name', + 'is_native', + 'language', + 'name', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -723,7 +777,7 @@ export default class Connector { async secretDelete (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_delete'] + } = this[kAcceptedParams]['connector.secret_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -753,7 +807,10 @@ export default class Connector { name: 'connector.secret_delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -767,7 +824,7 @@ export default class Connector { async secretGet (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_get'] + } = this[kAcceptedParams]['connector.secret_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -797,7 +854,10 @@ export default class Connector { name: 'connector.secret_get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -811,7 +871,7 @@ export default class Connector { async secretPost (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_post'] + } = this[kAcceptedParams]['connector.secret_post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -838,7 +898,9 @@ export default class Connector { const method = 'POST' const path = '/_connector/_secret' const meta: TransportRequestMetadata = { - name: 'connector.secret_post' + name: 'connector.secret_post', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -852,7 +914,7 @@ export default class Connector { async secretPut (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.secret_put'] + } = this[kAcceptedParams]['connector.secret_put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -882,7 +944,10 @@ export default class Connector { name: 'connector.secret_put', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -897,7 +962,7 @@ export default class Connector { async syncJobCancel (this: That, params: T.ConnectorSyncJobCancelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_cancel'] + } = this[kAcceptedParams]['connector.sync_job_cancel'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -927,7 +992,10 @@ export default class Connector { name: 'connector.sync_job_cancel', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -942,7 +1010,7 @@ export default class Connector { async syncJobCheckIn (this: That, params: T.ConnectorSyncJobCheckInRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_check_in'] + } = this[kAcceptedParams]['connector.sync_job_check_in'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -972,7 +1040,10 @@ export default class Connector { name: 'connector.sync_job_check_in', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -989,7 +1060,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_claim'] + } = this[kAcceptedParams]['connector.sync_job_claim'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1029,7 +1100,12 @@ export default class Connector { name: 'connector.sync_job_claim', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'sync_cursor', + 'worker_hostname' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1044,7 +1120,7 @@ export default class Connector { async syncJobDelete (this: That, params: T.ConnectorSyncJobDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_delete'] + } = this[kAcceptedParams]['connector.sync_job_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1074,7 +1150,10 @@ export default class Connector { name: 'connector.sync_job_delete', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1091,7 +1170,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_error'] + } = this[kAcceptedParams]['connector.sync_job_error'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1131,7 +1210,11 @@ export default class Connector { name: 'connector.sync_job_error', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'error' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1146,7 +1229,7 @@ export default class Connector { async syncJobGet (this: That, params: T.ConnectorSyncJobGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_get'] + } = this[kAcceptedParams]['connector.sync_job_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1176,7 +1259,10 @@ export default class Connector { name: 'connector.sync_job_get', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1191,7 +1277,7 @@ export default class Connector { async syncJobList (this: That, params?: T.ConnectorSyncJobListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.sync_job_list'] + } = this[kAcceptedParams]['connector.sync_job_list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1219,7 +1305,14 @@ export default class Connector { const method = 'GET' const path = '/_connector/_sync_job' const meta: TransportRequestMetadata = { - name: 'connector.sync_job_list' + name: 'connector.sync_job_list', + acceptedParams: [ + 'from', + 'size', + 'status', + 'connector_id', + 'job_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1236,7 +1329,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_post'] + } = this[kAcceptedParams]['connector.sync_job_post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1273,7 +1366,12 @@ export default class Connector { const method = 'POST' const path = '/_connector/_sync_job' const meta: TransportRequestMetadata = { - name: 'connector.sync_job_post' + name: 'connector.sync_job_post', + acceptedParams: [ + 'id', + 'job_type', + 'trigger_method' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1290,7 +1388,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.sync_job_update_stats'] + } = this[kAcceptedParams]['connector.sync_job_update_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1330,7 +1428,16 @@ export default class Connector { name: 'connector.sync_job_update_stats', pathParts: { connector_sync_job_id: params.connector_sync_job_id - } + }, + acceptedParams: [ + 'connector_sync_job_id', + 'deleted_document_count', + 'indexed_document_count', + 'indexed_document_volume', + 'last_seen', + 'metadata', + 'total_document_count' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1345,7 +1452,7 @@ export default class Connector { async updateActiveFiltering (this: That, params: T.ConnectorUpdateActiveFilteringRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['connector.update_active_filtering'] + } = this[kAcceptedParams]['connector.update_active_filtering'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1375,7 +1482,10 @@ export default class Connector { name: 'connector.update_active_filtering', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1392,7 +1502,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_api_key_id'] + } = this[kAcceptedParams]['connector.update_api_key_id'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1432,7 +1542,12 @@ export default class Connector { name: 'connector.update_api_key_id', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'api_key_id', + 'api_key_secret_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1449,7 +1564,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_configuration'] + } = this[kAcceptedParams]['connector.update_configuration'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1489,7 +1604,12 @@ export default class Connector { name: 'connector.update_configuration', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'configuration', + 'values' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1506,7 +1626,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_error'] + } = this[kAcceptedParams]['connector.update_error'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1546,7 +1666,11 @@ export default class Connector { name: 'connector.update_error', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'error' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1563,7 +1687,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_features'] + } = this[kAcceptedParams]['connector.update_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1603,7 +1727,11 @@ export default class Connector { name: 'connector.update_features', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'features' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1620,7 +1748,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_filtering'] + } = this[kAcceptedParams]['connector.update_filtering'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1660,7 +1788,13 @@ export default class Connector { name: 'connector.update_filtering', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'filtering', + 'rules', + 'advanced_snippet' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1677,7 +1811,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_filtering_validation'] + } = this[kAcceptedParams]['connector.update_filtering_validation'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1717,7 +1851,11 @@ export default class Connector { name: 'connector.update_filtering_validation', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'validation' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1734,7 +1872,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_index_name'] + } = this[kAcceptedParams]['connector.update_index_name'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1774,7 +1912,11 @@ export default class Connector { name: 'connector.update_index_name', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'index_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1791,7 +1933,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_name'] + } = this[kAcceptedParams]['connector.update_name'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1831,7 +1973,12 @@ export default class Connector { name: 'connector.update_name', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'name', + 'description' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1848,7 +1995,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_native'] + } = this[kAcceptedParams]['connector.update_native'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1888,7 +2035,11 @@ export default class Connector { name: 'connector.update_native', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'is_native' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1905,7 +2056,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_pipeline'] + } = this[kAcceptedParams]['connector.update_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1945,7 +2096,11 @@ export default class Connector { name: 'connector.update_pipeline', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'pipeline' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1962,7 +2117,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_scheduling'] + } = this[kAcceptedParams]['connector.update_scheduling'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2002,7 +2157,11 @@ export default class Connector { name: 'connector.update_scheduling', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'scheduling' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2019,7 +2178,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_service_type'] + } = this[kAcceptedParams]['connector.update_service_type'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2059,7 +2218,11 @@ export default class Connector { name: 'connector.update_service_type', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'service_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2076,7 +2239,7 @@ export default class Connector { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['connector.update_status'] + } = this[kAcceptedParams]['connector.update_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2116,7 +2279,11 @@ export default class Connector { name: 'connector.update_status', pathParts: { connector_id: params.connector_id - } + }, + acceptedParams: [ + 'connector_id', + 'status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/count.ts b/src/api/api/count.ts index 69b85545f..87bd7f29f 100644 --- a/src/api/api/count.ts +++ b/src/api/api/count.ts @@ -115,7 +115,25 @@ export default async function CountApi (this: That, params?: T.CountRequest, opt name: 'count', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'query', + 'allow_no_indices', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', + 'lenient', + 'min_score', + 'preference', + 'routing', + 'terminate_after', + 'q' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/create.ts b/src/api/api/create.ts index 84d0fc832..b1b099dda 100644 --- a/src/api/api/create.ts +++ b/src/api/api/create.ts @@ -95,7 +95,22 @@ export default async function CreateApi (this: That, params pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'document', + 'include_source_on_error', + 'pipeline', + 'refresh', + 'require_alias', + 'require_data_stream', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/dangling_indices.ts b/src/api/api/dangling_indices.ts index b58b65f9c..0162a2328 100644 --- a/src/api/api/dangling_indices.ts +++ b/src/api/api/dangling_indices.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class DanglingIndices { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'dangling_indices.delete_dangling_index': { path: [ 'index_uuid' @@ -73,7 +74,7 @@ export default class DanglingIndices { async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.delete_dangling_index'] + } = this[kAcceptedParams]['dangling_indices.delete_dangling_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -103,7 +104,13 @@ export default class DanglingIndices { name: 'dangling_indices.delete_dangling_index', pathParts: { index_uuid: params.index_uuid - } + }, + acceptedParams: [ + 'index_uuid', + 'accept_data_loss', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -118,7 +125,7 @@ export default class DanglingIndices { async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.import_dangling_index'] + } = this[kAcceptedParams]['dangling_indices.import_dangling_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -148,7 +155,13 @@ export default class DanglingIndices { name: 'dangling_indices.import_dangling_index', pathParts: { index_uuid: params.index_uuid - } + }, + acceptedParams: [ + 'index_uuid', + 'accept_data_loss', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -163,7 +176,7 @@ export default class DanglingIndices { async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['dangling_indices.list_dangling_indices'] + } = this[kAcceptedParams]['dangling_indices.list_dangling_indices'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -191,7 +204,9 @@ export default class DanglingIndices { const method = 'GET' const path = '/_dangling' const meta: TransportRequestMetadata = { - name: 'dangling_indices.list_dangling_indices' + name: 'dangling_indices.list_dangling_indices', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete.ts b/src/api/api/delete.ts index 8a207e817..ddf403939 100644 --- a/src/api/api/delete.ts +++ b/src/api/api/delete.ts @@ -87,7 +87,19 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest, op pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'if_primary_term', + 'if_seq_no', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query.ts b/src/api/api/delete_by_query.ts index 16a66ef3b..e24d013fb 100644 --- a/src/api/api/delete_by_query.ts +++ b/src/api/api/delete_by_query.ts @@ -125,7 +125,43 @@ export default async function DeleteByQueryApi (this: That, params: T.DeleteByQu name: 'delete_by_query', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'max_docs', + 'query', + 'slice', + 'sort', + 'allow_no_indices', + 'analyzer', + 'analyze_wildcard', + 'conflicts', + 'default_operator', + 'df', + 'expand_wildcards', + 'from', + 'ignore_unavailable', + 'lenient', + 'max_docs', + 'preference', + 'refresh', + 'request_cache', + 'requests_per_second', + 'routing', + 'q', + 'scroll', + 'scroll_size', + 'search_timeout', + 'search_type', + 'slices', + 'sort', + 'stats', + 'terminate_after', + 'timeout', + 'version', + 'wait_for_active_shards', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_by_query_rethrottle.ts b/src/api/api/delete_by_query_rethrottle.ts index bcb21062d..e21355452 100644 --- a/src/api/api/delete_by_query_rethrottle.ts +++ b/src/api/api/delete_by_query_rethrottle.ts @@ -78,7 +78,11 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T. name: 'delete_by_query_rethrottle', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'requests_per_second' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/delete_script.ts b/src/api/api/delete_script.ts index d7761c571..7255ae286 100644 --- a/src/api/api/delete_script.ts +++ b/src/api/api/delete_script.ts @@ -79,7 +79,12 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip name: 'delete_script', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/enrich.ts b/src/api/api/enrich.ts index 16ba0ac8e..9c6f41afe 100644 --- a/src/api/api/enrich.ts +++ b/src/api/api/enrich.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Enrich { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'enrich.delete_policy': { path: [ 'name' @@ -96,7 +97,7 @@ export default class Enrich { async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.delete_policy'] + } = this[kAcceptedParams]['enrich.delete_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -126,7 +127,11 @@ export default class Enrich { name: 'enrich.delete_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -141,7 +146,7 @@ export default class Enrich { async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.execute_policy'] + } = this[kAcceptedParams]['enrich.execute_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -171,7 +176,12 @@ export default class Enrich { name: 'enrich.execute_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -186,7 +196,7 @@ export default class Enrich { async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.get_policy'] + } = this[kAcceptedParams]['enrich.get_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -224,7 +234,11 @@ export default class Enrich { name: 'enrich.get_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -241,7 +255,7 @@ export default class Enrich { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['enrich.put_policy'] + } = this[kAcceptedParams]['enrich.put_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -281,7 +295,14 @@ export default class Enrich { name: 'enrich.put_policy', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'geo_match', + 'match', + 'range', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -296,7 +317,7 @@ export default class Enrich { async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['enrich.stats'] + } = this[kAcceptedParams]['enrich.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -324,7 +345,10 @@ export default class Enrich { const method = 'GET' const path = '/_enrich/_stats' const meta: TransportRequestMetadata = { - name: 'enrich.stats' + name: 'enrich.stats', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/eql.ts b/src/api/api/eql.ts index d45e12f15..a22aacaa8 100644 --- a/src/api/api/eql.ts +++ b/src/api/api/eql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Eql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'eql.delete': { path: [ 'id' @@ -107,7 +108,7 @@ export default class Eql { async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.delete'] + } = this[kAcceptedParams]['eql.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -137,7 +138,10 @@ export default class Eql { name: 'eql.delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -152,7 +156,7 @@ export default class Eql { async get (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.get'] + } = this[kAcceptedParams]['eql.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -182,7 +186,12 @@ export default class Eql { name: 'eql.get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -197,7 +206,7 @@ export default class Eql { async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['eql.get_status'] + } = this[kAcceptedParams]['eql.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -227,7 +236,10 @@ export default class Eql { name: 'eql.get_status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -244,7 +256,7 @@ export default class Eql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['eql.search'] + } = this[kAcceptedParams]['eql.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -284,7 +296,36 @@ export default class Eql { name: 'eql.search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'query', + 'case_sensitive', + 'event_category_field', + 'tiebreaker_field', + 'timestamp_field', + 'fetch_size', + 'filter', + 'keep_alive', + 'keep_on_completion', + 'wait_for_completion_timeout', + 'allow_partial_search_results', + 'allow_partial_sequence_results', + 'size', + 'fields', + 'result_position', + 'runtime_mappings', + 'max_samples_per_key', + 'allow_no_indices', + 'allow_partial_search_results', + 'allow_partial_sequence_results', + 'expand_wildcards', + 'ccs_minimize_roundtrips', + 'ignore_unavailable', + 'keep_alive', + 'keep_on_completion', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/esql.ts b/src/api/api/esql.ts index 53e5789e8..a3e8b7d74 100644 --- a/src/api/api/esql.ts +++ b/src/api/api/esql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Esql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'esql.async_query': { path: [], body: [ @@ -117,7 +118,7 @@ export default class Esql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['esql.async_query'] + } = this[kAcceptedParams]['esql.async_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -154,7 +155,23 @@ export default class Esql { const method = 'POST' const path = '/_query/async' const meta: TransportRequestMetadata = { - name: 'esql.async_query' + name: 'esql.async_query', + acceptedParams: [ + 'columnar', + 'filter', + 'locale', + 'params', + 'profile', + 'query', + 'tables', + 'include_ccs_metadata', + 'wait_for_completion_timeout', + 'keep_alive', + 'keep_on_completion', + 'delimiter', + 'drop_null_columns', + 'format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -169,7 +186,7 @@ export default class Esql { async asyncQueryDelete (this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_delete'] + } = this[kAcceptedParams]['esql.async_query_delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -199,7 +216,10 @@ export default class Esql { name: 'esql.async_query_delete', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -214,7 +234,7 @@ export default class Esql { async asyncQueryGet (this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_get'] + } = this[kAcceptedParams]['esql.async_query_get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -244,7 +264,14 @@ export default class Esql { name: 'esql.async_query_get', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'drop_null_columns', + 'format', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -259,7 +286,7 @@ export default class Esql { async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['esql.async_query_stop'] + } = this[kAcceptedParams]['esql.async_query_stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -289,7 +316,11 @@ export default class Esql { name: 'esql.async_query_stop', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'drop_null_columns' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -306,7 +337,7 @@ export default class Esql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['esql.query'] + } = this[kAcceptedParams]['esql.query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -343,7 +374,20 @@ export default class Esql { const method = 'POST' const path = '/_query' const meta: TransportRequestMetadata = { - name: 'esql.query' + name: 'esql.query', + acceptedParams: [ + 'columnar', + 'filter', + 'locale', + 'params', + 'profile', + 'query', + 'tables', + 'include_ccs_metadata', + 'format', + 'delimiter', + 'drop_null_columns' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists.ts b/src/api/api/exists.ts index 058a3780e..beb3ec5b4 100644 --- a/src/api/api/exists.ts +++ b/src/api/api/exists.ts @@ -89,7 +89,21 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest, op pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/exists_source.ts b/src/api/api/exists_source.ts index b1882ab45..853b9e155 100644 --- a/src/api/api/exists_source.ts +++ b/src/api/api/exists_source.ts @@ -88,7 +88,20 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/explain.ts b/src/api/api/explain.ts index 779edbb88..c02a66a07 100644 --- a/src/api/api/explain.ts +++ b/src/api/api/explain.ts @@ -107,7 +107,24 @@ export default async function ExplainApi (this: That, param pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'query', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'lenient', + 'preference', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields', + 'q' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/features.ts b/src/api/api/features.ts index 7e4ffbdb8..c7bd35ac6 100644 --- a/src/api/api/features.ts +++ b/src/api/api/features.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Features { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'features.get_features': { path: [], body: [], @@ -60,7 +61,7 @@ export default class Features { async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['features.get_features'] + } = this[kAcceptedParams]['features.get_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -88,7 +89,10 @@ export default class Features { const method = 'GET' const path = '/_features' const meta: TransportRequestMetadata = { - name: 'features.get_features' + name: 'features.get_features', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -103,7 +107,7 @@ export default class Features { async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['features.reset_features'] + } = this[kAcceptedParams]['features.reset_features'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -131,7 +135,10 @@ export default class Features { const method = 'POST' const path = '/_features/_reset' const meta: TransportRequestMetadata = { - name: 'features.reset_features' + name: 'features.reset_features', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/field_caps.ts b/src/api/api/field_caps.ts index 667521cee..ee130d989 100644 --- a/src/api/api/field_caps.ts +++ b/src/api/api/field_caps.ts @@ -111,7 +111,21 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ name: 'field_caps', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'fields', + 'index_filter', + 'runtime_mappings', + 'allow_no_indices', + 'expand_wildcards', + 'fields', + 'ignore_unavailable', + 'include_unmapped', + 'filters', + 'types', + 'include_empty_fields' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/fleet.ts b/src/api/api/fleet.ts index e0289c3ae..da652e5eb 100644 --- a/src/api/api/fleet.ts +++ b/src/api/api/fleet.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Fleet { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'fleet.delete_secret': { path: [ 'id' @@ -185,7 +186,7 @@ export default class Fleet { async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.delete_secret'] + } = this[kAcceptedParams]['fleet.delete_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -215,7 +216,10 @@ export default class Fleet { name: 'fleet.delete_secret', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -229,7 +233,7 @@ export default class Fleet { async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.get_secret'] + } = this[kAcceptedParams]['fleet.get_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -259,7 +263,10 @@ export default class Fleet { name: 'fleet.get_secret', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -274,7 +281,7 @@ export default class Fleet { async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.global_checkpoints'] + } = this[kAcceptedParams]['fleet.global_checkpoints'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -304,7 +311,14 @@ export default class Fleet { name: 'fleet.global_checkpoints', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'wait_for_advance', + 'wait_for_index', + 'checkpoints', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -321,7 +335,7 @@ export default class Fleet { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['fleet.msearch'] + } = this[kAcceptedParams]['fleet.msearch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -358,7 +372,24 @@ export default class Fleet { name: 'fleet.msearch', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'searches', + 'allow_no_indices', + 'ccs_minimize_roundtrips', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', + 'max_concurrent_searches', + 'max_concurrent_shard_requests', + 'pre_filter_shard_size', + 'search_type', + 'rest_total_hits_as_int', + 'typed_keys', + 'wait_for_checkpoints', + 'allow_partial_search_results' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -372,7 +403,7 @@ export default class Fleet { async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['fleet.post_secret'] + } = this[kAcceptedParams]['fleet.post_secret'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +430,9 @@ export default class Fleet { const method = 'POST' const path = '/_fleet/secret' const meta: TransportRequestMetadata = { - name: 'fleet.post_secret' + name: 'fleet.post_secret', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +449,7 @@ export default class Fleet { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['fleet.search'] + } = this[kAcceptedParams]['fleet.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -456,7 +489,85 @@ export default class Fleet { name: 'fleet.search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'collapse', + 'explain', + 'ext', + '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', + 'allow_no_indices', + 'analyzer', + 'analyze_wildcard', + 'batched_reduce_size', + 'ccs_minimize_roundtrips', + 'default_operator', + 'df', + 'docvalue_fields', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'lenient', + 'max_concurrent_shard_requests', + 'preference', + 'pre_filter_shard_size', + 'request_cache', + 'routing', + 'scroll', + 'search_type', + 'stats', + 'stored_fields', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'terminate_after', + 'timeout', + 'track_total_hits', + 'track_scores', + 'typed_keys', + 'rest_total_hits_as_int', + 'version', + '_source', + '_source_excludes', + '_source_includes', + 'seq_no_primary_term', + 'q', + 'size', + 'from', + 'sort', + 'wait_for_checkpoints', + 'allow_partial_search_results' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get.ts b/src/api/api/get.ts index aa88afd23..e0f19be63 100644 --- a/src/api/api/get.ts +++ b/src/api/api/get.ts @@ -90,7 +90,22 @@ export default async function GetApi (this: That, params: T pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'force_synthetic_source', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script.ts b/src/api/api/get_script.ts index 287694080..ac9329552 100644 --- a/src/api/api/get_script.ts +++ b/src/api/api/get_script.ts @@ -78,7 +78,11 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque name: 'get_script', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_context.ts b/src/api/api/get_script_context.ts index 88876cdfb..a77cd981c 100644 --- a/src/api/api/get_script_context.ts +++ b/src/api/api/get_script_context.ts @@ -72,7 +72,9 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr const method = 'GET' const path = '/_script_context' const meta: TransportRequestMetadata = { - name: 'get_script_context' + name: 'get_script_context', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_script_languages.ts b/src/api/api/get_script_languages.ts index 970244d88..22bbf7eaf 100644 --- a/src/api/api/get_script_languages.ts +++ b/src/api/api/get_script_languages.ts @@ -72,7 +72,9 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS const method = 'GET' const path = '/_script_language' const meta: TransportRequestMetadata = { - name: 'get_script_languages' + name: 'get_script_languages', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/get_source.ts b/src/api/api/get_source.ts index 9ee175a54..e2c1a8f10 100644 --- a/src/api/api/get_source.ts +++ b/src/api/api/get_source.ts @@ -88,7 +88,20 @@ export default async function GetSourceApi (this: That, par pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/graph.ts b/src/api/api/graph.ts index fb0521d60..e7ef2a47a 100644 --- a/src/api/api/graph.ts +++ b/src/api/api/graph.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Graph { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'graph.explore': { path: [ 'index' @@ -65,7 +66,7 @@ export default class Graph { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['graph.explore'] + } = this[kAcceptedParams]['graph.explore'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -105,7 +106,16 @@ export default class Graph { name: 'graph.explore', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'connections', + 'controls', + 'query', + 'vertices', + 'routing', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/health_report.ts b/src/api/api/health_report.ts index 300df315b..ecc77792a 100644 --- a/src/api/api/health_report.ts +++ b/src/api/api/health_report.ts @@ -88,7 +88,13 @@ export default async function HealthReportApi (this: That, params?: T.HealthRepo name: 'health_report', pathParts: { feature: params.feature - } + }, + acceptedParams: [ + 'feature', + 'timeout', + 'verbose', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ilm.ts b/src/api/api/ilm.ts index 69eea6a6a..a982a3048 100644 --- a/src/api/api/ilm.ts +++ b/src/api/api/ilm.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ilm { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ilm.delete_lifecycle': { path: [ 'name' @@ -147,7 +148,7 @@ export default class Ilm { async deleteLifecycle (this: That, params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.delete_lifecycle'] + } = this[kAcceptedParams]['ilm.delete_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -177,7 +178,12 @@ export default class Ilm { name: 'ilm.delete_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -192,7 +198,7 @@ export default class Ilm { async explainLifecycle (this: That, params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.explain_lifecycle'] + } = this[kAcceptedParams]['ilm.explain_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -222,7 +228,13 @@ export default class Ilm { name: 'ilm.explain_lifecycle', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'only_errors', + 'only_managed', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -237,7 +249,7 @@ export default class Ilm { async getLifecycle (this: That, params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.get_lifecycle'] + } = this[kAcceptedParams]['ilm.get_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -275,7 +287,12 @@ export default class Ilm { name: 'ilm.get_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -290,7 +307,7 @@ export default class Ilm { async getStatus (this: That, params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.get_status'] + } = this[kAcceptedParams]['ilm.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -318,7 +335,9 @@ export default class Ilm { const method = 'GET' const path = '/_ilm/status' const meta: TransportRequestMetadata = { - name: 'ilm.get_status' + name: 'ilm.get_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +354,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.migrate_to_data_tiers'] + } = this[kAcceptedParams]['ilm.migrate_to_data_tiers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -373,7 +392,13 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/migrate_to_data_tiers' const meta: TransportRequestMetadata = { - name: 'ilm.migrate_to_data_tiers' + name: 'ilm.migrate_to_data_tiers', + acceptedParams: [ + 'legacy_template_to_delete', + 'node_attribute', + 'dry_run', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -390,7 +415,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.move_to_step'] + } = this[kAcceptedParams]['ilm.move_to_step'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -430,7 +455,12 @@ export default class Ilm { name: 'ilm.move_to_step', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'current_step', + 'next_step' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -447,7 +477,7 @@ export default class Ilm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ilm.put_lifecycle'] + } = this[kAcceptedParams]['ilm.put_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -487,7 +517,13 @@ export default class Ilm { name: 'ilm.put_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'policy', + 'policy', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -502,7 +538,7 @@ export default class Ilm { async removePolicy (this: That, params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.remove_policy'] + } = this[kAcceptedParams]['ilm.remove_policy'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -532,7 +568,10 @@ export default class Ilm { name: 'ilm.remove_policy', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -547,7 +586,7 @@ export default class Ilm { async retry (this: That, params: T.IlmRetryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.retry'] + } = this[kAcceptedParams]['ilm.retry'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -577,7 +616,10 @@ export default class Ilm { name: 'ilm.retry', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -592,7 +634,7 @@ export default class Ilm { async start (this: That, params?: T.IlmStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.start'] + } = this[kAcceptedParams]['ilm.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -620,7 +662,11 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/start' const meta: TransportRequestMetadata = { - name: 'ilm.start' + name: 'ilm.start', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -635,7 +681,7 @@ export default class Ilm { async stop (this: That, params?: T.IlmStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ilm.stop'] + } = this[kAcceptedParams]['ilm.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -663,7 +709,11 @@ export default class Ilm { const method = 'POST' const path = '/_ilm/stop' const meta: TransportRequestMetadata = { - name: 'ilm.stop' + name: 'ilm.stop', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/index.ts b/src/api/api/index.ts index 1700da2f1..de7be2b11 100644 --- a/src/api/api/index.ts +++ b/src/api/api/index.ts @@ -105,7 +105,25 @@ export default async function IndexApi (this: That, params: pathParts: { id: params.id, index: params.index - } + }, + acceptedParams: [ + 'id', + 'index', + 'document', + 'if_primary_term', + 'if_seq_no', + 'include_source_on_error', + 'op_type', + 'pipeline', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'wait_for_active_shards', + 'require_alias', + 'require_data_stream' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 5736baa2e..c62965b39 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Indices { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'indices.add_block': { path: [ 'index', @@ -875,7 +876,7 @@ export default class Indices { async addBlock (this: That, params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.add_block'] + } = this[kAcceptedParams]['indices.add_block'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -906,7 +907,16 @@ export default class Indices { pathParts: { index: params.index, block: params.block - } + }, + acceptedParams: [ + 'index', + 'block', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -923,7 +933,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.analyze'] + } = this[kAcceptedParams]['indices.analyze'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -971,7 +981,20 @@ export default class Indices { name: 'indices.analyze', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'analyzer', + 'attributes', + 'char_filter', + 'explain', + 'field', + 'filter', + 'normalizer', + 'text', + 'tokenizer', + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -986,7 +1009,7 @@ export default class Indices { async cancelMigrateReindex (this: That, params: T.IndicesCancelMigrateReindexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.cancel_migrate_reindex'] + } = this[kAcceptedParams]['indices.cancel_migrate_reindex'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1016,7 +1039,10 @@ export default class Indices { name: 'indices.cancel_migrate_reindex', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1031,7 +1057,7 @@ export default class Indices { async clearCache (this: That, params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.clear_cache'] + } = this[kAcceptedParams]['indices.clear_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1069,7 +1095,18 @@ export default class Indices { name: 'indices.clear_cache', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'fielddata', + 'fields', + 'ignore_unavailable', + 'query', + 'request' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1086,7 +1123,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.clone'] + } = this[kAcceptedParams]['indices.clone'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1127,7 +1164,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1142,7 +1188,7 @@ export default class Indices { async close (this: That, params: T.IndicesCloseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.close'] + } = this[kAcceptedParams]['indices.close'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1172,7 +1218,16 @@ export default class Indices { name: 'indices.close', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1189,7 +1244,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.create'] + } = this[kAcceptedParams]['indices.create'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1229,7 +1284,16 @@ export default class Indices { name: 'indices.create', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aliases', + 'mappings', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1244,7 +1308,7 @@ export default class Indices { async createDataStream (this: That, params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.create_data_stream'] + } = this[kAcceptedParams]['indices.create_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1274,7 +1338,12 @@ export default class Indices { name: 'indices.create_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1291,7 +1360,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.create_from'] + } = this[kAcceptedParams]['indices.create_from'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1322,7 +1391,12 @@ export default class Indices { pathParts: { source: params.source, dest: params.dest - } + }, + acceptedParams: [ + 'source', + 'dest', + 'create_from' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1337,7 +1411,7 @@ export default class Indices { async dataStreamsStats (this: That, params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.data_streams_stats'] + } = this[kAcceptedParams]['indices.data_streams_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1375,7 +1449,11 @@ export default class Indices { name: 'indices.data_streams_stats', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1390,7 +1468,7 @@ export default class Indices { async delete (this: That, params: T.IndicesDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete'] + } = this[kAcceptedParams]['indices.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1420,7 +1498,15 @@ export default class Indices { name: 'indices.delete', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1435,7 +1521,7 @@ export default class Indices { async deleteAlias (this: That, params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_alias'] + } = this[kAcceptedParams]['indices.delete_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1473,7 +1559,13 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1488,7 +1580,7 @@ export default class Indices { async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_data_lifecycle'] + } = this[kAcceptedParams]['indices.delete_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1518,7 +1610,13 @@ export default class Indices { name: 'indices.delete_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1533,7 +1631,7 @@ export default class Indices { async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_data_stream'] + } = this[kAcceptedParams]['indices.delete_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1563,7 +1661,12 @@ export default class Indices { name: 'indices.delete_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'expand_wildcards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1578,7 +1681,7 @@ export default class Indices { async deleteIndexTemplate (this: That, params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_index_template'] + } = this[kAcceptedParams]['indices.delete_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1608,7 +1711,12 @@ export default class Indices { name: 'indices.delete_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1623,7 +1731,7 @@ export default class Indices { async deleteTemplate (this: That, params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.delete_template'] + } = this[kAcceptedParams]['indices.delete_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1653,7 +1761,12 @@ export default class Indices { name: 'indices.delete_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1668,7 +1781,7 @@ export default class Indices { async diskUsage (this: That, params: T.IndicesDiskUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.disk_usage'] + } = this[kAcceptedParams]['indices.disk_usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1698,7 +1811,15 @@ export default class Indices { name: 'indices.disk_usage', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flush', + 'ignore_unavailable', + 'run_expensive_tasks' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1715,7 +1836,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.downsample'] + } = this[kAcceptedParams]['indices.downsample'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1746,7 +1867,12 @@ export default class Indices { pathParts: { index: params.index, target_index: params.target_index - } + }, + acceptedParams: [ + 'index', + 'target_index', + 'config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1761,7 +1887,7 @@ export default class Indices { async exists (this: That, params: T.IndicesExistsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists'] + } = this[kAcceptedParams]['indices.exists'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1791,7 +1917,16 @@ export default class Indices { name: 'indices.exists', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1806,7 +1941,7 @@ export default class Indices { async existsAlias (this: That, params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_alias'] + } = this[kAcceptedParams]['indices.exists_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1844,7 +1979,15 @@ export default class Indices { pathParts: { name: params.name, index: params.index - } + }, + acceptedParams: [ + 'name', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1859,7 +2002,7 @@ export default class Indices { async existsIndexTemplate (this: That, params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_index_template'] + } = this[kAcceptedParams]['indices.exists_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1889,7 +2032,13 @@ export default class Indices { name: 'indices.exists_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'local', + 'flat_settings', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1904,7 +2053,7 @@ export default class Indices { async existsTemplate (this: That, params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.exists_template'] + } = this[kAcceptedParams]['indices.exists_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1934,7 +2083,13 @@ export default class Indices { name: 'indices.exists_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1949,7 +2104,7 @@ export default class Indices { async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.explain_data_lifecycle'] + } = this[kAcceptedParams]['indices.explain_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1979,7 +2134,12 @@ export default class Indices { name: 'indices.explain_data_lifecycle', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'include_defaults', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1994,7 +2154,7 @@ export default class Indices { async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.field_usage_stats'] + } = this[kAcceptedParams]['indices.field_usage_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2024,7 +2184,14 @@ export default class Indices { name: 'indices.field_usage_stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'fields' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2039,7 +2206,7 @@ export default class Indices { async flush (this: That, params?: T.IndicesFlushRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.flush'] + } = this[kAcceptedParams]['indices.flush'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2077,7 +2244,15 @@ export default class Indices { name: 'indices.flush', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'force', + 'ignore_unavailable', + 'wait_if_ongoing' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2092,7 +2267,7 @@ export default class Indices { async forcemerge (this: That, params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.forcemerge'] + } = this[kAcceptedParams]['indices.forcemerge'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2130,7 +2305,17 @@ export default class Indices { name: 'indices.forcemerge', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flush', + 'ignore_unavailable', + 'max_num_segments', + 'only_expunge_deletes', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2145,7 +2330,7 @@ export default class Indices { async get (this: That, params: T.IndicesGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get'] + } = this[kAcceptedParams]['indices.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2175,7 +2360,18 @@ export default class Indices { name: 'indices.get', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local', + 'master_timeout', + 'features' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2190,7 +2386,7 @@ export default class Indices { async getAlias (this: That, params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_alias'] + } = this[kAcceptedParams]['indices.get_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2235,7 +2431,15 @@ export default class Indices { pathParts: { name: params.name, index: params.index - } + }, + acceptedParams: [ + 'name', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2250,7 +2454,7 @@ export default class Indices { async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_lifecycle'] + } = this[kAcceptedParams]['indices.get_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2280,7 +2484,13 @@ export default class Indices { name: 'indices.get_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'include_defaults', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2295,7 +2505,7 @@ export default class Indices { async getDataLifecycleStats (this: That, params?: T.IndicesGetDataLifecycleStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_lifecycle_stats'] + } = this[kAcceptedParams]['indices.get_data_lifecycle_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2323,7 +2533,9 @@ export default class Indices { const method = 'GET' const path = '/_lifecycle/stats' const meta: TransportRequestMetadata = { - name: 'indices.get_data_lifecycle_stats' + name: 'indices.get_data_lifecycle_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2338,7 +2550,7 @@ export default class Indices { async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_data_stream'] + } = this[kAcceptedParams]['indices.get_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2376,7 +2588,14 @@ export default class Indices { name: 'indices.get_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'include_defaults', + 'master_timeout', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2391,7 +2610,7 @@ export default class Indices { async getFieldMapping (this: That, params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_field_mapping'] + } = this[kAcceptedParams]['indices.get_field_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2429,7 +2648,16 @@ export default class Indices { pathParts: { fields: params.fields, index: params.index - } + }, + acceptedParams: [ + 'fields', + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'include_defaults', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2444,7 +2672,7 @@ export default class Indices { async getIndexTemplate (this: That, params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_index_template'] + } = this[kAcceptedParams]['indices.get_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2482,7 +2710,14 @@ export default class Indices { name: 'indices.get_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'local', + 'flat_settings', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2497,7 +2732,7 @@ export default class Indices { async getMapping (this: That, params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_mapping'] + } = this[kAcceptedParams]['indices.get_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2535,7 +2770,15 @@ export default class Indices { name: 'indices.get_mapping', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2550,7 +2793,7 @@ export default class Indices { async getMigrateReindexStatus (this: That, params: T.IndicesGetMigrateReindexStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_migrate_reindex_status'] + } = this[kAcceptedParams]['indices.get_migrate_reindex_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2580,7 +2823,10 @@ export default class Indices { name: 'indices.get_migrate_reindex_status', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2595,7 +2841,7 @@ export default class Indices { async getSettings (this: That, params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_settings'] + } = this[kAcceptedParams]['indices.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2640,7 +2886,18 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'include_defaults', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2655,7 +2912,7 @@ export default class Indices { async getTemplate (this: That, params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.get_template'] + } = this[kAcceptedParams]['indices.get_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2693,7 +2950,13 @@ export default class Indices { name: 'indices.get_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'flat_settings', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2710,7 +2973,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.migrate_reindex'] + } = this[kAcceptedParams]['indices.migrate_reindex'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2737,7 +3000,10 @@ export default class Indices { const method = 'POST' const path = '/_migration/reindex' const meta: TransportRequestMetadata = { - name: 'indices.migrate_reindex' + name: 'indices.migrate_reindex', + acceptedParams: [ + 'reindex' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2752,7 +3018,7 @@ export default class Indices { async migrateToDataStream (this: That, params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.migrate_to_data_stream'] + } = this[kAcceptedParams]['indices.migrate_to_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2782,7 +3048,12 @@ export default class Indices { name: 'indices.migrate_to_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2799,7 +3070,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.modify_data_stream'] + } = this[kAcceptedParams]['indices.modify_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2836,7 +3107,10 @@ export default class Indices { const method = 'POST' const path = '/_data_stream/_modify' const meta: TransportRequestMetadata = { - name: 'indices.modify_data_stream' + name: 'indices.modify_data_stream', + acceptedParams: [ + 'actions' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2851,7 +3125,7 @@ export default class Indices { async open (this: That, params: T.IndicesOpenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.open'] + } = this[kAcceptedParams]['indices.open'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2881,7 +3155,16 @@ export default class Indices { name: 'indices.open', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2896,7 +3179,7 @@ export default class Indices { async promoteDataStream (this: That, params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.promote_data_stream'] + } = this[kAcceptedParams]['indices.promote_data_stream'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2926,7 +3209,11 @@ export default class Indices { name: 'indices.promote_data_stream', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2943,7 +3230,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_alias'] + } = this[kAcceptedParams]['indices.put_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2991,7 +3278,18 @@ export default class Indices { pathParts: { index: params.index, name: params.name - } + }, + acceptedParams: [ + 'index', + 'name', + 'filter', + 'index_routing', + 'is_write_index', + 'routing', + 'search_routing', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3008,7 +3306,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_data_lifecycle'] + } = this[kAcceptedParams]['indices.put_data_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3048,7 +3346,16 @@ export default class Indices { name: 'indices.put_data_lifecycle', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'data_retention', + 'downsampling', + 'enabled', + 'expand_wildcards', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3065,7 +3372,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_index_template'] + } = this[kAcceptedParams]['indices.put_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3105,7 +3412,23 @@ export default class Indices { name: 'indices.put_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'index_patterns', + 'composed_of', + 'template', + 'data_stream', + 'priority', + 'version', + '_meta', + 'allow_auto_create', + 'ignore_missing_component_templates', + 'deprecated', + 'create', + 'master_timeout', + 'cause' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3122,7 +3445,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_mapping'] + } = this[kAcceptedParams]['indices.put_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3162,7 +3485,27 @@ export default class Indices { name: 'indices.put_mapping', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'date_detection', + 'dynamic', + 'dynamic_date_formats', + 'dynamic_templates', + '_field_names', + '_meta', + 'numeric_detection', + 'properties', + '_routing', + '_source', + 'runtime', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'write_index_only' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3179,7 +3522,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_settings'] + } = this[kAcceptedParams]['indices.put_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3216,7 +3559,19 @@ export default class Indices { name: 'indices.put_settings', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'settings', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', + 'master_timeout', + 'preserve_existing', + 'reopen', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3233,7 +3588,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.put_template'] + } = this[kAcceptedParams]['indices.put_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3273,7 +3628,20 @@ export default class Indices { name: 'indices.put_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'aliases', + 'index_patterns', + 'mappings', + 'order', + 'settings', + 'version', + 'create', + 'master_timeout', + 'order', + 'cause' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3288,7 +3656,7 @@ export default class Indices { async recovery (this: That, params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.recovery'] + } = this[kAcceptedParams]['indices.recovery'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3326,7 +3694,15 @@ export default class Indices { name: 'indices.recovery', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'active_only', + 'detailed', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3341,7 +3717,7 @@ export default class Indices { async refresh (this: That, params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.refresh'] + } = this[kAcceptedParams]['indices.refresh'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3379,7 +3755,13 @@ export default class Indices { name: 'indices.refresh', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3394,7 +3776,7 @@ export default class Indices { async reloadSearchAnalyzers (this: That, params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.reload_search_analyzers'] + } = this[kAcceptedParams]['indices.reload_search_analyzers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3424,7 +3806,14 @@ export default class Indices { name: 'indices.reload_search_analyzers', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'resource' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3439,7 +3828,7 @@ export default class Indices { async resolveCluster (this: That, params?: T.IndicesResolveClusterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.resolve_cluster'] + } = this[kAcceptedParams]['indices.resolve_cluster'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3477,7 +3866,15 @@ export default class Indices { name: 'indices.resolve_cluster', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3492,7 +3889,7 @@ export default class Indices { async resolveIndex (this: That, params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.resolve_index'] + } = this[kAcceptedParams]['indices.resolve_index'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3522,7 +3919,13 @@ export default class Indices { name: 'indices.resolve_index', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'expand_wildcards', + 'ignore_unavailable', + 'allow_no_indices' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3539,7 +3942,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.rollover'] + } = this[kAcceptedParams]['indices.rollover'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3587,7 +3990,20 @@ export default class Indices { pathParts: { alias: params.alias, new_index: params.new_index - } + }, + acceptedParams: [ + 'alias', + 'new_index', + 'aliases', + 'conditions', + 'mappings', + 'settings', + 'dry_run', + 'master_timeout', + 'timeout', + 'wait_for_active_shards', + 'lazy' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3602,7 +4018,7 @@ export default class Indices { async segments (this: That, params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.segments'] + } = this[kAcceptedParams]['indices.segments'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3640,7 +4056,13 @@ export default class Indices { name: 'indices.segments', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3655,7 +4077,7 @@ export default class Indices { async shardStores (this: That, params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.shard_stores'] + } = this[kAcceptedParams]['indices.shard_stores'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3693,7 +4115,14 @@ export default class Indices { name: 'indices.shard_stores', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'status' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3710,7 +4139,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.shrink'] + } = this[kAcceptedParams]['indices.shrink'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3751,7 +4180,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3766,7 +4204,7 @@ export default class Indices { async simulateIndexTemplate (this: That, params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.simulate_index_template'] + } = this[kAcceptedParams]['indices.simulate_index_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3796,7 +4234,14 @@ export default class Indices { name: 'indices.simulate_index_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'create', + 'cause', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3813,7 +4258,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.simulate_template'] + } = this[kAcceptedParams]['indices.simulate_template'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3861,7 +4306,24 @@ export default class Indices { name: 'indices.simulate_template', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'allow_auto_create', + 'index_patterns', + 'composed_of', + 'template', + 'data_stream', + 'priority', + 'version', + '_meta', + 'ignore_missing_component_templates', + 'deprecated', + 'create', + 'cause', + 'master_timeout', + 'include_defaults' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3878,7 +4340,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.split'] + } = this[kAcceptedParams]['indices.split'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3919,7 +4381,16 @@ export default class Indices { pathParts: { index: params.index, target: params.target - } + }, + acceptedParams: [ + 'index', + 'target', + 'aliases', + 'settings', + 'master_timeout', + 'timeout', + 'wait_for_active_shards' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3934,7 +4405,7 @@ export default class Indices { async stats (this: That, params?: T.IndicesStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['indices.stats'] + } = this[kAcceptedParams]['indices.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3979,7 +4450,20 @@ export default class Indices { pathParts: { metric: params.metric, index: params.index - } + }, + acceptedParams: [ + 'metric', + 'index', + 'completion_fields', + 'expand_wildcards', + 'fielddata_fields', + 'fields', + 'forbid_closed_indices', + 'groups', + 'include_segment_file_sizes', + 'include_unloaded_segments', + 'level' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3996,7 +4480,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.update_aliases'] + } = this[kAcceptedParams]['indices.update_aliases'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4034,7 +4518,12 @@ export default class Indices { const method = 'POST' const path = '/_aliases' const meta: TransportRequestMetadata = { - name: 'indices.update_aliases' + name: 'indices.update_aliases', + acceptedParams: [ + 'actions', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4051,7 +4540,7 @@ export default class Indices { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['indices.validate_query'] + } = this[kAcceptedParams]['indices.validate_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4099,7 +4588,23 @@ export default class Indices { name: 'indices.validate_query', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'query', + 'allow_no_indices', + 'all_shards', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'expand_wildcards', + 'explain', + 'ignore_unavailable', + 'lenient', + 'rewrite', + 'q' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/inference.ts b/src/api/api/inference.ts index b5fdb5f30..fdecec898 100644 --- a/src/api/api/inference.ts +++ b/src/api/api/inference.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Inference { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'inference.chat_completion_unified': { path: [ 'inference_id' @@ -419,7 +420,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.chat_completion_unified'] + } = this[kAcceptedParams]['inference.chat_completion_unified'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -449,7 +450,12 @@ export default class Inference { name: 'inference.chat_completion_unified', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'chat_completion_request', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -466,7 +472,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.completion'] + } = this[kAcceptedParams]['inference.completion'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -506,7 +512,13 @@ export default class Inference { name: 'inference.completion', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -521,7 +533,7 @@ export default class Inference { async delete (this: That, params: T.InferenceDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['inference.delete'] + } = this[kAcceptedParams]['inference.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -559,7 +571,13 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'dry_run', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -574,7 +592,7 @@ export default class Inference { async get (this: That, params?: T.InferenceGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['inference.get'] + } = this[kAcceptedParams]['inference.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -616,7 +634,11 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -633,7 +655,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.inference'] + } = this[kAcceptedParams]['inference.inference'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -681,7 +703,15 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'query', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -698,7 +728,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put'] + } = this[kAcceptedParams]['inference.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -736,7 +766,13 @@ export default class Inference { pathParts: { task_type: params.task_type, inference_id: params.inference_id - } + }, + acceptedParams: [ + 'task_type', + 'inference_id', + 'inference_config', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -753,7 +789,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_alibabacloud'] + } = this[kAcceptedParams]['inference.put_alibabacloud'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -794,7 +830,16 @@ export default class Inference { pathParts: { task_type: params.task_type, alibabacloud_inference_id: params.alibabacloud_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'alibabacloud_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -811,7 +856,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_amazonbedrock'] + } = this[kAcceptedParams]['inference.put_amazonbedrock'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -852,7 +897,16 @@ export default class Inference { pathParts: { task_type: params.task_type, amazonbedrock_inference_id: params.amazonbedrock_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'amazonbedrock_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -869,7 +923,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_anthropic'] + } = this[kAcceptedParams]['inference.put_anthropic'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -910,7 +964,16 @@ export default class Inference { pathParts: { task_type: params.task_type, anthropic_inference_id: params.anthropic_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'anthropic_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -927,7 +990,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_azureaistudio'] + } = this[kAcceptedParams]['inference.put_azureaistudio'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -968,7 +1031,16 @@ export default class Inference { pathParts: { task_type: params.task_type, azureaistudio_inference_id: params.azureaistudio_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'azureaistudio_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -985,7 +1057,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_azureopenai'] + } = this[kAcceptedParams]['inference.put_azureopenai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1026,7 +1098,16 @@ export default class Inference { pathParts: { task_type: params.task_type, azureopenai_inference_id: params.azureopenai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'azureopenai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1043,7 +1124,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_cohere'] + } = this[kAcceptedParams]['inference.put_cohere'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1084,7 +1165,16 @@ export default class Inference { pathParts: { task_type: params.task_type, cohere_inference_id: params.cohere_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'cohere_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1099,7 +1189,7 @@ export default class Inference { async putCustom (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['inference.put_custom'] + } = this[kAcceptedParams]['inference.put_custom'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1130,7 +1220,11 @@ export default class Inference { pathParts: { task_type: params.task_type, custom_inference_id: params.custom_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'custom_inference_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1147,7 +1241,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_elasticsearch'] + } = this[kAcceptedParams]['inference.put_elasticsearch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1188,7 +1282,16 @@ export default class Inference { pathParts: { task_type: params.task_type, elasticsearch_inference_id: params.elasticsearch_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'elasticsearch_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1205,7 +1308,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_elser'] + } = this[kAcceptedParams]['inference.put_elser'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1246,7 +1349,15 @@ export default class Inference { pathParts: { task_type: params.task_type, elser_inference_id: params.elser_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'elser_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1263,7 +1374,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_googleaistudio'] + } = this[kAcceptedParams]['inference.put_googleaistudio'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1304,7 +1415,15 @@ export default class Inference { pathParts: { task_type: params.task_type, googleaistudio_inference_id: params.googleaistudio_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'googleaistudio_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1321,7 +1440,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_googlevertexai'] + } = this[kAcceptedParams]['inference.put_googlevertexai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1362,7 +1481,16 @@ export default class Inference { pathParts: { task_type: params.task_type, googlevertexai_inference_id: params.googlevertexai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'googlevertexai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1379,7 +1507,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_hugging_face'] + } = this[kAcceptedParams]['inference.put_hugging_face'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1420,7 +1548,15 @@ export default class Inference { pathParts: { task_type: params.task_type, huggingface_inference_id: params.huggingface_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'huggingface_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1437,7 +1573,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_jinaai'] + } = this[kAcceptedParams]['inference.put_jinaai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1478,7 +1614,16 @@ export default class Inference { pathParts: { task_type: params.task_type, jinaai_inference_id: params.jinaai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'jinaai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1495,7 +1640,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_mistral'] + } = this[kAcceptedParams]['inference.put_mistral'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1536,7 +1681,15 @@ export default class Inference { pathParts: { task_type: params.task_type, mistral_inference_id: params.mistral_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'mistral_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1553,7 +1706,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_openai'] + } = this[kAcceptedParams]['inference.put_openai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1594,7 +1747,16 @@ export default class Inference { pathParts: { task_type: params.task_type, openai_inference_id: params.openai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'openai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1611,7 +1773,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_voyageai'] + } = this[kAcceptedParams]['inference.put_voyageai'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1652,7 +1814,16 @@ export default class Inference { pathParts: { task_type: params.task_type, voyageai_inference_id: params.voyageai_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'voyageai_inference_id', + 'chunking_settings', + 'service', + 'service_settings', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1669,7 +1840,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.put_watsonx'] + } = this[kAcceptedParams]['inference.put_watsonx'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1710,7 +1881,14 @@ export default class Inference { pathParts: { task_type: params.task_type, watsonx_inference_id: params.watsonx_inference_id - } + }, + acceptedParams: [ + 'task_type', + 'watsonx_inference_id', + 'service', + 'service_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1727,7 +1905,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.rerank'] + } = this[kAcceptedParams]['inference.rerank'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1767,7 +1945,14 @@ export default class Inference { name: 'inference.rerank', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'query', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1784,7 +1969,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.sparse_embedding'] + } = this[kAcceptedParams]['inference.sparse_embedding'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1824,7 +2009,13 @@ export default class Inference { name: 'inference.sparse_embedding', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1841,7 +2032,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.stream_completion'] + } = this[kAcceptedParams]['inference.stream_completion'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1881,7 +2072,13 @@ export default class Inference { name: 'inference.stream_completion', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1898,7 +2095,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.text_embedding'] + } = this[kAcceptedParams]['inference.text_embedding'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1938,7 +2135,13 @@ export default class Inference { name: 'inference.text_embedding', pathParts: { inference_id: params.inference_id - } + }, + acceptedParams: [ + 'inference_id', + 'input', + 'task_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1955,7 +2158,7 @@ export default class Inference { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['inference.update'] + } = this[kAcceptedParams]['inference.update'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1993,7 +2196,12 @@ export default class Inference { pathParts: { inference_id: params.inference_id, task_type: params.task_type - } + }, + acceptedParams: [ + 'inference_id', + 'task_type', + 'inference_config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/info.ts b/src/api/api/info.ts index 086e826cf..ab0010bf0 100644 --- a/src/api/api/info.ts +++ b/src/api/api/info.ts @@ -72,7 +72,9 @@ export default async function InfoApi (this: That, params?: T.InfoRequest, optio const method = 'GET' const path = '/' const meta: TransportRequestMetadata = { - name: 'info' + name: 'info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ingest.ts b/src/api/api/ingest.ts index 7fd6c82c3..2621d993c 100644 --- a/src/api/api/ingest.ts +++ b/src/api/api/ingest.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ingest { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ingest.delete_geoip_database': { path: [ 'id' @@ -167,7 +168,7 @@ export default class Ingest { async deleteGeoipDatabase (this: That, params: T.IngestDeleteGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_geoip_database'] + } = this[kAcceptedParams]['ingest.delete_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -197,7 +198,12 @@ export default class Ingest { name: 'ingest.delete_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -212,7 +218,7 @@ export default class Ingest { async deleteIpLocationDatabase (this: That, params: T.IngestDeleteIpLocationDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_ip_location_database'] + } = this[kAcceptedParams]['ingest.delete_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -242,7 +248,12 @@ export default class Ingest { name: 'ingest.delete_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -257,7 +268,7 @@ export default class Ingest { async deletePipeline (this: That, params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.delete_pipeline'] + } = this[kAcceptedParams]['ingest.delete_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -287,7 +298,12 @@ export default class Ingest { name: 'ingest.delete_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -302,7 +318,7 @@ export default class Ingest { async geoIpStats (this: That, params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.geo_ip_stats'] + } = this[kAcceptedParams]['ingest.geo_ip_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -330,7 +346,9 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/geoip/stats' const meta: TransportRequestMetadata = { - name: 'ingest.geo_ip_stats' + name: 'ingest.geo_ip_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -345,7 +363,7 @@ export default class Ingest { async getGeoipDatabase (this: That, params?: T.IngestGetGeoipDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_geoip_database'] + } = this[kAcceptedParams]['ingest.get_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -383,7 +401,10 @@ export default class Ingest { name: 'ingest.get_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -398,7 +419,7 @@ export default class Ingest { async getIpLocationDatabase (this: That, params?: T.IngestGetIpLocationDatabaseRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_ip_location_database'] + } = this[kAcceptedParams]['ingest.get_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -436,7 +457,10 @@ export default class Ingest { name: 'ingest.get_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -451,7 +475,7 @@ export default class Ingest { async getPipeline (this: That, params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.get_pipeline'] + } = this[kAcceptedParams]['ingest.get_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -489,7 +513,12 @@ export default class Ingest { name: 'ingest.get_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'master_timeout', + 'summary' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -504,7 +533,7 @@ export default class Ingest { async processorGrok (this: That, params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ingest.processor_grok'] + } = this[kAcceptedParams]['ingest.processor_grok'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -532,7 +561,9 @@ export default class Ingest { const method = 'GET' const path = '/_ingest/processor/grok' const meta: TransportRequestMetadata = { - name: 'ingest.processor_grok' + name: 'ingest.processor_grok', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -549,7 +580,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_geoip_database'] + } = this[kAcceptedParams]['ingest.put_geoip_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -589,7 +620,14 @@ export default class Ingest { name: 'ingest.put_geoip_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'name', + 'maxmind', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -606,7 +644,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_ip_location_database'] + } = this[kAcceptedParams]['ingest.put_ip_location_database'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -636,7 +674,13 @@ export default class Ingest { name: 'ingest.put_ip_location_database', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'configuration', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -653,7 +697,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.put_pipeline'] + } = this[kAcceptedParams]['ingest.put_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -693,7 +737,19 @@ export default class Ingest { name: 'ingest.put_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + '_meta', + 'description', + 'on_failure', + 'processors', + 'version', + 'deprecated', + 'master_timeout', + 'timeout', + 'if_version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -710,7 +766,7 @@ export default class Ingest { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ingest.simulate'] + } = this[kAcceptedParams]['ingest.simulate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -757,7 +813,13 @@ export default class Ingest { name: 'ingest.simulate', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'docs', + 'pipeline', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/knn_search.ts b/src/api/api/knn_search.ts index 2fd7b462b..737050353 100644 --- a/src/api/api/knn_search.ts +++ b/src/api/api/knn_search.ts @@ -75,7 +75,10 @@ export default async function KnnSearchApi (this: That, params?: T.TODO, options name: 'knn_search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/license.ts b/src/api/api/license.ts index 7bd039d1e..b7a5b088b 100644 --- a/src/api/api/license.ts +++ b/src/api/api/license.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class License { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'license.delete': { path: [], body: [], @@ -104,7 +105,7 @@ export default class License { async delete (this: That, params?: T.LicenseDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.delete'] + } = this[kAcceptedParams]['license.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -132,7 +133,11 @@ export default class License { const method = 'DELETE' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.delete' + name: 'license.delete', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -147,7 +152,7 @@ export default class License { async get (this: That, params?: T.LicenseGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get'] + } = this[kAcceptedParams]['license.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -175,7 +180,11 @@ export default class License { const method = 'GET' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.get' + name: 'license.get', + acceptedParams: [ + 'accept_enterprise', + 'local' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -190,7 +199,7 @@ export default class License { async getBasicStatus (this: That, params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get_basic_status'] + } = this[kAcceptedParams]['license.get_basic_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -218,7 +227,9 @@ export default class License { const method = 'GET' const path = '/_license/basic_status' const meta: TransportRequestMetadata = { - name: 'license.get_basic_status' + name: 'license.get_basic_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -233,7 +244,7 @@ export default class License { async getTrialStatus (this: That, params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.get_trial_status'] + } = this[kAcceptedParams]['license.get_trial_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -261,7 +272,9 @@ export default class License { const method = 'GET' const path = '/_license/trial_status' const meta: TransportRequestMetadata = { - name: 'license.get_trial_status' + name: 'license.get_trial_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -278,7 +291,7 @@ export default class License { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['license.post'] + } = this[kAcceptedParams]['license.post'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -316,7 +329,14 @@ export default class License { const method = 'PUT' const path = '/_license' const meta: TransportRequestMetadata = { - name: 'license.post' + name: 'license.post', + acceptedParams: [ + 'license', + 'licenses', + 'acknowledge', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -331,7 +351,7 @@ export default class License { async postStartBasic (this: That, params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.post_start_basic'] + } = this[kAcceptedParams]['license.post_start_basic'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -359,7 +379,12 @@ export default class License { const method = 'POST' const path = '/_license/start_basic' const meta: TransportRequestMetadata = { - name: 'license.post_start_basic' + name: 'license.post_start_basic', + acceptedParams: [ + 'acknowledge', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -374,7 +399,7 @@ export default class License { async postStartTrial (this: That, params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['license.post_start_trial'] + } = this[kAcceptedParams]['license.post_start_trial'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -402,7 +427,12 @@ export default class License { const method = 'POST' const path = '/_license/start_trial' const meta: TransportRequestMetadata = { - name: 'license.post_start_trial' + name: 'license.post_start_trial', + acceptedParams: [ + 'acknowledge', + 'type', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/logstash.ts b/src/api/api/logstash.ts index e7acf0315..f276f3c98 100644 --- a/src/api/api/logstash.ts +++ b/src/api/api/logstash.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Logstash { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'logstash.delete_pipeline': { path: [ 'id' @@ -71,7 +72,7 @@ export default class Logstash { async deletePipeline (this: That, params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['logstash.delete_pipeline'] + } = this[kAcceptedParams]['logstash.delete_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -101,7 +102,10 @@ export default class Logstash { name: 'logstash.delete_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -116,7 +120,7 @@ export default class Logstash { async getPipeline (this: That, params?: T.LogstashGetPipelineRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['logstash.get_pipeline'] + } = this[kAcceptedParams]['logstash.get_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -154,7 +158,10 @@ export default class Logstash { name: 'logstash.get_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -171,7 +178,7 @@ export default class Logstash { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['logstash.put_pipeline'] + } = this[kAcceptedParams]['logstash.put_pipeline'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -201,7 +208,11 @@ export default class Logstash { name: 'logstash.put_pipeline', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'pipeline' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/mget.ts b/src/api/api/mget.ts index fcd1f2eb1..27d2a74f2 100644 --- a/src/api/api/mget.ts +++ b/src/api/api/mget.ts @@ -111,7 +111,21 @@ export default async function MgetApi (this: That, params?: name: 'mget', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'docs', + 'ids', + 'force_synthetic_source', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'stored_fields' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/migration.ts b/src/api/api/migration.ts index fac6aedcd..dc10a169b 100644 --- a/src/api/api/migration.ts +++ b/src/api/api/migration.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Migration { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'migration.deprecations': { path: [ 'index' @@ -63,7 +64,7 @@ export default class Migration { async deprecations (this: That, params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.deprecations'] + } = this[kAcceptedParams]['migration.deprecations'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -101,7 +102,10 @@ export default class Migration { name: 'migration.deprecations', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -116,7 +120,7 @@ export default class Migration { async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.get_feature_upgrade_status'] + } = this[kAcceptedParams]['migration.get_feature_upgrade_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -144,7 +148,9 @@ export default class Migration { const method = 'GET' const path = '/_migration/system_features' const meta: TransportRequestMetadata = { - name: 'migration.get_feature_upgrade_status' + name: 'migration.get_feature_upgrade_status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -159,7 +165,7 @@ export default class Migration { async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['migration.post_feature_upgrade'] + } = this[kAcceptedParams]['migration.post_feature_upgrade'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -187,7 +193,9 @@ export default class Migration { const method = 'POST' const path = '/_migration/system_features' const meta: TransportRequestMetadata = { - name: 'migration.post_feature_upgrade' + name: 'migration.post_feature_upgrade', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ml.ts b/src/api/api/ml.ts index 76bbde531..594982fea 100644 --- a/src/api/api/ml.ts +++ b/src/api/api/ml.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Ml { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ml.clear_trained_model_deployment_cache': { path: [ 'model_id' @@ -984,7 +985,7 @@ export default class Ml { async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.clear_trained_model_deployment_cache'] + } = this[kAcceptedParams]['ml.clear_trained_model_deployment_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1014,7 +1015,10 @@ export default class Ml { name: 'ml.clear_trained_model_deployment_cache', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1031,7 +1035,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.close_job'] + } = this[kAcceptedParams]['ml.close_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1071,7 +1075,16 @@ export default class Ml { name: 'ml.close_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'force', + 'timeout', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1086,7 +1099,7 @@ export default class Ml { async deleteCalendar (this: That, params: T.MlDeleteCalendarRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar'] + } = this[kAcceptedParams]['ml.delete_calendar'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1116,7 +1129,10 @@ export default class Ml { name: 'ml.delete_calendar', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1131,7 +1147,7 @@ export default class Ml { async deleteCalendarEvent (this: That, params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar_event'] + } = this[kAcceptedParams]['ml.delete_calendar_event'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1162,7 +1178,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, event_id: params.event_id - } + }, + acceptedParams: [ + 'calendar_id', + 'event_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1177,7 +1197,7 @@ export default class Ml { async deleteCalendarJob (this: That, params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_calendar_job'] + } = this[kAcceptedParams]['ml.delete_calendar_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1208,7 +1228,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, job_id: params.job_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1223,7 +1247,7 @@ export default class Ml { async deleteDataFrameAnalytics (this: That, params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_data_frame_analytics'] + } = this[kAcceptedParams]['ml.delete_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1253,7 +1277,12 @@ export default class Ml { name: 'ml.delete_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1268,7 +1297,7 @@ export default class Ml { async deleteDatafeed (this: That, params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_datafeed'] + } = this[kAcceptedParams]['ml.delete_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1298,7 +1327,11 @@ export default class Ml { name: 'ml.delete_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1315,7 +1348,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.delete_expired_data'] + } = this[kAcceptedParams]['ml.delete_expired_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1363,7 +1396,14 @@ export default class Ml { name: 'ml.delete_expired_data', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'requests_per_second', + 'timeout', + 'requests_per_second', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1378,7 +1418,7 @@ export default class Ml { async deleteFilter (this: That, params: T.MlDeleteFilterRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_filter'] + } = this[kAcceptedParams]['ml.delete_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1408,7 +1448,10 @@ export default class Ml { name: 'ml.delete_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1423,7 +1466,7 @@ export default class Ml { async deleteForecast (this: That, params: T.MlDeleteForecastRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_forecast'] + } = this[kAcceptedParams]['ml.delete_forecast'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1461,7 +1504,13 @@ export default class Ml { pathParts: { job_id: params.job_id, forecast_id: params.forecast_id - } + }, + acceptedParams: [ + 'job_id', + 'forecast_id', + 'allow_no_forecasts', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1476,7 +1525,7 @@ export default class Ml { async deleteJob (this: That, params: T.MlDeleteJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_job'] + } = this[kAcceptedParams]['ml.delete_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1506,7 +1555,13 @@ export default class Ml { name: 'ml.delete_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'force', + 'delete_user_annotations', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1521,7 +1576,7 @@ export default class Ml { async deleteModelSnapshot (this: That, params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_model_snapshot'] + } = this[kAcceptedParams]['ml.delete_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1552,7 +1607,11 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1567,7 +1626,7 @@ export default class Ml { async deleteTrainedModel (this: That, params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_trained_model'] + } = this[kAcceptedParams]['ml.delete_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1597,7 +1656,12 @@ export default class Ml { name: 'ml.delete_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1612,7 +1676,7 @@ export default class Ml { async deleteTrainedModelAlias (this: That, params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.delete_trained_model_alias'] + } = this[kAcceptedParams]['ml.delete_trained_model_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1643,7 +1707,11 @@ export default class Ml { pathParts: { model_alias: params.model_alias, model_id: params.model_id - } + }, + acceptedParams: [ + 'model_alias', + 'model_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1660,7 +1728,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.estimate_model_memory'] + } = this[kAcceptedParams]['ml.estimate_model_memory'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1698,7 +1766,12 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_estimate_model_memory' const meta: TransportRequestMetadata = { - name: 'ml.estimate_model_memory' + name: 'ml.estimate_model_memory', + acceptedParams: [ + 'analysis_config', + 'max_bucket_cardinality', + 'overall_cardinality' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1715,7 +1788,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.evaluate_data_frame'] + } = this[kAcceptedParams]['ml.evaluate_data_frame'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1752,7 +1825,12 @@ export default class Ml { const method = 'POST' const path = '/_ml/data_frame/_evaluate' const meta: TransportRequestMetadata = { - name: 'ml.evaluate_data_frame' + name: 'ml.evaluate_data_frame', + acceptedParams: [ + 'evaluation', + 'index', + 'query' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1769,7 +1847,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.explain_data_frame_analytics'] + } = this[kAcceptedParams]['ml.explain_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1817,7 +1895,18 @@ export default class Ml { name: 'ml.explain_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'source', + 'dest', + 'analysis', + 'description', + 'model_memory_limit', + 'max_num_threads', + 'analyzed_fields', + 'allow_lazy_start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1834,7 +1923,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.flush_job'] + } = this[kAcceptedParams]['ml.flush_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1874,7 +1963,20 @@ export default class Ml { name: 'ml.flush_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'advance_time', + 'calc_interim', + 'end', + 'skip_time', + 'start', + 'advance_time', + 'calc_interim', + 'end', + 'skip_time', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1891,7 +1993,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.forecast'] + } = this[kAcceptedParams]['ml.forecast'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1931,7 +2033,16 @@ export default class Ml { name: 'ml.forecast', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'duration', + 'expires_in', + 'max_model_memory', + 'duration', + 'expires_in', + 'max_model_memory' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1948,7 +2059,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_buckets'] + } = this[kAcceptedParams]['ml.get_buckets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1996,7 +2107,28 @@ export default class Ml { pathParts: { job_id: params.job_id, timestamp: params.timestamp - } + }, + acceptedParams: [ + 'job_id', + 'timestamp', + 'anomaly_score', + 'desc', + 'end', + 'exclude_interim', + 'expand', + 'page', + 'sort', + 'start', + 'anomaly_score', + 'desc', + 'end', + 'exclude_interim', + 'expand', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2011,7 +2143,7 @@ export default class Ml { async getCalendarEvents (this: That, params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_calendar_events'] + } = this[kAcceptedParams]['ml.get_calendar_events'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2041,7 +2173,15 @@ export default class Ml { name: 'ml.get_calendar_events', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'end', + 'from', + 'job_id', + 'size', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2058,7 +2198,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_calendars'] + } = this[kAcceptedParams]['ml.get_calendars'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2106,7 +2246,13 @@ export default class Ml { name: 'ml.get_calendars', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'page', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2123,7 +2269,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_categories'] + } = this[kAcceptedParams]['ml.get_categories'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2171,7 +2317,15 @@ export default class Ml { pathParts: { job_id: params.job_id, category_id: params.category_id - } + }, + acceptedParams: [ + 'job_id', + 'category_id', + 'page', + 'from', + 'partition_field_value', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2186,7 +2340,7 @@ export default class Ml { async getDataFrameAnalytics (this: That, params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_data_frame_analytics'] + } = this[kAcceptedParams]['ml.get_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2224,7 +2378,14 @@ export default class Ml { name: 'ml.get_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'from', + 'size', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2239,7 +2400,7 @@ export default class Ml { async getDataFrameAnalyticsStats (this: That, params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_data_frame_analytics_stats'] + } = this[kAcceptedParams]['ml.get_data_frame_analytics_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2277,7 +2438,14 @@ export default class Ml { name: 'ml.get_data_frame_analytics_stats', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'from', + 'size', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2292,7 +2460,7 @@ export default class Ml { async getDatafeedStats (this: That, params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_datafeed_stats'] + } = this[kAcceptedParams]['ml.get_datafeed_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2330,7 +2498,11 @@ export default class Ml { name: 'ml.get_datafeed_stats', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2345,7 +2517,7 @@ export default class Ml { async getDatafeeds (this: That, params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_datafeeds'] + } = this[kAcceptedParams]['ml.get_datafeeds'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2383,7 +2555,12 @@ export default class Ml { name: 'ml.get_datafeeds', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2398,7 +2575,7 @@ export default class Ml { async getFilters (this: That, params?: T.MlGetFiltersRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_filters'] + } = this[kAcceptedParams]['ml.get_filters'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2436,7 +2613,12 @@ export default class Ml { name: 'ml.get_filters', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2453,7 +2635,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_influencers'] + } = this[kAcceptedParams]['ml.get_influencers'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2493,7 +2675,19 @@ export default class Ml { name: 'ml.get_influencers', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'page', + 'desc', + 'end', + 'exclude_interim', + 'influencer_score', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2508,7 +2702,7 @@ export default class Ml { async getJobStats (this: That, params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_job_stats'] + } = this[kAcceptedParams]['ml.get_job_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2546,7 +2740,11 @@ export default class Ml { name: 'ml.get_job_stats', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2561,7 +2759,7 @@ export default class Ml { async getJobs (this: That, params?: T.MlGetJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_jobs'] + } = this[kAcceptedParams]['ml.get_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2599,7 +2797,12 @@ export default class Ml { name: 'ml.get_jobs', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2614,7 +2817,7 @@ export default class Ml { async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_memory_stats'] + } = this[kAcceptedParams]['ml.get_memory_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2652,7 +2855,12 @@ export default class Ml { name: 'ml.get_memory_stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2667,7 +2875,7 @@ export default class Ml { async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_model_snapshot_upgrade_stats'] + } = this[kAcceptedParams]['ml.get_model_snapshot_upgrade_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2698,7 +2906,12 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'allow_no_match' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2715,7 +2928,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_model_snapshots'] + } = this[kAcceptedParams]['ml.get_model_snapshots'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2763,7 +2976,22 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'desc', + 'end', + 'page', + 'sort', + 'start', + 'desc', + 'end', + 'from', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2780,7 +3008,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_overall_buckets'] + } = this[kAcceptedParams]['ml.get_overall_buckets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2820,7 +3048,24 @@ export default class Ml { name: 'ml.get_overall_buckets', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_no_match', + 'bucket_span', + 'end', + 'exclude_interim', + 'overall_score', + 'start', + 'top_n', + 'allow_no_match', + 'bucket_span', + 'end', + 'exclude_interim', + 'overall_score', + 'start', + 'top_n' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2837,7 +3082,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.get_records'] + } = this[kAcceptedParams]['ml.get_records'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2877,7 +3122,25 @@ export default class Ml { name: 'ml.get_records', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'desc', + 'end', + 'exclude_interim', + 'page', + 'record_score', + 'sort', + 'start', + 'desc', + 'end', + 'exclude_interim', + 'from', + 'record_score', + 'size', + 'sort', + 'start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2892,7 +3155,7 @@ export default class Ml { async getTrainedModels (this: That, params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_trained_models'] + } = this[kAcceptedParams]['ml.get_trained_models'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2930,7 +3193,17 @@ export default class Ml { name: 'ml.get_trained_models', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'decompress_definition', + 'exclude_generated', + 'from', + 'include', + 'size', + 'tags' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2945,7 +3218,7 @@ export default class Ml { async getTrainedModelsStats (this: That, params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.get_trained_models_stats'] + } = this[kAcceptedParams]['ml.get_trained_models_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2983,7 +3256,13 @@ export default class Ml { name: 'ml.get_trained_models_stats', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3000,7 +3279,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.infer_trained_model'] + } = this[kAcceptedParams]['ml.infer_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3040,7 +3319,13 @@ export default class Ml { name: 'ml.infer_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'docs', + 'inference_config', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3055,7 +3340,7 @@ export default class Ml { async info (this: That, params?: T.MlInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.info'] + } = this[kAcceptedParams]['ml.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3083,7 +3368,9 @@ export default class Ml { const method = 'GET' const path = '/_ml/info' const meta: TransportRequestMetadata = { - name: 'ml.info' + name: 'ml.info', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3100,7 +3387,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.open_job'] + } = this[kAcceptedParams]['ml.open_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3140,7 +3427,12 @@ export default class Ml { name: 'ml.open_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3157,7 +3449,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.post_calendar_events'] + } = this[kAcceptedParams]['ml.post_calendar_events'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3197,7 +3489,11 @@ export default class Ml { name: 'ml.post_calendar_events', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'events' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3214,7 +3510,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.post_data'] + } = this[kAcceptedParams]['ml.post_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3244,7 +3540,13 @@ export default class Ml { name: 'ml.post_data', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'data', + 'reset_end', + 'reset_start' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -3261,7 +3563,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.preview_data_frame_analytics'] + } = this[kAcceptedParams]['ml.preview_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3309,7 +3611,11 @@ export default class Ml { name: 'ml.preview_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'config' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3326,7 +3632,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.preview_datafeed'] + } = this[kAcceptedParams]['ml.preview_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3374,7 +3680,14 @@ export default class Ml { name: 'ml.preview_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'datafeed_config', + 'job_config', + 'start', + 'end' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3391,7 +3704,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_calendar'] + } = this[kAcceptedParams]['ml.put_calendar'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3431,7 +3744,12 @@ export default class Ml { name: 'ml.put_calendar', pathParts: { calendar_id: params.calendar_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_ids', + 'description' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3446,7 +3764,7 @@ export default class Ml { async putCalendarJob (this: That, params: T.MlPutCalendarJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.put_calendar_job'] + } = this[kAcceptedParams]['ml.put_calendar_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3477,7 +3795,11 @@ export default class Ml { pathParts: { calendar_id: params.calendar_id, job_id: params.job_id - } + }, + acceptedParams: [ + 'calendar_id', + 'job_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3494,7 +3816,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_data_frame_analytics'] + } = this[kAcceptedParams]['ml.put_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3534,7 +3856,21 @@ export default class Ml { name: 'ml.put_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_lazy_start', + 'analysis', + 'analyzed_fields', + 'description', + 'dest', + 'max_num_threads', + '_meta', + 'model_memory_limit', + 'source', + 'headers', + 'version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3551,7 +3887,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_datafeed'] + } = this[kAcceptedParams]['ml.put_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3591,7 +3927,30 @@ export default class Ml { name: 'ml.put_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'aggregations', + 'aggs', + 'chunking_config', + 'delayed_data_check_config', + 'frequency', + 'indices', + 'indexes', + 'indices_options', + 'job_id', + 'max_empty_searches', + 'query', + 'query_delay', + 'runtime_mappings', + 'script_fields', + 'scroll_size', + 'headers', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3608,7 +3967,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_filter'] + } = this[kAcceptedParams]['ml.put_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3648,7 +4007,12 @@ export default class Ml { name: 'ml.put_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'description', + 'items' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3665,7 +4029,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_job'] + } = this[kAcceptedParams]['ml.put_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3705,7 +4069,30 @@ export default class Ml { name: 'ml.put_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_lazy_open', + 'analysis_config', + 'analysis_limits', + 'background_persist_interval', + 'custom_settings', + 'daily_model_snapshot_retention_after_days', + 'data_description', + 'datafeed_config', + 'description', + 'job_id', + 'groups', + 'model_plot_config', + 'model_snapshot_retention_days', + 'renormalization_window_days', + 'results_index_name', + 'results_retention_days', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3722,7 +4109,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model'] + } = this[kAcceptedParams]['ml.put_trained_model'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3762,7 +4149,23 @@ export default class Ml { name: 'ml.put_trained_model', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'compressed_definition', + 'definition', + 'description', + 'inference_config', + 'input', + 'metadata', + 'model_type', + 'model_size_bytes', + 'platform_architecture', + 'tags', + 'prefix_strings', + 'defer_definition_decompression', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3777,7 +4180,7 @@ export default class Ml { async putTrainedModelAlias (this: That, params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.put_trained_model_alias'] + } = this[kAcceptedParams]['ml.put_trained_model_alias'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3808,7 +4211,12 @@ export default class Ml { pathParts: { model_alias: params.model_alias, model_id: params.model_id - } + }, + acceptedParams: [ + 'model_alias', + 'model_id', + 'reassign' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3825,7 +4233,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model_definition_part'] + } = this[kAcceptedParams]['ml.put_trained_model_definition_part'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3866,7 +4274,14 @@ export default class Ml { pathParts: { model_id: params.model_id, part: params.part - } + }, + acceptedParams: [ + 'model_id', + 'part', + 'definition', + 'total_definition_length', + 'total_parts' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3883,7 +4298,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.put_trained_model_vocabulary'] + } = this[kAcceptedParams]['ml.put_trained_model_vocabulary'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3923,7 +4338,13 @@ export default class Ml { name: 'ml.put_trained_model_vocabulary', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'vocabulary', + 'merges', + 'scores' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3938,7 +4359,7 @@ export default class Ml { async resetJob (this: That, params: T.MlResetJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.reset_job'] + } = this[kAcceptedParams]['ml.reset_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3968,7 +4389,12 @@ export default class Ml { name: 'ml.reset_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'wait_for_completion', + 'delete_user_annotations' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3985,7 +4411,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.revert_model_snapshot'] + } = this[kAcceptedParams]['ml.revert_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4026,7 +4452,13 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'delete_intervening_results', + 'delete_intervening_results' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4041,7 +4473,7 @@ export default class Ml { async setUpgradeMode (this: That, params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.set_upgrade_mode'] + } = this[kAcceptedParams]['ml.set_upgrade_mode'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4069,7 +4501,11 @@ export default class Ml { const method = 'POST' const path = '/_ml/set_upgrade_mode' const meta: TransportRequestMetadata = { - name: 'ml.set_upgrade_mode' + name: 'ml.set_upgrade_mode', + acceptedParams: [ + 'enabled', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4084,7 +4520,7 @@ export default class Ml { async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.start_data_frame_analytics'] + } = this[kAcceptedParams]['ml.start_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4114,7 +4550,11 @@ export default class Ml { name: 'ml.start_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4131,7 +4571,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.start_datafeed'] + } = this[kAcceptedParams]['ml.start_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4171,7 +4611,16 @@ export default class Ml { name: 'ml.start_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'end', + 'start', + 'timeout', + 'end', + 'start', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4188,7 +4637,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.start_trained_model_deployment'] + } = this[kAcceptedParams]['ml.start_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4228,7 +4677,19 @@ export default class Ml { name: 'ml.start_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'adaptive_allocations', + 'cache_size', + 'deployment_id', + 'number_of_allocations', + 'priority', + 'queue_capacity', + 'threads_per_allocation', + 'timeout', + 'wait_for' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4243,7 +4704,7 @@ export default class Ml { async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.stop_data_frame_analytics'] + } = this[kAcceptedParams]['ml.stop_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4273,7 +4734,13 @@ export default class Ml { name: 'ml.stop_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4290,7 +4757,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.stop_datafeed'] + } = this[kAcceptedParams]['ml.stop_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4330,7 +4797,16 @@ export default class Ml { name: 'ml.stop_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'allow_no_match', + 'force', + 'timeout', + 'allow_no_match', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4345,7 +4821,7 @@ export default class Ml { async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.stop_trained_model_deployment'] + } = this[kAcceptedParams]['ml.stop_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4375,7 +4851,12 @@ export default class Ml { name: 'ml.stop_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'allow_no_match', + 'force' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4392,7 +4873,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_data_frame_analytics'] + } = this[kAcceptedParams]['ml.update_data_frame_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4432,7 +4913,14 @@ export default class Ml { name: 'ml.update_data_frame_analytics', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'description', + 'model_memory_limit', + 'max_num_threads', + 'allow_lazy_start' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4449,7 +4937,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_datafeed'] + } = this[kAcceptedParams]['ml.update_datafeed'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4489,7 +4977,28 @@ export default class Ml { name: 'ml.update_datafeed', pathParts: { datafeed_id: params.datafeed_id - } + }, + acceptedParams: [ + 'datafeed_id', + 'aggregations', + 'chunking_config', + 'delayed_data_check_config', + 'frequency', + 'indices', + 'indexes', + 'indices_options', + 'job_id', + 'max_empty_searches', + 'query', + 'query_delay', + 'runtime_mappings', + 'script_fields', + 'scroll_size', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4506,7 +5015,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_filter'] + } = this[kAcceptedParams]['ml.update_filter'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4546,7 +5055,13 @@ export default class Ml { name: 'ml.update_filter', pathParts: { filter_id: params.filter_id - } + }, + acceptedParams: [ + 'filter_id', + 'add_items', + 'description', + 'remove_items' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4563,7 +5078,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_job'] + } = this[kAcceptedParams]['ml.update_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4603,7 +5118,25 @@ export default class Ml { name: 'ml.update_job', pathParts: { job_id: params.job_id - } + }, + acceptedParams: [ + 'job_id', + 'allow_lazy_open', + 'analysis_limits', + 'background_persist_interval', + 'custom_settings', + 'categorization_filters', + 'description', + 'model_plot_config', + 'model_prune_window', + 'daily_model_snapshot_retention_after_days', + 'model_snapshot_retention_days', + 'renormalization_window_days', + 'results_retention_days', + 'groups', + 'detectors', + 'per_partition_categorization' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4620,7 +5153,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_model_snapshot'] + } = this[kAcceptedParams]['ml.update_model_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4661,7 +5194,13 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'description', + 'retain' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4678,7 +5217,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.update_trained_model_deployment'] + } = this[kAcceptedParams]['ml.update_trained_model_deployment'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4718,7 +5257,13 @@ export default class Ml { name: 'ml.update_trained_model_deployment', pathParts: { model_id: params.model_id - } + }, + acceptedParams: [ + 'model_id', + 'number_of_allocations', + 'adaptive_allocations', + 'number_of_allocations' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4733,7 +5278,7 @@ export default class Ml { async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ml.upgrade_job_snapshot'] + } = this[kAcceptedParams]['ml.upgrade_job_snapshot'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4764,7 +5309,13 @@ export default class Ml { pathParts: { job_id: params.job_id, snapshot_id: params.snapshot_id - } + }, + acceptedParams: [ + 'job_id', + 'snapshot_id', + 'wait_for_completion', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4781,7 +5332,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.validate'] + } = this[kAcceptedParams]['ml.validate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4819,7 +5370,18 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate' const meta: TransportRequestMetadata = { - name: 'ml.validate' + name: 'ml.validate', + acceptedParams: [ + 'job_id', + 'analysis_config', + 'analysis_limits', + 'data_description', + 'description', + 'model_plot', + 'model_snapshot_id', + 'model_snapshot_retention_days', + 'results_index_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -4836,7 +5398,7 @@ export default class Ml { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['ml.validate_detector'] + } = this[kAcceptedParams]['ml.validate_detector'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -4863,7 +5425,10 @@ export default class Ml { const method = 'POST' const path = '/_ml/anomaly_detectors/_validate/detector' const meta: TransportRequestMetadata = { - name: 'ml.validate_detector' + name: 'ml.validate_detector', + acceptedParams: [ + 'detector' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/monitoring.ts b/src/api/api/monitoring.ts index 8974e0c87..f8abf74f6 100644 --- a/src/api/api/monitoring.ts +++ b/src/api/api/monitoring.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Monitoring { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'monitoring.bulk': { path: [ 'type' @@ -63,7 +64,7 @@ export default class Monitoring { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['monitoring.bulk'] + } = this[kAcceptedParams]['monitoring.bulk'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -93,7 +94,14 @@ export default class Monitoring { name: 'monitoring.bulk', pathParts: { type: params.type - } + }, + acceptedParams: [ + 'type', + 'operations', + 'system_id', + 'system_api_version', + 'interval' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } diff --git a/src/api/api/msearch.ts b/src/api/api/msearch.ts index 37577bdd2..b50b50af3 100644 --- a/src/api/api/msearch.ts +++ b/src/api/api/msearch.ts @@ -104,7 +104,25 @@ export default async function MsearchApi + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Nodes { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'nodes.clear_repositories_metering_archive': { path: [ 'node_id', @@ -129,7 +130,7 @@ export default class Nodes { async clearRepositoriesMeteringArchive (this: That, params: T.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.clear_repositories_metering_archive'] + } = this[kAcceptedParams]['nodes.clear_repositories_metering_archive'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -160,7 +161,11 @@ export default class Nodes { pathParts: { node_id: params.node_id, max_archive_version: params.max_archive_version - } + }, + acceptedParams: [ + 'node_id', + 'max_archive_version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -175,7 +180,7 @@ export default class Nodes { async getRepositoriesMeteringInfo (this: That, params: T.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.get_repositories_metering_info'] + } = this[kAcceptedParams]['nodes.get_repositories_metering_info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -205,7 +210,10 @@ export default class Nodes { name: 'nodes.get_repositories_metering_info', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -220,7 +228,7 @@ export default class Nodes { async hotThreads (this: That, params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.hot_threads'] + } = this[kAcceptedParams]['nodes.hot_threads'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -258,7 +266,17 @@ export default class Nodes { name: 'nodes.hot_threads', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'ignore_idle_threads', + 'interval', + 'snapshots', + 'threads', + 'timeout', + 'type', + 'sort' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -273,7 +291,7 @@ export default class Nodes { async info (this: That, params?: T.NodesInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.info'] + } = this[kAcceptedParams]['nodes.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -318,7 +336,13 @@ export default class Nodes { pathParts: { node_id: params.node_id, metric: params.metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'flat_settings', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +359,7 @@ export default class Nodes { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['nodes.reload_secure_settings'] + } = this[kAcceptedParams]['nodes.reload_secure_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -383,7 +407,12 @@ export default class Nodes { name: 'nodes.reload_secure_settings', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'secure_settings_password', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -398,7 +427,7 @@ export default class Nodes { async stats (this: That, params?: T.NodesStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.stats'] + } = this[kAcceptedParams]['nodes.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -450,7 +479,21 @@ export default class Nodes { node_id: params.node_id, metric: params.metric, index_metric: params.index_metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'index_metric', + 'completion_fields', + 'fielddata_fields', + 'fields', + 'groups', + 'include_segment_file_sizes', + 'level', + 'timeout', + 'types', + 'include_unloaded_segments' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -465,7 +508,7 @@ export default class Nodes { async usage (this: That, params?: T.NodesUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['nodes.usage'] + } = this[kAcceptedParams]['nodes.usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -510,7 +553,12 @@ export default class Nodes { pathParts: { node_id: params.node_id, metric: params.metric - } + }, + acceptedParams: [ + 'node_id', + 'metric', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/open_point_in_time.ts b/src/api/api/open_point_in_time.ts index 3b547e4d3..585d3927d 100644 --- a/src/api/api/open_point_in_time.ts +++ b/src/api/api/open_point_in_time.ts @@ -100,7 +100,18 @@ export default async function OpenPointInTimeApi (this: That, params: T.OpenPoin name: 'open_point_in_time', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'index_filter', + 'keep_alive', + 'ignore_unavailable', + 'preference', + 'routing', + 'expand_wildcards', + 'allow_partial_search_results', + 'max_concurrent_shard_requests' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ping.ts b/src/api/api/ping.ts index ea9109110..93fa5f635 100644 --- a/src/api/api/ping.ts +++ b/src/api/api/ping.ts @@ -72,7 +72,9 @@ export default async function PingApi (this: That, params?: T.PingRequest, optio const method = 'HEAD' const path = '/' const meta: TransportRequestMetadata = { - name: 'ping' + name: 'ping', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/profiling.ts b/src/api/api/profiling.ts index 7998d1c2d..1f02a06f7 100644 --- a/src/api/api/profiling.ts +++ b/src/api/api/profiling.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Profiling { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'profiling.flamegraph': { path: [], body: [], @@ -66,7 +67,7 @@ export default class Profiling { async flamegraph (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.flamegraph'] + } = this[kAcceptedParams]['profiling.flamegraph'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -93,7 +94,9 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/flamegraph' const meta: TransportRequestMetadata = { - name: 'profiling.flamegraph' + name: 'profiling.flamegraph', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -108,7 +111,7 @@ export default class Profiling { async stacktraces (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.stacktraces'] + } = this[kAcceptedParams]['profiling.stacktraces'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -135,7 +138,9 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/stacktraces' const meta: TransportRequestMetadata = { - name: 'profiling.stacktraces' + name: 'profiling.stacktraces', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -150,7 +155,7 @@ export default class Profiling { async status (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.status'] + } = this[kAcceptedParams]['profiling.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -177,7 +182,9 @@ export default class Profiling { const method = 'GET' const path = '/_profiling/status' const meta: TransportRequestMetadata = { - name: 'profiling.status' + name: 'profiling.status', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -192,7 +199,7 @@ export default class Profiling { async topnFunctions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['profiling.topn_functions'] + } = this[kAcceptedParams]['profiling.topn_functions'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -219,7 +226,9 @@ export default class Profiling { const method = 'POST' const path = '/_profiling/topn/functions' const meta: TransportRequestMetadata = { - name: 'profiling.topn_functions' + name: 'profiling.topn_functions', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/put_script.ts b/src/api/api/put_script.ts index 8cec8229e..d1dc5db52 100644 --- a/src/api/api/put_script.ts +++ b/src/api/api/put_script.ts @@ -105,7 +105,15 @@ export default async function PutScriptApi (this: That, params: T.PutScriptReque pathParts: { id: params.id, context: params.context - } + }, + acceptedParams: [ + 'id', + 'context', + 'script', + 'context', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/query_rules.ts b/src/api/api/query_rules.ts index 2e5c17cdf..921fd23f9 100644 --- a/src/api/api/query_rules.ts +++ b/src/api/api/query_rules.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class QueryRules { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'query_rules.delete_rule': { path: [ 'ruleset_id', @@ -117,7 +118,7 @@ export default class QueryRules { async deleteRule (this: That, params: T.QueryRulesDeleteRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.delete_rule'] + } = this[kAcceptedParams]['query_rules.delete_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -148,7 +149,11 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -163,7 +168,7 @@ export default class QueryRules { async deleteRuleset (this: That, params: T.QueryRulesDeleteRulesetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.delete_ruleset'] + } = this[kAcceptedParams]['query_rules.delete_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -193,7 +198,10 @@ export default class QueryRules { name: 'query_rules.delete_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -208,7 +216,7 @@ export default class QueryRules { async getRule (this: That, params: T.QueryRulesGetRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.get_rule'] + } = this[kAcceptedParams]['query_rules.get_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -239,7 +247,11 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -254,7 +266,7 @@ export default class QueryRules { async getRuleset (this: That, params: T.QueryRulesGetRulesetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.get_ruleset'] + } = this[kAcceptedParams]['query_rules.get_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -284,7 +296,10 @@ export default class QueryRules { name: 'query_rules.get_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -299,7 +314,7 @@ export default class QueryRules { async listRulesets (this: That, params?: T.QueryRulesListRulesetsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['query_rules.list_rulesets'] + } = this[kAcceptedParams]['query_rules.list_rulesets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -327,7 +342,11 @@ export default class QueryRules { const method = 'GET' const path = '/_query_rules' const meta: TransportRequestMetadata = { - name: 'query_rules.list_rulesets' + name: 'query_rules.list_rulesets', + acceptedParams: [ + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -344,7 +363,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.put_rule'] + } = this[kAcceptedParams]['query_rules.put_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -385,7 +404,15 @@ export default class QueryRules { pathParts: { ruleset_id: params.ruleset_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rule_id', + 'type', + 'criteria', + 'actions', + 'priority' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -402,7 +429,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.put_ruleset'] + } = this[kAcceptedParams]['query_rules.put_ruleset'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -442,7 +469,11 @@ export default class QueryRules { name: 'query_rules.put_ruleset', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'rules' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -459,7 +490,7 @@ export default class QueryRules { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['query_rules.test'] + } = this[kAcceptedParams]['query_rules.test'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -499,7 +530,11 @@ export default class QueryRules { name: 'query_rules.test', pathParts: { ruleset_id: params.ruleset_id - } + }, + acceptedParams: [ + 'ruleset_id', + 'match_criteria' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rank_eval.ts b/src/api/api/rank_eval.ts index 795b5e3c2..665fea782 100644 --- a/src/api/api/rank_eval.ts +++ b/src/api/api/rank_eval.ts @@ -105,7 +105,16 @@ export default async function RankEvalApi (this: That, params: T.RankEvalRequest name: 'rank_eval', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'requests', + 'metric', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'search_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex.ts b/src/api/api/reindex.ts index c280e26e8..bbb3174a4 100644 --- a/src/api/api/reindex.ts +++ b/src/api/api/reindex.ts @@ -102,7 +102,24 @@ export default async function ReindexApi (this: That, params: T.ReindexRequest, const method = 'POST' const path = '/_reindex' const meta: TransportRequestMetadata = { - name: 'reindex' + name: 'reindex', + acceptedParams: [ + 'conflicts', + 'dest', + 'max_docs', + 'script', + 'size', + 'source', + 'refresh', + 'requests_per_second', + 'scroll', + 'slices', + 'max_docs', + 'timeout', + 'wait_for_active_shards', + 'wait_for_completion', + 'require_alias' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/reindex_rethrottle.ts b/src/api/api/reindex_rethrottle.ts index cf966a44f..d25bc2108 100644 --- a/src/api/api/reindex_rethrottle.ts +++ b/src/api/api/reindex_rethrottle.ts @@ -78,7 +78,11 @@ export default async function ReindexRethrottleApi (this: That, params: T.Reinde name: 'reindex_rethrottle', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'requests_per_second' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/render_search_template.ts b/src/api/api/render_search_template.ts index fcc1fbd62..89a54d3e1 100644 --- a/src/api/api/render_search_template.ts +++ b/src/api/api/render_search_template.ts @@ -101,7 +101,14 @@ export default async function RenderSearchTemplateApi (this: That, params?: T.Re name: 'render_search_template', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'id', + 'file', + 'params', + 'source' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/rollup.ts b/src/api/api/rollup.ts index dd175dded..6528eec17 100644 --- a/src/api/api/rollup.ts +++ b/src/api/api/rollup.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Rollup { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'rollup.delete_job': { path: [ 'id' @@ -124,7 +125,7 @@ export default class Rollup { async deleteJob (this: That, params: T.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.delete_job'] + } = this[kAcceptedParams]['rollup.delete_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -154,7 +155,10 @@ export default class Rollup { name: 'rollup.delete_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -169,7 +173,7 @@ export default class Rollup { async getJobs (this: That, params?: T.RollupGetJobsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_jobs'] + } = this[kAcceptedParams]['rollup.get_jobs'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -207,7 +211,10 @@ export default class Rollup { name: 'rollup.get_jobs', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -222,7 +229,7 @@ export default class Rollup { async getRollupCaps (this: That, params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_rollup_caps'] + } = this[kAcceptedParams]['rollup.get_rollup_caps'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -260,7 +267,10 @@ export default class Rollup { name: 'rollup.get_rollup_caps', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -275,7 +285,7 @@ export default class Rollup { async getRollupIndexCaps (this: That, params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.get_rollup_index_caps'] + } = this[kAcceptedParams]['rollup.get_rollup_index_caps'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -305,7 +315,10 @@ export default class Rollup { name: 'rollup.get_rollup_index_caps', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -322,7 +335,7 @@ export default class Rollup { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['rollup.put_job'] + } = this[kAcceptedParams]['rollup.put_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -362,7 +375,18 @@ export default class Rollup { name: 'rollup.put_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'cron', + 'groups', + 'index_pattern', + 'metrics', + 'page_size', + 'rollup_index', + 'timeout', + 'headers' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -379,7 +403,7 @@ export default class Rollup { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['rollup.rollup_search'] + } = this[kAcceptedParams]['rollup.rollup_search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -419,7 +443,16 @@ export default class Rollup { name: 'rollup.rollup_search', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'aggregations', + 'aggs', + 'query', + 'size', + 'rest_total_hits_as_int', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -434,7 +467,7 @@ export default class Rollup { async startJob (this: That, params: T.RollupStartJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.start_job'] + } = this[kAcceptedParams]['rollup.start_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -464,7 +497,10 @@ export default class Rollup { name: 'rollup.start_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -479,7 +515,7 @@ export default class Rollup { async stopJob (this: That, params: T.RollupStopJobRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['rollup.stop_job'] + } = this[kAcceptedParams]['rollup.stop_job'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -509,7 +545,12 @@ export default class Rollup { name: 'rollup.stop_job', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scripts_painless_execute.ts b/src/api/api/scripts_painless_execute.ts index 1d524bc02..c8d3f3a1c 100644 --- a/src/api/api/scripts_painless_execute.ts +++ b/src/api/api/scripts_painless_execute.ts @@ -90,7 +90,12 @@ export default async function ScriptsPainlessExecuteApi (this const method = body != null ? 'POST' : 'GET' const path = '/_scripts/painless/_execute' const meta: TransportRequestMetadata = { - name: 'scripts_painless_execute' + name: 'scripts_painless_execute', + acceptedParams: [ + 'context', + 'context_setup', + 'script' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/scroll.ts b/src/api/api/scroll.ts index 1bb814335..0dac36c0a 100644 --- a/src/api/api/scroll.ts +++ b/src/api/api/scroll.ts @@ -95,7 +95,15 @@ export default async function ScrollApi + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class SearchApplication { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'search_application.delete': { path: [ 'name' @@ -135,7 +136,7 @@ export default class SearchApplication { async delete (this: That, params: T.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.delete'] + } = this[kAcceptedParams]['search_application.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -165,7 +166,10 @@ export default class SearchApplication { name: 'search_application.delete', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -180,7 +184,7 @@ export default class SearchApplication { async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.delete_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.delete_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -210,7 +214,10 @@ export default class SearchApplication { name: 'search_application.delete_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -225,7 +232,7 @@ export default class SearchApplication { async get (this: That, params: T.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.get'] + } = this[kAcceptedParams]['search_application.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -255,7 +262,10 @@ export default class SearchApplication { name: 'search_application.get', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -270,7 +280,7 @@ export default class SearchApplication { async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.get_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.get_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -308,7 +318,10 @@ export default class SearchApplication { name: 'search_application.get_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -323,7 +336,7 @@ export default class SearchApplication { async list (this: That, params?: T.SearchApplicationListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.list'] + } = this[kAcceptedParams]['search_application.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -351,7 +364,12 @@ export default class SearchApplication { const method = 'GET' const path = '/_application/search_application' const meta: TransportRequestMetadata = { - name: 'search_application.list' + name: 'search_application.list', + acceptedParams: [ + 'q', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -368,7 +386,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.post_behavioral_analytics_event'] + } = this[kAcceptedParams]['search_application.post_behavioral_analytics_event'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +417,13 @@ export default class SearchApplication { pathParts: { collection_name: params.collection_name, event_type: params.event_type - } + }, + acceptedParams: [ + 'collection_name', + 'event_type', + 'payload', + 'debug' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -416,7 +440,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.put'] + } = this[kAcceptedParams]['search_application.put'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -446,7 +470,12 @@ export default class SearchApplication { name: 'search_application.put', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'search_application', + 'create' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -461,7 +490,7 @@ export default class SearchApplication { async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['search_application.put_behavioral_analytics'] + } = this[kAcceptedParams]['search_application.put_behavioral_analytics'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -491,7 +520,10 @@ export default class SearchApplication { name: 'search_application.put_behavioral_analytics', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -508,7 +540,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.render_query'] + } = this[kAcceptedParams]['search_application.render_query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -548,7 +580,11 @@ export default class SearchApplication { name: 'search_application.render_query', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'params' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -565,7 +601,7 @@ export default class SearchApplication { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['search_application.search'] + } = this[kAcceptedParams]['search_application.search'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -605,7 +641,12 @@ export default class SearchApplication { name: 'search_application.search', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'params', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_mvt.ts b/src/api/api/search_mvt.ts index 5293e4a21..f85fcb5ac 100644 --- a/src/api/api/search_mvt.ts +++ b/src/api/api/search_mvt.ts @@ -122,7 +122,36 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque zoom: params.zoom, x: params.x, y: params.y - } + }, + acceptedParams: [ + 'index', + 'field', + 'zoom', + 'x', + 'y', + 'aggs', + 'buffer', + 'exact_bounds', + 'extent', + 'fields', + 'grid_agg', + 'grid_precision', + 'grid_type', + 'query', + 'runtime_mappings', + 'size', + 'sort', + 'track_total_hits', + 'with_labels', + 'exact_bounds', + 'extent', + 'grid_agg', + 'grid_precision', + 'grid_type', + 'size', + 'track_total_hits', + 'with_labels' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_shards.ts b/src/api/api/search_shards.ts index e82889be1..d75d62691 100644 --- a/src/api/api/search_shards.ts +++ b/src/api/api/search_shards.ts @@ -92,7 +92,17 @@ export default async function SearchShardsApi (this: That, params?: T.SearchShar name: 'search_shards', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'local', + 'master_timeout', + 'preference', + 'routing' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/search_template.ts b/src/api/api/search_template.ts index 1b4d9e066..1e6cad36a 100644 --- a/src/api/api/search_template.ts +++ b/src/api/api/search_template.ts @@ -118,7 +118,28 @@ export default async function SearchTemplateApi (this: That name: 'search_template', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'explain', + 'id', + 'params', + 'profile', + 'source', + 'allow_no_indices', + 'ccs_minimize_roundtrips', + 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', + 'preference', + 'profile', + 'routing', + 'scroll', + 'search_type', + 'rest_total_hits_as_int', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/searchable_snapshots.ts b/src/api/api/searchable_snapshots.ts index 0d642e793..11ea96fa0 100644 --- a/src/api/api/searchable_snapshots.ts +++ b/src/api/api/searchable_snapshots.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class SearchableSnapshots { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'searchable_snapshots.cache_stats': { path: [ 'node_id' @@ -94,7 +95,7 @@ export default class SearchableSnapshots { async cacheStats (this: That, params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.cache_stats'] + } = this[kAcceptedParams]['searchable_snapshots.cache_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -132,7 +133,11 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.cache_stats', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -147,7 +152,7 @@ export default class SearchableSnapshots { async clearCache (this: That, params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.clear_cache'] + } = this[kAcceptedParams]['searchable_snapshots.clear_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -185,7 +190,13 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.clear_cache', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'expand_wildcards', + 'allow_no_indices', + 'ignore_unavailable' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -202,7 +213,7 @@ export default class SearchableSnapshots { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['searchable_snapshots.mount'] + } = this[kAcceptedParams]['searchable_snapshots.mount'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -243,7 +254,18 @@ export default class SearchableSnapshots { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'index', + 'renamed_index', + 'index_settings', + 'ignore_index_settings', + 'master_timeout', + 'wait_for_completion', + 'storage' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -258,7 +280,7 @@ export default class SearchableSnapshots { async stats (this: That, params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['searchable_snapshots.stats'] + } = this[kAcceptedParams]['searchable_snapshots.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -296,7 +318,11 @@ export default class SearchableSnapshots { name: 'searchable_snapshots.stats', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'level' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/security.ts b/src/api/api/security.ts index d3ed4589d..37057fa72 100644 --- a/src/api/api/security.ts +++ b/src/api/api/security.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Security { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'security.activate_user_profile': { path: [], body: [ @@ -675,7 +676,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.activate_user_profile'] + } = this[kAcceptedParams]['security.activate_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -712,7 +713,13 @@ export default class Security { const method = 'POST' const path = '/_security/profile/_activate' const meta: TransportRequestMetadata = { - name: 'security.activate_user_profile' + name: 'security.activate_user_profile', + acceptedParams: [ + 'access_token', + 'grant_type', + 'password', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -727,7 +734,7 @@ export default class Security { async authenticate (this: That, params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.authenticate'] + } = this[kAcceptedParams]['security.authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -755,7 +762,9 @@ export default class Security { const method = 'GET' const path = '/_security/_authenticate' const meta: TransportRequestMetadata = { - name: 'security.authenticate' + name: 'security.authenticate', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -772,7 +781,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_delete_role'] + } = this[kAcceptedParams]['security.bulk_delete_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -809,7 +818,11 @@ export default class Security { const method = 'DELETE' const path = '/_security/role' const meta: TransportRequestMetadata = { - name: 'security.bulk_delete_role' + name: 'security.bulk_delete_role', + acceptedParams: [ + 'names', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -826,7 +839,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_put_role'] + } = this[kAcceptedParams]['security.bulk_put_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -863,7 +876,11 @@ export default class Security { const method = 'POST' const path = '/_security/role' const meta: TransportRequestMetadata = { - name: 'security.bulk_put_role' + name: 'security.bulk_put_role', + acceptedParams: [ + 'roles', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -880,7 +897,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.bulk_update_api_keys'] + } = this[kAcceptedParams]['security.bulk_update_api_keys'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -917,7 +934,13 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/_bulk_update' const meta: TransportRequestMetadata = { - name: 'security.bulk_update_api_keys' + name: 'security.bulk_update_api_keys', + acceptedParams: [ + 'expiration', + 'ids', + 'metadata', + 'role_descriptors' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -934,7 +957,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.change_password'] + } = this[kAcceptedParams]['security.change_password'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -982,7 +1005,13 @@ export default class Security { name: 'security.change_password', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'password', + 'password_hash', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -997,7 +1026,7 @@ export default class Security { async clearApiKeyCache (this: That, params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_api_key_cache'] + } = this[kAcceptedParams]['security.clear_api_key_cache'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1027,7 +1056,10 @@ export default class Security { name: 'security.clear_api_key_cache', pathParts: { ids: params.ids - } + }, + acceptedParams: [ + 'ids' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1042,7 +1074,7 @@ export default class Security { async clearCachedPrivileges (this: That, params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_privileges'] + } = this[kAcceptedParams]['security.clear_cached_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1072,7 +1104,10 @@ export default class Security { name: 'security.clear_cached_privileges', pathParts: { application: params.application - } + }, + acceptedParams: [ + 'application' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1087,7 +1122,7 @@ export default class Security { async clearCachedRealms (this: That, params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_realms'] + } = this[kAcceptedParams]['security.clear_cached_realms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1117,7 +1152,11 @@ export default class Security { name: 'security.clear_cached_realms', pathParts: { realms: params.realms - } + }, + acceptedParams: [ + 'realms', + 'usernames' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1132,7 +1171,7 @@ export default class Security { async clearCachedRoles (this: That, params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_roles'] + } = this[kAcceptedParams]['security.clear_cached_roles'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1162,7 +1201,10 @@ export default class Security { name: 'security.clear_cached_roles', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1177,7 +1219,7 @@ export default class Security { async clearCachedServiceTokens (this: That, params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.clear_cached_service_tokens'] + } = this[kAcceptedParams]['security.clear_cached_service_tokens'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1209,7 +1251,12 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1226,7 +1273,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.create_api_key'] + } = this[kAcceptedParams]['security.create_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1264,7 +1311,14 @@ export default class Security { const method = 'PUT' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.create_api_key' + name: 'security.create_api_key', + acceptedParams: [ + 'expiration', + 'name', + 'role_descriptors', + 'metadata', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1281,7 +1335,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.create_cross_cluster_api_key'] + } = this[kAcceptedParams]['security.create_cross_cluster_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1318,7 +1372,13 @@ export default class Security { const method = 'POST' const path = '/_security/cross_cluster/api_key' const meta: TransportRequestMetadata = { - name: 'security.create_cross_cluster_api_key' + name: 'security.create_cross_cluster_api_key', + acceptedParams: [ + 'access', + 'expiration', + 'metadata', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1333,7 +1393,7 @@ export default class Security { async createServiceToken (this: That, params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.create_service_token'] + } = this[kAcceptedParams]['security.create_service_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1372,7 +1432,13 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1389,7 +1455,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.delegate_pki'] + } = this[kAcceptedParams]['security.delegate_pki'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1426,7 +1492,10 @@ export default class Security { const method = 'POST' const path = '/_security/delegate_pki' const meta: TransportRequestMetadata = { - name: 'security.delegate_pki' + name: 'security.delegate_pki', + acceptedParams: [ + 'x509_certificate_chain' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1441,7 +1510,7 @@ export default class Security { async deletePrivileges (this: That, params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_privileges'] + } = this[kAcceptedParams]['security.delete_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1472,7 +1541,12 @@ export default class Security { pathParts: { application: params.application, name: params.name - } + }, + acceptedParams: [ + 'application', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1487,7 +1561,7 @@ export default class Security { async deleteRole (this: That, params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_role'] + } = this[kAcceptedParams]['security.delete_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1517,7 +1591,11 @@ export default class Security { name: 'security.delete_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1532,7 +1610,7 @@ export default class Security { async deleteRoleMapping (this: That, params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_role_mapping'] + } = this[kAcceptedParams]['security.delete_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1562,7 +1640,11 @@ export default class Security { name: 'security.delete_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1577,7 +1659,7 @@ export default class Security { async deleteServiceToken (this: That, params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_service_token'] + } = this[kAcceptedParams]['security.delete_service_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1609,7 +1691,13 @@ export default class Security { namespace: params.namespace, service: params.service, name: params.name - } + }, + acceptedParams: [ + 'namespace', + 'service', + 'name', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1624,7 +1712,7 @@ export default class Security { async deleteUser (this: That, params: T.SecurityDeleteUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.delete_user'] + } = this[kAcceptedParams]['security.delete_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1654,7 +1742,11 @@ export default class Security { name: 'security.delete_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1669,7 +1761,7 @@ export default class Security { async disableUser (this: That, params: T.SecurityDisableUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.disable_user'] + } = this[kAcceptedParams]['security.disable_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1699,7 +1791,11 @@ export default class Security { name: 'security.disable_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1714,7 +1810,7 @@ export default class Security { async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.disable_user_profile'] + } = this[kAcceptedParams]['security.disable_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1744,7 +1840,11 @@ export default class Security { name: 'security.disable_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1759,7 +1859,7 @@ export default class Security { async enableUser (this: That, params: T.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enable_user'] + } = this[kAcceptedParams]['security.enable_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1789,7 +1889,11 @@ export default class Security { name: 'security.enable_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1804,7 +1908,7 @@ export default class Security { async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enable_user_profile'] + } = this[kAcceptedParams]['security.enable_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1834,7 +1938,11 @@ export default class Security { name: 'security.enable_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1849,7 +1957,7 @@ export default class Security { async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enroll_kibana'] + } = this[kAcceptedParams]['security.enroll_kibana'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1877,7 +1985,9 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/kibana' const meta: TransportRequestMetadata = { - name: 'security.enroll_kibana' + name: 'security.enroll_kibana', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1892,7 +2002,7 @@ export default class Security { async enrollNode (this: That, params?: T.SecurityEnrollNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.enroll_node'] + } = this[kAcceptedParams]['security.enroll_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1920,7 +2030,9 @@ export default class Security { const method = 'GET' const path = '/_security/enroll/node' const meta: TransportRequestMetadata = { - name: 'security.enroll_node' + name: 'security.enroll_node', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1935,7 +2047,7 @@ export default class Security { async getApiKey (this: That, params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_api_key'] + } = this[kAcceptedParams]['security.get_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -1963,7 +2075,17 @@ export default class Security { const method = 'GET' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.get_api_key' + name: 'security.get_api_key', + acceptedParams: [ + 'id', + 'name', + 'owner', + 'realm_name', + 'username', + 'with_limited_by', + 'active_only', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -1978,7 +2100,7 @@ export default class Security { async getBuiltinPrivileges (this: That, params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_builtin_privileges'] + } = this[kAcceptedParams]['security.get_builtin_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2006,7 +2128,9 @@ export default class Security { const method = 'GET' const path = '/_security/privilege/_builtin' const meta: TransportRequestMetadata = { - name: 'security.get_builtin_privileges' + name: 'security.get_builtin_privileges', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2021,7 +2145,7 @@ export default class Security { async getPrivileges (this: That, params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_privileges'] + } = this[kAcceptedParams]['security.get_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2063,7 +2187,11 @@ export default class Security { pathParts: { application: params.application, name: params.name - } + }, + acceptedParams: [ + 'application', + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2078,7 +2206,7 @@ export default class Security { async getRole (this: That, params?: T.SecurityGetRoleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_role'] + } = this[kAcceptedParams]['security.get_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2116,7 +2244,10 @@ export default class Security { name: 'security.get_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2131,7 +2262,7 @@ export default class Security { async getRoleMapping (this: That, params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_role_mapping'] + } = this[kAcceptedParams]['security.get_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2169,7 +2300,10 @@ export default class Security { name: 'security.get_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2184,7 +2318,7 @@ export default class Security { async getServiceAccounts (this: That, params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_service_accounts'] + } = this[kAcceptedParams]['security.get_service_accounts'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2226,7 +2360,11 @@ export default class Security { pathParts: { namespace: params.namespace, service: params.service - } + }, + acceptedParams: [ + 'namespace', + 'service' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2241,7 +2379,7 @@ export default class Security { async getServiceCredentials (this: That, params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_service_credentials'] + } = this[kAcceptedParams]['security.get_service_credentials'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2272,7 +2410,11 @@ export default class Security { pathParts: { namespace: params.namespace, service: params.service - } + }, + acceptedParams: [ + 'namespace', + 'service' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2287,7 +2429,7 @@ export default class Security { async getSettings (this: That, params?: T.SecurityGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_settings'] + } = this[kAcceptedParams]['security.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2315,7 +2457,10 @@ export default class Security { const method = 'GET' const path = '/_security/settings' const meta: TransportRequestMetadata = { - name: 'security.get_settings' + name: 'security.get_settings', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2332,7 +2477,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.get_token'] + } = this[kAcceptedParams]['security.get_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2370,7 +2515,15 @@ export default class Security { const method = 'POST' const path = '/_security/oauth2/token' const meta: TransportRequestMetadata = { - name: 'security.get_token' + name: 'security.get_token', + acceptedParams: [ + 'grant_type', + 'scope', + 'password', + 'kerberos_ticket', + 'refresh_token', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2385,7 +2538,7 @@ export default class Security { async getUser (this: That, params?: T.SecurityGetUserRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user'] + } = this[kAcceptedParams]['security.get_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2423,7 +2576,11 @@ export default class Security { name: 'security.get_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2438,7 +2595,7 @@ export default class Security { async getUserPrivileges (this: That, params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user_privileges'] + } = this[kAcceptedParams]['security.get_user_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2466,7 +2623,9 @@ export default class Security { const method = 'GET' const path = '/_security/user/_privileges' const meta: TransportRequestMetadata = { - name: 'security.get_user_privileges' + name: 'security.get_user_privileges', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2481,7 +2640,7 @@ export default class Security { async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.get_user_profile'] + } = this[kAcceptedParams]['security.get_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2511,7 +2670,11 @@ export default class Security { name: 'security.get_user_profile', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'data' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2528,7 +2691,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.grant_api_key'] + } = this[kAcceptedParams]['security.grant_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2565,7 +2728,16 @@ export default class Security { const method = 'POST' const path = '/_security/api_key/grant' const meta: TransportRequestMetadata = { - name: 'security.grant_api_key' + name: 'security.grant_api_key', + acceptedParams: [ + 'api_key', + 'grant_type', + 'access_token', + 'username', + 'password', + 'run_as', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2582,7 +2754,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.has_privileges'] + } = this[kAcceptedParams]['security.has_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2630,7 +2802,13 @@ export default class Security { name: 'security.has_privileges', pathParts: { user: params.user - } + }, + acceptedParams: [ + 'user', + 'application', + 'cluster', + 'index' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2647,7 +2825,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.has_privileges_user_profile'] + } = this[kAcceptedParams]['security.has_privileges_user_profile'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2684,7 +2862,11 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_has_privileges' const meta: TransportRequestMetadata = { - name: 'security.has_privileges_user_profile' + name: 'security.has_privileges_user_profile', + acceptedParams: [ + 'uids', + 'privileges' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2701,7 +2883,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.invalidate_api_key'] + } = this[kAcceptedParams]['security.invalidate_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2739,7 +2921,15 @@ export default class Security { const method = 'DELETE' const path = '/_security/api_key' const meta: TransportRequestMetadata = { - name: 'security.invalidate_api_key' + name: 'security.invalidate_api_key', + acceptedParams: [ + 'id', + 'ids', + 'name', + 'owner', + 'realm_name', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2756,7 +2946,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.invalidate_token'] + } = this[kAcceptedParams]['security.invalidate_token'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2794,7 +2984,13 @@ export default class Security { const method = 'DELETE' const path = '/_security/oauth2/token' const meta: TransportRequestMetadata = { - name: 'security.invalidate_token' + name: 'security.invalidate_token', + acceptedParams: [ + 'token', + 'refresh_token', + 'realm_name', + 'username' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2811,7 +3007,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_authenticate'] + } = this[kAcceptedParams]['security.oidc_authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2848,7 +3044,13 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/authenticate' const meta: TransportRequestMetadata = { - name: 'security.oidc_authenticate' + name: 'security.oidc_authenticate', + acceptedParams: [ + 'nonce', + 'realm', + 'redirect_uri', + 'state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2865,7 +3067,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_logout'] + } = this[kAcceptedParams]['security.oidc_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2902,7 +3104,11 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/logout' const meta: TransportRequestMetadata = { - name: 'security.oidc_logout' + name: 'security.oidc_logout', + acceptedParams: [ + 'token', + 'refresh_token' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2919,7 +3125,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.oidc_prepare_authentication'] + } = this[kAcceptedParams]['security.oidc_prepare_authentication'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -2957,7 +3163,14 @@ export default class Security { const method = 'POST' const path = '/_security/oidc/prepare' const meta: TransportRequestMetadata = { - name: 'security.oidc_prepare_authentication' + name: 'security.oidc_prepare_authentication', + acceptedParams: [ + 'iss', + 'login_hint', + 'nonce', + 'realm', + 'state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -2974,7 +3187,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_privileges'] + } = this[kAcceptedParams]['security.put_privileges'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3001,7 +3214,11 @@ export default class Security { const method = 'PUT' const path = '/_security/privilege' const meta: TransportRequestMetadata = { - name: 'security.put_privileges' + name: 'security.put_privileges', + acceptedParams: [ + 'privileges', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3018,7 +3235,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_role'] + } = this[kAcceptedParams]['security.put_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3058,7 +3275,21 @@ export default class Security { name: 'security.put_role', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'applications', + 'cluster', + 'global', + 'indices', + 'remote_indices', + 'remote_cluster', + 'metadata', + 'run_as', + 'description', + 'transient_metadata', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3075,7 +3306,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_role_mapping'] + } = this[kAcceptedParams]['security.put_role_mapping'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3115,7 +3346,17 @@ export default class Security { name: 'security.put_role_mapping', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'name', + 'enabled', + 'metadata', + 'roles', + 'role_templates', + 'rules', + 'run_as', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3132,7 +3373,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.put_user'] + } = this[kAcceptedParams]['security.put_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3172,7 +3413,19 @@ export default class Security { name: 'security.put_user', pathParts: { username: params.username - } + }, + acceptedParams: [ + 'username', + 'username', + 'email', + 'full_name', + 'metadata', + 'password', + 'password_hash', + 'roles', + 'enabled', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3189,7 +3442,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_api_keys'] + } = this[kAcceptedParams]['security.query_api_keys'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3227,7 +3480,19 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/api_key' const meta: TransportRequestMetadata = { - name: 'security.query_api_keys' + name: 'security.query_api_keys', + acceptedParams: [ + 'aggregations', + 'aggs', + 'query', + 'from', + 'sort', + 'size', + 'search_after', + 'with_limited_by', + 'with_profile_uid', + 'typed_keys' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3244,7 +3509,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_role'] + } = this[kAcceptedParams]['security.query_role'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3282,7 +3547,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/role' const meta: TransportRequestMetadata = { - name: 'security.query_role' + name: 'security.query_role', + acceptedParams: [ + 'query', + 'from', + 'sort', + 'size', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3299,7 +3571,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.query_user'] + } = this[kAcceptedParams]['security.query_user'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3337,7 +3609,15 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/_query/user' const meta: TransportRequestMetadata = { - name: 'security.query_user' + name: 'security.query_user', + acceptedParams: [ + 'query', + 'from', + 'sort', + 'size', + 'search_after', + 'with_profile_uid' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3354,7 +3634,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_authenticate'] + } = this[kAcceptedParams]['security.saml_authenticate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3391,7 +3671,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/authenticate' const meta: TransportRequestMetadata = { - name: 'security.saml_authenticate' + name: 'security.saml_authenticate', + acceptedParams: [ + 'content', + 'ids', + 'realm' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3408,7 +3693,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_complete_logout'] + } = this[kAcceptedParams]['security.saml_complete_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3445,7 +3730,13 @@ export default class Security { const method = 'POST' const path = '/_security/saml/complete_logout' const meta: TransportRequestMetadata = { - name: 'security.saml_complete_logout' + name: 'security.saml_complete_logout', + acceptedParams: [ + 'realm', + 'ids', + 'query_string', + 'content' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3462,7 +3753,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_invalidate'] + } = this[kAcceptedParams]['security.saml_invalidate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3499,7 +3790,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/invalidate' const meta: TransportRequestMetadata = { - name: 'security.saml_invalidate' + name: 'security.saml_invalidate', + acceptedParams: [ + 'acs', + 'query_string', + 'realm' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3516,7 +3812,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_logout'] + } = this[kAcceptedParams]['security.saml_logout'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3553,7 +3849,11 @@ export default class Security { const method = 'POST' const path = '/_security/saml/logout' const meta: TransportRequestMetadata = { - name: 'security.saml_logout' + name: 'security.saml_logout', + acceptedParams: [ + 'token', + 'refresh_token' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3570,7 +3870,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.saml_prepare_authentication'] + } = this[kAcceptedParams]['security.saml_prepare_authentication'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3608,7 +3908,12 @@ export default class Security { const method = 'POST' const path = '/_security/saml/prepare' const meta: TransportRequestMetadata = { - name: 'security.saml_prepare_authentication' + name: 'security.saml_prepare_authentication', + acceptedParams: [ + 'acs', + 'realm', + 'relay_state' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3623,7 +3928,7 @@ export default class Security { async samlServiceProviderMetadata (this: That, params: T.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['security.saml_service_provider_metadata'] + } = this[kAcceptedParams]['security.saml_service_provider_metadata'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3653,7 +3958,10 @@ export default class Security { name: 'security.saml_service_provider_metadata', pathParts: { realm_name: params.realm_name - } + }, + acceptedParams: [ + 'realm_name' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3670,7 +3978,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.suggest_user_profiles'] + } = this[kAcceptedParams]['security.suggest_user_profiles'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3708,7 +4016,14 @@ export default class Security { const method = body != null ? 'POST' : 'GET' const path = '/_security/profile/_suggest' const meta: TransportRequestMetadata = { - name: 'security.suggest_user_profiles' + name: 'security.suggest_user_profiles', + acceptedParams: [ + 'name', + 'size', + 'data', + 'hint', + 'data' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3725,7 +4040,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_api_key'] + } = this[kAcceptedParams]['security.update_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3765,7 +4080,13 @@ export default class Security { name: 'security.update_api_key', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'role_descriptors', + 'metadata', + 'expiration' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3782,7 +4103,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_cross_cluster_api_key'] + } = this[kAcceptedParams]['security.update_cross_cluster_api_key'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3822,7 +4143,13 @@ export default class Security { name: 'security.update_cross_cluster_api_key', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'access', + 'expiration', + 'metadata' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3839,7 +4166,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_settings'] + } = this[kAcceptedParams]['security.update_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3877,7 +4204,14 @@ export default class Security { const method = 'PUT' const path = '/_security/settings' const meta: TransportRequestMetadata = { - name: 'security.update_settings' + name: 'security.update_settings', + acceptedParams: [ + 'security', + 'security-profile', + 'security-tokens', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -3894,7 +4228,7 @@ export default class Security { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['security.update_user_profile_data'] + } = this[kAcceptedParams]['security.update_user_profile_data'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -3934,7 +4268,15 @@ export default class Security { name: 'security.update_user_profile_data', pathParts: { uid: params.uid - } + }, + acceptedParams: [ + 'uid', + 'labels', + 'data', + 'if_seq_no', + 'if_primary_term', + 'refresh' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/shutdown.ts b/src/api/api/shutdown.ts index 67755db18..deb971087 100644 --- a/src/api/api/shutdown.ts +++ b/src/api/api/shutdown.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Shutdown { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'shutdown.delete_node': { path: [ 'node_id' @@ -82,7 +83,7 @@ export default class Shutdown { async deleteNode (this: That, params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['shutdown.delete_node'] + } = this[kAcceptedParams]['shutdown.delete_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -112,7 +113,12 @@ export default class Shutdown { name: 'shutdown.delete_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -127,7 +133,7 @@ export default class Shutdown { async getNode (this: That, params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['shutdown.get_node'] + } = this[kAcceptedParams]['shutdown.get_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -165,7 +171,11 @@ export default class Shutdown { name: 'shutdown.get_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -182,7 +192,7 @@ export default class Shutdown { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['shutdown.put_node'] + } = this[kAcceptedParams]['shutdown.put_node'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -222,7 +232,16 @@ export default class Shutdown { name: 'shutdown.put_node', pathParts: { node_id: params.node_id - } + }, + acceptedParams: [ + 'node_id', + 'type', + 'reason', + 'allocation_delay', + 'target_node_name', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/simulate.ts b/src/api/api/simulate.ts index 68f123b5a..f2f4029ab 100644 --- a/src/api/api/simulate.ts +++ b/src/api/api/simulate.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Simulate { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'simulate.ingest': { path: [ 'index' @@ -65,7 +66,7 @@ export default class Simulate { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['simulate.ingest'] + } = this[kAcceptedParams]['simulate.ingest'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -112,7 +113,16 @@ export default class Simulate { name: 'simulate.ingest', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'docs', + 'component_template_substitutions', + 'index_template_substitutions', + 'mapping_addition', + 'pipeline_substitutions', + 'pipeline' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/slm.ts b/src/api/api/slm.ts index cb290106f..58df5d85f 100644 --- a/src/api/api/slm.ts +++ b/src/api/api/slm.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Slm { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'slm.delete_lifecycle': { path: [ 'policy_id' @@ -134,7 +135,7 @@ export default class Slm { async deleteLifecycle (this: That, params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.delete_lifecycle'] + } = this[kAcceptedParams]['slm.delete_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -164,7 +165,12 @@ export default class Slm { name: 'slm.delete_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -179,7 +185,7 @@ export default class Slm { async executeLifecycle (this: That, params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.execute_lifecycle'] + } = this[kAcceptedParams]['slm.execute_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -209,7 +215,12 @@ export default class Slm { name: 'slm.execute_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -224,7 +235,7 @@ export default class Slm { async executeRetention (this: That, params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.execute_retention'] + } = this[kAcceptedParams]['slm.execute_retention'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -252,7 +263,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/_execute_retention' const meta: TransportRequestMetadata = { - name: 'slm.execute_retention' + name: 'slm.execute_retention', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -267,7 +282,7 @@ export default class Slm { async getLifecycle (this: That, params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_lifecycle'] + } = this[kAcceptedParams]['slm.get_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -305,7 +320,12 @@ export default class Slm { name: 'slm.get_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -320,7 +340,7 @@ export default class Slm { async getStats (this: That, params?: T.SlmGetStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_stats'] + } = this[kAcceptedParams]['slm.get_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -348,7 +368,11 @@ export default class Slm { const method = 'GET' const path = '/_slm/stats' const meta: TransportRequestMetadata = { - name: 'slm.get_stats' + name: 'slm.get_stats', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -363,7 +387,7 @@ export default class Slm { async getStatus (this: That, params?: T.SlmGetStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.get_status'] + } = this[kAcceptedParams]['slm.get_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -391,7 +415,11 @@ export default class Slm { const method = 'GET' const path = '/_slm/status' const meta: TransportRequestMetadata = { - name: 'slm.get_status' + name: 'slm.get_status', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -408,7 +436,7 @@ export default class Slm { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['slm.put_lifecycle'] + } = this[kAcceptedParams]['slm.put_lifecycle'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -448,7 +476,17 @@ export default class Slm { name: 'slm.put_lifecycle', pathParts: { policy_id: params.policy_id - } + }, + acceptedParams: [ + 'policy_id', + 'config', + 'name', + 'repository', + 'retention', + 'schedule', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -463,7 +501,7 @@ export default class Slm { async start (this: That, params?: T.SlmStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.start'] + } = this[kAcceptedParams]['slm.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -491,7 +529,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/start' const meta: TransportRequestMetadata = { - name: 'slm.start' + name: 'slm.start', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -506,7 +548,7 @@ export default class Slm { async stop (this: That, params?: T.SlmStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['slm.stop'] + } = this[kAcceptedParams]['slm.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -534,7 +576,11 @@ export default class Slm { const method = 'POST' const path = '/_slm/stop' const meta: TransportRequestMetadata = { - name: 'slm.stop' + name: 'slm.stop', + acceptedParams: [ + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/snapshot.ts b/src/api/api/snapshot.ts index a018a70bc..49bdb5188 100644 --- a/src/api/api/snapshot.ts +++ b/src/api/api/snapshot.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Snapshot { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'snapshot.cleanup_repository': { path: [ 'name' @@ -235,7 +236,7 @@ export default class Snapshot { async cleanupRepository (this: That, params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.cleanup_repository'] + } = this[kAcceptedParams]['snapshot.cleanup_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -265,7 +266,12 @@ export default class Snapshot { name: 'snapshot.cleanup_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -282,7 +288,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.clone'] + } = this[kAcceptedParams]['snapshot.clone'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -324,7 +330,14 @@ export default class Snapshot { repository: params.repository, snapshot: params.snapshot, target_snapshot: params.target_snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'target_snapshot', + 'indices', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -341,7 +354,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.create'] + } = this[kAcceptedParams]['snapshot.create'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -382,7 +395,20 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'expand_wildcards', + 'feature_states', + 'ignore_unavailable', + 'include_global_state', + 'indices', + 'metadata', + 'partial', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -399,7 +425,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.create_repository'] + } = this[kAcceptedParams]['snapshot.create_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -429,7 +455,14 @@ export default class Snapshot { name: 'snapshot.create_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'repository', + 'master_timeout', + 'timeout', + 'verify' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -444,7 +477,7 @@ export default class Snapshot { async delete (this: That, params: T.SnapshotDeleteRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.delete'] + } = this[kAcceptedParams]['snapshot.delete'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -475,7 +508,13 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -490,7 +529,7 @@ export default class Snapshot { async deleteRepository (this: That, params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.delete_repository'] + } = this[kAcceptedParams]['snapshot.delete_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -520,7 +559,12 @@ export default class Snapshot { name: 'snapshot.delete_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -535,7 +579,7 @@ export default class Snapshot { async get (this: That, params: T.SnapshotGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.get'] + } = this[kAcceptedParams]['snapshot.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -566,7 +610,24 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'after', + 'from_sort_value', + 'ignore_unavailable', + 'index_details', + 'index_names', + 'include_repository', + 'master_timeout', + 'order', + 'offset', + 'size', + 'slm_policy_filter', + 'sort', + 'verbose' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -581,7 +642,7 @@ export default class Snapshot { async getRepository (this: That, params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.get_repository'] + } = this[kAcceptedParams]['snapshot.get_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -619,7 +680,12 @@ export default class Snapshot { name: 'snapshot.get_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'local', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -634,7 +700,7 @@ export default class Snapshot { async repositoryAnalyze (this: That, params: T.SnapshotRepositoryAnalyzeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.repository_analyze'] + } = this[kAcceptedParams]['snapshot.repository_analyze'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -664,7 +730,22 @@ export default class Snapshot { name: 'snapshot.repository_analyze', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'blob_count', + 'concurrency', + 'detailed', + 'early_read_node_count', + 'max_blob_size', + 'max_total_data_size', + 'rare_action_probability', + 'rarely_abort_writes', + 'read_node_count', + 'register_operation_count', + 'seed', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -679,7 +760,7 @@ export default class Snapshot { async repositoryVerifyIntegrity (this: That, params: T.SnapshotRepositoryVerifyIntegrityRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.repository_verify_integrity'] + } = this[kAcceptedParams]['snapshot.repository_verify_integrity'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -709,7 +790,18 @@ export default class Snapshot { name: 'snapshot.repository_verify_integrity', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'blob_thread_pool_concurrency', + 'index_snapshot_verification_concurrency', + 'index_verification_concurrency', + 'max_bytes_per_sec', + 'max_failed_shard_snapshots', + 'meta_thread_pool_concurrency', + 'snapshot_verification_concurrency', + 'verify_blob_contents' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -726,7 +818,7 @@ export default class Snapshot { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['snapshot.restore'] + } = this[kAcceptedParams]['snapshot.restore'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -767,7 +859,23 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'feature_states', + 'ignore_index_settings', + 'ignore_unavailable', + 'include_aliases', + 'include_global_state', + 'index_settings', + 'indices', + 'partial', + 'rename_pattern', + 'rename_replacement', + 'master_timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -782,7 +890,7 @@ export default class Snapshot { async status (this: That, params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.status'] + } = this[kAcceptedParams]['snapshot.status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -824,7 +932,13 @@ export default class Snapshot { pathParts: { repository: params.repository, snapshot: params.snapshot - } + }, + acceptedParams: [ + 'repository', + 'snapshot', + 'ignore_unavailable', + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -839,7 +953,7 @@ export default class Snapshot { async verifyRepository (this: That, params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['snapshot.verify_repository'] + } = this[kAcceptedParams]['snapshot.verify_repository'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -869,7 +983,12 @@ export default class Snapshot { name: 'snapshot.verify_repository', pathParts: { name: params.name - } + }, + acceptedParams: [ + 'repository', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/sql.ts b/src/api/api/sql.ts index b8be615f7..7388cb06c 100644 --- a/src/api/api/sql.ts +++ b/src/api/api/sql.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Sql { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'sql.clear_cursor': { path: [], body: [ @@ -118,7 +119,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.clear_cursor'] + } = this[kAcceptedParams]['sql.clear_cursor'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -155,7 +156,10 @@ export default class Sql { const method = 'POST' const path = '/_sql/close' const meta: TransportRequestMetadata = { - name: 'sql.clear_cursor' + name: 'sql.clear_cursor', + acceptedParams: [ + 'cursor' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -170,7 +174,7 @@ export default class Sql { async deleteAsync (this: That, params: T.SqlDeleteAsyncRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.delete_async'] + } = this[kAcceptedParams]['sql.delete_async'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -200,7 +204,10 @@ export default class Sql { name: 'sql.delete_async', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -215,7 +222,7 @@ export default class Sql { async getAsync (this: That, params: T.SqlGetAsyncRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.get_async'] + } = this[kAcceptedParams]['sql.get_async'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -245,7 +252,14 @@ export default class Sql { name: 'sql.get_async', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'delimiter', + 'format', + 'keep_alive', + 'wait_for_completion_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -260,7 +274,7 @@ export default class Sql { async getAsyncStatus (this: That, params: T.SqlGetAsyncStatusRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['sql.get_async_status'] + } = this[kAcceptedParams]['sql.get_async_status'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -290,7 +304,10 @@ export default class Sql { name: 'sql.get_async_status', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -307,7 +324,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.query'] + } = this[kAcceptedParams]['sql.query'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -345,7 +362,27 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql' const meta: TransportRequestMetadata = { - name: 'sql.query' + name: 'sql.query', + acceptedParams: [ + 'allow_partial_search_results', + 'catalog', + 'columnar', + 'cursor', + 'fetch_size', + 'field_multi_value_leniency', + 'filter', + 'index_using_frozen', + 'keep_alive', + 'keep_on_completion', + 'page_timeout', + 'params', + 'query', + 'request_timeout', + 'runtime_mappings', + 'time_zone', + 'wait_for_completion_timeout', + 'format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -362,7 +399,7 @@ export default class Sql { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['sql.translate'] + } = this[kAcceptedParams]['sql.translate'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -399,7 +436,13 @@ export default class Sql { const method = body != null ? 'POST' : 'GET' const path = '/_sql/translate' const meta: TransportRequestMetadata = { - name: 'sql.translate' + name: 'sql.translate', + acceptedParams: [ + 'fetch_size', + 'filter', + 'query', + 'time_zone' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/ssl.ts b/src/api/api/ssl.ts index 272765a68..6389f3e5f 100644 --- a/src/api/api/ssl.ts +++ b/src/api/api/ssl.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Ssl { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'ssl.certificates': { path: [], body: [], @@ -51,7 +52,7 @@ export default class Ssl { async certificates (this: That, params?: T.SslCertificatesRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['ssl.certificates'] + } = this[kAcceptedParams]['ssl.certificates'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -79,7 +80,9 @@ export default class Ssl { const method = 'GET' const path = '/_ssl/certificates' const meta: TransportRequestMetadata = { - name: 'ssl.certificates' + name: 'ssl.certificates', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/synonyms.ts b/src/api/api/synonyms.ts index 99e7f18b1..09b182bee 100644 --- a/src/api/api/synonyms.ts +++ b/src/api/api/synonyms.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Synonyms { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'synonyms.delete_synonym': { path: [ 'id' @@ -108,7 +109,7 @@ export default class Synonyms { async deleteSynonym (this: That, params: T.SynonymsDeleteSynonymRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.delete_synonym'] + } = this[kAcceptedParams]['synonyms.delete_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -138,7 +139,10 @@ export default class Synonyms { name: 'synonyms.delete_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -153,7 +157,7 @@ export default class Synonyms { async deleteSynonymRule (this: That, params: T.SynonymsDeleteSynonymRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.delete_synonym_rule'] + } = this[kAcceptedParams]['synonyms.delete_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -184,7 +188,11 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -199,7 +207,7 @@ export default class Synonyms { async getSynonym (this: That, params: T.SynonymsGetSynonymRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonym'] + } = this[kAcceptedParams]['synonyms.get_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -229,7 +237,12 @@ export default class Synonyms { name: 'synonyms.get_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -244,7 +257,7 @@ export default class Synonyms { async getSynonymRule (this: That, params: T.SynonymsGetSynonymRuleRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonym_rule'] + } = this[kAcceptedParams]['synonyms.get_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -275,7 +288,11 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -290,7 +307,7 @@ export default class Synonyms { async getSynonymsSets (this: That, params?: T.SynonymsGetSynonymsSetsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['synonyms.get_synonyms_sets'] + } = this[kAcceptedParams]['synonyms.get_synonyms_sets'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -318,7 +335,11 @@ export default class Synonyms { const method = 'GET' const path = '/_synonyms' const meta: TransportRequestMetadata = { - name: 'synonyms.get_synonyms_sets' + name: 'synonyms.get_synonyms_sets', + acceptedParams: [ + 'from', + 'size' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -335,7 +356,7 @@ export default class Synonyms { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['synonyms.put_synonym'] + } = this[kAcceptedParams]['synonyms.put_synonym'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -375,7 +396,11 @@ export default class Synonyms { name: 'synonyms.put_synonym', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'synonyms_set' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -392,7 +417,7 @@ export default class Synonyms { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['synonyms.put_synonym_rule'] + } = this[kAcceptedParams]['synonyms.put_synonym_rule'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -433,7 +458,12 @@ export default class Synonyms { pathParts: { set_id: params.set_id, rule_id: params.rule_id - } + }, + acceptedParams: [ + 'set_id', + 'rule_id', + 'synonyms' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/tasks.ts b/src/api/api/tasks.ts index e7afc408a..7991210a7 100644 --- a/src/api/api/tasks.ts +++ b/src/api/api/tasks.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Tasks { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'tasks.cancel': { path: [ 'task_id' @@ -81,7 +82,7 @@ export default class Tasks { async cancel (this: That, params?: T.TasksCancelRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.cancel'] + } = this[kAcceptedParams]['tasks.cancel'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -119,7 +120,14 @@ export default class Tasks { name: 'tasks.cancel', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'actions', + 'nodes', + 'parent_task_id', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -134,7 +142,7 @@ export default class Tasks { async get (this: That, params: T.TasksGetRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.get'] + } = this[kAcceptedParams]['tasks.get'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -164,7 +172,12 @@ export default class Tasks { name: 'tasks.get', pathParts: { task_id: params.task_id - } + }, + acceptedParams: [ + 'task_id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -179,7 +192,7 @@ export default class Tasks { async list (this: That, params?: T.TasksListRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['tasks.list'] + } = this[kAcceptedParams]['tasks.list'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -207,7 +220,16 @@ export default class Tasks { const method = 'GET' const path = '/_tasks' const meta: TransportRequestMetadata = { - name: 'tasks.list' + name: 'tasks.list', + acceptedParams: [ + 'actions', + 'detailed', + 'group_by', + 'nodes', + 'parent_task_id', + 'timeout', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/terms_enum.ts b/src/api/api/terms_enum.ts index 2c2359baa..0a8750efc 100644 --- a/src/api/api/terms_enum.ts +++ b/src/api/api/terms_enum.ts @@ -98,7 +98,17 @@ export default async function TermsEnumApi (this: That, params: T.TermsEnumReque name: 'terms_enum', pathParts: { index: params.index - } + }, + acceptedParams: [ + 'index', + 'field', + 'size', + 'timeout', + 'case_insensitive', + 'index_filter', + 'string', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/termvectors.ts b/src/api/api/termvectors.ts index 68ac7d3cf..70b398f8f 100644 --- a/src/api/api/termvectors.ts +++ b/src/api/api/termvectors.ts @@ -124,7 +124,34 @@ export default async function TermvectorsApi (this: That, p pathParts: { index: params.index, id: params.id - } + }, + acceptedParams: [ + 'index', + 'id', + 'doc', + 'filter', + 'per_field_analyzer', + 'fields', + 'field_statistics', + 'offsets', + 'payloads', + 'positions', + 'term_statistics', + 'routing', + 'version', + 'version_type', + 'fields', + 'field_statistics', + 'offsets', + 'payloads', + 'positions', + 'preference', + 'realtime', + 'routing', + 'term_statistics', + 'version', + 'version_type' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/text_structure.ts b/src/api/api/text_structure.ts index 72521758a..bd6ad2811 100644 --- a/src/api/api/text_structure.ts +++ b/src/api/api/text_structure.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class TextStructure { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'text_structure.find_field_structure': { path: [], body: [], @@ -120,7 +121,7 @@ export default class TextStructure { async findFieldStructure (this: That, params: T.TextStructureFindFieldStructureRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['text_structure.find_field_structure'] + } = this[kAcceptedParams]['text_structure.find_field_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -147,7 +148,23 @@ export default class TextStructure { const method = 'GET' const path = '/_text_structure/find_field_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_field_structure' + name: 'text_structure.find_field_structure', + acceptedParams: [ + 'column_names', + 'delimiter', + 'documents_to_sample', + 'ecs_compatibility', + 'explain', + 'field', + 'format', + 'grok_pattern', + 'index', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -164,7 +181,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.find_message_structure'] + } = this[kAcceptedParams]['text_structure.find_message_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -201,7 +218,21 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/find_message_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_message_structure' + name: 'text_structure.find_message_structure', + acceptedParams: [ + 'messages', + 'column_names', + 'delimiter', + 'ecs_compatibility', + 'explain', + 'format', + 'grok_pattern', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -218,7 +249,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.find_structure'] + } = this[kAcceptedParams]['text_structure.find_structure'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -245,7 +276,25 @@ export default class TextStructure { const method = 'POST' const path = '/_text_structure/find_structure' const meta: TransportRequestMetadata = { - name: 'text_structure.find_structure' + name: 'text_structure.find_structure', + acceptedParams: [ + 'text_files', + 'charset', + 'column_names', + 'delimiter', + 'ecs_compatibility', + 'explain', + 'format', + 'grok_pattern', + 'has_header_row', + 'line_merge_size_limit', + 'lines_to_sample', + 'quote', + 'should_trim_fields', + 'timeout', + 'timestamp_field', + 'timestamp_format' + ] } return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options) } @@ -262,7 +311,7 @@ export default class TextStructure { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['text_structure.test_grok_pattern'] + } = this[kAcceptedParams]['text_structure.test_grok_pattern'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -299,7 +348,12 @@ export default class TextStructure { const method = body != null ? 'POST' : 'GET' const path = '/_text_structure/test_grok_pattern' const meta: TransportRequestMetadata = { - name: 'text_structure.test_grok_pattern' + name: 'text_structure.test_grok_pattern', + acceptedParams: [ + 'grok_pattern', + 'text', + 'ecs_compatibility' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/transform.ts b/src/api/api/transform.ts index c494fed36..c3c16cb88 100644 --- a/src/api/api/transform.ts +++ b/src/api/api/transform.ts @@ -21,20 +21,21 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Transform { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'transform.delete_transform': { path: [ 'transform_id' @@ -205,7 +206,7 @@ export default class Transform { async deleteTransform (this: That, params: T.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.delete_transform'] + } = this[kAcceptedParams]['transform.delete_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -235,7 +236,13 @@ export default class Transform { name: 'transform.delete_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'force', + 'delete_dest_index', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -250,7 +257,7 @@ export default class Transform { async getNodeStats (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_node_stats'] + } = this[kAcceptedParams]['transform.get_node_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -277,7 +284,9 @@ export default class Transform { const method = 'GET' const path = '/_transform/_node_stats' const meta: TransportRequestMetadata = { - name: 'transform.get_node_stats' + name: 'transform.get_node_stats', + acceptedParams: [ + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -292,7 +301,7 @@ export default class Transform { async getTransform (this: That, params?: T.TransformGetTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_transform'] + } = this[kAcceptedParams]['transform.get_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -330,7 +339,14 @@ export default class Transform { name: 'transform.get_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'size', + 'exclude_generated' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -345,7 +361,7 @@ export default class Transform { async getTransformStats (this: That, params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.get_transform_stats'] + } = this[kAcceptedParams]['transform.get_transform_stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -375,7 +391,14 @@ export default class Transform { name: 'transform.get_transform_stats', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'from', + 'size', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -392,7 +415,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.preview_transform'] + } = this[kAcceptedParams]['transform.preview_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -440,7 +463,20 @@ export default class Transform { name: 'transform.preview_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + 'pivot', + 'source', + 'settings', + 'sync', + 'retention_policy', + 'latest', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -457,7 +493,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.put_transform'] + } = this[kAcceptedParams]['transform.put_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -497,7 +533,22 @@ export default class Transform { name: 'transform.put_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + 'latest', + '_meta', + 'pivot', + 'retention_policy', + 'settings', + 'source', + 'sync', + 'defer_validation', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -512,7 +563,7 @@ export default class Transform { async resetTransform (this: That, params: T.TransformResetTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.reset_transform'] + } = this[kAcceptedParams]['transform.reset_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -542,7 +593,12 @@ export default class Transform { name: 'transform.reset_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'force', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -557,7 +613,7 @@ export default class Transform { async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.schedule_now_transform'] + } = this[kAcceptedParams]['transform.schedule_now_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -587,7 +643,11 @@ export default class Transform { name: 'transform.schedule_now_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -602,7 +662,7 @@ export default class Transform { async setUpgradeMode (this: That, params?: T.TransformSetUpgradeModeRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.set_upgrade_mode'] + } = this[kAcceptedParams]['transform.set_upgrade_mode'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -630,7 +690,11 @@ export default class Transform { const method = 'POST' const path = '/_transform/set_upgrade_mode' const meta: TransportRequestMetadata = { - name: 'transform.set_upgrade_mode' + name: 'transform.set_upgrade_mode', + acceptedParams: [ + 'enabled', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -645,7 +709,7 @@ export default class Transform { async startTransform (this: That, params: T.TransformStartTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.start_transform'] + } = this[kAcceptedParams]['transform.start_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -675,7 +739,12 @@ export default class Transform { name: 'transform.start_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'timeout', + 'from' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -690,7 +759,7 @@ export default class Transform { async stopTransform (this: That, params: T.TransformStopTransformRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.stop_transform'] + } = this[kAcceptedParams]['transform.stop_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -720,7 +789,15 @@ export default class Transform { name: 'transform.stop_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'allow_no_match', + 'force', + 'timeout', + 'wait_for_checkpoint', + 'wait_for_completion' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -737,7 +814,7 @@ export default class Transform { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['transform.update_transform'] + } = this[kAcceptedParams]['transform.update_transform'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -777,7 +854,20 @@ export default class Transform { name: 'transform.update_transform', pathParts: { transform_id: params.transform_id - } + }, + acceptedParams: [ + 'transform_id', + 'dest', + 'description', + 'frequency', + '_meta', + 'source', + 'settings', + 'sync', + 'retention_policy', + 'defer_validation', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -792,7 +882,7 @@ export default class Transform { async upgradeTransforms (this: That, params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['transform.upgrade_transforms'] + } = this[kAcceptedParams]['transform.upgrade_transforms'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -820,7 +910,11 @@ export default class Transform { const method = 'POST' const path = '/_transform/_upgrade' const meta: TransportRequestMetadata = { - name: 'transform.upgrade_transforms' + name: 'transform.upgrade_transforms', + acceptedParams: [ + 'dry_run', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/update.ts b/src/api/api/update.ts index 7ccb98e6c..32ab88f8d 100644 --- a/src/api/api/update.ts +++ b/src/api/api/update.ts @@ -114,7 +114,31 @@ export default async function UpdateApi + [kAcceptedParams]: Record } const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty'] export default class Watcher { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'watcher.ack_watch': { path: [ 'watch_id', @@ -175,7 +176,7 @@ export default class Watcher { async ackWatch (this: That, params: T.WatcherAckWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.ack_watch'] + } = this[kAcceptedParams]['watcher.ack_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -213,7 +214,11 @@ export default class Watcher { pathParts: { watch_id: params.watch_id, action_id: params.action_id - } + }, + acceptedParams: [ + 'watch_id', + 'action_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -228,7 +233,7 @@ export default class Watcher { async activateWatch (this: That, params: T.WatcherActivateWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.activate_watch'] + } = this[kAcceptedParams]['watcher.activate_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -258,7 +263,10 @@ export default class Watcher { name: 'watcher.activate_watch', pathParts: { watch_id: params.watch_id - } + }, + acceptedParams: [ + 'watch_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -273,7 +281,7 @@ export default class Watcher { async deactivateWatch (this: That, params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.deactivate_watch'] + } = this[kAcceptedParams]['watcher.deactivate_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -303,7 +311,10 @@ export default class Watcher { name: 'watcher.deactivate_watch', pathParts: { watch_id: params.watch_id - } + }, + acceptedParams: [ + 'watch_id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -318,7 +329,7 @@ export default class Watcher { async deleteWatch (this: That, params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.delete_watch'] + } = this[kAcceptedParams]['watcher.delete_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -348,7 +359,10 @@ export default class Watcher { name: 'watcher.delete_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -365,7 +379,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.execute_watch'] + } = this[kAcceptedParams]['watcher.execute_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -413,7 +427,18 @@ export default class Watcher { name: 'watcher.execute_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'action_modes', + 'alternative_input', + 'ignore_condition', + 'record_execution', + 'simulated_actions', + 'trigger_data', + 'watch', + 'debug' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -428,7 +453,7 @@ export default class Watcher { async getSettings (this: That, params?: T.WatcherGetSettingsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.get_settings'] + } = this[kAcceptedParams]['watcher.get_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -456,7 +481,10 @@ export default class Watcher { const method = 'GET' const path = '/_watcher/settings' const meta: TransportRequestMetadata = { - name: 'watcher.get_settings' + name: 'watcher.get_settings', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -471,7 +499,7 @@ export default class Watcher { async getWatch (this: That, params: T.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.get_watch'] + } = this[kAcceptedParams]['watcher.get_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -501,7 +529,10 @@ export default class Watcher { name: 'watcher.get_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -518,7 +549,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.put_watch'] + } = this[kAcceptedParams]['watcher.put_watch'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -558,7 +589,22 @@ export default class Watcher { name: 'watcher.put_watch', pathParts: { id: params.id - } + }, + acceptedParams: [ + 'id', + 'actions', + 'condition', + 'input', + 'metadata', + 'throttle_period', + 'throttle_period_in_millis', + 'transform', + 'trigger', + 'active', + 'if_primary_term', + 'if_seq_no', + 'version' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -575,7 +621,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.query_watches'] + } = this[kAcceptedParams]['watcher.query_watches'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -613,7 +659,14 @@ export default class Watcher { const method = body != null ? 'POST' : 'GET' const path = '/_watcher/_query/watches' const meta: TransportRequestMetadata = { - name: 'watcher.query_watches' + name: 'watcher.query_watches', + acceptedParams: [ + 'from', + 'size', + 'query', + 'sort', + 'search_after' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -628,7 +681,7 @@ export default class Watcher { async start (this: That, params?: T.WatcherStartRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.start'] + } = this[kAcceptedParams]['watcher.start'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -656,7 +709,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_start' const meta: TransportRequestMetadata = { - name: 'watcher.start' + name: 'watcher.start', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -671,7 +727,7 @@ export default class Watcher { async stats (this: That, params?: T.WatcherStatsRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.stats'] + } = this[kAcceptedParams]['watcher.stats'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -709,7 +765,12 @@ export default class Watcher { name: 'watcher.stats', pathParts: { metric: params.metric - } + }, + acceptedParams: [ + 'metric', + 'emit_stacktraces', + 'metric' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -724,7 +785,7 @@ export default class Watcher { async stop (this: That, params?: T.WatcherStopRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['watcher.stop'] + } = this[kAcceptedParams]['watcher.stop'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -752,7 +813,10 @@ export default class Watcher { const method = 'POST' const path = '/_watcher/_stop' const meta: TransportRequestMetadata = { - name: 'watcher.stop' + name: 'watcher.stop', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -769,7 +833,7 @@ export default class Watcher { path: acceptedPath, body: acceptedBody, query: acceptedQuery - } = this.acceptedParams['watcher.update_settings'] + } = this[kAcceptedParams]['watcher.update_settings'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -807,7 +871,13 @@ export default class Watcher { const method = 'PUT' const path = '/_watcher/settings' const meta: TransportRequestMetadata = { - name: 'watcher.update_settings' + name: 'watcher.update_settings', + acceptedParams: [ + 'index.auto_expand_replicas', + 'index.number_of_replicas', + 'master_timeout', + 'timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/api/xpack.ts b/src/api/api/xpack.ts index cad3e3743..57028ed55 100644 --- a/src/api/api/xpack.ts +++ b/src/api/api/xpack.ts @@ -21,18 +21,19 @@ import { TransportResult } from '@elastic/transport' import * as T from '../types' +import { kAcceptedParams } from '../../client' interface That { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record } export default class Xpack { transport: Transport - acceptedParams: Record + [kAcceptedParams]: Record constructor (transport: Transport) { this.transport = transport - this.acceptedParams = { + this[kAcceptedParams] = { 'xpack.info': { path: [], body: [], @@ -62,7 +63,7 @@ export default class Xpack { async info (this: That, params?: T.XpackInfoRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['xpack.info'] + } = this[kAcceptedParams]['xpack.info'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -90,7 +91,12 @@ export default class Xpack { const method = 'GET' const path = '/_xpack' const meta: TransportRequestMetadata = { - name: 'xpack.info' + name: 'xpack.info', + acceptedParams: [ + 'categories', + 'accept_enterprise', + 'human' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } @@ -105,7 +111,7 @@ export default class Xpack { async usage (this: That, params?: T.XpackUsageRequest, options?: TransportRequestOptions): Promise { const { path: acceptedPath - } = this.acceptedParams['xpack.usage'] + } = this[kAcceptedParams]['xpack.usage'] const userQuery = params?.querystring const querystring: Record = userQuery != null ? { ...userQuery } : {} @@ -133,7 +139,10 @@ export default class Xpack { const method = 'GET' const path = '/_xpack/usage' const meta: TransportRequestMetadata = { - name: 'xpack.usage' + name: 'xpack.usage', + acceptedParams: [ + 'master_timeout' + ] } return await this.transport.request({ path, method, querystring, body, meta }, options) } diff --git a/src/api/types.ts b/src/api/types.ts index 2d12e5079..088d85bff 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -4779,6 +4779,8 @@ export interface WriteResponseBase { _shards: ShardStatistics /** The document version, which is incremented each time the document is updated. */ _version: VersionNumber + /** The role of the failure store in this document response */ + failure_store?: BulkFailureStoreStatus forced_refresh?: boolean } @@ -6076,6 +6078,14 @@ export interface AggregationsNormalizeAggregation extends AggregationsPipelineAg export type AggregationsNormalizeMethod = 'rescale_0_1' | 'rescale_0_100' | 'percent_of_sum' | 'mean' | 'z-score' | 'softmax' +export interface AggregationsPValueHeuristic { + background_is_superset?: boolean + /** Should the results be normalized when above the given value. + * Allows for consistent significance results at various scales. + * Note: `0` is a special value which means no normalization */ + normalize_above?: long +} + export interface AggregationsParentAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsParentAggregate = AggregationsParentAggregateKeys @@ -6313,6 +6323,14 @@ export interface AggregationsSignificantTermsAggregation extends AggregationsBuc percentage?: AggregationsPercentageScoreHeuristic /** Customized score, implemented via a script. */ script_heuristic?: AggregationsScriptedHeuristic + /** Significant terms heuristic that calculates the p-value between the term existing in foreground and background sets. + * + * The p-value is the probability of obtaining test results at least as extreme as + * the results actually observed, under the assumption that the null hypothesis is + * correct. The p-value is calculated assuming that the foreground set and the + * background set are independent https://en.wikipedia.org/wiki/Bernoulli_trial, with the null + * hypothesis that the probabilities are the same. */ + p_value?: AggregationsPValueHeuristic /** Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. * Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. */ shard_min_doc_count?: long @@ -25010,7 +25028,8 @@ export interface LogstashGetPipelineRequest extends RequestBase { export type LogstashGetPipelineResponse = Record export interface LogstashPutPipelineRequest extends RequestBase { - /** An identifier for the pipeline. */ + /** An identifier for the pipeline. + * Pipeline IDs must begin with a letter or underscore and contain only letters, underscores, dashes, hyphens and numbers. */ id: Id pipeline?: LogstashPipeline /** All values in `body` will be added to the request body. */