couchbase 4.2.8-dev.1 → 4.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. package/CMakeLists.txt +1 -1
  2. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +139 -56
  3. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
  4. package/deps/couchbase-cxx-client/CMakeLists.txt +397 -424
  5. package/deps/couchbase-cxx-client/core/agent_config.hxx +1 -1
  6. package/deps/couchbase-cxx-client/core/agent_group.cxx +0 -1
  7. package/deps/couchbase-cxx-client/core/agent_group.hxx +9 -0
  8. package/deps/couchbase-cxx-client/core/agent_group_config.hxx +1 -1
  9. package/deps/couchbase-cxx-client/core/bucket.cxx +22 -8
  10. package/deps/couchbase-cxx-client/core/bucket.hxx +3 -1
  11. package/deps/couchbase-cxx-client/core/cluster.cxx +1453 -108
  12. package/deps/couchbase-cxx-client/core/cluster.hxx +183 -473
  13. package/deps/couchbase-cxx-client/core/cluster_agent_config.hxx +1 -1
  14. package/deps/couchbase-cxx-client/core/cluster_options.cxx +12 -2
  15. package/deps/couchbase-cxx-client/core/cluster_options.hxx +9 -8
  16. package/deps/couchbase-cxx-client/core/config_profiles.cxx +2 -2
  17. package/deps/couchbase-cxx-client/core/config_profiles.hxx +1 -1
  18. package/deps/couchbase-cxx-client/core/core_sdk_shim.cxx +1 -2
  19. package/deps/couchbase-cxx-client/core/core_sdk_shim.hxx +3 -2
  20. package/deps/couchbase-cxx-client/core/diagnostics.hxx +0 -1
  21. package/deps/couchbase-cxx-client/core/dispatcher.cxx +2 -2
  22. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +38 -76
  23. package/deps/couchbase-cxx-client/core/impl/analytics.hxx +40 -0
  24. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +820 -0
  25. package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +403 -0
  26. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +78 -0
  27. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +433 -0
  28. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +226 -44
  29. package/deps/couchbase-cxx-client/core/impl/collection.cxx +1384 -0
  30. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +306 -0
  31. package/deps/couchbase-cxx-client/core/impl/configuration_profiles_registry.cxx +3 -1
  32. package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -0
  33. package/deps/couchbase-cxx-client/core/{operations/mcbp_noop.cxx → impl/doc_id_query.cxx} +19 -15
  34. package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +4 -2
  35. package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.hxx +0 -10
  36. package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.hxx +0 -10
  37. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +24 -17
  38. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -1
  39. package/deps/couchbase-cxx-client/core/impl/query.cxx +45 -68
  40. package/deps/couchbase-cxx-client/core/impl/query.hxx +34 -0
  41. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +628 -0
  42. package/deps/couchbase-cxx-client/core/impl/scope.cxx +172 -0
  43. package/deps/couchbase-cxx-client/core/impl/search.cxx +12 -61
  44. package/deps/couchbase-cxx-client/core/impl/search.hxx +37 -0
  45. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +469 -0
  46. package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +12 -0
  47. package/deps/couchbase-cxx-client/core/impl/search_sort_geo_distance.cxx +87 -0
  48. package/deps/couchbase-cxx-client/core/impl/with_legacy_durability.hxx +23 -25
  49. package/deps/couchbase-cxx-client/core/io/dns_config.cxx +28 -0
  50. package/deps/couchbase-cxx-client/core/io/dns_config.hxx +6 -25
  51. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +9 -1
  52. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
  53. package/deps/couchbase-cxx-client/core/io/mcbp_message.hxx +3 -2
  54. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +51 -21
  55. package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +2 -1
  56. package/deps/couchbase-cxx-client/core/logger/logger.hxx +4 -4
  57. package/deps/couchbase-cxx-client/core/management/bucket_settings.hxx +1 -1
  58. package/deps/couchbase-cxx-client/core/mcbp/packet.cxx +1 -1
  59. package/deps/couchbase-cxx-client/core/mcbp/queue_callback.hxx +1 -1
  60. package/deps/couchbase-cxx-client/core/meta/features.hxx +28 -0
  61. package/deps/couchbase-cxx-client/core/operations/document_query.cxx +17 -1
  62. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -1
  63. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.cxx +2 -0
  64. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.cxx +2 -0
  65. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.cxx +2 -0
  66. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.cxx +2 -0
  67. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.cxx +2 -0
  68. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.cxx +2 -0
  69. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.cxx +2 -0
  70. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.cxx +2 -0
  71. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.cxx +2 -0
  72. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +2 -0
  73. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.cxx +1 -1
  74. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -0
  75. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/management/change_password.cxx +3 -1
  79. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +6 -5
  83. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.cxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.cxx +2 -0
  85. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.cxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.cxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.cxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.cxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.cxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/management/group_drop.cxx +2 -0
  91. package/deps/couchbase-cxx-client/core/operations/management/group_get.cxx +2 -0
  92. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.cxx +1 -1
  93. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +2 -2
  94. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +4 -1
  95. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +4 -1
  96. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.cxx +1 -1
  97. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +1 -1
  98. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -0
  99. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +2 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.cxx +4 -4
  102. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +4 -4
  103. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +2 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +2 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +2 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +2 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +2 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +2 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +1 -1
  110. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +2 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.cxx +2 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +2 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -0
  114. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -0
  115. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +2 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -0
  117. package/deps/couchbase-cxx-client/core/operations.hxx +0 -1
  118. package/deps/couchbase-cxx-client/core/operations_fwd.hxx +260 -0
  119. package/deps/couchbase-cxx-client/core/origin.cxx +146 -5
  120. package/deps/couchbase-cxx-client/core/origin.hxx +30 -140
  121. package/deps/couchbase-cxx-client/core/protocol/cmd_cluster_map_change_notification.hxx +3 -3
  122. package/deps/couchbase-cxx-client/core/protocol/cmd_hello.hxx +5 -0
  123. package/deps/couchbase-cxx-client/core/protocol/cmd_observe_seqno.hxx +4 -4
  124. package/deps/couchbase-cxx-client/core/protocol/hello_feature.hxx +6 -0
  125. package/deps/couchbase-cxx-client/core/protocol/hello_feature_fmt.hxx +3 -0
  126. package/deps/couchbase-cxx-client/core/protocol/status.cxx +6 -0
  127. package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/query_context.hxx +11 -7
  129. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +1 -1
  130. package/deps/couchbase-cxx-client/core/topology/configuration.cxx +23 -0
  131. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +8 -12
  132. package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +3 -3
  133. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
  134. package/deps/couchbase-cxx-client/core/topology/error_map.hxx +2 -2
  135. package/deps/couchbase-cxx-client/core/topology/error_map_json.hxx +4 -0
  136. package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.cxx +58 -0
  137. package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.hxx +5 -40
  138. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.cxx +30 -0
  139. package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +18 -18
  140. package/deps/couchbase-cxx-client/core/transactions/attempt_context.cxx +36 -0
  141. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +39 -41
  142. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +2 -2
  143. package/deps/couchbase-cxx-client/core/transactions/internal/atr_cleanup_entry.hxx +3 -1
  144. package/deps/couchbase-cxx-client/core/transactions/internal/atr_entry.hxx +2 -0
  145. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.cxx +32 -0
  146. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.hxx +4 -30
  147. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record_fmt.hxx +41 -0
  148. package/deps/couchbase-cxx-client/core/transactions/internal/logging.hxx +17 -15
  149. package/deps/couchbase-cxx-client/core/transactions/internal/transaction_context.hxx +1 -1
  150. package/deps/couchbase-cxx-client/core/transactions/internal/transactions_cleanup.hxx +4 -4
  151. package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +1 -13
  152. package/deps/couchbase-cxx-client/core/transactions/result.hxx +0 -26
  153. package/deps/couchbase-cxx-client/core/transactions/result_fmt.hxx +46 -0
  154. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +16 -14
  155. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +6 -6
  156. package/deps/couchbase-cxx-client/core/transactions/transaction_keyspace.cxx +48 -0
  157. package/deps/couchbase-cxx-client/core/transactions/transaction_links.hxx +1 -0
  158. package/deps/couchbase-cxx-client/core/transactions/transaction_options.cxx +61 -4
  159. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +9 -8
  160. package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +9 -16
  161. package/deps/couchbase-cxx-client/core/transactions/transactions_config.cxx +7 -6
  162. package/deps/couchbase-cxx-client/core/transactions.hxx +6 -5
  163. package/deps/couchbase-cxx-client/core/utils/join_strings.hxx +4 -3
  164. package/deps/couchbase-cxx-client/core/utils/keyspace.hxx +4 -4
  165. package/deps/couchbase-cxx-client/couchbase/allow_querying_search_index_options.hxx +44 -0
  166. package/deps/couchbase-cxx-client/couchbase/analytics_index_manager.hxx +463 -0
  167. package/deps/couchbase-cxx-client/couchbase/analyze_document_options.hxx +44 -0
  168. package/deps/couchbase-cxx-client/couchbase/append_options.hxx +0 -24
  169. package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +1 -1
  170. package/deps/couchbase-cxx-client/couchbase/binary_collection.hxx +19 -115
  171. package/deps/couchbase-cxx-client/couchbase/bucket.hxx +13 -30
  172. package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +8 -7
  173. package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -1
  174. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +41 -73
  175. package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +1 -27
  176. package/deps/couchbase-cxx-client/couchbase/collection.hxx +176 -386
  177. package/deps/couchbase-cxx-client/couchbase/collection_manager.hxx +8 -9
  178. package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +21 -24
  179. package/deps/couchbase-cxx-client/couchbase/connect_link_analytics_options.hxx +116 -0
  180. package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +3 -3
  181. package/deps/couchbase-cxx-client/couchbase/create_collection_options.hxx +3 -2
  182. package/deps/couchbase-cxx-client/couchbase/create_dataset_analytics_options.hxx +120 -0
  183. package/deps/couchbase-cxx-client/couchbase/create_dataverse_analytics_options.hxx +85 -0
  184. package/deps/couchbase-cxx-client/couchbase/create_index_analytics_options.hxx +103 -0
  185. package/deps/couchbase-cxx-client/couchbase/create_link_analytics_options.hxx +63 -0
  186. package/deps/couchbase-cxx-client/couchbase/decrement_options.hxx +0 -23
  187. package/deps/couchbase-cxx-client/couchbase/disallow_querying_search_index_options.hxx +43 -0
  188. package/deps/couchbase-cxx-client/couchbase/disconnect_link_analytics_options.hxx +105 -0
  189. package/deps/couchbase-cxx-client/couchbase/drop_dataset_analytics_options.hxx +103 -0
  190. package/deps/couchbase-cxx-client/couchbase/drop_dataverse_analytics_options.hxx +84 -0
  191. package/deps/couchbase-cxx-client/couchbase/drop_index_analytics_options.hxx +103 -0
  192. package/deps/couchbase-cxx-client/couchbase/drop_link_analytics_options.hxx +63 -0
  193. package/deps/couchbase-cxx-client/couchbase/drop_search_index_options.hxx +43 -0
  194. package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +22 -1
  195. package/deps/couchbase-cxx-client/couchbase/exists_options.hxx +0 -23
  196. package/deps/couchbase-cxx-client/couchbase/fmt/key_value_error_map_attribute.hxx +6 -0
  197. package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -0
  198. package/deps/couchbase-cxx-client/couchbase/fmt/transaction_keyspace.hxx +37 -0
  199. package/deps/couchbase-cxx-client/couchbase/freeze_plan_search_index_options.hxx +43 -0
  200. package/deps/couchbase-cxx-client/couchbase/get_all_datasets_analytics_options.hxx +66 -0
  201. package/deps/couchbase-cxx-client/couchbase/get_all_indexes_analytics_options.hxx +65 -0
  202. package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +1 -4
  203. package/deps/couchbase-cxx-client/couchbase/get_all_replicas_options.hxx +0 -23
  204. package/deps/couchbase-cxx-client/couchbase/get_all_search_indexes_options.hxx +45 -0
  205. package/deps/couchbase-cxx-client/couchbase/get_and_lock_options.hxx +0 -24
  206. package/deps/couchbase-cxx-client/couchbase/get_and_touch_options.hxx +0 -24
  207. package/deps/couchbase-cxx-client/couchbase/get_any_replica_options.hxx +0 -23
  208. package/deps/couchbase-cxx-client/couchbase/get_indexed_search_index_options.hxx +43 -0
  209. package/deps/couchbase-cxx-client/couchbase/get_links_analytics_options.hxx +121 -0
  210. package/deps/couchbase-cxx-client/couchbase/get_options.hxx +0 -23
  211. package/deps/couchbase-cxx-client/couchbase/get_pending_mutations_analytics_options.hxx +67 -0
  212. package/deps/couchbase-cxx-client/couchbase/get_search_index_options.hxx +44 -0
  213. package/deps/couchbase-cxx-client/couchbase/increment_options.hxx +0 -23
  214. package/deps/couchbase-cxx-client/couchbase/insert_options.hxx +0 -24
  215. package/deps/couchbase-cxx-client/couchbase/key_value_error_map_attribute.hxx +12 -0
  216. package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
  217. package/deps/couchbase-cxx-client/couchbase/lookup_in_options.hxx +0 -24
  218. package/deps/couchbase-cxx-client/couchbase/management/analytics_dataset.hxx +48 -0
  219. package/deps/couchbase-cxx-client/couchbase/management/analytics_index.hxx +48 -0
  220. package/deps/couchbase-cxx-client/couchbase/management/analytics_link.hxx +239 -0
  221. package/deps/couchbase-cxx-client/couchbase/management/query_index.hxx +3 -3
  222. package/deps/couchbase-cxx-client/couchbase/management/search_index.hxx +40 -0
  223. package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +0 -1
  224. package/deps/couchbase-cxx-client/couchbase/mutate_in_options.hxx +0 -24
  225. package/deps/couchbase-cxx-client/couchbase/network_options.hxx +1 -1
  226. package/deps/couchbase-cxx-client/couchbase/pause_ingest_search_index_options.hxx +43 -0
  227. package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +19 -0
  228. package/deps/couchbase-cxx-client/couchbase/prepend_options.hxx +0 -24
  229. package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +99 -20
  230. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +0 -21
  231. package/deps/couchbase-cxx-client/couchbase/remove_options.hxx +0 -23
  232. package/deps/couchbase-cxx-client/couchbase/replace_link_analytics_options.hxx +63 -0
  233. package/deps/couchbase-cxx-client/couchbase/replace_options.hxx +0 -24
  234. package/deps/couchbase-cxx-client/couchbase/resume_ingest_search_index_options.hxx +43 -0
  235. package/deps/couchbase-cxx-client/couchbase/scope.hxx +13 -45
  236. package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +1 -7
  237. package/deps/couchbase-cxx-client/couchbase/search_geo_distance_units.hxx +26 -0
  238. package/deps/couchbase-cxx-client/couchbase/search_index_manager.hxx +292 -0
  239. package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +10 -0
  240. package/deps/couchbase-cxx-client/couchbase/search_sort_geo_distance.hxx +84 -0
  241. package/deps/couchbase-cxx-client/couchbase/security_options.hxx +1 -1
  242. package/deps/couchbase-cxx-client/couchbase/touch_options.hxx +0 -24
  243. package/deps/couchbase-cxx-client/couchbase/tracing/request_tracer.hxx +1 -1
  244. package/deps/couchbase-cxx-client/couchbase/transactions/async_attempt_context.hxx +10 -7
  245. package/deps/couchbase-cxx-client/couchbase/transactions/attempt_context.hxx +10 -10
  246. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_keyspace.hxx +8 -58
  247. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +28 -70
  248. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +7 -2
  249. package/deps/couchbase-cxx-client/couchbase/transactions/transactions_cleanup_config.hxx +2 -1
  250. package/deps/couchbase-cxx-client/couchbase/transactions/transactions_config.hxx +11 -38
  251. package/deps/couchbase-cxx-client/couchbase/unfreeze_plan_search_index_options.hxx +43 -0
  252. package/deps/couchbase-cxx-client/couchbase/unlock_options.hxx +0 -24
  253. package/deps/couchbase-cxx-client/couchbase/upsert_options.hxx +0 -24
  254. package/deps/couchbase-cxx-client/couchbase/upsert_search_index_options.hxx +41 -0
  255. package/dist/binding.d.ts +7 -9
  256. package/dist/bindingutilities.js +2 -0
  257. package/dist/collection.js +3 -3
  258. package/dist/errors.d.ts +9 -0
  259. package/dist/errors.js +14 -2
  260. package/dist/transactions.d.ts +2 -0
  261. package/dist/transactions.js +2 -3
  262. package/dist/usermanager.js +1 -1
  263. package/package.json +7 -7
  264. package/src/binding.cpp +1 -0
  265. package/src/connection.cpp +12 -9
  266. package/src/connection.hpp +3 -3
  267. package/src/connection_autogen.cpp +7 -5
  268. package/src/constants.cpp +3 -0
  269. package/src/instance.cpp +2 -2
  270. package/src/instance.hpp +1 -1
  271. package/src/jstocbpp_autogen.hpp +21 -38
  272. package/src/jstocbpp_basic.hpp +2 -0
  273. package/src/jstocbpp_errors.hpp +1 -0
  274. package/src/jstocbpp_transactions.hpp +6 -22
  275. package/src/mutationtoken.hpp +1 -0
  276. package/tools/gen-bindings-json.py +39 -16
  277. package/deps/couchbase-cxx-cache/spdlog/66ab2619a0014319471759c03e2de1af6bda14de/spdlog/example/CMakeLists.txt +0 -23
  278. package/deps/couchbase-cxx-cache/spdlog/66ab2619a0014319471759c03e2de1af6bda14de/spdlog/example/example.cpp +0 -398
  279. package/deps/couchbase-cxx-client/core/impl/append.cxx +0 -87
  280. package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +0 -157
  281. package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +0 -158
  282. package/deps/couchbase-cxx-client/core/impl/create_collection.cxx +0 -83
  283. package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +0 -232
  284. package/deps/couchbase-cxx-client/core/impl/create_scope.cxx +0 -69
  285. package/deps/couchbase-cxx-client/core/impl/decrement.cxx +0 -96
  286. package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +0 -66
  287. package/deps/couchbase-cxx-client/core/impl/drop_collection.cxx +0 -76
  288. package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +0 -187
  289. package/deps/couchbase-cxx-client/core/impl/drop_scope.cxx +0 -68
  290. package/deps/couchbase-cxx-client/core/impl/exists.cxx +0 -47
  291. package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +0 -66
  292. package/deps/couchbase-cxx-client/core/impl/get.cxx +0 -68
  293. package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +0 -178
  294. package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +0 -106
  295. package/deps/couchbase-cxx-client/core/impl/get_all_replicas.cxx +0 -145
  296. package/deps/couchbase-cxx-client/core/impl/get_all_scopes.cxx +0 -94
  297. package/deps/couchbase-cxx-client/core/impl/get_and_lock.cxx +0 -49
  298. package/deps/couchbase-cxx-client/core/impl/get_and_touch.cxx +0 -49
  299. package/deps/couchbase-cxx-client/core/impl/get_any_replica.cxx +0 -134
  300. package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +0 -168
  301. package/deps/couchbase-cxx-client/core/impl/increment.cxx +0 -96
  302. package/deps/couchbase-cxx-client/core/impl/insert.cxx +0 -90
  303. package/deps/couchbase-cxx-client/core/impl/lookup_in.cxx +0 -69
  304. package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.cxx +0 -178
  305. package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.cxx +0 -169
  306. package/deps/couchbase-cxx-client/core/impl/mutate_in.cxx +0 -125
  307. package/deps/couchbase-cxx-client/core/impl/prepend.cxx +0 -87
  308. package/deps/couchbase-cxx-client/core/impl/remove.cxx +0 -86
  309. package/deps/couchbase-cxx-client/core/impl/replace.cxx +0 -102
  310. package/deps/couchbase-cxx-client/core/impl/touch.cxx +0 -49
  311. package/deps/couchbase-cxx-client/core/impl/unlock.cxx +0 -47
  312. package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +0 -133
  313. package/deps/couchbase-cxx-client/core/impl/update_collection.cxx +0 -83
  314. package/deps/couchbase-cxx-client/core/impl/upsert.cxx +0 -100
  315. package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +0 -196
  316. package/deps/couchbase-cxx-client/core/operations/mcbp_noop.hxx +0 -49
  317. /package/deps/couchbase-cxx-client/core/impl/{streaming_json_lexter_error_category.cxx → streaming_json_lexer_error_category.cxx} +0 -0
