@opensearch-project/opensearch 3.0.0-beta.4 → 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.
Files changed (54) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/api/cat/_api.js +24 -26
  3. package/api/cluster/_api.js +21 -23
  4. package/api/danglingIndices/_api.js +3 -5
  5. package/api/http/_api.js +9 -11
  6. package/api/indices/_api.js +48 -50
  7. package/api/ingest/_api.js +5 -7
  8. package/api/knn/_api.js +6 -8
  9. package/api/ml/_api.js +7 -9
  10. package/api/nodes/_api.js +5 -7
  11. package/api/notifications/_api.js +9 -11
  12. package/api/ppl/_api.js +4 -6
  13. package/api/remoteStore/_api.js +1 -3
  14. package/api/rollups/_api.js +6 -8
  15. package/api/searchPipeline/_api.js +3 -5
  16. package/api/security/_api.js +74 -76
  17. package/api/snapshot/_api.js +11 -13
  18. package/api/sql/_api.js +6 -8
  19. package/api/tasks/_api.js +3 -5
  20. package/api/transforms/_api.js +8 -10
  21. package/api/utils.js +6 -7
  22. package/lib/OpenSearchAPI.d.ts +1403 -0
  23. package/lib/OpenSearchAPI.js +117 -0
  24. package/package.json +5 -1
  25. package/.dockerignore +0 -5
  26. package/.eslintignore +0 -2
  27. package/.eslintrc.json +0 -34
  28. package/.prettierrc.json +0 -5
  29. package/.whitesource +0 -15
  30. package/ADMINS.md +0 -16
  31. package/COMPATIBILITY.md +0 -13
  32. package/DEVELOPER_GUIDE.md +0 -127
  33. package/MAINTAINERS.md +0 -23
  34. package/Makefile +0 -17
  35. package/RELEASING.md +0 -41
  36. package/SECURITY.md +0 -3
  37. package/USER_GUIDE.md +0 -316
  38. package/codecov.yml +0 -14
  39. package/guides/advanced_index_actions.md +0 -92
  40. package/guides/bulk.md +0 -126
  41. package/guides/document_lifecycle.md +0 -162
  42. package/guides/index_lifecycle.md +0 -142
  43. package/guides/index_template.md +0 -228
  44. package/guides/json.md +0 -53
  45. package/guides/msearch.md +0 -56
  46. package/guides/search.md +0 -203
  47. package/jenkins/release.JenkinsFile +0 -11
  48. package/samples/README.md +0 -17
  49. package/samples/bulk.js +0 -91
  50. package/samples/json.js +0 -75
  51. package/samples/msearch.js +0 -131
  52. package/samples/rollups.js +0 -139
  53. package/samples/search.js +0 -155
  54. package/samples/transforms.ts +0 -146
@@ -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
  };