couchbase 3.2.2 → 3.2.5

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 (129) hide show
  1. package/binding.gyp +5 -0
  2. package/deps/lcb/CMakeLists.txt +1 -1
  3. package/deps/lcb/CONTRIBUTING.md +1 -1
  4. package/deps/lcb/README.markdown +2 -2
  5. package/deps/lcb/RELEASE_NOTES.markdown +84 -17
  6. package/deps/lcb/cmake/Modules/GetVersionInfo.cmake +1 -1
  7. package/deps/lcb/contrib/cbsasl/src/scram-sha/scram_utils.cc +22 -26
  8. package/deps/lcb/contrib/lcb-jsoncpp/lcb-jsoncpp.cpp +20 -6
  9. package/deps/lcb/doc/Doxyfile +1 -1
  10. package/deps/lcb/example/minimal/query.c +9 -7
  11. package/deps/lcb/gyp_config/common/libcouchbase/configuration.h +3 -3
  12. package/deps/lcb/gyp_config/linux/arm64/config.h +243 -0
  13. package/deps/lcb/include/libcouchbase/couchbase.h +55 -1
  14. package/deps/lcb/include/libcouchbase/error.h +6 -1
  15. package/deps/lcb/include/libcouchbase/ixmgmt.h +15 -10
  16. package/deps/lcb/include/libcouchbase/tracing.h +2 -2
  17. package/deps/lcb/include/memcached/protocol_binary.h +21 -0
  18. package/deps/lcb/libcouchbase.gyp +353 -349
  19. package/deps/lcb/packaging/deb/control +1 -1
  20. package/deps/lcb/src/analytics/analytics_handle.cc +7 -5
  21. package/deps/lcb/src/analytics/analytics_handle.hh +28 -0
  22. package/deps/lcb/src/capi/cmd_counter.hh +18 -0
  23. package/deps/lcb/src/capi/cmd_exists.hh +18 -0
  24. package/deps/lcb/src/capi/cmd_get.hh +17 -0
  25. package/deps/lcb/src/capi/cmd_get_replica.hh +20 -1
  26. package/deps/lcb/src/capi/cmd_query.cc +13 -0
  27. package/deps/lcb/src/capi/cmd_query.hh +22 -14
  28. package/deps/lcb/src/capi/cmd_remove.hh +18 -0
  29. package/deps/lcb/src/capi/cmd_search.hh +6 -0
  30. package/deps/lcb/src/capi/cmd_store.hh +28 -21
  31. package/deps/lcb/src/capi/cmd_subdoc.hh +30 -0
  32. package/deps/lcb/src/capi/cmd_touch.hh +18 -0
  33. package/deps/lcb/src/capi/cmd_unlock.hh +18 -0
  34. package/deps/lcb/src/capi/cmd_view.hh +6 -0
  35. package/deps/lcb/src/capi/collection_qualifier.hh +6 -8
  36. package/deps/lcb/src/cntl.cc +42 -8
  37. package/deps/lcb/src/dns-srv.cc +5 -3
  38. package/deps/lcb/src/errmap.cc +5 -9
  39. package/deps/lcb/src/errmap.h +7 -3
  40. package/deps/lcb/src/handler.cc +24 -18
  41. package/deps/lcb/src/internal.h +2 -1
  42. package/deps/lcb/src/lcbio/ctx.cc +4 -2
  43. package/deps/lcb/src/mcserver/mcserver.cc +8 -5
  44. package/deps/lcb/src/mcserver/negotiate.cc +42 -17
  45. package/deps/lcb/src/n1ql/ixmgmt.cc +1 -2
  46. package/deps/lcb/src/n1ql/n1ql.cc +5 -1
  47. package/deps/lcb/src/n1ql/query_handle.cc +80 -44
  48. package/deps/lcb/src/n1ql/query_handle.hh +41 -3
  49. package/deps/lcb/src/operations/counter.cc +13 -1
  50. package/deps/lcb/src/operations/exists.cc +14 -2
  51. package/deps/lcb/src/operations/get.cc +14 -2
  52. package/deps/lcb/src/operations/get_replica.cc +18 -6
  53. package/deps/lcb/src/operations/observe.cc +1 -1
  54. package/deps/lcb/src/operations/remove.cc +13 -1
  55. package/deps/lcb/src/operations/store.cc +13 -1
  56. package/deps/lcb/src/operations/subdoc.cc +13 -2
  57. package/deps/lcb/src/operations/touch.cc +14 -2
  58. package/deps/lcb/src/operations/unlock.cc +14 -2
  59. package/deps/lcb/src/search/search_handle.cc +26 -8
  60. package/deps/lcb/src/search/search_handle.hh +29 -0
  61. package/deps/lcb/src/ssl/ssl_common.c +7 -8
  62. package/deps/lcb/src/tracing/span.cc +43 -10
  63. package/deps/lcb/src/tracing/tracing-internal.h +105 -93
  64. package/deps/lcb/src/utilities.cc +21 -0
  65. package/deps/lcb/src/utilities.h +3 -0
  66. package/deps/lcb/src/views/view_handle.cc +13 -5
  67. package/deps/lcb/src/views/view_handle.hh +29 -0
  68. package/deps/lcb/tests/CMakeLists.txt +21 -0
  69. package/deps/lcb/tests/basic/t_ctlcodes.cc +24 -3
  70. package/deps/lcb/tests/basic/t_jsparse.cc +8 -0
  71. package/deps/lcb/tests/iotests/mock-environment.cc +25 -1
  72. package/deps/lcb/tests/iotests/mock-environment.h +49 -1
  73. package/deps/lcb/tests/iotests/mock-unit-test.cc +96 -5
  74. package/deps/lcb/tests/iotests/mock-unit-test.h +32 -0
  75. package/deps/lcb/tests/iotests/serverparams.h +7 -2
  76. package/deps/lcb/tests/iotests/t_collections.cc +1 -1
  77. package/deps/lcb/tests/iotests/t_confmon.cc +4 -2
  78. package/deps/lcb/tests/iotests/t_get.cc +14 -4
  79. package/deps/lcb/tests/iotests/t_n1ql.cc +17 -1
  80. package/deps/lcb/tests/iotests/t_ratelimit.cc +729 -0
  81. package/deps/lcb/tests/iotests/t_views.cc +1 -0
  82. package/deps/lcb/tests/iotests/testutil.cc +342 -0
  83. package/deps/lcb/tests/iotests/testutil.h +164 -0
  84. package/deps/lcb/tests/mocksupport/procutil.c +32 -28
  85. package/deps/lcb/tests/mocksupport/server.c +0 -1
  86. package/deps/lcb/tools/cbc.cc +7 -0
  87. package/dist/analyticsexecutor.js +2 -2
  88. package/dist/analyticsindexmanager.js +512 -524
  89. package/dist/binarycollection.d.ts +17 -0
  90. package/dist/binding.d.ts +2 -0
  91. package/dist/binding.js +1 -1
  92. package/dist/bindingutilities.js +9 -1
  93. package/dist/bucketmanager.d.ts +32 -23
  94. package/dist/bucketmanager.js +197 -189
  95. package/dist/cluster.js +37 -36
  96. package/dist/collection.js +17 -23
  97. package/dist/collectionmanager.js +181 -200
  98. package/dist/connection.js +6 -3
  99. package/dist/connspec.js +5 -1
  100. package/dist/couchbase.js +7 -14
  101. package/dist/datastructures.js +239 -310
  102. package/dist/diagnosticsexecutor.js +70 -85
  103. package/dist/errors.d.ts +18 -0
  104. package/dist/errors.js +26 -2
  105. package/dist/eventingfunctionmanager.js +267 -294
  106. package/dist/httpexecutor.js +31 -38
  107. package/dist/logging.js +1 -1
  108. package/dist/queryexecutor.js +3 -3
  109. package/dist/queryindexmanager.js +236 -263
  110. package/dist/scope.js +8 -2
  111. package/dist/searchexecutor.js +3 -0
  112. package/dist/searchindexmanager.js +240 -271
  113. package/dist/searchquery.d.ts +17 -0
  114. package/dist/searchquery.js +22 -1
  115. package/dist/searchtypes.d.ts +7 -2
  116. package/dist/searchtypes.js +2 -2
  117. package/dist/usermanager.js +250 -263
  118. package/dist/utilities.d.ts +3 -2
  119. package/dist/utilities.js +16 -4
  120. package/dist/viewexecutor.js +1 -1
  121. package/dist/viewindexmanager.js +131 -150
  122. package/package.json +1 -1
  123. package/src/connection.cpp +2 -0
  124. package/src/constants.cpp +2 -0
  125. package/src/instance.cpp +8 -1
  126. package/src/instance.h +1 -0
  127. package/src/uv-plugin-all.cpp +1 -0
  128. package/dist/cas.d.ts +0 -0
  129. package/dist/cas.js +0 -1
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Collection } from './collection';
3
3
  import { CounterResult, MutationResult } from './crudoptypes';