@@ -0,0 +1,820 @@
1
+ /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright 2023-Present Couchbase, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ #include "core/cluster.hxx"
19
+ #include "core/logger/logger.hxx"
20
+
21
+ #include "core/operations/management/analytics_dataset_create.hxx"
22
+ #include "core/operations/management/analytics_dataset_drop.hxx"
23
+ #include "core/operations/management/analytics_dataset_get_all.hxx"
24
+ #include "core/operations/management/analytics_dataverse_create.hxx"
25
+ #include "core/operations/management/analytics_dataverse_drop.hxx"
26
+ #include "core/operations/management/analytics_get_pending_mutations.hxx"
27
+ #include "core/operations/management/analytics_index_create.hxx"
28
+ #include "core/operations/management/analytics_index_drop.hxx"
29
+ #include "core/operations/management/analytics_index_get_all.hxx"
30
+ #include "core/operations/management/analytics_link_connect.hxx"
31
+ #include "core/operations/management/analytics_link_create.hxx"
32
+ #include "core/operations/management/analytics_link_disconnect.hxx"
33
+ #include "core/operations/management/analytics_link_drop.hxx"
34
+ #include "core/operations/management/analytics_link_get_all.hxx"
35
+ #include "core/operations/management/analytics_link_replace.hxx"
36
+ #include "internal_manager_error_context.hxx"
37
+
38
+ #include <couchbase/analytics_index_manager.hxx>
39
+ #include <couchbase/management/analytics_link.hxx>
40
+
41
+ namespace couchbase
42
+ {
43
+ namespace
44
+ {
45
+ template<typename Response>
46
+ manager_error_context
47
+ build_context(Response& resp)
48
+ {
49
+ return manager_error_context{ internal_manager_error_context{ resp.ctx.ec,
50
+ resp.ctx.last_dispatched_to,
51
+ resp.ctx.last_dispatched_from,
52
+ resp.ctx.retry_attempts,
53
+ std::move(resp.ctx.retry_reasons),
54
+ std::move(resp.ctx.client_context_id),
55
+ resp.ctx.http_status,
56
+ std::move(resp.ctx.http_body),
57
+ std::move(resp.ctx.path) } };
58
+ }
59
+
60
+ core::management::analytics::couchbase_remote_link
61
+ to_core_couchbase_remote_link(const management::analytics_link& link)
62
+ {
63
+ auto cb_link = dynamic_cast<const management::couchbase_remote_analytics_link&>(link);
64
+ core::management::analytics::couchbase_remote_link core_link{ cb_link.name,
65
+ cb_link.dataverse_name,
66
+ cb_link.hostname,
67
+ cb_link.username,
68
+ cb_link.password,
69
+ core::management::analytics::couchbase_link_encryption_settings{
70
+ {},
71
+ cb_link.encryption.certificate,
72
+ cb_link.encryption.client_certificate,
73
+ cb_link.encryption.client_key,
74
+ } };
75
+ switch (cb_link.encryption.encryption_level) {
76
+ case management::analytics_encryption_level::none:
77
+ core_link.encryption.level = core::management::analytics::couchbase_link_encryption_level::none;
78
+ break;
79
+ case management::analytics_encryption_level::half:
80
+ core_link.encryption.level = core::management::analytics::couchbase_link_encryption_level::half;
81
+ break;
82
+ case management::analytics_encryption_level::full:
83
+ core_link.encryption.level = core::management::analytics::couchbase_link_encryption_level::full;
84
+ break;
85
+ }
86
+ return core_link;
87
+ }
88
+
89
+ core::management::analytics::azure_blob_external_link
90
+ to_core_azure_blob_external_link(const management::analytics_link& link)
91
+ {
92
+ auto azure_link = dynamic_cast<const management::azure_blob_external_analytics_link&>(link);
93
+ return core::management::analytics::azure_blob_external_link{
94
+ azure_link.name, azure_link.dataverse_name, azure_link.connection_string, azure_link.account_name,
95
+ azure_link.account_key, azure_link.shared_access_signature, azure_link.blob_endpoint, azure_link.endpoint_suffix,
96
+ };
97
+ }
98
+
99
+ core::management::analytics::s3_external_link
100
+ to_core_s3_external_link(const management::analytics_link& link)
101
+ {
102
+ auto s3_link = dynamic_cast<const management::s3_external_analytics_link&>(link);
103
+ return core::management::analytics::s3_external_link{
104
+ s3_link.name, s3_link.dataverse_name, s3_link.access_key_id, s3_link.secret_access_key,
105
+ s3_link.session_token, s3_link.region, s3_link.service_endpoint,
106
+ };
107
+ }
108
+ } // namespace
109
+
110
+ class analytics_index_manager_impl : public std::enable_shared_from_this<analytics_index_manager_impl>
111
+ {
112
+ public:
113
+ explicit analytics_index_manager_impl(core::cluster core)
114
+ : core_{ std::move(core) }
115
+ {
116
+ }
117
+
118
+ void create_dataverse(const std::string& dataverse_name,
119
+ const create_dataverse_analytics_options::built& options,
120
+ create_dataverse_analytics_handler&& handler) const
121
+ {
122
+ return core_.execute(
123
+ core::operations::management::analytics_dataverse_create_request{
124
+ dataverse_name,
125
+ options.ignore_if_exists,
126
+ {},
127
+ options.timeout,
128
+ },
129
+ [dataverse_name, handler = std::move(handler)](auto resp) {
130
+ CB_LOG_DEBUG("Dataverse create for {} error code = {}", dataverse_name, resp.ctx.ec.value());
131
+ handler(build_context(resp));
132
+ });
133
+ }
134
+
135
+ void drop_dataverse(const std::string& dataverse_name,
136
+ const drop_dataverse_analytics_options::built& options,
137
+ drop_dataverse_analytics_handler&& handler) const
138
+ {
139
+ return core_.execute(
140
+ core::operations::management::analytics_dataverse_drop_request{
141
+ dataverse_name,
142
+ options.ignore_if_not_exists,
143
+ {},
144
+ options.timeout,
145
+ },
146
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
147
+ }
148
+
149
+ void create_dataset(const std::string& dataset_name,
150
+ const std::string& bucket_name,
151
+ const create_dataset_analytics_options::built& options,
152
+ create_dataset_analytics_handler&& handler) const
153
+ {
154
+ return core_.execute(
155
+ core::operations::management::analytics_dataset_create_request{
156
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
157
+ dataset_name,
158
+ bucket_name,
159
+ options.condition,
160
+ {},
161
+ options.timeout,
162
+ options.ignore_if_exists,
163
+ },
164
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
165
+ }
166
+
167
+ void drop_dataset(const std::string& dataset_name,
168
+ const drop_dataset_analytics_options::built& options,
169
+ drop_dataset_analytics_handler&& handler) const
170
+ {
171
+ return core_.execute(
172
+ core::operations::management::analytics_dataset_drop_request{
173
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
174
+ dataset_name,
175
+ options.ignore_if_not_exists,
176
+ {},
177
+ options.timeout,
178
+ },
179
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
180
+ }
181
+
182
+ void get_all_datasets(const get_all_datasets_analytics_options::built& options, get_all_datasets_analytics_handler&& handler) const
183
+ {
184
+ return core_.execute(
185
+ core::operations::management::analytics_dataset_get_all_request{
186
+ {},
187
+ options.timeout,
188
+ },
189
+ [handler = std::move(handler)](core::operations::management::analytics_dataset_get_all_response resp) {
190
+ if (resp.ctx.ec) {
191
+ return handler(build_context(resp), {});
192
+ }
193
+ std::vector<management::analytics_dataset> datasets{};
194
+ datasets.reserve(resp.datasets.size());
195
+ for (const auto& d : resp.datasets) {
196
+ datasets.push_back(management::analytics_dataset{
197
+ d.name,
198
+ d.dataverse_name,
199
+ d.link_name,
200
+ d.bucket_name,
201
+ });
202
+ }
203
+ handler(build_context(resp), datasets);
204
+ });
205
+ }
206
+
207
+ void create_index(const std::string& index_name,
208
+ const std::string& dataset_name,
209
+ const std::map<std::string, std::string>& fields,
210
+ const create_index_analytics_options::built& options,
211
+ create_index_analytics_handler&& handler) const
212
+ {
213
+ return core_.execute(
214
+ core::operations::management::analytics_index_create_request{
215
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
216
+ dataset_name,
217
+ index_name,
218
+ fields,
219
+ options.ignore_if_exists,
220
+ {},
221
+ options.timeout,
222
+ },
223
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
224
+ }
225
+
226
+ void drop_index(const std::string& index_name,
227
+ const std::string& dataset_name,
228
+ const drop_index_analytics_options::built& options,
229
+ drop_index_analytics_handler&& handler) const
230
+ {
231
+ return core_.execute(
232
+ core::operations::management::analytics_index_drop_request{
233
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
234
+ dataset_name,
235
+ index_name,
236
+ options.ignore_if_not_exists,
237
+ {},
238
+ options.timeout,
239
+ },
240
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
241
+ }
242
+
243
+ void get_all_indexes(const get_all_indexes_analytics_options::built& options, get_all_indexes_analytics_handler&& handler) const
244
+ {
245
+ return core_.execute(
246
+ core::operations::management::analytics_index_get_all_request{
247
+ {},
248
+ options.timeout,
249
+ },
250
+ [handler = std::move(handler)](core::operations::management::analytics_index_get_all_response resp) {
251
+ if (resp.ctx.ec) {
252
+ return handler(build_context(resp), {});
253
+ }
254
+ std::vector<management::analytics_index> indexes{};
255
+ indexes.reserve(resp.indexes.size());
256
+ for (const auto& idx : resp.indexes) {
257
+ indexes.push_back(management::analytics_index{
258
+ idx.name,
259
+ idx.dataset_name,
260
+ idx.dataverse_name,
261
+ idx.is_primary,
262
+ });
263
+ }
264
+ handler(build_context(resp), indexes);
265
+ });
266
+ }
267
+
268
+ void connect_link(const connect_link_analytics_options::built& options, connect_link_analytics_handler&& handler) const
269
+ {
270
+ return core_.execute(
271
+ core::operations::management::analytics_link_connect_request{
272
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
273
+ options.link_name.value_or(DEFAULT_LINK_NAME),
274
+ options.force,
275
+ {},
276
+ options.timeout,
277
+ },
278
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
279
+ }
280
+
281
+ void disconnect_link(const disconnect_link_analytics_options::built& options, disconnect_link_analytics_handler&& handler) const
282
+ {
283
+ return core_.execute(
284
+ core::operations::management::analytics_link_disconnect_request{
285
+ options.dataverse_name.value_or(DEFAULT_DATAVERSE_NAME),
286
+ options.link_name.value_or(DEFAULT_LINK_NAME),
287
+ {},
288
+ options.timeout,
289
+ },
290
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
291
+ }
292
+
293
+ void get_pending_mutations(const get_pending_mutations_analytics_options::built& options,
294
+ get_pending_mutations_analytics_handler&& handler) const
295
+ {
296
+ return core_.execute(
297
+ core::operations::management::analytics_get_pending_mutations_request{
298
+ {},
299
+ options.timeout,
300
+ },
301
+ [handler = std::move(handler)](core::operations::management::analytics_get_pending_mutations_response resp) {
302
+ if (resp.ctx.ec) {
303
+ return handler(build_context(resp), {});
304
+ }
305
+ std::map<std::string, std::map<std::string, std::int64_t>> pending_mutations{};
306
+ const std::string separator{ "." };
307
+ for (const auto& [key, mutation_count] : resp.stats) {
308
+ // Keys are encoded as `dataverse.dataset`
309
+ auto separator_pos = key.find(separator);
310
+ auto dataverse_name = key.substr(0, separator_pos);
311
+ auto dataset_name = key.substr(separator_pos + 1, key.size() - separator_pos - 1);
312
+ if (pending_mutations.count(dataverse_name) == 0) {
313
+ pending_mutations.insert({ dataverse_name, {} });
314
+ }
315
+ pending_mutations.at(dataverse_name).insert({ dataset_name, mutation_count });
316
+ }
317
+ handler(build_context(resp), pending_mutations);
318
+ });
319
+ }
320
+
321
+ void create_link(const management::analytics_link& link,
322
+ const create_link_analytics_options::built& options,
323
+ create_link_analytics_handler&& handler) const
324
+ {
325
+ switch (link.link_type()) {
326
+ case management::s3_external:
327
+ return core_.execute(
328
+ core::operations::management::analytics_link_create_request<core::management::analytics::s3_external_link>{
329
+ to_core_s3_external_link(link),
330
+ {},
331
+ options.timeout,
332
+ },
333
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
334
+
335
+ case management::azure_external:
336
+ return core_.execute(
337
+ core::operations::management::analytics_link_create_request<core::management::analytics::azure_blob_external_link>{
338
+ to_core_azure_blob_external_link(link),
339
+ {},
340
+ options.timeout,
341
+ },
342
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
343
+
344
+ case management::couchbase_remote:
345
+ return core_.execute(
346
+ core::operations::management::analytics_link_create_request<core::management::analytics::couchbase_remote_link>{
347
+ to_core_couchbase_remote_link(link),
348
+ {},
349
+ options.timeout,
350
+ },
351
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
352
+ }
353
+ }
354
+
355
+ void replace_link(const management::analytics_link& link,
356
+ const replace_link_analytics_options::built& options,
357
+ replace_link_analytics_handler&& handler) const
358
+ {
359
+ switch (link.link_type()) {
360
+ case management::s3_external:
361
+ return core_.execute(
362
+ core::operations::management::analytics_link_replace_request<core::management::analytics::s3_external_link>{
363
+ to_core_s3_external_link(link),
364
+ {},
365
+ options.timeout,
366
+ },
367
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
368
+
369
+ case management::azure_external:
370
+ return core_.execute(
371
+ core::operations::management::analytics_link_replace_request<core::management::analytics::azure_blob_external_link>{
372
+ to_core_azure_blob_external_link(link),
373
+ {},
374
+ options.timeout,
375
+ },
376
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
377
+
378
+ case management::couchbase_remote:
379
+ return core_.execute(
380
+ core::operations::management::analytics_link_replace_request<core::management::analytics::couchbase_remote_link>{
381
+ to_core_couchbase_remote_link(link),
382
+ {},
383
+ options.timeout,
384
+ },
385
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
386
+ }
387
+ }
388
+
389
+ void drop_link(const std::string& link_name,
390
+ const std::string& dataverse_name,
391
+ const drop_link_analytics_options::built& options,
392
+ drop_link_analytics_handler&& handler) const
393
+ {
394
+ return core_.execute(
395
+ core::operations::management::analytics_link_drop_request{
396
+ link_name,
397
+ dataverse_name,
398
+ {},
399
+ options.timeout,
400
+ },
401
+ [handler = std::move(handler)](auto resp) { handler(build_context(resp)); });
402
+ }
403
+
404
+ void get_links(const get_links_analytics_options::built& options, get_links_analytics_handler&& handler) const
405
+ {
406
+ core::operations::management::analytics_link_get_all_request req{
407
+ {}, {}, {}, {}, options.timeout,
408
+ };
409
+ if (options.name.has_value()) {
410
+ req.link_name = options.name.value();
411
+ }
412
+ if (options.dataverse_name.has_value()) {
413
+ req.dataverse_name = options.dataverse_name.value();
414
+ }
415
+ if (options.link_type.has_value()) {
416
+ switch (options.link_type.value()) {
417
+ case management::s3_external:
418
+ req.link_type = "s3";
419
+ break;
420
+ case management::azure_external:
421
+ req.link_type = "azureblob";
422
+ break;
423
+ case management::couchbase_remote:
424
+ req.link_type = "couchbase";
425
+ break;
426
+ }
427
+ }
428
+ return core_.execute(req, [handler = std::move(handler)](core::operations::management::analytics_link_get_all_response resp) {
429
+ if (resp.ctx.ec) {
430
+ return handler(build_context(resp), {});
431
+ }
432
+ std::vector<std::unique_ptr<management::analytics_link>> links{};
433
+
434
+ for (const auto& link : resp.couchbase) {
435
+ auto cb_link = std::make_unique<management::couchbase_remote_analytics_link>();
436
+ cb_link->name = link.link_name;
437
+ cb_link->dataverse_name = link.dataverse;
438
+ cb_link->hostname = link.hostname;
439
+ switch (link.encryption.level) {
440
+ case core::management::analytics::couchbase_link_encryption_level::none:
441
+ cb_link->encryption.encryption_level = management::analytics_encryption_level::none;
442
+ break;
443
+ case core::management::analytics::couchbase_link_encryption_level::half:
444
+ cb_link->encryption.encryption_level = management::analytics_encryption_level::half;
445
+ break;
446
+ case core::management::analytics::couchbase_link_encryption_level::full:
447
+ cb_link->encryption.encryption_level = management::analytics_encryption_level::full;
448
+ break;
449
+ }
450
+ cb_link->encryption.certificate = link.encryption.certificate;
451
+ cb_link->encryption.client_certificate = link.encryption.client_certificate;
452
+ cb_link->username = link.username;
453
+ links.push_back(std::move(cb_link));
454
+ }
455
+
456
+ for (const auto& link : resp.s3) {
457
+ auto s3_link = std::make_unique<management::s3_external_analytics_link>();
458
+ s3_link->name = link.link_name;
459
+ s3_link->dataverse_name = link.dataverse;
460
+ s3_link->access_key_id = link.access_key_id;
461
+ s3_link->region = link.region;
462
+ s3_link->service_endpoint = link.service_endpoint;
463
+ links.push_back(std::move(s3_link));
464
+ }
465
+
466
+ for (const auto& link : resp.azure_blob) {
467
+ auto azure_link = std::make_unique<management::azure_blob_external_analytics_link>();
468
+ azure_link->name = link.link_name;
469
+ azure_link->dataverse_name = link.dataverse;
470
+ azure_link->account_name = link.account_name;
471
+ azure_link->blob_endpoint = link.blob_endpoint;
472
+ azure_link->endpoint_suffix = link.endpoint_suffix;
473
+ links.push_back(std::move(azure_link));
474
+ }
475
+
476
+ handler(build_context(resp), std::move(links));
477
+ });
478
+ }
479
+
480
+ private:
481
+ static const inline std::string DEFAULT_DATAVERSE_NAME = "Default";
482
+ static const inline std::string DEFAULT_LINK_NAME = "Local";
483
+
484
+ core::cluster core_;
485
+ };
486
+
487
+ analytics_index_manager::analytics_index_manager(core::cluster core)
488
+ : impl_(std::make_shared<analytics_index_manager_impl>(std::move(core)))
489
+ {
490
+ }
491
+
492
+ void
493
+ analytics_index_manager::create_dataverse(std::string dataverse_name,
494
+ const create_dataverse_analytics_options& options,
495
+ create_dataverse_analytics_handler&& handler) const
496
+ {
497
+ return impl_->create_dataverse(dataverse_name, options.build(), std::move(handler));
498
+ }
499
+
500
+ auto
501
+ analytics_index_manager::create_dataverse(std::string dataverse_name, const create_dataverse_analytics_options& options) const
502
+ -> std::future<manager_error_context>
503
+ {
504
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
505
+ auto future = barrier->get_future();
506
+ create_dataverse(std::move(dataverse_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
507
+ return future;
508
+ }
509
+
510
+ void
511
+ analytics_index_manager::drop_dataverse(std::string dataverse_name,
512
+ const drop_dataverse_analytics_options& options,
513
+ drop_dataverse_analytics_handler&& handler) const
514
+ {
515
+ return impl_->drop_dataverse(dataverse_name, options.build(), std::move(handler));
516
+ }
517
+
518
+ auto
519
+ analytics_index_manager::drop_dataverse(std::string dataverse_name, const drop_dataverse_analytics_options& options) const
520
+ -> std::future<manager_error_context>
521
+ {
522
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
523
+ auto future = barrier->get_future();
524
+ drop_dataverse(std::move(dataverse_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
525
+ return future;
526
+ }
527
+
528
+ void
529
+ analytics_index_manager::create_dataset(std::string dataset_name,
530
+ std::string bucket_name,
531
+ const create_dataset_analytics_options& options,
532
+ create_dataset_analytics_handler&& handler) const
533
+ {
534
+ return impl_->create_dataset(dataset_name, bucket_name, options.build(), std::move(handler));
535
+ }
536
+
537
+ auto
538
+ analytics_index_manager::create_dataset(std::string dataset_name,
539
+ std::string bucket_name,
540
+ const create_dataset_analytics_options& options) const -> std::future<manager_error_context>
541
+ {
542
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
543
+ auto future = barrier->get_future();
544
+ create_dataset(
545
+ std::move(dataset_name), std::move(bucket_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
546
+ return future;
547
+ }
548
+
549
+ void
550
+ analytics_index_manager::drop_dataset(std::string dataset_name,
551
+ const drop_dataset_analytics_options& options,
552
+ drop_dataset_analytics_handler&& handler) const
553
+ {
554
+ return impl_->drop_dataset(dataset_name, options.build(), std::move(handler));
555
+ }
556
+
557
+ auto
558
+ analytics_index_manager::drop_dataset(std::string dataset_name, const drop_dataset_analytics_options& options) const
559
+ -> std::future<manager_error_context>
560
+ {
561
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
562
+ auto future = barrier->get_future();
563
+ drop_dataset(std::move(dataset_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
564
+ return future;
565
+ }
566
+
567
+ void
568
+ analytics_index_manager::get_all_datasets(const get_all_datasets_analytics_options& options,
569
+ get_all_datasets_analytics_handler&& handler) const
570
+ {
571
+ return impl_->get_all_datasets(options.build(), std::move(handler));
572
+ }
573
+
574
+ auto
575
+ analytics_index_manager::get_all_datasets(const get_all_datasets_analytics_options& options) const
576
+ -> std::future<std::pair<manager_error_context, std::vector<management::analytics_dataset>>>
577
+ {
578
+ auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, std::vector<management::analytics_dataset>>>>();
579
+ auto future = barrier->get_future();
580
+ get_all_datasets(options, [barrier](auto ctx, auto resp) mutable { barrier->set_value({ std::move(ctx), std::move(resp) }); });
581
+ return future;
582
+ }
583
+
584
+ void
585
+ analytics_index_manager::create_index(std::string index_name,
586
+ std::string dataset_name,
587
+ std::map<std::string, std::string> fields,
588
+ const create_index_analytics_options& options,
589
+ create_index_analytics_handler&& handler) const
590
+ {
591
+ return impl_->create_index(index_name, dataset_name, fields, options.build(), std::move(handler));
592
+ }
593
+
594
+ auto
595
+ analytics_index_manager::create_index(std::string index_name,
596
+ std::string dataset_name,
597
+ std::map<std::string, std::string> fields,
598
+ const create_index_analytics_options& options) const -> std::future<manager_error_context>
599
+ {
600
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
601
+ auto future = barrier->get_future();
602
+ create_index(std::move(index_name), std::move(dataset_name), std::move(fields), options, [barrier](auto ctx) mutable {
603
+ barrier->set_value({ std::move(ctx) });
604
+ });
605
+ return future;
606
+ }
607
+
608
+ void
609
+ analytics_index_manager::drop_index(std::string index_name,
610
+ std::string dataset_name,
611
+ const drop_index_analytics_options& options,
612
+ drop_index_analytics_handler&& handler) const
613
+ {
614
+ return impl_->drop_index(index_name, dataset_name, options.build(), std::move(handler));
615
+ }
616
+
617
+ auto
618
+ analytics_index_manager::drop_index(std::string index_name, std::string dataset_name, const drop_index_analytics_options& options) const
619
+ -> std::future<manager_error_context>
620
+ {
621
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
622
+ auto future = barrier->get_future();
623
+ drop_index(
624
+ std::move(index_name), std::move(dataset_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
625
+ return future;
626
+ }
627
+
628
+ void
629
+ analytics_index_manager::get_all_indexes(const get_all_indexes_analytics_options& options,
630
+ get_all_indexes_analytics_handler&& handler) const
631
+ {
632
+ return impl_->get_all_indexes(options.build(), std::move(handler));
633
+ }
634
+
635
+ auto
636
+ analytics_index_manager::get_all_indexes(const get_all_indexes_analytics_options& options) const
637
+ -> std::future<std::pair<manager_error_context, std::vector<management::analytics_index>>>
638
+ {
639
+ auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, std::vector<management::analytics_index>>>>();
640
+ auto future = barrier->get_future();
641
+ get_all_indexes(options, [barrier](auto ctx, auto resp) mutable { barrier->set_value({ std::move(ctx), std::move(resp) }); });
642
+ return future;
643
+ }
644
+
645
+ void
646
+ analytics_index_manager::connect_link(const connect_link_analytics_options& options, connect_link_analytics_handler&& handler) const
647
+ {
648
+ return impl_->connect_link(options.build(), std::move(handler));
649
+ }
650
+
651
+ auto
652
+ analytics_index_manager::connect_link(const connect_link_analytics_options& options) const -> std::future<manager_error_context>
653
+ {
654
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
655
+ auto future = barrier->get_future();
656
+ connect_link(options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
657
+ return future;
658
+ }
659
+
660
+ void
661
+ analytics_index_manager::disconnect_link(const disconnect_link_analytics_options& options,
662
+ disconnect_link_analytics_handler&& handler) const
663
+ {
664
+ return impl_->disconnect_link(options.build(), std::move(handler));
665
+ }
666
+
667
+ auto
668
+ analytics_index_manager::disconnect_link(const disconnect_link_analytics_options& options) const -> std::future<manager_error_context>
669
+ {
670
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
671
+ auto future = barrier->get_future();
672
+ disconnect_link(options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
673
+ return future;
674
+ }
675
+
676
+ void
677
+ analytics_index_manager::get_pending_mutations(const get_pending_mutations_analytics_options& options,
678
+ get_pending_mutations_analytics_handler&& handler) const
679
+ {
680
+ return impl_->get_pending_mutations(options.build(), std::move(handler));
681
+ }
682
+
683
+ auto
684
+ analytics_index_manager::get_pending_mutations(const get_pending_mutations_analytics_options& options) const
685
+ -> std::future<std::pair<couchbase::manager_error_context, std::map<std::string, std::map<std::string, std::int64_t>>>>
686
+ {
687
+ auto barrier = std::make_shared<
688
+ std::promise<std::pair<couchbase::manager_error_context, std::map<std::string, std::map<std::string, std::int64_t>>>>>();
689
+ auto future = barrier->get_future();
690
+ get_pending_mutations(options, [barrier](auto ctx, auto resp) mutable { barrier->set_value({ std::move(ctx), std::move(resp) }); });
691
+ return future;
692
+ }
693
+
694
+ void
695
+ analytics_index_manager::create_link(const management::analytics_link& link,
696
+ const create_link_analytics_options& options,
697
+ create_link_analytics_handler&& handler) const
698
+ {
699
+ return impl_->create_link(link, options.build(), std::move(handler));
700
+ }
701
+
702
+ auto
703
+ analytics_index_manager::create_link(const management::analytics_link& link, const create_link_analytics_options& options) const
704
+ -> std::future<manager_error_context>
705
+ {
706
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
707
+ auto future = barrier->get_future();
708
+ create_link(link, options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
709
+ return future;
710
+ }
711
+
712
+ void
713
+ analytics_index_manager::replace_link(const management::analytics_link& link,
714
+ const replace_link_analytics_options& options,
715
+ replace_link_analytics_handler&& handler) const
716
+ {
717
+ return impl_->replace_link(link, options.build(), std::move(handler));
718
+ }
719
+
720
+ auto
721
+ analytics_index_manager::replace_link(const management::analytics_link& link, const replace_link_analytics_options& options) const
722
+ -> std::future<manager_error_context>
723
+ {
724
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
725
+ auto future = barrier->get_future();
726
+ replace_link(link, options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
727
+ return future;
728
+ }
729
+
730
+ void
731
+ analytics_index_manager::drop_link(std::string link_name,
732
+ std::string dataverse_name,
733
+ const drop_link_analytics_options& options,
734
+ drop_link_analytics_handler&& handler) const
735
+ {
736
+ return impl_->drop_link(link_name, dataverse_name, options.build(), std::move(handler));
737
+ }
738
+
739
+ auto
740
+ analytics_index_manager::drop_link(std::string link_name, std::string dataverse_name, const drop_link_analytics_options& options) const
741
+ -> std::future<manager_error_context>
742
+ {
743
+ auto barrier = std::make_shared<std::promise<manager_error_context>>();
744
+ auto future = barrier->get_future();
745
+ drop_link(
746
+ std::move(link_name), std::move(dataverse_name), options, [barrier](auto ctx) mutable { barrier->set_value({ std::move(ctx) }); });
747
+ return future;
748
+ }
749
+
750
+ void
751
+ analytics_index_manager::get_links(const get_links_analytics_options& options, get_links_analytics_handler&& handler) const
752
+ {
753
+ return impl_->get_links(options.build(), std::move(handler));
754
+ }
755
+
756
+ auto
757
+ analytics_index_manager::get_links(const get_links_analytics_options& options) const
758
+ -> std::future<std::pair<manager_error_context, std::vector<std::unique_ptr<management::analytics_link>>>>
759
+ {
760
+ auto barrier =
761
+ std::make_shared<std::promise<std::pair<manager_error_context, std::vector<std::unique_ptr<management::analytics_link>>>>>();
762
+ auto future = barrier->get_future();
763
+ get_links(options, [barrier](auto ctx, auto resp) mutable { barrier->set_value({ std::move(ctx), std::move(resp) }); });
764
+ return future;
765
+ }
766
+
767
+ management::analytics_link::analytics_link(std::string name, std::string dataverse_name)
768
+ : name(std::move(name))
769
+ , dataverse_name(std::move(dataverse_name))
770
+ {
771
+ }
772
+
773
+ management::couchbase_remote_analytics_link::couchbase_remote_analytics_link(std::string name,
774
+ std::string dataverse_name,
775
+ std::string hostname,
776
+ couchbase_analytics_encryption_settings encryption,
777
+ std::optional<std::string> username,
778
+ std::optional<std::string> password)
779
+ : analytics_link(std::move(name), std::move(dataverse_name))
780
+ , hostname(std::move(hostname))
781
+ , encryption(std::move(encryption))
782
+ , username(std::move(username))
783
+ , password(std::move(password))
784
+ {
785
+ }
786
+
787
+ management::s3_external_analytics_link::s3_external_analytics_link(std::string name,
788
+ std::string dataverse_name,
789
+ std::string access_key_id,
790
+ std::string secret_access_key,
791
+ std::string region,
792
+ std::optional<std::string> session_token,
793
+ std::optional<std::string> service_endpoint)
794
+ : analytics_link(std::move(name), std::move(dataverse_name))
795
+ , access_key_id(std::move(access_key_id))
796
+ , secret_access_key(std::move(secret_access_key))
797
+ , region(std::move(region))
798
+ , session_token(std::move(session_token))
799
+ , service_endpoint(std::move(service_endpoint))
800
+ {
801
+ }
802
+
803
+ management::azure_blob_external_analytics_link::azure_blob_external_analytics_link(std::string name,
804
+ std::string dataverse_name,
805
+ std::optional<std::string> connection_string,
806
+ std::optional<std::string> account_name,
807
+ std::optional<std::string> account_key,
808
+ std::optional<std::string> shared_access_signature,
809
+ std::optional<std::string> blob_endpoint,
810
+ std::optional<std::string> endpoint_suffix)
811
+ : analytics_link(std::move(name), std::move(dataverse_name))
812
+ , connection_string(std::move(connection_string))
813
+ , account_name(std::move(account_name))
814
+ , account_key(std::move(account_key))
815
+ , shared_access_signature(std::move(shared_access_signature))
816
+ , blob_endpoint(std::move(blob_endpoint))
817
+ , endpoint_suffix(std::move(endpoint_suffix))
818
+ {
819
+ }
820
+ } // namespace couchbase