aerospike 5.5.0 → 5.7.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.
Files changed (118) hide show
  1. package/README.md +45 -16
  2. package/binding.gyp +20 -6
  3. package/examples/package-lock.json +149 -101
  4. package/examples/package.json +1 -1
  5. package/examples/put.js +3 -3
  6. package/lib/admin.js +47 -0
  7. package/lib/aerospike.js +18 -0
  8. package/lib/binding/node-v108-darwin-arm64/aerospike.node +0 -0
  9. package/lib/binding/node-v108-darwin-x64/aerospike.node +0 -0
  10. package/lib/binding/node-v111-darwin-arm64/aerospike.node +0 -0
  11. package/lib/binding/node-v111-darwin-x64/aerospike.node +0 -0
  12. package/lib/binding/node-v115-darwin-arm64/aerospike.node +0 -0
  13. package/lib/binding/node-v115-darwin-x64/aerospike.node +0 -0
  14. package/lib/binding/node-v93-darwin-arm64/aerospike.node +0 -0
  15. package/lib/binding/node-v93-darwin-x64/aerospike.node +0 -0
  16. package/lib/binding/openssl@1/node-v108-linux-arm64/aerospike.node +0 -0
  17. package/lib/binding/openssl@1/node-v108-linux-x64/aerospike.node +0 -0
  18. package/lib/binding/openssl@1/node-v111-linux-arm64/aerospike.node +0 -0
  19. package/lib/binding/openssl@1/node-v111-linux-x64/aerospike.node +0 -0
  20. package/lib/binding/openssl@1/node-v115-linux-arm64/aerospike.node +0 -0
  21. package/lib/binding/openssl@1/node-v115-linux-x64/aerospike.node +0 -0
  22. package/lib/binding/openssl@1/node-v93-linux-arm64/aerospike.node +0 -0
  23. package/lib/binding/openssl@1/node-v93-linux-x64/aerospike.node +0 -0
  24. package/lib/binding/openssl@3/node-v108-linux-arm64/aerospike.node +0 -0
  25. package/lib/binding/openssl@3/node-v108-linux-x64/aerospike.node +0 -0
  26. package/lib/binding/openssl@3/node-v111-linux-arm64/aerospike.node +0 -0
  27. package/lib/binding/openssl@3/node-v111-linux-x64/aerospike.node +0 -0
  28. package/lib/binding/openssl@3/node-v115-linux-arm64/aerospike.node +0 -0
  29. package/lib/binding/openssl@3/node-v115-linux-x64/aerospike.node +0 -0
  30. package/lib/binding/openssl@3/node-v93-linux-arm64/aerospike.node +0 -0
  31. package/lib/binding/openssl@3/node-v93-linux-x64/aerospike.node +0 -0
  32. package/lib/cdt_context.js +29 -0
  33. package/lib/client.js +886 -122
  34. package/lib/commands/index.js +15 -0
  35. package/lib/filter.js +28 -20
  36. package/lib/policies/admin_policy.js +44 -0
  37. package/lib/policies/info_policy.js +0 -3
  38. package/lib/policies/query_policy.js +8 -0
  39. package/lib/policies/scan_policy.js +8 -0
  40. package/lib/policy.js +16 -1
  41. package/lib/privilege.js +32 -0
  42. package/lib/privilege_code.js +91 -0
  43. package/lib/query.js +27 -16
  44. package/lib/role.js +33 -0
  45. package/lib/scan.js +21 -0
  46. package/lib/status.js +27 -0
  47. package/lib/user.js +33 -0
  48. package/package.json +16 -16
  49. package/scripts/build-c-client.sh +0 -4
  50. package/scripts/{build-package.sh-cclient-output.log → build-c-client.sh-cclient-output.log} +116 -116
  51. package/scripts/build-commands.sh +2 -55
  52. package/scripts/build-package.sh +0 -3
  53. package/scripts/prebuiltBinding.js +72 -72
  54. package/src/include/client.h +17 -0
  55. package/src/include/conversions.h +10 -0
  56. package/src/include/enums.h +1 -0
  57. package/src/include/operations.h +1 -0
  58. package/src/include/policy.h +2 -0
  59. package/src/include/query.h +4 -3
  60. package/src/main/aerospike.cc +1 -0
  61. package/src/main/async.cc +2 -2
  62. package/src/main/cdt_ctx.cc +77 -0
  63. package/src/main/client.cc +18 -2
  64. package/src/main/commands/change_password.cc +116 -0
  65. package/src/main/commands/index_create.cc +20 -6
  66. package/src/main/commands/privilege_grant.cc +104 -0
  67. package/src/main/commands/privilege_revoke.cc +104 -0
  68. package/src/main/commands/query_apply.cc +6 -1
  69. package/src/main/commands/query_async.cc +7 -1
  70. package/src/main/commands/query_background.cc +7 -1
  71. package/src/main/commands/query_foreach.cc +6 -1
  72. package/src/main/commands/query_pages.cc +24 -6
  73. package/src/main/commands/query_role.cc +88 -0
  74. package/src/main/commands/query_roles.cc +80 -0
  75. package/src/main/commands/query_user.cc +87 -0
  76. package/src/main/commands/query_users.cc +80 -0
  77. package/src/main/commands/role_create.cc +141 -0
  78. package/src/main/commands/role_drop.cc +83 -0
  79. package/src/main/commands/role_grant.cc +104 -0
  80. package/src/main/commands/role_revoke.cc +104 -0
  81. package/src/main/commands/role_set_quotas.cc +94 -0
  82. package/src/main/commands/role_set_whitelist.cc +103 -0
  83. package/src/main/commands/scan_pages.cc +1 -1
  84. package/src/main/commands/udf_register.cc +5 -1
  85. package/src/main/commands/user_create.cc +117 -0
  86. package/src/main/commands/user_drop.cc +82 -0
  87. package/src/main/config.cc +2 -1
  88. package/src/main/enums/privilege_code.cc +44 -0
  89. package/src/main/enums/status.cc +3 -0
  90. package/src/main/list_operations.cc +6 -6
  91. package/src/main/policy.cc +27 -0
  92. package/src/main/query.cc +27 -10
  93. package/src/main/scan.cc +7 -0
  94. package/src/main/util/conversions.cc +157 -2
  95. package/test/admin.js +512 -0
  96. package/test/cdt_context.js +31 -1
  97. package/test/client.js +69 -0
  98. package/test/index.js +60 -8
  99. package/test/query.js +255 -4
  100. package/test/scan.js +24 -1
  101. package/test/test_helper.js +3 -2
  102. package/lib/binding/openssl@1/node-v108-darwin-arm64/aerospike.node +0 -0
  103. package/lib/binding/openssl@1/node-v108-darwin-x64/aerospike.node +0 -0
  104. package/lib/binding/openssl@1/node-v111-darwin-arm64/aerospike.node +0 -0
  105. package/lib/binding/openssl@1/node-v111-darwin-x64/aerospike.node +0 -0
  106. package/lib/binding/openssl@1/node-v115-darwin-arm64/aerospike.node +0 -0
  107. package/lib/binding/openssl@1/node-v115-darwin-x64/aerospike.node +0 -0
  108. package/lib/binding/openssl@1/node-v93-darwin-arm64/aerospike.node +0 -0
  109. package/lib/binding/openssl@1/node-v93-darwin-x64/aerospike.node +0 -0
  110. package/lib/binding/openssl@3/node-v108-darwin-arm64/aerospike.node +0 -0
  111. package/lib/binding/openssl@3/node-v108-darwin-x64/aerospike.node +0 -0
  112. package/lib/binding/openssl@3/node-v111-darwin-arm64/aerospike.node +0 -0
  113. package/lib/binding/openssl@3/node-v111-darwin-x64/aerospike.node +0 -0
  114. package/lib/binding/openssl@3/node-v115-darwin-arm64/aerospike.node +0 -0
  115. package/lib/binding/openssl@3/node-v115-darwin-x64/aerospike.node +0 -0
  116. package/lib/binding/openssl@3/node-v93-darwin-arm64/aerospike.node +0 -0
  117. package/lib/binding/openssl@3/node-v93-darwin-x64/aerospike.node +0 -0
  118. package/scripts/postinstall.js +0 -12
