couchbase 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CMakeLists.txt +1 -0
- package/deps/couchbase-cxx-client/.gitmodules +3 -0
- package/deps/couchbase-cxx-client/.idea/misc.xml +1 -0
- package/deps/couchbase-cxx-client/.idea/vcs.xml +1 -0
- package/deps/couchbase-cxx-client/CMakeLists.txt +11 -1
- package/deps/couchbase-cxx-client/README.md +3 -3
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +4 -1
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +13 -1
- package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
- package/deps/couchbase-cxx-client/core/cluster.hxx +15 -5
- package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +17 -6
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/collection_query_index_manager.cxx +93 -0
- package/deps/couchbase-cxx-client/core/impl/configuration_profiles_registry.cxx +11 -0
- package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +119 -0
- package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +108 -0
- package/deps/couchbase-cxx-client/core/impl/get.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +76 -0
- package/deps/couchbase-cxx-client/core/impl/query.cxx +5 -7
- package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +168 -0
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +15 -1
- package/deps/couchbase-cxx-client/core/logger/configuration.hxx +3 -0
- package/deps/couchbase-cxx-client/core/logger/level.hxx +21 -0
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +4 -6
- package/deps/couchbase-cxx-client/core/meta/CMakeLists.txt +4 -2
- package/deps/couchbase-cxx-client/core/meta/features.hxx +31 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +67 -5
- package/deps/couchbase-cxx-client/core/meta/version.hxx +12 -1
- package/deps/couchbase-cxx-client/core/metrics/CMakeLists.txt +4 -1
- package/deps/couchbase-cxx-client/core/metrics/logging_meter.cxx +46 -5
- package/deps/couchbase-cxx-client/core/metrics/logging_meter.hxx +10 -26
- package/deps/couchbase-cxx-client/core/operations/document_get_projected.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +10 -12
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -3
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build.cxx +8 -14
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +15 -8
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +7 -14
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +11 -16
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.cxx +8 -12
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +4 -3
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.cxx +21 -12
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -2
- package/deps/couchbase-cxx-client/core/origin.hxx +1 -1
- package/deps/couchbase-cxx-client/core/platform/uuid.cc +1 -2
- package/deps/couchbase-cxx-client/core/protocol/cmd_hello.hxx +5 -1
- package/deps/couchbase-cxx-client/core/query_context.hxx +79 -0
- package/deps/couchbase-cxx-client/core/tracing/CMakeLists.txt +3 -1
- package/deps/couchbase-cxx-client/core/tracing/threshold_logging_tracer.cxx +19 -4
- package/deps/couchbase-cxx-client/core/tracing/threshold_logging_tracer.hxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +10 -4
- package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +52 -63
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +8 -3
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +163 -126
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +24 -37
- package/deps/couchbase-cxx-client/core/transactions/forward_compat.hxx +4 -4
- package/deps/couchbase-cxx-client/core/transactions/internal/atr_cleanup_entry.hxx +51 -13
- package/deps/couchbase-cxx-client/core/transactions/internal/client_record.hxx +26 -1
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.hxx +21 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/logging.hxx +40 -18
- package/deps/couchbase-cxx-client/core/transactions/internal/transaction_context.hxx +5 -0
- package/deps/couchbase-cxx-client/core/transactions/result.hxx +26 -0
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +48 -47
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.hxx +6 -6
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +33 -19
- package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +18 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_links.hxx +25 -2
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +4 -4
- package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +49 -56
- package/deps/couchbase-cxx-client/core/transactions/waitable_op_list.hxx +7 -7
- package/deps/couchbase-cxx-client/core/transactions.hxx +0 -12
- package/deps/couchbase-cxx-client/core/utils/binary.hxx +1 -1
- package/deps/couchbase-cxx-client/core/utils/keyspace.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +12 -45
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +6 -7
- package/deps/couchbase-cxx-client/couchbase/collection.hxx +8 -0
- package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +218 -0
- package/deps/couchbase-cxx-client/couchbase/configuration_profiles_registry.hxx +3 -0
- package/deps/couchbase-cxx-client/couchbase/create_primary_query_index_options.hxx +166 -0
- package/deps/couchbase-cxx-client/couchbase/create_query_index_options.hxx +172 -0
- package/deps/couchbase-cxx-client/couchbase/drop_primary_query_index_options.hxx +129 -0
- package/deps/couchbase-cxx-client/couchbase/drop_query_index_options.hxx +116 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/cas.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/fmt/query_scan_consistency.hxx +46 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/query_status.hxx +70 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/tls_verify_mode.hxx +46 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +100 -0
- package/deps/couchbase-cxx-client/{core → couchbase}/management/query_index.hxx +2 -2
- package/deps/couchbase-cxx-client/couchbase/metrics/meter.hxx +16 -0
- package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +178 -6
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +1 -18
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +5 -2
- package/deps/couchbase-cxx-client/couchbase/tracing/request_tracer.hxx +16 -0
- package/deps/couchbase-cxx-client/couchbase/transactions/async_attempt_context.hxx +11 -4
- package/deps/couchbase-cxx-client/couchbase/transactions/attempt_context.hxx +5 -3
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_keyspace.hxx +16 -0
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +0 -6
- package/deps/couchbase-cxx-client/couchbase/watch_query_indexes_options.hxx +115 -0
- package/deps/couchbase-cxx-client/examples/minimal.cxx +3 -1
- package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +72 -0
- package/deps/couchbase-cxx-client/test/test_integration_management.cxx +727 -310
- package/deps/couchbase-cxx-client/test/test_integration_query.cxx +4 -8
- package/deps/couchbase-cxx-client/test/test_integration_transcoders.cxx +14 -0
- package/deps/couchbase-cxx-client/test/test_transaction_transaction_public_blocking_api.cxx +34 -19
- package/deps/couchbase-cxx-client/test/test_unit_transaction_logging.cxx +66 -22
- package/deps/couchbase-cxx-client/test/test_unit_utils.cxx +51 -0
- package/deps/couchbase-cxx-client/test/tools/tool_kv_loader.cxx +2 -2
- package/deps/couchbase-cxx-client/test/utils/integration_test_guard.cxx +2 -0
- package/deps/couchbase-cxx-client/test/utils/wait_until.cxx +4 -4
- package/deps/couchbase-cxx-client/third_party/docopt/.travis.yml +103 -0
- package/deps/couchbase-cxx-client/third_party/docopt/CMakeLists.txt +129 -0
- package/deps/couchbase-cxx-client/third_party/docopt/LICENSE-Boost-1.0 +23 -0
- package/deps/couchbase-cxx-client/third_party/docopt/LICENSE-MIT +23 -0
- package/deps/couchbase-cxx-client/third_party/docopt/README.rst +479 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt-config.cmake +1 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt.cpp +687 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt.h +98 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt.pc.in +9 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt_private.h +676 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt_util.h +122 -0
- package/deps/couchbase-cxx-client/third_party/docopt/docopt_value.h +341 -0
- package/deps/couchbase-cxx-client/third_party/docopt/examples/naval_fate.cpp +36 -0
- package/deps/couchbase-cxx-client/third_party/docopt/main.cpp +16 -0
- package/deps/couchbase-cxx-client/third_party/docopt/run_testcase.cpp +40 -0
- package/deps/couchbase-cxx-client/third_party/docopt/run_tests.py +72 -0
- package/deps/couchbase-cxx-client/third_party/docopt/testcases.docopt +957 -0
- package/deps/couchbase-cxx-client/tools/CMakeLists.txt +14 -0
- package/deps/couchbase-cxx-client/tools/cbc.cxx +65 -0
- package/deps/couchbase-cxx-client/tools/command.hxx +31 -0
- package/deps/couchbase-cxx-client/tools/command_registry.cxx +43 -0
- package/deps/couchbase-cxx-client/tools/command_registry.hxx +39 -0
- package/deps/couchbase-cxx-client/tools/get.cxx +267 -0
- package/deps/couchbase-cxx-client/tools/get.hxx +26 -0
- package/deps/couchbase-cxx-client/tools/query.cxx +441 -0
- package/deps/couchbase-cxx-client/tools/query.hxx +26 -0
- package/deps/couchbase-cxx-client/tools/utils.cxx +418 -0
- package/deps/couchbase-cxx-client/tools/utils.hxx +150 -0
- package/deps/couchbase-cxx-client/tools/version.cxx +82 -0
- package/deps/couchbase-cxx-client/tools/version.hxx +26 -0
- package/dist/authenticators.d.ts +2 -2
- package/dist/authenticators.js +1 -2
- package/dist/binding.d.ts +32 -16
- package/dist/cluster.js +14 -7
- package/dist/collection.d.ts +6 -0
- package/dist/collection.js +8 -0
- package/dist/queryexecutor.js +1 -1
- package/dist/queryindexmanager.d.ts +100 -4
- package/dist/queryindexmanager.js +344 -118
- package/dist/transactions.js +0 -2
- package/package.json +1 -1
- package/src/connection.cpp +2 -0
- package/src/connection.hpp +1 -0
- package/src/connection_autogen.cpp +16 -0
- package/src/jstocbpp_autogen.hpp +93 -23
- package/src/jstocbpp_basic.hpp +24 -0
- package/src/jstocbpp_transactions.hpp +0 -8
- package/tools/gen-bindings-js.js +1 -0
- package/tools/gen-bindings-json.py +4 -2
- package/deps/couchbase-cxx-client/core/transactions/logging.cxx +0 -107
@@ -0,0 +1,26 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2023-Present Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include "command.hxx"
|
19
|
+
|
20
|
+
namespace cbc
|
21
|
+
{
|
22
|
+
class version : public command
|
23
|
+
{
|
24
|
+
void execute(const std::vector<std::string>& argv);
|
25
|
+
};
|
26
|
+
} // namespace cbc
|
package/dist/authenticators.d.ts
CHANGED
@@ -51,7 +51,7 @@ export declare class PasswordAuthenticator implements IPasswordAuthenticator {
|
|
51
51
|
/**
|
52
52
|
* The sasl mechanisms to authenticate with.
|
53
53
|
*/
|
54
|
-
allowed_sasl_mechanisms?: string[];
|
54
|
+
allowed_sasl_mechanisms?: string[] | undefined;
|
55
55
|
/**
|
56
56
|
* Constructs this PasswordAuthenticator with the passed username and password.
|
57
57
|
*
|
@@ -61,7 +61,7 @@ export declare class PasswordAuthenticator implements IPasswordAuthenticator {
|
|
61
61
|
constructor(username: string, password: string);
|
62
62
|
/**
|
63
63
|
* Creates a LDAP compatible password authenticator which is INSECURE if not used with TLS.
|
64
|
-
*
|
64
|
+
*
|
65
65
|
* Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers.
|
66
66
|
* This should only be enabled in trusted environments.
|
67
67
|
*
|
package/dist/authenticators.js
CHANGED
@@ -16,11 +16,10 @@ class PasswordAuthenticator {
|
|
16
16
|
constructor(username, password) {
|
17
17
|
this.username = username;
|
18
18
|
this.password = password;
|
19
|
-
this.allowed_sasl_mechanisms = ['SCRAM-SHA512', 'SCRAM-SHA256', 'SCRAM-SHA1'];
|
20
19
|
}
|
21
20
|
/**
|
22
21
|
* Creates a LDAP compatible password authenticator which is INSECURE if not used with TLS.
|
23
|
-
*
|
22
|
+
*
|
24
23
|
* Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers.
|
25
24
|
* This should only be enabled in trusted environments.
|
26
25
|
*
|
package/dist/binding.d.ts
CHANGED
@@ -5,6 +5,18 @@ export declare type CppBytes = string | Buffer;
|
|
5
5
|
export declare type CppDocFlags = number;
|
6
6
|
export declare type CppExpiry = number;
|
7
7
|
export declare type CppJsonString = string | Buffer;
|
8
|
+
export interface CppClusterCredentials {
|
9
|
+
username?: string;
|
10
|
+
password?: string;
|
11
|
+
certificate_path?: string;
|
12
|
+
key_path?: string;
|
13
|
+
allowed_sasl_mechanisms?: string[];
|
14
|
+
}
|
15
|
+
export interface CppDnsConfig {
|
16
|
+
nameserver?: string;
|
17
|
+
port?: number;
|
18
|
+
dnsSrvTimeout?: number;
|
19
|
+
}
|
8
20
|
export interface CppDocumentId {
|
9
21
|
bucket: string;
|
10
22
|
scope: string;
|
@@ -20,6 +32,10 @@ export interface CppMutationToken {
|
|
20
32
|
toString(): string;
|
21
33
|
toJSON(): any;
|
22
34
|
}
|
35
|
+
export interface CppQueryContext {
|
36
|
+
bucket_name: string;
|
37
|
+
scope_name: string;
|
38
|
+
}
|
23
39
|
export declare enum CppManagementAnalyticsCouchbaseLinkEncryptionLevel {
|
24
40
|
}
|
25
41
|
export declare enum CppManagementClusterBucketType {
|
@@ -568,9 +584,7 @@ export interface CppQueryRequest {
|
|
568
584
|
pipeline_cap?: number;
|
569
585
|
scan_consistency?: CppQueryScanConsistency;
|
570
586
|
mutation_state: CppMutationToken[];
|
571
|
-
|
572
|
-
scope_name?: string;
|
573
|
-
scope_qualifier?: string;
|
587
|
+
query_context?: string;
|
574
588
|
client_context_id?: string;
|
575
589
|
timeout?: CppMilliseconds;
|
576
590
|
profile: CppQueryProfile;
|
@@ -1046,6 +1060,7 @@ export interface CppManagementQueryIndexGetAllRequest {
|
|
1046
1060
|
bucket_name: string;
|
1047
1061
|
scope_name: string;
|
1048
1062
|
collection_name: string;
|
1063
|
+
query_ctx: CppQueryContext;
|
1049
1064
|
client_context_id?: string;
|
1050
1065
|
timeout?: CppMilliseconds;
|
1051
1066
|
}
|
@@ -1097,6 +1112,7 @@ export interface CppManagementQueryIndexBuildDeferredRequest {
|
|
1097
1112
|
bucket_name: string;
|
1098
1113
|
scope_name?: string;
|
1099
1114
|
collection_name?: string;
|
1115
|
+
query_ctx: CppQueryContext;
|
1100
1116
|
client_context_id?: string;
|
1101
1117
|
timeout?: CppMilliseconds;
|
1102
1118
|
}
|
@@ -1158,6 +1174,7 @@ export interface CppManagementQueryIndexDropRequest {
|
|
1158
1174
|
scope_name: string;
|
1159
1175
|
collection_name: string;
|
1160
1176
|
index_name: string;
|
1177
|
+
query_ctx: CppQueryContext;
|
1161
1178
|
is_primary: boolean;
|
1162
1179
|
ignore_if_does_not_exist: boolean;
|
1163
1180
|
client_context_id?: string;
|
@@ -1209,6 +1226,7 @@ export interface CppManagementQueryIndexCreateRequest {
|
|
1209
1226
|
collection_name: string;
|
1210
1227
|
index_name: string;
|
1211
1228
|
fields: string[];
|
1229
|
+
query_ctx: CppQueryContext;
|
1212
1230
|
is_primary: boolean;
|
1213
1231
|
ignore_if_exists: boolean;
|
1214
1232
|
condition?: string;
|
@@ -1296,6 +1314,13 @@ export interface CppManagementCollectionsManifestGetRequest {
|
|
1296
1314
|
opaque: number;
|
1297
1315
|
timeout?: CppMilliseconds;
|
1298
1316
|
}
|
1317
|
+
export interface CppManagementChangePasswordResponse {
|
1318
|
+
}
|
1319
|
+
export interface CppManagementChangePasswordRequest {
|
1320
|
+
newPassword: string;
|
1321
|
+
client_context_id?: string;
|
1322
|
+
timeout?: CppMilliseconds;
|
1323
|
+
}
|
1299
1324
|
export interface CppManagementClusterDeveloperPreviewEnableResponse {
|
1300
1325
|
}
|
1301
1326
|
export interface CppManagementClusterDeveloperPreviewEnableRequest {
|
@@ -1700,6 +1725,7 @@ export interface CppManagementQueryIndexGetAllDeferredRequest {
|
|
1700
1725
|
bucket_name: string;
|
1701
1726
|
scope_name: string;
|
1702
1727
|
collection_name: string;
|
1728
|
+
query_ctx: CppQueryContext;
|
1703
1729
|
client_context_id?: string;
|
1704
1730
|
timeout?: CppMilliseconds;
|
1705
1731
|
}
|
@@ -1715,6 +1741,7 @@ export interface CppManagementQueryIndexBuildRequest {
|
|
1715
1741
|
bucket_name: string;
|
1716
1742
|
scope_name: string;
|
1717
1743
|
collection_name: string;
|
1744
|
+
query_ctx: CppQueryContext;
|
1718
1745
|
index_names: string[];
|
1719
1746
|
client_context_id?: string;
|
1720
1747
|
timeout?: CppMilliseconds;
|
@@ -1890,6 +1917,7 @@ export interface CppConnectionAutogen {
|
|
1890
1917
|
managementAnalyticsDataverseDrop(options: CppManagementAnalyticsDataverseDropRequest, callback: (err: CppError | null, result: CppManagementAnalyticsDataverseDropResponse) => void): void;
|
1891
1918
|
managementAnalyticsLinkConnect(options: CppManagementAnalyticsLinkConnectRequest, callback: (err: CppError | null, result: CppManagementAnalyticsLinkConnectResponse) => void): void;
|
1892
1919
|
managementCollectionsManifestGet(options: CppManagementCollectionsManifestGetRequest, callback: (err: CppError | null, result: CppManagementCollectionsManifestGetResponse) => void): void;
|
1920
|
+
managementChangePassword(options: CppManagementChangePasswordRequest, callback: (err: CppError | null, result: CppManagementChangePasswordResponse) => void): void;
|
1893
1921
|
managementClusterDeveloperPreviewEnable(options: CppManagementClusterDeveloperPreviewEnableRequest, callback: (err: CppError | null, result: CppManagementClusterDeveloperPreviewEnableResponse) => void): void;
|
1894
1922
|
managementAnalyticsLinkDrop(options: CppManagementAnalyticsLinkDropRequest, callback: (err: CppError | null, result: CppManagementAnalyticsLinkDropResponse) => void): void;
|
1895
1923
|
managementBucketDescribe(options: CppManagementBucketDescribeRequest, callback: (err: CppError | null, result: CppManagementBucketDescribeResponse) => void): void;
|
@@ -2486,17 +2514,7 @@ export interface CppTxnError extends CppErrorBase {
|
|
2486
2514
|
}
|
2487
2515
|
export declare type CppError = CppGenericError | CppKeyValueError | CppViewError | CppQueryError | CppSearchError | CppAnalyticsError | CppHttpError | CppTxnOperationFailed | CppTxnError;
|
2488
2516
|
export interface CppConnection extends CppConnectionAutogen {
|
2489
|
-
connect(connStr: string, credentials:
|
2490
|
-
username?: string;
|
2491
|
-
password?: string;
|
2492
|
-
certificate_path?: string;
|
2493
|
-
key_path?: string;
|
2494
|
-
allowed_sasl_mechanisms?: string[];
|
2495
|
-
}, dnsOptions: {
|
2496
|
-
nameserver?: string;
|
2497
|
-
port?: number;
|
2498
|
-
dnsSrvTimeout?: number;
|
2499
|
-
} | null, callback: (err: CppError | null) => void): void;
|
2517
|
+
connect(connStr: string, credentials: CppClusterCredentials, dnsOptions: CppDnsConfig | null, callback: (err: CppError | null) => void): void;
|
2500
2518
|
shutdown(callback: (err: CppError | null) => void): void;
|
2501
2519
|
openBucket(bucketName: string, callback: (err: CppError | null) => void): void;
|
2502
2520
|
diagnostics(options: {
|
@@ -2627,8 +2645,6 @@ export interface CppTransaction {
|
|
2627
2645
|
named_parameters?: {
|
2628
2646
|
[key: string]: CppJsonString;
|
2629
2647
|
};
|
2630
|
-
bucket_name?: string;
|
2631
|
-
scope_name?: string;
|
2632
2648
|
}, callback: (err: CppError | null, resp: CppQueryResponse | null) => void): void;
|
2633
2649
|
commit(callback: (err: CppError | null, resp: CppTransactionResult) => void): void;
|
2634
2650
|
rollback(callback: (err: CppError | null) => void): void;
|
package/dist/cluster.js
CHANGED
@@ -356,13 +356,20 @@ class Cluster {
|
|
356
356
|
dsnObj.options.user_agent_extra = (0, utilities_internal_1.generateClientString)();
|
357
357
|
dsnObj.options.trust_certificate = this._trustStorePath;
|
358
358
|
const connStr = dsnObj.toString();
|
359
|
-
const authOpts = {
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
359
|
+
const authOpts = {};
|
360
|
+
// lets allow `allowed_sasl_mechanisms` to override legacy connstr option
|
361
|
+
for (const saslKey of ['sasl_mech_force', 'allowed_sasl_mechanisms']) {
|
362
|
+
if (!(saslKey in dsnObj.options)) {
|
363
|
+
continue;
|
364
|
+
}
|
365
|
+
if (typeof dsnObj.options[saslKey] === 'string') {
|
366
|
+
authOpts.allowed_sasl_mechanisms = [dsnObj.options[saslKey]];
|
367
|
+
}
|
368
|
+
else {
|
369
|
+
authOpts.allowed_sasl_mechanisms = dsnObj.options[saslKey];
|
370
|
+
}
|
371
|
+
delete dsnObj.options[saslKey];
|
372
|
+
}
|
366
373
|
if (this._auth) {
|
367
374
|
const passAuth = this._auth;
|
368
375
|
if (passAuth.username || passAuth.password) {
|
package/dist/collection.d.ts
CHANGED
@@ -5,6 +5,7 @@ import { Cluster } from './cluster';
|
|
5
5
|
import { CounterResult, ExistsResult, GetReplicaResult, GetResult, LookupInResult, MutateInResult, MutationResult } from './crudoptypes';
|
6
6
|
import { CouchbaseList, CouchbaseMap, CouchbaseQueue, CouchbaseSet } from './datastructures';
|
7
7
|
import { DurabilityLevel, StoreSemantics } from './generaltypes';
|
8
|
+
import { CollectionQueryIndexManager } from './queryindexmanager';
|
8
9
|
import { Scope } from './scope';
|
9
10
|
import { LookupInSpec, MutateInSpec } from './sdspecs';
|
10
11
|
import { StreamableReplicasPromise } from './streamablepromises';
|
@@ -559,4 +560,9 @@ export declare class Collection {
|
|
559
560
|
* @internal
|
560
561
|
*/
|
561
562
|
_binaryPrepend(key: string, value: string | Buffer, options?: PrependOptions, callback?: NodeCallback<MutationResult>): Promise<MutationResult>;
|
563
|
+
/**
|
564
|
+
* Returns a CollectionQueryIndexManager which can be used to manage the query indexes
|
565
|
+
* of this collection.
|
566
|
+
*/
|
567
|
+
queryIndexes(): CollectionQueryIndexManager;
|
562
568
|
}
|
package/dist/collection.js
CHANGED
@@ -30,6 +30,7 @@ const bindingutilities_1 = require("./bindingutilities");
|
|
30
30
|
const crudoptypes_1 = require("./crudoptypes");
|
31
31
|
const datastructures_1 = require("./datastructures");
|
32
32
|
const generaltypes_1 = require("./generaltypes");
|
33
|
+
const queryindexmanager_1 = require("./queryindexmanager");
|
33
34
|
const sdspecs_1 = require("./sdspecs");
|
34
35
|
const sdutils_1 = require("./sdutils");
|
35
36
|
const streamablepromises_1 = require("./streamablepromises");
|
@@ -1208,5 +1209,12 @@ class Collection {
|
|
1208
1209
|
}
|
1209
1210
|
}, callback);
|
1210
1211
|
}
|
1212
|
+
/**
|
1213
|
+
* Returns a CollectionQueryIndexManager which can be used to manage the query indexes
|
1214
|
+
* of this collection.
|
1215
|
+
*/
|
1216
|
+
queryIndexes() {
|
1217
|
+
return new queryindexmanager_1.CollectionQueryIndexManager(this);
|
1218
|
+
}
|
1211
1219
|
}
|
1212
1220
|
exports.Collection = Collection;
|
package/dist/queryexecutor.js
CHANGED
@@ -103,7 +103,7 @@ class QueryExecutor {
|
|
103
103
|
scan_consistency: (0, bindingutilities_1.queryScanConsistencyToCpp)(options.scanConsistency),
|
104
104
|
mutation_state: (0, bindingutilities_1.mutationStateToCpp)(options.consistentWith).tokens,
|
105
105
|
timeout: timeout,
|
106
|
-
|
106
|
+
query_context: options.queryContext,
|
107
107
|
profile: (0, bindingutilities_1.queryProfileToCpp)(options.profile),
|
108
108
|
raw: options.raw
|
109
109
|
? Object.fromEntries(Object.entries(options.raw)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Cluster } from './cluster';
|
2
|
+
import { Collection } from './collection';
|
2
3
|
import { NodeCallback } from './utilities';
|
3
4
|
/**
|
4
5
|
* Contains a specific index configuration for the query service.
|
@@ -57,10 +58,14 @@ export declare class QueryIndex {
|
|
57
58
|
export interface CreateQueryIndexOptions {
|
58
59
|
/**
|
59
60
|
* Specifies the collection of this index.
|
61
|
+
*
|
62
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
60
63
|
*/
|
61
64
|
collectionName?: string;
|
62
65
|
/**
|
63
66
|
* Specifies the collection scope of this index.
|
67
|
+
*
|
68
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
64
69
|
*/
|
65
70
|
scopeName?: string;
|
66
71
|
/**
|
@@ -88,10 +93,14 @@ export interface CreateQueryIndexOptions {
|
|
88
93
|
export interface CreatePrimaryQueryIndexOptions {
|
89
94
|
/**
|
90
95
|
* Specifies the collection of this index.
|
96
|
+
*
|
97
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
91
98
|
*/
|
92
99
|
collectionName?: string;
|
93
100
|
/**
|
94
101
|
* Specifies the collection scope of this index.
|
102
|
+
*
|
103
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
95
104
|
*/
|
96
105
|
scopeName?: string;
|
97
106
|
/**
|
@@ -123,10 +132,14 @@ export interface CreatePrimaryQueryIndexOptions {
|
|
123
132
|
export interface DropQueryIndexOptions {
|
124
133
|
/**
|
125
134
|
* Specifies the collection of this index.
|
135
|
+
*
|
136
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
126
137
|
*/
|
127
138
|
collectionName?: string;
|
128
139
|
/**
|
129
140
|
* Specifies the collection scope of this index.
|
141
|
+
*
|
142
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
130
143
|
*/
|
131
144
|
scopeName?: string;
|
132
145
|
/**
|
@@ -145,10 +158,14 @@ export interface DropQueryIndexOptions {
|
|
145
158
|
export interface DropPrimaryQueryIndexOptions {
|
146
159
|
/**
|
147
160
|
* Specifies the collection of this index.
|
161
|
+
*
|
162
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
148
163
|
*/
|
149
164
|
collectionName?: string;
|
150
165
|
/**
|
151
166
|
* Specifies the collection scope of this index.
|
167
|
+
*
|
168
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
152
169
|
*/
|
153
170
|
scopeName?: string;
|
154
171
|
/**
|
@@ -171,10 +188,14 @@ export interface DropPrimaryQueryIndexOptions {
|
|
171
188
|
export interface GetAllQueryIndexesOptions {
|
172
189
|
/**
|
173
190
|
* Specifies the collection of this index.
|
191
|
+
*
|
192
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
174
193
|
*/
|
175
194
|
collectionName?: string;
|
176
195
|
/**
|
177
196
|
* Specifies the collection scope of this index.
|
197
|
+
*
|
198
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
178
199
|
*/
|
179
200
|
scopeName?: string;
|
180
201
|
/**
|
@@ -188,10 +209,14 @@ export interface GetAllQueryIndexesOptions {
|
|
188
209
|
export interface BuildQueryIndexOptions {
|
189
210
|
/**
|
190
211
|
* Specifies the collection of this index.
|
212
|
+
*
|
213
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
191
214
|
*/
|
192
215
|
collectionName?: string;
|
193
216
|
/**
|
194
217
|
* Specifies the collection scope of this index.
|
218
|
+
*
|
219
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
195
220
|
*/
|
196
221
|
scopeName?: string;
|
197
222
|
/**
|
@@ -205,10 +230,14 @@ export interface BuildQueryIndexOptions {
|
|
205
230
|
export interface WatchQueryIndexOptions {
|
206
231
|
/**
|
207
232
|
* Specifies the collection of this index.
|
233
|
+
*
|
234
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
208
235
|
*/
|
209
236
|
collectionName?: string;
|
210
237
|
/**
|
211
238
|
* Specifies the collection scope of this index.
|
239
|
+
*
|
240
|
+
* @deprecated Use {@link CollectionQueryIndexManager} instead.
|
212
241
|
*/
|
213
242
|
scopeName?: string;
|
214
243
|
/**
|
@@ -216,6 +245,76 @@ export interface WatchQueryIndexOptions {
|
|
216
245
|
*/
|
217
246
|
watchPrimary?: boolean;
|
218
247
|
}
|
248
|
+
/**
|
249
|
+
* CollectionQueryIndexManager provides an interface for managing the
|
250
|
+
* query indexes on the collection.
|
251
|
+
*
|
252
|
+
* @category Management
|
253
|
+
*/
|
254
|
+
export declare class CollectionQueryIndexManager {
|
255
|
+
private _bucketName;
|
256
|
+
private _collectionName;
|
257
|
+
private _manager;
|
258
|
+
private _scopeName;
|
259
|
+
/**
|
260
|
+
* @internal
|
261
|
+
*/
|
262
|
+
constructor(collection: Collection);
|
263
|
+
/**
|
264
|
+
* Creates a new query index.
|
265
|
+
*
|
266
|
+
* @param indexName The name of the new index.
|
267
|
+
* @param fields The fields which this index should cover.
|
268
|
+
* @param options Optional parameters for this operation.
|
269
|
+
* @param callback A node-style callback to be invoked after execution.
|
270
|
+
*/
|
271
|
+
createIndex(indexName: string, fields: string[], options?: CreateQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
272
|
+
/**
|
273
|
+
* Creates a new primary query index.
|
274
|
+
*
|
275
|
+
* @param options Optional parameters for this operation.
|
276
|
+
* @param callback A node-style callback to be invoked after execution.
|
277
|
+
*/
|
278
|
+
createPrimaryIndex(options?: CreatePrimaryQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
279
|
+
/**
|
280
|
+
* Drops an existing query index.
|
281
|
+
*
|
282
|
+
* @param indexName The name of the index to drop.
|
283
|
+
* @param options Optional parameters for this operation.
|
284
|
+
* @param callback A node-style callback to be invoked after execution.
|
285
|
+
*/
|
286
|
+
dropIndex(indexName: string, options?: DropQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
287
|
+
/**
|
288
|
+
* Drops an existing primary index.
|
289
|
+
*
|
290
|
+
* @param options Optional parameters for this operation.
|
291
|
+
* @param callback A node-style callback to be invoked after execution.
|
292
|
+
*/
|
293
|
+
dropPrimaryIndex(options?: DropPrimaryQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
294
|
+
/**
|
295
|
+
* Returns a list of indexes for a specific bucket.
|
296
|
+
*
|
297
|
+
* @param options Optional parameters for this operation.
|
298
|
+
* @param callback A node-style callback to be invoked after execution.
|
299
|
+
*/
|
300
|
+
getAllIndexes(options?: GetAllQueryIndexesOptions, callback?: NodeCallback<QueryIndex[]>): Promise<QueryIndex[]>;
|
301
|
+
/**
|
302
|
+
* Starts building any indexes which were previously created with deferred=true.
|
303
|
+
*
|
304
|
+
* @param options Optional parameters for this operation.
|
305
|
+
* @param callback A node-style callback to be invoked after execution.
|
306
|
+
*/
|
307
|
+
buildDeferredIndexes(options?: BuildQueryIndexOptions, callback?: NodeCallback<string[]>): Promise<string[]>;
|
308
|
+
/**
|
309
|
+
* Waits for a number of indexes to finish creation and be ready to use.
|
310
|
+
*
|
311
|
+
* @param indexNames The names of the indexes to watch.
|
312
|
+
* @param timeout The maximum time to wait for the index, expressed in milliseconds.
|
313
|
+
* @param options Optional parameters for this operation.
|
314
|
+
* @param callback A node-style callback to be invoked after execution.
|
315
|
+
*/
|
316
|
+
watchIndexes(indexNames: string[], timeout: number, options?: WatchQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
317
|
+
}
|
219
318
|
/**
|
220
319
|
* QueryIndexManager provides an interface for managing the
|
221
320
|
* query indexes on the cluster.
|
@@ -223,13 +322,11 @@ export interface WatchQueryIndexOptions {
|
|
223
322
|
* @category Management
|
224
323
|
*/
|
225
324
|
export declare class QueryIndexManager {
|
226
|
-
private
|
325
|
+
private _manager;
|
227
326
|
/**
|
228
327
|
* @internal
|
229
328
|
*/
|
230
329
|
constructor(cluster: Cluster);
|
231
|
-
private get _http();
|
232
|
-
private _createIndex;
|
233
330
|
/**
|
234
331
|
* Creates a new query index.
|
235
332
|
*
|
@@ -248,7 +345,6 @@ export declare class QueryIndexManager {
|
|
248
345
|
* @param callback A node-style callback to be invoked after execution.
|
249
346
|
*/
|
250
347
|
createPrimaryIndex(bucketName: string, options?: CreatePrimaryQueryIndexOptions, callback?: NodeCallback<void>): Promise<void>;
|
251
|
-
private _dropIndex;
|
252
348
|
/**
|
253
349
|
* Drops an existing query index.
|
254
350
|
*
|