couchbase 3.2.3 → 3.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/deps/lcb/CMakeLists.txt +1 -1
  2. package/deps/lcb/CONTRIBUTING.md +1 -1
  3. package/deps/lcb/README.markdown +2 -2
  4. package/deps/lcb/RELEASE_NOTES.markdown +72 -17
  5. package/deps/lcb/cmake/Modules/GetVersionInfo.cmake +1 -1
  6. package/deps/lcb/contrib/cbsasl/src/scram-sha/scram_utils.cc +22 -26
  7. package/deps/lcb/contrib/lcb-jsoncpp/lcb-jsoncpp.cpp +20 -6
  8. package/deps/lcb/doc/Doxyfile +1 -1
  9. package/deps/lcb/example/minimal/query.c +9 -7
  10. package/deps/lcb/gyp_config/common/libcouchbase/configuration.h +3 -3
  11. package/deps/lcb/include/libcouchbase/couchbase.h +3 -1
  12. package/deps/lcb/include/libcouchbase/error.h +2 -0
  13. package/deps/lcb/include/libcouchbase/ixmgmt.h +15 -10
  14. package/deps/lcb/include/libcouchbase/tracing.h +2 -2
  15. package/deps/lcb/include/memcached/protocol_binary.h +21 -0
  16. package/deps/lcb/libcouchbase.gyp +347 -349
  17. package/deps/lcb/packaging/deb/control +1 -1
  18. package/deps/lcb/src/analytics/analytics_handle.cc +7 -5
  19. package/deps/lcb/src/analytics/analytics_handle.hh +28 -0
  20. package/deps/lcb/src/capi/cmd_counter.hh +6 -0
  21. package/deps/lcb/src/capi/cmd_exists.hh +6 -0
  22. package/deps/lcb/src/capi/cmd_get.hh +5 -0
  23. package/deps/lcb/src/capi/cmd_get_replica.hh +6 -0
  24. package/deps/lcb/src/capi/cmd_remove.hh +6 -0
  25. package/deps/lcb/src/capi/cmd_search.hh +6 -0
  26. package/deps/lcb/src/capi/cmd_store.hh +16 -21
  27. package/deps/lcb/src/capi/cmd_subdoc.hh +18 -0
  28. package/deps/lcb/src/capi/cmd_touch.hh +6 -0
  29. package/deps/lcb/src/capi/cmd_unlock.hh +6 -0
  30. package/deps/lcb/src/capi/cmd_view.hh +6 -0
  31. package/deps/lcb/src/capi/collection_qualifier.hh +2 -2
  32. package/deps/lcb/src/cntl.cc +42 -8
  33. package/deps/lcb/src/dns-srv.cc +5 -3
  34. package/deps/lcb/src/errmap.cc +5 -9
  35. package/deps/lcb/src/errmap.h +7 -3
  36. package/deps/lcb/src/handler.cc +24 -18
  37. package/deps/lcb/src/lcbio/ctx.cc +4 -2
  38. package/deps/lcb/src/mcserver/mcserver.cc +8 -5
  39. package/deps/lcb/src/mcserver/negotiate.cc +39 -17
  40. package/deps/lcb/src/n1ql/ixmgmt.cc +1 -2
  41. package/deps/lcb/src/n1ql/query_handle.cc +27 -16
  42. package/deps/lcb/src/n1ql/query_handle.hh +27 -1
  43. package/deps/lcb/src/operations/counter.cc +1 -1
  44. package/deps/lcb/src/operations/exists.cc +2 -2
  45. package/deps/lcb/src/operations/get.cc +2 -2
  46. package/deps/lcb/src/operations/observe.cc +1 -1
  47. package/deps/lcb/src/operations/remove.cc +1 -1
  48. package/deps/lcb/src/operations/store.cc +1 -1
  49. package/deps/lcb/src/operations/subdoc.cc +1 -2
  50. package/deps/lcb/src/operations/touch.cc +2 -2
  51. package/deps/lcb/src/operations/unlock.cc +2 -2
  52. package/deps/lcb/src/search/search_handle.cc +27 -8
  53. package/deps/lcb/src/search/search_handle.hh +29 -0
  54. package/deps/lcb/src/ssl/ssl_common.c +6 -7
  55. package/deps/lcb/src/tracing/span.cc +43 -10
  56. package/deps/lcb/src/tracing/tracing-internal.h +105 -93
  57. package/deps/lcb/src/views/view_handle.cc +13 -5
  58. package/deps/lcb/src/views/view_handle.hh +29 -0
  59. package/deps/lcb/tests/CMakeLists.txt +21 -0
  60. package/deps/lcb/tests/basic/t_ctlcodes.cc +24 -3
  61. package/deps/lcb/tests/basic/t_jsparse.cc +8 -0
  62. package/deps/lcb/tests/iotests/mock-environment.cc +15 -0
  63. package/deps/lcb/tests/iotests/mock-environment.h +47 -0
  64. package/deps/lcb/tests/iotests/mock-unit-test.cc +96 -5
  65. package/deps/lcb/tests/iotests/mock-unit-test.h +32 -0
  66. package/deps/lcb/tests/iotests/t_collections.cc +1 -1
  67. package/deps/lcb/tests/iotests/t_confmon.cc +4 -2
  68. package/deps/lcb/tests/iotests/t_get.cc +14 -4
  69. package/deps/lcb/tests/iotests/t_n1ql.cc +17 -1
  70. package/deps/lcb/tests/iotests/t_views.cc +1 -0
  71. package/deps/lcb/tests/iotests/testutil.cc +168 -0
  72. package/deps/lcb/tests/iotests/testutil.h +111 -0
  73. package/deps/lcb/tests/mocksupport/procutil.c +32 -28
  74. package/deps/lcb/tests/mocksupport/server.c +0 -1
  75. package/deps/lcb/tools/cbc.cc +7 -0
  76. package/dist/analyticsindexmanager.js +3 -3
  77. package/dist/binding.d.ts +2 -0
  78. package/dist/bindingutilities.js +4 -0
  79. package/dist/bucketmanager.d.ts +31 -1
  80. package/dist/bucketmanager.js +28 -2
  81. package/dist/collection.js +2 -2
  82. package/dist/collectionmanager.js +2 -2
  83. package/dist/connection.js +3 -0
  84. package/dist/errors.d.ts +18 -0
  85. package/dist/errors.js +26 -2
  86. package/dist/eventingfunctionmanager.js +6 -6
  87. package/dist/queryindexmanager.js +3 -3
  88. package/dist/searchexecutor.js +3 -0
  89. package/dist/searchindexmanager.js +1 -1
  90. package/dist/searchquery.d.ts +17 -0
  91. package/dist/searchquery.js +22 -1
  92. package/dist/searchtypes.d.ts +7 -2
  93. package/dist/searchtypes.js +2 -2
  94. package/dist/usermanager.js +1 -1
  95. package/dist/viewindexmanager.js +1 -1
  96. package/package.json +1 -1
  97. package/src/connection.cpp +2 -0
  98. package/src/constants.cpp +2 -0
  99. package/src/instance.cpp +8 -1
  100. package/src/instance.h +1 -0
