couchbase 3.2.3 → 3.2.4

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 (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
@@ -20,8 +20,6 @@
20
20
  #include <stdio.h>
21
21
 
22
22
  #ifndef _WIN32
23
- #define _XOPEN_SOURCE
24
- #include <stdlib.h>
25
23
  #include <string.h>
26
24
  #include <wordexp.h>
27
25
  #include <fcntl.h> /* O_* */
@@ -51,6 +49,7 @@ static char **clisplit(const char *s)
51
49
  ret[ii] = strdup(p.we_wordv[ii]);
52
50
  }
53
51
  ret[ii] = NULL;
52
+ wordfree(&p);
54
53
  return ret;
55
54
  }
56
55
 
@@ -59,39 +58,44 @@ static int spawn_process_impl(child_process_t *proc)
59
58
  int rv;
60
59
  char **argv;
61
60
 
62
- proc->pid = fork();
63
- if (proc->pid < 0) {
61
+ argv = clisplit(proc->name);
62
+ if (argv == NULL) {
63
+ fprintf(stderr, "Couldn't split arguments: %s\n", proc->name);
64
64
  return -1;
65
65
  }
66
- if (proc->pid > 0) {
67
- return 0;
68
- }
69
-
70
- /** In Child */
71
- argv = clisplit(proc->name);
72
- if (!argv) {
73
- fprintf(stderr, "Couldn't split arguments\n");
74
- exit(EXIT_FAILURE);
66
+ proc->pid = vfork();
67
+ if (proc->pid < 0) {
68
+ for (int i = 0; argv[i] != NULL; ++i) {
69
+ free(argv[i]);
70
+ }
71
+ free(argv);
72
+ return -1;
75
73
  }
76
- if (proc->redirect) {
77
- int fd = open(proc->redirect, O_RDWR | O_CREAT | O_APPEND, 0644);
78
- if (fd < 0) {
79
- perror(proc->redirect);
80
- exit(EXIT_FAILURE);
74
+ if (proc->pid == 0) {
75
+ /** In Child */
76
+ if (proc->redirect) {
77
+ int fd = open(proc->redirect, O_RDWR | O_CREAT | O_APPEND, 0644);
78
+ if (fd < 0) {
79
+ perror(proc->redirect);
80
+ exit(EXIT_FAILURE);
81
+ }
82
+ if (dup2(fd, fileno(stderr)) < 0 || dup2(fd, fileno(stdout)) < 0) {
83
+ perror("dup2");
84
+ exit(EXIT_FAILURE);
85
+ }
86
+ setvbuf(stderr, NULL, _IOLBF, 0);
81
87
  }
82
- if (dup2(fd, fileno(stderr)) < 0 || dup2(fd, fileno(stdout)) < 0) {
83
- perror("dup2");
84
- exit(EXIT_FAILURE);
88
+ rv = execvp(argv[0], argv);
89
+ if (rv < 0) {
90
+ perror(argv[0]);
91
+ return -1;
85
92
  }
86
- setvbuf(stderr, NULL, _IOLBF, 0);
87
93
  }
88
- rv = execvp(argv[0], argv);
89
- if (rv < 0) {
90
- perror(argv[0]);
91
- exit(EXIT_FAILURE);
94
+ for (int i = 0; argv[i] != NULL; ++i) {
95
+ free(argv[i]);
92
96
  }
93
- abort();
94
- return 0; /* make things happy */
97
+ free(argv);
98
+ return 0;
95
99
  }
96
100
 
97
101
  void kill_process(child_process_t *process, int force)
@@ -296,7 +296,6 @@ static int start_mock_server(struct test_server_info *info, char **cmdline)
296
296
 
297
297
  start_mock_process(info, argv);
298
298
  negotiate_mock_connection(info);
299
- sleep(1); /* give it a bit time to initialize itself */
300
299
  return 1;
301
300
  }
302
301
 
@@ -1273,6 +1273,13 @@ void VersionHandler::run()
1273
1273
  #endif
1274
1274
  printf(" SSL Headers: %s\n", OPENSSL_VERSION_TEXT);
1275
1275
  #endif
1276
+ printf(" HAVE_PKCS5_PBKDF2_HMAC: "
1277
+ #ifdef HAVE_PKCS5_PBKDF2_HMAC
1278
+ "yes"
1279
+ #else
1280
+ "no"
1281
+ #endif
1282
+ "\n");
1276
1283
  } else {
1277
1284
  printf(" SSL: NOT SUPPORTED\n");
1278
1285
  }
@@ -786,7 +786,7 @@ class AnalyticsIndexManager {
786
786
  */
787
787
  async createLink(link, options, callback) {
788
788
  if (options instanceof Function) {
789
- callback = arguments[0];
789
+ callback = arguments[1];
790
790
  options = undefined;
791
791
  }
792
792
  if (!options) {
@@ -830,7 +830,7 @@ class AnalyticsIndexManager {
830
830
  */
831
831
  async replaceLink(link, options, callback) {
832
832
  if (options instanceof Function) {
833
- callback = arguments[0];
833
+ callback = arguments[1];
834
834
  options = undefined;
835
835
  }
836
836
  if (!options) {
@@ -875,7 +875,7 @@ class AnalyticsIndexManager {
875
875
  */
876
876
  async dropLink(linkName, dataverseName, options, callback) {
877
877
  if (options instanceof Function) {
878
- callback = arguments[0];
878
+ callback = arguments[2];
879
879
  options = undefined;
880
880
  }
881
881
  if (!options) {
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;
@@ -214,6 +214,10 @@ function translateCppError(err) {
214
214
  return new errs.IndexNotFoundError(codeErr, context);
215
215
  case binding_1.default.LCB_ERR_INDEX_EXISTS:
216
216
  return new errs.IndexExistsError(codeErr, context);
217
+ case binding_1.default.LCB_ERR_RATE_LIMITED:
218
+ return new errs.RateLimitedError(codeErr, context);
219
+ case binding_1.default.LCB_ERR_QUOTA_LIMITED:
220
+ return new errs.QuotaLimitedError(codeErr, context);
217
221
  /* KeyValue Error Definitions */
218
222
  case binding_1.default.LCB_ERR_DOCUMENT_NOT_FOUND:
219
223
  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
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BucketManager = exports.BucketSettings = exports.CompressionMode = exports.EvictionPolicy = exports.BucketType = exports.ConflictResolutionType = void 0;
3
+ exports.BucketManager = exports.BucketSettings = exports.CompressionMode = exports.EvictionPolicy = exports.StorageBackend = exports.BucketType = exports.ConflictResolutionType = void 0;
4
4
  const errors_1 = require("./errors");
5
5
  const httpexecutor_1 = require("./httpexecutor");
6
6
  const utilities_1 = require("./utilities");
@@ -22,6 +22,13 @@ var ConflictResolutionType;
22
22
  * Indicates that the seqno of the document should be used for conflict resolution.
23
23
  */
24
24
  ConflictResolutionType["SequenceNumber"] = "seqno";
25
+ /**
26
+ * Indicates that custom conflict resolution should be used.
27
+ *
28
+ * @experimental This mode is only available in Couchbase Server 7.1 with the
29
+ * "developer-preview" mode enabled.
30
+ */
31
+ ConflictResolutionType["Custom"] = "custom";
25
32
  })(ConflictResolutionType = exports.ConflictResolutionType || (exports.ConflictResolutionType = {}));
26
33
  /**
27
34
  * Represents the type of a bucket.
@@ -43,6 +50,22 @@ var BucketType;
43
50
  */
44
51
  BucketType["Ephemeral"] = "ephemeral";
45
52
  })(BucketType = exports.BucketType || (exports.BucketType = {}));
53
+ /**
54
+ * Represents the storage backend to use for a bucket.
55
+ *
56
+ * @category Management
57
+ */
58
+ var StorageBackend;
59
+ (function (StorageBackend) {
60
+ /**
61
+ * Indicates the bucket should use the Couchstore storage engine.
62
+ */
63
+ StorageBackend["Couchstore"] = "couchstore";
64
+ /**
65
+ * Indicates the bucket should use the Magma storage engine.
66
+ */
67
+ StorageBackend["Magma"] = "magma";
68
+ })(StorageBackend = exports.StorageBackend || (exports.StorageBackend = {}));
46
69
  /**
47
70
  * Represents the eviction policy that should be used for a bucket.
48
71
  *
@@ -106,6 +129,7 @@ class BucketSettings {
106
129
  this.numReplicas = data.numReplicas;
107
130
  this.replicaIndexes = data.replicaIndexes;
108
131
  this.bucketType = data.bucketType;
132
+ this.storageBackend = data.storageBackend;
109
133
  this.evictionPolicy = data.evictionPolicy;
110
134
  this.maxExpiry = data.maxExpiry;
111
135
  this.compressionMode = data.compressionMode;
@@ -153,6 +177,7 @@ class BucketSettings {
153
177
  replicaNumber: data.numReplicas,
154
178
  replicaIndexes: data.replicaIndexes,
155
179
  bucketType: data.bucketType,
180
+ storageBackend: data.storageBackend,
156
181
  evictionPolicy: data.evictionPolicy,
157
182
  maxTTL: data.maxTTL || data.maxExpiry,
158
183
  compressionMode: data.compressionMode,
@@ -171,6 +196,7 @@ class BucketSettings {
171
196
  numReplicas: data.replicaNumber,
172
197
  replicaIndexes: data.replicaIndexes,
173
198
  bucketType: data.bucketType,
199
+ storageBackend: data.storageBackend,
174
200
  evictionPolicy: data.evictionPolicy,
175
201
  maxExpiry: data.maxTTL,
176
202
  compressionMode: data.compressionMode,
@@ -378,7 +404,7 @@ class BucketManager {
378
404
  */
379
405
  async getAllBuckets(options, callback) {
380
406
  if (options instanceof Function) {
381
- callback = arguments[1];
407
+ callback = arguments[0];
382
408
  options = undefined;
383
409
  }
384
410
  if (!options) {
@@ -336,7 +336,7 @@ class Collection {
336
336
  */
337
337
  touch(key, expiry, options, callback) {
338
338
  if (options instanceof Function) {
339
- callback = arguments[1];
339
+ callback = arguments[2];
340
340
  options = undefined;
341
341
  }
342
342
  if (!options) {
@@ -586,7 +586,7 @@ class Collection {
586
586
  }
587
587
  _getReplica(mode, key, options, callback) {
588
588
  if (options instanceof Function) {
589
- callback = arguments[1];
589
+ callback = arguments[2];
590
590
  options = undefined;
591
591
  }
592
592
  if (!options) {
@@ -142,7 +142,7 @@ class CollectionManager {
142
142
  callback = arguments[3];
143
143
  }
144
144
  if (options instanceof Function) {
145
- callback = arguments[2];
145
+ callback = arguments[1];
146
146
  options = undefined;
147
147
  }
148
148
  if (!options) {
@@ -277,7 +277,7 @@ class CollectionManager {
277
277
  */
278
278
  async dropScope(scopeName, options, callback) {
279
279
  if (options instanceof Function) {
280
- callback = arguments[2];
280
+ callback = arguments[1];
281
281
  options = undefined;
282
282
  }
283
283
  if (!options) {
@@ -50,6 +50,9 @@ class Connection {
50
50
  if (options.kvConnectTimeout) {
51
51
  lcbDsnObj.options.config_total_timeout = fmtTmt(options.kvConnectTimeout);
52
52
  }
53
+ else {
54
+ lcbDsnObj.options.config_total_timeout = '30s';
55
+ }
53
56
  if (options.kvTimeout) {
54
57
  lcbDsnObj.options.timeout = fmtTmt(options.kvTimeout);
55
58
  }
package/dist/errors.d.ts CHANGED
@@ -217,6 +217,24 @@ export declare class ScopeNotFoundError extends CouchbaseError {
217
217
  export declare class IndexNotFoundError extends CouchbaseError {
218
218
  constructor(cause?: Error, context?: ErrorContext);
219
219
  }
220
+ /**
221
+ * Indicates that a rate limit was exceeded while attempting to
222
+ * execute the operation.
223
+ *
224
+ * @category Error Handling
225
+ */
226
+ export declare class RateLimitedError extends CouchbaseError {
227
+ constructor(cause?: Error, context?: ErrorContext);
228
+ }
229
+ /**
230
+ * Indicates that a quota limit was exceeded while attempting to
231
+ * execute the operation.
232
+ *
233
+ * @category Error Handling
234
+ */
235
+ export declare class QuotaLimitedError extends CouchbaseError {
236
+ constructor(cause?: Error, context?: ErrorContext);
237
+ }
220
238
  /**
221
239
  * Indicates that the referenced index already existed, but was expected
222
240
  * to not yet exist for the operation.
package/dist/errors.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IndexFailureError = exports.PlanningFailureError = exports.PathExistsError = exports.DeltaInvalidError = exports.NumberTooBigError = exports.DocumentNotJsonError = exports.ValueInvalidError = exports.ValueTooDeepError = exports.PathTooDeepError = exports.PathTooBigError = exports.PathInvalidError = exports.PathMismatchError = exports.PathNotFoundError = exports.MutationLostError = exports.DurableWriteReCommitInProgressError = exports.DurableWriteInProgressError = exports.DurabilityAmbiguousError = exports.DurabilityImpossibleError = exports.DurabilityLevelNotAvailableError = exports.ValueNotJsonError = exports.DocumentExistsError = exports.ValueTooLargeError = exports.DocumentLockedError = exports.DocumentUnretrievableError = exports.DocumentNotFoundError = exports.IndexExistsError = exports.IndexNotFoundError = exports.ScopeNotFoundError = exports.FeatureNotAvailableError = exports.UnambiguousTimeoutError = exports.AmbiguousTimeoutError = exports.UnsupportedOperationError = exports.DecodingFailureError = exports.EncodingFailureError = exports.CollectionNotFoundError = exports.BucketNotFoundError = exports.CasMismatchError = exports.ParsingFailureError = exports.TemporaryFailureError = exports.AuthenticationFailureError = exports.InternalServerFailureError = exports.ServiceNotAvailableError = exports.InvalidArgumentError = exports.RequestCanceledError = exports.TimeoutError = exports.InvalidDurabilityLevel = exports.NeedOpenBucketError = exports.ClusterClosedError = exports.ConnectionClosedError = exports.CouchbaseError = void 0;
4
- exports.EventingFunctionDeployedError = exports.EventingFunctionNotBootstrappedError = exports.EventingFunctionIdenticalKeyspaceError = exports.EventingFunctionCompilationFailureError = exports.EventingFunctionNotDeployedError = exports.EventingFunctionNotFoundError = exports.BucketNotFlushableError = exports.UserExistsError = exports.BucketExistsError = exports.GroupNotFoundError = exports.UserNotFoundError = exports.ScopeExistsError = exports.CollectionExistsError = exports.DesignDocumentNotFoundError = exports.ViewNotFoundError = exports.LinkExistsError = exports.LinkNotFoundError = exports.DataverseExistsError = exports.DatasetExistsError = exports.DataverseNotFoundError = exports.DatasetNotFoundError = exports.JobQueueFullError = exports.CompilationFailureError = exports.PreparedStatementFailureError = void 0;
3
+ exports.PathExistsError = exports.DeltaInvalidError = exports.NumberTooBigError = exports.DocumentNotJsonError = exports.ValueInvalidError = exports.ValueTooDeepError = exports.PathTooDeepError = exports.PathTooBigError = exports.PathInvalidError = exports.PathMismatchError = exports.PathNotFoundError = exports.MutationLostError = exports.DurableWriteReCommitInProgressError = exports.DurableWriteInProgressError = exports.DurabilityAmbiguousError = exports.DurabilityImpossibleError = exports.DurabilityLevelNotAvailableError = exports.ValueNotJsonError = exports.DocumentExistsError = exports.ValueTooLargeError = exports.DocumentLockedError = exports.DocumentUnretrievableError = exports.DocumentNotFoundError = exports.IndexExistsError = exports.QuotaLimitedError = exports.RateLimitedError = exports.IndexNotFoundError = exports.ScopeNotFoundError = exports.FeatureNotAvailableError = exports.UnambiguousTimeoutError = exports.AmbiguousTimeoutError = exports.UnsupportedOperationError = exports.DecodingFailureError = exports.EncodingFailureError = exports.CollectionNotFoundError = exports.BucketNotFoundError = exports.CasMismatchError = exports.ParsingFailureError = exports.TemporaryFailureError = exports.AuthenticationFailureError = exports.InternalServerFailureError = exports.ServiceNotAvailableError = exports.InvalidArgumentError = exports.RequestCanceledError = exports.TimeoutError = exports.InvalidDurabilityLevel = exports.NeedOpenBucketError = exports.ClusterClosedError = exports.ConnectionClosedError = exports.CouchbaseError = void 0;
4
+ exports.EventingFunctionDeployedError = exports.EventingFunctionNotBootstrappedError = exports.EventingFunctionIdenticalKeyspaceError = exports.EventingFunctionCompilationFailureError = exports.EventingFunctionNotDeployedError = exports.EventingFunctionNotFoundError = exports.BucketNotFlushableError = exports.UserExistsError = exports.BucketExistsError = exports.GroupNotFoundError = exports.UserNotFoundError = exports.ScopeExistsError = exports.CollectionExistsError = exports.DesignDocumentNotFoundError = exports.ViewNotFoundError = exports.LinkExistsError = exports.LinkNotFoundError = exports.DataverseExistsError = exports.DatasetExistsError = exports.DataverseNotFoundError = exports.DatasetNotFoundError = exports.JobQueueFullError = exports.CompilationFailureError = exports.PreparedStatementFailureError = exports.IndexFailureError = exports.PlanningFailureError = void 0;
5
5
  require("./errorcontexts");
6
6
  /**
7
7
  * A generic base error that all errors inherit. Exposes the cause and
@@ -288,6 +288,30 @@ class IndexNotFoundError extends CouchbaseError {
288
288
  }
289
289
  }
290
290
  exports.IndexNotFoundError = IndexNotFoundError;
291
+ /**
292
+ * Indicates that a rate limit was exceeded while attempting to
293
+ * execute the operation.
294
+ *
295
+ * @category Error Handling
296
+ */
297
+ class RateLimitedError extends CouchbaseError {
298
+ constructor(cause, context) {
299
+ super('operation was rate limited', cause, context);
300
+ }
301
+ }
302
+ exports.RateLimitedError = RateLimitedError;
303
+ /**
304
+ * Indicates that a quota limit was exceeded while attempting to
305
+ * execute the operation.
306
+ *
307
+ * @category Error Handling
308
+ */
309
+ class QuotaLimitedError extends CouchbaseError {
310
+ constructor(cause, context) {
311
+ super('operation was quota limited', cause, context);
312
+ }
313
+ }
314
+ exports.QuotaLimitedError = QuotaLimitedError;
291
315
  /**
292
316
  * Indicates that the referenced index already existed, but was expected
293
317
  * to not yet exist for the operation.
@@ -652,7 +652,7 @@ class EventingFunctionManager {
652
652
  */
653
653
  async upsertFunction(functionDefinition, options, callback) {
654
654
  if (options instanceof Function) {
655
- callback = arguments[2];
655
+ callback = arguments[1];
656
656
  options = undefined;
657
657
  }
658
658
  if (!options) {
@@ -697,7 +697,7 @@ class EventingFunctionManager {
697
697
  */
698
698
  async dropFunction(name, options, callback) {
699
699
  if (options instanceof Function) {
700
- callback = arguments[2];
700
+ callback = arguments[1];
701
701
  options = undefined;
702
702
  }
703
703
  if (!options) {
@@ -810,7 +810,7 @@ class EventingFunctionManager {
810
810
  */
811
811
  async deployFunction(name, options, callback) {
812
812
  if (options instanceof Function) {
813
- callback = arguments[2];
813
+ callback = arguments[1];
814
814
  options = undefined;
815
815
  }
816
816
  if (!options) {
@@ -849,7 +849,7 @@ class EventingFunctionManager {
849
849
  */
850
850
  async undeployFunction(name, options, callback) {
851
851
  if (options instanceof Function) {
852
- callback = arguments[2];
852
+ callback = arguments[1];
853
853
  options = undefined;
854
854
  }
855
855
  if (!options) {
@@ -888,7 +888,7 @@ class EventingFunctionManager {
888
888
  */
889
889
  async pauseFunction(name, options, callback) {
890
890
  if (options instanceof Function) {
891
- callback = arguments[2];
891
+ callback = arguments[1];
892
892
  options = undefined;
893
893
  }
894
894
  if (!options) {
@@ -927,7 +927,7 @@ class EventingFunctionManager {
927
927
  */
928
928
  async resumeFunction(name, options, callback) {
929
929
  if (options instanceof Function) {
930
- callback = arguments[2];
930
+ callback = arguments[1];
931
931
  options = undefined;
932
932
  }
933
933
  if (!options) {
@@ -101,7 +101,7 @@ class QueryIndexManager {
101
101
  */
102
102
  async createIndex(bucketName, indexName, fields, options, callback) {
103
103
  if (options instanceof Function) {
104
- callback = arguments[2];
104
+ callback = arguments[3];
105
105
  options = undefined;
106
106
  }
107
107
  if (!options) {
@@ -126,7 +126,7 @@ class QueryIndexManager {
126
126
  */
127
127
  async createPrimaryIndex(bucketName, options, callback) {
128
128
  if (options instanceof Function) {
129
- callback = arguments[0];
129
+ callback = arguments[1];
130
130
  options = undefined;
131
131
  }
132
132
  if (!options) {
@@ -198,7 +198,7 @@ class QueryIndexManager {
198
198
  */
199
199
  async dropPrimaryIndex(bucketName, options, callback) {
200
200
  if (options instanceof Function) {
201
- callback = arguments[0];
201
+ callback = arguments[1];
202
202
  options = undefined;
203
203
  }
204
204
  if (!options) {
@@ -50,6 +50,9 @@ class SearchExecutor {
50
50
  if (options.disableScoring) {
51
51
  queryObj.score = 'none';
52
52
  }
53
+ if (options.includeLocations !== undefined) {
54
+ queryObj.includeLocations = options.includeLocations;
55
+ }
53
56
  if (options.consistency) {
54
57
  queryObjCtl.consistency = {
55
58
  level: options.consistency,
@@ -105,7 +105,7 @@ class SearchIndexManager {
105
105
  */
106
106
  async upsertIndex(indexDefinition, options, callback) {
107
107
  if (options instanceof Function) {
108
- callback = arguments[2];
108
+ callback = arguments[1];
109
109
  options = undefined;
110
110
  }
111
111
  if (!options) {
@@ -1,3 +1,19 @@
1
+ /**
2
+ * Specifies how the individual match terms should be logically concatenated.
3
+ *
4
+ * @experimental This API is subject to change without notice.
5
+ * @category Full Text Search
6
+ */
7
+ export declare enum MatchOperator {
8
+ /**
9
+ * Specifies that individual match terms are concatenated with a logical OR - this is the default if not provided.
10
+ */
11
+ Or = "or",
12
+ /**
13
+ * Specifies that individual match terms are concatenated with a logical AND.
14
+ */
15
+ And = "and"
16
+ }
1
17
  /**
2
18
  * GeoPoint represents a specific coordinate on earth. We support
3
19
  * a number of different variants of geopoints being specified.
@@ -86,6 +102,7 @@ export declare class MatchSearchQuery extends SearchQuery {
86
102
  * @internal
87
103
  */
88
104
  constructor(match: string);
105
+ operator(op: MatchOperator): MatchSearchQuery;
89
106
  field(field: string): MatchSearchQuery;
90
107
  analyzer(analyzer: string): MatchSearchQuery;
91
108
  prefixLength(prefixLength: number): MatchSearchQuery;
@@ -1,7 +1,24 @@
1
1
  "use strict";
2
2
  /* eslint jsdoc/require-jsdoc: off */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.GeoPolygonSearchQuery = exports.GeoBoundingBoxSearchQuery = exports.GeoDistanceSearchQuery = exports.MatchNoneSearchQuery = exports.MatchAllSearchQuery = exports.PrefixSearchQuery = exports.PhraseSearchQuery = exports.TermSearchQuery = exports.BooleanFieldSearchQuery = exports.DocIdSearchQuery = exports.WildcardSearchQuery = exports.BooleanSearchQuery = exports.DisjunctionSearchQuery = exports.ConjunctionSearchQuery = exports.DateRangeSearchQuery = exports.NumericRangeSearchQuery = exports.QueryStringSearchQuery = exports.RegexpSearchQuery = exports.MatchPhraseSearchQuery = exports.MatchSearchQuery = exports.SearchQuery = void 0;
4
+ exports.GeoPolygonSearchQuery = exports.GeoBoundingBoxSearchQuery = exports.GeoDistanceSearchQuery = exports.MatchNoneSearchQuery = exports.MatchAllSearchQuery = exports.PrefixSearchQuery = exports.PhraseSearchQuery = exports.TermSearchQuery = exports.BooleanFieldSearchQuery = exports.DocIdSearchQuery = exports.WildcardSearchQuery = exports.BooleanSearchQuery = exports.DisjunctionSearchQuery = exports.ConjunctionSearchQuery = exports.DateRangeSearchQuery = exports.NumericRangeSearchQuery = exports.QueryStringSearchQuery = exports.RegexpSearchQuery = exports.MatchPhraseSearchQuery = exports.MatchSearchQuery = exports.SearchQuery = exports.MatchOperator = void 0;
5
+ /**
6
+ * Specifies how the individual match terms should be logically concatenated.
7
+ *
8
+ * @experimental This API is subject to change without notice.
9
+ * @category Full Text Search
10
+ */
11
+ var MatchOperator;
12
+ (function (MatchOperator) {
13
+ /**
14
+ * Specifies that individual match terms are concatenated with a logical OR - this is the default if not provided.
15
+ */
16
+ MatchOperator["Or"] = "or";
17
+ /**
18
+ * Specifies that individual match terms are concatenated with a logical AND.
19
+ */
20
+ MatchOperator["And"] = "and";
21
+ })(MatchOperator = exports.MatchOperator || (exports.MatchOperator = {}));
5
22
  function _parseGeoPoint(v) {
6
23
  if (Array.isArray(v)) {
7
24
  return v;
@@ -145,6 +162,10 @@ class MatchSearchQuery extends SearchQuery {
145
162
  match: match,
146
163
  });
147
164
  }
165
+ operator(op) {
166
+ this._data.operator = op;
167
+ return this;
168
+ }
148
169
  field(field) {
149
170
  this._data.field = field;
150
171
  return this;
@@ -44,7 +44,7 @@ export declare class SearchResult {
44
44
  *
45
45
  * @category Full Text Search
46
46
  */
47
- declare enum HighlightStyle {
47
+ export declare enum HighlightStyle {
48
48
  /**
49
49
  * Indicates that matches should be highlighted using HTML tags in the result text.
50
50
  */
@@ -123,6 +123,12 @@ export interface SearchQueryOptions {
123
123
  * impossible to sort based on how well a particular result scored.
124
124
  */
125
125
  disableScoring?: boolean;
126
+ /**
127
+ * If set to true, will include the locations in the search result.
128
+ *
129
+ * @experimental This API is subject to change without notice.
130
+ */
131
+ includeLocations?: boolean;
126
132
  /**
127
133
  * Specifies the consistency requirements when executing the query.
128
134
  *
@@ -151,4 +157,3 @@ export interface SearchQueryOptions {
151
157
  */
152
158
  timeout?: number;
153
159
  }
154
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchScanConsistency = exports.SearchResult = exports.SearchRow = exports.SearchMetaData = void 0;
3
+ exports.SearchScanConsistency = exports.HighlightStyle = exports.SearchResult = exports.SearchRow = exports.SearchMetaData = void 0;
4
4
  /**
5
5
  * SearchMetaData represents the meta-data available from a search query.
6
6
  * This class is currently incomplete and must be casted to `any` in
@@ -51,7 +51,7 @@ var HighlightStyle;
51
51
  * Indicates that matches should be highlighted using ASCII coding in the result test.
52
52
  */
53
53
  HighlightStyle["ANSI"] = "ansi";
54
- })(HighlightStyle || (HighlightStyle = {}));
54
+ })(HighlightStyle = exports.HighlightStyle || (exports.HighlightStyle = {}));
55
55
  /**
56
56
  * Represents the various scan consistency options that are available when
57
57
  * querying against the query service.
@@ -459,7 +459,7 @@ class UserManager {
459
459
  */
460
460
  async getRoles(options, callback) {
461
461
  if (options instanceof Function) {
462
- callback = arguments[1];
462
+ callback = arguments[0];
463
463
  options = undefined;
464
464
  }
465
465
  if (!options) {
@@ -174,7 +174,7 @@ class ViewIndexManager {
174
174
  */
175
175
  async upsertDesignDocument(designDoc, options, callback) {
176
176
  if (options instanceof Function) {
177
- callback = arguments[2];
177
+ callback = arguments[1];
178
178
  options = undefined;
179
179
  }
180
180
  if (!options) {