Skip to content

Commit

Permalink
Added deprecation warnings for Index Template APIs (#645)
Browse files Browse the repository at this point in the history
* Added deprecation warnings for Index Template APIs

Signed-off-by: Theo Truong <[email protected]>

* # Added PR link

Signed-off-by: Theo Truong <[email protected]>

---------

Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong authored Nov 18, 2023
1 parent fc1c786 commit 9259a54
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Added deprecation warnings for Index Template APIs ([654](https://github.com/opensearch-project/opensearch-js/pull/645))
### Dependencies
- Bumps `@aws-sdk/types` from 3.418.0 to 3.433.0
- Bumps `@types/node` from 20.6.5 to 20.9.0
Expand Down Expand Up @@ -192,4 +193,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed

- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291))
- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291))
2 changes: 1 addition & 1 deletion api/api/indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, option
};

/**
* Returns a progress status of current upgrade. (Deprecated. Use API-Document#reindex instead)
* Returns a progress status of current upgrade.
*
* @memberOf API-Index
*
Expand Down
17 changes: 17 additions & 0 deletions api/new.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,14 +951,17 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<T.IndicesDeleteIndexTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TContext = unknown>(
params: T.IndicesDeleteTemplateRequest,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<T.IndicesDeleteTemplateResponse, TContext>>;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TContext = unknown>(
params: T.IndicesDeleteTemplateRequest,
callback: callbackFn<T.IndicesDeleteTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TContext = unknown>(
params: T.IndicesDeleteTemplateRequest,
options: TransportRequestOptions,
Expand Down Expand Up @@ -1017,14 +1020,17 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<T.IndicesExistsIndexTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TContext = unknown>(
params: T.IndicesExistsTemplateRequest,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<T.IndicesExistsTemplateResponse, TContext>>;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TContext = unknown>(
params: T.IndicesExistsTemplateRequest,
callback: callbackFn<T.IndicesExistsTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TContext = unknown>(
params: T.IndicesExistsTemplateRequest,
options: TransportRequestOptions,
Expand Down Expand Up @@ -1168,17 +1174,21 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<T.IndicesGetSettingsResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TContext = unknown>(
params?: T.IndicesGetTemplateRequest,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<T.IndicesGetTemplateResponse, TContext>>;
/** @deprecated use getIndexTemplate instead */
getTemplate<TContext = unknown>(
callback: callbackFn<T.IndicesGetTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TContext = unknown>(
params: T.IndicesGetTemplateRequest,
callback: callbackFn<T.IndicesGetTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TContext = unknown>(
params: T.IndicesGetTemplateRequest,
options: TransportRequestOptions,
Expand Down Expand Up @@ -1269,14 +1279,17 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<T.IndicesPutSettingsResponse, TContext>
): TransportRequestCallback;
/** @deprecated use putIndexTemplate instead */
putTemplate<TContext = unknown>(
params: T.IndicesPutTemplateRequest,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<T.IndicesPutTemplateResponse, TContext>>;
/** @deprecated use putIndexTemplate instead */
putTemplate<TContext = unknown>(
params: T.IndicesPutTemplateRequest,
callback: callbackFn<T.IndicesPutTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use putIndexTemplate instead */
putTemplate<TContext = unknown>(
params: T.IndicesPutTemplateRequest,
options: TransportRequestOptions,
Expand Down Expand Up @@ -1401,17 +1414,21 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<T.IndicesSimulateIndexTemplateResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<TContext = unknown>(
params?: TODO,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TODO, TContext>>;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<TContext = unknown>(
callback: callbackFn<TODO, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<TContext = unknown>(
params: TODO,
callback: callbackFn<TODO, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<TContext = unknown>(
params: TODO,
options: TransportRequestOptions,
Expand Down
40 changes: 40 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2360,33 +2360,41 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use delete_index_template instead */
delete_template<TResponse = Record<string, any>, TContext = Context>(
params?: RequestParams.IndicesDeleteTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use delete_index_template instead */
delete_template<TResponse = Record<string, any>, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use delete_index_template instead */
delete_template<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesDeleteTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use delete_index_template instead */
delete_template<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesDeleteTemplate,
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(
params?: RequestParams.IndicesDeleteTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesDeleteTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use deleteIndexTemplate instead */
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesDeleteTemplate,
options: TransportRequestOptions,
Expand Down Expand Up @@ -2504,33 +2512,41 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use exists_index_template instead */
exists_template<TResponse = boolean, TContext = Context>(
params?: RequestParams.IndicesExistsTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use exists_index_template instead */
exists_template<TResponse = boolean, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use exists_index_template instead */
exists_template<TResponse = boolean, TContext = Context>(
params: RequestParams.IndicesExistsTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use exists_index_template instead */
exists_template<TResponse = boolean, TContext = Context>(
params: RequestParams.IndicesExistsTemplate,
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TResponse = boolean, TContext = Context>(
params?: RequestParams.IndicesExistsTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TResponse = boolean, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TResponse = boolean, TContext = Context>(
params: RequestParams.IndicesExistsTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use existsIndexTemplate instead */
existsTemplate<TResponse = boolean, TContext = Context>(
params: RequestParams.IndicesExistsTemplate,
options: TransportRequestOptions,
Expand Down Expand Up @@ -2776,33 +2792,41 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use get_index_template instead */
get_template<TResponse = Record<string, any>, TContext = Context>(
params?: RequestParams.IndicesGetTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use get_index_template instead */
get_template<TResponse = Record<string, any>, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use get_index_template instead */
get_template<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesGetTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use get_index_template instead */
get_template<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesGetTemplate,
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TResponse = Record<string, any>, TContext = Context>(
params?: RequestParams.IndicesGetTemplate,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use getIndexTemplate instead */
getTemplate<TResponse = Record<string, any>, TContext = Context>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesGetTemplate,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use getIndexTemplate instead */
getTemplate<TResponse = Record<string, any>, TContext = Context>(
params: RequestParams.IndicesGetTemplate,
options: TransportRequestOptions,
Expand Down Expand Up @@ -3112,6 +3136,7 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use put_index_template instead */
put_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3120,13 +3145,15 @@ declare class Client {
params?: RequestParams.IndicesPutTemplate<TRequestBody>,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use put_index_template instead */
put_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
TContext = Context
>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use put_index_template instead */
put_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3135,6 +3162,7 @@ declare class Client {
params: RequestParams.IndicesPutTemplate<TRequestBody>,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use put_index_template instead */
put_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3144,6 +3172,7 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use putIndexTemplate instead */
putTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3152,13 +3181,15 @@ declare class Client {
params?: RequestParams.IndicesPutTemplate<TRequestBody>,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use putIndexTemplate instead */
putTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
TContext = Context
>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use putIndexTemplate instead */
putTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3167,6 +3198,7 @@ declare class Client {
params: RequestParams.IndicesPutTemplate<TRequestBody>,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use putIndexTemplate instead */
putTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand Down Expand Up @@ -3416,6 +3448,7 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulate_index_template instead */
simulate_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3424,13 +3457,15 @@ declare class Client {
params?: RequestParams.IndicesSimulateTemplate<TRequestBody>,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use simulate_index_template instead */
simulate_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
TContext = Context
>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulate_index_template instead */
simulate_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3439,6 +3474,7 @@ declare class Client {
params: RequestParams.IndicesSimulateTemplate<TRequestBody>,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulate_index_template instead */
simulate_template<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3448,6 +3484,7 @@ declare class Client {
options: TransportRequestOptions,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3456,13 +3493,15 @@ declare class Client {
params?: RequestParams.IndicesSimulateTemplate<TRequestBody>,
options?: TransportRequestOptions
): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
TContext = Context
>(
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand All @@ -3471,6 +3510,7 @@ declare class Client {
params: RequestParams.IndicesSimulateTemplate<TRequestBody>,
callback: callbackFn<TResponse, TContext>
): TransportRequestCallback;
/** @deprecated use simulateIndexTemplate instead */
simulateTemplate<
TResponse = Record<string, any>,
TRequestBody extends RequestBody = Record<string, any>,
Expand Down

0 comments on commit 9259a54

Please sign in to comment.