couchbase 4.4.2 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +13 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
  13. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
  14. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  15. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
  16. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  17. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  21. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  22. package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
  23. package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
  24. package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
  25. package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
  26. package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
  27. package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
  28. package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
  29. package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
  30. package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
  31. package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
  32. package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
  33. package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
  34. package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
  36. package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
  37. package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
  38. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  39. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
  40. package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
  41. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
  42. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
  43. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
  44. package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
  45. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
  46. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  47. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
  50. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
  51. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  52. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  53. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
  54. package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
  55. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  56. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
  57. package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
  58. package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
  59. package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
  60. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
  61. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
  62. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
  63. package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
  64. package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
  65. package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
  66. package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
  67. package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
  68. package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
  69. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  70. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  71. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
  72. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
  73. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  74. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  75. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  79. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  83. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  85. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  91. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  92. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  93. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  94. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  95. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  96. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  97. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  98. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  99. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  114. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  115. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
  118. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
  120. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
  122. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
  124. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
  127. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  129. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
  132. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
  134. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  135. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
  136. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  137. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  138. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  139. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  140. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  141. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  142. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  143. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  144. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  145. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  146. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  147. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  148. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  149. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  150. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  151. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
  152. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  153. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  154. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  155. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  156. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  157. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  158. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  159. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  160. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
  161. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  162. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
  163. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  164. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
  165. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  166. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  167. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
  168. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  169. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
  170. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  171. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
  172. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  173. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
  174. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  175. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
  176. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  177. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
  178. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  179. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
  180. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  181. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
  182. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  183. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  184. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
  185. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  186. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  187. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  188. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  189. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  190. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  191. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
  192. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  193. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
  194. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  195. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
  196. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  197. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
  198. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  199. package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
  200. package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
  201. package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
  202. package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
  203. package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
  204. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
  205. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
  206. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
  207. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
  208. package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
  209. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
  210. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
  211. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  212. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  213. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
  214. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
  215. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
  216. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  217. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  218. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
  219. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
  220. package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
  221. package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
  222. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  223. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  224. package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
  225. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
  226. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
  227. package/dist/analyticsindexmanager.d.ts +98 -14
  228. package/dist/analyticsindexmanager.js +452 -411
  229. package/dist/binding.d.ts +53 -4
  230. package/dist/bindingutilities.d.ts +26 -1
  231. package/dist/bindingutilities.js +108 -1
  232. package/dist/couchbase.d.ts +3 -1
  233. package/dist/couchbase.js +2 -0
  234. package/dist/rangeScan.d.ts +1 -1
  235. package/dist/rangeScan.js +1 -1
  236. package/dist/transactions.d.ts +34 -3
  237. package/dist/transactions.js +25 -18
  238. package/dist/transcoders.d.ts +68 -0
  239. package/dist/transcoders.js +194 -1
  240. package/dist/usermanager.d.ts +14 -14
  241. package/dist/usermanager.js +178 -228
  242. package/dist/utilities.js +4 -6
  243. package/dist/utilities_internal.js +1 -2
  244. package/package.json +9 -8
  245. package/src/binding.cpp +13 -13
  246. package/src/connection.cpp +22 -0
  247. package/src/connection.hpp +12 -0
  248. package/src/connection_autogen.cpp +100 -0
  249. package/src/jstocbpp_autogen.hpp +315 -8
  250. package/src/jstocbpp_transactions.hpp +1 -2
  251. package/tools/gen-bindings-js.js +38 -3
  252. package/tools/gen-bindings-json.py +575 -328
@@ -18,6 +18,7 @@
18
18
  #pragma once
19
19
 
20
20
  #include <couchbase/retry_strategy.hxx>
21
+ #include <couchbase/tracing/request_span.hxx>
21
22
 
22
23
  #include <chrono>
23
24
  #include <memory>
@@ -69,6 +70,18 @@ public:
69
70
  return self();
70
71
  }
71
72
 
