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 (2025-01-05) (#950)

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 Jan 6, 2025
1 parent 8703a6c commit f4c5f26
Show file tree
Hide file tree
Showing 64 changed files with 1,853 additions and 866 deletions.
34 changes: 34 additions & 0 deletions api/OpenSearchApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,18 @@ export default class OpenSearchAPI {
};

ml: {
predict (params: API.Ml_Predict_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_Predict_Response>;
predict (params: API.Ml_Predict_Request, callback: callbackFn<API.Ml_Predict_Response>): TransportRequestCallback;
predict (params: API.Ml_Predict_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_Predict_Response>): TransportRequestCallback;

trainPredict (params: API.Ml_TrainPredict_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_TrainPredict_Response>;
trainPredict (params: API.Ml_TrainPredict_Request, callback: callbackFn<API.Ml_TrainPredict_Response>): TransportRequestCallback;
trainPredict (params: API.Ml_TrainPredict_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_TrainPredict_Response>): TransportRequestCallback;

train (params: API.Ml_Train_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_Train_Response>;
train (params: API.Ml_Train_Request, callback: callbackFn<API.Ml_Train_Response>): TransportRequestCallback;
train (params: API.Ml_Train_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_Train_Response>): TransportRequestCallback;

registerAgents (params?: API.Ml_RegisterAgents_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_RegisterAgents_Response>;
registerAgents (callback: callbackFn<API.Ml_RegisterAgents_Response>): TransportRequestCallback;
registerAgents (params: API.Ml_RegisterAgents_Request, callback: callbackFn<API.Ml_RegisterAgents_Response>): TransportRequestCallback;
Expand All @@ -707,15 +719,33 @@ export default class OpenSearchAPI {
createConnector (params: API.Ml_CreateConnector_Request, callback: callbackFn<API.Ml_CreateConnector_Response>): TransportRequestCallback;
createConnector (params: API.Ml_CreateConnector_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_CreateConnector_Response>): TransportRequestCallback;

searchConnectors (params?: API.Ml_SearchConnectors_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_SearchConnectors_Response>;
searchConnectors (callback: callbackFn<API.Ml_SearchConnectors_Response>): TransportRequestCallback;
searchConnectors (params: API.Ml_SearchConnectors_Request, callback: callbackFn<API.Ml_SearchConnectors_Response>): TransportRequestCallback;
searchConnectors (params: API.Ml_SearchConnectors_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_SearchConnectors_Response>): TransportRequestCallback;

deleteConnector (params: API.Ml_DeleteConnector_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_DeleteConnector_Response>;
deleteConnector (params: API.Ml_DeleteConnector_Request, callback: callbackFn<API.Ml_DeleteConnector_Response>): TransportRequestCallback;
deleteConnector (params: API.Ml_DeleteConnector_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_DeleteConnector_Response>): TransportRequestCallback;

getConnector (params: API.Ml_GetConnector_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_GetConnector_Response>;
getConnector (params: API.Ml_GetConnector_Request, callback: callbackFn<API.Ml_GetConnector_Response>): TransportRequestCallback;
getConnector (params: API.Ml_GetConnector_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_GetConnector_Response>): TransportRequestCallback;

updateConnector (params: API.Ml_UpdateConnector_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UpdateConnector_Response>;
updateConnector (params: API.Ml_UpdateConnector_Request, callback: callbackFn<API.Ml_UpdateConnector_Response>): TransportRequestCallback;
updateConnector (params: API.Ml_UpdateConnector_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UpdateConnector_Response>): TransportRequestCallback;

registerModelGroup (params?: API.Ml_RegisterModelGroup_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_RegisterModelGroup_Response>;
registerModelGroup (callback: callbackFn<API.Ml_RegisterModelGroup_Response>): TransportRequestCallback;
registerModelGroup (params: API.Ml_RegisterModelGroup_Request, callback: callbackFn<API.Ml_RegisterModelGroup_Response>): TransportRequestCallback;
registerModelGroup (params: API.Ml_RegisterModelGroup_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_RegisterModelGroup_Response>): TransportRequestCallback;

searchModelGroup (params?: API.Ml_SearchModelGroup_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_SearchModelGroup_Response>;
searchModelGroup (callback: callbackFn<API.Ml_SearchModelGroup_Response>): TransportRequestCallback;
searchModelGroup (params: API.Ml_SearchModelGroup_Request, callback: callbackFn<API.Ml_SearchModelGroup_Response>): TransportRequestCallback;
searchModelGroup (params: API.Ml_SearchModelGroup_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_SearchModelGroup_Response>): TransportRequestCallback;

deleteModelGroup (params: API.Ml_DeleteModelGroup_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_DeleteModelGroup_Response>;
deleteModelGroup (params: API.Ml_DeleteModelGroup_Request, callback: callbackFn<API.Ml_DeleteModelGroup_Response>): TransportRequestCallback;
deleteModelGroup (params: API.Ml_DeleteModelGroup_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_DeleteModelGroup_Response>): TransportRequestCallback;
Expand All @@ -724,6 +754,10 @@ export default class OpenSearchAPI {
getModelGroup (params: API.Ml_GetModelGroup_Request, callback: callbackFn<API.Ml_GetModelGroup_Response>): TransportRequestCallback;
getModelGroup (params: API.Ml_GetModelGroup_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_GetModelGroup_Response>): TransportRequestCallback;

updateModelGroup (params: API.Ml_UpdateModelGroup_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_UpdateModelGroup_Response>;
updateModelGroup (params: API.Ml_UpdateModelGroup_Request, callback: callbackFn<API.Ml_UpdateModelGroup_Response>): TransportRequestCallback;
updateModelGroup (params: API.Ml_UpdateModelGroup_Request, options: TransportRequestOptions, callback: callbackFn<API.Ml_UpdateModelGroup_Response>): TransportRequestCallback;

registerModel (params?: API.Ml_RegisterModel_Request, options?: TransportRequestOptions): TransportRequestPromise<API.Ml_RegisterModel_Response>;
registerModel (callback: callbackFn<API.Ml_RegisterModel_Response>): TransportRequestCallback;
registerModel (params: API.Ml_RegisterModel_Request, callback: callbackFn<API.Ml_RegisterModel_Response>): TransportRequestCallback;
Expand Down
2 changes: 1 addition & 1 deletion api/_core/search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface Search_Request extends Global.Params {
search_type?: Common.SearchType;
seq_no_primary_term?: boolean;
size?: number;
sort?: string | string[];
sort?: Common.StringOrStringArray;
stats?: string[];
stored_fields?: Common.Fields;
suggest_field?: Common.Field;
Expand Down
2 changes: 1 addition & 1 deletion api/_types/_common.analysis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export type StopTokenFilter = TokenFilterBase & {
type: 'stop';
}

export type StopWords = string | string[]
export type StopWords = Common.StringOrStringArray

export type SynonymFormat = 'solr' | 'wordnet'

Expand Down
10 changes: 8 additions & 2 deletions api/_types/_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export type Duration = string

export type DurationLarge = string

export type DurationValueUnitMicros = UnitMicros

export type DurationValueUnitMillis = UnitMillis

export type DurationValueUnitNanos = UnitNanos
Expand Down Expand Up @@ -283,7 +285,7 @@ export type HourAndMinute = {
minute: number[];
}

export type HttpHeaders = Record<string, string | string[]>
export type HttpHeaders = Record<string, StringOrStringArray>

export type HumanReadableByteCount = string

Expand Down Expand Up @@ -624,7 +626,7 @@ export type Retries = {

export type Routing = string

export type RoutingInQueryString = string | string[]
export type RoutingInQueryString = StringOrStringArray

export type RrfRank = RankBase & {
rank_constant?: number;
Expand Down Expand Up @@ -825,6 +827,8 @@ export type StringifiedLong = number | string

export type StringifiedVersionNumber = VersionNumber | string

export type StringOrStringArray = string | string[]

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

export type TaskFailure = {
Expand Down Expand Up @@ -878,6 +882,8 @@ export type uint = number

export type ulong = number

export type UnitMicros = number

export type UnitMillis = number

export type UnitNanos = number
Expand Down
3 changes: 2 additions & 1 deletion api/_types/_global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* modify the API generator.
*/

import * as Common from './_common'

export type Params = {
error_trace?: boolean;
filter_path?: string | string[];
filter_path?: Common.StringOrStringArray;
human?: boolean;
pretty?: boolean;
source?: string;
Expand Down
2 changes: 1 addition & 1 deletion api/_types/indices._common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export type IndexSettings = {
refresh_interval?: Common.Duration;
routing?: IndexRouting;
routing_partition_size?: Common.StringifiedInteger;
routing_path?: string | string[];
routing_path?: Common.StringOrStringArray;
search?: IndexSettingsSearch;
'search.idle.after'?: Common.Duration;
settings?: IndexSettings;
Expand Down
3 changes: 2 additions & 1 deletion api/_types/indices.analyze.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* modify the API generator.
*/

import * as Common from './_common'

export type AnalyzeDetail = {
analyzer?: AnalyzerDetail;
Expand Down Expand Up @@ -54,7 +55,7 @@ export type ExplainAnalyzeToken = {
type: string;
}

export type TextToAnalyze = string | string[]
export type TextToAnalyze = Common.StringOrStringArray

export type TokenDetail = {
name: string;
Expand Down
4 changes: 3 additions & 1 deletion api/_types/indices.stats.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export type AllIndicesStats = {
total: IndexStats;
}

export type IndexShardStats = IndexStatsBase & {
export type IndexShardStats = IndexShardStatsBase & Record<string, any>

export type IndexShardStatsBase = IndexStatsBase & {
commit?: ShardCommit;
retention_leases?: ShardRetentionLeases;
routing?: ShardRouting;
Expand Down
Loading

0 comments on commit f4c5f26

Please sign in to comment.