|
| 1 | +/* |
| 2 | + * Copyright OpenSearch Contributors |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * The OpenSearch Contributors require contributions made to |
| 6 | + * this file be licensed under the Apache-2.0 license or a |
| 7 | + * compatible open source license. |
| 8 | + * |
| 9 | + */ |
| 10 | + |
| 11 | +/* |
| 12 | + * This file was generated from the OpenSearch API Spec. Do NOT edit it |
| 13 | + * manually. If you want to make changes, either update the spec or |
| 14 | + * modify the API generator. |
| 15 | + */ |
| 16 | + |
| 17 | +'use strict'; |
| 18 | + |
| 19 | +const { kConfigErr } = require('./utils') |
| 20 | +const kApiModules = Symbol('api modules') |
| 21 | + |
| 22 | +class OpenSearchAPI { |
| 23 | + constructor (opts) { |
| 24 | + this[kConfigErr] = opts.ConfigurationError |
| 25 | + this[kApiModules] = { |
| 26 | + asynchronousSearch: new(require('./asynchronousSearch/_api'))(this), |
| 27 | + cat: new(require('./cat/_api'))(this), |
| 28 | + cluster: new(require('./cluster/_api'))(this), |
| 29 | + danglingIndices: new(require('./danglingIndices/_api'))(this), |
| 30 | + flowFramework: new(require('./flowFramework/_api'))(this), |
| 31 | + http: new(require('./http/_api'))(this), |
| 32 | + indices: new(require('./indices/_api'))(this), |
| 33 | + ingest: new(require('./ingest/_api'))(this), |
| 34 | + ism: new(require('./ism/_api'))(this), |
| 35 | + knn: new(require('./knn/_api'))(this), |
| 36 | + ml: new(require('./ml/_api'))(this), |
| 37 | + nodes: new(require('./nodes/_api'))(this), |
| 38 | + notifications: new(require('./notifications/_api'))(this), |
| 39 | + observability: new(require('./observability/_api'))(this), |
| 40 | + ppl: new(require('./ppl/_api'))(this), |
| 41 | + query: new(require('./query/_api'))(this), |
| 42 | + remoteStore: new(require('./remoteStore/_api'))(this), |
| 43 | + rollups: new(require('./rollups/_api'))(this), |
| 44 | + searchPipeline: new(require('./searchPipeline/_api'))(this), |
| 45 | + security: new(require('./security/_api'))(this), |
| 46 | + snapshot: new(require('./snapshot/_api'))(this), |
| 47 | + sql: new(require('./sql/_api'))(this), |
| 48 | + tasks: new(require('./tasks/_api'))(this), |
| 49 | + transforms: new(require('./transforms/_api'))(this), |
| 50 | + } |
| 51 | + |
| 52 | + // Setup Root API Functions |
| 53 | + /** @namespace API-Core */ |
| 54 | + this.bulk = require('./_core/bulk').bind(this) |
| 55 | + this.clearScroll = require('./_core/clearScroll').bind(this) |
| 56 | + this.count = require('./_core/count').bind(this) |
| 57 | + this.create = require('./_core/create').bind(this) |
| 58 | + this.createPit = require('./_core/createPit').bind(this) |
| 59 | + this.delete = require('./_core/delete').bind(this) |
| 60 | + this.deleteAllPits = require('./_core/deleteAllPits').bind(this) |
| 61 | + this.deleteByQuery = require('./_core/deleteByQuery').bind(this) |
| 62 | + this.deleteByQueryRethrottle = require('./_core/deleteByQueryRethrottle').bind(this) |
| 63 | + this.deletePit = require('./_core/deletePit').bind(this) |
| 64 | + this.deleteScript = require('./_core/deleteScript').bind(this) |
| 65 | + this.exists = require('./_core/exists').bind(this) |
| 66 | + this.existsSource = require('./_core/existsSource').bind(this) |
| 67 | + this.explain = require('./_core/explain').bind(this) |
| 68 | + this.fieldCaps = require('./_core/fieldCaps').bind(this) |
| 69 | + this.get = require('./_core/get').bind(this) |
| 70 | + this.getAllPits = require('./_core/getAllPits').bind(this) |
| 71 | + this.getScript = require('./_core/getScript').bind(this) |
| 72 | + this.getScriptContext = require('./_core/getScriptContext').bind(this) |
| 73 | + this.getScriptLanguages = require('./_core/getScriptLanguages').bind(this) |
| 74 | + this.getSource = require('./_core/getSource').bind(this) |
| 75 | + this.index = require('./_core/index').bind(this) |
| 76 | + this.info = require('./_core/info').bind(this) |
| 77 | + this.mget = require('./_core/mget').bind(this) |
| 78 | + this.msearch = require('./_core/msearch').bind(this) |
| 79 | + this.msearchTemplate = require('./_core/msearchTemplate').bind(this) |
| 80 | + this.mtermvectors = require('./_core/mtermvectors').bind(this) |
| 81 | + this.ping = require('./_core/ping').bind(this) |
| 82 | + this.putScript = require('./_core/putScript').bind(this) |
| 83 | + this.rankEval = require('./_core/rankEval').bind(this) |
| 84 | + this.reindex = require('./_core/reindex').bind(this) |
| 85 | + this.reindexRethrottle = require('./_core/reindexRethrottle').bind(this) |
| 86 | + this.renderSearchTemplate = require('./_core/renderSearchTemplate').bind(this) |
| 87 | + this.scriptsPainlessExecute = require('./_core/scriptsPainlessExecute').bind(this) |
| 88 | + this.scroll = require('./_core/scroll').bind(this) |
| 89 | + this.search = require('./_core/search').bind(this) |
| 90 | + this.searchShards = require('./_core/searchShards').bind(this) |
| 91 | + this.searchTemplate = require('./_core/searchTemplate').bind(this) |
| 92 | + this.termvectors = require('./_core/termvectors').bind(this) |
| 93 | + this.update = require('./_core/update').bind(this) |
| 94 | + this.updateByQuery = require('./_core/updateByQuery').bind(this) |
| 95 | + this.updateByQueryRethrottle = require('./_core/updateByQueryRethrottle').bind(this) |
| 96 | + |
| 97 | + // Deprecated: Use clearScroll instead. |
| 98 | + this.clear_scroll = require('./_core/clearScroll').bind(this) |
| 99 | + // Deprecated: Use createPit instead. |
| 100 | + this.create_pit = require('./_core/createPit').bind(this) |
| 101 | + // Deprecated: Use deleteAllPits instead. |
| 102 | + this.delete_all_pits = require('./_core/deleteAllPits').bind(this) |
| 103 | + // Deprecated: Use deleteByQuery instead. |
| 104 | + this.delete_by_query = require('./_core/deleteByQuery').bind(this) |
| 105 | + // Deprecated: Use deleteByQueryRethrottle instead. |
| 106 | + this.delete_by_query_rethrottle = require('./_core/deleteByQueryRethrottle').bind(this) |
| 107 | + // Deprecated: Use deletePit instead. |
| 108 | + this.delete_pit = require('./_core/deletePit').bind(this) |
| 109 | + // Deprecated: Use deleteScript instead. |
| 110 | + this.delete_script = require('./_core/deleteScript').bind(this) |
| 111 | + // Deprecated: Use existsSource instead. |
| 112 | + this.exists_source = require('./_core/existsSource').bind(this) |
| 113 | + // Deprecated: Use fieldCaps instead. |
| 114 | + this.field_caps = require('./_core/fieldCaps').bind(this) |
| 115 | + // Deprecated: Use getAllPits instead. |
| 116 | + this.get_all_pits = require('./_core/getAllPits').bind(this) |
| 117 | + // Deprecated: Use getScript instead. |
| 118 | + this.get_script = require('./_core/getScript').bind(this) |
| 119 | + // Deprecated: Use getScriptContext instead. |
| 120 | + this.get_script_context = require('./_core/getScriptContext').bind(this) |
| 121 | + // Deprecated: Use getScriptLanguages instead. |
| 122 | + this.get_script_languages = require('./_core/getScriptLanguages').bind(this) |
| 123 | + // Deprecated: Use getSource instead. |
| 124 | + this.get_source = require('./_core/getSource').bind(this) |
| 125 | + // Deprecated: Use msearchTemplate instead. |
| 126 | + this.msearch_template = require('./_core/msearchTemplate').bind(this) |
| 127 | + // Deprecated: Use putScript instead. |
| 128 | + this.put_script = require('./_core/putScript').bind(this) |
| 129 | + // Deprecated: Use rankEval instead. |
| 130 | + this.rank_eval = require('./_core/rankEval').bind(this) |
| 131 | + // Deprecated: Use reindexRethrottle instead. |
| 132 | + this.reindex_rethrottle = require('./_core/reindexRethrottle').bind(this) |
| 133 | + // Deprecated: Use renderSearchTemplate instead. |
| 134 | + this.render_search_template = require('./_core/renderSearchTemplate').bind(this) |
| 135 | + // Deprecated: Use scriptsPainlessExecute instead. |
| 136 | + this.scripts_painless_execute = require('./_core/scriptsPainlessExecute').bind(this) |
| 137 | + // Deprecated: Use searchShards instead. |
| 138 | + this.search_shards = require('./_core/searchShards').bind(this) |
| 139 | + // Deprecated: Use searchTemplate instead. |
| 140 | + this.search_template = require('./_core/searchTemplate').bind(this) |
| 141 | + // Deprecated: Use updateByQuery instead. |
| 142 | + this.update_by_query = require('./_core/updateByQuery').bind(this) |
| 143 | + // Deprecated: Use updateByQueryRethrottle instead. |
| 144 | + this.update_by_query_rethrottle = require('./_core/updateByQueryRethrottle').bind(this) |
| 145 | + |
| 146 | + // Setup API Modules |
| 147 | + Object.defineProperties(this, { |
| 148 | + asynchronousSearch: { get() { return this[kApiModules].asynchronousSearch } }, |
| 149 | + cat: { get() { return this[kApiModules].cat } }, |
| 150 | + cluster: { get() { return this[kApiModules].cluster } }, |
| 151 | + danglingIndices: { get() { return this[kApiModules].danglingIndices } }, |
| 152 | + flowFramework: { get() { return this[kApiModules].flowFramework } }, |
| 153 | + http: { get() { return this[kApiModules].http } }, |
| 154 | + indices: { get() { return this[kApiModules].indices } }, |
| 155 | + ingest: { get() { return this[kApiModules].ingest } }, |
| 156 | + ism: { get() { return this[kApiModules].ism } }, |
| 157 | + knn: { get() { return this[kApiModules].knn } }, |
| 158 | + ml: { get() { return this[kApiModules].ml } }, |
| 159 | + nodes: { get() { return this[kApiModules].nodes } }, |
| 160 | + notifications: { get() { return this[kApiModules].notifications } }, |
| 161 | + observability: { get() { return this[kApiModules].observability } }, |
| 162 | + ppl: { get() { return this[kApiModules].ppl } }, |
| 163 | + query: { get() { return this[kApiModules].query } }, |
| 164 | + remoteStore: { get() { return this[kApiModules].remoteStore } }, |
| 165 | + rollups: { get() { return this[kApiModules].rollups } }, |
| 166 | + searchPipeline: { get() { return this[kApiModules].searchPipeline } }, |
| 167 | + security: { get() { return this[kApiModules].security } }, |
| 168 | + snapshot: { get() { return this[kApiModules].snapshot } }, |
| 169 | + sql: { get() { return this[kApiModules].sql } }, |
| 170 | + tasks: { get() { return this[kApiModules].tasks } }, |
| 171 | + transforms: { get() { return this[kApiModules].transforms } }, |
| 172 | + |
| 173 | + // Deprecated: Use asynchronousSearch instead. |
| 174 | + asynchronous_search: { get() { return this[kApiModules].asynchronousSearch } }, |
| 175 | + // Deprecated: Use danglingIndices instead. |
| 176 | + dangling_indices: { get() { return this[kApiModules].danglingIndices } }, |
| 177 | + // Deprecated: Use flowFramework instead. |
| 178 | + flow_framework: { get() { return this[kApiModules].flowFramework } }, |
| 179 | + // Deprecated: Use remoteStore instead. |
| 180 | + remote_store: { get() { return this[kApiModules].remoteStore } }, |
| 181 | + // Deprecated: Use searchPipeline instead. |
| 182 | + search_pipeline: { get() { return this[kApiModules].searchPipeline } }, |
| 183 | + }) |
| 184 | + } |
| 185 | +} |
| 186 | + |
| 187 | +module.exports = OpenSearchAPI; |
0 commit comments