couchbase 4.7.0 → 4.7.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 (84) hide show
  1. package/CMakeLists.txt +3 -0
  2. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +96 -727
  3. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
  4. package/deps/couchbase-cxx-client/CMakeLists.txt +3 -1
  5. package/deps/couchbase-cxx-client/README.md +2 -2
  6. package/deps/couchbase-cxx-client/core/error_context/base_error_context.hxx +32 -0
  7. package/deps/couchbase-cxx-client/core/error_context/key_value.cxx +1 -0
  8. package/deps/couchbase-cxx-client/core/error_context/key_value.hxx +23 -0
  9. package/deps/couchbase-cxx-client/core/error_context/key_value_error_context.hxx +35 -0
  10. package/deps/couchbase-cxx-client/core/error_context/subdocument_error_context.hxx +41 -0
  11. package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +123 -88
  12. package/deps/couchbase-cxx-client/core/impl/collection.cxx +416 -189
  13. package/deps/couchbase-cxx-client/core/impl/error.cxx +29 -4
  14. package/deps/couchbase-cxx-client/core/impl/invoke_with_node_id.hxx +44 -0
  15. package/deps/couchbase-cxx-client/core/impl/node_id.cxx +110 -0
  16. package/deps/couchbase-cxx-client/core/impl/node_id.hxx +40 -0
  17. package/deps/couchbase-cxx-client/core/io/configuration_belongs_to_session.hxx +67 -0
  18. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -57
  19. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +7 -16
  20. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +14 -4
  21. package/deps/couchbase-cxx-client/core/operations/document_get_projected.cxx +3 -4
  22. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +4 -0
  23. package/deps/couchbase-cxx-client/core/operations/document_query.cxx +12 -12
  24. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +11 -11
  25. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +11 -11
  26. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +11 -11
  27. package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +9 -6
  28. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +5 -4
  29. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +7 -6
  30. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +12 -13
  31. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +8 -9
  32. package/deps/couchbase-cxx-client/core/topology/configuration.cxx +21 -0
  33. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +28 -0
  34. package/deps/couchbase-cxx-client/core/utils/contains_string.cxx +61 -0
  35. package/deps/couchbase-cxx-client/core/utils/contains_string.hxx +26 -0
  36. package/deps/couchbase-cxx-client/couchbase/collection.hxx +73 -0
  37. package/deps/couchbase-cxx-client/couchbase/error.hxx +16 -0
  38. package/deps/couchbase-cxx-client/couchbase/node_id.hxx +123 -0
  39. package/deps/couchbase-cxx-client/couchbase/node_id_for_options.hxx +61 -0
  40. package/deps/couchbase-cxx-client/couchbase/node_ids_options.hxx +62 -0
  41. package/deps/couchbase-cxx-client/couchbase/result.hxx +42 -0
  42. package/dist/analyticsexecutor.d.ts +4 -0
  43. package/dist/analyticsexecutor.js +26 -11
  44. package/dist/analyticsindexmanager.js +2 -2
  45. package/dist/binding.d.ts +12 -2
  46. package/dist/bindingutilities.js +8 -5
  47. package/dist/bucket.d.ts +9 -1
  48. package/dist/bucket.js +21 -0
  49. package/dist/cluster.d.ts +10 -1
  50. package/dist/cluster.js +25 -3
  51. package/dist/collection.d.ts +3 -3
  52. package/dist/collection.js +189 -143
  53. package/dist/diagnosticsexecutor.js +2 -2
  54. package/dist/diagnosticstypes.d.ts +36 -0
  55. package/dist/diagnosticstypes.js +22 -1
  56. package/dist/mutationstate.js +1 -1
  57. package/dist/observability.d.ts +5 -1
  58. package/dist/observability.js +11 -3
  59. package/dist/observabilityhandler.d.ts +19 -0
  60. package/dist/observabilityhandler.js +81 -14
  61. package/dist/observabilitytypes.js +19 -42
  62. package/dist/observabilityutilities.js +1 -1
  63. package/dist/oteltracer.d.ts +5 -0
  64. package/dist/oteltracer.js +7 -0
  65. package/dist/queryexecutor.d.ts +9 -0
  66. package/dist/queryexecutor.js +18 -0
  67. package/dist/queryindexmanager.js +15 -0
  68. package/dist/searchexecutor.d.ts +4 -0
  69. package/dist/searchexecutor.js +30 -15
  70. package/dist/thresholdlogging.d.ts +5 -0
  71. package/dist/thresholdlogging.js +7 -0
  72. package/dist/tracing.d.ts +6 -0
  73. package/dist/transactions.js +29 -6
  74. package/dist/version.d.ts +1 -1
  75. package/dist/version.js +1 -1
  76. package/dist/viewexecutor.d.ts +4 -0
  77. package/dist/viewexecutor.js +30 -15
  78. package/dist/waituntilreadyexecutor.d.ts +37 -0
  79. package/dist/waituntilreadyexecutor.js +156 -0
  80. package/package.json +8 -8
  81. package/scripts/prebuilds.js +13 -0
  82. package/src/binding.cpp +1 -1
  83. package/src/connection.hpp +24 -3
  84. package/src/jstocbpp_errors.hpp +6 -0
package/dist/cluster.d.ts CHANGED
@@ -5,7 +5,7 @@ import { Authenticator } from './authenticators';
5
5
  import { CppConnection } from './binding';
6
6
  import { Bucket } from './bucket';
7
7
  import { BucketManager } from './bucketmanager';
