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
package/dist/viewexecutor.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { CppDocumentViewResponse } from './binding';
|
|
1
2
|
import { Bucket } from './bucket';
|
|
2
3
|
import { Cluster } from './cluster';
|
|
4
|
+
import { ObservableRequestHandler } from './observabilityhandler';
|
|
5
|
+
import { ObservabilityInstruments } from './observabilitytypes';
|
|
3
6
|
import { StreamableRowPromise } from './streamablepromises';
|
|
4
7
|
import { ViewMetaData, ViewQueryOptions, ViewResult, ViewRow } from './viewtypes';
|
|
5
8
|
/**
|
|
@@ -15,6 +18,18 @@ export declare class ViewExecutor {
|
|
|
15
18
|
@internal
|
|
16
19
|
*/
|
|
17
20
|
get _cluster(): Cluster;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
get observabilityInstruments(): ObservabilityInstruments;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
static _processViewResponse<TValue = any, TKey = any>(emitter: StreamableRowPromise<ViewResult<TValue, TKey>, ViewRow<TValue, TKey>, ViewMetaData>, err: Error | null, resp: CppDocumentViewResponse, obsReqHandler?: ObservableRequestHandler): void;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
static executePromise<TValue = any, TKey = any>(viewPromise: Promise<[Error | null, CppDocumentViewResponse]>, obsReqHandler: ObservableRequestHandler): StreamableRowPromise<ViewResult<TValue, TKey>, ViewRow<TValue, TKey>, ViewMetaData>;
|
|
18
33
|
/**
|
|
19
34
|
* @internal
|
|
20
35
|
*/
|
package/dist/viewexecutor.js
CHANGED
|
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ViewExecutor = void 0;
|
|
4
4
|
/* eslint jsdoc/require-jsdoc: off */
|
|
5
5
|
const bindingutilities_1 = require("./bindingutilities");
|
|
6
|
+
const observability_1 = require("./observability");
|
|
7
|
+
const observabilityhandler_1 = require("./observabilityhandler");
|
|
8
|
+
const observabilitytypes_1 = require("./observabilitytypes");
|
|
6
9
|
const streamablepromises_1 = require("./streamablepromises");
|
|
10
|
+
const utilities_1 = require("./utilities");
|
|
7
11
|
const viewtypes_1 = require("./viewtypes");
|
|
8
12
|
/**
|
|
9
13
|
* @internal
|
|
@@ -24,14 +28,60 @@ class ViewExecutor {
|
|
|
24
28
|
/**
|
|
25
29
|
* @internal
|
|
26
30
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
get observabilityInstruments() {
|
|
32
|
+
return this._cluster.observabilityInstruments;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
static _processViewResponse(emitter, err, resp, obsReqHandler) {
|
|
38
|
+
if (err) {
|
|
39
|
+
obsReqHandler === null || obsReqHandler === void 0 ? void 0 : obsReqHandler.endWithError(err);
|
|
40
|
+
emitter.emit('error', err);
|
|
41
|
+
emitter.emit('end');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
resp.rows.forEach((row) => {
|
|
45
|
+
emitter.emit('row', new viewtypes_1.ViewRow({
|
|
46
|
+
value: JSON.parse(row.value),
|
|
47
|
+
id: row.id,
|
|
48
|
+
key: JSON.parse(row.key),
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
{
|
|
52
|
+
const metaData = resp.meta;
|
|
53
|
+
const meta = new viewtypes_1.ViewMetaData({
|
|
54
|
+
totalRows: metaData.total_rows,
|
|
55
|
+
debug: metaData.debug_info,
|
|
56
|
+
});
|
|
57
|
+
emitter.emit('meta', meta);
|
|
58
|
+
}
|
|
59
|
+
obsReqHandler === null || obsReqHandler === void 0 ? void 0 : obsReqHandler.end();
|
|
60
|
+
emitter.emit('end');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
static executePromise(viewPromise, obsReqHandler) {
|
|
29
66
|
const emitter = new streamablepromises_1.StreamableRowPromise((rows, meta) => {
|
|
30
67
|
return new viewtypes_1.ViewResult({
|
|
31
68
|
rows: rows,
|
|
32
69
|
meta: meta,
|
|
33
70
|
});
|
|
34
71
|
});
|
|
72
|
+
utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
73
|
+
const [err, resp] = await viewPromise;
|
|
74
|
+
ViewExecutor._processViewResponse(emitter, err, resp, obsReqHandler);
|
|
75
|
+
});
|
|
76
|
+
return emitter;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
query(designDoc, viewName, options) {
|
|
82
|
+
var _a;
|
|
83
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.StreamingOp.View, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
84
|
+
obsReqHandler.setRequestHttpAttributes({ bucketName: this._bucket.name });
|
|
35
85
|
const timeout = options.timeout || this._cluster.viewTimeout;
|
|
36
86
|
const raw = options.raw || {};
|
|
37
87
|
const ns = (_a = options.namespace) !== null && _a !== void 0 ? _a : viewtypes_1.DesignDocumentNamespace.Production;
|
|
@@ -39,7 +89,7 @@ class ViewExecutor {
|
|
|
39
89
|
if (typeof options.fullSet !== 'undefined') {
|
|
40
90
|
fullSet = options.fullSet;
|
|
41
91
|
}
|
|
42
|
-
this._cluster.conn.documentView({
|
|
92
|
+
return ViewExecutor.executePromise((0, observability_1.wrapObservableBindingCall)(this._cluster.conn.documentView.bind(this._cluster.conn), {
|
|
43
93
|
timeout: timeout,
|
|
44
94
|
bucket_name: this._bucket.name,
|
|
45
95
|
document_name: designDoc,
|
|
@@ -71,32 +121,7 @@ class ViewExecutor {
|
|
|
71
121
|
query_string: [],
|
|
72
122
|
raw: raw,
|
|
73
123
|
full_set: fullSet,
|
|
74
|
-
},
|
|
75
|
-
const err = (0, bindingutilities_1.errorFromCpp)(cppErr);
|
|
76
|
-
if (err) {
|
|
77
|
-
emitter.emit('error', err);
|
|
78
|
-
emitter.emit('end');
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
resp.rows.forEach((row) => {
|
|
82
|
-
emitter.emit('row', new viewtypes_1.ViewRow({
|
|
83
|
-
value: JSON.parse(row.value),
|
|
84
|
-
id: row.id,
|
|
85
|
-
key: JSON.parse(row.key),
|
|
86
|
-
}));
|
|
87
|
-
});
|
|
88
|
-
{
|
|
89
|
-
const metaData = resp.meta;
|
|
90
|
-
const meta = new viewtypes_1.ViewMetaData({
|
|
91
|
-
totalRows: metaData.total_rows,
|
|
92
|
-
debug: metaData.debug_info,
|
|
93
|
-
});
|
|
94
|
-
emitter.emit('meta', meta);
|
|
95
|
-
}
|
|
96
|
-
emitter.emit('end');
|
|
97
|
-
return;
|
|
98
|
-
});
|
|
99
|
-
return emitter;
|
|
124
|
+
}, obsReqHandler), obsReqHandler);
|
|
100
125
|
}
|
|
101
126
|
}
|
|
102
127
|
exports.ViewExecutor = ViewExecutor;
|
|
@@ -2,6 +2,8 @@ import { Bucket } from './bucket';
|
|
|
2
2
|
import { NodeCallback } from './utilities';
|
|
3
3
|
import { DesignDocumentNamespace } from './viewtypes';
|
|
4
4
|
import { CppManagementViewsDesignDocument, CppManagementViewsDesignDocumentView } from './binding';
|
|
5
|
+
import { ObservabilityInstruments } from './observabilitytypes';
|
|
6
|
+
import { RequestSpan } from './tracing';
|
|
5
7
|
/**
|
|
6
8
|
* Contains information about a view in a design document.
|
|
7
9
|
*
|
|
@@ -98,6 +100,10 @@ export interface GetAllDesignDocumentOptions {
|
|
|
98
100
|
* The timeout for this operation, represented in milliseconds.
|
|
99
101
|
*/
|
|
100
102
|
timeout?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Specifies the parent span for this specific operation.
|
|
105
|
+
*/
|
|
106
|
+
parentSpan?: RequestSpan;
|
|
101
107
|
}
|
|
102
108
|
/**
|
|
103
109
|
* @category Management
|
|
@@ -107,6 +113,10 @@ export interface GetDesignDocumentOptions {
|
|
|
107
113
|
* The timeout for this operation, represented in milliseconds.
|
|
108
114
|
*/
|
|
109
115
|
timeout?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Specifies the parent span for this specific operation.
|
|
118
|
+
*/
|
|
119
|
+
parentSpan?: RequestSpan;
|
|
110
120
|
}
|
|
111
121
|
/**
|
|
112
122
|
* @category Management
|
|
@@ -116,6 +126,10 @@ export interface UpsertDesignDocumentOptions {
|
|
|
116
126
|
* The timeout for this operation, represented in milliseconds.
|
|
117
127
|
*/
|
|
118
128
|
timeout?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Specifies the parent span for this specific operation.
|
|
131
|
+
*/
|
|
132
|
+
parentSpan?: RequestSpan;
|
|
119
133
|
}
|
|
120
134
|
/**
|
|
121
135
|
* @category Management
|
|
@@ -125,6 +139,10 @@ export interface DropDesignDocumentOptions {
|
|
|
125
139
|
* The timeout for this operation, represented in milliseconds.
|
|
126
140
|
*/
|
|
127
141
|
timeout?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Specifies the parent span for this specific operation.
|
|
144
|
+
*/
|
|
145
|
+
parentSpan?: RequestSpan;
|
|
128
146
|
}
|
|
129
147
|
/**
|
|
130
148
|
* @category Management
|
|
@@ -134,11 +152,19 @@ export interface PublishDesignDocumentOptions {
|
|
|
134
152
|
* The timeout for this operation, represented in milliseconds.
|
|
135
153
|
*/
|
|
136
154
|
timeout?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Specifies the parent span for this specific operation.
|
|
157
|
+
*/
|
|
158
|
+
parentSpan?: RequestSpan;
|
|
137
159
|
}
|
|
138
160
|
/**
|
|
139
161
|
* ViewIndexManager is an interface which enables the management
|
|
140
162
|
* of view indexes on the cluster.
|
|
141
163
|
*
|
|
164
|
+
* @deprecated Since version 4.7.0. Views are deprecated in Couchbase Server 7.0+, and will be removed from a future server version.
|
|
165
|
+
* Views are not compatible with the Magma storage engine. Instead of views, use indexes and queries using the
|
|
166
|
+
* Index Service (GSI) and the Query Service (SQL++).
|
|
167
|
+
*
|
|
142
168
|
* @category Management
|
|
143
169
|
*/
|
|
144
170
|
export declare class ViewIndexManager {
|
|
@@ -151,6 +177,10 @@ export declare class ViewIndexManager {
|
|
|
151
177
|
* @internal
|
|
152
178
|
*/
|
|
153
179
|
private get _cluster();
|
|
180
|
+
/**
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
183
|
+
get observabilityInstruments(): ObservabilityInstruments;
|
|
154
184
|
/**
|
|
155
185
|
* Returns a list of all the design documents in this bucket.
|
|
156
186
|
*
|
package/dist/viewindexmanager.js
CHANGED
|
@@ -4,6 +4,9 @@ exports.ViewIndexManager = exports.DesignDocument = exports.DesignDocumentView =
|
|
|
4
4
|
const utilities_1 = require("./utilities");
|
|
5
5
|
const viewtypes_1 = require("./viewtypes");
|
|
6
6
|
const bindingutilities_1 = require("./bindingutilities");
|
|
7
|
+
const observability_1 = require("./observability");
|
|
8
|
+
const observabilityhandler_1 = require("./observabilityhandler");
|
|
9
|
+
const observabilitytypes_1 = require("./observabilitytypes");
|
|
7
10
|
/**
|
|
8
11
|
* Contains information about a view in a design document.
|
|
9
12
|
*
|
|
@@ -131,6 +134,10 @@ exports.DesignDocument = DesignDocument;
|
|
|
131
134
|
* ViewIndexManager is an interface which enables the management
|
|
132
135
|
* of view indexes on the cluster.
|
|
133
136
|
*
|
|
137
|
+
* @deprecated Since version 4.7.0. Views are deprecated in Couchbase Server 7.0+, and will be removed from a future server version.
|
|
138
|
+
* Views are not compatible with the Magma storage engine. Instead of views, use indexes and queries using the
|
|
139
|
+
* Index Service (GSI) and the Query Service (SQL++).
|
|
140
|
+
*
|
|
134
141
|
* @category Management
|
|
135
142
|
*/
|
|
136
143
|
class ViewIndexManager {
|
|
@@ -146,6 +153,12 @@ class ViewIndexManager {
|
|
|
146
153
|
get _cluster() {
|
|
147
154
|
return this._bucket.cluster;
|
|
148
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
get observabilityInstruments() {
|
|
160
|
+
return this._bucket.cluster.observabilityInstruments;
|
|
161
|
+
}
|
|
149
162
|
/**
|
|
150
163
|
* @internal
|
|
151
164
|
*/
|
|
@@ -153,22 +166,18 @@ class ViewIndexManager {
|
|
|
153
166
|
let namespace;
|
|
154
167
|
let options;
|
|
155
168
|
let callback;
|
|
156
|
-
// deprecated path: options and maybe callback passed in
|
|
157
169
|
if (typeof arguments[0] === 'object') {
|
|
158
170
|
namespace = undefined;
|
|
159
171
|
options = arguments[0];
|
|
160
172
|
callback = arguments[1];
|
|
161
173
|
}
|
|
162
174
|
else if (arguments[0] instanceof Function) {
|
|
163
|
-
// deprecated path: no options, only callback passed in
|
|
164
175
|
namespace = undefined;
|
|
165
176
|
options = undefined;
|
|
166
177
|
callback = arguments[0];
|
|
167
178
|
}
|
|
168
179
|
else {
|
|
169
|
-
// either no args passed in or desired path (namespace is 1st arg)
|
|
170
180
|
namespace = arguments[0];
|
|
171
|
-
// still need to handle possible no options, but callback passed in
|
|
172
181
|
if (arguments[1] instanceof Function) {
|
|
173
182
|
callback = arguments[1];
|
|
174
183
|
options = undefined;
|
|
@@ -181,25 +190,29 @@ class ViewIndexManager {
|
|
|
181
190
|
if (!options) {
|
|
182
191
|
options = {};
|
|
183
192
|
}
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
this._cluster.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.ViewIndexMgmtOp.ViewIndexGetAll, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
194
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
195
|
+
try {
|
|
196
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
197
|
+
const ns = namespace !== null && namespace !== void 0 ? namespace : viewtypes_1.DesignDocumentNamespace.Production;
|
|
198
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
199
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementViewIndexGetAll.bind(this._cluster.conn), {
|
|
200
|
+
bucket_name: this._bucket.name,
|
|
201
|
+
ns: (0, bindingutilities_1.designDocumentNamespaceToCpp)(ns),
|
|
202
|
+
timeout: timeout,
|
|
203
|
+
}, obsReqHandler);
|
|
193
204
|
if (err) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const ddocs = [];
|
|
197
|
-
for (const ddoc of resp.design_documents) {
|
|
198
|
-
ddocs.push(DesignDocument._fromCppData(ddoc));
|
|
205
|
+
obsReqHandler.endWithError(err);
|
|
206
|
+
throw err;
|
|
199
207
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
208
|
+
obsReqHandler.end();
|
|
209
|
+
return resp.design_documents.map((ddoc) => DesignDocument._fromCppData(ddoc));
|
|
210
|
+
}, callback);
|
|
211
|
+
}
|
|
212
|
+
catch (err) {
|
|
213
|
+
obsReqHandler.endWithError(err);
|
|
214
|
+
throw err;
|
|
215
|
+
}
|
|
203
216
|
}
|
|
204
217
|
/**
|
|
205
218
|
* @internal
|
|
@@ -209,22 +222,18 @@ class ViewIndexManager {
|
|
|
209
222
|
let namespace;
|
|
210
223
|
let options;
|
|
211
224
|
let callback;
|
|
212
|
-
// deprecated path: options and maybe callback passed in
|
|
213
225
|
if (typeof arguments[1] === 'object') {
|
|
214
226
|
namespace = undefined;
|
|
215
227
|
options = arguments[1];
|
|
216
228
|
callback = arguments[2];
|
|
217
229
|
}
|
|
218
230
|
else if (arguments[1] instanceof Function) {
|
|
219
|
-
// deprecated path: no options, only callback passed in
|
|
220
231
|
namespace = undefined;
|
|
221
232
|
options = undefined;
|
|
222
233
|
callback = arguments[1];
|
|
223
234
|
}
|
|
224
235
|
else {
|
|
225
|
-
// either no other args passed in or desired path (namespace is 2nd arg)
|
|
226
236
|
namespace = arguments[1];
|
|
227
|
-
// still need to handle possible no options, but callback passed in
|
|
228
237
|
if (arguments[2] instanceof Function) {
|
|
229
238
|
callback = arguments[2];
|
|
230
239
|
options = undefined;
|
|
@@ -237,28 +246,34 @@ class ViewIndexManager {
|
|
|
237
246
|
if (!options) {
|
|
238
247
|
options = {};
|
|
239
248
|
}
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.ViewIndexMgmtOp.ViewIndexGet, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
250
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
251
|
+
try {
|
|
252
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
253
|
+
if (designDocName.startsWith('dev_')) {
|
|
254
|
+
namespace = viewtypes_1.DesignDocumentNamespace.Development;
|
|
255
|
+
designDocName = designDocName.substring(4);
|
|
256
|
+
}
|
|
257
|
+
const ns = namespace !== null && namespace !== void 0 ? namespace : viewtypes_1.DesignDocumentNamespace.Production;
|
|
258
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
259
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementViewIndexGet.bind(this._cluster.conn), {
|
|
260
|
+
bucket_name: this._bucket.name,
|
|
261
|
+
document_name: designDocName,
|
|
262
|
+
ns: (0, bindingutilities_1.designDocumentNamespaceToCpp)(ns),
|
|
263
|
+
timeout: timeout,
|
|
264
|
+
}, obsReqHandler);
|
|
255
265
|
if (err) {
|
|
256
|
-
|
|
266
|
+
obsReqHandler.endWithError(err);
|
|
267
|
+
throw err;
|
|
257
268
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
});
|
|
261
|
-
}
|
|
269
|
+
obsReqHandler.end();
|
|
270
|
+
return DesignDocument._fromCppData(resp.document);
|
|
271
|
+
}, callback);
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
obsReqHandler.endWithError(err);
|
|
275
|
+
throw err;
|
|
276
|
+
}
|
|
262
277
|
}
|
|
263
278
|
/**
|
|
264
279
|
* @internal
|
|
@@ -268,22 +283,18 @@ class ViewIndexManager {
|
|
|
268
283
|
let namespace;
|
|
269
284
|
let options;
|
|
270
285
|
let callback;
|
|
271
|
-
// deprecated path: options and maybe callback passed in
|
|
272
286
|
if (typeof arguments[1] === 'object') {
|
|
273
287
|
namespace = undefined;
|
|
274
288
|
options = arguments[1];
|
|
275
289
|
callback = arguments[2];
|
|
276
290
|
}
|
|
277
291
|
else if (arguments[1] instanceof Function) {
|
|
278
|
-
// deprecated path: no options, only callback passed in
|
|
279
292
|
namespace = undefined;
|
|
280
293
|
options = undefined;
|
|
281
294
|
callback = arguments[1];
|
|
282
295
|
}
|
|
283
296
|
else {
|
|
284
|
-
// either no other args passed in or desired path (namespace is 2nd arg)
|
|
285
297
|
namespace = arguments[1];
|
|
286
|
-
// still need to handle possible no options, but callback passed in
|
|
287
298
|
if (arguments[2] instanceof Function) {
|
|
288
299
|
callback = arguments[2];
|
|
289
300
|
options = undefined;
|
|
@@ -296,26 +307,32 @@ class ViewIndexManager {
|
|
|
296
307
|
if (!options) {
|
|
297
308
|
options = {};
|
|
298
309
|
}
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.ViewIndexMgmtOp.ViewIndexUpsert, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
311
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
312
|
+
try {
|
|
313
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
314
|
+
if (designDoc.name.startsWith('dev_')) {
|
|
315
|
+
namespace = viewtypes_1.DesignDocumentNamespace.Development;
|
|
316
|
+
designDoc.name = designDoc.name.substring(4);
|
|
317
|
+
}
|
|
318
|
+
const ns = namespace !== null && namespace !== void 0 ? namespace : viewtypes_1.DesignDocumentNamespace.Production;
|
|
319
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
320
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementViewIndexUpsert.bind(this._cluster.conn), {
|
|
321
|
+
bucket_name: this._bucket.name,
|
|
322
|
+
document: DesignDocument._toCppData(designDoc, ns),
|
|
323
|
+
timeout: timeout,
|
|
324
|
+
}, obsReqHandler);
|
|
313
325
|
if (err) {
|
|
314
|
-
|
|
326
|
+
obsReqHandler.endWithError(err);
|
|
327
|
+
throw err;
|
|
315
328
|
}
|
|
316
|
-
|
|
317
|
-
});
|
|
318
|
-
}
|
|
329
|
+
obsReqHandler.end();
|
|
330
|
+
}, callback);
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
obsReqHandler.endWithError(err);
|
|
334
|
+
throw err;
|
|
335
|
+
}
|
|
319
336
|
}
|
|
320
337
|
/**
|
|
321
338
|
* @internal
|
|
@@ -325,22 +342,18 @@ class ViewIndexManager {
|
|
|
325
342
|
let namespace;
|
|
326
343
|
let options;
|
|
327
344
|
let callback;
|
|
328
|
-
// deprecated path: options and maybe callback passed in
|
|
329
345
|
if (typeof arguments[1] === 'object') {
|
|
330
346
|
namespace = undefined;
|
|
331
347
|
options = arguments[1];
|
|
332
348
|
callback = arguments[2];
|
|
333
349
|
}
|
|
334
350
|
else if (arguments[1] instanceof Function) {
|
|
335
|
-
// deprecated path: no options, only callback passed in
|
|
336
351
|
namespace = undefined;
|
|
337
352
|
options = undefined;
|
|
338
353
|
callback = arguments[1];
|
|
339
354
|
}
|
|
340
355
|
else {
|
|
341
|
-
// either no other args passed in or desired path (namespace is 2nd arg)
|
|
342
356
|
namespace = arguments[1];
|
|
343
|
-
// still need to handle possible no options, but callback passed in
|
|
344
357
|
if (arguments[2] instanceof Function) {
|
|
345
358
|
callback = arguments[2];
|
|
346
359
|
options = undefined;
|
|
@@ -353,27 +366,33 @@ class ViewIndexManager {
|
|
|
353
366
|
if (!options) {
|
|
354
367
|
options = {};
|
|
355
368
|
}
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.ViewIndexMgmtOp.ViewIndexDrop, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
370
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
371
|
+
try {
|
|
372
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
373
|
+
if (designDocName.startsWith('dev_')) {
|
|
374
|
+
namespace = viewtypes_1.DesignDocumentNamespace.Development;
|
|
375
|
+
designDocName = designDocName.substring(4);
|
|
376
|
+
}
|
|
377
|
+
const ns = namespace !== null && namespace !== void 0 ? namespace : viewtypes_1.DesignDocumentNamespace.Production;
|
|
378
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
379
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementViewIndexDrop.bind(this._cluster.conn), {
|
|
380
|
+
bucket_name: this._bucket.name,
|
|
381
|
+
document_name: designDocName,
|
|
382
|
+
ns: (0, bindingutilities_1.designDocumentNamespaceToCpp)(ns),
|
|
383
|
+
timeout: timeout,
|
|
384
|
+
}, obsReqHandler);
|
|
371
385
|
if (err) {
|
|
372
|
-
|
|
386
|
+
obsReqHandler.endWithError(err);
|
|
387
|
+
throw err;
|
|
373
388
|
}
|
|
374
|
-
|
|
375
|
-
});
|
|
376
|
-
}
|
|
389
|
+
obsReqHandler.end();
|
|
390
|
+
}, callback);
|
|
391
|
+
}
|
|
392
|
+
catch (err) {
|
|
393
|
+
obsReqHandler.endWithError(err);
|
|
394
|
+
throw err;
|
|
395
|
+
}
|
|
377
396
|
}
|
|
378
397
|
/**
|
|
379
398
|
* Publishes a development design document to be a production design document.
|
|
@@ -393,16 +412,26 @@ class ViewIndexManager {
|
|
|
393
412
|
if (!options) {
|
|
394
413
|
options = {};
|
|
395
414
|
}
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
415
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.ViewIndexMgmtOp.ViewIndexPublish, this.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
416
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
417
|
+
try {
|
|
418
|
+
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
419
|
+
const timer = new utilities_1.CompoundTimeout(timeout);
|
|
420
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
421
|
+
const designDoc = await this.getDesignDocument(designDocName, viewtypes_1.DesignDocumentNamespace.Development, {
|
|
422
|
+
timeout: timer.left(),
|
|
423
|
+
parentSpan: obsReqHandler.wrappedSpan,
|
|
424
|
+
});
|
|
425
|
+
await this.upsertDesignDocument(designDoc, viewtypes_1.DesignDocumentNamespace.Production, {
|
|
426
|
+
timeout: timer.left(),
|
|
427
|
+
parentSpan: obsReqHandler.wrappedSpan,
|
|
428
|
+
});
|
|
429
|
+
}, callback);
|
|
430
|
+
}
|
|
431
|
+
catch (err) {
|
|
432
|
+
obsReqHandler.endWithError(err);
|
|
433
|
+
throw err;
|
|
434
|
+
}
|
|
406
435
|
}
|
|
407
436
|
}
|
|
408
437
|
exports.ViewIndexManager = ViewIndexManager;
|
package/dist/viewtypes.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequestSpan } from './tracing';
|
|
1
2
|
/**
|
|
2
3
|
* Contains the results of a view query.
|
|
3
4
|
*
|
|
@@ -296,4 +297,8 @@ export interface ViewQueryOptions {
|
|
|
296
297
|
* Specifies the design document namespace to use when executing the view query.
|
|
297
298
|
*/
|
|
298
299
|
namespace?: DesignDocumentNamespace;
|
|
300
|
+
/**
|
|
301
|
+
* Specifies the parent span for this specific operation.
|
|
302
|
+
*/
|
|
303
|
+
parentSpan?: RequestSpan;
|
|
299
304
|
}
|
package/package.json
CHANGED
|
@@ -22,10 +22,20 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"cmake-js": "^8.0.0",
|
|
24
24
|
"detect-libc": "^2.1.2",
|
|
25
|
+
"hdr-histogram-js": "^3.0.1",
|
|
25
26
|
"node-addon-api": "^8.3.1"
|
|
26
27
|
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@opentelemetry/api": "^1.0.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"@opentelemetry/api": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
27
36
|
"devDependencies": {
|
|
28
37
|
"@eslint/js": "^9.39.2",
|
|
38
|
+
"@opentelemetry/api": "^1.9.0",
|
|
29
39
|
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
30
40
|
"@tsconfig/node12": "^12.1.4",
|
|
31
41
|
"@types/bindings": "^1.5.5",
|
|
@@ -58,7 +68,7 @@
|
|
|
58
68
|
"type": "git",
|
|
59
69
|
"url": "http://github.com/couchbase/couchnode.git"
|
|
60
70
|
},
|
|
61
|
-
"version": "4.
|
|
71
|
+
"version": "4.7.0-dev.1",
|
|
62
72
|
"config": {
|
|
63
73
|
"native": false
|
|
64
74
|
},
|
|
@@ -67,7 +77,7 @@
|
|
|
67
77
|
"build": "cmake-js build && tsc",
|
|
68
78
|
"rebuild": "cmake-js rebuild && tsc",
|
|
69
79
|
"prebuild": "node ./scripts/buildPrebuild.js",
|
|
70
|
-
"prepare": "tsc",
|
|
80
|
+
"prepare": "node ./scripts/updateVersion.js && tsc",
|
|
71
81
|
"help-prune": "node ./scripts/prune.js",
|
|
72
82
|
"build-docs": "typedoc",
|
|
73
83
|
"test": "ts-mocha test/*.test.*",
|
|
@@ -156,12 +166,12 @@
|
|
|
156
166
|
"deps/couchbase-cxx-cache/mozilla-ca-bundle.*"
|
|
157
167
|
],
|
|
158
168
|
"optionalDependencies": {
|
|
159
|
-
"@couchbase/couchbase-darwin-arm64-napi": "4.
|
|
160
|
-
"@couchbase/couchbase-darwin-x64-napi": "4.
|
|
161
|
-
"@couchbase/couchbase-linux-arm64-napi": "4.
|
|
162
|
-
"@couchbase/couchbase-linuxmusl-arm64-napi": "4.
|
|
163
|
-
"@couchbase/couchbase-linuxmusl-x64-napi": "4.
|
|
164
|
-
"@couchbase/couchbase-linux-x64-napi": "4.
|
|
165
|
-
"@couchbase/couchbase-win32-x64-napi": "4.
|
|
169
|
+
"@couchbase/couchbase-darwin-arm64-napi": "4.7.0-dev.1",
|
|
170
|
+
"@couchbase/couchbase-darwin-x64-napi": "4.7.0-dev.1",
|
|
171
|
+
"@couchbase/couchbase-linux-arm64-napi": "4.7.0-dev.1",
|
|
172
|
+
"@couchbase/couchbase-linuxmusl-arm64-napi": "4.7.0-dev.1",
|
|
173
|
+
"@couchbase/couchbase-linuxmusl-x64-napi": "4.7.0-dev.1",
|
|
174
|
+
"@couchbase/couchbase-linux-x64-napi": "4.7.0-dev.1",
|
|
175
|
+
"@couchbase/couchbase-win32-x64-napi": "4.7.0-dev.1"
|
|
166
176
|
}
|
|
167
177
|
}
|