Skip to content

Commit

Permalink
Merge pull request #524 from aerospike/stage
Browse files Browse the repository at this point in the history
Nodejs release 5.2.1
  • Loading branch information
DomPeliniAerospike authored Feb 7, 2023
2 parents 816dd03 + 97a0589 commit 7335ec6
Show file tree
Hide file tree
Showing 33 changed files with 3,206 additions and 5,449 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ image:
platform: x64
environment:
matrix:
- nodejs_version: "14"
- nodejs_version: "12"
- nodejs_version: "10"
- nodejs_version: "19"
- nodejs_version: "18"
- nodejs_version: "16"

install:
- ps: Install-Product node $env:nodejs_version $env:platform
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cache: 'npm'
- name: Set up Aerospike Database
uses: reugn/github-action-aerospike@v1
- run: npm ci
- run: npm install
- run: npm run coverage
env:
AEROSPIKE_HOSTS: "127.0.0.1:3000"
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,17 @@ jobs:
strategy:
matrix:
node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- 10.x
- 12.x
- 14.x
- 16.x
- 17.x
- 18.x
- 19.x
continue-on-error: true
name: Node ${{ matrix.node-version }} tester
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Windows SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.6
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11
with:
sdk-version: 17763
- name: Setup node
Expand All @@ -60,12 +57,12 @@ jobs:
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\@npmcli\run-script"
}
cd $NodeModulesPath
npm install node-gyp@8.x
npm install node-gyp@9.x
- name: Install nodejs Client
shell: pwsh
run: npm install --unsafe-perm --build-from-source
# - name: Test nodejs client
# run: npm test
# env:
# AEROSPIKE_HOSTS: "127.0.0.1:3000"
# OPTIONS: "--timeout 30000 --set demp ${{ matrix.node }}"
# OPTIONS: "--timeout 30000 --set demp ${{ matrix.node }}"
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'action': [
'pwsh', 'scripts/build-c-client.ps1',
'-Configuration', "$(ConfigurationName)",
'-NodeLibFile', "<(node_root_dir)/<(build_arch)/node.lib"
'-NodeLibFile', "<(node_root_dir)/<(target_arch)/node.lib"
]
}
]
Expand Down
44 changes: 23 additions & 21 deletions lib/bitwise.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,28 @@ const as = require('bindings')('aerospike.node')
const opcodes = as.bitOperations

/**
* @class aerospike/bitwise~BitwiseOperation
* @class module:aerospike/bitwise~BitwiseOperation
*
* @classdesc Use the methods in the {@link module:aerospike/bitwise|bitwise}
* module to create bitwise operations for use with the {@link Client#operate}
* command.
*/
class BitwiseOperation extends Operation {
/**
* @summary Applies a {@link BitwisePolicy} to the operation.
*
* @param {BitwisePolicy} policy - Policy to apply to the operation.
*/
withPolicy (policy) {
this.policy = policy
return this
}

}

/**
* @summary Applies a {@link BitwisePolicy} to the operation.
*
* @param {BitwisePolicy} policy - Policy to apply to the operation.
*/
BitwiseOperation.prototype.withPolicy = function (policy) {
this.policy = policy
return this
}

/**
* @class aerospike/bitwise~OverflowableBitwiseOp
* @class module:aerospike/bitwise~OverflowableBitwiseOp
*
* @classdesc Bitwise operation variant that can overflow/underflow.
*
Expand All @@ -73,17 +75,17 @@ class OverflowableBitwiseOp extends BitwiseOperation {
super(op, bin, props)
this.overflowAction = as.bitwise.overflow.FAIL
}
}

/**
* @summary Sets the action to take when the operation overflows/underflows.
*
* @param {number} action - {@link module:aerospike/bitwise.overflow|overflow
* action} to apply to the operation.
*/
onOverflow (action) {
this.overflowAction = action
return this
}
/**
* @summary Sets the action to take when the operation overflows/underflows.
*
* @param {number} action - {@link module:aerospike/bitwise.overflow|overflow
* action} to apply to the operation.
*/
OverflowableBitwiseOp.prototype.onOverflow = function (action) {
this.overflowAction = action
return this
}

