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-22) #946

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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
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'

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
Loading