couchbase 3.2.6 → 3.2.7

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.
@@ -30,7 +30,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
30
30
  # Couchbase mock path to download
31
31
  SET(COUCHBASE_MOCK_VERSION 1.5.25)
32
32
  SET(COUCHBASE_MOCK_URL "https://github.com/couchbase/CouchbaseMock/releases/download/${COUCHBASE_MOCK_VERSION}/CouchbaseMock-${COUCHBASE_MOCK_VERSION}.jar")
33
- project(libcouchbase VERSION 3.3.3 LANGUAGES C CXX)
33
+ project(libcouchbase VERSION 3.3.4 LANGUAGES C CXX)
34
34
 
35
35
  if (NOT CMAKE_VERSION VERSION_LESS "3.13")
36
36
  # CMP0077: option() honors normal variables
@@ -1,6 +1,11 @@
1
1
  # Release Notes
2
2
 
3
+ ## 3.3.4 (2023-02-08)
4
+
5
+ * CCBC-1583: disable collections support if KV does not ack it.
6
+
3
7
  ## 3.3.3 (2022-09-09)
8
+
4
9
  * CCBC-1565: load system CAs when the trust certificate is not provided
5
10
 
6
11
  When the user has not set any root ca provider but is using TLS then we
@@ -38,7 +38,7 @@ PROJECT_NAME = "Couchbase C Client"
38
38
  # could be handy for archiving the generated documentation or if some version
39
39
  # control system is used.
40
40
 
41
- PROJECT_NUMBER = 3.3.3
41
+ PROJECT_NUMBER = 3.3.4
42
42
 
43
43
  # Using the PROJECT_BRIEF tag one can provide an optional one line description
44
44
  # for a project that appears at the top of each page and should give viewer a
@@ -33,7 +33,7 @@
33
33
  */
34
34
 
35
35
  /** @brief libcouchbase version string */
36
- #define LCB_VERSION_STRING "3.3.3-njs"
36
+ #define LCB_VERSION_STRING "3.3.4-njs"
37
37
 
38
38
  /**@brief libcouchbase hex version
39
39
  *
@@ -50,12 +50,12 @@
50
50
  * 2.1.3 | 0x020103
51
51
  * 3.0.15 | 0x030015
52
52
  */
53
- #define LCB_VERSION 0x030303
53
+ #define LCB_VERSION 0x030304
54
54
 
55
55
  /**@brief The SCM revision ID
56
56
  * @see LCB_CNTL_CHANGESET
57
57
  */
58
- #define LCB_VERSION_CHANGESET "66ff4fad9947e6fb60be06b3aeb57a8b77fbada2"
58
+ #define LCB_VERSION_CHANGESET "9bf9ef8624757474d57b06624fc55e470340d9dd"
59
59
 
60
60
  /**@brief The client ID
61
61
  */
@@ -990,6 +990,11 @@ void Server::handle_connected(lcbio_SOCKET *sock, lcb_STATUS err, lcbio_OSERR sy
990
990
  connreq = SessionRequest::start(sock, settings, settings->config_node_timeout, on_connected, this);
991
991
  return;
992
992
  } else {
993
+ if (settings->use_collections && !sessinfo->has_feature(PROTOCOL_BINARY_FEATURE_COLLECTIONS)) {
994
+ settings->use_collections = 0;
995
+ lcb_log(LOGARGS_T(DEBUG), "<%s:%s> (SRV=%p) Disable collections support as not every node support it",
996
+ curhost->host, curhost->port, (void *)this);
997
+ }
993
998
  jsonsupport = sessinfo->has_feature(PROTOCOL_BINARY_FEATURE_JSON);
994
999
  compsupport = sessinfo->has_feature(PROTOCOL_BINARY_FEATURE_SNAPPY);
995
1000
  mutation_tokens = sessinfo->has_feature(PROTOCOL_BINARY_FEATURE_MUTATION_SEQNO);
@@ -69,14 +69,16 @@ static void log_callback(const SSL *ssl, int where, int ret)
69
69
  }
70
70
  }
71
71
 
72
- // http://stackoverflow.com/questions/256405/programmatically-create-x509-certificate-using-openss l
72
+ // http://stackoverflow.com/questions/256405/programmatically-create-x509-certificate-using-openssl
73
73
  // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-22/openssl/demos/x509/mkcert.c
74
74
  // Note we deviate from the examples by directly setting the certificate.
75
75
 
