Skip to content

Commit

Permalink
Updated opensearch-js to reflect the latest OpenSearch API spec (2025…
Browse files Browse the repository at this point in the history
…-01-12)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
nhtruong authored and github-actions[bot] committed Jan 12, 2025
1 parent faa8069 commit 27b2876
Show file tree
Hide file tree
Showing 41 changed files with 49 additions and 75 deletions.
3 changes: 1 addition & 2 deletions api/_core/createPit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import { ApiResponse } from '../../lib/Transport'
import * as Common from '../_types/_common'
import * as Core_Common from '../_types/_core._common'
import * as Global from '../_types/_global'

export interface CreatePit_Request extends Global.Params {
Expand All @@ -33,7 +32,7 @@ export interface CreatePit_Response extends ApiResponse {
}

export type CreatePit_ResponseBody = {
_shards?: Core_Common.ShardStatistics;
_shards?: Common.ShardStatistics;
creation_time?: number;
pit_id?: string;
}
Expand Down
4 changes: 2 additions & 2 deletions api/_core/deleteAllPits.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ApiResponse } from '../../lib/Transport'
import * as Core_Common from '../_types/_core._common'
import * as Core_Pit from '../_types/_core.pit'
import * as Global from '../_types/_global'

export type DeleteAllPits_Request = Global.Params & Record<string, any>
Expand All @@ -25,6 +25,6 @@ export interface DeleteAllPits_Response extends ApiResponse {
}

export type DeleteAllPits_ResponseBody = {
pits?: Core_Common.PitsDetailsDeleteAll[];
pits?: Core_Pit.DeletedPit[];
}

3 changes: 2 additions & 1 deletion api/_core/deleteByQuery.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import { ApiResponse } from '../../lib/Transport'
import * as Common from '../_types/_common'
import * as Common_QueryDsl from '../_types/_common.query_dsl'
import * as Core_Search from '../_types/_core.search'
import * as Global from '../_types/_global'

export interface DeleteByQuery_Request extends Global.Params {
_source?: string[];
_source?: Core_Search.SourceConfigParam;
_source_excludes?: string[];
_source_includes?: string[];
allow_no_indices?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion api/_core/deleteByQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
* @memberOf API-Core
*
* @param {object} params
* @param {array} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
* @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
* @param {array} [params._source_excludes] - List of fields to exclude from the returned `_source` field.
* @param {array} [params._source_includes] - List of fields to extract and return from the `_source` field.
* @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
Expand Down
4 changes: 2 additions & 2 deletions api/_core/deletePit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ApiResponse } from '../../lib/Transport'
import * as Core_Common from '../_types/_core._common'
import * as Core_Pit from '../_types/_core.pit'
import * as Global from '../_types/_global'

export interface DeletePit_Request extends Global.Params {
Expand All @@ -31,6 +31,6 @@ export interface DeletePit_Response extends ApiResponse {
}

export type DeletePit_ResponseBody = {
pits?: Core_Common.DeletedPit[];
pits?: Core_Pit.DeletedPit[];
}

4 changes: 2 additions & 2 deletions api/_core/getAllPits.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ApiResponse } from '../../lib/Transport'
import * as Core_Common from '../_types/_core._common'
import * as Core_Pit from '../_types/_core.pit'
import * as Global from '../_types/_global'

export type GetAllPits_Request = Global.Params & Record<string, any>
Expand All @@ -25,6 +25,6 @@ export interface GetAllPits_Response extends ApiResponse {
}

export type GetAllPits_ResponseBody = {
pits?: Core_Common.PitDetail[];
pits?: Core_Pit.PitDetail[];
}