4
+ import { DurabilityLevel } from './generaltypes';
4
5
  import { RequestSpan } from './tracing';
5
6
  import { NodeCallback } from './utilities';
6
7
  /**
@@ -17,6 +18,10 @@ export interface IncrementOptions {
17
18
  * The expiry time that should be set for the document, expressed in seconds.
18
19
  */
19
20
  expiry?: number;
21
+ /**
22
+ * Specifies the level of synchronous durability for this operation.
23
+ */
24
+ durabilityLevel?: DurabilityLevel;
20
25
  /**
21
26
  * The parent tracing span that this operation will be part of.
22
27
  */
@@ -40,6 +45,10 @@ export interface DecrementOptions {
40
45
  * The expiry time that should be set for the document, expressed in seconds.
41
46
  */
42
47
  expiry?: number;
48
+ /**
49
+ * Specifies the level of synchronous durability for this operation.
50
+ */
51
+ durabilityLevel?: DurabilityLevel;
43
52
  /**
44
53
  * The parent tracing span that this operation will be part of.
45
54
  */
@@ -53,6 +62,10 @@ export interface DecrementOptions {
53
62
  * @category Key-Value
54
63
  */
55
64
  export interface AppendOptions {
65
+ /**
66
+ * Specifies the level of synchronous durability for this operation.
67
+ */
68
+ durabilityLevel?: DurabilityLevel;
56
69
  /**
57
70
  * The parent tracing span that this operation will be part of.
58
71
  */
@@ -66,6 +79,10 @@ export interface AppendOptions {
66
79
  * @category Key-Value
67
80
  */
68
81
  export interface PrependOptions {
82
+ /**
83
+ * Specifies the level of synchronous durability for this operation.
84
+ */
85
+ durabilityLevel?: DurabilityLevel;
69
86
  /**
70
87
  * The parent tracing span that this operation will be part of.
71
88
  */
package/dist/binding.d.ts CHANGED
@@ -184,6 +184,8 @@ export interface CppBinding {
184
184
  LCB_ERR_SCOPE_NOT_FOUND: CppErrType;
185
185
  LCB_ERR_INDEX_NOT_FOUND: CppErrType;
186
186
  LCB_ERR_INDEX_EXISTS: CppErrType;
187
+ LCB_ERR_RATE_LIMITED: CppErrType;
188
+ LCB_ERR_QUOTA_LIMITED: CppErrType;
187
189
  LCB_ERR_DOCUMENT_NOT_FOUND: CppErrType;
188
190
  LCB_ERR_DOCUMENT_UNRETRIEVABLE: CppErrType;
189
191
  LCB_ERR_DOCUMENT_LOCKED: CppErrType;
package/dist/binding.js CHANGED
@@ -67,5 +67,5 @@ var CppAnalyticsQueryRespFlags;
67
67
  (function (CppAnalyticsQueryRespFlags) {
68
68
  })(CppAnalyticsQueryRespFlags = exports.CppAnalyticsQueryRespFlags || (exports.CppAnalyticsQueryRespFlags = {}));
69
69
  // Load it with require
70
- const binding = bindings_1.default('couchbase_impl');
70
+ const binding = (0, bindings_1.default)('couchbase_impl');
71
71
  exports.default = binding;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -214,6 +218,10 @@ function translateCppError(err) {
214
218
  return new errs.IndexNotFoundError(codeErr, context);
215
219
  case binding_1.default.LCB_ERR_INDEX_EXISTS:
216
220
  return new errs.IndexExistsError(codeErr, context);
221
+ case binding_1.default.LCB_ERR_RATE_LIMITED:
222
+ return new errs.RateLimitedError(codeErr, context);
223
+ case binding_1.default.LCB_ERR_QUOTA_LIMITED:
224
+ return new errs.QuotaLimitedError(codeErr, context);
217
225
  /* KeyValue Error Definitions */
218
226
  case binding_1.default.LCB_ERR_DOCUMENT_NOT_FOUND:
219
227
  return new errs.DocumentNotFoundError(codeErr, context);
@@ -18,7 +18,14 @@ export declare enum ConflictResolutionType {
18
18
  /**
19
19
  * Indicates that the seqno of the document should be used for conflict resolution.
20
20
  */
21
- SequenceNumber = "seqno"
21
+ SequenceNumber = "seqno",
22
+ /**
23
+ * Indicates that custom conflict resolution should be used.
24
+ *
25
+ * @experimental This mode is only available in Couchbase Server 7.1 with the
26
+ * "developer-preview" mode enabled.
27
+ */
28
+ Custom = "custom"
22
29
  }
23
30
  /**
24
31
  * Represents the type of a bucket.
@@ -39,6 +46,21 @@ export declare enum BucketType {
39
46
  */
40
47
  Ephemeral = "ephemeral"
41
48
  }
49
+ /**
50
+ * Represents the storage backend to use for a bucket.
51
+ *
52
+ * @category Management
53
+ */
54
+ export declare enum StorageBackend {
55
+ /**
56
+ * Indicates the bucket should use the Couchstore storage engine.
57
+ */
58
+ Couchstore = "couchstore",
59
+ /**
60
+ * Indicates the bucket should use the Magma storage engine.
61
+ */
62
+ Magma = "magma"
63
+ }
42
64
  /**
43
65
  * Represents the eviction policy that should be used for a bucket.
44
66
  *
@@ -117,6 +139,10 @@ export interface IBucketSettings {
117
139
  * Specifies the type of bucket that should be used.
118
140
  */
119
141
  bucketType: BucketType | string;
142
+ /**
143
+ * Specifies the storage backend to use for the bucket.
144
+ */
145
+ storageBackend: StorageBackend | string;
120
146
  /**
121
147
  * Specifies the ejection method that should be used.
122
148
  */
@@ -189,6 +215,10 @@ export declare class BucketSettings implements IBucketSettings {
189
215
  * Specifies the type of bucket that should be used.
190
216
  */
191
217
  bucketType: BucketType;
218
+ /**
219
+ * Specifies the storage backend to use for the bucket.
220
+ */
221
+ storageBackend: StorageBackend | string;
192
222
  /**
193
223
  * Specifies the ejection method that should be used.
194
224
  */
@@ -253,26 +283,6 @@ export interface ICreateBucketSettings extends IBucketSettings {
253
283
  */
254
284
  conflictResolutionType: ConflictResolutionType | string;
255
285
  }
256
- /**
257
- * We intentionally do not export this class as it is never returned back
258
- * to the user, but we still need the ability to translate to NS data.
259
- *
260
- * @internal
261
- */
262
- declare class CreateBucketSettings extends BucketSettings implements ICreateBucketSettings {
263
- /**
264
- * Specifies the conflict resolution mode to use for XDCR of this bucket.
265
- */
266
- conflictResolutionType: ConflictResolutionType;
267
- /**
268
- * @internal
269
- */
270
- constructor(data: CreateBucketSettings);
271
- /**
272
- * @internal
273
- */
274
- static _toNsData(data: ICreateBucketSettings): any;
275
- }
276
286
  /**
277
287
  * @category Management
278
288
  */
@@ -371,7 +381,7 @@ export declare class BucketManager {
371
381
  * @param options Optional parameters for this operation.
372
382
  * @param callback A node-style callback to be invoked after execution.
373
383
  */
374
- createBucket(settings: CreateBucketSettings, options?: CreateBucketOptions, callback?: NodeCallback<void>): Promise<void>;
384
+ createBucket(settings: ICreateBucketSettings, options?: CreateBucketOptions, callback?: NodeCallback<void>): Promise<void>;
375
385
  /**
376
386
  * Updates the settings for an existing bucket.
377
387
  *
@@ -412,4 +422,3 @@ export declare class BucketManager {
412
422
  */
413
423
  flushBucket(bucketName: string, options?: FlushBucketOptions, callback?: NodeCallback<void>): Promise<void>;
414
424
  }
415
- export {};