76
- static void genCertificate(SSL_CTX *ctx)
77
- {
78
- EVP_PKEY *pkey = EVP_PKEY_new();
76
+ static void genCertificate(SSL_CTX *ctx) {
79
77
  X509 *x509 = X509_new();
78
+ #if OPENSSL_VERSION_NUMBER >= 0x3000000fL
79
+ EVP_PKEY *pkey = EVP_RSA_gen(2048);
80
+ #else
81
+ EVP_PKEY *pkey = EVP_PKEY_new();
80
82
  RSA *rsa = RSA_new();
81
83
  BIGNUM *exponent = BN_new();
82
84
  BN_set_word(exponent, RSA_F4);
@@ -84,6 +86,7 @@ static void genCertificate(SSL_CTX *ctx)
84
86
  BN_free(exponent);
85
87
 
86
88
  EVP_PKEY_assign_RSA(pkey, rsa);
89
+ #endif
87
90
  ASN1_INTEGER_set(X509_get_serialNumber(x509), 1);
88
91
  X509_gmtime_adj(X509_get_notBefore(x509), 0);
89
92
  X509_gmtime_adj(X509_get_notAfter(x509), 31536000L);
@@ -94,7 +97,7 @@ static void genCertificate(SSL_CTX *ctx)
94
97
  X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC, (unsigned char *)"MyCompany Inc.", -1, -1, 0);
95
98
  X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"localhost", -1, -1, 0);
96
99
  X509_set_issuer_name(x509, name);
97
- X509_sign(x509, pkey, EVP_sha1());
100
+ X509_sign(x509, pkey, EVP_sha384());
98
101
 
99
102
  SSL_CTX_use_PrivateKey(ctx, pkey);
100
103
  SSL_CTX_use_certificate(ctx, x509);
@@ -79,4 +79,4 @@ export declare class CertificateAuthenticator implements ICertificateAuthenticat
79
79
  *
80
80
  * @category Authentication
81
81
  */