package/README.md CHANGED
@@ -197,43 +197,72 @@ Before starting with the Aerospike Nodejs Client, verify that you have the follo
197
197
  - Xcode 5 or greater.
198
198
 
199
199
 
200
- **Openssl Library**
200
+ **OpenSSL Library**
201
+ OpenSSL is needed to build the Aerospike C Client. If downloading from NPM at version 5.6.0 or later, you will not need to
202
+ have OpenSSL installed to use the Aerospike Nodejs Client. If you are using version 5.5.0 and below, you will need to do
203
+ some additional linking to use the client, which is specified below.
201
204
 
202
- The below example shows how to install the Openssl library.
205
+ We recommend using brew to install OpenSSL:
203
206
 
204
207
  ```bash
205
208
  brew install openssl
206
- unlink /usr/local/opt/openssl
207
- # Change the below linking based on openssl version and installation path
208
- ln -s /usr/local/Cellar/openssl@x/y.z/ /usr/local/opt/openssl
209
209
  ```
210
210
 
211
- If you are looking upgrade switch from openssl@1 or an older version of openssl@3, add these variables to your .bashrc, .profile, or .zshrc file.
211
+ For a Mac using ARM architecture, OpenSSL should be linked as shown below:
212
+
213
+ ```bash
214
+ # When building from source before version 5.6 with openssl@3
215
+ sudo ln -s /opt/homebrew/opt/openssl@3/ /usr/local/opt/openssl;
216
+ # link here if before version 5.6.0
217
+ sudo ln -s /opt/homebrew/opt/openssl@3/ /usr/local/opt/openssl@3;
218
+
219
+ # When building from source with openssl@1.1
220
+ sudo ln -s /opt/homebrew/opt/openssl@1.1/ /usr/local/opt/openssl;
221
+ # link here if before version 5.6.0 with openssl@1.1
222
+ sudo ln -s /opt/homebrew/opt/openssl@1.1/ /usr/local/opt/openssl@1.1;
223
+ ```
224
+
225
+ For a Mac using X86 architecture, OpenSSL should be linked as shown below:
226
+
227
+ ```bash
228
+ # When building from source before version 5.6 with openssl@1.1
229
+ sudo ln -s /opt/homebrew/opt/openssl@1.1/ /usr/local/opt/openssl;
230
+ # link here if before version 5.6.0 with openssl@1.1
231
+ sudo ln -s /opt/homebrew/opt/openssl@1.1/ /usr/local/opt/openssl@1.1;
232
+ ```
233
+
234
+ Before version 5.6.0, you may need to some add some variables to your profile for OpenSSL to be found.
235
+
212
236
  ```bash
213
237
  export PATH="/usr/local/bin/:/usr/local/opt/openssl/bin:$PATH"
214
238
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
215
239
  export CPPFLAGS="-I/usr/local/opt/openssl/include"
216
240
  export EXT_CFLAGS="-I/usr/local/opt/openssl/include"
217
- ```
218
-
219
- Afterwards, source the file that was changed and confirm the desired openssl version is installed
220
- ```bash
241
+ # Make sure to source the changes to your shell profile
221
242
  source ~/.bashrc
222
243
  source ~/.profile
223
244
  source ~/.zshrc
224
- openssl version
225
245
  ```
