From d6dbaf1ab93c41a218f999011bf2fcf41a625cb4 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 7 Apr 2021 19:23:36 +0200 Subject: [PATCH] API generation --- api/api/ml.js | 6 +++-- api/api/monitoring.js | 2 +- api/api/text_structure.js | 2 +- api/requestParams.d.ts | 6 ++--- index.d.ts | 56 +++++++++++++++++++-------------------- 5 files changed, 37 insertions(+), 35 deletions(-) diff --git a/api/api/ml.js b/api/api/ml.js index 6b4a66b6f..46823e764 100644 --- a/api/api/ml.js +++ b/api/api/ml.js @@ -524,7 +524,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 = { @@ -1176,7 +1178,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/requestParams.d.ts b/api/requestParams.d.ts index 2e3a1f004..0a72bcc01 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1786,7 +1786,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; @@ -1936,7 +1936,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; @@ -2560,7 +2560,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 70ca1e2ef..d7d82cd27 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1662,14 +1662,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_data_frame_analytics, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.MlPreviewDataFrameAnalytics, options?: TransportRequestOptions): TransportRequestPromise> preview_data_frame_analytics, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback preview_data_frame_analytics, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.MlPreviewDataFrameAnalytics, callback: callbackFn): TransportRequestCallback @@ -1860,10 +1860,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 @@ -2544,24 +2544,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>