82
- export declare type Authenticator = IPasswordAuthenticator | ICertificateAuthenticator;
82
+ export type Authenticator = IPasswordAuthenticator | ICertificateAuthenticator;
package/dist/binding.d.ts CHANGED
@@ -64,10 +64,10 @@ export interface CppRequestSpan {
64
64
  export interface CppTracer {
65
65
  requestSpan(name: string, parent: CppRequestSpan | undefined): CppRequestSpan;
66
66
  }
67
- export declare type CppBytes = string | Buffer;
68
- export declare type CppTranscoder = any;
69
- export declare type CppCas = any;
70
- export declare type CppMutationToken = any;
67
+ export type CppBytes = string | Buffer;
68
+ export type CppTranscoder = any;
69
+ export type CppCas = any;
70
+ export type CppMutationToken = any;
71
71
  export interface CppErrorBase extends Error {
72
72
  code: number;
73
73
  }
@@ -125,7 +125,7 @@ export interface CppAnalyticsError extends CppErrorBase {
125
125
  http_response_code: number;
126
126
  http_response_body: string;
127
127
  }
128
- export declare type CppError = CppGenericError | CppKeyValueError | CppViewError | CppQueryError | CppSearchError | CppAnalyticsError;
128
+ export type CppError = CppGenericError | CppKeyValueError | CppViewError | CppQueryError | CppSearchError | CppAnalyticsError;
129
129
  export interface CppConnection {
130
130
  new (connType: CppConnType, connStr: string, username: string | undefined, password: string | undefined, logFn: CppLogFunc, tracer: CppTracer | undefined, meter: CppMeter | undefined): any;
131
131
  connect(callback: (err: CppError | null) => void): void;
package/dist/cluster.js CHANGED
@@ -28,6 +28,12 @@ const utilities_1 = require("./utilities");
28
28
  * @category Core
29
29
  */
30
30
  class Cluster {
31
+ /**
32
+ @internal
33
+ */
34
+ get transcoder() {
35
+ return this._transcoder;
36
+ }
31
37
  /**
32
38
  @internal
33
39
  @deprecated Use the static sdk-level {@link connect} method instead.
@@ -94,12 +100,6 @@ class Cluster {
94
100
  /**
95
101
  @internal
96
102
  */
97
- get transcoder() {
98
- return this._transcoder;
99
- }
100
- /**
101
- @internal
102
- */
103
103
  static async connect(connStr, options, callback) {
104
104
  return utilities_1.PromiseHelper.wrapAsync(async () => {
105
105
  const cluster = new Cluster(connStr, options);
@@ -22,6 +22,12 @@ const utilities_1 = require("./utilities");
22
22
  * @category Core
23
23
  */
24
24
  class Collection {
25
+ /**
26
+ * @internal
27
+ */
28
+ static get DEFAULT_NAME() {
29
+ return '_default';
30
+ }
25
31
  /**
26
32
  @internal
27
33
  */
@@ -30,12 +36,6 @@ class Collection {
30
36
  this._name = collectionName;
31
37
  this._conn = scope.conn;
32
38
  }
33
- /**
34
- * @internal
35
- */
36
- static get DEFAULT_NAME() {
37
- return '_default';
38
- }
39
39
  /**
40
40
  @internal
41
41
  */
@@ -22,8 +22,8 @@ export interface ConnectionOptions {
22
22
  meter?: Meter;
23
23
  logFunc?: LogFunc;
24
24
  }
25
- declare type MergeArgs<A, B> = A extends [...infer Params] ? [...Params, ...(B extends [...infer Params2] ? Params2 : [])] : never;
26
- declare type CppCbToNew<T extends (...fargs: any[]) => void> = T extends (...fargs: [
25
+ type MergeArgs<A, B> = A extends [...infer Params] ? [...Params, ...(B extends [...infer Params2] ? Params2 : [])] : never;
26
+ type CppCbToNew<T extends (...fargs: any[]) => void> = T extends (...fargs: [
27
27
  ...infer FArgs,
28
28
  (err: CppError | null, ...cbArgs: infer CbArgs) => void
29
29
  ]) => void ? [
package/dist/scope.js CHANGED
@@ -12,6 +12,12 @@ const utilities_1 = require("./utilities");
12
12
  * @category Core
13
13
  */
14
14
  class Scope {
15
+ /**
16
+ * @internal
17
+ */
18
+ static get DEFAULT_NAME() {
19
+ return '_default';
20
+ }
15
21
  /**
16
22
  @internal
17
23
  */
@@ -20,12 +26,6 @@ class Scope {
20
26
  this._name = scopeName;
21
27
  this._conn = bucket.conn;
22
28
  }
23
- /**
24
- * @internal
25
- */
26
- static get DEFAULT_NAME() {
27
- return '_default';
28
- }
29
29
  /**
30
30
  @internal
31
31
  */
package/dist/sdspecs.js CHANGED
@@ -103,11 +103,6 @@ exports.MutateInMacro = MutateInMacro;
103
103
  * @category Key-Value
104
104
  */
105
105
  class LookupInSpec {
106
- constructor(op, path, flags) {
107
- this._op = op;
108
- this._path = path;
109
- this._flags = flags;
110
- }
111
106
  /**
112
107
  * BUG(JSCBC-756): Previously provided access to the expiry macro for a
113
108
  * lookup-in operation.
@@ -117,6 +112,11 @@ class LookupInSpec {
117
112
  static get Expiry() {
118
113
  return LookupInMacro.Expiry;
119
114
  }
115
+ constructor(op, path, flags) {
116
+ this._op = op;
117
+ this._path = path;
118
+ this._flags = flags;
119
+ }
120
120
  static _create(op, path, options) {
121
121
  if (!options) {
122
122
  options = {};
@@ -175,12 +175,6 @@ exports.LookupInSpec = LookupInSpec;
175
175
  * @category Key-Value
176
176
  */
177
177
  class MutateInSpec {
178
- constructor(op, path, flags, data) {
179
- this._op = op;
180
- this._path = path;
181
- this._flags = flags;
182
- this._data = data;
183
- }
184
178
  /**
185
179
  * BUG(JSCBC-756): Previously provided access to the document cas mutate
186
180
  * macro.
@@ -190,6 +184,12 @@ class MutateInSpec {
190
184
  static get CasPlaceholder() {
191
185
  return MutateInMacro.Cas;
192
186
  }
187
+ constructor(op, path, flags, data) {
188
+ this._op = op;
189
+ this._path = path;
190
+ this._flags = flags;
191
+ this._data = data;
192
+ }
193
193
  static _create(op, path, value, options) {
194
194
  if (!options) {
195
195
  options = {};
@@ -20,7 +20,7 @@ export declare enum MatchOperator {
20
20
  *
21
21
  * @category Full Text Search
22
22
  */
23
- export declare type GeoPoint = [longitude: number, latitude: number] | {
23
+ export type GeoPoint = [longitude: number, latitude: number] | {
24
24
  lon: number;
25
25
  lat: number;
26
26
  } | {
@@ -3,7 +3,7 @@ import EventEmitter from 'events';
3
3
  /**
4
4
  * @internal
5
5
  */
6
- declare type PromisifyFunc<T> = (emitter: StreamablePromise<T>, resolve: (result: T) => void, reject: (err: Error) => void) => void;
6
+ type PromisifyFunc<T> = (emitter: StreamablePromise<T>, resolve: (result: T) => void, reject: (err: Error) => void) => void;
7
7
  /**
8
8
  * @internal
9
9
  */
@@ -204,6 +204,15 @@ exports.User = User;
204
204
  * @category Management
205
205
  */
206
206
  class UserAndMetadata extends User {
207
+ /**
208
+ * Same as {@link effectiveRoles}, which already contains the roles
209
+ * including their origins.
210
+ *
211
+ * @deprecated Use {@link effectiveRoles} instead.
212
+ */
213
+ get effectiveRolesAndOrigins() {
214
+ return this.effectiveRoles;
215
+ }
207
216
  /**
208
217
  * @internal
209
218
  */
@@ -214,15 +223,6 @@ class UserAndMetadata extends User {
214
223
  this.passwordChanged = data.passwordChanged;
215
224
  this.externalGroups = data.externalGroups;
216
225
  }
217
- /**
218
- * Same as {@link effectiveRoles}, which already contains the roles
219
- * including their origins.
220
- *
221
- * @deprecated Use {@link effectiveRoles} instead.
222
- */
223
- get effectiveRolesAndOrigins() {
224
- return this.effectiveRoles;
225
- }
226
226
  /**
227
227
  * @internal
228
228
  */
@@ -5,7 +5,7 @@ import { DurabilityLevel } from './generaltypes';
5
5
  *
6
6
  * @category Key-Value
7
7
  */
8
- export declare type Cas = any;
8
+ export type Cas = any;
9
9
  /**
10
10
  * Reprents a node-style callback which receives an optional error or result.
11
11
  *
@@ -35,6 +35,14 @@ exports.DesignDocumentView = DesignDocumentView;
35
35
  * @category Management
36
36
  */
37
37
  class DesignDocument {
38
+ /**
39
+ * Same as {@link DesignDocumentView}.
40
+ *
41
+ * @deprecated Use {@link DesignDocumentView} directly.
42
+ */
43
+ static get View() {
44
+ return DesignDocumentView;
45
+ }
38
46
  /**
39
47
  * @internal
40
48
  */
@@ -52,14 +60,6 @@ class DesignDocument {
52
60
  this.name = data.name;
53
61
  this.views = data.views || {};
54
62
  }
55
- /**
56
- * Same as {@link DesignDocumentView}.
57
- *
58
- * @deprecated Use {@link DesignDocumentView} directly.
59
- */
60
- static get View() {
61
- return DesignDocumentView;
62
- }
63
63
  /**
64
64
  * @internal
65
65
  */
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.4","nan":"^2.17.0","parse-duration":"^1.0.2","prebuild-install":"^7.1.1"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^3.4.0","@tsconfig/node10":"^1.0.9","@types/bindings":"^1.5.1","@types/debug":"^4.1.7","@types/node":"^18.11.9","@typescript-eslint/eslint-plugin":"^5.42.0","@typescript-eslint/parser":"^5.42.0","chai":"^4.3.6","eslint":"^8.26.0","eslint-config-prettier":"^8.5.0","eslint-plugin-jsdoc":"^39.6.2","eslint-plugin-mocha":"^10.1.0","eslint-plugin-node":"^11.1.0","expose-gc":"^1.0.0","mocha":"^10.1.0","npm-check-updates":"^16.3.16","nyc":"^15.1.0","prebuild":"^11.0.4","prettier":"^2.7.1","segfault-handler":"^1.3.0","semver":"^7.3.8","ts-mocha":"^10.0.0","ts-node":"^10.9.1","typedoc":"^0.23.20","typescript":"^4.8.4","uuid":"^9.0.0"},"repository":{"type":"git","url":"http://github.com/couchbase/couchnode.git"},"version":"3.2.6","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.4","nan":"^2.17.0","parse-duration":"^1.0.2","prebuild-install":"^7.1.1"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^4.0.0","@tsconfig/node10":"^1.0.9","@types/bindings":"^1.5.1","@types/debug":"^4.1.7","@types/node":"^18.11.9","@typescript-eslint/eslint-plugin":"^5.42.0","@typescript-eslint/parser":"^5.42.0","chai":"^4.3.6","eslint":"^8.26.0","eslint-config-prettier":"^8.5.0","eslint-plugin-jsdoc":"^39.6.2","eslint-plugin-mocha":"^10.1.0","eslint-plugin-node":"^11.1.0","expose-gc":"^1.0.0","mocha":"^10.1.0","npm-check-updates":"^16.3.16","nyc":"^15.1.0","prebuild":"^11.0.4","prettier":"^2.7.1","segfault-handler":"^1.3.0","semver":"^7.3.8","ts-mocha":"^10.0.0","ts-node":"^10.9.1","typedoc":"^0.23.20","typescript":"^4.8.4","uuid":"^9.0.0"},"repository":{"type":"git","url":"http://github.com/couchbase/couchnode.git"},"version":"3.2.7","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"}}