2 changes: 1 addition & 1 deletion api/_core/rankEval.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface RankEval_Response extends ApiResponse {

export type RankEval_ResponseBody = {
details: Record<string, Core_RankEval.RankEvalMetricDetail>;
failures: Record<string, Record<string, any>>;
failures: Record<string, any>;
metric_score: number;
}

1 change: 1 addition & 0 deletions api/_core/reindex.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Reindex_Request extends Global.Params {
max_docs?: number;
refresh?: Common.Refresh;
requests_per_second?: number;
require_alias?: boolean;
scroll?: Common.Duration;
slices?: Common.Slices;
timeout?: Common.Duration;
Expand Down
1 change: 1 addition & 0 deletions api/_core/reindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ documents from a remote cluster.
* @param {number} [params.max_docs] - Maximum number of documents to process. By default, all documents.
* @param {string} [params.refresh] - If `true`, the request refreshes affected shards to make this operation visible to search.
* @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. Defaults to no throttle.
* @param {boolean} [params.require_alias]
* @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search.
* @param {string} [params.slices] - The number of slices this task should be divided into. Defaults to 1 slice, meaning the task isn't sliced into subtasks.
* @param {string} [params.timeout] - Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards.
Expand Down
2 changes: 1 addition & 1 deletion api/_core/renderSearchTemplate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export interface RenderSearchTemplate_Response extends ApiResponse {
}

export type RenderSearchTemplate_ResponseBody = {
template_output: Record<string, Record<string, any>>;
template_output: Record<string, any>;
}

11 changes: 0 additions & 11 deletions api/_core/searchShards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as Global from '../_types/_global'

export interface SearchShards_Request extends Global.Params {
allow_no_indices?: boolean;
body?: SearchShards_RequestBody;
expand_wildcards?: Common.ExpandWildcards;
ignore_unavailable?: boolean;
index?: Common.Indices;
Expand All @@ -30,16 +29,6 @@ export interface SearchShards_Request extends Global.Params {
routing?: Common.RoutingInQueryString;
}

export type SearchShards_RequestBody = {
_source?: boolean | string[];
allow_partial_search_results?: boolean;
from?: number;
indices_boost?: Record<string, number>;
query?: Record<string, Record<string, any>>;
size?: number;
sort?: Record<string, string>[];
}

export interface SearchShards_Response extends ApiResponse {
body: SearchShards_ResponseBody;
}
Expand Down
1 change: 0 additions & 1 deletion api/_core/searchShards.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @param {string} [params.preference=random] - Specifies the node or shard the operation should be performed on. Random by default.
* @param {string} [params.routing] - Custom value used to route operations to a specific shard.
* @param {string} [params.index] - Returns the indexes and shards that a search request would be executed against.
* @param {object} [params.body] - Defines the parameters that can be used in the `search_shards` endpoint request. See documentation for supported query syntax.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Expand Down
3 changes: 2 additions & 1 deletion api/_core/updateByQuery.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import { ApiResponse } from '../../lib/Transport'
import * as Common from '../_types/_common'
import * as Common_QueryDsl from '../_types/_common.query_dsl'
import * as Core_Search from '../_types/_core.search'
import * as Global from '../_types/_global'

export interface UpdateByQuery_Request extends Global.Params {
_source?: string[];
_source?: Core_Search.SourceConfigParam;
_source_excludes?: string[];
_source_includes?: string[];
allow_no_indices?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion api/_core/updateByQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for example to pick up a mapping change.
* @memberOf API-Core
*
* @param {object} params
* @param {array} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
* @param {string} [params._source] - Set to `true` or `false` to return the `_source` field or not, or a list of fields to return.
* @param {array} [params._source_excludes] - List of fields to exclude from the returned `_source` field.
* @param {array} [params._source_includes] - List of fields to extract and return from the `_source` field.
* @param {boolean} [params.allow_no_indices] - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.
Expand Down
7 changes: 1 addition & 6 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ export type NodeShard = {
primary: boolean;
recovery_source?: Record<string, Id>;
relocating_node?: NodeId | undefined;
relocation_failure_info?: RelocationFailureInfo;
shard: number;
state: Indices_Stats.ShardRoutingState;
unassigned_info?: Cluster_AllocationExplain.UnassignedInformation;
Expand Down Expand Up @@ -515,10 +514,6 @@ export type RefreshStats = {

export type RelationName = string

export type RelocationFailureInfo = {
failed_attempts: number;
}

export type RemoteStoreDownloadStats = {
total_download_size: RemoteStoreUploadDownloadStats;
total_time_spent?: Duration;
Expand Down Expand Up @@ -768,7 +763,7 @@ export type short = number

export type SlicedScroll = {
field?: Field;
id: Id;
id: number;
max: number;
}

Expand Down
2 changes: 1 addition & 1 deletion api/_types/_core.field_caps.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as Common from './_common'
export type FieldCapability = {
aggregatable: boolean;
indices?: Common.Indices;
meta?: Common.Metadata;
meta?: Record<string, string[]>;
metadata_field?: boolean;
non_aggregatable_indices?: Common.Indices;
non_searchable_indices?: Common.Indices;
Expand Down
12 changes: 0 additions & 12 deletions api/_types/_core._common.d.ts → api/_types/_core.pit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,3 @@ export type PitDetail = {
pit_id?: string;
}

export type PitsDetailsDeleteAll = {
pit_id?: string;
successful?: boolean;
}

export type ShardStatistics = {
failed?: number;
skipped?: number;
successful?: number;
total?: number;
}

6 changes: 3 additions & 3 deletions api/_types/_core.rank_eval.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type RankEvalHit = {

export type RankEvalHitItem = {
hit: RankEvalHit;
rating?: undefined | number | string;
rating?: number;
}

export type RankEvalMetric = {
Expand All @@ -49,7 +49,7 @@ export type RankEvalMetricBase = {

export type RankEvalMetricDetail = {
hits: RankEvalHitItem[];
metric_details: Record<string, Record<string, number>>;
metric_details: Record<string, Record<string, any>>;
metric_score: number;
unrated_docs: UnratedDocument[];
}
Expand Down Expand Up @@ -81,7 +81,7 @@ export type RankEvalQuery = {

export type RankEvalRequestItem = {
id: Common.Id;
params?: Record<string, Record<string, any>>;
params?: Record<string, any>;
ratings: DocumentRating[];
request?: RankEvalQuery;
template_id?: Common.Id;
Expand Down
2 changes: 1 addition & 1 deletion api/_types/_core.termvectors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type Term = {
}

export type TermVector = {
field_statistics: FieldStatistics;
field_statistics?: FieldStatistics;
terms: Record<string, Term>;
}

Expand Down
4 changes: 2 additions & 2 deletions api/_types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import * as Common_Aggregations from './_common.aggregations'
import * as Common_Analysis from './_common.analysis'
import * as Common_Mapping from './_common.mapping'
import * as Common_QueryDsl from './_common.query_dsl'
import * as Core_Common from './_core._common'
import * as Core_Bulk from './_core.bulk'
import * as Core_Explain from './_core.explain'
import * as Core_FieldCaps from './_core.field_caps'
Expand All @@ -30,6 +29,7 @@ import * as Core_Mget from './_core.mget'
import * as Core_MsearchTemplate from './_core.msearch_template'
import * as Core_Msearch from './_core.msearch'
import * as Core_Mtermvectors from './_core.mtermvectors'
import * as Core_Pit from './_core.pit'
import * as Core_RankEval from './_core.rank_eval'
import * as Core_ReindexRethrottle from './_core.reindex_rethrottle'
import * as Core_Reindex from './_core.reindex'
Expand Down Expand Up @@ -128,7 +128,6 @@ export {
Common_Analysis,
Common_Mapping,
Common_QueryDsl,
Core_Common,
Core_Bulk,
Core_Explain,
Core_FieldCaps,
Expand All @@ -139,6 +138,7 @@ export {
Core_MsearchTemplate,
Core_Msearch,
Core_Mtermvectors,
Core_Pit,
Core_RankEval,
Core_ReindexRethrottle,
Core_Reindex,
Expand Down
2 changes: 1 addition & 1 deletion api/cat/allPitSegments.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils');
* @param {string} [params.bytes] - The units used to display byte values.
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
* @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers.
*
Expand Down
2 changes: 1 addition & 1 deletion api/cat/clusterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils');
* @param {string} [params.cluster_manager_timeout] - A timeout for connection to the cluster manager node.
* @param {string} [params.format] - A short version of the HTTP `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {boolean} [params.local=false] - Returns local information but does not retrieve the state from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - A timeout for connection to the cluster manager node.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
Expand Down
2 changes: 1 addition & 1 deletion api/cat/count.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @param {object} [params]
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
* @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers.
* @param {string} [params.index] - Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`.
Expand Down
2 changes: 1 addition & 1 deletion api/cat/fielddata.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @param {string} [params.fields] - A comma-separated list of fields used to limit the amount of returned information. To retrieve all fields, omit this parameter.
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
* @param {boolean} [params.v=false] - Enables verbose mode, which displays column headers.
*
Expand Down
2 changes: 1 addition & 1 deletion api/cat/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { normalizeArguments } = require('../utils');
* @param {object} [params]
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
* @param {string} [params.time] - The unit used to display time values.
* @param {boolean} [params.ts=true] - When `true`, returns `HH:MM:SS` and Unix epoch timestamps.
Expand Down
4 changes: 2 additions & 2 deletions api/cat/indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @param {object} [params]
* @param {string} [params.bytes] - The units used to display byte values.
* @param {string} [params.cluster_manager_timeout] - The amount of time allowed to establish a connection to the cluster manager node.
* @param {string} [params.expand_wildcards] - The type of index that wildcard patterns can match.
* @param {string} [params.expand_wildcards] - The type of index that wildcard patterns can match. Supported values are `all`, `open`, `closed`, `hidden`, and `none`.
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {string} [params.health] - Limits indexes based on their health status. Supported values are `green`, `yellow`, and `red`.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {boolean} [params.include_unloaded_segments=false] - Whether to include information from segments not loaded into memory.
* @param {boolean} [params.local=false] - Returns local information but does not retrieve the state from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - The amount of time allowed to establish a connection to the cluster manager node.
Expand Down
2 changes: 1 addition & 1 deletion api/cat/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils');
* @param {string} [params.cluster_manager_timeout] - The amount of time allowed to establish a connection to the cluster manager node.
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {boolean} [params.local=false] - Returns local information but does not retrieve the state from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - The amount of time allowed to establish a connection to the cluster manager node.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
Expand Down
2 changes: 1 addition & 1 deletion api/cat/nodeattrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { normalizeArguments } = require('../utils');
* @param {string} [params.cluster_manager_timeout] - The amount of time allowed to establish a connection to the cluster manager node.
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {boolean} [params.local=false] - Returns local information but does not retrieve the state from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - The amount of time allowed to establish a connection to the cluster manager node.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
Expand Down
2 changes: 1 addition & 1 deletion api/cat/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { normalizeArguments } = require('../utils');
* @param {string} [params.format] - A short version of the `Accept` header, such as `json` or `yaml`.
* @param {string} [params.full_id] - When `true`, returns the full node ID. When `false`, returns the shortened node ID.
* @param {array} [params.h] - A comma-separated list of column names to display.
* @param {boolean} [params.help=false] - Return help information.
* @param {boolean} [params.help=false] - Returns help information.
* @param {boolean} [params.local=false] DEPRECATED - Returns local information but does not retrieve the state from the cluster manager node.
* @param {string} [params.master_timeout] DEPRECATED - The amount of time allowed to establish a connection to the cluster manager node.
* @param {array} [params.s] - A comma-separated list of column names or column aliases to sort by.
Expand Down
Loading

0 comments on commit 27b2876

Please sign in to comment.