@opensearch-project/opensearch 2.3.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/index.js CHANGED
@@ -54,6 +54,7 @@ const getScriptApi = require('./api/get_script');
54
54
  const getScriptContextApi = require('./api/get_script_context');
55
55
  const getScriptLanguagesApi = require('./api/get_script_languages');
56
56
  const getSourceApi = require('./api/get_source');
57
+ const HttpApi = require('./api/http');
57
58
  const indexApi = require('./api/index');
58
59
  const IndicesApi = require('./api/indices');
59
60
  const infoApi = require('./api/info');
@@ -71,6 +72,7 @@ const reindexRethrottleApi = require('./api/reindex_rethrottle');
71
72
  const renderSearchTemplateApi = require('./api/render_search_template');
72
73
  const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute');
73
74
  const scrollApi = require('./api/scroll');
75
+ const SecurityApi = require('./api/security');
74
76
  const searchApi = require('./api/search');
75
77
  const searchShardsApi = require('./api/search_shards');
76
78
  const searchTemplateApi = require('./api/search_template');
@@ -88,9 +90,11 @@ const kCat = Symbol('Cat');
88
90
  const kCluster = Symbol('Cluster');
89
91
  const kDanglingIndices = Symbol('DanglingIndices');
90
92
  const kFeatures = Symbol('Features');
93
+ const kHttp = Symbol('Http');
91
94
  const kIndices = Symbol('Indices');
92
95
  const kIngest = Symbol('Ingest');
93
96
  const kNodes = Symbol('Nodes');
97
+ const kSecurity = Symbol('Security');
94
98
  const kShutdown = Symbol('Shutdown');
95
99
  const kSnapshot = Symbol('Snapshot');
96
100
  const kTasks = Symbol('Tasks');
@@ -101,9 +105,11 @@ function OpenSearchAPI(opts) {
101
105
  this[kCluster] = null;
102
106
  this[kDanglingIndices] = null;
103
107
  this[kFeatures] = null;
108
+ this[kHttp] = null;
104
109
  this[kIndices] = null;
105
110
  this[kIngest] = null;
106
111
  this[kNodes] = null;
112
+ this[kSecurity] = null;
107
113
  this[kShutdown] = null;
108
114
  this[kSnapshot] = null;
109
115
  this[kTasks] = null;
@@ -261,6 +267,14 @@ Object.defineProperties(OpenSearchAPI.prototype, {
261
267
  return this.getSource;
262
268
  },
263
269
  },
270
+ http: {
271
+ get() {
272
+ if (this[kHttp] === null) {
273
+ this[kHttp] = new HttpApi(this.transport, this[kConfigurationError]);
274
+ }
275
+ return this[kHttp];
276
+ },
277
+ },
264
278
  indices: {
265
279
  get() {
266
280
  if (this[kIndices] === null) {
@@ -325,6 +339,14 @@ Object.defineProperties(OpenSearchAPI.prototype, {
325
339
  return this.searchTemplate;
326
340
  },
327
341
  },
342
+ security: {
343
+ get() {
344
+ if (this[kSecurity] === null) {
345
+ this[kSecurity] = new SecurityApi(this.transport, this[kConfigurationError]);
346
+ }
347
+ return this[kSecurity];
348
+ },
349
+ },
328
350
  shutdown: {
329
351
  get() {
330
352
  if (this[kShutdown] === null) {