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
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryIndexManager = exports.CollectionQueryIndexManager = exports.QueryIndex = void 0;
|
|
4
|
-
const bindingutilities_1 = require("./bindingutilities");
|
|
5
4
|
const errors_1 = require("./errors");
|
|
5
|
+
const observability_1 = require("./observability");
|
|
6
|
+
const observabilityhandler_1 = require("./observabilityhandler");
|
|
7
|
+
const observabilitytypes_1 = require("./observabilitytypes");
|
|
6
8
|
const utilities_1 = require("./utilities");
|
|
7
9
|
/**
|
|
8
10
|
* Contains a specific index configuration for the query service.
|
|
@@ -44,10 +46,16 @@ class InternalQueryIndexManager {
|
|
|
44
46
|
/**
|
|
45
47
|
* @internal
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
get observabilityInstruments() {
|
|
50
|
+
return this._cluster.observabilityInstruments;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
async createIndex(bucketName, isPrimary, options, obsReqHandler, callback) {
|
|
48
56
|
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
49
|
-
return utilities_1.PromiseHelper.
|
|
50
|
-
this._cluster.conn.managementQueryIndexCreate({
|
|
57
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
58
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementQueryIndexCreate.bind(this._cluster.conn), {
|
|
51
59
|
bucket_name: bucketName,
|
|
52
60
|
scope_name: options.scopeName || '',
|
|
53
61
|
collection_name: options.collectionName || '',
|
|
@@ -60,26 +68,25 @@ class InternalQueryIndexManager {
|
|
|
60
68
|
num_replicas: options.numReplicas,
|
|
61
69
|
timeout: timeout,
|
|
62
70
|
condition: undefined,
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
71
|
+
}, obsReqHandler);
|
|
72
|
+
if (err) {
|
|
73
|
+
obsReqHandler.endWithError(err);
|
|
74
|
+
throw err;
|
|
75
|
+
}
|
|
76
|
+
obsReqHandler.end();
|
|
70
77
|
}, callback);
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* @internal
|
|
74
81
|
*/
|
|
75
|
-
async dropIndex(bucketName, isPrimary, options, callback) {
|
|
82
|
+
async dropIndex(bucketName, isPrimary, options, obsReqHandler, callback) {
|
|
76
83
|
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
77
84
|
// BUG(JSCBC-1066): We need to use a normal drop index for named primary indexes.
|
|
78
85
|
if (options.name) {
|
|
79
86
|
isPrimary = false;
|
|
80
87
|
}
|
|
81
|
-
return utilities_1.PromiseHelper.
|
|
82
|
-
this._cluster.conn.managementQueryIndexDrop({
|
|
88
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
89
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementQueryIndexDrop.bind(this._cluster.conn), {
|
|
83
90
|
bucket_name: bucketName,
|
|
84
91
|
scope_name: options.scopeName || '',
|
|
85
92
|
collection_name: options.collectionName || '',
|
|
@@ -88,73 +95,71 @@ class InternalQueryIndexManager {
|
|
|
88
95
|
is_primary: isPrimary,
|
|
89
96
|
ignore_if_does_not_exist: options.ignoreIfNotExists || false,
|
|
90
97
|
timeout: timeout,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
+
}, obsReqHandler);
|
|
99
|
+
if (err) {
|
|
100
|
+
obsReqHandler.endWithError(err);
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
obsReqHandler.end();
|
|
98
104
|
}, callback);
|
|
99
105
|
}
|
|
100
106
|
/**
|
|
101
107
|
* @internal
|
|
102
108
|
*/
|
|
103
|
-
async getAllIndexes(bucketName, options, callback) {
|
|
109
|
+
async getAllIndexes(bucketName, options, obsReqHandler, callback) {
|
|
104
110
|
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
105
|
-
return utilities_1.PromiseHelper.
|
|
106
|
-
this._cluster.conn.managementQueryIndexGetAll({
|
|
111
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
112
|
+
const [err, resp] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementQueryIndexGetAll.bind(this._cluster.conn), {
|
|
107
113
|
bucket_name: bucketName,
|
|
108
114
|
scope_name: options.scopeName || '',
|
|
109
115
|
collection_name: options.collectionName || '',
|
|
110
116
|
query_ctx: options.queryContext || this._queryContext,
|
|
111
117
|
timeout: timeout,
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
118
|
+
}, obsReqHandler);
|
|
119
|
+
if (err) {
|
|
120
|
+
obsReqHandler.endWithError(err);
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
obsReqHandler.end();
|
|
124
|
+
return resp.indexes.map((row) => new QueryIndex({
|
|
125
|
+
isPrimary: row.is_primary,
|
|
126
|
+
name: row.name,
|
|
127
|
+
state: row.state,
|
|
128
|
+
type: row.type,
|
|
129
|
+
indexKey: row.index_key,
|
|
130
|
+
partition: row.partition,
|
|
131
|
+
condition: row.condition,
|
|
132
|
+
bucketName: row.bucket_name,
|
|
133
|
+
scopeName: row.scope_name,
|
|
134
|
+
collectionName: row.collection_name,
|
|
135
|
+
}));
|
|
131
136
|
}, callback);
|
|
132
137
|
}
|
|
133
138
|
/**
|
|
134
139
|
* @internal
|
|
135
140
|
*/
|
|
136
|
-
async buildDeferredIndexes(bucketName, options, callback) {
|
|
141
|
+
async buildDeferredIndexes(bucketName, options, obsReqHandler, callback) {
|
|
137
142
|
const timeout = options.timeout || this._cluster.managementTimeout;
|
|
138
|
-
return utilities_1.PromiseHelper.
|
|
139
|
-
this._cluster.conn.managementQueryIndexBuildDeferred({
|
|
143
|
+
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
144
|
+
const [err, _] = await (0, observability_1.wrapObservableBindingCall)(this._cluster.conn.managementQueryIndexBuildDeferred.bind(this._cluster.conn), {
|
|
140
145
|
bucket_name: bucketName,
|
|
141
146
|
scope_name: options.scopeName || '',
|
|
142
147
|
collection_name: options.collectionName || '',
|
|
143
148
|
query_ctx: options.queryContext || this._queryContext,
|
|
144
149
|
timeout: timeout,
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
}, obsReqHandler);
|
|
151
|
+
if (err) {
|
|
152
|
+
obsReqHandler.endWithError(err);
|
|
153
|
+
throw err;
|
|
154
|
+
}
|
|
155
|
+
obsReqHandler.end();
|
|
156
|
+
return [];
|
|
152
157
|
}, callback);
|
|
153
158
|
}
|
|
154
159
|
/**
|
|
155
160
|
* @internal
|
|
156
161
|
*/
|
|
157
|
-
async watchIndexes(bucketName, indexNames, timeout, options, callback) {
|
|
162
|
+
async watchIndexes(bucketName, indexNames, timeout, options, obsReqHandler, callback) {
|
|
158
163
|
if (options.watchPrimary) {
|
|
159
164
|
indexNames = [...indexNames, '#primary'];
|
|
160
165
|
}
|
|
@@ -162,10 +167,12 @@ class InternalQueryIndexManager {
|
|
|
162
167
|
return utilities_1.PromiseHelper.wrapAsync(async () => {
|
|
163
168
|
let curInterval = 50;
|
|
164
169
|
for (;;) {
|
|
170
|
+
const subObsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexGetAll, this.observabilityInstruments, obsReqHandler.wrappedSpan);
|
|
171
|
+
subObsReqHandler.setRequestHttpAttributes();
|
|
165
172
|
// Get all the indexes that are currently registered
|
|
166
173
|
const foundIdxs = await this.getAllIndexes(bucketName, {
|
|
167
174
|
timeout: timer.left(),
|
|
168
|
-
});
|
|
175
|
+
}, subObsReqHandler);
|
|
169
176
|
const foundIndexNames = foundIdxs.map((idx) => idx.name);
|
|
170
177
|
const onlineIdxs = foundIdxs.filter((idx) => idx.state === 'online');
|
|
171
178
|
const onlineIdxNames = onlineIdxs.map((idx) => idx.name);
|
|
@@ -179,6 +186,7 @@ class InternalQueryIndexManager {
|
|
|
179
186
|
});
|
|
180
187
|
// If all the indexes are online, we've succeeded
|
|
181
188
|
if (allOnline) {
|
|
189
|
+
obsReqHandler.end();
|
|
182
190
|
break;
|
|
183
191
|
}
|
|
184
192
|
// Add 500 to our interval to a max of 1000
|
|
@@ -189,7 +197,14 @@ class InternalQueryIndexManager {
|
|
|
189
197
|
curInterval = Math.min(curInterval, userTimeLeft);
|
|
190
198
|
}
|
|
191
199
|
if (curInterval <= 0) {
|
|
192
|
-
|
|
200
|
+
// We don't need to end the top-level span here b/c the caller wraps this in a try/catch that
|
|
201
|
+
// will end the span w/ an error accordingly. But we do need end the sub-span we created for
|
|
202
|
+
// the getAllIndexes() call
|
|
203
|
+
const err = new errors_1.CouchbaseError('Failed to find all indexes online within the alloted time.');
|
|
204
|
+
if (!subObsReqHandler.requestHasEnded) {
|
|
205
|
+
subObsReqHandler.endWithError(err);
|
|
206
|
+
}
|
|
207
|
+
throw err;
|
|
193
208
|
}
|
|
194
209
|
// Wait until curInterval expires
|
|
195
210
|
await new Promise((resolve) => setTimeout(() => resolve(true), curInterval));
|
|
@@ -229,16 +244,24 @@ class CollectionQueryIndexManager {
|
|
|
229
244
|
if (!options) {
|
|
230
245
|
options = {};
|
|
231
246
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
247
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexCreate, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
248
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
249
|
+
try {
|
|
250
|
+
return this._manager.createIndex(this._bucketName, false, {
|
|
251
|
+
collectionName: this._collectionName,
|
|
252
|
+
scopeName: this._scopeName,
|
|
253
|
+
name: indexName,
|
|
254
|
+
keys: keys,
|
|
255
|
+
ignoreIfExists: options.ignoreIfExists,
|
|
256
|
+
numReplicas: options.numReplicas,
|
|
257
|
+
deferred: options.deferred,
|
|
258
|
+
timeout: options.timeout,
|
|
259
|
+
}, obsReqHandler, callback);
|
|
260
|
+
}
|
|
261
|
+
catch (err) {
|
|
262
|
+
obsReqHandler.endWithError(err);
|
|
263
|
+
throw err;
|
|
264
|
+
}
|
|
242
265
|
}
|
|
243
266
|
/**
|
|
244
267
|
* Creates a new primary query index.
|
|
@@ -254,14 +277,22 @@ class CollectionQueryIndexManager {
|
|
|
254
277
|
if (!options) {
|
|
255
278
|
options = {};
|
|
256
279
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
280
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexCreate, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
281
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
282
|
+
try {
|
|
283
|
+
return this._manager.createIndex(this._bucketName, true, {
|
|
284
|
+
collectionName: this._collectionName,
|
|
285
|
+
scopeName: this._scopeName,
|
|
286
|
+
name: options.name,
|
|
287
|
+
ignoreIfExists: options.ignoreIfExists,
|
|
288
|
+
deferred: options.deferred,
|
|
289
|
+
timeout: options.timeout,
|
|
290
|
+
}, obsReqHandler, callback);
|
|
291
|
+
}
|
|
292
|
+
catch (err) {
|
|
293
|
+
obsReqHandler.endWithError(err);
|
|
294
|
+
throw err;
|
|
295
|
+
}
|
|
265
296
|
}
|
|
266
297
|
/**
|
|
267
298
|
* Drops an existing query index.
|
|
@@ -278,13 +309,21 @@ class CollectionQueryIndexManager {
|
|
|
278
309
|
if (!options) {
|
|
279
310
|
options = {};
|
|
280
311
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
312
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexDrop, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
313
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
314
|
+
try {
|
|
315
|
+
return this._manager.dropIndex(this._bucketName, false, {
|
|
316
|
+
collectionName: this._collectionName,
|
|
317
|
+
scopeName: this._scopeName,
|
|
318
|
+
name: indexName,
|
|
319
|
+
ignoreIfNotExists: options.ignoreIfNotExists,
|
|
320
|
+
timeout: options.timeout,
|
|
321
|
+
}, obsReqHandler, callback);
|
|
322
|
+
}
|
|
323
|
+
catch (err) {
|
|
324
|
+
obsReqHandler.endWithError(err);
|
|
325
|
+
throw err;
|
|
326
|
+
}
|
|
288
327
|
}
|
|
289
328
|
/**
|
|
290
329
|
* Drops an existing primary index.
|
|
@@ -300,13 +339,21 @@ class CollectionQueryIndexManager {
|
|
|
300
339
|
if (!options) {
|
|
301
340
|
options = {};
|
|
302
341
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
342
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexDrop, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
343
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
344
|
+
try {
|
|
345
|
+
return this._manager.dropIndex(this._bucketName, true, {
|
|
346
|
+
collectionName: this._collectionName,
|
|
347
|
+
scopeName: this._scopeName,
|
|
348
|
+
name: options.name,
|
|
349
|
+
ignoreIfNotExists: options.ignoreIfNotExists,
|
|
350
|
+
timeout: options.timeout,
|
|
351
|
+
}, obsReqHandler, callback);
|
|
352
|
+
}
|
|
353
|
+
catch (err) {
|
|
354
|
+
obsReqHandler.endWithError(err);
|
|
355
|
+
throw err;
|
|
356
|
+
}
|
|
310
357
|
}
|
|
311
358
|
/**
|
|
312
359
|
* Returns a list of indexes for a specific bucket.
|
|
@@ -322,11 +369,19 @@ class CollectionQueryIndexManager {
|
|
|
322
369
|
if (!options) {
|
|
323
370
|
options = {};
|
|
324
371
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
372
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexGetAll, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
373
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
374
|
+
try {
|
|
375
|
+
return this._manager.getAllIndexes(this._bucketName, {
|
|
376
|
+
collectionName: this._collectionName,
|
|
377
|
+
scopeName: this._scopeName,
|
|
378
|
+
timeout: options.timeout,
|
|
379
|
+
}, obsReqHandler, callback);
|
|
380
|
+
}
|
|
381
|
+
catch (err) {
|
|
382
|
+
obsReqHandler.endWithError(err);
|
|
383
|
+
throw err;
|
|
384
|
+
}
|
|
330
385
|
}
|
|
331
386
|
/**
|
|
332
387
|
* Starts building any indexes which were previously created with deferred=true.
|
|
@@ -342,11 +397,19 @@ class CollectionQueryIndexManager {
|
|
|
342
397
|
if (!options) {
|
|
343
398
|
options = {};
|
|
344
399
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
400
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexBuildDeferred, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
401
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
402
|
+
try {
|
|
403
|
+
return this._manager.buildDeferredIndexes(this._bucketName, {
|
|
404
|
+
collectionName: this._collectionName,
|
|
405
|
+
scopeName: this._scopeName,
|
|
406
|
+
timeout: options.timeout,
|
|
407
|
+
}, obsReqHandler, callback);
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
obsReqHandler.endWithError(err);
|
|
411
|
+
throw err;
|
|
412
|
+
}
|
|
350
413
|
}
|
|
351
414
|
/**
|
|
352
415
|
* Waits for a number of indexes to finish creation and be ready to use.
|
|
@@ -364,11 +427,19 @@ class CollectionQueryIndexManager {
|
|
|
364
427
|
if (!options) {
|
|
365
428
|
options = {};
|
|
366
429
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
430
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexWatchIndexes, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
431
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
432
|
+
try {
|
|
433
|
+
return this._manager.watchIndexes(this._bucketName, indexNames, timeout, {
|
|
434
|
+
collectionName: this._collectionName,
|
|
435
|
+
scopeName: this._scopeName,
|
|
436
|
+
watchPrimary: options.watchPrimary,
|
|
437
|
+
}, obsReqHandler, callback);
|
|
438
|
+
}
|
|
439
|
+
catch (err) {
|
|
440
|
+
obsReqHandler.endWithError(err);
|
|
441
|
+
throw err;
|
|
442
|
+
}
|
|
372
443
|
}
|
|
373
444
|
}
|
|
374
445
|
exports.CollectionQueryIndexManager = CollectionQueryIndexManager;
|
|
@@ -402,16 +473,24 @@ class QueryIndexManager {
|
|
|
402
473
|
if (!options) {
|
|
403
474
|
options = {};
|
|
404
475
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
476
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexCreate, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
477
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
478
|
+
try {
|
|
479
|
+
return this._manager.createIndex(bucketName, false, {
|
|
480
|
+
collectionName: options.collectionName,
|
|
481
|
+
scopeName: options.scopeName,
|
|
482
|
+
name: indexName,
|
|
483
|
+
keys: keys,
|
|
484
|
+
ignoreIfExists: options.ignoreIfExists,
|
|
485
|
+
numReplicas: options.numReplicas,
|
|
486
|
+
deferred: options.deferred,
|
|
487
|
+
timeout: options.timeout,
|
|
488
|
+
}, obsReqHandler, callback);
|
|
489
|
+
}
|
|
490
|
+
catch (err) {
|
|
491
|
+
obsReqHandler.endWithError(err);
|
|
492
|
+
throw err;
|
|
493
|
+
}
|
|
415
494
|
}
|
|
416
495
|
/**
|
|
417
496
|
* Creates a new primary query index.
|
|
@@ -428,14 +507,22 @@ class QueryIndexManager {
|
|
|
428
507
|
if (!options) {
|
|
429
508
|
options = {};
|
|
430
509
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
510
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexCreate, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
511
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
512
|
+
try {
|
|
513
|
+
return this._manager.createIndex(bucketName, true, {
|
|
514
|
+
collectionName: options.collectionName,
|
|
515
|
+
scopeName: options.scopeName,
|
|
516
|
+
name: options.name,
|
|
517
|
+
ignoreIfExists: options.ignoreIfExists,
|
|
518
|
+
deferred: options.deferred,
|
|
519
|
+
timeout: options.timeout,
|
|
520
|
+
}, obsReqHandler, callback);
|
|
521
|
+
}
|
|
522
|
+
catch (err) {
|
|
523
|
+
obsReqHandler.endWithError(err);
|
|
524
|
+
throw err;
|
|
525
|
+
}
|
|
439
526
|
}
|
|
440
527
|
/**
|
|
441
528
|
* Drops an existing query index.
|
|
@@ -453,13 +540,21 @@ class QueryIndexManager {
|
|
|
453
540
|
if (!options) {
|
|
454
541
|
options = {};
|
|
455
542
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
543
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexDrop, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
544
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
545
|
+
try {
|
|
546
|
+
return this._manager.dropIndex(bucketName, false, {
|
|
547
|
+
collectionName: options.collectionName,
|
|
548
|
+
scopeName: options.scopeName,
|
|
549
|
+
name: indexName,
|
|
550
|
+
ignoreIfNotExists: options.ignoreIfNotExists,
|
|
551
|
+
timeout: options.timeout,
|
|
552
|
+
}, obsReqHandler, callback);
|
|
553
|
+
}
|
|
554
|
+
catch (err) {
|
|
555
|
+
obsReqHandler.endWithError(err);
|
|
556
|
+
throw err;
|
|
557
|
+
}
|
|
463
558
|
}
|
|
464
559
|
/**
|
|
465
560
|
* Drops an existing primary index.
|
|
@@ -476,13 +571,21 @@ class QueryIndexManager {
|
|
|
476
571
|
if (!options) {
|
|
477
572
|
options = {};
|
|
478
573
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
574
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexDrop, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
575
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
576
|
+
try {
|
|
577
|
+
return this._manager.dropIndex(bucketName, true, {
|
|
578
|
+
collectionName: options.collectionName,
|
|
579
|
+
scopeName: options.scopeName,
|
|
580
|
+
name: options.name,
|
|
581
|
+
ignoreIfNotExists: options.ignoreIfNotExists,
|
|
582
|
+
timeout: options.timeout,
|
|
583
|
+
}, obsReqHandler, callback);
|
|
584
|
+
}
|
|
585
|
+
catch (err) {
|
|
586
|
+
obsReqHandler.endWithError(err);
|
|
587
|
+
throw err;
|
|
588
|
+
}
|
|
486
589
|
}
|
|
487
590
|
/**
|
|
488
591
|
* Returns a list of indexes for a specific bucket.
|
|
@@ -499,11 +602,19 @@ class QueryIndexManager {
|
|
|
499
602
|
if (!options) {
|
|
500
603
|
options = {};
|
|
501
604
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
605
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexGetAll, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
606
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
607
|
+
try {
|
|
608
|
+
return this._manager.getAllIndexes(bucketName, {
|
|
609
|
+
collectionName: options.collectionName,
|
|
610
|
+
scopeName: options.scopeName,
|
|
611
|
+
timeout: options.timeout,
|
|
612
|
+
}, obsReqHandler, callback);
|
|
613
|
+
}
|
|
614
|
+
catch (err) {
|
|
615
|
+
obsReqHandler.endWithError(err);
|
|
616
|
+
throw err;
|
|
617
|
+
}
|
|
507
618
|
}
|
|
508
619
|
/**
|
|
509
620
|
* Starts building any indexes which were previously created with deferred=true.
|
|
@@ -520,11 +631,19 @@ class QueryIndexManager {
|
|
|
520
631
|
if (!options) {
|
|
521
632
|
options = {};
|
|
522
633
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
634
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexBuildDeferred, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
635
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
636
|
+
try {
|
|
637
|
+
return this._manager.buildDeferredIndexes(bucketName, {
|
|
638
|
+
collectionName: options.collectionName,
|
|
639
|
+
scopeName: options.scopeName,
|
|
640
|
+
timeout: options.timeout,
|
|
641
|
+
}, obsReqHandler, callback);
|
|
642
|
+
}
|
|
643
|
+
catch (err) {
|
|
644
|
+
obsReqHandler.endWithError(err);
|
|
645
|
+
throw err;
|
|
646
|
+
}
|
|
528
647
|
}
|
|
529
648
|
/**
|
|
530
649
|
* Waits for a number of indexes to finish creation and be ready to use.
|
|
@@ -543,11 +662,19 @@ class QueryIndexManager {
|
|
|
543
662
|
if (!options) {
|
|
544
663
|
options = {};
|
|
545
664
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
665
|
+
const obsReqHandler = new observabilityhandler_1.ObservableRequestHandler(observabilitytypes_1.QueryIndexMgmtOp.QueryIndexWatchIndexes, this._manager.observabilityInstruments, options === null || options === void 0 ? void 0 : options.parentSpan);
|
|
666
|
+
obsReqHandler.setRequestHttpAttributes();
|
|
667
|
+
try {
|
|
668
|
+
return this._manager.watchIndexes(bucketName, indexNames, timeout, {
|
|
669
|
+
collectionName: options.collectionName,
|
|
670
|
+
scopeName: options.scopeName,
|
|
671
|
+
watchPrimary: options.watchPrimary,
|
|
672
|
+
}, obsReqHandler, callback);
|
|
673
|
+
}
|
|
674
|
+
catch (err) {
|
|
675
|
+
obsReqHandler.endWithError(err);
|
|
676
|
+
throw err;
|
|
677
|
+
}
|
|
551
678
|
}
|
|
552
679
|
}
|
|
553
680
|
exports.QueryIndexManager = QueryIndexManager;
|
package/dist/querytypes.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MutationState } from './mutationstate';
|
|
2
|
+
import { RequestSpan } from './tracing';
|
|
2
3
|
/**
|
|
3
4
|
* Represents the status of a query.
|
|
4
5
|
*
|
|
@@ -310,4 +311,8 @@ export interface QueryOptions {
|
|
|
310
311
|
* The timeout for this operation, represented in milliseconds.
|
|
311
312
|
*/
|
|
312
313
|
timeout?: number;
|
|
314
|
+
/**
|
|
315
|
+
* Specifies the parent span for this specific operation.
|
|
316
|
+
*/
|
|
317
|
+
parentSpan?: RequestSpan;
|
|
313
318
|
}
|
package/dist/scope.js
CHANGED
|
@@ -102,7 +102,7 @@ class Scope {
|
|
|
102
102
|
const options_ = options;
|
|
103
103
|
return utilities_1.PromiseHelper.wrapAsync(() => exec.query(statement, {
|
|
104
104
|
...options_,
|
|
105
|
-
queryContext:
|
|
105
|
+
queryContext: `\`${bucket.name}\`.\`${this.name}\``,
|
|
106
106
|
}), callback);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
@@ -125,7 +125,7 @@ class Scope {
|
|
|
125
125
|
const options_ = options;
|
|
126
126
|
return utilities_1.PromiseHelper.wrapAsync(() => exec.query(statement, {
|
|
127
127
|
...options_,
|
|
128
|
-
queryContext:
|
|
128
|
+
queryContext: `\`${bucket.name}\`.\`${this.name}\``,
|
|
129
129
|
}), callback);
|
|
130
130
|
}
|
|
131
131
|
/**
|