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
…-03-02)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
nhtruong authored and github-actions[bot] committed Mar 2, 2025
1 parent f76a349 commit 2592b76
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 98 deletions.
72 changes: 2 additions & 70 deletions api/_types/_common.aggregations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,78 +42,9 @@ export type Aggregation = {
}

export type AggregationContainer = {
adjacency_matrix?: AdjacencyMatrixAggregation;
aggregations?: Record<string, AggregationContainer>;
auto_date_histogram?: AutoDateHistogramAggregation;
avg?: AverageAggregation;
avg_bucket?: AverageBucketAggregation;
boxplot?: BoxplotAggregation;
bucket_script?: BucketScriptAggregation;
bucket_selector?: BucketSelectorAggregation;
bucket_sort?: BucketSortAggregation;
cardinality?: CardinalityAggregation;
children?: ChildrenAggregation;
composite?: CompositeAggregation;
cumulative_cardinality?: CumulativeCardinalityAggregation;
cumulative_sum?: CumulativeSumAggregation;
date_histogram?: DateHistogramAggregation;
date_range?: DateRangeAggregation;
derivative?: DerivativeAggregation;
diversified_sampler?: DiversifiedSamplerAggregation;
extended_stats?: ExtendedStatsAggregation;
extended_stats_bucket?: ExtendedStatsBucketAggregation;
filter?: Common_QueryDsl.QueryContainer;
filters?: FiltersAggregation;
geo_bounds?: GeoBoundsAggregation;
geo_centroid?: GeoCentroidAggregation;
geo_distance?: GeoDistanceAggregation;
geo_line?: GeoLineAggregation;
geohash_grid?: GeoHashGridAggregation;
geotile_grid?: GeoTileGridAggregation;
global?: GlobalAggregation;
histogram?: HistogramAggregation;
inference?: InferenceAggregation;
ip_range?: IpRangeAggregation;
line?: GeoLineAggregation;
matrix_stats?: MatrixStatsAggregation;
max?: MaxAggregation;
max_bucket?: MaxBucketAggregation;
median_absolute_deviation?: MedianAbsoluteDeviationAggregation;
aggs?: Record<string, AggregationContainer>;
meta?: Common.Metadata;
min?: MinAggregation;
min_bucket?: MinBucketAggregation;
missing?: MissingAggregation;
moving_avg?: MovingAverageAggregation;
moving_fn?: MovingFunctionAggregation;
moving_percentiles?: MovingPercentilesAggregation;
multi_terms?: MultiTermsAggregation;
nested?: NestedAggregation;
normalize?: NormalizeAggregation;
parent?: ParentAggregation;
percentile_ranks?: PercentileRanksAggregation;
percentiles?: PercentilesAggregation;
percentiles_bucket?: PercentilesBucketAggregation;
range?: RangeAggregation;
rare_terms?: RareTermsAggregation;
rate?: RateAggregation;
reverse_nested?: ReverseNestedAggregation;
sampler?: SamplerAggregation;
scripted_metric?: ScriptedMetricAggregation;
serial_diff?: SerialDifferencingAggregation;
significant_terms?: SignificantTermsAggregation;
significant_text?: SignificantTextAggregation;
stats?: StatsAggregation;
stats_bucket?: StatsBucketAggregation;
string_stats?: StringStatsAggregation;
sum?: SumAggregation;
sum_bucket?: SumBucketAggregation;
t_test?: TTestAggregation;
terms?: TermsAggregation;
top_hits?: TopHitsAggregation;
top_metrics?: TopMetricsAggregation;
value_count?: ValueCountAggregation;
variable_width_histogram?: VariableWidthHistogramAggregation;
weighted_avg?: WeightedAverageAggregation;
}

