aerospike 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +11 -0
  2. package/lib/abort_status.js +0 -1
  3. package/lib/binding/glibc@2.31/node-v108-linux-arm64/aerospike.node +0 -0
  4. package/lib/binding/glibc@2.31/node-v108-linux-x64/aerospike.node +0 -0
  5. package/lib/binding/glibc@2.31/node-v115-linux-arm64/aerospike.node +0 -0
  6. package/lib/binding/glibc@2.31/node-v115-linux-x64/aerospike.node +0 -0
  7. package/lib/binding/glibc@2.31/node-v127-linux-arm64/aerospike.node +0 -0
  8. package/lib/binding/glibc@2.31/node-v127-linux-x64/aerospike.node +0 -0
  9. package/lib/binding/glibc@2.31/node-v131-linux-arm64/aerospike.node +0 -0
  10. package/lib/binding/glibc@2.31/node-v131-linux-x64/aerospike.node +0 -0
  11. package/lib/binding/glibc@2.35/node-v108-linux-arm64/aerospike.node +0 -0
  12. package/lib/binding/glibc@2.35/node-v108-linux-x64/aerospike.node +0 -0
  13. package/lib/binding/glibc@2.35/node-v115-linux-arm64/aerospike.node +0 -0
  14. package/lib/binding/glibc@2.35/node-v115-linux-x64/aerospike.node +0 -0
  15. package/lib/binding/glibc@2.35/node-v127-linux-arm64/aerospike.node +0 -0
  16. package/lib/binding/glibc@2.35/node-v127-linux-x64/aerospike.node +0 -0
  17. package/lib/binding/glibc@2.35/node-v131-linux-arm64/aerospike.node +0 -0
  18. package/lib/binding/glibc@2.35/node-v131-linux-x64/aerospike.node +0 -0
  19. package/lib/binding/node-v108-darwin-arm64/aerospike.node +0 -0
  20. package/lib/binding/node-v108-darwin-x64/aerospike.node +0 -0
  21. package/lib/binding/node-v108-win32-x64/aerospike.dll +0 -0
  22. package/lib/binding/node-v108-win32-x64/aerospike.node +0 -0
  23. package/lib/binding/node-v115-darwin-arm64/aerospike.node +0 -0
  24. package/lib/binding/node-v115-darwin-x64/aerospike.node +0 -0
  25. package/lib/binding/node-v115-win32-x64/aerospike.dll +0 -0
  26. package/lib/binding/node-v115-win32-x64/aerospike.node +0 -0
  27. package/lib/binding/node-v127-darwin-arm64/aerospike.node +0 -0
  28. package/lib/binding/node-v127-darwin-x64/aerospike.node +0 -0
  29. package/lib/binding/node-v127-win32-x64/aerospike.dll +0 -0
  30. package/lib/binding/node-v127-win32-x64/aerospike.node +0 -0
  31. package/lib/binding/node-v131-darwin-arm64/aerospike.node +0 -0
  32. package/lib/binding/node-v131-darwin-x64/aerospike.node +0 -0
  33. package/lib/binding/node-v131-win32-x64/aerospike.dll +0 -0
  34. package/lib/binding/node-v131-win32-x64/aerospike.node +0 -0
  35. package/lib/client.js +8 -3
  36. package/lib/commit_status.js +0 -1
  37. package/lib/status.js +92 -31
  38. package/package.json +5 -5
  39. package/scripts/change-install-command.js +15 -0
  40. package/src/main/enums/abort_status.cc +0 -1
  41. package/src/main/enums/commit_status.cc +0 -1
  42. package/src/main/enums/status.cc +8 -1
  43. package/ts-test/package-lock.json +353 -4
  44. package/ts-test/package.json +1 -0
  45. package/ts-test/tests/batch_read.ts +7 -7
  46. package/ts-test/tests/batch_remove.ts +2 -3
  47. package/ts-test/tests/batch_write.ts +2 -2
  48. package/ts-test/tests/error.ts +1 -1
  49. package/ts-test/tests/get.ts +6 -6
  50. package/ts-test/tests/mrt_api.ts +38 -0
  51. package/ts-test/tests/mrt_backward_compatible.ts +4 -1
  52. package/ts-test/tests/mrt_functionality.ts +18 -4
  53. package/ts-test/tests/query.ts +2 -3
  54. package/ts-test/tests/scan.ts +3 -4
  55. package/ts-test/tests/status.ts +623 -0
  56. package/ts-test/tests/test_helper.ts +12 -9
  57. package/typings/index.d.ts +472 -444