73
+ /**
74
+ * @param span
75
+ *
76
+ * @since 1.0.4
77
+ * @volatile
78
+ */
79
+ auto parent_span(std::shared_ptr<tracing::request_span> span) -> derived_class&
80
+ {
81
+ parent_span_ = std::move(span);
82
+ return self();
83
+ }
84
+
72
85
  /**
73
86
  * Immutable value object representing consistent options.
74
87
  *
@@ -78,6 +91,7 @@ public:
78
91
  struct built {
79
92
  const std::optional<std::chrono::milliseconds> timeout;
80
93
  const std::shared_ptr<couchbase::retry_strategy> retry_strategy;
94
+ const std::shared_ptr<tracing::request_span> parent_span;
81
95
  };
82
96
 
83
97
  protected:
@@ -88,7 +102,7 @@ protected:
88
102
  */
89
103
  [[nodiscard]] auto build_common_options() const -> built
90
104
  {
91
- return { timeout_, retry_strategy_ };
105
+ return { timeout_, retry_strategy_, parent_span_ };
92
106
  }
93
107
 
94
108
  /**
@@ -107,6 +121,7 @@ protected:
107
121
  private:
108
122
  std::optional<std::chrono::milliseconds> timeout_{};
109
123
  std::shared_ptr<couchbase::retry_strategy> retry_strategy_{ nullptr };
124
+ std::shared_ptr<tracing::request_span> parent_span_{ nullptr };
110
125
  };
111
126
 
112
127
  } // namespace couchbase
@@ -20,6 +20,7 @@
20
20
  #include "opentelemetry/sdk/metrics/meter.h"
21
21
  #include <couchbase/metrics/meter.hxx>
22
22
 
23
+ #include <algorithm>
23
24
  #include <iostream>
24
25
  #include <thread>
25
26
  #include <utility>
@@ -37,44 +38,39 @@ namespace couchbase::metrics
37
38
  class otel_sync_histogram
38
39
  {
39
40
  public:
40
- otel_sync_histogram(nostd::shared_ptr<metrics_api::Histogram<long>> histogram_counter)
41
+ otel_sync_histogram(nostd::shared_ptr<metrics_api::Histogram<std::uint64_t>> histogram_counter)
41
42
  : histogram_counter_(histogram_counter)
42
43
  {
43
44
  }
44
- void record(uint64_t value,
45
+
46
+ void record(std::uint64_t value,
45
47
  const opentelemetry::common::KeyValueIterable& tags,
46
48
  opentelemetry::context::Context& ctx)
47
49
  {
48
- // overflow
49
- if (value > LONG_MAX) {
50
- value = LONG_MAX;
51
- }
52
- long lvalue = static_cast<long>(value);
53
- histogram_counter_->Record(lvalue, tags, ctx);
50
+ histogram_counter_->Record(value, tags, ctx);
54
51
  }
55
52
 
56
53
  private:
57
- nostd::shared_ptr<metrics_api::Histogram<long>> histogram_counter_;
54
+ nostd::shared_ptr<metrics_api::Histogram<std::uint64_t>> histogram_counter_;
58
55
  std::mutex mutex_;
59
56
  };
60
57
 
61
58
  class otel_value_recorder : public couchbase::metrics::value_recorder
62
59
  {
63
60
  public:
64
- explicit otel_value_recorder(nostd::shared_ptr<metrics_api::Histogram<long>> histogram_counter,
65
- const std::map<std::string, std::string>& tags)
61
+ explicit otel_value_recorder(
62
+ nostd::shared_ptr<metrics_api::Histogram<std::uint64_t>> histogram_counter,
63
+ const std::map<std::string, std::string>& tags)
66
64
  : histogram_counter_(histogram_counter)
67
65
  , tags_(tags)
68
66
  {
69
67
  }
70
68
  void record_value(std::int64_t value) override
71
69
  {
72
- if (value > LONG_MAX) {
73
- value = LONG_MAX;
74
- }
75
- long lvalue = static_cast<long>(value);
70
+ value = std::max<int64_t>(value, 0);
71
+ auto uvalue = static_cast<std::uint64_t>(value);
76
72
  histogram_counter_->Record(
77
- value, opentelemetry::common::KeyValueIterableView<decltype(tags_)>{ tags_ }, context_);
73
+ uvalue, opentelemetry::common::KeyValueIterableView<decltype(tags_)>{ tags_ }, context_);
78
74
  }
79
75
 
80
76
  const std::map<std::string, std::string> tags()
@@ -82,13 +78,13 @@ public:
82
78
  return tags_;
83
79
  }
84
80
 
85
- nostd::shared_ptr<metrics_api::Histogram<long>> histogram_counter()
81
+ nostd::shared_ptr<metrics_api::Histogram<std::uint64_t>> histogram_counter()
86
82
  {
87
83
  return histogram_counter_;
88
84
  }
89
85
 
90
86
  private:
91
- nostd::shared_ptr<metrics_api::Histogram<long>> histogram_counter_;
87
+ nostd::shared_ptr<metrics_api::Histogram<std::uint64_t>> histogram_counter_;
92
88
  const std::map<std::string, std::string> tags_;
93
89
  opentelemetry::context::Context context_{};
94
90
  std::mutex mutex_;
@@ -115,8 +111,8 @@ public:
115
111
  // api doesn't seem to allow this.
116
112
  return recorders_
117
113
  .insert({ name,
118
- std::make_shared<otel_value_recorder>(meter_->CreateLongHistogram(name, "", "us"),
119
- tags) })
114
+ std::make_shared<otel_value_recorder>(
115
+ meter_->CreateUInt64Histogram(name, "", "us"), tags) })
120
116
  ->second;
121
117
  }
122
118
  // so it is already, lets see if we already have one with those tags, or need
@@ -235,7 +235,7 @@ public:
235
235
  template<typename Value, typename Transcoder = codec::default_json_transcoder>
236
236
  static auto upsert(std::string path, const Value& value) -> subdoc::upsert
237
237
  {
238
- return { std::move(path), std::move(Transcoder::template encode(value).data) };
238
+ return { std::move(path), std::move(Transcoder::template encode<const Value&>(value).data) };
239
239
  }
240
240
 
241
241
  /**
@@ -453,7 +453,7 @@ public:
453
453
  template<typename Value, typename Transcoder = codec::default_json_transcoder>
454
454
  static auto array_add_unique(std::string path, const Value& value) -> subdoc::array_add_unique
455
455
  {
456
- return { std::move(path), std::move(Transcoder::template encode(value).data) };
456
+ return { std::move(path), std::move(Transcoder::template encode<Value>(value).data) };
457
457
  }
458
458
 
459
459
  /**
@@ -445,7 +445,7 @@ struct query_options : public common_options<query_options> {
445
445
  std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
446
446
  auto raw(std::string name, const Value& value) -> query_options&
447
447
  {
448
- raw_[std::move(name)] = std::move(Serializer::template serialize(value));
448
+ raw_[std::move(name)] = std::move(Serializer::template serialize<const Value&>(value));
449
449
  return self();
450
450
  }
451
451
 
@@ -563,7 +563,8 @@ private:
563
563
  std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
564
564
  void encode_positional_parameters(const Parameter& parameter, Rest... args)
565
565
  {
566
- positional_parameters_.emplace_back(std::move(Serializer::template serialize(parameter)));
566
+ positional_parameters_.emplace_back(
567
+ std::move(Serializer::template serialize<const Parameter&>(parameter)));
567
568
  if constexpr (sizeof...(args) > 0) {
568
569
  encode_positional_parameters<Serializer>(args...);
569
570
  }
@@ -577,7 +578,7 @@ private:
577
578
  void encode_named_parameters(const std::pair<Name, Parameter>& parameter, Rest... args)
578
579
  {
579
580
  named_parameters_[parameter.first] =
580
- std::move(Serializer::template serialize(parameter.second));
581
+ std::move(Serializer::template serialize<Parameter>(parameter.second));
581
582
  if constexpr (sizeof...(args) > 0) {
582
583
  encode_named_parameters<Serializer>(args...);
583
584
  }
@@ -192,7 +192,7 @@ struct search_options : public common_options<search_options> {
192
192
  std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
193
193
  auto raw(std::string name, const Value& value) -> search_options&
194
194
  {
195
- raw_[std::move(name)] = std::move(Serializer::template serialize(value));
195
+ raw_[std::move(name)] = std::move(Serializer::template serialize<Value>(value));
196
196
  return self();
197
197
  }
198
198
 
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Cluster } from './cluster';
3
+ import { CppManagementAnalyticsCouchbaseRemoteLink, CppManagementAnalyticsS3ExternalLink, CppManagementAnalyticsAzureBlobExternalLink } from './binding';
3
4
  import { NodeCallback } from './utilities';
4
5
  /**
5
6
  * Represents the type of an analytics link.
@@ -155,6 +156,14 @@ export interface IAnalyticsLink {
155
156
  * Specifies what type of analytics link this represents.
156
157
  */