226
- For 4x client support, install openssl@1.1 version.
246
+
247
+ For 4x client support, install OpenSSL@1.1 version.
227
248
 
228
249
  **LIBUV Library**
229
250
 
230
- The example below shows how to install the LIBUV library.
251
+ Libuv is needed to build the Aerospike C Client. If downloading from NPM at version 5.6.0 or later, you will not need to
252
+ have Libuv installed to use the Aerospike Nodejs Client. If you are using version 5.5.0 and below, you will need to do
253
+ some additional linking to use the client, which is specified below.
254
+
255
+ We recommend using brew to install Libuv:
231
256
 
232
257
  ```bash
233
258
  brew install libuv
234
- unlink /usr/local/opt/libuv
235
- # Change the below linking based on libuv version and installation path
236
- ln -s /usr/local/Cellar/libuv/1.44.1_1/ /usr/local/opt/libuv
259
+ ```
260
+
261
+ For a Mac using ARM architecture, Libuv should be linked as shown below:
262
+
263
+ ```bash
264
+ # When building from source before version 5.6
265
+ sudo ln -s /opt/homebrew/opt/libuv/ /usr/local/opt/libuv;
237
266
  ```
238
267
 
239
268
  ### Git Repository Installations
package/binding.gyp CHANGED
@@ -91,28 +91,43 @@
91
91
  'src/main/commands/batch_remove.cc',
92
92
  'src/main/commands/batch_apply.cc',
93
93
  'src/main/commands/batch_write_async.cc',
