Skip to content

Commit

Permalink
[AUTOCUT] Update opensearch-js to reflect the latest OpenSearch API s…
Browse files Browse the repository at this point in the history
…pec (2024-12-01) (#933)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: nhtruong <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and nhtruong authored Dec 1, 2024
1 parent 87c8ea8 commit 4ae6093
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api/_core/scriptsPainlessExecute.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export type ScriptsPainlessExecute_Response = ApiResponse & {
}

export type ScriptsPainlessExecute_ResponseBody = {
result: Record<string, any>;
result: number | string | boolean;
}

18 changes: 18 additions & 0 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,19 @@ export type RequestStats = {
total?: number;
}

export type ResourceStat = {
cpu_time_in_nanos: DurationValueUnitNanos;
memory_in_bytes: ByteCount;
}

export type ResourceStats = {
average: ResourceStat;
max: ResourceStat;
min: ResourceStat;
thread_info: ThreadInfo;
total: ResourceStat;
}

export type ResourceType = 'index_or_alias'

export type Result = 'created' | 'deleted' | 'noop' | 'not_found' | 'updated'
Expand Down Expand Up @@ -831,6 +844,11 @@ export type TaskId = string | number

export type TermFrequencyNormalization = 'h1' | 'h2' | 'h3' | 'no' | 'z'

export type ThreadInfo = {
active_threads: number;
thread_executions: number;
}

export type TimeOfDay = string

export type TimeUnit = 'd' | 'h' | 'm' | 'micros' | 'ms' | 'nanos' | 's'
Expand Down
2 changes: 1 addition & 1 deletion api/_types/_core.scripts_painless_execute.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ import * as Common_QueryDsl from './_common.query_dsl'
export type PainlessContextSetup = {
document: Record<string, any>;
index: Common.IndexName;
query: Common_QueryDsl.QueryContainer;
query?: Common_QueryDsl.QueryContainer;
}

2 changes: 1 addition & 1 deletion api/_types/_core.search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export type Hit = {
_source?: Record<string, any>;
_type?: Common.Type;
_version?: Common.VersionNumber;
fields?: Record<string, Record<string, any>>;
fields?: Record<string, any>;
highlight?: Record<string, string[]>;
ignored_field_values?: Record<string, string[]>;
inner_hits?: Record<string, InnerHitsResult>;
Expand Down
2 changes: 1 addition & 1 deletion api/_types/indices.simulate_template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Overlapping = {

export type Template = {
aliases: Record<string, Indices_Common.Alias>;
mappings: Common_Mapping.TypeMapping;
mappings?: Common_Mapping.TypeMapping;
settings: Indices_Common.IndexSettings;
}

2 changes: 1 addition & 1 deletion api/_types/ingest.simulate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type DocumentSimulation = {
_index: Common.IndexName;
_ingest: Ingest;
_routing?: string;
_source: Record<string, Record<string, any>>;
_source: Record<string, any>;
_version?: Common.StringifiedVersionNumber;
_version_type?: Common.VersionType;
}
Expand Down
9 changes: 6 additions & 3 deletions api/_types/nodes._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,15 @@ export type NodeBufferPool = {
used_in_bytes?: Common.ByteCount;
}

export type NodeReloadError = {
name: Common.Name;
export type NodeReloadError = NodeReloadResponse & {
reload_exception?: Common.ErrorCause;
}

export type NodeReloadResult = Stats | NodeReloadError
export type NodeReloadResponse = {
name: Common.Name;
}

export type NodeReloadResult = NodeReloadResponse | NodeReloadError

export type NodesResponseBase = {
_nodes?: Common.NodeStatistics;
Expand Down
6 changes: 3 additions & 3 deletions api/_types/nodes.usage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import * as Common from './_common'
import * as Nodes_Common from './nodes._common'

export type Metric = '_all' | 'rest_actions'
export type Metric = '_all' | 'aggregations' | 'rest_actions'

export type NodeUsage = {
aggregations: Record<string, Record<string, any>>;
rest_actions: Record<string, number>;
aggregations?: Record<string, Record<string, any>>;
rest_actions?: Record<string, number>;
since: Common.EpochTimeUnitMillis;
timestamp: Common.EpochTimeUnitMillis;
}
Expand Down
1 change: 1 addition & 0 deletions api/_types/tasks._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type TaskInfoBase = {
id: number;
node: Common.NodeId;
parent_task_id?: Common.TaskId;
resource_stats?: Common.ResourceStats;
running_time?: Common.Duration;
running_time_in_nanos: Common.DurationValueUnitNanos;
start_time_in_millis: Common.EpochTimeUnitMillis;
Expand Down
6 changes: 3 additions & 3 deletions api/asynchronousSearch/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const { normalizeArguments } = require('../utils');
* @memberOf API-Asynchronous-Search
*
* @param {object} [params]
* @param {string} [params.index] - The name of the index to be searched.
* @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster.
* @param {string} [params.index] - The name of the index to be searched. Can be an individual name, a comma-separated list of indexes, or a wildcard expression of index names.
* @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query overruns this time, the process cancels this query automatically.
* @param {boolean} [params.keep_on_completion] - Whether you want to save the results in the cluster after the search is complete.
* @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results.
* @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results. You can poll the remaining results based on an ID. The maximum value is `300s`. Default is `1s`.
* @param {object} [params.body] - The search definition using the Query DSL.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
Expand Down
2 changes: 0 additions & 2 deletions api/indices/simulateIndexTemplate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import * as Indices_PutIndexTemplate from '../_types/indices.put_index_template'

export type Indices_SimulateIndexTemplate_Request = Global.Params & {
body?: Indices_SimulateIndexTemplate_RequestBody;
cause?: string;
cluster_manager_timeout?: Common.Duration;
create?: boolean;
master_timeout?: Common.Duration;
name: Common.Name;
}
Expand Down
2 changes: 0 additions & 2 deletions api/indices/simulateIndexTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
* @memberOf API-Indices
*
* @param {object} params
* @param {string} [params.cause=false] - User defined reason for dry-run creating the new template for simulation purposes.
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {boolean} [params.create=false] - If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.
* @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.
* @param {string} params.name - Index or template name to simulate
* @param {object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system
Expand Down
4 changes: 3 additions & 1 deletion api/ingest/processorGrok.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import { ApiResponse } from '../../lib/Transport'
import * as Global from '../_types/_global'

export type Ingest_ProcessorGrok_Request = Global.Params & Record<string, any>
export type Ingest_ProcessorGrok_Request = Global.Params & {
s?: boolean;
}

export type Ingest_ProcessorGrok_Response = ApiResponse & {
body: Ingest_ProcessorGrok_ResponseBody;
Expand Down
4 changes: 3 additions & 1 deletion api/ingest/processorGrok.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const { normalizeArguments } = require('../utils');
*
* @memberOf API-Ingest
*
* @param {object} [params] - (Unused)
* @param {object} [params]
* @param {boolean} [params.s=false] - Sort returned patterns by key name.
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
*
Expand Down

0 comments on commit 4ae6093

Please sign in to comment.