157
158
  linkType: AnalyticsLinkType;
159
+ /**
160
+ * The dataverse that this link belongs to.
161
+ */
162
+ dataverse: string;
163
+ /**
164
+ * The name of this link.
165
+ */
166
+ name: string;
158
167
  }
159
168
  /**
160
169
  * This is a base class for specific link configurations for the analytics service.
@@ -168,6 +177,18 @@ export declare abstract class AnalyticsLink implements IAnalyticsLink {
168
177
  * Specifies what type of analytics link this represents.
169
178
  */
170
179
  linkType: AnalyticsLinkType;
180
+ /**
181
+ * The dataverse that this link belongs to.
182
+ */
183
+ dataverse: string;
184
+ /**
185
+ * The name of this link.
186
+ */
187
+ name: string;
188
+ /**
189
+ * Validates the link.
190
+ */
191
+ abstract validate(): void;
171
192
  /**
172
193
  * @internal
173
194
  */
@@ -250,18 +271,22 @@ export declare class CouchbaseRemoteAnalyticsLink extends AnalyticsLink implemen
250
271
  * (@see ICouchbaseAnalyticsEncryptionSettings.clientCertificate) is being used.
251
272
  */
252
273
  password?: string;
274
+ /**
275
+ * Validates the CouchbaseRemoteAnalyticsLink.
276
+ */
277
+ validate(): void;
253
278
  /**
254
279
  * @internal
255
280
  */
