@opensearch-project/opensearch 2.3.0 → 2.4.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
@@ -71,6 +71,7 @@ const reindexRethrottleApi = require('./api/reindex_rethrottle');
71
71
  const renderSearchTemplateApi = require('./api/render_search_template');
72
72
  const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute');
73
73
  const scrollApi = require('./api/scroll');
74
+ const SecurityApi = require('./api/security');
74
75
  const searchApi = require('./api/search');
75
76
  const searchShardsApi = require('./api/search_shards');
76
77
  const searchTemplateApi = require('./api/search_template');
@@ -91,6 +92,7 @@ const kFeatures = Symbol('Features');
91
92
  const kIndices = Symbol('Indices');
92
93
  const kIngest = Symbol('Ingest');
93
94
  const kNodes = Symbol('Nodes');
95
+ const kSecurity = Symbol('Security');
94
96
  const kShutdown = Symbol('Shutdown');
95
97
  const kSnapshot = Symbol('Snapshot');
96
98
  const kTasks = Symbol('Tasks');
@@ -104,6 +106,7 @@ function OpenSearchAPI(opts) {
104
106
  this[kIndices] = null;
105
107
  this[kIngest] = null;
106
108
  this[kNodes] = null;
109
+ this[kSecurity] = null;
107
110
  this[kShutdown] = null;
108
111
  this[kSnapshot] = null;
109
112
  this[kTasks] = null;
@@ -325,6 +328,14 @@ Object.defineProperties(OpenSearchAPI.prototype, {
325
328
  return this.searchTemplate;
326
329
  },
327
330
  },
331
+ security: {
332
+ get() {
333
+ if (this[kSecurity] === null) {
334
+ this[kSecurity] = new SecurityApi(this.transport, this[kConfigurationError]);
335
+ }
336
+ return this[kSecurity];
337
+ },
338
+ },
328
339
  shutdown: {
329
340
  get() {
330
341
  if (this[kShutdown] === null) {