diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ae50e246..b310fab1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,7 +30,7 @@ jobs: # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - 18.x + - 20.x steps: - name: Checkout repository diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 139f4420..92026c2d 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -23,10 +23,10 @@ jobs: strategy: matrix: node-version: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - 14.x - 16.x - 18.x - 19.x + - 20.x continue-on-error: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index fabd17d4..158aea8f 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,6 +32,7 @@ jobs: - 16.x - 18.x - 19.x + - 20.x continue-on-error: true name: Node ${{ matrix.node-version }} tester steps: diff --git a/.travis/start_cluster.sh b/.travis/start_cluster.sh index 49189579..98ad8e62 100755 --- a/.travis/start_cluster.sh +++ b/.travis/start_cluster.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright 2013-2017 Aerospike, Inc. +# Copyright 2013-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. diff --git a/CHANGELOG.md b/CHANGELOG.md index b5698cfa..baac19b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,99 @@ # Changelog All notable changes to this project will be documented in this file. +## [5.5.0] + +* **Breaking Changes** + * [CLIENT-2343] - Dropped support for Node.js 14 + +* **New Features** + * [CLIENT-2108] - Added pagination support for queries and scans. + * [CLIENT-2224] - Added support for rack aware reads when the replication factor is three. + * [CLIENT-2303] - Added support for Amazon Linux 2023. + * [CLIENT-2342] - Added support for Node.js 20 + +* **Improvements** + * [CLIENT-1819] - Fixed issue which caused the configuration class property "rackId" to be ignored. + +* **Bug Fixes** + * [CLIENT-2231] - Fixed expression API documentation to show parameters for functions. + +## [5.4.0] +* The new features require Aerospike Server version 6.3 or newer. + +* **Breaking Changes** + * Dropped support for: + * Ubuntu 18.04 + * Debian 10 (ARM64 only). + +* **New Features** + * [CLIENT-2178] - Added ORDERED_MAP and UNORDERED_MAP map operation return types. + * [CLIENT-2187] - Added comparison of map values using expressions. + +## [5.3.0] + +* **New Features** + * [CLIENT-1750] - Added 'returnType.EXISTS' for 'aerospike/maps' and 'aerospike/list' module read operations. This feature requires server version 6.1+. + * [CLIENT-1818] - Added the 'getByKeyList' method 'aerospike/maps' module. + * [CLIENT-2210] - Added the 'getByValueList' method 'aerospike/maps' module. + +* **Improvements** + * [CLIENT-1819] - Corrected 'Client.batchApply' to have a keys parameter rather than a records parameter. + +* **Bug Fixes** + * [CLIENT-2231] - Fixed segmentation fault caused by using context with map and list expressions. Added unit tests for map and list expressions using context. Fixed parameter order for map and list expression methods. + +## [5.2.2] +* **Improvements** + * [CLIENT-2202] - Corrected default values for MaxConnsPerNode, maxSocketIdle, and totalTimeout policies within the API documentation. + +* **Bug Fixes** + * [CLIENT-2195] - Reworked batch write to accommodate promises and callbacks. Batch write will no longer return "AEROSPIKE_BATCH_FAILED" as an error, and will instead return results with status codes detailing the status of each batch operation. + +## [5.2.1] + +* **New Features** + * [CLIENT-1248] - AddListIndexCreate and AddMapKeyCreate added to cdt_context.js. + +* **Improvements** + * [CLIENT-2011] - Batch writes now returns the results of transactions ending in the AEROSPIKE_BATCH_FAILED status as well as the status of each record. + * [CLIENT-2150] - Reduced install size from 500MB to 166MB. + +* **Bug Fixes** + * [CLIENT-2167] - Fixed broken API documentation links. + * [CLIENT-2168] - Added missing methods from operations classes. + +## [5.2.0] + +* **Updates** + * BREAKING: Client does not support Node.js LTS version 14 on macOS using ARM architecture - see Incompatible API Changes for details. + * Added support for + * Node.js 19 + * Ubuntu 22.04 + * RHEL 9 + * Dropped support for: + * Node.js 10, 12, 17 + * RHEL 7 + * Debian 8, 9 + +* **New Features** + * [CLIENT-2000] - Added ARM architecture support for all currently supported OS systems. + +## [5.1.1] + +* **Bug Fixes** + * [CLIENT-1944] - Node.js: Revamped existing API documentation. + * [CLIENT-1943] - Node.js: Added documentation for list, map, hll, and bit expressions + * [CLIENT-1942] - Node.js: Improved examples within the API documentation. + +## [5.0.3] + +* **Updates** + * Debian 9 Stretch LTS has reached its End of Life on June 30 2022. We will drop support for Debian 9 in an upcoming client release. + +* **Bug Fixes** + * [CLIENT-1778] Node.js: document client support for PKI auth. + * [CLIENT-1762] Add Node.js client TypeScript support. ## [5.0.2] diff --git a/README.md b/README.md index e2f61caf..66c9b64a 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,12 @@ The Aerospike Node.js client is a Node.js add-on module, written using V8. -The client is compatible with Node.js 19, 18 (LTS), 16 (LTS) and 14 (LTS). +The client is compatible with Node.js 20 (LTS), 19, 18 (LTS), 16 (LTS). It supports the following operating systems: - RHEL 8/9 - Debian 10 (x86_64 architecture only) - Debian 11 +- Amazon Linux 2023 - Ubuntu 20.04/22.04 (Focal Fossa, Jammy Jellyfish) - Many Linux distributions compatible with one of the above OS releases. - macOS versions 11/12/13 are also supported. (Node.js 14 install unavailable on M1 Mac systems) diff --git a/aerospike-client-c b/aerospike-client-c index bdd08709..294084c7 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit bdd08709ed5be34b634aa69682144986d1ae09b4 +Subproject commit 294084c753f98d44317b85611915bb43362ed1ca diff --git a/benchmarks/alerts.js b/benchmarks/alerts.js index 2f3446b9..20729bfb 100644 --- a/benchmarks/alerts.js +++ b/benchmarks/alerts.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/inspect.js b/benchmarks/inspect.js index 36f4de34..5bfe7441 100644 --- a/benchmarks/inspect.js +++ b/benchmarks/inspect.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/logging.js b/benchmarks/logging.js index bab1b1c3..f2780950 100644 --- a/benchmarks/logging.js +++ b/benchmarks/logging.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/main.js b/benchmarks/main.js index 95f5221b..75c24550 100644 --- a/benchmarks/main.js +++ b/benchmarks/main.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/memory.js b/benchmarks/memory.js index dd57bbfb..b3c0de48 100644 --- a/benchmarks/memory.js +++ b/benchmarks/memory.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/stats.js b/benchmarks/stats.js index f48ae744..8a39b7dd 100644 --- a/benchmarks/stats.js +++ b/benchmarks/stats.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/benchmarks/worker.js b/benchmarks/worker.js index 09baddbe..c55b1560 100644 --- a/benchmarks/worker.js +++ b/benchmarks/worker.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/binding.gyp b/binding.gyp index 0e3722b2..e94a6884 100644 --- a/binding.gyp +++ b/binding.gyp @@ -104,9 +104,11 @@ 'src/main/commands/query_apply.cc', 'src/main/commands/query_background.cc', 'src/main/commands/query_foreach.cc', + 'src/main/commands/query_pages.cc', 'src/main/commands/remove_async.cc', 'src/main/commands/scan_async.cc', 'src/main/commands/scan_background.cc', + 'src/main/commands/scan_pages.cc', 'src/main/commands/select_async.cc', 'src/main/commands/truncate.cc', 'src/main/commands/index_create.cc', diff --git a/examples/add.js b/examples/add.js index f47f33e8..d940c090 100755 --- a/examples/add.js +++ b/examples/add.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/append.js b/examples/append.js index 65db56b3..7e63efd6 100755 --- a/examples/append.js +++ b/examples/append.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/apply.js b/examples/apply.js index 3ba31d70..5275c3d1 100755 --- a/examples/apply.js +++ b/examples/apply.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/batch.js b/examples/batch.js index cdc1725a..ba525f5d 100755 --- a/examples/batch.js +++ b/examples/batch.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/exists.js b/examples/exists.js index 5654a1d8..85ae7b11 100755 --- a/examples/exists.js +++ b/examples/exists.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/geospatialMonteCarlo.js b/examples/geospatialMonteCarlo.js index cff7670c..1ceba914 100755 --- a/examples/geospatialMonteCarlo.js +++ b/examples/geospatialMonteCarlo.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/get.js b/examples/get.js index c3336abd..58677eb8 100755 --- a/examples/get.js +++ b/examples/get.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/info.js b/examples/info.js index 1ec55ff2..b4f1f18c 100755 --- a/examples/info.js +++ b/examples/info.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/operate.js b/examples/operate.js index 3651dc02..a17c1b2d 100755 --- a/examples/operate.js +++ b/examples/operate.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/put.js b/examples/put.js index 71ecbe54..dce1ade5 100755 --- a/examples/put.js +++ b/examples/put.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/query.js b/examples/query.js index 0d592b22..2fa38a5a 100755 --- a/examples/query.js +++ b/examples/query.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/remove.js b/examples/remove.js index 113e9d9d..064f1951 100755 --- a/examples/remove.js +++ b/examples/remove.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/run.js b/examples/run.js index 4e454cd1..1a66fb11 100755 --- a/examples/run.js +++ b/examples/run.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2018-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/scan.js b/examples/scan.js index f82e207a..c335f4ca 100755 --- a/examples/scan.js +++ b/examples/scan.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/shared/cli.js b/examples/shared/cli.js index a4d5d722..410c1c5f 100644 --- a/examples/shared/cli.js +++ b/examples/shared/cli.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018 Aerospike, Inc. +// Copyright 2018-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. diff --git a/examples/shared/client.js b/examples/shared/client.js index 3ebd5303..7922e77e 100644 --- a/examples/shared/client.js +++ b/examples/shared/client.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018-2022 Aerospike, Inc. +// Copyright 2018-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. diff --git a/examples/shared/index.js b/examples/shared/index.js index 4f08a5f7..5d8b5bbf 100644 --- a/examples/shared/index.js +++ b/examples/shared/index.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018 Aerospike, Inc. +// Copyright 2018-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. diff --git a/examples/shared/run.js b/examples/shared/run.js index bf5911d2..73342b44 100644 --- a/examples/shared/run.js +++ b/examples/shared/run.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018 Aerospike, Inc. +// Copyright 2018-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. diff --git a/examples/sindex.js b/examples/sindex.js index 9e757195..2033a612 100755 --- a/examples/sindex.js +++ b/examples/sindex.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/examples/udf.js b/examples/udf.js index 9781991c..7e396ec6 100755 --- a/examples/udf.js +++ b/examples/udf.js @@ -1,6 +1,6 @@ #!/usr/bin/env node // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/incompatible.md b/incompatible.md index bf485ae3..7df8a90f 100644 --- a/incompatible.md +++ b/incompatible.md @@ -1,6 +1,18 @@ # Backward Incompatible API Changes All notable changes to this project will be documented in this file. +## [5.5.0] + +### Client no longer supports Node.js version 14 + +## [5.4.0] + +### Client no longer supports Ubuntu 18.04 +### Client no longer supports Debian 10 on ARM64 architecture + +## [5.2.0] + +### Client does not support Node.js LTS version 14 on macOS using ARM architecture ## [5.0.0] diff --git a/lib/aerospike.js b/lib/aerospike.js index 364308d1..32b71576 100644 --- a/lib/aerospike.js +++ b/lib/aerospike.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/batch_type.js b/lib/batch_type.js index a0c99ad7..bd501704 100644 --- a/lib/batch_type.js +++ b/lib/batch_type.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/bigint.js b/lib/bigint.js index 12b5b402..aa811850 100644 --- a/lib/bigint.js +++ b/lib/bigint.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/bitwise.js b/lib/bitwise.js index e131366c..110dd518 100644 --- a/lib/bitwise.js +++ b/lib/bitwise.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2019 Aerospike, Inc. +// Copyright 2019-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. diff --git a/lib/cdt_context.js b/lib/cdt_context.js index 53ba6dbb..6a9a6ef8 100644 --- a/lib/cdt_context.js +++ b/lib/cdt_context.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2019 Aerospike, Inc. +// Copyright 2019-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. diff --git a/lib/client.js b/lib/client.js index 482503de..8917cc47 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/batch_command.js b/lib/commands/batch_command.js index bb2d18f3..eb0185f2 100644 --- a/lib/commands/batch_command.js +++ b/lib/commands/batch_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/command.js b/lib/commands/command.js index 09748077..ffa889d9 100644 --- a/lib/commands/command.js +++ b/lib/commands/command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/connect_command.js b/lib/commands/connect_command.js index feaf560f..17d4d8e3 100644 --- a/lib/commands/connect_command.js +++ b/lib/commands/connect_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/exists_command.js b/lib/commands/exists_command.js index 93a08c32..b9dd3665 100644 --- a/lib/commands/exists_command.js +++ b/lib/commands/exists_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/index.js b/lib/commands/index.js index 93e6fc7a..a9b37cb8 100644 --- a/lib/commands/index.js +++ b/lib/commands/index.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. @@ -46,12 +46,14 @@ exports.JobInfo = class JobInfoCommand extends Command('jobInfo') { } exports.Operate = class OperateCommand extends ReadRecordCommand('operateAsync') { } exports.Put = class PutCommand extends WriteRecordCommand('putAsync') { } exports.Query = class QueryCommand extends StreamCommand('queryAsync') { } +exports.QueryPages = class QueryPagesCommand extends StreamCommand('queryPages') { } exports.QueryApply = class QueryApplyCommand extends Command('queryApply') { } exports.QueryBackground = class QueryBackgroundCommand extends QueryBackgroundBaseCommand('queryBackground') { } exports.QueryOperate = class QueryOperateCommand extends QueryBackgroundBaseCommand('queryBackground') { } exports.QueryForeach = class QueryForeachCommand extends StreamCommand('queryForeach') { } exports.Remove = class RemoveCommand extends WriteRecordCommand('removeAsync') { } exports.Scan = class ScanCommand extends StreamCommand('scanAsync') { } +exports.ScanPages = class ScanPagesCommand extends StreamCommand('scanPages') { } exports.ScanBackground = class ScanBackgroundCommand extends QueryBackgroundBaseCommand('scanBackground') { } exports.ScanOperate = class ScanOperateCommand extends QueryBackgroundBaseCommand('scanBackground') { } exports.Select = class SelectCommand extends ReadRecordCommand('selectAsync') { } diff --git a/lib/commands/query_background_command.js b/lib/commands/query_background_command.js index c330c0a4..2d5fb92a 100644 --- a/lib/commands/query_background_command.js +++ b/lib/commands/query_background_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/read_record_command.js b/lib/commands/read_record_command.js index a89d28f2..8a4ef201 100644 --- a/lib/commands/read_record_command.js +++ b/lib/commands/read_record_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/commands/stream_command.js b/lib/commands/stream_command.js index a1fe17b0..a2258842 100644 --- a/lib/commands/stream_command.js +++ b/lib/commands/stream_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. @@ -20,8 +20,6 @@ const Command = require('./command') const Key = require('../key') const Record = require('../record') -const EndOfStream = {} - module.exports = asCommand => class StreamCommand extends Command(asCommand) { constructor (stream, args) { super(stream.client, args) @@ -31,8 +29,8 @@ module.exports = asCommand => class StreamCommand extends Command(asCommand) { callback (error, record) { if (error) { this.stream.emit('error', error) - } else if (record === EndOfStream) { - this.stream.emit('end') + } else if ('state' in record) { + this.stream.emit('end', record.state) } else { this.stream.emit('data', record) } @@ -40,7 +38,7 @@ module.exports = asCommand => class StreamCommand extends Command(asCommand) { } convertResult (bins, meta, asKey) { - if (!bins) return EndOfStream + if (!bins) return { state: meta } const key = Key.fromASKey(asKey) return new Record(key, bins, meta) } diff --git a/lib/commands/write_record_command.js b/lib/commands/write_record_command.js index b6eee7f1..b6680948 100644 --- a/lib/commands/write_record_command.js +++ b/lib/commands/write_record_command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/config.js b/lib/config.js index d24dc537..12afacf3 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/double.js b/lib/double.js index 10c03eaf..70e050ad 100644 --- a/lib/double.js +++ b/lib/double.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/error.js b/lib/error.js index f1d130a7..b77b9a2d 100644 --- a/lib/error.js +++ b/lib/error.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/event_loop.js b/lib/event_loop.js index 6f5280c5..569f7f25 100644 --- a/lib/event_loop.js +++ b/lib/event_loop.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/exp.js b/lib/exp.js index a2e056f1..44bd93ef 100644 --- a/lib/exp.js +++ b/lib/exp.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2021-2022 Aerospike, Inc. +// Copyright 2021-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. @@ -138,6 +138,7 @@ const _valueExpBytes = (op, valName, sizeName) => (value, size) => [{ op, [valNa /** * Create boolean value. * + * @function * @param {boolean} value boolean value. * @return {AerospikeExp} */ @@ -146,6 +147,7 @@ exports.bool = _valueExp(exp.ops.VAL_BOOL, 'boolVal') /** * Create 64 bit signed integer value. * + * @function * @param {number} number value integer value. * @return {AerospikeExp} */ @@ -155,6 +157,7 @@ const _int = exports.int /** * Create 64 bit unsigned integer value. * + * @function * @param {number} number value unsigned integer value. * @return {AerospikeExp} */ @@ -163,14 +166,16 @@ exports.uint = _valueExp(exp.ops.VAL_UINT, 'uintVal') /** * Create 64 bit floating point value. * + * @function * @param {number} value floating point value. - * @return {AerospikeExp} + * @return {AerospikeExp} */ exports.float = _valueExp(exp.ops.VAL_FLOAT, 'floatVal') /** * Create string value. * + * @function * @param {string} value string value. * @return {AerospikeExp} */ @@ -178,7 +183,8 @@ exports.str = _valueExp(exp.ops.VAL_STR, 'strVal') /** * Create byte array value. - * + * * + * @function * @param {string[]} value byte array value. * @param {number} size number of bytes. * @return {AerospikeExp} @@ -188,6 +194,7 @@ exports.bytes = _valueExpBytes(exp.ops.VAL_BYTES, 'bytesVal', 'sz') /** * Create geojson value. * + * @function * @param {Object} value geojson value. * @return {AerospikeExp} */ @@ -195,11 +202,30 @@ exports.geo = _valueExp(exp.ops.VAL_GEO, 'value') /** * Create 'nil' value. + * + * @function + * @return {AerospikeExp} */ exports.nil = () => [{ op: exp.ops.AS_VAL, value: null }] const _val = _valueExp(exp.ops.AS_VAL, 'value') + +/** + * Create list value. + * + * @function + * @param {array} value list value + * @return {AerospikeExp} + */ exports.list = _val + +/** + * Create map value. + * + * @function + * @param {array} value map value + * @return {AerospikeExp} + */ exports.map = _val /********************************************************************************* @@ -215,6 +241,7 @@ const _keyTypeExp = (type) => () => [ * Create expression that returns the key as an integer. Returns 'unknown' if * the key is not an integer. * + * @function * @param {number} integer value Integer value of the key if the key is an integer. * @return {AerospikeExp} */ @@ -224,6 +251,7 @@ exports.keyInt = _keyTypeExp(exp.type.INT) * Create expression that returns the key as an string. Returns 'unknown' if * the key is not a string. * + * @function * @param {string} string value String value of the key if the key is a string. * @return {AerospikeExp} */ @@ -233,6 +261,7 @@ exports.keyStr = _keyTypeExp(exp.type.STR) * Create expression that returns the key as an blob. Returns 'unknown' if * the key is not an blob. * + * @function * @param {Object} blob Blob value of the key if the key is a blob. * @return {AerospikeExp} */ @@ -243,6 +272,7 @@ exports.keyBlob = _keyTypeExp(exp.type.BLOB) * data as a boolean expression. This would occur when "policy write key" is * SEND on record write. * + * @function * @param {boolean} - value True if the record has a stored key, false otherwise. * @return {AerospikeExp} */ @@ -264,6 +294,7 @@ const _binTypeExp = (type) => (binName) => [ * Create expression that returns a bin as a boolean value. Returns 'unknown' * if the bin is not a boolean. * + * @function * @param {string }binName Bin name. * @return {AerospikeExp} boolean bin */ @@ -273,6 +304,7 @@ exports.binBool = _binTypeExp(exp.type.BOOL) * Create expression that returns a bin as a signed integer. Returns 'unknown' * if the bin is not an integer. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} integer bin */ @@ -282,6 +314,7 @@ exports.binInt = _binTypeExp(exp.type.INT) * Create expression that returns a bin as a float. Returns 'unknown' if the bin * is not an float. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} float bin */ @@ -291,6 +324,7 @@ exports.binFloat = _binTypeExp(exp.type.FLOAT) * Create expression that returns a bin as a string. Returns 'unknown' if the * bin is not an string. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} string bin */ @@ -300,6 +334,7 @@ exports.binStr = _binTypeExp(exp.type.STR) * Create expression that returns a bin as a blob. Returns 'unknown' if the bin * is not an blob. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} blob bin */ @@ -309,6 +344,7 @@ exports.binBlob = _binTypeExp(exp.type.BLOB) * Create expression that returns a bin as a geojson. Returns 'unknown' if the * bin is not geojson. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} geojson bin */ @@ -318,6 +354,7 @@ exports.binGeo = _binTypeExp(exp.type.GEOJSON) * Create expression that returns a bin as a list. Returns 'unknown' if the bin * is not an list. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} list bin */ @@ -327,6 +364,7 @@ exports.binList = _binTypeExp(exp.type.LIST) * Create expression that returns a bin as a map. Returns 'unknown' if the bin * is not an map. * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} map bin */ @@ -336,6 +374,7 @@ exports.binMap = _binTypeExp(exp.type.MAP) * Create expression that returns a bin as a HyperLogLog (hll). Returns * 'unknown' if the bin is not a HyperLogLog (hll). * + * @function * @param {string} binName Bin name. * @return {AerospikeExp} hll bin */ @@ -350,6 +389,7 @@ const _binType = exports.binType /** * Create expression that returns if bin of specified name exists. * + * @function * @param {string} binName Bin name. * @return {boolean} - value True if the bin exists, false otherwise. */ @@ -365,6 +405,7 @@ const _metaExp = (op) => () => [{ op, count: 1 }] * Create expression that returns record set name string. This expression usually * evaluates quickly because record meta data is cached in memory. * + * @function * @return {AerospikeExp} string value Name of the set this record belongs to. */ exports.setName = _metaExp(exp.ops.SET_NAME) @@ -374,6 +415,7 @@ exports.setName = _metaExp(exp.ops.SET_NAME) * memory, then zero is returned. This expression usually evaluates quickly * because record meta data is cached in memory. * + * @function * @return {AerospikeExp} integer value Uncompressed storage size of the record. */ exports.deviceSize = _metaExp(exp.ops.DEVICE_SIZE) @@ -382,6 +424,7 @@ exports.deviceSize = _metaExp(exp.ops.DEVICE_SIZE) * Create expression that returns record last update time expressed as 64 bit * integer nanoseconds since 1970-01-01 epoch. * + * @function * @return {AerospikeExp} integer value When the record was last updated. */ exports.lastUpdate = _metaExp(exp.ops.LAST_UPDATE) @@ -391,6 +434,7 @@ exports.lastUpdate = _metaExp(exp.ops.LAST_UPDATE) * This expression usually evaluates quickly because record meta data is cached * in memory. * + * @function * @return {AerospikeExp} integer value Number of milliseconds since last updated. */ exports.sinceUpdate = _metaExp(exp.ops.SINCE_UPDATE) @@ -399,6 +443,7 @@ exports.sinceUpdate = _metaExp(exp.ops.SINCE_UPDATE) * Create expression that returns record expiration time expressed as 64 bit * integer nanoseconds since 1970-01-01 epoch. * + * @function * @return {AerospikeExp} integer value Expiration time in nanoseconds since 1970-01-01. */ exports.voidTime = _metaExp(exp.ops.VOID_TIME) @@ -407,6 +452,7 @@ exports.voidTime = _metaExp(exp.ops.VOID_TIME) * Create expression that returns record expiration time (time to live) in integer * seconds. * + * @function * @return {AerospikeExp} integer value Number of seconds till the record will expire, * returns -1 if the record never expires. */ @@ -417,6 +463,7 @@ exports.ttl = _metaExp(exp.ops.TTL) * tombstone state. This expression usually evaluates quickly because record * meta data is cached in memory. * + * @function * @return {AerospikeExp} - value True if the record is a tombstone, false otherwise. */ exports.isTombstone = _metaExp(exp.ops.IS_TOMBSTONE) @@ -428,6 +475,7 @@ exports.isTombstone = _metaExp(exp.ops.IS_TOMBSTONE) * in memory. * Requires server version 5.3.0+. * + * @function * @return {AerospikeExp} integer value memory size of the record. */ exports.memorySize = _metaExp(exp.ops.MEMORY_SIZE) @@ -435,6 +483,7 @@ exports.memorySize = _metaExp(exp.ops.MEMORY_SIZE) /** * Create expression that returns record digest modulo as integer. * + * @function * @param {number} mod Divisor used to divide the digest to get a remainder. * @return {AerospikeExp} integer value Value in range 0 and mod (exclusive).. */ @@ -449,6 +498,7 @@ const _cmpExp = (op) => (left, right) => [{ op, count: 3 }].concat(left, right) /** * Create equals (==) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -458,6 +508,7 @@ exports.eq = _cmpExp(exp.ops.CMP_EQ) /** * Create not equal (!=) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -468,6 +519,7 @@ const _ne = exports.ne /** * Create a greater than (>) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -477,6 +529,7 @@ exports.gt = _cmpExp(exp.ops.CMP_GT) /** * Create a greater than or equals (>=) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -486,6 +539,7 @@ exports.ge = _cmpExp(exp.ops.CMP_GE) /** * Create a less than (<) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -495,6 +549,7 @@ exports.lt = _cmpExp(exp.ops.CMP_LT) /** * Create a less than or equals (<=) expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -505,6 +560,7 @@ exports.le = _cmpExp(exp.ops.CMP_LE) * Create expression that performs a regex match on a string bin or value * expression. * + * @function * @param {number} options POSIX regex flags defined in regex.h. * @param {string} regex POSIX regex string. * @param {AerospikeExp} cmpStr String expression to compare against. @@ -520,6 +576,7 @@ exports.cmpRegex = (options, regex, cmpStr) => [ /** * Create a point within region or region contains point expression. * + * @function * @param {number} left left expression in comparison. * @param {number} right right expression in comparison. * @return {AerospikeExp} - boolean value @@ -533,6 +590,7 @@ exports.cmpGeo = _cmpExp(exp.ops.CMP_GEO) /** * Create "not" (!) operator expression. * + * @function * @param {AerospikeExp} expr Boolean expression to negate. * @return {AerospikeExp} - boolean value */ @@ -550,6 +608,7 @@ const _VAExp = (op) => (...expr) => [].concat( /** * Create "and" (&&) operator that applies to a variable number of expressions. * + * @function * @param {AerospikeExp} ... Variable number of boolean expressions. * @return {AerospikeExp} - boolean value */ @@ -558,6 +617,7 @@ exports.and = _VAExp(exp.ops.AND) /** * Create "or" (||) operator that applies to a variable number of expressions. * + * @function * @param {AerospikeExp} ... Variable number of boolean expressions. * @return {AerospikeExp} - boolean value */ @@ -567,6 +627,7 @@ exports.or = _VAExp(exp.ops.OR) * Create expression that returns true if only one of the expressions are true. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of boolean expressions. * @return {AerospikeExp} - boolean value */ @@ -582,6 +643,7 @@ exports.exclusive = _VAExp(exp.ops.EXCLUSIVE) * All arguments must be the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {number[]} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -594,6 +656,7 @@ exports.add = _VAExp(exp.ops.ADD) * argument. All arguments must resolve to the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {number[]} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -605,6 +668,7 @@ exports.sub = _VAExp(exp.ops.SUB) * that argument. All arguments must resolve to the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {number[]} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -617,6 +681,7 @@ exports.mul = _VAExp(exp.ops.MUL) * All arguments must resolve to the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {number[]} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -632,6 +697,7 @@ const _paramsExp = (op) => (...params) => [ * All arguments must resolve to floats. * Requires server version 5.6.0+. * + * @function * @param {number} base Base value. * @param {number} exponent Exponent value. * @return {AerospikeExp} float value @@ -643,6 +709,7 @@ exports.pow = _paramsExp(exp.ops.POW) * All arguments must resolve to floats. * Requires server version 5.6.0+. * + * @function * @param {number} num Number. * @param {number}base Base value. * @return {AerospikeExp} float value @@ -654,6 +721,7 @@ exports.log = _paramsExp(exp.ops.LOG) * divided by "denominator". All arguments must resolve to integers. * Requires server version 5.6.0+. * + * @function * @return {AerospikeExp} integer value */ exports.mod = _paramsExp(exp.ops.MOD) @@ -663,6 +731,7 @@ exports.mod = _paramsExp(exp.ops.MOD) * All arguments must resolve to integer or float. * Requires server version 5.6.0+. * + * @function * @return {AerospikeExp} number value */ exports.abs = _paramsExp(exp.ops.ABS) @@ -671,6 +740,7 @@ exports.abs = _paramsExp(exp.ops.ABS) * Create expression that rounds a floating point number down to the closest integer value. * Requires server version 5.6.0+. * + * @function * @param {number} num Floating point value to round down. * @return {AerospikeExp} float-value */ @@ -680,6 +750,7 @@ exports.floor = _paramsExp(exp.ops.FLOOR) * Create expression that rounds a floating point number up to the closest integer value. * Requires server version 5.6.0+. * + * @function * @param {number} num Floating point value to round up. * @return {AerospikeExp} integer-value */ @@ -689,6 +760,7 @@ exports.ceil = _paramsExp(exp.ops.CEIL) * Create expression that converts a float to an integer. * Requires server version 5.6.0+. * + * @function * @param {number} num Integer to convert to a float * @return {AerospikeExp} float value */ @@ -698,6 +770,7 @@ exports.toInt = _paramsExp(exp.ops.TO_INT) * Create expression that converts an integer to a float. * Requires server version 5.6.0+. * + * @function * @param {number} num Integer to convert to a float * @return {AerospikeExp} float value */ @@ -708,6 +781,7 @@ exports.toFloat = _paramsExp(exp.ops.TO_FLOAT) * All arguments must resolve to integers. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of integer expressions. * @return {AerospikeExp} integer value */ @@ -718,6 +792,7 @@ exports.intAnd = _VAExp(exp.ops.INT_AND) * All arguments must resolve to integers. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of integer expressions. * @return {AerospikeExp} integer value */ @@ -728,6 +803,7 @@ exports.intOr = _VAExp(exp.ops.INT_OR) * All arguments must resolve to integers. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of integer expressions. * @return {AerospikeExp} integer value */ @@ -737,6 +813,7 @@ exports.intXor = _VAExp(exp.ops.INT_XOR) * Create integer "not" (~) operator. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} expr Integer expression. * @return {AerospikeExp} integer value */ @@ -746,6 +823,7 @@ exports.intNot = _paramsExp(exp.ops.INT_NOT) * Create integer "left shift" (<<) operator. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} value Integer expression. * @param {number} shift Number of bits to shift by. * @return {AerospikeExp} integer value @@ -756,6 +834,7 @@ exports.intLshift = _paramsExp(exp.ops.INT_LSHIFT) * Create integer "logical right shift" (>>>) operator. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} value Integer expression. * @param {number} shift Number of bits to shift by. * @return {AerospikeExp} integer value @@ -766,6 +845,7 @@ exports.intRshift = _paramsExp(exp.ops.INT_RSHIFT) * Create integer "arithmetic right shift" (>>) operator. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} value Integer expression. * @param {number} shift Number of bits to shift by. * @return {AerospikeExp} integer value @@ -776,6 +856,7 @@ exports.intArshift = _paramsExp(exp.ops.INT_ARSHIFT) * Create expression that returns count of integer bits that are set to 1. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} * @return {AerospikeExp} integer value */ @@ -789,6 +870,7 @@ exports.intCount = _paramsExp(exp.ops.INT_COUNT) * value 1. If "search" is false it will search for bit value 0. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} * @return {AerospikeExp} integer value */ @@ -802,6 +884,7 @@ exports.intLscan = _paramsExp(exp.ops.INT_LSCAN) * value 1. If "search" is false it will search for bit value 0. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} * @return {AerospikeExp} integer value */ @@ -812,6 +895,7 @@ exports.intRscan = _paramsExp(exp.ops.INT_RSCAN) * All arguments must be the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -822,6 +906,7 @@ exports.min = _VAExp(exp.ops.MIN) * All arguments must be the same type (integer or float). * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of integer or float expressions. * @return {AerospikeExp} integer or float value */ @@ -834,6 +919,7 @@ exports.max = _VAExp(exp.ops.MAX) * Conditionally select an expression from a variable number of expression pairs * followed by default expression action. Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} * @return {AerospikeExp} first action expression where bool expression is true or action-default. */ @@ -843,6 +929,7 @@ exports.cond = _VAExp(exp.ops.COND) * Define variables and expressions in scope. * Requires server version 5.6.0+. * + * @function * @param {AerospikeExp} ... Variable number of expression def followed by a scoped * expression. * @return {AerospikeExp} result of scoped expression. @@ -853,6 +940,7 @@ exports.let = _VAExp(exp.ops.LET) * Assign variable to an expression that can be accessed later. * Requires server version 5.6.0+. * + * @function * @param {string} varName Variable name. * @param {AerospikeExp} expr The variable is set to the result of expr. * @return {AerospikeExp} A variable name expression pair. @@ -866,6 +954,7 @@ exports.def = (varName, expr) => [ * Retrieve expression value from a variable. * Requires server version 5.6.0+. * + * @function * @param {string} varName Variable name. * @return {AerospikeExp} value stored in variable. */ diff --git a/lib/exp_bit.js b/lib/exp_bit.js index 9bc3fd04..55fd93be 100644 --- a/lib/exp_bit.js +++ b/lib/exp_bit.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/exp_hll.js b/lib/exp_hll.js index 0e527580..70c3c6a3 100644 --- a/lib/exp_hll.js +++ b/lib/exp_hll.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2021-2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/exp_lists.js b/lib/exp_lists.js index 6873aa02..94bc7b5c 100644 --- a/lib/exp_lists.js +++ b/lib/exp_lists.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2021-2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/exp_operations.js b/lib/exp_operations.js index 10db3230..5ab142db 100644 --- a/lib/exp_operations.js +++ b/lib/exp_operations.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/features.js b/lib/features.js index b965cec7..c4eaa2ab 100644 --- a/lib/features.js +++ b/lib/features.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2019 Aerospike, Inc. +// Copyright 2019-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. diff --git a/lib/filter.js b/lib/filter.js index 171aaa7e..9152ca94 100644 --- a/lib/filter.js +++ b/lib/filter.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/geojson.js b/lib/geojson.js index 1bf075ab..bf329ab6 100644 --- a/lib/geojson.js +++ b/lib/geojson.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/hll.js b/lib/hll.js index 3fb3d895..10bb3a22 100644 --- a/lib/hll.js +++ b/lib/hll.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2020 Aerospike, Inc. +// Copyright 2020-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. diff --git a/lib/index_job.js b/lib/index_job.js index 41325bd5..b782d144 100644 --- a/lib/index_job.js +++ b/lib/index_job.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/info.js b/lib/info.js index 84efcf60..c46ef258 100644 --- a/lib/info.js +++ b/lib/info.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/job.js b/lib/job.js index a0f0e041..2b579112 100644 --- a/lib/job.js +++ b/lib/job.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/key.js b/lib/key.js index b0a32b57..db4d35bd 100644 --- a/lib/key.js +++ b/lib/key.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/lists.js b/lib/lists.js index 7c573c32..35b02019 100644 --- a/lib/lists.js +++ b/lib/lists.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/maps.js b/lib/maps.js index 84ae9a4d..0b9c4098 100644 --- a/lib/maps.js +++ b/lib/maps.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/apply_policy.js b/lib/policies/apply_policy.js index ddbb3855..cfa58266 100644 --- a/lib/policies/apply_policy.js +++ b/lib/policies/apply_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/base_policy.js b/lib/policies/base_policy.js index 953e92bd..19d3ae48 100644 --- a/lib/policies/base_policy.js +++ b/lib/policies/base_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/batch_apply_policy.js b/lib/policies/batch_apply_policy.js index f61635c2..92335c4b 100644 --- a/lib/policies/batch_apply_policy.js +++ b/lib/policies/batch_apply_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/policies/batch_policy.js b/lib/policies/batch_policy.js index ac231dbb..245812db 100644 --- a/lib/policies/batch_policy.js +++ b/lib/policies/batch_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/batch_read_policy.js b/lib/policies/batch_read_policy.js index 2b83680c..21225d9c 100644 --- a/lib/policies/batch_read_policy.js +++ b/lib/policies/batch_read_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/policies/batch_remove_policy.js b/lib/policies/batch_remove_policy.js index 406762ca..7a683424 100644 --- a/lib/policies/batch_remove_policy.js +++ b/lib/policies/batch_remove_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/policies/batch_write_policy.js b/lib/policies/batch_write_policy.js index f049c0d3..7bd43f6e 100644 --- a/lib/policies/batch_write_policy.js +++ b/lib/policies/batch_write_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/lib/policies/bitwise_policy.js b/lib/policies/bitwise_policy.js index ec3c87dc..94e73187 100644 --- a/lib/policies/bitwise_policy.js +++ b/lib/policies/bitwise_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2019 Aerospike, Inc. +// Copyright 2019-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. diff --git a/lib/policies/command_queue_policy.js b/lib/policies/command_queue_policy.js index a1a2d42b..4662afc7 100644 --- a/lib/policies/command_queue_policy.js +++ b/lib/policies/command_queue_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/hll_policy.js b/lib/policies/hll_policy.js index f02ee2eb..c3d00c97 100644 --- a/lib/policies/hll_policy.js +++ b/lib/policies/hll_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2020 Aerospike, Inc. +// Copyright 2020-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. diff --git a/lib/policies/info_policy.js b/lib/policies/info_policy.js index dec2bfc8..339ee99c 100644 --- a/lib/policies/info_policy.js +++ b/lib/policies/info_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/list_policy.js b/lib/policies/list_policy.js index 35c07bb7..d5c11bac 100644 --- a/lib/policies/list_policy.js +++ b/lib/policies/list_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018 Aerospike, Inc. +// Copyright 2018-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. diff --git a/lib/policies/map_policy.js b/lib/policies/map_policy.js index 51ad2005..cd195127 100644 --- a/lib/policies/map_policy.js +++ b/lib/policies/map_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/operate_policy.js b/lib/policies/operate_policy.js index 124cae6b..611c28c5 100644 --- a/lib/policies/operate_policy.js +++ b/lib/policies/operate_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/query_policy.js b/lib/policies/query_policy.js index 7622a403..1e6f0d86 100644 --- a/lib/policies/query_policy.js +++ b/lib/policies/query_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/read_policy.js b/lib/policies/read_policy.js index f0c5e9a6..5241cd15 100644 --- a/lib/policies/read_policy.js +++ b/lib/policies/read_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/remove_policy.js b/lib/policies/remove_policy.js index 753dbc96..6f694858 100644 --- a/lib/policies/remove_policy.js +++ b/lib/policies/remove_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/scan_policy.js b/lib/policies/scan_policy.js index bd880c9d..ee8f03bf 100644 --- a/lib/policies/scan_policy.js +++ b/lib/policies/scan_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policies/write_policy.js b/lib/policies/write_policy.js index 433d5198..e3d3d387 100644 --- a/lib/policies/write_policy.js +++ b/lib/policies/write_policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/policy.js b/lib/policy.js index eddd3660..6b9b834c 100644 --- a/lib/policy.js +++ b/lib/policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/query.js b/lib/query.js index 0f475ee7..e8b047a2 100644 --- a/lib/query.js +++ b/lib/query.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. @@ -54,17 +54,21 @@ const util = require('util') * module:aerospike/filter.geoContainsGeoJSONPoint} against geo indexes * * See {@link module:aerospike/filter} for a list of all supported secondary - * index filter predicates. + * index filter. * - * Before a filter predicate can be applied, a SI needs to be - * created on the bins which the predicate matches on. Using the Node.js + * Before a secondary index filter can be applied, a SI needs to be + * created on the bins which the index filter matches on. Using the Node.js * client, a SI can be created using {@link Client#createIndex}. * - * Currently, only a single SI filter predicate is supported for + * Currently, only a single SI index filter is supported for * each query. To do more advanced filtering, a expressions can be * applied to the query using policy (see below). Alternatively, User-Defined Functions * (UDFs) can be used to further process the query results on the server. * + * Previously, predicate filtering was used to perform secondary index queries. + * SI filter predicates have been deprecated since server 5.2, and obsolete since + * server 6.0. + * * For more information about Predicate Filtering, please refer to the ⇑Predicate * Filtering documentation in the Aerospike Feature Guide. @@ -121,11 +125,29 @@ const util = require('util') * ⇑Record UDFs * in the Aerospike technical documentation. * + * #### Query pagination + * + * Query pagination allows for queries return records in pages rather than all at once. + * To enable query pagination, the query property {@link Query#paginate} must be true + * and the previously stated query property {@link Query#maxRecords} must be set to a + * nonzero positive integer in order to specify a maximum page size. + * + * When a page is complete, {@link RecordStream} event {@link RecordStream#event:error} will + * emit a {@link Query#queryState} object containing a serialized version of the query. + * This serialized query, if be assigned back to {@link Query#queryState}, allows the query + * to retrieve the next page of records in the query upon calling {@link Query#foreach}. + * If {@link Query#queryState} is undefined, pagination is not enabled or the query has completed. + * If {@link RecordStream#event:error} emits an undefined object, either {@link Query#paginate} + * is not true, or the query has successfully returned all the specified records. + * + * For additional information and examples, please refer to the {@link Query#paginate} section + * below. + * * @param {Client} client - A client instance. * @param {string} ns - The namescape. * @param {string} set - The name of a set. * @param {object} [options] - Query parameters. - * @param {object[]} [options.filters] - List of filter predicates to + * @param {object[]} [options.filters] - List of index filters to * apply to the query. See {@link Query#where}. * @param {string[]} [options.select] - List of bin names to select. See * {@link Query#select}. @@ -199,13 +221,13 @@ function Query (client, ns, set, options) { /** * Filters to apply to the query. * - * *Note:* Currently, a single filter predicate is supported. To do more + * *Note:* Currently, a single index filter is supported. To do more * advanced filtering, you need to use a user-defined function (UDF) to * process the result set on the server. * * @member {object[]} Query#filters * - * @see Use {@link Query#where} to add filter predicates to the query. + * @see Use {@link Query#where} to add index filters to the query. * @see Use {@link module:aerospike/filter} to create a SI * filter. */ @@ -239,12 +261,167 @@ function Query (client, ns, set, options) { this.udf = options.udf /** - * If set to true, the scan will return only those belongs to partitions. + * If set to true, the query will return records belonging to the partitions specified + * in {@link Query#partFilter}. * * @member {boolean} Query#pfEnabled * @private */ this.pfEnabled = false + + /** + * If set to true, paginated queries are enabled. In order to receive paginated + * results, the {@link query#maxRecords} property must assign a nonzero integer value. + * + * @member {boolean} Query#paginate + * + * @example Asynchronous pagination over a set of thirty records with {@link Query#foreach}. + * + * const Aerospike = require('./lib/aerospike'); + * // Define host configuration + * let config = { + * hosts: '34.213.88.142:3000', + * policies: { + * batchWrite : new Aerospike.BatchWritePolicy({socketTimeout : 0, totalTimeout : 0}), + * } + * }; + * + * var batchRecords = [] + * for(let i = 0; i < 30; i++){ + * batchRecords.push({ + * type: Aerospike.batchType;.BATCH_WRITE, + * key: new Aerospike.Key('test', 'demo', 'key' + i), + * ops:[Aerospike.operations.write('exampleBin', i)] + * }) + * } + * + * ;(async function() { + * try { + * client = await Aerospike.connect(config) + * await client.truncate('test', 'demo', 0) + * await client.batchWrite(batchRecords, {socketTimeout : 0, totalTimeout : 0}) + * + * const query = client.query('test', 'demo', { paginate: true, maxRecords: 10}) + * do { + * const stream = query.foreach() + * stream.on('error', (error) => { throw error }) + * stream.on('data', (record) => { + * console.log(record.bins) + * }) + * await new Promise(resolve => { + * stream.on('end', (queryState) => { + * query.queryState = queryState + * resolve() + * }) + * }) + * } while (query.queryState !== undefined) + * + * } catch (error) { + * console.error('An error occurred at some point.', error) + * process.exit(1) + * } finally { + * if (client) client.close() + * } + * })() + * + * @example Asynchronous pagination over a set of thirty records with {@link Query#results} + * + * + * const Aerospike = require('./lib/aerospike'); + * // Define host configuration + * let config = { + * hosts: '34.213.88.142:3000', + * policies: { + * batchWrite : new Aerospike.BatchWritePolicy({socketTimeout : 0, totalTimeout : 0}), + * } + * }; + * + * var batchRecords = [] + * for(let i = 0; i < 30; i++){ + * batchRecords.push({ + * type: Aerospike.batchType.BATCH_WRITE, + * key: new Aerospike.Key('test', 'demo', 'key' + i), + * ops:[Aerospike.operations.write('exampleBin', i)] + * }) + * } + * + * + * ;(async function() { + * try { + * client = await Aerospike.connect(config) + * await client.truncate('test', 'demo', 0) + * await client.batchWrite(batchRecords, {socketTimeout : 0, totalTimeout : 0}) + * + * const query = client.query('test', 'demo', { paginate: true, maxRecords: 11}) + * + * let allResults = [] + * let results = await query.results() + * allResults = [...allResults, ...results] + * + * + * results = await query.results() + * allResults = [...allResults, ...results] + * + * results = await query.results() + * allResults = [...allResults, ...results] + * + * console.log("Records returned in total: " + allResults.length) // Should be 30 records + * } catch (error) { + * console.error('An error occurred at some point.', error) + * process.exit(1) + * } finally { + * if (client) client.close() + * } + * })() + * + */ + this.paginate = options.paginate + + /** + * Approximate number of records to return to client. + * + * When {@link query#paginate} is true, + * then maxRecords will be the page size if there are enough records remaining in the query to fill the page size. + * + * When {@link query#paginate} is false, this number is divided by the number of nodes involved in the scan, + * and actual number of records returned may be less than maxRecords if node record counts are small and unbalanced across nodes. + * @member {number} Query#maxRecords + */ + this.maxRecords = options.maxRecords + + /** + * If set to a valid serialized query, calling {@link query#foreach} will allow the next page of records to be queried while preserving the progress + * of the previous query. If set to null, calling {@link query#foreach} will begin a new query. + * @member {number} Query#queryState + */ + this.queryState = undefined +} + +/** + * @function Query#nextPage + * + * @summary Sets {@link query#queryState} to the value specified by the state argument. + * + * @description setter function for the {@link Query#queryState} member variable. + * + * @param {...object} state - serialized query emitted from the {@link RecordStream#event:error} event. + */ +Query.prototype.nextPage = function (state) { + this.queryState = state +} + +/** + * @function Query#hasNextPage + * + * @summary Checks compiliation status of a paginated query. + * + * @description If false is returned, there are no more records left in the query, and the query is complete. + * If true is returned, calling {@link Query#foreach} will continue from the state specified by {@link Query#queryState}. + * + * @returns {boolean} + */ +Query.prototype.hasNextPage = function () { + return (!!this.queryState) } /** @@ -275,7 +452,7 @@ Query.prototype.select = function (bins) { * This method takes SI created using the {@link * module:aerospike/filter|filter module} as argument. * - * @param {module:aerospike/filter~SindexFilterPredicate} predicate - The filter to + * @param {module:aerospike/filter~SindexFilterPredicate} index filter - The index filter to * apply to the function. * * @example Applying a SI filter to find all records @@ -311,11 +488,11 @@ Query.prototype.select = function (bins) { * stream.on('end', () => client.close()) * }) */ -Query.prototype.where = function (predicate) { - if (predicate instanceof filter.SindexFilterPredicate) { - this.setSindexFilter(predicate) +Query.prototype.where = function (indexFilter) { + if (indexFilter instanceof filter.SindexFilterPredicate) { + this.setSindexFilter(indexFilter) } else { - throw new TypeError('predicate should be a SindexFilterPredicate') + throw new TypeError('indexFilter should be a SindexFilterPredicate') } } @@ -345,15 +522,15 @@ Query.prototype.setUdf = function (udfModule, udfFunction, udfArgs) { * @function Query#partitions * * @summary Specify the begin and count of the partitions - * to be scanned by the Query foreach op. + * to be queried by the Query foreach op. * * @description If a Query specifies partitions begin and count, - * then only those partitons will be scanned and returned. + * then only those partitons will be queried and returned. * If no partitions are specified, - * then all partitions will be scanned and returned. + * then all partitions will be queried and returned. * - * @param {number} begin - Start partition number to scan. - * @param {number} count - Number of partitions from the start to scan. + * @param {number} begin - Start partition number to query. + * @param {number} count - Number of partitions from the start to query. * @param {string} digest - Start from this digest if it is specified. */ Query.prototype.partitions = function (begin, count, digest) { @@ -400,26 +577,43 @@ Query.prototype.foreach = function (policy, dataCb, errorCb, endCb) { const args = [this.ns, this.set, this, policy] let cmd if (this.udf) { - cmd = new Commands.QueryForeach(stream, args) + if (this.paginate) { + throw new Error('Stream UDF cannot be applied using a paginated stream. Please disable pagination or UDF.') + } else { + cmd = new Commands.QueryForeach(stream, args) + } } else { - cmd = new Commands.Query(stream, args) + if (this.paginate) { + args.push(this.queryState) + args.push(this.maxRecords) + cmd = new Commands.QueryPages(stream, args) + } else { + cmd = new Commands.Query(stream, args) + } } + cmd.queryState = this.queryState cmd.execute() - return stream } /** * @function Query#results * - * @summary Executes the query and collects the results into an array. + * @summary Executes the query and collects the results into an array. On paginated queries, + * preparing the next page is also handled automatically. * + * * * @description This method returns a Promise that contains the query results * as an array of records, when fulfilled. It should only be used if the query * is expected to return only few records; otherwise it is recommended to use * {@link Query#foreach}, which returns the results as a {@link RecordStream} * instead. * + * If pagination is enabled, the data emitted from the {@link RecordStream#event:error} + * event will automatically be assigned to {@link Query#queryState}, allowing the next page + * of records to be queried if {@link Query#foreach} or {@link Query#results} is called. + * + * * @param {QueryPolicy} [policy] - The Query Policy to use for this operation. * * @returns {Promise} @@ -429,8 +623,11 @@ Query.prototype.results = function (policy) { const stream = this.foreach(policy) const results = [] stream.on('error', reject) - stream.on('end', () => resolve(results)) stream.on('data', record => results.push(record)) + stream.on('end', (queryState) => { + this.queryState = queryState + resolve(results) + }) }) } diff --git a/lib/record.js b/lib/record.js index 5bec0007..16dc302f 100644 --- a/lib/record.js +++ b/lib/record.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/record_stream.js b/lib/record_stream.js index 5649d456..865910c2 100644 --- a/lib/record_stream.js +++ b/lib/record_stream.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/scan.js b/lib/scan.js index e311e607..5a8c6d49 100644 --- a/lib/scan.js +++ b/lib/scan.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. @@ -30,9 +30,10 @@ const RecordStream = require('./record_stream') * Scans can return a set of records as a {@link RecordStream} or apply an * Aerospike UDF (user-defined function) on each of the records on the server. * - * Scan is depricated in server 6.0. Use Query methods implemented by {@link Client#query} + * #### Scan is obsolete in server 6.0 + * Use query methods implemented by {@link Client#query}. * For more information, please refer to the section on - * ⇑Scans + * ⇑Historical evolution of scan features * in the Aerospike technical documentation. * * #### Selecting Bins @@ -61,6 +62,23 @@ const RecordStream = require('./record_stream') * ⇑Record UDFs * in the Aerospike technical documentation. * + * #### Scan pagination + * + * Scan pagination allows for queries return records in pages rather than all at once. + * To enable scan pagination, the scan property {@link Scan#paginate} must be true + * and the previously stated scan policy {@link ScanPolicy#maxRecords} must be set to a + * nonzero positive integer in order to specify a maximum page size. + * + * When a page is complete, {@link RecordStream} event {@link RecordStream#event:error} will + * emit a {@link Scan#scanState} object containing a serialized version of the scan. + * This serialized scan, if be assigned back to {@link Scan#scanState}, allows the scan + * to retrieve the next page of records in the scan upon calling {@link Scan#foreach}. + * If {@link RecordStream#event:error} emits an undefined object, either {@link Scan#paginate} + * is not true, or the scan has successfully returned all the specified records. + * + * For additional information and examples, please refer to the {@link Scan#paginate} section + * below. + * * @param {Client} client - A client instance. * @param {string} ns - The namescape. * @param {string} set - The name of a set. @@ -157,8 +175,147 @@ function Scan (client, ns, set, options) { * @private */ this.pfEnabled = false + /** + * If set to true, paginated queries are enabled. In order to receive paginated + * results, the {@link ScanPolicy#maxRecords} property must assign a nonzero integer value. + * + * @member {boolean} Scan#paginate + * + * @example Asynchronous pagination over a set of thirty records with {@link Scan#foreach}. + * + * const Aerospike = require('./lib/aerospike'); + * // Define host configuration + * let config = { + * hosts: '34.213.88.142:3000', + * policies: { + * batchWrite : new Aerospike.BatchWritePolicy({socketTimeout : 0, totalTimeout : 0}), + * } + * }; + * + * var batchRecords = [] + * for(let i = 0; i < 30; i++){ + * batchRecords.push({ + * type: Aerospike.batchType.BATCH_WRITE, + * key: new Aerospike.Key('test', 'demo', 'key' + i), + * ops:[Aerospike.operations.write('exampleBin', i)] + * }) + * } + * + * ;(async function() { + * try { + * client = await Aerospike.connect(config) + * await client.truncate('test', 'demo', 0) + * await client.batchWrite(batchRecords, {socketTimeout : 0, totalTimeout : 0}) + * + * const scan = client.scan('test', 'demo', {paginate: true}) + * do { + * const stream = scan.foreach({maxRecords: 11}) + * stream.on('error', (error) => { throw error }) + * stream.on('data', (record) => { + * console.log(record.bins) + * }) + * await new Promise(resolve => { + * stream.on('end', (scanState) => { + * scan.nextPage(scanState) + * console.log(scan.scanState) + * resolve() + * }) + * }) + * } while (scan.hasNextPage()) + * + * } catch (error) { + * console.error('An error occurred at some point.', error) + * process.exit(1) + * } finally { + * if (client) client.close() + * } + * })() + * + * @example Asynchronous pagination over a set of thirty records with {@link Scan#foreach}. + * + * const Aerospike = require('./lib/aerospike'); + * // Define host configuration + * let config = { + * hosts: '34.213.88.142:3000', + * policies: { + * batchWrite : new Aerospike.BatchWritePolicy({socketTimeout : 0, totalTimeout : 0}), + * } + * }; + * + * var batchRecords = [] + * for(let i = 0; i < 30; i++){ + * batchRecords.push({ + * type: Aerospike.batchType.BATCH_WRITE, + * key: new Aerospike.Key('test', 'demo', 'key' + i), + * ops:[Aerospike.operations.write('exampleBin', i)] + * }) + * } + * + * ;(async function() { + * try { + * client = await Aerospike.connect(config) + * await client.truncate('test', 'demo', 0) + * await client.batchWrite(batchRecords, {socketTimeout : 0, totalTimeout : 0}) + * + * const scan = client.scan('test', 'demo', {paginate: true}) + * let allResults = [] + * let results = await scan.results({maxRecords: 11}) + * allResults = [...allResults, ...results] + * + * + * results = await scan.results({maxRecords: 11}) + * allResults = [...allResults, ...results] + * + * results = await scan.results({maxRecords: 11}) + * allResults = [...allResults, ...results] + * + * console.log("Records returned in total: " + allResults.length) // Should be 30 records + * + * } catch (error) { + * console.error('An error occurred at some point.', error) + * process.exit(1) + * } finally { + * if (client) client.close() + * } + * })() + * + */ + this.paginate = options.paginate + + /** + * If set to a valid serialized scan, calling {@link scan#foreach} will allow the next page of records to be queried while preserving the progress + * of the previous scan. If set to null, calling {@link scan#foreach} will begin a new scan. + * @member {number} Scan#scanState + */ + this.scanState = undefined } +/** + * @function Scan#nextPage + * + * @summary Sets {@link scan#scanState} to the value specified by the state argument. + * + * @description setter function for the {@link Scan#scanState} member variable. + * + * @param {...object} state - serialized scan emitted from the {@link RecordStream#event:error} event. + */ +Scan.prototype.nextPage = function (state) { + this.scanState = state +} + +/** + * @function Scan#hasNextPage + * + * @summary Checks compiliation status of a paginated scan. + * + * @description If false is returned, there are no more records left in the scan, and the scan is complete. + * If true is returned, calling {@link Scan#foreach} will continue from the state specified by {@link Scan#scanState}. + * + * @returns {boolean} + */ +Scan.prototype.hasNextPage = function () { + return (!!this.scanState) +} /** * @function Scan#select * @@ -314,14 +471,52 @@ Scan.prototype.foreach = function (policy, dataCb, errorCb, endCb) { if (dataCb) stream.on('data', dataCb) if (errorCb) stream.on('error', errorCb) if (endCb) stream.on('end', endCb) - const scanID = Job.safeRandomJobID() const args = [this.ns, this.set, this, policy, scanID] - const cmd = new Commands.Scan(stream, args) - cmd.execute() + if (this.paginate) { + args.push(this.scanState) + const cmd = new Commands.ScanPages(stream, args) + cmd.execute() + } else { + const cmd = new Commands.Scan(stream, args) + cmd.execute() + } stream.job = new Job(this.client, scanID, 'scan') return stream } +/** + * @function Scan#results + * + * @summary Executes the Scan and collects the results into an array. On paginated queries, + * preparing the next page is also handled automatically. + * + * @description This method returns a Promise that contains the scan results + * as an array of records, when fulfilled. It should only be used if the scan + * is expected to return only few records; otherwise it is recommended to use + * {@link Scan#foreach}, which returns the results as a {@link RecordStream} + * instead. + * + * If pagination is enabled, the data emitted from the {@link RecordStream#event:error} + * event will automatically be assigned to {@link Scan#scanState}, allowing the next page + * of records to be queried if {@link Scan#foreach} or {@link Scan#results} is called. + * + * @param {ScanPolicy} [policy] - The Scan Policy to use for this operation. + * + * @returns {Promise} + */ +Scan.prototype.results = function (policy) { + return new Promise((resolve, reject) => { + const stream = this.foreach(policy) + const results = [] + stream.on('error', reject) + stream.on('data', record => results.push(record)) + stream.on('end', (scanState) => { + this.scanState = scanState + resolve(results) + }) + }) +} + module.exports = Scan diff --git a/lib/status.js b/lib/status.js index 44a4f264..c5462953 100644 --- a/lib/status.js +++ b/lib/status.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/typedefs.js b/lib/typedefs.js index 30be5a8c..76a2dd63 100644 --- a/lib/typedefs.js +++ b/lib/typedefs.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/udf_job.js b/lib/udf_job.js index fbbfea5d..16106b9e 100644 --- a/lib/udf_job.js +++ b/lib/udf_job.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/lib/utils.js b/lib/utils.js index b4101d3d..5e021192 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/package-lock.json b/package-lock.json index 86a02a9b..7a47961b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aerospike", - "version": "5.4.0", + "version": "5.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aerospike", - "version": "5.4.0", + "version": "5.5.0", "cpu": [ "x64", "arm64" @@ -47,12 +47,12 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { @@ -60,9 +60,9 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", "dev": true, "dependencies": { "@babel/highlight": "^7.18.6" @@ -72,30 +72,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", - "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", + "version": "7.21.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.9.tgz", + "integrity": "sha512-FUGed8kfhyWvbYug/Un/VPJD41rDIgoVVcR+FuzhzOYyRz5uED+Gd3SLZml0Uw2l2aHFb7ZgdW5mGA3G2cCCnQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", - "integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", + "version": "7.21.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.8.tgz", + "integrity": "sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.3", + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-compilation-targets": "^7.21.5", + "@babel/helper-module-transforms": "^7.21.5", + "@babel/helpers": "^7.21.5", + "@babel/parser": "^7.21.8", "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.3", - "@babel/types": "^7.21.3", + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -120,12 +120,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.21.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.9.tgz", + "integrity": "sha512-F3fZga2uv09wFdEjEQIJxXALXfz0+JaOb7SabvVMmjHxeVTuGW8wgE8Vp1Hd7O+zMTYtcfEISGRzPkeiaPPsvg==", "dev": true, "dependencies": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.21.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -134,28 +134,14 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz", + "integrity": "sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", + "@babel/compat-data": "^7.21.5", + "@babel/helper-validator-option": "^7.21.0", "browserslist": "^4.21.3", "lru-cache": "^5.1.1", "semver": "^6.3.0" @@ -192,9 +178,9 @@ "dev": true }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz", + "integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -226,43 +212,43 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", + "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.21.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz", + "integrity": "sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", + "@babel/helper-environment-visitor": "^7.21.5", + "@babel/helper-module-imports": "^7.21.4", + "@babel/helper-simple-access": "^7.21.5", "@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz", + "integrity": "sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.21.5" }, "engines": { "node": ">=6.9.0" @@ -281,9 +267,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", + "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -308,14 +294,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.5.tgz", + "integrity": "sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==", "dev": true, "dependencies": { "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" + "@babel/traverse": "^7.21.5", + "@babel/types": "^7.21.5" }, "engines": { "node": ">=6.9.0" @@ -336,9 +322,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "version": "7.21.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.9.tgz", + "integrity": "sha512-q5PNg/Bi1OpGgx5jYlvWZwAorZepEudDMCLtj967aeS7WMont7dUZI46M2XwcIQqvUlMxWfdLFu4S/qSxeUu5g==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -348,33 +334,33 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.21.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.21.9.tgz", + "integrity": "sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.21.4", + "@babel/parser": "^7.21.9", + "@babel/types": "^7.21.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", - "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.5.tgz", + "integrity": "sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-environment-visitor": "^7.18.9", + "@babel/code-frame": "^7.21.4", + "@babel/generator": "^7.21.5", + "@babel/helper-environment-visitor": "^7.21.5", "@babel/helper-function-name": "^7.21.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.3", - "@babel/types": "^7.21.3", + "@babel/parser": "^7.21.5", + "@babel/types": "^7.21.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -383,12 +369,12 @@ } }, "node_modules/@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz", + "integrity": "sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-string-parser": "^7.21.5", "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, @@ -515,13 +501,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" @@ -546,21 +533,27 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", @@ -1052,9 +1045,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001473", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz", - "integrity": "sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg==", + "version": "1.0.30001489", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001489.tgz", + "integrity": "sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==", "dev": true, "funding": [ { @@ -1384,9 +1377,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.346", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.346.tgz", - "integrity": "sha512-9ZpKQD8hyWAoYf5bccm2qpaWogAGxb833DVC0arHo9nIbiAMh+aAKHZWABR2P9sK4a3zoCq7eXg8tylqPAnuNw==", + "version": "1.4.405", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.405.tgz", + "integrity": "sha512-JdDgnwU69FMZURoesf9gNOej2Cms1XJFfLk24y1IBtnAdhTcJY/mXnokmpmxHN59PcykBP4bgUU98vLY44Lhuw==", "dev": true }, "node_modules/emoji-regex": { @@ -1674,9 +1667,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { "debug": "^3.2.7" @@ -2446,13 +2439,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -2935,9 +2929,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -4002,9 +3996,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -4100,9 +4094,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", + "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, "node_modules/nopt": { @@ -5039,14 +5033,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -5104,12 +5098,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -5197,9 +5191,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5684,13 +5678,13 @@ "dev": true }, "node_modules/tar": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", - "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" @@ -5700,9 +5694,9 @@ } }, "node_modules/tar/node_modules/minipass": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.5.tgz", - "integrity": "sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "engines": { "node": ">=8" } @@ -5911,9 +5905,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "funding": [ { @@ -5923,6 +5917,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -5930,7 +5928,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -6029,9 +6027,9 @@ } }, "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, "node_modules/which-typed-array": { diff --git a/package.json b/package.json index cc036002..7efe612c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aerospike", - "version": "5.4.0", + "version": "5.5.0", "description": "Aerospike Client Library", "keywords": [ "aerospike", diff --git a/scripts/build-c-client.sh b/scripts/build-c-client.sh index 05635ee6..e85a04f5 100755 --- a/scripts/build-c-client.sh +++ b/scripts/build-c-client.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright 2013-2022 Aerospike, Inc. +# Copyright 2013-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. diff --git a/scripts/build-commands.sh b/scripts/build-commands.sh index e1d52108..5ca06a8b 100755 --- a/scripts/build-commands.sh +++ b/scripts/build-commands.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright 2013-2022 Aerospike, Inc. +# Copyright 2013-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. diff --git a/scripts/build-package.sh b/scripts/build-package.sh index 6d2c7e27..b4e02ee6 100755 --- a/scripts/build-package.sh +++ b/scripts/build-package.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright 2013-2022 Aerospike, Inc. +# Copyright 2013-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. @@ -56,11 +56,11 @@ perform_check rm -rf ${AEROSPIKE_NODEJS_RELEASE_HOME}/node-*-${OS_FLAVOR}-* -build_nodejs_client v14.21.1 -build_nodejs_client v16.18.1 -build_nodejs_client v18.12.1 -build_nodejs_client v19.2.0 +build_nodejs_client v16 +build_nodejs_client v18 +build_nodejs_client v19 +build_nodejs_client v20 -nvm use v18.12.1 +nvm use v20 cd ${CWD} diff --git a/scripts/os_version b/scripts/os_version index c1dee888..dc93aa03 100755 --- a/scripts/os_version +++ b/scripts/os_version @@ -1,6 +1,6 @@ #!/usr/bin/env bash # ------------------------------------------------------------------------------ -# Copyright 2013-2017 Aerospike, Inc. +# Copyright 2013-2023 Aerospike, Inc. # # Portions may be licensed to Aerospike, Inc. under one or more contributor # license agreements. diff --git a/scripts/prebuiltBinding.js b/scripts/prebuiltBinding.js index 3c1aaf68..3a1e179f 100755 --- a/scripts/prebuiltBinding.js +++ b/scripts/prebuiltBinding.js @@ -31,8 +31,8 @@ exec('openssl version', (error, stdout, stderr) => { fs.rename('lib/binding/openssl@3/node-v93-' + dict[OS] + '-' + dict[arch], 'lib/binding/node-v93-' + dict[OS] + '-' + dict[arch], (err) => { if (err) throw err - fs.rename('lib/binding/openssl@3/node-v83-' + dict[OS] + '-' + dict[arch], - 'lib/binding/node-v83-' + dict[OS] + '-' + dict[arch], (err) => { + fs.rename('lib/binding/openssl@3/node-v115-' + dict[OS] + '-' + dict[arch], + 'lib/binding/node-v115-' + dict[OS] + '-' + dict[arch], (err) => { if (err) return fs.rm('lib/binding/openssl@3', { recursive: true, force: true }, (e) => { if (e) throw e @@ -54,8 +54,8 @@ exec('openssl version', (error, stdout, stderr) => { fs.rename('lib/binding/openssl@1/node-v93-' + dict[OS] + '-' + dict[arch], 'lib/binding/node-v93-' + dict[OS] + '-' + dict[arch], (err) => { if (err) throw err - fs.rename('lib/binding/openssl@1/node-v83-' + dict[OS] + '-' + dict[arch], - 'lib/binding/node-v83-' + dict[OS] + '-' + dict[arch], (err) => { + fs.rename('lib/binding/openssl@1/node-v115-' + dict[OS] + '-' + dict[arch], + 'lib/binding/node-v115-' + dict[OS] + '-' + dict[arch], (err) => { if (err) return fs.rm('lib/binding/openssl@3', { recursive: true, force: true }, (e) => { if (e) throw e diff --git a/scripts/validate-c-client.sh b/scripts/validate-c-client.sh index f22d3f68..4a500916 100755 --- a/scripts/validate-c-client.sh +++ b/scripts/validate-c-client.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################ -# Copyright 2013-2022 Aerospike, Inc. +# Copyright 2013-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. diff --git a/scripts/wait-for-node.sh b/scripts/wait-for-node.sh index e35280d9..cd2a9a4f 100755 --- a/scripts/wait-for-node.sh +++ b/scripts/wait-for-node.sh @@ -1,6 +1,6 @@ #! /bin/bash ################################################################################ -# Copyright 2013-2017 Aerospike, Inc. +# Copyright 2013-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. diff --git a/src/include/async.h b/src/include/async.h index 5b211546..a72ffabe 100644 --- a/src/include/async.h +++ b/src/include/async.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. @@ -56,3 +56,9 @@ void async_batch_listener(as_error *err, as_batch_read_records *records, // implements the as_async_scan_listener and as_async_query_record_listener interfaces bool async_scan_listener(as_error *err, as_record *record, void *udata, as_event_loop *event_loop); + +bool async_scan_pages_listener(as_error *err, as_record *record, void *udata, + as_event_loop *event_loop); + +bool async_query_pages_listener(as_error *err, as_record *record, void *udata, + as_event_loop *event_loop); \ No newline at end of file diff --git a/src/include/client.h b/src/include/client.h index 8351c8d8..de89af4a 100644 --- a/src/include/client.h +++ b/src/include/client.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. @@ -102,11 +102,13 @@ class AerospikeClient : public Nan::ObjectWrap { static NAN_METHOD(QueryAsync); static NAN_METHOD(QueryBackground); static NAN_METHOD(QueryForeach); + static NAN_METHOD(QueryPages); static NAN_METHOD(Register); static NAN_METHOD(RemoveAsync); static NAN_METHOD(RemoveSeedHost); static NAN_METHOD(ScanBackground); static NAN_METHOD(ScanAsync); + static NAN_METHOD(ScanPages); static NAN_METHOD(SelectAsync); static NAN_METHOD(SetLogLevel); static NAN_METHOD(SetupEventCb); diff --git a/src/include/command.h b/src/include/command.h index 18bd8ab8..105d12ee 100644 --- a/src/include/command.h +++ b/src/include/command.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2018 Aerospike, Inc. + * Copyright 2018-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. diff --git a/src/include/config.h b/src/include/config.h index 6ccf78ef..548e8f82 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/conversions.h b/src/include/conversions.h index f8d630c3..20ff8c9a 100644 --- a/src/include/conversions.h +++ b/src/include/conversions.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. @@ -122,6 +122,11 @@ v8::Local record_to_jsobject(const as_record *record, v8::Local key_to_jsobject(const as_key *key, const LogInfo *log); v8::Local jobinfo_to_jsobject(const as_job_info *info, const LogInfo *log); +v8::Local query_bytes_to_jsobject(uint8_t* bytes, uint32_t bytes_size, const LogInfo *log); + +void load_bytes_size(v8::Local saved_object, uint32_t* bytes_size, LogInfo *log); + +void load_bytes(v8::Local saved_object, uint8_t* bytes, uint32_t bytes_size, LogInfo *log); // Functions to convert v8 objects(maps) to C client structures int host_from_jsobject(v8::Local obj, char **addr, uint16_t *port, diff --git a/src/include/enums.h b/src/include/enums.h index 8e480e5e..c87b9290 100644 --- a/src/include/enums.h +++ b/src/include/enums.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2021 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/events.h b/src/include/events.h index 02f9da7e..4f82847f 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/expressions.h b/src/include/expressions.h index 68174a04..00352aae 100644 --- a/src/include/expressions.h +++ b/src/include/expressions.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2021-2022 Aerospike, Inc. + * Copyright 2021-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. diff --git a/src/include/log.h b/src/include/log.h index 5078ee96..cae70a06 100644 --- a/src/include/log.h +++ b/src/include/log.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/operations.h b/src/include/operations.h index 212bb40b..1d41eafa 100644 --- a/src/include/operations.h +++ b/src/include/operations.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/policy.h b/src/include/policy.h index fd16af28..df7091d7 100644 --- a/src/include/policy.h +++ b/src/include/policy.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/include/query.h b/src/include/query.h index cc1d7263..d715bce8 100644 --- a/src/include/query.h +++ b/src/include/query.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. @@ -24,7 +24,18 @@ extern "C" { #include "log.h" + +struct query_udata { + as_query* query; + AsyncCommand* cmd; + uint32_t count; + uint32_t max_records; +}; + void setup_query(as_query *query, v8::Local ns, v8::Local set, v8::Local maybe_options, LogInfo *log); +void setup_options(as_query *query, v8::Local options, LogInfo *log); +void setup_query_pages(as_query ** query, v8::Local ns, v8::Local set, + v8::Localmaybe_options, uint8_t* bytes, uint32_t bytes_size, LogInfo *log); void free_query(as_query *query, as_policy_query *policy); diff --git a/src/include/scan.h b/src/include/scan.h index b6b7cb4c..f1988af9 100644 --- a/src/include/scan.h +++ b/src/include/scan.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. @@ -22,6 +22,18 @@ extern "C" { #include "log.h" +struct scan_udata { + as_scan* scan; + AsyncCommand * cmd; + uint32_t count; + uint32_t max_records; +}; + void setup_scan(as_scan *scan, v8::Local ns, v8::Local set, v8::Local maybe_options, LogInfo *log); + +void setup_options(as_scan *scan, v8::Local options, LogInfo *log); + +void setup_scan_pages(as_scan **scan, v8::Local ns, v8::Local set, + v8::Local maybe_options, uint8_t* bytes, uint32_t bytes_size, LogInfo *log); \ No newline at end of file diff --git a/src/main/aerospike.cc b/src/main/aerospike.cc index b8080407..e60c7881 100644 --- a/src/main/aerospike.cc +++ b/src/main/aerospike.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/async.cc b/src/main/async.cc index ab8cdf25..41419e33 100644 --- a/src/main/async.cc +++ b/src/main/async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. @@ -23,6 +23,8 @@ #include "client.h" #include "conversions.h" #include "log.h" +#include "scan.h" +#include "query.h" extern "C" { #include @@ -168,3 +170,120 @@ bool async_scan_listener(as_error *err, as_record *record, void *udata, } return continue_scan; } + +bool async_scan_pages_listener(as_error *err, as_record *record, void *udata, + as_event_loop *event_loop) +{ + Nan::HandleScope scope; + struct scan_udata* su = (scan_udata*) udata; + AsyncCommand *cmd = reinterpret_cast(su->cmd); + + const LogInfo *log = cmd->log; + + Local result; + if (err) { + result = cmd->ErrorCallback(err); + } + else if (su->count >= su->max_records) { + as_scan* scan = reinterpret_cast(su->scan); + uint32_t bytes_size; + uint8_t* bytes = NULL; + + as_scan_to_bytes(scan, &bytes, &bytes_size); + Local argv[] = {Nan::Null(), + Nan::Null(), + query_bytes_to_jsobject(bytes, bytes_size, log), + Nan::Null()}; + + cmd->Callback(4, {argv}); + as_scan_destroy(scan); + free(bytes); + delete cmd; + free(su); + return false; + } + else if (record) { + Local argv[] = {Nan::Null(), + recordbins_to_jsobject(record, log), + recordmeta_to_jsobject(record, log), + key_to_jsobject(&record->key, log)}; + result = cmd->Callback(4, argv); + } + else { + as_scan* scan = reinterpret_cast(su->scan); + cmd->Callback(0, {}); + as_scan_destroy(scan); + delete cmd; + free(su); + return false; + } + + su->count += 1; + + bool continue_scan = true; + if (result->IsBoolean()) { + continue_scan = Nan::To(result).FromJust(); + as_v8_debug(log, "Async scan callback returned: %s", + continue_scan ? "true" : "false"); + } + return continue_scan; +} + +bool async_query_pages_listener(as_error *err, as_record *record, void *udata, + as_event_loop *event_loop) +{ + Nan::HandleScope scope; + struct query_udata* qu = (query_udata*) udata; + AsyncCommand *cmd = reinterpret_cast(qu->cmd); + + + const LogInfo *log = cmd->log; + + Local result; + if (err) { + result = cmd->ErrorCallback(err); + } + else if (qu->count >= qu->max_records) { + as_query* query = reinterpret_cast(qu->query); + uint32_t bytes_size; + uint8_t* bytes = NULL; + as_query_to_bytes(query, &bytes, &bytes_size); + Local argv[] = {Nan::Null(), + Nan::Null(), + query_bytes_to_jsobject(bytes, bytes_size, log), + Nan::Null()}; + + cmd->Callback(4, {argv}); + free_query(query, NULL); + free(bytes); + delete cmd; + free(qu); + return false; + } + else if (record) { + Local argv[] = {Nan::Null(), + recordbins_to_jsobject(record, log), + recordmeta_to_jsobject(record, log), + key_to_jsobject(&record->key, log)}; + result = cmd->Callback(4, argv); + } + else { + as_query* query = reinterpret_cast(qu->query); + cmd->Callback(0, {}); + free_query(query, NULL); + delete cmd; + free(qu); + return false; + } + + qu->count += 1; + + bool continue_scan = true; + if (result->IsBoolean()) { + continue_scan = Nan::To(result).FromJust(); + as_v8_debug(log, "Async scan callback returned: %s", + continue_scan ? "true" : "false"); + } + return continue_scan; +} + diff --git a/src/main/bit_operations.cc b/src/main/bit_operations.cc index c4ff6daf..283fc4c6 100644 --- a/src/main/bit_operations.cc +++ b/src/main/bit_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2019 Aerospike, Inc. + * Copyright 2019-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. diff --git a/src/main/cdt_ctx.cc b/src/main/cdt_ctx.cc index ec9cd821..23811f61 100644 --- a/src/main/cdt_ctx.cc +++ b/src/main/cdt_ctx.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/client.cc b/src/main/client.cc index dbdef41f..b382e805 100644 --- a/src/main/client.cc +++ b/src/main/client.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. @@ -311,9 +311,11 @@ void AerospikeClient::Init() Nan::SetPrototypeMethod(tpl, "queryAsync", QueryAsync); Nan::SetPrototypeMethod(tpl, "queryBackground", QueryBackground); Nan::SetPrototypeMethod(tpl, "queryForeach", QueryForeach); + Nan::SetPrototypeMethod(tpl, "queryPages", QueryPages); Nan::SetPrototypeMethod(tpl, "removeAsync", RemoveAsync); Nan::SetPrototypeMethod(tpl, "removeSeedHost", RemoveSeedHost); Nan::SetPrototypeMethod(tpl, "scanAsync", ScanAsync); + Nan::SetPrototypeMethod(tpl, "scanPages", ScanPages); Nan::SetPrototypeMethod(tpl, "scanBackground", ScanBackground); Nan::SetPrototypeMethod(tpl, "selectAsync", SelectAsync); Nan::SetPrototypeMethod(tpl, "setupEventCb", SetupEventCb); @@ -323,4 +325,4 @@ void AerospikeClient::Init() Nan::SetPrototypeMethod(tpl, "updateLogging", SetLogLevel); constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); -} +} \ No newline at end of file diff --git a/src/main/command.cc b/src/main/command.cc index fae9e426..dd7a136e 100644 --- a/src/main/command.cc +++ b/src/main/command.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2018 Aerospike, Inc. + * Copyright 2018-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. diff --git a/src/main/commands/batch_apply.cc b/src/main/commands/batch_apply.cc index aab88071..4953c728 100644 --- a/src/main/commands/batch_apply.cc +++ b/src/main/commands/batch_apply.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2022 Aerospike, Inc. + * Copyright 2022-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. diff --git a/src/main/commands/batch_exists.cc b/src/main/commands/batch_exists.cc index 7df5953a..13ed34e4 100644 --- a/src/main/commands/batch_exists.cc +++ b/src/main/commands/batch_exists.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/batch_get.cc b/src/main/commands/batch_get.cc index ec177058..1984670a 100644 --- a/src/main/commands/batch_get.cc +++ b/src/main/commands/batch_get.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/batch_read_async.cc b/src/main/commands/batch_read_async.cc index d8049987..d8735b4d 100644 --- a/src/main/commands/batch_read_async.cc +++ b/src/main/commands/batch_read_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/batch_remove.cc b/src/main/commands/batch_remove.cc index 1efba76d..eb677d19 100644 --- a/src/main/commands/batch_remove.cc +++ b/src/main/commands/batch_remove.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2022 Aerospike, Inc. + * Copyright 2022-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. diff --git a/src/main/commands/batch_select.cc b/src/main/commands/batch_select.cc index 96264416..0f03bf98 100644 --- a/src/main/commands/batch_select.cc +++ b/src/main/commands/batch_select.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/batch_write_async.cc b/src/main/commands/batch_write_async.cc index a4f7239e..64fdaf8e 100644 --- a/src/main/commands/batch_write_async.cc +++ b/src/main/commands/batch_write_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/exists_async.cc b/src/main/commands/exists_async.cc index dcc09e11..7675354c 100644 --- a/src/main/commands/exists_async.cc +++ b/src/main/commands/exists_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/get_async.cc b/src/main/commands/get_async.cc index 2b151f26..e87bb2b7 100644 --- a/src/main/commands/get_async.cc +++ b/src/main/commands/get_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/index_create.cc b/src/main/commands/index_create.cc index 37c9a67c..cfa5dfd4 100644 --- a/src/main/commands/index_create.cc +++ b/src/main/commands/index_create.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/index_remove.cc b/src/main/commands/index_remove.cc index ab2d093f..309db7ff 100644 --- a/src/main/commands/index_remove.cc +++ b/src/main/commands/index_remove.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/info_any.cc b/src/main/commands/info_any.cc index 8db88565..e49a6885 100644 --- a/src/main/commands/info_any.cc +++ b/src/main/commands/info_any.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/info_foreach.cc b/src/main/commands/info_foreach.cc index 17b6c81d..31c253ac 100644 --- a/src/main/commands/info_foreach.cc +++ b/src/main/commands/info_foreach.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/info_host.cc b/src/main/commands/info_host.cc index 0ab0da9f..83181cf0 100644 --- a/src/main/commands/info_host.cc +++ b/src/main/commands/info_host.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/info_node.cc b/src/main/commands/info_node.cc index c1c72b1a..7c5d6c40 100644 --- a/src/main/commands/info_node.cc +++ b/src/main/commands/info_node.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/job_info.cc b/src/main/commands/job_info.cc index 51f45998..7e2924f6 100644 --- a/src/main/commands/job_info.cc +++ b/src/main/commands/job_info.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/operate_async.cc b/src/main/commands/operate_async.cc index 1292a160..56f13294 100644 --- a/src/main/commands/operate_async.cc +++ b/src/main/commands/operate_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/put_async.cc b/src/main/commands/put_async.cc index a7edac99..a309e43c 100644 --- a/src/main/commands/put_async.cc +++ b/src/main/commands/put_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/query_apply.cc b/src/main/commands/query_apply.cc index 54d552af..f54b28d7 100644 --- a/src/main/commands/query_apply.cc +++ b/src/main/commands/query_apply.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/query_async.cc b/src/main/commands/query_async.cc index 2e5f1688..60b6d6f0 100644 --- a/src/main/commands/query_async.cc +++ b/src/main/commands/query_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/query_background.cc b/src/main/commands/query_background.cc index eb44e1e2..f8e31f45 100644 --- a/src/main/commands/query_background.cc +++ b/src/main/commands/query_background.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/query_foreach.cc b/src/main/commands/query_foreach.cc index 9db85931..df68f53c 100644 --- a/src/main/commands/query_foreach.cc +++ b/src/main/commands/query_foreach.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/query_pages.cc b/src/main/commands/query_pages.cc new file mode 100644 index 00000000..f0755513 --- /dev/null +++ b/src/main/commands/query_pages.cc @@ -0,0 +1,124 @@ +/******************************************************************************* + * 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. + ******************************************************************************/ + +#include "client.h" +#include "async.h" +#include "command.h" +#include "conversions.h" +#include "policy.h" +#include "log.h" +#include "query.h" + +extern "C" { +#include +#include +#include +#include +#include +#include +} + +using namespace v8; + +NAN_METHOD(AerospikeClient::QueryPages) +{ + TYPE_CHECK_REQ(info[0], IsString, "Namespace must be a string"); + TYPE_CHECK_OPT(info[1], IsString, "Set must be a string"); + TYPE_CHECK_OPT(info[2], IsObject, "Options must be an object"); + TYPE_CHECK_OPT(info[3], IsObject, "Policy must be an object"); + TYPE_CHECK_OPT(info[4], IsObject, "saved_query must be an object"); + TYPE_CHECK_OPT(info[5], IsNumber, "max_records must be an object"); + TYPE_CHECK_REQ(info[6], IsFunction, "Callback must be a function"); + + AerospikeClient *client = + Nan::ObjectWrap::Unwrap(info.This()); + AsyncCommand *cmd = + new AsyncCommand("Query", client, info[6].As()); + LogInfo *log = client->log; + + as_policy_query* p_policy = NULL; + as_policy_query policy; + as_partition_filter pf; + bool pf_defined = false; + as_status status; + + struct query_udata* qu = (query_udata*) cf_malloc(sizeof(struct query_udata)); + qu->cmd = cmd; + qu->count = 0; + + if (info[4]->IsObject()) { + uint32_t bytes_size = 0; + load_bytes_size(info[4].As(), &bytes_size, log); + uint8_t* bytes = new uint8_t[bytes_size]; + load_bytes(info[4].As(), bytes, bytes_size, log); + setup_query_pages(&qu->query, info[0], info[1], Nan::Null(), bytes, bytes_size, log); + delete bytes; + } + else{ + setup_query_pages(&qu->query, info[0], info[1], info[2], NULL, 0, log); + } + + + if (info[3]->IsObject()) { + if (querypolicy_from_jsobject(&policy, info[3].As(), log) != + AS_NODE_PARAM_OK) { + CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, + "Partitions object invalid"); + goto Cleanup; + } + p_policy = &policy; + } + + as_partition_filter_set_all(&pf); + if (partitions_from_jsobject(&pf, &pf_defined, info[2].As(), log) != + AS_NODE_PARAM_OK) { + CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid"); + goto Cleanup; + } + + if(info[5]->IsNumber()){ + qu->max_records = Nan::To(info[5]).FromJust(); + qu->query->max_records = 0; + } + + + if (pf_defined) { + as_v8_debug(log, "Sending async query partitions command"); + status = aerospike_query_partitions_async( + client->as, &cmd->err, p_policy, (as_query*) qu->query, &pf, async_query_pages_listener, + qu, NULL); + } + else { + as_v8_debug(log, "Sending async query command"); + + status = aerospike_query_async(client->as, &cmd->err, p_policy, (as_query*) qu->query, + async_query_pages_listener, qu, NULL); + } + + if (status == AEROSPIKE_OK) { + cmd = NULL; // async callback responsible for deleting the command + } + else { + cmd->ErrorCallback(); + } + +Cleanup: + delete cmd; + if (p_policy && policy.base.filter_exp) { + as_exp_destroy(policy.base.filter_exp); + } + +} \ No newline at end of file diff --git a/src/main/commands/remove_async.cc b/src/main/commands/remove_async.cc index 6ea97456..32ea7749 100644 --- a/src/main/commands/remove_async.cc +++ b/src/main/commands/remove_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/scan_async.cc b/src/main/commands/scan_async.cc index 66d6ab80..a5ac629b 100644 --- a/src/main/commands/scan_async.cc +++ b/src/main/commands/scan_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/scan_background.cc b/src/main/commands/scan_background.cc index 3121659d..1235c8e5 100644 --- a/src/main/commands/scan_background.cc +++ b/src/main/commands/scan_background.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/scan_pages.cc b/src/main/commands/scan_pages.cc new file mode 100644 index 00000000..faf85161 --- /dev/null +++ b/src/main/commands/scan_pages.cc @@ -0,0 +1,127 @@ +/******************************************************************************* + * 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. + ******************************************************************************/ + +#include "client.h" +#include "async.h" +#include "command.h" +#include "conversions.h" +#include "policy.h" +#include "log.h" +#include "scan.h" + +extern "C" { +#include +#include +#include +#include +#include +#include +} + +using namespace v8; + +NAN_METHOD(AerospikeClient::ScanPages) +{ + TYPE_CHECK_REQ(info[0], IsString, "Namespace must be a string"); + TYPE_CHECK_OPT(info[1], IsString, "Set must be a string"); + TYPE_CHECK_OPT(info[2], IsObject, "Options must be an object"); + TYPE_CHECK_OPT(info[3], IsObject, "Policy must be an object"); + TYPE_CHECK_OPT(info[4], IsNumber, "Scan_id must be a number"); + TYPE_CHECK_OPT(info[5], IsObject, "saved_scan must be an object"); + TYPE_CHECK_REQ(info[6], IsFunction, "Callback must be a function"); + + AerospikeClient *client = + Nan::ObjectWrap::Unwrap(info.This()); + AsyncCommand *cmd = + new AsyncCommand("Scan", client, info[6].As()); + + LogInfo *log = client->log; + + uint64_t scan_id = 0; + + as_policy_scan *p_policy = NULL; + as_policy_scan policy; + as_partition_filter pf; + bool pf_defined = false; + as_status status; + + struct scan_udata* su = (scan_udata*) cf_malloc(sizeof(struct scan_udata)); + su->cmd = cmd; + su->count = 0; + + if (info[5]->IsObject()) { + uint32_t bytes_size = 0; + load_bytes_size(info[5].As(), &bytes_size, log); + uint8_t* bytes = new uint8_t[bytes_size]; + load_bytes(info[5].As(), bytes, bytes_size, log); + setup_scan_pages(&su->scan, info[0], info[1], Nan::Null(), bytes, bytes_size, log); + delete bytes; + } + else{ + setup_scan_pages(&su->scan, info[0], info[1], info[2], NULL, 0, log); + } + + + + if (info[3]->IsObject()) { + if (scanpolicy_from_jsobject(&policy, info[3].As(), log) != + AS_NODE_PARAM_OK) { + CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid"); + goto Cleanup; + } + p_policy = &policy; + } + + if (info[4]->IsNumber()) { + scan_id = Nan::To(info[4]).FromJust(); + as_v8_debug(log, "Using scan ID %lli for async scan.", scan_id); + } + + + as_partition_filter_set_all(&pf); + if (partitions_from_jsobject(&pf, &pf_defined, info[2].As(), log) != + AS_NODE_PARAM_OK) { + CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Partitions object invalid"); + goto Cleanup; + } + + su->max_records = p_policy->max_records; + p_policy->max_records = 0; + + if (pf_defined) { + as_v8_debug(log, "Sending async scan partitions command"); + status = aerospike_scan_partitions_async( + client->as, &cmd->err, p_policy, su->scan, &pf, async_scan_pages_listener, + su, NULL); + } + else { + as_v8_debug(log, "Sending async scan command"); + status = aerospike_scan_async(client->as, &cmd->err, p_policy, su->scan, + &scan_id, async_scan_pages_listener, su, NULL); + } + if (status == AEROSPIKE_OK) { + cmd = NULL; // async callback responsible for deleting the command + } + else { + cmd->ErrorCallback(); + } + +Cleanup: + delete cmd; + if (p_policy && policy.base.filter_exp) { + as_exp_destroy(policy.base.filter_exp); + } +} \ No newline at end of file diff --git a/src/main/commands/select_async.cc b/src/main/commands/select_async.cc index 4e22b248..bb3e2a2b 100644 --- a/src/main/commands/select_async.cc +++ b/src/main/commands/select_async.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/truncate.cc b/src/main/commands/truncate.cc index 30330498..fa9993fb 100644 --- a/src/main/commands/truncate.cc +++ b/src/main/commands/truncate.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/udf_register.cc b/src/main/commands/udf_register.cc index 9d5322f0..7ba9a377 100644 --- a/src/main/commands/udf_register.cc +++ b/src/main/commands/udf_register.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/commands/udf_remove.cc b/src/main/commands/udf_remove.cc index 5e70ac50..85cc477e 100644 --- a/src/main/commands/udf_remove.cc +++ b/src/main/commands/udf_remove.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/config.cc b/src/main/config.cc index dc85e706..094f7959 100644 --- a/src/main/config.cc +++ b/src/main/config.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. @@ -453,7 +453,7 @@ int config_from_jsobject(as_config *config, Local configObj, goto Cleanup; } if ((rc = get_optional_int_property(&config->rack_id, NULL, configObj, - "rack_id", log)) != AS_NODE_PARAM_OK) { + "rackId", log)) != AS_NODE_PARAM_OK) { goto Cleanup; } diff --git a/src/main/enums/batch_type.cc b/src/main/enums/batch_type.cc index 042cbc1a..41933010 100644 --- a/src/main/enums/batch_type.cc +++ b/src/main/enums/batch_type.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2022 Aerospike, Inc. + * Copyright 2022-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. diff --git a/src/main/enums/bitwise_enum.cc b/src/main/enums/bitwise_enum.cc index b8b0b97a..ddf50621 100644 --- a/src/main/enums/bitwise_enum.cc +++ b/src/main/enums/bitwise_enum.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2019-2022 Aerospike, Inc. + * Copyright 2019-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. diff --git a/src/main/enums/config_enum.cc b/src/main/enums/config_enum.cc index dfdce607..b77b9324 100644 --- a/src/main/enums/config_enum.cc +++ b/src/main/enums/config_enum.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/exp_enum.cc b/src/main/enums/exp_enum.cc index 7d9d7428..c3ced9b0 100644 --- a/src/main/enums/exp_enum.cc +++ b/src/main/enums/exp_enum.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2021-2022 Aerospike, Inc. + * Copyright 2021-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. diff --git a/src/main/enums/hll_enum.cc b/src/main/enums/hll_enum.cc index 8c365817..4ae28a91 100644 --- a/src/main/enums/hll_enum.cc +++ b/src/main/enums/hll_enum.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2020-2022 Aerospike, Inc. + * Copyright 2020-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. diff --git a/src/main/enums/index.cc b/src/main/enums/index.cc index bde4eb0d..f578de60 100644 --- a/src/main/enums/index.cc +++ b/src/main/enums/index.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/job_status.cc b/src/main/enums/job_status.cc index d85294e5..f722d089 100644 --- a/src/main/enums/job_status.cc +++ b/src/main/enums/job_status.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/lists.cc b/src/main/enums/lists.cc index da4f072b..69706507 100644 --- a/src/main/enums/lists.cc +++ b/src/main/enums/lists.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2018-2022 Aerospike, Inc. + * Copyright 2018-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. diff --git a/src/main/enums/maps.cc b/src/main/enums/maps.cc index d2c58b58..b8081451 100644 --- a/src/main/enums/maps.cc +++ b/src/main/enums/maps.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/policy_enum.cc b/src/main/enums/policy_enum.cc index 063cdf07..f8ed3925 100644 --- a/src/main/enums/policy_enum.cc +++ b/src/main/enums/policy_enum.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2019 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/predicates.cc b/src/main/enums/predicates.cc index 56b8dbf2..5ea942cf 100644 --- a/src/main/enums/predicates.cc +++ b/src/main/enums/predicates.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/scanPriority.cc b/src/main/enums/scanPriority.cc index cbdcf94c..3505d7e5 100644 --- a/src/main/enums/scanPriority.cc +++ b/src/main/enums/scanPriority.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/status.cc b/src/main/enums/status.cc index 549dcfbb..39957599 100644 --- a/src/main/enums/status.cc +++ b/src/main/enums/status.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/ttl.cc b/src/main/enums/ttl.cc index 71ee2a63..fd5a09c6 100644 --- a/src/main/enums/ttl.cc +++ b/src/main/enums/ttl.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/enums/udf_languages.cc b/src/main/enums/udf_languages.cc index 49464e4d..1b515a6c 100644 --- a/src/main/enums/udf_languages.cc +++ b/src/main/enums/udf_languages.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2017 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/events.cc b/src/main/events.cc index 86c80b62..6f4b909d 100644 --- a/src/main/events.cc +++ b/src/main/events.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/exp_operations.cc b/src/main/exp_operations.cc index 7848041c..6681afae 100644 --- a/src/main/exp_operations.cc +++ b/src/main/exp_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2022 Aerospike, Inc. + * Copyright 2022-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. diff --git a/src/main/expressions.cc b/src/main/expressions.cc index a311b769..d138d58b 100644 --- a/src/main/expressions.cc +++ b/src/main/expressions.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2020 Aerospike, Inc. + * Copyright 2020-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. diff --git a/src/main/hll_operations.cc b/src/main/hll_operations.cc index 2eedb362..b9febe2a 100644 --- a/src/main/hll_operations.cc +++ b/src/main/hll_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2020-2022 Aerospike, Inc. + * Copyright 2020-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. diff --git a/src/main/list_operations.cc b/src/main/list_operations.cc index 2f5b882b..e3d15491 100644 --- a/src/main/list_operations.cc +++ b/src/main/list_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/map_operations.cc b/src/main/map_operations.cc index d36bea54..eca3a24d 100644 --- a/src/main/map_operations.cc +++ b/src/main/map_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/operations.cc b/src/main/operations.cc index 62b75c66..a9c42ade 100644 --- a/src/main/operations.cc +++ b/src/main/operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/policy.cc b/src/main/policy.cc index 9ec145b5..4bb80082 100644 --- a/src/main/policy.cc +++ b/src/main/policy.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike Inc. + * Copyright 2013-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. diff --git a/src/main/query.cc b/src/main/query.cc index bec563f6..64af4442 100644 --- a/src/main/query.cc +++ b/src/main/query.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2020 Aerospike, Inc. + * Copyright 2013-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. @@ -56,7 +56,13 @@ void setup_query(as_query *query, Local ns, Local set, if (!maybe_options->IsObject()) { return; } - Local options = maybe_options.As(); + setup_options(query, maybe_options.As(), log); + + +} + +void setup_options(as_query *query, Local options, LogInfo *log) +{ Local filters_val = Nan::Get(options, Nan::New("filters").ToLocalChecked()) @@ -187,7 +193,7 @@ void setup_query(as_query *query, Local ns, Local set, if (selected->IsArray()) { Local bins = Local::Cast(selected); int size = bins->Length(); - as_v8_detail(log, "Number of bins to select in scan %d", size); + as_v8_detail(log, "Number of bins to select in query %d", size); as_query_select_init(query, size); for (int i = 0; i < size; i++) { Local bin = Nan::Get(bins, i).ToLocalChecked(); @@ -207,6 +213,13 @@ void setup_query(as_query *query, Local ns, Local set, query->no_bins = Nan::To(nobins).FromJust(); } + Local max_records = + Nan::Get(options, Nan::New("maxRecords").ToLocalChecked()).ToLocalChecked(); + TYPE_CHECK_OPT(max_records, IsNumber, "max_records must be a number"); + if (max_records->IsNumber()) { + query->max_records = (uint64_t) Nan::To(max_records).FromJust(); + } + Local udf = Nan::Get(options, Nan::New("udf").ToLocalChecked()).ToLocalChecked(); TYPE_CHECK_OPT(udf, IsObject, "udf must be an object"); @@ -239,16 +252,47 @@ void setup_query(as_query *query, Local ns, Local set, } } +void setup_query_pages(as_query** query, Local ns, Local set, + Local maybe_options, uint8_t* bytes, uint32_t bytes_size, LogInfo *log) +{ + as_namespace as_ns = {'\0'}; + as_set as_set = {'\0'}; + + if (as_strlcpy(as_ns, *Nan::Utf8String(ns), AS_NAMESPACE_MAX_SIZE) > + AS_NAMESPACE_MAX_SIZE) { + as_v8_error(log, "Namespace exceeds max. length (%d)", + AS_NAMESPACE_MAX_SIZE); + // TODO: Return param error + } + + if (set->IsString()) { + if (as_strlcpy(as_set, *Nan::Utf8String(set), AS_SET_MAX_SIZE) > + AS_SET_MAX_SIZE) { + as_v8_error(log, "Set exceeds max. length (%d)", AS_SET_MAX_SIZE); + // TODO: Return param error + } + } + + *query = as_query_new(as_ns, as_set); + + if(bytes_size){ + *query = as_query_from_bytes_new(bytes, bytes_size); + return; + } + as_query_set_paginate(*query, true); + + if (!maybe_options->IsObject()) { + return; + } + + setup_options(*query, maybe_options.As(), log); + +} + + void free_query(as_query *query, as_policy_query *policy) { if (query) { - for (int i = 0; i < query->where.size; i++) { - as_predicate entry = query->where.entries[i]; - if (entry.dtype == AS_INDEX_STRING || - entry.dtype == AS_INDEX_GEO2DSPHERE) { - free(entry.value.string); - } - } as_query_destroy(query); } diff --git a/src/main/scalar_operations.cc b/src/main/scalar_operations.cc index f7cb2db1..40f01e65 100644 --- a/src/main/scalar_operations.cc +++ b/src/main/scalar_operations.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2021 Aerospike, Inc. + * Copyright 2013-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. diff --git a/src/main/scan.cc b/src/main/scan.cc index c10c4b91..2cbb26cb 100644 --- a/src/main/scan.cc +++ b/src/main/scan.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2021 Aerospike, Inc. + * Copyright 2013-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. @@ -57,11 +57,13 @@ void setup_scan(as_scan *scan, Local ns, Local set, if (!maybe_options->IsObject()) { return; } - Local options = maybe_options.As(); + setup_options(scan, maybe_options.As(), log); +} +void setup_options(as_scan *scan, Local options, LogInfo *log) +{ Local selected = - Nan::Get(options, Nan::New("selected").ToLocalChecked()) - .ToLocalChecked(); + Nan::Get(options, Nan::New("selected").ToLocalChecked()).ToLocalChecked(); TYPE_CHECK_OPT(selected, IsArray, "selected must be an array"); if (selected->IsArray()) { Local bins = Local::Cast(selected); @@ -125,3 +127,43 @@ void setup_scan(as_scan *scan, Local ns, Local set, } } } + +void setup_scan_pages(as_scan **scan, Local ns, Local set, + Local maybe_options, uint8_t* bytes, uint32_t bytes_size, LogInfo *log) +{ + as_namespace as_ns = {'\0'}; + as_set as_set = {'\0'}; + + if (as_strlcpy(as_ns, *Nan::Utf8String(ns), AS_NAMESPACE_MAX_SIZE) > + AS_NAMESPACE_MAX_SIZE) { + as_v8_error(log, "Namespace exceeds max. length (%d)", + AS_NAMESPACE_MAX_SIZE); + // TODO: Return param error + } + + if (set->IsString()) { + if (as_strlcpy(as_set, *Nan::Utf8String(set), AS_SET_MAX_SIZE) > + AS_SET_MAX_SIZE) { + as_v8_error(log, "Set exceeds max. length (%d)", AS_SET_MAX_SIZE); + // TODO: Return param error + } + } + + *scan = as_scan_new(as_ns, as_set); + + if(bytes_size){ + *scan = as_scan_from_bytes_new(bytes, bytes_size); + return; + } + as_scan_set_paginate(*scan, true); + + if (!maybe_options->IsObject()) { + printf("returnthis"); + return; + } + + setup_options(*scan, maybe_options.As(), log); + + +} + diff --git a/src/main/stats.cc b/src/main/stats.cc index 684983c8..70f14580 100644 --- a/src/main/stats.cc +++ b/src/main/stats.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2018 Aerospike, Inc. + * Copyright 2018-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. diff --git a/src/main/util/conversions.cc b/src/main/util/conversions.cc index 6fd8cb37..5b95310d 100644 --- a/src/main/util/conversions.cc +++ b/src/main/util/conversions.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2022 Aerospike, Inc. + * Copyright 2013-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. @@ -1430,6 +1430,64 @@ Local jobinfo_to_jsobject(const as_job_info *info, const LogInfo *log) return jobinfo; } +Local query_bytes_to_jsobject(uint8_t* bytes, uint32_t bytes_size, const LogInfo *log) +{ + Nan::EscapableHandleScope scope; + + Local v8_saved_query; + if (bytes == NULL) { + as_v8_debug( + log, + "Bytes ( C structure) is NULL, cannot form node.js record object"); + return scope.Escape(v8_saved_query); + } + + v8_saved_query = Nan::New(); + + Local v8_bytes = Nan::New(); + for(uint32_t i = 0; i < bytes_size; i++) { + Nan::Set(v8_bytes, i, Nan::New((uint32_t) bytes[i])); + } + Nan::Set(v8_saved_query, Nan::New("bytes").ToLocalChecked(), v8_bytes); + Nan::Set(v8_saved_query, Nan::New("bytesSize").ToLocalChecked(), Nan::New(bytes_size)); + return scope.Escape(v8_saved_query); +} + +void load_bytes_size(Local saved_object, uint32_t* bytes_size, LogInfo *log) +{ + + Local v8_byte_size = + Nan::Get(saved_object, Nan::New("bytesSize").ToLocalChecked()) + .ToLocalChecked(); + TYPE_CHECK_OPT(v8_byte_size, IsNumber, "paginate must be a boolean"); + if (v8_byte_size->IsUint32()) { + *bytes_size = (uint32_t)Nan::To(v8_byte_size).FromJust(); + + } + +} + +void load_bytes(Local saved_object, uint8_t* bytes, uint32_t bytes_size, LogInfo *log) +{ + + Local v8_bytes = + Nan::Get(saved_object, Nan::New("bytes").ToLocalChecked()) + .ToLocalChecked(); + TYPE_CHECK_OPT(v8_bytes, IsArray, "paginate must be a boolean"); + if (v8_bytes->IsArray()) + { + for(uint32_t i = 0; i < (bytes_size); i++) + { + Local v8_bytes_val = Nan::Get(v8_bytes.As(), i).ToLocalChecked(); + TYPE_CHECK_OPT(v8_bytes_val, IsNumber, "paginate must be a boolean"); + if (v8_bytes_val->IsNumber()) + { + bytes[i] = (uint8_t) Nan::To(v8_bytes_val).FromJust(); + } + } + } +} + int key_from_jsobject(as_key *key, Local obj, const LogInfo *log) { Nan::EscapableHandleScope scope; diff --git a/src/main/util/conversions_batch.cc b/src/main/util/conversions_batch.cc index 24b17527..5d96f348 100644 --- a/src/main/util/conversions_batch.cc +++ b/src/main/util/conversions_batch.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2022 Aerospike, Inc. + * Copyright 2022-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. diff --git a/src/main/util/log.cc b/src/main/util/log.cc index 1e1751f6..85aa9def 100644 --- a/src/main/util/log.cc +++ b/src/main/util/log.cc @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2013-2018 Aerospike, Inc. + * Copyright 2013-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. diff --git a/test/aerospike.js b/test/aerospike.js index 290e1ccb..2eb5158d 100644 --- a/test/aerospike.js +++ b/test/aerospike.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2018 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/apply.js b/test/apply.js index 741c33cb..349c2e5c 100644 --- a/test/apply.js +++ b/test/apply.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/batch_apply.js b/test/batch_apply.js index ab7cea38..b0e30072 100644 --- a/test/batch_apply.js +++ b/test/batch_apply.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/batch_exists.js b/test/batch_exists.js index 9d464e2f..dce2dc4b 100644 --- a/test/batch_exists.js +++ b/test/batch_exists.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/batch_get.js b/test/batch_get.js index 8f39667f..a3bfc88c 100644 --- a/test/batch_get.js +++ b/test/batch_get.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/batch_read.js b/test/batch_read.js index 745e056b..1969a2f1 100644 --- a/test/batch_read.js +++ b/test/batch_read.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/batch_remove.js b/test/batch_remove.js index fd2fcc37..5af50d14 100644 --- a/test/batch_remove.js +++ b/test/batch_remove.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/batch_select.js b/test/batch_select.js index cdda72f4..8596be7e 100644 --- a/test/batch_select.js +++ b/test/batch_select.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/batch_write.js b/test/batch_write.js index 62324a90..23ea97aa 100644 --- a/test/batch_write.js +++ b/test/batch_write.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/bigint.js b/test/bigint.js index 17201035..e9fa8d5e 100644 --- a/test/bigint.js +++ b/test/bigint.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/bitwise.js b/test/bitwise.js index adab3ac4..ed30c7fe 100644 --- a/test/bitwise.js +++ b/test/bitwise.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2019 Aerospike, Inc. +// Copyright 2019-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. diff --git a/test/cdt_context.js b/test/cdt_context.js index 0fa68d60..3bed967a 100644 --- a/test/cdt_context.js +++ b/test/cdt_context.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/client.js b/test/client.js index 65df337c..3ecb9577 100644 --- a/test/client.js +++ b/test/client.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/command.js b/test/command.js index 1ceefec9..ef583277 100644 --- a/test/command.js +++ b/test/command.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/command_queue.js b/test/command_queue.js index ab06b563..d459a3ad 100644 --- a/test/command_queue.js +++ b/test/command_queue.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/config.js b/test/config.js index 3e4c0476..05dd355f 100644 --- a/test/config.js +++ b/test/config.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/double.js b/test/double.js index 75ce9b31..87488b46 100644 --- a/test/double.js +++ b/test/double.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/enterprise.js b/test/enterprise.js index 32f0ba86..4978cf5d 100644 --- a/test/enterprise.js +++ b/test/enterprise.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/error.js b/test/error.js index ce41539d..b852f7a7 100644 --- a/test/error.js +++ b/test/error.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/exists.js b/test/exists.js index 79dbdafa..3b650646 100644 --- a/test/exists.js +++ b/test/exists.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/exp.js b/test/exp.js index 16af59c9..e606fb5b 100644 --- a/test/exp.js +++ b/test/exp.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2021 Aerospike, Inc. +// Copyright 2021-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. diff --git a/test/exp_bit.js b/test/exp_bit.js index cbb6ea52..d1648f06 100644 --- a/test/exp_bit.js +++ b/test/exp_bit.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/exp_hll.js b/test/exp_hll.js index 015b6c6c..8e4cdd5b 100644 --- a/test/exp_hll.js +++ b/test/exp_hll.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/exp_list.js b/test/exp_list.js index 76717972..3d28ae5b 100644 --- a/test/exp_list.js +++ b/test/exp_list.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/exp_map.js b/test/exp_map.js index 09956b84..81f80170 100644 --- a/test/exp_map.js +++ b/test/exp_map.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2022 Aerospike, Inc. +// Copyright 2022-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. diff --git a/test/generators/key.js b/test/generators/key.js index 89d9f8b9..12182735 100644 --- a/test/generators/key.js +++ b/test/generators/key.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/generators/metadata.js b/test/generators/metadata.js index 6a3aecbe..5f5a108f 100644 --- a/test/generators/metadata.js +++ b/test/generators/metadata.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/generators/put.js b/test/generators/put.js index 085c97f7..ec6621a1 100644 --- a/test/generators/put.js +++ b/test/generators/put.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/generators/record.js b/test/generators/record.js index 67685c2b..e3c317bf 100644 --- a/test/generators/record.js +++ b/test/generators/record.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/generators/util.js b/test/generators/util.js index a8e20d25..7f88e6c8 100644 --- a/test/generators/util.js +++ b/test/generators/util.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2017 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/generators/value.js b/test/generators/value.js index 18cff8d3..c86cb9fa 100644 --- a/test/generators/value.js +++ b/test/generators/value.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/geojson.js b/test/geojson.js index 65e247c2..cabbcafd 100644 --- a/test/geojson.js +++ b/test/geojson.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/get.js b/test/get.js index 75f909dc..3c398c83 100644 --- a/test/get.js +++ b/test/get.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/hll.js b/test/hll.js index ec468a48..4ae1c47a 100644 --- a/test/hll.js +++ b/test/hll.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2020 Aerospike, Inc. +// Copyright 2020-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. diff --git a/test/index.js b/test/index.js index 7a013e14..f98019e0 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/index_job.js b/test/index_job.js index 6e9bbc30..17d5a23b 100644 --- a/test/index_job.js +++ b/test/index_job.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/info.js b/test/info.js index d1f82737..84a60ca7 100644 --- a/test/info.js +++ b/test/info.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/key.js b/test/key.js index b9de08e6..89feca03 100644 --- a/test/key.js +++ b/test/key.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/lists.js b/test/lists.js index 7213d442..961a825f 100644 --- a/test/lists.js +++ b/test/lists.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/maps.js b/test/maps.js index 2b675735..40f613a7 100644 --- a/test/maps.js +++ b/test/maps.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/operate.js b/test/operate.js index 0e863fcd..2a51251d 100644 --- a/test/operate.js +++ b/test/operate.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/policy.js b/test/policy.js index 485ce851..9da4886f 100644 --- a/test/policy.js +++ b/test/policy.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/put.js b/test/put.js index e88f9e13..01ec814d 100644 --- a/test/put.js +++ b/test/put.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/query.js b/test/query.js index 90060a09..717f346a 100644 --- a/test/query.js +++ b/test/query.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. @@ -200,6 +200,111 @@ describe('Queries', function () { }) }) + describe('query.paginate()', function () { + it('paginates with the correct amount of keys and pages', async function () { + let recordsReceived = 0 + let recordTotal = 0 + let pageTotal = 0 + const lastPage = 3 + const maxRecs = 2 + const query = client.query(helper.namespace, testSet, { paginate: true, maxRecords: maxRecs, filters: [filter.equal('name', 'filter')] }) + while (1) { + const stream = query.foreach() + stream.on('error', (error) => { throw error }) + stream.on('data', (record) => { + recordsReceived++ + }) + await new Promise(resolve => { + stream.on('end', (queryState) => { + query.queryState = queryState + resolve() + }) + }) + pageTotal += 1 + if (recordsReceived !== maxRecs) { + recordTotal += recordsReceived + expect(query.queryState).to.equal(undefined) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(4) + break + } else { + recordTotal += recordsReceived + recordsReceived = 0 + } + } + }) + + it('Paginates correctly using query.hasNextPage() and query.nextPage()', async function () { + let recordsReceived = 0 + let recordTotal = 0 + let pageTotal = 0 + const lastPage = 3 + const maxRecs = 2 + const query = client.query(helper.namespace, testSet, { paginate: true, maxRecords: maxRecs, filters: [filter.equal('name', 'filter')] }) + while (1) { + const stream = query.foreach() + stream.on('error', (error) => { throw error }) + stream.on('data', (record) => { + recordsReceived++ + }) + await new Promise(resolve => { + stream.on('end', (queryState) => { + query.nextPage(queryState) + resolve() + }) + }) + pageTotal += 1 + if (recordsReceived !== maxRecs) { + recordTotal += recordsReceived + expect(query.hasNextPage()).to.equal(false) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(4) + break + } else { + recordTotal += recordsReceived + recordsReceived = 0 + } + } + }) + + it('Paginates correctly using query.results()', async function () { + let recordTotal = 0 + let recordsReceived = 0 + let pageTotal = 0 + const lastPage = 3 + const maxRecs = 2 + const query = client.query(helper.namespace, testSet, { paginate: true, maxRecords: maxRecs, filters: [filter.equal('name', 'filter')] }) + let results = [] + while (1) { + results = await query.results() + recordsReceived += results.length + results = [] + + pageTotal += 1 + recordTotal += recordsReceived + if (recordsReceived !== maxRecs) { + expect(query.hasNextPage()).to.equal(false) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(4) + break + } + recordsReceived = 0 + } + }) + + it('Throw error when query.UDF is set and query.paginate is true', async function () { + const maxRecs = 2 + const query = client.query(helper.namespace, testSet, { paginate: true, maxRecords: maxRecs, filters: [filter.equal('name', 'filter')] }) + query.setUdf('ANYVALUE') + try { + await query.results() + expect(1).to.equal(2) + } catch (error) { + expect(error.message).to.equal('Stream UDF cannot be applied using a paginated stream. Please disable pagination or UDF.') + } + }) + }) + it('returns the key if it was stored on the server', function (done) { const uniqueKey = 'test/query/record_with_stored_key' const key = new Aerospike.Key(helper.namespace, testSet, uniqueKey) @@ -211,6 +316,7 @@ describe('Queries', function () { client.put(key, record, meta, policy, function (err) { if (err) throw err + const query = client.query(helper.namespace, testSet) query.where(Aerospike.filter.equal('name', uniqueKey)) const stream = query.foreach() diff --git a/test/remove.js b/test/remove.js index 2e45355c..33f803fb 100644 --- a/test/remove.js +++ b/test/remove.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/remove_bin.js b/test/remove_bin.js index 70bceeec..a3a616b8 100644 --- a/test/remove_bin.js +++ b/test/remove_bin.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/scan.js b/test/scan.js index a61f5dcc..213fc8d2 100644 --- a/test/scan.js +++ b/test/scan.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. @@ -112,6 +112,107 @@ context('Scans', function () { }) }) + describe('scan.paginate', function () { + it('Paginates with the correct amount of keys and pages', async function () { + let recordsReceived = 0 + let recordTotal = 0 + let pageTotal = 0 + const lastPage = 11 + const maxRecs = 10 + const scan = client.scan(helper.namespace, testSet, { paginate: true }) + while (1) { + const stream = scan.foreach({ maxRecords: maxRecs }) + stream.on('error', (error) => { throw error }) + stream.on('data', (record) => { + recordsReceived++ + }) + await new Promise(resolve => { + stream.on('end', (scanState) => { + scan.scanState = scanState + resolve() + }) + }) + pageTotal += 1 + if (recordsReceived !== maxRecs) { + recordTotal += recordsReceived + expect(scan.scanState).to.equal(undefined) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(numberOfRecords) + break + } else { + recordTotal += recordsReceived + recordsReceived = 0 + } + } + }) + + it('Paginates correctly using scan.hasNextPage() and scan.nextPage()', async function () { + let recordsReceived = 0 + let recordTotal = 0 + let pageTotal = 0 + const lastPage = 11 + const maxRecs = 10 + const scan = client.scan(helper.namespace, testSet, { paginate: true }) + while (1) { + const stream = scan.foreach({ maxRecords: maxRecs }) + stream.on('error', (error) => { throw error }) + stream.on('data', (record) => { + recordsReceived++ + }) + await new Promise(resolve => { + stream.on('end', (scanState) => { + scan.nextPage(scanState) + resolve() + }) + }) + pageTotal += 1 + if (recordsReceived !== maxRecs) { + recordTotal += recordsReceived + expect(scan.hasNextPage()).to.equal(false) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(numberOfRecords) + break + } else { + recordTotal += recordsReceived + recordsReceived = 0 + } + } + }) + + it('Paginates correctly using query.results()', async function () { + let recordsReceived = 0 + let recordTotal = 0 + let pageTotal = 0 + const lastPage = 11 + const maxRecs = 10 + const scan = client.scan(helper.namespace, testSet, { paginate: true }) + while (1) { + const stream = scan.foreach({ maxRecords: maxRecs }) + stream.on('error', (error) => { throw error }) + stream.on('data', (record) => { + recordsReceived++ + }) + await new Promise(resolve => { + stream.on('end', (scanState) => { + scan.nextPage(scanState) + resolve() + }) + }) + pageTotal += 1 + if (recordsReceived !== maxRecs) { + recordTotal += recordsReceived + expect(scan.hasNextPage()).to.equal(false) + expect(pageTotal).to.equal(lastPage) + expect(recordTotal).to.equal(numberOfRecords) + break + } else { + recordTotal += recordsReceived + recordsReceived = 0 + } + } + }) + }) + it('retrieves all records from the given partitions', function (done) { const scan = client.scan(helper.namespace, testSet) let recordsReceived = 0 diff --git a/test/select.js b/test/select.js index b142891e..8c5ad20a 100644 --- a/test/select.js +++ b/test/select.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/stats.js b/test/stats.js index 885af784..fecc1386 100644 --- a/test/stats.js +++ b/test/stats.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2018-2019 Aerospike, Inc. +// Copyright 2018-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. diff --git a/test/stress/perfdata.js b/test/stress/perfdata.js index ea7276de..0e4bf934 100644 --- a/test/stress/perfdata.js +++ b/test/stress/perfdata.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/stress/query.js b/test/stress/query.js index 16e7c990..aaac2a8b 100644 --- a/test/stress/query.js +++ b/test/stress/query.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/stress/scan.js b/test/stress/scan.js index e41edaa0..9a18fc18 100644 --- a/test/stress/scan.js +++ b/test/stress/scan.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2021 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/test_helper.js b/test/test_helper.js index 6879d0bd..c865d480 100644 --- a/test/test_helper.js +++ b/test/test_helper.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/truncate.js b/test/truncate.js index 9d47b2bb..854438f3 100644 --- a/test/truncate.js +++ b/test/truncate.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/udf.js b/test/udf.js index 535dc465..30cb11ed 100644 --- a/test/udf.js +++ b/test/udf.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/util/options.js b/test/util/options.js index 0e8a96ba..643515ca 100644 --- a/test/util/options.js +++ b/test/util/options.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2022 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/util/run_in_new_process.js b/test/util/run_in_new_process.js index ed101969..9ad46053 100644 --- a/test/util/run_in_new_process.js +++ b/test/util/run_in_new_process.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2020 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/util/statefulAsyncTest.js b/test/util/statefulAsyncTest.js index c669e75a..e1e7a944 100644 --- a/test/util/statefulAsyncTest.js +++ b/test/util/statefulAsyncTest.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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. diff --git a/test/utils.js b/test/utils.js index f813ed89..7e8e3600 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,5 +1,5 @@ // ***************************************************************************** -// Copyright 2013-2019 Aerospike, Inc. +// Copyright 2013-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.