256
- constructor(data: CouchbaseRemoteAnalyticsLink);
281
+ constructor(data: ICouchbaseRemoteAnalyticsLink);
257
282
  /**
258
283
  * @internal
259
284
  */
260
- static _toHttpData(data: ICouchbaseRemoteAnalyticsLink): any;
285
+ static _toCppData(data: CouchbaseRemoteAnalyticsLink): CppManagementAnalyticsCouchbaseRemoteLink;
261
286
  /**
262
287
  * @internal
263
288
  */
264
- static _fromHttpData(data: any): CouchbaseRemoteAnalyticsLink;
289
+ static _fromCppData(data: CppManagementAnalyticsCouchbaseRemoteLink): CouchbaseRemoteAnalyticsLink;
265
290
  }
266
291
  /**
267
292
  * Provides options for configuring an analytics remote S3 link.
@@ -341,15 +366,19 @@ export declare class S3ExternalAnalyticsLink extends AnalyticsLink implements IS
341
366
  /**
342
367
  * @internal
343
368
  */
344
- constructor(data: S3ExternalAnalyticsLink);
369
+ constructor(data: IS3ExternalAnalyticsLink);
370
+ /**
371
+ * Validates the S3ExternalAnalyticsLink.
372
+ */
373
+ validate(): void;
345
374
  /**
346
375
  * @internal
347
376
  */
348
- static _toHttpData(data: IS3ExternalAnalyticsLink): any;
377
+ static _toCppData(data: S3ExternalAnalyticsLink): CppManagementAnalyticsS3ExternalLink;
349
378
  /**
350
379
  * @internal
351
380
  */
352
- static _fromHttpData(data: any): S3ExternalAnalyticsLink;
381
+ static _fromCppData(data: CppManagementAnalyticsS3ExternalLink): S3ExternalAnalyticsLink;
353
382
  }
354
383
  /**
355
384
  * Provides options for configuring an analytics remote Azure link.
@@ -435,15 +464,19 @@ export declare class AzureExternalAnalyticsLink extends AnalyticsLink implements
435
464
  /**
436
465
  * @internal
437
466
  */
438
- constructor(data: AzureExternalAnalyticsLink);
467
+ constructor(data: IAzureExternalAnalyticsLink);
468
+ /**
469
+ * Validates the AzureExternalAnalyticsLink.
470
+ */
471
+ validate(): void;
439
472
  /**
440
473
  * @internal
441
474
  */
