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

[nodejs client] hookup issues in src/core/server/opensearch #1193

Closed
ananzh opened this issue Feb 1, 2022 · 0 comments · Fixed by #1342
Closed

[nodejs client] hookup issues in src/core/server/opensearch #1193

ananzh opened this issue Feb 1, 2022 · 0 comments · Fixed by #1342
Assignees
Labels
bug Something isn't working nodejs 🍭 issues related to nodejs client

Comments

@ananzh
Copy link
Member

ananzh commented Feb 1, 2022

opensearch client has issues after nodejs client hooked up with dashboards. Some major issues are:

  • import { Client } from '@opensearch-project/opensearch' is not pointing to the correct types. sample issue:
            src/core/server/opensearch/client/cluster_client.ts:98:36 - error TS2345: Argument of type 'Client' is not assignable to parameter of type 'OpenSearchClient'.
              Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            98     return new ScopedClusterClient(this.asInternalUser, scopedClient);
  • type 'undefined' cause issues, for example:
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:74:7 - error TS2532: Object is possibly 'undefined'.
 
            74       state.body.nodes.length > 0

  • types mismatch. sample issue:
            src/core/server/opensearch/client/retry_call_cluster.test.ts:120:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            120         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })

  • async search is a x-pack api and is removed in nodejs client. sample issue:
            src/core/server/opensearch/client/mocks.test.ts:57:25 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<Client>'.
 
            57     expectMocked(client.asyncSearch.get);

To Reproduce

rm -rf package-lock.json
npm i @opensearch-project/opensearch
rm -rf node_modules
yarn osd bootstrap

Expected behavior
clean out all issue in src/core/server/opensearch

OpenSearch Version
2.0

Dashboards Version
2.0

All Issues in src/core/server/opensearch

