From 1ec3643b4ffb45827c89ab8c3fee0d5b5d7b6da8 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 04:25:55 -0600 Subject: [PATCH 1/6] Add exp.inf and exp.wildcard methods CLIENT-2378 Add exp.inf and exp.wildcard methods Add testing for exp.inf, exp.nil, and exp.wildcard --- lib/exp.js | 16 ++++++++++++++++ src/include/conversions.h | 2 ++ src/main/expressions.cc | 10 ++++++++++ src/main/util/conversions.cc | 12 ++++++++++++ test/exp.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+) diff --git a/lib/exp.js b/lib/exp.js index 44bd93ef6..b6a853719 100644 --- a/lib/exp.js +++ b/lib/exp.js @@ -208,6 +208,22 @@ exports.geo = _valueExp(exp.ops.VAL_GEO, 'value') */ exports.nil = () => [{ op: exp.ops.AS_VAL, value: null }] +/** + * Create 'inf' value. + * + * @function + * @return {AerospikeExp} + */ +exports.inf = () => [{ op: exp.ops.AS_VAL, inf: null }] + +/** + * Create 'wildcard' value. + * + * @function + * @return {AerospikeExp} + */ +exports.wildcard = () => [{ op: exp.ops.AS_VAL, wildcard: null }] + const _val = _valueExp(exp.ops.AS_VAL, 'value') /** diff --git a/src/include/conversions.h b/src/include/conversions.h index 582eafa7d..61b9e27f9 100644 --- a/src/include/conversions.h +++ b/src/include/conversions.h @@ -73,6 +73,8 @@ int get_uint64_property(uint64_t *intp, v8::Local obj, char const *prop, const LogInfo *log); int get_uint32_property(uint32_t *intp, v8::Local obj, char const *prop, const LogInfo *log); +void get_inf_property(as_val **value, const LogInfo *log); +void get_wildcard_property(as_val **value, const LogInfo *log); int get_asval_property(as_val **value, v8::Local obj, const char *prop, const LogInfo *log); int get_string_property(char **strp, v8::Local obj, diff --git a/src/main/expressions.cc b/src/main/expressions.cc index d138d58bb..11626e96f 100644 --- a/src/main/expressions.cc +++ b/src/main/expressions.cc @@ -201,6 +201,16 @@ int convert_entry(Local entry_obj, as_exp_entry *entry, return AS_NODE_PARAM_OK; } + if (Nan::Has(entry_obj, Nan::New("inf").ToLocalChecked()).FromJust()) { + entry->v.val = NULL; + get_inf_property(&entry->v.val, log); + } + + if (Nan::Has(entry_obj, Nan::New("wildcard").ToLocalChecked()).FromJust()) { + entry->v.val = NULL; + get_wildcard_property(&entry->v.val, log); + } + return rc; } diff --git a/src/main/util/conversions.cc b/src/main/util/conversions.cc index 0861ac92b..5fa22fc89 100644 --- a/src/main/util/conversions.cc +++ b/src/main/util/conversions.cc @@ -420,6 +420,18 @@ int get_optional_bytes_property(uint8_t **bytes, int *size, bool *defined, return AS_NODE_PARAM_OK; } +void get_inf_property(as_val **value, const LogInfo *log) +{ + Nan::HandleScope scope; + *value = (as_val *)&as_cmp_inf; +} + +void get_wildcard_property(as_val **value, const LogInfo *log) +{ + Nan::HandleScope scope; + *value = (as_val *)&as_cmp_wildcard; +} + int get_asval_property(as_val **value, Local obj, const char *prop, const LogInfo *log) { diff --git a/test/exp.js b/test/exp.js index e606fb5b2..b229a6456 100644 --- a/test/exp.js +++ b/test/exp.js @@ -22,6 +22,7 @@ const Aerospike = require('../lib/aerospike') const exp = Aerospike.exp const op = Aerospike.operations +const maps = Aerospike.maps const GeoJSON = Aerospike.GeoJSON @@ -236,6 +237,34 @@ describe('Aerospike.exp', function () { }) }) + describe('nil', function () { + it('evaluates to true if any expression evaluates to true', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('green'), exp.nil(), maps.returnType.COUNT), exp.int(2))) + await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.str('green'), exp.nil(), maps.returnType.COUNT), exp.int(1))) + }) + }) + + describe('inf', function () { + it('evaluates to true if any expression evaluates to true', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(1))) + await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(2))) + }) + + }) + + describe('wildcard', function () { + it('evaluates to true if any expression evaluates to true', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.wildcard(), maps.returnType.COUNT), exp.int(2))) + await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.wildcard(), maps.returnType.COUNT), exp.int(3))) + }) + }) + describe('arithmetic expressions', function () { describe('int bin add expression', function () { it('evaluates exp_read op to true if temp bin equals the sum of bin and given value', async function () { From 7545e89124cc0109714091bd852cab10a92b390f Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 04:48:08 -0600 Subject: [PATCH 2/6] Fixed segmentation fault occuring exp.maps.removeBy* and exp.lists.removeBy methods CLIENT-2488 & CLIENT-2538 Fixed segmentation fault occuring exp.maps.removeBy* and exp.lists.removeBy methods Fixed opcodes in exp.list.getByKeyList, exp.list.getByKeyRelIndexRangeToEnd, exp.getByValueList methods Added testing for all fixed methods. --- lib/exp_lists.js | 44 +-- lib/exp_maps.js | 88 +++-- test/exp_list.js | 449 ++++++++++++++++++++- test/exp_map.js | 994 ++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 1496 insertions(+), 79 deletions(-) diff --git a/lib/exp_lists.js b/lib/exp_lists.js index 94bc7b5c0..3dfd29f3d 100644 --- a/lib/exp_lists.js +++ b/lib/exp_lists.js @@ -450,9 +450,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByValue: (bin, value, ctx = null) => [ + removeByValue: (bin, value, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_ALL_BY_VALUE, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...value, ...bin ], @@ -465,9 +465,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByValueList: (bin, values, ctx = null) => [ + removeByValueList: (bin, values, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_LIST, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...values, ...bin ], @@ -483,9 +483,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByValueRange: (bin, end, begin, ctx = null) => [ + removeByValueRange: (bin, end, begin, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_INTERVAL, 3, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...begin, ...end, ...bin @@ -500,9 +500,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByRelRankRangeToEnd: (bin, rank, value, ctx = null) => [ + removeByRelRankRangeToEnd: (bin, rank, value, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...value, ...rank, ...bin @@ -519,9 +519,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByRelRankRange: (bin, count, rank, value, ctx = null) => [ + removeByRelRankRange: (bin, count, rank, value, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...value, ...rank, ...count, @@ -536,9 +536,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByIndex: (bin, idx, ctx = null) => [ + removeByIndex: (bin, idx, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...idx, ...bin ], @@ -551,9 +551,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByIndexRangeToEnd: (bin, idx, ctx = null) => [ + removeByIndexRangeToEnd: (bin, idx, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX_RANGE, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...idx, ...bin ], @@ -567,9 +567,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByIndexRange: (bin, count, idx, ctx = null) => [ + removeByIndexRange: (bin, count, idx, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_INDEX_RANGE, 3, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...idx, ...count, ...bin @@ -583,9 +583,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByRank: (bin, rank, ctx = null) => [ + removeByRank: (bin, rank, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...rank, ...bin ], @@ -598,9 +598,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByRankRangeToEnd: (bin, rank, ctx = null) => [ + removeByRankRangeToEnd: (bin, rank, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK_RANGE, 2, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...rank, ...bin ], @@ -614,9 +614,9 @@ module.exports = { * @param {AerospikeExp} ctx Optional context path for nested CDT. * @return {AerospikeExp} (list expression) */ - removeByRankRange: (bin, count, rank, ctx = null) => [ + removeByRankRange: (bin, count, rank, ctx = null, returnType = lists.returnType.NONE) => [ ..._listModify(ctx, null, lists.opcodes.REMOVE_BY_RANK_RANGE, 3, 0), - ..._int(lists.RETURN_NONE), + ..._int(lists.returnType.NONE), ...rank, ...count, ...bin diff --git a/lib/exp_maps.js b/lib/exp_maps.js index 1976a9e4b..2b78002d5 100644 --- a/lib/exp_maps.js +++ b/lib/exp_maps.js @@ -145,12 +145,13 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} key Key expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByKey: (bin, key, ctx = null) => [ + removeByKey: (bin, key, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...key, ...bin ], @@ -161,12 +162,13 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} keys List expression of keys to remove. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) * */ - removeByKeyList: (bin, keys, ctx = null) => [ + removeByKeyList: (bin, keys, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_LIST, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...keys, ...bin ], @@ -180,11 +182,12 @@ module.exports = { * @param {AerospikeExp} end End value expression. * @param {AerospikeExp} begin Begin value expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByKeyRange: (bin, end, begin, ctx = null) => [ + removeByKeyRange: (bin, end, begin, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_INTERVAL, 3, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...begin, ...end, ...bin @@ -197,11 +200,12 @@ module.exports = { * @param {AerospikeExp} idx Index integer expression. * @param {AerospikeExp} key Key expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByKeyRelIndexRangeToEnd: (bin, idx, key, ctx = null) => [ + removeByKeyRelIndexRangeToEnd: (bin, idx, key, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_REL_INDEX_RANGE, 3, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...key, ...idx, ...bin @@ -215,11 +219,12 @@ module.exports = { * @param {AerospikeExp} idx Index integer expression. * @param {AerospikeExp} key Key expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByKeyRelIndexRange: (bin, count, idx, key, ctx = null) => [ + removeByKeyRelIndexRange: (bin, count, idx, key, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_KEY_REL_INDEX_RANGE, 4, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...key, ...idx, ...count, @@ -232,11 +237,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} value Value expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByValue: (bin, value, ctx = null) => [ + removeByValue: (bin, value, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_ALL_BY_VALUE, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...value, ...bin ], @@ -247,11 +253,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} values Values list expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByValueList: (bin, values, ctx = null) => [ + removeByValueList: (bin, values, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_LIST, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...values, ...bin ], @@ -265,11 +272,12 @@ module.exports = { * @param {AerospikeExp} end End value expression. * @param {AerospikeExp} begin Begin value expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByValueRange: (bin, end, begin, ctx = null) => [ + removeByValueRange: (bin, end, begin, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_INTERVAL, 3, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...begin, ...end, ...bin @@ -282,11 +290,12 @@ module.exports = { * @param {AerospikeExp} rank Rank integer expression. * @param {AerospikeExp} value Value expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByValueRelRankRangeToEnd: (bin, rank, value, ctx = null) => [ + removeByValueRelRankRangeToEnd: (bin, rank, value, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 3, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...value, ...rank, ...bin @@ -301,11 +310,12 @@ module.exports = { * @param {AerospikeExp} rank Rank integer expression. * @param {AerospikeExp} value Value expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByValueRelRankRange: (bin, count, rank, value, ctx = null) => [ + removeByValueRelRankRange: (bin, count, rank, value, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_VALUE_REL_RANK_RANGE, 4, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...value, ...rank, ...count, @@ -318,11 +328,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} idx Index integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByIndex: (bin, idx, ctx = null) => [ + removeByIndex: (bin, idx, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...idx, ...bin ], @@ -333,11 +344,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} idx Index integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByIndexRangeToEnd: (bin, idx, ctx = null) => [ + removeByIndexRangeToEnd: (bin, idx, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX_RANGE, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...idx, ...bin ], @@ -349,11 +361,12 @@ module.exports = { * @param {AerospikeExp} count Count integer expression. * @param {AerospikeExp} idx Index integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByIndexRange: (bin, count, idx, ctx = null) => [ - ..._mapModify(ctx, null, maps.opcodes.PUT, 3, 0), - ..._int(maps.RETURN_NONE), + removeByIndexRange: (bin, count, idx, ctx = null, returnType = maps.returnType.NONE) => [ + ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_INDEX_RANGE, 3, 0), + ..._int(returnType), ...idx, ...count, ...bin @@ -365,11 +378,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} rank Rank integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByRank: (bin, rank, ctx = null) => [ + removeByRank: (bin, rank, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...rank, ...bin ], @@ -380,11 +394,12 @@ module.exports = { * @param {AerospikeExp} bin Map bin or map value expression. * @param {AerospikeExp} rank Rank integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByRankRangeToEnd: (bin, rank, ctx = null) => [ + removeByRankRangeToEnd: (bin, rank, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK_RANGE, 2, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...rank, ...bin ], @@ -396,11 +411,12 @@ module.exports = { * @param {AerospikeExp} count Count integer expression. * @param {AerospikeExp} rank Rank integer expression. * @param {AerospikeExp} ctx Optional context path for nested CDT. + * @param {AerospikeExp} returnType Optional Return type. Valid values are returnType.NONE or returnType.INVERTED. * @return {AerospikeExp} (map expression) */ - removeByRankRange: (bin, count, rank, ctx = null) => [ + removeByRankRange: (bin, count, rank, ctx = null, returnType = maps.returnType.NONE) => [ ..._mapModify(ctx, null, maps.opcodes.REMOVE_BY_RANK_RANGE, 3, 0), - ..._int(maps.RETURN_NONE), + ..._int(returnType), ...rank, ...count, ...bin @@ -476,7 +492,7 @@ module.exports = { */ getByKeyList: (bin, keys, returnType, ctx = null) => [ ..._mapRead(exp.type.AUTO, returnType, true), - ..._mapStart(ctx, maps.opcodes.GET_BY_KEY_INTERVAL, 2), + ..._mapStart(ctx, maps.opcodes.GET_BY_KEY_LIST, 2), ..._int(returnType), ...keys, ...bin @@ -495,7 +511,7 @@ module.exports = { */ getByKeyRelIndexRangeToEnd: (bin, idx, key, returnType, ctx = null) => [ ..._mapRead(exp.type.AUTO, returnType, true), - ..._mapStart(ctx, maps.opcodes.GET_BY_KEY_INTERVAL, 3), + ..._mapStart(ctx, maps.opcodes.GET_BY_KEY_REL_INDEX_RANGE, 3), ..._int(returnType), ...key, ...idx, @@ -577,7 +593,7 @@ module.exports = { */ getByValueList: (bin, values, returnType, ctx = null) => [ ..._mapRead(exp.type.AUTO, returnType, true), - ..._mapStart(ctx, maps.opcodes.GET_BY_VALUE_INTERVAL, 2), + ..._mapStart(ctx, maps.opcodes.GET_BY_VALUE_LIST, 2), ..._int(returnType), ...values, ...bin diff --git a/test/exp_list.js b/test/exp_list.js index 3d28ae5b3..dcc9d110f 100644 --- a/test/exp_list.js +++ b/test/exp_list.js @@ -84,6 +84,434 @@ describe('Aerospike.exp_operations', function () { }) }) + describe('clear', function () { + it('removes all items in a map', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.clear( + exp.binList('tags')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: [] }) + }) + + it('selects item identified by index inside nested map', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.clear( + exp.binList('tags'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', []] }) + }) + }) + + describe('removeByValue', function () { + it('removes list item by value', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValue( + exp.binList('tags'), + exp.str('green')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'yellow'] }) + }) + + it('removes list item by value in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValue( + exp.binList('tags'), + exp.str('white'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'pink', 'black']] }) + }) + }) + + describe('removeByValueList', function () { + it('removes list item by value list', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValueList( + exp.binList('tags'), + exp.list(['green', 'yellow'])), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue'] }) + }) + + it('removes list item by value list in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValueList( + exp.binList('tags'), + exp.list(['orange', 'white']), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'black']] }) + }) + }) + + describe('removeByValueRange', function () { + it('removes list item by value range', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValueRange( + exp.binList('tags'), + exp.str('green'), + exp.str('blue')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['green', 'yellow'] }) + }) + + it('removes list item by value range in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByValueRange( + exp.binList('tags'), + exp.str('pink'), + exp.str('black'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white']] }) + }) + }) + + describe('removeByRelRankRangeToEnd', function () { + it('removes list item by value relative rank range to end', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRelRankRangeToEnd( + exp.binList('tags'), + exp.int(1), + exp.str('blue')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue'] }) + }) + + it('removes list item by value relative rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRelRankRangeToEnd( + exp.binList('tags'), + exp.int(1), + exp.str('orange'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'black']] }) + }) + }) + + describe('removeByRelRankRange', function () { + it('removes list item by value relative rank range', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRelRankRange( + exp.binList('tags'), + exp.int(1), + exp.int(-1), + exp.str('green')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['green', 'yellow'] }) + }) + + it('removes list item by value relative rank range in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRelRankRange( + exp.binList('tags'), + exp.int(1), + exp.int(-1), + exp.str('pink'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white', 'black']] }) + }) + }) + + describe('removeByIndex', function () { + it('removes a list item by index', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndex( + exp.binList('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + expect(result.bins).to.eql({ tags: ['blue', 'yellow'] }) + }) + + it('removes a list item by index in a cdt context in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndex( + exp.binList('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'white', 'black']] }) + }) + }) + + describe('removeByIndexRangeToEnd', function () { + it('removes a list item by index range to end', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndexRangeToEnd( + exp.binList('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue'] }) + }) + + it('removes a list item by index range to end in a cdt context in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndexRangeToEnd( + exp.binList('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange']] }) + }) + }) + + describe('removeByIndexRange', function () { + it('removes a list item by index range', async function () { + const key = await createRecord({ tags: ['blue', 'green', 'yellow'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndexRange( + exp.binList('tags'), + exp.int(2), + exp.int(0)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['yellow'] }) + }) + + it('removes a list item by index range in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByIndexRange( + exp.binList('tags'), + exp.int(2), + exp.int(0), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['white', 'black']] }) + }) + }) + + describe('removeByRank', function () { + it('removes a list item by rank', async function () { + const key = await createRecord({ tags: ['yellow', 'green', 'blue'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRank( + exp.binList('tags'), + exp.int(2)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['green', 'blue'] }) + }) + + it('removes a list item by rank in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRank( + exp.binList('tags'), + exp.int(2), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['orange', 'white', 'black']] }) + }) + }) + + describe('removeByRankRangeToEnd', function () { + it('removes a list item by rank range to end', async function () { + const key = await createRecord({ tags: ['yellow', 'green', 'blue'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRankRangeToEnd( + exp.binList('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue'] }) + }) + + it('removes a list item by rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRankRangeToEnd( + exp.binList('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['black']] }) + }) + }) + + describe('removeByRankRange', function () { + it('removes a list item by rank range', async function () { + const key = await createRecord({ tags: ['yellow', 'green', 'blue'] }) + + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRankRange( + exp.binList('tags'), + exp.int(2), + exp.int(0)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['yellow'] }) + }) + + it('removes a list item by rank range in a cdt context', async function () { + const key = await createRecord({ tags: ['blue', 'green', ['orange', 'pink', 'white', 'black']] }) + const context = new Context().addListIndex(2) + const ops = [ + exp.operations.write('tags', + exp.lists.removeByRankRange( + exp.binList('tags'), + exp.int(2), + exp.int(0), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: ['blue', 'green', ['pink', 'white']] }) + }) + }) + describe('getByValue', function () { it('matches the count of the matched list values', async function () { const key = await createRecord({ tags: ['blue', 'green', 'yellow', 'green'] }) @@ -292,7 +720,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5]) expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, 6]) }) @@ -307,7 +735,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5, [4]]) expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 6]]) }) @@ -323,7 +751,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5]) expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, 2, 3, 4, 5]) }) @@ -338,7 +766,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5, [80, 90, 100]]) expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [80, 90, 100, 2, 3, 4, 5, [80, 90, 100]]]) }) @@ -354,7 +782,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5]) expect(result.bins.ExpVar).to.eql([2, 3, 6, 4, 5]) }) @@ -369,7 +797,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5, [4, 1, 9]]) expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [4, 1, 7, 9]]) }) @@ -384,7 +812,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, 4, 5]) expect(result.bins.ExpVar).to.eql([2, 2, 3, 4, 5, 3, 4, 5]) }) @@ -399,7 +827,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.list).to.eql([2, 3, [9, 9]]) expect(result.bins.ExpVar).to.eql([2, 3, [9, 2, 3, [9, 9], 9]]) }) @@ -418,7 +846,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - // console.log(result) + expect(result.bins.ExpVar).to.eql([5, 5, 4, 4, 3, 3, 2, 2]) expect(result.bins.list).to.eql([2, 2, 3, 4, 5, 3, 4, 5]) }) @@ -433,8 +861,7 @@ describe('Aerospike.exp_operations', function () { op.read('list') ] const result = await client.operate(key, ops, {}) - console.log(result.bins.ExpVar) - // console.log(result) + expect(result.bins.ExpVar).to.eql([2, 3, 4, 5, [100, 9]]) expect(result.bins.list).to.eql([2, 3, 4, 5, [9, 100]]) }) diff --git a/test/exp_map.js b/test/exp_map.js index 81f801709..5f69179d3 100644 --- a/test/exp_map.js +++ b/test/exp_map.js @@ -109,6 +109,967 @@ describe('Aerospike.exp_operations', function () { }) }) + describe('removeByKey', function () { + it('removes map item by key', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKey( + exp.binMap('tags'), + exp.str('a')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } }) + }) + + it('removes map item by key in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKey( + exp.binMap('tags'), + exp.str('e'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByKeyList', function () { + it('removes map item by key list', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyList( + exp.binMap('tags'), + exp.list(['a', 'b'])), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'yellow' } }) + }) + + it('removes map item by key list in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyList( + exp.binMap('tags'), + exp.list(['d', 'e']), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByKeyRange', function () { + it('removes map item by key range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRange( + exp.binMap('tags'), + exp.str('c'), + exp.str('a')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'yellow' } }) + }) + + it('removes map item by key range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRange( + exp.binMap('tags'), + exp.str('h'), + exp.str('e'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } }) + }) + + it('removes inverted map item by key range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRange( + exp.binMap('tags'), + exp.str('c'), + exp.str('a'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } }) + }) + + it('removes inverted map item by key range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRange( + exp.binMap('tags'), + exp.str('h'), + exp.str('e'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByKeyRelIndexRangeToEnd', function () { + it('removes map item by key relative index range to end', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('b')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } }) + }) + + it('removes map item by key relative index range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('e'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } }) + }) + + it('removes inverted map item by key relative index range to end', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('b'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'yellow' } }) + }) + + it('removes inverted map item by key relative index range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('e'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByKeyRelIndexRange', function () { + it('removes map item by key relative index range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + exp.str('a')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'yellow' } }) + }) + + it('removes map item by key relative index range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + exp.str('d'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } }) + }) + + it('removes inverted map item by key relative index range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + exp.str('a'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } }) + }) + + it('removes inverted map item by key relative index range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByKeyRelIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + exp.str('a'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } }) + }) + }) + + describe('removeByValue', function () { + it('removes map item by value', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValue( + exp.binMap('tags'), + exp.str('green')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', c: 'yellow' } }) + }) + + it('removes map item by value in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValue( + exp.binMap('tags'), + exp.str('white'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', g: 'black' } } }) + }) + }) + + describe('removeByValueList', function () { + it('removes map item by value list', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueList( + exp.binMap('tags'), + exp.list(['green', 'yellow'])), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue' } }) + }) + + it('removes map item by value list in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueList( + exp.binMap('tags'), + exp.list(['orange', 'white']), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', g: 'black' } } }) + }) + }) + + describe('removeByValueRange', function () { + it('removes map item by value range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRange( + exp.binMap('tags'), + exp.str('green'), + exp.str('blue')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } }) + }) + + it('removes map item by value range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRange( + exp.binMap('tags'), + exp.str('pink'), + exp.str('black'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white' } } }) + }) + + it('removes inverted map item by value range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRange( + exp.binMap('tags'), + exp.str('green'), + exp.str('blue'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue' } }) + }) + + it('removes inverted map item by value range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRange( + exp.binMap('tags'), + exp.str('pink'), + exp.str('black'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } }) + }) + }) + + describe('removeByValueRelRankRangeToEnd', function () { + it('removes map item by value relative rank range to end', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('blue')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'blue' } }) + }) + + it('removes map item by value relative rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('orange'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } }) + }) + + it('removes inverted map item by value relative rank range to end', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('blue'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } }) + }) + + it('removes inverted map item by value relative rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + exp.str('black'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white' } } }) + }) + }) + + describe('removeByValueRelRankRange', function () { + it('removes map item by value relative rank range', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRange( + exp.binMap('tags'), + exp.int(1), + exp.int(-1), + exp.str('green')), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } }) + }) + + it('removes map item by value relative rank range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRange( + exp.binMap('tags'), + exp.int(1), + exp.int(-1), + exp.str('pink'), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } }) + }) + + it('removes inverted map item by value relative rank range', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRange( + exp.binMap('tags'), + exp.int(1), + exp.int(-1), + exp.str('green'), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'blue' } }) + }) + + it('removes inverted map item by value relative rank range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByValueRelRankRange( + exp.binMap('tags'), + exp.int(1), + exp.int(-1), + exp.str('pink'), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } }) + }) + }) + + describe('removeByIndex', function () { + it('removes a map item by index', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndex( + exp.binMap('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + let result = await client.operate(key, ops, {}) + result = await client.get(key) + console.log(result) + expect(result.bins).to.eql({ tags: { a: 'blue', c: 'yellow' } }) + }) + + it('removes a map item by index in a cdt context in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndex( + exp.binMap('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + let result = await client.operate(key, ops, {}) + result = await client.get(key) + console.log(result) + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByIndexRangeToEnd', function () { + it('removes a map item by index range to end', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue' } }) + }) + + it('removes a map item by index range to end in a cdt context in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange' } } }) + }) + + it('removes an inverted map item by index range to end', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { b: 'green', c: 'yellow' } }) + }) + + it('removes an inverted map item by index range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRangeToEnd( + exp.binMap('tags'), + exp.int(1), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByIndexRange', function () { + it('removes a map item by index range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'yellow' } }) + }) + + it('removes a map item by index range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { f: 'white', g: 'black' } } }) + }) + + it('removes a inverted map item by index range', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', b: 'green' } }) + }) + + it('removes a inverted map item by index range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByIndexRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink' } } }) + }) + }) + + describe('removeByRank', function () { + it('removes a map item by rank', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRank( + exp.binMap('tags'), + exp.int(2)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { b: 'green', c: 'blue' } }) + }) + + it('removes a map item by rank in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRank( + exp.binMap('tags'), + exp.int(2), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', f: 'white', g: 'black' } } }) + }) + }) + + describe('removeByRankRangeToEnd', function () { + it('removes a map item by rank range to end', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRangeToEnd( + exp.binMap('tags'), + exp.int(1)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { c: 'blue' } }) + }) + + it('removes a map item by rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { g: 'black' } } }) + }) + + it('removes an inverted map item by rank range to end', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'yellow', b: 'green' } }) + }) + + it('removes an inverted map item by rank range to end in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRangeToEnd( + exp.binMap('tags'), + exp.int(1), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white' } } }) + }) + }) + + describe('removeByRankRange', function () { + it('removes a map item by rank range', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0)), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'yellow' } }) + }) + + it('removes a map item by rank range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + context), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { e: 'pink', f: 'white' } } }) + }) + + it('removes an inverted map item by rank range', async function () { + const key = await createRecord({ tags: { a: 'yellow', b: 'green', c: 'blue' } }) + + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + null, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { b: 'green', c: 'blue' } }) + }) + + it('removes an inverted map item by rank range in a cdt context', async function () { + const key = await createRecord({ tags: { a: 'blue', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + const ops = [ + exp.operations.write('tags', + exp.maps.removeByRankRange( + exp.binMap('tags'), + exp.int(2), + exp.int(0), + context, + maps.returnType.INVERTED), + 0), + op.read('tags') + ] + const result = await client.operate(key, ops, {}) + + expect(result.bins).to.eql({ tags: { a: 'blue', nested: { d: 'orange', g: 'black' } } }) + }) + }) + describe('getByIndex', function () { it('selects item identified by index', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) @@ -264,6 +1225,21 @@ describe('Aerospike.exp_operations', function () { }) }) + describe('getByKeyList', function () { + it('matches the count of the matched map values', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) + await testNoMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['a', 'b']), maps.returnType.COUNT), exp.int(1))) + await testMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['a', 'b']), maps.returnType.COUNT), exp.int(2))) + }) + + it('matches the count of the matched map values of a nested map', async function () { + const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) + const context = new Context().addMapKey('nested') + await testNoMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['d', 'e']), maps.returnType.COUNT, context), exp.int(1))) + await testMatch(key, exp.eq(exp.maps.getByKeyList(exp.binMap('tags'), exp.list(['d', 'e']), maps.returnType.COUNT, context), exp.int(2))) + }) + }) + describe('getByKeyRange', function () { it('matches the count of the matched map values', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) @@ -293,7 +1269,7 @@ describe('Aerospike.exp_operations', function () { await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRange(exp.binMap('tags'), exp.int(3), exp.int(0), exp.str('g'), maps.returnType.COUNT, context), exp.int(2))) }) }) - /* + describe('getByKeyRelIndexRangeToEnd', function () { it('matches the count of the matched map values', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', d: 'yellow' } }) @@ -304,11 +1280,11 @@ describe('Aerospike.exp_operations', function () { it('matches the count of the matched map values of a nested map', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', g: 'white', h: 'black' } } }) const context = new Context().addMapKey('nested') - await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(2))) - await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(3))) + await testNoMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(2))) + await testMatch(key, exp.eq(exp.maps.getByKeyRelIndexRangeToEnd(exp.binMap('tags'), exp.int(0), exp.str('e'), maps.returnType.COUNT, context), exp.int(3))) }) }) -*/ + describe('getByRank', function () { it('selects map item identified by rank', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', d: 5, c: 'yellow' } }) @@ -472,24 +1448,22 @@ describe('Aerospike.exp_operations', function () { }) }) - /* describe('getByValueList', function () { it('matches the count of the matched values', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow' } }) - await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('green'), exp.str('yellow')]), maps.returnType.COUNT), exp.int(3))) - await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('green'), exp.str('yellow')]), maps.returnType.COUNT), exp.int(2))) + await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['green', 'yellow']), maps.returnType.COUNT), exp.int(3))) + await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['green', 'yellow']), maps.returnType.COUNT), exp.int(2))) }) it('matches the count of the matched values', async function () { const key = await createRecord({ tags: { a: 'blue', b: 'green', c: 'yellow', nested: { d: 'orange', e: 'pink', f: 'white', g: 'black' } } }) const context = new Context().addMapKey('nested') - await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('orange'), exp.str('white')]), maps.returnType.COUNT, context), exp.int(3))) - await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list([exp.str('orange'), exp.str('white')]), maps.returnType.COUNT, context), exp.int(2))) + await testNoMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['orange', 'white']), maps.returnType.COUNT, context), exp.int(3))) + await testMatch(key, exp.eq(exp.maps.getByValueList(exp.binMap('tags'), exp.list(['orange', 'white']), maps.returnType.COUNT, context), exp.int(2))) }) }) -*/ describe('getByValueRange', function () { it('matches the count of the matched range of map values', async function () { From be3926790e36db44200372a0628778d20c91d5e8 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 05:20:58 -0600 Subject: [PATCH 3/6] Added Bin class and support for Javascript Maps and the new Bin class in put operations. CLIENT-1983 Added Bin class. Added support for the Bin class in put operations. Added support for Javascript Maps in put operations. Note: Javascript Maps become Key Ordered Maps before being sent to the server. --- lib/aerospike.js | 8 ++++ lib/bin.js | 60 +++++++++++++++++++++++++++ src/include/conversions.h | 2 + src/main/map_operations.cc | 9 +++- src/main/util/conversions.cc | 79 +++++++++++++++++++++++++++++------- test/maps.js | 10 +++++ test/put.js | 38 +++++++++++++++-- 7 files changed, 187 insertions(+), 19 deletions(-) create mode 100644 lib/bin.js diff --git a/lib/aerospike.js b/lib/aerospike.js index 0e2414097..b5f0b230b 100644 --- a/lib/aerospike.js +++ b/lib/aerospike.js @@ -264,6 +264,14 @@ exports.Key = require('./key') */ exports.Record = require('./record') +/** + * In the Aerospike database, each record (similar to a row in a relational database) stores + * data using one or more bins (like columns in a relational database). + * + * @summary {@link Bin} class + */ +exports.Bin = require('./bin') + // ======================================================================== // Enumerations // ======================================================================== diff --git a/lib/bin.js b/lib/bin.js new file mode 100644 index 000000000..032a8b2b7 --- /dev/null +++ b/lib/bin.js @@ -0,0 +1,60 @@ +// ***************************************************************************** +// Copyright 2023 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ***************************************************************************** + +'use strict' + +/** + * @class Bin + * @classdesc Aerospike Bin + * + * In the Aerospike database, each record (similar to a row in a relational database) stores + * data using one or more bins (like columns in a relational database). The major difference + * between bins and RDBMS columns is that you don't need to define a schema. Each record can + * have multiple bins. Bins accept the data types listed {@link https://docs.aerospike.com/apidocs/nodejs/#toc4__anchor|here}. + * + * For information about these data types and how bins support them, see {@link https://docs.aerospike.com/server/guide/data-types/scalar-data-types|this}. + * + * Although the bin for a given record or object must be typed, bins in different rows do not + * have to be the same type. There are some internal performance optimizations for single-bin namespaces. + * + * @summary Construct a new Aerospike Bin instance. + * + */ +class Bin { + /** @private */ + constructor (name, value, mapOrder) { + /** + * Bin name. + * + * @member {String} Bin#name + */ + this.name = name + + /** + * Bin value. + * + * @member {Any} Bin#value + */ + if(mapOrder === 1){ + this.value = new Map(Object.entries(value)) + } + else{ + this.value = value + } + } +} + +module.exports = Bin \ No newline at end of file diff --git a/src/include/conversions.h b/src/include/conversions.h index 582eafa7d..ce44183a7 100644 --- a/src/include/conversions.h +++ b/src/include/conversions.h @@ -177,6 +177,8 @@ int list_from_jsarray(as_list **list, v8::Local array, const LogInfo *log); int map_from_jsobject(as_map **map, v8::Local obj, const LogInfo *log); +int map_from_jsmap(as_map **map, v8::Local obj, + const LogInfo *log); int asval_from_jsvalue(as_val **value, v8::Local v8value, const LogInfo *log); int string_from_jsarray(char*** roles, int roles_size, v8::Local role_array, const LogInfo *log); diff --git a/src/main/map_operations.cc b/src/main/map_operations.cc index eca3a24d3..ab244d5a9 100644 --- a/src/main/map_operations.cc +++ b/src/main/map_operations.cc @@ -157,7 +157,14 @@ bool add_map_put_items_op(as_operations *ops, const char *bin, as_v8_error(log, "Type error: items property should be an Object"); return false; } - if (map_from_jsobject(&items, v8items.As(), log) != + if(v8items->IsMap()){ + if (map_from_jsmap(&items, v8items.As(), log) != + AS_NODE_PARAM_OK) { + as_v8_error(log, "Type error: items property should be an Object"); + return false; + } + } + else if (map_from_jsobject(&items, v8items.As(), log) != AS_NODE_PARAM_OK) { as_v8_error(log, "Type error: items property should be an Object"); return false; diff --git a/src/main/util/conversions.cc b/src/main/util/conversions.cc index 0861ac92b..11e603f7b 100644 --- a/src/main/util/conversions.cc +++ b/src/main/util/conversions.cc @@ -37,8 +37,7 @@ extern "C" { #include #include #include -#include -#include +#include #include #include #include @@ -61,6 +60,7 @@ using namespace v8; const char *DoubleType = "Double"; const char *GeoJSONType = "GeoJSON"; +const char *BinType = "Bin"; const int64_t MIN_SAFE_INTEGER = -1 * (std::pow(2, 53) - 1); const int64_t MAX_SAFE_INTEGER = std::pow(2, 53) - 1; @@ -620,19 +620,20 @@ as_val *asval_clone(const as_val *val, const LogInfo *log) break; } case AS_MAP: { - as_hashmap *map = (as_hashmap *)as_map_fromval(val); + as_orderedmap *map = (as_orderedmap *)as_map_fromval(val); clone_val = - as_map_toval((as_map *)as_hashmap_new(as_hashmap_size(map))); - as_hashmap_iterator it; - as_hashmap_iterator_init(&it, map); - while (as_hashmap_iterator_has_next(&it)) { - as_pair *pair = (as_pair *)as_hashmap_iterator_next(&it); + as_map_toval((as_map *)as_orderedmap_new(as_orderedmap_size(map))); + as_orderedmap_iterator it; + as_orderedmap_iterator_init(&it, map); + while (as_orderedmap_iterator_has_next(&it)) { + as_pair *pair = (as_pair *)as_orderedmap_iterator_next(&it); as_val *orig_key = as_pair_1(pair); as_val *orig_val = as_pair_2(pair); as_val *clone_key = asval_clone(orig_key, log); as_val *clone_mapval = asval_clone(orig_val, log); - as_hashmap_set((as_hashmap *)clone_val, clone_key, clone_mapval); + as_orderedmap_set((as_orderedmap *)clone_val, clone_key, clone_mapval); } + as_orderedmap_set_flags((as_orderedmap *)clone_val, (as_orderedmap *)val->_.flags); as_v8_detail(log, "Cloning a map SUCCESS"); break; } @@ -860,12 +861,12 @@ Local val_to_jsvalue(as_val *val, const LogInfo *log) } case AS_MAP: { Local jsobj = Nan::New(); - as_hashmap *map = (as_hashmap *)as_map_fromval(val); - as_hashmap_iterator it; - as_hashmap_iterator_init(&it, map); + as_orderedmap *map = (as_orderedmap *)as_map_fromval(val); + as_orderedmap_iterator it; + as_orderedmap_iterator_init(&it, map); - while (as_hashmap_iterator_has_next(&it)) { - as_pair *p = (as_pair *)as_hashmap_iterator_next(&it); + while (as_orderedmap_iterator_has_next(&it)) { + as_pair *p = (as_pair *)as_orderedmap_iterator_next(&it); as_val *key = as_pair_1(p); as_val *val = as_pair_2(p); Nan::Set(jsobj, val_to_jsvalue(key, log), val_to_jsvalue(val, log)); @@ -1026,6 +1027,11 @@ bool is_geojson_value(Local value) return instanceof (value, GeoJSONType); } +bool is_bin_value(Local value) +{ + return instanceof (value, BinType); +} + char *geojson_as_string(Local value) { Local strval = @@ -1081,6 +1087,31 @@ int map_from_jsobject(as_map **map, Local obj, const LogInfo *log) return AS_NODE_PARAM_OK; } +int map_from_jsmap(as_map **map, Local obj, const LogInfo *log) +{ + const Local data = obj->AsArray(); + const uint32_t capacity = data->Length(); + as_v8_detail(log, "Creating new as_orderedmap with capacity %d", capacity); + as_orderedmap *orderedmap = as_orderedmap_new(capacity); + if (orderedmap == NULL) { + as_v8_error(log, "Map allocation failed"); + Nan::ThrowError("Map allocation failed"); + return AS_NODE_PARAM_ERR; + } + *map = (as_map *)orderedmap; + + for (uint32_t i = 0; i < capacity; i = i + 2) { + const Local name = Nan::Get(data, i).ToLocalChecked(); + const Local value = Nan::Get(data, i+1).ToLocalChecked(); + as_val *val = NULL; + if (asval_from_jsvalue(&val, value, log) != AS_NODE_PARAM_OK) { + return AS_NODE_PARAM_ERR; + } + as_stringmap_set(*map, *Nan::Utf8String(name), val); + } + return AS_NODE_PARAM_OK; +} + int asval_from_jsvalue(as_val **value, Local v8value, const LogInfo *log) { if (v8value->IsNull()) { @@ -1145,6 +1176,12 @@ int asval_from_jsvalue(as_val **value, Local v8value, const LogInfo *log) return AS_NODE_PARAM_ERR; } } + else if (v8value->IsMap()) { + if (map_from_jsmap((as_map **)value, v8value.As(), log) != + AS_NODE_PARAM_OK) { + return AS_NODE_PARAM_ERR; + } + } else if (is_geojson_value(v8value)) { char *jsonstr = geojson_as_string(v8value); *value = (as_val *)as_geojson_new(jsonstr, true); @@ -1242,6 +1279,11 @@ int privileges_from_jsarray(as_privilege*** privileges, int privileges_size, Loc int recordbins_from_jsobject(as_record *rec, Local obj, const LogInfo *log) { + if (is_bin_value(obj)) { + Local jsobj = Nan::New(); + Nan::Set(jsobj, Nan::Get(obj, Nan::New("name").ToLocalChecked()).ToLocalChecked(), Nan::Get(obj, Nan::New("value").ToLocalChecked()).ToLocalChecked()); + obj = jsobj; + } const Local props = Nan::GetOwnPropertyNames(obj).ToLocalChecked(); const uint32_t count = props->Length(); as_record_init(rec, count); @@ -1319,6 +1361,15 @@ int recordbins_from_jsobject(as_record *rec, Local obj, as_record_set_list(rec, *n, list); continue; } + if (value->IsMap()) { + as_map *map; + if (map_from_jsmap(&map, value.As(), log) != + AS_NODE_PARAM_OK) { + return AS_NODE_PARAM_ERR; + } + as_record_set_map(rec, *n, map); + continue; + } if (value->IsObject()) { as_map *map; if (map_from_jsobject(&map, value.As(), log) != diff --git a/test/maps.js b/test/maps.js index 40f613a73..aae92cb73 100644 --- a/test/maps.js +++ b/test/maps.js @@ -253,6 +253,16 @@ describe('client.operate() - CDT Map operations', function () { .then(cleanup()) }) + it('adds each item from the Map class to the map and returns the size of the map', function () { + console.log(maps.putItems('map', new Map([ ['e', 150,], ['d', 100], ['c', 99]]))) + return initState() + .then(createRecord({ map: { a: 1, b: 2, c: 3 } })) + .then(operate(maps.putItems('map', new Map([ ['e', 150], ['d', 100], ['c', 99]])))) + .then(assertResultEql({ map: 4 })) + .then(assertRecordEql({ map: { a: 1, b: 2, c: 99, d: 100 } })) + .then(cleanup()) + }) + context('with update-only flag', function () { helper.skipUnlessVersion('>= 4.3.0', this) diff --git a/test/put.js b/test/put.js index 01ec814dd..28536b565 100644 --- a/test/put.js +++ b/test/put.js @@ -240,11 +240,12 @@ describe('client.put()', function () { putGetVerify(record, expected, done) }) - it.skip('writes bin with Map value as map and reads it back', function (done) { + it('writes bin with Map value as map and reads it back as an ordered object', function (done) { const record = { - map: new Map([['a', 1], ['b', 'foo'], ['c', 1.23], + map: new Map([['g', [1, 2, 3]], ['h', { a: 1, b: 2 }], ['j', new Map([['b', 'foo'], ['a', 1]])], ['d', new Double(3.14)], ['e', Buffer.from('bar')], ['f', GeoJSON.Point(103.8, 1.283)], - ['g', [1, 2, 3]], ['h', { a: 1, b: 2 }]]) + ['a', 1], ['b', 'foo'], ['c', 1.23]] + ) } const expected = { map: { @@ -255,7 +256,36 @@ describe('client.put()', function () { e: Buffer.from('bar'), f: '{"type":"Point","coordinates":[103.8,1.283]}', g: [1, 2, 3], - h: { a: 1, b: 2 } + h: { a: 1, b: 2 }, + j: { a: 1, b: 'foo'} + } + } + putGetVerify(record, expected, done) + }) + + it('writes bin with the Bin class and reads it back as an object', function (done) { + const record = new Aerospike.Bin('map', { + g: [1, 2, 3], + h: { a: 1, b: 2 }, + j: new Map([['b', 'foo'], ['a', 1]]), + e: Buffer.from('bar'), + f: '{"type":"Point","coordinates":[103.8,1.283]}', + a: 1, + b: 'foo', + c: 1.23, + d: 3.14 + }) + const expected = { + map: { + a: 1, + b: 'foo', + c: 1.23, + d: 3.14, + e: Buffer.from('bar'), + f: '{"type":"Point","coordinates":[103.8,1.283]}', + g: [1, 2, 3], + h: { a: 1, b: 2 }, + j: { a: 1, b: 'foo'} } } putGetVerify(record, expected, done) From bd340d54fd2bbbe8286594177106e45661180818 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 05:52:26 -0600 Subject: [PATCH 4/6] Switched from Ink-docstrap to Docdash Switched from Ink-docstrap to Docdash for API documentation generation. --- jsdoc.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/jsdoc.json b/jsdoc.json index fe9bd60c6..6b570d6be 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -24,10 +24,27 @@ "domain": "aerospike.com" } }, + "docdash": { + "sectionOrder": [ + "Modules", + "Classes", + "Events", + "Tutorials", + "Global" + ],"meta": { + "title": "Aerospike Node.js Client API Documentation", + "description": "Explore the comprehensive documentation for the Aerospike Node.js Client API, covering usage, configuration, and examples. Learn how to integrate Aerospike with your Node.js applications efficiently.", + "keyword": "Aerospike, Node.js, Client API, Documentation, Usage, Configuration, Examples, Integration" + } + }, "opts": { "destination": "./build/apidocs", - "template": "./node_modules/ink-docstrap/template", + "template": "./node_modules/docdash", "readme": "./docs/overview.md", - "tutorials" : "./docs/tutorials" + "tutorials" : "./docs/tutorials", + "recurse": true, + "verbose": true } + + } \ No newline at end of file From 5c063408320a4925be111b6548aa7da70ebff726 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 07:24:57 -0600 Subject: [PATCH 5/6] Readded Typescript support. CLIENT-2374 Added Typescript typings file. Organized typescript components in alphabetical order. Fixed casting error. Fixed putItems test case. ran npm lint. --- lib/bin.js | 11 +- src/main/util/conversions.cc | 2 +- test/exp.js | 1 - test/maps.js | 8 +- test/put.js | 26 +- tsconfig.json | 5 +- typings/autoIndex.d.ts | 1709 ------------------ typings/index.d.ts | 3311 ++++++++++++++++++---------------- 8 files changed, 1820 insertions(+), 3253 deletions(-) delete mode 100644 typings/autoIndex.d.ts diff --git a/lib/bin.js b/lib/bin.js index 032a8b2b7..2ba7e73f1 100644 --- a/lib/bin.js +++ b/lib/bin.js @@ -24,9 +24,9 @@ * data using one or more bins (like columns in a relational database). The major difference * between bins and RDBMS columns is that you don't need to define a schema. Each record can * have multiple bins. Bins accept the data types listed {@link https://docs.aerospike.com/apidocs/nodejs/#toc4__anchor|here}. - * + * * For information about these data types and how bins support them, see {@link https://docs.aerospike.com/server/guide/data-types/scalar-data-types|this}. - * + * * Although the bin for a given record or object must be typed, bins in different rows do not * have to be the same type. There are some internal performance optimizations for single-bin namespaces. * @@ -48,13 +48,12 @@ class Bin { * * @member {Any} Bin#value */ - if(mapOrder === 1){ + if (mapOrder === 1) { this.value = new Map(Object.entries(value)) - } - else{ + } else { this.value = value } } } -module.exports = Bin \ No newline at end of file +module.exports = Bin diff --git a/src/main/util/conversions.cc b/src/main/util/conversions.cc index 1b8d85b49..3ea176eea 100644 --- a/src/main/util/conversions.cc +++ b/src/main/util/conversions.cc @@ -645,7 +645,7 @@ as_val *asval_clone(const as_val *val, const LogInfo *log) as_val *clone_mapval = asval_clone(orig_val, log); as_orderedmap_set((as_orderedmap *)clone_val, clone_key, clone_mapval); } - as_orderedmap_set_flags((as_orderedmap *)clone_val, (as_orderedmap *)val->_.flags); + as_orderedmap_set_flags((as_orderedmap *)clone_val, map->_.flags); as_v8_detail(log, "Cloning a map SUCCESS"); break; } diff --git a/test/exp.js b/test/exp.js index b229a6456..e00c30a55 100644 --- a/test/exp.js +++ b/test/exp.js @@ -253,7 +253,6 @@ describe('Aerospike.exp', function () { await testNoMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(1))) await testMatch(key, exp.eq(exp.maps.getByValueRange(exp.binMap('tags'), exp.inf(), exp.str('green'), maps.returnType.COUNT), exp.int(2))) }) - }) describe('wildcard', function () { diff --git a/test/maps.js b/test/maps.js index aae92cb73..2455db4eb 100644 --- a/test/maps.js +++ b/test/maps.js @@ -254,12 +254,12 @@ describe('client.operate() - CDT Map operations', function () { }) it('adds each item from the Map class to the map and returns the size of the map', function () { - console.log(maps.putItems('map', new Map([ ['e', 150,], ['d', 100], ['c', 99]]))) + console.log(maps.putItems('map', new Map([['e', 150], ['d', 100], ['c', 99]]))) return initState() .then(createRecord({ map: { a: 1, b: 2, c: 3 } })) - .then(operate(maps.putItems('map', new Map([ ['e', 150], ['d', 100], ['c', 99]])))) - .then(assertResultEql({ map: 4 })) - .then(assertRecordEql({ map: { a: 1, b: 2, c: 99, d: 100 } })) + .then(operate(maps.putItems('map', new Map([['e', 150], ['d', 100], ['c', 99]])))) + .then(assertResultEql({ map: 5 })) + .then(assertRecordEql({ map: { a: 1, b: 2, c: 99, d: 100, e: 150 } })) .then(cleanup()) }) diff --git a/test/put.js b/test/put.js index 28536b565..3dab71b5c 100644 --- a/test/put.js +++ b/test/put.js @@ -245,7 +245,7 @@ describe('client.put()', function () { map: new Map([['g', [1, 2, 3]], ['h', { a: 1, b: 2 }], ['j', new Map([['b', 'foo'], ['a', 1]])], ['d', new Double(3.14)], ['e', Buffer.from('bar')], ['f', GeoJSON.Point(103.8, 1.283)], ['a', 1], ['b', 'foo'], ['c', 1.23]] - ) + ) } const expected = { map: { @@ -257,7 +257,7 @@ describe('client.put()', function () { f: '{"type":"Point","coordinates":[103.8,1.283]}', g: [1, 2, 3], h: { a: 1, b: 2 }, - j: { a: 1, b: 'foo'} + j: { a: 1, b: 'foo' } } } putGetVerify(record, expected, done) @@ -265,16 +265,16 @@ describe('client.put()', function () { it('writes bin with the Bin class and reads it back as an object', function (done) { const record = new Aerospike.Bin('map', { - g: [1, 2, 3], - h: { a: 1, b: 2 }, - j: new Map([['b', 'foo'], ['a', 1]]), - e: Buffer.from('bar'), - f: '{"type":"Point","coordinates":[103.8,1.283]}', - a: 1, - b: 'foo', - c: 1.23, - d: 3.14 - }) + g: [1, 2, 3], + h: { a: 1, b: 2 }, + j: new Map([['b', 'foo'], ['a', 1]]), + e: Buffer.from('bar'), + f: '{"type":"Point","coordinates":[103.8,1.283]}', + a: 1, + b: 'foo', + c: 1.23, + d: 3.14 + }) const expected = { map: { a: 1, @@ -285,7 +285,7 @@ describe('client.put()', function () { f: '{"type":"Point","coordinates":[103.8,1.283]}', g: [1, 2, 3], h: { a: 1, b: 2 }, - j: { a: 1, b: 'foo'} + j: { a: 1, b: 'foo' } } } putGetVerify(record, expected, done) diff --git a/tsconfig.json b/tsconfig.json index 8684691ad..9cb2ada86 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,9 @@ "es2020", "dom" ], + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, "removeComments": true, "alwaysStrict": true, "pretty": false, @@ -25,4 +28,4 @@ "skipLibCheck": true, "baseUrl": ".", } -} +} \ No newline at end of file diff --git a/typings/autoIndex.d.ts b/typings/autoIndex.d.ts deleted file mode 100644 index 3fc72ccea..000000000 --- a/typings/autoIndex.d.ts +++ /dev/null @@ -1,1709 +0,0 @@ -declare module 'aerospike/aerospike' { - export var filter: typeof import("aerospike/filter"); - export var exp: typeof import("aerospike/exp"); - export namespace regex { - const BASIC: number; - const EXTENDED: number; - const ICASE: number; - const NEWLINE: number; - } - export type regex = number; - export var info: typeof import("aerospike/info"); - export var lists: typeof import("aerospike/lists"); - export var hll: typeof import("aerospike/hll"); - export var maps: typeof import("aerospike/maps"); - export namespace cdt { - const Context: typeof import("aerospike/cdt_context"); - } - export var bitwise: typeof import("aerospike/bitwise"); - export var operations: typeof import("aerospike/operations"); - export var policy: typeof import("aerospike/policy"); - export var BasePolicy: typeof import("aerospike/policies/base_policy"); - export var ApplyPolicy: typeof import("aerospike/policies/apply_policy"); - export var BatchPolicy: typeof import("aerospike/policies/batch_policy"); - export var OperatePolicy: typeof import("aerospike/policies/operate_policy"); - export var QueryPolicy: typeof import("aerospike/policies/query_policy"); - export var ReadPolicy: typeof import("aerospike/policies/read_policy"); - export var RemovePolicy: typeof import("aerospike/policies/remove_policy"); - export var ScanPolicy: typeof import("aerospike/policies/scan_policy"); - export var WritePolicy: typeof import("aerospike/policies/write_policy"); - export var BatchApplyPolicy: typeof import("aerospike/policies/batch_apply_policy"); - export var BatchReadPolicy: typeof import("aerospike/policies/batch_read_policy"); - export var BatchRemovePolicy: typeof import("aerospike/policies/batch_remove_policy"); - export var BatchWritePolicy: typeof import("aerospike/policies/batch_write_policy"); - export var CommandQueuePolicy: typeof import("aerospike/policies/command_queue_policy"); - export var InfoPolicy: typeof import("aerospike/policies/info_policy"); - export var ListPolicy: typeof import("aerospike/policies/list_policy"); - export var MapPolicy: typeof import("aerospike/policies/map_policy"); - export var status: typeof import("aerospike/status"); - export var features: typeof import("aerospike/features"); - export { AerospikeError }; - export var Client: typeof import("aerospike/client"); - export var Config: typeof import("aerospike/config"); - export var Double: typeof import("aerospike/double"); - export var GeoJSON: typeof import("aerospike/geojson"); - export var Key: typeof import("aerospike/key"); - export var Record: typeof import("aerospike/record"); - export type auth = number; - export type language = number; - export type log = number; - export type ttl = number; - export type jobStatus = number; - export type indexDataType = number; - export type indexType = number; - export var print: typeof import("aerospike/utils").print; - export var releaseEventLoop: typeof EventLoop.releaseEventLoop; - export function client(config?: any): import("aerospike/client"); - export function connect(config?: any, callback?: connectCallback | undefined): Promise | null; - export function setDefaultLogging(logInfo: any): void; - export function setupGlobalCommandQueue(policy: CommandQueuePolicy): void; - export var batchType: { - BATCH_READ: any; - BATCH_WRITE: any; - BATCH_APPLY: any; - BATCH_REMOVE: any; - }; - import AerospikeError = require("./error"); - import EventLoop = require("./event_loop"); - -} -declare module 'aerospike/batch_type' { - export const BATCH_READ: any; - export const BATCH_WRITE: any; - export const BATCH_APPLY: any; - export const BATCH_REMOVE: any; - -} -declare module 'aerospike/bigint' { - export var BigInt: any; - export var bigIntSupported: boolean; - export function isInt64(value: any): boolean; - -} -declare module 'aerospike/bitwise' { - export function resize(bin: string, size: number, flags?: number | undefined): BitwiseOperation; - export function insert(bin: string, byteOffset: any, value: Buffer): BitwiseOperation; - export function remove(bin: string, byteOffset: number, byteSize: number): BitwiseOperation; - export function set(bin: string, bitOffset: number, bitSize: number, value: number | Buffer): BitwiseOperation; - export function or(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function xor(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function and(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function not(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; - export function lshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; - export function rshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; - export function add(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; - export function subtract(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; - export function get(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; - export function getInt(bin: string, bitOffset: number, bitSize: number, sign: boolean): BitwiseOperation; - export function lscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; - export function rscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; - class BitwiseOperation extends Operation { - withPolicy(policy: BitwisePolicy): BitwiseOperation; - policy: any; - } - class OverflowableBitwiseOp extends BitwiseOperation { - overflowAction: any; - onOverflow(action: number): OverflowableBitwiseOp; - } - import Operation_1 = require("./operations"); - import Operation = Operation_1.Operation; - export {}; - -} -declare module 'aerospike/cdt_context' { - export = CdtContext; - class CdtContext { - static getContextType(ctx: CdtContext, type: number): number; - items: any[]; - addListIndex(index: number): CdtContext; - addListIndexCreate(index: number, order: number, pad: boolean): CdtContext; - addListRank(rank: number): CdtContext; - addListValue(value: any): CdtContext; - addMapIndex(index: number): CdtContext; - addMapRank(rank: number): CdtContext; - addMapKey(key: any): CdtContext; - addMapKeyCreate(key: any, order: number): CdtContext; - addMapValue(value: any): CdtContext; - private add; - } - -} -declare module 'aerospike/client' { - export = Client; - function Client(config: Config): void; - class Client { - constructor(config: Config); - config: Config; - private as_client; - private connected; - captureStackTraces: boolean; - private asExec; - getNodes(): Array<{ - name: string; - address: string; - }>; - addSeedHost(hostname: string, port?: number | undefined): void; - removeSeedHost(hostname: string, port?: number | undefined): void; - batchExists(keys: Key[], policy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchGet(keys: Key[], policy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchRead(records: { - type: number; - key: Key; - bins?: string[]; - readAllBins?: boolean; - }, policy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchWrite(records: { - type: number; - key: Key; - }, policy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchApply(records: { - type: number; - key: Key; - }, udf: object[], batchPolicy?: any, batchApplyPolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchRemove(records: { - type: number; - key: Key; - }, batchPolicy?: any, batchRemovePolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchSelect(keys: Key[], bins: string[], policy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - close(releaseEventLoop?: boolean | undefined): void; - connect(callback?: connectCallback | undefined): Promise | null; - createIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - datatype: any; - }, policy?: any, callback?: jobCallback | undefined): Promise | null; - createIntegerIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: any, callback?: jobCallback | undefined): Promise | null; - createStringIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: any, callback?: jobCallback | undefined): Promise | null; - createGeo2DSphereIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: any, callback?: jobCallback | undefined): Promise | null; - apply(key: Key, udfArgs: { - module: string; - funcname: string; - args: Array<(number | string)>; - }, policy?: any, callback?: valueCallback | undefined): Promise | null; - exists(key: Key, policy?: any, callback?: valueCallback | undefined): Promise | null; - get(key: Key, policy?: any, callback?: recordCallback | undefined): Promise | null; - indexRemove(namespace: string, index: string, policy?: any, callback?: doneCallback | undefined): Promise | null; - info(request: string | null, host: { - addr: string; - port?: number | undefined; - }, policy?: any, callback?: infoCallback | undefined): any; - infoAny(request?: string | undefined, policy?: any, callback?: infoCallback | undefined): any; - infoAll(request?: string | undefined, policy?: any, callback?: infoCallback | undefined): any; - infoNode(request: string | null, node: { - name: string; - }, policy?: any, callback?: infoCallback | undefined): any; - isConnected(checkTenderErrors?: boolean | undefined): boolean; - operate(key: Key, operations: any, metadata?: any, policy?: any, callback?: recordCallback | undefined): any; - incr: any; - put(key: Key, bins: object, meta?: object, policy?: any, callback?: writeCallback | undefined): any; - query(ns: string, set: string, options?: object): Query; - remove(key: Key, policy?: any, callback?: writeCallback | undefined): any; - scan(ns: string, set: string, options?: object): Scan; - select(key: Key, bins: string[], policy?: any, callback?: recordCallback | undefined): any; - truncate(ns: string, set: string, beforeNanos: any, policy?: any, callback?: doneCallback | undefined): any; - udfRegister(udfPath: any, udfType?: number | undefined, policy?: any, callback?: jobCallback | undefined): any; - stats(): ClientStats; - udfRemove(udfModule: string, policy?: any, callback?: jobCallback | undefined): any; - updateLogging(logConfig: any): void; - } - import Config = require("./config"); - import Query = require("./query"); - import Scan = require("./scan"); - -} -declare module 'aerospike/commands/batch_command' { - function _exports(asCommand: any): { - new (): { - convertResult(results: any): any; - }; - }; - export = _exports; - -} -declare module 'aerospike/commands/command' { - const _exports: Class; - export = _exports; - -} -declare module 'aerospike/commands/connect_command' { - function _exports(asCommand: any): { - new (client: any, callback: any): { - ensureConnected: boolean; - }; - }; - export = _exports; - -} -declare module 'aerospike/commands/exists_command' { - function _exports(asCommand: any): { - new (): { - convertResponse(error: any): any[]; - }; - }; - export = _exports; - -} -declare module 'aerospike/commands/index' { - class ApplyCommand { - } - const BatchExistsCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchExistsCommand extends BatchExistsCommand_base { - } - const BatchGetCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchGetCommand extends BatchGetCommand_base { - } - const BatchReadCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchReadCommand extends BatchReadCommand_base { - } - const BatchWriteCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchWriteCommand extends BatchWriteCommand_base { - } - const BatchApplyCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchApplyCommand extends BatchApplyCommand_base { - } - const BatchRemoveCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchRemoveCommand extends BatchRemoveCommand_base { - } - const BatchSelectCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchSelectCommand extends BatchSelectCommand_base { - } - const ConnectCommand_base: { - new (client: any, callback: any): { - ensureConnected: boolean; - }; - }; - class ConnectCommand extends ConnectCommand_base { - } - const ExistsCommand_base: { - new (): { - convertResponse(error: any): any[]; - }; - }; - class ExistsCommand extends ExistsCommand_base { - } - const GetCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class GetCommand extends GetCommand_base { - } - class IndexCreateCommand { - } - class IndexRemoveCommand { - } - class InfoAnyCommand { - } - class InfoForeachCommand { - } - class InfoHostCommand { - } - class InfoNodeCommand { - } - class JobInfoCommand { - } - const OperateCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class OperateCommand extends OperateCommand_base { - } - const PutCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - class PutCommand extends PutCommand_base { - } - const QueryCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class QueryCommand extends QueryCommand_base { - } - class QueryApplyCommand { - } - const QueryBackgroundCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("aerospike/job"); - }; - }; - class QueryBackgroundCommand extends QueryBackgroundCommand_base { - } - const QueryOperateCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("aerospike/job"); - }; - }; - class QueryOperateCommand extends QueryOperateCommand_base { - } - const QueryForeachCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class QueryForeachCommand extends QueryForeachCommand_base { - } - const RemoveCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - class RemoveCommand extends RemoveCommand_base { - } - const ScanCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class ScanCommand extends ScanCommand_base { - } - const ScanBackgroundCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("aerospike/job"); - }; - }; - class ScanBackgroundCommand extends ScanBackgroundCommand_base { - } - const ScanOperateCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("aerospike/job"); - }; - }; - class ScanOperateCommand extends ScanOperateCommand_base { - } - const SelectCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class SelectCommand extends SelectCommand_base { - } - class TruncateCommand { - } - class UdfRegisterCommand { - } - class UdfRemoveCommand { - } - export { ApplyCommand as Apply, BatchExistsCommand as BatchExists, BatchGetCommand as BatchGet, BatchReadCommand as BatchRead, BatchWriteCommand as BatchWrite, BatchApplyCommand as BatchApply, BatchRemoveCommand as BatchRemove, BatchSelectCommand as BatchSelect, ConnectCommand as Connect, ExistsCommand as Exists, GetCommand as Get, IndexCreateCommand as IndexCreate, IndexRemoveCommand as IndexRemove, InfoAnyCommand as InfoAny, InfoForeachCommand as InfoForeach, InfoHostCommand as InfoHost, InfoNodeCommand as InfoNode, JobInfoCommand as JobInfo, OperateCommand as Operate, PutCommand as Put, QueryCommand as Query, QueryApplyCommand as QueryApply, QueryBackgroundCommand as QueryBackground, QueryOperateCommand as QueryOperate, QueryForeachCommand as QueryForeach, RemoveCommand as Remove, ScanCommand as Scan, ScanBackgroundCommand as ScanBackground, ScanOperateCommand as ScanOperate, SelectCommand as Select, TruncateCommand as Truncate, UdfRegisterCommand as UdfRegister, UdfRemoveCommand as UdfRemove }; - -} -declare module 'aerospike/commands/query_background_command' { - function _exports(asCommand: any): { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): Job; - }; - }; - export = _exports; - import Job = require("../job"); - -} -declare module 'aerospike/commands/read_record_command' { - function _exports(asCommand: any): { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - export = _exports; - -} -declare module 'aerospike/commands/stream_command' { - function _exports(asCommand: any): { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - export = _exports; - -} -declare module 'aerospike/commands/write_record_command' { - function _exports(asCommand: any): { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - export = _exports; - -} -declare module 'aerospike/config' { - export = Config; - class Config { - constructor(config?: any); - user: any; - password: any; - authMode: any; - clusterName: string; - port: any; - tls: any; - hosts: (Host[] | string); - policies: Policies; - log: any; - connTimeoutMs: any; - loginTimeoutMs: any; - maxSocketIdle: any; - tenderInterval: any; - maxConnsPerNode: any; - minConnsPerNode: any; - modlua: any; - sharedMemory: any; - useAlternateAccessAddress: boolean; - rackAware: boolean; - rackId: any; - setDefaultPolicies(policies: any): void; - private [inspect]; - } - const inspect: unique symbol; - -} -declare module 'aerospike/double' { - export = Double; - function Double(value: number): void; - class Double { - constructor(value: number); - Double: number; - value(): number; - } - -} -declare module 'aerospike/error' { - export = AerospikeError; - class AerospikeError extends Error { - private static fromASError; - private static copyASErrorProperties; - private static formatMessage; - private constructor(); - code: number; - command: any | null; - func: string | null; - file: string | null; - line: number | null; - inDoubt: boolean; - private setStackTrace; - isServerError(): boolean; - get client(): any; - } - -} -declare module 'aerospike/event_loop' { - export function releaseEventLoop(): void; - export function registerASEventLoop(): void; - export function referenceEventLoop(): void; - export function unreferenceEventLoop(): void; - export function setCommandQueuePolicy(policy: any): void; - -} -declare module 'aerospike/exp' { - export function bool(value: any): { - [x: number]: any; - op: any; - }[]; - export function int(value: any): { - [x: number]: any; - op: any; - }[]; - export function uint(value: any): { - [x: number]: any; - op: any; - }[]; - export function float(value: any): { - [x: number]: any; - op: any; - }[]; - export function str(value: any): { - [x: number]: any; - op: any; - }[]; - export function bytes(value: any, size: any): { - [x: number]: any; - op: any; - }[]; - export function geo(value: any): { - [x: number]: any; - op: any; - }[]; - export function nil(): { - op: any; - value: null; - }[]; - export function keyInt(): { - [x: number]: any; - op: any; - }[]; - export function keyStr(): { - [x: number]: any; - op: any; - }[]; - export function keyBlob(): { - [x: number]: any; - op: any; - }[]; - export function keyExist(): AerospikeExp; - export function binBool(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binInt(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binFloat(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binStr(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binBlob(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binGeo(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binList(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binMap(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binHll(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binType(binName: any): ({ - op: any; - strVal: any; - } | { - op: any; - count: number; - })[]; - export function binExists(binName: string): boolean; - export function setName(): { - op: any; - count: number; - }[]; - export function deviceSize(): { - op: any; - count: number; - }[]; - export function lastUpdate(): { - op: any; - count: number; - }[]; - export function sinceUpdate(): { - op: any; - count: number; - }[]; - export function voidTime(): { - op: any; - count: number; - }[]; - export function ttl(): { - op: any; - count: number; - }[]; - export function isTombstone(): { - op: any; - count: number; - }[]; - export function memorySize(): { - op: any; - count: number; - }[]; - export function digestModulo(): { - op: any; - count: number; - }[]; - export function eq(left: any, right: any): { - op: any; - count: number; - }[]; - export function ne(left: any, right: any): { - op: any; - count: number; - }[]; - export function gt(left: any, right: any): { - op: any; - count: number; - }[]; - export function ge(left: any, right: any): { - op: any; - count: number; - }[]; - export function lt(left: any, right: any): { - op: any; - count: number; - }[]; - export function le(left: any, right: any): { - op: any; - count: number; - }[]; - export function cmpRegex(options: number, regex: string, cmpStr: AerospikeExp): AerospikeExp; - export function cmpGeo(left: any, right: any): { - op: any; - count: number; - }[]; - export function not(expr: AerospikeExp): AerospikeExp; - export function and(...expr: any[]): never[]; - export function or(...expr: any[]): never[]; - export function exclusive(...expr: any[]): never[]; - export function add(...expr: any[]): never[]; - export function sub(...expr: any[]): never[]; - export function mul(...expr: any[]): never[]; - export function div(...expr: any[]): never[]; - export function pow(...params: any[]): any[]; - export function log(...params: any[]): any[]; - export function mod(...params: any[]): any[]; - export function abs(...params: any[]): any[]; - export function floor(...params: any[]): any[]; - export function ceil(...params: any[]): any[]; - export function toInt(...params: any[]): any[]; - export function toFloat(...params: any[]): any[]; - export function intAnd(...expr: any[]): never[]; - export function intOr(...expr: any[]): never[]; - export function intXor(...expr: any[]): never[]; - export function intNot(...params: any[]): any[]; - export function intLshift(...params: any[]): any[]; - export function intRshift(...params: any[]): any[]; - export function intArshift(...params: any[]): any[]; - export function intCount(...params: any[]): any[]; - export function intLscan(...params: any[]): any[]; - export function intRscan(...params: any[]): any[]; - export function min(...expr: any[]): never[]; - export function max(...expr: any[]): never[]; - export function cond(...expr: any[]): never[]; - function _let(...expr: any[]): never[]; - export function def(varName: string, expr: AerospikeExp): AerospikeExp; - function _var(varName: string): AerospikeExp; - export var lists: { - size: (bin: any, ctx?: any) => any; - getByValue: (bin: any, value: any, returnType: any, ctx?: any) => any; - getByValueRange: (bin: any, begin: any, end: any, returnType: any, ctx?: any) => any; - getByValueList: (bin: any, value: any, returnType: any, ctx?: any) => any; - getByRelRankRangeToEnd: (bin: any, value: any, rank: any, returnType: any, ctx?: any) => any; - getByRelRankRange: (bin: any, value: any, rank: any, count: any, returnType: any, ctx?: any) => any; - getByIndex: (bin: any, index: any, valueType: any, returnType: any, ctx?: any) => any; - getByIndexRangeToEnd: (bin: any, index: any, returnType: any, ctx?: any) => any; - getByIndexRange: (bin: any, index: any, count: any, returnType: any, ctx?: any) => any; - getByRank: (bin: any, rank: any, valueType: any, returnType: any, ctx?: any) => any; - getByRankRangeToEnd: (bin: any, rank: any, returnType: any, ctx?: any) => any; - getByRankRange: (bin: any, rank: any, count: any, returnType: any, ctx?: any) => any; - append: (bin: any, value: any, policy?: any, ctx?: any) => any; - appendItems: (bin: any, value: any, policy?: any, ctx?: any) => any; - insert: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; - insertItems: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; - increment: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; - set: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; - clear: (bin: any, ctx?: any) => any; - sort: (bin: any, order: number, ctx?: any) => any; - removeByValue: (bin: any, value: any, ctx?: any) => any; - removeByValueList: (bin: any, values: any, ctx?: any) => any; - removeByValueRange: (bin: any, end: any, begin: any, ctx?: any) => any; - removeByRelRankRangeToEnd: (bin: any, rank: any, value: any, ctx?: any) => any; - removeByRelRankRange: (bin: any, count: any, rank: any, value: any, ctx?: any) => any; - removeByIndex: (bin: any, idx: any, ctx?: any) => any; - removeByIndexRangeToEnd: (bin: any, idx: any, ctx?: any) => any; - removeByIndexRange: (bin: any, count: any, idx: any, ctx?: any) => any; - removeByRank: (bin: any, rank: any, ctx?: any) => any; - removeByRankRangeToEnd: (bin: any, rank: any, ctx?: any) => any; - removeByRankRange: (bin: any, count: any, rank: any, ctx?: any) => any; - }; - export var maps: { - put: (bin: any, value: any, key: any, policy?: any, ctx?: any) => any; - putItems: (bin: any, map: any, policy?: any, ctx?: any) => any; - increment: (bin: any, value: any, key: any, policy?: any, ctx?: any) => any; - clear: (bin: any, ctx?: any) => any; - removeByKey: (bin: any, key: any, ctx?: any) => any; - removeByKeyList: (bin: any, keys: any, ctx?: any) => any; - removeByKeyRange: (bin: any, end: any, begin: any, ctx?: any) => any; - removeByKeyRelIndexRangeToEnd: (bin: any, idx: any, key: any, ctx?: any) => any; - removeByKeyRelIndexRange: (bin: any, count: any, idx: any, key: any, ctx?: any) => any; - removeByValue: (bin: any, value: any, ctx?: any) => any; - removeByValueList: (bin: any, values: any, ctx?: any) => any; - removeByValueRange: (bin: any, end: any, begin: any, ctx?: any) => any; - removeByValueRelRankRangeToEnd: (bin: any, rank: any, value: any, ctx?: any) => any; - removeByValueRelRankRange: (bin: any, count: any, rank: any, value: any, key: any, ctx?: any) => any; - removeByIndex: (bin: any, idx: any, ctx?: any) => any; - removeByIndexRangeToEnd: (bin: any, idx: any, ctx?: any) => any; - removeByIndexRange: (bin: any, count: any, idx: any, ctx?: any) => any; - removeByRank: (bin: any, rank: any, ctx?: any) => any; - removeByRankRangeToEnd: (bin: any, rank: any, ctx?: any) => any; - removeByRankRange: (bin: any, count: any, rank: any, ctx?: any) => any; - size: (bin: any, ctx?: any) => any; - getByKey: (bin: any, key: any, valueType: any, returnType: any, ctx?: any) => any; - getByKeyRange: (bin: any, end: any, begin: any, returnType: any, ctx?: any) => any; - getByKeyList: (bin: any, keys: any, returnType: any, ctx?: any) => any; - getByKeyRelIndexRangeToEnd: (bin: any, idx: any, key: any, returnType: any, ctx?: any) => any; - getByKeyRelIndexRange: (bin: any, count: any, idx: any, key: any, returnType: any, ctx?: any) => any; - getByValue: (bin: any, value: any, returnType: any, ctx?: any) => any; - getByValueRange: (bin: any, end: any, begin: any, returnType: any, ctx?: any) => any; - getByValueList: (bin: any, values: any, returnType: any, ctx?: any) => any; - getByValueRelRankRangeToEnd: (bin: any, rank: any, value: any, returnType: any, ctx?: any) => any; - getByValueRelRankRange: (bin: any, count: any, rank: any, value: any, returnType: any, ctx?: any) => any; - getByIndex: (bin: any, idx: any, valueType: any, returnType: any, ctx?: any) => any; - getByIndexRangeToEnd: (bin: any, idx: any, returnType: any, ctx?: any) => any; - getByIndexRange: (bin: any, count: any, idx: any, returnType: any, ctx?: any) => any; - getByRank: (bin: any, rank: any, valueType: any, returnType: any, ctx?: any) => any; - getByRankRangeToEnd: (bin: any, rank: any, returnType: any, ctx?: any) => any; - getByRankRange: (bin: any, count: any, rank: any, returnType: any, ctx?: any) => any; - }; - export var bit: { - reSize: (bin: any, flags: number, byteSize: number, policy?: any) => any; - insert: (bin: any, value: any, byteOffset: any, policy?: any) => any; - remove: (bin: any, byteSize: number, byteOffset: any, policy?: any) => any; - set: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - or: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - xor: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - and: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - not: (bin: any, bitSize: any, bitOffset: any, policy?: any) => any; - lShift: (bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any) => any; - rShift: (bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any) => any; - add: (bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - subtract: (bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - setInt: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; - get: (bin: any, bitSize: any, bitOffset: any) => any; - count: (bin: any, bitSize: any, bitOffset: any) => number; - lScan: (bin: any, value: any, bitSize: any, bitOffset: any) => number; - rScan: (bin: any, value: any, bitSize: any, bitOffset: any) => number; - getInt: (bin: any, sign: boolean, bitSize: any, bitOffset: any) => any; - }; - export var hll: { - initMH: (bin: any, mhBitCount: number, indexBitCount: number, policy?: any) => any; - init: (bin: any, indexBitCount: number, policy?: any) => any; - addMH: (bin: any, mhBitCount: number, indexBitCount: number, list: any, policy?: any) => any; - add: (bin: any, indexBitCount: number, list: any, policy?: any) => any; - update: (bin: any, list: any, policy?: any) => any; - getCount: (bin: any) => any; - getUnion: (bin: any, list: any) => any; - getUnionCount: (bin: any, list: any) => any; - getIntersectCount: (bin: any, list: any) => any; - getSimilarity: (bin: any, list: any) => any[]; - describe: (bin: any) => any; - mayContain: (bin: any, list: any) => any; - }; - function _val(value: any): { - [x: number]: any; - op: any; - }[]; - export { _val as list, _val as map, _let as let, _var as var }; - -} -declare module 'aerospike/exp_bit' { - export function reSize(bin: any, flags: number, byteSize: number, policy?: any): any; - export function insert(bin: any, value: any, byteOffset: any, policy?: any): any; - export function remove(bin: any, byteSize: number, byteOffset: any, policy?: any): any; - export function set(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function or(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function xor(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function and(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function not(bin: any, bitSize: any, bitOffset: any, policy?: any): any; - export function lShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; - export function rShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; - export function add(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function subtract(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function setInt(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function get(bin: any, bitSize: any, bitOffset: any): any; - export function count(bin: any, bitSize: any, bitOffset: any): number; - export function lScan(bin: any, value: any, bitSize: any, bitOffset: any): number; - export function rScan(bin: any, value: any, bitSize: any, bitOffset: any): number; - export function getInt(bin: any, sign: boolean, bitSize: any, bitOffset: any): any; - -} -declare module 'aerospike/exp_hll' { - export function initMH(bin: any, mhBitCount: number, indexBitCount: number, policy?: any): any; - export function init(bin: any, indexBitCount: number, policy?: any): any; - export function addMH(bin: any, mhBitCount: number, indexBitCount: number, list: any, policy?: any): any; - export function add(bin: any, indexBitCount: number, list: any, policy?: any): any; - export function update(bin: any, list: any, policy?: any): any; - export function getCount(bin: any): any; - export function getUnion(bin: any, list: any): any; - export function getUnionCount(bin: any, list: any): any; - export function getIntersectCount(bin: any, list: any): any; - export function getSimilarity(bin: any, list: any): any[]; - export function describe(bin: any): any; - export function mayContain(bin: any, list: any): any; - -} -declare module 'aerospike/exp_lists' { - export function size(bin: any, ctx?: any): any; - export function getByValue(bin: any, value: any, returnType: any, ctx?: any): any; - export function getByValueRange(bin: any, begin: any, end: any, returnType: any, ctx?: any): any; - export function getByValueList(bin: any, value: any, returnType: any, ctx?: any): any; - export function getByRelRankRangeToEnd(bin: any, value: any, rank: any, returnType: any, ctx?: any): any; - export function getByRelRankRange(bin: any, value: any, rank: any, count: any, returnType: any, ctx?: any): any; - export function getByIndex(bin: any, index: any, valueType: any, returnType: any, ctx?: any): any; - export function getByIndexRangeToEnd(bin: any, index: any, returnType: any, ctx?: any): any; - export function getByIndexRange(bin: any, index: any, count: any, returnType: any, ctx?: any): any; - export function getByRank(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; - export function getByRankRangeToEnd(bin: any, rank: any, returnType: any, ctx?: any): any; - export function getByRankRange(bin: any, rank: any, count: any, returnType: any, ctx?: any): any; - export function append(bin: any, value: any, policy?: any, ctx?: any): any; - export function appendItems(bin: any, value: any, policy?: any, ctx?: any): any; - export function insert(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - export function insertItems(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - export function increment(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - export function set(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - export function clear(bin: any, ctx?: any): any; - export function sort(bin: any, order: number, ctx?: any): any; - export function removeByValue(bin: any, value: any, ctx?: any): any; - export function removeByValueList(bin: any, values: any, ctx?: any): any; - export function removeByValueRange(bin: any, end: any, begin: any, ctx?: any): any; - export function removeByRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any): any; - export function removeByRelRankRange(bin: any, count: any, rank: any, value: any, ctx?: any): any; - export function removeByIndex(bin: any, idx: any, ctx?: any): any; - export function removeByIndexRangeToEnd(bin: any, idx: any, ctx?: any): any; - export function removeByIndexRange(bin: any, count: any, idx: any, ctx?: any): any; - export function removeByRank(bin: any, rank: any, ctx?: any): any; - export function removeByRankRangeToEnd(bin: any, rank: any, ctx?: any): any; - export function removeByRankRange(bin: any, count: any, rank: any, ctx?: any): any; - -} -declare module 'aerospike/exp_maps' { - export function put(bin: any, value: any, key: any, policy?: any, ctx?: any): any; - export function putItems(bin: any, map: any, policy?: any, ctx?: any): any; - export function increment(bin: any, value: any, key: any, policy?: any, ctx?: any): any; - export function clear(bin: any, ctx?: any): any; - export function removeByKey(bin: any, key: any, ctx?: any): any; - export function removeByKeyList(bin: any, keys: any, ctx?: any): any; - export function removeByKeyRange(bin: any, end: any, begin: any, ctx?: any): any; - export function removeByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, ctx?: any): any; - export function removeByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, ctx?: any): any; - export function removeByValue(bin: any, value: any, ctx?: any): any; - export function removeByValueList(bin: any, values: any, ctx?: any): any; - export function removeByValueRange(bin: any, end: any, begin: any, ctx?: any): any; - export function removeByValueRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any): any; - export function removeByValueRelRankRange(bin: any, count: any, rank: any, value: any, key: any, ctx?: any): any; - export function removeByIndex(bin: any, idx: any, ctx?: any): any; - export function removeByIndexRangeToEnd(bin: any, idx: any, ctx?: any): any; - export function removeByIndexRange(bin: any, count: any, idx: any, ctx?: any): any; - export function removeByRank(bin: any, rank: any, ctx?: any): any; - export function removeByRankRangeToEnd(bin: any, rank: any, ctx?: any): any; - export function removeByRankRange(bin: any, count: any, rank: any, ctx?: any): any; - export function size(bin: any, ctx?: any): any; - export function getByKey(bin: any, key: any, valueType: any, returnType: any, ctx?: any): any; - export function getByKeyRange(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; - export function getByKeyList(bin: any, keys: any, returnType: any, ctx?: any): any; - export function getByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, returnType: any, ctx?: any): any; - export function getByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, returnType: any, ctx?: any): any; - export function getByValue(bin: any, value: any, returnType: any, ctx?: any): any; - export function getByValueRange(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; - export function getByValueList(bin: any, values: any, returnType: any, ctx?: any): any; - export function getByValueRelRankRangeToEnd(bin: any, rank: any, value: any, returnType: any, ctx?: any): any; - export function getByValueRelRankRange(bin: any, count: any, rank: any, value: any, returnType: any, ctx?: any): any; - export function getByIndex(bin: any, idx: any, valueType: any, returnType: any, ctx?: any): any; - export function getByIndexRangeToEnd(bin: any, idx: any, returnType: any, ctx?: any): any; - export function getByIndexRange(bin: any, count: any, idx: any, returnType: any, ctx?: any): any; - export function getByRank(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; - export function getByRankRangeToEnd(bin: any, rank: any, returnType: any, ctx?: any): any; - export function getByRankRange(bin: any, count: any, rank: any, returnType: any, ctx?: any): any; - -} -declare module 'aerospike/exp_operations' { - export function read(bin: string, exp: any, flags: any): Operation; - export function write(bin: string, exp: any, flags: any): Operation; - export class ExpOperation { - constructor(op: any, bin: any, exp: any, flags: any, props: any); - op: any; - bin: any; - exp: any; - flags: any; - } - -} -declare module 'aerospike/features' { - export var CDT_MAP: string; - export var CDT_LIST: string; - export var BLOB_BITS: string; - -} -declare module 'aerospike/filter' { - export function range(bin: string, min: number, max: number, indexType?: number | undefined): any; - export function equal(bin: string, value: string): any; - export function contains(bin: string, value: (string | number), indexType: number): any; - export function geoWithinGeoJSONRegion(bin: string, value: GeoJSON, indexType?: number | undefined): any; - export function geoContainsGeoJSONPoint(bin: string, value: GeoJSON, indexType?: number | undefined): any; - export function geoWithinRadius(bin: string, lon: any, lat: number, radius: number, indexType?: number | undefined): any; - export function geoContainsPoint(bin: string, lon: any, lat: number, indexType?: number | undefined): any; - export class SindexFilterPredicate { - constructor(predicate: any, bin: any, dataType: any, indexType: any, props: any); - predicate: any; - bin: any; - datatype: any; - type: any; - } - import GeoJSON = require("./geojson"); - -} -declare module 'aerospike/geojson' { - export = GeoJSON; - function GeoJSON(json: any): GeoJSON; - class GeoJSON { - constructor(json: any); - str: string | undefined; - toJSON(): any; - toString(): string; - value(): any; - } - namespace GeoJSON { - function Point(lng: number, lat: number): GeoJSON; - function Polygon(...args: number[][]): GeoJSON; - function Circle(lng: number, lat: number, radius: number): GeoJSON; - } - -} -declare module 'aerospike/hll' { - export function init(bin: string, indexBits: number, minhashBits?: number | undefined): any; - export function add(bin: string, list: any[], indexBits?: number | undefined, minhashBits?: number | undefined): any; - export function setUnion(bin: string, list: any[]): any; - export function refreshCount(bin: string): any; - export function fold(bin: string, indexBits: number): any; - export function getCount(bin: string): any; - export function getUnion(bin: string, list: any[]): any; - export function getUnionCount(bin: string, list: any[]): any; - export function getIntersectCount(bin: string, list: any[]): any; - export function getSimilarity(bin: string, list: any[]): any; - export function describe(bin: string): any; - -} -declare module 'aerospike/index_job' { - export = IndexJob; - function IndexJob(client: any, namespace: any, indexName: any): void; - class IndexJob { - constructor(client: any, namespace: any, indexName: any); - client: any; - namespace: any; - indexName: any; - private hasCompleted; - private info; - } - -} -declare module 'aerospike/info' { - export function parse(info: string): any; - export const separators: { - bins: (string | typeof splitBins)[]; - 'bins/*': (typeof splitBins)[]; - 'namespace/*': string[]; - service: string[]; - sindex: string[]; - 'sindex/*': string[]; - 'sindex/*/**': string[]; - 'udf-list': string[]; - 'get-dc-config': string[]; - sets: string[]; - 'sets/*': string[]; - 'sets/*/**': (string | typeof chop)[]; - }; - function splitBins(str: any): { - stats: {}; - names: any[]; - }; - function chop(str: any): any; - export {}; - -} -declare module 'aerospike/job' { - export = Job; - function Job(client: any, jobID: any, module: any): void; - class Job { - constructor(client: any, jobID: any, module: any); - client: any; - jobID: any; - module: any; - private hasCompleted; - private checkStatus; - info(policy: any, callback?: JobinfoCallback | undefined): Promise | null; - wait(pollInterval?: number | undefined, callback?: JobdoneCallback | undefined): Promise | null; - waitUntilDone: any; - } - namespace Job { - function safeRandomJobID(): number; - function pollUntilDone(statusFunction: any, pollInterval: any): Promise; - } - -} -declare module 'aerospike/key' { - export = Key; - function Key(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined): void; - class Key { - constructor(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined); - ns: string; - set: string; - key: any; - digest: string | null; - equals(other: any): any; - } - namespace Key { - function fromASKey(keyObj: any): Key | null; - } - -} -declare module 'aerospike/lists' { - export function setOrder(bin: string, order: number): any; - export function sort(bin: string, flags: number): any; - export function append(bin: string, value: any, policy?: any): any; - export function appendItems(bin: string, list: Array, policy?: any): any; - export function insert(bin: string, index: number, value: any, policy?: any): any; - export function insertItems(bin: string, index: number, list: Array, policy: any): any; - export function pop(bin: string, index: number): any; - export function popRange(bin: string, index: number, count?: number | undefined): any; - export function remove(bin: string, index: number): any; - export function removeRange(bin: string, index: number, count?: number | undefined): any; - export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; - export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function clear(bin: string): any; - export function set(bin: string, index: number, value: any, policy?: any): any; - export function trim(bin: string, index: number, count: number): any; - export function get(bin: string, index: number): any; - export function getRange(bin: string, index: number, count?: number | undefined): any; - export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByValue(bin: string, value: any, returnType?: number | undefined): any; - export function getByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function getByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function increment(bin: string, index: number, value?: number | undefined, policy?: any): any; - export function size(bin: string): any; - -} -declare module 'aerospike/maps' { - export function setPolicy(bin: string, policy: MapPolicy): any; - export function put(bin: string, key: any, value: any, policy?: any): any; - export function putItems(bin: string, items: object, policy?: any): any; - export function increment(bin: string, key: any, incr: number, policy?: any): any; - export function decrement(bin: string, key: any, decr: number, policy?: any): any; - export function clear(bin: string): any; - export function removeByKey(bin: string, key: any, returnType?: number | undefined): any; - export function removeByKeyList(bin: string, keys: Array, returnType?: number | undefined): any; - export function removeByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; - export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function size(bin: string): any; - export function getByKey(bin: string, key: any, returnType?: number | undefined): any; - export function getByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByValue(bin: string, value: any, returnType?: number | undefined): any; - export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function getByRankRange(bin: string, rank: any, count: number, returnType?: number | undefined): any; - -} -declare module 'aerospike/operations' { - export function read(bin: string): Operation; - export function write(bin: string, value: any): Operation; - export function add(bin: string, value: (number | any)): Operation; - export function incr(bin: any, value: any): Operation; - export function append(bin: string, value: (string | Buffer)): Operation; - export function prepend(bin: string, value: (string | Buffer)): Operation; - export function touch(ttl?: number | undefined): Operation; - function _delete(): Operation; - export class Operation { - constructor(op: any, bin: any, props: any); - op: any; - bin: any; - } - export { _delete as delete }; - -} -declare module 'aerospike/policies/apply_policy' { - export = ApplyPolicy; - class ApplyPolicy extends BasePolicy { - key: number; - commitLevel: number; - ttl: number; - durableDelete: boolean; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/base_policy' { - export = BasePolicy; - class BasePolicy { - constructor(props: any); - socketTimeout: number; - totalTimeout: number; - maxRetries: number; - filterExpression: any; - compress: boolean; - } - -} -declare module 'aerospike/policies/batch_apply_policy' { - export = BatchApplyPolicy; - class BatchApplyPolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - ttl: number; - durableDelete: boolean; - } - -} -declare module 'aerospike/policies/batch_policy' { - export = BatchPolicy; - class BatchPolicy extends BasePolicy { - replica: number; - readModeAP: number; - readModeSC: number; - concurrent: boolean; - allowInline: boolean; - allowInlineSSD: boolean; - respondAllKeys: boolean; - sendSetName: boolean; - deserialize: boolean; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/batch_read_policy' { - export = BatchReadPolicy; - class BatchReadPolicy { - constructor(props?: any); - filterExpression: any; - readModeAP: number; - readModeSC: number; - } - -} -declare module 'aerospike/policies/batch_remove_policy' { - export = BatchRemovePolicy; - class BatchRemovePolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - gen: number; - generation: number; - durableDelete: boolean; - } - -} -declare module 'aerospike/policies/batch_write_policy' { - export = BatchWritePolicy; - class BatchWritePolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - gen: number; - exists: number; - durableDelete: boolean; - } - -} -declare module 'aerospike/policies/bitwise_policy' { - export = BitwisePolicy; - class BitwisePolicy { - constructor(props?: any); - writeFlags: number; - } - -} -declare module 'aerospike/policies/command_queue_policy' { - export = CommandQueuePolicy; - class CommandQueuePolicy { - constructor(props?: { - maxCommandsInProcess?: number | undefined; - maxCommandsInQueue?: number | undefined; - queueInitialCapacity?: number | undefined; - } | undefined); - maxCommandsInProcess: number; - maxCommandsInQueue: number; - queueInitialCapacity: number; - } - -} -declare module 'aerospike/policies/hll_policy' { - export = HLLPolicy; - class HLLPolicy { - constructor(props?: any); - writeFlags: number; - } - -} -declare module 'aerospike/policies/info_policy' { - export = InfoPolicy; - class InfoPolicy { - constructor(props?: any); - timeout: number; - sendAsIs: boolean; - checkBounds: boolean; - } - -} -declare module 'aerospike/policies/list_policy' { - export = ListPolicy; - class ListPolicy { - constructor(props?: any); - order: number; - writeFlags: number; - } - -} -declare module 'aerospike/policies/map_policy' { - export = MapPolicy; - class MapPolicy { - constructor(props?: any); - order: number; - writeMode: number; - writeFlags: number; - } - -} -declare module 'aerospike/policies/operate_policy' { - export = OperatePolicy; - class OperatePolicy extends BasePolicy { - key: number; - gen: number; - exists: number; - replica: number; - commitLevel: number; - deserialize: boolean; - durableDelete: boolean; - readModeAP: number; - readModeSC: number; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/query_policy' { - export = QueryPolicy; - class QueryPolicy extends BasePolicy { - deserialize: boolean; - failOnClusterChange: boolean; - infoTimeout: number; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/read_policy' { - export = ReadPolicy; - class ReadPolicy extends BasePolicy { - key: number; - replica: number; - readModeAP: number; - readModeSC: number; - deserialize: boolean; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/remove_policy' { - export = RemovePolicy; - class RemovePolicy extends BasePolicy { - generation: number; - key: number; - gen: number; - commitLevel: number; - durableDelete: boolean; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/scan_policy' { - export = ScanPolicy; - class ScanPolicy extends BasePolicy { - durableDelete: boolean; - recordsPerSecond: number; - maxRecords: number; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policies/write_policy' { - export = WritePolicy; - class WritePolicy extends BasePolicy { - compressionThreshold: number; - key: number; - gen: number; - exists: number; - commitLevel: number; - durableDelete: boolean; - } - import BasePolicy = require("./base_policy"); - -} -declare module 'aerospike/policy' { - export function createPolicy(type: any, values: any): CommandQueuePolicy | BasePolicy | BatchApplyPolicy | BatchReadPolicy | BatchRemovePolicy | BatchWritePolicy | HLLPolicy | InfoPolicy | undefined; - import BasePolicy = require("./policies/base_policy"); - import ApplyPolicy = require("./policies/apply_policy"); - import OperatePolicy = require("./policies/operate_policy"); - import QueryPolicy = require("./policies/query_policy"); - import ReadPolicy = require("./policies/read_policy"); - import RemovePolicy = require("./policies/remove_policy"); - import ScanPolicy = require("./policies/scan_policy"); - import WritePolicy = require("./policies/write_policy"); - import BatchPolicy = require("./policies/batch_policy"); - import BatchApplyPolicy = require("./policies/batch_apply_policy"); - import BatchReadPolicy = require("./policies/batch_read_policy"); - import BatchRemovePolicy = require("./policies/batch_remove_policy"); - import BatchWritePolicy = require("./policies/batch_write_policy"); - import CommandQueuePolicy = require("./policies/command_queue_policy"); - import HLLPolicy = require("./policies/hll_policy"); - import InfoPolicy = require("./policies/info_policy"); - import ListPolicy = require("./policies/list_policy"); - import MapPolicy = require("./policies/map_policy"); - export { BasePolicy, ApplyPolicy, OperatePolicy, QueryPolicy, ReadPolicy, RemovePolicy, ScanPolicy, WritePolicy, BatchPolicy, BatchApplyPolicy, BatchReadPolicy, BatchRemovePolicy, BatchWritePolicy, CommandQueuePolicy, HLLPolicy, InfoPolicy, ListPolicy, MapPolicy }; - -} -declare module 'aerospike/query' { - export = Query; - function Query(client: Client, ns: string, set: string, options?: { - filters?: any[] | undefined; - select?: string[] | undefined; - nobins?: boolean | undefined; - } | undefined): void; - class Query { - constructor(client: Client, ns: string, set: string, options?: { - filters?: any[] | undefined; - select?: string[] | undefined; - nobins?: boolean | undefined; - } | undefined); - client: Client; - ns: string; - set: string; - filters: any[]; - selected: string[] | undefined; - nobins: boolean | undefined; - udf: any; - private pfEnabled; - select(...args: string[]): void; - where(predicate: any): void; - setSindexFilter(sindexFilter: any): void; - setUdf(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined): void; - partitions(begin: number, count: number, digest: string): void; - partFilter: { - begin: number; - count: number; - digest: string; - } | undefined; - foreach(policy?: any, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; - results(policy?: any): Promise; - apply(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: any, callback?: QueryaggregationResultCallback | undefined): Promise | null; - background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: any, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - operate(operations: any, policy?: any, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - ops: any; - } - import RecordStream = require("./record_stream"); - -} -declare module 'aerospike/record' { - export = Record; - class Record { - private constructor(); - key: any; - bins: any; - ttl: any; - gen: any; - type: any; - policy: any; - readAllBins: any; - ops: any; - udf: any; - } - -} -declare module 'aerospike/record_stream' { - export = RecordStream; - function RecordStream(client: any): void; - class RecordStream { - constructor(client: any); - aborted: boolean; - client: any; - writable: boolean; - readable: boolean; - _read(): void; - abort(): void; - } - -} -declare module 'aerospike/scan' { - export = Scan; - function Scan(client: Client, ns: string, set: string, options?: { - select?: string[] | undefined; - nobins?: boolean | undefined; - concurrent?: boolean | undefined; - } | undefined): void; - class Scan { - constructor(client: Client, ns: string, set: string, options?: { - select?: string[] | undefined; - nobins?: boolean | undefined; - concurrent?: boolean | undefined; - } | undefined); - client: Client; - ns: string; - set: string; - selected: string[] | undefined; - nobins: boolean | undefined; - concurrent: boolean | undefined; - private pfEnabled; - select(...args: string[]): void; - partitions(begin: number, count: number, digest: string): void; - partFilter: { - begin: number; - count: number; - digest: string; - } | undefined; - background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: any, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - udf: { - module: string; - funcname: string; - args: any[] | undefined; - } | undefined; - operate(operations: any, policy?: any, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - ops: any; - foreach(policy?: any, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; - } - import RecordStream = require("./record_stream"); - -} -declare module 'aerospike/status' { - export var BATCH_FAILED: any; - export var ERR_ASYNC_QUEUE_FULL: any; - export var ERR_CONNECTION: any; - export var ERR_INVALID_NODE: any; - export var ERR_NO_MORE_CONNECTIONS: any; - export var ERR_ASYNC_CONNECTION: any; - export var ERR_CLIENT_ABORT: any; - export var ERR_INVALID_HOST: any; - export var NO_MORE_RECORDS: any; - export var ERR_PARAM: any; - export var ERR_CLIENT: any; - export var OK: any; - export var ERR_SERVER: any; - export var ERR_RECORD_NOT_FOUND: any; - export var ERR_RECORD_GENERATION: any; - export var ERR_REQUEST_INVALID: any; - export var ERR_RECORD_EXISTS: any; - export var ERR_BIN_EXISTS: any; - export var ERR_CLUSTER_CHANGE: any; - export var ERR_SERVER_FULL: any; - export var ERR_TIMEOUT: any; - export var ERR_ALWAYS_FORBIDDEN: any; - export var ERR_CLUSTER: any; - export var ERR_BIN_INCOMPATIBLE_TYPE: any; - export var ERR_RECORD_TOO_BIG: any; - export var ERR_RECORD_BUSY: any; - export var ERR_SCAN_ABORTED: any; - export var ERR_UNSUPPORTED_FEATURE: any; - export var ERR_BIN_NOT_FOUND: any; - export var ERR_DEVICE_OVERLOAD: any; - export var ERR_RECORD_KEY_MISMATCH: any; - export var ERR_NAMESPACE_NOT_FOUND: any; - export var ERR_BIN_NAME: any; - export var ERR_FAIL_FORBIDDEN: any; - export var ERR_FAIL_ELEMENT_NOT_FOUND: any; - export var ERR_FAIL_ELEMENT_EXISTS: any; - export var ERR_ENTERPRISE_ONLY: any; - export var ERR_FAIL_ENTERPRISE_ONLY: any; - export var ERR_OP_NOT_APPLICABLE: any; - export var FILTERED_OUT: any; - export var LOST_CONFLICT: any; - export var QUERY_END: any; - export var SECURITY_NOT_SUPPORTED: any; - export var SECURITY_NOT_ENABLED: any; - export var SECURITY_SCHEME_NOT_SUPPORTED: any; - export var INVALID_COMMAND: any; - export var INVALID_FIELD: any; - export var ILLEGAL_STATE: any; - export var INVALID_USER: any; - export var USER_ALREADY_EXISTS: any; - export var INVALID_PASSWORD: any; - export var EXPIRED_PASSWORD: any; - export var FORBIDDEN_PASSWORD: any; - export var INVALID_CREDENTIAL: any; - export var INVALID_ROLE: any; - export var ROLE_ALREADY_EXISTS: any; - export var INVALID_PRIVILEGE: any; - export var NOT_AUTHENTICATED: any; - export var ROLE_VIOLATION: any; - export var ERR_UDF: any; - export var ERR_BATCH_DISABLED: any; - export var ERR_BATCH_MAX_REQUESTS_EXCEEDED: any; - export var ERR_BATCH_QUEUES_FULL: any; - export var ERR_GEO_INVALID_GEOJSON: any; - export var ERR_INDEX_FOUND: any; - export var ERR_INDEX_NOT_FOUND: any; - export var ERR_INDEX_OOM: any; - export var ERR_INDEX_NOT_READABLE: any; - export var ERR_INDEX: any; - export var ERR_INDEX_NAME_MAXLEN: any; - export var ERR_INDEX_MAXCOUNT: any; - export var ERR_QUERY_ABORTED: any; - export var ERR_QUERY_QUEUE_FULL: any; - export var ERR_QUERY_TIMEOUT: any; - export var ERR_QUERY: any; - export var ERR_UDF_NOT_FOUND: any; - export var ERR_LUA_FILE_NOT_FOUND: any; - export function getMessage(code: any): string; - -} -declare module 'aerospike/typedefs' { - type Host = object; - type ClientStats = any; - type doneCallback = () => any; - type errorCallback = () => any; - type recordCallback = () => any; - type valueCallback = () => any; - type writeCallback = () => any; - type batchRecordsCallback = () => any; - type connectCallback = () => any; - type infoCallback = () => any; - type infoAllCallback = () => any; - type jobCallback = () => any; - type JobdoneCallback = () => any; - type JobinfoCallback = () => any; - type QueryaggregationResultCallback = () => any; - type AerospikeExp = object; - type Policies = { - apply: ApplyPolicy; - batch: BatchPolicy; - info: InfoPolicy; - operate: OperatePolicy; - read: ReadPolicy; - remove: RemovePolicy; - scan: ScanPolicy; - query: QueryPolicy; - write: WritePolicy; - map: MapPolicy; - list: ListPolicy; - commandQueue: CommandQueuePolicy; - }; - type Operation = object; - type RecordObject = object; - -} -declare module 'aerospike/udf_job' { - export = UdfJob; - function UdfJob(client: any, udfModule: any, command: any): void; - class UdfJob { - constructor(client: any, udfModule: any, command: any); - client: any; - udfModule: any; - command: any; - private hasCompleted; - private info; - } - namespace UdfJob { - const REGISTER: string; - const UNREGISTER: string; - } - -} -declare module 'aerospike/utils' { - export function parseHostString(hostString: any): { - addr: any; - tlsname: any; - port: number; - }; - export function print(err: any, result: any): void; - -} -declare module 'aerospike' { - import main = require('aerospike/index'); - export = main; -} \ No newline at end of file diff --git a/typings/index.d.ts b/typings/index.d.ts index 6a195a1c0..75a1b23ac 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,1515 +1,1753 @@ -declare module "status" { - export const ERR_INVALID_NODE: any; - export const ERR_NO_MORE_CONNECTIONS: any; - export const ERR_ASYNC_CONNECTION: any; - export const ERR_CLIENT_ABORT: any; - export const ERR_INVALID_HOST: any; - export const NO_MORE_RECORDS: any; - export const ERR_PARAM: any; - export const ERR_CLIENT: any; - export const OK: any; - export const ERR_SERVER: any; - export const ERR_RECORD_NOT_FOUND: any; - export const ERR_RECORD_GENERATION: any; - export const ERR_REQUEST_INVALID: any; - export const ERR_RECORD_EXISTS: any; - export const ERR_BIN_EXISTS: any; - export const ERR_CLUSTER_CHANGE: any; - export const ERR_SERVER_FULL: any; - export const ERR_TIMEOUT: any; - export const ERR_ALWAYS_FORBIDDEN: any; - export const ERR_CLUSTER: any; - export const ERR_BIN_INCOMPATIBLE_TYPE: any; - export const ERR_RECORD_TOO_BIG: any; - export const ERR_RECORD_BUSY: any; - export const ERR_SCAN_ABORTED: any; - export const ERR_UNSUPPORTED_FEATURE: any; - export const ERR_BIN_NOT_FOUND: any; - export const ERR_DEVICE_OVERLOAD: any; - export const ERR_RECORD_KEY_MISMATCH: any; - export const ERR_NAMESPACE_NOT_FOUND: any; - export const ERR_BIN_NAME: any; - export const ERR_FAIL_FORBIDDEN: any; - export const ERR_FAIL_ELEMENT_NOT_FOUND: any; - export const ERR_FAIL_ELEMENT_EXISTS: any; - export const ERR_ENTERPRISE_ONLY: any; - export const ERR_FAIL_ENTERPRISE_ONLY: any; - export const ERR_OP_NOT_APPLICABLE: any; - export const FILTERED_OUT: any; - export const LOST_CONFLICT: any; - export const QUERY_END: any; - export const SECURITY_NOT_SUPPORTED: any; - export const SECURITY_NOT_ENABLED: any; - export const SECURITY_SCHEME_NOT_SUPPORTED: any; - export const INVALID_COMMAND: any; - export const INVALID_FIELD: any; - export const ILLEGAL_STATE: any; - export const INVALID_USER: any; - export const USER_ALREADY_EXISTS: any; - export const INVALID_PASSWORD: any; - export const EXPIRED_PASSWORD: any; - export const FORBIDDEN_PASSWORD: any; - export const INVALID_CREDENTIAL: any; - export const INVALID_ROLE: any; - export const ROLE_ALREADY_EXISTS: any; - export const INVALID_PRIVILEGE: any; - export const NOT_AUTHENTICATED: any; - export const ROLE_VIOLATION: any; - export const ERR_UDF: any; - export const ERR_BATCH_DISABLED: any; - export const ERR_BATCH_MAX_REQUESTS_EXCEEDED: any; - export const ERR_BATCH_QUEUES_FULL: any; - export const ERR_GEO_INVALID_GEOJSON: any; - export const ERR_INDEX_FOUND: any; - export const ERR_INDEX_NOT_FOUND: any; - export const ERR_INDEX_OOM: any; - export const ERR_INDEX_NOT_READABLE: any; - export const ERR_INDEX: any; - export const ERR_INDEX_NAME_MAXLEN: any; - export const ERR_INDEX_MAXCOUNT: any; - export const ERR_QUERY_ABORTED: any; - export const ERR_QUERY_QUEUE_FULL: any; - export const ERR_QUERY_TIMEOUT: any; - export const ERR_QUERY: any; - export const ERR_UDF_NOT_FOUND: any; - export const ERR_LUA_FILE_NOT_FOUND: any; - export function getMessage(code: any): string; -} -declare module "error" { - export = AerospikeError; - class AerospikeError extends Error { - private static fromASError; - private static copyASErrorProperties; - private static formatMessage; - private constructor(); - code: number; - command: any | null; - func: string | null; - file: string | null; - line: number | null; - inDoubt: boolean; - private setStackTrace; - isServerError(): boolean; - get client(): any; - } -} -declare module "policies/command_queue_policy" { - export = CommandQueuePolicy; - class CommandQueuePolicy { - constructor(props?: { - maxCommandsInProcess?: number | undefined; - maxCommandsInQueue?: number | undefined; - queueInitialCapacity?: number | undefined; - } | undefined); - maxCommandsInProcess: number; - maxCommandsInQueue: number; - queueInitialCapacity: number; - } -} -declare module "event_loop" { - export function releaseEventLoop(): void; - export function registerASEventLoop(): void; - export function referenceEventLoop(): void; - export function unreferenceEventLoop(): void; - export function setCommandQueuePolicy(policy: any): void; -} -declare module "geojson" { - export = GeoJSON; - function GeoJSON(json: any): GeoJSON; - class GeoJSON { - constructor(json: any); - str: string | undefined; - toJSON(): any; - toString(): string; - value(): any; - } - namespace GeoJSON { - function Point(lng: number, lat: number): GeoJSON; - function Polygon(...args: number[][]): GeoJSON; - function Circle(lng: number, lat: number, radius: number): GeoJSON; - } -} -declare module "filter" { - export function range(bin: string, min: number, max: number, indexType?: number | undefined): any; - export function equal(bin: string, value: string): any; - export function contains(bin: string, value: (string | number), indexType: number): any; - export function geoWithinGeoJSONRegion(bin: string, value: GeoJSON, indexType?: number | undefined): any; - export function geoContainsGeoJSONPoint(bin: string, value: GeoJSON, indexType?: number | undefined): any; - export function geoWithinRadius(bin: string, lon: any, lat: number, radius: number, indexType?: number | undefined): any; - export function geoContainsPoint(bin: string, lon: any, lat: number, indexType?: number | undefined): any; - export class SindexFilterPredicate { - constructor(predicate: any, bin: any, dataType: any, indexType: any, props: any); - predicate: any; - bin: any; - datatype: any; - type: any; - } - import GeoJSON = require("geojson"); -} -declare module "cdt_context" { - export = CdtContext; - class CdtContext { - static getContextType(ctx: CdtContext, type: number): number; - items: any[]; - addListIndex(index: number): CdtContext; - addListRank(rank: number): CdtContext; - addListValue(value: any): CdtContext; - addMapIndex(index: number): CdtContext; - addMapRank(rank: number): CdtContext; - addMapKey(key: any): CdtContext; - addMapValue(value: any): CdtContext; - private add; - } -} -declare module "exp" { - export function bool(value: any): { - [x: number]: any; - op: any; - }[]; - export function int(value: any): { - [x: number]: any; - op: any; - }[]; - export function uint(value: any): { - [x: number]: any; - op: any; - }[]; - export function float(value: any): { - [x: number]: any; - op: any; - }[]; - export function str(value: any): { - [x: number]: any; - op: any; - }[]; - export function bytes(value: any, size: any): { - [x: number]: any; - op: any; - }[]; - export function geo(value: any): { - [x: number]: any; - op: any; - }[]; - export function nil(): { - op: any; - value: null; - }[]; - export function keyInt(): { - [x: number]: any; - op: any; - }[]; - export function keyStr(): { - [x: number]: any; - op: any; - }[]; - export function keyBlob(): { - [x: number]: any; - op: any; - }[]; - export function keyExist(): AerospikeExp; - export function binBool(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binInt(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binFloat(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binStr(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binBlob(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binGeo(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binList(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binMap(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binHll(binName: any): { - [x: number]: any; - op: any; - }[]; - export function binType(binName: any): ({ - op: any; - strVal: any; - } | { - op: any; - count: number; - })[]; - export function binExists(binName: string): boolean; - export function setName(): { - op: any; - count: number; - }[]; - export function deviceSize(): { - op: any; - count: number; - }[]; - export function lastUpdate(): { - op: any; - count: number; - }[]; - export function sinceUpdate(): { - op: any; - count: number; - }[]; - export function voidTime(): { - op: any; - count: number; - }[]; - export function ttl(): { - op: any; - count: number; - }[]; - export function isTombstone(): { - op: any; - count: number; - }[]; - export function memorySize(): { - op: any; - count: number; - }[]; - export function digestModulo(): { - op: any; - count: number; - }[]; - export function eq(left: any, right: any): { - op: any; - count: number; - }[]; - export function ne(left: any, right: any): { - op: any; - count: number; - }[]; - export function gt(left: any, right: any): { - op: any; - count: number; - }[]; - export function ge(left: any, right: any): { - op: any; - count: number; - }[]; - export function lt(left: any, right: any): { - op: any; - count: number; - }[]; - export function le(left: any, right: any): { - op: any; - count: number; - }[]; - export function cmpRegex(options: number, regex: string, cmpStr: AerospikeExp): AerospikeExp; - export function cmpGeo(left: any, right: any): { - op: any; - count: number; - }[]; - export function not(expr: AerospikeExp): AerospikeExp; - export function and(...expr: any[]): never[]; - export function or(...expr: any[]): never[]; - export function exclusive(...expr: any[]): never[]; - export function add(...expr: any[]): never[]; - export function sub(...expr: any[]): never[]; - export function mul(...expr: any[]): never[]; - export function div(...expr: any[]): never[]; - export function pow(...params: any[]): any[]; - export function log(...params: any[]): any[]; - export function mod(...params: any[]): any[]; - export function abs(...params: any[]): any[]; - export function floor(...params: any[]): any[]; - export function ceil(...params: any[]): any[]; - export function toInt(...params: any[]): any[]; - export function toFloat(...params: any[]): any[]; - export function intAnd(...expr: any[]): never[]; - export function intOr(...expr: any[]): never[]; - export function intXor(...expr: any[]): never[]; - export function intNot(...params: any[]): any[]; - export function intLshift(...params: any[]): any[]; - export function intRshift(...params: any[]): any[]; - export function intArshift(...params: any[]): any[]; - export function intCount(...params: any[]): any[]; - export function intLscan(...params: any[]): any[]; - export function intRscan(...params: any[]): any[]; - export function min(...expr: any[]): never[]; - export function max(...expr: any[]): never[]; - export function cond(...expr: any[]): never[]; - function _let(...expr: any[]): never[]; - export function def(varName: string, expr: AerospikeExp): AerospikeExp; - function _var(varName: string): AerospikeExp; - export namespace lists { - function size(bin: any, ctx?: any): any; - function getByValue(bin: any, value: any, returnType: any, ctx?: any): any; - function getByValueRange(bin: any, begin: any, end: any, returnType: any, ctx?: any): any; - function getByValueList(bin: any, value: any, returnType: any, ctx?: any): any; - function getByRelRankRangeToEnd(bin: any, value: any, rank: any, returnType: any, ctx?: any): any; - function getByRelRankRange(bin: any, value: any, rank: any, count: any, returnType: any, ctx?: any): any; - function getByIndex(bin: any, index: any, valueType: any, returnType: any, ctx?: any): any; - function getByIndexRangeToEnd(bin: any, index: any, returnType: any, ctx?: any): any; - function getByIndexRange(bin: any, index: any, count: any, returnType: any, ctx?: any): any; - function getByRank(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; - function getByRankRangeToEnd(bin: any, rank: any, returnType: any, ctx?: any): any; - function getByRankRange(bin: any, rank: any, count: any, returnType: any, ctx?: any): any; - function append(bin: any, value: any, policy?: any, ctx?: any): any; - function appendItems(bin: any, value: any, policy?: any, ctx?: any): any; - function insert(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - function insertItems(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - function increment(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - function set(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; - function clear(bin: any, ctx?: any): any; - function sort(bin: any, order: number, ctx?: any): any; - function removeByValue(bin: any, value: any, ctx?: any): any; - function removeByValueList(bin: any, values: any, ctx?: any): any; - function removeByValueRange(bin: any, end: any, begin: any, ctx?: any): any; - function removeByRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any): any; - function removeByRelRankRange(bin: any, count: any, rank: any, value: any, ctx?: any): any; - function removeByIndex(bin: any, idx: any, ctx?: any): any; - function removeByIndexRangeToEnd(bin: any, idx: any, ctx?: any): any; - function removeByIndexRange(bin: any, count: any, idx: any, ctx?: any): any; - function removeByRank(bin: any, rank: any, ctx?: any): any; - function removeByRankRangeToEnd(bin: any, rank: any, ctx?: any): any; - function removeByRankRange(bin: any, count: any, rank: any, ctx?: any): any; - } - export namespace maps { - export function put(bin: any, value: any, key: any, policy?: any, ctx?: any): any; - export function putItems(bin: any, map: any, policy?: any, ctx?: any): any; - export function increment_1(bin: any, value: any, key: any, policy?: any, ctx?: any): any; - export { increment_1 as increment }; - export function clear_1(bin: any, ctx?: any): any; - export { clear_1 as clear }; - export function removeByKey(bin: any, key: any, ctx?: any): any; - export function removeByKeyList(bin: any, keys: any, ctx?: any): any; - export function removeByKeyRange(bin: any, end: any, begin: any, ctx?: any): any; - export function removeByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, ctx?: any): any; - export function removeByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, ctx?: any): any; - export function removeByValue_1(bin: any, value: any, ctx?: any): any; - export { removeByValue_1 as removeByValue }; - export function removeByValueList_1(bin: any, values: any, ctx?: any): any; - export { removeByValueList_1 as removeByValueList }; - export function removeByValueRange_1(bin: any, end: any, begin: any, ctx?: any): any; - export { removeByValueRange_1 as removeByValueRange }; - export function removeByValueRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any): any; - export function removeByValueRelRankRange(bin: any, count: any, rank: any, value: any, key: any, ctx?: any): any; - export function removeByIndex_1(bin: any, idx: any, ctx?: any): any; - export { removeByIndex_1 as removeByIndex }; - export function removeByIndexRangeToEnd_1(bin: any, idx: any, ctx?: any): any; - export { removeByIndexRangeToEnd_1 as removeByIndexRangeToEnd }; - export function removeByIndexRange_1(bin: any, count: any, idx: any, ctx?: any): any; - export { removeByIndexRange_1 as removeByIndexRange }; - export function removeByRank_1(bin: any, rank: any, ctx?: any): any; - export { removeByRank_1 as removeByRank }; - export function removeByRankRangeToEnd_1(bin: any, rank: any, ctx?: any): any; - export { removeByRankRangeToEnd_1 as removeByRankRangeToEnd }; - export function removeByRankRange_1(bin: any, count: any, rank: any, ctx?: any): any; - export { removeByRankRange_1 as removeByRankRange }; - export function size_1(bin: any, ctx?: any): any; - export { size_1 as size }; - export function getByKey(bin: any, key: any, valueType: any, returnType: any, ctx?: any): any; - export function getByKeyRange(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; - export function getByKeyList(bin: any, keys: any, returnType: any, ctx?: any): any; - export function getByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, returnType: any, ctx?: any): any; - export function getByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, returnType: any, ctx?: any): any; - export function getByValue_1(bin: any, value: any, returnType: any, ctx?: any): any; - export { getByValue_1 as getByValue }; - export function getByValueRange_1(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; - export { getByValueRange_1 as getByValueRange }; - export function getByValueList_1(bin: any, values: any, returnType: any, ctx?: any): any; - export { getByValueList_1 as getByValueList }; - export function getByValueRelRankRangeToEnd(bin: any, rank: any, value: any, returnType: any, ctx?: any): any; - export function getByValueRelRankRange(bin: any, count: any, rank: any, value: any, returnType: any, ctx?: any): any; - export function getByIndex_1(bin: any, idx: any, valueType: any, returnType: any, ctx?: any): any; - export { getByIndex_1 as getByIndex }; - export function getByIndexRangeToEnd_1(bin: any, idx: any, returnType: any, ctx?: any): any; - export { getByIndexRangeToEnd_1 as getByIndexRangeToEnd }; - export function getByIndexRange_1(bin: any, count: any, idx: any, returnType: any, ctx?: any): any; - export { getByIndexRange_1 as getByIndexRange }; - export function getByRank_1(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; - export { getByRank_1 as getByRank }; - export function getByRankRangeToEnd_1(bin: any, rank: any, returnType: any, ctx?: any): any; - export { getByRankRangeToEnd_1 as getByRankRangeToEnd }; - export function getByRankRange_1(bin: any, count: any, rank: any, returnType: any, ctx?: any): any; - export { getByRankRange_1 as getByRankRange }; - } - export namespace bit { - export function reSize(bin: any, flags: number, byteSize: number, policy?: any): any; - export function insert_1(bin: any, value: any, byteOffset: any, policy?: any): any; - export { insert_1 as insert }; - export function remove(bin: any, byteSize: number, byteOffset: any, policy?: any): any; - export function set_1(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export { set_1 as set }; - export function or(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function xor(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function and(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function not(bin: any, bitSize: any, bitOffset: any, policy?: any): any; - export function lShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; - export function rShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; - export function add(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function subtract(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function setInt(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; - export function get(bin: any, bitSize: any, bitOffset: any): any; - export function count(bin: any, bitSize: any, bitOffset: any): number; - export function lScan(bin: any, value: any, bitSize: any, bitOffset: any): number; - export function rScan(bin: any, value: any, bitSize: any, bitOffset: any): number; - export function getInt(bin: any, sign: boolean, bitSize: any, bitOffset: any): any; - } - export namespace hll { - export function initMH(bin: any, mhBitCount: number, indexBitCount: number, policy?: any): any; - export function init(bin: any, indexBitCount: number, policy?: any): any; - export function addMH(bin: any, mhBitCount: number, indexBitCount: number, list: any, policy?: any): any; - export function add_1(bin: any, indexBitCount: number, list: any, policy?: any): any; - export { add_1 as add }; - export function update(bin: any, list: any, policy?: any): any; - export function getCount(bin: any): any; - export function getUnion(bin: any, list: any): any; - export function getUnionCount(bin: any, list: any): any; - export function getIntersectCount(bin: any, list: any): any; - export function getSimilarity(bin: any, list: any): any[]; - export function describe(bin: any): any; - export function mayContain(bin: any, list: any): any; - } - function _val(value: any): { - [x: number]: any; - op: any; - }[]; - export { _val as list, _val as map, _let as let, _var as var }; -} -declare module "info" { - export function parse(info: string): any; - export const separators: { - bins: (string | typeof splitBins)[]; - 'bins/*': (typeof splitBins)[]; - 'namespace/*': string[]; - service: string[]; - sindex: string[]; - 'sindex/*': string[]; - 'sindex/*/**': string[]; - 'udf-list': string[]; - 'get-dc-config': string[]; - sets: string[]; - 'sets/*': string[]; - 'sets/*/**': (string | typeof chop)[]; - }; - function splitBins(str: any): { - stats: {}; - names: any[]; - }; - function chop(str: any): any; - export {}; -} -declare module "operations" { - export function read(bin: string): Operation; - export function write(bin: string, value: any): Operation; - export function add(bin: string, value: (number | any)): Operation; - export function incr(bin: any, value: any): any; - export function append(bin: string, value: (string | Buffer)): Operation; - export function prepend(bin: string, value: (string | Buffer)): Operation; - export function touch(ttl?: number | undefined): Operation; - function _delete(): Operation; - export class Operation { - protected constructor(); - op: any; - bin: any; - } - export { _delete as delete }; -} -declare module "lists" { - export function setOrder(bin: string, order: number): any; - export function sort(bin: string, flags: number): any; - export function append(bin: string, value: any, policy?: any): any; - export function appendItems(bin: string, list: Array, policy?: any): any; - export function insert(bin: string, index: number, value: any, policy?: any): any; - export function insertItems(bin: string, index: number, list: Array, policy: any): any; - export function pop(bin: string, index: number): any; - export function popRange(bin: string, index: number, count?: number | undefined): any; - export function remove(bin: string, index: number): any; - export function removeRange(bin: string, index: number, count?: number | undefined): any; - export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; - export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function clear(bin: string): any; - export function set(bin: string, index: number, value: any, policy?: any): any; - export function trim(bin: string, index: number, count: number): any; - export function get(bin: string, index: number): any; - export function getRange(bin: string, index: number, count?: number | undefined): any; - export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByValue(bin: string, value: any, returnType?: number | undefined): any; - export function getByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function getByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function increment(bin: string, index: number, value?: number | undefined, policy?: any): any; - export function size(bin: string): any; -} -declare module "hll" { - export function init(bin: string, indexBits: number, minhashBits?: number | undefined): any; - export function add(bin: string, list: any[], indexBits?: number | undefined, minhashBits?: number | undefined): any; - export function setUnion(bin: string, list: any[]): any; - export function refreshCount(bin: string): any; - export function fold(bin: string, indexBits: number): any; - export function getCount(bin: string): any; - export function getUnion(bin: string, list: any[]): any; - export function getUnionCount(bin: string, list: any[]): any; - export function getIntersectCount(bin: string, list: any[]): any; - export function getSimilarity(bin: string, list: any[]): any; - export function describe(bin: string): any; -} -declare module "maps" { - export function setPolicy(bin: string, policy: MapPolicy): any; - export function put(bin: string, key: any, value: any, policy?: MapPolicy): any; - export function putItems(bin: string, items: object, policy?: MapPolicy): any; - export function increment(bin: string, key: any, incr: number, policy?: MapPolicy): any; - export function decrement(bin: string, key: any, decr: number, policy?: MapPolicy): any; - export function clear(bin: string): any; - export function removeByKey(bin: string, key: any, returnType?: number | undefined): any; - export function removeByKeyList(bin: string, keys: Array, returnType?: number | undefined): any; - export function removeByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; - export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; - export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; - export function size(bin: string): any; - export function getByKey(bin: string, key: any, returnType?: number | undefined): any; - export function getByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByValue(bin: string, value: any, returnType?: number | undefined): any; - export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; - export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; - export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; - export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; - export function getByRankRange(bin: string, rank: any, count: number, returnType?: number | undefined): any; -} -declare module "bitwise" { - export function resize(bin: string, size: number, flags?: number | undefined): BitwiseOperation; - export function insert(bin: string, byteOffset: any, value: Buffer): BitwiseOperation; - export function remove(bin: string, byteOffset: number, byteSize: number): BitwiseOperation; - export function set(bin: string, bitOffset: number, bitSize: number, value: number | Buffer): BitwiseOperation; - export function or(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function xor(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function and(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; - export function not(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; - export function lshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; - export function rshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; - export function add(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; - export function subtract(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; - export function get(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; - export function getInt(bin: string, bitOffset: number, bitSize: number, sign: boolean): BitwiseOperation; - export function lscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; - export function rscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; - class BitwiseOperation extends Operation { - withPolicy(policy: BitwisePolicy): BitwiseOperation; - policy: any; - } - class OverflowableBitwiseOp extends BitwiseOperation { - overflowAction: any; - onOverflow(action: number): OverflowableBitwiseOp; - } - import Operation_1 = require("operations"); - import Operation = Operation_1.Operation; - export {}; -} -declare module "exp_operations" { - export function read(bin: string, exp: any, flags: any): Operation; - export function write(bin: string, exp: any, flags: any): Operation; - export class ExpOperation { - protected constructor(); - op: any; - bin: any; - exp: any; - flags: any; - } -} -declare module "policies/base_policy" { - export = BasePolicy; - class BasePolicy { - constructor(props: any); - socketTimeout: number; - totalTimeout: number; - maxRetries: number; - filterExpression: any; - compress: boolean; - } -} -declare module "policies/apply_policy" { - export = ApplyPolicy; - class ApplyPolicy extends BasePolicy { - key: number; - commitLevel: number; - ttl: number; - durableDelete: boolean; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/operate_policy" { - export = OperatePolicy; - class OperatePolicy extends BasePolicy { - key: number; - gen: number; - exists: number; - replica: number; - commitLevel: number; - deserialize: boolean; - durableDelete: boolean; - readModeAP: number; - readModeSC: number; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/query_policy" { - export = QueryPolicy; - class QueryPolicy extends BasePolicy { - deserialize: boolean; - failOnClusterChange: boolean; - infoTimeout: number; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/read_policy" { - export = ReadPolicy; - class ReadPolicy extends BasePolicy { - key: number; - replica: number; - readModeAP: number; - readModeSC: number; - deserialize: boolean; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/remove_policy" { - export = RemovePolicy; - class RemovePolicy extends BasePolicy { - generation: number; - key: number; - gen: number; - commitLevel: number; - durableDelete: boolean; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/scan_policy" { - export = ScanPolicy; - class ScanPolicy extends BasePolicy { - durableDelete: boolean; - recordsPerSecond: number; - maxRecords: number; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/write_policy" { - export = WritePolicy; - class WritePolicy extends BasePolicy { - compressionThreshold: number; - key: number; - gen: number; - exists: number; - commitLevel: number; - durableDelete: boolean; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/batch_policy" { - export = BatchPolicy; - class BatchPolicy extends BasePolicy { - replica: number; - readModeAP: number; - readModeSC: number; - concurrent: boolean; - allowInline: boolean; - allowInlineSSD: boolean; - respondAllKeys: boolean; - sendSetName: boolean; - deserialize: boolean; - } - import BasePolicy = require("policies/base_policy"); -} -declare module "policies/batch_apply_policy" { - export = BatchApplyPolicy; - class BatchApplyPolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - ttl: number; - durableDelete: boolean; - } -} -declare module "policies/batch_read_policy" { - export = BatchReadPolicy; - class BatchReadPolicy { - constructor(props?: any); - filterExpression: any; - readModeAP: number; - readModeSC: number; - } -} -declare module "policies/batch_remove_policy" { - export = BatchRemovePolicy; - class BatchRemovePolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - gen: number; - generation: number; - durableDelete: boolean; - } -} -declare module "policies/batch_write_policy" { - export = BatchWritePolicy; - class BatchWritePolicy { - constructor(props?: any); - filterExpression: any; - key: number; - commitLevel: number; - gen: number; - exists: number; - durableDelete: boolean; - } -} -declare module "policies/hll_policy" { - export = HLLPolicy; - class HLLPolicy { - constructor(props?: any); - writeFlags: number; - } -} -declare module "policies/info_policy" { - export = InfoPolicy; - class InfoPolicy { - constructor(props?: any); - timeout: number; - sendAsIs: boolean; - checkBounds: boolean; - } -} -declare module "policies/list_policy" { - export = ListPolicy; - class ListPolicy { - constructor(props?: any); - order: number; - writeFlags: number; - } -} -declare module "policies/map_policy" { - export = MapPolicy; - class MapPolicy { - constructor(props?: any); - order: number; - writeMode: number; - writeFlags: number; - } -} -declare module "policy" { - export function createPolicy(type: any, values: any): CommandQueuePolicy | BasePolicy | BatchApplyPolicy | BatchReadPolicy | BatchRemovePolicy | BatchWritePolicy | HLLPolicy | InfoPolicy | undefined; - import BasePolicy = require("policies/base_policy"); - import ApplyPolicy = require("policies/apply_policy"); - import OperatePolicy = require("policies/operate_policy"); - import QueryPolicy = require("policies/query_policy"); - import ReadPolicy = require("policies/read_policy"); - import RemovePolicy = require("policies/remove_policy"); - import ScanPolicy = require("policies/scan_policy"); - import WritePolicy = require("policies/write_policy"); - import BatchPolicy = require("policies/batch_policy"); - import BatchApplyPolicy = require("policies/batch_apply_policy"); - import BatchReadPolicy = require("policies/batch_read_policy"); - import BatchRemovePolicy = require("policies/batch_remove_policy"); - import BatchWritePolicy = require("policies/batch_write_policy"); - import CommandQueuePolicy = require("policies/command_queue_policy"); - import HLLPolicy = require("policies/hll_policy"); - import InfoPolicy = require("policies/info_policy"); - import ListPolicy = require("policies/list_policy"); - import MapPolicy = require("policies/map_policy"); - export { BasePolicy, ApplyPolicy, OperatePolicy, QueryPolicy, ReadPolicy, RemovePolicy, ScanPolicy, WritePolicy, BatchPolicy, BatchApplyPolicy, BatchReadPolicy, BatchRemovePolicy, BatchWritePolicy, CommandQueuePolicy, HLLPolicy, InfoPolicy, ListPolicy, MapPolicy }; -} -declare module "features" { - export const CDT_MAP: "cdt-map"; - export const CDT_LIST: "cdt-list"; - export const BLOB_BITS: "blob-bits"; -} -declare module "commands/command" { - const _exports: Class; - export = _exports; -} -declare module "record" { - export = Record; - class Record { - private constructor(); - key: any; - bins: any; - ttl: any; - gen: any; - type: any; - policy: any; - readAllBins: any; - ops: any; - udf: any; - } -} -declare module "commands/batch_command" { - function _exports(asCommand: any): { - new (): { - convertResult(results: any): any; - }; - }; - export = _exports; -} -declare module "commands/connect_command" { - function _exports(asCommand: any): { - new (client: any, callback: any): { - ensureConnected: boolean; - }; - }; - export = _exports; -} -declare module "commands/exists_command" { - function _exports(asCommand: any): { - new (): { - convertResponse(error: any): any[]; - }; - }; - export = _exports; -} -declare module "commands/read_record_command" { - function _exports(asCommand: any): { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - export = _exports; -} -declare module "bigint" { - export const BigInt: BigIntConstructor; - export const bigIntSupported: true; - export function isInt64(value: any): boolean; -} -declare module "key" { - export = Key; - function Key(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined): void; - class Key { - constructor(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined); - ns: string; - set: string; - key: string | number | Buffer; - digest: string | null; - equals(other: any): any; - } - namespace Key { - function fromASKey(keyObj: any): Key | null; - } -} -declare module "commands/stream_command" { - function _exports(asCommand: any): { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - export = _exports; -} -declare module "commands/write_record_command" { - function _exports(asCommand: any): { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - export = _exports; -} -declare module "job" { - export = Job; - function Job(client: any, jobID: any, module: any): void; - class Job { - constructor(client: any, jobID: any, module: any); - client: any; - jobID: any; - module: any; - private hasCompleted; - private checkStatus; - info(policy: any, callback?: JobinfoCallback | undefined): Promise | null; - wait(pollInterval?: number | undefined, callback?: JobdoneCallback | undefined): Promise | null; - waitUntilDone: any; - } - namespace Job { - function safeRandomJobID(): number; - function pollUntilDone(statusFunction: any, pollInterval: any): Promise; - } -} -declare module "commands/query_background_command" { - function _exports(asCommand: any): { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): Job; - }; - }; - export = _exports; - import Job = require("job"); -} -declare module "commands/index" { - class ApplyCommand { - } - const BatchExistsCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchExistsCommand extends BatchExistsCommand_base { - } - const BatchGetCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchGetCommand extends BatchGetCommand_base { - } - const BatchReadCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchReadCommand extends BatchReadCommand_base { - } - const BatchWriteCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchWriteCommand extends BatchWriteCommand_base { - } - const BatchApplyCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchApplyCommand extends BatchApplyCommand_base { - } - const BatchRemoveCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchRemoveCommand extends BatchRemoveCommand_base { - } - const BatchSelectCommand_base: { - new (): { - convertResult(results: any): any; - }; - }; - class BatchSelectCommand extends BatchSelectCommand_base { - } - const ConnectCommand_base: { - new (client: any, callback: any): { - ensureConnected: boolean; - }; - }; - class ConnectCommand extends ConnectCommand_base { - } - const ExistsCommand_base: { - new (): { - convertResponse(error: any): any[]; - }; - }; - class ExistsCommand extends ExistsCommand_base { - } - const GetCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class GetCommand extends GetCommand_base { - } - class IndexCreateCommand { - } - class IndexRemoveCommand { - } - class InfoAnyCommand { - } - class InfoForeachCommand { - } - class InfoHostCommand { - } - class InfoNodeCommand { - } - class JobInfoCommand { - } - const OperateCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class OperateCommand extends OperateCommand_base { - } - const PutCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - class PutCommand extends PutCommand_base { - } - const QueryCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class QueryCommand extends QueryCommand_base { - } - class QueryApplyCommand { - } - const QueryBackgroundCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("job"); - }; - }; - class QueryBackgroundCommand extends QueryBackgroundCommand_base { - } - const QueryOperateCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("job"); - }; - }; - class QueryOperateCommand extends QueryOperateCommand_base { - } - const QueryForeachCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class QueryForeachCommand extends QueryForeachCommand_base { - } - const RemoveCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(): any; - }; - }; - class RemoveCommand extends RemoveCommand_base { - } - const ScanCommand_base: { - new (stream: any, args: any): { - stream: any; - callback(error: any, record: any): boolean; - convertResult(bins: any, meta: any, asKey: any): any; - }; - }; - class ScanCommand extends ScanCommand_base { - } - const ScanBackgroundCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("job"); - }; - }; - class ScanBackgroundCommand extends ScanBackgroundCommand_base { - } - const ScanOperateCommand_base: { - new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { - client: any; - queryID: any; - queryObj: any; - convertResult(): import("job"); - }; - }; - class ScanOperateCommand extends ScanOperateCommand_base { - } - const SelectCommand_base: { - new (client: any, key: any, args: any, callback: any): { - key: any; - convertResult(bins: any, metadata: any): any; - }; - }; - class SelectCommand extends SelectCommand_base { - } - class TruncateCommand { - } - class UdfRegisterCommand { - } - class UdfRemoveCommand { - } - export { ApplyCommand as Apply, BatchExistsCommand as BatchExists, BatchGetCommand as BatchGet, BatchReadCommand as BatchRead, BatchWriteCommand as BatchWrite, BatchApplyCommand as BatchApply, BatchRemoveCommand as BatchRemove, BatchSelectCommand as BatchSelect, ConnectCommand as Connect, ExistsCommand as Exists, GetCommand as Get, IndexCreateCommand as IndexCreate, IndexRemoveCommand as IndexRemove, InfoAnyCommand as InfoAny, InfoForeachCommand as InfoForeach, InfoHostCommand as InfoHost, InfoNodeCommand as InfoNode, JobInfoCommand as JobInfo, OperateCommand as Operate, PutCommand as Put, QueryCommand as Query, QueryApplyCommand as QueryApply, QueryBackgroundCommand as QueryBackground, QueryOperateCommand as QueryOperate, QueryForeachCommand as QueryForeach, RemoveCommand as Remove, ScanCommand as Scan, ScanBackgroundCommand as ScanBackground, ScanOperateCommand as ScanOperate, SelectCommand as Select, TruncateCommand as Truncate, UdfRegisterCommand as UdfRegister, UdfRemoveCommand as UdfRemove }; -} -declare module "config" { - export = Config; - class Config { - constructor(config?: any); - user: any; - password: any; - authMode: any; - clusterName: string; - port: any; - tls: any; - hosts: (Host[] | string); - policies: Policies; - log: any; - connTimeoutMs: any; - loginTimeoutMs: any; - maxSocketIdle: any; - tenderInterval: any; - maxConnsPerNode: any; - minConnsPerNode: any; - modlua: any; - sharedMemory: any; - useAlternateAccessAddress: boolean; - rackAware: boolean; - rackId: any; - setDefaultPolicies(policies: any): void; - private [inspect]; - } - const inspect: unique symbol; -} -declare module "index_job" { - export = IndexJob; - function IndexJob(client: any, namespace: any, indexName: any): void; - class IndexJob { - constructor(client: any, namespace: any, indexName: any); - client: any; - namespace: any; - indexName: any; - private hasCompleted; - private info; - } -} -declare module "record_stream" { - export = RecordStream; - function RecordStream(client: any): void; - class RecordStream { - constructor(client: any); - aborted: boolean; - client: any; - writable: boolean; - readable: boolean; - _read(): void; - abort(): void; - } -} -declare module "query" { - export = Query; - function Query(client: Client, ns: string, set: string, options?: { - filters?: any[] | undefined; - select?: string[] | undefined; - nobins?: boolean | undefined; - } | undefined): void; - class Query { - constructor(client: Client, ns: string, set: string, options?: { - filters?: any[] | undefined; - select?: string[] | undefined; - nobins?: boolean | undefined; - } | undefined); - client: any; - ns: string; - set: string; - filters: any[]; - selected: string[] | undefined; - nobins: boolean | undefined; - udf: any; - private pfEnabled; - select(...args: string[]): void; - where(predicate: any): void; - setSindexFilter(sindexFilter: any): void; - setUdf(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined): void; - partitions(begin: number, count: number, digest: string): void; - partFilter: { - begin: number; - count: number; - digest: string; - } | undefined; - foreach(policy?: QueryPolicy, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; - results(policy?: QueryPolicy): Promise; - apply(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: QueryPolicy, callback?: QueryaggregationResultCallback | undefined): Promise | null; - background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: WritePolicy, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - operate(operations: any, policy?: QueryPolicy, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - ops: any; - } - import RecordStream = require("record_stream"); -} -declare module "scan" { - export = Scan; - function Scan(client: Client, ns: string, set: string, options?: { - select?: string[] | undefined; - nobins?: boolean | undefined; - concurrent?: boolean | undefined; - } | undefined): void; - class Scan { - constructor(client: Client, ns: string, set: string, options?: { - select?: string[] | undefined; - nobins?: boolean | undefined; - concurrent?: boolean | undefined; - } | undefined); - client: any; - ns: string; - set: string; - selected: string[] | undefined; - nobins: boolean | undefined; - concurrent: boolean | undefined; - private pfEnabled; - select(...args: string[]): void; - partitions(begin: number, count: number, digest: string): void; - partFilter: { - begin: number; - count: number; - digest: string; - } | undefined; - background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: ScanPolicy, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - udf: { - module: string; - funcname: string; - args: any[] | undefined; - } | undefined; - operate(operations: any, policy?: ScanPolicy, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; - ops: any; - foreach(policy?: ScanPolicy, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; - } - import RecordStream = require("record_stream"); -} -declare module "udf_job" { - export = UdfJob; - function UdfJob(client: any, udfModule: any, command: any): void; - class UdfJob { - constructor(client: any, udfModule: any, command: any); - client: any; - udfModule: any; - command: any; - private hasCompleted; - private info; - } - namespace UdfJob { - const REGISTER: string; - const UNREGISTER: string; - } -} -declare module "utils" { - export function parseHostString(hostString: any): { - addr: any; - tlsname: any; - port: number; - }; - export function print(err: any, result: any): void; -} -declare module "client" { - export = Client; - function Client(config: Config): void; - class Client { - constructor(config: Config); - config: Config; - private as_client; - private connected; - captureStackTraces: boolean; - private asExec; - getNodes(): Array<{ - name: string; - address: string; - }>; - addSeedHost(hostname: string, port?: number | undefined): void; - removeSeedHost(hostname: string, port?: number | undefined): void; - batchExists(keys: Key[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; - batchGet(keys: Key[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; - batchRead(records: { - type: number; - key: Key; - bins?: string[]; - readAllBins?: boolean; - }, policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; - batchWrite(records: { - type: number; - key: Key; - }, policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; - batchApply(records: { - type: number; - key: Key; - }, udf: object[], batchPolicy?: BatchPolicy, batchApplyPolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchRemove(records: { - type: number; - key: Key; - }, batchPolicy?: BatchPolicy, batchRemovePolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; - batchSelect(keys: Key[], bins: string[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; - close(releaseEventLoop?: boolean | undefined): void; - connect(callback?: connectCallback | undefined): Promise | null; - createIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - datatype: any; - }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; - createIntegerIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; - createStringIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; - createGeo2DSphereIndex(options: { - ns: string; - set: string; - bin: string; - index: string; - type?: any; - }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; - apply(key: Key, udfArgs: { - module: string; - funcname: string; - args: Array<(number | string)>; - }, policy?: ApplyPolicy, callback?: valueCallback | undefined): Promise | null; - exists(key: Key, policy?: ReadPolicy, callback?: valueCallback | undefined): Promise | null; - get(key: Key, policy?: ReadPolicy, callback?: recordCallback | undefined): Promise | null; - indexRemove(namespace: string, index: string, policy?: InfoPolicy, callback?: doneCallback | undefined): Promise | null; - info(request: string | null, host: { - addr: string; - port?: number | undefined; - }, policy?: InfoPolicy, callback?: infoCallback | undefined): any; - infoAny(request?: string | undefined, policy?: InfoPolicy, callback?: infoCallback | undefined): any; - infoAll(request?: string | undefined, policy?: InfoPolicy, callback?: infoCallback | undefined): any; - infoNode(request: string | null, node: { - name: string; - }, policy?: InfoPolicy, callback?: infoCallback | undefined): any; - isConnected(checkTenderErrors?: boolean | undefined): boolean; - operate(key: Key, operations: any, metadata?: any, policy?: OperatePolicy, callback?: recordCallback | undefined): any; - incr: any; - put(key: Key, bins: object, meta?: object, policy?: WritePolicy, callback?: writeCallback | undefined): any; - query(ns: string, set: string, options?: object): Query; - remove(key: Key, policy?: RemovePolicy, callback?: writeCallback | undefined): any; - scan(ns: string, set: string, options?: object): Scan; - select(key: Key, bins: string[], policy?: ReadPolicy, callback?: recordCallback | undefined): any; - truncate(ns: string, set: string, beforeNanos: any, policy?: InfoPolicy, callback?: doneCallback | undefined): any; - udfRegister(udfPath: any, udfType?: number | undefined, policy?: InfoPolicy, callback?: jobCallback | undefined): any; - stats(): ClientStats; - udfRemove(udfModule: string, policy?: InfoPolicy, callback?: jobCallback | undefined): any; - updateLogging(logConfig: any): void; - } - import Config = require("config"); - import Query = require("query"); - import Scan = require("scan"); -} -declare module "double" { - export = Double; - function Double(value: number): void; - class Double { - constructor(value: number); - Double: number; - value(): number; - } -} -declare module "batch_type" { - export const BATCH_READ: any; - export const BATCH_WRITE: any; - export const BATCH_APPLY: any; - export const BATCH_REMOVE: any; -} -declare module "aerospike" { - export const filter: typeof import("filter"); - export const exp: typeof import("exp"); - export namespace regex { - const BASIC: number; - const EXTENDED: number; - const ICASE: number; - const NEWLINE: number; - } - export type regex = number; - export const info: typeof import("info"); - export const lists: typeof import("lists"); - export const hll: typeof import("hll"); - export const maps: typeof import("maps"); - export namespace cdt { - const Context: typeof import("cdt_context"); - } - export const bitwise: typeof import("bitwise"); - export const operations: typeof import("operations"); - export const policy: typeof import("policy"); - export const BasePolicy: typeof import("policies/base_policy"); - export const ApplyPolicy: typeof import("policies/apply_policy"); - export const BatchPolicy: typeof import("policies/batch_policy"); - export const OperatePolicy: typeof import("policies/operate_policy"); - export const QueryPolicy: typeof import("policies/query_policy"); - export const ReadPolicy: typeof import("policies/read_policy"); - export const RemovePolicy: typeof import("policies/remove_policy"); - export const ScanPolicy: typeof import("policies/scan_policy"); - export const WritePolicy: typeof import("policies/write_policy"); - export const BatchApplyPolicy: typeof import("policies/batch_apply_policy"); - export const BatchReadPolicy: typeof import("policies/batch_read_policy"); - export const BatchRemovePolicy: typeof import("policies/batch_remove_policy"); - export const BatchWritePolicy: typeof import("policies/batch_write_policy"); - export const CommandQueuePolicy: typeof import("policies/command_queue_policy"); - export const InfoPolicy: typeof import("policies/info_policy"); - export const ListPolicy: typeof import("policies/list_policy"); - export const MapPolicy: typeof import("policies/map_policy"); - export const status: typeof import("status"); - export const features: typeof import("features"); - export { AerospikeError }; - export const Client: typeof import("client"); - export const Config: typeof import("config"); - export const Double: typeof import("double"); - export const GeoJSON: typeof import("geojson"); - export const Key: typeof import("key"); - export const Record: typeof import("record"); - export type auth = number; - export type language = number; - export type log = number; - export type ttl = number; - export type jobStatus = number; - export type indexDataType = number; - export type indexType = number; - export const print: typeof import("utils").print; - export const releaseEventLoop: typeof EventLoop.releaseEventLoop; - export function client(config?: any): import("client"); - export function connect(config?: any, callback?: connectCallback | undefined): Promise | null; - export function setDefaultLogging(logInfo: any): void; - export function setupGlobalCommandQueue(policy: CommandQueuePolicy): void; - export const batchType: { - BATCH_READ: any; - BATCH_WRITE: any; - BATCH_APPLY: any; - BATCH_REMOVE: any; - }; - import AerospikeError = require("error"); - import EventLoop = require("event_loop"); +declare module 'admin' { + export const User: typeof import("user"); + export const Privilege: typeof import("privilege"); + export const Role: typeof import("role"); + +} +declare module 'aerospike' { + export const filter: typeof import("filter"); + export const exp: typeof import("exp"); + export namespace regex { + const BASIC: number; + const EXTENDED: number; + const ICASE: number; + const NEWLINE: number; + } + export type regex = number; + export const info: typeof import("info"); + export const admin: typeof import("admin"); + export const lists: typeof import("lists"); + export const hll: typeof import("hll"); + export const maps: typeof import("maps"); + export namespace cdt { + const Context: typeof import("cdt_context"); + } + export const bitwise: typeof import("bitwise"); + export const operations: typeof import("operations"); + export const policy: typeof import("policy"); + export const BasePolicy: typeof import("policies/base_policy"); + export const ApplyPolicy: typeof import("policies/apply_policy"); + export const BatchPolicy: typeof import("policies/batch_policy"); + export const OperatePolicy: typeof import("policies/operate_policy"); + export const QueryPolicy: typeof import("policies/query_policy"); + export const ReadPolicy: typeof import("policies/read_policy"); + export const RemovePolicy: typeof import("policies/remove_policy"); + export const ScanPolicy: typeof import("policies/scan_policy"); + export const WritePolicy: typeof import("policies/write_policy"); + export const BatchApplyPolicy: typeof import("policies/batch_apply_policy"); + export const BatchReadPolicy: typeof import("policies/batch_read_policy"); + export const BatchRemovePolicy: typeof import("policies/batch_remove_policy"); + export const BatchWritePolicy: typeof import("policies/batch_write_policy"); + export const CommandQueuePolicy: typeof import("policies/command_queue_policy"); + export const InfoPolicy: typeof import("policies/info_policy"); + export const ListPolicy: typeof import("policies/list_policy"); + export const MapPolicy: typeof import("policies/map_policy"); + export const AdminPolicy: typeof import("policies/admin_policy"); + export const status: typeof import("status"); + export const features: typeof import("features"); + export { AerospikeError }; + export const Client: typeof import("client"); + export const Config: typeof import("config"); + export const Double: typeof import("double"); + export const GeoJSON: typeof import("geojson"); + export const Key: typeof import("key"); + export const Record: typeof import("record"); + export const Bin: typeof import("bin"); + export type auth = number; + export type language = number; + export type log = number; + export type ttl = number; + export type jobStatus = number; + export type indexDataType = number; + export type indexType = number; + export const print: typeof import("utils").print; + export const releaseEventLoop: typeof EventLoop.releaseEventLoop; + export function client(config?: any): import("client"); + export function connect(config?: any, callback?: connectCallback | undefined): Promise | null; + export function setDefaultLogging(logInfo: any): void; + export function setupGlobalCommandQueue(policy: CommandQueuePolicy): void; + export const batchType: { + BATCH_READ: any; + BATCH_WRITE: any; + BATCH_APPLY: any; + BATCH_REMOVE: any; + }; + export const privilegeCode: { + USER_ADMIN: any; + SYS_ADMIN: any; + DATA_ADMIN: any; + UDF_ADMIN: any; + SINDEX_ADMIN: any; + READ: any; + READ_WRITE: any; + READ_WRITE_UDF: any; + WRITE: any; + TRUNCATE: any; + }; + import AerospikeError = require("error"); + import EventLoop = require("event_loop"); +} +declare module 'batch_type' { + export const BATCH_READ: any; + export const BATCH_WRITE: any; + export const BATCH_APPLY: any; + export const BATCH_REMOVE: any; +} +declare module 'bigint' { + export const BigInt: BigIntConstructor; + export const bigIntSupported: true; + export function isInt64(value: any): boolean; +} +declare module 'bin' { + export = Bin; + class Bin { + private constructor(); + name: any; + value: any; +} +declare module 'bitwise' { + export function resize(bin: string, size: number, flags?: number | undefined): BitwiseOperation; + export function insert(bin: string, byteOffset: any, value: Buffer): BitwiseOperation; + export function remove(bin: string, byteOffset: number, byteSize: number): BitwiseOperation; + export function set(bin: string, bitOffset: number, bitSize: number, value: number | Buffer): BitwiseOperation; + export function or(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; + export function xor(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; + export function and(bin: string, bitOffset: number, bitSize: number, value: Buffer): BitwiseOperation; + export function not(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; + export function lshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; + export function rshift(bin: string, bitOffset: number, bitSize: number, shift: number): BitwiseOperation; + export function add(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; + export function subtract(bin: string, bitOffset: number, bitSize: number, value: number, sign: boolean): OverflowableBitwiseOp; + export function get(bin: string, bitOffset: number, bitSize: number): BitwiseOperation; + export function getInt(bin: string, bitOffset: number, bitSize: number, sign: boolean): BitwiseOperation; + export function lscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; + export function rscan(bin: string, bitOffset: number, bitSize: number, value: boolean): BitwiseOperation; + class BitwiseOperation extends Operation { + withPolicy(policy: BitwisePolicy): BitwiseOperation; + policy: any; + } + class OverflowableBitwiseOp extends BitwiseOperation { + overflowAction: any; + onOverflow(action: number): OverflowableBitwiseOp; + } + import Operation_1 = require("operations"); + import Operation = Operation_1.Operation; + export {}; +} +declare module 'cdt_context' { + export = CdtContext; + class CdtContext { + static getContextType(ctx: CdtContext, type: number): number; + items: any[]; + addListIndex(index: number): CdtContext; + addListIndexCreate(index: number, order: number, pad: boolean): CdtContext; + addListRank(rank: number): CdtContext; + addListValue(value: any): CdtContext; + addMapIndex(index: number): CdtContext; + addMapRank(rank: number): CdtContext; + addMapKey(key: any): CdtContext; + addMapKeyCreate(key: any, order: number): CdtContext; + addMapValue(value: any): CdtContext; + private add; + } +} +declare module 'client' { + export = Client; + function Client(config: Config): void; + class Client { + constructor(config: Config); + config: Config; + private as_client; + private connected; + captureStackTraces: boolean; + private asExec; + getNodes(): Array<{ + name: string; + address: string; + }>; + contextToBase64(context: any): string; + contextFromBase64(serializedContext: string): CdtContext; + changePassword(user: string, password: string, policy: any): void; + createUser(user: string, password: string, roles: Array, policy: any): void; + createRole(roleName: string, privileges: Array, policy: any, whitelist: Array, readQuota: number, writeQuota: number): void; + dropRole(roleName: string, policy: any): void; + dropUser(user: string, policy: any): void; + grantPrivileges(roleName: string, privileges: Array, policy: any): void; + grantRoles(user: string, roles: Array, policy: any): void; + queryRole(roleName: string, policy: any): Role; + queryRoles(policy: any): Array; + queryUser(user: string, policy: any): User; + queryUsers(policy: any): Array; + revokePrivileges(roleName: string, privileges: Array, policy: any): void; + revokeRoles(user: string, roles: Array, policy: any): void; + setQuotas(roleName: string, readQuota: number, writeQuota: number, policy: any): void; + setWhitelist(roleName: string, whitelist: Array, policy: any): void; + addSeedHost(hostname: string, port?: number | undefined): void; + removeSeedHost(hostname: string, port?: number | undefined): void; + batchExists(keys: Key[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; + batchGet(keys: Key[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; + batchRead(records: { + type: number; + key: Key; + bins?: string[]; + readAllBins?: boolean; + ops?: any[]; + }, policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; + batchWrite(records: { + type: number; + key: Key; + }, policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; + batchApply(records: { + type: number; + key: Key; + }, udf: object[], batchPolicy?: BatchPolicy, batchApplyPolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; + batchRemove(records: { + type: number; + key: Key; + }, batchPolicy?: BatchPolicy, batchRemovePolicy?: any, callback?: batchRecordsCallback | undefined): Promise | null; + batchSelect(keys: Key[], bins: string[], policy?: BatchPolicy, callback?: batchRecordsCallback | undefined): Promise | null; + close(releaseEventLoop?: boolean | undefined): void; + connect(callback?: connectCallback | undefined): Promise | null; + createIndex(options: { + ns: string; + set: string; + bin: string; + index: string; + type?: any; + datatype: any; + context: any; + }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; + createIntegerIndex(options: { + ns: string; + set: string; + bin: string; + index: string; + type?: any; + }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; + createStringIndex(options: { + ns: string; + set: string; + bin: string; + index: string; + type?: any; + }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; + createGeo2DSphereIndex(options: { + ns: string; + set: string; + bin: string; + index: string; + type?: any; + }, policy?: InfoPolicy, callback?: jobCallback | undefined): Promise | null; + apply(key: Key, udfArgs: { + module: string; + funcname: string; + args: Array<(number | string)>; + }, policy?: ApplyPolicy, callback?: valueCallback | undefined): Promise | null; + exists(key: Key, policy?: ReadPolicy, callback?: valueCallback | undefined): Promise | null; + get(key: Key, policy?: ReadPolicy, callback?: recordCallback | undefined): Promise | null; + indexRemove(namespace: string, index: string, policy?: InfoPolicy, callback?: doneCallback | undefined): Promise | null; + info(request: string | null, host: { + addr: string; + port?: number | undefined; + }, policy?: InfoPolicy, callback?: infoCallback | undefined): any; + infoAny(request?: string | undefined, policy?: InfoPolicy, callback?: infoCallback | undefined): any; + infoAll(request?: string | undefined, policy?: InfoPolicy, callback?: infoCallback | undefined): any; + infoNode(request: string | null, node: { + name: string; + }, policy?: InfoPolicy, callback?: infoCallback | undefined): any; + isConnected(checkTenderErrors?: boolean | undefined): boolean; + operate(key: Key, operations: any, metadata?: any, policy?: OperatePolicy, callback?: recordCallback | undefined): any; + incr: any; + put(key: Key, bins: object, meta?: object, policy?: WritePolicy, callback?: writeCallback | undefined): any; + query(ns: string, set: string, options?: object): Query; + remove(key: Key, policy?: RemovePolicy, callback?: writeCallback | undefined): any; + scan(ns: string, set: string, options?: object): Scan; + select(key: Key, bins: string[], policy?: ReadPolicy, callback?: recordCallback | undefined): any; + truncate(ns: string, set: string, beforeNanos: any, policy?: InfoPolicy, callback?: doneCallback | undefined): any; + udfRegister(udfPath: any, udfType?: number | undefined, policy?: InfoPolicy, callback?: jobCallback | undefined): any; + stats(): ClientStats; + udfRemove(udfModule: string, policy?: InfoPolicy, callback?: jobCallback | undefined): any; + updateLogging(logConfig: any): void; + } + import Config = require("config"); + import Query = require("query"); + import Scan = require("scan"); +} +declare module 'commands/batch_command' { + function _exports(asCommand: any): { + new (): { + convertResult(results: any): any; + }; + }; + export = _exports; +} +declare module 'commands/command' { + const _exports: Class; + export = _exports; +} +declare module 'commands/connect_command' { + function _exports(asCommand: any): { + new (client: any, callback: any): { + ensureConnected: boolean; + }; + }; + export = _exports; +} +declare module 'commands/exists_command' { + function _exports(asCommand: any): { + new (): { + convertResponse(error: any): any[]; + }; + }; + export = _exports; +} +declare module 'commands/index' { + class ApplyCommand { + } + const BatchExistsCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchExistsCommand extends BatchExistsCommand_base { + } + const BatchGetCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchGetCommand extends BatchGetCommand_base { + } + const BatchReadCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchReadCommand extends BatchReadCommand_base { + } + const BatchWriteCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchWriteCommand extends BatchWriteCommand_base { + } + const BatchApplyCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchApplyCommand extends BatchApplyCommand_base { + } + const BatchRemoveCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchRemoveCommand extends BatchRemoveCommand_base { + } + const BatchSelectCommand_base: { + new (): { + convertResult(results: any): any; + }; + }; + class BatchSelectCommand extends BatchSelectCommand_base { + } + class ChangePasswordCommand { + } + const ConnectCommand_base: { + new (client: any, callback: any): { + ensureConnected: boolean; + }; + }; + class ConnectCommand extends ConnectCommand_base { + } + const ExistsCommand_base: { + new (): { + convertResponse(error: any): any[]; + }; + }; + class ExistsCommand extends ExistsCommand_base { + } + const GetCommand_base: { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(bins: any, metadata: any): any; + }; + }; + class GetCommand extends GetCommand_base { + } + class IndexCreateCommand { + } + class IndexRemoveCommand { + } + class InfoAnyCommand { + } + class InfoForeachCommand { + } + class InfoHostCommand { + } + class InfoNodeCommand { + } + class JobInfoCommand { + } + const OperateCommand_base: { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(bins: any, metadata: any): any; + }; + }; + class OperateCommand extends OperateCommand_base { + } + class PrivilegeGrantCommand { + } + class PrivilegeRevokeCommand { + } + const PutCommand_base: { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(): any; + }; + }; + class PutCommand extends PutCommand_base { + } + const QueryCommand_base: { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + class QueryCommand extends QueryCommand_base { + } + const QueryPagesCommand_base: { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + class QueryPagesCommand extends QueryPagesCommand_base { + } + class QueryApplyCommand { + } + const QueryBackgroundCommand_base: { + new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { + client: any; + queryID: any; + queryObj: any; + convertResult(): import("job"); + }; + }; + class QueryBackgroundCommand extends QueryBackgroundCommand_base { + } + const QueryOperateCommand_base: { + new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { + client: any; + queryID: any; + queryObj: any; + convertResult(): import("job"); + }; + }; + class QueryOperateCommand extends QueryOperateCommand_base { + } + const QueryForeachCommand_base: { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + class QueryForeachCommand extends QueryForeachCommand_base { + } + class QueryRoleCommand { + } + class QueryRolesCommand { + } + class QueryUserCommand { + } + class QueryUsersCommand { + } + const RemoveCommand_base: { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(): any; + }; + }; + class RemoveCommand extends RemoveCommand_base { + } + class RoleCreateCommand { + } + class RoleDropCommand { + } + class RoleGrantCommand { + } + class RoleRevokeCommand { + } + class RoleSetWhitelistCommand { + } + class RoleSetQuotasCommand { + } + const ScanCommand_base: { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + class ScanCommand extends ScanCommand_base { + } + const ScanPagesCommand_base: { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + class ScanPagesCommand extends ScanPagesCommand_base { + } + const ScanBackgroundCommand_base: { + new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { + client: any; + queryID: any; + queryObj: any; + convertResult(): import("job"); + }; + }; + class ScanBackgroundCommand extends ScanBackgroundCommand_base { + } + const ScanOperateCommand_base: { + new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { + client: any; + queryID: any; + queryObj: any; + convertResult(): import("job"); + }; + }; + class ScanOperateCommand extends ScanOperateCommand_base { + } + const SelectCommand_base: { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(bins: any, metadata: any): any; + }; + }; + class SelectCommand extends SelectCommand_base { + } + class TruncateCommand { + } + class UdfRegisterCommand { + } + class UdfRemoveCommand { + } + class UserCreateCommand { + } + class UserDropCommand { + } + export { ApplyCommand as Apply, BatchExistsCommand as BatchExists, BatchGetCommand as BatchGet, BatchReadCommand as BatchRead, BatchWriteCommand as BatchWrite, BatchApplyCommand as BatchApply, BatchRemoveCommand as BatchRemove, BatchSelectCommand as BatchSelect, ChangePasswordCommand as ChangePassword, ConnectCommand as Connect, ExistsCommand as Exists, GetCommand as Get, IndexCreateCommand as IndexCreate, IndexRemoveCommand as IndexRemove, InfoAnyCommand as InfoAny, InfoForeachCommand as InfoForeach, InfoHostCommand as InfoHost, InfoNodeCommand as InfoNode, JobInfoCommand as JobInfo, OperateCommand as Operate, PrivilegeGrantCommand as PrivilegeGrant, PrivilegeRevokeCommand as PrivilegeRevoke, PutCommand as Put, QueryCommand as Query, QueryPagesCommand as QueryPages, QueryApplyCommand as QueryApply, QueryBackgroundCommand as QueryBackground, QueryOperateCommand as QueryOperate, QueryForeachCommand as QueryForeach, QueryRoleCommand as QueryRole, QueryRolesCommand as QueryRoles, QueryUserCommand as QueryUser, QueryUsersCommand as QueryUsers, RemoveCommand as Remove, RoleCreateCommand as RoleCreate, RoleDropCommand as RoleDrop, RoleGrantCommand as RoleGrant, RoleRevokeCommand as RoleRevoke, RoleSetWhitelistCommand as RoleSetWhitelist, RoleSetQuotasCommand as RoleSetQuotas, ScanCommand as Scan, ScanPagesCommand as ScanPages, ScanBackgroundCommand as ScanBackground, ScanOperateCommand as ScanOperate, SelectCommand as Select, TruncateCommand as Truncate, UdfRegisterCommand as UdfRegister, UdfRemoveCommand as UdfRemove, UserCreateCommand as UserCreate, UserDropCommand as UserDrop }; +} +declare module 'commands/query_background_command' { + function _exports(asCommand: any): { + new (client: any, ns: any, set: any, queryObj: any, policy: any, queryID: any, callback: any): { + client: any; + queryID: any; + queryObj: any; + convertResult(): Job; + }; + }; + export = _exports; + import Job = require(".job"); +} +declare module 'commands/read_record_command' { + function _exports(asCommand: any): { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(bins: any, metadata: any): any; + }; + }; + export = _exports; +} +declare module 'commands/stream_command' { + function _exports(asCommand: any): { + new (stream: any, args: any): { + stream: any; + callback(error: any, record: any): boolean; + convertResult(bins: any, meta: any, asKey: any): any; + }; + }; + export = _exports; +} +declare module 'commands/write_record_command' { + function _exports(asCommand: any): { + new (client: any, key: any, args: any, callback: any): { + key: any; + convertResult(): any; + }; + }; + export = _exports; +} +declare module 'config' { + export = Config; + class Config { + constructor(config?: any); + user: any; + password: any; + authMode: any; + clusterName: string; + port: any; + tls: any; + hosts: (Host[] | string); + policies: Policies; + log: any; + connTimeoutMs: any; + loginTimeoutMs: any; + maxSocketIdle: any; + tenderInterval: any; + maxConnsPerNode: any; + minConnsPerNode: any; + modlua: any; + sharedMemory: any; + useAlternateAccessAddress: boolean; + rackAware: boolean; + rackId: any; + setDefaultPolicies(policies: any): void; + private [inspect]; + } + const inspect: unique symbol; +} +declare module 'double' { + export = Double; + function Double(value: number): void; + class Double { + constructor(value: number); + Double: number; + value(): number; + } +} +declare module 'error' { + export = AerospikeError; + class AerospikeError extends Error { + private static fromASError; + private static copyASErrorProperties; + private static formatMessage; + private constructor(); + code: number; + command: any | null; + func: string | null; + file: string | null; + line: number | null; + inDoubt: boolean; + private setStackTrace; + isServerError(): boolean; + get client(): any; + } +} +declare module 'event_loop' { + export function releaseEventLoop(): void; + export function registerASEventLoop(): void; + export function referenceEventLoop(): void; + export function unreferenceEventLoop(): void; + export function setCommandQueuePolicy(policy: any): void; +} +declare module 'exp' { + export function bool(value: any): { + [x: number]: any; + op: any; + }[]; + export function int(value: any): { + [x: number]: any; + op: any; + }[]; + export function uint(value: any): { + [x: number]: any; + op: any; + }[]; + export function float(value: any): { + [x: number]: any; + op: any; + }[]; + export function str(value: any): { + [x: number]: any; + op: any; + }[]; + export function bytes(value: any, size: any): { + [x: number]: any; + op: any; + }[]; + export function geo(value: any): { + [x: number]: any; + op: any; + }[]; + export function nil(): { + op: any; + value: null; + }[]; + export function inf(): { + op: any; + value: null; + }[]; + export function wildcard(): { + op: any; + value: null; + }[]; + export function keyInt(): { + [x: number]: any; + op: any; + }[]; + export function keyStr(): { + [x: number]: any; + op: any; + }[]; + export function keyBlob(): { + [x: number]: any; + op: any; + }[]; + export function keyExist(): AerospikeExp; + export function binBool(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binInt(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binFloat(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binStr(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binBlob(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binGeo(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binList(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binMap(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binHll(binName: any): { + [x: number]: any; + op: any; + }[]; + export function binType(binName: any): ({ + op: any; + strVal: any; + } | { + op: any; + count: number; + })[]; + export function binExists(binName: string): boolean; + export function setName(): { + op: any; + count: number; + }[]; + export function deviceSize(): { + op: any; + count: number; + }[]; + export function lastUpdate(): { + op: any; + count: number; + }[]; + export function sinceUpdate(): { + op: any; + count: number; + }[]; + export function voidTime(): { + op: any; + count: number; + }[]; + export function ttl(): { + op: any; + count: number; + }[]; + export function isTombstone(): { + op: any; + count: number; + }[]; + export function memorySize(): { + op: any; + count: number; + }[]; + export function digestModulo(): { + op: any; + count: number; + }[]; + export function eq(left: any, right: any): { + op: any; + count: number; + }[]; + export function ne(left: any, right: any): { + op: any; + count: number; + }[]; + export function gt(left: any, right: any): { + op: any; + count: number; + }[]; + export function ge(left: any, right: any): { + op: any; + count: number; + }[]; + export function lt(left: any, right: any): { + op: any; + count: number; + }[]; + export function le(left: any, right: any): { + op: any; + count: number; + }[]; + export function cmpRegex(options: number, regex: string, cmpStr: AerospikeExp): AerospikeExp; + export function cmpGeo(left: any, right: any): { + op: any; + count: number; + }[]; + export function not(expr: AerospikeExp): AerospikeExp; + export function and(...expr: any[]): never[]; + export function or(...expr: any[]): never[]; + export function exclusive(...expr: any[]): never[]; + export function add(...expr: any[]): never[]; + export function sub(...expr: any[]): never[]; + export function mul(...expr: any[]): never[]; + export function div(...expr: any[]): never[]; + export function pow(...params: any[]): any[]; + export function log(...params: any[]): any[]; + export function mod(...params: any[]): any[]; + export function abs(...params: any[]): any[]; + export function floor(...params: any[]): any[]; + export function ceil(...params: any[]): any[]; + export function toInt(...params: any[]): any[]; + export function toFloat(...params: any[]): any[]; + export function intAnd(...expr: any[]): never[]; + export function intOr(...expr: any[]): never[]; + export function intXor(...expr: any[]): never[]; + export function intNot(...params: any[]): any[]; + export function intLshift(...params: any[]): any[]; + export function intRshift(...params: any[]): any[]; + export function intArshift(...params: any[]): any[]; + export function intCount(...params: any[]): any[]; + export function intLscan(...params: any[]): any[]; + export function intRscan(...params: any[]): any[]; + export function min(...expr: any[]): never[]; + export function max(...expr: any[]): never[]; + export function cond(...expr: any[]): never[]; + function _let(...expr: any[]): never[]; + export function def(varName: string, expr: AerospikeExp): AerospikeExp; + function _var(varName: string): AerospikeExp; + export const lists: { + size: (bin: any, ctx?: any) => any; + getByValue: (bin: any, value: any, returnType: any, ctx?: any) => any; + getByValueRange: (bin: any, begin: any, end: any, returnType: any, ctx?: any) => any; + getByValueList: (bin: any, value: any, returnType: any, ctx?: any) => any; + getByRelRankRangeToEnd: (bin: any, value: any, rank: any, returnType: any, ctx?: any) => any; + getByRelRankRange: (bin: any, value: any, rank: any, count: any, returnType: any, ctx?: any) => any; + getByIndex: (bin: any, index: any, valueType: any, returnType: any, ctx?: any) => any; + getByIndexRangeToEnd: (bin: any, index: any, returnType: any, ctx?: any) => any; + getByIndexRange: (bin: any, index: any, count: any, returnType: any, ctx?: any) => any; + getByRank: (bin: any, rank: any, valueType: any, returnType: any, ctx?: any) => any; + getByRankRangeToEnd: (bin: any, rank: any, returnType: any, ctx?: any) => any; + getByRankRange: (bin: any, rank: any, count: any, returnType: any, ctx?: any) => any; + append: (bin: any, value: any, policy?: any, ctx?: any) => any; + appendItems: (bin: any, value: any, policy?: any, ctx?: any) => any; + insert: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; + insertItems: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; + increment: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; + set: (bin: any, value: any, idx: any, policy?: any, ctx?: any) => any; + clear: (bin: any, ctx?: any) => any; + sort: (bin: any, order: number, ctx?: any) => any; + removeByValue: (bin: any, value: any, ctx?: any) => any; + removeByValueList: (bin: any, values: any, ctx?: any) => any; + removeByValueRange: (bin: any, end: any, begin: any, ctx?: any) => any; + removeByRelRankRangeToEnd: (bin: any, rank: any, value: any, ctx?: any) => any; + removeByRelRankRange: (bin: any, count: any, rank: any, value: any, ctx?: any) => any; + removeByIndex: (bin: any, idx: any, ctx?: any) => any; + removeByIndexRangeToEnd: (bin: any, idx: any, ctx?: any) => any; + removeByIndexRange: (bin: any, count: any, idx: any, ctx?: any) => any; + removeByRank: (bin: any, rank: any, ctx?: any) => any; + removeByRankRangeToEnd: (bin: any, rank: any, ctx?: any) => any; + removeByRankRange: (bin: any, count: any, rank: any, ctx?: any) => any; + }; + export const maps: { + put: (bin: any, value: any, key: any, policy?: any, ctx?: any) => any; + putItems: (bin: any, map: any, policy?: any, ctx?: any) => any; + increment: (bin: any, value: any, key: any, policy?: any, ctx?: any) => any; + clear: (bin: any, ctx?: any) => any; + removeByKey: (bin: any, key: any, ctx?: any) => any; + removeByKeyList: (bin: any, keys: any, ctx?: any) => any; + removeByKeyRange: (bin: any, end: any, begin: any, ctx?: any) => any; + removeByKeyRelIndexRangeToEnd: (bin: any, idx: any, key: any, ctx?: any) => any; + removeByKeyRelIndexRange: (bin: any, count: any, idx: any, key: any, ctx?: any) => any; + removeByValue: (bin: any, value: any, ctx?: any) => any; + removeByValueList: (bin: any, values: any, ctx?: any) => any; + removeByValueRange: (bin: any, end: any, begin: any, ctx?: any) => any; + removeByValueRelRankRangeToEnd: (bin: any, rank: any, value: any, ctx?: any) => any; + removeByValueRelRankRange: (bin: any, count: any, rank: any, value: any, ctx?: any) => any; + removeByIndex: (bin: any, idx: any, ctx?: any) => any; + removeByIndexRangeToEnd: (bin: any, idx: any, ctx?: any) => any; + removeByIndexRange: (bin: any, count: any, idx: any, ctx?: any) => any; + removeByRank: (bin: any, rank: any, ctx?: any) => any; + removeByRankRangeToEnd: (bin: any, rank: any, ctx?: any) => any; + removeByRankRange: (bin: any, count: any, rank: any, ctx?: any) => any; + size: (bin: any, ctx?: any) => any; + getByKey: (bin: any, key: any, valueType: any, returnType: any, ctx?: any) => any; + getByKeyRange: (bin: any, end: any, begin: any, returnType: any, ctx?: any) => any; + getByKeyList: (bin: any, keys: any, returnType: any, ctx?: any) => any; + getByKeyRelIndexRangeToEnd: (bin: any, idx: any, key: any, returnType: any, ctx?: any) => any; + getByKeyRelIndexRange: (bin: any, count: any, idx: any, key: any, returnType: any, ctx?: any) => any; + getByValue: (bin: any, value: any, returnType: any, ctx?: any) => any; + getByValueRange: (bin: any, end: any, begin: any, returnType: any, ctx?: any) => any; + getByValueList: (bin: any, values: any, returnType: any, ctx?: any) => any; + getByValueRelRankRangeToEnd: (bin: any, rank: any, value: any, returnType: any, ctx?: any) => any; + getByValueRelRankRange: (bin: any, count: any, rank: any, value: any, returnType: any, ctx?: any) => any; + getByIndex: (bin: any, idx: any, valueType: any, returnType: any, ctx?: any) => any; + getByIndexRangeToEnd: (bin: any, idx: any, returnType: any, ctx?: any) => any; + getByIndexRange: (bin: any, count: any, idx: any, returnType: any, ctx?: any) => any; + getByRank: (bin: any, rank: any, valueType: any, returnType: any, ctx?: any) => any; + getByRankRangeToEnd: (bin: any, rank: any, returnType: any, ctx?: any) => any; + getByRankRange: (bin: any, count: any, rank: any, returnType: any, ctx?: any) => any; + }; + export const bit: { + reSize: (bin: any, flags: number, byteSize: number, policy?: any) => any; + insert: (bin: any, value: any, byteOffset: any, policy?: any) => any; + remove: (bin: any, byteSize: number, byteOffset: any, policy?: any) => any; + set: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + or: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + xor: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + and: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + not: (bin: any, bitSize: any, bitOffset: any, policy?: any) => any; + lShift: (bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any) => any; + rShift: (bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any) => any; + add: (bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + subtract: (bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + setInt: (bin: any, value: any, bitSize: any, bitOffset: any, policy?: any) => any; + get: (bin: any, bitSize: any, bitOffset: any) => any; + count: (bin: any, bitSize: any, bitOffset: any) => number; + lScan: (bin: any, value: any, bitSize: any, bitOffset: any) => number; + rScan: (bin: any, value: any, bitSize: any, bitOffset: any) => number; + getInt: (bin: any, sign: boolean, bitSize: any, bitOffset: any) => any; + }; + export const hll: { + initMH: (bin: any, mhBitCount: number, indexBitCount: number, policy?: any) => any; + init: (bin: any, indexBitCount: number, policy?: any) => any; + addMH: (bin: any, mhBitCount: number, indexBitCount: number, list: any, policy?: any) => any; + add: (bin: any, indexBitCount: number, list: any, policy?: any) => any; + update: (bin: any, list: any, policy?: any) => any; + getCount: (bin: any) => any; + getUnion: (bin: any, list: any) => any; + getUnionCount: (bin: any, list: any) => any; + getIntersectCount: (bin: any, list: any) => any; + getSimilarity: (bin: any, list: any) => any[]; + describe: (bin: any) => any; + mayContain: (bin: any, list: any) => any; + }; + function _val(value: any): { + [x: number]: any; + op: any; + }[]; + export { _val as list, _val as map, _let as let, _var as var }; +} +declare module 'exp_bit' { + export function reSize(bin: any, flags: number, byteSize: number, policy?: any): any; + export function insert(bin: any, value: any, byteOffset: any, policy?: any): any; + export function remove(bin: any, byteSize: number, byteOffset: any, policy?: any): any; + export function set(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function or(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function xor(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function and(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function not(bin: any, bitSize: any, bitOffset: any, policy?: any): any; + export function lShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; + export function rShift(bin: any, shift: number, bitSize: any, bitOffset: any, policy?: any): any; + export function add(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function subtract(bin: any, action: number, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function setInt(bin: any, value: any, bitSize: any, bitOffset: any, policy?: any): any; + export function get(bin: any, bitSize: any, bitOffset: any): any; + export function count(bin: any, bitSize: any, bitOffset: any): number; + export function lScan(bin: any, value: any, bitSize: any, bitOffset: any): number; + export function rScan(bin: any, value: any, bitSize: any, bitOffset: any): number; + export function getInt(bin: any, sign: boolean, bitSize: any, bitOffset: any): any; +} +declare module 'exp_hll' { + export function initMH(bin: any, mhBitCount: number, indexBitCount: number, policy?: any): any; + export function init(bin: any, indexBitCount: number, policy?: any): any; + export function addMH(bin: any, mhBitCount: number, indexBitCount: number, list: any, policy?: any): any; + export function add(bin: any, indexBitCount: number, list: any, policy?: any): any; + export function update(bin: any, list: any, policy?: any): any; + export function getCount(bin: any): any; + export function getUnion(bin: any, list: any): any; + export function getUnionCount(bin: any, list: any): any; + export function getIntersectCount(bin: any, list: any): any; + export function getSimilarity(bin: any, list: any): any[]; + export function describe(bin: any): any; + export function mayContain(bin: any, list: any): any; +} +declare module 'exp_lists' { + export function size(bin: any, ctx?: any): any; + export function getByValue(bin: any, value: any, returnType: any, ctx?: any): any; + export function getByValueRange(bin: any, begin: any, end: any, returnType: any, ctx?: any): any; + export function getByValueList(bin: any, value: any, returnType: any, ctx?: any): any; + export function getByRelRankRangeToEnd(bin: any, value: any, rank: any, returnType: any, ctx?: any): any; + export function getByRelRankRange(bin: any, value: any, rank: any, count: any, returnType: any, ctx?: any): any; + export function getByIndex(bin: any, index: any, valueType: any, returnType: any, ctx?: any): any; + export function getByIndexRangeToEnd(bin: any, index: any, returnType: any, ctx?: any): any; + export function getByIndexRange(bin: any, index: any, count: any, returnType: any, ctx?: any): any; + export function getByRank(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; + export function getByRankRangeToEnd(bin: any, rank: any, returnType: any, ctx?: any): any; + export function getByRankRange(bin: any, rank: any, count: any, returnType: any, ctx?: any): any; + export function append(bin: any, value: any, policy?: any, ctx?: any): any; + export function appendItems(bin: any, value: any, policy?: any, ctx?: any): any; + export function insert(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; + export function insertItems(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; + export function increment(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; + export function set(bin: any, value: any, idx: any, policy?: any, ctx?: any): any; + export function clear(bin: any, ctx?: any): any; + export function sort(bin: any, order: number, ctx?: any): any; + export function removeByValue(bin: any, value: any, ctx?: any, returnType?: any): any; + export function removeByValueList(bin: any, values: any, ctx?: any, returnType?: any): any; + export function removeByValueRange(bin: any, end: any, begin: any, ctx?: any, returnType?: any): any; + export function removeByRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any, returnType?: any): any; + export function removeByRelRankRange(bin: any, count: any, rank: any, value: any, ctx?: any, returnType?: any): any; + export function removeByIndex(bin: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByIndexRangeToEnd(bin: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByIndexRange(bin: any, count: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByRank(bin: any, rank: any, ctx?: any, returnType?: any): any; + export function removeByRankRangeToEnd(bin: any, rank: any, ctx?: any, returnType?: any): any; + export function removeByRankRange(bin: any, count: any, rank: any, ctx?: any, returnType?: any): any; +} +declare module 'exp_maps' { + export function put(bin: any, value: any, key: any, policy?: any, ctx?: any): any; + export function putItems(bin: any, map: any, policy?: any, ctx?: any): any; + export function increment(bin: any, value: any, key: any, policy?: any, ctx?: any): any; + export function clear(bin: any, ctx?: any): any; + export function removeByKey(bin: any, key: any, ctx?: any, returnType?: any): any; + export function removeByKeyList(bin: any, keys: any, ctx?: any, returnType?: any): any; + export function removeByKeyRange(bin: any, end: any, begin: any, ctx?: any, returnType?: any): any; + export function removeByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, ctx?: any, returnType?: any): any; + export function removeByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, ctx?: any, returnType?: any): any; + export function removeByValue(bin: any, value: any, ctx?: any, returnType?: any): any; + export function removeByValueList(bin: any, values: any, ctx?: any, returnType?: any): any; + export function removeByValueRange(bin: any, end: any, begin: any, ctx?: any, returnType?: any): any; + export function removeByValueRelRankRangeToEnd(bin: any, rank: any, value: any, ctx?: any, returnType?: any): any; + export function removeByValueRelRankRange(bin: any, count: any, rank: any, value: any, ctx?: any, returnType?: any): any; + export function removeByIndex(bin: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByIndexRangeToEnd(bin: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByIndexRange(bin: any, count: any, idx: any, ctx?: any, returnType?: any): any; + export function removeByRank(bin: any, rank: any, ctx?: any, returnType?: any): any; + export function removeByRankRangeToEnd(bin: any, rank: any, ctx?: any, returnType?: any): any; + export function removeByRankRange(bin: any, count: any, rank: any, ctx?: any, returnType?: any): any; + export function size(bin: any, ctx?: any): any; + export function getByKey(bin: any, key: any, valueType: any, returnType: any, ctx?: any): any; + export function getByKeyRange(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; + export function getByKeyList(bin: any, keys: any, returnType: any, ctx?: any): any; + export function getByKeyRelIndexRangeToEnd(bin: any, idx: any, key: any, returnType: any, ctx?: any): any; + export function getByKeyRelIndexRange(bin: any, count: any, idx: any, key: any, returnType: any, ctx?: any): any; + export function getByValue(bin: any, value: any, returnType: any, ctx?: any): any; + export function getByValueRange(bin: any, end: any, begin: any, returnType: any, ctx?: any): any; + export function getByValueList(bin: any, values: any, returnType: any, ctx?: any): any; + export function getByValueRelRankRangeToEnd(bin: any, rank: any, value: any, returnType: any, ctx?: any): any; + export function getByValueRelRankRange(bin: any, count: any, rank: any, value: any, returnType: any, ctx?: any): any; + export function getByIndex(bin: any, idx: any, valueType: any, returnType: any, ctx?: any): any; + export function getByIndexRangeToEnd(bin: any, idx: any, returnType: any, ctx?: any): any; + export function getByIndexRange(bin: any, count: any, idx: any, returnType: any, ctx?: any): any; + export function getByRank(bin: any, rank: any, valueType: any, returnType: any, ctx?: any): any; + export function getByRankRangeToEnd(bin: any, rank: any, returnType: any, ctx?: any): any; + export function getByRankRange(bin: any, count: any, rank: any, returnType: any, ctx?: any): any; +} +declare module 'exp_operations' { + export function read(bin: string, exp: any, flags: any): Operation; + export function write(bin: string, exp: any, flags: any): Operation; + export class ExpOperation { + protected constructor(); + op: any; + bin: any; + exp: any; + flags: any; + } +} +declare module 'features' { + export const CDT_MAP: "cdt-map"; + export const CDT_LIST: "cdt-list"; + export const BLOB_BITS: "blob-bits"; +} +declare module 'filter' { + export function range(bin: string, min: number, max: number, indexType?: number | undefined, context: any): any; + export function equal(bin: string, value: string): any; + export function contains(bin: string, value: (string | number), indexType: number, context: any): any; + export function geoWithinGeoJSONRegion(bin: string, value: GeoJSON, indexType?: number | undefined, context: any): any; + export function geoContainsGeoJSONPoint(bin: string, value: GeoJSON, indexType?: number | undefined, context: any): any; + export function geoWithinRadius(bin: string, lon: any, lat: number, radius: number, indexType?: number | undefined, context: any): any; + export function geoContainsPoint(bin: string, lon: any, lat: number, indexType?: number | undefined, context: any): any; + export class SindexFilterPredicate { + constructor(predicate: any, bin: any, dataType: any, indexType: any, context: any, props: any); + predicate: any; + bin: any; + datatype: any; + type: any; + context: any; + } + import GeoJSON = require("geojson"); +} +declare module 'geojson' { + export = GeoJSON; + function GeoJSON(json: any): GeoJSON; + class GeoJSON { + constructor(json: any); + str: string | undefined; + toJSON(): any; + toString(): string; + value(): any; + } + namespace GeoJSON { + function Point(lng: number, lat: number): GeoJSON; + function Polygon(...args: number[][]): GeoJSON; + function Circle(lng: number, lat: number, radius: number): GeoJSON; + } +} +declare module 'hll' { + export function init(bin: string, indexBits: number, minhashBits?: number | undefined): any; + export function add(bin: string, list: any[], indexBits?: number | undefined, minhashBits?: number | undefined): any; + export function setUnion(bin: string, list: any[]): any; + export function refreshCount(bin: string): any; + export function fold(bin: string, indexBits: number): any; + export function getCount(bin: string): any; + export function getUnion(bin: string, list: any[]): any; + export function getUnionCount(bin: string, list: any[]): any; + export function getIntersectCount(bin: string, list: any[]): any; + export function getSimilarity(bin: string, list: any[]): any; + export function describe(bin: string): any; +} +declare module 'index_job' { + export = IndexJob; + function IndexJob(client: any, namespace: any, indexName: any): void; + class IndexJob { + constructor(client: any, namespace: any, indexName: any); + client: any; + namespace: any; + indexName: any; + private hasCompleted; + private info; + } +} +declare module 'info' { + export function parse(info: string): any; + export const separators: { + bins: (string | typeof splitBins)[]; + 'bins/*': (typeof splitBins)[]; + 'namespace/*': string[]; + service: string[]; + sindex: string[]; + 'sindex/*': string[]; + 'sindex/*/**': string[]; + 'udf-list': string[]; + 'get-dc-config': string[]; + sets: string[]; + 'sets/*': string[]; + 'sets/*/**': (string | typeof chop)[]; + }; + function splitBins(str: any): { + stats: {}; + names: any[]; + }; + function chop(str: any): any; + export {}; +} +declare module 'job' { + export = Job; + function Job(client: any, jobID: any, module: any): void; + class Job { + constructor(client: any, jobID: any, module: any); + client: any; + jobID: any; + module: any; + private hasCompleted; + private checkStatus; + info(policy: any, callback?: JobinfoCallback | undefined): Promise | null; + wait(pollInterval?: number | undefined, callback?: JobdoneCallback | undefined): Promise | null; + waitUntilDone: any; + } + namespace Job { + function safeRandomJobID(): number; + function pollUntilDone(statusFunction: any, pollInterval: any): Promise; + } +} +declare module 'key' { + export = Key; + function Key(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined): void; + class Key { + constructor(ns: string, set: string, key: (string | number | Buffer), digest?: string | undefined); + ns: string; + set: string; + key: string | number | Buffer; + digest: string | null; + equals(other: any): any; + } + namespace Key { + function fromASKey(keyObj: any): Key | null; + } +} +declare module 'lists' { + export function setOrder(bin: string, order: number): any; + export function sort(bin: string, flags: number): any; + export function append(bin: string, value: any, policy?: any): any; + export function appendItems(bin: string, list: Array, policy?: any): any; + export function insert(bin: string, index: number, value: any, policy?: any): any; + export function insertItems(bin: string, index: number, list: Array, policy: any): any; + export function pop(bin: string, index: number): any; + export function popRange(bin: string, index: number, count?: number | undefined): any; + export function remove(bin: string, index: number): any; + export function removeRange(bin: string, index: number, count?: number | undefined): any; + export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; + export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; + export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; + export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; + export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; + export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; + export function clear(bin: string): any; + export function set(bin: string, index: number, value: any, policy?: any): any; + export function trim(bin: string, index: number, count: number): any; + export function get(bin: string, index: number): any; + export function getRange(bin: string, index: number, count?: number | undefined): any; + export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; + export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function getByValue(bin: string, value: any, returnType?: number | undefined): any; + export function getByValueList(bin: string, values: Array, returnType?: number | undefined): any; + export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; + export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; + export function getByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; + export function increment(bin: string, index: number, value?: number | undefined, policy?: any): any; + export function size(bin: string): any; +} +declare module 'maps' { + export function setPolicy(bin: string, policy: MapPolicy): any; + export function put(bin: string, key: any, value: any, policy?: MapPolicy): any; + export function putItems(bin: string, items: object, policy?: MapPolicy): any; + export function increment(bin: string, key: any, incr: number, policy?: MapPolicy): any; + export function decrement(bin: string, key: any, decr: number, policy?: MapPolicy): any; + export function clear(bin: string): any; + export function removeByKey(bin: string, key: any, returnType?: number | undefined): any; + export function removeByKeyList(bin: string, keys: Array, returnType?: number | undefined): any; + export function removeByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function removeByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function removeByValue(bin: string, value: any, returnType?: number | undefined): any; + export function removeByValueList(bin: string, values: Array, returnType?: number | undefined): any; + export function removeByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function removeByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; + export function removeByIndex(bin: string, index: number, returnType?: number | undefined): any; + export function removeByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function removeByRank(bin: string, rank: number, returnType?: number | undefined): any; + export function removeByRankRange(bin: string, rank: any, count?: number | undefined, returnType?: number | undefined): any; + export function size(bin: string): any; + export function getByKey(bin: string, key: any, returnType?: number | undefined): any; + export function getByKeyList(bin: string, keys: any, returnType?: number | undefined): any; + export function getByKeyRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function getByKeyRelIndexRange(bin: string, key: any, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function getByValue(bin: string, value: any, returnType?: number | undefined): any; + export function getByValueList(bin: string, values: any, returnType?: number | undefined): any; + export function getByValueRange(bin: string, begin: any | null, end: any | null, returnType?: number | undefined): any; + export function getByValueRelRankRange(bin: string, value: any, rank: number, count?: number | undefined, returnType?: number | undefined): any; + export function getByIndex(bin: string, index: number, returnType?: number | undefined): any; + export function getByIndexRange(bin: string, index: number, count?: number | undefined, returnType?: number | undefined): any; + export function getByRank(bin: string, rank: number, returnType?: number | undefined): any; + export function getByRankRange(bin: string, rank: any, count: number, returnType?: number | undefined): any; +} +declare module 'operations' { + export function read(bin: string): Operation; + export function write(bin: string, value: any): Operation; + export function add(bin: string, value: (number | any)): Operation; + export function incr(bin: any, value: any): Operation; + export function append(bin: string, value: (string | Buffer)): Operation; + export function prepend(bin: string, value: (string | Buffer)): Operation; + export function touch(ttl?: number | undefined): Operation; + function _delete(): Operation; + export class Operation { + protected constructor(); + op: any; + bin: any; + } + export { _delete as delete }; +} +declare module 'policies/admin_policy' { + export = AdminPolicy; + class AdminPolicy { + constructor(props?: any); + timeout: number; + } +} +declare module 'policies/apply_policy' { + export = ApplyPolicy; + class ApplyPolicy extends BasePolicy { + key: number; + commitLevel: number; + ttl: number; + durableDelete: boolean; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/base_policy' { + export = BasePolicy; + class BasePolicy { + constructor(props: any); + socketTimeout: number; + totalTimeout: number; + maxRetries: number; + filterExpression: any; + compress: boolean; + } +} +declare module 'policies/batch_apply_policy' { + export = BatchApplyPolicy; + class BatchApplyPolicy { + constructor(props?: any); + filterExpression: any; + key: number; + commitLevel: number; + ttl: number; + durableDelete: boolean; + } +} +declare module 'policies/batch_policy' { + export = BatchPolicy; + class BatchPolicy extends BasePolicy { + replica: number; + readModeAP: number; + readModeSC: number; + concurrent: boolean; + allowInline: boolean; + allowInlineSSD: boolean; + respondAllKeys: boolean; + sendSetName: boolean; + deserialize: boolean; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/batch_read_policy' { + export = BatchReadPolicy; + class BatchReadPolicy { + constructor(props?: any); + filterExpression: any; + readModeAP: number; + readModeSC: number; + } +} +declare module 'policies/batch_remove_policy' { + export = BatchRemovePolicy; + class BatchRemovePolicy { + constructor(props?: any); + filterExpression: any; + key: number; + commitLevel: number; + gen: number; + generation: number; + durableDelete: boolean; + } +} +declare module 'policies/batch_write_policy' { + export = BatchWritePolicy; + class BatchWritePolicy { + constructor(props?: any); + filterExpression: any; + key: number; + commitLevel: number; + gen: number; + exists: number; + durableDelete: boolean; + } +} +declare module 'policies/bitwise_policy' { + export = BitwisePolicy; + class BitwisePolicy { + constructor(props?: any); + writeFlags: number; + } +} +declare module 'policies/command_queue_policy' { + export = CommandQueuePolicy; + class CommandQueuePolicy { + constructor(props?: { + maxCommandsInProcess?: number | undefined; + maxCommandsInQueue?: number | undefined; + queueInitialCapacity?: number | undefined; + } | undefined); + maxCommandsInProcess: number; + maxCommandsInQueue: number; + queueInitialCapacity: number; + } +} +declare module 'policies/hll_policy' { + export = HLLPolicy; + class HLLPolicy { + constructor(props?: any); + writeFlags: number; + } +} +declare module 'policies/info_policy' { + export = InfoPolicy; + class InfoPolicy { + constructor(props?: any); + timeout: number; + sendAsIs: boolean; + checkBounds: boolean; + } +} +declare module 'policies/list_policy' { + export = ListPolicy; + class ListPolicy { + constructor(props?: any); + order: number; + writeFlags: number; + } +} +declare module 'policies/map_policy' { + export = MapPolicy; + class MapPolicy { + constructor(props?: any); + order: number; + writeMode: number; + writeFlags: number; + } +} +declare module 'policies/operate_policy' { + export = OperatePolicy; + class OperatePolicy extends BasePolicy { + key: number; + gen: number; + exists: number; + replica: number; + commitLevel: number; + deserialize: boolean; + durableDelete: boolean; + readModeAP: number; + readModeSC: number; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/query_policy' { + export = QueryPolicy; + class QueryPolicy extends BasePolicy { + replica: number; + deserialize: boolean; + failOnClusterChange: boolean; + infoTimeout: number; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/read_policy' { + export = ReadPolicy; + class ReadPolicy extends BasePolicy { + key: number; + replica: number; + readModeAP: number; + readModeSC: number; + deserialize: boolean; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/remove_policy' { + export = RemovePolicy; + class RemovePolicy extends BasePolicy { + generation: number; + key: number; + gen: number; + commitLevel: number; + durableDelete: boolean; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/scan_policy' { + export = ScanPolicy; + class ScanPolicy extends BasePolicy { + replica: number; + durableDelete: boolean; + recordsPerSecond: number; + maxRecords: number; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policies/write_policy' { + export = WritePolicy; + class WritePolicy extends BasePolicy { + compressionThreshold: number; + key: number; + gen: number; + exists: number; + commitLevel: number; + durableDelete: boolean; + } + import BasePolicy = require("policies/base_policy"); +} +declare module 'policy' { + export function createPolicy(type: any, values: any): CommandQueuePolicy | BasePolicy | BatchApplyPolicy | BatchReadPolicy | BatchRemovePolicy | BatchWritePolicy | HLLPolicy | InfoPolicy | AdminPolicy | undefined; + import BasePolicy = require("policies/base_policy"); + import ApplyPolicy = require("policies/apply_policy"); + import OperatePolicy = require("policies/operate_policy"); + import QueryPolicy = require("policies/query_policy"); + import ReadPolicy = require("policies/read_policy"); + import RemovePolicy = require("policies/remove_policy"); + import ScanPolicy = require("policies/scan_policy"); + import WritePolicy = require("policies/write_policy"); + import BatchPolicy = require("policies/batch_policy"); + import BatchApplyPolicy = require("policies/batch_apply_policy"); + import BatchReadPolicy = require("policies/batch_read_policy"); + import BatchRemovePolicy = require("policies/batch_remove_policy"); + import BatchWritePolicy = require("policies/batch_write_policy"); + import CommandQueuePolicy = require("policies/command_queue_policy"); + import HLLPolicy = require("policies/hll_policy"); + import InfoPolicy = require("policies/info_policy"); + import AdminPolicy = require("policies/admin_policy"); + import ListPolicy = require("policies/list_policy"); + import MapPolicy = require("policies/map_policy"); + export { BasePolicy, ApplyPolicy, OperatePolicy, QueryPolicy, ReadPolicy, RemovePolicy, ScanPolicy, WritePolicy, BatchPolicy, BatchApplyPolicy, BatchReadPolicy, BatchRemovePolicy, BatchWritePolicy, CommandQueuePolicy, HLLPolicy, InfoPolicy, AdminPolicy, ListPolicy, MapPolicy }; +} +declare module 'privilege' { + export = Privilege; + function Privilege(code: any, options: any): void; + class Privilege { + constructor(code: any, options: any); + code: any; + namespace: any; + set: any; + } +} +declare module 'privilege_code' { + export const USER_ADMIN: any; + export const SYS_ADMIN: any; + export const DATA_ADMIN: any; + export const UDF_ADMIN: any; + export const SINDEX_ADMIN: any; + export const READ: any; + export const READ_WRITE: any; + export const READ_WRITE_UDF: any; + export const WRITE: any; + export const TRUNCATE: any; +} +declare module 'query' { + export = Query; + function Query(client: Client, ns: string, set: string, options?: { + filters?: any[] | undefined; + select?: string[] | undefined; + nobins?: boolean | undefined; + ttl?: number | undefined; + } | undefined): void; + class Query { + constructor(client: Client, ns: string, set: string, options?: { + filters?: any[] | undefined; + select?: string[] | undefined; + nobins?: boolean | undefined; + ttl?: number | undefined; + } | undefined); + client: Client; + ns: string; + set: string; + filters: any[]; + selected: string[] | undefined; + nobins: boolean | undefined; + udf: any; + private pfEnabled; + paginate: boolean; + maxRecords: number; + queryState: any; + ttl: number | undefined; + nextPage(state: object[]): void; + hasNextPage(): boolean; + select(...args: string[]): void; + where(indexFilter: any): void; + setSindexFilter(sindexFilter: any): void; + setUdf(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined): void; + partitions(begin: number, count: number, digest: string): void; + partFilter: { + begin: number; + count: number; + digest: string; + } | undefined; + foreach(policy?: QueryPolicy, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; + results(policy?: QueryPolicy): Promise; + apply(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: QueryPolicy, callback?: QueryaggregationResultCallback | undefined): Promise | null; + background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: WritePolicy, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; + operate(operations: any, policy?: QueryPolicy, queryID?: number | undefined, callback?: jobCallback | undefined): Promise | null; + ops: any; + } + import RecordStream = require("record_stream"); +} +declare module 'record' { + export = Record; + class Record { + private constructor(); + key: any; + bins: any; + ttl: any; + gen: any; + type: any; + policy: any; + readAllBins: any; + ops: any; + udf: any; + } +} +declare module 'record_stream' { + export = RecordStream; + function RecordStream(client: any): void; + class RecordStream { + constructor(client: any); + aborted: boolean; + client: any; + writable: boolean; + readable: boolean; + _read(): void; + abort(): void; + } +} +declare module 'role' { + export = Role; + function Role(options: any): void; + class Role { + constructor(options: any); + name: any; + readQuota: any; + writeQuota: any; + whitelist: any; + privileges: any; + } +} +declare module 'scan' { + export = Scan; + function Scan(client: Client, ns: string, set: string, options?: { + select?: string[] | undefined; + nobins?: boolean | undefined; + concurrent?: boolean | undefined; + ttl?: number | undefined; + } | undefined): void; + class Scan { + constructor(client: Client, ns: string, set: string, options?: { + select?: string[] | undefined; + nobins?: boolean | undefined; + concurrent?: boolean | undefined; + ttl?: number | undefined; + } | undefined); + client: Client; + ns: string; + set: string; + selected: string[] | undefined; + nobins: boolean | undefined; + concurrent: boolean | undefined; + private pfEnabled; + paginate: boolean; + scanState: any; + ttl: number | undefined; + nextPage(state: object[]): void; + hasNextPage(): boolean; + select(...args: string[]): void; + partitions(begin: number, count: number, digest: string): void; + partFilter: { + begin: number; + count: number; + digest: string; + } | undefined; + background(udfModule: string, udfFunction: string, udfArgs?: any[] | undefined, policy?: ScanPolicy, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; + udf: { + module: string; + funcname: string; + args: any[] | undefined; + } | undefined; + operate(operations: any, policy?: ScanPolicy, scanID?: number | undefined, callback?: jobCallback | undefined): Promise | null; + ops: any; + foreach(policy?: ScanPolicy, dataCb?: recordCallback | undefined, errorCb?: errorCallback | undefined, endCb?: doneCallback | undefined): RecordStream; + results(policy?: ScanPolicy): Promise; + } + import RecordStream = require("record_stream"); +} +declare module 'status' { + export const ERR_ASYNC_QUEUE_FULL: any; + export const ERR_CONNECTION: any; + export const ERR_INVALID_NODE: any; + export const ERR_NO_MORE_CONNECTIONS: any; + export const ERR_ASYNC_CONNECTION: any; + export const ERR_CLIENT_ABORT: any; + export const ERR_INVALID_HOST: any; + export const NO_MORE_RECORDS: any; + export const ERR_PARAM: any; + export const ERR_CLIENT: any; + export const OK: any; + export const ERR_SERVER: any; + export const ERR_RECORD_NOT_FOUND: any; + export const ERR_RECORD_GENERATION: any; + export const ERR_REQUEST_INVALID: any; + export const ERR_RECORD_EXISTS: any; + export const ERR_BIN_EXISTS: any; + export const ERR_CLUSTER_CHANGE: any; + export const ERR_SERVER_FULL: any; + export const ERR_TIMEOUT: any; + export const ERR_ALWAYS_FORBIDDEN: any; + export const ERR_CLUSTER: any; + export const ERR_BIN_INCOMPATIBLE_TYPE: any; + export const ERR_RECORD_TOO_BIG: any; + export const ERR_RECORD_BUSY: any; + export const ERR_SCAN_ABORTED: any; + export const ERR_UNSUPPORTED_FEATURE: any; + export const ERR_BIN_NOT_FOUND: any; + export const ERR_DEVICE_OVERLOAD: any; + export const ERR_RECORD_KEY_MISMATCH: any; + export const ERR_NAMESPACE_NOT_FOUND: any; + export const ERR_BIN_NAME: any; + export const ERR_FAIL_FORBIDDEN: any; + export const ERR_FAIL_ELEMENT_NOT_FOUND: any; + export const ERR_FAIL_ELEMENT_EXISTS: any; + export const ERR_ENTERPRISE_ONLY: any; + export const ERR_FAIL_ENTERPRISE_ONLY: any; + export const ERR_OP_NOT_APPLICABLE: any; + export const FILTERED_OUT: any; + export const LOST_CONFLICT: any; + export const QUERY_END: any; + export const SECURITY_NOT_SUPPORTED: any; + export const SECURITY_NOT_ENABLED: any; + export const SECURITY_SCHEME_NOT_SUPPORTED: any; + export const INVALID_COMMAND: any; + export const INVALID_FIELD: any; + export const ILLEGAL_STATE: any; + export const INVALID_USER: any; + export const USER_ALREADY_EXISTS: any; + export const INVALID_PASSWORD: any; + export const EXPIRED_PASSWORD: any; + export const FORBIDDEN_PASSWORD: any; + export const INVALID_CREDENTIAL: any; + export const INVALID_ROLE: any; + export const ROLE_ALREADY_EXISTS: any; + export const INVALID_PRIVILEGE: any; + export const INVALID_WHITELIST: any; + export const QUOTAS_NOT_ENABLED: any; + export const INVALID_QUOTA: any; + export const NOT_AUTHENTICATED: any; + export const ROLE_VIOLATION: any; + export const ERR_UDF: any; + export const ERR_BATCH_DISABLED: any; + export const ERR_BATCH_MAX_REQUESTS_EXCEEDED: any; + export const ERR_BATCH_QUEUES_FULL: any; + export const ERR_GEO_INVALID_GEOJSON: any; + export const ERR_INDEX_FOUND: any; + export const ERR_INDEX_NOT_FOUND: any; + export const ERR_INDEX_OOM: any; + export const ERR_INDEX_NOT_READABLE: any; + export const ERR_INDEX: any; + export const ERR_INDEX_NAME_MAXLEN: any; + export const ERR_INDEX_MAXCOUNT: any; + export const ERR_QUERY_ABORTED: any; + export const ERR_QUERY_QUEUE_FULL: any; + export const ERR_QUERY_TIMEOUT: any; + export const ERR_QUERY: any; + export const ERR_UDF_NOT_FOUND: any; + export const ERR_LUA_FILE_NOT_FOUND: any; + export function getMessage(code: any): string; } type Host = object; type ClientStats = any; @@ -1549,15 +1787,52 @@ type Policies = { scan: ScanPolicy; query: QueryPolicy; write: WritePolicy; + map: MapPolicy; + list: ListPolicy; + commandQueue: CommandQueuePolicy; }; type Operation = object; type Client = object; type Key = object; type RecordObject = object; -declare module "policies/bitwise_policy" { - export = BitwisePolicy; - class BitwisePolicy { - constructor(props?: any); - writeFlags: number; - } +type Privilege = object; +type Role = object; +type User = object; +type role = object; +type CdtContext = object +declare module 'udf_job' { + export = UdfJob; + function UdfJob(client: any, udfModule: any, command: any): void; + class UdfJob { + constructor(client: any, udfModule: any, command: any); + client: any; + udfModule: any; + command: any; + private hasCompleted; + private info; + } + namespace UdfJob { + const REGISTER: string; + const UNREGISTER: string; + } +} +declare module 'user' { + export = User; + function User(options: any): void; + class User { + constructor(options: any); + connsInUse: any; + name: any; + readInfo: any; + writeInfo: any; + roles: any; + } +} +declare module 'utils' { + export function parseHostString(hostString: any): { + addr: any; + tlsname: any; + port: number; + }; + export function print(err: any, result: any): void; } \ No newline at end of file From e943c754f511532605ff1b71cc705220dc1144a2 Mon Sep 17 00:00:00 2001 From: Dominic Pelini <111786059+DomPeliniAerospike@users.noreply.github.com> Date: Tue, 19 Sep 2023 07:47:09 -0600 Subject: [PATCH 6/6] Removed v16 and v19 from Build script and github actions. Removed v16 and v19 from Build script and github actions. --- .github/workflows/linux-build.yml | 2 -- .github/workflows/windows-build.yml | 2 -- scripts/build-package.ps1 | 7 +++---- scripts/build-package.sh | 3 +-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 6dfc78120..be2d119e4 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -23,9 +23,7 @@ jobs: strategy: matrix: node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - 16.x - 18.x - - 19.x - 20.x continue-on-error: true steps: diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 158aea8fb..fa37d6624 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -29,9 +29,7 @@ jobs: strategy: matrix: node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - 16.x - 18.x - - 19.x - 20.x continue-on-error: true name: Node ${{ matrix.node-version }} tester diff --git a/scripts/build-package.ps1 b/scripts/build-package.ps1 index ef3a881ca..f5ed6f579 100644 --- a/scripts/build-package.ps1 +++ b/scripts/build-package.ps1 @@ -33,9 +33,8 @@ function build_nodejs_client { # cd D:\a\aerospike-client-nodejs\aerospike-client-nodejs -build_nodejs_client v14.21.1 -build_nodejs_client v16.18.1 -build_nodejs_client v18.12.1 -# build_nodejs_client v19.1.0 + +build_nodejs_client v18 +build_nodejs_client v20 nvm use v18.12.1 diff --git a/scripts/build-package.sh b/scripts/build-package.sh index 1795ea88c..be1f434ee 100755 --- a/scripts/build-package.sh +++ b/scripts/build-package.sh @@ -53,9 +53,8 @@ perform_check rm -rf ${AEROSPIKE_NODEJS_RELEASE_HOME}/node-*-${OS_FLAVOR}-* -build_nodejs_client v16 + build_nodejs_client v18 -build_nodejs_client v19 build_nodejs_client v20 nvm use v20