94
+ 'src/main/commands/change_password.cc',
94
95
  'src/main/commands/exists_async.cc',
95
96
  'src/main/commands/get_async.cc',
97
+ 'src/main/commands/index_create.cc',
98
+ 'src/main/commands/index_remove.cc',
96
99
  'src/main/commands/info_any.cc',
97
100
  'src/main/commands/info_foreach.cc',
98
101
  'src/main/commands/info_host.cc',
99
102
  'src/main/commands/info_node.cc',
100
103
  'src/main/commands/job_info.cc',
101
104
  'src/main/commands/operate_async.cc',
105
+ 'src/main/commands/privilege_grant.cc',
106
+ 'src/main/commands/privilege_revoke.cc',
102
107
  'src/main/commands/put_async.cc',
103
108
  'src/main/commands/query_async.cc',
104
109
  'src/main/commands/query_apply.cc',
105
110
  'src/main/commands/query_background.cc',
106
111
  'src/main/commands/query_foreach.cc',
107
112
  'src/main/commands/query_pages.cc',
113
+ 'src/main/commands/query_role.cc',
114
+ 'src/main/commands/query_roles.cc',
115
+ 'src/main/commands/query_user.cc',
116
+ 'src/main/commands/query_users.cc',
117
+ 'src/main/commands/role_create.cc',
118
+ 'src/main/commands/role_drop.cc',
119
+ 'src/main/commands/role_grant.cc',
120
+ 'src/main/commands/role_revoke.cc',
121
+ 'src/main/commands/role_set_quotas.cc',
122
+ 'src/main/commands/role_set_whitelist.cc',
108
123
  'src/main/commands/remove_async.cc',
109
124
  'src/main/commands/scan_async.cc',
110
125
  'src/main/commands/scan_background.cc',
111
126
  'src/main/commands/scan_pages.cc',
112
127
  'src/main/commands/select_async.cc',
113
128
  'src/main/commands/truncate.cc',
114
- 'src/main/commands/index_create.cc',
115
- 'src/main/commands/index_remove.cc',
129
+ 'src/main/commands/user_create.cc',
130
+ 'src/main/commands/user_drop.cc',
116
131
  'src/main/commands/udf_register.cc',
117
132
  'src/main/commands/udf_remove.cc',
118
133
  'src/main/enums/predicates.cc',
@@ -129,6 +144,7 @@
129
144
  'src/main/enums/config_enum.cc',
130
145
  'src/main/enums/exp_enum.cc',
131
146
  'src/main/enums/batch_type.cc',
147
+ 'src/main/enums/privilege_code.cc',
132
148
  'src/main/stats.cc',
133
149
  'src/main/util/conversions.cc',
134
150
  'src/main/util/conversions_batch.cc',