src/core/server/opensearch/client/cluster_client.ts:79:19 - error TS2416: Property 'asInternalUser' in type 'ClusterClient' is not assignable to the same property in base type 'ICustomClusterClient'.
              Type 'Client' is not assignable to type 'OpenSearchClient'.
                Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
                  The types of 'on(...).on' are incompatible between these types.
                    Type '{ (event: "request", listener: (err: ApiError, meta: RequestEvent<Record<string, any>, unknown>) => void): Client; (event: "response", listener: (err: ApiError, meta: RequestEvent<...>) => void): Client; (event: "sniff", listener: (err: ApiError, meta: RequestEvent<...>) => void): Client; (event: "resurrect", listen...' is not assignable to type '{ (event: "request", listener: (err: ApiError, meta: RequestEvent<Record<string, any>, unknown>) => void): OpenSearchDashboardsClient; (event: "response", listener: (err: ApiError, meta: RequestEvent<...>) => void): OpenSearchDashboardsClient; (event: "sniff", listener: (err: ApiError, meta: RequestEvent<...>) => vo...'.
                      Types of parameters 'event' and 'event' are incompatible.
                        Type '"response"' is not assignable to type '"request"'.
 
            79   public readonly asInternalUser: Client;
                                 ~~~~~~~~~~~~~~
 
            src/core/server/opensearch/client/cluster_client.ts:98:36 - error TS2345: Argument of type 'Client' is not assignable to parameter of type 'OpenSearchClient'.
              Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            98     return new ScopedClusterClient(this.asInternalUser, scopedClient);
 

            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:74:7 - error TS2532: Object is possibly 'undefined'.
 
            74       state.body.nodes.length > 0
                     ~~~~~~~~~~~~~~~~
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:74:7 - error TS2365: Operator '>' cannot be applied to types 'NodeAttributes' and 'number'.
 
            74       state.body.nodes.length > 0
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:75:15 - error TS2532: Object is possibly 'undefined'.
 
            75         ? get(state.body.nodes[0], `attributes.${healthcheckAttributeName}`, null)
                             ~~~~~~~~~~~~~~~~
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:78:7 - error TS2532: Object is possibly 'undefined'.
 
            78       state.body.nodes.find(
                     ~~~~~~~~~~~~~~~~
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:78:24 - error TS2349: This expression is not callable.
              Type 'NodeAttributes' has no call signatures.
 
            78       state.body.nodes.find(
                                      ~~~~
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.ts:211:5 - error TS2345: Argument of type 'OperatorFunction<number, NodesInfoResponse | { nodes: {}; }>' is not assignable to parameter of type 'OperatorFunction<number, NodesInfo>'.
              Type 'NodesInfoResponse | { nodes: {}; }' is not assignable to type 'NodesInfo'.
                Type 'NodesInfoResponse' is not assignable to type 'NodesInfo'.
                  Types of property 'nodes' are incompatible.
                    Type 'Record<string, NodesInfoNodeInfo>' is not assignable to type '{ [key: string]: NodeInfo; }'.
                      Index signatures are incompatible.
                        Type 'NodesInfoNodeInfo' is not assignable to type 'NodeInfo'.
                          Types of property 'http' are incompatible.
                            Type 'NodesInfoNodeInfoHttp | undefined' is not assignable to type '{ publish_address: string; }'.
                              Type 'undefined' is not assignable to type '{ publish_address: string; }'.
 
            211     exhaustMap(() => {
                    ~~~~~~~~~~~~~~~~~~
            212       /*
                ~~~~~~~~
            ... 
            245       }
                ~~~~~~~
            246     }),
 
 
            src/core/server/opensearch/opensearch_service.ts:97:7 - error TS2322: Type 'Client' is not assignable to type 'OpenSearchClient'.
              Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            97       internalClient: this.client.asInternalUser,
                     ~~~~~~~~~~~~~~
 
              src/core/server/opensearch/version_check/ensure_opensearch_version.ts:89:3
                89   internalClient: OpenSearchClient;
                     ~~~~~~~~~~~~~~
                The expected type comes from property 'internalClient' which is declared here on type 'PollOpenSearchNodesVersionOptions'
 
            src/core/server/opensearch/opensearch_service.ts:133:7 - error TS2322: Type 'ClusterClient' is not assignable to type 'ICustomClusterClient'.
              Types of property 'asInternalUser' are incompatible.
                Type 'Client' is not assignable to type 'OpenSearchClient'.
                  Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            133       return this.createClusterClient(type, finalConfig);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/opensearch/opensearch_service.ts:137:7 - error TS2322: Type 'ClusterClient' is not assignable to type 'IClusterClient'.
              Types of property 'asInternalUser' are incompatible.
                Type 'Client' is not assignable to type 'OpenSearchClient'.
                  Type 'Client' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            137       client: this.client!,
                      ~~~~~~
 
              src/core/server/opensearch/types.ts:120:12
                120   readonly client: IClusterClient;
                               ~~~~~~
                The expected type comes from property 'client' which is declared here on type 'OpenSearchServiceStart'
 
            src/core/server/opensearch/client/mocks.test.ts:57:25 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<Client>'.
 
            57     expectMocked(client.asyncSearch.get);
 
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:54:12 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<OpenSearchClient>'.
 
            54     client.asyncSearch.get.mockReturnValue(successReturn);
 
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:56:56 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<OpenSearchClient>'.
 
            56     const result = await retryCallCluster(() => client.asyncSearch.get());
 
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:65:12 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<OpenSearchClient>'.
 
            65     client.asyncSearch.get
 
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:71:56 - error TS2339: Property 'asyncSearch' does not exist on type 'DeeplyMockedKeys<OpenSearchClient>'.
 
            71     const result = await retryCallCluster(() => client.asyncSearch.get());
 
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:79:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            79         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
 
 
              node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:97:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            97         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:120:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            120         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
              node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:253:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            253         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
              node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:288:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            288         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
              node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/client/retry_call_cluster.test.ts:306:9 - error TS2322: Type 'MockedTransportRequestPromise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'TransportRequestPromise<ApiResponse<boolean, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ foo: string; }, unknown>>' is not assignable to type 'Promise<ApiResponse<boolean, unknown>>'.
                  Type 'ApiResponse<{ foo: string; }, unknown>' is not assignable to type 'ApiResponse<boolean, unknown>'.
                    Type '{ foo: string; }' is not assignable to type 'boolean'.
 
            306         opensearchClientMock.createSuccessTransportRequestPromise({ ...dummyBody })
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
              node_modules/@types/jest/index.d.ts:1217:36
                1217         mockImplementationOnce(fn: (...args: Y) => T): this;
                                                        ~~~~~~~~~~~~~~~~~
                The expected type comes from the return type of this signature.
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.test.ts:182:7 - error TS2322: Type 'DeeplyMockedKeys<Client>' is not assignable to type 'OpenSearchClient'.
              Type 'DeeplyMockedKeys<Client>' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
                The types returned by 'on(...).child(...)' are incompatible between these types.
                  Type 'Client' is not assignable to type 'OpenSearchDashboardsClient'.
 
            182       internalClient,
                      ~~~~~~~~~~~~~~
 
              src/core/server/opensearch/version_check/ensure_opensearch_version.ts:89:3
                89   internalClient: OpenSearchClient;
                     ~~~~~~~~~~~~~~
                The expected type comes from property 'internalClient' which is declared here on type 'PollOpenSearchNodesVersionOptions'
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.test.ts:206:7 - error TS2322: Type 'DeeplyMockedKeys<Client>' is not assignable to type 'OpenSearchClient'.
              Type 'DeeplyMockedKeys<Client>' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            206       internalClient,
                      ~~~~~~~~~~~~~~
 
              src/core/server/opensearch/version_check/ensure_opensearch_version.ts:89:3
                89   internalClient: OpenSearchClient;
                     ~~~~~~~~~~~~~~
                The expected type comes from property 'internalClient' which is declared here on type 'PollOpenSearchNodesVersionOptions'
 
            src/core/server/opensearch/version_check/ensure_opensearch_version.test.ts:235:7 - error TS2322: Type 'DeeplyMockedKeys<Client>' is not assignable to type 'OpenSearchClient'.
              Type 'DeeplyMockedKeys<Client>' is not assignable to type 'Pick<OpenSearchDashboardsClient, "helpers" | "emit" | "on" | "once" | "off" | "bulk" | "cat" | "clearScroll" | "cluster" | "count" | "create" | "danglingIndices" | ... 41 more ... | "updateByQueryRethrottle">'.
 
            235       internalClient,
                      ~~~~~~~~~~~~~~
 
              src/core/server/opensearch/version_check/ensure_opensearch_version.ts:89:3
                89   internalClient: OpenSearchClient;

@ananzh ananzh added bug Something isn't working untriaged labels Feb 1, 2022
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Feb 1, 2022
…search

1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Issue Resolved: opensearch-project#1193
Partical Resolved: opensearch-project/opensearch-js#837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Feb 1, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Issue Resolved: opensearch-project#1193
Partical Resolved: opensearch-project/opensearch-js#837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Feb 1, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Issue Resolved: opensearch-project#1193
Partical Resolved: opensearch-project/opensearch-js#837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
@kavilla kavilla added nodejs 🍭 issues related to nodejs client and removed untriaged labels Feb 3, 2022
@ananzh ananzh self-assigned this Feb 7, 2022
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Feb 7, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Remove retry_call_cluster.test.ts due to removing all asyncSearch api

Issue Resolved: opensearch-project#1193
Partical Resolved: opensearch-project#837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ananzh added a commit that referenced this issue Feb 17, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Remove retry_call_cluster.test.ts due to removing all asyncSearch api

Issue Resolved: #1193
Partical Resolved: #837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Feb 28, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Issue Resolved: opensearch-project#1193
Partical Resolved: opensearch-project/opensearch-js#837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit that referenced this issue Mar 5, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Remove retry_call_cluster.test.ts due to removing all asyncSearch api

Issue Resolved: #1193
Partical Resolved: #837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit that referenced this issue Mar 5, 2022
1. import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2. remove asynSearch
3. apply type assertion
4. fix undefined and mismatched types

Remove retry_call_cluster.test.ts due to removing all asyncSearch api

Issue Resolved: #1193
Partical Resolved: #837
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 12, 2022
1.change @elastic/elasticsearch to @opensearch-project/opensearch
2.add path in tsconfig.base.json to let nodejs types point to api/new.d.ts
which is the new defined types
3.fix hookup issues in src/core/server/opensearch
4.fix hookup issues in src/core/server/core_usage_data_service.ts
5.fix hookup issues in src/core/server/saved_objects

Issue Resolved: opensearch-project#1193
Issue Resolved: opensearch-project#1224
Issue Resolved: opensearch-project#1216
Partical Resolved: opensearch-project#837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 12, 2022
1.change @elastic/elasticsearch to @opensearch-project/opensearch
2.add path in tsconfig.base.json to let nodejs types point to api/new.d.ts
which is the new defined types
3.fix hookup issues in src/core/server/opensearch
4.fix hookup issues in src/core/server/core_usage_data_service.ts
5.fix hookup issues in src/core/server/saved_objects

Sub-Issue Resolved: opensearch-project#1193
Sub-Issue Resolved: opensearch-project#1224
Sub-Issue Resolved: opensearch-project#1216
Issue Resolved: opensearch-project#837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
@kavilla kavilla closed this as completed Mar 14, 2022
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 18, 2022
1.change @elastic/elasticsearch to @opensearch-project/opensearch
2.add path in tsconfig.base.json to let nodejs types point to api/new.d.ts
which is the new defined types
3.fix hookup issues in src/core/server/opensearch
4.fix hookup issues in src/core/server/core_usage_data_service.ts
5.fix hookup issues in src/core/server/saved_objects

fix PR comments and add more explains to type mismatch

Sub-Issue Resolved: opensearch-project#1193
Sub-Issue Resolved: opensearch-project#1224
Sub-Issue Resolved: opensearch-project#1216
Issue Resolved: opensearch-project#837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 18, 2022
1.change @elastic/elasticsearch to @opensearch-project/opensearch
2.add path in tsconfig.base.json to let nodejs types point to api/new.d.ts
which is the new defined types
3.fix hookup issues in src/core/server/opensearch
4.fix hookup issues in src/core/server/core_usage_data_service.ts
5.fix hookup issues in src/core/server/saved_objects

fix PR comments and add more explains to type mismatch

Sub-Issue Resolved: opensearch-project#1193
Sub-Issue Resolved: opensearch-project#1224
Sub-Issue Resolved: opensearch-project#1216
Issue Resolved: opensearch-project#837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
kavilla pushed a commit that referenced this issue Mar 23, 2022
1.change @elastic/elasticsearch to @opensearch-project/opensearch
2.add path in tsconfig.base.json to let nodejs types point to api/new.d.ts
which is the new defined types
3.fix hookup issues in src/core/server/opensearch
4.fix hookup issues in src/core/server/core_usage_data_service.ts
5.fix hookup issues in src/core/server/saved_objects

fix PR comments and add more explains to type mismatch

Sub-Issue Resolved: #1193
Sub-Issue Resolved: #1224
Sub-Issue Resolved: #1216
Issue Resolved: #837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nodejs 🍭 issues related to nodejs client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants