couchbase 4.6.1 → 4.7.0-dev.1
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.
- package/CMakeLists.txt +2 -1
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +23 -5
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
- package/deps/couchbase-cxx-client/CMakeLists.txt +24 -11
- package/deps/couchbase-cxx-client/README.md +2 -2
- package/deps/couchbase-cxx-client/cmake/APKBUILD.in +17 -1
- package/deps/couchbase-cxx-client/cmake/Bundler.cmake +9 -1
- package/deps/couchbase-cxx-client/cmake/Cache.cmake +48 -19
- package/deps/couchbase-cxx-client/cmake/CompilerOptions.cmake +3 -1
- package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +10 -2
- package/deps/couchbase-cxx-client/cmake/Packaging.cmake +48 -8
- package/deps/couchbase-cxx-client/cmake/ThirdPartyDependencies.cmake +41 -0
- package/deps/couchbase-cxx-client/cmake/build_config.hxx.in +2 -0
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +18 -0
- package/deps/couchbase-cxx-client/cmake/debian/control +6 -1
- package/deps/couchbase-cxx-client/cmake/debian/rules +1 -0
- package/deps/couchbase-cxx-client/cmake/tarball_glob.txt +10 -0
- package/deps/couchbase-cxx-client/core/app_telemetry_meter.cxx +1 -0
- package/deps/couchbase-cxx-client/core/app_telemetry_reporter.cxx +45 -43
- package/deps/couchbase-cxx-client/core/app_telemetry_reporter.hxx +4 -3
- package/deps/couchbase-cxx-client/core/bucket.cxx +128 -13
- package/deps/couchbase-cxx-client/core/bucket.hxx +12 -2
- package/deps/couchbase-cxx-client/core/cluster.cxx +304 -152
- package/deps/couchbase-cxx-client/core/cluster.hxx +32 -0
- package/deps/couchbase-cxx-client/core/cluster_credentials.cxx +25 -0
- package/deps/couchbase-cxx-client/core/cluster_credentials.hxx +5 -0
- package/deps/couchbase-cxx-client/core/cluster_label_listener.cxx +72 -0
- package/deps/couchbase-cxx-client/core/cluster_label_listener.hxx +46 -0
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +4 -0
- package/deps/couchbase-cxx-client/core/deprecation_utils.hxx +26 -0
- package/deps/couchbase-cxx-client/core/error.hxx +27 -0
- package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +0 -2
- package/deps/couchbase-cxx-client/core/http_component.cxx +12 -48
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +3 -2
- package/deps/couchbase-cxx-client/core/impl/analytics.hxx +2 -1
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +249 -137
- package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +134 -58
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +87 -35
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +560 -245
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +89 -49
- package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +3 -3
- package/deps/couchbase-cxx-client/core/impl/error.cxx +20 -13
- package/deps/couchbase-cxx-client/core/impl/error.hxx +15 -10
- package/deps/couchbase-cxx-client/core/impl/get_all_replicas.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/get_any_replica.hxx +2 -1
- package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/observability_recorder.cxx +161 -0
- package/deps/couchbase-cxx-client/core/impl/observability_recorder.hxx +77 -0
- package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/public_bucket.cxx +31 -7
- package/deps/couchbase-cxx-client/core/impl/public_cluster.cxx +107 -19
- package/deps/couchbase-cxx-client/core/impl/query.cxx +6 -3
- package/deps/couchbase-cxx-client/core/impl/query.hxx +3 -1
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +267 -102
- package/deps/couchbase-cxx-client/core/impl/scope.cxx +53 -11
- package/deps/couchbase-cxx-client/core/impl/search.cxx +8 -4
- package/deps/couchbase-cxx-client/core/impl/search.hxx +6 -2
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +131 -41
- package/deps/couchbase-cxx-client/core/impl/with_cancellation.hxx +75 -0
- package/deps/couchbase-cxx-client/core/io/config_tracker.cxx +9 -9
- package/deps/couchbase-cxx-client/core/io/config_tracker.hxx +2 -1
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +98 -49
- package/deps/couchbase-cxx-client/core/io/http_context.hxx +2 -0
- package/deps/couchbase-cxx-client/core/io/http_session.cxx +23 -10
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -9
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +163 -228
- package/deps/couchbase-cxx-client/core/io/http_traits.hxx +0 -7
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +123 -44
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +251 -26
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +9 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_traits.hxx +0 -8
- package/deps/couchbase-cxx-client/core/io/streams.cxx +3 -3
- package/deps/couchbase-cxx-client/core/io/streams.hxx +3 -2
- package/deps/couchbase-cxx-client/core/meta/features.hxx +15 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +13 -0
- package/deps/couchbase-cxx-client/core/meta/version.hxx +3 -0
- package/deps/couchbase-cxx-client/core/metrics/constants.hxx +23 -0
- package/deps/couchbase-cxx-client/core/metrics/logging_meter.cxx +5 -5
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +65 -63
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +12 -10
- package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +0 -5
- package/deps/couchbase-cxx-client/core/operations/document_append.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +0 -5
- package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +0 -7
- package/deps/couchbase-cxx-client/core/operations/document_get.hxx +0 -7
- package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +77 -27
- package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +0 -9
- package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +0 -9
- package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +83 -2
- package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +0 -9
- package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +0 -5
- package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +0 -9
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +46 -4
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +121 -43
- package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +0 -5
- package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +0 -7
- package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +0 -7
- package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +0 -6
- package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +0 -4
- package/deps/couchbase-cxx-client/core/operations/document_view.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.hxx +10 -13
- package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +2 -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 +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +2 -0
- 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/error_utils.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +2 -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 +68 -30
- 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.hxx +2 -0
- 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.hxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +2 -0
- 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 +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +2 -0
- 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.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/operation_traits.hxx +6 -0
- package/deps/couchbase-cxx-client/core/operations.hxx +0 -1
- package/deps/couchbase-cxx-client/core/operations_fwd.hxx +8 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +67 -12
- package/deps/couchbase-cxx-client/core/origin.hxx +13 -8
- package/deps/couchbase-cxx-client/core/orphan_reporter.cxx +164 -0
- package/deps/couchbase-cxx-client/core/orphan_reporter.hxx +65 -0
- package/deps/couchbase-cxx-client/core/sasl/CMakeLists.txt +1 -0
- package/deps/couchbase-cxx-client/core/sasl/client.cc +6 -0
- package/deps/couchbase-cxx-client/core/sasl/mechanism.cc +2 -1
- package/deps/couchbase-cxx-client/core/sasl/mechanism.h +2 -1
- package/deps/couchbase-cxx-client/core/sasl/oauthbearer/oauthbearer.cc +41 -0
- package/deps/couchbase-cxx-client/core/sasl/oauthbearer/oauthbearer.h +47 -0
- package/deps/couchbase-cxx-client/core/tls_context_provider.cxx +44 -0
- package/deps/couchbase-cxx-client/core/tls_context_provider.hxx +44 -0
- package/deps/couchbase-cxx-client/core/tracing/attribute_helpers.hxx +45 -0
- package/deps/couchbase-cxx-client/core/tracing/constants.hxx +148 -68
- package/deps/couchbase-cxx-client/core/tracing/threshold_logging_options.hxx +0 -3
- package/deps/couchbase-cxx-client/core/tracing/threshold_logging_tracer.cxx +122 -170
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +17 -24
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +8 -10
- package/deps/couchbase-cxx-client/core/tracing/wrapper_sdk_tracer.cxx +114 -0
- package/deps/couchbase-cxx-client/core/tracing/wrapper_sdk_tracer.hxx +85 -0
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +16 -14
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +4 -4
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +1 -1
- package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +1 -2
- package/deps/couchbase-cxx-client/core/utils/byteswap.hxx +12 -0
- package/deps/couchbase-cxx-client/core/utils/concurrent_fixed_priority_queue.hxx +102 -0
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +2 -0
- package/deps/couchbase-cxx-client/couchbase/certificate_authenticator.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +47 -0
- package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +16 -0
- package/deps/couchbase-cxx-client/couchbase/collection.hxx +60 -15
- package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +48 -48
- package/deps/couchbase-cxx-client/couchbase/jwt_authenticator.hxx +52 -0
- package/deps/couchbase-cxx-client/couchbase/metrics/meter.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +75 -80
- package/deps/couchbase-cxx-client/couchbase/network_options.hxx +19 -0
- package/deps/couchbase-cxx-client/couchbase/password_authenticator.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/tracing/otel_tracer.hxx +15 -17
- package/deps/couchbase-cxx-client/couchbase/tracing/request_span.hxx +2 -2
- package/dist/analyticsexecutor.d.ts +15 -0
- package/dist/analyticsexecutor.js +79 -50
- package/dist/analyticsindexmanager.d.ts +66 -0
- package/dist/analyticsindexmanager.js +404 -277
- package/dist/analyticstypes.d.ts +5 -0
- package/dist/authenticators.d.ts +34 -1
- package/dist/authenticators.js +19 -1
- package/dist/binarycollection.d.ts +17 -0
- package/dist/binding.d.ts +245 -228
- package/dist/bindingutilities.js +1 -1
- package/dist/bucket.d.ts +8 -0
- package/dist/bucket.js +8 -0
- package/dist/bucketmanager.d.ts +30 -0
- package/dist/bucketmanager.js +128 -69
- package/dist/cluster.d.ts +45 -0
- package/dist/cluster.js +133 -21
- package/dist/collection.d.ts +75 -2
- package/dist/collection.js +772 -551
- package/dist/collectionmanager.d.ts +34 -0
- package/dist/collectionmanager.js +172 -89
- package/dist/couchbase.d.ts +5 -0
- package/dist/couchbase.js +5 -0
- package/dist/datastructures.js +310 -97
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +12 -1
- package/dist/eventingfunctionmanager.d.ts +42 -0
- package/dist/eventingfunctionmanager.js +172 -100
- package/dist/logger.d.ts +192 -0
- package/dist/logger.js +213 -0
- package/dist/loggingmeter.d.ts +120 -0
- package/dist/loggingmeter.js +226 -0
- package/dist/metrics.d.ts +33 -0
- package/dist/metrics.js +5 -0
- package/dist/observability.d.ts +60 -0
- package/dist/observability.js +86 -0
- package/dist/observabilityhandler.d.ts +176 -0
- package/dist/observabilityhandler.js +733 -0
- package/dist/observabilitytypes.d.ts +320 -0
- package/dist/observabilitytypes.js +362 -0
- package/dist/observabilityutilities.d.ts +60 -0
- package/dist/observabilityutilities.js +175 -0
- package/dist/otelmeter.d.ts +51 -0
- package/dist/otelmeter.js +100 -0
- package/dist/oteltracer.d.ts +69 -0
- package/dist/oteltracer.js +141 -0
- package/dist/queryexecutor.d.ts +16 -0
- package/dist/queryexecutor.js +128 -86
- package/dist/queryindexmanager.d.ts +29 -0
- package/dist/queryindexmanager.js +277 -150
- package/dist/querytypes.d.ts +5 -0
- package/dist/scope.js +2 -2
- package/dist/scopeeventingfunctionmanager.d.ts +5 -0
- package/dist/scopeeventingfunctionmanager.js +217 -119
- package/dist/scopesearchindexmanager.d.ts +5 -0
- package/dist/scopesearchindexmanager.js +295 -166
- package/dist/sdspecs.js +6 -1
- package/dist/searchexecutor.d.ts +15 -0
- package/dist/searchexecutor.js +54 -26
- package/dist/searchindexmanager.d.ts +54 -0
- package/dist/searchindexmanager.js +235 -142
- package/dist/searchtypes.d.ts +5 -0
- package/dist/thresholdlogging.d.ts +301 -0
- package/dist/thresholdlogging.js +657 -0
- package/dist/tracing.d.ts +55 -0
- package/dist/tracing.js +2 -0
- package/dist/usermanager.d.ts +46 -0
- package/dist/usermanager.js +199 -118
- package/dist/utilities.d.ts +4 -0
- package/dist/utilities.js +11 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.js +7 -0
- package/dist/viewexecutor.d.ts +15 -0
- package/dist/viewexecutor.js +54 -29
- package/dist/viewindexmanager.d.ts +30 -0
- package/dist/viewindexmanager.js +129 -100
- package/dist/viewtypes.d.ts +5 -0
- package/package.json +19 -9
- package/scripts/prebuilds.js +1 -1
- package/scripts/updateVersion.js +26 -0
- package/src/connection.cpp +79 -98
- package/src/connection.hpp +46 -38
- package/src/connection_autogen.cpp +1236 -292
- package/src/jstocbpp_autogen.hpp +1117 -313
- package/src/jstocbpp_basic.hpp +73 -0
- package/src/jstocbpp_defs.hpp +37 -9
- package/src/jstocbpp_errors.hpp +37 -11
- package/tools/gen-bindings-js.js +100 -22
- package/tools/gen-bindings-json.py +40 -6
- package/src/transcoder.hpp +0 -96
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AttributeValue, SpanStatus, TimeInput } from './observabilitytypes';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single traced operation (span) in distributed tracing.
|
|
4
|
+
*
|
|
5
|
+
* A RequestSpan provides methods to add metadata (attributes), record events,
|
|
6
|
+
* set the final status, and mark the completion of an operation.
|
|
7
|
+
*/
|
|
8
|
+
export interface RequestSpan {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the span, describing the operation being traced.
|
|
11
|
+
*/
|
|
12
|
+
readonly name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Sets a single attribute (key-value pair) on the span.
|
|
15
|
+
*
|
|
16
|
+
* @param key - The attribute key.
|
|
17
|
+
* @param value - The attribute value.
|
|
18
|
+
*/
|
|
19
|
+
setAttribute(key: string, value: AttributeValue): void;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a timestamped event to the span.
|
|
22
|
+
*
|
|
23
|
+
* @param key - The event name.
|
|
24
|
+
* @param startTime - The start time of the event.
|
|
25
|
+
*/
|
|
26
|
+
addEvent(key: string, startTime?: TimeInput): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the final status of the span.
|
|
29
|
+
*
|
|
30
|
+
* @param status - The span status containing code and optional message.
|
|
31
|
+
*/
|
|
32
|
+
setStatus(status: SpanStatus): void;
|
|
33
|
+
/**
|
|
34
|
+
* Marks the span as complete and records the end time.
|
|
35
|
+
*
|
|
36
|
+
* @param endTime - Optional end time; defaults to current time if not provided.
|
|
37
|
+
*/
|
|
38
|
+
end(endTime?: TimeInput): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface for creating and managing distributed tracing spans.
|
|
42
|
+
*
|
|
43
|
+
* A RequestTracer is responsible for creating new spans to track operations.
|
|
44
|
+
*/
|
|
45
|
+
export interface RequestTracer {
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new span to trace an operation.
|
|
48
|
+
*
|
|
49
|
+
* @param name - The name of the span, describing the operation being traced.
|
|
50
|
+
* @param parentSpan - Optional parent span for creating hierarchical traces.
|
|
51
|
+
* @param startTime - Optional start time; defaults to current time if not provided.
|
|
52
|
+
* @returns A new RequestSpan instance.
|
|
53
|
+
*/
|
|
54
|
+
requestSpan(name: string, parentSpan?: RequestSpan, startTime?: TimeInput): RequestSpan;
|
|
55
|
+
}
|
package/dist/tracing.js
ADDED
package/dist/usermanager.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Cluster } from './cluster';
|
|
2
2
|
import { CppManagementRbacGroup, CppManagementRbacOrigin, CppManagementRbacRole, CppManagementRbacRoleAndDescription, CppManagementRbacRoleAndOrigins, CppManagementRbacUser, CppManagementRbacUserAndMetadata } from './binding';
|
|
3
|
+
import { ObservabilityInstruments } from './observabilitytypes';
|
|
4
|
+
import { RequestSpan } from './tracing';
|
|
3
5
|
import { NodeCallback } from './utilities';
|
|
4
6
|
/**
|
|
5
7
|
* Contains information about an origin for a role.
|
|
@@ -276,6 +278,10 @@ export interface GetUserOptions {
|
|
|
276
278
|
* The timeout for this operation, represented in milliseconds.
|
|
277
279
|
*/
|
|
278
280
|
timeout?: number;
|
|
281
|
+
/**
|
|
282
|
+
* Specifies the parent span for this specific operation.
|
|
283
|
+
*/
|
|
284
|
+
parentSpan?: RequestSpan;
|
|
279
285
|
}
|
|
280
286
|
/**
|
|
281
287
|
* @category Management
|
|
@@ -289,6 +295,10 @@ export interface GetAllUsersOptions {
|
|
|
289
295
|
* The timeout for this operation, represented in milliseconds.
|
|
290
296
|
*/
|
|
291
297
|
timeout?: number;
|
|
298
|
+
/**
|
|
299
|
+
* Specifies the parent span for this specific operation.
|
|
300
|
+
*/
|
|
301
|
+
parentSpan?: RequestSpan;
|
|
292
302
|
}
|
|
293
303
|
/**
|
|
294
304
|
* @category Management
|
|
@@ -302,6 +312,10 @@ export interface UpsertUserOptions {
|
|
|
302
312
|
* The timeout for this operation, represented in milliseconds.
|
|
303
313
|
*/
|
|
304
314
|
timeout?: number;
|
|
315
|
+
/**
|
|
316
|
+
* Specifies the parent span for this specific operation.
|
|
317
|
+
*/
|
|
318
|
+
parentSpan?: RequestSpan;
|
|
305
319
|
}
|
|
306
320
|
/**
|
|
307
321
|
* @category Management
|
|
@@ -311,6 +325,10 @@ export interface ChangePasswordOptions {
|
|
|
311
325
|
* The timeout for this operation, represented in milliseconds.
|
|
312
326
|
*/
|
|
313
327
|
timeout?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Specifies the parent span for this specific operation.
|
|
330
|
+
*/
|
|
331
|
+
parentSpan?: RequestSpan;
|
|
314
332
|
}
|
|
315
333
|
/**
|
|
316
334
|
* @category Management
|
|
@@ -324,6 +342,10 @@ export interface DropUserOptions {
|
|
|
324
342
|
* The timeout for this operation, represented in milliseconds.
|
|
325
343
|
*/
|
|
326
344
|
timeout?: number;
|
|
345
|
+
/**
|
|
346
|
+
* Specifies the parent span for this specific operation.
|
|
347
|
+
*/
|
|
348
|
+
parentSpan?: RequestSpan;
|
|
327
349
|
}
|
|
328
350
|
/**
|
|
329
351
|
* @category Management
|
|
@@ -333,6 +355,10 @@ export interface GetRolesOptions {
|
|
|
333
355
|
* The timeout for this operation, represented in milliseconds.
|
|
334
356
|
*/
|
|
335
357
|
timeout?: number;
|
|
358
|
+
/**
|
|
359
|
+
* Specifies the parent span for this specific operation.
|
|
360
|
+
*/
|
|
361
|
+
parentSpan?: RequestSpan;
|
|
336
362
|
}
|
|
337
363
|
/**
|
|
338
364
|
* @category Management
|
|
@@ -342,6 +368,10 @@ export interface GetGroupOptions {
|
|
|
342
368
|
* The timeout for this operation, represented in milliseconds.
|
|
343
369
|
*/
|
|
344
370
|
timeout?: number;
|
|
371
|
+
/**
|
|
372
|
+
* Specifies the parent span for this specific operation.
|
|
373
|
+
*/
|
|
374
|
+
parentSpan?: RequestSpan;
|
|
345
375
|
}
|
|
346
376
|
/**
|
|
347
377
|
* @category Management
|
|
@@ -351,6 +381,10 @@ export interface GetAllGroupsOptions {
|
|
|
351
381
|
* The timeout for this operation, represented in milliseconds.
|
|
352
382
|
*/
|
|
353
383
|
timeout?: number;
|
|
384
|
+
/**
|
|
385
|
+
* Specifies the parent span for this specific operation.
|
|
386
|
+
*/
|
|
387
|
+
parentSpan?: RequestSpan;
|
|
354
388
|
}
|
|
355
389
|
/**
|
|
356
390
|
* @category Management
|
|
@@ -360,6 +394,10 @@ export interface UpsertGroupOptions {
|
|
|
360
394
|
* The timeout for this operation, represented in milliseconds.
|
|
361
395
|
*/
|
|
362
396
|
timeout?: number;
|
|
397
|
+
/**
|
|
398
|
+
* Specifies the parent span for this specific operation.
|
|
399
|
+
*/
|
|
400
|
+
parentSpan?: RequestSpan;
|
|
363
401
|
}
|
|
364
402
|
/**
|
|
365
403
|
* @category Management
|
|
@@ -369,6 +407,10 @@ export interface DropGroupOptions {
|
|
|
369
407
|
* The timeout for this operation, represented in milliseconds.
|
|
370
408
|
*/
|
|
371
409
|
timeout?: number;
|
|
410
|
+
/**
|
|
411
|
+
* Specifies the parent span for this specific operation.
|
|
412
|
+
*/
|
|
413
|
+
parentSpan?: RequestSpan;
|
|
372
414
|
}
|
|
373
415
|
/**
|
|
374
416
|
* UserManager is an interface which enables the management of users,
|
|
@@ -382,6 +424,10 @@ export declare class UserManager {
|
|
|
382
424
|
* @internal
|
|
383
425
|
*/
|
|
384
426
|
constructor(cluster: Cluster);
|
|
427
|
+
/**
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
get observabilityInstruments(): ObservabilityInstruments;
|
|
385
431
|
/**
|
|
386
432
|
* Returns a specific user by their username.
|
|
387
433
|
*
|
package/dist/usermanager.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserManager = exports.Group = exports.UserAndMetadata = exports.User = exports.RoleAndOrigin = exports.RoleAndDescription = exports.Role = exports.Origin = void 0;
|
|
4
4
|
const bindingutilities_1 = require("./bindingutilities");
|
|
5
|
+
const observability_1 = require("./observability");
|
|
6
|
+
const observabilityhandler_1 = require("./observabilityhandler");
|
|
7
|
+
const observabilitytypes_1 = require("./observabilitytypes");
|
|
5
8
|
const utilities_1 = require("./utilities");
|
|
6
9
|
/**
|
|
7
10
|
* Contains information about an origin for a role.
|
|
@@ -293,6 +296,12 @@ class UserManager {
|
|
|
293
296
|
constructor(cluster) {
|
|
294
297
|
this._cluster = cluster;
|
|
295
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* @internal
|
|
301
|
+
*/
|
|
302
|
+
get observabilityInstruments() {
|
|
303
|
+
return this._cluster.observabilityInstruments;
|
|
304
|
+
}
|
|
296
305
|
/**
|
|
297
306
|
* Returns a specific user by their username.
|
|
298
307
|
*
|
|
@@ -308,21 +317,29 @@ class UserManager {
|
|
|
308
317
|
if (!options) {
|
|
309
318
|
options = {};
|
|
310
319
|
}
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.UserGet, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
321
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
322
|
+
try {
|
|
323
|
+
const cppDomain = (0, bindingutilities_1.authDomainToCpp)(options.domainName || 'local');
|
|
324
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
325
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
326
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementUserGet.bind(this._cluster.conn), {
|
|
327
|
+
username: username,
|
|
328
|
+
domain: cppDomain,
|
|
329
|
+
timeout: timeout,
|
|
330
|
+
}, obsReqHandler);
|
|
320
331
|
if (err) {
|
|
321
|
-
|
|
332
|
+
obsReqHandler.endWithError(err);
|
|
333
|
+
throw err;
|
|
322
334
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
335
|
+
obsReqHandler.end();
|
|
336
|
+
return UserAndMetadata._fromCppData(resp.user);
|
|
337
|
+
}, callback);
|
|
338
|
+
}
|
|
339
|
+
catch (err) {
|
|
340
|
+
obsReqHandler.endWithError(err);
|
|
341
|
+
throw err;
|
|
342
|
+
}
|
|
326
343
|
}
|
|
327
344
|
/**
|
|
328
345
|
* Returns a list of all existing users.
|
|
@@ -338,21 +355,28 @@ class UserManager {
|
|
|
338
355
|
if (!options) {
|
|
339
356
|
options = {};
|
|
340
357
|
}
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
358
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.UserGetAll, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
359
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
360
|
+
try {
|
|
361
|
+
const cppDomain = (0, bindingutilities_1.authDomainToCpp)(options.domainName || 'local');
|
|
362
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
363
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
364
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementUserGetAll.bind(this._cluster.conn), {
|
|
365
|
+
domain: cppDomain,
|
|
366
|
+
timeout: timeout,
|
|
367
|
+
}, obsReqHandler);
|
|
349
368
|
if (err) {
|
|
350
|
-
|
|
369
|
+
obsReqHandler.endWithError(err);
|
|
370
|
+
throw err;
|
|
351
371
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
});
|
|
355
|
-
}
|
|
372
|
+
obsReqHandler.end();
|
|
373
|
+
return resp.users.map((user) => UserAndMetadata._fromCppData(user));
|
|
374
|
+
}, callback);
|
|
375
|
+
}
|
|
376
|
+
catch (err) {
|
|
377
|
+
obsReqHandler.endWithError(err);
|
|
378
|
+
throw err;
|
|
379
|
+
}
|
|
356
380
|
}
|
|
357
381
|
/**
|
|
358
382
|
* Creates or updates an existing user.
|
|
@@ -369,21 +393,28 @@ class UserManager {
|
|
|
369
393
|
if (!options) {
|
|
370
394
|
options = {};
|
|
371
395
|
}
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
396
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.UserUpsert, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
397
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
398
|
+
try {
|
|
399
|
+
const cppDomain = (0, bindingutilities_1.authDomainToCpp)(options.domainName || 'local');
|
|
400
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
401
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
402
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementUserUpsert.bind(this._cluster.conn), {
|
|
403
|
+
user: User._toCppData(user),
|
|
404
|
+
domain: cppDomain,
|
|
405
|
+
timeout: timeout,
|
|
406
|
+
}, obsReqHandler);
|
|
381
407
|
if (err) {
|
|
382
|
-
|
|
408
|
+
obsReqHandler.endWithError(err);
|
|
409
|
+
throw err;
|
|
383
410
|
}
|
|
384
|
-
|
|
385
|
-
});
|
|
386
|
-
}
|
|
411
|
+
obsReqHandler.end();
|
|
412
|
+
}, callback);
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
obsReqHandler.endWithError(err);
|
|
416
|
+
throw err;
|
|
417
|
+
}
|
|
387
418
|
}
|
|
388
419
|
/**
|
|
389
420
|
* Change password for the currently authenticatd user.
|
|
@@ -400,19 +431,26 @@ class UserManager {
|
|
|
400
431
|
if (!options) {
|
|
401
432
|
options = {};
|
|
402
433
|
}
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
434
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.ChangePassword, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
435
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
436
|
+
try {
|
|
437
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
438
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
439
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementChangePassword.bind(this._cluster.conn), {
|
|
440
|
+
newPassword: newPassword,
|
|
441
|
+
timeout: timeout,
|
|
442
|
+
}, obsReqHandler);
|
|
410
443
|
if (err) {
|
|
411
|
-
|
|
444
|
+
obsReqHandler.endWithError(err);
|
|
445
|
+
throw err;
|
|
412
446
|
}
|
|
413
|
-
|
|
414
|
-
});
|
|
415
|
-
}
|
|
447
|
+
obsReqHandler.end();
|
|
448
|
+
}, callback);
|
|
449
|
+
}
|
|
450
|
+
catch (err) {
|
|
451
|
+
obsReqHandler.endWithError(err);
|
|
452
|
+
throw err;
|
|
453
|
+
}
|
|
416
454
|
}
|
|
417
455
|
/**
|
|
418
456
|
* Drops an existing user.
|
|
@@ -429,21 +467,28 @@ class UserManager {
|
|
|
429
467
|
if (!options) {
|
|
430
468
|
options = {};
|
|
431
469
|
}
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
470
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.UserDrop, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
471
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
472
|
+
try {
|
|
473
|
+
const cppDomain = (0, bindingutilities_1.authDomainToCpp)(options.domainName || 'local');
|
|
474
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
475
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
476
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementUserDrop.bind(this._cluster.conn), {
|
|
477
|
+
username: username,
|
|
478
|
+
domain: cppDomain,
|
|
479
|
+
timeout: timeout,
|
|
480
|
+
}, obsReqHandler);
|
|
441
481
|
if (err) {
|
|
442
|
-
|
|
482
|
+
obsReqHandler.endWithError(err);
|
|
483
|
+
throw err;
|
|
443
484
|
}
|
|
444
|
-
|
|
445
|
-
});
|
|
446
|
-
}
|
|
485
|
+
obsReqHandler.end();
|
|
486
|
+
}, callback);
|
|
487
|
+
}
|
|
488
|
+
catch (err) {
|
|
489
|
+
obsReqHandler.endWithError(err);
|
|
490
|
+
throw err;
|
|
491
|
+
}
|
|
447
492
|
}
|
|
448
493
|
/**
|
|
449
494
|
* Returns a list of roles available on the server.
|
|
@@ -459,19 +504,26 @@ class UserManager {
|
|
|
459
504
|
if (!options) {
|
|
460
505
|
options = {};
|
|
461
506
|
}
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
const err = (0,
|
|
507
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.RoleGetAll, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
508
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
509
|
+
try {
|
|
510
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
511
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
512
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementRoleGetAll.bind(this._cluster.conn), {
|
|
513
|
+
timeout: timeout,
|
|
514
|
+
}, obsReqHandler);
|
|
468
515
|
if (err) {
|
|
469
|
-
|
|
516
|
+
obsReqHandler.endWithError(err);
|
|
517
|
+
throw err;
|
|
470
518
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
});
|
|
474
|
-
}
|
|
519
|
+
obsReqHandler.end();
|
|
520
|
+
return resp.roles.map((role) => Role._fromCppData(role));
|
|
521
|
+
}, callback);
|
|
522
|
+
}
|
|
523
|
+
catch (err) {
|
|
524
|
+
obsReqHandler.endWithError(err);
|
|
525
|
+
throw err;
|
|
526
|
+
}
|
|
475
527
|
}
|
|
476
528
|
/**
|
|
477
529
|
* Returns a group by it's name.
|
|
@@ -488,19 +540,27 @@ class UserManager {
|
|
|
488
540
|
if (!options) {
|
|
489
541
|
options = {};
|
|
490
542
|
}
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
543
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.GroupGet, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
544
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
545
|
+
try {
|
|
546
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
547
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
548
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementGroupGet.bind(this._cluster.conn), {
|
|
549
|
+
name: groupName,
|
|
550
|
+
timeout: timeout,
|
|
551
|
+
}, obsReqHandler);
|
|
498
552
|
if (err) {
|
|
499
|
-
|
|
553
|
+
obsReqHandler.endWithError(err);
|
|
554
|
+
throw err;
|
|
500
555
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
556
|
+
obsReqHandler.end();
|
|
557
|
+
return Group._fromCppData(resp.group);
|
|
558
|
+
}, callback);
|
|
559
|
+
}
|
|
560
|
+
catch (err) {
|
|
561
|
+
obsReqHandler.endWithError(err);
|
|
562
|
+
throw err;
|
|
563
|
+
}
|
|
504
564
|
}
|
|
505
565
|
/**
|
|
506
566
|
* Returns a list of all existing groups.
|
|
@@ -516,19 +576,26 @@ class UserManager {
|
|
|
516
576
|
if (!options) {
|
|
517
577
|
options = {};
|
|
518
578
|
}
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const err = (0,
|
|
579
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.GroupGetAll, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
580
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
581
|
+
try {
|
|
582
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
583
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
584
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementGroupGetAll.bind(this._cluster.conn), {
|
|
585
|
+
timeout: timeout,
|
|
586
|
+
}, obsReqHandler);
|
|
525
587
|
if (err) {
|
|
526
|
-
|
|
588
|
+
obsReqHandler.endWithError(err);
|
|
589
|
+
throw err;
|
|
527
590
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
});
|
|
531
|
-
}
|
|
591
|
+
obsReqHandler.end();
|
|
592
|
+
return resp.groups.map((group) => Group._fromCppData(group));
|
|
593
|
+
}, callback);
|
|
594
|
+
}
|
|
595
|
+
catch (err) {
|
|
596
|
+
obsReqHandler.endWithError(err);
|
|
597
|
+
throw err;
|
|
598
|
+
}
|
|
532
599
|
}
|
|
533
600
|
/**
|
|
534
601
|
* Creates or updates an existing group.
|
|
@@ -545,19 +612,26 @@ class UserManager {
|
|
|
545
612
|
if (!options) {
|
|
546
613
|
options = {};
|
|
547
614
|
}
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
615
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.GroupUpsert, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
616
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
617
|
+
try {
|
|
618
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
619
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
620
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementGroupUpsert.bind(this._cluster.conn), {
|
|
621
|
+
group: Group._toCppData(group),
|
|
622
|
+
timeout: timeout,
|
|
623
|
+
}, obsReqHandler);
|
|
555
624
|
if (err) {
|
|
556
|
-
|
|
625
|
+
obsReqHandler.endWithError(err);
|
|
626
|
+
throw err;
|
|
557
627
|
}
|
|
558
|
-
|
|
559
|
-
});
|
|
560
|
-
}
|
|
628
|
+
obsReqHandler.end();
|
|
629
|
+
}, callback);
|
|
630
|
+
}
|
|
631
|
+
catch (err) {
|
|
632
|
+
obsReqHandler.endWithError(err);
|
|
633
|
+
throw err;
|
|
634
|
+
}
|
|
561
635
|
}
|
|
562
636
|
/**
|
|
563
637
|
* Drops an existing group.
|
|
@@ -574,19 +648,26 @@ class UserManager {
|
|
|
574
648
|
if (!options) {
|
|
575
649
|
options = {};
|
|
576
650
|
}
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
651
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.UserMgmtOp.GroupDrop, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
652
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
653
|
+
try {
|
|
654
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
655
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
656
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementGroupDrop.bind(this._cluster.conn), {
|
|
657
|
+
name: groupName,
|
|
658
|
+
timeout: timeout,
|
|
659
|
+
}, obsReqHandler);
|
|
584
660
|
if (err) {
|
|
585
|
-
|
|
661
|
+
obsReqHandler.endWithError(err);
|
|
662
|
+
throw err;
|
|
586
663
|
}
|
|
587
|
-
|
|
588
|
-
});
|
|
589
|
-
}
|
|
664
|
+
obsReqHandler.end();
|
|
665
|
+
}, callback);
|
|
666
|
+
}
|
|
667
|
+
catch (err) {
|
|
668
|
+
obsReqHandler.endWithError(err);
|
|
669
|
+
throw err;
|
|
670
|
+
}
|
|
590
671
|
}
|
|
591
672
|
}
|
|
592
673
|
exports.UserManager = UserManager;
|
package/dist/utilities.d.ts
CHANGED
package/dist/utilities.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.parseExpiry = exports.cbQsStringify = exports.nsServerStrToDuraLevel = exports.duraLevelToNsServerStr = exports.CompoundTimeout = exports.PromiseHelper = void 0;
|
|
26
|
+
exports.getErrorMessage = exports.parseExpiry = exports.cbQsStringify = exports.nsServerStrToDuraLevel = exports.duraLevelToNsServerStr = exports.CompoundTimeout = exports.PromiseHelper = void 0;
|
|
27
27
|
const generaltypes_1 = require("./generaltypes");
|
|
28
28
|
const errors_1 = require("./errors");
|
|
29
29
|
const qs = __importStar(require("querystring"));
|
|
@@ -240,3 +240,13 @@ function parseExpiry(expiry) {
|
|
|
240
240
|
return expiry + unixTimeSecs;
|
|
241
241
|
}
|
|
242
242
|
exports.parseExpiry = parseExpiry;
|
|
243
|
+
/**
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
function getErrorMessage(error) {
|
|
247
|
+
if (error instanceof Error) {
|
|
248
|
+
return error.message;
|
|
249
|
+
}
|
|
250
|
+
return String(error);
|
|
251
|
+
}
|
|
252
|
+
exports.getErrorMessage = getErrorMessage;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is auto-generated by scripts/updateVersion.js during the build process.
|
|
3
|
+
// DO NOT EDIT DIRECTLY.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SDK_NAME = exports.SDK_VERSION = void 0;
|
|
6
|
+
exports.SDK_VERSION = '4.7.0-dev.1';
|
|
7
|
+
exports.SDK_NAME = 'couchbase';
|