@@ -151,8 +167,7 @@
151
167
  ['OS=="linux"',{
152
168
  'libraries': [
153
169
  '../aerospike-client-c/target/Linux-<(build_arch)/lib/libaerospike.a',
154
- '-lz',
155
- '-lssl'
170
+ '-lz'
156
171
  ],
157
172
  'defines': [
158
173
  'AS_USE_LIBUV'
@@ -168,8 +183,7 @@
168
183
  ['OS=="mac"',{
169
184
  'libraries': [
170
185
  '../aerospike-client-c/target/Darwin-<(build_arch)/lib/libaerospike.a',
171
- '-lz',
172
- '-lssl'
186
+ '-lz'
173
187
  ],
174
188
  'defines': [
175
189
  'AS_USE_LIBUV'
@@ -1,173 +1,221 @@
1
1
  {
2
2
  "name": "aerospike-client-examples",
3
+ "lockfileVersion": 3,
3
4
  "requires": true,
4
- "lockfileVersion": 1,
5
- "dependencies": {
6
- "aerospike": {
7
- "version": "file:..",
8
- "requires": {
9
- "bindings": "^1.3.0",
10
- "minimatch": "^3.0.4",
11
- "nan": "^2.13.2"
5
+ "packages": {
6
+ "": {
7
+ "name": "aerospike-client-examples",
8
+ "license": "Apache-2.0",
9
+ "dependencies": {
10
+ "aerospike": "file:..",
11
+ "yargs": "^16.2.0"
12
+ },
13
+ "engines": {
14
+ "node": ">=8"
12
15
  }
13
16
  },
14
- "ansi-regex": {
17
+ "..": {
18
+ "version": "5.6.0",
19
+ "cpu": [
20
+ "x64",
21
+ "arm64"
22
+ ],
23
+ "hasInstallScript": true,
24
+ "license": "Apache-2.0",
25
+ "os": [
26
+ "linux",
27
+ "darwin",
28
+ "win32"
29
+ ],
30
+ "dependencies": {
31
+ "@mapbox/node-pre-gyp": "^1.0.11",
32
+ "bindings": "^1.5.0",
33
+ "minimatch": "^3.1.2",
34
+ "nan": "^2.17.0",
35
+ "node-gyp": "^8.4.1"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^17.0.45",
39
+ "chai": "^4.3.7",
40
+ "choma": "^1.2.1",
41
+ "codecov": "^3.8.3",
42
+ "deep-eql": "^4.1.3",
43
+ "dirty-chai": "^2.0.1",
44
+ "husky": "^7.0.4",
45
+ "mocha": "^9.2.2",
46
+ "mocha-clean": "^1.0.0",
47
+ "nyc": "^15.1.0",
48
+ "p-throttle": "^3.1.0",
49
+ "semver": "^7.5.4",
50
+ "standard": "^16.0.4",
51
+ "tmp": "^0.1.0",
52
+ "yargs": "^15.4.1"
53
+ },
54
+ "engines": {
55
+ "node": ">=4"
56
+ }
57
+ },
58
+ "node_modules/aerospike": {
59
+ "resolved": "..",
60
+ "link": true
61
+ },
62
+ "node_modules/ansi-regex": {
15
63
  "version": "5.0.1",
16
64
  "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
17
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
65
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
66
+ "engines": {
67
+ "node": ">=8"
68
+ }
18
69
  },
19
- "ansi-styles": {
70
+ "node_modules/ansi-styles": {
20
71
  "version": "4.3.0",
21
72
  "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
22
73
  "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
23
- "requires": {
74
+ "dependencies": {
24
75
  "color-convert": "^2.0.1"
76
+ },
77
+ "engines": {
78
+ "node": ">=8"
79
+ },
80
+ "funding": {
81
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
25
82
  }
26
83
  },
27
- "balanced-match": {
28
- "version": "1.0.0",
29
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
30
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
31
- },
32
- "bindings": {
33
- "version": "1.5.0",
34
- "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
35
- "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
36
- "requires": {
37
- "file-uri-to-path": "1.0.0"
38
- }
39
- },
40
- "brace-expansion": {
41
- "version": "1.1.11",
42
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
43
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
44
- "requires": {
45
- "balanced-match": "^1.0.0",
46
- "concat-map": "0.0.1"
47
- }
48
- },
49
- "cliui": {
84
+ "node_modules/cliui": {
50
85
  "version": "7.0.4",
51
86
  "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
52
87
  "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
53
- "requires": {
88
+ "dependencies": {
54
89
  "string-width": "^4.2.0",
55
90
  "strip-ansi": "^6.0.0",
56
91
  "wrap-ansi": "^7.0.0"
57
92
  }
58
93
  },
59
- "color-convert": {
94
+ "node_modules/color-convert": {
60
95
  "version": "2.0.1",
61
96
  "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
62
97
  "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
63
- "requires": {
98
+ "dependencies": {
64
99
  "color-name": "~1.1.4"
100
+ },
101
+ "engines": {
102
+ "node": ">=7.0.0"
65
103
  }
66
104
  },
67
- "color-name": {
105
+ "node_modules/color-name": {
68
106
  "version": "1.1.4",
69
107
  "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
70
108
  "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
71
109
  },
72
- "concat-map": {
73
- "version": "0.0.1",
74
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
75
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
76
- },
77
- "emoji-regex": {
110
+ "node_modules/emoji-regex": {
78
111
  "version": "8.0.0",
79
112
  "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
80
113
  "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
81
114
  },
82
- "escalade": {
115
+ "node_modules/escalade": {
83
116
  "version": "3.1.1",
84
117
  "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
85
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
86
- },
87
- "file-uri-to-path": {
88
- "version": "1.0.0",
89
- "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
90
- "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
118
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
119
+ "engines": {
120
+ "node": ">=6"
121
+ }
91
122
  },
92
- "get-caller-file": {
123
+ "node_modules/get-caller-file": {
93
124
  "version": "2.0.5",
94
125
  "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
95
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
126
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
127
+ "engines": {
128
+ "node": "6.* || 8.* || >= 10.*"
129
+ }
96
130
  },
97
- "is-fullwidth-code-point": {
131
+ "node_modules/is-fullwidth-code-point": {
98
132
  "version": "3.0.0",
99
133
  "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
100
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
101
- },
102
- "minimatch": {
103
- "version": "3.0.4",
104
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
105
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
106
- "requires": {
107
- "brace-expansion": "^1.1.7"
134
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
135
+ "engines": {
136
+ "node": ">=8"
108
137
  }
109
138
  },
110
- "nan": {
111
- "version": "2.14.0",
112
- "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
113
- "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
114
- },
115
- "require-directory": {
139
+ "node_modules/require-directory": {
116
140
  "version": "2.1.1",
117
141
  "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
118
- "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
142
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
143
+ "engines": {
144
+ "node": ">=0.10.0"
145
+ }
119
146
  },
120
- "string-width": {
121
- "version": "4.2.0",
122
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
123
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
124
- "requires": {
147
+ "node_modules/string-width": {
148
+ "version": "4.2.3",
149
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
150
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
151
+ "dependencies": {
125
152
  "emoji-regex": "^8.0.0",
126
153
  "is-fullwidth-code-point": "^3.0.0",
127
- "strip-ansi": "^6.0.0"
154
+ "strip-ansi": "^6.0.1"
155
+ },
156
+ "engines": {
157
+ "node": ">=8"
128
158
  }
129
159
  },
130
- "strip-ansi": {
131
- "version": "6.0.0",
132
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
133
- "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
134
- "requires": {
135
- "ansi-regex": "^5.0.0"
160
+ "node_modules/strip-ansi": {
161
+ "version": "6.0.1",
162
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
163
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
164
+ "dependencies": {
165
+ "ansi-regex": "^5.0.1"
166
+ },
167
+ "engines": {
168
+ "node": ">=8"
136
169
  }
137
170
  },
138
- "wrap-ansi": {
171
+ "node_modules/wrap-ansi": {
139
172
  "version": "7.0.0",
140
173
  "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
141
174
  "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
142
- "requires": {
175
+ "dependencies": {
143
176
  "ansi-styles": "^4.0.0",
144
177
  "string-width": "^4.1.0",
145
178
  "strip-ansi": "^6.0.0"
179
+ },
180
+ "engines": {
181
+ "node": ">=10"
182
+ },
183
+ "funding": {
184
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
146
185
  }
147
186
  },
148
- "y18n": {
149
- "version": "5.0.5",
150
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz",
151
- "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg=="
187
+ "node_modules/y18n": {
188
+ "version": "5.0.8",
189
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
190
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
191
+ "engines": {
192
+ "node": ">=10"
193
+ }
152
194
  },
153
- "yargs": {
154
- "version": "16.0.0",
155
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.0.tgz",
156
- "integrity": "sha512-Ykb00VnWjee855QmeCrDAAmhVagt0T8PMML9WS2YrcU0VtvbeGq02MD7UiWmK6biiVPas6CaXmJNetL4Ye4+ng==",
157
- "requires": {
158
- "cliui": "^7.0.0",
159
- "escalade": "^3.0.2",
195
+ "node_modules/yargs": {
196
+ "version": "16.2.0",
197
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
198
+ "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
199
+ "dependencies": {
200
+ "cliui": "^7.0.2",
201
+ "escalade": "^3.1.1",
160
202
  "get-caller-file": "^2.0.5",
161
203
  "require-directory": "^2.1.1",
162
204
  "string-width": "^4.2.0",
163
- "y18n": "^5.0.1",
164
- "yargs-parser": "^19.0.4"
205
+ "y18n": "^5.0.5",
206
+ "yargs-parser": "^20.2.2"
207
+ },
208
+ "engines": {
209
+ "node": ">=10"
165
210
  }
166
211
  },
167
- "yargs-parser": {
168
- "version": "19.0.4",
169
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-19.0.4.tgz",
170
- "integrity": "sha512-eXeQm7yXRjPFFyf1voPkZgXQZJjYfjgQUmGPbD2TLtZeIYzvacgWX7sQ5a1HsRgVP+pfKAkRZDNtTGev4h9vhw=="
212
+ "node_modules/yargs-parser": {
213
+ "version": "20.2.9",
214
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
215
+ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
216
+ "engines": {
217
+ "node": ">=10"
218
+ }
171
219
  }
172
220
  }
173
221
  }
@@ -12,6 +12,6 @@
12
12
  "main": "run.js",
13
13
  "dependencies": {
14
14
  "aerospike": "file:..",
15
- "yargs": "^16.0.0"
15
+ "yargs": "^16.2.0"
16
16
  }
17
17
  }
package/examples/put.js CHANGED
@@ -24,7 +24,7 @@ async function put (client, argv) {
24
24
  const key = new Aerospike.Key(argv.namespace, argv.set, argv.key)
25
25
  const bins = shared.cli.parseBins(argv.bins)
26
26
  const meta = buildMeta(argv)
27
- const policy = buildPolicy(argv)
27
+ const policy = buildPolicy(argv, client.config)
28
28
  console.info(key, bins, meta, policy)
29
29
  await client.put(key, bins, meta, policy)
30
30
  }
@@ -37,8 +37,8 @@ function buildMeta (argv) {
37
37
  return meta
38
38
  }
39
39
 
40
- function buildPolicy (argv) {
41
- const policy = { }
40
+ function buildPolicy (argv, config) {
41
+ const policy = { ...config.policies.write }
42
42
  if (argv.create) {
43
43
  policy.exists = Aerospike.policy.exists.CREATE
44
44
  }
package/lib/admin.js ADDED
@@ -0,0 +1,47 @@
1
+ // *****************************************************************************
2
+ // Copyright 2023 Aerospike, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the 'License')
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an 'AS IS' BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ // *****************************************************************************
16
+
17
+ 'use strict'
18
+
19
+ /**
20
+ * @module aerospike/admin
21
+ *
22
+ * @description The admin module contains classes associated with RBAC (Role Based Access Control) security
23
+ * methods defined in {@link Client}
24
+ *
25
+ */
26
+
27
+ /**
28
+ * The {@link User} class holds role and database usage information for individual users.
29
+ *
30
+ * @summary User.
31
+ */
32
+ exports.User = require('./user')
33
+
34
+ /**
35
+ * The {@link Privilege} class contains a {@link aerospike/privilegeCode | privilegeCode} as well as
36
+ * an namespace and set.
37
+ *
38
+ * @summary Privilege
39
+ */
40
+ exports.Privilege = require('./privilege')
41
+
42
+ /**
43
+ * The {@link Role} class holds quota, whitelist, and privilege information for an specified role.
44
+ *
45
+ * @summary Role
46
+ */
47
+ exports.Role = require('./role')
package/lib/aerospike.js CHANGED
@@ -80,6 +80,14 @@ exports.regex = {
80
80
  */
81
81
  exports.info = require('./info')
82
82
 
83
+ /**
84
+ * The admin module contains classes associated with RBAC (Role Based Access Control) security
85
+ * methods defined in {@link Client}
86
+ *
87
+ * @summary {@link module:aerospike/admin|aerospike/admin} module
88
+ */
89
+ exports.admin = require('./admin')
90
+
83
91
  /**
84
92
  * The {@link module:aerospike/lists|lists} module defines operations on the Lists
85
93
  * complex data type.
@@ -174,6 +182,7 @@ exports.CommandQueuePolicy = require('./policy').CommandQueuePolicy
174
182
  exports.InfoPolicy = require('./policy').InfoPolicy
175
183
  exports.ListPolicy = require('./policy').ListPolicy
176
184
  exports.MapPolicy = require('./policy').MapPolicy
185
+ exports.AdminPolicy = require('./policy').AdminPolicy
177
186
 
178
187
  /**
179
188
  * The {@link module:aerospike/status|status} module contains a list of the
@@ -656,6 +665,15 @@ exports.setupGlobalCommandQueue = function (policy) {
656
665
  */
657
666
  exports.batchType = require('./batch_type')
658
667
 
668
+ /**
669
+ * The {@link module:aerospike/privilegeCode|aerospike/privilege_code}
670
+ * module is comprised of permission codes which define the type of
671
+ * permission granted for a user's role.
672
+ *
673
+ * @summary {@link module:aerospike/privilegeCode|aerospike/privilege_code} module
674
+ */
675
+ exports.privilegeCode = require('./privilege_code')
676
+
659
677
  // Set default log level
660
678
  as.setDefaultLogging({
661
679
  level: as.log.WARN,