/**
Expand Down
45 changes: 45 additions & 0 deletions lib/cdt_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,33 @@ class CdtContext {
return this.add(LIST_INDEX, index)
}

/**
* @summary Lookup list by base list's index offset.
*
* @description If the list at index offset is not found,
* create it with the given sort order at that index offset.
* If pad is true and the index offset is greater than the
* bounds of the base list, nil entries will be inserted before the newly
* created list.
*
* @param {number} index - List index
* @param {number} order - Sort order used if a list is created
* @param {boolean} pad - Pads list entries between index and the
* final list entry with zeros.
* @return {CdtContext} Updated CDT context, so calls can be chained.
*/
addListIndexCreate (index, order, pad) {
if (order) {
return this.add(LIST_INDEX | 0xc0, index)
} else {
if (pad) {
return this.add(LIST_INDEX | 0x80, index)
} else {
return this.add(LIST_INDEX | 0x40, index)
}
}
}

/**
* @summary Lookup list by rank.
*
Expand Down Expand Up @@ -137,6 +164,24 @@ class CdtContext {
return this.add(MAP_KEY, key)
}

/**
* @summary Lookup map by base map's key. If the map at key is not found,
* create it with the given sort order at that key.
*
* @param {any} key - Map key
* @param {number} order - Sort order used if a map is created
* @return {CdtContext} Updated CDT context, so calls can be chained.
*/
addMapKeyCreate (key, order) {
if (!order) {
return this.add(MAP_KEY | 0x40, key)
} else if (order === 1) {
return this.add(MAP_KEY | 0x80, key)
} else {
return this.add(MAP_KEY | 0xc0, key)
}
}

/**
* @summary Lookup map by value.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/exp.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ exports.mul = _VAExp(exp.ops.MUL)
exports.div = _VAExp(exp.ops.DIV)

const _paramsExp = (op) => (...params) => [
{ op: op, count: params.length + 1 },
{ op, count: params.length + 1 },
...params
]

Expand Down
2 changes: 1 addition & 1 deletion lib/exp_operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ops = as.expOperations

/**
* @protected
* @class aerospike/exp_operations~ExpOperation
* @class module:aerospike/exp_operations~ExpOperation
*
* @classdesc class for all expression operations executed with the {@link
* Client#operate} command.
Expand Down
2 changes: 1 addition & 1 deletion lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const GeoJSON = require('./geojson')
*/

/**
* @class aerospike/filter~SindexFilterPredicate
* @class module:aerospike/filter~SindexFilterPredicate
* @classdesc SI filter predicate to limit the scope of a {@link Query}.
*
* Filter predicates must be instantiated using the methods in the {@link
Expand Down
22 changes: 12 additions & 10 deletions lib/hll.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,24 @@ const GET_SIMILARITY_COMMAND = 54
const DESCRIBE_COMMAND = 55

/**
* @class aerospike/hll~HLLOperation
* @class module:aerospike/hll~HLLOperation
*
* @classdesc Use the methods in the {@link module:aerospike/hll|hll}
* module to create HLL operations for use with the {@link Client#operate}
* command.
*/
class HLLOperation extends Operation {
/**
* @summary Applies a {@link HLLPolicy} to the operation.
*
* @param {HLLPolicy} policy - Policy to apply to the operation.
*/
withPolicy (policy) {
this.policy = policy
return this
}

}

/**
* @summary Applies a {@link HLLPolicy} to the operation.
*
* @param {HLLPolicy} policy - Policy to apply to the operation.
*/
HLLOperation.prototype.withPolicy = function (policy) {
this.policy = policy
return this
}

/**
Expand Down
Loading

0 comments on commit 7335ec6

Please sign in to comment.