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/saved_objects #1216

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

[nodejs client] hookup issues in src/core/server/saved_objects #1216

ananzh opened this issue Feb 7, 2022 · 0 comments · Fixed by #1342
Assignees
Labels
nodejs 🍭 issues related to nodejs client v2.0.0

Comments

@ananzh
Copy link
Member

ananzh commented Feb 7, 2022

opensearch saved_objects api 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

  • types mismatch. for example, ShardsInfo needs to be replaced with ShardStatistics. This is due to api changes. Use scroll api as an example:


node_modules/@opensearch-project/opensearch/api/opensearch_dashboards.d.ts
scroll<TDocument = unknown, TContext = unknown>(params?: T.ScrollRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ScrollResponse<TDocument>, TContext>>
 
node_modules/@elastic/elasticsearch/api/kibana.d.ts
scroll<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Scroll<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

Here ScrollResponse exports interface SearchResponse which needs _shards: ShardStatistics. Here is a sample issue for types mismatch:

            src/core/server/saved_objects/migrations/core/opensearch_index.ts:108:36 - error TS2345: Argument of type 'ScrollResponse<SearchResponse<SavedObjectsRawDocSource>>' is not assignable to parameter of type '{ _shards: ShardsInfo; }'.
              Types of property '_shards' are incompatible.
                Type 'ShardStatistics' is not assignable to type 'ShardsInfo'.
 
            108     assertResponseIncludeAllShards(result.body);
 
 
type '{ _shards: ShardsInfo; }'.
              The types of '_shards.skipped' are incompatible between these types.
                Type 'number | undefined' is not assignable to type 'number'.
                  Type 'undefined' is not assignable to type 'number'.
 
            208     assertResponseIncludeAllShards(body);
  • type 'undefined' cause issues, for example:
            src/core/server/saved_objects/service/lib/repository.ts:415:40 - error TS2532: Object is possibly 'undefined'.
 
            415         const docFound = indexFound && actualResult.found === true;
  • unit tests need to update due to api changes
src/core/server/saved_objects/mappings/lib/get_property.test.ts
src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts
src/core/server/saved_objects/migrations/core/build_index_map.test.ts
src/core/server/saved_objects/migrations/core/index_migrator.test.ts
src/core/server/saved_objects/migrations/core/migration_context.test.ts
src/core/server/saved_objects/migrations/core/opensearch_index.test.ts
src/core/server/saved_objects/migrations/opensearch_dashboards/opensearch_dashboards_migrator.test.ts
src/core/server/saved_objects/service/lib/filter_utils.test.ts
src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts

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/saved_objects

OpenSearch Version
2.0

Dashboards Version
2.0

All Issues in src/core/server/saved_objects

            src/core/server/saved_objects/migrations/core/opensearch_index.ts:71:33 - error TS2345: Argument of type '{ exists: true; indexName: string; aliases?: Record<string, IndicesAlias> | undefined; mappings?: MappingTypeMapping | undefined; settings: IndicesIndexSettings | IndicesIndexStatePrefixedSettings; }' is not assignable to parameter of type 'FullIndexInfo'.
              Types of property 'aliases' are incompatible.
                Type 'Record<string, IndicesAlias> | undefined' is not assignable to type '{ [name: string]: object; }'.
                  Type 'undefined' is not assignable to type '{ [name: string]: object; }'.
 
            71   return assertIsSupportedIndex({ ...indexInfo, exists: true, indexName });
 
            src/core/server/saved_objects/migrations/core/opensearch_index.ts:108:36 - error TS2345: Argument of type 'ScrollResponse<SearchResponse<SavedObjectsRawDocSource>>' is not assignable to parameter of type '{ _shards: ShardsInfo; }'.
              Types of property '_shards' are incompatible.
                Type 'ShardStatistics' is not assignable to type 'ShardsInfo'.
 
            108     assertResponseIncludeAllShards(result.body);
 
 
type '{ _shards: ShardsInfo; }'.
              The types of '_shards.skipped' are incompatible between these types.
                Type 'number | undefined' is not assignable to type 'number'.
                  Type 'undefined' is not assignable to type 'number'.
 
            208     assertResponseIncludeAllShards(body);

            src/core/server/saved_objects/migrations/core/opensearch_index.ts:150:36 - error TS2532: Object is possibly 'undefined'.
 
            150   const exception: any = new Error(err.index.error!.reason);

            src/core/server/saved_objects/migrations/core/opensearch_index.ts:229:13 - error TS2322: Type 'IndexMapping | undefined' is not assignable to type 'MappingTypeMapping | Record<string, MappingTypeMapping> | undefined'.
              Type 'IndexMapping' is not assignable to type 'MappingTypeMapping | Record<string, MappingTypeMapping> | undefined'.
                Type 'IndexMapping' is not assignable to type 'Record<string, MappingTypeMapping>'.
                  Index signature is missing in type 'IndexMapping'.
 
            229     body: { mappings, settings },
 
 
            src/core/server/saved_objects/migrations/core/opensearch_index.ts:255:13 - error TS2322: Type 'IndexMapping' is not assignable to type 'MappingTypeMapping | Record<string, MappingTypeMapping> | undefined'.
              Type 'IndexMapping' is not assignable to type 'Record<string, MappingTypeMapping>'.
 
            255     body: { mappings: info.mappings, settings },

 
            src/core/server/saved_objects/migrations/core/opensearch_index.ts:375:7 - error TS2322: Type 'string | number | undefined' is not assignable to type 'string'.
              Type 'undefined' is not assignable to type 'string'.
 
            375       task_id: task,
 
              node_modules/@opensearch-project/opensearch/api/types.d.ts:9433:3
                9433   task_id: Id
                       ~~~~~~~
                The expected type comes from property 'task_id' which is declared here on type 'TaskGetRequest'
 
            src/core/server/saved_objects/migrations/core/index_migrator.ts:172:82 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
              Type 'undefined' is not assignable to type 'string'.
 
            172   return Promise.all(templateNames.map((name) => client.indices.deleteTemplate({ name })));
 
 
              node_modules/@opensearch-project/opensearch/api/types.d.ts:7235:3
                7235   name: Name
                       ~~~~
                The expected type comes from property 'name' which is declared here on type 'IndicesDeleteTemplateRequest'
 
 
            src/core/server/saved_objects/migrations/core/index_migrator.ts:210:66 - error TS2345: Argument of type 'SearchHit<SearchResponse<SavedObjectsRawDocSource>>[]' is not assignable to parameter of type 'SavedObjectsRawDoc[]'.
              Type 'SearchHit<SearchResponse<SavedObjectsRawDocSource>>' is not assignable to type 'SavedObjectsRawDoc'.
                Types of property '_source' are incompatible.
                  Type 'SearchResponse<SavedObjectsRawDocSource> | undefined' is not assignable to type 'SavedObjectsRawDocSource'.
                    Type 'undefined' is not assignable to type 'SavedObjectsRawDocSource'.
 
            210       await migrateRawDocs(serializer, documentMigrator.migrate, docs, log)
                                                                                 ~~~~

            src/core/server/saved_objects/service/lib/repository.ts:415:40 - error TS2532: Object is possibly 'undefined'.
 
            415         const docFound = indexFound && actualResult.found === true;
 
            
src/core/server/saved_objects/service/lib/repository.ts:575:11 - error TS2532: Object is possibly 'undefined'.
 
            575       if (doc.found) {
 
            src/core/server/saved_objects/service/lib/repository.ts:920:14 - error TS2532: Object is possibly 'undefined'.
 
            920         if (!doc.found || !this.rawDocExistsInNamespace(doc, namespace)) {

 
            src/core/server/saved_objects/service/lib/repository.ts:416:55 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc'.
              Type 'undefined' is not assignable to type 'SavedObjectsRawDoc'.
 
            416         if (docFound && !this.rawDocExistsInNamespace(actualResult, namespace)) {
 
 
            src/core/server/saved_objects/service/lib/repository.ts:431:68 - error TS2345: Argument of type 'false | MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc | undefined'.
              Type 'false' is not assignable to type 'SavedObjectsRawDoc | undefined'.
 
            431           initialNamespaces || getSavedObjectNamespaces(namespace, docFound && actualResult);
 
 
          src/core/server/saved_objects/service/lib/repository.ts:432:67 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc | undefined'.
              Type 'MgetHit<unknown>' is not assignable to type 'SavedObjectsRawDoc'.
                Types of property '_source' are incompatible.
                  Type 'unknown' is not assignable to type 'SavedObjectsRawDocSource'.
 
            432         versionProperties = getExpectedVersionProperties(version, actualResult);
 
 
 
            src/core/server/saved_objects/service/lib/repository.ts:581:47 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc'.
              Type 'undefined' is not assignable to type 'SavedObjectsRawDoc'.
 
            581             ...(!this.rawDocExistsInNamespace(doc, namespace) && {
 
 
            src/core/server/saved_objects/service/lib/repository.ts:920:57 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc'.
              Type 'undefined' is not assignable to type 'SavedObjectsRawDoc'.
 
            920         if (!doc.found || !this.rawDocExistsInNamespace(doc, namespace)) {
           489           bulkResponse?.body.items[opensearchRequestIndex]
 
            src/core/server/saved_objects/service/lib/repository.ts:835:9 - error TS2345: Argument of type '(hit: SavedObjectsRawDoc) => SavedObjectsFindResult' is not assignable to parameter of type '(value: SearchHit<SearchResponse<any>>, index: number, array: SearchHit<SearchResponse<any>>[]) => SavedObjectsFindResult<unknown>'.
              Types of parameters 'hit' and 'value' are incompatible.
                Type 'SearchHit<SearchResponse<any>>' is not assignable to type 'SavedObjectsRawDoc'.
                  Types of property '_source' are incompatible.
                    Type 'SearchResponse<any> | undefined' is not assignable to type 'SavedObjectsRawDocSource'.
                      Type 'undefined' is not assignable to type 'SavedObjectsRawDocSource'.
 
            835         (hit: SavedObjectsRawDoc): SavedObjectsFindResult => ({
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            836           ...this._rawToSavedObject(hit),
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            837           score: (hit as any)._score,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            838         })
 
            src/core/server/saved_objects/service/lib/repository.ts:928:17 - error TS2339: Property 'originId' does not exist on type 'unknown'.
 
            928         const { originId, updated_at: updatedAt } = doc._source;
 
 
            src/core/server/saved_objects/service/lib/repository.ts:928:27 - error TS2339: Property 'updated_at' does not exist on type 'unknown'.
 
            928         const { originId, updated_at: updatedAt } = doc._source;
 
 
            src/core/server/saved_objects/service/lib/repository.ts:928:53 - error TS2532: Object is possibly 'undefined'.
 
            928         const { originId, updated_at: updatedAt } = doc._source;
 
 
            src/core/server/saved_objects/service/lib/repository.ts:931:24 - error TS2532: Object is possibly 'undefined'.
 
            931           namespaces = doc._source.namespaces ?? [
                                       ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:931:24 - error TS2571: Object is of type 'unknown'.
 
            931           namespaces = doc._source.namespaces ?? [
                                       ~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:932:51 - error TS2532: Object is possibly 'undefined'.
 
            932             SavedObjectsUtils.namespaceIdToString(doc._source.namespace),
                                                                  ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:932:51 - error TS2571: Object is of type 'unknown'.
 
            932             SavedObjectsUtils.namespaceIdToString(doc._source.namespace),
                                                                  ~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:942:37 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type '{ _seq_no: number; _primary_term: number; }'.
              Type 'undefined' is not assignable to type '{ _seq_no: number; _primary_term: number; }'.
 
            942           version: encodeHitVersion(doc),
                                                    ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:943:23 - error TS2532: Object is possibly 'undefined'.
 
            943           attributes: doc._source[type],
                                      ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:943:23 - error TS2571: Object is of type 'unknown'.
 
            943           attributes: doc._source[type],
                                      ~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:944:23 - error TS2532: Object is possibly 'undefined'.
 
            944           references: doc._source.references || [],
                                      ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:944:23 - error TS2571: Object is of type 'unknown'.
 
            944           references: doc._source.references || [],
                                      ~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:945:29 - error TS2532: Object is possibly 'undefined'.
 
            945           migrationVersion: doc._source.migrationVersion,
                                            ~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:945:29 - error TS2571: Object is of type 'unknown'.
 
            945           migrationVersion: doc._source.migrationVersion,
                                            ~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:981:71 - error TS2345: Argument of type 'GetResponse<GetResponse<SavedObjectsRawDocSource>>' is not assignable to parameter of type 'SavedObjectsRawDoc'.
 
            981     if (docNotFound || indexNotFound || !this.rawDocExistsInNamespace(body, namespace)) {
 
 
            src/core/server/saved_objects/service/lib/repository.ts:986:13 - error TS2339: Property 'originId' does not exist on type 'GetResponse<SavedObjectsRawDocSource> | undefined'.
 
            986     const { originId, updated_at: updatedAt } = body._source;
                            ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:986:23 - error TS2339: Property 'updated_at' does not exist on type 'GetResponse<SavedObjectsRawDocSource> | undefined'.
 
            986     const { originId, updated_at: updatedAt } = body._source;
                                      ~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:990:20 - error TS2532: Object is possibly 'undefined'.
 
            990       namespaces = body._source.namespaces ?? [
                                   ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:990:33 - error TS2339: Property 'namespaces' does not exist on type 'GetResponse<SavedObjectsRawDocSource>'.
 
            990       namespaces = body._source.namespaces ?? [
                                                ~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:991:47 - error TS2532: Object is possibly 'undefined'.
 
            991         SavedObjectsUtils.namespaceIdToString(body._source.namespace),
                                                              ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:991:60 - error TS2339: Property 'namespace' does not exist on type 'GetResponse<SavedObjectsRawDocSource>'.
 
            991         SavedObjectsUtils.namespaceIdToString(body._source.namespace),
                                                                           ~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1001:33 - error TS2345: Argument of type 'GetResponse<GetResponse<SavedObjectsRawDocSource>>' is not assignable to parameter of type '{ _seq_no: number; _primary_term: number; }'.
              Types of property '_seq_no' are incompatible.
                Type 'number | undefined' is not assignable to type 'number'.
                  Type 'undefined' is not assignable to type 'number'.
 
            1001       version: encodeHitVersion(body),
                                                 ~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1002:19 - error TS2532: Object is possibly 'undefined'.
 
            1002       attributes: body._source[type],
                                   ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1002:19 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'GetResponse<SavedObjectsRawDocSource>'.
              No index signature with a parameter of type 'string' was found on type 'GetResponse<SavedObjectsRawDocSource>'.
 
            1002       attributes: body._source[type],
                                   ~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1003:19 - error TS2532: Object is possibly 'undefined'.
 
            1003       references: body._source.references || [],
                                   ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1003:32 - error TS2339: Property 'references' does not exist on type 'GetResponse<SavedObjectsRawDocSource>'.
 
            1003       references: body._source.references || [],
                                                ~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1004:25 - error TS2532: Object is possibly 'undefined'.
 
            1004       migrationVersion: body._source.migrationVersion,
                                         ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1004:38 - error TS2339: Property 'migrationVersion' does not exist on type 'GetResponse<SavedObjectsRawDocSource>'.
 
            1004       migrationVersion: body._source.migrationVersion,
                                                      ~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1065:13 - error TS2339: Property 'originId' does not exist on type 'unknown'.
 
            1065     const { originId } = body.get._source;
                             ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1065:26 - error TS2532: Object is possibly 'undefined'.
 
            1065     const { originId } = body.get._source;
                                          ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1068:20 - error TS2532: Object is possibly 'undefined'.
 
            1068       namespaces = body.get._source.namespaces ?? [
                                    ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1068:20 - error TS2571: Object is of type 'unknown'.
 
            1068       namespaces = body.get._source.namespaces ?? [
                                    ~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1069:47 - error TS2532: Object is possibly 'undefined'.
 
            1069         SavedObjectsUtils.namespaceIdToString(body.get._source.namespace),
                                                               ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1069:47 - error TS2571: Object is of type 'unknown'.
 
            1069         SavedObjectsUtils.namespaceIdToString(body.get._source.namespace),
                                                               ~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1371:42 - error TS2532: Object is possibly 'undefined'.
 
            1371           const docFound = indexFound && actualResult.found === true;
                                                          ~~~~~~~~~~~~

            src/core/server/saved_objects/service/lib/repository.ts:1374:43 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc'.
              Type 'undefined' is not assignable to type 'SavedObjectsRawDoc'.
 
            1374             !this.rawDocExistsInNamespace(actualResult, getNamespaceId(objectNamespace))
                                                           ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1385:24 - error TS2532: Object is possibly 'undefined'.
 
            1385           namespaces = actualResult._source.namespaces ?? [
                                        ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1385:24 - error TS2571: Object is of type 'unknown'.
 
            1385           namespaces = actualResult._source.namespaces ?? [
                                        ~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1386:51 - error TS2532: Object is possibly 'undefined'.
 
            1386             SavedObjectsUtils.namespaceIdToString(actualResult._source.namespace),
                                                                   ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1386:51 - error TS2571: Object is of type 'unknown'.
 
            1386             SavedObjectsUtils.namespaceIdToString(actualResult._source.namespace),
                                                                   ~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1388:69 - error TS2345: Argument of type 'MgetHit<unknown> | undefined' is not assignable to parameter of type 'SavedObjectsRawDoc | undefined'.
              Type 'MgetHit<unknown>' is not assignable to type 'SavedObjectsRawDoc'.
 
            1388           versionProperties = getExpectedVersionProperties(version, actualResult);
 
            src/core/server/saved_objects/service/lib/repository.ts:1446:11 - error TS2769: No overload matches this call.
              Overload 1 of 2, '(o: ArrayLike<unknown> | { [s: string]: unknown; }): unknown[]', gave the following error.
                Argument of type 'BulkResponseItemContainer | undefined' is not assignable to parameter of type 'ArrayLike<unknown> | { [s: string]: unknown; }'.
                  Type 'undefined' is not assignable to type 'ArrayLike<unknown> | { [s: string]: unknown; }'.
              Overload 2 of 2, '(o: {}): any[]', gave the following error.
                Argument of type 'BulkResponseItemContainer | undefined' is not assignable to parameter of type '{}'.
                  Type 'undefined' is not assignable to type '{}'.
 
            1446           response
                           ~~~~~~~~
 
 
            src/core/server/saved_objects/service/lib/repository.ts:1553:13 - error TS2339: Property 'originId' does not exist on type 'unknown'.
 
            1553     const { originId } = body.get._source;
                             ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1553:26 - error TS2532: Object is possibly 'undefined'.
           1553     const { originId } = body.get._source;
                                          ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1560:19 - error TS2532: Object is possibly 'undefined'.
 
            1560       references: body.get._source.references,
                                   ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1560:19 - error TS2571: Object is of type 'unknown'.
 
            1560       references: body.get._source.references,
                                   ~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1563:19 - error TS2532: Object is possibly 'undefined'.
 
            1563       attributes: body.get._source[type],
                                   ~~~~~~~~
 
            src/core/server/saved_objects/service/lib/repository.ts:1563:19 - error TS2571: Object is of type 'unknown'.
 
            1563       attributes: body.get._source[type],
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
          at makeError (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:25139:11)
          at handlePromise (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:24074:26)
          at processTicksAndRejections (internal/process/task_queues.js:95:5)
          at async /home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:9040:9
          at async scheduleItem (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:10927:9)

 
src/core/server/saved_objects/saved_objects_type_registry.ts:59:31 - error TS2345: Argument of type 'Readonly<{ name: string; hidden: boolean; namespaceType: SavedObjectsNamespaceType; indexPattern?: string | undefined; convertToAliasScript?: string | undefined; mappings: Readonly<...>; migrations?: Readonly<...> | undefined; management?: Readonly<...> | undefined; }>' is not assignable to parameter of type 'SavedObjectsType'.
              The types of 'mappings.properties' are incompatible between these types.
                Type 'Readonly<{ [x: string]: Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; ... 11 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonly<...>; }>' is not assignable to type 'SavedObjectsMappingProperties'.
                  Index signatures are incompatible.
                    Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonl...' is not assignable to type 'SavedObjectsFieldMapping'.
                      Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'SavedObjectsFieldMapping'.
                        Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }'.
                          Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'MappingFlattenedProperty'.
                            Types of property 'properties' are incompatible.
                              Type 'Readonly<{ [x: string]: Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; ... 11 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonly<...>; }> | undefined' is not assignable to type 'Record<string, MappingProperty> | undefined'.
                                Type 'Readonly<{ [x: string]: Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; ... 11 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonly<...>; }>' is not assignable to type 'Record<string, MappingProperty>'.
                                  Index signatures are incompatible.
                                    Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonl...' is not assignable to type 'MappingProperty'.
                                      Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'MappingProperty'.
                                        Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'MappingFlattenedProperty'.
                                          Types of property 'properties' are incompatible.
                                            Type 'Readonly<{ [x: string]: Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; ... 11 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonly<...>; }> | undefined' is not assignable to type 'Record<string, MappingProperty> | undefined'.
                                              Type 'Readonly<{ [x: string]: Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; ... 11 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonly<...>; }>' is not assignable to type 'Record<string, MappingProperty>'.
                                                Index signatures are incompatible.
                                                  Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }> | ... 33 more ... | Readonl...' is not assignable to type 'MappingProperty'.
                                                    Type 'Readonly<{ boost?: number | undefined; depth_limit?: number | undefined; doc_values?: boolean | undefined; eager_global_ordinals?: boolean | undefined; index?: boolean | undefined; index_options?: "docs" | ... 3 more ... | undefined; ... 10 more ...; fields?: Readonly<...> | undefined; }>' is not assignable to type 'MappingProperty'.
 
            59     this.types.set(type.name, deepFreeze(type));
 
 
src/core/server/saved_objects/mappings/lib/get_property.test.ts:62:22 - error TS2345: Argument of type '{ properties: { foo: { properties: { name: { type: string; }; description: { type: string; }; }; }; bar: { properties: { baz: { type: string; fields: { box: { type: string; }; }; }; }; }; }; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ properties: { foo: { properties: { name: { type: string; }; description: { type: string; }; }; }; bar: { properties: { baz: { type: string; fields: { box: { type: string; }; }; }; }; }; }; }' is not assignable to type 'IndexMapping'.
                Types of property 'properties' are incompatible.
                  Type '{ foo: { properties: { name: { type: string; }; description: { type: string; }; }; }; bar: { properties: { baz: { type: string; fields: { box: { type: string; }; }; }; }; }; }' is not assignable to type 'SavedObjectsMappingProperties'.
                    Property 'foo' is incompatible with index signature.
                      Type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to type 'SavedObjectsFieldMapping'.
                        Type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                          Property 'type' is missing in type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' but required in type 'MappingPointProperty'.
 
            62   expect(getProperty(MAPPINGS, key)).toBe(mapping);
                                    ~~~~~~~~
 
              node_modules/@opensearch-project/opensearch/api/types.d.ts:3857:3
                3857   type: 'point'
                       ~~~~
                'type' is declared here.
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:68:22 - error TS2345: Argument of type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to type 'IndexMapping'.
                Types of property 'properties' are incompatible.
                  Type '{ name: { type: string; }; description: { type: string; }; }' is not assignable to type 'SavedObjectsMappingProperties'.
                    Property 'name' is incompatible with index signature.
                      Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
                        Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                          Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            68       runTest('foo', MAPPINGS.properties.foo);
                                    ~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:71:27 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
                  Types of property 'type' are incompatible.
                    Type 'string' is not assignable to type '"point"'.
 
            71       runTest('foo.name', MAPPINGS.properties.foo.properties.name);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:72:34 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
                  Types of property 'type' are incompatible.
                    Type 'string' is not assignable to type '"point"'.
 
            72       runTest('foo.description', MAPPINGS.properties.foo.properties.description);
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:73:26 - error TS2345: Argument of type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to type 'MappingPointProperty'.
                  Types of property 'type' are incompatible.
                    Type 'string' is not assignable to type '"point"'.
 
            73       runTest('bar.baz', MAPPINGS.properties.bar.properties.baz);
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:76:30 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
                  Types of property 'type' are incompatible.
                    Type 'string' is not assignable to type '"point"'.
 
            76       runTest('bar.baz.box', MAPPINGS.properties.bar.properties.baz.fields.box);
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:81:24 - error TS2345: Argument of type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ properties: { name: { type: string; }; description: { type: string; }; }; }' is not assignable to type 'IndexMapping'.
 
            81       runTest(['foo'], MAPPINGS.properties.foo);
                                      ~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:84:32 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
 
            84       runTest(['foo', 'name'], MAPPINGS.properties.foo.properties.name);
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:85:39 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
 
            85       runTest(['foo', 'description'], MAPPINGS.properties.foo.properties.description);
                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:86:31 - error TS2345: Argument of type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; fields: { box: { type: string; }; }; }' is not assignable to type 'MappingPointProperty'.
 
            86       runTest(['bar', 'baz'], MAPPINGS.properties.bar.properties.baz);
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/mappings/lib/get_property.test.ts:89:38 - error TS2345: Argument of type '{ type: string; }' is not assignable to parameter of type '(MappingFlattenedProperty & { dynamic?: false | "strict" | undefined; }) | (MappingJoinProperty & { dynamic?: false | "strict" | undefined; }) | ... 33 more ... | IndexMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingPointProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is not assignable to type 'MappingPointProperty'.
 
            89       runTest(['bar', 'baz', 'box'], MAPPINGS.properties.bar.properties.baz.fields.box);
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts:43:32 - error TS2345: Argument of type '{ aaa: { type: string; }; bbb: { type: string; }; }' is not assignable to parameter of type 'SavedObjectsMappingProperties | SavedObjectsTypeMappingDefinitions'.
              Type '{ aaa: { type: string; }; bbb: { type: string; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
                Property 'aaa' is incompatible with index signature.
                  Property 'properties' is missing in type '{ type: string; }' but required in type 'SavedObjectsTypeMappingDefinition'.
 
            43     expect(buildActiveMappings(properties)).toMatchSnapshot();
                                              ~~~~~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:68:3
                68   properties: SavedObjectsMappingProperties;
                     ~~~~~~~~~~
                'properties' is declared here.
 
            src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts:49:38 - error TS2345: Argument of type '{ type: { type: string; }; }' is not assignable to parameter of type 'SavedObjectsMappingProperties | SavedObjectsTypeMappingDefinitions'.
              Type '{ type: { type: string; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
                Property 'type' is incompatible with index signature.
                  Property 'properties' is missing in type '{ type: string; }' but required in type 'SavedObjectsTypeMappingDefinition'.
 
            49     expect(() => buildActiveMappings(properties)).toThrow(/Cannot redefine core mapping \"type\"/);
                                                    ~~~~~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:68:3
                68   properties: SavedObjectsMappingProperties;
                     ~~~~~~~~~~
                'properties' is declared here.
 
            src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts:55:38 - error TS2345: Argument of type '{ _hm: { type: string; }; }' is not assignable to parameter of type 'SavedObjectsMappingProperties | SavedObjectsTypeMappingDefinitions'.
              Type '{ _hm: { type: string; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
                Property '_hm' is incompatible with index signature.
                  Property 'properties' is missing in type '{ type: string; }' but required in type 'SavedObjectsTypeMappingDefinition'.
 
            55     expect(() => buildActiveMappings(properties)).toThrow(
                                                    ~~~~~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:68:3
                68   properties: SavedObjectsMappingProperties;
                     ~~~~~~~~~~
                'properties' is declared here.
 
            src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts:84:42 - error TS2345: Argument of type '{ aaa: { type: string; fields: { a: { type: string; }; b: { type: string; }; }; }; bbb: { fields: { b: { type: string; }; a: { type: string; }; }; type: string; }; ccc: { fields: { b: { type: string; }; a: { type: string; }; }; type: string; }; }' is not assignable to parameter of type 'SavedObjectsMappingProperties | SavedObjectsTypeMappingDefinitions'.
              Type '{ aaa: { type: string; fields: { a: { type: string; }; b: { type: string; }; }; }; bbb: { fields: { b: { type: string; }; a: { type: string; }; }; type: string; }; ccc: { fields: { b: { type: string; }; a: { type: string; }; }; type: string; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
                Property 'aaa' is incompatible with index signature.
                  Property 'properties' is missing in type '{ type: string; fields: { a: { type: string; }; b: { type: string; }; }; }' but required in type 'SavedObjectsTypeMappingDefinition'.
 
            84     const mappings = buildActiveMappings(properties);
                                                        ~~~~~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:68:3
                68   properties: SavedObjectsMappingProperties;
                     ~~~~~~~~~~
                'properties' is declared here.
 
            src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts:186:7 - error TS2322: Type '"abcde"' is not assignable to type 'boolean | "strict" | undefined'.
 
            186       dynamic: 'abcde',
                      ~~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:137:3
                137   dynamic?: boolean | 'strict';
                      ~~~~~~~
                The expected type comes from property 'dynamic' which is declared here on type 'IndexMapping'
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:57:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            57           field1: {
                         ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:90:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            90           field1: {
                         ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:124:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            124           field1: {
                          ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:182:7 - error TS2322: Type '{ type1: { properties: { field1: { type: string; }; }; }; type2: { properties: { field1: { type: string; }; }; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
              Property 'type1' is incompatible with index signature.
                Type '{ properties: { field1: { type: string; }; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinition'.
                  Types of property 'properties' are incompatible.
                    Type '{ field1: { type: string; }; }' is not assignable to type 'SavedObjectsMappingProperties'.
                      Property 'field1' is incompatible with index signature.
                        Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
                          Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                            Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            182       indexMap,
                      ~~~~~~~~
 
              src/core/server/saved_objects/migrations/core/build_index_map.ts:39:3
                39   indexMap: SavedObjectsTypeMappingDefinitions;
                     ~~~~~~~~
                The expected type comes from property 'indexMap' which is declared here on type 'CreateIndexMapOptions'
 
src/core/server/saved_objects/migrations/core/index_migrator.test.ts:460:5 - error TS2345: Argument of type 'MockedTransportRequestPromise<ApiResponse<{ completed: true; }, unknown>>' is not assignable to parameter of type 'TransportRequestPromise<ApiResponse<TaskGetResponse, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ completed: true; }, unknown>>' is not assignable to type 'Promise<ApiResponse<TaskGetResponse, unknown>>'.
                  Type 'ApiResponse<{ completed: true; }, unknown>' is not assignable to type 'ApiResponse<TaskGetResponse, unknown>'.
                    Property 'task' is missing in type '{ completed: true; }' but required in type 'TaskGetResponse'.
 
            460     opensearchClientMock.createSuccessTransportRequestPromise({ completed: true })
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
              node_modules/@opensearch-project/opensearch/api/types.d.ts:9440:3
                9440   task: TaskInfo
                       ~~~~
                'task' is declared here.
 
            src/core/server/saved_objects/migrations/core/index_migrator.test.ts:463:5 - error TS2345: Argument of type 'MockedTransportRequestPromise<ApiResponse<{ _scroll_id: number; _shards: { successful: number; total: number; }; hits: { hits: any; }; }, unknown>>' is not assignable to parameter of type 'TransportRequestPromise<ApiResponse<SearchResponse<unknown>, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ _scroll_id: number; _shards: { successful: number; total: number; }; hits: { hits: any; }; }, unknown>>' is not assignable to type 'Promise<ApiResponse<SearchResponse<unknown>, unknown>>'.
                  Type 'ApiResponse<{ _scroll_id: number; _shards: { successful: number; total: number; }; hits: { hits: any; }; }, unknown>' is not assignable to type 'ApiResponse<SearchResponse<unknown>, unknown>'.
                    Type '{ _scroll_id: number; _shards: { successful: number; total: number; }; hits: { hits: any; }; }' is missing the following properties from type 'SearchResponse<unknown>': took, timed_out
 
            463     opensearchClientMock.createSuccessTransportRequestPromise(searchResult(0))
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/migrations/core/index_migrator.test.ts:466:5 - error TS2345: Argument of type 'MockedTransportRequestPromise<ApiResponse<{ items: never[]; }, unknown>>' is not assignable to parameter of type 'TransportRequestPromise<ApiResponse<BulkResponse, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ items: never[]; }, unknown>>' is not assignable to type 'Promise<ApiResponse<BulkResponse, unknown>>'.
                  Type 'ApiResponse<{ items: never[]; }, unknown>' is not assignable to type 'ApiResponse<BulkResponse, unknown>'.
                    Type '{ items: never[]; }' is missing the following properties from type 'BulkResponse': errors, took
 
            466     opensearchClientMock.createSuccessTransportRequestPromise({ items: [] })
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
            src/core/server/saved_objects/migrations/core/index_migrator.test.ts:469:5 - error TS2345: Argument of type 'MockedTransportRequestPromise<ApiResponse<{ count: any; _shards: { successful: number; total: number; }; }, unknown>>' is not assignable to parameter of type 'TransportRequestPromise<ApiResponse<CountResponse, unknown>>'.
              The types returned by 'finally(...)' are incompatible between these types.
                Type 'Promise<ApiResponse<{ count: any; _shards: { successful: number; total: number; }; }, unknown>>' is not assignable to type 'Promise<ApiResponse<CountResponse, unknown>>'.
                  Type 'ApiResponse<{ count: any; _shards: { successful: number; total: number; }; }, unknown>' is not assignable to type 'ApiResponse<CountResponse, unknown>'.
                    Type '{ count: any; _shards: { successful: number; total: number; }; }' is not assignable to type 'CountResponse'.
                      Types of property '_shards' are incompatible.
                        Property 'failed' is missing in type '{ successful: number; total: number; }' but required in type 'ShardStatistics'.
 
            469     opensearchClientMock.createSuccessTransportRequestPromise({
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            470       count: numOutOfDate,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~
            471       _shards: { successful: 1, total: 1 },
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            472     })
                ~~~~~~
 
              node_modules/@opensearch-project/opensearch/api/types.d.ts:2248:3
                2248   failed: uint
                       ~~~~~~
                'failed' is declared here.
 
            src/core/server/saved_objects/migrations/core/index_migrator.test.ts:474:36 - error TS2345: Argument of type '() => MockedTransportRequestPromise<ApiResponse<{}, unknown>>' is not assignable to parameter of type '(params?: ScrollRequest | undefined, options?: TransportRequestOptions | undefined) => TransportRequestPromise<ApiResponse<ScrollResponse<unknown>, unknown>>'.
              Call signature return types 'MockedTransportRequestPromise<ApiResponse<{}, unknown>>' and 'TransportRequestPromise<ApiResponse<ScrollResponse<unknown>, unknown>>' are incompatible.
                The types returned by 'finally(...)' are incompatible between these types.
                  Type 'Promise<ApiResponse<{}, unknown>>' is not assignable to type 'Promise<ApiResponse<ScrollResponse<unknown>, unknown>>'.
                    Type 'ApiResponse<{}, unknown>' is not assignable to type 'ApiResponse<ScrollResponse<unknown>, unknown>'.
                      Type '{}' is missing the following properties from type 'ScrollResponse<unknown>': took, timed_out, _shards, hits
 
            474   client.scroll.mockImplementation(() => {
                                                   ~~~~~~~
 
src/core/server/saved_objects/migrations/core/build_index_map.test.ts:57:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            57           field1: {
                         ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:90:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            90           field1: {
                         ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:124:11 - error TS2322: Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
              Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            124           field1: {
                          ~~~~~~
 
              src/core/server/saved_objects/mappings/types.ts:114:3
                114   [field: string]: SavedObjectsFieldMapping;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                The expected type comes from this index signature.
 
            src/core/server/saved_objects/migrations/core/build_index_map.test.ts:182:7 - error TS2322: Type '{ type1: { properties: { field1: { type: string; }; }; }; type2: { properties: { field1: { type: string; }; }; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinitions'.
              Property 'type1' is incompatible with index signature.
                Type '{ properties: { field1: { type: string; }; }; }' is not assignable to type 'SavedObjectsTypeMappingDefinition'.
                  Types of property 'properties' are incompatible.
                    Type '{ field1: { type: string; }; }' is not assignable to type 'SavedObjectsMappingProperties'.
                      Property 'field1' is incompatible with index signature.
                        Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
                          Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                            Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            182       indexMap,
                      ~~~~~~~~
 
              src/core/server/saved_objects/migrations/core/build_index_map.ts:39:3
                39   indexMap: SavedObjectsTypeMappingDefinitions;
                     ~~~~~~~~
                The expected type comes from property 'indexMap' which is declared here on type 'CreateIndexMapOptions

 
src/core/server/saved_objects/service/lib/filter_utils.test.ts:100:60 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
              Types of property 'properties' are incompatible.
                Type '{ updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }' is not assignable to type 'SavedObjectsMappingProperties'.
                  Property 'updatedAt' is incompatible with index signature.
                    Type '{ type: string; }' is not assignable to type 'SavedObjectsFieldMapping'.
                      Type '{ type: string; }' is not assignable to type 'MappingGenericProperty & { dynamic?: false | "strict" | undefined; }'.
                        Type '{ type: string; }' is missing the following properties from type 'MappingGenericProperty': analyzer, boost, fielddata, ignore_malformed, and 7 more.
 
            100       expect(validateConvertFilterToKueryNode(['foo'], '', mockMappings)).toBeUndefined();
                                                                           ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:107:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            107           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:113:83 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            113         validateConvertFilterToKueryNode(['foo'], 'foo.attributes.title: "best"', mockMappings)
                                                                                                  ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:121:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            121           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:135:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            135           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:149:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            149           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:163:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            163           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:175:11 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            175           mockMappings
                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:184:75 - error TS2345: Argument of type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to parameter of type 'IndexMapping'.
 
            184         validateConvertFilterToKueryNode([], 'hiddentype.title: "title"', mockMappings);
                                                                                          ~~~~~~~~~~~~
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:196:9 - error TS2322: Type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to type 'IndexMapping'.
 
            196         indexMapping: mockMappings,
                        ~~~~~~~~~~~~
 
              src/core/server/saved_objects/service/lib/filter_utils.ts:116:3
                116   indexMapping: IndexMapping;
                      ~~~~~~~~~~~~
                The expected type comes from property 'indexMapping' which is declared here on type 'ValidateFilterKueryNodeParams'
 
            src/core/server/saved_objects/service/lib/filter_utils.test.ts:251:9 - error TS2322: Type '{ properties: { updatedAt: { type: string; }; foo: { properties: { title: { type: string; }; description: { type: string; }; bytes: { type: string; }; }; }; bar: { properties: { foo: { type: string; }; description: { type: string; }; }; }; alert: { ...; }; hiddenType: { ...; }; }; }' is not assignable to type 'IndexMapping'.
 
            251         indexMapping: mockMappings,
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
          at makeError (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:25139:11)
          at handlePromise (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:24074:26)
          at processTicksAndRejections (internal/process/task_queues.js:95:5)
          at async /home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:9040:9
          at async scheduleItem (/home/anan/work/OpenSearch-Dashboards-nodejs/packages/osd-pm/dist/index.js:10927:9)

            src/core/server/saved_objects/service/lib/repository.ts:489:11 - error TS2769: No overload matches this call.
              Overload 1 of 2, '(o: ArrayLike<unknown> | { [s: string]: unknown; }): unknown[]', gave the following error.
                Argument of type 'BulkResponseItemContainer | undefined' is not assignable to parameter of type 'ArrayLike<unknown> | { [s: string]: unknown; }'.
                  Type 'undefined' is not assignable to type 'ArrayLike<unknown> | { [s: string]: unknown; }'.
              Overload 2 of 2, '(o: {}): any[]', gave the following error.
                Argument of type 'BulkResponseItemContainer | undefined' is not assignable to parameter of type '{}'.
                  Type 'undefined' is not assignable to type '{}'.
 


@ananzh ananzh added v2.0.0 nodejs 🍭 issues related to nodejs client labels Feb 7, 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.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Issue Resolved: opensearch-project#1216
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 7, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Issue Resolved: opensearch-project#1216
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 7, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

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 Feb 8, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

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 Feb 8, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

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 Feb 17, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types

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 Feb 23, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Issue Resolved: opensearch-project#1216
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 25, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias

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

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

modify repository

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.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Issue Resolved: opensearch-project#1216
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 Mar 2, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias
remove coreMigrationVersion to avoid bwc issue

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

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

modify repository

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 4, 2022
1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias
remove coreMigrationVersion to avoid bwc issue
modify repository
add param comments

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

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit that referenced this issue Mar 4, 2022
…1223)

1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias
remove coreMigrationVersion to avoid bwc issue
modify repository
add param comments

Issue Resolved: #1216
Partical Resolved: #837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit that referenced this issue Mar 5, 2022
…1223)

1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias
remove coreMigrationVersion to avoid bwc issue
modify repository
add param comments

Issue Resolved: #1216
Partical Resolved: #837

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit that referenced this issue Mar 5, 2022
…1223)

1.import Client from '@opensearch-project/opensearch/api/new' to hook
up the new types
2.add support functions. for example, add a support function for
converting a possibly not existant doc to an existant doc.
3.add @ts-expect-error to expected mismatches
4.fix undefined and mismatched types
5.fix unit tests in src/core/server/saved_objects

Fix comments and modify import types
Remove require_alias
remove coreMigrationVersion to avoid bwc issue
modify repository
add param comments

Issue Resolved: #1216
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
nodejs 🍭 issues related to nodejs client v2.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants