couchbase 4.4.2 → 4.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/BUILDING.md +182 -0
- package/CMakeLists.txt +13 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +4 -2
- package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
- package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
- package/deps/couchbase-cxx-client/README.md +2 -2
- package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
- package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
- package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
- package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
- package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
- package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
- package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
- package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
- package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
- package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
- package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
- package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
- package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
- package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
- package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
- package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
- package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
- package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
- package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
- package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
- package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
- package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
- package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
- package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
- package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
- package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
- package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
- package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
- package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
- package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
- package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
- package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
- package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
- package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
- package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
- package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
- package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
- package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
- package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
- package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
- package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
- package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
- package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
- package/dist/analyticsindexmanager.d.ts +98 -14
- package/dist/analyticsindexmanager.js +452 -411
- package/dist/binding.d.ts +53 -4
- package/dist/bindingutilities.d.ts +26 -1
- package/dist/bindingutilities.js +108 -1
- package/dist/couchbase.d.ts +3 -1
- package/dist/couchbase.js +2 -0
- package/dist/rangeScan.d.ts +1 -1
- package/dist/rangeScan.js +1 -1
- package/dist/transactions.d.ts +34 -3
- package/dist/transactions.js +25 -18
- package/dist/transcoders.d.ts +68 -0
- package/dist/transcoders.js +194 -1
- package/dist/usermanager.d.ts +14 -14
- package/dist/usermanager.js +178 -228
- package/dist/utilities.js +4 -6
- package/dist/utilities_internal.js +1 -2
- package/package.json +9 -8
- package/src/binding.cpp +13 -13
- package/src/connection.cpp +22 -0
- package/src/connection.hpp +12 -0
- package/src/connection_autogen.cpp +100 -0
- package/src/jstocbpp_autogen.hpp +315 -8
- package/src/jstocbpp_transactions.hpp +1 -2
- package/tools/gen-bindings-js.js +38 -3
- package/tools/gen-bindings-json.py +575 -328
package/dist/transcoders.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DefaultTranscoder = void 0;
|
3
|
+
exports.RawJsonTranscoder = exports.RawStringTranscoder = exports.RawBinaryTranscoder = exports.DefaultTranscoder = void 0;
|
4
4
|
const NF_JSON = 0x00;
|
5
5
|
const NF_RAW = 0x02;
|
6
6
|
const NF_UTF8 = 0x04;
|
@@ -86,3 +86,196 @@ class DefaultTranscoder {
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
exports.DefaultTranscoder = DefaultTranscoder;
|
89
|
+
/**
|
90
|
+
* The raw binary transcoder provides an explicit mechanism for storing and retrieving raw
|
91
|
+
* byte data.
|
92
|
+
*
|
93
|
+
* @category Key-Value
|
94
|
+
*/
|
95
|
+
class RawBinaryTranscoder {
|
96
|
+
/**
|
97
|
+
* Encodes the specified value, returning a buffer and flags that are
|
98
|
+
* stored to the server and later used for decoding.
|
99
|
+
*
|
100
|
+
* @param value The value to encode.
|
101
|
+
*/
|
102
|
+
encode(value) {
|
103
|
+
// If its a buffer, write that directly as raw.
|
104
|
+
if (Buffer.isBuffer(value)) {
|
105
|
+
return [value, CF_RAW | NF_RAW];
|
106
|
+
}
|
107
|
+
throw new Error('Only binary data supported by RawBinaryTranscoder.');
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Decodes a buffer and flags tuple back to the original type of the
|
111
|
+
* document.
|
112
|
+
*
|
113
|
+
* @param bytes The bytes that were previously encoded.
|
114
|
+
* @param flags The flags associated with the data.
|
115
|
+
*/
|
116
|
+
decode(bytes, flags) {
|
117
|
+
let format = flags & NF_MASK;
|
118
|
+
const cfformat = flags & CF_MASK;
|
119
|
+
if (cfformat !== CF_NONE) {
|
120
|
+
if (cfformat === CF_JSON) {
|
121
|
+
format = NF_JSON;
|
122
|
+
}
|
123
|
+
else if (cfformat === CF_RAW) {
|
124
|
+
format = NF_RAW;
|
125
|
+
}
|
126
|
+
else if (cfformat === CF_UTF8) {
|
127
|
+
format = NF_UTF8;
|
128
|
+
}
|
129
|
+
else if (cfformat !== CF_PRIVATE) {
|
130
|
+
// Unknown CF Format! The following will force
|
131
|
+
// fallback to reporting RAW data.
|
132
|
+
format = NF_UNKNOWN;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
if (format === NF_RAW) {
|
136
|
+
return bytes;
|
137
|
+
}
|
138
|
+
else if (format === NF_UTF8) {
|
139
|
+
throw new Error('String format not supported by RawBinaryTranscoder.');
|
140
|
+
}
|
141
|
+
else if (format === NF_JSON) {
|
142
|
+
throw new Error('JSON format not supported by RawBinaryTranscoder.');
|
143
|
+
}
|
144
|
+
else if (format === NF_UNKNOWN) {
|
145
|
+
throw new Error('Unknown format not supported by RawBinaryTranscoder.');
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
throw new Error(`Unrecognized format provided: ${format}.`);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
exports.RawBinaryTranscoder = RawBinaryTranscoder;
|
153
|
+
/**
|
154
|
+
* The raw string transcoder provides an explicit mechanism for storing and retrieving raw
|
155
|
+
* string data.
|
156
|
+
*
|
157
|
+
* @category Key-Value
|
158
|
+
*/
|
159
|
+
class RawStringTranscoder {
|
160
|
+
/**
|
161
|
+
* Encodes the specified value, returning a buffer and flags that are
|
162
|
+
* stored to the server and later used for decoding.
|
163
|
+
*
|
164
|
+
* @param value The value to encode.
|
165
|
+
*/
|
166
|
+
encode(value) {
|
167
|
+
// If its a string, encode it as a UTF8 string.
|
168
|
+
if (typeof value === 'string') {
|
169
|
+
return [Buffer.from(value), CF_UTF8 | NF_UTF8];
|
170
|
+
}
|
171
|
+
throw new Error('Only string data supported by RawStringTranscoder.');
|
172
|
+
}
|
173
|
+
/**
|
174
|
+
* Decodes a buffer and flags tuple back to the original type of the
|
175
|
+
* document.
|
176
|
+
*
|
177
|
+
* @param bytes The bytes that were previously encoded.
|
178
|
+
* @param flags The flags associated with the data.
|
179
|
+
*/
|
180
|
+
decode(bytes, flags) {
|
181
|
+
let format = flags & NF_MASK;
|
182
|
+
const cfformat = flags & CF_MASK;
|
183
|
+
if (cfformat !== CF_NONE) {
|
184
|
+
if (cfformat === CF_JSON) {
|
185
|
+
format = NF_JSON;
|
186
|
+
}
|
187
|
+
else if (cfformat === CF_RAW) {
|
188
|
+
format = NF_RAW;
|
189
|
+
}
|
190
|
+
else if (cfformat === CF_UTF8) {
|
191
|
+
format = NF_UTF8;
|
192
|
+
}
|
193
|
+
else if (cfformat !== CF_PRIVATE) {
|
194
|
+
// Unknown CF Format! The following will force
|
195
|
+
// fallback to reporting RAW data.
|
196
|
+
format = NF_UNKNOWN;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
if (format === NF_UTF8) {
|
200
|
+
return bytes.toString('utf8');
|
201
|
+
}
|
202
|
+
else if (format === NF_RAW) {
|
203
|
+
throw new Error('Binary format not supported by RawStringTranscoder.');
|
204
|
+
}
|
205
|
+
else if (format === NF_JSON) {
|
206
|
+
throw new Error('JSON format not supported by RawStringTranscoder.');
|
207
|
+
}
|
208
|
+
else if (format === NF_UNKNOWN) {
|
209
|
+
throw new Error('Unknown format not supported by RawStringTranscoder.');
|
210
|
+
}
|
211
|
+
else {
|
212
|
+
throw new Error(`Unrecognized format provided: ${format}.`);
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}
|
216
|
+
exports.RawStringTranscoder = RawStringTranscoder;
|
217
|
+
/**
|
218
|
+
* The raw JSON transcoder provides an explicit mechanism for storing and retrieving JSON data.
|
219
|
+
*
|
220
|
+
* @category Key-Value
|
221
|
+
*/
|
222
|
+
class RawJsonTranscoder {
|
223
|
+
/**
|
224
|
+
* Encodes the specified value, returning a buffer and flags that are
|
225
|
+
* stored to the server and later used for decoding.
|
226
|
+
*
|
227
|
+
* @param value The value to encode.
|
228
|
+
*/
|
229
|
+
encode(value) {
|
230
|
+
if (typeof value === 'string') {
|
231
|
+
return [Buffer.from(value), CF_JSON | NF_JSON];
|
232
|
+
}
|
233
|
+
if (Buffer.isBuffer(value)) {
|
234
|
+
return [value, CF_JSON | NF_JSON];
|
235
|
+
}
|
236
|
+
throw new Error('Only binary and string data supported by RawJsonTranscoder.');
|
237
|
+
}
|
238
|
+
/**
|
239
|
+
* Decodes a buffer and flags tuple back to the original type of the
|
240
|
+
* document.
|
241
|
+
*
|
242
|
+
* @param bytes The bytes that were previously encoded.
|
243
|
+
* @param flags The flags associated with the data.
|
244
|
+
*/
|
245
|
+
decode(bytes, flags) {
|
246
|
+
let format = flags & NF_MASK;
|
247
|
+
const cfformat = flags & CF_MASK;
|
248
|
+
if (cfformat !== CF_NONE) {
|
249
|
+
if (cfformat === CF_JSON) {
|
250
|
+
format = NF_JSON;
|
251
|
+
}
|
252
|
+
else if (cfformat === CF_RAW) {
|
253
|
+
format = NF_RAW;
|
254
|
+
}
|
255
|
+
else if (cfformat === CF_UTF8) {
|
256
|
+
format = NF_UTF8;
|
257
|
+
}
|
258
|
+
else if (cfformat !== CF_PRIVATE) {
|
259
|
+
// Unknown CF Format! The following will force
|
260
|
+
// fallback to reporting RAW data.
|
261
|
+
format = NF_UNKNOWN;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
if (format === NF_UTF8) {
|
265
|
+
throw new Error('string format not supported by RawJsonTranscoder.');
|
266
|
+
}
|
267
|
+
else if (format === NF_RAW) {
|
268
|
+
throw new Error('Binary format not supported by RawJsonTranscoder.');
|
269
|
+
}
|
270
|
+
else if (format === NF_JSON) {
|
271
|
+
return bytes;
|
272
|
+
}
|
273
|
+
else if (format === NF_UNKNOWN) {
|
274
|
+
throw new Error('Unknown format not supported by RawJsonTranscoder.');
|
275
|
+
}
|
276
|
+
else {
|
277
|
+
throw new Error(`Unrecognized format provided: ${format}.`);
|
278
|
+
}
|
279
|
+
}
|
280
|
+
}
|
281
|
+
exports.RawJsonTranscoder = RawJsonTranscoder;
|
package/dist/usermanager.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Cluster } from './cluster';
|
2
|
+
import { CppManagementRbacGroup, CppManagementRbacOrigin, CppManagementRbacRole, CppManagementRbacRoleAndDescription, CppManagementRbacRoleAndOrigins, CppManagementRbacUser, CppManagementRbacUserAndMetadata } from './binding';
|
2
3
|
import { NodeCallback } from './utilities';
|
3
4
|
/**
|
4
5
|
* Contains information about an origin for a role.
|
@@ -13,7 +14,7 @@ export declare class Origin {
|
|
13
14
|
/**
|
14
15
|
* The name of this origin.
|
15
16
|
*/
|
16
|
-
name
|
17
|
+
name?: string;
|
17
18
|
/**
|
18
19
|
* @internal
|
19
20
|
*/
|
@@ -21,7 +22,7 @@ export declare class Origin {
|
|
21
22
|
/**
|
22
23
|
* @internal
|
23
24
|
*/
|
24
|
-
static
|
25
|
+
static _fromCppData(data: CppManagementRbacOrigin): Origin;
|
25
26
|
}
|
26
27
|
/**
|
27
28
|
* Contains information about a role.
|
@@ -52,11 +53,11 @@ export declare class Role {
|
|
52
53
|
/**
|
53
54
|
* @internal
|
54
55
|
*/
|
55
|
-
static
|
56
|
+
static _fromCppData(data: CppManagementRbacRole): Role;
|
56
57
|
/**
|
57
58
|
* @internal
|
58
59
|
*/
|
59
|
-
static
|
60
|
+
static _toCppData(data: Role): CppManagementRbacRole;
|
60
61
|
}
|
61
62
|
/**
|
62
63
|
* Contains information about a role along with its description.
|
@@ -79,7 +80,7 @@ export declare class RoleAndDescription extends Role {
|
|
79
80
|
/**
|
80
81
|
* @internal
|
81
82
|
*/
|
82
|
-
static
|
83
|
+
static _fromCppData(data: CppManagementRbacRoleAndDescription): RoleAndDescription;
|
83
84
|
}
|
84
85
|
/**
|
85
86
|
* Contains information about a role along with its origin.
|
@@ -98,7 +99,7 @@ export declare class RoleAndOrigin extends Role {
|
|
98
99
|
/**
|
99
100
|
* @internal
|
100
101
|
*/
|
101
|
-
static
|
102
|
+
static _fromCppData(data: CppManagementRbacRoleAndOrigins): RoleAndOrigin;
|
102
103
|
}
|
103
104
|
/**
|
104
105
|
* Specifies information about a user.
|
@@ -140,7 +141,7 @@ export declare class User implements IUser {
|
|
140
141
|
/**
|
141
142
|
* The display name of the user.
|
142
143
|
*/
|
143
|
-
displayName
|
144
|
+
displayName?: string;
|
144
145
|
/**
|
145
146
|
* The groups associated with this user.
|
146
147
|
*/
|
@@ -160,11 +161,11 @@ export declare class User implements IUser {
|
|
160
161
|
/**
|
161
162
|
* @internal
|
162
163
|
*/
|
163
|
-
static
|
164
|
+
static _fromCppData(data: CppManagementRbacUser): User;
|
164
165
|
/**
|
165
166
|
* @internal
|
166
167
|
*/
|
167
|
-
static
|
168
|
+
static _toCppData(data: IUser): CppManagementRbacUser;
|
168
169
|
}
|
169
170
|
/**
|
170
171
|
* Contains information about a user along with some additional meta-data
|
@@ -184,7 +185,7 @@ export declare class UserAndMetadata extends User {
|
|
184
185
|
/**
|
185
186
|
* The last time the users password was changed.
|
186
187
|
*/
|
187
|
-
passwordChanged
|
188
|
+
passwordChanged?: Date;
|
188
189
|
/**
|
189
190
|
* The external groups that this user is associated with.
|
190
191
|
*/
|
@@ -203,7 +204,7 @@ export declare class UserAndMetadata extends User {
|
|
203
204
|
/**
|
204
205
|
* @internal
|
205
206
|
*/
|
206
|
-
static
|
207
|
+
static _fromCppData(data: CppManagementRbacUserAndMetadata): UserAndMetadata;
|
207
208
|
}
|
208
209
|
/**
|
209
210
|
* Specifies information about a group.
|
@@ -257,11 +258,11 @@ export declare class Group {
|
|
257
258
|
/**
|
258
259
|
* @internal
|
259
260
|
*/
|
260
|
-
static
|
261
|
+
static _fromCppData(data: CppManagementRbacGroup): Group;
|
261
262
|
/**
|
262
263
|
* @internal
|
263
264
|
*/
|
264
|
-
static
|
265
|
+
static _toCppData(data: IGroup): CppManagementRbacGroup;
|
265
266
|
}
|
266
267
|
/**
|
267
268
|
* @category Management
|
@@ -381,7 +382,6 @@ export declare class UserManager {
|
|
381
382
|
* @internal
|
382
383
|
*/
|
383
384
|
constructor(cluster: Cluster);
|
384
|
-
private get _http();
|
385
385
|
/**
|
386
386
|
* Returns a specific user by their username.
|
387
387
|
*
|