From 9886e31fb4775729646a4e06f17386075a7b7b97 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 7 Apr 2021 15:27:52 +0200 Subject: [PATCH] API generation --- api/api/ml.js | 6 +++-- api/api/monitoring.js | 2 +- api/api/text_structure.js | 2 +- api/kibana.d.ts | 6 ++--- api/requestParams.d.ts | 6 ++--- index.d.ts | 56 +++++++++++++++++++-------------------- 6 files changed, 40 insertions(+), 38 deletions(-) diff --git a/api/api/ml.js b/api/api/ml.js index 7af4e3801..4fb70e5e7 100644 --- a/api/api/ml.js +++ b/api/api/ml.js @@ -487,7 +487,9 @@ MlApi.prototype.findFileStructure = function mlFindFileStructureApi (params, opt let { method, body, ...querystring } = params querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) - const path = '' + let path = '' + if (method == null) method = 'POST' + path = '/' + '_ml' + '/' + 'find_file_structure' // build request object const request = { @@ -1139,7 +1141,7 @@ MlApi.prototype.postData = function mlPostDataApi (params, options, callback) { const request = { method, path, - body: body || '', + bulkBody: body, querystring } diff --git a/api/api/monitoring.js b/api/api/monitoring.js index 5366bd517..531a8b068 100644 --- a/api/api/monitoring.js +++ b/api/api/monitoring.js @@ -56,7 +56,7 @@ MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, call const request = { method, path, - bulkBody: body, + body: body || '', querystring } diff --git a/api/api/text_structure.js b/api/api/text_structure.js index 4a5509adf..1d29691c4 100644 --- a/api/api/text_structure.js +++ b/api/api/text_structure.js @@ -51,7 +51,7 @@ TextStructureApi.prototype.findStructure = function textStructureFindStructureAp const request = { method, path, - body: body || '', + bulkBody: body, querystring } diff --git a/api/kibana.d.ts b/api/kibana.d.ts index 112a9d98c..138d16f19 100644 --- a/api/kibana.d.ts +++ b/api/kibana.d.ts @@ -323,7 +323,7 @@ interface KibanaClient { info, TContext = Context>(params?: RequestParams.MlInfo, options?: TransportRequestOptions): TransportRequestPromise> openJob, TContext = Context>(params?: RequestParams.MlOpenJob, options?: TransportRequestOptions): TransportRequestPromise> postCalendarEvents, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPostCalendarEvents, options?: TransportRequestOptions): TransportRequestPromise> - postData, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> + postData, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> previewDatafeed, TContext = Context>(params?: RequestParams.MlPreviewDatafeed, options?: TransportRequestOptions): TransportRequestPromise> putCalendar, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPutCalendar, options?: TransportRequestOptions): TransportRequestPromise> putCalendarJob, TContext = Context>(params?: RequestParams.MlPutCalendarJob, options?: TransportRequestOptions): TransportRequestPromise> @@ -348,7 +348,7 @@ interface KibanaClient { validateDetector, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlValidateDetector, options?: TransportRequestOptions): TransportRequestPromise> } monitoring: { - bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> + bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> } msearch, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.Msearch, options?: TransportRequestOptions): TransportRequestPromise> msearchTemplate, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MsearchTemplate, options?: TransportRequestOptions): TransportRequestPromise> @@ -459,7 +459,7 @@ interface KibanaClient { } termvectors, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.Termvectors, options?: TransportRequestOptions): TransportRequestPromise> textStructure: { - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> } transform: { deleteTransform, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise> diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index feebcf079..408798549 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1755,7 +1755,7 @@ export interface MlPostCalendarEvents extends Generic { body: T; } -export interface MlPostData extends Generic { +export interface MlPostData extends Generic { job_id: string; reset_start?: string; reset_end?: string; @@ -1893,7 +1893,7 @@ export interface MlValidateDetector extends Generic { body: T; } -export interface MonitoringBulk extends Generic { +export interface MonitoringBulk extends Generic { type?: string; system_id?: string; system_api_version?: string; @@ -2501,7 +2501,7 @@ export interface Termvectors extends Generic { body?: T; } -export interface TextStructureFindStructure extends Generic { +export interface TextStructureFindStructure extends Generic { lines_to_sample?: number; line_merge_size_limit?: number; timeout?: string; diff --git a/index.d.ts b/index.d.ts index 2e7377caa..c3164e1da 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1637,14 +1637,14 @@ declare class Client { postCalendarEvents, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback postCalendarEvents, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostCalendarEvents, callback: callbackFn): TransportRequestCallback postCalendarEvents, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostCalendarEvents, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - post_data, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> - post_data, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - post_data, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostData, callback: callbackFn): TransportRequestCallback - post_data, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostData, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - postData, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> - postData, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - postData, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostData, callback: callbackFn): TransportRequestCallback - postData, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPostData, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + post_data, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> + post_data, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + post_data, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlPostData, callback: callbackFn): TransportRequestCallback + post_data, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlPostData, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + postData, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MlPostData, options?: TransportRequestOptions): TransportRequestPromise> + postData, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + postData, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlPostData, callback: callbackFn): TransportRequestCallback + postData, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MlPostData, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback preview_datafeed, TContext = Context>(params?: RequestParams.MlPreviewDatafeed, options?: TransportRequestOptions): TransportRequestPromise> preview_datafeed, TContext = Context>(callback: callbackFn): TransportRequestCallback preview_datafeed, TContext = Context>(params: RequestParams.MlPreviewDatafeed, callback: callbackFn): TransportRequestCallback @@ -1819,10 +1819,10 @@ declare class Client { validateDetector, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlValidateDetector, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } monitoring: { - bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> - bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback - bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MonitoringBulk, callback: callbackFn): TransportRequestCallback - bulk, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.MonitoringBulk, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MonitoringBulk, options?: TransportRequestOptions): TransportRequestPromise> + bulk, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MonitoringBulk, callback: callbackFn): TransportRequestCallback + bulk, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MonitoringBulk, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } msearch, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.Msearch, options?: TransportRequestOptions): TransportRequestPromise> msearch, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback @@ -2477,24 +2477,24 @@ declare class Client { termvectors, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.Termvectors, callback: callbackFn): TransportRequestCallback termvectors, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.Termvectors, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback text_structure: { - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } textStructure: { - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback - find_structure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback - findStructure, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback + find_structure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params?: RequestParams.TextStructureFindStructure, options?: TransportRequestOptions): TransportRequestPromise> + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, callback: callbackFn): TransportRequestCallback + findStructure, TRequestBody extends RequestNDBody = Record[], TContext = Context>(params: RequestParams.TextStructureFindStructure, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback } transform: { delete_transform, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise>