Full Code of couchbase/couchnode for AI

master 7378b6e1d268 cached
176 files
6.1 MB
1.6M tokens
3531 symbols
1 requests
Download .txt
Showing preview only (6,400K chars total). Download the full file or copy to clipboard to get everything.
Repository: couchbase/couchnode
Branch: master
Commit: 7378b6e1d268
Files: 176
Total size: 6.1 MB

Directory structure:
gitextract_4ye31yx3/

├── .clang-format
├── .editorconfig
├── .gitignore
├── .gitmodules
├── .istanbul.yml
├── .npmignore
├── .prettierrc
├── BUILDING.md
├── CMakeLists.txt
├── CONTRIBUTING.md
├── LICENSE
├── LOGGING.md
├── Makefile
├── README.md
├── couchbase-sdk-nodejs-black-duck-manifest.yaml
├── eslint.config.mjs
├── examples/
│   └── observability/
│       ├── combined/
│       │   ├── docker-compose.yml
│       │   ├── otel-collector-config.yml
│       │   ├── otel-otlp-metrics-and-tracing.js
│       │   ├── otel-otlp-metrics-and-tracing.ts
│       │   └── prometheus.yml
│       ├── metrics/
│       │   ├── docker-compose.yml
│       │   ├── otel-collector-config.yml
│       │   ├── otel-otlp-metrics-exporter.ts
│       │   └── prometheus.yml
│       └── tracing/
│           ├── console/
│           │   ├── otel-console-exporter.js
│           │   └── otel-console-exporter.ts
│           └── jaeger/
│               ├── docker-compose.yml
│               └── otel-otlp-tracing-exporter.ts
├── lib/
│   ├── analyticsexecutor.ts
│   ├── analyticsindexmanager.ts
│   ├── analyticstypes.ts
│   ├── authenticators.ts
│   ├── binarycollection.ts
│   ├── binding.ts
│   ├── bindingutilities.ts
│   ├── bucket.ts
│   ├── bucketmanager.ts
│   ├── cluster.ts
│   ├── collection.ts
│   ├── collectionmanager.ts
│   ├── configProfile.ts
│   ├── connspec.ts
│   ├── couchbase.ts
│   ├── crudoptypes.ts
│   ├── datastructures.ts
│   ├── diagnosticsexecutor.ts
│   ├── diagnosticstypes.ts
│   ├── errorcontexts.ts
│   ├── errors.ts
│   ├── eventingfunctionmanager.ts
│   ├── generaltypes.ts
│   ├── httpexecutor.ts
│   ├── logger.ts
│   ├── loggingmeter.ts
│   ├── metrics.ts
│   ├── mutationstate.ts
│   ├── observability.ts
│   ├── observabilityhandler.ts
│   ├── observabilitytypes.ts
│   ├── observabilityutilities.ts
│   ├── otelmeter.ts
│   ├── oteltracer.ts
│   ├── queryexecutor.ts
│   ├── queryindexmanager.ts
│   ├── querytypes.ts
│   ├── rangeScan.ts
│   ├── scope.ts
│   ├── scopeeventingfunctionmanager.ts
│   ├── scopesearchindexmanager.ts
│   ├── sdspecs.ts
│   ├── sdutils.ts
│   ├── searchexecutor.ts
│   ├── searchfacet.ts
│   ├── searchindexmanager.ts
│   ├── searchquery.ts
│   ├── searchsort.ts
│   ├── searchtypes.ts
│   ├── streamablepromises.ts
│   ├── thresholdlogging.ts
│   ├── tracing.ts
│   ├── transactions.ts
│   ├── transcoders.ts
│   ├── usermanager.ts
│   ├── utilities.ts
│   ├── utilities_internal.ts
│   ├── vectorsearch.ts
│   ├── version.ts
│   ├── viewexecutor.ts
│   ├── viewindexmanager.ts
│   └── viewtypes.ts
├── package.json
├── scripts/
│   ├── buildPrebuild.js
│   ├── install.js
│   ├── prebuilds.js
│   ├── prune.js
│   └── updateVersion.js
├── src/
│   ├── addondata.cpp
│   ├── addondata.hpp
│   ├── binding.cpp
│   ├── cas.cpp
│   ├── cas.hpp
│   ├── connection.cpp
│   ├── connection.hpp
│   ├── connection_autogen.cpp
│   ├── constants.cpp
│   ├── constants.hpp
│   ├── instance.cpp
│   ├── instance.hpp
│   ├── jstocbpp.hpp
│   ├── jstocbpp_autogen.hpp
│   ├── jstocbpp_basic.hpp
│   ├── jstocbpp_cpptypes.hpp
│   ├── jstocbpp_defs.hpp
│   ├── jstocbpp_errors.hpp
│   ├── jstocbpp_transactions.hpp
│   ├── mutationtoken.cpp
│   ├── mutationtoken.hpp
│   ├── scan_iterator.cpp
│   ├── scan_iterator.hpp
│   ├── transaction.cpp
│   ├── transaction.hpp
│   ├── transactions.cpp
│   ├── transactions.hpp
│   └── utils.hpp
├── test/
│   ├── analytics.test.js
│   ├── analyticslinks.test.js
│   ├── bucketmanager.test.js
│   ├── cluster.test.js
│   ├── collectionmanager.test.js
│   ├── connspec.test.js
│   ├── consistencyutil.js
│   ├── crud.test.js
│   ├── data/
│   │   ├── search_index.json
│   │   ├── test_vector.json
│   │   ├── test_vector_search_docs.json
│   │   └── vector_search_index.json
│   ├── datastructures.test.js
│   ├── diag.test.js
│   ├── errors.test.js
│   ├── eventing.test.js
│   ├── expiry.test.js
│   ├── harness.js
│   ├── jcbmock.js
│   ├── loggingmeter.test.js
│   ├── management.test.js
│   ├── metrics/
│   │   ├── metertypes.js
│   │   └── validators.js
│   ├── metricsdatastructures.test.js
│   ├── metricskv.test.js
│   ├── metricsmgmt.test.js
│   ├── metricsstreaming.test.js
│   ├── n1ql.test.js
│   ├── rangescan.test.js
│   ├── sdutils.test.js
│   ├── search.test.js
│   ├── streamablepromise.test.js
│   ├── testdata.js
│   ├── thresholdlogging.test.js
│   ├── tracing/
│   │   ├── tracingtypes.js
│   │   └── validators.js
│   ├── tracingdatastructures.test.js
│   ├── tracingkv.test.js
│   ├── tracingmgmt.test.js
│   ├── tracingstreaming.test.js
│   ├── transactions.test.js
│   ├── transcoder.test.js
│   ├── users.test.js
│   ├── utilities.test.js
│   ├── views.test.js
│   ├── workerthread.test.js
│   └── workerthread.worker.js
├── tools/
│   ├── gen-bindings-js.js
│   └── gen-bindings-json.py
├── tsconfig.json
└── typedoc.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
BasedOnStyle: LLVM
Standard: Cpp11
BreakBeforeBraces: Linux
ColumnLimit: '80'
IndentWidth: 4
DerivePointerAlignment: false
PointerAlignment: Right

AccessModifierOffset: -4
AllowShortFunctionsOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
KeepEmptyLinesAtTheStartOfBlocks: true
AlwaysBreakTemplateDeclarations: true
BreakConstructorInitializers: BeforeComma
CommentPragmas: '^[^ ]'
...


================================================
FILE: .editorconfig
================================================
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


================================================
FILE: .gitignore
================================================
# Local test configuration
config.json

# Compiled Object files
*.slo
*.lo
*.o

# Compiled Dynamic libraries
*.so

# Compiled Static libraries
*.lai
*.la
*.a

# The original file after running astyle:
*.orig

# Ignore some IDE-specific folder
/.idea
/.vscode

# User folders
*~

# Build stuff
/.lock-wscript
/build/
/node_modules/
/docs/
/test/CouchbaseMock.jar
/builderror.log
/configcache.txt
/coverage/
/benchmarks/
/.nyc_output/
/prebuilds/
/deps/couchbase-cxx-cache
*.tar.gz
/tools/bindings.json

# Extra stuff
/dist/
.DS_Store


================================================
FILE: .gitmodules
================================================
[submodule "deps/couchbase-cxx-client"]
	path = deps/couchbase-cxx-client
	url = https://github.com/couchbaselabs/couchbase-cxx-client.git

================================================
FILE: .istanbul.yml
================================================
instrumentation:
  excludes: ['lib/binding.ts']


================================================
FILE: .npmignore
================================================
# Local test configuration
config.json

# Compiled Object files
*.slo
*.lo
*.o

# Compiled Dynamic libraries
*.so

# Compiled Static libraries
*.lai
*.la
*.a

# The original file after running astyle:
*.orig

# Ignore some IDE-specific folder
/.idea
/.vscode

# User folders
*~

# Build stuff
/.lock-wscript
/build/
/node_modules/
/docs/
/test/CouchbaseMock.jar
/builderror.log
/configcache.txt
/coverage/
/benchmarks/
/.nyc_output/
/prebuilds/
/prebuildsDebug/
*.tar.gz

# Extra stuff
/.git
/lib/
/test/
.clang-format
.editorconfig
.eslintrc.js
.gitignore
.istanbul.yml
.prettierrc
Makefile
README.md
tsconfig.json
typedoc.json


================================================
FILE: .prettierrc
================================================
{
  "semi": false,
  "arrowParens": "always",
  "singleQuote": true,
  "trailingComma": "es5"
}


================================================
FILE: BUILDING.md
================================================
# Setup

Make sure to have cloned the [SDK repository](https://github.com/couchbase/couchnode.git) and have the submodules appropriately synced (`git submodule update --init --recursive`).

# Building

## Set CPM Cache
The C++ core utilizes the CMake Package Manager (CPM) to include depencies.  These can be set to a cache directory and can be used for future builds.  Periodically the dependencies should be updated.  So, in general it is good practice to configure the build environment by setting the CPM cache.

### Via npm command
```console
npm run prebuild -- --configure --set-cpm-cache --use-boringssl
```

### Available Options
>Note: Section under construction

### Via cmake-js

Set the cache directory `CXXCBC_CACHE_DIR`:
```console
export CXXCBC_CACHE_DIR=$PWD/deps/couchbase-cxx-cache
```

Remove the cache directory
```console
rm -rf $CXXCBC_CACHE_DIR
```

Configure the build:
```console
$ npx cmake-js configure \
--runtime node \
--runtime-version $(node --version) \
--CDUSE_STATIC_OPENSSL=OFF \
--CDCPM_DOWNLOAD_ALL=OFF \
--CDCPM_USE_NAMED_CACHE_DIRECTORIES=ON \
--CDCPM_USE_LOCAL_PACKAGES=OFF \
--CDCPM_SOURCE_CACHE=$CXXCBC_CACHE_DIR
```

## Build the client binary

### Via npm command
```console
npm run prebuild -- --use-boringssl
```

### Available Options
>Note: Section under construction

### Via cmake-js

>NOTE:  If using the `compile` command, the build will automatically clean and re-execute a build upon a failure.  Use the `build` command to only attempt a single build.

Set the cache directory (if it has not already been set) `CXXCBC_CACHE_DIR`:
```console
export CXXCBC_CACHE_DIR=$PWD/deps/couchbase-cxx-cache
```

```console
npx cmake-js compile \
--runtime node \
--runtime-version $(node --version) \
--CDUSE_STATIC_OPENSSL=OFF \
--CDCPM_DOWNLOAD_ALL=OFF \
--CDCPM_USE_NAMED_CACHE_DIRECTORIES=ON \
--CDCPM_USE_LOCAL_PACKAGES=OFF \
--CDCPM_SOURCE_CACHE=$CXXCBC_CACHE_DIR
```

# Autogen

>**IMPORTANT**: Autogen is only needed for maintainers of the library.  If not making updates to the core bindings, running the autogen tooling should *NOT* be required.

Move into the `tools` directory prior to running any autogen commands.

## Python Environment

>NOTE: Python >= 3.9 required

Setup virtual env:
```console
python3 -m venv <path to virtualenv>
```
Example: `python3 -m venv $(pwd)/couchnode`

Activate virtual env:
```console
source <path to virtualenv>/bin/activate
```
Example: `source $(pwd)/couchnode/bin/activate`

Install `clang` from PyPI:
```console
python3 -m pip install clang
```

Generate `bindings.json`.  If no arguments are passed in the binding generator will attempt to determine the necessary version, lib directory, include directory and system headers directory.
```console
python3 gen-bindings-json.py
```
Alternatively, options can be provided (or ENV variables may be set):
```console
python gen-bindings-json.py -v $(llvm-config --version) \
-i $(llvm-config --includedir) \
-l $(llvm-config --libdir) \
-s $(xcrun --show-sdk-path)
```

Available Environment Variables:
- `CN_LLVM_VERSION`: LLVM version
- `CN_LLVM_INCLUDE`: LLVM include directory path
- `CN_LLVM_LIB`:  LLVM lib directory path
- `CN_SYS_HEADERS`: System headers path

## Node.js

Populate SDK autogen code sections:
```console
node gen-bindings.js.js
```

## clean-up
### Format C++ source files.

On MacOS, make sure LLVM clang-format is used (configure the PATH appropriately):
```console
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" 
```

>NOTE:  Be aware of the current working directory (commands below assume the CWD is `tools`).

```console
clang-format -i ../src/connection.cpp
clang-format -i ../src/connection.hpp
clang-format -i ../src/connection_autogen.cpp
clang-format -i ../src/constants.cpp
clang-format -i ../src/jstocbpp_autogen.hpp
```
### Format Node.js source files.

>NOTE:  Be aware of the current working directory (commands below assume the CWD is `tools`).

```console
npx prettier --write ../lib/binding.ts
```

### Remove bindings.json

```console
rm bindings.json
```

### Format autogen scripts.

This should rarely be needed (e.g. updating the autogen logic).

>NOTE:  Be aware of the current working directory (commands below assume the CWD is `tools`).

#### Python

Install `autopep8` from PyPI:
```console
python3 -m pip install autopep8
```

```console
autopep8 -i -a -a --max-line-length 120 gen-bindings-json.py
```

#### Node.js
```console
npx prettier --write gen-bindings-js.js
```

If a virtualenv was setup (hopefully it was ;)), deactivate and the environment
```console
deactivate
rm -rf <path to virtualenv>
```
Example: `deactivate && rm -rf $(pwd)/couchnode`

================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.19)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0048 NEW)
include(FetchContent)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

project (couchbase_impl)

function(get_couchnode_version)
  execute_process(COMMAND node -e "console.log(JSON.parse(fs.readFileSync('${PROJECT_SOURCE_DIR}/package.json')).version)"
                  OUTPUT_VARIABLE sdk_version)
  string(STRIP "${sdk_version}" SDK_VERSION)
  set(COUCHNODE_VERSION "${SDK_VERSION}" PARENT_SCOPE)
endfunction()

function(download_nodejs_headers)
  message("Finding Node.js headers SHA for version: ${NODE_RUNTIMEVERSION}")
  file(DOWNLOAD
    https://nodejs.org/dist/v${NODE_RUNTIMEVERSION}/SHASUMS256.txt
    "${CMAKE_CURRENT_BINARY_DIR}/SHASUM256.txt"
    TLS_VERIFY ON)

  file(READ "${CMAKE_CURRENT_BINARY_DIR}/SHASUM256.txt" HASH_FILE_CONTENT)
  set(REGEX_CHECK "node-v${NODE_RUNTIMEVERSION}-headers.tar.gz")
  string(REPLACE "\n" ";" HASH_FILE_CONTENT ${HASH_FILE_CONTENT})
  FOREACH(HASH ${HASH_FILE_CONTENT})
    string(FIND ${HASH} ${REGEX_CHECK} FOUND_FILE)
    if("${FOUND_FILE}" GREATER_EQUAL "0")
      string(REGEX MATCH
            "^[0-9a-f]+"
            CB_NODE_VERSION_SHA256
            ${HASH})
      break()
    endif()
  ENDFOREACH()

  if(NOT CB_NODE_VERSION_SHA256)
    message(FATAL_ERROR "Failed to extract expected hash from node shasum file.")
  else()
    message("Using SHA=${CB_NODE_VERSION_SHA256}")
  endif()
  if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
    # see https://cmake.org/cmake/help/latest/policy/CMP0135.html
    # and Externalproject_add - DOWNLOAD_EXTRACT_TIMESTAMP
    FetchContent_Declare(
      nodejs_headers
      URL https://nodejs.org/dist/v${NODE_RUNTIMEVERSION}/node-v${NODE_RUNTIMEVERSION}-headers.tar.gz
      URL_HASH SHA256=${CB_NODE_VERSION_SHA256}
      DOWNLOAD_EXTRACT_TIMESTAMP FALSE
      )
  else()
    FetchContent_Declare(
      nodejs_headers
      URL https://nodejs.org/dist/v${NODE_RUNTIMEVERSION}/node-v${NODE_RUNTIMEVERSION}-headers.tar.gz
      URL_HASH SHA256=${CB_NODE_VERSION_SHA256}
      )
  endif()

  message("Downloading Node.js ${NODE_RUNTIMEVERSION} headers...")
  FetchContent_MakeAvailable(nodejs_headers)
  message("Downloaded Node.js ${NODE_RUNTIMEVERSION} headers to ${nodejs_headers_SOURCE_DIR}")
  set(NODEJS_INC_DIR "${nodejs_headers_SOURCE_DIR}/include/node" PARENT_SCOPE)
endfunction()

function(download_nodejs_win_lib)
  if(NODE_RUNTIME STREQUAL "electron")
    set(NODE_LIB_URL "https://artifacts.electronjs.org/headers/dist/v${NODE_RUNTIMEVERSION}")
    if(NODE_ARCH STREQUAL "x64")
      set(NODE_LIB_URL "${NODE_LIB_URL}/x64")
    endif()
  else()
    set(NODE_LIB_URL "https://nodejs.org/dist/v${NODE_RUNTIMEVERSION}")
    if(NODE_ARCH STREQUAL "x64")
      set(NODE_LIB_URL "${NODE_LIB_URL}/win-x64")
    else()
      set(NODE_LIB_URL "${NODE_LIB_URL}/win-x86")
    endif()
  endif()
  set(NODE_LIB_URL "${NODE_LIB_URL}/node.lib")

  FetchContent_Declare(
    nodejs_win_lib
    URL ${NODE_LIB_URL}
    DOWNLOAD_NO_EXTRACT TRUE
    )

  message("Downloading ${NODE_RUNTIME} v${NODE_RUNTIMEVERSION} win lib...")
  FetchContent_MakeAvailable(nodejs_win_lib)
  message("Downloaded ${NODE_RUNTIME} v${NODE_RUNTIMEVERSION} win lib to ${nodejs_win_lib_SOURCE_DIR}")
  set(NODEJS_LIB "${nodejs_win_lib_SOURCE_DIR}/node.lib" PARENT_SCOPE)
endfunction()

option(USE_STATIC_OPENSSL "Statically link OpenSSL instead of BoringSSL" TRUE)

if(USE_STATIC_OPENSSL AND "${NODE_RUNTIME}" STREQUAL "electron")
  message(STATUS "Found electron runtime, using BoringSSL.")
  set(USE_STATIC_OPENSSL FALSE)
endif()

message(STATUS "USE_STATIC_OPENSSL=${USE_STATIC_OPENSSL}")
if(NOT USE_STATIC_OPENSSL)
  set(COUCHBASE_CXX_CLIENT_POST_LINKED_OPENSSL OFF CACHE BOOL "" FORCE)
  set(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL ON CACHE BOOL "" FORCE)
  if(WIN32)
    # Using /MD compile flag as that is what BoringSSL uses and since we cannot override their CMake config
	  # (see link below), we need to use the DLL-specific version of the run-time library.
    # REF: https://github.com/google/boringssl/blob/f86dd185939a0a81dbbaea4f26d95f299d26811b/CMakeLists.txt#L203-L216
    set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
    SET(NODEJS_LIB "${CMAKE_JS_LIB}")
  endif()
else()
  set(COUCHBASE_CXX_CLIENT_POST_LINKED_OPENSSL ON CACHE BOOL "" FORCE)
  # cmake-js >= v7.0 no longer downloads the full Node.js headers and utilizes the https://github.com/nodejs/node-api-headers
  # project.  Since we rely on Node's OpenSSL we need to pull in more than just the node-api headers, so lets download
  # the headers ourselves.
  if(CMAKE_JS_VERSION VERSION_GREATER_EQUAL "7.0.0")
    set(NODEJS_INC_DIR "")
    download_nodejs_headers()
    set(NODEJS_INC_DIR "${NODEJS_INC_DIR};${CMAKE_JS_INC}")
    if(WIN32)
      # cmake-js >= v7.0 no longer downloads the full Node.js Windows lib and utilizes the https://github.com/nodejs/node-api-headers
      # project to build the lib.  We need to pull in more than just the node-api headers, so lets download the node.lib ourselves.
      SET(NODEJS_LIB "")
      download_nodejs_win_lib()
    endif()
  else()
    set(NODEJS_INC_DIR "${CMAKE_JS_INC}")
    SET(NODEJS_LIB "${CMAKE_JS_LIB}")
  endif()
  if(WIN32)
    # /MT compile flag: use static version of run-time library
    set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
  endif()
endif()

if(CMAKE_JS_VERSION VERSION_GREATER_EQUAL "7.0.0")
  set(NODEJS_INC_DIR "${NODEJS_INC_DIR};${CMAKE_JS_INC}")
else()
  set(NODEJS_INC_DIR "${CMAKE_JS_INC}")
endif()
list(REMOVE_DUPLICATES NODEJS_INC_DIR)

message(STATUS "NODEJS_INC_DIR=${NODEJS_INC_DIR}")
message(STATUS "NODEJS_LIB=${NODEJS_LIB}")

# Set up some build requirements for Windows.
if(WIN32)
  add_definitions(/bigobj)
  add_definitions(-D_WIN32_WINNT=0x0601)
endif()

# We need to import headers globally for our dependant libraries such as couchbase-cxx-client.
include_directories(SYSTEM ${NODEJS_INC_DIR})

get_couchnode_version()
message(STATUS "COUCHNODE_VERSION=${COUCHNODE_VERSION}")

set(COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID "nodejs/${COUCHNODE_VERSION}" CACHE STRING "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_STATIC ON CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_INSTALL OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(COUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY OFF CACHE BOOL "" FORCE)

# In case we need to build the SDK on RHEL >= RHEL8, allow users to dynamically link C++ std libs.
option(USE_DYNAMIC_STDLIB "Dynamically link C++ standard library" FALSE)
if(DEFINED ENV{CN_USE_DYNAMIC_STDLIB})
  set(USE_DYNAMIC_STDLIB $ENV{CN_USE_DYNAMIC_STDLIB})
endif()

if(USE_DYNAMIC_STDLIB)
  set(COUCHBASE_CXX_CLIENT_STATIC_STDLIB OFF CACHE BOOL "" FORCE)
else()
  set(COUCHBASE_CXX_CLIENT_STATIC_STDLIB ON CACHE BOOL "" FORCE)
endif()
message(STATUS "USE_DYNAMIC_STDLIB=${USE_DYNAMIC_STDLIB}")

# handle CPM cache dir
if(DEFINED COUCHBASE_CXX_CPM_CACHE_DIR AND NOT COUCHBASE_CXX_CPM_CACHE_DIR STREQUAL "")
  set(CPM_SOURCE_CACHE "${COUCHBASE_CXX_CPM_CACHE_DIR}")
endif()

if(DEFINED CPM_SOURCE_CACHE)
  message(STATUS "CPM_SOURCE_CACHE=${CPM_SOURCE_CACHE}")
endif()

add_subdirectory(deps/couchbase-cxx-client)

set(COUCHBASE_CXX_BINARY_DIR "${CMAKE_BINARY_DIR}/deps/couchbase-cxx-client")
message(STATUS "COUCHBASE_CXX_BINARY_DIR=${COUCHBASE_CXX_BINARY_DIR}")
if(DEFINED COUCHBASE_CXX_CPM_CACHE_DIR AND NOT COUCHBASE_CXX_CPM_CACHE_DIR STREQUAL "")
  file(COPY "${COUCHBASE_CXX_BINARY_DIR}/mozilla-ca-bundle.crt" "${COUCHBASE_CXX_BINARY_DIR}/mozilla-ca-bundle.sha256"
    DESTINATION "${COUCHBASE_CXX_CPM_CACHE_DIR}")
  message(STATUS "Copied Mozilla cert bundle to cache.  COUCHBASE_CXX_CPM_CACHE_DIR=${COUCHBASE_CXX_CPM_CACHE_DIR}")
endif()

file(GLOB SOURCE_FILES "src/*.cpp")
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
target_compile_definitions(${PROJECT_NAME} PRIVATE COUCHBASE_CXX_CLIENT_IGNORE_CORE_DEPRECATIONS)
add_definitions(-DNAPI_VERSION=6)
set(COUCHBASE_CXX_SOURCE_DIR "${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client")
if(CMAKE_JS_VERSION VERSION_GREATER_EQUAL "7.0.0")
  target_include_directories(${PROJECT_NAME}
    PRIVATE ${NODEJS_INC_DIR}
            "${COUCHBASE_CXX_BINARY_DIR}/generated"
            "${COUCHBASE_CXX_SOURCE_DIR}"
            "${COUCHBASE_CXX_SOURCE_DIR}/third_party/cxx_function"
            "${COUCHBASE_CXX_SOURCE_DIR}/third_party/expected/include")
else()
  execute_process(COMMAND node -p "require('node-addon-api').include"
          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
          OUTPUT_VARIABLE NODE_ADDON_API_DIR
          )
  string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
  string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})

  target_include_directories(${PROJECT_NAME}
    PRIVATE ${NODEJS_INC_DIR}
            ${NODE_ADDON_API_DIR}
            "${COUCHBASE_CXX_BINARY_DIR}/generated"
            "${COUCHBASE_CXX_SOURCE_DIR}"
            "${COUCHBASE_CXX_SOURCE_DIR}/third_party/cxx_function"
            "${COUCHBASE_CXX_SOURCE_DIR}/third_party/expected/include")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")

target_link_libraries(${PROJECT_NAME}
  ${NODEJS_LIB}
  couchbase_cxx_client_static_intermediate
  asio
  Microsoft.GSL::GSL
  taocpp::json
  spdlog::spdlog
)

if(MSVC)
  # If using BoringSSL we need to generate node.lib, if using OpenSSL we download node.lib.
  if(NOT USE_STATIC_OPENSSL AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
    execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
  endif()

  # Workaround a bug in cmake-js with removal of used references:
  # https://github.com/cmake-js/cmake-js/issues/205
  target_link_options(${PROJECT_NAME} PUBLIC /OPT:NOREF)

  # since we only care about the *.PDB for a command line build, this _should_ be okay.
  if(CMAKE_BUILD_TYPE STREQUAL "Release")
      target_compile_options(${PROJECT_NAME} PUBLIC /Zi)

      # Do we want /OPT:ICF?
      set_target_properties(${PROJECT_NAME} PROPERTIES
        LINK_FLAGS "/INCREMENTAL:NO /DEBUG"
        COMPILE_PDB_NAME ${PROJECT_NAME}
        COMPILE_PDB_OUTPUT_DIR ${CMAKE_BINARY_DIR}
      )
  endif()
endif()


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

In addition to filing bugs, you may contribute by submitting patches to fix bugs in the library. Contributions may be submitted to <http://review.couchbase.com>.  We use Gerrit as our code review system - and thus submitting a change requires an account there. While Github pull requests are not ignored, Gerrit pull requests will be responded to more quickly (and most likely with more detail).

For something to be accepted into the codebase, it must be formatted properly and have undergone proper testing.

## Branches and Tags

* The `master` branch represents the mainline branch. The master branch typically consists of content going into the next release.
* For older series of the Couchbase Node.js SDK see the corresponding branches: 2.x = `v2` and 3.x = `v3`.

## Contributing Patches

If you wish to contribute a new feature or a bug fix to the library, try to follow the following guidelines to help ensure your change gets merged upstream.

### Before you begin

For any code change, ensure the new code you write looks similar to the code surrounding it. We have no strict code style policies, but do request that your code stand out as little as possible from its surrounding neighborhood (unless of course your change is stylistic in nature).

If your change is going to involve a substantial amount of time or effort, please attempt to discuss it with the project developers first who will provide assistance and direction where possible.

#### For new features

Ensure the feature you are adding does not already exist, and think about how this feature may be useful for other users. In general less intrusive changes are more likely to be accepted.

#### For fixing bugs

Ensure the bug you are fixing is actually a bug (and not a usage) error, and that it has not been fixed in a more recent version. Please read the [release notes](https://docs.couchbase.com/nodejs-sdk/current/project-docs/sdk-release-notes.html) as well as the [issue tracker](https://jira.issues.couchbase.com/projects/JSCBC/issues/) to see a list of open and resolved issues.

### Code Review

#### Signing up on Gerrit

Everything that is merged into the library goes through a code review process.  The code review process is done via [Gerrit](http://review.couchbase.org).

To sign up for a Gerrit account, go to http://review.couchbase.org and click on the _Register_ link at the top right. Once you've signed in you will need to agree to the CLA (Contributor License Agreement) by going you your Gerrit account page and selecting the _Agreements_ link on the left. When you've done that, everything should flow through just fine.  Be sure that you have registered your email address at http://review.couchbase.org/#/settings/contact as many sign-up methods won't pass emails along.  Note that your email address in your code commit and in the Gerrit settings must match.

Add your public SSH key to Gerrit before submitting.

#### Setting up your fork with Gerrit

Assuming you have a repository created like so:

```
$ git clone https://github.com/couchbase/couchnode.git
```

you can simply perform two simple steps to get started with Gerrit:

```
$ git remote add gerrit ssh://${USERNAME}@review.couchbase.org:29418/couchnode
$ scp -P 29418 ${USERNAME}@review.couchbase.org:hooks/commit-msg .git/hooks
$ chmod a+x .git/hooks/commit-msg
```

The last change is required for annotating each commit message with a special header known as `Change-Id`. This allows Gerrit to group together different revisions of the same patch.

#### Pushing a changeset

Now that you have your change and a Gerrit account to push to, you need to upload the change for review. To do so, invoke the following incantation:

```
$ git push gerrit HEAD:refs/for/master
```

Where `gerrit` is the name of the _remote_ added earlier.

#### Pushing a new patchset

After a change has been pushed to Gerrit, further revisions can be made and then uploaded.  These revisions are called patchsets and are associated with the the `Change-Id` created from the initial commit (see above).  To push a new revision, simply ammend the commit (can also add the `--no-edit` option if no edits to the commit message are needed):

```
$ git commit --amend
```

Then push the revision to Gerrit:

```
$ git push gerrit HEAD:refs/for/master
```

Where `gerrit` is the name of the _remote_ added earlier.

#### Troubleshooting

You may encounter some errors when pushing. The most common are:

* "You are not authorized to push to this repository". You will get this if your account has not yet been approved.  Please reach out in the [forums](https://www.couchbase.com/forums/c/node-js-sdk/12) if blocked.
* "Missing Change-Id". You need to install the `commit-msg` hook as described above.  Note that even once you do this, you will need to ensure that any prior commits already have this header - this may be done by doing an interactive rebase (e.g.  `git rebase -i origin/master` and selecting `reword` for all the commits; which will automatically fill in the Change-Id).

#### Reviewers

Once you've pushed your changeset you can add people to review. Currently these are:

* Jared Casey
* Matt Wozakowski
* Brett Lawson


================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

This library also makes use of boringssl so the following licenses also apply:

  OpenSSL License
  ---------------

/* ====================================================================
 * Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@openssl.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

 Original SSLeay License
 -----------------------

/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
 * All rights reserved.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
 * This library is free for commercial and non-commercial use as long as
 * the following conditions are aheared to.  The following conditions
 * apply to all code found in this distribution, be it the RC4, RSA,
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
 * included with this distribution is covered by the same copyright terms
 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
 *
 * Copyright remains Eric Young's, and as such any Copyright notices in
 * the code are not to be removed.
 * If this package is used in a product, Eric Young should be given attribution
 * as the author of the parts of the library used.
 * This can be in the form of a textual message at program startup or
 * in documentation (online or textual) provided with the package.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    "This product includes cryptographic software written by
 *     Eric Young (eay@cryptsoft.com)"
 *    The word 'cryptographic' can be left out if the rouines from the library
 *    being used are not cryptographic related :-).
 * 4. If you include any Windows specific code (or a derivative thereof) from 
 *    the apps directory (application code) you must include an acknowledgement:
 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
 *
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * The licence and distribution terms for any publically available version or
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
 * copied and put under another distribution licence
 * [including the GNU Public Licence.]
 */


ISC license used for completely new code in BoringSSL:

/* Copyright (c) 2015, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */


================================================
FILE: LOGGING.md
================================================
# Quick Start

The simplest way to enable logging is to set the `CNLOGLEVEL` environment variable:

```console
CNLOGLEVEL=info node your-app.js
```

This will output SDK logs at INFO level and above (info, warn, error) to the console.

> NOTE: This is separate from the underlying C++ core console logger that is created with the `CBPPLOGLEVEL` environment variable. Integration of the core logger will be implemented in a future version of the SDK.

# Environment Variable Configuration

The SDK automatically checks the `CNLOGLEVEL` environment variable when connecting to a cluster. If set to a valid log level and no logger is explicitly provided, the SDK will create a console logger at the specified level.

### Valid Values

The following values are accepted (case-insensitive):

- `trace` - Most verbose, logs everything
- `debug` - Detailed debugging information
- `info` - General informational messages
- `warn` - Warning messages and above
- `error` - Error messages only (least verbose)

Invalid values will be ignored, and the SDK will default to no logging.

# Log Levels

The SDK uses five standard log levels in ascending order of severity:

| Level | Value | Description              | When to Use                         |
| ----- | ----- | ------------------------ | ----------------------------------- |
| TRACE | 0     | Finest-grained debugging | Tracing code execution paths        |
| DEBUG | 1     | Detailed debugging info  | Debugging application issues        |
| INFO  | 2     | Informational messages   | Tracking application progress       |
| WARN  | 3     | Warning messages         | Potentially harmful situations      |
| ERROR | 4     | Error messages           | Errors allowing continued execution |

# Programmatic Console Logger

You can create a console logger programmatically using the `createConsoleLogger()` function.

## Basic Usage

### TypeScript:

```TypeScript
import { connect, createConsoleLogger, LogLevel } from 'couchbase'

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: createConsoleLogger(LogLevel.INFO)
})
```

### JavaScript:

```JavaScript
const couchbase = require('couchbase')

const cluster = await couchbase.connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: couchbase.createConsoleLogger(couchbase.LogLevel.INFO)
})
```

## Logging Prefix

Add a prefix to all log messages for easier identification:

```TypeScript
import { connect, createConsoleLogger, LogLevel } from 'couchbase'

const logger = createConsoleLogger(LogLevel.DEBUG, '[Couchbase]')

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})

logger.info('Connection established!')
```

Output:

```console
[Couchbase] Connection established!
```

# Custom Logger Integration

The SDK uses a simple logging interface that makes it easy to integrate with popular logging libraries.

## Logger Interface

```TypeScript
interface Logger {
  trace?(message: string, ...args: any[]): void
  debug?(message: string, ...args: any[]): void
  info?(message: string, ...args: any[]): void
  warn?(message: string, ...args: any[]): void
  error?(message: string, ...args: any[]): void
}
```

All methods are optional. The SDK safely handles loggers that only implement a subset of methods.

## Simple Custom Logger

### TypeScript:
```TypeScript
class CustomLogger implements Logger {
  trace(msg: string, ...args: any[]): void {
    console.log('[TRACE]', msg, ...args)
  }

  debug(msg: string, ...args: any[]): void {
    console.log('[DEBUG]', msg, ...args)
  }

  info(msg: string, ...args: any[]): void {
    console.log('[INFO]', msg, ...args)
  }

  warn(msg: string, ...args: any[]): void {
    console.warn('[WARN]', msg, ...args)
  }

  error(msg: string, ...args: any[]): void {
    console.error('[ERROR]', msg, ...args)
  }
}

customLogger = new CustomLogger()

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: customLogger
})
```
### JavaScript:
```JavaScript
const customLogger = {
    trace: (msg, ...args) => console.log('[TRACE]', msg, ...args),
    debug: (msg, ...args) => console.log('[DEBUG]', msg, ...args),
    info: (msg, ...args) => console.log('[INFO]', msg, ...args),
    warn: (msg, ...args) => console.warn('[WARN]', msg, ...args),
    error: (msg, ...args) => console.error('[ERROR]', msg, ...args)
}

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: customLogger
})
```

## Integration with Pino

[Pino](https://github.com/pinojs/pino) is a fast, low-overhead logging library (`npm install pino`). Its API naturally matches the Couchbase Logger interface.

### Basic Integration

```TypeScript
import pino from 'pino'
import { connect } from 'couchbase'

const logger = pino({ level: 'info' })

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

### With Custom Configuration

```TypeScript
import pino from 'pino'
import { connect } from 'couchbase'

const logger = pino({
  level: 'debug',
  formatters: {
    level: (label) => {
      return { level: label }
    }
  },
  transport: {
    target: 'pino-pretty', // need the pino-pretty package
    options: {
      colorize: true,
      translateTime: 'SYS:standard'
    }
  }
})

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

### Child Logger with Context

```TypeScript
import pino from 'pino'
import { connect } from 'couchbase'

const baseLogger = pino({ level: 'info' })
const couchbaseLogger = baseLogger.child({ component: 'couchbase' })

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: couchbaseLogger
})
```

## Integration with Winston

[Winston](https://github.com/winstonjs/winston) is a versatile logging library with support for multiple transports (`npm install winston`). Its API also matches the Couchbase Logger interface.

### Basic Integration

```TypeScript
import winston from 'winston'
import { connect } from 'couchbase'

const logger = winston.createLogger({
  level: 'info',
  format: winston.format.combine(
    winston.format.timestamp(),
    winston.format.json()
  ),
  transports: [
    new winston.transports.Console()
  ]
})

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

### With Multiple Transports

```TypeScript
import winston from 'winston'
import { connect } from 'couchbase'

const logger = winston.createLogger({
  level: 'debug',
  format: winston.format.combine(
    winston.format.timestamp(),
    winston.format.errors({ stack: true }),
    winston.format.json()
  ),
  transports: [
    // Write all logs to console
    new winston.transports.Console({
      format: winston.format.combine(
        winston.format.colorize(),
        winston.format.simple()
      )
    }),
    // Write all logs to a file
    new winston.transports.File({
      filename: 'couchbase.log',
      level: 'info'
    }),
    // Write error logs to a separate file
    new winston.transports.File({
      filename: 'couchbase-error.log',
      level: 'error'
    })
  ]
})

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

## Integration with Debug Package

The [debug](https://www.npmjs.com/package/debug) package uses a different API pattern, but you can create a simple adapter.

### Basic Integration

```TypeScript
import createDebug from 'debug'
import { connect, Logger } from 'couchbase'

const debugLogger = createDebug('couchbase')

// Create an adapter that implements the Logger interface
class CustomLogger implements Logger {
  trace(msg: string, ...args: any[]): void {
    debugLogger('[TRACE]', msg, ...args)
  }

  debug(msg: string, ...args: any[]): void {
    debugLogger('[DEBUG]', msg, ...args)
  }

  info(msg: string, ...args: any[]): void {
    debugLogger('[INFO]', msg, ...args)
  }

  warn(msg: string, ...args: any[]): void {
    debugLogger('[WARN]', msg, ...args)
  }

  error(msg: string, ...args: any[]): void {
    debugLogger('[ERROR]', msg, ...args)
  }
}

const logger = new CustomLogger()

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

To enable debug output, set the `DEBUG` environment variable:

```console
DEBUG=couchbase node your-app.js
```

### With Separate Debug Instances per Level

```TypeScript
import createDebug from 'debug'
import { connect, Logger } from 'couchbase'

// Create separate debug instances for each log level
const debugTrace = createDebug('couchbase:trace')
const debugDebug = createDebug('couchbase:debug')
const debugInfo = createDebug('couchbase:info')
const debugWarn = createDebug('couchbase:warn')
const debugError = createDebug('couchbase:error')

class CustomLogger implements Logger {
  trace(msg: string, ...args: any[]): void {
    debugTrace(msg, ...args)
  }

  debug(msg: string, ...args: any[]): void {
    debugDebug(msg, ...args)
  }

  info(msg: string, ...args: any[]): void {
    debugInfo(msg, ...args)
  }

  warn(msg: string, ...args: any[]): void {
    debugWarn(msg, ...args)
  }

  error(msg: string, ...args: any[]): void {
    debugError(msg, ...args)
  }
}

const logger = new CustomLogger()

const cluster = await connect('couchbase://localhost', {
  username: 'Administrator',
  password: 'password',
  logger: logger
})
```

Enable specific log levels with wildcards:

```console
# Only errors and warnings
DEBUG=couchbase:error,couchbase:warn node your-app.js

# All levels
DEBUG=couchbase:* node your-app.js

# Everything except trace
DEBUG=couchbase:*,-couchbase:trace node your-app.js
```


================================================
FILE: Makefile
================================================
all: binding src/ deps/
	@node-gyp build

binding: binding.gyp
	@node-gyp configure

clean:
	@node-gyp clean

install:
	@npm install

node_modules:
	@npm install

checkdeps:
	npm run check-deps

checkaudit:
	npm audit

test: node_modules
	npm run test
fasttest: node_modules
	npm run test-fast

lint: node_modules
	npm run lint

cover: node_modules
	npm run cover
fastcover: node_modules
	npm run cover-fast

check: checkdeps checkaudit docs lint test cover

docs: node_modules
	npm run build-docs

prebuilds:
	npm run prebuild

.PHONY: all test clean docs browser prebuilds


================================================
FILE: README.md
================================================
# Couchbase Node.js Client

The Node.js SDK library allows you to connect to a Couchbase cluster from
Node.js. It is a native Node.js module and uses the very fast libcouchbase
library to handle communicating to the cluster over the Couchbase binary
protocol.

## Useful Links

Source - [https://github.com/couchbase/couchnode](https://github.com/couchbase/couchnode)

Bug Tracker - [https://jira.issues.couchbase.com/projects/JSCBC/issues/](https://jira.issues.couchbase.com/projects/JSCBC/issues/)

Couchbase Developer Portal - [https://docs.couchbase.com/](https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html)

Release Notes - [https://docs.couchbase.com/nodejs-sdk/3.0/project-docs/sdk-release-notes.html](https://docs.couchbase.com/nodejs-sdk/3.0/project-docs/sdk-release-notes.html)

## Installing

To install the lastest release using npm, run:

```bash
npm install couchbase
```

To install the development version directly from github, run:

```bash
npm install "git+https://github.com/couchbase/couchnode.git#master"
```

## Introduction

Connecting to a Couchbase bucket is as simple as creating a new `Cluster`
instance to represent the `Cluster` you are using, and then using the
`bucket` and `collection` commands against this to open a connection to
open your specific bucket and collection. You are able to execute most
operations immediately, and they will be queued until the connection is
successfully established.

Here is a simple example of instantiating a connection, adding a new document
into the bucket and then retrieving its contents:

**Javascript:**
```javascript
const couchbase = require('couchbase')

async function main() {
  const cluster = await couchbase.connect(
    'couchbase://127.0.0.1',
    {
      username: 'username',
      password: 'password',
    })

  const bucket = cluster.bucket('default')
  const coll = bucket.defaultCollection()
  await coll.upsert('testdoc', { foo: 'bar' })

  const res = await coll.get('testdoc')
  console.log(res.content)
}

// Run the main function
main()
  .then((_) => {
    console.log ('Success!')
  })
  .catch((err) => {
    console.log('ERR:', err)
  })
```

**Typescript:**
```javascript
import {
  Bucket,
  Cluster,
  Collection,
  connect,
  GetResult,
} from 'couchbase'

async function main() {
  const cluster: Cluster = await connect(
    'couchbase://127.0.0.1',
    {
      username: 'username',
      password: 'password',
    })

  const bucket: Bucket = cluster.bucket('default')
  const coll: Collection = bucket.defaultCollection()
  await coll.upsert('testdoc', { foo: 'bar' })

  const res: GetResult = await coll.get('testdoc')
  console.log(res.content)
}

// Run the main function
main()
  .then((_) => {
    console.log ('Success!')
  })
  .catch((err) => {
    console.log('ERR:', err)
  })
```

## AWS Lambda

Version 4.2.5 of the SDK significantly reduces the size of the prebuilt binary provided with the SDK on supported platforms. The reduction
enables the SDK to meet the [minimum size requirements](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for an AWS lambda deployment package without extra steps for reducing the size of the package.  However, if further size reduction is desired, the SDK provides a script to provide recommendations for size reduction.

**Script:**
```bash
npm explore couchbase -- npm run help-prune
```

**Example output:**
```bash
Checking for platform packages in /tmp/couchnode-test/node_modules/@couchbase that do not match the expected platform package (couchbase-linux-x64-openssl1).
Found mismatch: Path=/tmp/couchnode-test/node_modules/@couchbase/couchbase-linuxmusl-x64-openssl1

Recommendations for pruning:

Removing mismatched platform=couchbase-linuxmusl-x64-openssl1 (path=/tmp/couchnode-test/node_modules/@couchbase/couchbase-linuxmusl-x64-openssl1) saves ~13.31 MB on disk.
Removing Couchbase deps/ (path=/tmp/couchnode-test/node_modules/couchbase/deps) saves ~45.51 MB on disk.
Removing Couchbase src/ (path=/tmp/couchnode-test/node_modules/couchbase/src) saves ~0.61 MB on disk.
```

## Documentation

An extensive documentation is available on the Couchbase website - [https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html](https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html) -
including numerous examples and code samples.

Visit our [Couchbase Node.js SDK forum](https://forums.couchbase.com/c/node-js-sdk) for help.
Or get involved in the [Couchbase Community](https://couchbase.com/community) on the [Couchbase](https://couchbase.com) website.

## Source Control

The source code is available at
[https://github.com/couchbase/couchnode](https://github.com/couchbase/couchnode).
Once you have cloned the repository, you may contribute changes through our
gerrit server. For more details see
[CONTRIBUTING.md](https://github.com/couchbase/couchnode/blob/master/CONTRIBUTING.md).

To build the client, follow the steps outlined on the [BUILDING page](https://github.com/couchbase/couchnode/blob/main/BUILDING.md)

To execute our test suite, run `make test` from the root directory.

To execute our code coverage, run `make cover` from the root directory.

In addition to the full test suite and full code coverage, you may additionally
execute a subset of the tests which excludes slow-running tests for quick
verifications. These can be run through `make fasttest` and `make fastcover`
respectively.

Finally, to build the API reference for the project, run `make docs` from the
root directory, and a docs folder will be created with the api reference.

# Support & Additional Resources

If you found an issue, please file it in our [Github issues](https://github.com/couchbase/couchnode/issues).  We will bring over the issue to our [JIRA](https://jira.issues.couchbase.com/projects/JSCBC/issues/) as needed.

The Couchbase Discord server is a place where you can collaborate about all things Couchbase. Connect with others from the community, learn tips and tricks, and ask questions. [Join Discord and contribute](https://discord.com/invite/sQ5qbPZuTh).

You can ask questions in our [forums](https://forums.couchbase.com/).

## License

Copyright 2013 Couchbase Inc.

Licensed under the Apache License, Version 2.0.

See
[LICENSE](https://github.com/couchbase/couchnode/blob/master/LICENSE)
for further details.


================================================
FILE: couchbase-sdk-nodejs-black-duck-manifest.yaml
================================================
include-projects:
  - couchbase-sdk-cxx


================================================
FILE: eslint.config.mjs
================================================
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginN from 'eslint-plugin-n'
import pluginMocha from 'eslint-plugin-mocha'
import pluginJsdoc from 'eslint-plugin-jsdoc'
import prettierConfig from 'eslint-config-prettier'
import globals from 'globals'

/**
 * Defines the AST nodes we expect to have documentation for.  It includes
 * most publicly defined stuff with the following exceptions:
 * - No need for descriptions on Options interfaces.
 * - No need to document setters.
 * - No need to document protected or private.
 * - No need to document inline types in function parameters.
 */
const needsDocsContexts = [
  'TSInterfaceDeclaration[id.name!=/.*Options/]',
  'TSTypeAliasDeclaration',
  'TSEnumDeclaration',
  'TSEnumMember',
  'TSMethodSignature[accessibility!=/(private|protected)/]',
  'ClassBody > TSPropertySignature[accessibility!=/(private|protected)/]',
  'TSInterfaceBody > TSPropertySignature[accessibility!=/(private|protected)/]',
  'FunctionDeclaration',
  'ClassDeclaration',
  'MethodDefinition[accessibility!=/(private|protected)/][kind!=/(set|constructor)/]',
  'ClassBody > ClassProperty[accessibility!=/(private|protected)/]',
]

export default [
  // Global ignores
  {
    ignores: [
      'dist/**',
      'node_modules/**',
      'coverage/**',
      '**/*.d.ts',
      'deps/**',
      'scripts/**',
      'tools/**',
    ],
  },

  // Base ESLint recommended rules
  js.configs.recommended,

  // TypeScript ESLint recommended rules
  ...tseslint.configs.recommended,

  // Main configuration for lib/ and test/
  {
    files: ['lib/**/*.ts', 'test/**/*.{js,ts}'],

    languageOptions: {
      parser: tseslint.parser,
      parserOptions: {
        ecmaVersion: 'latest',
        sourceType: 'module',
      },
      globals: {
        ...globals.node,
        ...globals.es2021,
        ...globals.mocha,
      },
    },

    plugins: {
      '@typescript-eslint': tseslint.plugin,
      n: pluginN,
      mocha: pluginMocha,
      jsdoc: pluginJsdoc,
    },

    settings: {
      jsdoc: {
        ignorePrivate: true,
        ignoreInternal: true,
      },
    },

    rules: {
      // TypeScript rules
      '@typescript-eslint/explicit-module-boundary-types': [
        'error',
        {
          allowArgumentsExplicitlyTypedAsAny: true,
        },
      ],
      '@typescript-eslint/no-explicit-any': 'off',

      // TypeScript ESLint v8 new rules - allow empty interfaces for extending
      '@typescript-eslint/no-empty-object-type': [
        'error',
        {
          allowInterfaces: 'always',
        },
      ],

      // Allow unused vars if prefixed with underscore
      '@typescript-eslint/no-unused-vars': [
        'error',
        {
          argsIgnorePattern: '^_',
          varsIgnorePattern: '^_',
          caughtErrorsIgnorePattern: '^_',
        },
      ],

      // Node.js rules (migrated from eslint-plugin-node to eslint-plugin-n)
      'n/no-unsupported-features/es-syntax': [
        'error',
        {
          ignores: ['modules'],
        },
      ],
      'n/no-missing-import': [
        'error',
        {
          tryExtensions: ['.js', '.ts'],
        },
      ],
      'n/no-missing-require': [
        'error',
        {
          tryExtensions: ['.js', '.ts'],
        },
      ],

      // JSDoc rules
      'jsdoc/check-tag-names': [
        'warn',
        {
          definedTags: ['category', 'internal', 'experimental'],
        },
      ],
      'jsdoc/require-jsdoc': [
        'warn',
        {
          contexts: needsDocsContexts,
        },
      ],
      'jsdoc/require-description': [
        'warn',
        {
          contexts: needsDocsContexts,
        },
      ],
      'jsdoc/require-description-complete-sentence': 'warn',
      'jsdoc/require-returns': 'off',
      'jsdoc/require-param-type': 'off',
      'jsdoc/tag-lines': [
        'warn',
        'any',
        {
          startLines: 1,
        },
      ],
      'jsdoc/no-undefined-types': [
        'warn',
        {
          definedTypes: [
            'durabilityLevel',
            'effectiveRoles',
            'GetOptions',
            'IBucketSettings',
            'MutationState',
            'StorageBackend',
          ],
        },
      ],

      // Other rules
      'prefer-rest-params': 'off',
    },
  },

  // Test-specific overrides
  {
    files: ['test/**/*.{js,ts}'],
    rules: {
      '@typescript-eslint/no-var-requires': 'off',
      '@typescript-eslint/no-require-imports': 'off', // Tests use CommonJS
      'jsdoc/require-jsdoc': 'off',
    },
  },

  // Prettier config (must be last to override conflicting rules)
  prettierConfig,
]


================================================
FILE: examples/observability/combined/docker-compose.yml
================================================
services:
  otel-collector:
    image: otel/opentelemetry-collector:latest
    command: ["--config=/etc/otel-collector-config.yml"]
    volumes:
      - ./otel-collector-config.yml:/etc/otel-collector-config.yml
    ports:
      - "4317:4317" # Python script pushes BOTH traces and metrics here
    depends_on:
      - jaeger

  prometheus:
    image: prom/prometheus:latest
    command: ["--config.file=/etc/prometheus/prometheus.yml"]
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"
    depends_on:
      - otel-collector

  jaeger:
    image: jaegertracing/all-in-one:latest
    environment:
      - COLLECTOR_OTLP_ENABLED=true
    ports:
      - "16686:16686" # Jaeger UI
    # Note: We don't map Jaeger's 4317 to the host, because the Collector
    # already owns host:4317. The Collector talks to Jaeger internally.


================================================
FILE: examples/observability/combined/otel-collector-config.yml
================================================
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

exporters:
  prometheus:
    endpoint: "0.0.0.0:8889"
  otlp/jaeger:
    endpoint: "jaeger:4317" # Routes traces to the Jaeger container
    tls:
      insecure: true

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlp/jaeger] # Traces go here
    metrics:
      receivers: [otlp]
      exporters: [prometheus]  # Metrics go here


================================================
FILE: examples/observability/combined/otel-otlp-metrics-and-tracing.js
================================================
/**
 * OpenTelemetry Tracing and Metrics Example (JavaScript)
 *
 * This example demonstrates how to use OpenTelemetry tracing and metrics with the Couchbase Node.js SDK
 * and export metrics to Jaeger (tracing) and Prometheus (metrics) for visualization in a web UI.
 *
 * What this example does:
 * - Sets up OpenTelemetry tracing and metrics with OTLP exporters for Jaeger and Prometheus
 * - Creates a Couchbase cluster connection with OTel tracing enabled
 * - Performs various KV and query operations
 * - Exports all traces to Jaeger and metrics to Prometheus for visualization in the UI
 * - Exports all metrics to Prometheus for visualization in the UI
 *
 * Prerequisites:
 * - Jaeger, Prometheus and OTel Collector running locally
 * - Couchbase Server running
 * - OpenTelemetry packages installed
 *
 * Installation:
 *   npm install:
 *       - @opentelemetry/api (^1.9.0)
 *       - @opentelemetry/sdk-node (^0.213.0)
 *       - @opentelemetry/sdk-metrics-node (^2.6.0)
 *       - @opentelemetry/exporter-metrics-otlp-grpc (^0.213.0)
 *       - @opentelemetry/exporter-trace-otlp-grpc (^0.213.0)
 *
 * Quick Start with Docker:
 *   # Start containers
 *   docker-compose up -d
 *
 *   # Run this example
 *   node otel-otlp-metrics-and-tracing.js
 * 
 *   # Open Jaeger UI in browser
 *   # http://localhost:16686
 * 
 *   # Open Prometheus UI in browser
 *   # http://localhost:9090
 *
 * Expected output:
 * - Console logs showing operations being performed
 * - Traces should be visible in Jaeger UI at http://localhost:16686
 *    - Search "couchbase-otel-combined-example-js" service and look for spans like "kv.upsert", "kv.get", "cluster.query", etc.
 * - Metrics should visible in Prometheus UI at http://localhost:9090
 *    - Search "db_client_operation_duration_seconds_bucket" in UI
 */

const { trace, metrics } = require('@opentelemetry/api')
const {
  defaultResource,
  resourceFromAttributes,
} = require('@opentelemetry/resources')
const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')
const {
  AlwaysOnSampler,
  NodeTracerProvider,
  ParentBasedSampler,
  BatchSpanProcessor,
} = require('@opentelemetry/sdk-trace-node')
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const {
  MeterProvider,
  PeriodicExportingMetricReader,
} = require('@opentelemetry/sdk-metrics')
const {
  OTLPMetricExporter,
} = require('@opentelemetry/exporter-metrics-otlp-grpc')
const { connect, getOTelTracer, getOTelMeter } = require('couchbase')

// Configuration
const SERVICE_NAME = 'couchbase-otel-combined-example-js'
const OTLP_ENDPOINT = 'http://localhost:4317' // Both traces and metrics go here
const CONNECTION_STRING = 'couchbase://localhost'
const BUCKET_NAME = 'default'
const USERNAME = 'Administrator'
const PASSWORD = 'password'

function setupOtelTracing(resource) {
  const traceExporter = new OTLPTraceExporter({ url: OTLP_ENDPOINT })
  const spanProcessor = new BatchSpanProcessor(traceExporter)

  const tracerProvider = new NodeTracerProvider({
    resource: resource,
    sampler: new ParentBasedSampler({ root: new AlwaysOnSampler() }),
    spanProcessors: [spanProcessor],
  })

  // Set as the global tracer provider
  tracerProvider.register()

  return tracerProvider
}

function setupOtelMetrics(resource) {
  const metricExporter = new OTLPMetricExporter({ url: OTLP_ENDPOINT })

  const meterProvider = new MeterProvider({
    resource: resource,
    readers: [
      new PeriodicExportingMetricReader({
        exporter: metricExporter,
        exportIntervalMillis: 1000,
      }),
    ],
  })

  // Set as global meter provider so the SDK can pick it up
  metrics.setGlobalMeterProvider(meterProvider)

  return meterProvider
}

function printBanner() {
  console.log('\n' + '='.repeat(80))
  console.log('OpenTelemetry OTLP Combined Example (Plain JavaScript)')
  console.log('='.repeat(80) + '\n')
}

async function performOperations(collection, cluster) {
  console.log('\n' + '-'.repeat(80))
  console.log('Performing Operations (Generating Traces & Metrics)')
  console.log('-'.repeat(80) + '\n')

  const docs = {
    'testdoc:js:1': {
      name: 'Alice',
      age: 30,
      type: 'user',
      user_role: 'admin',
    },
    'testdoc:js:2': {
      name: 'Bob',
      age: 25,
      type: 'user',
      user_role: 'developer',
    },
    'testdoc:js:3': {
      name: 'Charlie',
      age: 35,
      type: 'user',
      user_role: 'manager',
    },
  }
  const docKeys = Object.keys(docs)

  console.log('1. Upserting documents...')
  for (const key of docKeys) {
    await collection.upsert(key, docs[key])
    console.log(`   ✓ Upserted '${key}'`)
  }

  console.log('\n2. Retrieving documents...')
  for (let roundNum = 1; roundNum <= 3; roundNum++) {
    for (const key of docKeys) {
      await collection.get(key)
    }
    console.log(`   ✓ Round ${roundNum} complete`)
  }

  console.log('\n3. Executing N1QL query...')
  try {
    const query = `SELECT name, user_role FROM \`${BUCKET_NAME}\` WHERE type = 'user' LIMIT 3`
    const result = await cluster.query(query)
    console.log(`   ✓ Query returned ${result.rows.length} rows`)
  } catch (e) {
    console.log(`   ⚠ Query failed: ${e.message}`)
  }

  console.log('\n4. Cleaning up...')
  for (const key of docKeys) {
    try {
      await collection.remove(key)
    } catch (e) {} // Ignore missing docs
  }
}

async function performOperationsWithParent(collection, cluster, cbTracer) {
  console.log('\n' + '-'.repeat(80))
  console.log('Executing Workloads with Custom Parent Spans')
  console.log('-'.repeat(80) + '\n')

  const appTracer = trace.getTracer('my-js-app')
  const testKey = 'doc:explicit_vs_implicit_js'
  const testDoc = { type: 'user', active: true }

  // ========================================================================
  // PATTERN 1: IMPLICIT CONTEXT (startActiveSpan)
  // ========================================================================
  console.log('Pattern 1: Implicit Context (startActiveSpan)...')

  await appTracer.startActiveSpan(
    'process_implicit_batch_js',
    async (parentSpan) => {
      try {
        await collection.upsert(testKey, testDoc)
        await collection.get(testKey)
        console.log('   ✓ Implicit workload complete')
      } finally {
        parentSpan.end()
      }
    }
  )

  // ========================================================================
  // PATTERN 2: EXPLICIT CONTEXT (Manual Span Passing)
  // ========================================================================
  console.log('\nPattern 2: Explicit Context (Manual Span Passing)...')

  // Use cbTracer.requestSpan() to generate the Couchbase-compatible span
  const explicitCbSpan = cbTracer.requestSpan('process_explicit_batch_js')

  try {
    // Pass the span manually via the options object
    await collection.upsert(testKey, testDoc, { parentSpan: explicitCbSpan })
    await collection.get(testKey, { parentSpan: explicitCbSpan })

    try {
      const query = `SELECT * FROM \`${BUCKET_NAME}\` LIMIT 1`
      await cluster.query(query, { parentSpan: explicitCbSpan })
    } catch (e) {}

    await collection.remove(testKey, { parentSpan: explicitCbSpan })

    console.log('   ✓ Explicit workload complete')
  } finally {
    explicitCbSpan.end()
  }
}

async function main() {
  printBanner()
  let tProvider = null
  let mProvider = null

  // Shared resource for both metrics and traces
  const customResource = resourceFromAttributes({
    [ATTR_SERVICE_NAME]: SERVICE_NAME,
  })
  const resource = defaultResource().merge(customResource)

  try {
    console.log('Setting up OpenTelemetry...')

    tProvider = setupOtelTracing(resource)
    mProvider = setupOtelMetrics(resource)

    console.log(`Connecting to Couchbase at ${CONNECTION_STRING}...`)

    // Extract the Couchbase-specific wrappers
    const cbTracer = getOTelTracer(tProvider)
    const cbMeter = getOTelMeter(mProvider)

    const cluster = await connect(CONNECTION_STRING, {
      username: USERNAME,
      password: PASSWORD,
      tracer: cbTracer, // Inject Tracer
      meter: cbMeter, // Inject Meter
    })

    const collection = cluster.bucket(BUCKET_NAME).defaultCollection()
    console.log('✓ Connected to Couchbase\n')

    await performOperations(collection, cluster)

    // Pass cbTracer to demonstrate the explicit context pattern
    await performOperationsWithParent(collection, cluster, cbTracer)

    console.log('\nClosing cluster connection...')
    await cluster.close()

    // Wait for the periodic metric reader to catch the final data
    await new Promise((resolve) => setTimeout(resolve, 2000))
  } catch (e) {
    console.error(`\nERROR:`, e)
  } finally {
    console.log('\nFlushing telemetry data...')

    if (tProvider) await tProvider.shutdown()
    if (mProvider) await mProvider.shutdown()

    console.log('✓ Telemetry flushed gracefully.\n')
    console.log('📊 VIEW YOUR DATA:')
    console.log('  • Traces:  http://localhost:16686 (Jaeger)')
    console.log('  • Metrics: http://localhost:9090  (Prometheus)')
    console.log('='.repeat(80) + '\n')
  }
}

main().catch((err) => {
  console.error('Fatal error:', err)
  process.exit(1)
})


================================================
FILE: examples/observability/combined/otel-otlp-metrics-and-tracing.ts
================================================
/**
 * OpenTelemetry Tracing and Metrics Example (TypeScript)
 *
 * This example demonstrates how to use OpenTelemetry tracing and metrics with the Couchbase Node.js SDK
 * and export metrics to Jaeger (tracing) and Prometheus (metrics) for visualization in a web UI.
 *
 * What this example does:
 * - Sets up OpenTelemetry tracing and metrics with OTLP exporters for Jaeger and Prometheus
 * - Creates a Couchbase cluster connection with OTel tracing enabled
 * - Performs various KV and query operations
 * - Exports all traces to Jaeger and metrics to Prometheus for visualization in the UI
 * - Exports all metrics to Prometheus for visualization in the UI
 *
 * Prerequisites:
 * - Jaeger, Prometheus and OTel Collector running locally
 * - Couchbase Server running
 * - OpenTelemetry packages installed
 *
 * Installation:
 *   npm install:
 *       - @opentelemetry/api (^1.9.0)
 *       - @opentelemetry/sdk-node (^0.213.0)
 *       - @opentelemetry/sdk-metrics-node (^2.6.0)
 *       - @opentelemetry/exporter-metrics-otlp-grpc (^0.213.0)
 *       - @opentelemetry/exporter-trace-otlp-grpc (^0.213.0)
 *
 * Quick Start with Docker:
 *   # Start containers
 *   docker-compose up -d
 *
 *   # Run this example
 *   tsx otel-otlp-metrics-and-tracing.ts
 * 
 *   # Open Jaeger UI in browser
 *   # http://localhost:16686
 * 
 *   # Open Prometheus UI in browser
 *   # http://localhost:9090
 *
 * Expected output:
 * - Console logs showing operations being performed
 * - Traces should be visible in Jaeger UI at http://localhost:16686
 *    - Search "couchbase-otel-combined-example" service and look for spans like "kv.upsert", "kv.get", "cluster.query", etc.
 * - Metrics should visible in Prometheus UI at http://localhost:9090
 *    - Search "db_client_operation_duration_seconds_bucket" in UI
 */

import { trace, metrics } from '@opentelemetry/api'
import {
  defaultResource,
  resourceFromAttributes,
  Resource,
} from '@opentelemetry/resources'
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions'
import {
  AlwaysOnSampler,
  NodeTracerProvider,
  ParentBasedSampler,
  BatchSpanProcessor,
} from '@opentelemetry/sdk-trace-node'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc'
import {
  MeterProvider,
  PeriodicExportingMetricReader,
} from '@opentelemetry/sdk-metrics'
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc'
import {
  Cluster,
  Collection,
  connect,
  getOTelTracer,
  getOTelMeter,
  RequestTracer,
} from 'couchbase'

// Configuration
const SERVICE_NAME = 'couchbase-otel-combined-example'
const OTLP_ENDPOINT = 'http://localhost:4317' // Both traces and metrics go here
const CONNECTION_STRING = 'couchbase://localhost'
const BUCKET_NAME = 'default'
const USERNAME = 'Administrator'
const PASSWORD = 'password'

function setupOtelTracing(resource: Resource): NodeTracerProvider {
  const traceExporter = new OTLPTraceExporter({ url: OTLP_ENDPOINT })
  const spanProcessor = new BatchSpanProcessor(traceExporter)

  const tracerProvider = new NodeTracerProvider({
    resource: resource,
    sampler: new ParentBasedSampler({ root: new AlwaysOnSampler() }),
    spanProcessors: [spanProcessor],
  })

  // Set as the global tracer provider
  tracerProvider.register()

  return tracerProvider
}

function setupOtelMetrics(resource: Resource): MeterProvider {
  const metricExporter = new OTLPMetricExporter({ url: OTLP_ENDPOINT })

  const meterProvider = new MeterProvider({
    resource: resource,
    readers: [
      new PeriodicExportingMetricReader({
        exporter: metricExporter,
        exportIntervalMillis: 1000,
      }),
    ],
  })

  // Set as global meter provider so the SDK can pick it up
  metrics.setGlobalMeterProvider(meterProvider)

  return meterProvider
}

function printBanner() {
  console.log('\n' + '='.repeat(80))
  console.log('OpenTelemetry OTLP Combined (Metrics + Tracing) Example')
  console.log('='.repeat(80) + '\n')
}

async function performOperations(collection: any, cluster: any) {
  console.log('\n' + '-'.repeat(80))
  console.log('Performing Operations (Generating Traces & Metrics)')
  console.log('-'.repeat(80) + '\n')

  const docs: Record<string, any> = {
    'testdoc:1': { name: 'Alice', age: 30, type: 'user', user_role: 'admin' },
    'testdoc:2': { name: 'Bob', age: 25, type: 'user', user_role: 'developer' },
    'testdoc:3': {
      name: 'Charlie',
      age: 35,
      type: 'user',
      user_role: 'manager',
    },
  }
  const docKeys = Object.keys(docs)

  console.log('1. Upserting documents...')
  for (const key of docKeys) {
    await collection.upsert(key, docs[key])
    console.log(`   ✓ Upserted '${key}'`)
  }

  console.log('\n2. Retrieving documents...')
  for (let roundNum = 1; roundNum <= 3; roundNum++) {
    for (const key of docKeys) {
      await collection.get(key)
    }
    console.log(`   ✓ Round ${roundNum} complete`)
  }

  console.log('\n3. Executing N1QL query...')
  try {
    const query = `SELECT name, user_role FROM \`${BUCKET_NAME}\` WHERE type = 'user' LIMIT 3`
    const result = await cluster.query(query)
    console.log(`   ✓ Query returned ${result.rows.length} rows`)
  } catch (e: any) {
    console.log(`   ⚠ Query failed: ${e.message}`)
  }

  console.log('\n4. Cleaning up...')
  for (const key of docKeys) {
    try {
      await collection.remove(key)
    } catch (e) {} // Ignore
  }
}

async function performOperationsWithParent(
  collection: Collection,
  cluster: Cluster,
  cbTracer: RequestTracer
) {
  console.log('\n' + '-'.repeat(80))
  console.log('Executing Workloads with Custom Parent Spans')
  console.log('-'.repeat(80) + '\n')

  const appTracer = trace.getTracer('my-node-app')
  const testKey = 'doc:explicit_vs_implicit'
  const testDoc = { type: 'user', active: true }

  // ========================================================================
  // PATTERN 1: IMPLICIT CONTEXT
  // ========================================================================
  console.log('Pattern 1: Implicit Context (startActiveSpan)...')

  await appTracer.startActiveSpan(
    'process_implicit_batch',
    async (parentSpan) => {
      try {
        // The SDK automatically finds 'process_implicit_batch' in AsyncLocalStorage
        await collection.upsert(testKey, testDoc)
        await collection.get(testKey)
        console.log('   ✓ Implicit workload complete')
      } finally {
        parentSpan.end()
      }
    }
  )

  // ========================================================================
  // PATTERN 2: EXPLICIT CONTEXT
  // ========================================================================
  console.log('\nPattern 2: Explicit Context (Manual Span Passing)...')

  // Notice we use couchbase wrapper tracer
  const explicitSpan = cbTracer.requestSpan('process_explicit_batch')

  try {
    // We MUST pass the span explicitly, otherwise the SDK won't know about it
    await collection.upsert(testKey, testDoc, { parentSpan: explicitSpan })
    await collection.get(testKey, { parentSpan: explicitSpan })

    // Example with cluster query
    try {
      const query = `SELECT * FROM \`${BUCKET_NAME}\` LIMIT 1`
      await cluster.query(query, { parentSpan: explicitSpan })
    } catch (e) {} // Ignore

    await collection.remove(testKey, { parentSpan: explicitSpan })

    console.log('   ✓ Explicit workload complete')
  } finally {
    explicitSpan.end()
  }
}

async function main() {
  printBanner()
  let tProvider: NodeTracerProvider | null = null
  let mProvider: MeterProvider | null = null

  // Create a shared resource so both metrics and traces share the exact same service name
  const customResource = resourceFromAttributes({
    [ATTR_SERVICE_NAME]: SERVICE_NAME,
  })
  const resource = defaultResource().merge(customResource)

  try {
    console.log('Setting up OpenTelemetry...')

    // Setup providers cleanly
    tProvider = setupOtelTracing(resource)
    mProvider = setupOtelMetrics(resource)

    console.log(`Connecting to Couchbase at ${CONNECTION_STRING}...`)

    // Extract the Couchbase-specific wrappers
    const cbTracer = getOTelTracer(tProvider)
    const cbMeter = getOTelMeter(mProvider)

    const cluster = await connect(CONNECTION_STRING, {
      username: USERNAME,
      password: PASSWORD,
      tracer: cbTracer, // Inject Tracer
      meter: cbMeter, // Inject Meter
    })

    const collection = cluster.bucket(BUCKET_NAME).defaultCollection()
    console.log('✓ Connected to Couchbase\n')

    await performOperations(collection, cluster)
    await performOperationsWithParent(collection, cluster, cbTracer)

    console.log('\nClosing cluster connection...')
    await cluster.close()

    // Wait a moment for the periodic metric reader to catch the final data
    await new Promise((resolve) => setTimeout(resolve, 2000))
  } catch (e) {
    console.error(`\nERROR:`, e)
  } finally {
    console.log('\nFlushing telemetry data...')

    // Shut down both providers to flush all remaining data
    if (tProvider) await tProvider.shutdown()
    if (mProvider) await mProvider.shutdown()

    console.log('✓ Telemetry flushed gracefully.\n')

    console.log('📊 VIEW YOUR DATA:')
    console.log('  • Traces:  http://localhost:16686 (Jaeger)')
    console.log('  • Metrics: http://localhost:9090  (Prometheus)')
    console.log('='.repeat(80) + '\n')
  }
}

main().catch((err) => {
  console.error('Fatal error:', err)
  process.exit(1)
})


================================================
FILE: examples/observability/combined/prometheus.yml
================================================
global:
  scrape_interval: 5s

scrape_configs:
  - job_name: 'otel-collector'
    static_configs:
      - targets: ['otel-collector:8889']


================================================
FILE: examples/observability/metrics/docker-compose.yml
================================================
services:
  otel-collector:
    image: otel/opentelemetry-collector:latest
    command: ["--config=/etc/otel-collector-config.yml"]
    volumes:
      - ./otel-collector-config.yml:/etc/otel-collector-config.yml
    ports:
      - "4317:4317" # OTLP gRPC receiver (Node.js sends here)
      - "8889:8889" # Prometheus exporter (Prometheus scrapes here)

  prometheus:
    image: prom/prometheus:latest
    command: ["--config.file=/etc/prometheus/prometheus.yml"]
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090" # Prometheus UI (You view this in your browser)
    depends_on:
      - otel-collector


================================================
FILE: examples/observability/metrics/otel-collector-config.yml
================================================
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

exporters:
  prometheus:
    endpoint: "0.0.0.0:8889"

service:
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [prometheus]


================================================
FILE: examples/observability/metrics/otel-otlp-metrics-exporter.ts
================================================
/**
 * OpenTelemetry Metrics with Prometheus UI Example (TypeScript)
 *
 * This example demonstrates how to use OpenTelemetry metrics with the Couchbase Node.js SDK
 * and export metrics to Prometheus for visualization in a web UI.
 *
 * What this example does:
 * - Sets up OpenTelemetry metrics with OTLP exporter for Prometheus
 * - Creates a Couchbase cluster connection with OTel tracing enabled
 * - Performs various KV and query operations
 * - Exports all metrics to Prometheus for visualization in the UI
 *
 * Prerequisites:
 * - Prometheus and OTel Collector running locally
 * - Couchbase Server running
 * - OpenTelemetry packages installed
 *
 * Installation:
 *   npm install:
 *       - @opentelemetry/api (^1.9.0)
 *       - @opentelemetry/sdk-node (^0.213.0)
 *       - @opentelemetry/sdk-metrics-node (^2.6.0)
 *       - @opentelemetry/exporter-metrics-otlp-grpc (^0.213.0)
 *
 * Quick Start with Docker:
 *   # Start containers
 *   docker-compose up -d
 *
 *   # Run this example
 *   tsx otel-otlp-metrics-exporter.ts
 *
 *   # Open Prometheus UI in browser
 *   # http://localhost:9090
 *
 * Expected output:
 * - Console logs showing operations being performed
 * - Metrics should visible in Prometheus UI at http://localhost:9090
 * - Search "db_client_operation_duration_seconds_bucket" in UI
 */

import {
  defaultResource,
  resourceFromAttributes,
} from '@opentelemetry/resources'
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions'
import {
  MeterProvider,
  PeriodicExportingMetricReader,
} from '@opentelemetry/sdk-metrics'
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc'
import { connect, getOTelMeter } from 'couchbase'

// Configuration
const SERVICE_NAME = 'couchbase-otel-metrics-example'
const METRICS_ENDPOINT = 'http://localhost:4317'
const CONNECTION_STRING = 'couchbase://localhost'
const BUCKET_NAME = 'default'
const USERNAME = 'Administrator'
const PASSWORD = 'password'

function setupOtelMetrics(): MeterProvider {
  const customResource = resourceFromAttributes({
    [ATTR_SERVICE_NAME]: SERVICE_NAME,
  })
  const resource = defaultResource().merge(customResource)

  const metricExporter = new OTLPMetricExporter({
    url: METRICS_ENDPOINT,
  })

  const meterProvider = new MeterProvider({
    resource: resource,
    readers: [
      new PeriodicExportingMetricReader({
        exporter: metricExporter,
        exportIntervalMillis: 1000, // Export metrics every 1 second
      }),
    ],
  })

  return meterProvider
}

function printBanner(): void {
  console.log('\n' + '='.repeat(80))
  console.log('OpenTelemetry OTLP Metrics Export Example (Prometheus)')
  console.log('='.repeat(80) + '\n')
}

async function performOperations(collection: any, cluster: any): Promise<void> {
  console.log('\n' + '-'.repeat(80))
  console.log('Performing Operations (Generating Metrics)')
  console.log('-'.repeat(80) + '\n')

  const docs: Record<string, any> = {
    'metrics:1': { name: 'Alice', age: 30, type: 'user', user_role: 'admin' },
    'metrics:2': { name: 'Bob', age: 25, type: 'user', user_role: 'developer' },
    'metrics:3': {
      name: 'Charlie',
      age: 35,
      type: 'user',
      user_role: 'manager',
    },
    'metrics:4': {
      name: 'Diana',
      age: 28,
      type: 'user',
      user_role: 'designer',
    },
    'metrics:5': { name: 'Eve', age: 32, type: 'user', user_role: 'analyst' },
  }

  const docKeys = Object.keys(docs)

  console.log('1. Upserting documents...')
  for (const key of docKeys) {
    await collection.upsert(key, docs[key])
    console.log(`   ✓ Upserted '${key}'`)
  }

  console.log(
    '\n2. Retrieving documents (multiple rounds for histogram data)...'
  )
  for (let roundNum = 1; roundNum <= 3; roundNum++) {
    console.log(`   Round ${roundNum}:`)
    for (const key of docKeys) {
      await collection.get(key)
    }
    console.log(`     ✓ Retrieved all ${docKeys.length} documents`)
  }

  console.log('\n3. Replacing documents...')
  for (const key of docKeys.slice(0, 3)) {
    // Just first 3
    const getResult = await collection.get(key)
    const doc = getResult.content
    doc.updated = true
    await collection.replace(key, doc, { cas: getResult.cas })
    console.log(`   ✓ Replaced '${key}'`)
  }

  console.log('\n4. Touching documents (updating expiry)...')
  for (const key of docKeys.slice(3)) {
    // Last 2
    await collection.touch(key, 3600) // Expiry in milliseconds
    console.log(`   ✓ Touched '${key}'`)
  }

  console.log('\n5. Executing N1QL query...')
  const query = `SELECT name, user_role FROM \`${BUCKET_NAME}\` WHERE type = 'user' LIMIT 3`
  try {
    const result = await cluster.query(query)
    console.log(`   ✓ Query returned ${result.rows.length} rows`)
  } catch (e: any) {
    console.log(`   ⚠ Query failed: ${e.message}`)
  }

  console.log('\n6. Cleaning up...')
  for (const key of docKeys) {
    try {
      await collection.remove(key)
      console.log(`   ✓ Removed '${key}'`)
    } catch (e) {
      // Ignore not found errors during cleanup
    }
  }

  console.log('\n' + '-'.repeat(80))
  console.log('All operations completed!')
  console.log('-'.repeat(80))
}

async function main(): Promise<void> {
  printBanner()
  let meterProvider: MeterProvider | null = null

  try {
    console.log('Setting up OpenTelemetry Metrics...')
    meterProvider = setupOtelMetrics()
    console.log('✓ OpenTelemetry Metrics configured\n')

    console.log(`Connecting to Couchbase at ${CONNECTION_STRING}...`)

    // Wrap the OTel meter with the Couchbase SDK wrapper
    const couchbaseMeter = getOTelMeter(meterProvider)

    const cluster = await connect(CONNECTION_STRING, {
      username: USERNAME,
      password: PASSWORD,
      meter: couchbaseMeter, // Inject the metrics wrapper here!
    })

    const bucket = cluster.bucket(BUCKET_NAME)
    const collection = bucket.defaultCollection()
    console.log('✓ Connected to Couchbase\n')

    await performOperations(collection, cluster)

    console.log('\nClosing cluster connection...')
    await cluster.close()

    // Give the periodic reader a moment to catch the final operations
    console.log('Flushing final metrics to OTLP Collector...')
    await new Promise((resolve) => setTimeout(resolve, 2000))
  } catch (e) {
    console.error(`\nERROR:`, e)
  } finally {
    // CRITICAL: Force the final batch of metrics to be exported
    if (meterProvider) {
      await meterProvider.shutdown()
      console.log('✓ OpenTelemetry provider shut down gracefully.')

      console.log('\n' + '='.repeat(80))
      console.log('SUCCESS! Metrics Exported')
      console.log('='.repeat(80))
      console.log('\n📊 VIEW METRICS IN PROMETHEUS:')
      console.log('  • Prometheus UI: http://localhost:9090')
      console.log(
        '  • Search for: db_client_operation_duration_seconds_bucket (or similar depending on OTel translation)'
      )
      console.log('='.repeat(80) + '\n')
    }
  }
}

main().catch((err) => {
  console.error('Fatal error:', err)
  process.exit(1)
})


================================================
FILE: examples/observability/metrics/prometheus.yml
================================================
global:
  scrape_interval: 5s

scrape_configs:
  - job_name: 'otel-collector'
    static_configs:
      - targets: ['otel-collector:8889']


================================================
FILE: examples/observability/tracing/console/otel-console-exporter.js
================================================
const {
    defaultResource,
    resourceFromAttributes,
  } = require('@opentelemetry/resources')
  const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions')
  const {
    AlwaysOnSampler,
    ConsoleSpanExporter,
    NodeTracerProvider,
    ParentBasedSampler,
    SimpleSpanProcessor,
  } = require('@opentelemetry/sdk-trace-node')
  const {
    connect,
    getOTelTracer,
    createConsoleLogger,
    LogLevel,
  } = require('couchbase')
  
  // Configuration
  const SERVICE_NAME = 'couchbase-otel-tracing-example-js'
  const CONNECTION_STRING = 'couchbase://localhost'
  const BUCKET_NAME = 'default'
  const USERNAME = 'Administrator'
  const PASSWORD = 'password'
  
  function setupOtelConsoleExporter() {
    const customResource = resourceFromAttributes({
      [ATTR_SERVICE_NAME]: SERVICE_NAME,
    })
    const resource = defaultResource().merge(customResource)
  
    const consoleExporter = new ConsoleSpanExporter()
    const processor = new SimpleSpanProcessor(consoleExporter)
  
    const sampler = new ParentBasedSampler({
      root: new AlwaysOnSampler(),
    })
  
    const provider = new NodeTracerProvider({
      resource: resource,
      sampler: sampler,
      spanProcessors: [processor],
    })
  
    provider.register()
  
    return provider
  }
  
  async function main() {
    const tracerProvider = setupOtelConsoleExporter()
  
    const logger = createConsoleLogger(LogLevel.DEBUG)
  
    logger.info(
      'Starting OpenTelemetry Tracing & SDK Logging Console Example (JS)'
    )
    logger.info(`Connecting to ${CONNECTION_STRING}...`)
  
    try {
      const couchbaseTracer = getOTelTracer(tracerProvider)
  
      const cluster = await connect(CONNECTION_STRING, {
        username: USERNAME,
        password: PASSWORD,
        tracer: couchbaseTracer,
        logger: logger,
      })
  
      const bucket = cluster.bucket(BUCKET_NAME)
      const collection = bucket.defaultCollection()
  
      logger.info('Connected successfully! Performing operations...')
  
      const testDocument = {
        id: 1,
        name: 'OpenTelemetry Demo JS',
        description: 'Testing Couchbase with OpenTelemetry tracing',
        timestamp: Date.now(),
      }
      const testKey = 'otelDemoKeyJS'
  
      // 1. Upsert
      logger.info(`Upserting document '${testKey}'...`)
      const upResult = await collection.upsert(testKey, testDocument)
      logger.debug(`Upsert CAS: ${upResult.cas}`)
  
      // 2. Get
      logger.info(`Retrieving document '${testKey}'...`)
      let getResult = await collection.get(testKey)
      logger.debug(`Retrieved name: ${getResult.content.name}`)
  
      // 3. Replace
      logger.info(`Replacing document '${testKey}'...`)
      testDocument.description = 'Updated: Testing Couchbase with OpenTelemetry'
      const replaceResult = await collection.replace(testKey, testDocument, {
        cas: upResult.cas,
      })
      logger.debug(`Replace CAS: ${replaceResult.cas}`)
  
      // 4. Query
      logger.info(`Executing N1QL query...`)
      const query = `SELECT name, description FROM \`${BUCKET_NAME}\` USE KEYS '${testKey}'`
      try {
        const queryResult = await cluster.query(query)
        logger.info(`Query returned ${queryResult.rows.length} rows`)
        for (const row of queryResult.rows) {
          logger.debug(`      - ${row.name}: ${row.description}`)
        }
      } catch (e) {
        logger.warn(`Query failed: ${e.message}`)
      }
  
      // 5. Remove
      logger.info(`Removing document '${testKey}'...`)
      const removeResult = await collection.remove(testKey)
      logger.debug(`Remove CAS: ${removeResult.cas}`)
  
      logger.info('All operations completed! Closing connection...')
      await cluster.close()
    } catch (e) {
      logger.error(`Fatal ERROR: ${e.message}`)
    } finally {
      if (tracerProvider) {
        await tracerProvider.shutdown()
        logger.info('OpenTelemetry tracer shut down gracefully.')
      }
    }
  }
  
  main().catch((err) => {
    console.error('Fatal error:', err)
    process.exit(1)
  })
  

================================================
FILE: examples/observability/tracing/console/otel-console-exporter.ts
================================================
import {
  defaultResource,
  resourceFromAttributes,
} from '@opentelemetry/resources'
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions'
import {
  AlwaysOnSampler,
  ConsoleSpanExporter,
  NodeTracerProvider,
  ParentBasedSampler,
  SimpleSpanProcessor,
} from '@opentelemetry/sdk-trace-node'
import {
  connect,
  getOTelTracer,
  createConsoleLogger,
  LogLevel,
} from 'couchbase'

// Configuration
const SERVICE_NAME = 'couchbase-otel-tracing-example'
const CONNECTION_STRING = 'couchbase://localhost'
const BUCKET_NAME = 'default'
const USERNAME = 'Administrator'
const PASSWORD = 'password'

function setupOtelConsoleExporter(): NodeTracerProvider {
  const customResource = resourceFromAttributes({
    [ATTR_SERVICE_NAME]: SERVICE_NAME,
  })
  const resource = defaultResource().merge(customResource)

  const consoleExporter = new ConsoleSpanExporter()
  const processor = new SimpleSpanProcessor(consoleExporter)

  const sampler = new ParentBasedSampler({
    root: new AlwaysOnSampler(),
  })

  const provider = new NodeTracerProvider({
    resource: resource,
    sampler: sampler,
    spanProcessors: [processor],
  })

  provider.register()

  return provider
}

async function main() {
  const tracerProvider = setupOtelConsoleExporter()

  // 1. Create a unified console logger for the app and the SDK
  const logger = createConsoleLogger(LogLevel.DEBUG)

  logger.info('Starting OpenTelemetry Tracing & SDK Logging Console Example')
  logger.info(`Connecting to ${CONNECTION_STRING}...`)

  try {
    const couchbaseTracer = getOTelTracer(tracerProvider)

    const cluster = await connect(CONNECTION_STRING, {
      username: USERNAME,
      password: PASSWORD,
      tracer: couchbaseTracer,
      logger: logger,
    })

    const bucket = cluster.bucket(BUCKET_NAME)
    const collection = bucket.defaultCollection()

    logger.info('Connected successfully! Performing operations...')

    const testDocument = {
      id: 1,
      name: 'OpenTelemetry Demo',
      description: 'Testing Couchbase with OpenTelemetry tracing',
      timestamp: Date.now(),
    }
    const testKey = 'otelDemoKey'

    logger.info(`Upserting document '${testKey}'...`)
    const upResult = await collection.upsert(testKey, testDocument)
    logger.debug(`Upsert CAS: ${upResult.cas}`) // Using debug for raw data!

    logger.info(`Retrieving document '${testKey}'...`)
    let getResult = await collection.get(testKey)
    logger.debug(`Retrieved name: ${getResult.content.name}`)

    logger.info(`Replacing document '${testKey}'...`)
    testDocument.description = 'Updated: Testing Couchbase with OpenTelemetry'
    const replaceResult = await collection.replace(testKey, testDocument, {
      cas: upResult.cas,
    })
    logger.debug(`Replace CAS: ${replaceResult.cas}`)

    logger.info(`Executing N1QL query...`)
    const query = `SELECT name, description FROM \`${BUCKET_NAME}\` USE KEYS '${testKey}'`
    try {
      const queryResult = await cluster.query(query)
      logger.info(`   Query returned ${queryResult.rows.length} rows`)
      for (const row of queryResult.rows) {
        logger.debug(`      - ${row.name}: ${row.description}`)
      }
    } catch (e: any) {
      logger.warn(`Query failed: ${e.message}`) // Graceful warning
    }

    logger.info(`Removing document '${testKey}'...`)
    const removeResult = await collection.remove(testKey)
    logger.debug(`Remove CAS: ${removeResult.cas}`)

    logger.info('All operations completed! Closing connection...')
    await cluster.close()
  } catch (e: any) {
    logger.error(`Fatal ERROR: ${e.message}`)
  } finally {
    if (tracerProvider) {
      await tracerProvider.shutdown()
      logger.info('OpenTelemetry tracer shut down gracefully.')
    }
  }
}

main().catch((err) => {
  console.error('Fatal error:', err)
  process.exit(1)
})


================================================
FILE: examples/observability/tracing/jaeger/docker-compose.yml
================================================
services:
  jaeger:
    image: jaegertracing/all-in-one:latest
    environment:
      - COLLECTOR_OTLP_ENABLED=true
    ports:
      - "4317:4317"   # OTLP gRPC receiver
      - "16686:16686" # Jaeger UI


================================================
FILE: examples/observability/tracing/jaeger/otel-otlp-tracing-exporter.ts
================================================
/**
 * OpenTelemetry Tracing with Jaeger UI Example (TypeScript)
 *
 * This example demonstrates how to use OpenTelemetry tracing with the Couchbase Node.js SDK
 * and export traces to Jaeger for visualization in a web UI.
 *
 * What this example does:
 * - Sets up OpenTelemetry tracing with OTLP exporter for Jaeger
 * - Creates a Couchbase cluster connection with OTel tracing enabled
 * - Performs various KV and query operations
 * - Exports all spans to Jaeger for visualization in the UI
 *
 * Prerequisites:
 * - Jaeger running locally (or update TRACING_ENDPOINT)
 * - Couchbase Server running
 * - OpenTelemetry packages installed
 *
 * Installation:
 *   npm install:
 *       - @opentelemetry/api (^1.9.0)
 *       - @opentelemetry/sdk-node (^0.213.0)
 *       - @opentelemetry/sdk-trace-node (^2.6.0)
 *       - @opentelemetry/exporter-trace-otlp-grpc (^0.213.0)
 *
 * Quick Start with Docker:
 *   # Start Jaeger (all-in-one with UI)
 *   docker-compose up -d
 *
 *   # Run this example
 *   tsx otel-otlp-tracing-exporter.ts
 *
 *   # Open Jaeger UI in browser
 *   # http://localhost:16686
 *
 * Expected output:
 * - Console logs showing operations being performed
 * - Traces visible in Jaeger UI at http://localhost:16686
 * - Search for service "couchbase-otel-tracing-example" in Jaeger UI
 */

import {
    defaultResource,
    resourceFromAttributes,
  } from '@opentelemetry/resources'
  import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions'
  import {
    AlwaysOnSampler,
    NodeTracerProvider,
    ParentBasedSampler,
    BatchSpanProcessor,
  } from '@opentelemetry/sdk-trace-node'
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc'
  import { connect, getOTelTracer } from 'couchbase'
  
  // Configuration
  const SERVICE_NAME = 'couchbase-otel-tracing-example'
  const TRACING_ENDPOINT = 'http://localhost:4317'
  const CONNECTION_STRING = 'couchbase://192.168.107.128'
  const BUCKET_NAME = 'default'
  const USERNAME = 'Administrator'
  const PASSWORD = 'password'
  
  function setupOtelTracing(): NodeTracerProvider {
    const customResource = resourceFromAttributes({
      [ATTR_SERVICE_NAME]: SERVICE_NAME,
    })
    const resource = defaultResource().merge(customResource)
  
    const traceExporter = new OTLPTraceExporter({
      url: TRACING_ENDPOINT,
    })
  
    // Batching is highly recommended for production over the SimpleSpanProcessor
    const processor = new BatchSpanProcessor(traceExporter)
  
    const sampler = new ParentBasedSampler({
      root: new AlwaysOnSampler(), // Sample all root spans
    })
  
    const provider = new NodeTracerProvider({
      resource: resource,
      sampler: sampler,
      spanProcessors: [processor],
    })
  
    provider.register()
  
    return provider
  }
  
  function printBanner(): void {
    console.log('\n' + '='.repeat(80))
    console.log('OpenTelemetry OTLP Tracing Export Example (Jaeger)')
    console.log('='.repeat(80) + '\n')
  }
  
  async function performOperations(collection: any, cluster: any): Promise<void> {
    console.log('\n' + '-'.repeat(80))
    console.log('Performing Operations (Generating Traces)')
    console.log('-'.repeat(80) + '\n')
  
    const docs: Record<string, any> = {
      'tracing:1': { name: 'Alice', age: 30, type: 'user', user_role: 'admin' },
      'tracing:2': { name: 'Bob', age: 25, type: 'user', user_role: 'developer' },
      'tracing:3': {
        name: 'Charlie',
        age: 35,
        type: 'user',
        user_role: 'manager',
      },
      'tracing:4': {
        name: 'Diana',
        age: 28,
        type: 'user',
        user_role: 'designer',
      },
      'tracing:5': { name: 'Eve', age: 32, type: 'user', user_role: 'analyst' },
    }
  
    const docKeys = Object.keys(docs)
  
    console.log('1. Upserting documents...')
    for (const key of docKeys) {
      await collection.upsert(key, docs[key])
      console.log(`   ✓ Upserted '${key}'`)
    }
  
    console.log('\n2. Retrieving documents...')
    for (let roundNum = 1; roundNum <= 3; roundNum++) {
      console.log(`   Round ${roundNum}:`)
      for (const key of docKeys) {
        await collection.get(key)
      }
      console.log(`     ✓ Retrieved all ${docKeys.length} documents`)
    }
  
    console.log('\n3. Replacing documents...')
    for (const key of docKeys.slice(0, 3)) {
      // Just first 3
      const getResult = await collection.get(key)
      const doc = getResult.content
      doc.updated = true
      await collection.replace(key, doc, { cas: getResult.cas })
      console.log(`   ✓ Replaced '${key}'`)
    }
  
    console.log('\n4. Touching documents (updating expiry)...')
    for (const key of docKeys.slice(3)) {
      // Last 2
      await collection.touch(key, 3600) // Expiry in seconds
      console.log(`   ✓ Touched '${key}'`)
    }
  
    console.log('\n5. Executing N1QL query...')
    const query = `SELECT name, user_role FROM \`${BUCKET_NAME}\` WHERE type = 'user' LIMIT 3`
    try {
      const result = await cluster.query(query)
      console.log(`   ✓ Query returned ${result.rows.length} rows`)
      for (const row of result.rows) {
        console.log(`      - ${row.name}: ${row.user_role}`)
      }
    } catch (e: any) {
      console.log(`   ⚠ Query failed: ${e.message}`)
    }
  
    console.log('\n6. Cleaning up...')
    for (const key of docKeys) {
      try {
        await collection.remove(key)
        console.log(`   ✓ Removed '${key}'`)
      } catch (e) {
        // Ignore not found errors during cleanup
      }
    }
  
    console.log('\n' + '-'.repeat(80))
    console.log('All operations completed!')
    console.log('-'.repeat(80))
  }
  
  async function main(): Promise<void> {
    printBanner()
    let tracerProvider: NodeTracerProvider | null = null
  
    try {
      console.log('Setting up OpenTelemetry Tracing...')
      tracerProvider = setupOtelTracing()
      console.log('✓ OpenTelemetry Tracing configured\n')
  
      console.log(`Connecting to Couchbase at ${CONNECTION_STRING}...`)
  
      // Wrap the OTel tracer with the Couchbase SDK wrapper
      const couchbaseTracer = getOTelTracer(tracerProvider)
  
      const cluster = await connect(CONNECTION_STRING, {
        username: USERNAME,
        password: PASSWORD,
        tracer: couchbaseTracer, // Inject the tracing wrapper here!
      })
  
      const bucket = cluster.bucket(BUCKET_NAME)
      const collection = bucket.defaultCollection()
      console.log('✓ Connected to Couchbase\n')
  
      await performOperations(collection, cluster)
  
      console.log('\nClosing cluster connection...')
      await cluster.close()
    } catch (e) {
      console.error(`\nERROR:`, e)
    } finally {
      // CRITICAL: Forces all pending spans in the BatchSpanProcessor
      // to be exported over gRPC before Node exits!
      if (tracerProvider) {
        await tracerProvider.shutdown()
        console.log('✓ OpenTelemetry tracer shut down and spans flushed.')
  
        console.log('\n' + '='.repeat(80))
        console.log('SUCCESS! Traces Exported')
        console.log('='.repeat(80))
        console.log('\n🔎 VIEW TRACES IN JAEGER:')
        console.log('  • Jaeger UI: http://localhost:16686')
        console.log(`  • Select Service: '${SERVICE_NAME}'`)
        console.log("  • Click 'Find Traces'")
        console.log('='.repeat(80) + '\n')
      }
    }
  }
  
  main().catch((err) => {
    console.error('Fatal error:', err)
    process.exit(1)
  })
  

================================================
FILE: lib/analyticsexecutor.ts
================================================
/* eslint jsdoc/require-jsdoc: off */
import {
  AnalyticsQueryOptions,
  AnalyticsResult,
  AnalyticsMetaData,
  AnalyticsWarning,
  AnalyticsMetrics,
} from './analyticstypes'
import { CppAnalyticsResponse } from './binding'
import {
  analyticsScanConsistencyToCpp,
  analyticsStatusFromCpp,
} from './bindingutilities'
import { Cluster } from './cluster'
import { wrapObservableBindingCall } from './observability'
import { ObservableRequestHandler } from './observabilityhandler'
import { ObservabilityInstruments, StreamingOp } from './observabilitytypes'
import { StreamableRowPromise } from './streamablepromises'
import { PromiseHelper } from './utilities'

/**
 * @internal
 */
export class AnalyticsExecutor {
  private _cluster: Cluster

  /**
   * @internal
   */
  constructor(cluster: Cluster) {
    this._cluster = cluster
  }

  /**
   * @internal
   */
  get observabilityInstruments(): ObservabilityInstruments {
    return this._cluster.observabilityInstruments
  }

  /**
   * @internal
   */
  static _processAnalyticsResponse<TRow>(
    emitter: StreamableRowPromise<
      AnalyticsResult<TRow>,
      TRow,
      AnalyticsMetaData
    >,
    err: Error | null,
    resp: CppAnalyticsResponse,
    obsReqHandler?: ObservableRequestHandler
  ): void {
    if (err) {
      obsReqHandler?.endWithError(err)
      emitter.emit('error', err)
      emitter.emit('end')
      return
    }

    resp.rows.forEach((row) => {
      emitter.emit('row', JSON.parse(row))
    })

    {
      const metaData = resp.meta

      let warnings: AnalyticsWarning[]
      if (metaData.warnings) {
        warnings = metaData.warnings.map(
          (warningData: any) =>
            new AnalyticsWarning({
              code: warningData.code,
              message: warningData.message,
            })
        )
      } else {
        warnings = []
      }

      const metricsData = metaData.metrics
      const metrics = new AnalyticsMetrics({
        elapsedTime: metricsData.elapsed_time,
        executionTime: metricsData.execution_time,
        resultCount: metricsData.result_count,
        resultSize: metricsData.result_size,
        errorCount: metricsData.error_count,
        processedObjects: metricsData.processed_objects,
        warningCount: metricsData.warning_count,
      })

      const meta = new AnalyticsMetaData({
        requestId: metaData.request_id,
        clientContextId: metaData.client_context_id,
        status: analyticsStatusFromCpp(metaData.status),
        signature: metaData.signature
          ? JSON.parse(metaData.signature)
          : undefined,
        warnings: warnings,
        metrics: metrics,
      })

      emitter.emit('meta', meta)
    }

    obsReqHandler?.end()
    emitter.emit('end')
  }

  /**
   * @internal
   */
  static executePromise<TRow = any>(
    queryPromise: Promise<[Error | null, CppAnalyticsResponse]>,
    obsReqHandler: ObservableRequestHandler
  ): StreamableRowPromise<AnalyticsResult<TRow>, TRow, AnalyticsMetaData> {
    const emitter = new StreamableRowPromise<
      AnalyticsResult<TRow>,
      TRow,
      AnalyticsMetaData
    >((rows, meta) => {
      return new AnalyticsResult({
        rows: rows,
        meta: meta,
      })
    })

    PromiseHelper.wrapAsync(async () => {
      const [err, resp] = await queryPromise
      AnalyticsExecutor._processAnalyticsResponse(
        emitter,
        err,
        resp,
        obsReqHandler
      )
    })

    return emitter
  }

  /**
   * @internal
   */
  query<TRow = any>(
    query: string,
    options: AnalyticsQueryOptions
  ): StreamableRowPromise<AnalyticsResult<TRow>, TRow, AnalyticsMetaData> {
    const timeout = options.timeout || this._cluster.analyticsTimeout

    const obsReqHandler = new ObservableRequestHandler(
      StreamingOp.Analytics,
      this.observabilityInstruments,
      options?.parentSpan
    )

    obsReqHandler.setRequestHttpAttributes({
      statement: query,
      queryContext: options.queryContext,
      queryOptions: options,
    })

    return AnalyticsExecutor.executePromise(
      wrapObservableBindingCall(
        this._cluster.conn.analytics.bind(this._cluster.conn),
        {
          statement: query,
          timeout,
          client_context_id: options.clientContextId,
          readonly: options.readOnly || false,
          priority: options.priority || false,
          scope_qualifier: options.queryContext,
          scan_consistency: analyticsScanConsistencyToCpp(
            options.scanConsistency
          ),
          raw: options.raw
            ? Object.fromEntries(
                Object.entries(options.raw)
                  .filter(([, v]) => v !== undefined)
                  .map(([k, v]) => [k, JSON.stringify(v)])
              )
            : {},
          positional_parameters:
            options.parameters && Array.isArray(options.parameters)
              ? options.parameters.map((v) => JSON.stringify(v ?? null))
              : [],
          named_parameters:
            options.parameters && !Array.isArray(options.parameters)
              ? Object.fromEntries(
                  Object.entries(options.parameters as { [key: string]: any })
                    .filter(([, v]) => v !== undefined)
                    .map(([k, v]) => [k, JSON.stringify(v)])
                )
              : {},
          body_str: '',
        },
        obsReqHandler
      ),
      obsReqHandler
    )
  }
}


================================================
FILE: lib/analyticsindexmanager.ts
================================================
import { Cluster } from './cluster'
import {
  CppManagementAnalyticsDataset,
  CppManagementAnalyticsIndex,
  CppManagementAnalyticsCouchbaseRemoteLink,
  CppManagementAnalyticsS3ExternalLink,
  CppManagementAnalyticsAzureBlobExternalLink,
} from './binding'
import { InvalidArgumentError } from './errors'
import {
  encryptionSettingsFromCpp,
  encryptionSettingsToCpp,
} from './bindingutilities'
import { wrapObservableBindingCall } from './observability'
import { ObservableRequestHandler } from './observabilityhandler'
import { AnalyticsMgmtOp, ObservabilityInstruments } from './observabilitytypes'
import { RequestSpan } from './tracing'
import { NodeCallback, PromiseHelper } from './utilities'

/**
 * Represents the type of an analytics link.
 *
 * @category Analytics
 */
export enum AnalyticsLinkType {
  /**
   * Indicates that the link is for S3.
   */
  S3External = 's3',

  /**
   * Indicates that the link is for Azure.
   */
  AzureBlobExternal = 'azureblob',

  /**
   * Indicates that the link is for a remote Couchbase cluster.
   */
  CouchbaseRemote = 'couchbase',
}

/**
 * Represents what level of encryption to use for analytics remote links.
 *
 * @category Analytics
 */
export enum AnalyticsEncryptionLevel {
  /**
   * Indicates that no encryption should be used.
   */
  None = 'none',

  /**
   * Indicates that half encryption should be used.
   */
  Half = 'half',

  /**
   * Indicates that full encryption should be used.
   */
  Full = 'full',
}

/**
 * Contains a specific dataset configuration for the analytics service.
 *
 * @category Management
 */
export class AnalyticsDataset {
  /**
   * The name of the dataset.
   */
  name: string

  /**
   * The name of the dataverse that this dataset exists within.
   */
  dataverseName: string

  /**
   * The name of the link that is associated with this dataset.
   */
  linkName: string

  /**
   * The name of the bucket that this dataset includes.
   */
  bucketName: string

  /**
   * @internal
   */
  constructor(data: AnalyticsDataset) {
    this.name = data.name
    this.dataverseName = data.dataverseName
    this.linkName = data.linkName
    this.bucketName = data.bucketName
  }
}

/**
 * Contains a specific index configuration for the analytics service.
 *
 * @category Management
 */
export class AnalyticsIndex {
  /**
   * The name of the index.
   */
  name: string

  /**
   * The name of the dataset this index belongs to.
   */
  datasetName: string

  /**
   * The name of the dataverse this index belongs to.
   */
  dataverseName: string

  /**
   * Whether or not this is a primary index or not.
   */
  isPrimary: boolean

  /**
   * @internal
   */
  constructor(data: AnalyticsIndex) {
    this.name = data.name
    this.datasetName = data.datasetName
    this.dataverseName = data.dataverseName
    this.isPrimary = data.isPrimary
  }
}

/**
 * Specifies encryption options for an analytics remote link.
 */
export interface ICouchbaseAnalyticsEncryptionSettings {
  /**
   * Specifies what level of encryption should be used.
   */
  encryptionLevel: AnalyticsEncryptionLevel

  /**
   * Provides a certificate to use for connecting when encryption level is set
   * to full.  Required when encryptionLevel is set to Full.
   */
  certificate?: Buffer

  /**
   * Provides a client certificate to use for connecting when encryption level
   * is set to full.  Cannot be set if a username/password are used.
   */
  clientCertificate?: Buffer

  /**
   * Provides a client key to use for connecting when encryption level is set
   * to full.  Cannot be set if a username/password are used.
   */
  clientKey?: Buffer
}

/**
 * Includes information about an analytics remote links encryption.
 */
export class CouchbaseAnalyticsEncryptionSettings
  implements ICouchbaseAnalyticsEncryptionSettings
{
  /**
   * Specifies what level of encryption should be used.
   */
  encryptionLevel: AnalyticsEncryptionLevel

  /**
   * Provides a certificate to use for connecting when encryption level is set
   * to full.  Required when encryptionLevel is set to Full.
   */
  certificate?: Buffer

  /**
   * Provides a client certificate to use for connecting when encryption level
   * is set to full.  Cannot be set if a username/password are used.
   */
  clientCertificate?: Buffer

  /**
   * Provides a client key to use for connecting when encryption level is set
   * to full.  Cannot be set if a username/password are used.
   */
  clientKey?: Buffer

  /**
   * @internal
   */
  constructor(data: CouchbaseAnalyticsEncryptionSettings) {
    this.encryptionLevel = data.encryptionLevel
    this.certificate = data.certificate
    this.clientCertificate = data.clientCertificate
    this.clientKey = data.clientKey
  }
}

/**
 * Provides a base class for specifying options for an analytics link.
 *
 * @category Management
 */
export interface IAnalyticsLink {
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string
}

/**
 * This is a base class for specific link configurations for the analytics service.
 */
export abstract class AnalyticsLink implements IAnalyticsLink {
  /**
   * @internal
   */
  constructor() {
    this.linkType = '' as AnalyticsLinkType
    this.dataverse = ''
    this.name = ''
  }

  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * Validates the link.
   */
  abstract validate(): void

  /**
   * @internal
   */
  static _toHttpData(data: IAnalyticsLink): any {
    if (data.linkType === AnalyticsLinkType.CouchbaseRemote) {
      return CouchbaseRemoteAnalyticsLink._toHttpData(
        new CouchbaseRemoteAnalyticsLink(data as ICouchbaseRemoteAnalyticsLink)
      )
    } else if (data.linkType === AnalyticsLinkType.S3External) {
      return S3ExternalAnalyticsLink._toHttpData(
        new S3ExternalAnalyticsLink(data as IS3ExternalAnalyticsLink)
      )
    } else if (data.linkType === AnalyticsLinkType.AzureBlobExternal) {
      return AzureExternalAnalyticsLink._toHttpData(
        new AzureExternalAnalyticsLink(data as IAzureExternalAnalyticsLink)
      )
    } else {
      throw new Error('invalid link type')
    }
  }

  /**
   * @internal
   */
  static _fromHttpData(data: any): AnalyticsLink {
    if (data.type === 'couchbase') {
      return CouchbaseRemoteAnalyticsLink._fromHttpData(data)
    } else if (data.type === 's3') {
      return S3ExternalAnalyticsLink._fromHttpData(data)
    } else if (data.type === 'azure') {
      return AzureExternalAnalyticsLink._fromHttpData(data)
    } else {
      throw new Error('invalid link type')
    }
  }
}

/**
 * Provides options for configuring an analytics remote couchbase cluster link.
 */
export interface ICouchbaseRemoteAnalyticsLink extends IAnalyticsLink {
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.CouchbaseRemote

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The hostname of the target Couchbase cluster.
   */
  hostname: string

  /**
   * The encryption settings to be used for the link.
   */
  encryption?: ICouchbaseAnalyticsEncryptionSettings

  /**
   * The username to use for authentication with the remote cluster.  Optional
   * if client-certificate authentication
   * (@see ICouchbaseAnalyticsEncryptionSettings.clientCertificate) is being used.
   */
  username?: string

  /**
   * The password to use for authentication with the remote cluster.  Optional
   * if client-certificate authentication
   * (@see ICouchbaseAnalyticsEncryptionSettings.clientCertificate) is being used.
   */
  password?: string
}

/**
 * Provides information about a analytics remote Couchbase link.
 */
export class CouchbaseRemoteAnalyticsLink
  extends AnalyticsLink
  implements ICouchbaseRemoteAnalyticsLink
{
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.CouchbaseRemote

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The hostname of the target Couchbase cluster.
   */
  hostname: string

  /**
   * The encryption settings to be used for the link.
   */
  encryption?: CouchbaseAnalyticsEncryptionSettings

  /**
   * The username to use for authentication with the remote cluster.  Optional
   * if client-certificate authentication
   * (@see ICouchbaseAnalyticsEncryptionSettings.clientCertificate) is being used.
   */
  username?: string

  /**
   * The password to use for authentication with the remote cluster.  Optional
   * if client-certificate authentication
   * (@see ICouchbaseAnalyticsEncryptionSettings.clientCertificate) is being used.
   */
  password?: string

  /**
   * Validates the CouchbaseRemoteAnalyticsLink.
   */
  validate(): void {
    if (!this.dataverse) {
      throw new InvalidArgumentError(
        new Error(
          'Must provide a dataverse for the CouchbaseRemoteAnalyticsLink.'
        )
      )
    }
    if (!this.name) {
      throw new InvalidArgumentError(
        new Error('Must provide a name for the CouchbaseRemoteAnalyticsLink.')
      )
    }
    if (!this.hostname) {
      throw new InvalidArgumentError(
        new Error(
          'Must provide a hostname for the CouchbaseRemoteAnalyticsLink.'
        )
      )
    }
    if (this.encryption) {
      if (
        [AnalyticsEncryptionLevel.None, AnalyticsEncryptionLevel.Half].includes(
          this.encryption.encryptionLevel
        )
      ) {
        if (!this.username || !this.password) {
          throw new InvalidArgumentError(
            new Error(
              'When encryption level is half or none, username and password must be set for the CouchbaseRemoteAnalyticsLink.'
            )
          )
        }
      } else {
        if (
          !this.encryption.certificate ||
          this.encryption.certificate.length == 0
        ) {
          throw new InvalidArgumentError(
            new Error(
              'When encryption level full, a certificate must be set for the CouchbaseRemoteAnalyticsLink.'
            )
          )
        }
        const clientCertificateInvalid =
          !this.encryption.clientCertificate ||
          this.encryption.clientCertificate.length == 0
        const clientKeyInvalid =
          !this.encryption.clientKey || this.encryption.clientKey.length == 0
        if (clientCertificateInvalid || clientKeyInvalid) {
          throw new InvalidArgumentError(
            new Error(
              'When encryption level full, a client key and certificate must be set for the CouchbaseRemoteAnalyticsLink.'
            )
          )
        }
      }
    }
  }

  /**
   * @internal
   */
  constructor(data: ICouchbaseRemoteAnalyticsLink) {
    super()
    this.linkType = AnalyticsLinkType.CouchbaseRemote

    this.dataverse = data.dataverse
    this.name = data.name
    this.hostname = data.hostname
    this.encryption = data.encryption
    this.username = data.username
    this.password = data.password
  }

  /**
   * @internal
   */
  static _toCppData(
    data: CouchbaseRemoteAnalyticsLink
  ): CppManagementAnalyticsCouchbaseRemoteLink {
    data.validate()
    return {
      link_name: data.name,
      dataverse: data.dataverse,
      hostname: data.hostname,
      username: data.hostname,
      password: data.password,
      encryption: encryptionSettingsToCpp(data.encryption),
    }
  }

  /**
   * @internal
   */
  static _fromCppData(
    data: CppManagementAnalyticsCouchbaseRemoteLink
  ): CouchbaseRemoteAnalyticsLink {
    return new CouchbaseRemoteAnalyticsLink({
      linkType: AnalyticsLinkType.CouchbaseRemote,
      dataverse: data.dataverse,
      name: data.link_name,
      hostname: data.hostname,
      encryption: encryptionSettingsFromCpp(data.encryption),
      username: data.username,
      password: undefined,
    })
  }
}

/**
 * Provides options for configuring an analytics remote S3 link.
 */
export interface IS3ExternalAnalyticsLink extends IAnalyticsLink {
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.S3External

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The AWS S3 access key.
   */
  accessKeyId: string

  /**
   * The AWS S3 secret key.
   */
  secretAccessKey?: string

  /**
   * The AWS S3 token if temporary credentials are provided.  Only available
   * in Couchbase Server 7.0 and above.
   */
  sessionToken?: string

  /**
   * The AWS S3 region.
   */
  region: string

  /**
   * The AWS S3 service endpoint.
   */
  serviceEndpoint?: string
}

/**
 * Provides information about a analytics remote S3 link.
 */
export class S3ExternalAnalyticsLink
  extends AnalyticsLink
  implements IS3ExternalAnalyticsLink
{
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.S3External

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The AWS S3 access key.
   */
  accessKeyId: string

  /**
   * The AWS S3 secret key.
   */
  secretAccessKey?: string

  /**
   * The AWS S3 token if temporary credentials are provided.  Only available
   * in Couchbase Server 7.0 and above.
   */
  sessionToken?: string

  /**
   * The AWS S3 region.
   */
  region: string

  /**
   * The AWS S3 service endpoint.
   */
  serviceEndpoint?: string

  /**
   * @internal
   */
  constructor(data: IS3ExternalAnalyticsLink) {
    super()
    this.linkType = AnalyticsLinkType.S3External

    this.dataverse = data.dataverse
    this.name = data.name
    this.accessKeyId = data.accessKeyId
    this.secretAccessKey = data.secretAccessKey
    this.sessionToken = data.sessionToken
    this.region = data.region
    this.serviceEndpoint = data.serviceEndpoint
  }

  /**
   * Validates the S3ExternalAnalyticsLink.
   */
  validate(): void {
    if (!this.dataverse) {
      throw new InvalidArgumentError(
        new Error('Must provide a dataverse for the S3ExternalAnalyticsLink.')
      )
    }
    if (!this.name) {
      throw new InvalidArgumentError(
        new Error('Must provide a name for the S3ExternalAnalyticsLink.')
      )
    }
    if (!this.accessKeyId) {
      throw new InvalidArgumentError(
        new Error(
          'Must provide an accessKeyId for the S3ExternalAnalyticsLink.'
        )
      )
    }
    if (!this.secretAccessKey) {
      throw new InvalidArgumentError(
        new Error(
          'Must provide an secretAccessKey for the S3ExternalAnalyticsLink.'
        )
      )
    }
    if (!this.region) {
      throw new InvalidArgumentError(
        new Error('Must provide an region for the S3ExternalAnalyticsLink.')
      )
    }
  }

  /**
   * @internal
   */
  static _toCppData(
    data: S3ExternalAnalyticsLink
  ): CppManagementAnalyticsS3ExternalLink {
    data.validate()
    return {
      link_name: data.name,
      dataverse: data.dataverse,
      access_key_id: data.accessKeyId,
      secret_access_key: data.secretAccessKey as string,
      session_token: data.sessionToken,
      region: data.region,
      service_endpoint: data.serviceEndpoint,
    }
  }

  /**
   * @internal
   */
  static _fromCppData(
    data: CppManagementAnalyticsS3ExternalLink
  ): S3ExternalAnalyticsLink {
    return new S3ExternalAnalyticsLink({
      name: data.link_name,
      linkType: AnalyticsLinkType.S3External,
      dataverse: data.dataverse,
      accessKeyId: data.access_key_id,
      secretAccessKey: undefined,
      sessionToken: undefined,
      region: data.region,
      serviceEndpoint: data.service_endpoint,
    })
  }
}

/**
 * Provides options for configuring an analytics remote Azure link.
 */
export interface IAzureExternalAnalyticsLink extends IAnalyticsLink {
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.AzureBlobExternal

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The connection string to use to connect to the external Azure store.
   */
  connectionString?: string

  /**
   * The Azure blob storage account name.
   */
  accountName?: string

  /**
   * The Azure blob storage account key.
   */
  accountKey?: string

  /**
   * The shared access signature to use for authentication.
   */
  sharedAccessSignature?: string

  /**
   * The Azure blob storage endpoint.
   */
  blobEndpoint?: string

  /**
   * The Azure blob endpoint suffix.
   */
  endpointSuffix?: string
}

/**
 * Provides information about a analytics remote S3 link.
 */
export class AzureExternalAnalyticsLink
  extends AnalyticsLink
  implements IAzureExternalAnalyticsLink
{
  /**
   * Specifies what type of analytics link this represents.
   */
  linkType: AnalyticsLinkType.AzureBlobExternal

  /**
   * The dataverse that this link belongs to.
   */
  dataverse: string

  /**
   * The name of this link.
   */
  name: string

  /**
   * The connection string to use to connect to the external Azure store.
   */
  connectionString?: string

  /**
   * The Azure blob storage account name.
   */
  accountName?: string

  /**
   * The Azure blob storage account key.
   */
  accountKey?: string

  /**
   * The shared access signature to use for authentication.
   */
  sharedAccessSignature?: string

  /**
   * The Azure blob storage endpoint.
   */
  blobEndpoint?: string

  /**
   * The Azure blob endpoint suffix.
   */
  endpointSuffix?: string

  /**
   * @internal
   */
  constructor(data: IAzureExternalAnalyticsLink) {
    super()
    this.linkType = AnalyticsLinkType.AzureBlobExternal

    this.dataverse = data.dataverse
    this.name = data.name
    this.connectionString = data.connectionString
    this.accountName = data.accountName
    this.accountKey = data.accountKey
    this.sharedAccessSignature = data.sharedAccessSignature
    this.blobEndpoint = data.blobEndpoint
    this.endpointSuffix = data.endpointSuffix
  }

  /**
   * Validates the AzureExternalAnalyticsLink.
   */
  validate(): void {
    if (!this.dataverse) {
      throw new InvalidArgumentError(
        new Error(
          'Must provide a dataverse for the AzureExternalAnalyticsLink.'
        )
      )
    }
    if (!this.name) {
      throw new InvalidArgumentError(
        new Error('Must provide a name for the AzureExternalAnalyticsLink.')
      )
    }
    if (!this.connectionString) {
      const missingAcctNameAndKey = !(this.accountName && this.accountKey)
      const missingAcctNameAndSharedAccessSignature = !(
        this.accountName && this.sharedAccessSignature
      )
      if (missingAcctNameAndKey && missingAcctNameAndSharedAccessSignature) {
        throw new InvalidArgumentError(
          new Error(
            'If not providing connectionString, accountName and either accountKey' +
              ' or sharedAccessSignature must be provided for the AzureExternalAnalyticsLink.'
          )
        )
      }
    }
  }

  /**
   * @internal
   */
  static _toCppData(
    data: AzureExternalAnalyticsLink
  ): CppManagementAnalyticsAzureBlobExternalLink {
    data.validate()
    return {
      link_name: data.name,
      dataverse: data.dataverse,
      connection_string: data.connectionString,
      account_name: data.accountName,
      account_key: data.accountKey,
      shared_access_signature: data.sharedAccessSignature,
      blob_endpoint: data.blobEndpoint,
      endpoint_suffix: data.endpointSuffix,
    }
  }

  /**
   * @internal
   */
  static _fromCppData(
    data: CppManagementAnalyticsAzureBlobExternalLink
  ): AzureExternalAnalyticsLink {
    return new AzureExternalAnalyticsLink({
      name: data.link_name,
      linkType: AnalyticsLinkType.AzureBlobExternal,
      dataverse: data.dataverse,
      connectionString: undefined,
      accountName: data.account_name,
      accountKey: undefined,
      sharedAccessSignature: undefined,
      blobEndpoint: data.blob_endpoint,
      endpointSuffix: data.endpoint_suffix,
    })
  }
}

/**
 * @category Management
 */
export interface CreateAnalyticsDataverseOptions {
  /**
   * Whether or not the call should ignore the dataverse already existing when
   * determining whether the call was successful.
   */
  ignoreIfExists?: boolean

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface DropAnalyticsDataverseOptions {
  /**
   * Whether or not the call should ignore the dataverse not existing when
   * determining whether the call was successful.
   */
  ignoreIfNotExists?: boolean

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface CreateAnalyticsDatasetOptions {
  /**
   * Whether or not the call should ignore the dataset already existing when
   * determining whether the call was successful.
   */
  ignoreIfExists?: boolean

  /**
   * The name of the dataverse the dataset should belong to.
   */
  dataverseName?: string

  /**
   * A conditional expression to limit the indexes scope.
   */
  condition?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface DropAnalyticsDatasetOptions {
  /**
   * Whether or not the call should ignore the dataset already existing when
   * determining whether the call was successful.
   */
  ignoreIfNotExists?: boolean

  /**
   * The name of the dataverse the dataset belongs to.
   */
  dataverseName?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface GetAllAnalyticsDatasetsOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface CreateAnalyticsIndexOptions {
  /**
   * Whether or not the call should ignore the dataverse not existing when
   * determining whether the call was successful.
   */
  ignoreIfExists?: boolean

  /**
   * The name of the dataverse the index should belong to.
   */
  dataverseName?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface DropAnalyticsIndexOptions {
  /**
   * Whether or not the call should ignore the index already existing when
   * determining whether the call was successful.
   */
  ignoreIfNotExists?: boolean

  /**
   * The name of the dataverse the index belongs to.
   */
  dataverseName?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface GetAllAnalyticsIndexesOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface ConnectAnalyticsLinkOptions {
  /**
   * Whether or not the call should attempt to force the link connection.
   */
  force?: boolean

  /**
   * The name of the dataverse the link belongs to.
   */
  dataverseName?: string

  /**
   * The name of the link to connect.
   */
  linkName?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface DisconnectAnalyticsLinkOptions {
  /**
   * The name of the dataverse the link belongs to.
   */
  dataverseName?: string

  /**
   * The name of the link to connect.
   */
  linkName?: string

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface GetPendingAnalyticsMutationsOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface CreateAnalyticsLinkOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface ReplaceAnalyticsLinkOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface DropAnalyticsLinkOptions {
  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Management
 */
export interface GetAllAnalyticsLinksOptions {
  /**
   * The name of a dataverse to filter the links list to.
   */
  dataverse?: string

  /**
   * The name of a specific link to fetch.
   */
  name?: string

  /**
   * The type of link to filter the links list to.
   */
  linkType?: AnalyticsLinkType

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * AnalyticsIndexManager provides an interface for performing management
 * operations against the analytics service of the cluster.
 *
 * @category Management
 */
export class AnalyticsIndexManager {
  private _cluster: Cluster

  /**
   * @internal
   */
  constructor(cluster: Cluster) {
    this._cluster = cluster
  }

  /**
   * @internal
   */
  get observabilityInstruments(): ObservabilityInstruments {
    return this._cluster.observabilityInstruments
  }

  /**
   * Creates a new dataverse.
   *
   * @param dataverseName The name of the dataverse to create.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async createDataverse(
    dataverseName: string,
    options?: CreateAnalyticsDataverseOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsDataverseCreate,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout
      const ignoreIfExists = options.ignoreIfExists || false

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsDataverseCreate.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            timeout: timeout,
            ignore_if_exists: ignoreIfExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Drops a previously created dataverse.
   *
   * @param dataverseName The name of the dataverse to drop.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async dropDataverse(
    dataverseName: string,
    options?: DropAnalyticsDataverseOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsDataverseDrop,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout
      const ignoreIfNotExists = options.ignoreIfNotExists || false

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsDataverseDrop.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            timeout: timeout,
            ignore_if_does_not_exist: ignoreIfNotExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Creates a new dataset.
   *
   * @param bucketName The name of the bucket to create this dataset of.
   * @param datasetName The name of the new dataset.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async createDataset(
    bucketName: string,
    datasetName: string,
    options?: CreateAnalyticsDatasetOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[2]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsDatasetCreate,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const ignoreIfExists = options.ignoreIfExists || false
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsDatasetCreate.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            dataset_name: datasetName,
            bucket_name: bucketName,
            condition: options?.condition,
            timeout: timeout,
            ignore_if_exists: ignoreIfExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Drops a previously created dataset.
   *
   * @param datasetName The name of the dataset to drop.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async dropDataset(
    datasetName: string,
    options?: DropAnalyticsDatasetOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsDatasetDrop,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const ignoreIfNotExists = options.ignoreIfNotExists || false
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsDatasetDrop.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            dataset_name: datasetName,
            timeout: timeout,
            ignore_if_does_not_exist: ignoreIfNotExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Returns a list of all existing datasets.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async getAllDatasets(
    options?: GetAllAnalyticsDatasetsOptions,
    callback?: NodeCallback<AnalyticsDataset[]>
  ): Promise<AnalyticsDataset[]> {
    if (options instanceof Function) {
      callback = arguments[0]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsDatasetGetAll,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, resp] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsDatasetGetAll.bind(
            this._cluster.conn
          ),
          {
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
        return resp.datasets.map(
          (dataset: CppManagementAnalyticsDataset) =>
            new AnalyticsDataset({
              name: dataset.name,
              dataverseName: dataset.dataverse_name,
              linkName: dataset.link_name,
              bucketName: dataset.bucket_name,
            })
        )
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Creates a new index.
   *
   * @param datasetName The name of the dataset to create this index on.
   * @param indexName The name of index to create.
   * @param fields A map of fields that the index should contain.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async createIndex(
    datasetName: string,
    indexName: string,
    fields: { [key: string]: string },
    options?: CreateAnalyticsIndexOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[3]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsIndexCreate,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const ignoreIfExists = options.ignoreIfExists || false
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsIndexCreate.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            dataset_name: datasetName,
            index_name: indexName,
            fields: fields,
            timeout: timeout,
            ignore_if_exists: ignoreIfExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Drops a previously created index.
   *
   * @param datasetName The name of the dataset containing the index to drop.
   * @param indexName The name of the index to drop.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async dropIndex(
    datasetName: string,
    indexName: string,
    options?: DropAnalyticsIndexOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[2]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsIndexDrop,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const ignoreIfNotExists = options.ignoreIfNotExists || false
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsIndexDrop.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            dataset_name: datasetName,
            index_name: indexName,
            timeout: timeout,
            ignore_if_does_not_exist: ignoreIfNotExists,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Returns a list of all existing indexes.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async getAllIndexes(
    options?: GetAllAnalyticsIndexesOptions,
    callback?: NodeCallback<AnalyticsIndex[]>
  ): Promise<AnalyticsIndex[]> {
    if (options instanceof Function) {
      callback = arguments[0]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsIndexGetAll,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, resp] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsIndexGetAll.bind(
            this._cluster.conn
          ),
          {
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
        return resp.indexes.map(
          (index: CppManagementAnalyticsIndex) =>
            new AnalyticsIndex({
              name: index.name,
              dataverseName: index.dataverse_name,
              datasetName: index.dataset_name,
              isPrimary: index.is_primary,
            })
        )
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  // TODO(JSCBC-1293):  Remove deprecated path
  /**
   * Connects a not yet connected link.
   *
   * @param linkStr The name of the link to connect.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   * @deprecated Use the other overload instead.
   */
  async connectLink(
    linkStr: string,
    options?: ConnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void>
  /**
   * Connects a not yet connected link.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async connectLink(
    options?: ConnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void>
  /**
   * @internal
   */
  async connectLink(): Promise<void> {
    if (typeof arguments[0] === 'string') {
      return this._connectLinkDeprecated(
        arguments[0],
        arguments[1],
        arguments[2]
      )
    } else {
      return this._connectLink(arguments[0], arguments[1])
    }
  }

  // TODO(JSCBC-1293):  Remove deprecated path
  /**
   * @internal
   */
  async _connectLinkDeprecated(
    linkStr: string,
    options?: ConnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkConnect,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const force = options.force || false
      const timeout = options.timeout || this._cluster.managementTimeout

      let qs = 'CONNECT LINK ' + linkStr
      if (force) {
        qs += ' WITH {"force": true}'
      }

      return PromiseHelper.wrapAsync(async () => {
        await this._cluster.analyticsQuery(qs, {
          timeout: timeout,
          parentSpan: obsReqHandler.wrappedSpan,
        })
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * @internal
   */
  async _connectLink(
    options?: ConnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkConnect,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const linkName = options.linkName || 'Local'
      const force = options.force || false
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsLinkConnect.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            link_name: linkName,
            timeout: timeout,
            force: force,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  // TODO(JSCBC-1293):  Remove deprecated path
  /**
   * Disconnects a previously connected link.
   *
   * @param linkStr The name of the link to disconnect.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   * @deprecated Use the other overload instead.
   */
  async disconnectLink(
    linkStr: string,
    options?: DisconnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void>
  /**
   * Disconnects a previously connected link.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async disconnectLink(
    options?: DisconnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void>
  /**
   * @internal
   */
  async disconnectLink(): Promise<void> {
    if (typeof arguments[0] === 'string') {
      return this._disconnectLinkDeprecated(
        arguments[0],
        arguments[1],
        arguments[2]
      )
    } else {
      return this._disconnectLink(arguments[0], arguments[1])
    }
  }

  // TODO(JSCBC-1293):  Remove deprecated path
  /**
   * @internal
   */
  async _disconnectLinkDeprecated(
    linkStr: string,
    options?: DisconnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }
    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkDisconnect,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const qs = 'DISCONNECT LINK ' + linkStr
      const timeout = options.timeout || this._cluster.managementTimeout
      return PromiseHelper.wrapAsync(async () => {
        await this._cluster.analyticsQuery(qs, {
          timeout: timeout,
          parentSpan: obsReqHandler.wrappedSpan,
        })
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * @internal
   */
  async _disconnectLink(
    options?: DisconnectAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkDisconnect,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverseName || 'Default'
      const linkName = options.linkName || 'Local'
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsLinkDisconnect.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            link_name: linkName,
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Returns a list of all pending mutations.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async getPendingMutations(
    options?: GetPendingAnalyticsMutationsOptions,
    callback?: NodeCallback<{ [k: string]: { [k: string]: number } }>
  ): Promise<{ [k: string]: { [k: string]: number } }> {
    if (options instanceof Function) {
      callback = arguments[0]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsGetPendingMutations,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, resp] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsGetPendingMutations.bind(
            this._cluster.conn
          ),
          {
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
        return { stats: resp.stats }
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Creates a new analytics remote link.
   *
   * @param link The settings for the link to create.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async createLink(
    link: IAnalyticsLink,
    options?: CreateAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkCreate,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      if (link.linkType == AnalyticsLinkType.CouchbaseRemote) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkCreateCouchbaseRemoteLink.bind(
              this._cluster.conn
            ),
            {
              link: CouchbaseRemoteAnalyticsLink._toCppData(
                new CouchbaseRemoteAnalyticsLink(
                  link as ICouchbaseRemoteAnalyticsLink
                )
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else if (link.linkType == AnalyticsLinkType.S3External) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkCreateS3ExternalLink.bind(
              this._cluster.conn
            ),
            {
              link: S3ExternalAnalyticsLink._toCppData(
                new S3ExternalAnalyticsLink(link as IS3ExternalAnalyticsLink)
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else if (link.linkType == AnalyticsLinkType.AzureBlobExternal) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkCreateAzureBlobExternalLink.bind(
              this._cluster.conn
            ),
            {
              link: AzureExternalAnalyticsLink._toCppData(
                new AzureExternalAnalyticsLink(
                  link as IAzureExternalAnalyticsLink
                )
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else {
        throw new Error('invalid link type')
      }
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Replaces an existing analytics remote link.
   *
   * @param link The settings for the updated link.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async replaceLink(
    link: IAnalyticsLink,
    options?: ReplaceAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[1]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkReplace,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      if (link.linkType == AnalyticsLinkType.CouchbaseRemote) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkReplaceCouchbaseRemoteLink.bind(
              this._cluster.conn
            ),
            {
              link: CouchbaseRemoteAnalyticsLink._toCppData(
                new CouchbaseRemoteAnalyticsLink(
                  link as ICouchbaseRemoteAnalyticsLink
                )
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else if (link.linkType == AnalyticsLinkType.S3External) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkReplaceS3ExternalLink.bind(
              this._cluster.conn
            ),
            {
              link: S3ExternalAnalyticsLink._toCppData(
                new S3ExternalAnalyticsLink(link as IS3ExternalAnalyticsLink)
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else if (link.linkType == AnalyticsLinkType.AzureBlobExternal) {
        return PromiseHelper.wrapAsync(async () => {
          const [err, _] = await wrapObservableBindingCall(
            this._cluster.conn.managementAnalyticsLinkReplaceAzureBlobExternalLink.bind(
              this._cluster.conn
            ),
            {
              link: AzureExternalAnalyticsLink._toCppData(
                new AzureExternalAnalyticsLink(
                  link as IAzureExternalAnalyticsLink
                )
              ),
              timeout: timeout,
            },
            obsReqHandler
          )
          if (err) {
            obsReqHandler.endWithError(err)
            throw err
          }
          obsReqHandler.end()
        }, callback)
      } else {
        throw new Error('invalid link type')
      }
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Drops an existing analytics remote link.
   *
   * @param linkName The name of the link to drop.
   * @param dataverseName The dataverse containing the link to drop.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async dropLink(
    linkName: string,
    dataverseName: string,
    options?: DropAnalyticsLinkOptions,
    callback?: NodeCallback<void>
  ): Promise<void> {
    if (options instanceof Function) {
      callback = arguments[2]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkDrop,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, _] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsLinkDrop.bind(
            this._cluster.conn
          ),
          {
            dataverse_name: dataverseName,
            link_name: linkName,
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }

  /**
   * Returns a list of existing analytics remote links.
   *
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  async getAllLinks(
    options?: GetAllAnalyticsLinksOptions,
    callback?: NodeCallback<AnalyticsLink[]>
  ): Promise<AnalyticsLink[]> {
    if (options instanceof Function) {
      callback = arguments[0]
      options = undefined
    }
    if (!options) {
      options = {}
    }

    const obsReqHandler = new ObservableRequestHandler(
      AnalyticsMgmtOp.AnalyticsLinkGetAll,
      this.observabilityInstruments,
      options?.parentSpan
    )
    obsReqHandler.setRequestHttpAttributes()

    try {
      const dataverseName = options.dataverse
      const linkName = options.name
      const linkType = options.linkType
      const timeout = options.timeout || this._cluster.managementTimeout

      return PromiseHelper.wrapAsync(async () => {
        const [err, resp] = await wrapObservableBindingCall(
          this._cluster.conn.managementAnalyticsLinkGetAll.bind(
            this._cluster.conn
          ),
          {
            link_type: linkType,
            link_name: linkName,
            dataverse_name: dataverseName,
            timeout: timeout,
          },
          obsReqHandler
        )
        if (err) {
          obsReqHandler.endWithError(err)
          throw err
        }
        obsReqHandler.end()
        const links: AnalyticsLink[] = []
        resp.couchbase.forEach(
          (link: CppManagementAnalyticsCouchbaseRemoteLink) => {
            links.push(CouchbaseRemoteAnalyticsLink._fromCppData(link))
          }
        )
        resp.s3.forEach((link: CppManagementAnalyticsS3ExternalLink) => {
          links.push(S3ExternalAnalyticsLink._fromCppData(link))
        })
        resp.azure_blob.forEach(
          (link: CppManagementAnalyticsAzureBlobExternalLink) => {
            links.push(AzureExternalAnalyticsLink._fromCppData(link))
          }
        )
        return links
      }, callback)
    } catch (err) {
      obsReqHandler.endWithError(err)
      throw err
    }
  }
}


================================================
FILE: lib/analyticstypes.ts
================================================
import { RequestSpan } from './tracing'

/**
 * Represents the status of an analytics query.
 *
 * @category Analytics
 */
export enum AnalyticsStatus {
  /**
   * Indicates the query is still running.
   */
  Running = 'running',

  /**
   * Indicates that the query completed successfully.
   */
  Success = 'success',

  /**
   * Indicates that the query completed with errors.
   */
  Errors = 'errors',

  /**
   * Indicates that the query completed but the outcome was unknown.
   */
  Completed = 'completed',

  /**
   * Indicates that the query was stopped.
   */
  Stopped = 'stopped',

  /**
   * Indicates that the query timed out during execution.
   */
  Timeout = 'timeout',

  /**
   * Indicates that a connection was closed during execution of the query.
   */
  Closed = 'closed',

  /**
   * Indicates that the query stopped with fatal errors.
   */
  Fatal = 'fatal',

  /**
   * Indicates that the query was aborted while executing.
   */
  Aborted = 'aborted',

  /**
   * Indicates that the status of the query is unknown.
   */
  Unknown = 'unknown',
}

/**
 * Contains the results of an analytics query.
 *
 * @category Analytics
 */
export class AnalyticsResult<TRow = any> {
  /**
   * The rows which have been returned by the query.
   */
  rows: TRow[]

  /**
   * The meta-data which has been returned by the query.
   */
  meta: AnalyticsMetaData

  /**
   * @internal
   */
  constructor(data: AnalyticsResult) {
    this.rows = data.rows
    this.meta = data.meta
  }
}

/**
 * Contains the meta-data that is returend from an analytics query.
 *
 * @category Analytics
 */
export class AnalyticsMetaData {
  /**
   * The request ID which is associated with the executed query.
   */
  requestId: string

  /**
   * The client context id which is assoicated with the executed query.
   */
  clientContextId: string

  /**
   * The status of the query at the time the query meta-data was generated.
   */
  status: AnalyticsStatus

  /**
   * Provides the signature of the query.
   */
  signature?: any

  /**
   * Any warnings that occurred during the execution of the query.
   */
  warnings: AnalyticsWarning[]

  /**
   * Various metrics which are made available by the query engine.
   */
  metrics: AnalyticsMetrics

  /**
   * @internal
   */
  constructor(data: AnalyticsMetaData) {
    this.requestId = data.requestId
    this.clientContextId = data.clientContextId
    this.status = data.status
    this.signature = data.signature
    this.warnings = data.warnings
    this.metrics = data.metrics
  }
}

/**
 * Contains information about a warning which occurred during the
 * execution of an analytics query.
 *
 * @category Analytics
 */
export class AnalyticsWarning {
  /**
   * The numeric code associated with the warning which occurred.
   */
  code: number

  /**
   * A human readable representation of the warning which occurred.
   */
  message: string

  /**
   * @internal
   */
  constructor(data: AnalyticsWarning) {
    this.code = data.code
    this.message = data.message
  }
}

/**
 * Contains various metrics that are returned by the server following
 * the execution of an analytics query.
 *
 * @category Analytics
 */
export class AnalyticsMetrics {
  /**
   * The total amount of time spent running the query, in milliseconds.
   */
  elapsedTime: number

  /**
   * The total amount of time spent executing the query, in milliseconds.
   */
  executionTime: number

  /**
   * The total number of rows which were part of the result set.
   */
  resultCount: number

  /**
   * The total number of bytes which were generated as part of the result set.
   */
  resultSize: number

  /**
   * The total number of errors which were encountered during the execution of the query.
   */
  errorCount: number

  /**
   * The total number of objects that were processed as part of execution of the query.
   */
  processedObjects: number

  /**
   * The total number of warnings which were encountered during the execution of the query.
   */
  warningCount: number

  /**
   * @internal
   */
  constructor(data: AnalyticsMetrics) {
    this.elapsedTime = data.elapsedTime
    this.executionTime = data.executionTime
    this.resultCount = data.resultCount
    this.resultSize = data.resultSize
    this.errorCount = data.errorCount
    this.processedObjects = data.processedObjects
    this.warningCount = data.warningCount
  }
}

/**
 * Represents the various scan consistency options that are available when
 * querying against the analytics service.
 *
 * @category Analytics
 */
export enum AnalyticsScanConsistency {
  /**
   * Indicates that no specific consistency is required, this is the fastest
   * options, but results may not include the most recent operations which have
   * been performed.
   */
  NotBounded = 'not_bounded',

  /**
   * Indicates that the results to the query should include all operations that
   * have occurred up until the query was started.  This incurs a performance
   * penalty of waiting for the index to catch up to the most recent operations,
   * but provides the highest level of consistency.
   */
  RequestPlus = 'request_plus',
}

/**
 * @category Analytics
 */
export interface AnalyticsQueryOptions {
  /**
   * Values to be used for the placeholders within the query.
   */
  parameters?: { [key: string]: any } | any[]

  /**
   * Specifies the consistency requirements when executing the query.
   *
   * @see AnalyticsScanConsistency
   */
  scanConsistency?: AnalyticsScanConsistency

  /**
   * The returned client context id for this query.
   */
  clientContextId?: string

  /**
   * Indicates whether this query should be executed with a specific priority level.
   */
  priority?: boolean

  /**
   * Indicates whether this query should be executed in read-only mode.
   */
  readOnly?: boolean

  /**
   * Specifies the context within which this query should be executed.  This can be
   * scoped to a scope or a collection within the dataset.
   */
  queryContext?: string

  /**
   * Specifies any additional parameters which should be passed to the query engine
   * when executing the query.
   */
  raw?: { [key: string]: any }

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}


================================================
FILE: lib/authenticators.ts
================================================
/**
 * IPasswordAuthenticator specifies an authenticator which uses an RBAC
 * username and password to authenticate with the cluster.
 *
 * @category Authentication
 */
export interface IPasswordAuthenticator {
  /**
   * The username to authenticate with.
   */
  username: string

  /**
   * The password to authenticate with.
   */
  password: string

  /**
   * The sasl mechanisms to authenticate with.
   */
  allowed_sasl_mechanisms?: string[]
}

/**
 * IPasswordAuthenticator specifies an authenticator which uses an SSL
 * certificate and key to authenticate with the cluster.
 *
 * @category Authentication
 */
export interface ICertificateAuthenticator {
  /**
   * The path to the certificate which should be used for certificate authentication.
   */
  certificatePath: string

  /**
   * The path to the key which should be used for certificate authentication.
   */
  keyPath: string
}

/**
 * PasswordAuthenticator implements a simple IPasswordAuthenticator.
 *
 * @category Authentication
 */
export class PasswordAuthenticator implements IPasswordAuthenticator {
  /**
   * The username that will be used to authenticate with.
   */
  username: string

  /**
   * The password that will be used to authenticate with.
   */
  password: string

  /**
   * The sasl mechanisms to authenticate with.
   */
  allowed_sasl_mechanisms?: string[] | undefined

  /**
   * Constructs this PasswordAuthenticator with the passed username and password.
   *
   * @param username The username to initialize this authenticator with.
   * @param password The password to initialize this authenticator with.
   */
  constructor(username: string, password: string) {
    this.username = username
    this.password = password
  }

  /**
   * Creates a LDAP compatible password authenticator which is INSECURE if not used with TLS.
   *
   * Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers.
   * This should only be enabled in trusted environments.
   *
   * @param username The username to initialize this authenticator with.
   * @param password The password to initialize this authenticator with.
   */
  public static ldapCompatible(
    username: string,
    password: string
  ): PasswordAuthenticator {
    const auth = new PasswordAuthenticator(username, password)
    auth.allowed_sasl_mechanisms = ['PLAIN']
    return auth
  }
}

/**
 * CertificateAuthenticator implements a simple ICertificateAuthenticator.
 *
 * @category Authentication
 */
export class CertificateAuthenticator implements ICertificateAuthenticator {
  /**
   * The path to the certificate which should be used for certificate authentication.
   */
  certificatePath: string

  /**
   * The path to the key which should be used for certificate authentication.
   */
  keyPath: string

  /**
   * Constructs this CertificateAuthenticator with the passed certificate and key paths.
   *
   * @param certificatePath The certificate path to initialize this authenticator with.
   * @param keyPath The key path to initialize this authenticator with.
   */
  constructor(certificatePath: string, keyPath: string) {
    this.certificatePath = certificatePath
    this.keyPath = keyPath
  }
}

/**
 * IJwtAuthenticator specifies an authenticator which uses a JWT token
 * to authenticate with the cluster.
 *
 * @category Authentication
 *
 * Uncommitted: This API is subject to change in the future.
 */
export interface IJwtAuthenticator {
  /**
   * The token to authenticate with.
   */
  token: string
}

/**
 * JwtAuthenticator implements a simple IJwtAuthenticator.
 *
 * @category Authentication
 *
 * Uncommitted: This API is subject to change in the future.
 */
export class JwtAuthenticator implements IJwtAuthenticator {
  /**
   * The token that will be used to authenticate with.
   */
  token: string

  /**
   * Constructs this JwtAuthenticator with the passed token.
   *
   * @param token The token to initialize this authenticator with.
   */
  constructor(token: string) {
    this.token = token
  }
}

/**
 * Represents any of the valid authenticators that could be passed to the SDK.
 *
 * @category Authentication
 */
export type Authenticator =
  | IPasswordAuthenticator
  | ICertificateAuthenticator
  | IJwtAuthenticator


================================================
FILE: lib/binarycollection.ts
================================================
import { Collection } from './collection'
import { CounterResult, MutationResult } from './crudoptypes'
import { DurabilityLevel } from './generaltypes'
import { CasInput, NodeCallback } from './utilities'
import { RequestSpan } from './tracing'

/**
 * @category Key-Value
 */
export interface IncrementOptions {
  /**
   * The initial value to use for the document if it does not already exist.
   * Not specifying this value indicates the operation should fail if the
   * document does not exist.
   */
  initial?: number

  /**
   * Specifies the expiry time for the document.
   *
   * The expiry can be provided as:
   * - A `number` of seconds relative to the current time.
   * - A `Date` object for an absolute expiry time.
   *
   * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
   */
  expiry?: number | Date

  /**
   * Specifies the level of synchronous durability for this operation.
   */
  durabilityLevel?: DurabilityLevel

  /**
   * Specifies the number of nodes this operation should be persisted to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityPersistTo?: number

  /**
   * Specifies the number of nodes this operation should be replicated to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityReplicateTo?: number

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Key-Value
 */
export interface DecrementOptions {
  /**
   * The initial value to use for the document if it does not already exist.
   * Not specifying this value indicates the operation should fail if the
   * document does not exist.
   */
  initial?: number

  /**
   * Specifies the expiry time for the document.
   *
   * The expiry can be provided as:
   * - A `number` of seconds relative to the current time.
   * - A `Date` object for an absolute expiry time.
   *
   * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
   */
  expiry?: number | Date

  /**
   * Specifies the level of synchronous durability for this operation.
   */
  durabilityLevel?: DurabilityLevel

  /**
   * Specifies the number of nodes this operation should be persisted to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityPersistTo?: number

  /**
   * Specifies the number of nodes this operation should be replicated to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityReplicateTo?: number

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Key-Value
 */
export interface AppendOptions {
  /**
   * Specifies the level of synchronous durability for this operation.
   */
  durabilityLevel?: DurabilityLevel

  /**
   * Specifies the number of nodes this operation should be persisted to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityPersistTo?: number

  /**
   * Specifies the number of nodes this operation should be replicated to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityReplicateTo?: number

  /**
   * If specified, indicates that operation should be failed if the CAS
   * has changed from this value, indicating that the document has changed.
   */
  cas?: CasInput

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * @category Key-Value
 */
export interface PrependOptions {
  /**
   * Specifies the level of synchronous durability for this operation.
   */
  durabilityLevel?: DurabilityLevel

  /**
   * Specifies the number of nodes this operation should be persisted to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityPersistTo?: number

  /**
   * Specifies the number of nodes this operation should be replicated to
   * before it is considered successful.  Note that this option is mutually
   * exclusive of {@link durabilityLevel}.
   */
  durabilityReplicateTo?: number

  /**
   * If specified, indicates that operation should be failed if the CAS
   * has changed from this value, indicating that the document has changed.
   */
  cas?: CasInput

  /**
   * The timeout for this operation, represented in milliseconds.
   */
  timeout?: number

  /**
   * Specifies the parent span for this specific operation.
   */
  parentSpan?: RequestSpan
}

/**
 * Exposes a number of binary-level operations against a collection.
 * These operations do not adhere to the standard JSON-centric
 * behaviour of the SDK.
 *
 * @category Core
 */
export class BinaryCollection {
  private _coll: Collection

  /**
   * @internal
   */
  constructor(parent: Collection) {
    this._coll = parent
  }

  /**
   * Increments the ASCII value of the specified key by the amount
   * indicated in the delta parameter.
   *
   * @param key The key to increment.
   * @param delta The amount to increment the key.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  increment(
    key: string,
    delta: number,
    options?: IncrementOptions,
    callback?: NodeCallback<CounterResult>
  ): Promise<CounterResult> {
    return this._coll._binaryIncrement(key, delta, options, callback)
  }

  /**
   * Decrements the ASCII value of the specified key by the amount
   * indicated in the delta parameter.
   *
   * @param key The key to increment.
   * @param delta The amount to increment the key.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  decrement(
    key: string,
    delta: number,
    options?: DecrementOptions,
    callback?: NodeCallback<CounterResult>
  ): Promise<CounterResult> {
    return this._coll._binaryDecrement(key, delta, options, callback)
  }

  /**
   * Appends the specified value to the end of the specified key.
   *
   * @param key The key to append to.
   * @param value The value to adjoin to the end of the document.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  append(
    key: string,
    value: string | Buffer,
    options?: AppendOptions,
    callback?: NodeCallback<MutationResult>
  ): Promise<MutationResult> {
    return this._coll._binaryAppend(key, value, options, callback)
  }

  /**
   * Prepends the specified value to the beginning of the specified key.
   *
   * @param key The key to prepend to.
   * @param value The value to adjoin to the beginning of the document.
   * @param options Optional parameters for this operation.
   * @param callback A node-style callback to be invoked after execution.
   */
  prepend(
    key: string,
    value: string | Buffer,
    options?: PrependOptions,
    callback?: NodeCallback<MutationResult>
  ): Promise<MutationResult> {
    return this._coll._binaryPrepend(key, value, options, callback)
  }
}


================================================
FILE: lib/binding.ts
================================================
/*
eslint
jsdoc/require-jsdoc: off,
@typescript-eslint/no-empty-interface: off
*/
import path from 'path'

// TODO(Brett19): Check which of these is actually needed...
export type CppMilliseconds = number
export type CppSeconds = number
export type CppBytes = string | Buffer
export type CppDocFlags = number
export type CppExpiry = number

export type CppJsonString = string | Buffer

export interface CppClusterCredentials {
  username?: string
  password?: string
  certificate_path?: string
  key_path?: string
  allowed_sasl_mechanisms?: string[]
  jwt_token?: string
}

export interface CppDnsConfig {
  nameserver?: string
  port?: number
  dnsSrvTimeout?: number
}

export interface CppAppTelemetryConfig {
  enabled?: boolean
  endpoint?: string
  backoff?: number
  pingInterval?: number
  pingTimeout?: number
}

export interface CppOrphanReporterConfig {
  emitInterval?: number
  sampleSize?: number
}

export interface CppDocumentId {
  bucket: string
  scope: string
  collection: string
  key: string
}

export interface CppCas {
  toString(): string
  toJSON(): any
}

export const zeroCas = 0 as any as CppCas

export type CppCasInput = CppCas | string | Buffer

export interface CppMutationToken {
  toString(): string
  toJSON(): any
}

export interface CppQueryContext {
  bucket_name: string
  scope_name: string
}

export interface CppScanIterator {
  cancelled: boolean

  next(
    callback: (
      err: CppError | null,
      result: CppRangeScanItem | undefined
    ) => void
  ): void
  cancel(): boolean
}

export interface CppEncodedValue {
  data: Buffer
  flags: number
}

// high resolution (e.g. process.hrtime())
export type HiResTime = [number, number]

export interface CppWrapperSdkSpan {
  attributes: { [key: string]: number | string }
  children?: CppWrapperSdkChildSpan[]
}

export interface CppWrapperSdkChildSpan {
  name: string
  start: HiResTime
  end: HiResTime
  attributes: { [key: string]: number | string }
  children?: CppWrapperSdkChildSpan[]
}

export interface CppObservableRequest {
  wrapper_span_name?: string
}

export interface CppObservableResponse {
  cpp_core_span?: CppWrapperSdkSpan
}

export type ObservableBindingFunc<
  TReq extends CppObservableRequests,
  TResp extends CppObservableResponse,
> = (req: TReq, cb: (err: CppError | null, res: TResp) => void) => void

export interface CppClusterLabelsResponse {
  clusterName?: string
  clusterUUID?: string
}

//#region Autogenerated Bindings

export enum CppManagementAnalyticsCouchbaseLinkEncryptionLevel {}
export enum CppManagementClusterBucketType {}
export enum CppManagementClusterBucketCompression {}
export enum CppManagementClusterBucketEvictionPolicy {}
export enum CppManagementClusterBucketConflictResolution {}
export enum CppManagementClusterBucketStorageBackend {}
export enum CppManagementEventingFunctionDcpBoundary {}
export enum CppManagementEventingFunctionLanguageCompatibility {}
export enum CppManagementEventingFunctionLogLevel {}
export enum CppManagementEventingFunctionBucketAccess {}
export enum CppManagementEventingFunctionStatus {}
export enum CppManagementEventingFunctionDeploymentStatus {}
export enum CppManagementEventingFunctionProcessingStatus {}
export enum CppManagementRbacAuthDomain {}
export enum CppRetryReason {}
export enum CppProtocolSubdocOpcode {}
export enum CppAnalyticsScanConsistency {}
export enum CppDesignDocumentNamespace {}
export enum CppDiagClusterState {}
export enum CppDiagEndpointState {}
export enum CppDiagPingState {}
export enum CppQueryProfile {}
export enum CppQueryScanConsistency {}
export enum CppSearchHighlightStyle {}
export enum CppSearchScanConsistency {}
export enum CppServiceType {}
export enum CppViewOnError {}
export enum CppViewScanConsistency {}
export enum CppViewSortOrder {}
export enum CppAnalyticsResponseAnalyticsStatus {}
export enum CppDurabilityLevel {}
export enum CppErrcCommon {}
export enum CppErrcKeyValue {}
export enum CppErrcQuery {}
export enum CppErrcAnalytics {}
export enum CppErrcSearch {}
export enum CppErrcView {}
export enum CppErrcManagement {}
export enum CppErrcFieldLevelEncryption {}
export enum CppErrcNetwork {}
export enum CppKeyValueStatusCode {}
export enum CppImplSubdocOpcode {}
export enum CppStoreSemantics {}
export enum CppPersistTo {}
export enum CppReplicateTo {}
export enum CppReadPreference {}
export enum CppVectorQueryCombination {}
export enum CppTransactionsFailureType {}
export enum CppTransactionsExternalException {}
export enum CppTransactionsTransactionGetMultiMode {}
export enum CppTransactionsTransactionGetMultiReplicasFromPreferredServerGroupMode {}

export interface CppManagementAnalyticsDataset {
  name: string
  dataverse_name: string
  link_name: string
  bucket_name: string
}
export interface CppManagementAnalyticsIndex {
  name: string
  dataverse_name: string
  dataset_name: string
  is_primary: boolean
}
export interface CppManagementAnalyticsAzureBlobExternalLink {
  link_name: string
  dataverse: string
  connection_string?: string
  account_name?: string
  account_key?: string
  shared_access_signature?: string
  blob_endpoint?: string
  endpoint_suffix?: string
}
export interface CppManagementAnalyticsCouchbaseLinkEncryptionSettings {
  level: CppManagementAnalyticsCouchbaseLinkEncryptionLevel
  certificate?: string
  client_certificate?: string
  client_key?: string
}
export interface CppManagementAnalyticsCouchbaseRemoteLink {
  link_name: string
  dataverse: string
  hostname: string
  username?: string
Download .txt
gitextract_4ye31yx3/

├── .clang-format
├── .editorconfig
├── .gitignore
├── .gitmodules
├── .istanbul.yml
├── .npmignore
├── .prettierrc
├── BUILDING.md
├── CMakeLists.txt
├── CONTRIBUTING.md
├── LICENSE
├── LOGGING.md
├── Makefile
├── README.md
├── couchbase-sdk-nodejs-black-duck-manifest.yaml
├── eslint.config.mjs
├── examples/
│   └── observability/
│       ├── combined/
│       │   ├── docker-compose.yml
│       │   ├── otel-collector-config.yml
│       │   ├── otel-otlp-metrics-and-tracing.js
│       │   ├── otel-otlp-metrics-and-tracing.ts
│       │   └── prometheus.yml
│       ├── metrics/
│       │   ├── docker-compose.yml
│       │   ├── otel-collector-config.yml
│       │   ├── otel-otlp-metrics-exporter.ts
│       │   └── prometheus.yml
│       └── tracing/
│           ├── console/
│           │   ├── otel-console-exporter.js
│           │   └── otel-console-exporter.ts
│           └── jaeger/
│               ├── docker-compose.yml
│               └── otel-otlp-tracing-exporter.ts
├── lib/
│   ├── analyticsexecutor.ts
│   ├── analyticsindexmanager.ts
│   ├── analyticstypes.ts
│   ├── authenticators.ts
│   ├── binarycollection.ts
│   ├── binding.ts
│   ├── bindingutilities.ts
│   ├── bucket.ts
│   ├── bucketmanager.ts
│   ├── cluster.ts
│   ├── collection.ts
│   ├── collectionmanager.ts
│   ├── configProfile.ts
│   ├── connspec.ts
│   ├── couchbase.ts
│   ├── crudoptypes.ts
│   ├── datastructures.ts
│   ├── diagnosticsexecutor.ts
│   ├── diagnosticstypes.ts
│   ├── errorcontexts.ts
│   ├── errors.ts
│   ├── eventingfunctionmanager.ts
│   ├── generaltypes.ts
│   ├── httpexecutor.ts
│   ├── logger.ts
│   ├── loggingmeter.ts
│   ├── metrics.ts
│   ├── mutationstate.ts
│   ├── observability.ts
│   ├── observabilityhandler.ts
│   ├── observabilitytypes.ts
│   ├── observabilityutilities.ts
│   ├── otelmeter.ts
│   ├── oteltracer.ts
│   ├── queryexecutor.ts
│   ├── queryindexmanager.ts
│   ├── querytypes.ts
│   ├── rangeScan.ts
│   ├── scope.ts
│   ├── scopeeventingfunctionmanager.ts
│   ├── scopesearchindexmanager.ts
│   ├── sdspecs.ts
│   ├── sdutils.ts
│   ├── searchexecutor.ts
│   ├── searchfacet.ts
│   ├── searchindexmanager.ts
│   ├── searchquery.ts
│   ├── searchsort.ts
│   ├── searchtypes.ts
│   ├── streamablepromises.ts
│   ├── thresholdlogging.ts
│   ├── tracing.ts
│   ├── transactions.ts
│   ├── transcoders.ts
│   ├── usermanager.ts
│   ├── utilities.ts
│   ├── utilities_internal.ts
│   ├── vectorsearch.ts
│   ├── version.ts
│   ├── viewexecutor.ts
│   ├── viewindexmanager.ts
│   └── viewtypes.ts
├── package.json
├── scripts/
│   ├── buildPrebuild.js
│   ├── install.js
│   ├── prebuilds.js
│   ├── prune.js
│   └── updateVersion.js
├── src/
│   ├── addondata.cpp
│   ├── addondata.hpp
│   ├── binding.cpp
│   ├── cas.cpp
│   ├── cas.hpp
│   ├── connection.cpp
│   ├── connection.hpp
│   ├── connection_autogen.cpp
│   ├── constants.cpp
│   ├── constants.hpp
│   ├── instance.cpp
│   ├── instance.hpp
│   ├── jstocbpp.hpp
│   ├── jstocbpp_autogen.hpp
│   ├── jstocbpp_basic.hpp
│   ├── jstocbpp_cpptypes.hpp
│   ├── jstocbpp_defs.hpp
│   ├── jstocbpp_errors.hpp
│   ├── jstocbpp_transactions.hpp
│   ├── mutationtoken.cpp
│   ├── mutationtoken.hpp
│   ├── scan_iterator.cpp
│   ├── scan_iterator.hpp
│   ├── transaction.cpp
│   ├── transaction.hpp
│   ├── transactions.cpp
│   ├── transactions.hpp
│   └── utils.hpp
├── test/
│   ├── analytics.test.js
│   ├── analyticslinks.test.js
│   ├── bucketmanager.test.js
│   ├── cluster.test.js
│   ├── collectionmanager.test.js
│   ├── connspec.test.js
│   ├── consistencyutil.js
│   ├── crud.test.js
│   ├── data/
│   │   ├── search_index.json
│   │   ├── test_vector.json
│   │   ├── test_vector_search_docs.json
│   │   └── vector_search_index.json
│   ├── datastructures.test.js
│   ├── diag.test.js
│   ├── errors.test.js
│   ├── eventing.test.js
│   ├── expiry.test.js
│   ├── harness.js
│   ├── jcbmock.js
│   ├── loggingmeter.test.js
│   ├── management.test.js
│   ├── metrics/
│   │   ├── metertypes.js
│   │   └── validators.js
│   ├── metricsdatastructures.test.js
│   ├── metricskv.test.js
│   ├── metricsmgmt.test.js
│   ├── metricsstreaming.test.js
│   ├── n1ql.test.js
│   ├── rangescan.test.js
│   ├── sdutils.test.js
│   ├── search.test.js
│   ├── streamablepromise.test.js
│   ├── testdata.js
│   ├── thresholdlogging.test.js
│   ├── tracing/
│   │   ├── tracingtypes.js
│   │   └── validators.js
│   ├── tracingdatastructures.test.js
│   ├── tracingkv.test.js
│   ├── tracingmgmt.test.js
│   ├── tracingstreaming.test.js
│   ├── transactions.test.js
│   ├── transcoder.test.js
│   ├── users.test.js
│   ├── utilities.test.js
│   ├── views.test.js
│   ├── workerthread.test.js
│   └── workerthread.worker.js
├── tools/
│   ├── gen-bindings-js.js
│   └── gen-bindings-json.py
├── tsconfig.json
└── typedoc.json
Download .txt
Showing preview only (308K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3531 symbols across 134 files)

FILE: examples/observability/combined/otel-otlp-metrics-and-tracing.js
  constant SERVICE_NAME (line 71) | const SERVICE_NAME = 'couchbase-otel-combined-example-js'
  constant OTLP_ENDPOINT (line 72) | const OTLP_ENDPOINT = 'http://localhost:4317' // Both traces and metrics...
  constant CONNECTION_STRING (line 73) | const CONNECTION_STRING = 'couchbase://localhost'
  constant BUCKET_NAME (line 74) | const BUCKET_NAME = 'default'
  constant USERNAME (line 75) | const USERNAME = 'Administrator'
  constant PASSWORD (line 76) | const PASSWORD = 'password'
  function setupOtelTracing (line 78) | function setupOtelTracing(resource) {
  function setupOtelMetrics (line 94) | function setupOtelMetrics(resource) {
  function printBanner (line 113) | function printBanner() {
  function performOperations (line 119) | async function performOperations(collection, cluster) {
  function performOperationsWithParent (line 177) | async function performOperationsWithParent(collection, cluster, cbTracer) {
  function main (line 230) | async function main() {

FILE: examples/observability/combined/otel-otlp-metrics-and-tracing.ts
  constant SERVICE_NAME (line 77) | const SERVICE_NAME = 'couchbase-otel-combined-example'
  constant OTLP_ENDPOINT (line 78) | const OTLP_ENDPOINT = 'http://localhost:4317' // Both traces and metrics...
  constant CONNECTION_STRING (line 79) | const CONNECTION_STRING = 'couchbase://localhost'
  constant BUCKET_NAME (line 80) | const BUCKET_NAME = 'default'
  constant USERNAME (line 81) | const USERNAME = 'Administrator'
  constant PASSWORD (line 82) | const PASSWORD = 'password'
  function setupOtelTracing (line 84) | function setupOtelTracing(resource: Resource): NodeTracerProvider {
  function setupOtelMetrics (line 100) | function setupOtelMetrics(resource: Resource): MeterProvider {
  function printBanner (line 119) | function printBanner() {
  function performOperations (line 125) | async function performOperations(collection: any, cluster: any) {
  function performOperationsWithParent (line 173) | async function performOperationsWithParent(
  function main (line 232) | async function main() {

FILE: examples/observability/metrics/otel-otlp-metrics-exporter.ts
  constant SERVICE_NAME (line 54) | const SERVICE_NAME = 'couchbase-otel-metrics-example'
  constant METRICS_ENDPOINT (line 55) | const METRICS_ENDPOINT = 'http://localhost:4317'
  constant CONNECTION_STRING (line 56) | const CONNECTION_STRING = 'couchbase://localhost'
  constant BUCKET_NAME (line 57) | const BUCKET_NAME = 'default'
  constant USERNAME (line 58) | const USERNAME = 'Administrator'
  constant PASSWORD (line 59) | const PASSWORD = 'password'
  function setupOtelMetrics (line 61) | function setupOtelMetrics(): MeterProvider {
  function printBanner (line 84) | function printBanner(): void {
  function performOperations (line 90) | async function performOperations(collection: any, cluster: any): Promise...
  function main (line 173) | async function main(): Promise<void> {

FILE: examples/observability/tracing/console/otel-console-exporter.js
  constant SERVICE_NAME (line 21) | const SERVICE_NAME = 'couchbase-otel-tracing-example-js'
  constant CONNECTION_STRING (line 22) | const CONNECTION_STRING = 'couchbase://localhost'
  constant BUCKET_NAME (line 23) | const BUCKET_NAME = 'default'
  constant USERNAME (line 24) | const USERNAME = 'Administrator'
  constant PASSWORD (line 25) | const PASSWORD = 'password'
  function setupOtelConsoleExporter (line 27) | function setupOtelConsoleExporter() {
  function main (line 51) | async function main() {

FILE: examples/observability/tracing/console/otel-console-exporter.ts
  constant SERVICE_NAME (line 21) | const SERVICE_NAME = 'couchbase-otel-tracing-example'
  constant CONNECTION_STRING (line 22) | const CONNECTION_STRING = 'couchbase://localhost'
  constant BUCKET_NAME (line 23) | const BUCKET_NAME = 'default'
  constant USERNAME (line 24) | const USERNAME = 'Administrator'
  constant PASSWORD (line 25) | const PASSWORD = 'password'
  function setupOtelConsoleExporter (line 27) | function setupOtelConsoleExporter(): NodeTracerProvider {
  function main (line 51) | async function main() {

FILE: examples/observability/tracing/jaeger/otel-otlp-tracing-exporter.ts
  constant SERVICE_NAME (line 56) | const SERVICE_NAME = 'couchbase-otel-tracing-example'
  constant TRACING_ENDPOINT (line 57) | const TRACING_ENDPOINT = 'http://localhost:4317'
  constant CONNECTION_STRING (line 58) | const CONNECTION_STRING = 'couchbase://192.168.107.128'
  constant BUCKET_NAME (line 59) | const BUCKET_NAME = 'default'
  constant USERNAME (line 60) | const USERNAME = 'Administrator'
  constant PASSWORD (line 61) | const PASSWORD = 'password'
  function setupOtelTracing (line 63) | function setupOtelTracing(): NodeTracerProvider {
  function printBanner (line 91) | function printBanner(): void {
  function performOperations (line 97) | async function performOperations(collection: any, cluster: any): Promise...
  function main (line 181) | async function main(): Promise<void> {

FILE: lib/analyticsexecutor.ts
  class AnalyticsExecutor (line 24) | class AnalyticsExecutor {
    method constructor (line 30) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 37) | get observabilityInstruments(): ObservabilityInstruments {
    method _processAnalyticsResponse (line 44) | static _processAnalyticsResponse<TRow>(
    method executePromise (line 113) | static executePromise<TRow = any>(
    method query (line 144) | query<TRow = any>(

FILE: lib/analyticsindexmanager.ts
  type AnalyticsLinkType (line 25) | enum AnalyticsLinkType {
  type AnalyticsEncryptionLevel (line 47) | enum AnalyticsEncryptionLevel {
  class AnalyticsDataset (line 69) | class AnalyticsDataset {
    method constructor (line 93) | constructor(data: AnalyticsDataset) {
  class AnalyticsIndex (line 106) | class AnalyticsIndex {
    method constructor (line 130) | constructor(data: AnalyticsIndex) {
  type ICouchbaseAnalyticsEncryptionSettings (line 141) | interface ICouchbaseAnalyticsEncryptionSettings {
  class CouchbaseAnalyticsEncryptionSettings (line 169) | class CouchbaseAnalyticsEncryptionSettings
    method constructor (line 198) | constructor(data: CouchbaseAnalyticsEncryptionSettings) {
  type IAnalyticsLink (line 211) | interface IAnalyticsLink {
  method constructor (line 235) | constructor() {
  method _toHttpData (line 264) | static _toHttpData(data: IAnalyticsLink): any {
  method _fromHttpData (line 285) | static _fromHttpData(data: any): AnalyticsLink {
  type ICouchbaseRemoteAnalyticsLink (line 301) | interface ICouchbaseRemoteAnalyticsLink extends IAnalyticsLink {
  class CouchbaseRemoteAnalyticsLink (line 345) | class CouchbaseRemoteAnalyticsLink
    method validate (line 391) | validate(): void {
    method constructor (line 454) | constructor(data: ICouchbaseRemoteAnalyticsLink) {
    method _toCppData (line 469) | static _toCppData(
    method _fromCppData (line 486) | static _fromCppData(
  type IS3ExternalAnalyticsLink (line 504) | interface IS3ExternalAnalyticsLink extends IAnalyticsLink {
  class S3ExternalAnalyticsLink (line 550) | class S3ExternalAnalyticsLink
    method constructor (line 598) | constructor(data: IS3ExternalAnalyticsLink) {
    method validate (line 614) | validate(): void {
    method _toCppData (line 649) | static _toCppData(
    method _fromCppData (line 667) | static _fromCppData(
  type IAzureExternalAnalyticsLink (line 686) | interface IAzureExternalAnalyticsLink extends IAnalyticsLink {
  class AzureExternalAnalyticsLink (line 736) | class AzureExternalAnalyticsLink
    method constructor (line 788) | constructor(data: IAzureExternalAnalyticsLink) {
    method validate (line 805) | validate(): void {
    method _toCppData (line 837) | static _toCppData(
    method _fromCppData (line 856) | static _fromCppData(
  type CreateAnalyticsDataverseOptions (line 876) | interface CreateAnalyticsDataverseOptions {
  type DropAnalyticsDataverseOptions (line 897) | interface DropAnalyticsDataverseOptions {
  type CreateAnalyticsDatasetOptions (line 918) | interface CreateAnalyticsDatasetOptions {
  type DropAnalyticsDatasetOptions (line 949) | interface DropAnalyticsDatasetOptions {
  type GetAllAnalyticsDatasetsOptions (line 975) | interface GetAllAnalyticsDatasetsOptions {
  type CreateAnalyticsIndexOptions (line 990) | interface CreateAnalyticsIndexOptions {
  type DropAnalyticsIndexOptions (line 1016) | interface DropAnalyticsIndexOptions {
  type GetAllAnalyticsIndexesOptions (line 1042) | interface GetAllAnalyticsIndexesOptions {
  type ConnectAnalyticsLinkOptions (line 1057) | interface ConnectAnalyticsLinkOptions {
  type DisconnectAnalyticsLinkOptions (line 1087) | interface DisconnectAnalyticsLinkOptions {
  type GetPendingAnalyticsMutationsOptions (line 1112) | interface GetPendingAnalyticsMutationsOptions {
  type CreateAnalyticsLinkOptions (line 1127) | interface CreateAnalyticsLinkOptions {
  type ReplaceAnalyticsLinkOptions (line 1142) | interface ReplaceAnalyticsLinkOptions {
  type DropAnalyticsLinkOptions (line 1157) | interface DropAnalyticsLinkOptions {
  type GetAllAnalyticsLinksOptions (line 1172) | interface GetAllAnalyticsLinksOptions {
  class AnalyticsIndexManager (line 1205) | class AnalyticsIndexManager {
    method constructor (line 1211) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 1218) | get observabilityInstruments(): ObservabilityInstruments {
    method createDataverse (line 1229) | async createDataverse(
    method dropDataverse (line 1284) | async dropDataverse(
    method createDataset (line 1340) | async createDataset(
    method dropDataset (line 1400) | async dropDataset(
    method getAllDatasets (line 1456) | async getAllDatasets(
    method createIndex (line 1518) | async createIndex(
    method dropIndex (line 1580) | async dropIndex(
    method getAllIndexes (line 1638) | async getAllIndexes(
    method connectLink (line 1718) | async connectLink(): Promise<void> {
    method _connectLinkDeprecated (line 1734) | async _connectLinkDeprecated(
    method _connectLink (line 1778) | async _connectLink(
    method disconnectLink (line 1855) | async disconnectLink(): Promise<void> {
    method _disconnectLinkDeprecated (line 1871) | async _disconnectLinkDeprecated(
    method _disconnectLink (line 1908) | async _disconnectLink(
    method getPendingMutations (line 1962) | async getPendingMutations(
    method createLink (line 2014) | async createLink(
    method replaceLink (line 2117) | async replaceLink(
    method dropLink (line 2221) | async dropLink(
    method getAllLinks (line 2275) | async getAllLinks(

FILE: lib/analyticstypes.ts
  type AnalyticsStatus (line 8) | enum AnalyticsStatus {
  class AnalyticsResult (line 65) | class AnalyticsResult<TRow = any> {
    method constructor (line 79) | constructor(data: AnalyticsResult) {
  class AnalyticsMetaData (line 90) | class AnalyticsMetaData {
    method constructor (line 124) | constructor(data: AnalyticsMetaData) {
  class AnalyticsWarning (line 140) | class AnalyticsWarning {
    method constructor (line 154) | constructor(data: AnalyticsWarning) {
  class AnalyticsMetrics (line 166) | class AnalyticsMetrics {
    method constructor (line 205) | constructor(data: AnalyticsMetrics) {
  type AnalyticsScanConsistency (line 222) | enum AnalyticsScanConsistency {
  type AnalyticsQueryOptions (line 242) | interface AnalyticsQueryOptions {

FILE: lib/authenticators.ts
  type IPasswordAuthenticator (line 7) | interface IPasswordAuthenticator {
  type ICertificateAuthenticator (line 30) | interface ICertificateAuthenticator {
  class PasswordAuthenticator (line 47) | class PasswordAuthenticator implements IPasswordAuthenticator {
    method constructor (line 69) | constructor(username: string, password: string) {
    method ldapCompatible (line 83) | public static ldapCompatible(
  class CertificateAuthenticator (line 98) | class CertificateAuthenticator implements ICertificateAuthenticator {
    method constructor (line 115) | constructor(certificatePath: string, keyPath: string) {
  type IJwtAuthenticator (line 129) | interface IJwtAuthenticator {
  class JwtAuthenticator (line 143) | class JwtAuthenticator implements IJwtAuthenticator {
    method constructor (line 154) | constructor(token: string) {
  type Authenticator (line 164) | type Authenticator =

FILE: lib/binarycollection.ts
  type IncrementOptions (line 10) | interface IncrementOptions {
  type DecrementOptions (line 62) | interface DecrementOptions {
  type AppendOptions (line 114) | interface AppendOptions {
  type PrependOptions (line 154) | interface PrependOptions {
  class BinaryCollection (line 198) | class BinaryCollection {
    method constructor (line 204) | constructor(parent: Collection) {
    method increment (line 217) | increment(
    method decrement (line 235) | decrement(
    method append (line 252) | append(
    method prepend (line 269) | prepend(

FILE: lib/binding.ts
  type CppMilliseconds (line 9) | type CppMilliseconds = number
  type CppSeconds (line 10) | type CppSeconds = number
  type CppBytes (line 11) | type CppBytes = string | Buffer
  type CppDocFlags (line 12) | type CppDocFlags = number
  type CppExpiry (line 13) | type CppExpiry = number
  type CppJsonString (line 15) | type CppJsonString = string | Buffer
  type CppClusterCredentials (line 17) | interface CppClusterCredentials {
  type CppDnsConfig (line 26) | interface CppDnsConfig {
  type CppAppTelemetryConfig (line 32) | interface CppAppTelemetryConfig {
  type CppOrphanReporterConfig (line 40) | interface CppOrphanReporterConfig {
  type CppDocumentId (line 45) | interface CppDocumentId {
  type CppCas (line 52) | interface CppCas {
  type CppCasInput (line 59) | type CppCasInput = CppCas | string | Buffer
  type CppMutationToken (line 61) | interface CppMutationToken {
  type CppQueryContext (line 66) | interface CppQueryContext {
  type CppScanIterator (line 71) | interface CppScanIterator {
  type CppEncodedValue (line 83) | interface CppEncodedValue {
  type HiResTime (line 89) | type HiResTime = [number, number]
  type CppWrapperSdkSpan (line 91) | interface CppWrapperSdkSpan {
  type CppWrapperSdkChildSpan (line 96) | interface CppWrapperSdkChildSpan {
  type CppObservableRequest (line 104) | interface CppObservableRequest {
  type CppObservableResponse (line 108) | interface CppObservableResponse {
  type ObservableBindingFunc (line 112) | type ObservableBindingFunc<
  type CppClusterLabelsResponse (line 117) | interface CppClusterLabelsResponse {
  type CppManagementAnalyticsCouchbaseLinkEncryptionLevel (line 124) | enum CppManagementAnalyticsCouchbaseLinkEncryptionLevel {}
  type CppManagementClusterBucketType (line 125) | enum CppManagementClusterBucketType {}
  type CppManagementClusterBucketCompression (line 126) | enum CppManagementClusterBucketCompression {}
  type CppManagementClusterBucketEvictionPolicy (line 127) | enum CppManagementClusterBucketEvictionPolicy {}
  type CppManagementClusterBucketConflictResolution (line 128) | enum CppManagementClusterBucketConflictResolution {}
  type CppManagementClusterBucketStorageBackend (line 129) | enum CppManagementClusterBucketStorageBackend {}
  type CppManagementEventingFunctionDcpBoundary (line 130) | enum CppManagementEventingFunctionDcpBoundary {}
  type CppManagementEventingFunctionLanguageCompatibility (line 131) | enum CppManagementEventingFunctionLanguageCompatibility {}
  type CppManagementEventingFunctionLogLevel (line 132) | enum CppManagementEventingFunctionLogLevel {}
  type CppManagementEventingFunctionBucketAccess (line 133) | enum CppManagementEventingFunctionBucketAccess {}
  type CppManagementEventingFunctionStatus (line 134) | enum CppManagementEventingFunctionStatus {}
  type CppManagementEventingFunctionDeploymentStatus (line 135) | enum CppManagementEventingFunctionDeploymentStatus {}
  type CppManagementEventingFunctionProcessingStatus (line 136) | enum CppManagementEventingFunctionProcessingStatus {}
  type CppManagementRbacAuthDomain (line 137) | enum CppManagementRbacAuthDomain {}
  type CppRetryReason (line 138) | enum CppRetryReason {}
  type CppProtocolSubdocOpcode (line 139) | enum CppProtocolSubdocOpcode {}
  type CppAnalyticsScanConsistency (line 140) | enum CppAnalyticsScanConsistency {}
  type CppDesignDocumentNamespace (line 141) | enum CppDesignDocumentNamespace {}
  type CppDiagClusterState (line 142) | enum CppDiagClusterState {}
  type CppDiagEndpointState (line 143) | enum CppDiagEndpointState {}
  type CppDiagPingState (line 144) | enum CppDiagPingState {}
  type CppQueryProfile (line 145) | enum CppQueryProfile {}
  type CppQueryScanConsistency (line 146) | enum CppQueryScanConsistency {}
  type CppSearchHighlightStyle (line 147) | enum CppSearchHighlightStyle {}
  type CppSearchScanConsistency (line 148) | enum CppSearchScanConsistency {}
  type CppServiceType (line 149) | enum CppServiceType {}
  type CppViewOnError (line 150) | enum CppViewOnError {}
  type CppViewScanConsistency (line 151) | enum CppViewScanConsistency {}
  type CppViewSortOrder (line 152) | enum CppViewSortOrder {}
  type CppAnalyticsResponseAnalyticsStatus (line 153) | enum CppAnalyticsResponseAnalyticsStatus {}
  type CppDurabilityLevel (line 154) | enum CppDurabilityLevel {}
  type CppErrcCommon (line 155) | enum CppErrcCommon {}
  type CppErrcKeyValue (line 156) | enum CppErrcKeyValue {}
  type CppErrcQuery (line 157) | enum CppErrcQuery {}
  type CppErrcAnalytics (line 158) | enum CppErrcAnalytics {}
  type CppErrcSearch (line 159) | enum CppErrcSearch {}
  type CppErrcView (line 160) | enum CppErrcView {}
  type CppErrcManagement (line 161) | enum CppErrcManagement {}
  type CppErrcFieldLevelEncryption (line 162) | enum CppErrcFieldLevelEncryption {}
  type CppErrcNetwork (line 163) | enum CppErrcNetwork {}
  type CppKeyValueStatusCode (line 164) | enum CppKeyValueStatusCode {}
  type CppImplSubdocOpcode (line 165) | enum CppImplSubdocOpcode {}
  type CppStoreSemantics (line 166) | enum CppStoreSemantics {}
  type CppPersistTo (line 167) | enum CppPersistTo {}
  type CppReplicateTo (line 168) | enum CppReplicateTo {}
  type CppReadPreference (line 169) | enum CppReadPreference {}
  type CppVectorQueryCombination (line 170) | enum CppVectorQueryCombination {}
  type CppTransactionsFailureType (line 171) | enum CppTransactionsFailureType {}
  type CppTransactionsExternalException (line 172) | enum CppTransactionsExternalException {}
  type CppTransactionsTransactionGetMultiMode (line 173) | enum CppTransactionsTransactionGetMultiMode {}
  type CppTransactionsTransactionGetMultiReplicasFromPreferredServerGroupMode (line 174) | enum CppTransactionsTransactionGetMultiReplicasFromPreferredServerGroupM...
  type CppManagementAnalyticsDataset (line 176) | interface CppManagementAnalyticsDataset {
  type CppManagementAnalyticsIndex (line 182) | interface CppManagementAnalyticsIndex {
  type CppManagementAnalyticsAzureBlobExternalLink (line 188) | interface CppManagementAnalyticsAzureBlobExternalLink {
  type CppManagementAnalyticsCouchbaseLinkEncryptionSettings (line 198) | interface CppManagementAnalyticsCouchbaseLinkEncryptionSettings {
  type CppManagementAnalyticsCouchbaseRemoteLink (line 204) | interface CppManagementAnalyticsCouchbaseRemoteLink {
  type CppManagementAnalyticsS3ExternalLink (line 212) | interface CppManagementAnalyticsS3ExternalLink {
  type CppManagementClusterBucketSettings (line 221) | interface CppManagementClusterBucketSettings {
  type CppManagementClusterBucketSettingsNode (line 242) | interface CppManagementClusterBucketSettingsNode {
  type CppManagementViewsDesignDocument (line 249) | interface CppManagementViewsDesignDocument {
  type CppManagementViewsDesignDocumentView (line 255) | interface CppManagementViewsDesignDocumentView {
  type CppManagementEventingFunctionKeyspace (line 260) | interface CppManagementEventingFunctionKeyspace {
  type CppManagementEventingFunctionSettings (line 265) | interface CppManagementEventingFunctionSettings {
  type CppManagementEventingFunctionBucketBinding (line 296) | interface CppManagementEventingFunctionBucketBinding {
  type CppManagementEventingFunctionUrlNoAuth (line 301) | interface CppManagementEventingFunctionUrlNoAuth {}
  type CppManagementEventingFunctionUrlAuthBasic (line 302) | interface CppManagementEventingFunctionUrlAuthBasic {
  type CppManagementEventingFunctionUrlAuthDigest (line 306) | interface CppManagementEventingFunctionUrlAuthDigest {
  type CppManagementEventingFunctionUrlAuthBearer (line 310) | interface CppManagementEventingFunctionUrlAuthBearer {
  type CppManagementEventingFunctionUrlBinding (line 313) | interface CppManagementEventingFunctionUrlBinding {
  type CppManagementEventingFunctionConstantBinding (line 325) | interface CppManagementEventingFunctionConstantBinding {
  type CppManagementEventingFunction (line 329) | interface CppManagementEventingFunction {
  type CppManagementEventingFunctionState (line 344) | interface CppManagementEventingFunctionState {
  type CppManagementEventingStatus (line 354) | interface CppManagementEventingStatus {
  type CppManagementRbacRole (line 358) | interface CppManagementRbacRole {
  type CppManagementRbacRoleAndDescription (line 364) | interface CppManagementRbacRoleAndDescription {
  type CppManagementRbacOrigin (line 372) | interface CppManagementRbacOrigin {
  type CppManagementRbacRoleAndOrigins (line 376) | interface CppManagementRbacRoleAndOrigins {
  type CppManagementRbacUser (line 383) | interface CppManagementRbacUser {
  type CppManagementRbacUserAndMetadata (line 390) | interface CppManagementRbacUserAndMetadata {
  type CppManagementRbacGroup (line 401) | interface CppManagementRbacGroup {
  type CppManagementSearchIndex (line 407) | interface CppManagementSearchIndex {
  type CppManagementQueryIndex (line 418) | interface CppManagementQueryIndex {
  type CppTopologyCollectionsManifest (line 430) | interface CppTopologyCollectionsManifest {
  type CppTopologyCollectionsManifestCollection (line 435) | interface CppTopologyCollectionsManifestCollection {
  type CppTopologyCollectionsManifestScope (line 441) | interface CppTopologyCollectionsManifestScope {
  type CppDiagEndpointDiagInfo (line 446) | interface CppDiagEndpointDiagInfo {
  type CppDiagDiagnosticsResult (line 456) | interface CppDiagDiagnosticsResult {
  type CppDiagEndpointPingInfo (line 462) | interface CppDiagEndpointPingInfo {
  type CppDiagPingResult (line 472) | interface CppDiagPingResult {
  type CppPrependResponse (line 478) | interface CppPrependResponse extends CppObservableResponse {
  type CppPrependRequest (line 483) | interface CppPrependRequest extends CppObservableRequest {
  type CppPrependWithLegacyDurabilityRequest (line 494) | interface CppPrependWithLegacyDurabilityRequest
  type CppExistsResponse (line 507) | interface CppExistsResponse extends CppObservableResponse {
  type CppExistsRequest (line 517) | interface CppExistsRequest extends CppObservableRequest {
  type CppHttpNoopResponse (line 525) | interface CppHttpNoopResponse extends CppObservableResponse {
  type CppHttpNoopRequest (line 528) | interface CppHttpNoopRequest extends CppObservableRequest {
  type CppUnlockResponse (line 534) | interface CppUnlockResponse extends CppObservableResponse {
  type CppUnlockRequest (line 538) | interface CppUnlockRequest extends CppObservableRequest {
  type CppGetAllReplicasResponse (line 547) | interface CppGetAllReplicasResponse extends CppObservableResponse {
  type CppGetAllReplicasResponseEntry (line 551) | interface CppGetAllReplicasResponseEntry {
  type CppGetAllReplicasRequest (line 557) | interface CppGetAllReplicasRequest extends CppObservableRequest {
  type CppUpsertResponse (line 563) | interface CppUpsertResponse extends CppObservableResponse {
  type CppUpsertRequest (line 568) | interface CppUpsertRequest extends CppObservableRequest {
  type CppUpsertWithLegacyDurabilityRequest (line 581) | interface CppUpsertWithLegacyDurabilityRequest
  type CppGetAnyReplicaResponse (line 596) | interface CppGetAnyReplicaResponse extends CppObservableResponse {
  type CppGetAnyReplicaRequest (line 603) | interface CppGetAnyReplicaRequest extends CppObservableRequest {
  type CppAppendResponse (line 609) | interface CppAppendResponse extends CppObservableResponse {
  type CppAppendRequest (line 614) | interface CppAppendRequest extends CppObservableRequest {
  type CppAppendWithLegacyDurabilityRequest (line 625) | interface CppAppendWithLegacyDurabilityRequest
  type CppQueryResponse (line 638) | interface CppQueryResponse extends CppObservableResponse {
  type CppQueryResponseQueryMetrics (line 645) | interface CppQueryResponseQueryMetrics {
  type CppQueryResponseQueryProblem (line 655) | interface CppQueryResponseQueryProblem {
  type CppQueryResponseQueryMetaData (line 661) | interface CppQueryResponseQueryMetaData {
  type CppQueryRequest (line 671) | interface CppQueryRequest extends CppObservableRequest {
  type CppReplaceResponse (line 700) | interface CppReplaceResponse extends CppObservableResponse {
  type CppReplaceRequest (line 705) | interface CppReplaceRequest extends CppObservableRequest {
  type CppReplaceWithLegacyDurabilityRequest (line 719) | interface CppReplaceWithLegacyDurabilityRequest
  type CppGetAndTouchResponse (line 735) | interface CppGetAndTouchResponse extends CppObservableResponse {
  type CppGetAndTouchRequest (line 741) | interface CppGetAndTouchRequest extends CppObservableRequest {
  type CppRemoveResponse (line 750) | interface CppRemoveResponse extends CppObservableResponse {
  type CppRemoveRequest (line 755) | interface CppRemoveRequest extends CppObservableRequest {
  type CppRemoveWithLegacyDurabilityRequest (line 765) | interface CppRemoveWithLegacyDurabilityRequest
  type CppGetResponse (line 777) | interface CppGetResponse extends CppObservableResponse {
  type CppGetRequest (line 783) | interface CppGetRequest extends CppObservableRequest {
  type CppLookupInAllReplicasResponse (line 791) | interface CppLookupInAllReplicasResponse extends CppObservableResponse {
  type CppLookupInAllReplicasResponseEntry (line 795) | interface CppLookupInAllReplicasResponseEntry {
  type CppLookupInAllReplicasResponseEntryLookupInEntry (line 801) | interface CppLookupInAllReplicasResponseEntryLookupInEntry {
  type CppLookupInAllReplicasRequest (line 810) | interface CppLookupInAllReplicasRequest extends CppObservableRequest {
  type CppAnalyticsResponse (line 818) | interface CppAnalyticsResponse extends CppObservableResponse {
  type CppAnalyticsResponseAnalyticsMetrics (line 823) | interface CppAnalyticsResponseAnalyticsMetrics {
  type CppAnalyticsResponseAnalyticsProblem (line 832) | interface CppAnalyticsResponseAnalyticsProblem {
  type CppAnalyticsResponseAnalyticsMetaData (line 836) | interface CppAnalyticsResponseAnalyticsMetaData {
  type CppAnalyticsRequest (line 845) | interface CppAnalyticsRequest extends CppObservableRequest {
  type CppGetProjectedResponse (line 862) | interface CppGetProjectedResponse extends CppObservableResponse {
  type CppGetProjectedRequest (line 869) | interface CppGetProjectedRequest extends CppObservableRequest {
  type CppDecrementResponse (line 881) | interface CppDecrementResponse extends CppObservableResponse {
  type CppDecrementRequest (line 887) | interface CppDecrementRequest extends CppObservableRequest {
  type CppDecrementWithLegacyDurabilityRequest (line 899) | interface CppDecrementWithLegacyDurabilityRequest
  type CppSearchResponse (line 913) | interface CppSearchResponse extends CppObservableResponse {
  type CppSearchResponseSearchMetrics (line 921) | interface CppSearchResponseSearchMetrics {
  type CppSearchResponseSearchMetaData (line 928) | interface CppSearchResponseSearchMetaData {
  type CppSearchResponseSearchLocation (line 933) | interface CppSearchResponseSearchLocation {
  type CppSearchResponseSearchRow (line 941) | interface CppSearchResponseSearchRow {
  type CppSearchResponseSearchFacet (line 950) | interface CppSearchResponseSearchFacet {
  type CppSearchResponseSearchFacetTermFacet (line 960) | interface CppSearchResponseSearchFacetTermFacet {
  type CppSearchResponseSearchFacetDateRangeFacet (line 964) | interface CppSearchResponseSearchFacetDateRangeFacet {
  type CppSearchResponseSearchFacetNumericRangeFacet (line 970) | interface CppSearchResponseSearchFacetNumericRangeFacet {
  type CppSearchRequest (line 976) | interface CppSearchRequest extends CppObservableRequest {
  type CppTouchResponse (line 1006) | interface CppTouchResponse extends CppObservableResponse {
  type CppTouchRequest (line 1010) | interface CppTouchRequest extends CppObservableRequest {
  type CppLookupInResponse (line 1019) | interface CppLookupInResponse extends CppObservableResponse {
  type CppLookupInResponseEntry (line 1025) | interface CppLookupInResponseEntry {
  type CppLookupInRequest (line 1034) | interface CppLookupInRequest extends CppObservableRequest {
  type CppDocumentViewResponse (line 1044) | interface CppDocumentViewResponse extends CppObservableResponse {
  type CppDocumentViewResponseMetaData (line 1050) | interface CppDocumentViewResponseMetaData {
  type CppDocumentViewResponseRow (line 1054) | interface CppDocumentViewResponseRow {
  type CppDocumentViewResponseProblem (line 1059) | interface CppDocumentViewResponseProblem {
  type CppDocumentViewRequest (line 1063) | interface CppDocumentViewRequest extends CppObservableRequest {
  type CppGetAndLockResponse (line 1092) | interface CppGetAndLockResponse extends CppObservableResponse {
  type CppGetAndLockRequest (line 1098) | interface CppGetAndLockRequest extends CppObservableRequest {
  type CppInsertResponse (line 1107) | interface CppInsertResponse extends CppObservableResponse {
  type CppInsertRequest (line 1112) | interface CppInsertRequest extends CppObservableRequest {
  type CppInsertWithLegacyDurabilityRequest (line 1124) | interface CppInsertWithLegacyDurabilityRequest
  type CppLookupInAnyReplicaResponse (line 1138) | interface CppLookupInAnyReplicaResponse extends CppObservableResponse {
  type CppLookupInAnyReplicaResponseEntry (line 1145) | interface CppLookupInAnyReplicaResponseEntry {
  type CppLookupInAnyReplicaRequest (line 1154) | interface CppLookupInAnyReplicaRequest extends CppObservableRequest {
  type CppMutateInResponse (line 1162) | interface CppMutateInResponse extends CppObservableResponse {
  type CppMutateInResponseEntry (line 1169) | interface CppMutateInResponseEntry {
  type CppMutateInRequest (line 1177) | interface CppMutateInRequest extends CppObservableRequest {
  type CppMutateInWithLegacyDurabilityRequest (line 1195) | interface CppMutateInWithLegacyDurabilityRequest
  type CppIncrementResponse (line 1215) | interface CppIncrementResponse extends CppObservableResponse {
  type CppIncrementRequest (line 1221) | interface CppIncrementRequest extends CppObservableRequest {
  type CppIncrementWithLegacyDurabilityRequest (line 1233) | interface CppIncrementWithLegacyDurabilityRequest
  type CppManagementGroupUpsertResponse (line 1247) | interface CppManagementGroupUpsertResponse
  type CppManagementGroupUpsertRequest (line 1252) | interface CppManagementGroupUpsertRequest extends CppObservableRequest {
  type CppManagementEventingPauseFunctionResponse (line 1258) | interface CppManagementEventingPauseFunctionResponse
  type CppManagementEventingPauseFunctionRequest (line 1263) | interface CppManagementEventingPauseFunctionRequest
  type CppManagementQueryIndexGetAllResponse (line 1272) | interface CppManagementQueryIndexGetAllResponse
  type CppManagementQueryIndexGetAllRequest (line 1278) | interface CppManagementQueryIndexGetAllRequest
  type CppManagementCollectionCreateResponse (line 1288) | interface CppManagementCollectionCreateResponse
  type CppManagementCollectionCreateRequest (line 1293) | interface CppManagementCollectionCreateRequest
  type CppManagementEventingResumeFunctionResponse (line 1304) | interface CppManagementEventingResumeFunctionResponse
  type CppManagementEventingResumeFunctionRequest (line 1309) | interface CppManagementEventingResumeFunctionRequest
  type CppManagementSearchIndexGetStatsResponse (line 1318) | interface CppManagementSearchIndexGetStatsResponse
  type CppManagementSearchIndexGetStatsRequest (line 1325) | interface CppManagementSearchIndexGetStatsRequest
  type CppManagementBucketGetAllResponse (line 1332) | interface CppManagementBucketGetAllResponse
  type CppManagementBucketGetAllRequest (line 1337) | interface CppManagementBucketGetAllRequest extends CppObservableRequest {
  type CppManagementQueryIndexBuildDeferredResponse (line 1342) | interface CppManagementQueryIndexBuildDeferredResponse
  type CppManagementQueryIndexBuildDeferredResponseQueryProblem (line 1348) | interface CppManagementQueryIndexBuildDeferredResponseQueryProblem {
  type CppManagementQueryIndexBuildDeferredRequest (line 1352) | interface CppManagementQueryIndexBuildDeferredRequest
  type CppManagementClusterDescribeResponse (line 1362) | interface CppManagementClusterDescribeResponse
  type CppManagementClusterDescribeResponseClusterInfo (line 1367) | interface CppManagementClusterDescribeResponseClusterInfo {
  type CppManagementClusterDescribeResponseClusterInfoNode (line 1372) | interface CppManagementClusterDescribeResponseClusterInfoNode {
  type CppManagementClusterDescribeResponseClusterInfoBucket (line 1381) | interface CppManagementClusterDescribeResponseClusterInfoBucket {
  type CppManagementClusterDescribeRequest (line 1385) | interface CppManagementClusterDescribeRequest
  type CppManagementSearchIndexGetAllResponse (line 1391) | interface CppManagementSearchIndexGetAllResponse
  type CppManagementSearchIndexGetAllRequest (line 1398) | interface CppManagementSearchIndexGetAllRequest
  type CppManagementSearchIndexAnalyzeDocumentResponse (line 1406) | interface CppManagementSearchIndexAnalyzeDocumentResponse
  type CppManagementSearchIndexAnalyzeDocumentRequest (line 1413) | interface CppManagementSearchIndexAnalyzeDocumentRequest
  type CppManagementQueryIndexDropResponse (line 1423) | interface CppManagementQueryIndexDropResponse
  type CppManagementQueryIndexDropResponseQueryProblem (line 1429) | interface CppManagementQueryIndexDropResponseQueryProblem {
  type CppManagementQueryIndexDropRequest (line 1433) | interface CppManagementQueryIndexDropRequest
  type CppManagementAnalyticsDatasetCreateResponse (line 1446) | interface CppManagementAnalyticsDatasetCreateResponse
  type CppManagementAnalyticsDatasetCreateRequest (line 1452) | interface CppManagementAnalyticsDatasetCreateRequest
  type CppManagementBucketFlushResponse (line 1463) | interface CppManagementBucketFlushResponse
  type CppManagementBucketFlushRequest (line 1467) | interface CppManagementBucketFlushRequest extends CppObservableRequest {
  type CppManagementAnalyticsIndexDropResponse (line 1473) | interface CppManagementAnalyticsIndexDropResponse
  type CppManagementAnalyticsIndexDropRequest (line 1479) | interface CppManagementAnalyticsIndexDropRequest
  type CppManagementQueryIndexCreateResponse (line 1489) | interface CppManagementQueryIndexCreateResponse
  type CppManagementQueryIndexCreateResponseQueryProblem (line 1495) | interface CppManagementQueryIndexCreateResponseQueryProblem {
  type CppManagementQueryIndexCreateRequest (line 1499) | interface CppManagementQueryIndexCreateRequest
  type CppManagementSearchIndexUpsertResponse (line 1516) | interface CppManagementSearchIndexUpsertResponse
  type CppManagementSearchIndexUpsertRequest (line 1524) | interface CppManagementSearchIndexUpsertRequest
  type CppManagementAnalyticsDatasetGetAllResponse (line 1533) | interface CppManagementAnalyticsDatasetGetAllResponse
  type CppManagementAnalyticsDatasetGetAllRequest (line 1540) | interface CppManagementAnalyticsDatasetGetAllRequest
  type CppManagementAnalyticsIndexGetAllResponse (line 1546) | interface CppManagementAnalyticsIndexGetAllResponse
  type CppManagementAnalyticsIndexGetAllRequest (line 1553) | interface CppManagementAnalyticsIndexGetAllRequest
  type CppManagementAnalyticsGetPendingMutationsResponse (line 1559) | interface CppManagementAnalyticsGetPendingMutationsResponse
  type CppManagementAnalyticsGetPendingMutationsRequest (line 1566) | interface CppManagementAnalyticsGetPendingMutationsRequest
  type CppManagementAnalyticsDataverseDropResponse (line 1572) | interface CppManagementAnalyticsDataverseDropResponse
  type CppManagementAnalyticsDataverseDropRequest (line 1578) | interface CppManagementAnalyticsDataverseDropRequest
  type CppManagementEventingProblem (line 1586) | interface CppManagementEventingProblem {
  type CppManagementAnalyticsLinkConnectResponse (line 1591) | interface CppManagementAnalyticsLinkConnectResponse
  type CppManagementAnalyticsLinkConnectResponseProblem (line 1597) | interface CppManagementAnalyticsLinkConnectResponseProblem {
  type CppManagementAnalyticsLinkConnectRequest (line 1601) | interface CppManagementAnalyticsLinkConnectRequest
  type CppManagementCollectionsManifestGetResponse (line 1610) | interface CppManagementCollectionsManifestGetResponse
  type CppManagementCollectionsManifestGetRequest (line 1615) | interface CppManagementCollectionsManifestGetRequest
  type CppManagementChangePasswordResponse (line 1624) | interface CppManagementChangePasswordResponse
  type CppManagementChangePasswordRequest (line 1628) | interface CppManagementChangePasswordRequest
  type CppManagementClusterDeveloperPreviewEnableResponse (line 1635) | interface CppManagementClusterDeveloperPreviewEnableResponse
  type CppManagementClusterDeveloperPreviewEnableRequest (line 1639) | interface CppManagementClusterDeveloperPreviewEnableRequest
  type CppManagementAnalyticsLinkDropResponse (line 1645) | interface CppManagementAnalyticsLinkDropResponse
  type CppManagementAnalyticsLinkDropResponseProblem (line 1651) | interface CppManagementAnalyticsLinkDropResponseProblem {
  type CppManagementAnalyticsLinkDropRequest (line 1655) | interface CppManagementAnalyticsLinkDropRequest
  type CppManagementCollectionUpdateResponse (line 1663) | interface CppManagementCollectionUpdateResponse
  type CppManagementCollectionUpdateRequest (line 1668) | interface CppManagementCollectionUpdateRequest
  type CppManagementServerNodeAddress (line 1679) | interface CppManagementServerNodeAddress {
  type CppManagementServerNode (line 1684) | interface CppManagementServerNode {
  type CppManagementServerGroup (line 1692) | interface CppManagementServerGroup {
  type CppManagementBucketDescribeResponse (line 1696) | interface CppManagementBucketDescribeResponse
  type CppManagementBucketDescribeResponseBucketInfo (line 1701) | interface CppManagementBucketDescribeResponseBucketInfo {
  type CppManagementBucketDescribeRequest (line 1711) | interface CppManagementBucketDescribeRequest
  type CppManagementEventingUpsertFunctionResponse (line 1718) | interface CppManagementEventingUpsertFunctionResponse
  type CppManagementEventingUpsertFunctionRequest (line 1723) | interface CppManagementEventingUpsertFunctionRequest
  type CppManagementViewIndexGetAllResponse (line 1732) | interface CppManagementViewIndexGetAllResponse
  type CppManagementViewIndexGetAllRequest (line 1737) | interface CppManagementViewIndexGetAllRequest
  type CppManagementBucketGetResponse (line 1745) | interface CppManagementBucketGetResponse extends CppObservableResponse {
  type CppManagementBucketGetRequest (line 1749) | interface CppManagementBucketGetRequest extends CppObservableRequest {
  type CppManagementBucketUpdateResponse (line 1755) | interface CppManagementBucketUpdateResponse
  type CppManagementBucketUpdateRequest (line 1761) | interface CppManagementBucketUpdateRequest extends CppObservableRequest {
  type CppManagementBucketDropResponse (line 1767) | interface CppManagementBucketDropResponse extends CppObservableResponse {
  type CppManagementBucketDropRequest (line 1770) | interface CppManagementBucketDropRequest extends CppObservableRequest {
  type CppManagementFreeformResponse (line 1776) | interface CppManagementFreeformResponse extends CppObservableResponse {
  type CppManagementFreeformRequest (line 1782) | interface CppManagementFreeformRequest extends CppObservableRequest {
  type CppManagementScopeDropResponse (line 1792) | interface CppManagementScopeDropResponse extends CppObservableResponse {
  type CppManagementScopeDropRequest (line 1796) | interface CppManagementScopeDropRequest extends CppObservableRequest {
  type CppManagementViewIndexUpsertResponse (line 1803) | interface CppManagementViewIndexUpsertResponse
  type CppManagementViewIndexUpsertRequest (line 1807) | interface CppManagementViewIndexUpsertRequest
  type CppManagementUserGetAllResponse (line 1815) | interface CppManagementUserGetAllResponse extends CppObservableResponse {
  type CppManagementUserGetAllRequest (line 1819) | interface CppManagementUserGetAllRequest extends CppObservableRequest {
  type CppManagementScopeCreateResponse (line 1825) | interface CppManagementScopeCreateResponse
  type CppManagementScopeCreateRequest (line 1830) | interface CppManagementScopeCreateRequest extends CppObservableRequest {
  type CppManagementEventingGetFunctionResponse (line 1837) | interface CppManagementEventingGetFunctionResponse
  type CppManagementEventingGetFunctionRequest (line 1843) | interface CppManagementEventingGetFunctionRequest
  type CppManagementViewIndexDropResponse (line 1852) | interface CppManagementViewIndexDropResponse
  type CppManagementViewIndexDropRequest (line 1856) | interface CppManagementViewIndexDropRequest
  type CppManagementAnalyticsLinkReplaceResponse (line 1865) | interface CppManagementAnalyticsLinkReplaceResponse
  type CppManagementAnalyticsLinkReplaceResponseProblem (line 1871) | interface CppManagementAnalyticsLinkReplaceResponseProblem {
  type CppManagementAnalyticsLinkReplaceAzureBlobExternalLinkRequest (line 1875) | interface CppManagementAnalyticsLinkReplaceAzureBlobExternalLinkRequest
  type CppManagementAnalyticsLinkReplaceCouchbaseRemoteLinkRequest (line 1882) | interface CppManagementAnalyticsLinkReplaceCouchbaseRemoteLinkRequest
  type CppManagementAnalyticsLinkReplaceS3ExternalLinkRequest (line 1889) | interface CppManagementAnalyticsLinkReplaceS3ExternalLinkRequest
  type CppManagementAnalyticsLinkDisconnectResponse (line 1896) | interface CppManagementAnalyticsLinkDisconnectResponse
  type CppManagementAnalyticsLinkDisconnectResponseProblem (line 1902) | interface CppManagementAnalyticsLinkDisconnectResponseProblem {
  type CppManagementAnalyticsLinkDisconnectRequest (line 1906) | interface CppManagementAnalyticsLinkDisconnectRequest
  type CppManagementUserUpsertResponse (line 1914) | interface CppManagementUserUpsertResponse extends CppObservableResponse {
  type CppManagementUserUpsertRequest (line 1918) | interface CppManagementUserUpsertRequest extends CppObservableRequest {
  type CppManagementEventingGetStatusResponse (line 1925) | interface CppManagementEventingGetStatusResponse
  type CppManagementEventingGetStatusRequest (line 1931) | interface CppManagementEventingGetStatusRequest
  type CppManagementEventingGetAllFunctionsResponse (line 1939) | interface CppManagementEventingGetAllFunctionsResponse
  type CppManagementEventingGetAllFunctionsRequest (line 1945) | interface CppManagementEventingGetAllFunctionsRequest
  type CppManagementAnalyticsIndexCreateResponse (line 1953) | interface CppManagementAnalyticsIndexCreateResponse
  type CppManagementAnalyticsIndexCreateRequest (line 1959) | interface CppManagementAnalyticsIndexCreateRequest
  type CppManagementScopeGetAllResponse (line 1970) | interface CppManagementScopeGetAllResponse
  type CppManagementScopeGetAllRequest (line 1975) | interface CppManagementScopeGetAllRequest extends CppObservableRequest {
  type CppManagementUserGetResponse (line 1981) | interface CppManagementUserGetResponse extends CppObservableResponse {
  type CppManagementUserGetRequest (line 1985) | interface CppManagementUserGetRequest extends CppObservableRequest {
  type CppManagementSearchIndexDropResponse (line 1992) | interface CppManagementSearchIndexDropResponse
  type CppManagementSearchIndexDropRequest (line 1998) | interface CppManagementSearchIndexDropRequest
  type CppManagementSearchIndexControlPlanFreezeResponse (line 2007) | interface CppManagementSearchIndexControlPlanFreezeResponse
  type CppManagementSearchIndexControlPlanFreezeRequest (line 2013) | interface CppManagementSearchIndexControlPlanFreezeRequest
  type CppManagementSearchGetStatsResponse (line 2023) | interface CppManagementSearchGetStatsResponse
  type CppManagementSearchGetStatsRequest (line 2028) | interface CppManagementSearchGetStatsRequest
  type CppManagementUserDropResponse (line 2034) | interface CppManagementUserDropResponse extends CppObservableResponse {
  type CppManagementUserDropRequest (line 2037) | interface CppManagementUserDropRequest extends CppObservableRequest {
  type CppManagementAnalyticsDataverseCreateResponse (line 2044) | interface CppManagementAnalyticsDataverseCreateResponse
  type CppManagementAnalyticsDataverseCreateRequest (line 2050) | interface CppManagementAnalyticsDataverseCreateRequest
  type CppManagementSearchIndexControlQueryResponse (line 2058) | interface CppManagementSearchIndexControlQueryResponse
  type CppManagementSearchIndexControlQueryRequest (line 2064) | interface CppManagementSearchIndexControlQueryRequest
  type CppManagementRoleGetAllResponse (line 2074) | interface CppManagementRoleGetAllResponse extends CppObservableResponse {
  type CppManagementRoleGetAllRequest (line 2078) | interface CppManagementRoleGetAllRequest extends CppObservableRequest {
  type CppManagementGroupGetAllResponse (line 2083) | interface CppManagementGroupGetAllResponse
  type CppManagementGroupGetAllRequest (line 2088) | interface CppManagementGroupGetAllRequest extends CppObservableRequest {
  type CppManagementAnalyticsLinkCreateResponse (line 2093) | interface CppManagementAnalyticsLinkCreateResponse
  type CppManagementAnalyticsLinkCreateResponseProblem (line 2099) | interface CppManagementAnalyticsLinkCreateResponseProblem {
  type CppManagementAnalyticsLinkCreateAzureBlobExternalLinkRequest (line 2103) | interface CppManagementAnalyticsLinkCreateAzureBlobExternalLinkRequest
  type CppManagementAnalyticsLinkCreateCouchbaseRemoteLinkRequest (line 2110) | interface CppManagementAnalyticsLinkCreateCouchbaseRemoteLinkRequest
  type CppManagementAnalyticsLinkCreateS3ExternalLinkRequest (line 2117) | interface CppManagementAnalyticsLinkCreateS3ExternalLinkRequest
  type CppManagementEventingDropFunctionResponse (line 2124) | interface CppManagementEventingDropFunctionResponse
  type CppManagementEventingDropFunctionRequest (line 2129) | interface CppManagementEventingDropFunctionRequest
  type CppManagementCollectionDropResponse (line 2138) | interface CppManagementCollectionDropResponse
  type CppManagementCollectionDropRequest (line 2143) | interface CppManagementCollectionDropRequest
  type CppManagementAnalyticsProblem (line 2152) | interface CppManagementAnalyticsProblem {
  type CppManagementSearchIndexControlIngestResponse (line 2156) | interface CppManagementSearchIndexControlIngestResponse
  type CppManagementSearchIndexControlIngestRequest (line 2162) | interface CppManagementSearchIndexControlIngestRequest
  type CppManagementEventingDeployFunctionResponse (line 2172) | interface CppManagementEventingDeployFunctionResponse
  type CppManagementEventingDeployFunctionRequest (line 2177) | interface CppManagementEventingDeployFunctionRequest
  type CppManagementGroupGetResponse (line 2186) | interface CppManagementGroupGetResponse extends CppObservableResponse {
  type CppManagementGroupGetRequest (line 2190) | interface CppManagementGroupGetRequest extends CppObservableRequest {
  type CppManagementViewIndexGetResponse (line 2196) | interface CppManagementViewIndexGetResponse
  type CppManagementViewIndexGetRequest (line 2201) | interface CppManagementViewIndexGetRequest extends CppObservableRequest {
  type CppManagementBucketCreateResponse (line 2209) | interface CppManagementBucketCreateResponse
  type CppManagementBucketCreateRequest (line 2214) | interface CppManagementBucketCreateRequest extends CppObservableRequest {
  type CppManagementAnalyticsDatasetDropResponse (line 2220) | interface CppManagementAnalyticsDatasetDropResponse
  type CppManagementAnalyticsDatasetDropRequest (line 2226) | interface CppManagementAnalyticsDatasetDropRequest
  type CppManagementGroupDropResponse (line 2235) | interface CppManagementGroupDropResponse extends CppObservableResponse {
  type CppManagementGroupDropRequest (line 2238) | interface CppManagementGroupDropRequest extends CppObservableRequest {
  type CppManagementSearchIndexGetResponse (line 2244) | interface CppManagementSearchIndexGetResponse
  type CppManagementSearchIndexGetRequest (line 2251) | interface CppManagementSearchIndexGetRequest
  type CppManagementQueryIndexGetAllDeferredResponse (line 2260) | interface CppManagementQueryIndexGetAllDeferredResponse
  type CppManagementQueryIndexGetAllDeferredRequest (line 2266) | interface CppManagementQueryIndexGetAllDeferredRequest
  type CppManagementQueryIndexBuildResponse (line 2276) | interface CppManagementQueryIndexBuildResponse
  type CppManagementQueryIndexBuildResponseQueryProblem (line 2282) | interface CppManagementQueryIndexBuildResponseQueryProblem {
  type CppManagementQueryIndexBuildRequest (line 2286) | interface CppManagementQueryIndexBuildRequest
  type CppManagementEventingUndeployFunctionResponse (line 2297) | interface CppManagementEventingUndeployFunctionResponse
  type CppManagementEventingUndeployFunctionRequest (line 2302) | interface CppManagementEventingUndeployFunctionRequest
  type CppManagementSearchIndexGetDocumentsCountResponse (line 2311) | interface CppManagementSearchIndexGetDocumentsCountResponse
  type CppManagementSearchIndexGetDocumentsCountRequest (line 2318) | interface CppManagementSearchIndexGetDocumentsCountRequest
  type CppManagementAnalyticsLinkGetAllResponse (line 2327) | interface CppManagementAnalyticsLinkGetAllResponse
  type CppManagementAnalyticsLinkGetAllResponseProblem (line 2336) | interface CppManagementAnalyticsLinkGetAllResponseProblem {
  type CppManagementAnalyticsLinkGetAllRequest (line 2340) | interface CppManagementAnalyticsLinkGetAllRequest
  type CppImplSubdocCommand (line 2349) | interface CppImplSubdocCommand {
  type CppScanTerm (line 2356) | interface CppScanTerm {
  type CppRangeScan (line 2360) | interface CppRangeScan {
  type CppPrefixScan (line 2364) | interface CppPrefixScan {
  type CppSamplingScan (line 2367) | interface CppSamplingScan {
  type CppRangeSnapshotRequirements (line 2371) | interface CppRangeSnapshotRequirements {
  type CppRangeScanCreateOptions (line 2376) | interface CppRangeScanCreateOptions {
  type CppRangeScanCreateResult (line 2388) | interface CppRangeScanCreateResult {
  type CppRangeScanContinueOptions (line 2392) | interface CppRangeScanContinueOptions {
  type CppRangeScanContinueResult (line 2400) | interface CppRangeScanContinueResult {
  type CppRangeScanCancelOptions (line 2405) | interface CppRangeScanCancelOptions {
  type CppRangeScanItemBody (line 2410) | interface CppRangeScanItemBody {
  type CppRangeScanItem (line 2418) | interface CppRangeScanItem {
  type CppRangeScanCancelResult (line 2422) | interface CppRangeScanCancelResult {}
  type CppMutationState (line 2423) | interface CppMutationState {
  type CppRangeScanOrchestratorOptions (line 2426) | interface CppRangeScanOrchestratorOptions extends CppObservableRequest {
  type CppConnectionAutogen (line 2437) | interface CppConnectionAutogen {
  type CppBindingAutogen (line 3118) | interface CppBindingAutogen {
  type CppObservableRequests (line 3602) | type CppObservableRequests =
  type CppErrc (line 3717) | type CppErrc =
  type CppErrorBase (line 3730) | interface CppErrorBase extends CppObservableResponse {
  type CppGenericError (line 3734) | interface CppGenericError extends CppErrorBase {
  type CppEnhancedErrorInfo (line 3738) | interface CppEnhancedErrorInfo {
  type CppKeyValueError (line 3743) | interface CppKeyValueError extends CppErrorBase {
  type CppViewError (line 3756) | interface CppViewError extends CppErrorBase {
  type CppQueryError (line 3772) | interface CppQueryError extends CppErrorBase {
  type CppSearchError (line 3789) | interface CppSearchError extends CppErrorBase {
  type CppAnalyticsError (line 3805) | interface CppAnalyticsError extends CppErrorBase {
  type CppHttpError (line 3822) | interface CppHttpError extends CppErrorBase {
  type CppTxnOperationFailed (line 3835) | interface CppTxnOperationFailed extends CppErrorBase {
  type CppTxnOpException (line 3844) | interface CppTxnOpException extends CppErrorBase {
  type CppTxnError (line 3851) | interface CppTxnError extends CppErrorBase {
  type CppTransactionErrorContext (line 3859) | interface CppTransactionErrorContext {
  type CppTransactionOpErrorContext (line 3864) | interface CppTransactionOpErrorContext {
  type CppError (line 3869) | type CppError =
  type CppConnection (line 3881) | interface CppConnection extends CppConnectionAutogen {
  type CppTransactionKeyspace (line 3964) | interface CppTransactionKeyspace {
  type CppTransactionsConfig (line 3970) | interface CppTransactionsConfig {
  type CppTransactionOptions (line 3980) | interface CppTransactionOptions {
  type CppTransactionLinks (line 3986) | interface CppTransactionLinks {
  type CppTransactionGetMetaData (line 4005) | interface CppTransactionGetMetaData {
  type CppTransactionGetResult (line 4012) | interface CppTransactionGetResult {
  type CppTransactionGetMultiResult (line 4020) | interface CppTransactionGetMultiResult {
  type CppTransactionGetMultiReplicasFromPreferredServerGroupResult (line 4024) | interface CppTransactionGetMultiReplicasFromPreferredServerGroupResult {
  type CppTransactionResult (line 4028) | interface CppTransactionResult {
  type CppTransactions (line 4033) | interface CppTransactions {
  type CppTransaction (line 4039) | interface CppTransaction {
  type CppBinding (line 4141) | interface CppBinding extends CppBindingAutogen {

FILE: lib/bindingutilities.ts
  function durabilityToCpp (line 99) | function durabilityToCpp(
  function durabilityFromCpp (line 127) | function durabilityFromCpp(
  function persistToToCpp (line 150) | function persistToToCpp(persistTo: number | undefined): CppPersistTo {
  function replicateToToCpp (line 176) | function replicateToToCpp(
  function storeSemanticToCpp (line 200) | function storeSemanticToCpp(
  function viewScanConsistencyToCpp (line 221) | function viewScanConsistencyToCpp(
  function viewOrderingToCpp (line 243) | function viewOrderingToCpp(
  function queryScanConsistencyToCpp (line 263) | function queryScanConsistencyToCpp(
  function queryScanConsistencyFromCpp (line 283) | function queryScanConsistencyFromCpp(
  function queryProfileToCpp (line 300) | function queryProfileToCpp(
  function analyticsScanConsistencyToCpp (line 322) | function analyticsScanConsistencyToCpp(
  function analyticsStatusFromCpp (line 342) | function analyticsStatusFromCpp(
  function searchScanConsistencyToCpp (line 373) | function searchScanConsistencyToCpp(
  function searchHighlightStyleToCpp (line 391) | function searchHighlightStyleToCpp(
  function mutationStateToCpp (line 411) | function mutationStateToCpp(
  function serviceTypeToCpp (line 432) | function serviceTypeToCpp(service: ServiceType): CppServiceType {
  function serviceTypeFromCpp (line 455) | function serviceTypeFromCpp(service: CppServiceType): ServiceType {
  function endpointStateFromCpp (line 478) | function endpointStateFromCpp(
  function txnExternalExceptionStringFromCpp (line 497) | function txnExternalExceptionStringFromCpp(
  function txnOpExeptionFromCpp (line 615) | function txnOpExeptionFromCpp(
  function pingStateFromCpp (line 668) | function pingStateFromCpp(service: CppDiagPingState): PingState {
  function contextFromCpp (line 683) | function contextFromCpp(err: CppError | null): ErrorContext | null {
  function retryReasonFromCpp (line 789) | function retryReasonFromCpp(reason: CppRetryReason): string {
  function errorFromCpp (line 844) | function errorFromCpp(err: CppError | null): Error | null {
  function scanTypeToCpp (line 1066) | function scanTypeToCpp(
  function bucketTypeToCpp (line 1101) | function bucketTypeToCpp(
  function bucketTypeFromCpp (line 1122) | function bucketTypeFromCpp(
  function bucketCompressionModeToCpp (line 1141) | function bucketCompressionModeToCpp(
  function bucketCompressionModeFromCpp (line 1162) | function bucketCompressionModeFromCpp(
  function bucketEvictionPolicyToCpp (line 1181) | function bucketEvictionPolicyToCpp(
  function bucketEvictionPolicyFromCpp (line 1204) | function bucketEvictionPolicyFromCpp(
  function bucketStorageBackendToCpp (line 1234) | function bucketStorageBackendToCpp(
  function bucketStorageBackendFromCpp (line 1253) | function bucketStorageBackendFromCpp(
  function bucketConflictResolutionTypeToCpp (line 1276) | function bucketConflictResolutionTypeToCpp(
  function bucketConflictResolutionTypeFromCpp (line 1297) | function bucketConflictResolutionTypeFromCpp(
  function vectorQueryCombinationToCpp (line 1325) | function vectorQueryCombinationToCpp(
  function designDocumentNamespaceFromCpp (line 1342) | function designDocumentNamespaceFromCpp(
  function designDocumentNamespaceToCpp (line 1359) | function designDocumentNamespaceToCpp(
  function transactionKeyspaceToCpp (line 1376) | function transactionKeyspaceToCpp(
  function eventingBucketBindingAccessToCpp (line 1391) | function eventingBucketBindingAccessToCpp(
  function eventingBucketBindingAccessFromCpp (line 1410) | function eventingBucketBindingAccessFromCpp(
  function eventingFunctionDcpBoundaryToCpp (line 1430) | function eventingFunctionDcpBoundaryToCpp(
  function eventingFunctionDcpBoundaryFromCpp (line 1451) | function eventingFunctionDcpBoundaryFromCpp(
  function eventingFunctionDeploymentStatusToCpp (line 1474) | function eventingFunctionDeploymentStatusToCpp(
  function eventingFunctionDeploymentStatusFromCpp (line 1495) | function eventingFunctionDeploymentStatusFromCpp(
  function eventingFunctionProcessingStatusToCpp (line 1520) | function eventingFunctionProcessingStatusToCpp(
  function eventingFunctionProcessingStatusFromCpp (line 1541) | function eventingFunctionProcessingStatusFromCpp(
  function eventingFunctionLogLevelToCpp (line 1566) | function eventingFunctionLogLevelToCpp(
  function eventingFunctionLogLevelFromCpp (line 1599) | function eventingFunctionLogLevelFromCpp(
  function eventingFunctionLanguageCompatibilityToCpp (line 1632) | function eventingFunctionLanguageCompatibilityToCpp(
  function eventingFunctionLanguageCompatibilityFromCpp (line 1665) | function eventingFunctionLanguageCompatibilityFromCpp(
  function eventingFunctionStatusFromCpp (line 1706) | function eventingFunctionStatusFromCpp(
  function couchbaseLinkEncryptionLevelFromCpp (line 1736) | function couchbaseLinkEncryptionLevelFromCpp(
  function encryptionLevelToCpp (line 1761) | function encryptionLevelToCpp(
  function encryptionSettingsToCpp (line 1780) | function encryptionSettingsToCpp(
  function encryptionSettingsFromCpp (line 1802) | function encryptionSettingsFromCpp(
  function authDomainToCpp (line 1820) | function authDomainToCpp(domain: string): CppManagementRbacAuthDomain {
  function authDomainFromCpp (line 1836) | function authDomainFromCpp(domain: CppManagementRbacAuthDomain): string {
  function readPreferenceToCpp (line 1854) | function readPreferenceToCpp(
  function transactionGetMultiModeToCpp (line 1874) | function transactionGetMultiModeToCpp(
  function transactionGetMultiReplicasFromPreferredServerGroupModeToCpp (line 1898) | function transactionGetMultiReplicasFromPreferredServerGroupModeToCpp(

FILE: lib/bucket.ts
  class Bucket (line 27) | class Bucket {
    method constructor (line 35) | constructor(cluster: Cluster, bucketName: string) {
    method conn (line 44) | get conn(): CppConnection {
    method cluster (line 51) | get cluster(): Cluster {
    method transcoder (line 58) | get transcoder(): Transcoder {
    method name (line 65) | get name(): string {
    method scope (line 74) | scope(scopeName: string): Scope {
    method defaultScope (line 81) | defaultScope(): Scope {
    method collection (line 90) | collection(collectionName: string): Collection {
    method defaultCollection (line 98) | defaultCollection(): Collection {
    method viewIndexes (line 110) | viewIndexes(): ViewIndexManager {
    method collections (line 118) | collections(): CollectionManager {
    method viewQuery (line 134) | viewQuery<TValue = any, TKey = any>(
    method ping (line 169) | ping(

FILE: lib/bucketmanager.ts
  type ConflictResolutionType (line 34) | enum ConflictResolutionType {
  type BucketType (line 61) | enum BucketType {
  type StorageBackend (line 83) | enum StorageBackend {
  type EvictionPolicy (line 100) | enum EvictionPolicy {
  type CompressionMode (line 127) | enum CompressionMode {
  type IBucketSettings (line 153) | interface IBucketSettings {
  class BucketSettings (line 267) | class BucketSettings implements IBucketSettings {
    method constructor (line 355) | constructor(data: BucketSettings) {
    method maxTTL (line 379) | get maxTTL(): number {
    method maxTTL (line 382) | set maxTTL(val: number) {
    method ejectionMethod (line 391) | get ejectionMethod(): EvictionPolicy | string {
    method ejectionMethod (line 394) | set ejectionMethod(val: EvictionPolicy | string) {
    method durabilityMinLevel (line 404) | get durabilityMinLevel(): string {
    method _toCppData (line 411) | static _toCppData(data: IBucketSettings): any {
    method _fromCppData (line 446) | static _fromCppData(
  type ICreateBucketSettings (line 478) | interface ICreateBucketSettings extends IBucketSettings {
  class CreateBucketSettings (line 491) | class CreateBucketSettings
    method constructor (line 503) | constructor(data: CreateBucketSettings) {
    method _toCppData (line 511) | static _toCppData(data: ICreateBucketSettings): any {
  type CreateBucketOptions (line 524) | interface CreateBucketOptions {
  type UpdateBucketOptions (line 539) | interface UpdateBucketOptions {
  type DropBucketOptions (line 554) | interface DropBucketOptions {
  type GetBucketOptions (line 569) | interface GetBucketOptions {
  type GetAllBucketsOptions (line 584) | interface GetAllBucketsOptions {
  type FlushBucketOptions (line 599) | interface FlushBucketOptions {
  class BucketManager (line 617) | class BucketManager {
    method constructor (line 623) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 630) | get observabilityInstruments(): ObservabilityInstruments {
    method createBucket (line 641) | async createBucket(
    method updateBucket (line 694) | async updateBucket(
    method dropBucket (line 747) | async dropBucket(
    method getBucket (line 800) | async getBucket(
    method getAllBuckets (line 853) | async getAllBuckets(
    method flushBucket (line 907) | async flushBucket(

FILE: lib/cluster.ts
  type TimeoutConfig (line 66) | interface TimeoutConfig {
  type SecurityConfig (line 123) | interface SecurityConfig {
  type DnsConfig (line 138) | interface DnsConfig {
  type AppTelemetryConfig (line 160) | interface AppTelemetryConfig {
  type TracingConfig (line 194) | interface TracingConfig {
  type OrphanReporterConfig (line 263) | interface OrphanReporterConfig {
  type MetricsConfig (line 290) | interface MetricsConfig {
  type ConnectOptions (line 310) | interface ConnectOptions {
  class Cluster (line 415) | class Cluster {
    method conn (line 448) | get conn(): CppConnection {
    method transcoder (line 455) | get transcoder(): Transcoder {
    method kvTimeout (line 462) | get kvTimeout(): number {
    method kvDurableTimeout (line 469) | get kvDurableTimeout(): number {
    method viewTimeout (line 476) | get viewTimeout(): number {
    method queryTimeout (line 483) | get queryTimeout(): number {
    method analyticsTimeout (line 490) | get analyticsTimeout(): number {
    method searchTimeout (line 497) | get searchTimeout(): number {
    method managementTimeout (line 504) | get managementTimeout(): number {
    method bootstrapTimeout (line 511) | get bootstrapTimeout(): number | undefined {
    method connectTimeout (line 518) | get connectTimeout(): number | undefined {
    method resolveTimeout (line 525) | get resolveTimeout(): number | undefined {
    method logger (line 532) | get logger(): CouchbaseLogger {
    method observabilityInstruments (line 539) | get observabilityInstruments(): ObservabilityInstruments {
    method toJSON (line 554) | toJSON(): Record<string, any> {
    method constructor (line 563) | constructor(connStr: string, options?: ConnectOptions) {
    method connect (line 726) | static async connect(
    method bucket (line 743) | bucket(bucketName: string): Bucket {
    method users (line 761) | users(): UserManager {
    method buckets (line 769) | buckets(): BucketManager {
    method queryIndexes (line 777) | queryIndexes(): QueryIndexManager {
    method analyticsIndexes (line 785) | analyticsIndexes(): AnalyticsIndexManager {
    method searchIndexes (line 793) | searchIndexes(): SearchIndexManager {
    method eventingFunctions (line 802) | eventingFunctions(): EventingFunctionManager {
    method transactions (line 810) | transactions(): Transactions {
    method query (line 824) | query<TRow = any>(
    method analyticsQuery (line 853) | analyticsQuery<TRow = any>(
    method searchQuery (line 883) | searchQuery(
    method search (line 914) | search(
    method diagnostics (line 945) | diagnostics(
    method ping (line 971) | ping(
    method close (line 994) | async close(callback?: NodeCallback<void>): Promise<void> {
    method updateCredentials (line 1020) | updateCredentials(auth: Authenticator): void {
    method _getClusterLabels (line 1031) | _getClusterLabels(): Record<string, string | undefined> {
    method _getCppCredentials (line 1036) | private _getCppCredentials(
    method _setupObservability (line 1068) | private _setupObservability(): [boolean, boolean] {
    method _connect (line 1121) | private async _connect() {
  method [inspect.custom] (line 546) | [inspect.custom](): Record<string, any> {

FILE: lib/collection.ts
  type GetOptions (line 68) | interface GetOptions {
  type ExistsOptions (line 101) | interface ExistsOptions {
  type InsertOptions (line 116) | interface InsertOptions {
  type UpsertOptions (line 166) | interface UpsertOptions {
  type ReplaceOptions (line 221) | interface ReplaceOptions {
  type RemoveOptions (line 282) | interface RemoveOptions {
  type GetAnyReplicaOptions (line 322) | interface GetAnyReplicaOptions {
  type GetAllReplicasOptions (line 347) | interface GetAllReplicasOptions {
  type TouchOptions (line 372) | interface TouchOptions {
  type GetAndTouchOptions (line 392) | interface GetAndTouchOptions {
  type GetAndLockOptions (line 412) | interface GetAndLockOptions {
  type UnlockOptions (line 432) | interface UnlockOptions {
  type LookupInOptions (line 447) | interface LookupInOptions {
  type LookupInAnyReplicaOptions (line 469) | interface LookupInAnyReplicaOptions {
  type LookupInAllReplicasOptions (line 489) | interface LookupInAllReplicasOptions {
  type MutateInOptions (line 509) | interface MutateInOptions {
  type ScanOptions (line 578) | interface ScanOptions {
  class Collection (line 625) | class Collection {
    method DEFAULT_NAME (line 629) | static get DEFAULT_NAME(): string {
    method constructor (line 643) | constructor(scope: Scope, collectionName: string) {
    method conn (line 655) | get conn(): CppConnection {
    method cluster (line 662) | get cluster(): Cluster {
    method scope (line 669) | get scope(): Scope {
    method transcoder (line 676) | get transcoder(): Transcoder {
    method observabilityInstruments (line 683) | get observabilityInstruments(): ObservabilityInstruments {
    method _mutationTimeout (line 690) | _mutationTimeout(durabilityLevel?: DurabilityLevel): number {
    method _cppDocId (line 704) | _cppDocId(key: string): CppDocumentId {
    method _encodeDoc (line 716) | _encodeDoc(
    method _decodeDoc (line 732) | _decodeDoc(
    method _subdocEncode (line 749) | _subdocEncode(value: any): any {
    method _subdocDecode (line 756) | _subdocDecode(bytes: Buffer): any {
    method name (line 769) | get name(): string {
    method get (line 780) | get(
    method _projectedGet (line 840) | private _projectedGet(
    method exists (line 939) | exists(
    method _getReplica (line 1000) | _getReplica(
    method getAnyReplica (line 1110) | getAnyReplica(
    method getAllReplicas (line 1146) | getAllReplicas(
    method insert (line 1179) | insert(
    method upsert (line 1273) | upsert(
    method replace (line 1368) | replace(
    method remove (line 1463) | remove(
    method getAndTouch (line 1554) | getAndTouch(
    method touch (line 1625) | touch(
    method getAndLock (line 1687) | getAndLock(
    method unlock (line 1753) | unlock(
    method _continueScan (line 1805) | _continueScan(
    method _doScan (line 1870) | _doScan(
    method scan (line 1915) | scan(
    method lookupIn (line 1968) | lookupIn(
    method _lookupInReplica (line 2065) | _lookupInReplica(
    method lookupInAnyReplica (line 2226) | lookupInAnyReplica(
    method lookupInAllReplicas (line 2270) | lookupInAllReplicas(
    method mutateIn (line 2305) | mutateIn(
    method list (line 2442) | list(key: string): CouchbaseList {
    method queue (line 2451) | queue(key: string): CouchbaseQueue {
    method map (line 2460) | map(key: string): CouchbaseMap {
    method set (line 2469) | set(key: string): CouchbaseSet {
    method binary (line 2477) | binary(): BinaryCollection {
    method _binaryIncrement (line 2484) | _binaryIncrement(
    method _binaryDecrement (line 2569) | _binaryDecrement(
    method _binaryAppend (line 2654) | _binaryAppend(
    method _binaryPrepend (line 2740) | _binaryPrepend(
    method queryIndexes (line 2827) | queryIndexes(): CollectionQueryIndexManager {

FILE: lib/collectionmanager.ts
  type ICollectionSpec (line 20) | interface ICollectionSpec {
  class CollectionSpec (line 52) | class CollectionSpec {
    method constructor (line 81) | constructor(data: CollectionSpec) {
    method _fromCppData (line 91) | static _fromCppData(
  class ScopeSpec (line 109) | class ScopeSpec {
    method constructor (line 123) | constructor(data: ScopeSpec) {
    method _fromCppData (line 131) | static _fromCppData(data: CppTopologyCollectionsManifestScope): ScopeS...
  type CreateCollectionSettings (line 155) | interface CreateCollectionSettings {
  type UpdateCollectionSettings (line 177) | interface UpdateCollectionSettings {
  type CreateCollectionOptions (line 197) | interface CreateCollectionOptions {
  type GetAllScopesOptions (line 212) | interface GetAllScopesOptions {
  type DropCollectionOptions (line 227) | interface DropCollectionOptions {
  type CreateScopeOptions (line 242) | interface CreateScopeOptions {
  type DropScopeOptions (line 257) | interface DropScopeOptions {
  type UpdateCollectionOptions (line 272) | interface UpdateCollectionOptions {
  constant OPTIONS_KEYS (line 284) | const OPTIONS_KEYS = ['timeout', 'parentSpan']
  function isOptions (line 289) | function isOptions<T>(obj: any, expectedKeys: string[]): obj is T {
  class CollectionManager (line 301) | class CollectionManager {
    method constructor (line 307) | constructor(bucket: Bucket) {
    method _cluster (line 311) | private get _cluster() {
    method observabilityInstruments (line 318) | get observabilityInstruments(): ObservabilityInstruments {
    method getAllScopes (line 328) | async getAllScopes(
    method createCollection (line 421) | async createCollection(): Promise<void> {
    method dropCollection (line 519) | async dropCollection(
    method updateCollection (line 582) | async updateCollection(
    method createScope (line 647) | async createScope(
    method dropScope (line 705) | async dropScope(

FILE: lib/configProfile.ts
  type IConfigProfile (line 9) | interface IConfigProfile {
  class WanDevelopmentProfile (line 26) | class WanDevelopmentProfile implements IConfigProfile {
    method apply (line 34) | apply(options: ConnectOptions): void {
  class ConfigProfiles (line 60) | class ConfigProfiles {
    method constructor (line 63) | constructor() {
    method applyProfile (line 76) | applyProfile(profileName: string, options: ConnectOptions): void {
    method registerProfile (line 91) | registerProfile(profileName: string, profile: IConfigProfile): void {
    method unregisterProfile (line 102) | unregisterProfile(profileName: string): void {

FILE: lib/connspec.ts
  class ConnSpec (line 9) | class ConnSpec {
    method constructor (line 15) | constructor(data?: Partial<ConnSpec>) {
    method parse (line 26) | static parse(connStr: string): ConnSpec {
    method toString (line 96) | toString(): string {

FILE: lib/couchbase.ts
  function connect (line 14) | async function connect(
  function enableProtocolLoggerToSaveNetworkTrafficToFile (line 46) | function enableProtocolLoggerToSaveNetworkTrafficToFile(
  function shutdownLogger (line 58) | function shutdownLogger(): void {

FILE: lib/crudoptypes.ts
  class GetResult (line 9) | class GetResult {
    method constructor (line 30) | constructor(data: { content: any; cas: Cas; expiryTime?: number }) {
    method value (line 41) | get value(): any {
    method value (line 44) | set value(v: any) {
    method expiry (line 53) | get expiry(): number | undefined {
  class ScanResult (line 63) | class ScanResult {
    method constructor (line 89) | constructor(data: {
  class ExistsResult (line 107) | class ExistsResult {
    method constructor (line 121) | constructor(data: ExistsResult) {
  class MutationResult (line 132) | class MutationResult {
    method constructor (line 146) | constructor(data: MutationResult) {
  class GetReplicaResult (line 157) | class GetReplicaResult {
    method constructor (line 176) | constructor(data: { content: any; cas: Cas; isReplica: boolean }) {
  class LookupInResultEntry (line 188) | class LookupInResultEntry {
    method constructor (line 202) | constructor(data: LookupInResultEntry) {
  class LookupInResult (line 213) | class LookupInResult {
    method constructor (line 226) | constructor(data: { content: LookupInResultEntry[]; cas: Cas }) {
    method results (line 236) | get results(): LookupInResultEntry[] {
    method results (line 239) | set results(v: LookupInResultEntry[]) {
  class LookupInReplicaResult (line 249) | class LookupInReplicaResult {
    method constructor (line 264) | constructor(data: {
  class MutateInResultEntry (line 280) | class MutateInResultEntry {
    method constructor (line 291) | constructor(data: MutateInResultEntry) {
  class MutateInResult (line 301) | class MutateInResult {
    method constructor (line 320) | constructor(data: MutateInResult) {
  class CounterResult (line 332) | class CounterResult {
    method constructor (line 351) | constructor(data: CounterResult) {

FILE: lib/datastructures.ts
  class CouchbaseList (line 17) | class CouchbaseList {
    method constructor (line 24) | constructor(collection: Collection, key: string) {
    method _get (line 29) | private async _get(parentSpan?: WrappedSpan): Promise<any[]> {
    method getAll (line 43) | async getAll(callback?: NodeCallback<any[]>): Promise<any[]> {
    method forEach (line 68) | async forEach(
    method getAt (line 110) | async getAt(index: number, callback?: NodeCallback<any>): Promise<any> {
    method removeAt (line 145) | async removeAt(index: number, callback?: NodeCallback<void>): Promise<...
    method indexOf (line 173) | async indexOf(value: any, callback?: NodeCallback<number>): Promise<nu...
    method size (line 205) | async size(callback?: NodeCallback<number>): Promise<number> {
    method push (line 234) | async push(value: any, callback?: NodeCallback<void>): Promise<void> {
    method unshift (line 265) | async unshift(value: any, callback?: NodeCallback<void>): Promise<void> {
  method [Symbol.asyncIterator] (line 83) | [Symbol.asyncIterator](): AsyncIterator<any> {
  class CouchbaseMap (line 298) | class CouchbaseMap {
    method constructor (line 305) | constructor(collection: Collection, key: string) {
    method _get (line 310) | private async _get(
    method getAll (line 326) | async getAll(
    method forEach (line 353) | async forEach(
    method set (line 400) | async set(
    method get (line 435) | async get(item: string, callback?: NodeCallback<any>): Promise<any> {
    method remove (line 470) | async remove(item: string, callback?: NodeCallback<void>): Promise<voi...
    method exists (line 496) | async exists(
    method keys (line 529) | async keys(callback?: NodeCallback<string[]>): Promise<string[]> {
    method values (line 553) | async values(callback?: NodeCallback<any[]>): Promise<any[]> {
    method size (line 577) | async size(callback?: NodeCallback<number>): Promise<number> {
  method [Symbol.asyncIterator] (line 368) | [Symbol.asyncIterator](): AsyncIterator<[any, string]> {
  class CouchbaseQueue (line 607) | class CouchbaseQueue {
    method constructor (line 614) | constructor(collection: Collection, key: string) {
    method _get (line 619) | private async _get(): Promise<any[]> {
    method size (line 633) | async size(callback?: NodeCallback<number>): Promise<number> {
    method push (line 661) | async push(value: any, callback?: NodeCallback<void>): Promise<void> {
    method pop (line 691) | async pop(callback?: NodeCallback<any>): Promise<any> {
  class CouchbaseSet (line 746) | class CouchbaseSet {
    method constructor (line 753) | constructor(collection: Collection, key: string) {
    method _get (line 758) | private async _get(parentSpan?: RequestSpan): Promise<any[]> {
    method add (line 774) | async add(item: any, callback?: NodeCallback<boolean>): Promise<boolea...
    method contains (line 812) | async contains(
    method remove (line 846) | async remove(item: any, callback?: NodeCallback<void>): Promise<void> {
    method values (line 898) | async values(callback?: NodeCallback<any[]>): Promise<any[]> {
    method size (line 922) | async size(callback?: NodeCallback<number>): Promise<number> {

FILE: lib/diagnosticsexecutor.ts
  class DiagnoticsExecutor (line 22) | class DiagnoticsExecutor {
    method constructor (line 28) | constructor(cluster: Cluster) {
    method diagnostics (line 35) | async diagnostics(options: DiagnosticsOptions): Promise<DiagnosticsRes...
  class PingExecutor (line 81) | class PingExecutor {
    method constructor (line 87) | constructor(cluster: Cluster) {
    method ping (line 94) | async ping(options: PingOptions): Promise<PingResult> {

FILE: lib/diagnosticstypes.ts
  type EndpointState (line 8) | enum EndpointState {
  type PingState (line 33) | enum PingState {
  type JsonPingReport (line 56) | interface JsonPingReport {
  type JsonDiagnosticsReport (line 81) | interface JsonDiagnosticsReport {
  class PingEndpoint (line 105) | class PingEndpoint {
    method constructor (line 109) | constructor(data: PingEndpoint) {
  class PingResult (line 166) | class PingResult {
    method constructor (line 170) | constructor(data: {
    method toJSON (line 205) | toJSON(): JsonPingReport {
  type PingOptions (line 235) | interface PingOptions {
  class DiagnosticsEndpoint (line 263) | class DiagnosticsEndpoint {
    method constructor (line 267) | constructor(data: DiagnosticsEndpoint) {
  class DiagnosticsResult (line 322) | class DiagnosticsResult {
    method constructor (line 326) | constructor(data: {
    method toJSON (line 361) | toJSON(): JsonDiagnosticsReport {
  type DiagnosticsOptions (line 391) | interface DiagnosticsOptions {

FILE: lib/errorcontexts.ts
  type ErrorContextTypes (line 8) | type ErrorContextTypes =
  class ErrorContext (line 21) | class ErrorContext {
    method constructor (line 42) | constructor(data: ErrorContextTypes) {
  class KeyValueErrorContext (line 55) | class KeyValueErrorContext extends ErrorContext {
    method constructor (line 104) | constructor(data: KeyValueErrorContext) {
  class ViewErrorContext (line 124) | class ViewErrorContext extends ErrorContext {
    method constructor (line 153) | constructor(data: ViewErrorContext) {
  class QueryErrorContext (line 169) | class QueryErrorContext extends ErrorContext {
    method constructor (line 199) | constructor(data: QueryErrorContext) {
  class SearchErrorContext (line 215) | class SearchErrorContext extends ErrorContext {
    method constructor (line 244) | constructor(data: SearchErrorContext) {
  class AnalyticsErrorContext (line 260) | class AnalyticsErrorContext extends ErrorContext {
    method constructor (line 290) | constructor(data: QueryErrorContext) {
  class HttpErrorContext (line 306) | class HttpErrorContext extends ErrorContext {
    method constructor (line 330) | constructor(data: HttpErrorContext) {

FILE: lib/errors.ts
  class CouchbaseError (line 18) | class CouchbaseError extends Error {
    method constructor (line 37) | constructor(message: string, cause?: Error, context?: ErrorContext) {
  class ConnectionClosedError (line 52) | class ConnectionClosedError extends CouchbaseError {
    method constructor (line 53) | constructor() {
  class ClusterClosedError (line 64) | class ClusterClosedError extends CouchbaseError {
    method constructor (line 65) | constructor() {
  class NeedOpenBucketError (line 77) | class NeedOpenBucketError extends CouchbaseError {
    method constructor (line 78) | constructor() {
  class InvalidDurabilityLevel (line 88) | class InvalidDurabilityLevel extends CouchbaseError {
    method constructor (line 89) | constructor() {
  class InvalidDurabilityPersistToLevel (line 99) | class InvalidDurabilityPersistToLevel extends CouchbaseError {
    method constructor (line 100) | constructor() {
  class InvalidDurabilityReplicateToLevel (line 110) | class InvalidDurabilityReplicateToLevel extends CouchbaseError {
    method constructor (line 111) | constructor() {
  class TimeoutError (line 121) | class TimeoutError extends CouchbaseError {
    method constructor (line 122) | constructor(cause?: Error, context?: ErrorContext) {
  class RequestCanceledError (line 132) | class RequestCanceledError extends CouchbaseError {
    method constructor (line 133) | constructor(cause?: Error, context?: ErrorContext) {
  class InvalidArgumentError (line 143) | class InvalidArgumentError extends CouchbaseError {
    method constructor (line 144) | constructor(cause?: Error, context?: ErrorContext) {
  class ServiceNotAvailableError (line 156) | class ServiceNotAvailableError extends CouchbaseError {
    method constructor (line 157) | constructor(cause?: Error, context?: ErrorContext) {
  class InternalServerFailureError (line 168) | class InternalServerFailureError extends CouchbaseError {
    method constructor (line 169) | constructor(cause?: Error, context?: ErrorContext) {
  class AuthenticationFailureError (line 179) | class AuthenticationFailureError extends CouchbaseError {
    method constructor (line 180) | constructor(cause?: Error, context?: ErrorContext) {
  class TemporaryFailureError (line 191) | class TemporaryFailureError extends CouchbaseError {
    method constructor (line 192) | constructor(cause?: Error, context?: ErrorContext) {
  class ParsingFailureError (line 202) | class ParsingFailureError extends CouchbaseError {
    method constructor (line 203) | constructor(cause?: Error, context?: ErrorContext) {
  class CasMismatchError (line 215) | class CasMismatchError extends CouchbaseError {
    method constructor (line 216) | constructor(cause?: Error, context?: ErrorContext) {
  class BucketNotFoundError (line 226) | class BucketNotFoundError extends CouchbaseError {
    method constructor (line 227) | constructor(cause?: Error, context?: ErrorContext) {
  class CollectionNotFoundError (line 237) | class CollectionNotFoundError extends CouchbaseError {
    method constructor (line 238) | constructor(cause?: Error, context?: ErrorContext) {
  class EncodingFailureError (line 248) | class EncodingFailureError extends CouchbaseError {
    method constructor (line 249) | constructor(cause?: Error, context?: ErrorContext) {
  class DecodingFailureError (line 259) | class DecodingFailureError extends CouchbaseError {
    method constructor (line 260) | constructor(cause?: Error, context?: ErrorContext) {
  class UnsupportedOperationError (line 270) | class UnsupportedOperationError extends CouchbaseError {
    method constructor (line 271) | constructor(cause?: Error, context?: ErrorContext) {
  class AmbiguousTimeoutError (line 283) | class AmbiguousTimeoutError extends TimeoutError {
    method constructor (line 284) | constructor(cause?: Error, context?: ErrorContext) {
  class UnambiguousTimeoutError (line 296) | class UnambiguousTimeoutError extends TimeoutError {
    method constructor (line 297) | constructor(cause?: Error, context?: ErrorContext) {
  class FeatureNotAvailableError (line 311) | class FeatureNotAvailableError extends CouchbaseError {
    method constructor (line 312) | constructor(cause?: Error, context?: ErrorContext) {
  class ScopeNotFoundError (line 322) | class ScopeNotFoundError extends CouchbaseError {
    method constructor (line 323) | constructor(cause?: Error, context?: ErrorContext) {
  class IndexNotFoundError (line 333) | class IndexNotFoundError extends CouchbaseError {
    method constructor (line 334) | constructor(cause?: Error, context?: ErrorContext) {
  class RateLimitedError (line 345) | class RateLimitedError extends CouchbaseError {
    method constructor (line 346) | constructor(cause?: Error, context?: ErrorContext) {
  class QuotaLimitedError (line 357) | class QuotaLimitedError extends CouchbaseError {
    method constructor (line 358) | constructor(cause?: Error, context?: ErrorContext) {
  class IndexExistsError (line 369) | class IndexExistsError extends CouchbaseError {
    method constructor (line 370) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentNotFoundError (line 380) | class DocumentNotFoundError extends CouchbaseError {
    method constructor (line 381) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentUnretrievableError (line 391) | class DocumentUnretrievableError extends CouchbaseError {
    method constructor (line 392) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentLockedError (line 403) | class DocumentLockedError extends CouchbaseError {
    method constructor (line 404) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentNotLockedError (line 415) | class DocumentNotLockedError extends CouchbaseError {
    method constructor (line 416) | constructor(cause?: Error, context?: ErrorContext) {
  class ValueTooLargeError (line 426) | class ValueTooLargeError extends CouchbaseError {
    method constructor (line 427) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentExistsError (line 438) | class DocumentExistsError extends CouchbaseError {
    method constructor (line 439) | constructor(cause?: Error, context?: ErrorContext) {
  class ValueNotJsonError (line 449) | class ValueNotJsonError extends CouchbaseError {
    method constructor (line 450) | constructor(cause?: Error, context?: ErrorContext) {
  class DurabilityLevelNotAvailableError (line 460) | class DurabilityLevelNotAvailableError extends CouchbaseError {
    method constructor (line 461) | constructor(cause?: Error, context?: ErrorContext) {
  class DurabilityImpossibleError (line 473) | class DurabilityImpossibleError extends CouchbaseError {
    method constructor (line 474) | constructor(cause?: Error, context?: ErrorContext) {
  class DurabilityAmbiguousError (line 486) | class DurabilityAmbiguousError extends CouchbaseError {
    method constructor (line 487) | constructor(cause?: Error, context?: ErrorContext) {
  class DurableWriteInProgressError (line 498) | class DurableWriteInProgressError extends CouchbaseError {
    method constructor (line 499) | constructor(cause?: Error, context?: ErrorContext) {
  class DurableWriteReCommitInProgressError (line 510) | class DurableWriteReCommitInProgressError extends CouchbaseError {
    method constructor (line 511) | constructor(cause?: Error, context?: ErrorContext) {
  class MutationLostError (line 521) | class MutationLostError extends CouchbaseError {
    method constructor (line 522) | constructor(cause?: Error, context?: ErrorContext) {
  class PathNotFoundError (line 532) | class PathNotFoundError extends CouchbaseError {
    method constructor (line 533) | constructor(cause?: Error, context?: ErrorContext) {
  class PathMismatchError (line 545) | class PathMismatchError extends CouchbaseError {
    method constructor (line 546) | constructor(cause?: Error, context?: ErrorContext) {
  class PathInvalidError (line 556) | class PathInvalidError extends CouchbaseError {
    method constructor (line 557) | constructor(cause?: Error, context?: ErrorContext) {
  class PathTooBigError (line 567) | class PathTooBigError extends CouchbaseError {
    method constructor (line 568) | constructor(cause?: Error, context?: ErrorContext) {
  class PathTooDeepError (line 578) | class PathTooDeepError extends CouchbaseError {
    method constructor (line 579) | constructor(cause?: Error, context?: ErrorContext) {
  class ValueTooDeepError (line 590) | class ValueTooDeepError extends CouchbaseError {
    method constructor (line 591) | constructor(cause?: Error, context?: ErrorContext) {
  class ValueInvalidError (line 601) | class ValueInvalidError extends CouchbaseError {
    method constructor (line 602) | constructor(cause?: Error, context?: ErrorContext) {
  class DocumentNotJsonError (line 613) | class DocumentNotJsonError extends CouchbaseError {
    method constructor (line 614) | constructor(cause?: Error, context?: ErrorContext) {
  class NumberTooBigError (line 624) | class NumberTooBigError extends CouchbaseError {
    method constructor (line 625) | constructor(cause?: Error, context?: ErrorContext) {
  class DeltaInvalidError (line 635) | class DeltaInvalidError extends CouchbaseError {
    method constructor (line 636) | constructor(cause?: Error, context?: ErrorContext) {
  class PathExistsError (line 647) | class PathExistsError extends CouchbaseError {
    method constructor (line 648) | constructor(cause?: Error, context?: ErrorContext) {
  class PlanningFailureError (line 658) | class PlanningFailureError extends CouchbaseError {
    method constructor (line 659) | constructor(cause?: Error, context?: ErrorContext) {
  class IndexFailureError (line 669) | class IndexFailureError extends CouchbaseError {
    method constructor (line 670) | constructor(cause?: Error, context?: ErrorContext) {
  class PreparedStatementFailureError (line 680) | class PreparedStatementFailureError extends CouchbaseError {
    method constructor (line 681) | constructor(cause?: Error, context?: ErrorContext) {
  class DmlFailureError (line 691) | class DmlFailureError extends CouchbaseError {
    method constructor (line 692) | constructor(cause?: Error, context?: ErrorContext) {
  class IndexNotReadyError (line 702) | class IndexNotReadyError extends CouchbaseError {
    method constructor (line 703) | constructor(cause?: Error, context?: ErrorContext) {
  class CompilationFailureError (line 713) | class CompilationFailureError extends CouchbaseError {
    method constructor (line 714) | constructor(cause?: Error, context?: ErrorContext) {
  class JobQueueFullError (line 725) | class JobQueueFullError extends CouchbaseError {
    method constructor (line 726) | constructor(cause?: Error, context?: ErrorContext) {
  class DatasetNotFoundError (line 736) | class DatasetNotFoundError extends CouchbaseError {
    method constructor (line 737) | constructor(cause?: Error, context?: ErrorContext) {
  class DataverseNotFoundError (line 747) | class DataverseNotFoundError extends CouchbaseError {
    method constructor (line 748) | constructor(cause?: Error, context?: ErrorContext) {
  class DatasetExistsError (line 759) | class DatasetExistsError extends CouchbaseError {
    method constructor (line 760) | constructor(cause?: Error, context?: ErrorContext) {
  class DataverseExistsError (line 771) | class DataverseExistsError extends CouchbaseError {
    method constructor (line 772) | constructor(cause?: Error, context?: ErrorContext) {
  class LinkNotFoundError (line 782) | class LinkNotFoundError extends CouchbaseError {
    method constructor (line 783) | constructor(cause?: Error, context?: ErrorContext) {
  class LinkExistsError (line 793) | class LinkExistsError extends CouchbaseError {
    method constructor (line 794) | constructor(cause?: Error, context?: ErrorContext) {
  class ViewNotFoundError (line 804) | class ViewNotFoundError extends CouchbaseError {
    method constructor (line 805) | constructor(cause?: Error, context?: ErrorContext) {
  class DesignDocumentNotFoundError (line 815) | class DesignDocumentNotFoundError extends CouchbaseError {
    method constructor (line 816) | constructor(cause?: Error, context?: ErrorContext) {
  class CollectionExistsError (line 827) | class CollectionExistsError extends CouchbaseError {
    method constructor (line 828) | constructor(cause?: Error, context?: ErrorContext) {
  class ScopeExistsError (line 839) | class ScopeExistsError extends CouchbaseError {
    method constructor (line 840) | constructor(cause?: Error, context?: ErrorContext) {
  class UserNotFoundError (line 850) | class UserNotFoundError extends CouchbaseError {
    method constructor (line 851) | constructor(cause?: Error, context?: ErrorContext) {
  class GroupNotFoundError (line 861) | class GroupNotFoundError extends CouchbaseError {
    method constructor (line 862) | constructor(cause?: Error, context?: ErrorContext) {
  class BucketExistsError (line 873) | class BucketExistsError extends CouchbaseError {
    method constructor (line 874) | constructor(cause?: Error, context?: ErrorContext) {
  class UserExistsError (line 885) | class UserExistsError extends CouchbaseError {
    method constructor (line 886) | constructor(cause?: Error, context?: ErrorContext) {
  class BucketNotFlushableError (line 897) | class BucketNotFlushableError extends CouchbaseError {
    method constructor (line 898) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionNotFoundError (line 908) | class EventingFunctionNotFoundError extends CouchbaseError {
    method constructor (line 909) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionNotDeployedError (line 920) | class EventingFunctionNotDeployedError extends CouchbaseError {
    method constructor (line 921) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionCompilationFailureError (line 931) | class EventingFunctionCompilationFailureError extends CouchbaseError {
    method constructor (line 932) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionIdenticalKeyspaceError (line 943) | class EventingFunctionIdenticalKeyspaceError extends CouchbaseError {
    method constructor (line 944) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionNotBootstrappedError (line 955) | class EventingFunctionNotBootstrappedError extends CouchbaseError {
    method constructor (line 956) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionDeployedError (line 967) | class EventingFunctionDeployedError extends CouchbaseError {
    method constructor (line 968) | constructor(cause?: Error, context?: ErrorContext) {
  class EventingFunctionPausedError (line 979) | class EventingFunctionPausedError extends CouchbaseError {
    method constructor (line 980) | constructor(cause?: Error, context?: ErrorContext) {
  class TransactionOperationFailedError (line 990) | class TransactionOperationFailedError extends CouchbaseError {
    method constructor (line 991) | constructor(cause?: Error, context?: ErrorContext) {
  class TransactionFailedError (line 1001) | class TransactionFailedError extends CouchbaseError {
    method constructor (line 1002) | constructor(cause?: Error, context?: ErrorContext) {
  class TransactionExpiredError (line 1012) | class TransactionExpiredError extends CouchbaseError {
    method constructor (line 1013) | constructor(cause?: Error) {
  class TransactionCommitAmbiguousError (line 1024) | class TransactionCommitAmbiguousError extends CouchbaseError {
    method constructor (line 1025) | constructor(cause?: Error) {
  class MeterError (line 1035) | class MeterError extends CouchbaseError {
    method constructor (line 1036) | constructor(cause?: Error) {

FILE: lib/eventingfunctionmanager.ts
  type EventingFunctionDcpBoundary (line 47) | enum EventingFunctionDcpBoundary {
  type EventingFunctionDeploymentStatus (line 65) | enum EventingFunctionDeploymentStatus {
  type EventingFunctionProcessingStatus (line 82) | enum EventingFunctionProcessingStatus {
  type EventingFunctionStatus (line 99) | enum EventingFunctionStatus {
  type EventingFunctionLanguageCompatibility (line 136) | enum EventingFunctionLanguageCompatibility {
  type EventingFunctionLogLevel (line 167) | enum EventingFunctionLogLevel {
  type EventingFunctionBucketAccess (line 199) | enum EventingFunctionBucketAccess {
  type EventingFunctionUrlAuthMethod (line 216) | enum EventingFunctionUrlAuthMethod {
  class EventingFunctionKeyspace (line 243) | class EventingFunctionKeyspace {
    method constructor (line 244) | constructor(v: EventingFunctionKeyspace) {
  class EventingFunctionBucketBinding (line 271) | class EventingFunctionBucketBinding {
    method constructor (line 272) | constructor(v: EventingFunctionBucketBinding) {
    method _fromCppData (line 296) | static _fromCppData(
    method _toCppData (line 313) | static _toCppData(
  type EventingFunctionUrlAuth (line 333) | interface EventingFunctionUrlAuth {
  class EventingFunctionUrlAuthBasic (line 345) | class EventingFunctionUrlAuthBasic implements EventingFunctionUrlAuth {
    method constructor (line 351) | constructor(v: Omit<EventingFunctionUrlAuthBasic, 'method'>) {
  class EventingFunctionUrlAuthDigest (line 372) | class EventingFunctionUrlAuthDigest implements EventingFunctionUrlAuth {
    method constructor (line 378) | constructor(v: Omit<EventingFunctionUrlAuthDigest, 'method'>) {
  class EventingFunctionUrlAuthBearer (line 399) | class EventingFunctionUrlAuthBearer implements EventingFunctionUrlAuth {
    method constructor (line 405) | constructor(v: Omit<EventingFunctionUrlAuthBearer, 'method'>) {
  class EventingFunctionUrlBinding (line 420) | class EventingFunctionUrlBinding {
    method constructor (line 421) | constructor(v: EventingFunctionUrlBinding) {
    method _fromCppData (line 457) | static _fromCppData(
    method _toCppData (line 503) | static _toCppData(
  class EventingFunctionConstantBinding (line 551) | class EventingFunctionConstantBinding {
    method constructor (line 552) | constructor(v: EventingFunctionConstantBinding) {
    method _fromCppData (line 570) | static _fromCppData(
    method _toCppData (line 582) | static _toCppData(
  class EventingFunctionSettings (line 598) | class EventingFunctionSettings {
    method constructor (line 599) | constructor(v: EventingFunctionSettings) {
    method _fromCppData (line 785) | static _fromCppData(
    method _toCppData (line 832) | static _toCppData(
  class EventingFunction (line 889) | class EventingFunction {
    method constructor (line 890) | constructor(v: EventingFunction) {
    method _fromCppData (line 971) | static _fromCppData(data: CppManagementEventingFunction): EventingFunc...
    method _toCppData (line 1008) | static _toCppData(data: EventingFunction): CppManagementEventingFuncti...
  class EventingFunctionState (line 1045) | class EventingFunctionState {
    method constructor (line 1046) | constructor(v: EventingFunctionState) {
    method _fromCppData (line 1088) | static _fromCppData(
  class EventingState (line 1112) | class EventingState {
    method constructor (line 1113) | constructor(v: EventingState) {
    method _fromCppData (line 1131) | static _fromCppData(data: CppManagementEventingStatus): EventingState {
  type UpsertFunctionOptions (line 1145) | interface UpsertFunctionOptions {
  type DropFunctionOptions (line 1160) | interface DropFunctionOptions {
  type GetAllFunctionsOptions (line 1175) | interface GetAllFunctionsOptions {
  type GetFunctionOptions (line 1190) | interface GetFunctionOptions {
  type DeployFunctionOptions (line 1205) | interface DeployFunctionOptions {
  type UndeployFunctionOptions (line 1220) | interface UndeployFunctionOptions {
  type PauseFunctionOptions (line 1235) | interface PauseFunctionOptions {
  type ResumeFunctionOptions (line 1250) | interface ResumeFunctionOptions {
  type FunctionsStatusOptions (line 1265) | interface FunctionsStatusOptions {
  class EventingFunctionManager (line 1284) | class EventingFunctionManager {
    method constructor (line 1290) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 1297) | get observabilityInstruments(): ObservabilityInstruments {
    method upsertFunction (line 1308) | async upsertFunction(
    method dropFunction (line 1361) | async dropFunction(
    method getAllFunctions (line 1413) | async getAllFunctions(
    method getFunction (line 1468) | async getFunction(
    method deployFunction (line 1522) | async deployFunction(
    method undeployFunction (line 1575) | async undeployFunction(
    method pauseFunction (line 1628) | async pauseFunction(
    method resumeFunction (line 1681) | async resumeFunction(
    method functionsStatus (line 1733) | async functionsStatus(

FILE: lib/generaltypes.ts
  type ServiceType (line 4) | enum ServiceType {
  type DurabilityLevel (line 44) | enum DurabilityLevel {
  type StoreSemantics (line 73) | enum StoreSemantics {
  type ReadPreference (line 99) | enum ReadPreference {

FILE: lib/httpexecutor.ts
  type HttpServiceType (line 10) | enum HttpServiceType {
  type HttpMethod (line 22) | enum HttpMethod {
  type HttpRequestOptions (line 32) | interface HttpRequestOptions {
  type HttpResponse (line 44) | interface HttpResponse {
  class HttpExecutor (line 54) | class HttpExecutor {
    method constructor (line 60) | constructor(conn: CppConnection) {
    method streamRequest (line 67) | streamRequest(options: HttpRequestOptions): events.EventEmitter {
    method request (line 145) | async request(options: HttpRequestOptions): Promise<HttpResponse> {

FILE: lib/logger.ts
  type LogLevel (line 14) | enum LogLevel {
  constant LOG_LEVEL_NAMES (line 44) | const LOG_LEVEL_NAMES = ['trace', 'debug', 'info', 'warn', 'error'] as c...
  type LogLevelName (line 49) | type LogLevelName = (typeof LOG_LEVEL_NAMES)[number]
  function parseLogLevel (line 61) | function parseLogLevel(level: LogLevel | string): LogLevel | undefined {
  type Logger (line 81) | interface Logger {
  class NoOpLogger (line 128) | class NoOpLogger implements Logger {
    method trace (line 132) | trace(): void {}
    method debug (line 137) | debug(): void {}
    method info (line 142) | info(): void {}
    method warn (line 147) | warn(): void {}
    method error (line 152) | error(): void {}
  class CouchbaseLogger (line 164) | class CouchbaseLogger implements Logger {
    method constructor (line 173) | constructor(logger?: Logger) {
    method trace (line 185) | trace(message: string, ...args: any[]): void {
    method debug (line 197) | debug(message: string, ...args: any[]): void {
    method info (line 209) | info(message: string, ...args: any[]): void {
    method warn (line 221) | warn(message: string, ...args: any[]): void {
    method error (line 233) | error(message: string, ...args: any[]): void {
  function createConsoleLogger (line 247) | function createConsoleLogger(

FILE: lib/loggingmeter.ts
  type PercentileReport (line 16) | interface PercentileReport {
  type LoggingMeterReport (line 32) | interface LoggingMeterReport {
  class LoggingValueRecorder (line 53) | class LoggingValueRecorder implements ValueRecorder {
    method constructor (line 57) | constructor() {
    method recordValue (line 70) | recordValue(value: number): void {
    method getPercentilesAndReset (line 79) | getPercentilesAndReset(): PercentileReport {
  class LoggingMeterReporter (line 101) | class LoggingMeterReporter {
    method constructor (line 109) | constructor(
    method start (line 123) | start() {
    method stop (line 133) | stop() {
    method report (line 144) | report(): void {
    method toJSON (line 154) | toJSON(): Record<string, any> {
  class LoggingMeter (line 165) | class LoggingMeter implements Meter {
    method constructor (line 179) | constructor(logger: CouchbaseLogger, emitInterval?: number) {
    method reporter (line 196) | get reporter(): LoggingMeterReporter {
    method valueRecorder (line 207) | valueRecorder(_name: string, tags: Record<string, string>): ValueRecor...
    method createReport (line 231) | createReport(): LoggingMeterReport | null {
    method cleanup (line 266) | cleanup(): void {
    method toJSON (line 277) | toJSON(): Record<string, any> {

FILE: lib/metrics.ts
  type ValueRecorder (line 11) | interface ValueRecorder {
  type Meter (line 26) | interface Meter {

FILE: lib/mutationstate.ts
  type MutationToken (line 8) | interface MutationToken {
  class MutationState (line 26) | class MutationState {
    method constructor (line 34) | constructor(...tokens: MutationToken[]) {
    method add (line 45) | add(...tokens: MutationToken[]): void {
    method _addOne (line 49) | private _addOne(token: MutationToken) {
    method toJSON (line 77) | toJSON(): any {
    method inspect (line 84) | inspect(): string {

FILE: lib/observability.ts
  class NoOpSpan (line 15) | class NoOpSpan implements RequestSpan {
    method setAttribute (line 19) | setAttribute(): void {}
    method addEvent (line 24) | addEvent(): void {}
    method setStatus (line 29) | setStatus(): void {}
    method end (line 34) | end(): void {}
    method name (line 39) | get name(): string {
  class NoOpTracer (line 47) | class NoOpTracer implements RequestTracer {
    method requestSpan (line 51) | requestSpan(): RequestSpan {
  function wrapObservableBindingCall (line 59) | async function wrapObservableBindingCall<
  class NoOpValueRecorder (line 87) | class NoOpValueRecorder implements ValueRecorder {
    method recordValue (line 91) | recordValue(_value: number): void {}
  class NoOpMeter (line 97) | class NoOpMeter implements Meter {
    method valueRecorder (line 101) | valueRecorder(_name: string, _tags: Record<string, string>): ValueReco...

FILE: lib/observabilityhandler.ts
  class ObservableRequestHandlerTracerImpl (line 41) | class ObservableRequestHandlerTracerImpl {
    method constructor (line 52) | constructor(
    method clusterName (line 75) | get clusterName(): string | undefined {
    method clusterUUID (line 82) | get clusterUUID(): string | undefined {
    method wrapperSpanName (line 89) | get wrapperSpanName(): string {
    method wrappedSpan (line 96) | get wrappedSpan(): WrappedSpan {
    method maybeAddEncodingSpan (line 103) | maybeAddEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, numbe...
    method maybeCreateEncodingSpan (line 110) | maybeCreateEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, nu...
    method end (line 117) | end(): void {
    method endWithError (line 125) | endWithError(error?: any): void {
    method reset (line 147) | reset(
    method processCoreSpan (line 171) | processCoreSpan(coreSpan?: CppWrapperSdkSpan): void {
    method setRequestHttpAttributes (line 182) | setRequestHttpAttributes(options?: HttpOpAttributesOptions): void {
    method setRequestKeyValueAttributes (line 195) | setRequestKeyValueAttributes(
  class ObservableRequestHandlerNoOpTracerImpl (line 214) | class ObservableRequestHandlerNoOpTracerImpl {
    method constructor (line 217) | constructor(
    method clusterName (line 228) | get clusterName(): string | undefined {
    method clusterUUID (line 235) | get clusterUUID(): string | undefined {
    method wrapperSpanName (line 242) | get wrapperSpanName(): string {
    method wrappedSpan (line 249) | get wrappedSpan(): WrappedSpan | undefined {
    method end (line 256) | end(): void {}
    method endWithError (line 261) | endWithError(_error?: any): void {}
    method maybeAddEncodingSpan (line 266) | maybeAddEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, numbe...
    method maybeCreateEncodingSpan (line 273) | maybeCreateEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, nu...
    method processCoreSpan (line 280) | processCoreSpan(_coreSpan?: CppWrapperSdkSpan): void {}
    method reset (line 285) | reset(
    method setRequestHttpAttributes (line 294) | setRequestHttpAttributes(_options?: HttpOpAttributesOptions): void {}
    method setRequestKeyValueAttributes (line 299) | setRequestKeyValueAttributes(
  class ObservableRequestHandlerNoOpMeterImpl (line 308) | class ObservableRequestHandlerNoOpMeterImpl {
    method constructor (line 310) | constructor(
    method setRequestKeyValueAttributes (line 320) | setRequestKeyValueAttributes(
    method setRequestHttpAttributes (line 328) | setRequestHttpAttributes(_options?: HttpOpAttributesOptions): void {}
    method processEnd (line 333) | processEnd(
    method reset (line 342) | reset(
  class ObservableRequestHandlerMeterImpl (line 353) | class ObservableRequestHandlerMeterImpl {
    method constructor (line 364) | constructor(
    method setRequestKeyValueAttributes (line 381) | setRequestKeyValueAttributes(cppDocId: CppDocumentId): void {
    method setRequestHttpAttributes (line 391) | setRequestHttpAttributes(options?: HttpOpAttributesOptions): void {
    method processEnd (line 401) | processEnd(clusterName?: string, clusterUUID?: string, error?: any): v...
    method reset (line 456) | reset(
    method _getOpName (line 469) | private _getOpName(): string {
    method _handleError (line 473) | private _handleError(tags: Record<string, string>, error: any): void {
  type TracerImpl (line 492) | type TracerImpl =
  type MeterImpl (line 499) | type MeterImpl =
  class ObservableRequestHandler (line 506) | class ObservableRequestHandler {
    method constructor (line 512) | constructor(
    method opType (line 551) | get opType(): OpType {
    method requestHasEnded (line 558) | get requestHasEnded(): boolean {
    method wrapperSpanName (line 565) | get wrapperSpanName(): string {
    method wrappedSpan (line 572) | get wrappedSpan(): WrappedSpan | undefined {
    method clusterName (line 579) | get clusterName(): string | undefined {
    method clusterUUID (line 586) | get clusterUUID(): string | undefined {
    method end (line 593) | end(): void {
    method endWithError (line 602) | endWithError(error?: any): void {
    method maybeAddEncodingSpan (line 611) | maybeAddEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, numbe...
    method maybeCreateEncodingSpan (line 618) | maybeCreateEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, nu...
    method reset (line 625) | reset(
    method processCoreSpan (line 643) | processCoreSpan(coreSpan?: CppWrapperSdkSpan): void {
    method setRequestHttpAttributes (line 650) | setRequestHttpAttributes(options?: HttpOpAttributesOptions): void {
    method setRequestKeyValueAttributes (line 658) | setRequestKeyValueAttributes(
  class WrappedEncodingSpan (line 670) | class WrappedEncodingSpan {
    method constructor (line 671) | constructor(
  class WrappedSpan (line 680) | class WrappedSpan implements RequestSpan {
    method constructor (line 695) | constructor(
    method clusterName (line 721) | get clusterName(): string | undefined {
    method clusterUUID (line 728) | get clusterUUID(): string | undefined {
    method name (line 735) | get name(): string {
    method requestSpan (line 742) | get requestSpan(): RequestSpan {
    method maybeAddEncodingSpan (line 749) | maybeAddEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, numbe...
    method maybeCreateEncodingSpan (line 784) | maybeCreateEncodingSpan(encodeFn: () => [Buffer, number]): [Buffer, nu...
    method maybeUpdateEndTimeWatermark (line 817) | maybeUpdateEndTimeWatermark(endTime: HiResTime): void {
    method _setAttributeOnAllSpans (line 824) | _setAttributeOnAllSpans(
    method _maybeSetAttributeFromCoreSpan (line 848) | _maybeSetAttributeFromCoreSpan(
    method _buildCoreSpans (line 881) | _buildCoreSpans(
    method _buildDispatchCoreSpan (line 897) | _buildDispatchCoreSpan(
    method _buildNonDispatchCoreSpan (line 929) | _buildNonDispatchCoreSpan(
    method _endEncodingSpans (line 963) | _endEncodingSpans(): void {
    method processCoreSpan (line 980) | processCoreSpan(coreSpan: CppWrapperSdkSpan): void {
    method setClusterLabels (line 1004) | setClusterLabels(clusterLabels: Record<string, string | undefined>): v...
    method setRetryAttribute (line 1022) | setRetryAttribute(retrCount: number = 0): void {
    method addEvent (line 1029) | addEvent(): void {}
    method end (line 1034) | end(endTime: HiResTime): void {
    method setAttribute (line 1046) | setAttribute(key: string, value: AttributeValue): void {
    method setStatus (line 1058) | setStatus(status: SpanStatus): void {
    method _createRequestSpan (line 1065) | _createRequestSpan(

FILE: lib/observabilitytypes.ts
  type AttributeValue (line 10) | type AttributeValue =
  type TimeInput (line 25) | type TimeInput = HiResTime | number | Date
  type OpType (line 30) | type OpType =
  type HttpOpType (line 46) | type HttpOpType =
  type KeyValueOp (line 61) | enum KeyValueOp {
  type DatastructureOp (line 92) | enum DatastructureOp {
  type StreamingOp (line 121) | enum StreamingOp {
  type AnalyticsMgmtOp (line 131) | enum AnalyticsMgmtOp {
  type BucketMgmtOp (line 152) | enum BucketMgmtOp {
  type CollectionMgmtOp (line 165) | enum CollectionMgmtOp {
  type EventingFunctionMgmtOp (line 178) | enum EventingFunctionMgmtOp {
  type QueryIndexMgmtOp (line 193) | enum QueryIndexMgmtOp {
  type SearchIndexMgmtOp (line 206) | enum SearchIndexMgmtOp {
  type UserMgmtOp (line 226) | enum UserMgmtOp {
  type ViewIndexMgmtOp (line 242) | enum ViewIndexMgmtOp {
  type CppOpAttributeName (line 253) | enum CppOpAttributeName {
  type OpAttributeName (line 262) | enum OpAttributeName {
  type DispatchAttributeName (line 298) | enum DispatchAttributeName {
  type ServiceName (line 312) | enum ServiceName {
  function serviceNameFromOpType (line 326) | function serviceNameFromOpType(opType: OpType): ServiceName {
  type SpanStatus (line 382) | interface SpanStatus {
  type SpanStatusCode (line 396) | enum SpanStatusCode {
  class ObservabilityInstruments (line 415) | class ObservabilityInstruments {
    method constructor (line 422) | constructor(
    method tracer (line 435) | get tracer(): RequestTracer {
    method meter (line 442) | get meter(): Meter {
    method clusterLabelsFn (line 449) | get clusterLabelsFn():

FILE: lib/observabilityutilities.ts
  constant MILLIS_PER_SECOND (line 23) | const MILLIS_PER_SECOND = 1000
  constant NANOS_PER_SECOND (line 24) | const NANOS_PER_SECOND = 1_000_000_000
  constant MICROS_PER_SECOND (line 25) | const MICROS_PER_SECOND = 1_000_000
  constant NANOS_PER_MILLI (line 26) | const NANOS_PER_MILLI = 1_000_000
  constant TIME_ORIGIN_MS (line 29) | const TIME_ORIGIN_MS = Date.now()
  constant HRTIME_ORIGIN (line 30) | const HRTIME_ORIGIN = process.hrtime()
  constant ORIGIN_SECONDS (line 33) | const ORIGIN_SECONDS = Math.floor(TIME_ORIGIN_MS / MILLIS_PER_SECOND)
  constant ORIGIN_NANOS (line 34) | const ORIGIN_NANOS = (TIME_ORIGIN_MS % MILLIS_PER_SECOND) * NANOS_PER_MILLI
  type StreamingOptions (line 39) | type StreamingOptions = AnalyticsQueryOptions | QueryOptions
  function getEpochHiResTime (line 45) | function getEpochHiResTime(): [number, number] {
  function hiResTimeToMicros (line 68) | function hiResTimeToMicros(hrTime: HiResTime): number {
  function getHiResTimeDelta (line 75) | function getHiResTimeDelta(start: HiResTime, end: HiResTime): HiResTime {
  function millisToHiResTime (line 89) | function millisToHiResTime(millis: number): HiResTime {
  function getLatestTime (line 99) | function getLatestTime(timeA: HiResTime, timeB: HiResTime): HiResTime {
  function getCoreSpanEndTime (line 119) | function getCoreSpanEndTime(coreSpanEndTime: HiResTime): HiResTime {
  function timeInputToHiResTime (line 129) | function timeInputToHiResTime(input?: TimeInput): HiResTime {
  function getAttributesForKeyValueOpType (line 148) | function getAttributesForKeyValueOpType(
  type HttpOpAttributesOptions (line 181) | interface HttpOpAttributesOptions {
  function getAttributesForHttpOpType (line 193) | function getAttributesForHttpOpType(

FILE: lib/otelmeter.ts
  constant HAS_OTEL (line 15) | let HAS_OTEL = false
  class OTelValueRecorder (line 30) | class OTelValueRecorder implements ValueRecorder {
    method constructor (line 43) | constructor(
    method recordValue (line 58) | recordValue(value: number): void {
  class OTelWrapperMeter (line 69) | class OTelWrapperMeter implements Meter {
    method constructor (line 78) | constructor(meter: OTelMeter) {
    method valueRecorder (line 90) | valueRecorder(name: string, tags: Record<string, any>): ValueRecorder {
  function getOTelMeter (line 108) | function getOTelMeter(provider?: OTelMeterProvider): Meter {

FILE: lib/oteltracer.ts
  constant HAS_OTEL (line 24) | let HAS_OTEL = false
  class OTelWrapperSpan (line 39) | class OTelWrapperSpan implements RequestSpan {
    method constructor (line 49) | constructor(otelSpan: OTelSpan, name: string) {
    method setAttribute (line 60) | setAttribute(key: string, value: AttributeValue): void {
    method addEvent (line 70) | addEvent(key: string, startTime?: TimeInput): void {
    method setStatus (line 79) | setStatus(status: SpanStatus): void {
    method end (line 101) | end(endTime?: TimeInput): void {
  class OTelWrapperTracer (line 109) | class OTelWrapperTracer implements RequestTracer {
    method constructor (line 117) | constructor(tracer: OTelTracer) {
    method requestSpan (line 129) | requestSpan(
  function getOTelTracer (line 161) | function getOTelTracer(

FILE: lib/queryexecutor.ts
  class QueryExecutor (line 26) | class QueryExecutor {
    method constructor (line 32) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 39) | get observabilityInstruments(): ObservabilityInstruments {
    method _processQueryResponse (line 46) | static _processQueryResponse<TRow>(
    method execute (line 121) | static execute<TRow = any>(
    method executePromise (line 151) | static executePromise<TRow = any>(
    method query (line 177) | query<TRow = any>(

FILE: lib/queryindexmanager.ts
  class QueryIndex (line 19) | class QueryIndex {
    method constructor (line 73) | constructor(data: QueryIndex) {
  type CreateQueryIndexOptions (line 90) | interface CreateQueryIndexOptions {
  type CreatePrimaryQueryIndexOptions (line 136) | interface CreatePrimaryQueryIndexOptions {
  type DropQueryIndexOptions (line 187) | interface DropQueryIndexOptions {
  type DropPrimaryQueryIndexOptions (line 222) | interface DropPrimaryQueryIndexOptions {
  type GetAllQueryIndexesOptions (line 262) | interface GetAllQueryIndexesOptions {
  type BuildQueryIndexOptions (line 291) | interface BuildQueryIndexOptions {
  type WatchQueryIndexOptions (line 320) | interface WatchQueryIndexOptions {
  class InternalQueryIndexManager (line 349) | class InternalQueryIndexManager {
    method constructor (line 356) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 367) | get observabilityInstruments(): ObservabilityInstruments {
    method createIndex (line 374) | async createIndex(
    method dropIndex (line 425) | async dropIndex(
    method getAllIndexes (line 473) | async getAllIndexes(
    method buildDeferredIndexes (line 525) | async buildDeferredIndexes(
    method watchIndexes (line 566) | async watchIndexes(
  class CollectionQueryIndexManager (line 660) | class CollectionQueryIndexManager {
    method constructor (line 669) | constructor(collection: Collection) {
    method createIndex (line 684) | async createIndex(
    method createPrimaryIndex (line 734) | async createPrimaryIndex(
    method dropIndex (line 781) | async dropIndex(
    method dropPrimaryIndex (line 827) | async dropPrimaryIndex(
    method getAllIndexes (line 872) | async getAllIndexes(
    method buildDeferredIndexes (line 914) | async buildDeferredIndexes(
    method watchIndexes (line 958) | async watchIndexes(
  class QueryIndexManager (line 1005) | class QueryIndexManager {
    method constructor (line 1011) | constructor(cluster: Cluster) {
    method createIndex (line 1024) | async createIndex(
    method createPrimaryIndex (line 1076) | async createPrimaryIndex(
    method dropIndex (line 1125) | async dropIndex(
    method dropPrimaryIndex (line 1173) | async dropPrimaryIndex(
    method getAllIndexes (line 1220) | async getAllIndexes(
    method buildDeferredIndexes (line 1264) | async buildDeferredIndexes(
    method watchIndexes (line 1310) | async watchIndexes(

FILE: lib/querytypes.ts
  type QueryStatus (line 9) | enum QueryStatus {
  class QueryResult (line 66) | class QueryResult<TRow = any> {
    method constructor (line 80) | constructor(data: QueryResult) {
  class QueryMetaData (line 91) | class QueryMetaData {
    method constructor (line 130) | constructor(data: QueryMetaData) {
  class QueryWarning (line 147) | class QueryWarning {
    method constructor (line 161) | constructor(data: QueryWarning) {
  class QueryMetrics (line 173) | class QueryMetrics {
    method constructor (line 217) | constructor(data: QueryMetrics) {
  type QueryProfileMode (line 234) | enum QueryProfileMode {
  type QueryScanConsistency (line 257) | enum QueryScanConsistency {
  type QueryOptions (line 277) | interface QueryOptions {

FILE: lib/rangeScan.ts
  class ScanTerm (line 7) | class ScanTerm {
    method constructor (line 23) | constructor(term: string, exclusive?: boolean) {
  type ScanType (line 33) | interface ScanType {
  class RangeScan (line 46) | class RangeScan implements ScanType {
    method constructor (line 60) | constructor(start?: ScanTerm, end?: ScanTerm) {
    method getScanType (line 68) | getScanType(): string {
  class SamplingScan (line 79) | class SamplingScan implements ScanType {
    method constructor (line 93) | constructor(limit: number, seed?: number) {
    method getScanType (line 101) | getScanType(): string {
  class PrefixScan (line 111) | class PrefixScan implements ScanType {
    method constructor (line 120) | constructor(prefix: string) {
    method getScanType (line 127) | getScanType(): string {

FILE: lib/scope.ts
  class Scope (line 33) | class Scope {
    method DEFAULT_NAME (line 37) | static get DEFAULT_NAME(): string {
    method constructor (line 48) | constructor(bucket: Bucket, scopeName: string) {
    method conn (line 57) | get conn(): CppConnection {
    method bucket (line 64) | get bucket(): Bucket {
    method cluster (line 71) | get cluster(): Cluster {
    method transcoder (line 78) | get transcoder(): Transcoder {
    method name (line 85) | get name(): string {
    method collection (line 94) | collection(collectionName: string): Collection {
    method searchIndexes (line 102) | searchIndexes(): ScopeSearchIndexManager {
    method eventingFunctions (line 115) | eventingFunctions(): ScopeEventingFunctionManager {
    method query (line 130) | query<TRow = any>(
    method analyticsQuery (line 164) | analyticsQuery<TRow = any>(
    method search (line 199) | search(

FILE: lib/scopeeventingfunctionmanager.ts
  class ScopeEventingFunctionManager (line 30) | class ScopeEventingFunctionManager {
    method constructor (line 38) | constructor(cluster: Cluster, bucketName: string, scopeName: string) {
    method observabilityInstruments (line 47) | get observabilityInstruments(): ObservabilityInstruments {
    method upsertFunction (line 58) | async upsertFunction(
    method dropFunction (line 116) | async dropFunction(
    method getAllFunctions (line 173) | async getAllFunctions(
    method getFunction (line 233) | async getFunction(
    method deployFunction (line 292) | async deployFunction(
    method undeployFunction (line 350) | async undeployFunction(
    method pauseFunction (line 408) | async pauseFunction(
    method resumeFunction (line 466) | async resumeFunction(
    method functionsStatus (line 523) | async functionsStatus(

FILE: lib/scopesearchindexmanager.ts
  class ScopeSearchIndexManager (line 32) | class ScopeSearchIndexManager {
    method constructor (line 40) | constructor(cluster: Cluster, bucketName: string, scopeName: string) {
    method observabilityInstruments (line 49) | get observabilityInstruments(): ObservabilityInstruments {
    method getIndex (line 60) | async getIndex(
    method getAllIndexes (line 116) | async getAllIndexes(
    method upsertIndex (line 175) | async upsertIndex(
    method dropIndex (line 233) | async dropIndex(
    method getIndexedDocumentsCount (line 289) | async getIndexedDocumentsCount(
    method pauseIngest (line 348) | async pauseIngest(
    method resumeIngest (line 407) | async resumeIngest(
    method allowQuerying (line 466) | async allowQuerying(
    method disallowQuerying (line 525) | async disallowQuerying(
    method freezePlan (line 584) | async freezePlan(
    method unfreezePlan (line 643) | async unfreezePlan(
    method analyzeDocument (line 703) | async analyzeDocument(

FILE: lib/sdspecs.ts
  class LookupInMacro (line 9) | class LookupInMacro {
    method constructor (line 15) | constructor(value: string) {
    method Document (line 22) | static get Document(): LookupInMacro {
    method Expiry (line 29) | static get Expiry(): LookupInMacro {
    method Cas (line 36) | static get Cas(): LookupInMacro {
    method SeqNo (line 43) | static get SeqNo(): LookupInMacro {
    method LastModified (line 50) | static get LastModified(): LookupInMacro {
    method IsDeleted (line 59) | static get IsDeleted(): LookupInMacro {
    method ValueSizeBytes (line 66) | static get ValueSizeBytes(): LookupInMacro {
    method RevId (line 73) | static get RevId(): LookupInMacro {
  class MutateInMacro (line 84) | class MutateInMacro {
    method constructor (line 90) | constructor(value: string) {
    method Cas (line 97) | static get Cas(): MutateInMacro {
    method SeqNo (line 104) | static get SeqNo(): MutateInMacro {
    method ValueCrc32c (line 111) | static get ValueCrc32c(): MutateInMacro {
  class LookupInSpec (line 121) | class LookupInSpec {
    method Expiry (line 128) | static get Expiry(): LookupInMacro {
    method constructor (line 147) | private constructor(
    method _create (line 157) | private static _create(
    method get (line 191) | static get(
    method exists (line 210) | static exists(
    method count (line 226) | static count(
  class MutateInSpec (line 239) | class MutateInSpec {
    method CasPlaceholder (line 246) | static get CasPlaceholder(): MutateInMacro {
    method constructor (line 270) | private constructor(
    method _create (line 282) | private static _create(
    method insert (line 347) | static insert(
    method upsert (line 374) | static upsert(
    method replace (line 406) | static replace(
    method remove (line 430) | static remove(path: string, options?: { xattr?: boolean }): MutateInSp...
    method arrayAppend (line 463) | static arrayAppend(
    method arrayPrepend (line 492) | static arrayPrepend(
    method arrayInsert (line 523) | static arrayInsert(
    method arrayAddUnique (line 553) | static arrayAddUnique(
    method increment (line 579) | static increment(
    method decrement (line 605) | static decrement(

FILE: lib/sdutils.ts
  type SdPathPartProp (line 4) | interface SdPathPartProp {
  type SdPathPartIndex (line 9) | interface SdPathPartIndex {
  type SdPathPart (line 14) | type SdPathPart = SdPathPartProp | SdPathPartIndex
  class SdUtils (line 16) | class SdUtils {
    method _parsePath (line 17) | private static _parsePath(path: string): SdPathPart[] {
    method _insertByPath (line 53) | private static _insertByPath(
    method insertByPath (line 96) | static insertByPath(root: any, path: string, value: any): any {
    method _getByPath (line 101) | private static _getByPath(value: any, parts: SdPathPart[]): any {
    method getByPath (line 130) | static getByPath(value: any, path: string): any {
    method convertMacroCasToCas (line 135) | static convertMacroCasToCas(cas: string): string {

FILE: lib/searchexecutor.ts
  class SearchExecutor (line 28) | class SearchExecutor {
    method constructor (line 36) | constructor(cluster: Cluster, bucketName?: string, scopeName?: string) {
    method observabilityInstruments (line 45) | get observabilityInstruments(): ObservabilityInstruments {
    method _processSearchResponse (line 52) | static _processSearchResponse(
    method executePromise (line 90) | static executePromise(
    method query (line 116) | query(

FILE: lib/searchfacet.ts
  class SearchFacet (line 8) | class SearchFacet {
    method constructor (line 11) | constructor(data: any) {
    method toJSON (line 19) | toJSON(): any {
    method term (line 23) | static term(field: string, size: number): TermSearchFacet {
    method numeric (line 27) | static numeric(field: string, size: number): NumericSearchFacet {
    method date (line 31) | static date(field: string, size: number): DateSearchFacet {
  class TermSearchFacet (line 41) | class TermSearchFacet extends SearchFacet {
    method constructor (line 45) | constructor(field: string, size: number) {
  class NumericSearchFacet (line 58) | class NumericSearchFacet extends SearchFacet {
    method constructor (line 62) | constructor(field: string, size: number) {
    method addRange (line 70) | addRange(name: string, min?: number, max?: number): NumericSearchFacet {
  class DateSearchFacet (line 85) | class DateSearchFacet extends SearchFacet {
    method constructor (line 89) | constructor(field: string, size: number) {
    method addRange (line 97) | addRange(name: string, start?: Date, end?: Date): DateSearchFacet {

FILE: lib/searchindexmanager.ts
  type ISearchIndex (line 18) | interface ISearchIndex {
  class SearchIndex (line 72) | class SearchIndex implements ISearchIndex {
    method constructor (line 122) | constructor(data: SearchIndex) {
    method _toCppData (line 137) | static _toCppData(data: ISearchIndex): any {
    method _fromCppData (line 154) | static _fromCppData(data: CppManagementSearchIndex): SearchIndex {
  type GetSearchIndexOptions (line 182) | interface GetSearchIndexOptions {
  type GetAllSearchIndexesOptions (line 197) | interface GetAllSearchIndexesOptions {
  type UpsertSearchIndexOptions (line 212) | interface UpsertSearchIndexOptions {
  type DropSearchIndexOptions (line 227) | interface DropSearchIndexOptions {
  type GetSearchIndexedDocumentsCountOptions (line 242) | interface GetSearchIndexedDocumentsCountOptions {
  type PauseSearchIngestOptions (line 257) | interface PauseSearchIngestOptions {
  type ResumeSearchIngestOptions (line 272) | interface ResumeSearchIngestOptions {
  type AllowSearchQueryingOptions (line 287) | interface AllowSearchQueryingOptions {
  type DisallowSearchQueryingOptions (line 302) | interface DisallowSearchQueryingOptions {
  type FreezeSearchPlanOptions (line 317) | interface FreezeSearchPlanOptions {
  type UnfreezeSearchPlanOptions (line 332) | interface UnfreezeSearchPlanOptions {
  type AnalyzeSearchDocumentOptions (line 347) | interface AnalyzeSearchDocumentOptions {
  class SearchIndexManager (line 365) | class SearchIndexManager {
    method constructor (line 371) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 378) | get observabilityInstruments(): ObservabilityInstruments {
    method getIndex (line 389) | async getIndex(
    method getAllIndexes (line 440) | async getAllIndexes(
    method upsertIndex (line 494) | async upsertIndex(
    method dropIndex (line 547) | async dropIndex(
    method getIndexedDocumentsCount (line 598) | async getIndexedDocumentsCount(
    method pauseIngest (line 652) | async pauseIngest(
    method resumeIngest (line 706) | async resumeIngest(
    method allowQuerying (line 760) | async allowQuerying(
    method disallowQuerying (line 814) | async disallowQuerying(
    method freezePlan (line 868) | async freezePlan(
    method unfreezePlan (line 922) | async unfreezePlan(
    method analyzeDocument (line 977) | async analyzeDocument(

FILE: lib/searchquery.ts
  type MatchOperator (line 9) | enum MatchOperator {
  type GeoPoint (line 27) | type GeoPoint =
  function _parseGeoPoint (line 32) | function _parseGeoPoint(v: GeoPoint): [number, number] {
  function _unpackListArgs (line 50) | function _unpackListArgs<T>(args: T[] | T[][]): T[] {
  class SearchQuery (line 62) | class SearchQuery {
    method constructor (line 65) | constructor(data: any) {
    method toJSON (line 73) | toJSON(): any {
    method toJSON (line 80) | static toJSON(query: SearchQuery | any): any {
    method hasProp (line 90) | static hasProp(query: SearchQuery | any, prop: string): boolean {
    method match (line 95) | static match(match: string): MatchSearchQuery {
    method matchPhrase (line 99) | static matchPhrase(phrase: string): MatchPhraseSearchQuery {
    method regexp (line 103) | static regexp(regexp: string): RegexpSearchQuery {
    method queryString (line 107) | static queryString(query: string): QueryStringSearchQuery {
    method numericRange (line 111) | static numericRange(): NumericRangeSearchQuery {
    method dateRange (line 115) | static dateRange(): DateRangeSearchQuery {
    method termRange (line 119) | static termRange(): TermRangeSearchQuery {
    method conjuncts (line 138) | static conjuncts(
    method disjuncts (line 160) | static disjuncts(
    method boolean (line 167) | static boolean(): BooleanSearchQuery {
    method wildcard (line 171) | static wildcard(wildcard: string): WildcardSearchQuery {
    method docIds (line 190) | static docIds(...args: string[] | string[][]): DocIdSearchQuery {
    method booleanField (line 195) | static booleanField(val: boolean): BooleanFieldSearchQuery {
    method term (line 199) | static term(term: string): TermSearchQuery {
    method phrase (line 203) | static phrase(terms: string[]): PhraseSearchQuery {
    method prefix (line 207) | static prefix(prefix: string): PrefixSearchQuery {
    method matchAll (line 211) | static matchAll(): MatchAllSearchQuery {
    method matchNone (line 215) | static matchNone(): MatchNoneSearchQuery {
    method geoDistance (line 219) | static geoDistance(
    method geoBoundingBox (line 227) | static geoBoundingBox(
    method geoPolygon (line 236) | static geoPolygon(points: GeoPoint[]): GeoPolygonSearchQuery {
  class MatchSearchQuery (line 246) | class MatchSearchQuery extends SearchQuery {
    method constructor (line 250) | constructor(match: string) {
    method operator (line 256) | operator(op: MatchOperator): MatchSearchQuery {
    method field (line 261) | field(field: string): MatchSearchQuery {
    method analyzer (line 266) | analyzer(analyzer: string): MatchSearchQuery {
    method prefixLength (line 271) | prefixLength(prefixLength: number): MatchSearchQuery {
    method fuzziness (line 276) | fuzziness(fuzziness: number): MatchSearchQuery {
    method boost (line 281) | boost(boost: number): MatchSearchQuery {
  class MatchPhraseSearchQuery (line 292) | class MatchPhraseSearchQuery extends SearchQuery {
    method constructor (line 296) | constructor(phrase: string) {
    method field (line 302) | field(field: string): MatchPhraseSearchQuery {
    method analyzer (line 307) | analyzer(analyzer: string): MatchPhraseSearchQuery {
    method boost (line 312) | boost(boost: number): MatchPhraseSearchQuery {
  class RegexpSearchQuery (line 323) | class RegexpSearchQuery extends SearchQuery {
    method constructor (line 327) | constructor(regexp: string) {
    method field (line 333) | field(field: string): RegexpSearchQuery {
    method boost (line 338) | boost(boost: number): RegexpSearchQuery {
  class QueryStringSearchQuery (line 349) | class QueryStringSearchQuery extends SearchQuery {
    method constructor (line 353) | constructor(query: string) {
    method boost (line 359) | boost(boost: number): QueryStringSearchQuery {
  class NumericRangeSearchQuery (line 370) | class NumericRangeSearchQuery extends SearchQuery {
    method constructor (line 374) | constructor() {
    method min (line 378) | min(min: number, inclusive?: boolean): NumericRangeSearchQuery {
    method max (line 388) | max(max: number, inclusive?: boolean): NumericRangeSearchQuery {
    method field (line 398) | field(field: string): NumericRangeSearchQuery {
    method boost (line 403) | boost(boost: number): NumericRangeSearchQuery {
  class DateRangeSearchQuery (line 414) | class DateRangeSearchQuery extends SearchQuery {
    method constructor (line 418) | constructor() {
    method start (line 422) | start(start: Date | string, inclusive?: boolean): DateRangeSearchQuery {
    method end (line 437) | end(end: Date | string, inclusive?: boolean): DateRangeSearchQuery {
    method field (line 452) | field(field: string): DateRangeSearchQuery {
    method dateTimeParser (line 457) | dateTimeParser(parser: string): DateRangeSearchQuery {
    method boost (line 462) | boost(boost: number): DateRangeSearchQuery {
  class TermRangeSearchQuery (line 473) | class TermRangeSearchQuery extends SearchQuery {
    method constructor (line 477) | constructor() {
    method min (line 481) | min(min: string, inclusive?: boolean): TermRangeSearchQuery {
    method max (line 491) | max(max: string, inclusive?: boolean): TermRangeSearchQuery {
    method field (line 501) | field(field: string): TermRangeSearchQuery {
    method boost (line 506) | boost(boost: number): TermRangeSearchQuery {
  class ConjunctionSearchQuery (line 517) | class ConjunctionSearchQuery extends SearchQuery {
    method constructor (line 521) | constructor(...queries: SearchQuery[]) {
    method and (line 544) | and(...args: SearchQuery[] | SearchQuery[][]): ConjunctionSearchQuery {
    method boost (line 553) | boost(boost: number): ConjunctionSearchQuery {
  class DisjunctionSearchQuery (line 564) | class DisjunctionSearchQuery extends SearchQuery {
    method constructor (line 568) | constructor(...queries: SearchQuery[]) {
    method or (line 591) | or(...args: SearchQuery[] | SearchQuery[][]): DisjunctionSearchQuery {
    method boost (line 600) | boost(boost: number): DisjunctionSearchQuery {
  class BooleanSearchQuery (line 611) | class BooleanSearchQuery extends SearchQuery {
    method constructor (line 617) | constructor() {
    method must (line 622) | must(query: ConjunctionSearchQuery): BooleanSearchQuery {
    method should (line 631) | should(query: DisjunctionSearchQuery): BooleanSearchQuery {
    method mustNot (line 639) | mustNot(query: DisjunctionSearchQuery): BooleanSearchQuery {
    method shouldMin (line 647) | shouldMin(shouldMin: number): BooleanSearchQuery {
    method boost (line 652) | boost(boost: number): BooleanSearchQuery {
    method toJSON (line 657) | toJSON(): any {
  class WildcardSearchQuery (line 681) | class WildcardSearchQuery extends SearchQuery {
    method constructor (line 685) | constructor(wildcard: string) {
    method field (line 691) | field(field: string): WildcardSearchQuery {
    method boost (line 696) | boost(boost: number): WildcardSearchQuery {
  class DocIdSearchQuery (line 707) | class DocIdSearchQuery extends SearchQuery {
    method constructor (line 711) | constructor(...ids: string[]) {
    method addDocIds (line 734) | addDocIds(...args: string[] | string[][]): DocIdSearchQuery {
    method field (line 743) | field(field: string): DocIdSearchQuery {
    method boost (line 748) | boost(boost: number): DocIdSearchQuery {
  class BooleanFieldSearchQuery (line 759) | class BooleanFieldSearchQuery extends SearchQuery {
    method constructor (line 763) | constructor(val: boolean) {
    method field (line 769) | field(field: string): BooleanFieldSearchQuery {
    method boost (line 774) | boost(boost: number): BooleanFieldSearchQuery {
  class TermSearchQuery (line 785) | class TermSearchQuery extends SearchQuery {
    method constructor (line 789) | constructor(term: string) {
    method field (line 795) | field(field: string): TermSearchQuery {
    method prefixLength (line 800) | prefixLength(prefixLength: number): TermSearchQuery {
    method fuzziness (line 805) | fuzziness(fuzziness: number): TermSearchQuery {
    method boost (line 810) | boost(boost: number): TermSearchQuery {
  class PhraseSearchQuery (line 821) | class PhraseSearchQuery extends SearchQuery {
    method constructor (line 825) | constructor(terms: string[]) {
    method field (line 831) | field(field: string): PhraseSearchQuery {
    method boost (line 836) | boost(boost: number): PhraseSearchQuery {
  class PrefixSearchQuery (line 847) | class PrefixSearchQuery extends SearchQuery {
    method constructor (line 851) | constructor(prefix: string) {
    method field (line 857) | field(field: string): PrefixSearchQuery {
    method boost (line 862) | boost(boost: number): PrefixSearchQuery {
  class MatchAllSearchQuery (line 873) | class MatchAllSearchQuery extends SearchQuery {
    method constructor (line 877) | constructor() {
  class MatchNoneSearchQuery (line 889) | class MatchNoneSearchQuery extends SearchQuery {
    method constructor (line 893) | constructor() {
  class GeoDistanceSearchQuery (line 905) | class GeoDistanceSearchQuery extends SearchQuery {
    method constructor (line 909) | constructor(lon: number, lat: number, distance: string) {
    method field (line 916) | field(field: string): GeoDistanceSearchQuery {
    method boost (line 921) | boost(boost: number): GeoDistanceSearchQuery {
  class GeoBoundingBoxSearchQuery (line 932) | class GeoBoundingBoxSearchQuery extends SearchQuery {
    method constructor (line 936) | constructor(tl_lon: number, tl_lat: number, br_lon: number, br_lat: nu...
    method field (line 943) | field(field: string): GeoBoundingBoxSearchQuery {
    method boost (line 948) | boost(boost: number): GeoBoundingBoxSearchQuery {
  class GeoPolygonSearchQuery (line 959) | class GeoPolygonSearchQuery extends SearchQuery {
    method constructor (line 963) | constructor(points: GeoPoint[]) {
    method field (line 970) | field(field: string): GeoPolygonSearchQuery {
    method boost (line 975) | boost(boost: number): GeoPolygonSearchQuery {

FILE: lib/searchsort.ts
  class SearchSort (line 8) | class SearchSort {
    method constructor (line 11) | constructor(data: any) {
    method toJSON (line 19) | toJSON(): any {
    method score (line 23) | static score(): ScoreSearchSort {
    method id (line 27) | static id(): IdSearchSort {
    method field (line 31) | static field(field: string): FieldSearchSort {
    method geoDistance (line 35) | static geoDistance(
  class ScoreSearchSort (line 49) | class ScoreSearchSort extends SearchSort {
    method constructor (line 53) | constructor() {
    method descending (line 59) | descending(descending: boolean): ScoreSearchSort {
  class IdSearchSort (line 70) | class IdSearchSort extends SearchSort {
    method constructor (line 74) | constructor() {
    method descending (line 80) | descending(descending: boolean): IdSearchSort {
  class FieldSearchSort (line 91) | class FieldSearchSort extends SearchSort {
    method constructor (line 95) | constructor(field: string) {
    method type (line 102) | type(type: string): FieldSearchSort {
    method mode (line 107) | mode(mode: string): FieldSearchSort {
    method missing (line 112) | missing(missing: boolean): FieldSearchSort {
    method descending (line 117) | descending(descending: boolean): FieldSearchSort {
  class GeoDistanceSearchSort (line 128) | class GeoDistanceSearchSort extends SearchSort {
    method constructor (line 132) | constructor(field: string, lat: number, lon: number) {
    method unit (line 140) | unit(unit: string): GeoDistanceSearchSort {
    method descending (line 145) | descending(descending: boolean): GeoDistanceSearchSort {

FILE: lib/searchtypes.ts
  class SearchMetaData (line 16) | class SearchMetaData {}
  class SearchRow (line 25) | class SearchRow {}
  class SearchResult (line 32) | class SearchResult {
    method constructor (line 46) | constructor(data: SearchResult) {
  type HighlightStyle (line 57) | enum HighlightStyle {
  type SearchScanConsistency (line 75) | enum SearchScanConsistency {
  type SearchQueryOptions (line 87) | interface SearchQueryOptions {
  class SearchRequest (line 199) | class SearchRequest {
    method constructor (line 203) | constructor(query: SearchQuery | VectorSearch) {
    method searchQuery (line 220) | get searchQuery(): SearchQuery | undefined {
    method vectorSearch (line 227) | get vectorSearch(): VectorSearch | undefined {
    method withSearchQuery (line 236) | withSearchQuery(query: SearchQuery): SearchRequest {
    method withVectorSearch (line 254) | withVectorSearch(search: VectorSearch): SearchRequest {
    method create (line 272) | static create(query: SearchQuery | VectorSearch): SearchRequest {

FILE: lib/streamablepromises.ts
  type ListenerFunc (line 7) | type ListenerFunc = (...args: any[]) => void
  type PromisifyEmitter (line 12) | interface PromisifyEmitter {
  type PromisifyFunc (line 19) | type PromisifyFunc<T> = (
  class StreamablePromise (line 28) | class StreamablePromise<T> extends EventEmitter implements Promise<T> {
    method constructor (line 35) | constructor(promisefyFn: PromisifyFunc<T>) {
    method promise (line 53) | private get promise(): Promise<T> {
    method _depromisify (line 62) | private _depromisify() {
    method then (line 67) | then<TResult1 = T, TResult2 = never>(
    method catch (line 80) | catch<TResult = never>(
    method finally (line 89) | finally(onfinally?: (() => void) | undefined | null): Promise<T> {
    method addListener (line 93) | addListener(eventName: string | symbol, listener: ListenerFunc): this {
    method on (line 98) | on(eventName: string | symbol, listener: ListenerFunc): this {
  method [Symbol.toStringTag] (line 106) | get [Symbol.toStringTag](): string {
  class StreamableRowPromise (line 116) | class StreamableRowPromise<T, TRow, TMeta> extends StreamablePromise<T> {
    method constructor (line 117) | constructor(fn: (rows: TRow[], meta: TMeta) => T) {
  class StreamableReplicasPromise (line 142) | class StreamableReplicasPromise<T, TRep> extends StreamablePromise<T> {
    method constructor (line 143) | constructor(fn: (replicas: TRep[]) => T) {
  class StreamableScanPromise (line 166) | class StreamableScanPromise<T, TRes> extends StreamablePromise<T> {
    method constructor (line 169) | constructor(fn: (results: TRes[]) => T) {
    method cancelRequested (line 187) | get cancelRequested(): boolean {
    method cancelStreaming (line 191) | cancelStreaming(): void {

FILE: lib/thresholdlogging.ts
  type ThresholdLoggingAttributeName (line 25) | enum ThresholdLoggingAttributeName {
  type IgnoredParentSpan (line 43) | enum IgnoredParentSpan {
  constant IGNORED_PARENT_SPAN_VALUES (line 69) | const IGNORED_PARENT_SPAN_VALUES = new Set<string>(
  class ThresholdLoggingSpanSnapshot (line 73) | class ThresholdLoggingSpanSnapshot {
    method constructor (line 87) | constructor(span: ThresholdLoggingSpan) {
  class PriorityQueue (line 106) | class PriorityQueue<T> {
    method constructor (line 112) | constructor(capacity?: number) {
    method droppedCount (line 119) | get droppedCount(): number {
    method _getInsertIndex (line 123) | _getInsertIndex(priority: number): number {
    method enqueue (line 137) | enqueue(item: T, priority: number): boolean {
    method peek (line 161) | peek(): T | undefined {
    method drain (line 165) | drain(): [T[], number] {
  class ThresholdLoggingReporter (line 182) | class ThresholdLoggingReporter {
    method constructor (line 192) | constructor(logger: CouchbaseLogger, interval: number, capacity?: numb...
    method addLogRecord (line 230) | addLogRecord(
    method start (line 238) | start() {
    method stop (line 245) | stop() {
    method report (line 253) | report(returnReport?: boolean): Record<string, any> | undefined {
  type ThresholdLogRecord (line 278) | type ThresholdLogRecord = Map<string, string | number>
  function serviceTypeFromString (line 283) | function serviceTypeFromString(serviceType: string): ServiceType {
  class ThresholdLoggingSpan (line 312) | class ThresholdLoggingSpan implements RequestSpan {
    method constructor (line 344) | constructor(
    method dispatchDuration (line 365) | get dispatchDuration(): number | undefined {
    method dispatchDuration (line 374) | set dispatchDuration(duration: number) {
    method encodeDuration (line 387) | get encodeDuration(): number | undefined {
    method encodeDuration (line 396) | set encodeDuration(duration: number) {
    method localId (line 409) | get localId(): string | undefined {
    method localSocket (line 418) | get localSocket(): string | undefined {
    method name (line 429) | get name(): string {
    method operationId (line 438) | get operationId(): string | undefined {
    method peerAddress (line 447) | get peerAddress(): string | undefined {
    method peerPort (line 456) | get peerPort(): number | undefined {
    method remoteSocket (line 465) | get remoteSocket(): string | undefined {
    method serverDuration (line 478) | get serverDuration(): number | undefined {
    method serviceType (line 487) | get serviceType(): ServiceType | undefined {
    method snapshot (line 496) | get snapshot(): ThresholdLoggingSpanSnapshot | undefined {
    method totalDispatchDuration (line 505) | get totalDispatchDuration(): number {
    method totalEncodeDuration (line 514) | get totalEncodeDuration(): number {
    method totalDuration (line 523) | get totalDuration(): number {
    method totalServerDuration (line 532) | get totalServerDuration(): number {
    method setAttribute (line 542) | setAttribute(key: string, value: AttributeValue): void {
    method addEvent (line 574) | addEvent(): void {}
    method setStatus (line 581) | setStatus(status: SpanStatus): void {
    method end (line 593) | end(endTime?: TimeInput): void {
    method _getTime (line 628) | private _getTime(input?: TimeInput): HiResTime {
  class ThresholdLoggingTracer (line 643) | class ThresholdLoggingTracer implements RequestTracer {
    method constructor (line 655) | constructor(logger: CouchbaseLogger, config: TracingConfig | null) {
    method reporter (line 700) | get reporter(): ThresholdLoggingReporter {
    method serviceThresholds (line 709) | get serviceThresholds(): Map<ServiceType, number> {
    method cleanup (line 720) | cleanup(): void {
    method requestSpan (line 732) | requestSpan(
    method checkThreshold (line 753) | checkThreshold(spanSnapshot: ThresholdLoggingSpanSnapshot): void {
    method _buildThresholdLogRecord (line 784) | _buildThresholdLogRecord(
    method _getServiceTypeThreshold (line 863) | _getServiceTypeThreshold(serviceType: ServiceType): number {

FILE: lib/tracing.ts
  type RequestSpan (line 13) | interface RequestSpan {
  type RequestTracer (line 55) | interface RequestTracer {

FILE: lib/transactions.ts
  class DocumentId (line 49) | class DocumentId {
    method constructor (line 50) | constructor() {
  type TransactionKeyspace (line 83) | interface TransactionKeyspace {
  type TransactionGetMultiMode (line 105) | enum TransactionGetMultiMode {
  type TransactionGetMultiReplicasFromPreferredServerGroupMode (line 125) | enum TransactionGetMultiReplicasFromPreferredServerGroupMode {
  type TransactionsCleanupConfig (line 145) | interface TransactionsCleanupConfig {
  type TransactionsQueryConfig (line 167) | interface TransactionsQueryConfig {
  type TransactionsConfig (line 179) | interface TransactionsConfig {
  type TransactionOptions (line 218) | interface TransactionOptions {
  class TransactionGetMultiSpec (line 235) | class TransactionGetMultiSpec {
    method constructor (line 236) | constructor(collection: Collection, id: string, transcoder?: Transcode...
    method _toCppDocumentId (line 260) | _toCppDocumentId(): CppDocumentId {
  class TransactionGetMultiReplicasFromPreferredServerGroupSpec (line 275) | class TransactionGetMultiReplicasFromPreferredServerGroupSpec {
    method constructor (line 276) | constructor(collection: Collection, id: string, transcoder?: Transcode...
    method _toCppDocumentId (line 300) | _toCppDocumentId(): CppDocumentId {
  class TransactionResult (line 315) | class TransactionResult {
    method constructor (line 319) | constructor(data: { transactionId: string; unstagingComplete: boolean ...
  class TransactionGetResult (line 341) | class TransactionGetResult {
    method constructor (line 345) | constructor(data: TransactionGetResult) {
  class TransactionGetMultiResultEntry (line 384) | class TransactionGetMultiResultEntry {
    method constructor (line 398) | constructor(data: { value?: any; error?: Error }) {
  class TransactionGetMultiResult (line 409) | class TransactionGetMultiResult {
    method constructor (line 413) | constructor(data: { content: TransactionGetMultiResultEntry[] }) {
    method exists (line 427) | exists(index: number): boolean {
    method contentAt (line 442) | contentAt(index: number): any {
  class TransactionGetMultiReplicasFromPreferredServerGroupResultEntry (line 461) | class TransactionGetMultiReplicasFromPreferredServerGroupResultEntry {
    method constructor (line 475) | constructor(data: { value?: any; error?: Error }) {
  class TransactionGetMultiReplicasFromPreferredServerGroupResult (line 486) | class TransactionGetMultiReplicasFromPreferredServerGroupResult {
    method constructor (line 490) | constructor(data: {
    method exists (line 506) | exists(index: number): boolean {
    method contentAt (line 521) | contentAt(index: number): any {
  class TransactionQueryResult (line 539) | class TransactionQueryResult<TRow = any> {
    method constructor (line 553) | constructor(data: QueryResult) {
  type TransactionQueryOptions (line 562) | interface TransactionQueryOptions {
  type TransactionGetOptions (line 649) | interface TransactionGetOptions {
  type TransactionGetReplicaFromPreferredServerGroupOptions (line 659) | interface TransactionGetReplicaFromPreferredServerGroupOptions {
  type TransactionGetMultiOptions (line 669) | interface TransactionGetMultiOptions {
  type TransactionGetMultiReplicasFromPreferredServerGroupOptions (line 679) | interface TransactionGetMultiReplicasFromPreferredServerGroupOptions {
  type TransactionInsertOptions (line 689) | interface TransactionInsertOptions {
  type TransactionReplaceOptions (line 699) | interface TransactionReplaceOptions {
  function translateGetResult (line 709) | function translateGetResult(
  function translateGetMultiResult (line 734) | function translateGetMultiResult(
  function translateGetMultiReplicasFromPreferredServerGroupResult (line 767) | function translateGetMultiReplicasFromPreferredServerGroupResult(
  class TransactionAttemptContext (line 803) | class TransactionAttemptContext {
    method constructor (line 810) | constructor(txns: Transactions, config?: TransactionOptions) {
    method impl (line 825) | get impl(): CppTransaction {
    method _newAttempt (line 832) | _newAttempt(): Promise<void> {
    method get (line 848) | async get(
    method getReplicaFromPreferredServerGroup (line 879) | async getReplicaFromPreferredServerGroup(
    method getMultiReplicasFromPreferredServerGroup (line 909) | async getMultiReplicasFromPreferredServerGroup(
    method getMulti (line 947) | async getMulti(
    method insert (line 979) | async insert(
    method replace (line 1016) | async replace(
    method remove (line 1058) | async remove(doc: TransactionGetResult): Promise<void> {
    method query (line 1087) | async query<TRow = any>(
    method _commit (line 1148) | async _commit(): Promise<TransactionResult> {
    method _rollback (line 1167) | async _rollback(): Promise<void> {
  class Transactions (line 1182) | class Transactions {
    method constructor (line 1189) | constructor(cluster: Cluster, config?: TransactionsConfig) {
    method impl (line 1227) | get impl(): CppTransactions {
    method _close (line 1234) | _close(): Promise<void> {
    method run (line 1249) | async run(

FILE: lib/transcoders.ts
  constant NF_JSON (line 1) | const NF_JSON = 0x00
  constant NF_RAW (line 2) | const NF_RAW = 0x02
  constant NF_UTF8 (line 3) | const NF_UTF8 = 0x04
  constant NF_MASK (line 4) | const NF_MASK = 0xff
  constant NF_UNKNOWN (line 5) | const NF_UNKNOWN = 0x100
  constant CF_NONE (line 7) | const CF_NONE = 0x00 << 24
  constant CF_PRIVATE (line 8) | const CF_PRIVATE = 0x01 << 24
  constant CF_JSON (line 9) | const CF_JSON = 0x02 << 24
  constant CF_RAW (line 10) | const CF_RAW = 0x03 << 24
  constant CF_UTF8 (line 11) | const CF_UTF8 = 0x04 << 24
  constant CF_MASK (line 12) | const CF_MASK = 0xff << 24
  type Transcoder (line 20) | interface Transcoder {
  class DefaultTranscoder (line 47) | class DefaultTranscoder implements Transcoder {
    method encode (line 54) | encode(value: any): [Buffer, number] {
    method decode (line 76) | decode(bytes: Buffer, flags: number): any {
  class RawBinaryTranscoder (line 119) | class RawBinaryTranscoder implements Transcoder {
    method encode (line 126) | encode(value: Buffer): [Buffer, number] {
    method decode (line 142) | decode(bytes: Buffer, flags: number): any {
  class RawStringTranscoder (line 180) | class RawStringTranscoder implements Transcoder {
    method encode (line 187) | encode(value: string): [Buffer, number] {
    method decode (line 203) | decode(bytes: Buffer, flags: number): string {
  class RawJsonTranscoder (line 240) | class RawJsonTranscoder implements Transcoder {
    method encode (line 247) | encode(value: string): [Buffer, number] {
    method decode (line 267) | decode(bytes: Buffer, flags: number): Buffer {

FILE: lib/usermanager.ts
  class Origin (line 23) | class Origin {
    method constructor (line 37) | constructor(data: Origin) {
    method _fromCppData (line 45) | static _fromCppData(data: CppManagementRbacOrigin): Origin {
  class Role (line 58) | class Role {
    method constructor (line 82) | constructor(data: Role) {
    method _fromCppData (line 92) | static _fromCppData(data: CppManagementRbacRole): Role {
    method _toCppData (line 104) | static _toCppData(data: Role): CppManagementRbacRole {
  class RoleAndDescription (line 119) | class RoleAndDescription extends Role {
    method constructor (line 133) | constructor(data: RoleAndDescription) {
    method _fromCppData (line 142) | static _fromCppData(
  class RoleAndOrigin (line 159) | class RoleAndOrigin extends Role {
    method constructor (line 168) | constructor(data: RoleAndOrigin) {
    method _fromCppData (line 176) | static _fromCppData(data: CppManagementRbacRoleAndOrigins): RoleAndOri...
  type IUser (line 195) | interface IUser {
  class User (line 227) | class User implements IUser {
    method constructor (line 256) | constructor(data: User) {
    method _fromCppData (line 266) | static _fromCppData(data: CppManagementRbacUser): User {
    method _toCppData (line 279) | static _toCppData(data: IUser): CppManagementRbacUser {
  class UserAndMetadata (line 308) | class UserAndMetadata extends User {
    method effectiveRolesAndOrigins (line 335) | get effectiveRolesAndOrigins(): RoleAndOrigin[] {
    method constructor (line 342) | constructor(data: UserAndMetadata) {
    method _fromCppData (line 353) | static _fromCppData(data: CppManagementRbacUserAndMetadata): UserAndMe...
  type IGroup (line 382) | interface IGroup {
  class Group (line 409) | class Group {
    method constructor (line 433) | constructor(data: Group) {
    method _fromCppData (line 443) | static _fromCppData(data: CppManagementRbacGroup): Group {
    method _toCppData (line 455) | static _toCppData(data: IGroup): CppManagementRbacGroup {
  type GetUserOptions (line 480) | interface GetUserOptions {
  type GetAllUsersOptions (line 500) | interface GetAllUsersOptions {
  type UpsertUserOptions (line 520) | interface UpsertUserOptions {
  type ChangePasswordOptions (line 540) | interface ChangePasswordOptions {
  type DropUserOptions (line 555) | interface DropUserOptions {
  type GetRolesOptions (line 575) | interface GetRolesOptions {
  type GetGroupOptions (line 590) | interface GetGroupOptions {
  type GetAllGroupsOptions (line 605) | interface GetAllGroupsOptions {
  type UpsertGroupOptions (line 620) | interface UpsertGroupOptions {
  type DropGroupOptions (line 635) | interface DropGroupOptions {
  class UserManager (line 653) | class UserManager {
    method constructor (line 659) | constructor(cluster: Cluster) {
    method observabilityInstruments (line 666) | get observabilityInstruments(): ObservabilityInstruments {
    method getUser (line 677) | async getUser(
    method getAllUsers (line 730) | async getAllUsers(
    method upsertUser (line 782) | async upsertUser(
    method changePassword (line 835) | async changePassword(
    method dropUser (line 886) | async dropUser(
    method getRoles (line 938) | async getRoles(
    method getGroup (line 988) | async getGroup(
    method getAllGroups (line 1039) | async getAllGroups(
    method upsertGroup (line 1089) | async upsertGroup(
    method dropGroup (line 1140) | async dropGroup(

FILE: lib/utilities.ts
  type Cas (line 11) | interface Cas {
  type CasInput (line 29) | type CasInput = Cas | string | Buffer
  type NodeCallback (line 36) | interface NodeCallback<T> {
  class PromiseHelper (line 43) | class PromiseHelper {
    method wrapAsync (line 47) | static wrapAsync<T, U extends Promise<T>>(
    method wrap (line 69) | static wrap<T>(
  class CompoundTimeout (line 97) | class CompoundTimeout {
    method constructor (line 104) | constructor(timeout: number | undefined) {
    method left (line 112) | left(): number | undefined {
    method expired (line 130) | expired(): boolean {
  function duraLevelToNsServerStr (line 143) | function duraLevelToNsServerStr(
  function nsServerStrToDuraLevel (line 170) | function nsServerStrToDuraLevel(
  function cbQsStringify (line 193) | function cbQsStringify(
  function parseExpiry (line 229) | function parseExpiry(expiry?: number | Date): number {
  function getErrorMessage (line 303) | function getErrorMessage(error: any): string {

FILE: lib/utilities_internal.ts
  function generateClientString (line 4) | function generateClientString(): string {

FILE: lib/vectorsearch.ts
  type VectorQueryCombination (line 9) | enum VectorQueryCombination {
  type VectorSearchOptions (line 24) | interface VectorSearchOptions {
  class VectorQuery (line 36) | class VectorQuery {
    method constructor (line 44) | constructor(fieldName: string, vector: number[] | string) {
    method toJSON (line 75) | toJSON(): any {
    method boost (line 99) | boost(boost: number): VectorQuery {
    method numCandidates (line 109) | numCandidates(numCandidates: number): VectorQuery {
    method prefilter (line 124) | prefilter(prefilter: SearchQuery): VectorQuery {
    method create (line 140) | static create(fieldName: string, vector: number[] | string): VectorQue...
  class VectorSearch (line 150) | class VectorSearch {
    method constructor (line 154) | constructor(queries: VectorQuery[], options?: VectorSearchOptions) {
    method queries (line 172) | get queries(): VectorQuery[] {
    method options (line 179) | get options(): VectorSearchOptions | undefined {
    method fromVectorQuery (line 188) | static fromVectorQuery(query: VectorQuery): VectorSearch {

FILE: lib/version.ts
  constant SDK_VERSION (line 4) | const SDK_VERSION = '4.7.0-dev';
  constant SDK_NAME (line 5) | const SDK_NAME = 'couchbase';

FILE: lib/viewexecutor.ts
  class ViewExecutor (line 26) | class ViewExecutor {
    method constructor (line 32) | constructor(bucket: Bucket) {
    method _cluster (line 39) | get _cluster(): Cluster {
    method observabilityInstruments (line 46) | get observabilityInstruments(): ObservabilityInstruments {
    method _processViewResponse (line 53) | static _processViewResponse<TValue = any, TKey = any>(
    method executePromise (line 99) | static executePromise<TValue = any, TKey = any>(
    method query (line 129) | query<TValue = any, TKey = any>(

FILE: lib/viewindexmanager.ts
  class DesignDocumentView (line 22) | class DesignDocumentView {
    method constructor (line 43) | constructor(...args: any[]) {
    method _toCppData (line 61) | static _toCppData(
    method _fromCppData (line 75) | static _fromCppData(
  class DesignDocument (line 90) | class DesignDocument {
    method View (line 96) | static get View(): any {
    method constructor (line 135) | constructor(...args: any[]) {
    method _fromNsData (line 155) | static _fromNsData(ddocName: string, ddocData: any): DesignDocument {
    method _toCppData (line 171) | static _toCppData(
    method _fromCppData (line 190) | static _fromCppData(ddoc: CppManagementViewsDesignDocument): DesignDoc...
  type GetAllDesignDocumentOptions (line 208) | interface GetAllDesignDocumentOptions {
  type GetDesignDocumentOptions (line 223) | interface GetDesignDocumentOptions {
  type UpsertDesignDocumentOptions (line 238) | interface UpsertDesignDocumentOptions {
  type DropDesignDocumentOptions (line 253) | interface DropDesignDocumentOptions {
  type PublishDesignDocumentOptions (line 268) | interface PublishDesignDocumentOptions {
  class ViewIndexManager (line 290) | class ViewIndexManager {
    method constructor (line 296) | constructor(bucket: Bucket) {
    method _cluster (line 303) | private get _cluster() {
    method observabilityInstruments (line 310) | get observabilityInstruments(): ObservabilityInstruments {
    method getAllDesignDocuments (line 342) | async getAllDesignDocuments(): Promise<DesignDocument[]> {
    method getDesignDocument (line 437) | async getDesignDocument(): Promise<DesignDocument> {
    method upsertDesignDocument (line 535) | async upsertDesignDocument(): Promise<void> {
    method dropDesignDocument (line 631) | async dropDesignDocument(): Promise<void> {
    method publishDesignDocument (line 706) | async publishDesignDocument(

FILE: lib/viewtypes.ts
  class ViewResult (line 8) | class ViewResult<TValue = any, TKey = any> {
    method constructor (line 22) | constructor(data: ViewResult) {
  class ViewMetaData (line 33) | class ViewMetaData {
    method constructor (line 47) | constructor(data: { totalRows?: number; debug?: any }) {
    method total_rows (line 58) | get total_rows(): number | undefined {
  class ViewRow (line 68) | class ViewRow<TValue = any, TKey = any> {
    method constructor (line 87) | constructor(data: ViewRow) {
  type DesignDocumentNamespace (line 99) | enum DesignDocumentNamespace {
  type ViewScanConsistency (line 117) | enum ViewScanConsistency {
  type ViewOrdering (line 147) | enum ViewOrdering {
  type ViewErrorMode (line 164) | enum ViewErrorMode {
  type ViewQueryKeyRange (line 183) | interface ViewQueryKeyRange {
  type ViewQueryIdRange (line 213) | interface ViewQueryIdRange {
  type ViewQueryOptions (line 228) | interface ViewQueryOptions {

FILE: scripts/buildPrebuild.js
  function buildPrebuild (line 5) | function buildPrebuild(

FILE: scripts/install.js
  function getLocalPrebuild (line 19) | function getLocalPrebuild() {
  function hasLocalPrebuild (line 24) | function hasLocalPrebuild() {
  function installPrebuild (line 28) | function installPrebuild() {

FILE: scripts/prebuilds.js
  constant CN_ROOT (line 24) | const CN_ROOT = path.resolve(path.dirname(__filename), '..')
  constant CXXCBC_CACHE_DIR (line 29) | const CXXCBC_CACHE_DIR =
  constant ENV_TRUE (line 32) | const ENV_TRUE = ['true', '1', 'y', 'yes', 'on']
  function buildBinary (line 34) | function buildBinary(
  function configureBinary (line 155) | function configureBinary(
  function getLocalPrebuild (line 257) | function getLocalPrebuild(dir) {
  function getLinuxType (line 276) | function getLinuxType(platform) {
  function getNodeMajorVersion (line 283) | function getNodeMajorVersion(version) {
  function getNodeVersion (line 288) | function getNodeVersion() {
  function getPrebuildsInfo (line 292) | function getPrebuildsInfo(dir) {
  function getSSLType (line 317) | function getSSLType(runtime, version) {
  function getSupportedPlatformPackages (line 327) | function getSupportedPlatformPackages(packageName) {
  function isElectron (line 350) | function isElectron() {
  function loadPrebuild (line 360) | function loadPrebuild(dir) {
  function matchBuild (line 364) | function matchBuild(name) {
  function matchingPlatformPrebuild (line 368) | function matchingPlatformPrebuild(filename, useElectronRuntime = false) {
  function readdirSync (line 409) | function readdirSync(dir) {
  function resolveLocalPrebuild (line 417) | async function resolveLocalPrebuild(src, dest) {
  function resolvePrebuild (line 434) | function resolvePrebuild(

FILE: scripts/prune.js
  function getMismatchedPlatformPackagesInfo (line 7) | function getMismatchedPlatformPackagesInfo(
  function getDirectorySize (line 41) | function getDirectorySize(dir) {
  function getPrebuildsInfo (line 57) | function getPrebuildsInfo() {
  function pruneCouchbaseHelp (line 67) | function pruneCouchbaseHelp() {

FILE: src/addondata.hpp
  type couchnode (line 4) | namespace couchnode
    class AddonData (line 7) | class AddonData
      method Init (line 10) | static inline void Init(Napi::Env env, Napi::Object exports)
      method AddonData (line 15) | static inline AddonData *fromEnv(Napi::Env &env)

FILE: src/binding.cpp
  type couchnode (line 13) | namespace couchnode
    function enable_protocol_logger (line 16) | Napi::Value enable_protocol_logger(const Napi::CallbackInfo &info)
    function shutdown_logger (line 29) | Napi::Value shutdown_logger(const Napi::CallbackInfo &info)
    function Init (line 39) | Napi::Object Init(Napi::Env env, Napi::Object exports)
  function Init (line 102) | Napi::Object Init(Napi::Env env, Napi::Object exports)

FILE: src/cas.cpp
  type couchnode (line 5) | namespace couchnode

FILE: src/cas.hpp
  type couchbase (line 6) | namespace couchbase
  type couchnode (line 11) | namespace couchnode
    class Cas (line 14) | class Cas : public Napi::ObjectWrap<Cas>

FILE: src/connection.cpp
  type couchnode (line 15) | namespace couchnode
    function jscbForward (line 18) | void jscbForward(Napi::Env env, Napi::Function callback, std::nullptr_...

FILE: src/connection.hpp
  type couchnode (line 9) | namespace couchnode
    class CallCookie (line 21) | class CallCookie
      method CallCookie (line 24) | CallCookie(Napi::Env env, Napi::Function jsCallback,
      method CallCookie (line 32) | CallCookie(CallCookie &o) = delete;
      method CallCookie (line 34) | CallCookie(CallCookie &&o)
      method invoke (line 39) | void invoke(FwdFunc &&callback)
    class Connection (line 49) | class Connection : public Napi::ObjectWrap<Connection>
      method cluster (line 62) | couchbase::core::cluster cluster() const
      method executeOp (line 229) | void executeOp(const std::string &opName, const Request &req,
      method executeOp (line 247) | void executeOp(const std::string &opName, const Request &req,

FILE: src/connection_autogen.cpp
  type couchnode (line 4) | namespace couchnode

FILE: src/constants.cpp
  type couchnode (line 13) | namespace couchnode
    function cbppEnumToJs (line 17) | static inline Napi::Object

FILE: src/constants.hpp
  type couchnode (line 4) | namespace couchnode
    class Constants (line 7) | class Constants

FILE: src/instance.cpp
  type couchnode (line 3) | namespace couchnode

FILE: src/instance.hpp
  type couchnode (line 8) | namespace couchnode
    class Instance (line 11) | class Instance

FILE: src/jstocbpp_autogen.hpp
  type couchnode (line 24) | namespace couchnode
    type js_to_cbpp_t<couchbase::core::management::analytics::dataset> (line 30) | struct js_to_cbpp_t<couchbase::core::management::analytics::dataset> {
      method from_js (line 31) | static inline couchbase::core::management::analytics::dataset
      method to_js (line 43) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::analytics::index> (line 59) | struct js_to_cbpp_t<couchbase::core::management::analytics::index> {
      method from_js (line 60) | static inline couchbase::core::management::analytics::index
      method to_js (line 72) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::analytics::azure_blob_external_link> (line 88) | struct js_to_cbpp_t<
      method from_js (line 90) | static inline couchbase::core::management::analytics::
      method to_js (line 113) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::analytics::
                        couchbase_link_encryption_settings> (line 139) | struct js_to_cbpp_t<couchbase::core::management::analytics::
      method from_js (line 141) | static inline couchbase::core::management::analytics::
      method to_js (line 159) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::analytics::couchbase_remote_link> (line 178) | struct js_to_cbpp_t<
      method from_js (line 180) | static inline couchbase::core::management::analytics::couchbase_remo...
      method to_js (line 197) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::analytics::s3_external_link> (line 219) | struct js_to_cbpp_t<couchbase::core::management::analytics::s3_externa...
      method from_js (line 220) | static inline couchbase::core::management::analytics::s3_external_link
      method to_js (line 238) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::management::cluster::bucket_settings> (line 259) | struct js_to_cbpp_t<couchbase::core::management::cluster::bucket_setti...
      method from_js (line 260) | static inline couchbase::core::management::cluster::bucket_settings
      method to_js (line 312) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::cluster::bucket_settings::node> (line 378) | struct js_to_cbpp_t<
      method from_js (line 380) | static inline couchbase::core::management::cluster::bucket_settings:...
      method to_js (line 394) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::views::design_document> (line 412) | struct js_to_cbpp_t<couchbase::core::management::views::design_documen...
      method from_js (line 413) | static inline couchbase::core::management::views::design_document
      method to_js (line 427) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::views::design_document::view> (line 447) | struct js_to_cbpp_t<couchbase::core::management::views::design_documen...
      method from_js (line 448) | static inline couchbase::core::management::views::design_document::view
      method to_js (line 459) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::management::eventing::function_keyspace> (line 474) | struct js_to_cbpp_t<couchbase::core::management::eventing::function_ke...
      method from_js (line 475) | static inline couchbase::core::management::eventing::function_keyspace
      method to_js (line 487) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::management::eventing::function_settings> (line 502) | struct js_to_cbpp_t<couchbase::core::management::eventing::function_se...
      method from_js (line 503) | static inline couchbase::core::management::eventing::function_settings
      method to_js (line 574) | static inline Napi::Value to_js(
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_bucket_binding> (line 667) | struct js_to_cbpp_t<
      method from_js (line 669) | static inline couchbase::core::management::eventing::function_bucket...
      method to_js (line 682) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_no_auth> (line 704) | struct js_to_cbpp_t<
      method from_js (line 706) | static inline couchbase::core::management::eventing::function_url_no...
      method to_js (line 713) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_basic> (line 724) | struct js_to_cbpp_t<
      method from_js (line 726) | static inline couchbase::core::management::eventing::function_url_au...
      method to_js (line 735) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_digest> (line 748) | struct js_to_cbpp_t<
      method from_js (line 750) | static inline couchbase::core::management::eventing::
      method to_js (line 760) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_bearer> (line 773) | struct js_to_cbpp_t<
      method from_js (line 775) | static inline couchbase::core::management::eventing::
      method to_js (line 784) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_binding> (line 796) | struct js_to_cbpp_t<
      method from_js (line 798) | static inline couchbase::core::management::eventing::function_url_bi...
      method to_js (line 835) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::management::eventing::function_constant_binding> (line 879) | struct js_to_cbpp_t<
      method from_js (line 881) | static inline couchbase::core::management::eventing::
      method to_js (line 891) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::eventing::function> (line 904) | struct js_to_cbpp_t<couchbase::core::management::eventing::function> {
      method from_js (line 905) | static inline couchbase::core::management::eventing::function
      method to_js (line 938) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::eventing::function_state> (line 990) | struct js_to_cbpp_t<couchbase::core::management::eventing::function_st...
      method from_js (line 991) | static inline couchbase::core::management::eventing::function_state
      method to_js (line 1014) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::eventing::status> (line 1045) | struct js_to_cbpp_t<couchbase::core::management::eventing::status> {
      method from_js (line 1046) | static inline couchbase::core::management::eventing::status
      method to_js (line 1058) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::role> (line 1074) | struct js_to_cbpp_t<couchbase::core::management::rbac::role> {
      method from_js (line 1075) | static inline couchbase::core::management::rbac::role
      method to_js (line 1089) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::role_and_description> (line 1105) | struct js_to_cbpp_t<couchbase::core::management::rbac::role_and_descri...
      method from_js (line 1106) | static inline couchbase::core::management::rbac::role_and_description
      method to_js (line 1122) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::origin> (line 1143) | struct js_to_cbpp_t<couchbase::core::management::rbac::origin> {
      method from_js (line 1144) | static inline couchbase::core::management::rbac::origin
      method to_js (line 1153) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::role_and_origins> (line 1166) | struct js_to_cbpp_t<couchbase::core::management::rbac::role_and_origin...
      method from_js (line 1167) | static inline couchbase::core::management::rbac::role_and_origins
      method to_js (line 1183) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::user> (line 1204) | struct js_to_cbpp_t<couchbase::core::management::rbac::user> {
      method from_js (line 1205) | static inline couchbase::core::management::rbac::user
      method to_js (line 1220) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::user_and_metadata> (line 1240) | struct js_to_cbpp_t<couchbase::core::management::rbac::user_and_metada...
      method from_js (line 1241) | static inline couchbase::core::management::rbac::user_and_metadata
      method to_js (line 1265) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::rbac::group> (line 1297) | struct js_to_cbpp_t<couchbase::core::management::rbac::group> {
      method from_js (line 1298) | static inline couchbase::core::management::rbac::group
      method to_js (line 1312) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::management::search::index> (line 1331) | struct js_to_cbpp_t<couchbase::core::management::search::index> {
      method from_js (line 1332) | static inline couchbase::core::management::search::index
      method to_js (line 1350) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::management::query_index> (line 1375) | struct js_to_cbpp_t<couchbase::management::query_index> {
      method from_js (line 1376) | static inline couchbase::management::query_index from_js(Napi::Value...
      method to_js (line 1397) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::topology::collections_manifest> (line 1422) | struct js_to_cbpp_t<couchbase::core::topology::collections_manifest> {
      method from_js (line 1423) | static inline couchbase::core::topology::collections_manifest
      method to_js (line 1435) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::topology::collections_manifest::collection> (line 1452) | struct js_to_cbpp_t<
      method from_js (line 1454) | static inline couchbase::core::topology::collections_manifest::colle...
      method to_js (line 1465) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::topology::collections_manifest::scope> (line 1482) | struct js_to_cbpp_t<couchbase::core::topology::collections_manifest::s...
      method from_js (line 1483) | static inline couchbase::core::topology::collections_manifest::scope
      method to_js (line 1495) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::diag::endpoint_diag_info> (line 1512) | struct js_to_cbpp_t<couchbase::core::diag::endpoint_diag_info> {
      method from_js (line 1513) | static inline couchbase::core::diag::endpoint_diag_info
      method to_js (line 1533) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::diag::diagnostics_result> (line 1557) | struct js_to_cbpp_t<couchbase::core::diag::diagnostics_result> {
      method from_js (line 1558) | static inline couchbase::core::diag::diagnostics_result
      method to_js (line 1572) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::diag::endpoint_ping_info> (line 1590) | struct js_to_cbpp_t<couchbase::core::diag::endpoint_ping_info> {
      method from_js (line 1591) | static inline couchbase::core::diag::endpoint_ping_info
      method to_js (line 1611) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::diag::ping_result> (line 1634) | struct js_to_cbpp_t<couchbase::core::diag::ping_result> {
      method from_js (line 1635) | static inline couchbase::core::diag::ping_result from_js(Napi::Value...
      method to_js (line 1648) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::prepend_response> (line 1665) | struct js_to_cbpp_t<couchbase::core::operations::prepend_response> {
      method from_js (line 1666) | static inline couchbase::core::operations::prepend_response
      method to_js (line 1677) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::prepend_request> (line 1694) | struct js_to_cbpp_t<couchbase::core::operations::prepend_request> {
      method from_js (line 1695) | static inline couchbase::core::operations::prepend_request from_js(
      method to_js (line 1714) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::prepend_request_with_legacy_durability> (line 1739) | struct js_to_cbpp_t<
      method from_js (line 1741) | static inline couchbase::core::operations::
      method to_js (line 1765) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::exists_response> (line 1792) | struct js_to_cbpp_t<couchbase::core::operations::exists_response> {
      method from_js (line 1793) | static inline couchbase::core::operations::exists_response
      method to_js (line 1810) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::exists_request> (line 1833) | struct js_to_cbpp_t<couchbase::core::operations::exists_request> {
      method from_js (line 1834) | static inline couchbase::core::operations::exists_request from_js(
      method to_js (line 1849) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::http_noop_response> (line 1869) | struct js_to_cbpp_t<couchbase::core::operations::http_noop_response> {
      method from_js (line 1870) | static inline couchbase::core::operations::http_noop_response
      method to_js (line 1879) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::http_noop_request> (line 1893) | struct js_to_cbpp_t<couchbase::core::operations::http_noop_request> {
      method from_js (line 1894) | static inline couchbase::core::operations::http_noop_request from_js(
      method to_js (line 1909) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::unlock_response> (line 1927) | struct js_to_cbpp_t<couchbase::core::operations::unlock_response> {
      method from_js (line 1928) | static inline couchbase::core::operations::unlock_response
      method to_js (line 1938) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::unlock_request> (line 1953) | struct js_to_cbpp_t<couchbase::core::operations::unlock_request> {
      method from_js (line 1954) | static inline couchbase::core::operations::unlock_request from_js(
      method to_js (line 1970) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_all_replicas_response> (line 1991) | struct js_to_cbpp_t<couchbase::core::operations::get_all_replicas_resp...
      method from_js (line 1992) | static inline couchbase::core::operations::get_all_replicas_response
      method to_js (line 2004) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::get_all_replicas_response::entry> (line 2023) | struct js_to_cbpp_t<
      method from_js (line 2025) | static inline couchbase::core::operations::get_all_replicas_response...
      method to_js (line 2036) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_all_replicas_request> (line 2052) | struct js_to_cbpp_t<couchbase::core::operations::get_all_replicas_requ...
      method from_js (line 2053) | static inline couchbase::core::operations::get_all_replicas_request ...
      method to_js (line 2067) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::upsert_response> (line 2085) | struct js_to_cbpp_t<couchbase::core::operations::upsert_response> {
      method from_js (line 2086) | static inline couchbase::core::operations::upsert_response
      method to_js (line 2097) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::upsert_request> (line 2114) | struct js_to_cbpp_t<couchbase::core::operations::upsert_request> {
      method from_js (line 2115) | static inline couchbase::core::operations::upsert_request from_js(
      method to_js (line 2136) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::upsert_request_with_legacy_durability> (line 2164) | struct js_to_cbpp_t<
      method from_js (line 2166) | static inline couchbase::core::operations::
      method to_js (line 2192) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::operations::get_any_replica_response> (line 2223) | struct js_to_cbpp_t<couchbase::core::operations::get_any_replica_respo...
      method from_js (line 2224) | static inline couchbase::core::operations::get_any_replica_response
      method to_js (line 2237) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_any_replica_request> (line 2256) | struct js_to_cbpp_t<couchbase::core::operations::get_any_replica_reque...
      method from_js (line 2257) | static inline couchbase::core::operations::get_any_replica_request f...
      method to_js (line 2271) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::append_response> (line 2289) | struct js_to_cbpp_t<couchbase::core::operations::append_response> {
      method from_js (line 2290) | static inline couchbase::core::operations::append_response
      method to_js (line 2301) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::append_request> (line 2318) | struct js_to_cbpp_t<couchbase::core::operations::append_request> {
      method from_js (line 2319) | static inline couchbase::core::operations::append_request from_js(
      method to_js (line 2338) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::append_request_with_legacy_durability> (line 2363) | struct js_to_cbpp_t<
      method from_js (line 2365) | static inline couchbase::core::operations::
      method to_js (line 2389) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::operations::query_response> (line 2417) | struct js_to_cbpp_t<couchbase::core::operations::query_response> {
      method from_js (line 2418) | static inline couchbase::core::operations::query_response
      method to_js (line 2435) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::query_response::query_metrics> (line 2460) | struct js_to_cbpp_t<
      method from_js (line 2462) | static inline couchbase::core::operations::query_response::query_met...
      method to_js (line 2482) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::query_response::query_problem> (line 2509) | struct js_to_cbpp_t<
      method from_js (line 2511) | static inline couchbase::core::operations::query_response::query_pro...
      method to_js (line 2523) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::query_response::query_meta_data> (line 2539) | struct js_to_cbpp_t<
      method from_js (line 2541) | static inline couchbase::core::operations::query_response::query_met...
      method to_js (line 2565) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::query_request> (line 2600) | struct js_to_cbpp_t<couchbase::core::operations::query_request> {
      method from_js (line 2601) | static inline couchbase::core::operations::query_request from_js(
      method to_js (line 2654) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::replace_response> (line 2718) | struct js_to_cbpp_t<couchbase::core::operations::replace_response> {
      method from_js (line 2719) | static inline couchbase::core::operations::replace_response
      method to_js (line 2730) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::replace_request> (line 2747) | struct js_to_cbpp_t<couchbase::core::operations::replace_request> {
      method from_js (line 2748) | static inline couchbase::core::operations::replace_request from_js(
      method to_js (line 2770) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::replace_request_with_legacy_durability> (line 2799) | struct js_to_cbpp_t<
      method from_js (line 2801) | static inline couchbase::core::operations::
      method to_js (line 2828) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_and_touch_response> (line 2859) | struct js_to_cbpp_t<couchbase::core::operations::get_and_touch_respons...
      method from_js (line 2860) | static inline couchbase::core::operations::get_and_touch_response
      method to_js (line 2872) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_and_touch_request> (line 2890) | struct js_to_cbpp_t<couchbase::core::operations::get_and_touch_request> {
      method from_js (line 2891) | static inline couchbase::core::operations::get_and_touch_request fro...
      method to_js (line 2907) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::remove_response> (line 2928) | struct js_to_cbpp_t<couchbase::core::operations::remove_response> {
      method from_js (line 2929) | static inline couchbase::core::operations::remove_response
      method to_js (line 2940) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::remove_request> (line 2957) | struct js_to_cbpp_t<couchbase::core::operations::remove_request> {
      method from_js (line 2958) | static inline couchbase::core::operations::remove_request from_js(
      method to_js (line 2976) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::remove_request_with_legacy_durability> (line 2999) | struct js_to_cbpp_t<
      method from_js (line 3001) | static inline couchbase::core::operations::
      method to_js (line 3024) | static inline Napi::Value to_js(
    type js_to_cbpp_t<couchbase::core::operations::get_response> (line 3050) | struct js_to_cbpp_t<couchbase::core::operations::get_response> {
      method from_js (line 3051) | static inline couchbase::core::operations::get_response
      method to_js (line 3063) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_request> (line 3081) | struct js_to_cbpp_t<couchbase::core::operations::get_request> {
      method from_js (line 3082) | static inline couchbase::core::operations::get_request from_js(
      method to_js (line 3097) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response> (line 3116) | struct js_to_cbpp_t<
      method from_js (line 3118) | static inline couchbase::core::operations::lookup_in_all_replicas_re...
      method to_js (line 3130) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response::entry> (line 3150) | struct js_to_cbpp_t<
      method from_js (line 3152) | static inline couchbase::core::operations::lookup_in_all_replicas_re...
      method to_js (line 3167) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response::entry::
        lookup_in_entry> (line 3185) | struct js_to_cbpp_t<
      method from_js (line 3188) | static inline couchbase::core::operations::lookup_in_all_replicas_re...
      method to_js (line 3207) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_request> (line 3230) | struct js_to_cbpp_t<
      method from_js (line 3232) | static inline couchbase::core::operations::lookup_in_all_replicas_re...
      method to_js (line 3250) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::analytics_response> (line 3275) | struct js_to_cbpp_t<couchbase::core::operations::analytics_response> {
      method from_js (line 3276) | static inline couchbase::core::operations::analytics_response
      method to_js (line 3288) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_metrics> (line 3307) | struct js_to_cbpp_t<
      method from_js (line 3309) | static inline couchbase::core::operations::analytics_response::
      method to_js (line 3330) | static inline Napi::Value to_js(
    type js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_problem> (line 3355) | struct js_to_cbpp_t<
      method from_js (line 3357) | static inline couchbase::core::operations::analytics_response::
      method to_js (line 3368) | static inline Napi::Value to_js(
    type js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_meta_data> (line 3381) | struct js_to_cbpp_t<
      method from_js (line 3383) | static inline couchbase::core::operations::analytics_response::
      method to_js (line 3409) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::analytics_request> (line 3441) | struct js_to_cbpp_t<couchbase::core::operations::analytics_request> {
      method from_js (line 3442) | static inline couchbase::core::operations::analytics_request from_js(
      method to_js (line 3474) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_projected_response> (line 3517) | struct js_to_cbpp_t<couchbase::core::operations::get_projected_respons...
      method from_js (line 3518) | static inline couchbase::core::operations::get_projected_response
      method to_js (line 3532) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::get_projected_request> (line 3552) | struct js_to_cbpp_t<couchbase::core::operations::get_projected_request> {
      method from_js (line 3553) | static inline couchbase::core::operations::get_projected_request fro...
      method to_js (line 3575) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::decrement_response> (line 3603) | struct js_to_cbpp_t<couchbase::core::operations::decrement_response> {
      method from_js (line 3604) | static inline couchbase::core::operations::decrement_response
      method to_js (line 3616) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::decrement_request> (line 3634) | struct js_to_cbpp_t<couchbase::core::operations::decrement_request> {
      method from_js (line 3635) | static inline couchbase::core::operations::decrement_request from_js(
      method to_js (line 3656) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbase::core::operations::decrement_request_with_legacy_durability> (line 3682) | struct js_to_cbpp_t<
      method from_js (line 3684) | static inline couchbase::core::operations::
      method to_js (line 3710) | static inline Napi::Value
    type js_to_cbpp_t<couchbase::core::operations::search_response> (line 3738) | struct js_to_cbpp_t<couchbase::core::operations::search_response> {
      method from_js (line 3739) | static inline couchbase::core::operations::search_response
      method to_js (line 3759) | static inline Napi::Value
    type js_to_cbpp_t<
    couchbas
Condensed preview — 176 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,480K chars).
[
  {
    "path": ".clang-format",
    "chars": 441,
    "preview": "---\nBasedOnStyle: LLVM\nStandard: Cpp11\nBreakBeforeBraces: Linux\nColumnLimit: '80'\nIndentWidth: 4\nDerivePointerAlignment:"
  },
  {
    "path": ".editorconfig",
    "chars": 207,
    "preview": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_"
  },
  {
    "path": ".gitignore",
    "chars": 533,
    "preview": "# Local test configuration\nconfig.json\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n\n# Compiled Dynamic libraries\n*.so\n\n# Com"
  },
  {
    "path": ".gitmodules",
    "chars": 138,
    "preview": "[submodule \"deps/couchbase-cxx-client\"]\n\tpath = deps/couchbase-cxx-client\n\turl = https://github.com/couchbaselabs/couchb"
  },
  {
    "path": ".istanbul.yml",
    "chars": 48,
    "preview": "instrumentation:\n  excludes: ['lib/binding.ts']\n"
  },
  {
    "path": ".npmignore",
    "chars": 629,
    "preview": "# Local test configuration\nconfig.json\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n\n# Compiled Dynamic libraries\n*.so\n\n# Com"
  },
  {
    "path": ".prettierrc",
    "chars": 96,
    "preview": "{\n  \"semi\": false,\n  \"arrowParens\": \"always\",\n  \"singleQuote\": true,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": "BUILDING.md",
    "chars": 4650,
    "preview": "# Setup\n\nMake sure to have cloned the [SDK repository](https://github.com/couchbase/couchnode.git) and have the submodul"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 10614,
    "preview": "cmake_minimum_required(VERSION 3.19)\ncmake_policy(SET CMP0042 NEW)\ncmake_policy(SET CMP0048 NEW)\ninclude(FetchContent)\ns"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 5202,
    "preview": "# Contributing\n\nIn addition to filing bugs, you may contribute by submitting patches to fix bugs in the library. Contrib"
  },
  {
    "path": "LICENSE",
    "chars": 18154,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "LOGGING.md",
    "chars": 10069,
    "preview": "# Quick Start\n\nThe simplest way to enable logging is to set the `CNLOGLEVEL` environment variable:\n\n```console\nCNLOGLEVE"
  },
  {
    "path": "Makefile",
    "chars": 575,
    "preview": "all: binding src/ deps/\n\t@node-gyp build\n\nbinding: binding.gyp\n\t@node-gyp configure\n\nclean:\n\t@node-gyp clean\n\ninstall:\n\t"
  },
  {
    "path": "README.md",
    "chars": 6374,
    "preview": "# Couchbase Node.js Client\n\nThe Node.js SDK library allows you to connect to a Couchbase cluster from\nNode.js. It is a n"
  },
  {
    "path": "couchbase-sdk-nodejs-black-duck-manifest.yaml",
    "chars": 40,
    "preview": "include-projects:\n  - couchbase-sdk-cxx\n"
  },
  {
    "path": "eslint.config.mjs",
    "chars": 4675,
    "preview": "import js from '@eslint/js'\nimport tseslint from 'typescript-eslint'\nimport pluginN from 'eslint-plugin-n'\nimport plugin"
  },
  {
    "path": "examples/observability/combined/docker-compose.yml",
    "chars": 874,
    "preview": "services:\n  otel-collector:\n    image: otel/opentelemetry-collector:latest\n    command: [\"--config=/etc/otel-collector-c"
  },
  {
    "path": "examples/observability/combined/otel-collector-config.yml",
    "chars": 438,
    "preview": "receivers:\n  otlp:\n    protocols:\n      grpc:\n        endpoint: 0.0.0.0:4317\n\nexporters:\n  prometheus:\n    endpoint: \"0."
  },
  {
    "path": "examples/observability/combined/otel-otlp-metrics-and-tracing.js",
    "chars": 9205,
    "preview": "/**\n * OpenTelemetry Tracing and Metrics Example (JavaScript)\n *\n * This example demonstrates how to use OpenTelemetry t"
  },
  {
    "path": "examples/observability/combined/otel-otlp-metrics-and-tracing.ts",
    "chars": 9464,
    "preview": "/**\n * OpenTelemetry Tracing and Metrics Example (TypeScript)\n *\n * This example demonstrates how to use OpenTelemetry t"
  },
  {
    "path": "examples/observability/combined/prometheus.yml",
    "chars": 139,
    "preview": "global:\n  scrape_interval: 5s\n\nscrape_configs:\n  - job_name: 'otel-collector'\n    static_configs:\n      - targets: ['ote"
  },
  {
    "path": "examples/observability/metrics/docker-compose.yml",
    "chars": 651,
    "preview": "services:\n  otel-collector:\n    image: otel/opentelemetry-collector:latest\n    command: [\"--config=/etc/otel-collector-c"
  },
  {
    "path": "examples/observability/metrics/otel-collector-config.yml",
    "chars": 222,
    "preview": "receivers:\n  otlp:\n    protocols:\n      grpc:\n        endpoint: 0.0.0.0:4317\n\nexporters:\n  prometheus:\n    endpoint: \"0."
  },
  {
    "path": "examples/observability/metrics/otel-otlp-metrics-exporter.ts",
    "chars": 7063,
    "preview": "/**\n * OpenTelemetry Metrics with Prometheus UI Example (TypeScript)\n *\n * This example demonstrates how to use OpenTele"
  },
  {
    "path": "examples/observability/metrics/prometheus.yml",
    "chars": 139,
    "preview": "global:\n  scrape_interval: 5s\n\nscrape_configs:\n  - job_name: 'otel-collector'\n    static_configs:\n      - targets: ['ote"
  },
  {
    "path": "examples/observability/tracing/console/otel-console-exporter.js",
    "chars": 4099,
    "preview": "const {\n    defaultResource,\n    resourceFromAttributes,\n  } = require('@opentelemetry/resources')\n  const { ATTR_SERVIC"
  },
  {
    "path": "examples/observability/tracing/console/otel-console-exporter.ts",
    "chars": 3852,
    "preview": "import {\n  defaultResource,\n  resourceFromAttributes,\n} from '@opentelemetry/resources'\nimport { ATTR_SERVICE_NAME } fro"
  },
  {
    "path": "examples/observability/tracing/jaeger/docker-compose.yml",
    "chars": 204,
    "preview": "services:\n  jaeger:\n    image: jaegertracing/all-in-one:latest\n    environment:\n      - COLLECTOR_OTLP_ENABLED=true\n    "
  },
  {
    "path": "examples/observability/tracing/jaeger/otel-otlp-tracing-exporter.ts",
    "chars": 7507,
    "preview": "/**\n * OpenTelemetry Tracing with Jaeger UI Example (TypeScript)\n *\n * This example demonstrates how to use OpenTelemetr"
  },
  {
    "path": "lib/analyticsexecutor.ts",
    "chars": 5444,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport {\n  AnalyticsQueryOptions,\n  AnalyticsResult,\n  AnalyticsMetaData,\n  Analyt"
  },
  {
    "path": "lib/analyticsindexmanager.ts",
    "chars": 59487,
    "preview": "import { Cluster } from './cluster'\nimport {\n  CppManagementAnalyticsDataset,\n  CppManagementAnalyticsIndex,\n  CppManage"
  },
  {
    "path": "lib/analyticstypes.ts",
    "chars": 6358,
    "preview": "import { RequestSpan } from './tracing'\n\n/**\n * Represents the status of an analytics query.\n *\n * @category Analytics\n "
  },
  {
    "path": "lib/authenticators.ts",
    "chars": 4266,
    "preview": "/**\n * IPasswordAuthenticator specifies an authenticator which uses an RBAC\n * username and password to authenticate wit"
  },
  {
    "path": "lib/binarycollection.ts",
    "chars": 7807,
    "preview": "import { Collection } from './collection'\nimport { CounterResult, MutationResult } from './crudoptypes'\nimport { Durabil"
  },
  {
    "path": "lib/binding.ts",
    "chars": 120205,
    "preview": "/*\neslint\njsdoc/require-jsdoc: off,\n@typescript-eslint/no-empty-interface: off\n*/\nimport path from 'path'\n\n// TODO(Brett"
  },
  {
    "path": "lib/bindingutilities.ts",
    "chars": 62058,
    "preview": "import { AnalyticsScanConsistency, AnalyticsStatus } from './analyticstypes'\nimport {\n  AnalyticsEncryptionLevel,\n  Couc"
  },
  {
    "path": "lib/bucket.ts",
    "chars": 5246,
    "preview": "import { CppConnection } from './binding'\nimport { Cluster } from './cluster'\nimport { Collection } from './collection'\n"
  },
  {
    "path": "lib/bucketmanager.ts",
    "chars": 24374,
    "preview": "import { CppManagementClusterBucketSettings } from './binding'\nimport {\n  bucketTypeToCpp,\n  bucketCompressionModeToCpp,"
  },
  {
    "path": "lib/cluster.ts",
    "chars": 32713,
    "preview": "import { AnalyticsExecutor } from './analyticsexecutor'\nimport { AnalyticsIndexManager } from './analyticsindexmanager'\n"
  },
  {
    "path": "lib/collection.ts",
    "chars": 75070,
    "preview": "import {\n  IncrementOptions,\n  DecrementOptions,\n  AppendOptions,\n  PrependOptions,\n  BinaryCollection,\n} from './binary"
  },
  {
    "path": "lib/collectionmanager.ts",
    "chars": 18429,
    "preview": "import {\n  CppTopologyCollectionsManifestCollection,\n  CppTopologyCollectionsManifestScope,\n} from './binding'\nimport { "
  },
  {
    "path": "lib/configProfile.ts",
    "chars": 3230,
    "preview": "import { ConnectOptions } from './cluster'\n\n/**\n * IConfigProfile specifies a ConfigProfile which applies\n * specified o"
  },
  {
    "path": "lib/connspec.ts",
    "chars": 3152,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport * as qs from 'querystring'\n\nconst partsMatcher =\n  /((.*):\\/\\/)?(([^/?:]*)("
  },
  {
    "path": "lib/couchbase.ts",
    "chars": 3217,
    "preview": "import binding from './binding'\nimport { Cluster, ConnectOptions } from './cluster'\nimport { NodeCallback } from './util"
  },
  {
    "path": "lib/crudoptypes.ts",
    "chars": 6493,
    "preview": "import { MutationToken } from './mutationstate'\nimport { Cas } from './utilities'\n\n/**\n * Contains the results of a Get "
  },
  {
    "path": "lib/datastructures.ts",
    "chars": 26634,
    "preview": "import { Collection } from './collection'\nimport { CouchbaseError, PathExistsError, PathInvalidError } from './errors'\ni"
  },
  {
    "path": "lib/diagnosticsexecutor.ts",
    "chars": 3650,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport {\n  endpointStateFromCpp,\n  errorFromCpp,\n  pingStateFromCpp,\n  serviceType"
  },
  {
    "path": "lib/diagnosticstypes.ts",
    "chars": 7447,
    "preview": "import { ServiceType } from './generaltypes'\n\n/**\n * Represents the status of an an endpoint in a diagnostics report.\n *"
  },
  {
    "path": "lib/errorcontexts.ts",
    "chars": 6935,
    "preview": "import { Cas } from './utilities'\n\n/**\n * Specific error context types.\n *\n * @category Error Handling\n */\ntype ErrorCon"
  },
  {
    "path": "lib/errors.ts",
    "chars": 26555,
    "preview": "import './errorcontexts'\nimport {\n  ErrorContext,\n  KeyValueErrorContext,\n  ViewErrorContext,\n  QueryErrorContext,\n  Sea"
  },
  {
    "path": "lib/eventingfunctionmanager.ts",
    "chars": 45190,
    "preview": "import { Cluster } from './cluster'\nimport { QueryScanConsistency } from './querytypes'\nimport { NodeCallback, PromiseHe"
  },
  {
    "path": "lib/generaltypes.ts",
    "chars": 2708,
    "preview": "/**\n * Represents the various service types available.\n */\nexport enum ServiceType {\n  /**\n   * The key-value service, r"
  },
  {
    "path": "lib/httpexecutor.ts",
    "chars": 4079,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport binding from './binding'\nimport { CppConnection } from './binding'\nimport {"
  },
  {
    "path": "lib/logger.ts",
    "chars": 7764,
    "preview": "/**\n * Represents log levels in ascending order of severity.\n *\n * Log levels follow standard severity conventions.\n *\n "
  },
  {
    "path": "lib/loggingmeter.ts",
    "chars": 7160,
    "preview": "/**\n * @internal\n */\n\nimport * as hdr from 'hdr-histogram-js'\nimport { MeterError } from './errors'\nimport { CouchbaseLo"
  },
  {
    "path": "lib/metrics.ts",
    "chars": 1039,
    "preview": "/**\n * @internal\n */\n\n/**\n * Abstract interface for recording metric values.\n *\n * Implementations should record values "
  },
  {
    "path": "lib/mutationstate.ts",
    "chars": 2316,
    "preview": "import { CppMutationToken } from './binding'\n\n/**\n * Represents the mutation token returned by the server.\n *\n * @see {@"
  },
  {
    "path": "lib/observability.ts",
    "chars": 1966,
    "preview": "import {\n  CppError,\n  CppObservableRequests,\n  CppObservableResponse,\n  ObservableBindingFunc,\n} from './binding'\nimpor"
  },
  {
    "path": "lib/observabilityhandler.ts",
    "chars": 24958,
    "preview": "import {\n  CppDocumentId,\n  CppDurabilityLevel,\n  CppWrapperSdkChildSpan,\n  CppWrapperSdkSpan,\n  HiResTime,\n} from './bi"
  },
  {
    "path": "lib/observabilitytypes.ts",
    "chars": 12716,
    "preview": "import { HiResTime } from './binding'\nimport { Meter } from './metrics'\nimport { RequestTracer } from './tracing'\n\n/**\n "
  },
  {
    "path": "lib/observabilityutilities.ts",
    "chars": 6174,
    "preview": "/*\neslint\njsdoc/require-jsdoc: off,\n@typescript-eslint/no-empty-interface: off\n*/\nimport { AnalyticsQueryOptions } from "
  },
  {
    "path": "lib/otelmeter.ts",
    "chars": 3878,
    "preview": "import { Meter, ValueRecorder } from './metrics'\nimport { SDK_NAME, SDK_VERSION } from './version'\n\n// This block is com"
  },
  {
    "path": "lib/oteltracer.ts",
    "chars": 5058,
    "preview": "import {\n  AttributeValue,\n  SpanStatus,\n  TimeInput,\n  SpanStatusCode,\n} from './observabilitytypes'\nimport { SDK_VERSI"
  },
  {
    "path": "lib/queryexecutor.ts",
    "chars": 6812,
    "preview": "import { CppError, CppQueryResponse } from './binding'\nimport {\n  errorFromCpp,\n  mutationStateToCpp,\n  queryProfileToCp"
  },
  {
    "path": "lib/queryindexmanager.ts",
    "chars": 34054,
    "preview": "import { CppQueryContext } from './binding'\nimport { Cluster } from './cluster'\nimport { Collection } from './collection"
  },
  {
    "path": "lib/querytypes.ts",
    "chars": 8702,
    "preview": "import { MutationState } from './mutationstate'\nimport { RequestSpan } from './tracing'\n\n/**\n * Represents the status of"
  },
  {
    "path": "lib/rangeScan.ts",
    "chars": 2121,
    "preview": "/**\n * Represents a search term for a RangeScan.\n *\n * @see {@link RangeScan}\n * @category Key-Value\n */\nexport class Sc"
  },
  {
    "path": "lib/scope.ts",
    "chars": 5595,
    "preview": "import { AnalyticsExecutor } from './analyticsexecutor'\nimport {\n  AnalyticsMetaData,\n  AnalyticsQueryOptions,\n  Analyti"
  },
  {
    "path": "lib/scopeeventingfunctionmanager.ts",
    "chars": 15576,
    "preview": "import { Cluster } from './cluster'\nimport { NodeCallback, PromiseHelper } from './utilities'\nimport { CppManagementEven"
  },
  {
    "path": "lib/scopesearchindexmanager.ts",
    "chars": 20711,
    "preview": "import { Cluster } from './cluster'\nimport { NodeCallback, PromiseHelper } from './utilities'\nimport {\n  GetSearchIndexO"
  },
  {
    "path": "lib/sdspecs.ts",
    "chars": 16604,
    "preview": "import binding, { CppProtocolSubdocOpcode } from './binding'\n\n/**\n * Represents a macro that can be passed to a lookup-i"
  },
  {
    "path": "lib/sdutils.ts",
    "chars": 3350,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\n'use strict'\n\ninterface SdPathPartProp {\n  type: 'property'\n  path: string\n}\n\ninte"
  },
  {
    "path": "lib/searchexecutor.ts",
    "chars": 5998,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport {\n  mutationStateToCpp,\n  searchHighlightStyleToCpp,\n  searchScanConsistenc"
  },
  {
    "path": "lib/searchfacet.ts",
    "chars": 1925,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\n\n/**\n * Provides the ability to specify facets for a search query.\n *\n * @category"
  },
  {
    "path": "lib/searchindexmanager.ts",
    "chars": 25317,
    "preview": "import { Cluster } from './cluster'\nimport { NodeCallback, PromiseHelper } from './utilities'\nimport { CppManagementSear"
  },
  {
    "path": "lib/searchquery.ts",
    "chars": 19573,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\n\n/**\n * Specifies how the individual match terms should be logically concatenated."
  },
  {
    "path": "lib/searchsort.ts",
    "chars": 2623,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\n\n/**\n * Provides the ability to specify sorting for a search query.\n *\n * @categor"
  },
  {
    "path": "lib/searchtypes.ts",
    "chars": 6837,
    "preview": "import { InvalidArgumentError } from './errors'\nimport { MutationState } from './mutationstate'\nimport { SearchFacet } f"
  },
  {
    "path": "lib/streamablepromises.ts",
    "chars": 4896,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport EventEmitter from 'events'\n\n/**\n * @internal\n */\ntype ListenerFunc = (...ar"
  },
  {
    "path": "lib/thresholdlogging.ts",
    "chars": 24180,
    "preview": "import { HiResTime } from './binding'\nimport { TracingConfig } from './cluster'\nimport { ServiceType } from './generalty"
  },
  {
    "path": "lib/tracing.ts",
    "chars": 1990,
    "preview": "import {\n    AttributeValue,\n    SpanStatus,\n    TimeInput,\n  } from './observabilitytypes'\n\n/**\n * Represents a single "
  },
  {
    "path": "lib/transactions.ts",
    "chars": 31549,
    "preview": "import {\n  CppDocumentId,\n  CppGenericError,\n  CppTransactions,\n  CppTransaction,\n  CppTransactionGetMultiReplicasFromPr"
  },
  {
    "path": "lib/transcoders.ts",
    "chars": 8877,
    "preview": "const NF_JSON = 0x00\nconst NF_RAW = 0x02\nconst NF_UTF8 = 0x04\nconst NF_MASK = 0xff\nconst NF_UNKNOWN = 0x100\n\nconst CF_NO"
  },
  {
    "path": "lib/usermanager.ts",
    "chars": 26653,
    "preview": "import { Cluster } from './cluster'\nimport {\n  CppManagementRbacGroup,\n  CppManagementRbacOrigin,\n  CppManagementRbacRol"
  },
  {
    "path": "lib/utilities.ts",
    "chars": 7718,
    "preview": "import { DurabilityLevel } from './generaltypes'\nimport { InvalidArgumentError } from './errors'\nimport * as qs from 'qu"
  },
  {
    "path": "lib/utilities_internal.ts",
    "chars": 454,
    "preview": "/**\n * @internal\n */\nexport function generateClientString(): string {\n  // Grab the various versions.  Note that we need"
  },
  {
    "path": "lib/vectorsearch.ts",
    "chars": 4666,
    "preview": "import { InvalidArgumentError } from './errors'\nimport { SearchQuery } from './searchquery'\n\n/**\n * Specifies how multip"
  },
  {
    "path": "lib/version.ts",
    "chars": 188,
    "preview": "// This file is auto-generated by scripts/updateVersion.js during the build process.\n// DO NOT EDIT DIRECTLY.\n\nexport co"
  },
  {
    "path": "lib/viewexecutor.ts",
    "chars": 5137,
    "preview": "/* eslint jsdoc/require-jsdoc: off */\nimport {\n  designDocumentNamespaceToCpp,\n  viewOrderingToCpp,\n  viewScanConsistenc"
  },
  {
    "path": "lib/viewindexmanager.ts",
    "chars": 20136,
    "preview": "import { Bucket } from './bucket'\nimport { CompoundTimeout, NodeCallback, PromiseHelper } from './utilities'\nimport { De"
  },
  {
    "path": "lib/viewtypes.ts",
    "chars": 8164,
    "preview": "import { RequestSpan } from './tracing'\n\n/**\n * Contains the results of a view query.\n *\n * @category Views\n */\nexport c"
  },
  {
    "path": "package.json",
    "chars": 6508,
    "preview": "{\n  \"bugs\": {\n    \"url\": \"http://www.couchbase.com/issues/browse/JSCBC\"\n  },\n  \"description\": \"The official Couchbase No"
  },
  {
    "path": "scripts/buildPrebuild.js",
    "chars": 3398,
    "preview": "'use strict'\n\nconst prebuilds = require('./prebuilds')\n\nfunction buildPrebuild(\n  runtime,\n  runtimeVersion,\n  useOpenSS"
  },
  {
    "path": "scripts/install.js",
    "chars": 885,
    "preview": "'use strict'\n\nconst path = require('path')\nconst prebuilds = require('./prebuilds')\n\nif (hasLocalPrebuild()) {\n  const d"
  },
  {
    "path": "scripts/prebuilds.js",
    "chars": 14959,
    "preview": "'use strict'\n\nconst fs = require('fs')\nconst path = require('path')\nvar proc = require('child_process')\nconst { familySy"
  },
  {
    "path": "scripts/prune.js",
    "chars": 3347,
    "preview": "'use strict'\n\nconst fs = require('fs')\nconst path = require('path')\nconst prebuilds = require('./prebuilds')\n\nfunction g"
  },
  {
    "path": "scripts/updateVersion.js",
    "chars": 825,
    "preview": "'use strict'\n\nconst fs = require('fs')\nconst path = require('path')\n\n// 1. Define the paths relative to this script\ncons"
  },
  {
    "path": "src/addondata.cpp",
    "chars": 25,
    "preview": "#include \"addondata.hpp\"\n"
  },
  {
    "path": "src/addondata.hpp",
    "chars": 620,
    "preview": "#pragma once\n#include <napi.h>\n\nnamespace couchnode\n{\n\nclass AddonData\n{\npublic:\n    static inline void Init(Napi::Env e"
  },
  {
    "path": "src/binding.cpp",
    "chars": 3760,
    "preview": "#include \"addondata.hpp\"\n#include \"cas.hpp\"\n#include \"connection.hpp\"\n#include \"constants.hpp\"\n#include \"mutationtoken.h"
  },
  {
    "path": "src/cas.cpp",
    "chars": 2528,
    "preview": "#include \"cas.hpp\"\n#include \"utils.hpp\"\n#include <sstream>\n\nnamespace couchnode\n{\n\nvoid Cas::Init(Napi::Env env, Napi::O"
  },
  {
    "path": "src/cas.hpp",
    "chars": 851,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include \"napi.h\"\n#include <couchbase/cas.hxx>\n\nnamespace couchbase\n{\ntypedef couc"
  },
  {
    "path": "src/connection.cpp",
    "chars": 28054,
    "preview": "#include \"connection.hpp\"\n#include \"cas.hpp\"\n#include \"instance.hpp\"\n#include \"jstocbpp.hpp\"\n#include \"mutationtoken.hpp"
  },
  {
    "path": "src/connection.hpp",
    "chars": 13882,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include \"instance.hpp\"\n#include \"jstocbpp.hpp\"\n#include <core/tracing/wrapper_sdk"
  },
  {
    "path": "src/connection_autogen.cpp",
    "chars": 86500,
    "preview": "#include \"connection.hpp\"\n#include \"jstocbpp.hpp\"\n\nnamespace couchnode\n{\n\n//#region Autogenerated Method Definitions\n\nNa"
  },
  {
    "path": "src/constants.cpp",
    "chars": 60060,
    "preview": "#include \"constants.hpp\"\n#include \"jstocbpp.hpp\"\n#include <core/cluster.hxx>\n#include <core/impl/subdoc/path_flags.hxx>\n"
  },
  {
    "path": "src/constants.hpp",
    "chars": 235,
    "preview": "#pragma once\n#include <napi.h>\n\nnamespace couchnode\n{\n\nclass Constants\n{\npublic:\n    static void Init(Napi::Env env, Nap"
  },
  {
    "path": "src/instance.cpp",
    "chars": 780,
    "preview": "#include \"instance.hpp\"\n\nnamespace couchnode\n{\n\nInstance::Instance()\n    : _cluster(couchbase::core::cluster(_io))\n{\n   "
  },
  {
    "path": "src/instance.hpp",
    "chars": 382,
    "preview": "#pragma once\n#include <asio/io_context.hpp>\n#include <core/cluster.hxx>\n#include <core/logger/logger.hxx>\n#include <memo"
  },
  {
    "path": "src/jstocbpp.hpp",
    "chars": 207,
    "preview": "#pragma once\n\n#include \"jstocbpp_defs.hpp\"\n\n#include \"jstocbpp_autogen.hpp\"\n#include \"jstocbpp_basic.hpp\"\n#include \"jsto"
  },
  {
    "path": "src/jstocbpp_autogen.hpp",
    "chars": 532144,
    "preview": "#pragma once\n#include \"jstocbpp_defs.hpp\"\n\n#include \"jstocbpp_basic.hpp\"\n#include \"jstocbpp_cpptypes.hpp\"\n\n#include <cor"
  },
  {
    "path": "src/jstocbpp_basic.hpp",
    "chars": 8569,
    "preview": "#pragma once\n#include \"jstocbpp_defs.hpp\"\n\n#include \"cas.hpp\"\n#include \"jstocbpp_cpptypes.hpp\"\n#include \"mutationtoken.h"
  },
  {
    "path": "src/jstocbpp_cpptypes.hpp",
    "chars": 11756,
    "preview": "#pragma once\n#include \"jstocbpp_defs.hpp\"\n\n#include <map>\n#include <napi.h>\n#include <optional>\n#include <set>\n#include "
  },
  {
    "path": "src/jstocbpp_defs.hpp",
    "chars": 2238,
    "preview": "#pragma once\n#include <napi.h>\n\n#include <core/error_context/key_value.hxx>\n#include <core/error_context/query_error_con"
  },
  {
    "path": "src/jstocbpp_errors.hpp",
    "chars": 14596,
    "preview": "#pragma once\n#include \"jstocbpp_defs.hpp\"\n\n#include \"jstocbpp_basic.hpp\"\n#include \"jstocbpp_cpptypes.hpp\"\n\n#include <cor"
  },
  {
    "path": "src/jstocbpp_transactions.hpp",
    "chars": 21067,
    "preview": "#pragma once\n#include \"jstocbpp_defs.hpp\"\n\n#include \"jstocbpp_basic.hpp\"\n#include \"jstocbpp_cpptypes.hpp\"\n\n#include <cor"
  },
  {
    "path": "src/mutationtoken.cpp",
    "chars": 4890,
    "preview": "#include \"mutationtoken.hpp\"\n#include \"jstocbpp.hpp\"\n#include \"utils.hpp\"\n#include <sstream>\n\nnamespace couchnode\n{\n\nstr"
  },
  {
    "path": "src/mutationtoken.hpp",
    "chars": 1069,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include \"napi.h\"\n#include <core/cluster.hxx>\n#include <couchbase/mutation_token.h"
  },
  {
    "path": "src/scan_iterator.cpp",
    "chars": 2752,
    "preview": "#include \"scan_iterator.hpp\"\n#include \"connection.hpp\"\n#include \"jstocbpp.hpp\"\n\nnamespace couchnode\n{\n\nvoid ScanIterator"
  },
  {
    "path": "src/scan_iterator.hpp",
    "chars": 721,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include \"napi.h\"\n#include <core/scan_result.hxx>\n\nnamespace couchnode\n{\n\nclass Sc"
  },
  {
    "path": "src/transaction.cpp",
    "chars": 13647,
    "preview": "#include \"transaction.hpp\"\n#include \"connection.hpp\"\n#include \"jstocbpp.hpp\"\n#include \"transactions.hpp\"\n#include <core/"
  },
  {
    "path": "src/transaction.hpp",
    "chars": 1484,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include <core/transactions.hxx>\n#include <core/transactions/internal/transaction_"
  },
  {
    "path": "src/transactions.cpp",
    "chars": 1935,
    "preview": "#include \"transactions.hpp\"\n#include \"connection.hpp\"\n#include <core/transactions/internal/exceptions_internal.hxx>\n#inc"
  },
  {
    "path": "src/transactions.hpp",
    "chars": 802,
    "preview": "#pragma once\n#include \"addondata.hpp\"\n#include <core/transactions.hxx>\n#include <memory>\n#include <napi.h>\n\nnamespace cb"
  },
  {
    "path": "src/utils.hpp",
    "chars": 714,
    "preview": "#pragma once\n#include <napi.h>\n\nnamespace couchnode\n{\n\nnamespace utils\n{\n\nstatic inline Napi::Symbol napiGetSymbol(const"
  },
  {
    "path": "test/analytics.test.js",
    "chars": 10224,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\n\nconst H = require('./harness"
  },
  {
    "path": "test/analyticslinks.test.js",
    "chars": 14035,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst {\n  AnalyticsLinkType,\n  AnalyticsEncryptionLevel,\n} = require"
  },
  {
    "path": "test/bucketmanager.test.js",
    "chars": 9180,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\n\nconst H = require('./harness')\nconst { StorageBackend } = require('"
  },
  {
    "path": "test/cluster.test.js",
    "chars": 7768,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst gc = require('expose-gc/function')\nconst { Cluster } = require"
  },
  {
    "path": "test/collectionmanager.test.js",
    "chars": 17780,
    "preview": "'use strict'\n\nconst { assert } = require('chai')\nconst H = require('./harness')\nconst { StorageBackend } = require('../l"
  },
  {
    "path": "test/connspec.test.js",
    "chars": 5876,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nvar { ConnSpec } = require('../lib/connspec')\n\nconst harness = requi"
  },
  {
    "path": "test/consistencyutil.js",
    "chars": 11628,
    "preview": "const { performance } = require('perf_hooks')\nconst http = require('http')\nconst MANAGEMENT_PORT = 8091\nconst VIEWS_PORT"
  },
  {
    "path": "test/crud.test.js",
    "chars": 75430,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst { DurabilityLevel, ReadPreference } = require('../lib/generalt"
  },
  {
    "path": "test/data/search_index.json",
    "chars": 2049,
    "preview": "{\n    \"doc_config\": {\n        \"docid_prefix_delim\": \"_\",\n        \"docid_regexp\": \"\",\n        \"mode\": \"docid_prefix\",\n   "
  },
  {
    "path": "test/data/test_vector.json",
    "chars": 34432,
    "preview": "[-0.014653487130999565, -0.008658270351588726, 0.017129190266132355, -0.015563474968075752, -0.02059517428278923, 0.0195"
  },
  {
    "path": "test/data/test_vector_search_docs.json",
    "chars": 3653384,
    "preview": "{\"id\": \"test:10000000\", \"text\": \"\\\"Beginners BBQ Class Taking Place in Missoula!\\\\nDo you want to get better at making d"
  },
  {
    "path": "test/data/vector_search_index.json",
    "chars": 2479,
    "preview": "{\n    \"doc_config\": {\n        \"docid_prefix_delim\": \"_\",\n        \"docid_regexp\": \"\",\n        \"mode\": \"docid_prefix\",\n   "
  },
  {
    "path": "test/datastructures.test.js",
    "chars": 10003,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\n\nfunction genericTests(collFn) {\n  de"
  },
  {
    "path": "test/diag.test.js",
    "chars": 2759,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\n\ndescribe('#diagnostics', function ()"
  },
  {
    "path": "test/errors.test.js",
    "chars": 694,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\n\nfunction genericTests(collFn) {\n  it"
  },
  {
    "path": "test/eventing.test.js",
    "chars": 6854,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\n\nconst H = require('./harness"
  },
  {
    "path": "test/expiry.test.js",
    "chars": 40012,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\n\nfunction genericTests(collFn) {\n  de"
  },
  {
    "path": "test/harness.js",
    "chars": 13718,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst uuid = require('uuid')\nconst semver = require('semver')\nconst "
  },
  {
    "path": "test/jcbmock.js",
    "chars": 6752,
    "preview": "'use strict'\n\nvar os = require('os')\nvar path = require('path')\nvar fs = require('fs')\nvar http = require('http')\nvar ne"
  },
  {
    "path": "test/loggingmeter.test.js",
    "chars": 5241,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst { LoggingMeter } = require('../lib/loggingmeter')\nconst { Couc"
  },
  {
    "path": "test/management.test.js",
    "chars": 360,
    "preview": "'use strict'\n\nconst H = require('./harness')\n\ndescribe('#management-apis', function () {\n  it('should successfully timeo"
  },
  {
    "path": "test/metrics/metertypes.js",
    "chars": 2090,
    "preview": "'use strict'\n\nconst { NoOpMeter, NoOpValueRecorder } = require('../../lib/observability')\nconst { OpAttributeName } = re"
  },
  {
    "path": "test/metrics/validators.js",
    "chars": 9496,
    "preview": "const assert = require('chai').assert\n\nconst { NoOpMeter } = require('../../lib/observability')\n\nconst {\n  Datastructure"
  },
  {
    "path": "test/metricsdatastructures.test.js",
    "chars": 13602,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst { NoOpTestMeter, TestMeter } = "
  },
  {
    "path": "test/metricskv.test.js",
    "chars": 22594,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst { NoOpTestMeter, TestMeter } = "
  },
  {
    "path": "test/metricsmgmt.test.js",
    "chars": 25711,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst { NoOpTestMeter, TestMeter } = "
  },
  {
    "path": "test/metricsstreaming.test.js",
    "chars": 7151,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst { NoOpTestMeter, TestMeter } = "
  },
  {
    "path": "test/n1ql.test.js",
    "chars": 26575,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\n\nconst H = require('./harness"
  },
  {
    "path": "test/rangescan.test.js",
    "chars": 14836,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\nconst H = require('./harness'"
  },
  {
    "path": "test/sdutils.test.js",
    "chars": 613,
    "preview": "'use strict'\n\nconst assert = require('assert')\nconst { SdUtils } = require('../lib/sdutils')\n\ndescribe('#sdutils', funct"
  },
  {
    "path": "test/search.test.js",
    "chars": 13168,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\nconst fs = require('fs')\ncons"
  },
  {
    "path": "test/streamablepromise.test.js",
    "chars": 40316,
    "preview": "'use strict'\n\nconst util = require('util')\n\nconst assert = require('chai').assert\n\nconst { QueryMetaData, QueryResult } "
  },
  {
    "path": "test/testdata.js",
    "chars": 2418,
    "preview": "'use strict'\n\nvar TEST_DOCS = [\n  { x: 0, y: 0, name: 'x0,y0' },\n  { x: 1, y: 0, name: 'x1,y0' },\n  { x: 2, y: 0, name: "
  },
  {
    "path": "test/thresholdlogging.test.js",
    "chars": 9848,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst {\n  ThresholdLoggingTracer,\n  ThresholdLoggingSpan,\n} = requir"
  },
  {
    "path": "test/tracing/tracingtypes.js",
    "chars": 4758,
    "preview": "'use strict'\n\nconst { NoOpTracer, NoOpSpan } = require('../../lib/observability')\nconst {\n  OpAttributeName,\n  SpanStatu"
  },
  {
    "path": "test/tracing/validators.js",
    "chars": 37585,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst { NoOpSpan, NoOpTracer } = require('../../lib/observability')\n"
  },
  {
    "path": "test/tracingdatastructures.test.js",
    "chars": 14294,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst {\n  NoOpTestTracer,\n  TestTrace"
  },
  {
    "path": "test/tracingkv.test.js",
    "chars": 38543,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst {\n  NoOpTestTracer,\n  TestTrace"
  },
  {
    "path": "test/tracingmgmt.test.js",
    "chars": 49387,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst {\n  NoOpTestTracer,\n  TestTrace"
  },
  {
    "path": "test/tracingstreaming.test.js",
    "chars": 10340,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst H = require('./harness')\nconst {\n  NoOpTestTracer,\n  TestTrace"
  },
  {
    "path": "test/transactions.test.js",
    "chars": 36362,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\nconst H = require('./harness'"
  },
  {
    "path": "test/transcoder.test.js",
    "chars": 20956,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst {\n  RawBinaryTranscoder,\n  RawJsonTranscoder,\n  RawStringTrans"
  },
  {
    "path": "test/users.test.js",
    "chars": 17826,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\n\nconst {\n  Origin,\n  Role,\n  RoleAndOrigin,\n  UserAndMetadata,\n} = r"
  },
  {
    "path": "test/utilities.test.js",
    "chars": 10126,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\n\nconst { PromiseHelper } = require('../lib/utilities')\n\ndescribe('#u"
  },
  {
    "path": "test/views.test.js",
    "chars": 38618,
    "preview": "'use strict'\n\nconst assert = require('chai').assert\nconst testdata = require('./testdata')\n\nconst H = require('./harness"
  },
  {
    "path": "test/workerthread.test.js",
    "chars": 1619,
    "preview": "'use strict'\n\nconst semver = require('semver')\nconst harness = require('./harness')\n\nconst H = harness\n\nasync function s"
  },
  {
    "path": "test/workerthread.worker.js",
    "chars": 1242,
    "preview": "require('ts-node').register()\n\nconst worker = require('worker_threads')\nconst assert = require('chai').assert\nconst couc"
  },
  {
    "path": "tools/gen-bindings-js.js",
    "chars": 26651,
    "preview": "const fsp = require('fs/promises')\n\nconst CustomDefinedTypes = [\n  'couchbase::core::json_string',\n  'couchbase::core::d"
  },
  {
    "path": "tools/gen-bindings-json.py",
    "chars": 35397,
    "preview": "#  Copyright 2016-2024. Couchbase, Inc.\n#  All Rights Reserved.\n#\n#  Licensed under the Apache License, Version 2.0 (the"
  },
  {
    "path": "tsconfig.json",
    "chars": 148,
    "preview": "{\n  \"extends\": \"@tsconfig/node12/tsconfig.json\",\n\n  \"compilerOptions\": {\n    \"outDir\": \"dist\",\n    \"declaration\": true\n "
  },
  {
    "path": "typedoc.json",
    "chars": 511,
    "preview": "{\n  \"entryPoints\": [\"./lib/couchbase.ts\"],\n  \"out\": \"docs\",\n  \"excludePrivate\": true,\n  \"excludeInternal\": true,\n  \"cate"
  }
]

About this extraction

This page contains the full source code of the couchbase/couchnode GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 176 files (6.1 MB), approximately 1.6M tokens, and a symbol index with 3531 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!