Socket
Socket
Sign inDemoInstall

aerospike

Package Overview
Dependencies
Maintainers
5
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aerospike - npm Package Compare versions

Comparing version 5.6.0 to 5.7.0

lib/admin.js

250

examples/package-lock.json
{
"name": "aerospike-client-examples",
"lockfileVersion": 3,
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"aerospike": {
"version": "file:..",
"requires": {
"bindings": "^1.3.0",
"minimatch": "^3.0.4",
"nan": "^2.13.2"
"packages": {
"": {
"name": "aerospike-client-examples",
"license": "Apache-2.0",
"dependencies": {
"aerospike": "file:..",
"yargs": "^16.2.0"
},
"engines": {
"node": ">=8"
}
},
"ansi-regex": {
"..": {
"version": "5.6.0",
"cpu": [
"x64",
"arm64"
],
"hasInstallScript": true,
"license": "Apache-2.0",
"os": [
"linux",
"darwin",
"win32"
],
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
"bindings": "^1.5.0",
"minimatch": "^3.1.2",
"nan": "^2.17.0",
"node-gyp": "^8.4.1"
},
"devDependencies": {
"@types/node": "^17.0.45",
"chai": "^4.3.7",
"choma": "^1.2.1",
"codecov": "^3.8.3",
"deep-eql": "^4.1.3",
"dirty-chai": "^2.0.1",
"husky": "^7.0.4",
"mocha": "^9.2.2",
"mocha-clean": "^1.0.0",
"nyc": "^15.1.0",
"p-throttle": "^3.1.0",
"semver": "^7.5.4",
"standard": "^16.0.4",
"tmp": "^0.1.0",
"yargs": "^15.4.1"
},
"engines": {
"node": ">=4"
}
},
"node_modules/aerospike": {
"resolved": "..",
"link": true
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
},
"ansi-styles": {
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"cliui": {
"node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"requires": {
"dependencies": {
"string-width": "^4.2.0",

@@ -59,11 +94,14 @@ "strip-ansi": "^6.0.0",

},
"color-convert": {
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"color-name": {
"node_modules/color-name": {
"version": "1.1.4",

@@ -73,8 +111,3 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",

},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"emoji-regex": {
"node_modules/emoji-regex": {
"version": "8.0.0",

@@ -84,93 +117,108 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",

},
"escalade": {
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"engines": {
"node": ">=6"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
},
"get-caller-file": {
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"is-fullwidth-code-point": {
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"nan": {
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
},
"require-directory": {
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"engines": {
"node": ">=0.10.0"
}
},
"string-width": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"requires": {
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"requires": {
"ansi-regex": "^5.0.0"
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"wrap-ansi": {
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"requires": {
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"y18n": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz",
"integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg=="
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"engines": {
"node": ">=10"
}
},
"yargs": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.0.tgz",
"integrity": "sha512-Ykb00VnWjee855QmeCrDAAmhVagt0T8PMML9WS2YrcU0VtvbeGq02MD7UiWmK6biiVPas6CaXmJNetL4Ye4+ng==",
"requires": {
"cliui": "^7.0.0",
"escalade": "^3.0.2",
"node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.1",
"yargs-parser": "^19.0.4"
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
}
},
"yargs-parser": {
"version": "19.0.4",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-19.0.4.tgz",
"integrity": "sha512-eXeQm7yXRjPFFyf1voPkZgXQZJjYfjgQUmGPbD2TLtZeIYzvacgWX7sQ5a1HsRgVP+pfKAkRZDNtTGev4h9vhw=="
"node_modules/yargs-parser": {
"version": "20.2.9",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"engines": {
"node": ">=10"
}
}
}
}

@@ -15,4 +15,4 @@ {

"aerospike": "file:..",
"yargs": "^16.0.0"
"yargs": "^16.2.0"
}
}

@@ -27,3 +27,3 @@ #!/usr/bin/env node

const meta = buildMeta(argv)
const policy = buildPolicy(argv)
const policy = buildPolicy(argv, client.config)
console.info(key, bins, meta, policy)

@@ -41,4 +41,4 @@ await client.put(key, bins, meta, policy)

function buildPolicy (argv) {
const policy = { }
function buildPolicy (argv, config) {
const policy = { ...config.policies.write }
if (argv.create) {

@@ -45,0 +45,0 @@ policy.exists = Aerospike.policy.exists.CREATE

@@ -84,2 +84,10 @@ // *****************************************************************************

/**
* The admin module contains classes associated with RBAC (Role Based Access Control) security
* methods defined in {@link Client}
*
* @summary {@link module:aerospike/admin|aerospike/admin} module
*/
exports.admin = require('./admin')
/**
* The {@link module:aerospike/lists|lists} module defines operations on the Lists

@@ -178,2 +186,3 @@ * complex data type.

exports.MapPolicy = require('./policy').MapPolicy
exports.AdminPolicy = require('./policy').AdminPolicy

@@ -661,2 +670,11 @@ /**

/**
* The {@link module:aerospike/privilegeCode|aerospike/privilege_code}
* module is comprised of permission codes which define the type of
* permission granted for a user's role.
*
* @summary {@link module:aerospike/privilegeCode|aerospike/privilege_code} module
*/
exports.privilegeCode = require('./privilege_code')
// Set default log level

@@ -663,0 +681,0 @@ as.setDefaultLogging({

@@ -36,2 +36,3 @@ // *****************************************************************************

exports.BatchSelect = class BatchSelectCommand extends BatchCommand('batchSelect') { }
exports.ChangePassword = class ChangePasswordCommand extends Command('changePassword') { }
exports.Connect = class ConnectCommand extends ConnectCommandBase('connect') { }

@@ -48,2 +49,4 @@ exports.Exists = class ExistsCommand extends ExistsCommandBase('existsAsync') { }

exports.Operate = class OperateCommand extends ReadRecordCommand('operateAsync') { }
exports.PrivilegeGrant = class PrivilegeGrantCommand extends Command('privilegeGrant') { }
exports.PrivilegeRevoke = class PrivilegeRevokeCommand extends Command('privilegeRevoke') { }
exports.Put = class PutCommand extends WriteRecordCommand('putAsync') { }

@@ -56,3 +59,13 @@ exports.Query = class QueryCommand extends StreamCommand('queryAsync') { }

exports.QueryForeach = class QueryForeachCommand extends StreamCommand('queryForeach') { }
exports.QueryRole = class QueryRoleCommand extends Command('queryRole') { }
exports.QueryRoles = class QueryRolesCommand extends Command('queryRoles') { }
exports.QueryUser = class QueryUserCommand extends Command('queryUser') { }
exports.QueryUsers = class QueryUsersCommand extends Command('queryUsers') { }
exports.Remove = class RemoveCommand extends WriteRecordCommand('removeAsync') { }
exports.RoleCreate = class RoleCreateCommand extends Command('roleCreate') { }
exports.RoleDrop = class RoleDropCommand extends Command('roleDrop') { }
exports.RoleGrant = class RoleGrantCommand extends Command('roleGrant') { }
exports.RoleRevoke = class RoleRevokeCommand extends Command('roleRevoke') { }
exports.RoleSetWhitelist = class RoleSetWhitelistCommand extends Command('roleSetWhitelist') { }
exports.RoleSetQuotas = class RoleSetQuotasCommand extends Command('roleSetQuotas') { }
exports.Scan = class ScanCommand extends StreamCommand('scanAsync') { }

@@ -66,1 +79,3 @@ exports.ScanPages = class ScanPagesCommand extends StreamCommand('scanPages') { }

exports.UdfRemove = class UdfRemoveCommand extends Command('udfRemove') { }
exports.UserCreate = class UserCreateCommand extends Command('userCreate') { }
exports.UserDrop = class UserDropCommand extends Command('userDrop') { }

@@ -42,5 +42,2 @@ // *****************************************************************************

this.timeout = props.timeout
if (this.timeout === undefined) {
this.timeout = props.timeout
}

@@ -47,0 +44,0 @@ /**

@@ -40,2 +40,3 @@ // *****************************************************************************

const MapPolicy = require('./policies/map_policy')
const AdminPolicy = require('./policies/admin_policy')
/**

@@ -77,6 +78,12 @@ * @module aerospike/policy

* * {@link MapPolicy} - Applies to Map operations defined in {@link module:aerospike/maps}.
* * {@link AdminPolicy} - Applies to {@link @Client#changePassword}, {@link Client#changePassword},
* {@link Client#createUser}, {@link Client#createRole}, {@link Client#dropRole}, {@link Client#dropUser},
* {@link Client#grantPrivileges}, {@link Client#grantRoles}, {@link Client#queryRole},
* {@link Client#queryRoles}, {@link Client#queryUser}, {@link Client#queryUsers},
* {@link Client#revokePrivileges}, {@link Client#revokeRoles}, {@link Client#setQuotas},
* and {@link Client#setWhitelist}, .
*
* Base policy {@link BasePolicy} class which defines common policy
* values that apply to all database operations
* (except `InfoPolicy`, `MapPolicy` and `ListPolicy`).
* (except `InfoPolicy`, `AdminPolicy`, `MapPolicy` and `ListPolicy`).
*

@@ -407,2 +414,9 @@ * This module also defines global values for the following policy settings:

/**
* A policy affecting the behavior of admin operations.
*
* @summary {@link AdminPolicy} class
*/
exports.AdminPolicy = AdminPolicy
/**
* A policy affecting the behavior of list operations.

@@ -441,2 +455,3 @@ *

case 'map': return MapPolicy
case 'admin': return AdminPolicy
default:

@@ -443,0 +458,0 @@ throw new TypeError(`Unknown policy type: "${type}"`)

@@ -156,2 +156,4 @@ // *****************************************************************************

* returned. See {@link Query#nobins}.
* @param {boolean} [options.ttl=0] - The time-to-live (expiration) of the record in seconds.
* See {@link Query#ttl}.
*

@@ -396,5 +398,23 @@ * @see {@link Client#query} to create new instances of this class.

* of the previous query. If set to <code>null</code>, calling {@link query#foreach} will begin a new query.
* @member {number} Query#queryState
* @member {Object} Query#queryState
*/
this.queryState = undefined
/**
* The time-to-live (expiration) of the record in seconds.
* There are also special values that can be set in the record TTL:
*
* 0 (defined Aerospike.ttl.NAMESPACE_DEFAULT), which means that the
* record will adopt the default TTL value from the namespace.
*
* -1 (defined Aerospike.ttl.NEVER_EXIRE), which means that the record
* will get an internal "void_time" of zero, and thus will never expire.
*
* -2 (defined Aerospike.ttl.DONT_UPDATE), which means that the record
* ttl will not change when the record is updated.
*
* Note that the TTL value will be employed ONLY on background query writes.
* @member {number} Query#ttl
*/
this.ttl = options.ttl
}

@@ -577,3 +597,7 @@

args.push(this.maxRecords)
args.push(this.filters[0].context ? { context: this.filters[0].context } : null)
if ((this.filters == null) && (this.filters[0].context)) {
args.push({ context: this.filters[0].context })
} else {
args.push(null)
}
cmd = new Commands.QueryPages(stream, args)

@@ -580,0 +604,0 @@ } else {

@@ -92,3 +92,6 @@ // *****************************************************************************

* should be scanned concurrently. See {@link Scan#concurrent}.
* @param {boolean} [options.ttl=0] - The time-to-live (expiration) of the record in seconds.
* See {@link Scan#ttl}.
*
*
* @see {@link Client#scan} to create new instances of this class.

@@ -292,2 +295,20 @@ *

this.scanState = undefined
/**
* The time-to-live (expiration) of the record in seconds.
* There are also special values that can be set in the record TTL:
*
* 0 (defined Aerospike.ttl.NAMESPACE_DEFAULT), which means that the
* record will adopt the default TTL value from the namespace.
*
* -1 (defined Aerospike.ttl.NEVER_EXIRE), which means that the record
* will get an internal "void_time" of zero, and thus will never expire.
*
* -2 (defined Aerospike.ttl.DONT_UPDATE), which means that the record
* ttl will not change when the record is updated.
*
* Note that the TTL value will be employed ONLY on background scan writes.
* @member {number} Scan#ttl
*/
this.ttl = options.ttl
}

@@ -294,0 +315,0 @@

@@ -366,2 +366,20 @@ // *****************************************************************************

/**
* Specified IP whitelist is invalid.
* @const {number}
*/
exports.INVALID_WHITELIST = exports.AEROSPIKE_INVALID_WHITELIST = as.status.AEROSPIKE_INVALID_WHITELIST
/**
* Quotas not enabled on the server.
* @const {number}
*/
exports.QUOTAS_NOT_ENABLED = exports.AEROSPIKE_QUOTAS_NOT_ENABLED = as.status.AEROSPIKE_QUOTAS_NOT_ENABLED
/**
* Invalid quota specified.
* @const {number}
*/
exports.INVALID_QUOTA = exports.AEROSPIKE_INVALID_QUOTA = as.status.AEROSPIKE_INVALID_QUOTA
/**
* User must be authenticated before performing database operations.

@@ -652,2 +670,11 @@ * @const {number}

case exports.INVALID_WHITELIST:
return 'Specified IP whitelist is invalid.'
case exports.QUOTAS_NOT_ENABLED:
return 'Quotas not enabled on the server.'
case exports.INVALID_QUOTA:
return 'Invalid quota specified.'
case exports.NOT_AUTHENTICATED:

@@ -654,0 +681,0 @@ return 'User must be authenticated before performing database operations.'

{
"name": "aerospike",
"version": "5.6.0",
"version": "5.7.0",
"description": "Aerospike Client Library",

@@ -42,3 +42,3 @@ "keywords": [

"preinstall": "npm install @mapbox/node-pre-gyp",
"install": "node ./scripts/prebuiltBinding.js; node-pre-gyp install --fallback-to-build",
"install": "node scripts/prebuiltBinding.js; node-pre-gyp install --fallback-to-build",
"test": "mocha",

@@ -57,24 +57,24 @@ "test-noserver": "GLOBAL_CLIENT=false mocha -g '#noserver'",

"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.10",
"bindings": "^1.3.0",
"minimatch": "^3.0.4",
"nan": "^2.14.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"bindings": "^1.5.0",
"minimatch": "^3.1.2",
"nan": "^2.17.0",
"node-gyp": "^8.4.1"
},
"devDependencies": {
"@types/node": "^17.0.21",
"chai": "^4.2.0",
"@types/node": "^17.0.45",
"chai": "^4.3.7",
"choma": "^1.2.1",
"codecov": "^3.8.3",
"deep-eql": "^4.0.0",
"deep-eql": "^4.1.3",
"dirty-chai": "^2.0.1",
"husky": "^7.0.4",
"mocha": "^9.2.0",
"mocha": "^9.2.2",
"mocha-clean": "^1.0.0",
"nyc": "^15.0.0",
"nyc": "^15.1.0",
"p-throttle": "^3.1.0",
"semver": "^7.1.1",
"semver": "^7.5.4",
"standard": "^16.0.4",
"tmp": "^0.1",
"yargs": "^15.3.1"
"tmp": "^0.1.0",
"yargs": "^15.4.1"
},

@@ -81,0 +81,0 @@ "standard": {

@@ -229,2 +229,35 @@ // *****************************************************************************

describe('query.foreach() #slow', function () {
it('Should run a regular primary index query', function (done) {
const query = client.query(helper.namespace, testSet)
const stream = query.foreach()
const results = []
stream.on('error', error => { throw error })
stream.on('data', record => results.push(record.bins))
stream.on('end', () => {
expect(results.length).to.be.above(60)
done()
})
})
it('Should run a paginated primary index query', async function () {
let recordTotal = 0
let recordsReceived = 0
const maxRecs = 8
const query = client.query(helper.namespace, testSet, { paginate: true, maxRecords: maxRecs })
let results = []
while (1) {
results = await query.results()
recordsReceived += results.length
expect(results.length).to.be.below(9)
results = []
recordTotal += recordsReceived
if (recordsReceived !== maxRecs) {
expect(query.hasNextPage()).to.equal(false)
expect(recordTotal).to.be.above(60)
break
}
recordsReceived = 0
}
})
it('should apply a stream UDF to filter the results', function (done) {

@@ -363,5 +396,3 @@ const args = {

while (1) {
console.log(results)
results = await query.results()
console.log(results)
recordsReceived += results.length

@@ -907,2 +938,14 @@ results = []

const query = client.query(helper.namespace, testSet)
const ops = [op.write('backgroundOps', 4)]
const job = await query.operate(ops)
await job.waitUntilDone()
const key = keys[Math.floor(Math.random() * keys.length)]
const record = await client.get(key)
expect(record.bins.backgroundOps).to.equal(4)
})
it('should set TTL to the specified value #slow', async function () {
const query = client.query(helper.namespace, testSet)
query.ttl = 3600
const ops = [op.incr('backgroundOps', 1)]

@@ -914,4 +957,15 @@ const job = await query.operate(ops)

const record = await client.get(key)
expect(record.bins.backgroundOps).to.equal(1)
expect(record.ttl).to.equal(3599)
})
it('should set TTL to the specified value using query options #slow', async function () {
const query = client.query(helper.namespace, testSet, { ttl: 7200 })
const ops = [op.incr('backgroundOps', 1)]
const job = await query.operate(ops)
await job.waitUntilDone()
const key = keys[Math.floor(Math.random() * keys.length)]
const record = await client.get(key)
expect(record.ttl).to.equal(7199)
})
})

@@ -918,0 +972,0 @@

@@ -182,3 +182,3 @@ // *****************************************************************************

it('Paginates correctly using query.results()', async function () {
it('Paginates correctly using scan.results()', async function () {
let recordsReceived = 0

@@ -389,2 +389,25 @@ let recordTotal = 0

it('should set TTL to the specified value #slow', async function () {
const scan = client.scan(helper.namespace, testSet)
scan.ttl = 10800
const ops = [op.incr('backgroundOps', 1)]
const job = await scan.operate(ops)
await job.waitUntilDone()
const key = keys[Math.floor(Math.random() * keys.length)]
const record = await client.get(key)
expect(record.ttl).to.equal(10799)
})
it('should set TTL to the specified value with scan options #slow', async function () {
const scan = client.scan(helper.namespace, testSet, { ttl: 14400 })
const ops = [op.incr('backgroundOps', 1)]
const job = await scan.operate(ops)
await job.waitUntilDone()
const key = keys[Math.floor(Math.random() * keys.length)]
const record = await client.get(key)
expect(record.ttl).to.equal(14399)
})
it('should perform a background scan that executes the touch operation #slow', async function () {

@@ -391,0 +414,0 @@ const ttl = 123

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc