Skip to content

Commit

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

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
nhtruong authored and github-actions[bot] committed Dec 29, 2024
1 parent 75c999b commit f8afcfb
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 58 deletions.
1 change: 1 addition & 0 deletions api/_core/updateByQueryRethrottle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down
18 changes: 0 additions & 18 deletions api/_types/cluster.stats.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

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

export type CharFilterTypes = {
analyzer_types: FieldTypes[];
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions api/_types/indices.shard_stores.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions api/cluster/getComponentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions api/cluster/reroute.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}
Expand Down
2 changes: 1 addition & 1 deletion api/cluster/state.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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;
Expand All @@ -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
Expand Up @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions api/indices/clone.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions api/indices/close.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions api/indices/rollover.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion api/indices/shardStores.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions api/indices/shrink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions api/indices/split.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions api/indices/upgrade.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -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
Expand Up @@ -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
Expand Down

0 comments on commit f8afcfb

Please sign in to comment.