Socket
Socket
Sign inDemoInstall

aerospike

Package Overview
Dependencies
Maintainers
3
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 3.12.0 to 3.13.0

lib/bitwise.js

5

CHANGELOG.md

@@ -7,2 +7,7 @@ # Changelog

## [3.13.0] - 2019-09-30
* **New Features**
* Support for bitwise operations. Requires server version 4.6 or later. [#312](https://github.com/aerospike/aerospike-client-nodejs/pull/312)
## [3.12.0] - 2019-08-31

@@ -9,0 +14,0 @@

34

lib/aerospike.js

@@ -95,2 +95,15 @@ // *****************************************************************************

/**
* The {@link module:aerospike/maps|maps} module defines operations on the Maps
* complex data type.
*
* @summary {@link module:aerospike/maps|aerospike/maps} module
* @static
*/
const maps = exports.maps = require('./maps')
// copy maps related enums into maps module
Object.keys(as.maps).forEach(key => {
maps[key] = as.maps[key]
})
/**
* The {@link module:aerospike/cdt|cdt} module provides the {@link CdtContext}

@@ -106,13 +119,8 @@ * class for operations on nested lists and maps.

/**
* The {@link module:aerospike/maps|maps} module defines operations on the Maps
* complex data type.
* The {@link module:aerospike/bitwise|bitwise} module defines operations on
* the bytes data type.
*
* @summary {@link module:aerospike/maps|aerospike/maps} module
* @static
* @summary {@link module:aerospike/bitwise|aerospike/bitwise} module
*/
const maps = exports.maps = require('./maps')
// copy maps related enums into maps module
Object.keys(as.maps).forEach(key => {
maps[key] = as.maps[key]
})
exports.bitwise = require('./bitwise')

@@ -158,2 +166,10 @@ /**

/**
* The {@link module:aerospike/features|features} module contains a list of the
* feature strings used by the Aerospike server.
*
* @summary {@link module:aerospike/features|aerospike/features} module
*/
exports.features = require('./features')
// ========================================================================

@@ -160,0 +176,0 @@ // Classes

@@ -1187,4 +1187,11 @@ // *****************************************************************************

*
* @description Operations can be created using the methods in one of the
* following modules:
* * {@link module:aerospike/operations} - General operations on all types.
* * {@link module:aerospike/lists} - Operations on CDT List values.
* * {@link module:aerospike/maps} - Operations on CDT Map values.
* * {@link module:aerospike/bitwise} - Operations on Bytes values.
*
* @param {Key} key - The key of the record.
* @param {Object[]} operations - List of operations to perform on the record.
* @param {module:aerospike/operations~Operation[]} operations - List of operations to perform on the record.
* @param {Object} [metadata] - Meta data.

@@ -1191,0 +1198,0 @@ * @param {OperatePolicy} [policy] - The Operate Policy to use for this operation.

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

const AerospikeError = require('./error')
const Operation = require('./operations').Operation

@@ -64,15 +65,4 @@ /**

*/
class ListOperation {
class ListOperation extends Operation {
/**
* @private
*/
constructor (op, bin, props) {
this.op = op
this.bin = bin
if (props) {
Object.assign(this, props)
}
}
/**
* @summary Set the return type for certain list operations.

@@ -79,0 +69,0 @@ * @description The return type only affects <code>getBy\*</code> and

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

const Context = require('./cdt_context')
const Operation = require('./operations').Operation

@@ -110,15 +111,4 @@ /**

*/
class MapOperation {
class MapOperation extends Operation {
/**
* @private
*/
constructor (op, bin, props) {
this.op = op
this.bin = bin
if (props) {
Object.assign(this, props)
}
}
/**
* @summary Set the return type for certain map operations.

@@ -125,0 +115,0 @@ *

// *****************************************************************************
// Copyright 2013-2017 Aerospike, Inc.
// Copyright 2013-2019 Aerospike, Inc.
//

@@ -56,108 +56,123 @@ // Licensed under the Apache License, Version 2.0 (the "License")

/**
* @private
* @class module:aerospike/operations~Operation
*
* @classdesc Base class for all operations executed with the {@link
* Client#operate} command.
*
* Operations can be created using the methods in one of the following modules:
* * {@link module:aerospike/operations} - General operations on all types.
* * {@link module:aerospike/lists} - Operations on CDT List values.
* * {@link module:aerospike/maps} - Operations on CDT Map values.
* * {@link module:aerospike/bitwise} - Operations on Bytes values.
*/
function Operation (op, bin) {
this.op = op
this.bin = bin
}
module.exports = {
class Operation {
/**
* @summary Read the value of the bin.
*
* @param {string} bin - The name of the bin.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
* @protected
*/
read: function read (bin) {
return new Operation(ops.READ, bin)
},
constructor (op, bin, props) {
this.op = op
this.bin = bin
if (props) {
Object.assign(this, props)
}
}
}
exports.Operation = Operation
/**
* @summary Update the value of the bin.
*
* @param {string} bin - The name of the bin.
* @param {any} value - The value to set the bin to.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
*/
write: function write (bin, value) {
var op = new Operation(ops.WRITE, bin)
op.value = value
return op
},
/**
* @summary Read the value of the bin.
*
* @param {string} bin - The name of the bin.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*/
exports.read = function (bin) {
return new Operation(ops.READ, bin)
}
/**
* @summary Increment the value of the bin by the given value.
*
* @description The bin must contain either an Integer or a Double, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(number|Double)} value - The value to increment the bin by.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
*/
add: function add (bin, value) {
var op = new Operation(ops.INCR, bin)
op.value = value
return op
},
/**
* @summary Update the value of the bin.
*
* @param {string} bin - The name of the bin.
* @param {any} value - The value to set the bin to.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*/
exports.write = function (bin, value) {
return new Operation(ops.WRITE, bin, {
value
})
}
/**
* @ summary Alias for the {@link module:aerospike/operations.add} operation.
*/
incr: function incr (bin, value) {
var op = new Operation(ops.INCR, bin)
op.value = value
return op
},
/**
* @summary Increment the value of the bin by the given value.
*
* @description The bin must contain either an Integer or a Double, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(number|Double)} value - The value to increment the bin by.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*/
exports.add = function (bin, value) {
return new Operation(ops.INCR, bin, {
value
})
}
/**
* @summary Append the value to the bin.
*
* @description The bin must contain either String or a Byte Array, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(string|Buffer)} value - The value to append to the bin.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
*/
append: function append (bin, value) {
var op = new Operation(ops.APPEND, bin)
op.value = value
return op
},
/**
* @summary Alias for the {@link module:aerospike/operations.add} operation.
*/
exports.incr = function (bin, value) {
return new Operation(ops.INCR, bin, {
value
})
}
/**
* @summary Prepend the value to the bin.
*
* @description The bin must contain either String or a Byte Array, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(string|Buffer)} value - The value to prepend to the bin.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
*/
prepend: function prepend (bin, value) {
var op = new Operation(ops.PREPEND, bin)
op.value = value
return op
},
/**
* @summary Append the value to the bin.
*
* @description The bin must contain either String or a Byte Array, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(string|Buffer)} value - The value to append to the bin.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*/
exports.append = function (bin, value) {
return new Operation(ops.APPEND, bin, {
value
})
}
/**
* @summary Update the TTL (time-to-live) for a record.
*
* @description If the optional `ttl` parameter is not specified, the server
* will reset the record's TTL value to the default TTL value for the
* namespace.
*
* @param {number} [ttl=Aerospike.ttl.NAMESPACE_DEFAULT] - The new, relative TTL to set for the record, when it is touched.
* @returns {Object} Operation that can be passed to the {@link Client#operate} command.
*
* @see {@link module:aerospike.ttl} for "special" TTL values.
*/
touch: function touch (ttl) {
var op = new Operation(ops.TOUCH)
op.ttl = ttl
return op
}
/**
* @summary Prepend the value to the bin.
*
* @description The bin must contain either String or a Byte Array, and the
* value must be of the same type.
*
* @param {string} bin - The name of the bin.
* @param {(string|Buffer)} value - The value to prepend to the bin.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*/
exports.prepend = function (bin, value) {
return new Operation(ops.PREPEND, bin, {
value
})
}
/**
* @summary Update the TTL (time-to-live) for a record.
*
* @description If the optional `ttl` parameter is not specified, the server
* will reset the record's TTL value to the default TTL value for the
* namespace.
*
* @param {number} [ttl=Aerospike.ttl.NAMESPACE_DEFAULT] - The new, relative TTL to set for the record, when it is touched.
* @returns {Operation} Operation that can be passed to the {@link Client#operate} command.
*
* @see {@link module:aerospike.ttl} for "special" TTL values.
*/
exports.touch = function (ttl) {
return new Operation(ops.TOUCH, undefined, {
ttl
})
}

@@ -130,2 +130,8 @@ // *****************************************************************************

/**
* Bin already exists on a create-only operation.
* @const {number}
*/
exports.ERR_BIN_EXISTS = exports.AEROSPIKE_ERR_BIN_EXISTS = as.status.AEROSPIKE_ERR_BIN_EXISTS
/**
* A cluster state change occurred during the request.

@@ -194,2 +200,8 @@ * @const {number}

/**
* Bin not found on update-only operation.
* @const {number}
*/
exports.ERR_BIN_NOT_FOUND = exports.AEROSPIKE_ERR_BIN_NOT_FOUND = as.status.AEROSPIKE_ERR_BIN_NOT_FOUND
/**
* The server node's storage device(s) can't keep up with the write load.

@@ -519,2 +531,5 @@ * @const {number}

case exports.ERR_BIN_EXISTS:
return 'Bin already exists on a create-only operation.'
case exports.ERR_CLUSTER_CHANGE:

@@ -550,2 +565,5 @@ return 'A cluster state change occurred during the request.'

case exports.ERR_BIN_NOT_FOUND:
return 'Bin not found on update-only operation.'
case exports.ERR_DEVICE_OVERLOAD:

@@ -552,0 +570,0 @@ return 'The server node\'s storage device(s) can\'t keep up with the write load.'

{
"name": "aerospike",
"version": "3.12.0",
"version": "3.13.0",
"description": "Aerospike Client Library",

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

"ink-docstrap": "^1.3.0",
"jsdoc": "^3.6.2",
"jsdoc": "^3.6.3",
"mocha": "^6.1.4",

@@ -57,0 +57,0 @@ "mocha-clean": "^1.0.0",

@@ -52,3 +52,3 @@ // *****************************************************************************

describe('client.operate() - CDT List operations', function () {
helper.skipUnlessSupportsFeature('cdt-list', this)
helper.skipUnlessSupportsFeature(Aerospike.features.CDT_LIST, this)

@@ -55,0 +55,0 @@ let ListOutOfBoundsError

@@ -52,3 +52,3 @@ // *****************************************************************************

describe('client.operate() - CDT Map operations', function () {
helper.skipUnlessSupportsFeature('cdt-map', this)
helper.skipUnlessSupportsFeature(Aerospike.features.CDT_MAP, this)

@@ -55,0 +55,0 @@ describe('maps.setPolicy', function () {

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