export type AggregationRange = {
Expand Down Expand Up @@ -1088,6 +1019,7 @@ export type SimpleValueAggregate = SingleMetricAggregateBase & Record<string, an

export type SingleBucketAggregateBase = AggregateBase & {
doc_count: number;
[key: string]: any | Aggregate;
}

export type SingleMetricAggregateBase = AggregateBase & {
Expand Down
1 change: 1 addition & 0 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ export type PluginStats = {
licensed?: boolean;
name: Name;
opensearch_version: VersionString;
optional_extended_plugins?: string[];
version: VersionString;
}

Expand Down
28 changes: 12 additions & 16 deletions api/_types/flow_framework.common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as Common from './_common'
import * as Common_QueryDsl from './_common.query_dsl'

export type All = boolean

Expand All @@ -28,16 +29,6 @@ export type FlowFrameworkCreate = {
workflows?: Record<string, any>;
}

export type FlowFrameworkDeleteResponse = {
_id?: string;
_index?: string;
_primary_term?: number;
_seq_no?: number;
_shards?: shards;
_version?: number;
result?: 'deleted' | 'not_found';
}

export type FlowFrameworkGetResponse = {
created_time?: number;
description?: string;
Expand Down Expand Up @@ -76,22 +67,27 @@ export type itemsObject = {

export type Provision = boolean

export type query = {
match?: Record<string, any>;
match_all?: Record<string, any>;
}

export type Reprovision = boolean

export type ResourcesCreated = {
resource_id?: string;
resource_type?: string;
workflow_step_id?: string;
workflow_step_name?: string;
}

export type SearchStateResponse = {
provision_end_time?: Common.DateTime;
provision_start_time?: Common.DateTime;
provisioning_progress?: string;
resources_created?: ResourcesCreated;
state?: string;
user?: user;
workflow_id?: string;
}

export type SearchWorkflowRequest = {
query?: query;
query?: Common_QueryDsl.QueryContainer;
}

export type shards = {
Expand Down
4 changes: 4 additions & 0 deletions api/_types/insights._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import * as Common from './_common'
import * as Common_QueryDsl from './_common.query_dsl'
import * as Core_Search from './_core.search'

export type GroupingType = 'NONE' | 'SIMILARITY' | 'none' | 'similarity'

export type Measurement = {
aggregationType?: string;
count?: number;
Expand Down Expand Up @@ -80,6 +82,8 @@ export type TopQueriesResponse = {
}

export type TopQuery = {
group_by?: GroupingType;
id?: string;
indices?: string[];
labels?: Record<string, any>;
measurements?: Measurements;
Expand Down
15 changes: 8 additions & 7 deletions api/_types/knn._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import * as Common from './_common'

export type DefaultOperator = 'AND' | 'OR'

export type DeletedModel = {
model_id: string;
result: 'deleted' | 'error';
Expand All @@ -43,6 +41,13 @@ export type GraphStats = {
refresh?: GraphRefreshStats;
}

export type KnnMethod = {
engine?: string;
name: string;
parameters?: Record<string, any>;
space_type?: string;
}

export type NodeStats = {
cache_capacity_reached?: boolean;
eviction_count?: number;
Expand Down Expand Up @@ -79,8 +84,6 @@ export type NodeStats = {
training_requests?: number;
}

export type SearchType = 'dfs_query_then_fetch' | 'query_then_fetch'

export type Stats = {
_nodes?: Common.NodeStatistics;
circuit_breaker_triggered?: boolean;
Expand All @@ -89,14 +92,12 @@ export type Stats = {
nodes?: Record<string, NodeStats>;
}

export type SuggestMode = 'always' | 'missing' | 'popular'

export type TrainedModel = {
compression_level?: string;
description?: string;
dimension: number;
max_training_vector_count?: number;
method?: string;
method?: KnnMethod;
mode?: string;
search_size?: number;
spaceType?: string;
Expand Down
3 changes: 2 additions & 1 deletion api/flowFramework/delete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { ApiResponse } from '../../lib/Transport'
import * as Common from '../_types/_common'
import * as FlowFramework_Common from '../_types/flow_framework.common'
import * as Global from '../_types/_global'

Expand All @@ -27,5 +28,5 @@ export interface FlowFramework_Delete_Response extends ApiResponse {
body: FlowFramework_Delete_ResponseBody;
}

export type FlowFramework_Delete_ResponseBody = FlowFramework_Common.FlowFrameworkDeleteResponse
export type FlowFramework_Delete_ResponseBody = Common.WriteResponseBase

8 changes: 4 additions & 4 deletions api/knn/searchModels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

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'
import * as Knn_Common from '../_types/knn._common'

export interface Knn_SearchModels_Request extends Global.Params {
_source?: string[];
Expand All @@ -31,7 +31,7 @@ export interface Knn_SearchModels_Request extends Global.Params {
batched_reduce_size?: number;
body?: Knn_SearchModels_RequestBody;
ccs_minimize_roundtrips?: boolean;
default_operator?: Knn_Common.DefaultOperator;
default_operator?: Common_QueryDsl.Operator;
df?: string;
docvalue_fields?: string[];
expand_wildcards?: Common.ExpandWildcards;
Expand All @@ -48,14 +48,14 @@ export interface Knn_SearchModels_Request extends Global.Params {
rest_total_hits_as_int?: boolean;
routing?: Common.RoutingInQueryString;
scroll?: Common.Duration;
search_type?: Knn_Common.SearchType;
search_type?: Common.SearchType;
seq_no_primary_term?: boolean;
size?: number;
sort?: string[];
stats?: string[];
stored_fields?: string[];
suggest_field?: string;
suggest_mode?: Knn_Common.SuggestMode;
suggest_mode?: Common.SuggestMode;
suggest_size?: number;
suggest_text?: string;
terminate_after?: number;
Expand Down

0 comments on commit 2592b76

Please sign in to comment.