package/package.json CHANGED
@@ -1 +1 @@
1
- {"bugs":{"url":"http://www.couchbase.com/issues/browse/JSCBC"},"description":"The official Couchbase Node.js Client Library.","engines":{"node":">=10.0.0"},"homepage":"http://www.couchbase.com/communities/nodejs","keywords":["couchbase","libcouchbase","memcached","nosql","json","document"],"main":"dist/couchbase.js","types":"dist/couchbase.d.ts","license":"Apache-2.0","name":"couchbase","dependencies":{"bindings":"^1.5.0","debug":"^4.3.2","nan":"^2.15.0","parse-duration":"^1.0.0","prebuild-install":"^6.1.4"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^2.0.4","@tsconfig/node10":"^1.0.8","@types/bindings":"^1.5.1","@types/debug":"^4.1.7","@types/node":"^16.7.2","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","chai":"^4.3.4","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^36.0.8","eslint-plugin-mocha":"^9.0.0","eslint-plugin-node":"^11.1.0","expose-gc":"^1.0.0","mocha":"^8.4.0","npm-check-updates":"^11.8.3","nyc":"^15.1.0","prebuild":"^10.0.1","prettier":"^2.3.2","semver":"^7.3.5","ts-mocha":"^8.0.0","ts-node":"^10.2.1","typedoc":"^0.21.6","typescript":"^4.3.5","uuid":"^8.3.2"},"repository":{"type":"git","url":"http://github.com/couchbase/couchnode.git"},"version":"3.2.3","config":{"native":false},"scripts":{"install":"prebuild-install || node-gyp rebuild","build":"node-gyp build && tsc","rebuild":"node-gyp rebuild && tsc","prebuild":"prebuild --verbose --strip","prepare":"tsc","build-docs":"typedoc","test":"ts-mocha test/*.test.*","test-fast":"ts-mocha test/*.test.* -ig '(slow)'","cover":"nyc ts-mocha test/*.test.*","cover-fast":"nyc ts-mocha test/*.test.* -ig '(slow)'","lint":"eslint ./lib/ ./test/","check-deps":"ncu"}}
1
+ {"bugs":{"url":"http://www.couchbase.com/issues/browse/JSCBC"},"description":"The official Couchbase Node.js Client Library.","engines":{"node":">=10.0.0"},"homepage":"http://www.couchbase.com/communities/nodejs","keywords":["couchbase","libcouchbase","memcached","nosql","json","document"],"main":"dist/couchbase.js","types":"dist/couchbase.d.ts","license":"Apache-2.0","name":"couchbase","dependencies":{"bindings":"^1.5.0","debug":"^4.3.2","nan":"^2.15.0","parse-duration":"^1.0.0","prebuild-install":"^6.1.4"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^2.0.4","@tsconfig/node10":"^1.0.8","@types/bindings":"^1.5.1","@types/debug":"^4.1.7","@types/node":"^16.7.2","@typescript-eslint/eslint-plugin":"^4.29.3","@typescript-eslint/parser":"^4.29.3","chai":"^4.3.4","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^36.0.8","eslint-plugin-mocha":"^9.0.0","eslint-plugin-node":"^11.1.0","expose-gc":"^1.0.0","mocha":"^8.4.0","npm-check-updates":"^11.8.3","nyc":"^15.1.0","prebuild":"^10.0.1","prettier":"^2.3.2","segfault-handler":"^1.3.0","semver":"^7.3.5","ts-mocha":"^8.0.0","ts-node":"^10.2.1","typedoc":"^0.21.6","typescript":"^4.3.5","uuid":"^8.3.2"},"repository":{"type":"git","url":"http://github.com/couchbase/couchnode.git"},"version":"3.2.4","config":{"native":false},"scripts":{"install":"prebuild-install || node-gyp rebuild","build":"node-gyp build && tsc","rebuild":"node-gyp rebuild && tsc","prebuild":"prebuild --verbose --strip","prepare":"tsc","build-docs":"typedoc","test":"ts-mocha test/*.test.*","test-fast":"ts-mocha test/*.test.* -ig '(slow)'","cover":"nyc ts-mocha test/*.test.*","cover-fast":"nyc ts-mocha test/*.test.* -ig '(slow)'","lint":"eslint ./lib/ ./test/","check-deps":"ncu"}}
@@ -207,6 +207,8 @@ NAN_METHOD(Connection::fnNew)
207
207
  Connection *obj = new Connection(inst);
208
208
  obj->Wrap(info.This());
209
209
 
210
+ inst->_connection = obj;
211
+
210
212
  info.GetReturnValue().Set(info.This());
211
213
  }
212
214
 
package/src/constants.cpp CHANGED
@@ -67,6 +67,8 @@ NAN_MODULE_INIT(Init)
67
67
  X(LCB_ERR_SCOPE_NOT_FOUND)
68
68
  X(LCB_ERR_INDEX_NOT_FOUND)
69
69
  X(LCB_ERR_INDEX_EXISTS)
70
+ X(LCB_ERR_RATE_LIMITED)
71
+ X(LCB_ERR_QUOTA_LIMITED)
70
72
  X(LCB_ERR_DOCUMENT_NOT_FOUND)
71
73
  X(LCB_ERR_DOCUMENT_UNRETRIEVABLE)
72
74
  X(LCB_ERR_DOCUMENT_LOCKED)
package/src/instance.cpp CHANGED
@@ -1,4 +1,5 @@
1
1
  #include "instance.h"
2
+ #include "connection.h"
2
3
 
3
4
  #include "error.h"
4
5
  #include "logger.h"
@@ -8,7 +9,8 @@ namespace couchnode
8
9
 
9
10
  Instance::Instance(lcb_INSTANCE *instance, Logger *logger,
10
11
  RequestTracer *tracer, Meter *meter)
11
- : _instance(instance)
12
+ : _connection(nullptr)
13
+ , _instance(instance)
12
14
  , _logger(logger)
13
15
  , _tracer(tracer)
14
16
  , _meter(meter)
@@ -73,6 +75,11 @@ Instance::Instance(lcb_INSTANCE *instance, Logger *logger,
73
75
 
74
76
  Instance::~Instance()
75
77
  {
78
+ if (_connection) {
79
+ _connection->_instance = nullptr;
80
+ _connection = nullptr;
81
+ }
82
+
76
83
  if (_parent) {
77
84
  _parent->remove_instance(this);
78
85
  _parent = nullptr;
package/src/instance.h CHANGED
@@ -84,6 +84,7 @@ public:
84
84
  const lcb_RESPHTTP *resp);
85
85
 
86
86
  AddonData *_parent;
87
+ class Connection *_connection;
87
88
  lcb_INSTANCE *_instance;
88
89
  Logger *_logger;
89
90
  RequestTracer *_tracer;