Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTOCUT] Update opensearch-js to reflect the latest OpenSearch API spec (2024-12-29) #948

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/_core/updateByQueryRethrottle.d.ts
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ export interface UpdateByQueryRethrottle_Response extends ApiResponse {
}

export type UpdateByQueryRethrottle_ResponseBody = {
node_failures?: Common.ErrorCause[];
nodes: Record<string, Core_UpdateByQueryRethrottle.UpdateByQueryRethrottleNode>;
}

10 changes: 7 additions & 3 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
@@ -578,7 +578,7 @@ export type RemoteStoreUploadRefreshSizeLagStats = {
export type RemoteStoreUploadStats = {
max_refresh_time_lag?: Duration;
max_refresh_time_lag_in_millis: DurationValueUnitMillis;
pressure: RemoteStoreUploadPressureStats;
pressure?: RemoteStoreUploadPressureStats;
refresh_size_lag: RemoteStoreUploadRefreshSizeLagStats;
total_time_spent?: Duration;
total_time_spent_in_millis: DurationValueUnitMillis;
@@ -707,8 +707,12 @@ export type SearchStats = {
export type SearchType = 'dfs_query_then_fetch' | 'query_then_fetch'

export type SegmentReplicationStats = {
max_bytes_behind: HumanReadableByteCount;
max_replication_lag: Duration;
total_bytes_behind: HumanReadableByteCount;
} | {
max_bytes_behind: ByteCount;
max_replication_lag: ByteCount;
max_replication_lag: DurationValueUnitMillis;
total_bytes_behind: ByteCount;
}

@@ -722,7 +726,7 @@ export type SegmentsStats = {
index_writer_max_memory_in_bytes?: ByteCount;
index_writer_memory?: HumanReadableByteCount;
index_writer_memory_in_bytes: ByteCount;
max_unsafe_auto_id_timestamp: number;
max_unsafe_auto_id_timestamp: EpochTimeUnitMillis;
memory?: HumanReadableByteCount;
memory_in_bytes: ByteCount;
norms_memory?: HumanReadableByteCount;
18 changes: 0 additions & 18 deletions api/_types/cluster.stats.d.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
*/

import * as Common from './_common'
import * as Nodes_Common from './nodes._common'

export type CharFilterTypes = {
analyzer_types: FieldTypes[];
@@ -191,19 +190,11 @@ export type ClusterShardMetrics = {
export type FieldTypes = {
count: number;
index_count: number;
indexed_vector_count?: number;
indexed_vector_dim_max?: number;
indexed_vector_dim_min?: number;
name: Common.Name;
script_count?: number;
}

export type FieldTypesMappings = {
field_types: FieldTypes[];
total_deduplicated_field_count?: number;
total_deduplicated_mapping_size?: Common.HumanReadableByteCount;
total_deduplicated_mapping_size_in_bytes?: Common.ByteCount;
total_field_count?: number;
}

export type IndexingPressure = {
@@ -256,12 +247,3 @@ export type OperatingSystemMemoryInfo = {
used_percent: Common.PercentageNumber;
}

export type StatsResponseBase = Nodes_Common.NodesResponseBase & {
cluster_name: Common.Name;
cluster_uuid: Common.Uuid;
indices?: ClusterIndices;
nodes?: ClusterNodes;
status: Common.HealthStatus;
timestamp: number;
}

12 changes: 0 additions & 12 deletions api/_types/indices._common.d.ts
Original file line number Diff line number Diff line change
@@ -124,11 +124,6 @@ export type IndexingSlowlogThresholds = {
index?: SlowlogThresholdLevels;
}

export type IndexPostUpgradeStatus = {
_shards?: Common.ShardStatistics;
upgraded_indices?: Record<string, UpgradeVersionStatus>;
}

export type IndexRouting = {
allocation?: IndexRoutingAllocation;
rebalance?: IndexRoutingRebalance;
@@ -608,13 +603,6 @@ export type TranslogRetention = {
size?: Common.HumanReadableByteCount;
}

export type UpgradeRequest = {
allow_no_indices?: boolean;
expand_wildcards?: 'all' | 'closed' | 'none' | 'open';
ignore_unavailable?: boolean;
wait_for_completion?: boolean;
}

export type UpgradeStatus = {
size_in_bytes?: Common.ByteCount;
size_to_upgrade_ancient_in_bytes?: Common.ByteCount;
4 changes: 2 additions & 2 deletions api/_types/indices.shard_stores.d.ts
Original file line number Diff line number Diff line change
@@ -34,9 +34,9 @@ export type ShardStoreException = {
type: string;
}

export type ShardStoreStatus = 'all' | 'green' | 'red' | 'yellow'

export type ShardStoreWrapper = {
stores: ShardStore[];
}

export type Status = 'all' | 'green' | 'red' | 'yellow'

1 change: 1 addition & 0 deletions api/cluster/getComponentTemplate.d.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ import * as Global from '../_types/_global'

export interface Cluster_GetComponentTemplate_Request extends Global.Params {
cluster_manager_timeout?: Common.Duration;
flat_settings?: boolean;
local?: boolean;
master_timeout?: Common.Duration;
name?: Common.Name;
1 change: 1 addition & 0 deletions api/cluster/getComponentTemplate.js
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ const { normalizeArguments, parsePathParam } = require('../utils');
*
* @param {object} [params]
* @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node.
* @param {boolean} [params.flat_settings=false] - If `true`, returns settings in flat format.
* @param {boolean} [params.local=false] - If `true`, the request retrieves information from the local node only. If `false`, information is retrieved from the cluster-manager node.
* @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] - Name of the component template to retrieve. Wildcard (`*`) expressions are supported.
3 changes: 1 addition & 2 deletions api/cluster/reroute.d.ts
Original file line number Diff line number Diff line change
@@ -38,8 +38,7 @@ export interface Cluster_Reroute_Response extends ApiResponse {
body: Cluster_Reroute_ResponseBody;
}

export type Cluster_Reroute_ResponseBody = {
acknowledged: boolean;
export interface Cluster_Reroute_ResponseBody extends Common.AcknowledgedResponseBase {
explanations?: Cluster_Reroute.RerouteExplanation[];
state?: Record<string, any>;
}
2 changes: 1 addition & 1 deletion api/cluster/state.d.ts
Original file line number Diff line number Diff line change
@@ -37,5 +37,5 @@ export interface Cluster_State_Response extends ApiResponse {
body: Cluster_State_ResponseBody;
}

export type Cluster_State_ResponseBody = Record<string, any>
export type Cluster_State_ResponseBody = any

10 changes: 9 additions & 1 deletion api/cluster/stats.d.ts
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ import { ApiResponse } from '../../lib/Transport'
import * as Cluster_Stats from '../_types/cluster.stats'
import * as Common from '../_types/_common'
import * as Global from '../_types/_global'
import * as Nodes_Common from '../_types/nodes._common'

export interface Cluster_Stats_Request extends Global.Params {
flat_settings?: boolean;
@@ -31,5 +32,12 @@ export interface Cluster_Stats_Response extends ApiResponse {
body: Cluster_Stats_ResponseBody;
}

export type Cluster_Stats_ResponseBody = Cluster_Stats.StatsResponseBase
export interface Cluster_Stats_ResponseBody extends Nodes_Common.NodesResponseBase {
cluster_name: Common.Name;
cluster_uuid: Common.Uuid;
indices?: Cluster_Stats.ClusterIndices;
nodes?: Cluster_Stats.ClusterNodes;
status: Common.HealthStatus;
timestamp: Common.EpochTimeUnitMillis;
}

3 changes: 1 addition & 2 deletions api/indices/addBlock.d.ts
Original file line number Diff line number Diff line change
@@ -34,8 +34,7 @@ export interface Indices_AddBlock_Response extends ApiResponse {
body: Indices_AddBlock_ResponseBody;
}

export type Indices_AddBlock_ResponseBody = {
acknowledged: boolean;
export interface Indices_AddBlock_ResponseBody extends Common.AcknowledgedResponseBase {
indices: Indices_AddBlock.IndicesBlockStatus[];
shards_acknowledged: boolean;
}
5 changes: 2 additions & 3 deletions api/indices/clone.d.ts
Original file line number Diff line number Diff line change
@@ -33,15 +33,14 @@ export interface Indices_Clone_Request extends Global.Params {

export type Indices_Clone_RequestBody = {
aliases?: Record<string, Indices_Common.Alias>;
settings?: Record<string, Record<string, any>>;
settings?: Record<string, any>;
}

export interface Indices_Clone_Response extends ApiResponse {
body: Indices_Clone_ResponseBody;
}

export type Indices_Clone_ResponseBody = {
acknowledged: boolean;
export interface Indices_Clone_ResponseBody extends Common.AcknowledgedResponseBase {
index: Common.IndexName;
shards_acknowledged: boolean;
}
3 changes: 1 addition & 2 deletions api/indices/close.d.ts
Original file line number Diff line number Diff line change
@@ -34,8 +34,7 @@ export interface Indices_Close_Response extends ApiResponse {
body: Indices_Close_ResponseBody;
}

export type Indices_Close_ResponseBody = {
acknowledged: boolean;
export interface Indices_Close_ResponseBody extends Common.AcknowledgedResponseBase {
indices: Record<string, Indices_Close.CloseIndexResult>;
shards_acknowledged: boolean;
}
5 changes: 2 additions & 3 deletions api/indices/rollover.d.ts
Original file line number Diff line number Diff line change
@@ -36,15 +36,14 @@ export type Indices_Rollover_RequestBody = {
aliases?: Record<string, Indices_Common.Alias>;
conditions?: Indices_Rollover.RolloverConditions;
mappings?: Common_Mapping.TypeMapping;
settings?: Record<string, Record<string, any>>;
settings?: Record<string, any>;
}

export interface Indices_Rollover_Response extends ApiResponse {
body: Indices_Rollover_ResponseBody;
}

export type Indices_Rollover_ResponseBody = {
acknowledged: boolean;
export interface Indices_Rollover_ResponseBody extends Common.AcknowledgedResponseBase {
conditions: Record<string, boolean>;
dry_run: boolean;
new_index: string;
2 changes: 1 addition & 1 deletion api/indices/shardStores.d.ts
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export interface Indices_ShardStores_Request extends Global.Params {
expand_wildcards?: Common.ExpandWildcards;
ignore_unavailable?: boolean;
index?: Common.Indices;
status?: Indices_ShardStores.Status | Indices_ShardStores.Status[];
status?: Indices_ShardStores.ShardStoreStatus | Indices_ShardStores.ShardStoreStatus[];
}

export interface Indices_ShardStores_Response extends ApiResponse {
5 changes: 2 additions & 3 deletions api/indices/shrink.d.ts
Original file line number Diff line number Diff line change
@@ -34,15 +34,14 @@ export interface Indices_Shrink_Request extends Global.Params {

export type Indices_Shrink_RequestBody = {
aliases?: Record<string, Indices_Common.Alias>;
settings?: Record<string, Record<string, any>>;
settings?: Record<string, any>;
}

export interface Indices_Shrink_Response extends ApiResponse {
body: Indices_Shrink_ResponseBody;
}

export type Indices_Shrink_ResponseBody = {
acknowledged: boolean;
export interface Indices_Shrink_ResponseBody extends Common.AcknowledgedResponseBase {
index: Common.IndexName;
shards_acknowledged: boolean;
}
3 changes: 1 addition & 2 deletions api/indices/split.d.ts
Original file line number Diff line number Diff line change
@@ -42,8 +42,7 @@ export interface Indices_Split_Response extends ApiResponse {
body: Indices_Split_ResponseBody;
}

export type Indices_Split_ResponseBody = {
acknowledged: boolean;
export interface Indices_Split_ResponseBody extends Common.AcknowledgedResponseBase {
index: Common.IndexName;
shards_acknowledged: boolean;
}
5 changes: 3 additions & 2 deletions api/indices/upgrade.d.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ import * as Indices_Common from '../_types/indices._common'

export interface Indices_Upgrade_Request extends Global.Params {
allow_no_indices?: boolean;
body?: Indices_Common.UpgradeRequest;
expand_wildcards?: Common.ExpandWildcards;
ignore_unavailable?: boolean;
index?: string[];
@@ -33,5 +32,7 @@ export interface Indices_Upgrade_Response extends ApiResponse {
body: Indices_Upgrade_ResponseBody;
}

export type Indices_Upgrade_ResponseBody = Indices_Common.IndexPostUpgradeStatus
export interface Indices_Upgrade_ResponseBody extends Common.ShardsOperationResponseBase {
upgraded_indices?: Record<string, Indices_Common.UpgradeVersionStatus>;
}

1 change: 0 additions & 1 deletion api/indices/upgrade.js
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ const { normalizeArguments, parsePathParam } = require('../utils');
* @param {boolean} [params.only_ancient_segments] - If `true`, only ancient (an older Lucene major release) segments will be upgraded.
* @param {boolean} [params.wait_for_completion=false] - Should this request wait until the operation has completed before returning.
* @param {array} [params.index] - Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes.
* @param {object} [params.body]
*
* @param {TransportRequestOptions} [options] - Options for {@link Transport#request}
* @param {function} [callback] - Callback that handles errors and response
Loading