API generation

This commit is contained in:
delvedor
2022-03-23 11:31:34 +01:00
parent a298517692
commit 720b5b449b
9 changed files with 858 additions and 546 deletions

View File

@ -524,6 +524,14 @@ https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.ht
client.cat.allocation(...)
----
[discrete]
==== component_templates
Returns information about existing component_templates templates.
[source,ts]
----
client.cat.componentTemplates(...)
----
[discrete]
==== count
Provides quick access to the document count of the entire cluster, or individual indices.
@ -3127,6 +3135,16 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-dis
client.security.disableUser(...)
----
[discrete]
==== disable_user_profile
Disables a user profile so it's not visible in user profile searches.
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html[Endpoint documentation]
[source,ts]
----
client.security.disableUserProfile(...)
----
[discrete]
==== enable_user
Enables users in the native realm.
@ -3137,6 +3155,16 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ena
client.security.enableUser(...)
----
[discrete]
==== enable_user_profile
Enables a user profile so it's visible in user profile searches.
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html[Endpoint documentation]
[source,ts]
----
client.security.enableUserProfile(...)
----
[discrete]
==== enroll_kibana
Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.
@ -3445,6 +3473,16 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-sam
client.security.samlServiceProviderMetadata(...)
----
[discrete]
==== search_user_profiles
Searches for user profiles that match specified criteria.
https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-search-user-profile.html[Endpoint documentation]
[source,ts]
----
client.security.searchUserProfiles(...)
----
[discrete]
==== update_user_profile_data
Update application specific data for the user profile of the given unique ID.
@ -3840,6 +3878,8 @@ client.transform.putTransform(...)
[discrete]
==== reset_transform
Resets an existing transform.
https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html[Endpoint documentation]
[source,ts]
----
client.transform.resetTransform(...)

View File

@ -103,6 +103,35 @@ export default class Cat {
return await this.transport.request({ path, method, querystring, body }, options)
}
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async componentTemplates (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['name']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
let method = ''
let path = ''
if (params.name != null) {
method = 'GET'
path = `/_cat/component_templates/${encodeURIComponent(params.name.toString())}`
} else {
method = 'GET'
path = '/_cat/component_templates'
}
return await this.transport.request({ path, method, querystring, body }, options)
}
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatCountResponse>
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatCountResponse, unknown>>
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptions): Promise<T.CatCountResponse>

View File

@ -37,10 +37,10 @@ import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
const querystring: Record<string, any> = {}
@ -53,7 +53,6 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}

View File

@ -42,7 +42,7 @@ export default async function KnnSearchApi<TDocument = unknown> (this: That, par
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<T.KnnSearchResponse<TDocument>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'knn']
const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'filter', 'knn']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -937,10 +937,10 @@ export default class Ml {
return await this.transport.request({ path, method, querystring, body }, options)
}
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getMemoryStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlGetMemoryStatsResponse>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlGetMemoryStatsResponse, unknown>>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise<T.MlGetMemoryStatsResponse>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['node_id']
const querystring: Record<string, any> = {}
const body = undefined
@ -950,6 +950,7 @@ export default class Ml {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
@ -1680,7 +1681,7 @@ export default class Ml {
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<T.MlPutTrainedModelVocabularyResponse>
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['vocabulary']
const acceptedBody: string[] = ['vocabulary', 'merges']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -37,10 +37,10 @@ import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexResponse, unknown>>
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<T.ReindexResponse>
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<any> {
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexResponse, unknown>>
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<T.ReindexResponse>
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['conflicts', 'dest', 'max_docs', 'script', 'size', 'source']
const querystring: Record<string, any> = {}
@ -53,7 +53,6 @@ export default async function ReindexApi (this: That, params?: T.ReindexRequest
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}

View File

@ -436,6 +436,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async disableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_disable`
return await this.transport.request({ path, method, querystring, body }, options)
}
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityEnableUserResponse>
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityEnableUserResponse, unknown>>
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise<T.SecurityEnableUserResponse>
@ -458,6 +480,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async enableUserProfile (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_enable`
return await this.transport.request({ path, method, querystring, body }, options)
}
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityEnrollKibanaResponse>
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityEnrollKibanaResponse, unknown>>
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise<T.SecurityEnrollKibanaResponse>
@ -1377,6 +1421,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async searchUserProfiles (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = body != null ? 'POST' : 'GET'
const path = '/_security/profile/_search'
return await this.transport.request({ path, method, querystring, body }, options)
}
async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async updateUserProfileData (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
@ -1394,8 +1460,8 @@ export default class Security {
}
}
const method = 'POST'
const path = `/_security/profile/_data/${encodeURIComponent(params.uid.toString())}`
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_data`
return await this.transport.request({ path, method, querystring, body }, options)
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff