From 5e18738921bd8fc3e2954567da32f438b26cb312 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 18 Aug 2021 17:51:42 +0200 Subject: [PATCH] API generation --- api/api/security.js | 22 ++++++++++++++++++++++ api/requestParams.d.ts | 4 ++++ docs/reference.asciidoc | 29 +++++++++++++++++++++++------ index.d.ts | 8 ++++++++ 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/api/api/security.js b/api/api/security.js index 5908f7c13..bbc14d922 100644 --- a/api/api/security.js +++ b/api/api/security.js @@ -1032,6 +1032,27 @@ SecurityApi.prototype.putUser = function securityPutUserApi (params, options, ca return this.transport.request(request, options, callback) } +SecurityApi.prototype.queryApiKeys = function securityQueryApiKeysApi (params, options, callback) { + ;[params, options, callback] = normalizeArguments(params, options, callback) + + let { method, body, ...querystring } = params + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) + + let path = '' + if (method == null) method = body == null ? 'GET' : 'POST' + path = '/' + '_security' + '/' + '_query' + '/' + 'api_key' + + // build request object + const request = { + method, + path, + body: body || '', + querystring + } + + return this.transport.request(request, options, callback) +} + SecurityApi.prototype.samlAuthenticate = function securitySamlAuthenticateApi (params, options, callback) { ;[params, options, callback] = normalizeArguments(params, options, callback) @@ -1228,6 +1249,7 @@ Object.defineProperties(SecurityApi.prototype, { put_role: { get () { return this.putRole } }, put_role_mapping: { get () { return this.putRoleMapping } }, put_user: { get () { return this.putUser } }, + query_api_keys: { get () { return this.queryApiKeys } }, saml_authenticate: { get () { return this.samlAuthenticate } }, saml_complete_logout: { get () { return this.samlCompleteLogout } }, saml_invalidate: { get () { return this.samlInvalidate } }, diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index f8f96ab1d..73cc8d4a5 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -2476,6 +2476,10 @@ export interface SecurityPutUser extends Generic { body: T; } +export interface SecurityQueryApiKeys extends Generic { + body?: T; +} + export interface SecuritySamlAuthenticate extends Generic { body: T; } diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index dd30b4ef0..6bfa14612 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -9256,9 +9256,9 @@ _Default:_ `5` client.searchMvt({ index: string | string[], field: string, - zoom: integer, - x: integer, - y: integer, + zoom: number, + x: number, + y: number, exact_bounds: boolean, extent: number, grid_precision: number, @@ -9277,13 +9277,13 @@ link:{ref}/search-vector-tile-api.html[Documentation] + |`string` - Field containing geospatial data to return |`zoom` -|`integer` - Zoom level for the vector tile to search +|`number` - Zoom level for the vector tile to search |`x` -|`integer` - X coordinate for the vector tile to search +|`number` - X coordinate for the vector tile to search |`y` -|`integer` - Y coordinate for the vector tile to search +|`number` - Y coordinate for the vector tile to search |`exact_bounds` or `exactBounds` |`boolean` - If false, the meta layer's feature is the bounding box of the tile. If true, the meta layer's feature is a bounding box resulting from a `geo_bounds` aggregation. @@ -10250,6 +10250,23 @@ link:{ref}/security-api-put-user.html[Documentation] + |=== +[discrete] +=== security.queryApiKeys + +[source,ts] +---- +client.security.queryApiKeys({ + body: object +}) +---- +link:{ref}/security-api-query-api-key.html[Documentation] + +[cols=2*] +|=== +|`body` +|`object` - From, size, query, sort and search_after + +|=== + [discrete] === security.samlAuthenticate diff --git a/index.d.ts b/index.d.ts index 3cd158f79..72260beb6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2466,6 +2466,14 @@ declare class Client { putUser, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback putUser, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityPutUser, callback: callbackFn): TransportRequestCallback putUser, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityPutUser, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + query_api_keys, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.SecurityQueryApiKeys, options?: TransportRequestOptions): TransportRequestPromise> + query_api_keys, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + query_api_keys, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityQueryApiKeys, callback: callbackFn): TransportRequestCallback + query_api_keys, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityQueryApiKeys, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + queryApiKeys, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.SecurityQueryApiKeys, options?: TransportRequestOptions): TransportRequestPromise> + queryApiKeys, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback + queryApiKeys, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityQueryApiKeys, callback: callbackFn): TransportRequestCallback + queryApiKeys, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecurityQueryApiKeys, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback saml_authenticate, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.SecuritySamlAuthenticate, options?: TransportRequestOptions): TransportRequestPromise> saml_authenticate, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback saml_authenticate, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.SecuritySamlAuthenticate, callback: callbackFn): TransportRequestCallback