442
- static _toHttpData(data: IAzureExternalAnalyticsLink): any;
475
+ static _toCppData(data: AzureExternalAnalyticsLink): CppManagementAnalyticsAzureBlobExternalLink;
443
476
  /**
444
477
  * @internal
445
478
  */
446
- static _fromHttpData(data: any): AzureExternalAnalyticsLink;
479
+ static _fromCppData(data: CppManagementAnalyticsAzureBlobExternalLink): AzureExternalAnalyticsLink;
447
480
  }
448
481
  /**
449
482
  * @category Management
@@ -571,6 +604,18 @@ export interface GetAllAnalyticsIndexesOptions {
571
604
  * @category Management
572
605
  */
573
606
  export interface ConnectAnalyticsLinkOptions {
607
+ /**
608
+ * Whether or not the call should attempt to force the link connection.
609
+ */
610
+ force?: boolean;
611
+ /**
612
+ * The name of the dataverse the link belongs to.
613
+ */
614
+ dataverseName?: string;
615
+ /**
616
+ * The name of the link to connect.
617
+ */
618
+ linkName?: string;
574
619
  /**
575
620
  * The timeout for this operation, represented in milliseconds.
576
621
  */
@@ -580,6 +625,14 @@ export interface ConnectAnalyticsLinkOptions {
580
625
  * @category Management
581
626
  */
582
627
  export interface DisconnectAnalyticsLinkOptions {
628
+ /**
629
+ * The name of the dataverse the link belongs to.
630
+ */
631
+ dataverseName?: string;
632
+ /**
633
+ * The name of the link to connect.
634
+ */
635
+ linkName?: string;
583
636
  /**
584
637
  * The timeout for this operation, represented in milliseconds.
585
638
  */
@@ -654,7 +707,6 @@ export declare class AnalyticsIndexManager {
654
707
  * @internal
655
708
  */
656
709
  constructor(cluster: Cluster);
657
- private get _http();
658
710
  /**
659
711
  * Creates a new dataverse.
660
712
  *
@@ -726,19 +778,51 @@ export declare class AnalyticsIndexManager {
726
778
  /**
727
779
  * Connects a not yet connected link.
728
780
  *
729
- * @param linkName The name of the link to connect.
781
+ * @param linkStr The name of the link to connect.
782
+ * @param options Optional parameters for this operation.
783
+ * @param callback A node-style callback to be invoked after execution.
784
+ * @deprecated Use the other overload instead.
785
+ */
786
+ connectLink(linkStr: string, options?: ConnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
787
+ /**
788
+ * Connects a not yet connected link.
789
+ *
790
+ * @param options Optional parameters for this operation.
791
+ * @param callback A node-style callback to be invoked after execution.
792
+ */
793
+ connectLink(options?: ConnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
794
+ /**
795
+ * @internal
796
+ */
797
+ _connectLinkDeprecated(linkStr: string, options?: ConnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
798
+ /**
799
+ * @internal
800
+ */
801
+ _connectLink(options?: ConnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
802
+ /**
803
+ * Disconnects a previously connected link.
804
+ *
805
+ * @param linkStr The name of the link to disconnect.
730
806
  * @param options Optional parameters for this operation.
731
807
  * @param callback A node-style callback to be invoked after execution.
808
+ * @deprecated Use the other overload instead.
732
809
  */
733
- connectLink(linkName: string, options?: ConnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
810
+ disconnectLink(linkStr: string, options?: DisconnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
734
811
  /**
735
812
  * Disconnects a previously connected link.
736
813
  *
737
- * @param linkName The name of the link to disconnect.
738
814
  * @param options Optional parameters for this operation.
739
815
  * @param callback A node-style callback to be invoked after execution.
740
816
  */
741
- disconnectLink(linkName: string, options?: DisconnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
817
+ disconnectLink(options?: DisconnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
818
+ /**
819
+ * @internal
820
+ */
821
+ _disconnectLinkDeprecated(linkStr: string, options?: DisconnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
822
+ /**
823
+ * @internal
824
+ */
825
+ _disconnectLink(options?: DisconnectAnalyticsLinkOptions, callback?: NodeCallback<void>): Promise<void>;
742
826
  /**
743
827
  * Returns a list of all pending mutations.
744
828
  *