@opensearch-project/opensearch 3.0.0-beta.5 → 3.0.0-beta.6

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/CHANGELOG.md CHANGED
@@ -22,11 +22,15 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
22
22
  ### Added
23
23
  ### Dependencies
24
24
  - Bumps `@babel/eslint-parser` from 7.24.8 to 7.25.1
25
- - Bumps `@types/node` from 20.14.11 to 22.0.0
25
+ - Bumps `@types/node` from 20.14.11 to 22.5.0
26
+ - Bumps `aws4` from 1.13.0 to 1.13.1
27
+ - Bumps `ora` from 8.0.1 to 8.1.0
28
+ - Bumps `simple-statistics` from 7.8.3 to 7.8.4
26
29
  ### Changed
27
30
  ### Deprecated
28
31
  ### Removed
29
32
  ### Fixed
33
+ - Fixed docker-compose command in Makefile ([#845](https://github.com/opensearch-project/opensearch-js/issues/845))
30
34
  ### Security
31
35
 
32
36
  ## [2.11.0]
package/api/cat/_api.js CHANGED
@@ -15,36 +15,34 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Cat */
21
19
 
22
20
  function CatApi(bindObj) {
23
21
  const cache = {};
24
- this.aliases = apiFunc(bindObj, cache, './cat/aliases');
25
- this.allocation = apiFunc(bindObj, cache, './cat/allocation');
26
- this.allPitSegments = apiFunc(bindObj, cache, './cat/allPitSegments');
27
- this.clusterManager = apiFunc(bindObj, cache, './cat/clusterManager');
28
- this.count = apiFunc(bindObj, cache, './cat/count');
29
- this.fielddata = apiFunc(bindObj, cache, './cat/fielddata');
30
- this.health = apiFunc(bindObj, cache, './cat/health');
31
- this.help = apiFunc(bindObj, cache, './cat/help');
32
- this.indices = apiFunc(bindObj, cache, './cat/indices');
33
- this.master = apiFunc(bindObj, cache, './cat/master');
34
- this.nodeattrs = apiFunc(bindObj, cache, './cat/nodeattrs');
35
- this.nodes = apiFunc(bindObj, cache, './cat/nodes');
36
- this.pendingTasks = apiFunc(bindObj, cache, './cat/pendingTasks');
37
- this.pitSegments = apiFunc(bindObj, cache, './cat/pitSegments');
38
- this.plugins = apiFunc(bindObj, cache, './cat/plugins');
39
- this.recovery = apiFunc(bindObj, cache, './cat/recovery');
40
- this.repositories = apiFunc(bindObj, cache, './cat/repositories');
41
- this.segmentReplication = apiFunc(bindObj, cache, './cat/segmentReplication');
42
- this.segments = apiFunc(bindObj, cache, './cat/segments');
43
- this.shards = apiFunc(bindObj, cache, './cat/shards');
44
- this.snapshots = apiFunc(bindObj, cache, './cat/snapshots');
45
- this.tasks = apiFunc(bindObj, cache, './cat/tasks');
46
- this.templates = apiFunc(bindObj, cache, './cat/templates');
47
- this.threadPool = apiFunc(bindObj, cache, './cat/threadPool');
22
+ this.aliases = require('./aliases').bind(bindObj);
23
+ this.allocation = require('./allocation').bind(bindObj);
24
+ this.allPitSegments = require('./allPitSegments').bind(bindObj);
25
+ this.clusterManager = require('./clusterManager').bind(bindObj);
26
+ this.count = require('./count').bind(bindObj);
27
+ this.fielddata = require('./fielddata').bind(bindObj);
28
+ this.health = require('./health').bind(bindObj);
29
+ this.help = require('./help').bind(bindObj);
30
+ this.indices = require('./indices').bind(bindObj);
31
+ this.master = require('./master').bind(bindObj);
32
+ this.nodeattrs = require('./nodeattrs').bind(bindObj);
33
+ this.nodes = require('./nodes').bind(bindObj);
34
+ this.pendingTasks = require('./pendingTasks').bind(bindObj);
35
+ this.pitSegments = require('./pitSegments').bind(bindObj);
36
+ this.plugins = require('./plugins').bind(bindObj);
37
+ this.recovery = require('./recovery').bind(bindObj);
38
+ this.repositories = require('./repositories').bind(bindObj);
39
+ this.segmentReplication = require('./segmentReplication').bind(bindObj);
40
+ this.segments = require('./segments').bind(bindObj);
41
+ this.shards = require('./shards').bind(bindObj);
42
+ this.snapshots = require('./snapshots').bind(bindObj);
43
+ this.tasks = require('./tasks').bind(bindObj);
44
+ this.templates = require('./templates').bind(bindObj);
45
+ this.threadPool = require('./threadPool').bind(bindObj);
48
46
  }
49
47
 
50
48
  module.exports = CatApi;
@@ -15,33 +15,31 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Cluster */
21
19
 
22
20
  function ClusterApi(bindObj) {
23
21
  const cache = {};
24
- this.allocationExplain = apiFunc(bindObj, cache, './cluster/allocationExplain');
25
- this.deleteComponentTemplate = apiFunc(bindObj, cache, './cluster/deleteComponentTemplate');
26
- this.deleteDecommissionAwareness = apiFunc(bindObj, cache, './cluster/deleteDecommissionAwareness');
27
- this.deleteVotingConfigExclusions = apiFunc(bindObj, cache, './cluster/deleteVotingConfigExclusions');
28
- this.deleteWeightedRouting = apiFunc(bindObj, cache, './cluster/deleteWeightedRouting');
29
- this.existsComponentTemplate = apiFunc(bindObj, cache, './cluster/existsComponentTemplate');
30
- this.getComponentTemplate = apiFunc(bindObj, cache, './cluster/getComponentTemplate');
31
- this.getDecommissionAwareness = apiFunc(bindObj, cache, './cluster/getDecommissionAwareness');
32
- this.getSettings = apiFunc(bindObj, cache, './cluster/getSettings');
33
- this.getWeightedRouting = apiFunc(bindObj, cache, './cluster/getWeightedRouting');
34
- this.health = apiFunc(bindObj, cache, './cluster/health');
35
- this.pendingTasks = apiFunc(bindObj, cache, './cluster/pendingTasks');
36
- this.postVotingConfigExclusions = apiFunc(bindObj, cache, './cluster/postVotingConfigExclusions');
37
- this.putComponentTemplate = apiFunc(bindObj, cache, './cluster/putComponentTemplate');
38
- this.putDecommissionAwareness = apiFunc(bindObj, cache, './cluster/putDecommissionAwareness');
39
- this.putSettings = apiFunc(bindObj, cache, './cluster/putSettings');
40
- this.putWeightedRouting = apiFunc(bindObj, cache, './cluster/putWeightedRouting');
41
- this.remoteInfo = apiFunc(bindObj, cache, './cluster/remoteInfo');
42
- this.reroute = apiFunc(bindObj, cache, './cluster/reroute');
43
- this.state = apiFunc(bindObj, cache, './cluster/state');
44
- this.stats = apiFunc(bindObj, cache, './cluster/stats');
22
+ this.allocationExplain = require('./allocationExplain').bind(bindObj);
23
+ this.deleteComponentTemplate = require('./deleteComponentTemplate').bind(bindObj);
24
+ this.deleteDecommissionAwareness = require('./deleteDecommissionAwareness').bind(bindObj);
25
+ this.deleteVotingConfigExclusions = require('./deleteVotingConfigExclusions').bind(bindObj);
26
+ this.deleteWeightedRouting = require('./deleteWeightedRouting').bind(bindObj);
27
+ this.existsComponentTemplate = require('./existsComponentTemplate').bind(bindObj);
28
+ this.getComponentTemplate = require('./getComponentTemplate').bind(bindObj);
29
+ this.getDecommissionAwareness = require('./getDecommissionAwareness').bind(bindObj);
30
+ this.getSettings = require('./getSettings').bind(bindObj);
31
+ this.getWeightedRouting = require('./getWeightedRouting').bind(bindObj);
32
+ this.health = require('./health').bind(bindObj);
33
+ this.pendingTasks = require('./pendingTasks').bind(bindObj);
34
+ this.postVotingConfigExclusions = require('./postVotingConfigExclusions').bind(bindObj);
35
+ this.putComponentTemplate = require('./putComponentTemplate').bind(bindObj);
36
+ this.putDecommissionAwareness = require('./putDecommissionAwareness').bind(bindObj);
37
+ this.putSettings = require('./putSettings').bind(bindObj);
38
+ this.putWeightedRouting = require('./putWeightedRouting').bind(bindObj);
39
+ this.remoteInfo = require('./remoteInfo').bind(bindObj);
40
+ this.reroute = require('./reroute').bind(bindObj);
41
+ this.state = require('./state').bind(bindObj);
42
+ this.stats = require('./stats').bind(bindObj);
45
43
  }
46
44
 
47
45
  module.exports = ClusterApi;
@@ -15,15 +15,13 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Dangling-Indices */
21
19
 
22
20
  function DanglingindicesApi(bindObj) {
23
21
  const cache = {};
24
- this.deleteDanglingIndex = apiFunc(bindObj, cache, './danglingIndices/deleteDanglingIndex');
25
- this.importDanglingIndex = apiFunc(bindObj, cache, './danglingIndices/importDanglingIndex');
26
- this.listDanglingIndices = apiFunc(bindObj, cache, './danglingIndices/listDanglingIndices');
22
+ this.deleteDanglingIndex = require('./deleteDanglingIndex').bind(bindObj);
23
+ this.importDanglingIndex = require('./importDanglingIndex').bind(bindObj);
24
+ this.listDanglingIndices = require('./listDanglingIndices').bind(bindObj);
27
25
  }
28
26
 
29
27
  module.exports = DanglingindicesApi;
package/api/http/_api.js CHANGED
@@ -15,21 +15,19 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Http */
21
19
 
22
20
  function HttpApi(bindObj) {
23
21
  const cache = {};
24
- this.connect = apiFunc(bindObj, cache, './http/connect');
25
- this.delete = apiFunc(bindObj, cache, './http/delete');
26
- this.get = apiFunc(bindObj, cache, './http/get');
27
- this.head = apiFunc(bindObj, cache, './http/head');
28
- this.options = apiFunc(bindObj, cache, './http/options');
29
- this.patch = apiFunc(bindObj, cache, './http/patch');
30
- this.post = apiFunc(bindObj, cache, './http/post');
31
- this.put = apiFunc(bindObj, cache, './http/put');
32
- this.trace = apiFunc(bindObj, cache, './http/trace');
22
+ this.connect = require('./connect').bind(bindObj);
23
+ this.delete = require('./delete').bind(bindObj);
24
+ this.get = require('./get').bind(bindObj);
25
+ this.head = require('./head').bind(bindObj);
26
+ this.options = require('./options').bind(bindObj);
27
+ this.patch = require('./patch').bind(bindObj);
28
+ this.post = require('./post').bind(bindObj);
29
+ this.put = require('./put').bind(bindObj);
30
+ this.trace = require('./trace').bind(bindObj);
33
31
  }
34
32
 
35
33
  module.exports = HttpApi;
@@ -15,60 +15,58 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Indices */
21
19
 
22
20
  function IndicesApi(bindObj) {
23
21
  const cache = {};
24
- this.addBlock = apiFunc(bindObj, cache, './indices/addBlock');
25
- this.analyze = apiFunc(bindObj, cache, './indices/analyze');
26
- this.clearCache = apiFunc(bindObj, cache, './indices/clearCache');
27
- this.clone = apiFunc(bindObj, cache, './indices/clone');
28
- this.close = apiFunc(bindObj, cache, './indices/close');
29
- this.create = apiFunc(bindObj, cache, './indices/create');
30
- this.createDataStream = apiFunc(bindObj, cache, './indices/createDataStream');
31
- this.dataStreamsStats = apiFunc(bindObj, cache, './indices/dataStreamsStats');
32
- this.delete = apiFunc(bindObj, cache, './indices/delete');
33
- this.deleteAlias = apiFunc(bindObj, cache, './indices/deleteAlias');
34
- this.deleteDataStream = apiFunc(bindObj, cache, './indices/deleteDataStream');
35
- this.deleteIndexTemplate = apiFunc(bindObj, cache, './indices/deleteIndexTemplate');
36
- this.deleteTemplate = apiFunc(bindObj, cache, './indices/deleteTemplate');
37
- this.exists = apiFunc(bindObj, cache, './indices/exists');
38
- this.existsAlias = apiFunc(bindObj, cache, './indices/existsAlias');
39
- this.existsIndexTemplate = apiFunc(bindObj, cache, './indices/existsIndexTemplate');
40
- this.existsTemplate = apiFunc(bindObj, cache, './indices/existsTemplate');
41
- this.flush = apiFunc(bindObj, cache, './indices/flush');
42
- this.forcemerge = apiFunc(bindObj, cache, './indices/forcemerge');
43
- this.get = apiFunc(bindObj, cache, './indices/get');
44
- this.getAlias = apiFunc(bindObj, cache, './indices/getAlias');
45
- this.getDataStream = apiFunc(bindObj, cache, './indices/getDataStream');
46
- this.getFieldMapping = apiFunc(bindObj, cache, './indices/getFieldMapping');
47
- this.getIndexTemplate = apiFunc(bindObj, cache, './indices/getIndexTemplate');
48
- this.getMapping = apiFunc(bindObj, cache, './indices/getMapping');
49
- this.getSettings = apiFunc(bindObj, cache, './indices/getSettings');
50
- this.getTemplate = apiFunc(bindObj, cache, './indices/getTemplate');
51
- this.getUpgrade = apiFunc(bindObj, cache, './indices/getUpgrade');
52
- this.open = apiFunc(bindObj, cache, './indices/open');
53
- this.putAlias = apiFunc(bindObj, cache, './indices/putAlias');
54
- this.putIndexTemplate = apiFunc(bindObj, cache, './indices/putIndexTemplate');
55
- this.putMapping = apiFunc(bindObj, cache, './indices/putMapping');
56
- this.putSettings = apiFunc(bindObj, cache, './indices/putSettings');
57
- this.putTemplate = apiFunc(bindObj, cache, './indices/putTemplate');
58
- this.recovery = apiFunc(bindObj, cache, './indices/recovery');
59
- this.refresh = apiFunc(bindObj, cache, './indices/refresh');
60
- this.resolveIndex = apiFunc(bindObj, cache, './indices/resolveIndex');
61
- this.rollover = apiFunc(bindObj, cache, './indices/rollover');
62
- this.segments = apiFunc(bindObj, cache, './indices/segments');
63
- this.shardStores = apiFunc(bindObj, cache, './indices/shardStores');
64
- this.shrink = apiFunc(bindObj, cache, './indices/shrink');
65
- this.simulateIndexTemplate = apiFunc(bindObj, cache, './indices/simulateIndexTemplate');
66
- this.simulateTemplate = apiFunc(bindObj, cache, './indices/simulateTemplate');
67
- this.split = apiFunc(bindObj, cache, './indices/split');
68
- this.stats = apiFunc(bindObj, cache, './indices/stats');
69
- this.updateAliases = apiFunc(bindObj, cache, './indices/updateAliases');
70
- this.upgrade = apiFunc(bindObj, cache, './indices/upgrade');
71
- this.validateQuery = apiFunc(bindObj, cache, './indices/validateQuery');
22
+ this.addBlock = require('./addBlock').bind(bindObj);
23
+ this.analyze = require('./analyze').bind(bindObj);
24
+ this.clearCache = require('./clearCache').bind(bindObj);
25
+ this.clone = require('./clone').bind(bindObj);
26
+ this.close = require('./close').bind(bindObj);
27
+ this.create = require('./create').bind(bindObj);
28
+ this.createDataStream = require('./createDataStream').bind(bindObj);
29
+ this.dataStreamsStats = require('./dataStreamsStats').bind(bindObj);
30
+ this.delete = require('./delete').bind(bindObj);
31
+ this.deleteAlias = require('./deleteAlias').bind(bindObj);
32
+ this.deleteDataStream = require('./deleteDataStream').bind(bindObj);
33
+ this.deleteIndexTemplate = require('./deleteIndexTemplate').bind(bindObj);
34
+ this.deleteTemplate = require('./deleteTemplate').bind(bindObj);
35
+ this.exists = require('./exists').bind(bindObj);
36
+ this.existsAlias = require('./existsAlias').bind(bindObj);
37
+ this.existsIndexTemplate = require('./existsIndexTemplate').bind(bindObj);
38
+ this.existsTemplate = require('./existsTemplate').bind(bindObj);
39
+ this.flush = require('./flush').bind(bindObj);
40
+ this.forcemerge = require('./forcemerge').bind(bindObj);
41
+ this.get = require('./get').bind(bindObj);
42
+ this.getAlias = require('./getAlias').bind(bindObj);
43
+ this.getDataStream = require('./getDataStream').bind(bindObj);
44
+ this.getFieldMapping = require('./getFieldMapping').bind(bindObj);
45
+ this.getIndexTemplate = require('./getIndexTemplate').bind(bindObj);
46
+ this.getMapping = require('./getMapping').bind(bindObj);
47
+ this.getSettings = require('./getSettings').bind(bindObj);
48
+ this.getTemplate = require('./getTemplate').bind(bindObj);
49
+ this.getUpgrade = require('./getUpgrade').bind(bindObj);
50
+ this.open = require('./open').bind(bindObj);
51
+ this.putAlias = require('./putAlias').bind(bindObj);
52
+ this.putIndexTemplate = require('./putIndexTemplate').bind(bindObj);
53
+ this.putMapping = require('./putMapping').bind(bindObj);
54
+ this.putSettings = require('./putSettings').bind(bindObj);
55
+ this.putTemplate = require('./putTemplate').bind(bindObj);
56
+ this.recovery = require('./recovery').bind(bindObj);
57
+ this.refresh = require('./refresh').bind(bindObj);
58
+ this.resolveIndex = require('./resolveIndex').bind(bindObj);
59
+ this.rollover = require('./rollover').bind(bindObj);
60
+ this.segments = require('./segments').bind(bindObj);
61
+ this.shardStores = require('./shardStores').bind(bindObj);
62
+ this.shrink = require('./shrink').bind(bindObj);
63
+ this.simulateIndexTemplate = require('./simulateIndexTemplate').bind(bindObj);
64
+ this.simulateTemplate = require('./simulateTemplate').bind(bindObj);
65
+ this.split = require('./split').bind(bindObj);
66
+ this.stats = require('./stats').bind(bindObj);
67
+ this.updateAliases = require('./updateAliases').bind(bindObj);
68
+ this.upgrade = require('./upgrade').bind(bindObj);
69
+ this.validateQuery = require('./validateQuery').bind(bindObj);
72
70
  }
73
71
 
74
72
  module.exports = IndicesApi;
@@ -15,17 +15,15 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Ingest */
21
19
 
22
20
  function IngestApi(bindObj) {
23
21
  const cache = {};
24
- this.deletePipeline = apiFunc(bindObj, cache, './ingest/deletePipeline');
25
- this.getPipeline = apiFunc(bindObj, cache, './ingest/getPipeline');
26
- this.processorGrok = apiFunc(bindObj, cache, './ingest/processorGrok');
27
- this.putPipeline = apiFunc(bindObj, cache, './ingest/putPipeline');
28
- this.simulate = apiFunc(bindObj, cache, './ingest/simulate');
22
+ this.deletePipeline = require('./deletePipeline').bind(bindObj);
23
+ this.getPipeline = require('./getPipeline').bind(bindObj);
24
+ this.processorGrok = require('./processorGrok').bind(bindObj);
25
+ this.putPipeline = require('./putPipeline').bind(bindObj);
26
+ this.simulate = require('./simulate').bind(bindObj);
29
27
  }
30
28
 
31
29
  module.exports = IngestApi;
package/api/knn/_api.js CHANGED
@@ -15,18 +15,16 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Knn */
21
19
 
22
20
  function KnnApi(bindObj) {
23
21
  const cache = {};
24
- this.deleteModel = apiFunc(bindObj, cache, './knn/deleteModel');
25
- this.getModel = apiFunc(bindObj, cache, './knn/getModel');
26
- this.searchModels = apiFunc(bindObj, cache, './knn/searchModels');
27
- this.stats = apiFunc(bindObj, cache, './knn/stats');
28
- this.trainModel = apiFunc(bindObj, cache, './knn/trainModel');
29
- this.warmup = apiFunc(bindObj, cache, './knn/warmup');
22
+ this.deleteModel = require('./deleteModel').bind(bindObj);
23
+ this.getModel = require('./getModel').bind(bindObj);
24
+ this.searchModels = require('./searchModels').bind(bindObj);
25
+ this.stats = require('./stats').bind(bindObj);
26
+ this.trainModel = require('./trainModel').bind(bindObj);
27
+ this.warmup = require('./warmup').bind(bindObj);
30
28
  }
31
29
 
32
30
  module.exports = KnnApi;
package/api/ml/_api.js CHANGED
@@ -15,19 +15,17 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Ml */
21
19
 
22
20
  function MlApi(bindObj) {
23
21
  const cache = {};
24
- this.deleteModel = apiFunc(bindObj, cache, './ml/deleteModel');
25
- this.deleteModelGroup = apiFunc(bindObj, cache, './ml/deleteModelGroup');
26
- this.getModelGroup = apiFunc(bindObj, cache, './ml/getModelGroup');
27
- this.getTask = apiFunc(bindObj, cache, './ml/getTask');
28
- this.registerModel = apiFunc(bindObj, cache, './ml/registerModel');
29
- this.registerModelGroup = apiFunc(bindObj, cache, './ml/registerModelGroup');
30
- this.searchModels = apiFunc(bindObj, cache, './ml/searchModels');
22
+ this.deleteModel = require('./deleteModel').bind(bindObj);
23
+ this.deleteModelGroup = require('./deleteModelGroup').bind(bindObj);
24
+ this.getModelGroup = require('./getModelGroup').bind(bindObj);
25
+ this.getTask = require('./getTask').bind(bindObj);
26
+ this.registerModel = require('./registerModel').bind(bindObj);
27
+ this.registerModelGroup = require('./registerModelGroup').bind(bindObj);
28
+ this.searchModels = require('./searchModels').bind(bindObj);
31
29
  }
32
30
 
33
31
  module.exports = MlApi;
package/api/nodes/_api.js CHANGED
@@ -15,17 +15,15 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Nodes */
21
19
 
22
20
  function NodesApi(bindObj) {
23
21
  const cache = {};
24
- this.hotThreads = apiFunc(bindObj, cache, './nodes/hotThreads');
25
- this.info = apiFunc(bindObj, cache, './nodes/info');
26
- this.reloadSecureSettings = apiFunc(bindObj, cache, './nodes/reloadSecureSettings');
27
- this.stats = apiFunc(bindObj, cache, './nodes/stats');
28
- this.usage = apiFunc(bindObj, cache, './nodes/usage');
22
+ this.hotThreads = require('./hotThreads').bind(bindObj);
23
+ this.info = require('./info').bind(bindObj);
24
+ this.reloadSecureSettings = require('./reloadSecureSettings').bind(bindObj);
25
+ this.stats = require('./stats').bind(bindObj);
26
+ this.usage = require('./usage').bind(bindObj);
29
27
  }
30
28
 
31
29
  module.exports = NodesApi;
@@ -15,21 +15,19 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Notifications */
21
19
 
22
20
  function NotificationsApi(bindObj) {
23
21
  const cache = {};
24
- this.createConfig = apiFunc(bindObj, cache, './notifications/createConfig');
25
- this.deleteConfig = apiFunc(bindObj, cache, './notifications/deleteConfig');
26
- this.deleteConfigs = apiFunc(bindObj, cache, './notifications/deleteConfigs');
27
- this.getConfig = apiFunc(bindObj, cache, './notifications/getConfig');
28
- this.getConfigs = apiFunc(bindObj, cache, './notifications/getConfigs');
29
- this.listChannels = apiFunc(bindObj, cache, './notifications/listChannels');
30
- this.listFeatures = apiFunc(bindObj, cache, './notifications/listFeatures');
31
- this.sendTest = apiFunc(bindObj, cache, './notifications/sendTest');
32
- this.updateConfig = apiFunc(bindObj, cache, './notifications/updateConfig');
22
+ this.createConfig = require('./createConfig').bind(bindObj);
23
+ this.deleteConfig = require('./deleteConfig').bind(bindObj);
24
+ this.deleteConfigs = require('./deleteConfigs').bind(bindObj);
25
+ this.getConfig = require('./getConfig').bind(bindObj);
26
+ this.getConfigs = require('./getConfigs').bind(bindObj);
27
+ this.listChannels = require('./listChannels').bind(bindObj);
28
+ this.listFeatures = require('./listFeatures').bind(bindObj);
29
+ this.sendTest = require('./sendTest').bind(bindObj);
30
+ this.updateConfig = require('./updateConfig').bind(bindObj);
33
31
  }
34
32
 
35
33
  module.exports = NotificationsApi;
package/api/ppl/_api.js CHANGED
@@ -15,16 +15,14 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Ppl */
21
19
 
22
20
  function PplApi(bindObj) {
23
21
  const cache = {};
24
- this.explain = apiFunc(bindObj, cache, './ppl/explain');
25
- this.getStats = apiFunc(bindObj, cache, './ppl/getStats');
26
- this.postStats = apiFunc(bindObj, cache, './ppl/postStats');
27
- this.query = apiFunc(bindObj, cache, './ppl/query');
22
+ this.explain = require('./explain').bind(bindObj);
23
+ this.getStats = require('./getStats').bind(bindObj);
24
+ this.postStats = require('./postStats').bind(bindObj);
25
+ this.query = require('./query').bind(bindObj);
28
26
  }
29
27
 
30
28
  module.exports = PplApi;
@@ -15,13 +15,11 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Remote-Store */
21
19
 
22
20
  function RemotestoreApi(bindObj) {
23
21
  const cache = {};
24
- this.restore = apiFunc(bindObj, cache, './remoteStore/restore');
22
+ this.restore = require('./restore').bind(bindObj);
25
23
  }
26
24
 
27
25
  module.exports = RemotestoreApi;
@@ -15,18 +15,16 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Rollups */
21
19
 
22
20
  function RollupsApi(bindObj) {
23
21
  const cache = {};
24
- this.delete = apiFunc(bindObj, cache, './rollups/delete');
25
- this.explain = apiFunc(bindObj, cache, './rollups/explain');
26
- this.get = apiFunc(bindObj, cache, './rollups/get');
27
- this.put = apiFunc(bindObj, cache, './rollups/put');
28
- this.start = apiFunc(bindObj, cache, './rollups/start');
29
- this.stop = apiFunc(bindObj, cache, './rollups/stop');
22
+ this.delete = require('./delete').bind(bindObj);
23
+ this.explain = require('./explain').bind(bindObj);
24
+ this.get = require('./get').bind(bindObj);
25
+ this.put = require('./put').bind(bindObj);
26
+ this.start = require('./start').bind(bindObj);
27
+ this.stop = require('./stop').bind(bindObj);
30
28
  }
31
29
 
32
30
  module.exports = RollupsApi;
@@ -15,15 +15,13 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Search-Pipeline */
21
19
 
22
20
  function SearchpipelineApi(bindObj) {
23
21
  const cache = {};
24
- this.delete = apiFunc(bindObj, cache, './searchPipeline/delete');
25
- this.get = apiFunc(bindObj, cache, './searchPipeline/get');
26
- this.put = apiFunc(bindObj, cache, './searchPipeline/put');
22
+ this.delete = require('./delete').bind(bindObj);
23
+ this.get = require('./get').bind(bindObj);
24
+ this.put = require('./put').bind(bindObj);
27
25
  }
28
26
 
29
27
  module.exports = SearchpipelineApi;
@@ -15,86 +15,84 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Security */
21
19
 
22
20
  function SecurityApi(bindObj) {
23
21
  const cache = {};
24
- this.authinfo = apiFunc(bindObj, cache, './security/authinfo');
25
- this.authtoken = apiFunc(bindObj, cache, './security/authtoken');
26
- this.changePassword = apiFunc(bindObj, cache, './security/changePassword');
27
- this.configUpgradeCheck = apiFunc(bindObj, cache, './security/configUpgradeCheck');
28
- this.configUpgradePerform = apiFunc(bindObj, cache, './security/configUpgradePerform');
29
- this.createActionGroup = apiFunc(bindObj, cache, './security/createActionGroup');
30
- this.createAllowlist = apiFunc(bindObj, cache, './security/createAllowlist');
31
- this.createRole = apiFunc(bindObj, cache, './security/createRole');
32
- this.createRoleMapping = apiFunc(bindObj, cache, './security/createRoleMapping');
33
- this.createTenant = apiFunc(bindObj, cache, './security/createTenant');
34
- this.createUpdateTenancyConfig = apiFunc(bindObj, cache, './security/createUpdateTenancyConfig');
35
- this.createUser = apiFunc(bindObj, cache, './security/createUser');
36
- this.createUserLegacy = apiFunc(bindObj, cache, './security/createUserLegacy');
37
- this.deleteActionGroup = apiFunc(bindObj, cache, './security/deleteActionGroup');
38
- this.deleteDistinguishedName = apiFunc(bindObj, cache, './security/deleteDistinguishedName');
39
- this.deleteRole = apiFunc(bindObj, cache, './security/deleteRole');
40
- this.deleteRoleMapping = apiFunc(bindObj, cache, './security/deleteRoleMapping');
41
- this.deleteTenant = apiFunc(bindObj, cache, './security/deleteTenant');
42
- this.deleteUser = apiFunc(bindObj, cache, './security/deleteUser');
43
- this.deleteUserLegacy = apiFunc(bindObj, cache, './security/deleteUserLegacy');
44
- this.flushCache = apiFunc(bindObj, cache, './security/flushCache');
45
- this.generateOboToken = apiFunc(bindObj, cache, './security/generateOboToken');
46
- this.generateUserToken = apiFunc(bindObj, cache, './security/generateUserToken');
47
- this.generateUserTokenLegacy = apiFunc(bindObj, cache, './security/generateUserTokenLegacy');
48
- this.getAccountDetails = apiFunc(bindObj, cache, './security/getAccountDetails');
49
- this.getActionGroup = apiFunc(bindObj, cache, './security/getActionGroup');
50
- this.getActionGroups = apiFunc(bindObj, cache, './security/getActionGroups');
51
- this.getAllowlist = apiFunc(bindObj, cache, './security/getAllowlist');
52
- this.getAuditConfiguration = apiFunc(bindObj, cache, './security/getAuditConfiguration');
53
- this.getCertificates = apiFunc(bindObj, cache, './security/getCertificates');
54
- this.getConfiguration = apiFunc(bindObj, cache, './security/getConfiguration');
55
- this.getDashboardsInfo = apiFunc(bindObj, cache, './security/getDashboardsInfo');
56
- this.getDistinguishedName = apiFunc(bindObj, cache, './security/getDistinguishedName');
57
- this.getDistinguishedNames = apiFunc(bindObj, cache, './security/getDistinguishedNames');
58
- this.getPermissionsInfo = apiFunc(bindObj, cache, './security/getPermissionsInfo');
59
- this.getRole = apiFunc(bindObj, cache, './security/getRole');
60
- this.getRoleMapping = apiFunc(bindObj, cache, './security/getRoleMapping');
61
- this.getRoleMappings = apiFunc(bindObj, cache, './security/getRoleMappings');
62
- this.getRoles = apiFunc(bindObj, cache, './security/getRoles');
63
- this.getSslinfo = apiFunc(bindObj, cache, './security/getSslinfo');
64
- this.getTenancyConfig = apiFunc(bindObj, cache, './security/getTenancyConfig');
65
- this.getTenant = apiFunc(bindObj, cache, './security/getTenant');
66
- this.getTenants = apiFunc(bindObj, cache, './security/getTenants');
67
- this.getUser = apiFunc(bindObj, cache, './security/getUser');
68
- this.getUserLegacy = apiFunc(bindObj, cache, './security/getUserLegacy');
69
- this.getUsers = apiFunc(bindObj, cache, './security/getUsers');
70
- this.getUsersLegacy = apiFunc(bindObj, cache, './security/getUsersLegacy');
71
- this.health = apiFunc(bindObj, cache, './security/health');
72
- this.migrate = apiFunc(bindObj, cache, './security/migrate');
73
- this.patchActionGroup = apiFunc(bindObj, cache, './security/patchActionGroup');
74
- this.patchActionGroups = apiFunc(bindObj, cache, './security/patchActionGroups');
75
- this.patchAllowlist = apiFunc(bindObj, cache, './security/patchAllowlist');
76
- this.patchAuditConfiguration = apiFunc(bindObj, cache, './security/patchAuditConfiguration');
77
- this.patchConfiguration = apiFunc(bindObj, cache, './security/patchConfiguration');
78
- this.patchDistinguishedName = apiFunc(bindObj, cache, './security/patchDistinguishedName');
79
- this.patchDistinguishedNames = apiFunc(bindObj, cache, './security/patchDistinguishedNames');
80
- this.patchRole = apiFunc(bindObj, cache, './security/patchRole');
81
- this.patchRoleMapping = apiFunc(bindObj, cache, './security/patchRoleMapping');
82
- this.patchRoleMappings = apiFunc(bindObj, cache, './security/patchRoleMappings');
83
- this.patchRoles = apiFunc(bindObj, cache, './security/patchRoles');
84
- this.patchTenant = apiFunc(bindObj, cache, './security/patchTenant');
85
- this.patchTenants = apiFunc(bindObj, cache, './security/patchTenants');
86
- this.patchUser = apiFunc(bindObj, cache, './security/patchUser');
87
- this.patchUsers = apiFunc(bindObj, cache, './security/patchUsers');
88
- this.postDashboardsInfo = apiFunc(bindObj, cache, './security/postDashboardsInfo');
89
- this.reloadHttpCertificates = apiFunc(bindObj, cache, './security/reloadHttpCertificates');
90
- this.reloadTransportCertificates = apiFunc(bindObj, cache, './security/reloadTransportCertificates');
91
- this.tenantInfo = apiFunc(bindObj, cache, './security/tenantInfo');
92
- this.updateAuditConfiguration = apiFunc(bindObj, cache, './security/updateAuditConfiguration');
93
- this.updateConfiguration = apiFunc(bindObj, cache, './security/updateConfiguration');
94
- this.updateDistinguishedName = apiFunc(bindObj, cache, './security/updateDistinguishedName');
95
- this.validate = apiFunc(bindObj, cache, './security/validate');
96
- this.whoAmI = apiFunc(bindObj, cache, './security/whoAmI');
97
- this.whoAmIProtected = apiFunc(bindObj, cache, './security/whoAmIProtected');
22
+ this.authinfo = require('./authinfo').bind(bindObj);
23
+ this.authtoken = require('./authtoken').bind(bindObj);
24
+ this.changePassword = require('./changePassword').bind(bindObj);
25
+ this.configUpgradeCheck = require('./configUpgradeCheck').bind(bindObj);
26
+ this.configUpgradePerform = require('./configUpgradePerform').bind(bindObj);
27
+ this.createActionGroup = require('./createActionGroup').bind(bindObj);
28
+ this.createAllowlist = require('./createAllowlist').bind(bindObj);
29
+ this.createRole = require('./createRole').bind(bindObj);
30
+ this.createRoleMapping = require('./createRoleMapping').bind(bindObj);
31
+ this.createTenant = require('./createTenant').bind(bindObj);
32
+ this.createUpdateTenancyConfig = require('./createUpdateTenancyConfig').bind(bindObj);
33
+ this.createUser = require('./createUser').bind(bindObj);
34
+ this.createUserLegacy = require('./createUserLegacy').bind(bindObj);
35
+ this.deleteActionGroup = require('./deleteActionGroup').bind(bindObj);
36
+ this.deleteDistinguishedName = require('./deleteDistinguishedName').bind(bindObj);
37
+ this.deleteRole = require('./deleteRole').bind(bindObj);
38
+ this.deleteRoleMapping = require('./deleteRoleMapping').bind(bindObj);
39
+ this.deleteTenant = require('./deleteTenant').bind(bindObj);
40
+ this.deleteUser = require('./deleteUser').bind(bindObj);
41
+ this.deleteUserLegacy = require('./deleteUserLegacy').bind(bindObj);
42
+ this.flushCache = require('./flushCache').bind(bindObj);
43
+ this.generateOboToken = require('./generateOboToken').bind(bindObj);
44
+ this.generateUserToken = require('./generateUserToken').bind(bindObj);
45
+ this.generateUserTokenLegacy = require('./generateUserTokenLegacy').bind(bindObj);
46
+ this.getAccountDetails = require('./getAccountDetails').bind(bindObj);
47
+ this.getActionGroup = require('./getActionGroup').bind(bindObj);
48
+ this.getActionGroups = require('./getActionGroups').bind(bindObj);
49
+ this.getAllowlist = require('./getAllowlist').bind(bindObj);
50
+ this.getAuditConfiguration = require('./getAuditConfiguration').bind(bindObj);
51
+ this.getCertificates = require('./getCertificates').bind(bindObj);
52
+ this.getConfiguration = require('./getConfiguration').bind(bindObj);
53
+ this.getDashboardsInfo = require('./getDashboardsInfo').bind(bindObj);
54
+ this.getDistinguishedName = require('./getDistinguishedName').bind(bindObj);
55
+ this.getDistinguishedNames = require('./getDistinguishedNames').bind(bindObj);
56
+ this.getPermissionsInfo = require('./getPermissionsInfo').bind(bindObj);
57
+ this.getRole = require('./getRole').bind(bindObj);
58
+ this.getRoleMapping = require('./getRoleMapping').bind(bindObj);
59
+ this.getRoleMappings = require('./getRoleMappings').bind(bindObj);
60
+ this.getRoles = require('./getRoles').bind(bindObj);
61
+ this.getSslinfo = require('./getSslinfo').bind(bindObj);
62
+ this.getTenancyConfig = require('./getTenancyConfig').bind(bindObj);
63
+ this.getTenant = require('./getTenant').bind(bindObj);
64
+ this.getTenants = require('./getTenants').bind(bindObj);
65
+ this.getUser = require('./getUser').bind(bindObj);
66
+ this.getUserLegacy = require('./getUserLegacy').bind(bindObj);
67
+ this.getUsers = require('./getUsers').bind(bindObj);
68
+ this.getUsersLegacy = require('./getUsersLegacy').bind(bindObj);
69
+ this.health = require('./health').bind(bindObj);
70
+ this.migrate = require('./migrate').bind(bindObj);
71
+ this.patchActionGroup = require('./patchActionGroup').bind(bindObj);
72
+ this.patchActionGroups = require('./patchActionGroups').bind(bindObj);
73
+ this.patchAllowlist = require('./patchAllowlist').bind(bindObj);
74
+ this.patchAuditConfiguration = require('./patchAuditConfiguration').bind(bindObj);
75
+ this.patchConfiguration = require('./patchConfiguration').bind(bindObj);
76
+ this.patchDistinguishedName = require('./patchDistinguishedName').bind(bindObj);
77
+ this.patchDistinguishedNames = require('./patchDistinguishedNames').bind(bindObj);
78
+ this.patchRole = require('./patchRole').bind(bindObj);
79
+ this.patchRoleMapping = require('./patchRoleMapping').bind(bindObj);
80
+ this.patchRoleMappings = require('./patchRoleMappings').bind(bindObj);
81
+ this.patchRoles = require('./patchRoles').bind(bindObj);
82
+ this.patchTenant = require('./patchTenant').bind(bindObj);
83
+ this.patchTenants = require('./patchTenants').bind(bindObj);
84
+ this.patchUser = require('./patchUser').bind(bindObj);
85
+ this.patchUsers = require('./patchUsers').bind(bindObj);
86
+ this.postDashboardsInfo = require('./postDashboardsInfo').bind(bindObj);
87
+ this.reloadHttpCertificates = require('./reloadHttpCertificates').bind(bindObj);
88
+ this.reloadTransportCertificates = require('./reloadTransportCertificates').bind(bindObj);
89
+ this.tenantInfo = require('./tenantInfo').bind(bindObj);
90
+ this.updateAuditConfiguration = require('./updateAuditConfiguration').bind(bindObj);
91
+ this.updateConfiguration = require('./updateConfiguration').bind(bindObj);
92
+ this.updateDistinguishedName = require('./updateDistinguishedName').bind(bindObj);
93
+ this.validate = require('./validate').bind(bindObj);
94
+ this.whoAmI = require('./whoAmI').bind(bindObj);
95
+ this.whoAmIProtected = require('./whoAmIProtected').bind(bindObj);
98
96
  }
99
97
 
100
98
  module.exports = SecurityApi;
@@ -15,23 +15,21 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Snapshot */
21
19
 
22
20
  function SnapshotApi(bindObj) {
23
21
  const cache = {};
24
- this.cleanupRepository = apiFunc(bindObj, cache, './snapshot/cleanupRepository');
25
- this.clone = apiFunc(bindObj, cache, './snapshot/clone');
26
- this.create = apiFunc(bindObj, cache, './snapshot/create');
27
- this.createRepository = apiFunc(bindObj, cache, './snapshot/createRepository');
28
- this.delete = apiFunc(bindObj, cache, './snapshot/delete');
29
- this.deleteRepository = apiFunc(bindObj, cache, './snapshot/deleteRepository');
30
- this.get = apiFunc(bindObj, cache, './snapshot/get');
31
- this.getRepository = apiFunc(bindObj, cache, './snapshot/getRepository');
32
- this.restore = apiFunc(bindObj, cache, './snapshot/restore');
33
- this.status = apiFunc(bindObj, cache, './snapshot/status');
34
- this.verifyRepository = apiFunc(bindObj, cache, './snapshot/verifyRepository');
22
+ this.cleanupRepository = require('./cleanupRepository').bind(bindObj);
23
+ this.clone = require('./clone').bind(bindObj);
24
+ this.create = require('./create').bind(bindObj);
25
+ this.createRepository = require('./createRepository').bind(bindObj);
26
+ this.delete = require('./delete').bind(bindObj);
27
+ this.deleteRepository = require('./deleteRepository').bind(bindObj);
28
+ this.get = require('./get').bind(bindObj);
29
+ this.getRepository = require('./getRepository').bind(bindObj);
30
+ this.restore = require('./restore').bind(bindObj);
31
+ this.status = require('./status').bind(bindObj);
32
+ this.verifyRepository = require('./verifyRepository').bind(bindObj);
35
33
  }
36
34
 
37
35
  module.exports = SnapshotApi;
package/api/sql/_api.js CHANGED
@@ -15,18 +15,16 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Sql */
21
19
 
22
20
  function SqlApi(bindObj) {
23
21
  const cache = {};
24
- this.close = apiFunc(bindObj, cache, './sql/close');
25
- this.explain = apiFunc(bindObj, cache, './sql/explain');
26
- this.getStats = apiFunc(bindObj, cache, './sql/getStats');
27
- this.postStats = apiFunc(bindObj, cache, './sql/postStats');
28
- this.query = apiFunc(bindObj, cache, './sql/query');
29
- this.settings = apiFunc(bindObj, cache, './sql/settings');
22
+ this.close = require('./close').bind(bindObj);
23
+ this.explain = require('./explain').bind(bindObj);
24
+ this.getStats = require('./getStats').bind(bindObj);
25
+ this.postStats = require('./postStats').bind(bindObj);
26
+ this.query = require('./query').bind(bindObj);
27
+ this.settings = require('./settings').bind(bindObj);
30
28
  }
31
29
 
32
30
  module.exports = SqlApi;
package/api/tasks/_api.js CHANGED
@@ -15,15 +15,13 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Tasks */
21
19
 
22
20
  function TasksApi(bindObj) {
23
21
  const cache = {};
24
- this.cancel = apiFunc(bindObj, cache, './tasks/cancel');
25
- this.get = apiFunc(bindObj, cache, './tasks/get');
26
- this.list = apiFunc(bindObj, cache, './tasks/list');
22
+ this.cancel = require('./cancel').bind(bindObj);
23
+ this.get = require('./get').bind(bindObj);
24
+ this.list = require('./list').bind(bindObj);
27
25
  }
28
26
 
29
27
  module.exports = TasksApi;
@@ -15,20 +15,18 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { apiFunc } = require('../utils');
19
-
20
18
  /** @namespace API-Transforms */
21
19
 
22
20
  function TransformsApi(bindObj) {
23
21
  const cache = {};
24
- this.delete = apiFunc(bindObj, cache, './transforms/delete');
25
- this.explain = apiFunc(bindObj, cache, './transforms/explain');
26
- this.get = apiFunc(bindObj, cache, './transforms/get');
27
- this.preview = apiFunc(bindObj, cache, './transforms/preview');
28
- this.put = apiFunc(bindObj, cache, './transforms/put');
29
- this.search = apiFunc(bindObj, cache, './transforms/search');
30
- this.start = apiFunc(bindObj, cache, './transforms/start');
31
- this.stop = apiFunc(bindObj, cache, './transforms/stop');
22
+ this.delete = require('./delete').bind(bindObj);
23
+ this.explain = require('./explain').bind(bindObj);
24
+ this.get = require('./get').bind(bindObj);
25
+ this.preview = require('./preview').bind(bindObj);
26
+ this.put = require('./put').bind(bindObj);
27
+ this.search = require('./search').bind(bindObj);
28
+ this.start = require('./start').bind(bindObj);
29
+ this.stop = require('./stop').bind(bindObj);
32
30
  }
33
31
 
34
32
  module.exports = TransformsApi;
package/api/utils.js CHANGED
@@ -60,12 +60,12 @@ function normalizeArguments(params, options, callback) {
60
60
  return [params, options, callback];
61
61
  }
62
62
 
63
- function apiFunc (bindObj, cache, path) {
64
- return function (...args) {
65
- if (!cache[path]) cache[path] = require(path).bind(bindObj);
66
- return cache[path](...args);
67
- }
68
- }
63
+ // function apiFunc (bindObj, cache, path) { // Used for lazy loading but not compatible with Webpack
64
+ // return function (...args) {
65
+ // if (!cache[path]) cache[path] = require(path).bind(bindObj);
66
+ // return cache[path](...args);
67
+ // }
68
+ // }
69
69
 
70
70
  function logMemoryUsage(context = '') {
71
71
  const memoryUsage = process.memoryUsage();
@@ -82,6 +82,5 @@ module.exports = {
82
82
  normalizeArguments,
83
83
  noop,
84
84
  kConfigErr,
85
- apiFunc,
86
85
  logMemoryUsage,
87
86
  };
@@ -15,89 +15,101 @@
15
15
 
16
16
  'use strict'
17
17
 
18
- const { kConfigErr, apiFunc } = require('../api/utils')
18
+ const { kConfigErr } = require('../api/utils')
19
19
  const kApiModules = Symbol('api modules')
20
- const kApiLoader = Symbol('api loader')
21
20
 
22
21
  class OpenSearchAPI {
23
22
  constructor (opts) {
24
23
  this[kConfigErr] = opts.ConfigurationError
25
- this[kApiModules] = {}
26
- this[kApiLoader] = function (path) {
27
- if (this[kApiModules][path] === undefined) {
28
- const ApiModule = require(path)
29
- this[kApiModules][path] = new ApiModule(this)
30
- }
31
- return this[kApiModules][path]
24
+ this[kApiModules] = {
25
+ cat: new(require('../api/cat/_api'))(this),
26
+ cluster: new(require('../api/cluster/_api'))(this),
27
+ danglingIndices: new(require('../api/danglingIndices/_api'))(this),
28
+ http: new(require('../api/http/_api'))(this),
29
+ indices: new(require('../api/indices/_api'))(this),
30
+ ingest: new(require('../api/ingest/_api'))(this),
31
+ knn: new(require('../api/knn/_api'))(this),
32
+ ml: new(require('../api/ml/_api'))(this),
33
+ nodes: new(require('../api/nodes/_api'))(this),
34
+ notifications: new(require('../api/notifications/_api'))(this),
35
+ ppl: new(require('../api/ppl/_api'))(this),
36
+ remoteStore: new(require('../api/remoteStore/_api'))(this),
37
+ rollups: new(require('../api/rollups/_api'))(this),
38
+ searchPipeline: new(require('../api/searchPipeline/_api'))(this),
39
+ security: new(require('../api/security/_api'))(this),
40
+ snapshot: new(require('../api/snapshot/_api'))(this),
41
+ sql: new(require('../api/sql/_api'))(this),
42
+ tasks: new(require('../api/tasks/_api'))(this),
43
+ transforms: new(require('../api/transforms/_api'))(this),
32
44
  }
33
45
 
34
46
  // Setup Root API Functions
35
47
  /** @namespace API-Core */
36
48
  const cache = {}
37
- this.bulk = apiFunc(this, cache, '../api/_core/bulk')
38
- this.clearScroll = apiFunc(this, cache, '../api/_core/clearScroll')
39
- this.count = apiFunc(this, cache, '../api/_core/count')
40
- this.create = apiFunc(this, cache, '../api/_core/create')
41
- this.createPit = apiFunc(this, cache, '../api/_core/createPit')
42
- this.delete = apiFunc(this, cache, '../api/_core/delete')
43
- this.deleteAllPits = apiFunc(this, cache, '../api/_core/deleteAllPits')
44
- this.deleteByQuery = apiFunc(this, cache, '../api/_core/deleteByQuery')
45
- this.deleteByQueryRethrottle = apiFunc(this, cache, '../api/_core/deleteByQueryRethrottle')
46
- this.deletePit = apiFunc(this, cache, '../api/_core/deletePit')
47
- this.deleteScript = apiFunc(this, cache, '../api/_core/deleteScript')
48
- this.exists = apiFunc(this, cache, '../api/_core/exists')
49
- this.existsSource = apiFunc(this, cache, '../api/_core/existsSource')
50
- this.explain = apiFunc(this, cache, '../api/_core/explain')
51
- this.fieldCaps = apiFunc(this, cache, '../api/_core/fieldCaps')
52
- this.get = apiFunc(this, cache, '../api/_core/get')
53
- this.getAllPits = apiFunc(this, cache, '../api/_core/getAllPits')
54
- this.getScript = apiFunc(this, cache, '../api/_core/getScript')
55
- this.getScriptContext = apiFunc(this, cache, '../api/_core/getScriptContext')
56
- this.getScriptLanguages = apiFunc(this, cache, '../api/_core/getScriptLanguages')
57
- this.getSource = apiFunc(this, cache, '../api/_core/getSource')
58
- this.index = apiFunc(this, cache, '../api/_core/index')
59
- this.info = apiFunc(this, cache, '../api/_core/info')
60
- this.mget = apiFunc(this, cache, '../api/_core/mget')
61
- this.msearch = apiFunc(this, cache, '../api/_core/msearch')
62
- this.msearchTemplate = apiFunc(this, cache, '../api/_core/msearchTemplate')
63
- this.mtermvectors = apiFunc(this, cache, '../api/_core/mtermvectors')
64
- this.ping = apiFunc(this, cache, '../api/_core/ping')
65
- this.putScript = apiFunc(this, cache, '../api/_core/putScript')
66
- this.rankEval = apiFunc(this, cache, '../api/_core/rankEval')
67
- this.reindex = apiFunc(this, cache, '../api/_core/reindex')
68
- this.reindexRethrottle = apiFunc(this, cache, '../api/_core/reindexRethrottle')
69
- this.renderSearchTemplate = apiFunc(this, cache, '../api/_core/renderSearchTemplate')
70
- this.scriptsPainlessExecute = apiFunc(this, cache, '../api/_core/scriptsPainlessExecute')
71
- this.scroll = apiFunc(this, cache, '../api/_core/scroll')
72
- this.search = apiFunc(this, cache, '../api/_core/search')
73
- this.searchShards = apiFunc(this, cache, '../api/_core/searchShards')
74
- this.searchTemplate = apiFunc(this, cache, '../api/_core/searchTemplate')
75
- this.termvectors = apiFunc(this, cache, '../api/_core/termvectors')
76
- this.update = apiFunc(this, cache, '../api/_core/update')
77
- this.updateByQuery = apiFunc(this, cache, '../api/_core/updateByQuery')
78
- this.updateByQueryRethrottle = apiFunc(this, cache, '../api/_core/updateByQueryRethrottle')
49
+ this.bulk = require('../api/_core/bulk').bind(this)
50
+ this.clearScroll = require('../api/_core/clearScroll').bind(this)
51
+ this.count = require('../api/_core/count').bind(this)
52
+ this.create = require('../api/_core/create').bind(this)
53
+ this.createPit = require('../api/_core/createPit').bind(this)
54
+ this.delete = require('../api/_core/delete').bind(this)
55
+ this.deleteAllPits = require('../api/_core/deleteAllPits').bind(this)
56
+ this.deleteByQuery = require('../api/_core/deleteByQuery').bind(this)
57
+ this.deleteByQueryRethrottle = require('../api/_core/deleteByQueryRethrottle').bind(this)
58
+ this.deletePit = require('../api/_core/deletePit').bind(this)
59
+ this.deleteScript = require('../api/_core/deleteScript').bind(this)
60
+ this.exists = require('../api/_core/exists').bind(this)
61
+ this.existsSource = require('../api/_core/existsSource').bind(this)
62
+ this.explain = require('../api/_core/explain').bind(this)
63
+ this.fieldCaps = require('../api/_core/fieldCaps').bind(this)
64
+ this.get = require('../api/_core/get').bind(this)
65
+ this.getAllPits = require('../api/_core/getAllPits').bind(this)
66
+ this.getScript = require('../api/_core/getScript').bind(this)
67
+ this.getScriptContext = require('../api/_core/getScriptContext').bind(this)
68
+ this.getScriptLanguages = require('../api/_core/getScriptLanguages').bind(this)
69
+ this.getSource = require('../api/_core/getSource').bind(this)
70
+ this.index = require('../api/_core/index').bind(this)
71
+ this.info = require('../api/_core/info').bind(this)
72
+ this.mget = require('../api/_core/mget').bind(this)
73
+ this.msearch = require('../api/_core/msearch').bind(this)
74
+ this.msearchTemplate = require('../api/_core/msearchTemplate').bind(this)
75
+ this.mtermvectors = require('../api/_core/mtermvectors').bind(this)
76
+ this.ping = require('../api/_core/ping').bind(this)
77
+ this.putScript = require('../api/_core/putScript').bind(this)
78
+ this.rankEval = require('../api/_core/rankEval').bind(this)
79
+ this.reindex = require('../api/_core/reindex').bind(this)
80
+ this.reindexRethrottle = require('../api/_core/reindexRethrottle').bind(this)
81
+ this.renderSearchTemplate = require('../api/_core/renderSearchTemplate').bind(this)
82
+ this.scriptsPainlessExecute = require('../api/_core/scriptsPainlessExecute').bind(this)
83
+ this.scroll = require('../api/_core/scroll').bind(this)
84
+ this.search = require('../api/_core/search').bind(this)
85
+ this.searchShards = require('../api/_core/searchShards').bind(this)
86
+ this.searchTemplate = require('../api/_core/searchTemplate').bind(this)
87
+ this.termvectors = require('../api/_core/termvectors').bind(this)
88
+ this.update = require('../api/_core/update').bind(this)
89
+ this.updateByQuery = require('../api/_core/updateByQuery').bind(this)
90
+ this.updateByQueryRethrottle = require('../api/_core/updateByQueryRethrottle').bind(this)
79
91
 
80
92
  // Setup API Modules
81
93
  Object.defineProperties(this, {
82
- cat: { get() { return this[kApiLoader]('../api/cat/_api') } },
83
- cluster: { get() { return this[kApiLoader]('../api/cluster/_api') } },
84
- danglingIndices: { get() { return this[kApiLoader]('../api/danglingIndices/_api') } },
85
- http: { get() { return this[kApiLoader]('../api/http/_api') } },
86
- indices: { get() { return this[kApiLoader]('../api/indices/_api') } },
87
- ingest: { get() { return this[kApiLoader]('../api/ingest/_api') } },
88
- knn: { get() { return this[kApiLoader]('../api/knn/_api') } },
89
- ml: { get() { return this[kApiLoader]('../api/ml/_api') } },
90
- nodes: { get() { return this[kApiLoader]('../api/nodes/_api') } },
91
- notifications: { get() { return this[kApiLoader]('../api/notifications/_api') } },
92
- ppl: { get() { return this[kApiLoader]('../api/ppl/_api') } },
93
- remoteStore: { get() { return this[kApiLoader]('../api/remoteStore/_api') } },
94
- rollups: { get() { return this[kApiLoader]('../api/rollups/_api') } },
95
- searchPipeline: { get() { return this[kApiLoader]('../api/searchPipeline/_api') } },
96
- security: { get() { return this[kApiLoader]('../api/security/_api') } },
97
- snapshot: { get() { return this[kApiLoader]('../api/snapshot/_api') } },
98
- sql: { get() { return this[kApiLoader]('../api/sql/_api') } },
99
- tasks: { get() { return this[kApiLoader]('../api/tasks/_api') } },
100
- transforms: { get() { return this[kApiLoader]('../api/transforms/_api') } },
94
+ cat: { get() { return this[kApiModules].cat } },
95
+ cluster: { get() { return this[kApiModules].cluster } },
96
+ danglingIndices: { get() { return this[kApiModules].danglingIndices } },
97
+ http: { get() { return this[kApiModules].http } },
98
+ indices: { get() { return this[kApiModules].indices } },
99
+ ingest: { get() { return this[kApiModules].ingest } },
100
+ knn: { get() { return this[kApiModules].knn } },
101
+ ml: { get() { return this[kApiModules].ml } },
102
+ nodes: { get() { return this[kApiModules].nodes } },
103
+ notifications: { get() { return this[kApiModules].notifications } },
104
+ ppl: { get() { return this[kApiModules].ppl } },
105
+ remoteStore: { get() { return this[kApiModules].remoteStore } },
106
+ rollups: { get() { return this[kApiModules].rollups } },
107
+ searchPipeline: { get() { return this[kApiModules].searchPipeline } },
108
+ security: { get() { return this[kApiModules].security } },
109
+ snapshot: { get() { return this[kApiModules].snapshot } },
110
+ sql: { get() { return this[kApiModules].sql } },
111
+ tasks: { get() { return this[kApiModules].tasks } },
112
+ transforms: { get() { return this[kApiModules].transforms } },
101
113
  })
102
114
  }
103
115
  }
package/package.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "index.d.ts", "index.js", "index.mjs",
32
32
  "README.md", "LICENSE.txt"],
33
33
  "homepage": "https://www.opensearch.org/",
34
- "version": "3.0.0-beta.5",
34
+ "version": "3.0.0-beta.6",
35
35
  "versionCanary": "7.10.0-canary.6",
36
36
  "keywords": [
37
37
  "opensearch",