diff --git a/.dockerignore b/.dockerignore
index 54eb2a95a..a7788423d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,5 +1,5 @@
node_modules
npm-debug.log
test/benchmarks
-elasticsearch
+opensearch
.git
diff --git a/.gitignore b/.gitignore
index 6de1b46bc..9e95a838b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,8 +50,8 @@ jspm_packages
package-lock.json
-# elasticsearch repo or binary files
-elasticsearch*
+# opensearch repo or binary files
+opensearch*
test/benchmarks/macro/fixtures/*
diff --git a/.npmignore b/.npmignore
index 9ef569a66..54ae7742a 100644
--- a/.npmignore
+++ b/.npmignore
@@ -47,8 +47,8 @@ jspm_packages
package-lock.json
-# elasticsearch repo or binary files
-elasticsearch*
+# opensearch repo or binary files
+opensearch*
# Generated typings, we don't commit them
# because we should copy them in the main .d.ts file
@@ -72,5 +72,5 @@ CODE_OF_CONDUCT.md
CONTRIBUTING.md
# CANARY-PACKAGE
-api/kibana.d.ts
+api/opensearch_dashboards.d.ts
# /CANARY-PACKAGE
diff --git a/api/index.js b/api/index.js
index 47fa621c4..0df211169 100644
--- a/api/index.js
+++ b/api/index.js
@@ -92,7 +92,7 @@ const kShutdown = Symbol('Shutdown')
const kSnapshot = Symbol('Snapshot')
const kTasks = Symbol('Tasks')
-function ESAPI (opts) {
+function OpenSearchAPI (opts) {
this[kConfigurationError] = opts.ConfigurationError
this[kCat] = null
this[kCluster] = null
@@ -106,47 +106,47 @@ function ESAPI (opts) {
this[kTasks] = null
}
-ESAPI.prototype.bulk = bulkApi
-ESAPI.prototype.clearScroll = clearScrollApi
-ESAPI.prototype.count = countApi
-ESAPI.prototype.create = createApi
-ESAPI.prototype.delete = deleteApi
-ESAPI.prototype.deleteByQuery = deleteByQueryApi
-ESAPI.prototype.deleteByQueryRethrottle = deleteByQueryRethrottleApi
-ESAPI.prototype.deleteScript = deleteScriptApi
-ESAPI.prototype.exists = existsApi
-ESAPI.prototype.existsSource = existsSourceApi
-ESAPI.prototype.explain = explainApi
-ESAPI.prototype.fieldCaps = fieldCapsApi
-ESAPI.prototype.get = getApi
-ESAPI.prototype.getScript = getScriptApi
-ESAPI.prototype.getScriptContext = getScriptContextApi
-ESAPI.prototype.getScriptLanguages = getScriptLanguagesApi
-ESAPI.prototype.getSource = getSourceApi
-ESAPI.prototype.index = indexApi
-ESAPI.prototype.info = infoApi
-ESAPI.prototype.mget = mgetApi
-ESAPI.prototype.msearch = msearchApi
-ESAPI.prototype.msearchTemplate = msearchTemplateApi
-ESAPI.prototype.mtermvectors = mtermvectorsApi
-ESAPI.prototype.ping = pingApi
-ESAPI.prototype.putScript = putScriptApi
-ESAPI.prototype.rankEval = rankEvalApi
-ESAPI.prototype.reindex = reindexApi
-ESAPI.prototype.reindexRethrottle = reindexRethrottleApi
-ESAPI.prototype.renderSearchTemplate = renderSearchTemplateApi
-ESAPI.prototype.scriptsPainlessExecute = scriptsPainlessExecuteApi
-ESAPI.prototype.scroll = scrollApi
-ESAPI.prototype.search = searchApi
-ESAPI.prototype.searchShards = searchShardsApi
-ESAPI.prototype.searchTemplate = searchTemplateApi
-ESAPI.prototype.termsEnum = termsEnumApi
-ESAPI.prototype.termvectors = termvectorsApi
-ESAPI.prototype.update = updateApi
-ESAPI.prototype.updateByQuery = updateByQueryApi
-ESAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi
+OpenSearchAPI.prototype.bulk = bulkApi
+OpenSearchAPI.prototype.clearScroll = clearScrollApi
+OpenSearchAPI.prototype.count = countApi
+OpenSearchAPI.prototype.create = createApi
+OpenSearchAPI.prototype.delete = deleteApi
+OpenSearchAPI.prototype.deleteByQuery = deleteByQueryApi
+OpenSearchAPI.prototype.deleteByQueryRethrottle = deleteByQueryRethrottleApi
+OpenSearchAPI.prototype.deleteScript = deleteScriptApi
+OpenSearchAPI.prototype.exists = existsApi
+OpenSearchAPI.prototype.existsSource = existsSourceApi
+OpenSearchAPI.prototype.explain = explainApi
+OpenSearchAPI.prototype.fieldCaps = fieldCapsApi
+OpenSearchAPI.prototype.get = getApi
+OpenSearchAPI.prototype.getScript = getScriptApi
+OpenSearchAPI.prototype.getScriptContext = getScriptContextApi
+OpenSearchAPI.prototype.getScriptLanguages = getScriptLanguagesApi
+OpenSearchAPI.prototype.getSource = getSourceApi
+OpenSearchAPI.prototype.index = indexApi
+OpenSearchAPI.prototype.info = infoApi
+OpenSearchAPI.prototype.mget = mgetApi
+OpenSearchAPI.prototype.msearch = msearchApi
+OpenSearchAPI.prototype.msearchTemplate = msearchTemplateApi
+OpenSearchAPI.prototype.mtermvectors = mtermvectorsApi
+OpenSearchAPI.prototype.ping = pingApi
+OpenSearchAPI.prototype.putScript = putScriptApi
+OpenSearchAPI.prototype.rankEval = rankEvalApi
+OpenSearchAPI.prototype.reindex = reindexApi
+OpenSearchAPI.prototype.reindexRethrottle = reindexRethrottleApi
+OpenSearchAPI.prototype.renderSearchTemplate = renderSearchTemplateApi
+OpenSearchAPI.prototype.scriptsPainlessExecute = scriptsPainlessExecuteApi
+OpenSearchAPI.prototype.scroll = scrollApi
+OpenSearchAPI.prototype.search = searchApi
+OpenSearchAPI.prototype.searchShards = searchShardsApi
+OpenSearchAPI.prototype.searchTemplate = searchTemplateApi
+OpenSearchAPI.prototype.termsEnum = termsEnumApi
+OpenSearchAPI.prototype.termvectors = termvectorsApi
+OpenSearchAPI.prototype.update = updateApi
+OpenSearchAPI.prototype.updateByQuery = updateByQueryApi
+OpenSearchAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi
-Object.defineProperties(ESAPI.prototype, {
+Object.defineProperties(OpenSearchAPI.prototype, {
cat: {
get () {
if (this[kCat] === null) {
@@ -251,4 +251,4 @@ Object.defineProperties(ESAPI.prototype, {
update_by_query_rethrottle: { get () { return this.updateByQueryRethrottle } }
})
-module.exports = ESAPI
+module.exports = OpenSearchAPI
diff --git a/api/kibana.d.ts b/api/kibana.d.ts
deleted file mode 100644
index 6e5877203..000000000
--- a/api/kibana.d.ts
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- *
- * The OpenSearch Contributors require contributions made to
- * this file be licensed under the Apache-2.0 license or a
- * compatible open source license.
- *
- * Modifications Copyright OpenSearch Contributors. See
- * GitHub history for details.
- */
-
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-///
-
-import {
- ClientOptions,
- ConnectionPool,
- Serializer,
- Transport,
- errors,
- RequestEvent,
- ResurrectEvent,
- ApiError
-} from '../index'
-import Helpers from '../lib/Helpers'
-import {
- ApiResponse,
- TransportRequestPromise,
- TransportRequestParams,
- TransportRequestOptions
-} from '../lib/Transport'
-import * as T from './types'
-
-/**
- * We are still working on this type, it will arrive soon.
- * If it's critical for you, please open an issue.
- * https://github.com/opensearch-project/opensearch-js
- */
-type TODO = Record
-
-// Extend API
-interface ClientExtendsCallbackOptions {
- ConfigurationError: errors.ConfigurationError,
- makeRequest(params: TransportRequestParams, options?: TransportRequestOptions): Promise | void;
- result: {
- body: null,
- statusCode: null,
- headers: null,
- warnings: null
- }
-}
-declare type extendsCallback = (options: ClientExtendsCallbackOptions) => any;
-// /Extend API
-
-interface KibanaClient {
- connectionPool: ConnectionPool
- transport: Transport
- serializer: Serializer
- extend(method: string, fn: extendsCallback): void
- extend(method: string, opts: { force: boolean }, fn: extendsCallback): void;
- helpers: Helpers
- child(opts?: ClientOptions): KibanaClient
- close(): Promise;
- emit(event: string | symbol, ...args: any[]): boolean;
- on(event: 'request', listener: (err: ApiError, meta: RequestEvent) => void): this;
- on(event: 'response', listener: (err: ApiError, meta: RequestEvent) => void): this;
- on(event: 'sniff', listener: (err: ApiError, meta: RequestEvent) => void): this;
- on(event: 'resurrect', listener: (err: null, meta: ResurrectEvent) => void): this;
- once(event: 'request', listener: (err: ApiError, meta: RequestEvent) => void): this;
- once(event: 'response', listener: (err: ApiError, meta: RequestEvent) => void): this;
- once(event: 'sniff', listener: (err: ApiError, meta: RequestEvent) => void): this;
- once(event: 'resurrect', listener: (err: null, meta: ResurrectEvent) => void): this;
- off(event: string | symbol, listener: (...args: any[]) => void): this;
- bulk(params: T.BulkRequest, options?: TransportRequestOptions): TransportRequestPromise>
- cat: {
- aliases(params?: T.CatAliasesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- allocation(params?: T.CatAllocationRequest, options?: TransportRequestOptions): TransportRequestPromise>
- count(params?: T.CatCountRequest, options?: TransportRequestOptions): TransportRequestPromise>
- fielddata(params?: T.CatFielddataRequest, options?: TransportRequestOptions): TransportRequestPromise>
- health(params?: T.CatHealthRequest, options?: TransportRequestOptions): TransportRequestPromise>
- help(params?: T.CatHelpRequest, options?: TransportRequestOptions): TransportRequestPromise>
- indices(params?: T.CatIndicesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- master(params?: T.CatMasterRequest, options?: TransportRequestOptions): TransportRequestPromise>
- nodeattrs(params?: T.CatNodeAttributesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- nodes(params?: T.CatNodesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- pendingTasks(params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise>
- plugins(params?: T.CatPluginsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- recovery(params?: T.CatRecoveryRequest, options?: TransportRequestOptions): TransportRequestPromise>
- repositories(params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- segments(params?: T.CatSegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- shards(params?: T.CatShardsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- snapshots(params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- tasks(params?: T.CatTasksRequest, options?: TransportRequestOptions): TransportRequestPromise>
- templates(params?: T.CatTemplatesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- threadPool(params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): TransportRequestPromise>
- }
- clearScroll(params?: T.ClearScrollRequest, options?: TransportRequestOptions): TransportRequestPromise>
- cluster: {
- allocationExplain(params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteComponentTemplate(params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteVotingConfigExclusions(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- existsComponentTemplate(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- getComponentTemplate(params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getSettings(params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- health(params?: T.ClusterHealthRequest, options?: TransportRequestOptions): TransportRequestPromise>
- pendingTasks(params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise>
- postVotingConfigExclusions(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- putComponentTemplate(params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putSettings(params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- remoteInfo(params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): TransportRequestPromise>
- reroute(params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): TransportRequestPromise>
- state(params?: T.ClusterStateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- stats(params?: T.ClusterStatsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- }
- count(params?: T.CountRequest, options?: TransportRequestOptions): TransportRequestPromise>
- create(params: T.CreateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- danglingIndices: {
- deleteDanglingIndex(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- importDanglingIndex(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- listDanglingIndices(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- }
- delete(params: T.DeleteRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteByQuery(params: T.DeleteByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteByQueryRethrottle(params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteScript(params: T.DeleteScriptRequest, options?: TransportRequestOptions): TransportRequestPromise>
- exists(params: T.ExistsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- existsSource(params: T.ExistsSourceRequest, options?: TransportRequestOptions): TransportRequestPromise>
- explain(params: T.ExplainRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- features: {
- getFeatures(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- resetFeatures(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- }
- fieldCaps(params?: T.FieldCapsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- get(params: T.GetRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- getScript(params: T.GetScriptRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getScriptContext(params?: T.GetScriptContextRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getScriptLanguages(params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getSource(params?: T.GetSourceRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- index(params: T.IndexRequest, options?: TransportRequestOptions): TransportRequestPromise>
- indices: {
- addBlock(params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): TransportRequestPromise>
- analyze(params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptions): TransportRequestPromise>
- clearCache(params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise>
- clone(params: T.IndicesCloneRequest, options?: TransportRequestOptions): TransportRequestPromise>
- close(params: T.IndicesCloseRequest, options?: TransportRequestOptions): TransportRequestPromise>
- create(params: T.IndicesCreateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- delete(params: T.IndicesDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteAlias(params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteIndexTemplate(params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- deleteTemplate(params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- diskUsage(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- exists(params: T.IndicesExistsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- existsAlias(params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): TransportRequestPromise>
- existsIndexTemplate(params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- existsTemplate(params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- existsType(params: T.IndicesExistsTypeRequest, options?: TransportRequestOptions): TransportRequestPromise>
- fieldUsageStats(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- flush(params?: T.IndicesFlushRequest, options?: TransportRequestOptions): TransportRequestPromise>
- flushSynced(params?: T.IndicesFlushSyncedRequest, options?: TransportRequestOptions): TransportRequestPromise>
- forcemerge(params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): TransportRequestPromise>
- get(params: T.IndicesGetRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getAlias(params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getFieldMapping(params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getIndexTemplate(params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getMapping(params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getSettings(params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getTemplate(params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getUpgrade(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- open(params: T.IndicesOpenRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putAlias(params: T.IndicesPutAliasRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putIndexTemplate(params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putMapping(params?: T.IndicesPutMappingRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putSettings(params?: T.IndicesPutSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putTemplate(params: T.IndicesPutTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- recovery(params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): TransportRequestPromise>
- refresh(params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): TransportRequestPromise>
- resolveIndex(params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): TransportRequestPromise>
- rollover(params: T.IndicesRolloverRequest, options?: TransportRequestOptions): TransportRequestPromise>
- segments(params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- shardStores(params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): TransportRequestPromise>
- shrink(params: T.IndicesShrinkRequest, options?: TransportRequestOptions): TransportRequestPromise>
- simulateIndexTemplate(params?: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise>
- simulateTemplate(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- split(params: T.IndicesSplitRequest, options?: TransportRequestOptions): TransportRequestPromise>
- stats(params?: T.IndicesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- updateAliases(params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): TransportRequestPromise>
- upgrade(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- validateQuery(params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptions): TransportRequestPromise>
- }
- info(params?: T.InfoRequest, options?: TransportRequestOptions): TransportRequestPromise>
- ingest: {
- deletePipeline(params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise>
- geoIpStats(params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- getPipeline(params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise>
- processorGrok(params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): TransportRequestPromise>
- putPipeline(params: T.IngestPutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise>
- simulate(params?: T.IngestSimulatePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise>
- }
- mget(params?: T.MgetRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- msearch(params?: T.MsearchRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- msearchTemplate(params?: T.MsearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>>
- mtermvectors(params?: T.MtermvectorsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- nodes: {
- clearMeteringArchive(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- getMeteringInfo(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise>
- hotThreads(params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- info(params?: T.NodesInfoRequest, options?: TransportRequestOptions): TransportRequestPromise>
- reloadSecureSettings(params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- stats(params?: T.NodesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise>
- usage(params?: T.NodesUsageRequest, options?: TransportRequestOptions): TransportRequestPromise>
- }
- ping