8
- import { DiagnosticsOptions, DiagnosticsResult, PingOptions, PingResult } from './diagnosticstypes';
8
+ import { DiagnosticsOptions, DiagnosticsResult, PingOptions, PingResult, WaitUntilReadyOptions } from './diagnosticstypes';
9
9
  import { EventingFunctionManager } from './eventingfunctionmanager';
10
10
  import { CouchbaseLogger, Logger } from './logger';
11
11
  import { Meter } from './metrics';
@@ -521,6 +521,15 @@ export declare class Cluster {
521
521
  * @param callback A node-style callback to be invoked after execution.
522
522
  */
523
523
  ping(options?: PingOptions, callback?: NodeCallback<PingResult>): Promise<PingResult>;
524
+ /**
525
+ * Waits until the cluster reaches the desired state or the timeout elapses.
526
+ * The default desired state is ClusterState.Online.
527
+ *
528
+ * @param timeout The time in milliseconds to wait for the cluster to become ready.
529
+ * @param options Optional parameters for this operation.
530
+ * @param callback A callback to be invoked after execution.
531
+ */
532
+ waitUntilReady(timeout: number, options?: WaitUntilReadyOptions, callback?: NodeCallback<void>): Promise<void>;
524
533
  /**
525
534
  * Shuts down this cluster object. Cleaning up all resources associated with it.
526
535
  *
package/dist/cluster.js CHANGED
@@ -13,6 +13,7 @@ const bucketmanager_1 = require("./bucketmanager");
13
13
  const configProfile_1 = require("./configProfile");
14
14
  const connspec_1 = require("./connspec");
15
15
  const diagnosticsexecutor_1 = require("./diagnosticsexecutor");
16
+ const waituntilreadyexecutor_1 = require("./waituntilreadyexecutor");
16
17
  const eventingfunctionmanager_1 = require("./eventingfunctionmanager");
17
18
  const logger_1 = require("./logger");
18
19
  const loggingmeter_1 = require("./loggingmeter");
@@ -141,9 +142,9 @@ class Cluster {
141
142
  */
142
143
  constructor(connStr, options) {
143
144
  var _a, _b, _c;
144
- if (!options) {
145
- options = {};
146
- }
145
+ // Copy before normalising: the options object belongs to the caller, and
146
+ // the defaulting below, plus any config profile, writes to it.
147
+ options = { ...options };
147
148
  if (!options.security) {
148
149
  options.security = {};
149
150
  }
@@ -487,6 +488,27 @@ class Cluster {
487
488
  const options_ = options;
488
489
  return utilities_1.PromiseHelper.wrapAsync(() => exec.ping(options_), callback);
489
490
  }
491
+ /**
492
+ * Waits until the cluster reaches the desired state or the timeout elapses.
493
+ * The default desired state is ClusterState.Online.
494
+ *
495
+ * @param timeout The time in milliseconds to wait for the cluster to become ready.
496
+ * @param options Optional parameters for this operation.
497
+ * @param callback A callback to be invoked after execution.
498
+ */
499
+ waitUntilReady(timeout, options, callback) {
500
+ if (options instanceof Function) {
501
+ callback = arguments[1];
502
+ options = undefined;
503
+ }
504
+ if (!options) {
505
+ options = {};
506
+ }
507
+ const exec = new waituntilreadyexecutor_1.WaitUntilReadyExecutor(this);
508
+ const timeout_ = timeout;
509
+ const options_ = options;
510
+ return utilities_1.PromiseHelper.wrapAsync(() => exec.waitUntilReady(timeout_, options_), callback);
511
+ }
490
512
  /**
491
513
  * Shuts down this cluster object. Cleaning up all resources associated with it.
492
514
  *
@@ -8,7 +8,7 @@ import { CouchbaseList, CouchbaseMap, CouchbaseQueue, CouchbaseSet } from './dat
8
8
  import { DurabilityLevel, ReadPreference, StoreSemantics } from './generaltypes';
9
9
  import { MutationState } from './mutationstate';
10
10
  import { ObservableRequestHandler } from './observabilityhandler';
11
- import { ObservabilityInstruments } from './observabilitytypes';
11
+ import { KeyValueOp, ObservabilityInstruments } from './observabilitytypes';
12
12
  import { CollectionQueryIndexManager } from './queryindexmanager';
13
13
  import { RangeScan, SamplingScan, PrefixScan } from './rangeScan';
14
14
  import { Scope } from './scope';
@@ -578,7 +578,7 @@ export declare class Collection {
578
578
  /**
579
579
  * @internal
580
580
  */
581
- _getReplica(key: string, obsReqHandler: ObservableRequestHandler, options: {
581
+ _getReplica(key: string, opType: KeyValueOp, obsReqHandler: ObservableRequestHandler | null, options: {
582
582
  transcoder?: Transcoder;
583
583
  timeout?: number;
584
584
  readPreference?: ReadPreference;
@@ -718,7 +718,7 @@ export declare class Collection {
718
718
  /**
719
719
  * @internal
720
720
  */
721
- _lookupInReplica(key: string, obsReqHandler: ObservableRequestHandler, specs: LookupInSpec[], options: {
721
+ _lookupInReplica(key: string, opType: KeyValueOp, obsReqHandler: ObservableRequestHandler | null, specs: LookupInSpec[], options: {
722
722
  timeout?: number;
723
723
  readPreference?: ReadPreference;
724
724
  parentSpan?: RequestSpan;