package/README.md CHANGED
@@ -188,6 +188,17 @@ To install library prerequisites using `apt`:
188
188
  sudo apt install g++ libssl libssl-dev zlib1g-dev
189
189
  ```
190
190
 
191
+ If you are using Ubuntu 20.04, you must upgrade gcc/g++ to at least version 10:
192
+
193
+ ```bash
194
+ sudo apt-get install gcc-10 g++-10
195
+ ln -s /usr/bin/gcc-10 /usr/local/bin/gcc
196
+
197
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40
198
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60
199
+ sudo update-alternatives --config g++
200
+ ```
201
+
191
202
  ### Windows
192
203
 
193
204
  See our [Windows README.md](https://github.com/aerospike/aerospike-client-nodejs/blob/master/README_WINDOWS.md) for details on how to build and install on windows.
@@ -21,7 +21,6 @@ const abortStatus = as.abortStatus
21
21
 
22
22
  module.exports = {
23
23
  OK: abortStatus.OK,
24
- ALREADY_COMMITTED: abortStatus.ALREADY_COMMITTED,
25
24
  ALREADY_ABORTED: abortStatus.ALREADY_ABORTED,
26
25
  ROLL_BACK_ABANDONED: abortStatus.ROLL_BACK_ABANDONED,
27
26
  CLOSE_ABANDONED: abortStatus.CLOSE_ABANDONED
package/lib/client.js CHANGED
@@ -22,9 +22,10 @@ const EventEmitter = require('events')
22
22
 
23
23
  const as = require('bindings')('aerospike.node')
24
24
  const AerospikeError = require('./error')
25
+ const status = require('./status')
26
+ const txnState = require('./txn_state')
25
27
  const abortStatus = require('./abort_status')
26
28
  const commitStatus = require('./commit_status')
27
- const txnState = require('./txn_state')
28
29
  const Transaction = require('./transaction')
29
30
  const Context = require('./cdt_context')
30
31
  const Commands = require('./commands')
@@ -220,7 +221,9 @@ Client.prototype.abort = function (transaction, callback) {
220
221
  _transactionPool.tendTransactions()
221
222
  if (transaction instanceof Transaction) {
222
223
  if (transaction.getState() === txnState.COMMITTED) {
223
- return abortStatus.ALREADY_COMMITTED
224
+ const err = new AerospikeError('The transaction has already been committed.')
225
+ err.code = status.TXN_ALREADY_COMMITTED
226
+ throw err
224
227
  } else if (transaction.getState() === txnState.ABORTED) {
225
228
  return abortStatus.ALREADY_ABORTED
226
229
  } else if (transaction.getDestroyed() === true) {
@@ -239,7 +242,9 @@ Client.prototype.commit = function (transaction, callback) {
239
242
  if (transaction.getState() === txnState.COMMITTED) {
240
243
  return commitStatus.ALREADY_COMMITTED
241
244
  } else if (transaction.getState() === txnState.ABORTED) {
242
- return commitStatus.ALREADY_ABORTED
245
+ const err = new AerospikeError('The transaction has already been aborted.')
246
+ err.code = status.TXN_ALREADY_ABORTED
247
+ throw err
243
248
  } else if (transaction.getDestroyed() === true) {
244
249
  throw new AerospikeError('The object has been destroyed, please create a new transaction.')
245
250
  }
@@ -22,7 +22,6 @@ const commitStatus = as.commitStatus
22
22
  module.exports = {
23
23
  OK: commitStatus.OK,
24
24
  ALREADY_COMMITTED: commitStatus.ALREADY_COMMITTED,
25
- ALREADY_ABORTED: commitStatus.ALREADY_ABORTED,
26
25
  VERIFY_FAILED: commitStatus.VERIFY_FAILED,
27
26
  MARK_ROLL_FORWARD_ABANDONED: commitStatus.MARK_ROLL_FORWARD_ABANDONED,
28
27
  ROLL_FORWARD_ABANDONED: commitStatus.ROLL_FORWARD_ABANDONED,
package/lib/status.js CHANGED
@@ -24,6 +24,10 @@ const as = require('bindings')('aerospike.node')
24
24
  * @description Database operation error codes.
25
25
  */
26
26
 
27
+ exports.TXN_ALREADY_ABORTED = exports.AEROSPIKE_TXN_ALREADY_ABORTED = as.status.AEROSPIKE_TXN_ALREADY_ABORTED
28
+
29
+ exports.TXN_ALREADY_COMMITTED = exports.AEROSPIKE_TXN_ALREADY_COMMITTED = as.status.AEROSPIKE_TXN_ALREADY_COMMITTED
30
+
27
31
  /**
28
32
  * Multi-record transaction failed.
29
33
  * @const {number}
@@ -443,6 +447,10 @@ exports.NOT_AUTHENTICATED = exports.AEROSPIKE_NOT_AUTHENTICATED = as.status.AERO
443
447
  */
444
448
  exports.ROLE_VIOLATION = exports.AEROSPIKE_ROLE_VIOLATION = as.status.AEROSPIKE_ROLE_VIOLATION
445
449
 
450
+ exports.NOT_WHITELISTED = exports.AEROSPIKE_NOT_WHITELISTED = as.status.AEROSPIKE_NOT_WHITELISTED
451
+
452
+ exports.QUOTA_EXCEEDED = exports.AEROSPIKE_QUOTA_EXCEEDED = as.status.AEROSPIKE_QUOTA_EXCEEDED
453
+
446
454
  /**
447
455
  * Generic UDF error.
448
456
  * @const {number}
@@ -455,6 +463,8 @@ exports.MRT_EXPIRED = exports.AEROSPIKE_MRT_EXPIRED = as.status.AEROSPIKE_MRT_EX
455
463
  exports.MRT_TOO_MANY_WRITES = exports.AEROSPIKE_MRT_TOO_MANY_WRITES = as.status.AEROSPIKE_MRT_TOO_MANY_WRITES
456
464
  exports.MRT_COMMITTED = exports.AEROSPIKE_MRT_COMMITTED = as.status.AEROSPIKE_MRT_COMMITTED
457
465
  exports.MRT_ABORTED = exports.AEROSPIKE_MRT_ABORTED = as.status.AEROSPIKE_MRT_ABORTED
466
+ exports.MRT_ALREADY_LOCKED = exports.AEROSPIKE_MRT_ALREADY_LOCKED = as.status.AEROSPIKE_MRT_ALREADY_LOCKED
467
+ exports.MRT_MONITOR_EXISTS = exports.AEROSPIKE_MRT_MONITOR_EXISTS = as.status.AEROSPIKE_MRT_MONITOR_EXISTS
458
468
 
459
469
  /**
460
470
  * Batch functionality has been disabled.
@@ -568,14 +578,44 @@ exports.ERR_LUA_FILE_NOT_FOUND = exports.AEROSPIKE_ERR_LUA_FILE_NOT_FOUND = as.s
568
578
  exports.getMessage = function (code) {
569
579
  /* istanbul ignore next */
570
580
  switch (code) {
581
+ case exports.TXN_ALREADY_ABORTED:
582
+ return 'Transaction commit called, but the transaction was already aborted.'
583
+
584
+ case exports.TXN_ALREADY_COMMITTED:
585
+ return 'Transaction abort called, but the transaction was already committed.'
586
+
571
587
  case exports.TXN_FAILED:
572
- return 'Multi-record transaction failed.'
588
+ return 'Transaction failed.'
589
+
590
+ case exports.BATCH_FAILED:
591
+ return 'One or more keys failed in a batch.'
592
+
593
+ case exports.NO_RESPONSE:
594
+ return 'No response received from server.'
595
+
596
+ case exports.MAX_ERROR_RATE:
597
+ return 'Max errors limit reached.'
598
+
599
+ case exports.USE_NORMAL_RETRY:
600
+ return 'Abort split batch retry and use normal node retry instead. Used internally and should not be returned to user.'
601
+
602
+ case exports.ERR_MAX_RETRIES_EXCEEDED:
603
+ return 'Max retries limit reached.'
604
+
605
+ case exports.ERR_ASYNC_QUEUE_FULL:
606
+ return 'Async command delay queue is full.'
607
+
608
+ case exports.ERR_CONNECTION:
609
+ return 'Synchronous connection error.'
610
+
611
+ case exports.ERR_TLS_ERROR:
612
+ return 'TLS related error'
573
613
 
574
614
  case exports.ERR_INVALID_NODE:
575
615
  return 'Node invalid or could not be found.'
576
616
 
577
617
  case exports.ERR_NO_MORE_CONNECTIONS:
578
- return 'Asynchronous connection error.'
618
+ return 'Max connections would be exceeded.'
579
619
 
580
620
  case exports.ERR_ASYNC_CONNECTION:
581
621
  return 'Asynchronous connection error.'
@@ -599,10 +639,10 @@ exports.getMessage = function (code) {
599
639
  return 'Generic success.'
600
640
 
601
641
  case exports.ERR_SERVER:
602
- return 'Generic error returned by the server.'
642
+ return 'Generic error returned by server.'
603
643
 
604
644
  case exports.ERR_RECORD_NOT_FOUND:
605
- return 'Record does not exist in database. May be returned by read, or write with policy Aerospike.policy.exists.UPDATE'
645
+ return 'Record does not exist in database. May be returned by read, or write with policy Aerospike.policy.exists.UPDATE.'
606
646
 
607
647
  case exports.ERR_RECORD_GENERATION:
608
648
  return 'Generation of record in database does not satisfy write policy.'
@@ -617,7 +657,7 @@ exports.getMessage = function (code) {
617
657
  return 'Bin already exists on a create-only operation.'
618
658
 
619
659
  case exports.ERR_CLUSTER_CHANGE:
620
- return 'A cluster state change occurred during the request.'
660
+ return 'A cluster state change occurred during the request. This may also be returned by scan operations with the fail_on_cluster_change flag set.'
621
661
 
622
662
  case exports.ERR_SERVER_FULL:
623
663
  return 'The server node is running out of memory and/or storage device space reserved for the specified namespace.'
@@ -626,25 +666,25 @@ exports.getMessage = function (code) {
626
666
  return 'Request timed out. Can be triggered by client or server.'
627
667
 
628
668
  case exports.ERR_ALWAYS_FORBIDDEN:
629
- return 'Client is attempting an operation which is not allowed under current configuration.'
669
+ return 'Operation not allowed in current configuration.'
630
670
 
631
671
  case exports.ERR_CLUSTER:
632
672
  return 'Partition is unavailable.'
633
673
 
634
674
  case exports.ERR_BIN_INCOMPATIBLE_TYPE:
635
- return 'Bin modification operation cannot be done on an existing bin due to its value type.'
675
+ return 'Bin modification operation can\'t be done on an existing bin due to its value type.'
636
676
 
637
677
  case exports.ERR_RECORD_TOO_BIG:
638
- return 'Record being (re-)written cannot fit in a storage write block.'
678
+ return 'Record being (re-)written can\'t fit in a storage write block.'
639
679
 
640
680
  case exports.ERR_RECORD_BUSY:
641
- return 'Too many concurrent requests for one record - a "hot key" situation.'
681
+ return 'Too many concurrent requests for one record - a "hot-key" situation.'
642
682
 
643
683
  case exports.ERR_SCAN_ABORTED:
644
684
  return 'Scan aborted by user.'
645
685
 
646
686
  case exports.ERR_UNSUPPORTED_FEATURE:
647
- return 'Sometimes our doc, or our customers\' wishes, get ahead of us. We may have processed something that the server is not ready for (unsupported feature).'
687
+ return 'Sometimes our doc, or our customers wishes, get ahead of us. We may have processed something that the server is not ready for (unsupported feature).'
648
688
 
649
689
  case exports.ERR_BIN_NOT_FOUND:
650
690
  return 'Bin not found on update-only operation.'
@@ -653,22 +693,22 @@ exports.getMessage = function (code) {
653
693
  return 'The server node\'s storage device(s) can\'t keep up with the write load.'
654
694
 
655
695
  case exports.ERR_RECORD_KEY_MISMATCH:
656
- return 'Record key sent with transaction did not match key stored on server.'
696
+ return 'Record key sent with command did not match key stored on server.'
657
697
 
658
698
  case exports.ERR_NAMESPACE_NOT_FOUND:
659
699
  return 'Namespace in request not found on server.'
660
700
 
661
701
  case exports.ERR_BIN_NAME:
662
- return 'Sent too-long bin name or exceeded namespace\'s bin name quota.'
702
+ return 'Sent too-long bin name (should be impossible in this client) or exceeded namespace\'s bin name quota.'
663
703
 
664
704
  case exports.ERR_FAIL_FORBIDDEN:
665
705
  return 'Operation not allowed at this time.'
666
706
 
667
707
  case exports.ERR_FAIL_ELEMENT_NOT_FOUND:
668
- return 'Map/list element not found in UPDATE_ONLY write mode.'
708
+ return 'Map element not found in UPDATE_ONLY write mode.'
669
709
 
670
710
  case exports.ERR_FAIL_ELEMENT_EXISTS:
671
- return 'Map/list element exists in CREATE_ONLY write mode.'
711
+ return 'Map element exists in CREATE_ONLY write mode.'
672
712
 
673
713
  case exports.ERR_ENTERPRISE_ONLY:
674
714
  return 'Attempt to use an Enterprise feature on a Community server or a server without the applicable feature key.'
@@ -677,7 +717,13 @@ exports.getMessage = function (code) {
677
717
  return 'The operation cannot be applied to the current bin value on the server.'
678
718
 
679
719
  case exports.FILTERED_OUT:
680
- return 'The transaction was not performed because the expression was false.'
720
+ return 'The command was not performed because the filter expression was false.'
721
+
722
+ case exports.LOST_CONFLICT:
723
+ return 'Write command loses conflict to XDR.'
724
+
725
+ case exports.XDR_KEY_BUSY:
726
+ return 'Write can\'t complete until XDR finishes shipping.'
681
727
 
682
728
  case exports.QUERY_END:
683
729
  return 'There are no more records left for query.'
@@ -689,7 +735,7 @@ exports.getMessage = function (code) {
689
735
  return 'Security functionality not enabled by connected server.'
690
736
 
691
737
  case exports.SECURITY_SCHEME_NOT_SUPPORTED:
692
- return 'Security type not supported by connected server.'
738
+ return 'Security scheme not supported.'
693
739
 
694
740
  case exports.INVALID_COMMAND:
695
741
  return 'Administration command is invalid.'
@@ -718,23 +764,26 @@ exports.getMessage = function (code) {
718
764
  case exports.INVALID_CREDENTIAL:
719
765
  return 'Security credential is invalid.'
720
766
 
767
+ case exports.EXPIRED_SESSION:
768
+ return 'Login session expired.'
769
+
721
770
  case exports.INVALID_ROLE:
722
771
  return 'Role name is invalid.'
723
772
 
724
773
  case exports.ROLE_ALREADY_EXISTS:
725
- return 'Role name already exists.'
774
+ return 'Role already exists.'
726
775
 
727
776
  case exports.INVALID_PRIVILEGE:
728
777
  return 'Privilege is invalid.'
729
778
 
730
779
  case exports.INVALID_WHITELIST:
731
- return 'Specified IP whitelist is invalid.'
780
+ return 'Invalid IP whitelist.'
732
781
 
733
782
  case exports.QUOTAS_NOT_ENABLED:
734
- return 'Quotas not enabled on the server.'
783
+ return 'Quotas not enabled on server.'
735
784
 
736
785
  case exports.INVALID_QUOTA:
737
- return 'Invalid quota specified.'
786
+ return 'Invalid quota.'
738
787
 
739
788
  case exports.NOT_AUTHENTICATED:
740
789
  return 'User must be authenticated before performing database operations.'
@@ -742,38 +791,50 @@ exports.getMessage = function (code) {
742
791
  case exports.ROLE_VIOLATION:
743
792
  return 'User does not possess the required role to perform the database operation.'
744
793
 
794
+ case exports.NOT_WHITELISTED:
795
+ return 'Command not allowed because sender IP not whitelisted.'
796
+
797
+ case exports.QUOTA_EXCEEDED:
798
+ return 'Quota exceeded.'
799
+
745
800
  case exports.ERR_UDF:
746
801
  return 'Generic UDF error.'
747
802
 
748
803
  case exports.MRT_BLOCKED:
749
- return 'MRT record blocked by a different transaction.'
804
+ return 'Transaction record blocked by a different transaction.'
750
805
 
751
806
  case exports.MRT_VERSION_MISMATCH:
752
- return 'MRT read version mismatch identified during commit. Some other command changed the record outside of the transaction.'
807
+ return 'Transaction read version mismatch identified during commit. Some other command changed the record outside of the transaction.'
753
808
 
754
809
  case exports.MRT_EXPIRED:
755
- return 'MRT deadline reached without a successful commit or abort.'
810
+ return 'Transaction deadline reached without a successful commit or abort.'
756
811
 
757
812
  case exports.MRT_TOO_MANY_WRITES:
758
- return 'MRT write command limit (4096) exceeded.'
813
+ return 'Transaction write command limit (4096) exceeded.'
759
814
 
760
815
  case exports.MRT_COMMITTED:
761
- return 'MRT was already committed.'
816
+ return 'Transaction was already committed.'
762
817
 
763
818
  case exports.MRT_ABORTED:
764
- return 'MRT was already aborted.'
819
+ return 'Transaction was already aborted.'
820
+
821
+ case exports.MRT_ALREADY_LOCKED:
822
+ return 'This record has been locked by a previous update in this transaction.'
823
+
824
+ case exports.MRT_MONITOR_EXISTS:
825
+ return 'This transaction has already started. Writing to the same transaction with independent threads is unsafe.'
765
826
 
766
827
  case exports.ERR_BATCH_DISABLED:
767
828
  return 'Batch functionality has been disabled.'
768
829
 
769
830
  case exports.ERR_BATCH_MAX_REQUESTS_EXCEEDED:
770
- return 'Batch max. requests have been exceeded.'
831
+ return 'Batch max requests have been exceeded.'
771
832
 
772
833
  case exports.ERR_BATCH_QUEUES_FULL:
773
834
  return 'All batch queues are full.'
774
835
 
775
836
  case exports.ERR_GEO_INVALID_GEOJSON:
776
- return 'Invalid/unsupported GeoJSON.'
837
+ return 'Invalid/Unsupported GeoJSON.'
777
838
 
778
839
  case exports.ERR_INDEX_FOUND:
779
840
  return 'Index found.'
@@ -788,13 +849,13 @@ exports.getMessage = function (code) {
788
849
  return 'Unable to read the index.'
789
850
 
790
851
  case exports.ERR_INDEX:
791
- return 'Generic SI error.'
852
+ return 'Generic secondary index error.'
792
853
 
793
854
  case exports.ERR_INDEX_NAME_MAXLEN:
794
855
  return 'Index name is too long.'
795
856
 
796
857
  case exports.ERR_INDEX_MAXCOUNT:
797
- return 'System alrady has maximum allowed indeces.'
858
+ return 'System already has maximum allowed indices.'
798
859
 
799
860
  case exports.ERR_QUERY_ABORTED:
800
861
  return 'Query was aborted.'
@@ -803,7 +864,7 @@ exports.getMessage = function (code) {
803
864
  return 'Query processing queue is full.'
804
865
 
805
866
  case exports.ERR_QUERY_TIMEOUT:
806
- return 'SI query timed out on server.'
867
+ return 'Secondary index query timed out on server.'
807
868
 
808
869
  case exports.ERR_QUERY:
809
870
  return 'Generic query error.'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aerospike",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Aerospike Client Library",
5
5
  "keywords": [
6
6
  "aerospike",
@@ -41,8 +41,8 @@
41
41
  "preinstall": "npm install @mapbox/node-pre-gyp",
42
42
  "install": "npm-run-all removeExtraBinaries build",
43
43
  "build": "node-pre-gyp install --fallback-to-build",
44
- "test-prereq": "cd ts-test; npm install ..; run: npm i --save-dev @types/jest; run: npm i --save-dev @types/chai; cd ..;",
45
- "test": "rm -rf ts-test/dist; cd ts-test; npx tsc ; cp tests/udf.lua dist/udf.lua ; mocha dist/${npm_config_testfile:-} ",
44
+ "test-prereq": "cd ts-test; npm install ..; npm i --save-dev @types/jest; npm i --save-dev @types/chai; cd ..;",
45
+ "test": "cd ts-test; npx tsc ; cp tests/udf.lua dist/udf.lua ; mocha dist/${npm_config_testfile:-} ",
46
46
  "test-dry-run": "mocha --dry-run",
47
47
  "test-noserver": "GLOBAL_CLIENT=false mocha -g '#noserver'",
48
48
  "lint": "standard",
@@ -53,7 +53,7 @@
53
53
  "apidocs": "jsdoc -c jsdoc.json",
54
54
  "build-docs": "npx typedoc --plugin typedoc-plugin-rename-defaults --entryPointStrategy expand typings/index.d.ts",
55
55
  "cppcheck": "cppcheck --quiet --enable=warning,style -I src/include src/main/",
56
- "valgrind": "valgrind node ./node_modules/mocha/bin/_mocha -R dot -g '#slow' -i",
56
+ "valgrind": "cd ts-test; valgrind node ./node_modules/mocha/bin/_mocha -R dot -g '#slow' -i dist/${npm_config_testfile:-}",
57
57
  "prepare": "husky install",
58
58
  "removeExtraBinaries": "node ./scripts/prebuiltBinding.js"
59
59
  },
@@ -110,4 +110,4 @@
110
110
  "ts-test/",
111
111
  "typings/"
112
112
  ]
113
- }
113
+ }
@@ -0,0 +1,15 @@
1
+ const fs = require('fs')
2
+
3
+ // Path to package.json
4
+ const packageJsonPath = './package.json'
5
+
6
+ // Read and parse package.json
7
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
8
+
9
+ // Update the install script
10
+ packageJson.scripts.install = 'npm-run-all removeExtraBinaries build'
11
+
12
+ // Write the updated package.json back
13
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8')
14
+
15
+ console.log('Updated the install script in package.json successfully.')
@@ -31,7 +31,6 @@ Local<Object> abortStatus()
31
31
  Nan::EscapableHandleScope scope;
32
32
  Local<Object> obj = Nan::New<Object>();
33
33
  set(obj, "OK", AS_ABORT_OK);
34
- set(obj, "ALREADY_COMMITTED", AS_ABORT_ALREADY_COMMITTED);
35
34
  set(obj, "ALREADY_ABORTED", AS_ABORT_ALREADY_ABORTED);
36
35
  set(obj, "ROLL_BACK_ABANDONED", AS_ABORT_ROLL_BACK_ABANDONED);
37
36
  set(obj, "CLOSE_ABANDONED", AS_ABORT_CLOSE_ABANDONED);
@@ -32,7 +32,6 @@ Local<Object> commitStatus()
32
32
  Local<Object> obj = Nan::New<Object>();
33
33
  set(obj, "OK", AS_COMMIT_OK);
34
34
  set(obj, "ALREADY_COMMITTED", AS_COMMIT_ALREADY_COMMITTED);
35
- set(obj, "ALREADY_ABORTED", AS_COMMIT_ALREADY_ABORTED);
36
35
  set(obj, "VERIFY_FAILED", AS_COMMIT_VERIFY_FAILED);
37
36
  set(obj, "MARK_ROLL_FORWARD_ABANDONED", AS_COMMIT_MARK_ROLL_FORWARD_ABANDONED);
38
37
  set(obj, "ROLL_FORWARD_ABANDONED", AS_COMMIT_ROLL_FORWARD_ABANDONED);
@@ -30,12 +30,14 @@ Local<Object> status()
30
30
  {
31
31
  Nan::EscapableHandleScope scope;
32
32
  Local<Object> obj = Nan::New<Object>();
33
+ set(obj, "AEROSPIKE_TXN_ALREADY_ABORTED", AEROSPIKE_TXN_ALREADY_ABORTED);
34
+ set(obj, "AEROSPIKE_TXN_ALREADY_COMMITTED", AEROSPIKE_TXN_ALREADY_COMMITTED);
33
35
  set(obj, "AEROSPIKE_TXN_FAILED", AEROSPIKE_TXN_FAILED);
34
36
  set(obj, "AEROSPIKE_BATCH_FAILED", AEROSPIKE_BATCH_FAILED);
35
37
  set(obj, "AEROSPIKE_NO_RESPONSE", AEROSPIKE_NO_RESPONSE);
36
38
  set(obj, "AEROSPIKE_MAX_ERROR_RATE", AEROSPIKE_MAX_ERROR_RATE);
37
39
  set(obj, "AEROSPIKE_USE_NORMAL_RETRY", AEROSPIKE_USE_NORMAL_RETRY);
38
- set(obj, "AEROSPIKE_ERR_MAX_RETRIES_EXCEEDED", AEROSPIKE_USE_NORMAL_RETRY);
40
+ set(obj, "AEROSPIKE_ERR_MAX_RETRIES_EXCEEDED", AEROSPIKE_ERR_MAX_RETRIES_EXCEEDED);
39
41
  set(obj, "AEROSPIKE_ERR_ASYNC_QUEUE_FULL", AEROSPIKE_ERR_ASYNC_QUEUE_FULL);
40
42
  set(obj, "AEROSPIKE_ERR_CONNECTION", AEROSPIKE_ERR_CONNECTION);
41
43
  set(obj, "AEROSPIKE_ERR_TLS_ERROR", AEROSPIKE_ERR_TLS_ERROR);
@@ -89,8 +91,11 @@ Local<Object> status()
89
91
  set(obj, "AEROSPIKE_MRT_VERSION_MISMATCH", AEROSPIKE_MRT_VERSION_MISMATCH);
90
92
  set(obj, "AEROSPIKE_MRT_EXPIRED", AEROSPIKE_MRT_EXPIRED);
91
93
  set(obj, "AEROSPIKE_XDR_KEY_BUSY", AEROSPIKE_XDR_KEY_BUSY);
94
+ set(obj, "AEROSPIKE_MRT_TOO_MANY_WRITES", AEROSPIKE_MRT_TOO_MANY_WRITES);
92
95
  set(obj, "AEROSPIKE_MRT_COMMITTED", AEROSPIKE_MRT_COMMITTED);
93
96
  set(obj, "AEROSPIKE_MRT_ABORTED", AEROSPIKE_MRT_ABORTED);
97
+ set(obj, "AEROSPIKE_MRT_ALREADY_LOCKED", AEROSPIKE_MRT_ALREADY_LOCKED);
98
+ set(obj, "AEROSPIKE_MRT_MONITOR_EXISTS", AEROSPIKE_MRT_MONITOR_EXISTS);
94
99
  set(obj, "AEROSPIKE_QUERY_END", AEROSPIKE_QUERY_END);
95
100
  set(obj, "AEROSPIKE_SECURITY_NOT_SUPPORTED",
96
101
  AEROSPIKE_SECURITY_NOT_SUPPORTED);
@@ -115,6 +120,8 @@ Local<Object> status()
115
120
  set(obj, "AEROSPIKE_INVALID_QUOTA", AEROSPIKE_INVALID_QUOTA);
116
121
  set(obj, "AEROSPIKE_NOT_AUTHENTICATED", AEROSPIKE_NOT_AUTHENTICATED);
117
122
  set(obj, "AEROSPIKE_ROLE_VIOLATION", AEROSPIKE_ROLE_VIOLATION);
123
+ set(obj, "AEROSPIKE_NOT_WHITELISTED", AEROSPIKE_NOT_WHITELISTED);
124
+ set(obj, "AEROSPIKE_QUOTA_EXCEEDED", AEROSPIKE_QUOTA_EXCEEDED);
118
125
  set(obj, "AEROSPIKE_ERR_UDF", AEROSPIKE_ERR_UDF);
119
126
  set(obj, "AEROSPIKE_ERR_BATCH_DISABLED", AEROSPIKE_ERR_BATCH_DISABLED);
120
127
  set(obj, "AEROSPIKE_ERR_BATCH_MAX_REQUESTS_EXCEEDED",