couchbase 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. package/deps/couchbase-cxx-client/CMakeLists.txt +54 -4
  2. package/deps/couchbase-cxx-client/README.md +1 -0
  3. package/deps/couchbase-cxx-client/bin/create-search-index +164 -0
  4. package/deps/couchbase-cxx-client/bin/init-cluster +55 -10
  5. package/deps/couchbase-cxx-client/bin/run-unit-tests +62 -6
  6. package/deps/couchbase-cxx-client/bin/travel-sample-index-v6.json +184 -0
  7. package/deps/couchbase-cxx-client/bin/travel-sample-index.json +188 -0
  8. package/deps/couchbase-cxx-client/cmake/Documentation.cmake +0 -1
  9. package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +98 -3
  10. package/deps/couchbase-cxx-client/cmake/Testing.cmake +8 -0
  11. package/deps/couchbase-cxx-client/cmake/build_config.hxx.in +3 -0
  12. package/deps/couchbase-cxx-client/core/bucket.cxx +183 -152
  13. package/deps/couchbase-cxx-client/core/bucket.hxx +17 -4
  14. package/deps/couchbase-cxx-client/core/cluster.hxx +18 -1
  15. package/deps/couchbase-cxx-client/core/cluster_options.hxx +1 -0
  16. package/deps/couchbase-cxx-client/core/error_context/key_value.cxx +2 -1
  17. package/deps/couchbase-cxx-client/core/error_context/key_value.hxx +10 -12
  18. package/deps/couchbase-cxx-client/core/error_context/search.hxx +1 -1
  19. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  20. package/deps/couchbase-cxx-client/core/impl/boolean_field_query.cxx +40 -0
  21. package/deps/couchbase-cxx-client/core/impl/boolean_query.cxx +62 -0
  22. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +1 -0
  23. package/deps/couchbase-cxx-client/core/impl/conjunction_query.cxx +51 -0
  24. package/deps/couchbase-cxx-client/core/impl/date_range.cxx +89 -0
  25. package/deps/couchbase-cxx-client/core/impl/date_range_facet.cxx +54 -0
  26. package/deps/couchbase-cxx-client/core/impl/date_range_facet_result.cxx +64 -0
  27. package/deps/couchbase-cxx-client/core/impl/date_range_query.cxx +125 -0
  28. package/deps/couchbase-cxx-client/core/impl/disjunction_query.cxx +51 -0
  29. package/deps/couchbase-cxx-client/core/impl/encoded_search_facet.hxx +29 -0
  30. package/deps/couchbase-cxx-client/core/impl/encoded_search_query.hxx +29 -0
  31. package/deps/couchbase-cxx-client/core/impl/encoded_search_sort.hxx +29 -0
  32. package/deps/couchbase-cxx-client/core/impl/geo_bounding_box_query.cxx +46 -0
  33. package/deps/couchbase-cxx-client/core/impl/geo_distance_query.cxx +43 -0
  34. package/deps/couchbase-cxx-client/core/impl/geo_polygon_query.cxx +46 -0
  35. package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.cxx +80 -0
  36. package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.hxx +48 -0
  37. package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.cxx +80 -0
  38. package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.hxx +48 -0
  39. package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.cxx +141 -0
  40. package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.hxx +61 -0
  41. package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.cxx +60 -0
  42. package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.hxx +41 -0
  43. package/deps/couchbase-cxx-client/core/impl/internal_search_result.cxx +84 -0
  44. package/deps/couchbase-cxx-client/core/impl/internal_search_result.hxx +43 -0
  45. package/deps/couchbase-cxx-client/core/impl/internal_search_row.cxx +82 -0
  46. package/deps/couchbase-cxx-client/core/impl/internal_search_row.hxx +56 -0
  47. package/deps/couchbase-cxx-client/core/impl/internal_search_row_location.hxx +32 -0
  48. package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.cxx +137 -0
  49. package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.hxx +45 -0
  50. package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.cxx +80 -0
  51. package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.hxx +48 -0
  52. package/deps/couchbase-cxx-client/core/impl/key_value_error_context.cxx +98 -0
  53. package/deps/couchbase-cxx-client/core/impl/match_all_query.cxx +35 -0
  54. package/deps/couchbase-cxx-client/core/impl/match_none_query.cxx +35 -0
  55. package/deps/couchbase-cxx-client/core/impl/match_phrase_query.cxx +43 -0
  56. package/deps/couchbase-cxx-client/core/impl/match_query.cxx +59 -0
  57. package/deps/couchbase-cxx-client/core/impl/numeric_range.cxx +49 -0
  58. package/deps/couchbase-cxx-client/core/impl/numeric_range_facet.cxx +54 -0
  59. package/deps/couchbase-cxx-client/core/impl/numeric_range_facet_result.cxx +64 -0
  60. package/deps/couchbase-cxx-client/core/impl/numeric_range_query.cxx +56 -0
  61. package/deps/couchbase-cxx-client/core/impl/phrase_query.cxx +42 -0
  62. package/deps/couchbase-cxx-client/core/impl/prefix_query.cxx +40 -0
  63. package/deps/couchbase-cxx-client/core/impl/query_error_context.cxx +75 -0
  64. package/deps/couchbase-cxx-client/core/impl/query_string_query.cxx +37 -0
  65. package/deps/couchbase-cxx-client/core/impl/regexp_query.cxx +40 -0
  66. package/deps/couchbase-cxx-client/core/impl/search.cxx +191 -0
  67. package/deps/couchbase-cxx-client/core/impl/search_error_context.cxx +147 -0
  68. package/deps/couchbase-cxx-client/core/impl/search_meta_data.cxx +46 -0
  69. package/deps/couchbase-cxx-client/core/impl/search_result.cxx +66 -0
  70. package/deps/couchbase-cxx-client/core/impl/search_row.cxx +74 -0
  71. package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +64 -0
  72. package/deps/couchbase-cxx-client/core/impl/search_row_locations.cxx +66 -0
  73. package/deps/couchbase-cxx-client/core/impl/search_sort_field.cxx +104 -0
  74. package/deps/couchbase-cxx-client/core/impl/search_sort_id.cxx +43 -0
  75. package/deps/couchbase-cxx-client/core/impl/search_sort_score.cxx +43 -0
  76. package/deps/couchbase-cxx-client/core/impl/term_facet.cxx +36 -0
  77. package/deps/couchbase-cxx-client/core/impl/term_facet_result.cxx +64 -0
  78. package/deps/couchbase-cxx-client/core/impl/term_query.cxx +56 -0
  79. package/deps/couchbase-cxx-client/core/impl/term_range_query.cxx +57 -0
  80. package/deps/couchbase-cxx-client/core/impl/wildcard_query.cxx +40 -0
  81. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +9 -2
  82. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +54 -37
  83. package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +4 -3
  84. package/deps/couchbase-cxx-client/core/json_string.hxx +5 -0
  85. package/deps/couchbase-cxx-client/core/meta/version.cxx +18 -4
  86. package/deps/couchbase-cxx-client/core/mozilla_ca_bundle.hxx +39 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_search.cxx +3 -1
  88. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -1
  89. package/deps/couchbase-cxx-client/core/protocol/client_request.hxx +11 -2
  90. package/deps/couchbase-cxx-client/core/protocol/client_response.hxx +1 -0
  91. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +59 -46
  92. package/deps/couchbase-cxx-client/core/utils/connection_string.hxx +1 -0
  93. package/deps/couchbase-cxx-client/couchbase/analytics_error_context.hxx +1 -1
  94. package/deps/couchbase-cxx-client/couchbase/boolean_field_query.hxx +77 -0
  95. package/deps/couchbase-cxx-client/couchbase/boolean_query.hxx +223 -0
  96. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +39 -0
  97. package/deps/couchbase-cxx-client/couchbase/conjunction_query.hxx +88 -0
  98. package/deps/couchbase-cxx-client/couchbase/date_range.hxx +69 -0
  99. package/deps/couchbase-cxx-client/couchbase/date_range_facet.hxx +56 -0
  100. package/deps/couchbase-cxx-client/couchbase/date_range_facet_result.hxx +55 -0
  101. package/deps/couchbase-cxx-client/couchbase/date_range_query.hxx +265 -0
  102. package/deps/couchbase-cxx-client/couchbase/disjunction_query.hxx +109 -0
  103. package/deps/couchbase-cxx-client/couchbase/doc_id_query.hxx +111 -0
  104. package/deps/couchbase-cxx-client/couchbase/error_context.hxx +17 -8
  105. package/deps/couchbase-cxx-client/couchbase/fmt/analytics_scan_consistency.hxx +52 -0
  106. package/deps/couchbase-cxx-client/{core/topology/error_map_fmt.hxx → couchbase/fmt/key_value_error_map_attribute.hxx} +21 -21
  107. package/deps/couchbase-cxx-client/couchbase/fmt/search_scan_consistency.hxx +49 -0
  108. package/deps/couchbase-cxx-client/couchbase/geo_bounding_box_query.hxx +107 -0
  109. package/deps/couchbase-cxx-client/couchbase/geo_distance_query.hxx +109 -0
  110. package/deps/couchbase-cxx-client/couchbase/geo_point.hxx +32 -0
  111. package/deps/couchbase-cxx-client/couchbase/geo_polygon_query.hxx +85 -0
  112. package/deps/couchbase-cxx-client/couchbase/highlight_style.hxx +45 -0
  113. package/deps/couchbase-cxx-client/couchbase/key_value_error_context.hxx +7 -2
  114. package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +1 -1
  115. package/deps/couchbase-cxx-client/couchbase/match_all_query.hxx +43 -0
  116. package/deps/couchbase-cxx-client/couchbase/match_none_query.hxx +43 -0
  117. package/deps/couchbase-cxx-client/couchbase/match_operator.hxx +45 -0
  118. package/deps/couchbase-cxx-client/couchbase/match_phrase_query.hxx +108 -0
  119. package/deps/couchbase-cxx-client/couchbase/match_query.hxx +163 -0
  120. package/deps/couchbase-cxx-client/couchbase/numeric_range.hxx +58 -0
  121. package/deps/couchbase-cxx-client/couchbase/numeric_range_facet.hxx +56 -0
  122. package/deps/couchbase-cxx-client/couchbase/numeric_range_facet_result.hxx +55 -0
  123. package/deps/couchbase-cxx-client/couchbase/numeric_range_query.hxx +143 -0
  124. package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +93 -0
  125. package/deps/couchbase-cxx-client/couchbase/prefix_query.hxx +82 -0
  126. package/deps/couchbase-cxx-client/couchbase/query_error_context.hxx +3 -1
  127. package/deps/couchbase-cxx-client/couchbase/query_string_query.hxx +72 -0
  128. package/deps/couchbase-cxx-client/couchbase/regexp_query.hxx +82 -0
  129. package/deps/couchbase-cxx-client/couchbase/scope.hxx +39 -0
  130. package/deps/couchbase-cxx-client/couchbase/search_date_range.hxx +68 -0
  131. package/deps/couchbase-cxx-client/couchbase/search_error_context.hxx +138 -0
  132. package/deps/couchbase-cxx-client/couchbase/search_facet.hxx +60 -0
  133. package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +50 -0
  134. package/deps/couchbase-cxx-client/couchbase/search_meta_data.hxx +85 -0
  135. package/deps/couchbase-cxx-client/couchbase/search_metrics.hxx +127 -0
  136. package/deps/couchbase-cxx-client/couchbase/search_numeric_range.hxx +69 -0
  137. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +509 -0
  138. package/deps/couchbase-cxx-client/couchbase/search_query.hxx +69 -0
  139. package/deps/couchbase-cxx-client/couchbase/search_result.hxx +77 -0
  140. package/deps/couchbase-cxx-client/couchbase/search_row.hxx +104 -0
  141. package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +55 -0
  142. package/deps/couchbase-cxx-client/couchbase/search_row_locations.hxx +86 -0
  143. package/deps/couchbase-cxx-client/couchbase/search_scan_consistency.hxx +34 -0
  144. package/deps/couchbase-cxx-client/couchbase/search_sort.hxx +58 -0
  145. package/deps/couchbase-cxx-client/couchbase/search_sort_field.hxx +117 -0
  146. package/deps/couchbase-cxx-client/couchbase/search_sort_field_missing.hxx +26 -0
  147. package/deps/couchbase-cxx-client/couchbase/search_sort_field_mode.hxx +27 -0
  148. package/deps/couchbase-cxx-client/couchbase/search_sort_field_type.hxx +28 -0
  149. package/deps/couchbase-cxx-client/couchbase/search_sort_id.hxx +60 -0
  150. package/deps/couchbase-cxx-client/couchbase/search_sort_score.hxx +60 -0
  151. package/deps/couchbase-cxx-client/couchbase/search_term_range.hxx +51 -0
  152. package/deps/couchbase-cxx-client/couchbase/security_options.hxx +3 -0
  153. package/deps/couchbase-cxx-client/couchbase/subdocument_error_context.hxx +4 -2
  154. package/deps/couchbase-cxx-client/couchbase/term_facet.hxx +48 -0
  155. package/deps/couchbase-cxx-client/couchbase/term_facet_result.hxx +55 -0
  156. package/deps/couchbase-cxx-client/couchbase/term_query.hxx +151 -0
  157. package/deps/couchbase-cxx-client/couchbase/term_range_query.hxx +142 -0
  158. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +1 -1
  159. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +2 -1
  160. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_result.hxx +1 -1
  161. package/deps/couchbase-cxx-client/couchbase/transactions.hxx +3 -3
  162. package/deps/couchbase-cxx-client/couchbase/wildcard_query.hxx +83 -0
  163. package/deps/couchbase-cxx-client/docs/Doxyfile.in +1 -1
  164. package/deps/couchbase-cxx-client/docs/cbc-analytics.md +2 -2
  165. package/deps/couchbase-cxx-client/docs/cbc-get.md +3 -2
  166. package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +7 -2
  167. package/deps/couchbase-cxx-client/docs/cbc-query.md +2 -2
  168. package/deps/couchbase-cxx-client/docs/cbc.md +3 -3
  169. package/deps/couchbase-cxx-client/docs/cli.hxx +5 -5
  170. package/deps/couchbase-cxx-client/docs/mainpage.hxx +42 -5
  171. package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
  172. package/deps/couchbase-cxx-client/test/test_integration_analytics.cxx +28 -6
  173. package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +7 -3
  174. package/deps/couchbase-cxx-client/test/test_integration_connect.cxx +7 -3
  175. package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +13 -3
  176. package/deps/couchbase-cxx-client/test/test_integration_diagnostics.cxx +8 -2
  177. package/deps/couchbase-cxx-client/test/test_integration_durability.cxx +12 -7
  178. package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +283 -11
  179. package/deps/couchbase-cxx-client/test/test_integration_management.cxx +140 -88
  180. package/deps/couchbase-cxx-client/test/test_integration_query.cxx +67 -9
  181. package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +12 -12
  182. package/deps/couchbase-cxx-client/test/test_integration_read_replica.cxx +48 -11
  183. package/deps/couchbase-cxx-client/test/test_integration_search.cxx +19 -1
  184. package/deps/couchbase-cxx-client/test/test_integration_subdoc.cxx +60 -9
  185. package/deps/couchbase-cxx-client/test/test_integration_tracer.cxx +3 -0
  186. package/deps/couchbase-cxx-client/test/test_integration_transcoders.cxx +4 -0
  187. package/deps/couchbase-cxx-client/test/test_transaction_examples.cxx +100 -85
  188. package/deps/couchbase-cxx-client/test/test_unit_connection_string.cxx +29 -0
  189. package/deps/couchbase-cxx-client/test/test_unit_search.cxx +427 -0
  190. package/deps/couchbase-cxx-client/test/utils/integration_test_guard.cxx +2 -1
  191. package/deps/couchbase-cxx-client/test/utils/logger.cxx +3 -1
  192. package/deps/couchbase-cxx-client/test/utils/server_version.hxx +31 -15
  193. package/deps/couchbase-cxx-client/test/utils/test_context.cxx +8 -0
  194. package/deps/couchbase-cxx-client/tools/get.cxx +9 -8
  195. package/deps/couchbase-cxx-client/tools/pillowfight.cxx +175 -75
  196. package/deps/couchbase-cxx-client/tools/version.cxx +4 -2
  197. package/dist/binding.d.ts +1 -1
  198. package/package.json +1 -1
  199. package/src/jstocbpp_autogen.hpp +3 -2
@@ -80,6 +80,7 @@ add_subdirectory(core/tracing)
80
80
  add_subdirectory(core/metrics)
81
81
 
82
82
  set(couchbase_cxx_client_FILES
83
+ ${CMAKE_CURRENT_BINARY_DIR}/generated/mozilla_ca_bundle.cxx
83
84
  core/agent.cxx
84
85
  core/agent_config.cxx
85
86
  core/agent_group.cxx
@@ -256,41 +257,75 @@ set(couchbase_cxx_client_FILES
256
257
  core/utils/split_string.cxx
257
258
  core/utils/url_codec.cxx
258
259
  core/impl/analytics.cxx
260
+ core/impl/search.cxx
259
261
  core/impl/analytics_error_category.cxx
260
262
  core/impl/append.cxx
261
263
  core/impl/best_effort_retry_strategy.cxx
264
+ core/impl/boolean_field_query.cxx
265
+ core/impl/boolean_query.cxx
262
266
  core/impl/build_deferred_query_indexes.cxx
263
- core/impl/collection_query_index_manager.cxx
264
267
  core/impl/cluster.cxx
268
+ core/impl/collection_query_index_manager.cxx
265
269
  core/impl/common_error_category.cxx
266
270
  core/impl/configuration_profiles_registry.cxx
271
+ core/impl/conjunction_query.cxx
267
272
  core/impl/create_query_index.cxx
273
+ core/impl/date_range.cxx
274
+ core/impl/date_range_facet.cxx
275
+ core/impl/date_range_facet_result.cxx
276
+ core/impl/date_range_query.cxx
268
277
  core/impl/decrement.cxx
278
+ core/impl/disjunction_query.cxx
269
279
  core/impl/dns_srv_tracker.cxx
270
280
  core/impl/drop_query_index.cxx
271
281
  core/impl/exists.cxx
272
282
  core/impl/expiry.cxx
273
283
  core/impl/fail_fast_retry_strategy.cxx
274
284
  core/impl/field_level_encryption_error_category.cxx
285
+ core/impl/geo_bounding_box_query.cxx
286
+ core/impl/geo_distance_query.cxx
287
+ core/impl/geo_polygon_query.cxx
275
288
  core/impl/get.cxx
289
+ core/impl/get_all_query_indexes.cxx
276
290
  core/impl/get_all_replicas.cxx
277
291
  core/impl/get_and_lock.cxx
278
292
  core/impl/get_and_touch.cxx
279
- core/impl/get_all_query_indexes.cxx
280
293
  core/impl/get_any_replica.cxx
281
294
  core/impl/get_replica.cxx
282
295
  core/impl/increment.cxx
283
296
  core/impl/insert.cxx
297
+ core/impl/internal_date_range_facet_result.cxx
298
+ core/impl/internal_numeric_range_facet_result.cxx
299
+ core/impl/internal_search_error_context.cxx
300
+ core/impl/internal_search_meta_data.cxx
301
+ core/impl/internal_search_result.cxx
302
+ core/impl/internal_search_row.cxx
303
+ core/impl/internal_search_row_locations.cxx
304
+ core/impl/internal_term_facet_result.cxx
284
305
  core/impl/key_value_error_category.cxx
306
+ core/impl/key_value_error_context.cxx
285
307
  core/impl/lookup_in.cxx
286
308
  core/impl/management_error_category.cxx
309
+ core/impl/match_all_query.cxx
310
+ core/impl/match_none_query.cxx
311
+ core/impl/match_phrase_query.cxx
312
+ core/impl/match_query.cxx
287
313
  core/impl/mutate_in.cxx
288
314
  core/impl/network_error_category.cxx
315
+ core/impl/numeric_range.cxx
316
+ core/impl/numeric_range_facet.cxx
317
+ core/impl/numeric_range_facet_result.cxx
318
+ core/impl/numeric_range_query.cxx
289
319
  core/impl/observe_poll.cxx
290
320
  core/impl/observe_seqno.cxx
321
+ core/impl/phrase_query.cxx
322
+ core/impl/prefix_query.cxx
291
323
  core/impl/prepend.cxx
292
324
  core/impl/query.cxx
293
325
  core/impl/query_error_category.cxx
326
+ core/impl/query_error_context.cxx
327
+ core/impl/query_string_query.cxx
328
+ core/impl/regexp_query.cxx
294
329
  core/impl/remove.cxx
295
330
  core/impl/replace.cxx
296
331
  core/impl/retry_action.cxx
@@ -314,6 +349,20 @@ set(couchbase_cxx_client_FILES
314
349
  core/impl/subdoc/remove.cxx
315
350
  core/impl/subdoc/replace.cxx
316
351
  core/impl/subdoc/upsert.cxx
352
+ core/impl/search.cxx
353
+ core/impl/search_error_context.cxx
354
+ core/impl/search_meta_data.cxx
355
+ core/impl/search_result.cxx
356
+ core/impl/search_row.cxx
357
+ core/impl/search_row_location.cxx
358
+ core/impl/search_row_locations.cxx
359
+ core/impl/search_sort_field.cxx
360
+ core/impl/search_sort_id.cxx
361
+ core/impl/search_sort_score.cxx
362
+ core/impl/term_facet.cxx
363
+ core/impl/term_facet_result.cxx
364
+ core/impl/term_query.cxx
365
+ core/impl/term_range_query.cxx
317
366
  core/impl/touch.cxx
318
367
  core/impl/transaction_error_category.cxx
319
368
  core/impl/transaction_get_result.cxx
@@ -322,6 +371,7 @@ set(couchbase_cxx_client_FILES
322
371
  core/impl/upsert.cxx
323
372
  core/impl/view_error_category.cxx
324
373
  core/impl/watch_query_indexes.cxx
374
+ core/impl/wildcard_query.cxx
325
375
  core/io/dns_client.cxx
326
376
  core/io/dns_config.cxx
327
377
  core/io/http_parser.cxx
@@ -405,9 +455,9 @@ endif ()
405
455
  if (NOT COUCHBASE_CXX_CLIENT_POST_LINKED_OPENSSL)
406
456
  if (TARGET PkgConfig::PKG_CONFIG_OPENSSL)
407
457
  target_link_libraries(couchbase_cxx_client PUBLIC PkgConfig::PKG_CONFIG_OPENSSL)
408
- else()
458
+ else ()
409
459
  target_link_libraries(couchbase_cxx_client PUBLIC OpenSSL::SSL OpenSSL::Crypto)
410
- endif()
460
+ endif ()
411
461
  endif ()
412
462
 
413
463
  option(COUCHBASE_CXX_CLIENT_BUILD_TESTS "Build test programs" TRUE)
@@ -7,6 +7,7 @@
7
7
 
8
8
  This repo is under active development and is not yet ready for release as a public SDK.
9
9
 
10
+ Release notes and API reference: https://github.com/couchbaselabs/couchbase-cxx-client/releases.
10
11
 
11
12
  ## Getting the Source Code
12
13
 
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Copyright 2020-2021 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
+ require "timeout"
18
+ require "net/http"
19
+ require "json"
20
+ require "openssl"
21
+
22
+ class API
23
+ def initialize(options)
24
+ @options = options
25
+ connect
26
+ end
27
+
28
+ def connect
29
+ puts "# CONNECT #{@options}"
30
+ @client = Net::HTTP.start(@options[:host], @options[:port],
31
+ use_ssl: @options[:strict_encryption],
32
+ verify_mode: OpenSSL::SSL::VERIFY_NONE)
33
+ end
34
+
35
+ def url(path)
36
+ "#{@client.use_ssl? ? 'https' : 'http'}://#{@options[:username]}@#{@options[:host]}:#{@options[:port]}#{path}"
37
+ end
38
+
39
+ def decode_response(response)
40
+ payload =
41
+ if response['content-type'] =~ /application\/json/
42
+ JSON.parse(response.body)
43
+ else
44
+ response.body
45
+ end
46
+ p payload if @options[:verbose]
47
+ payload
48
+ end
49
+
50
+ def setup_request(request)
51
+ request.basic_auth(@options[:username], @options[:password])
52
+ request['accept'] = "application/json"
53
+ end
54
+
55
+ def get(path)
56
+ puts "# GET #{url(path)}"
57
+ req = Net::HTTP::Get.new(path)
58
+ setup_request(req)
59
+ res = @client.request(req)
60
+ decode_response(res)
61
+ rescue EOFError
62
+ connect
63
+ retry
64
+ rescue => ex
65
+ puts "#{__method__}: #{ex}, sleep for 1 second and retry"
66
+ sleep(1)
67
+ retry
68
+ end
69
+
70
+ def post_form(path, fields = {})
71
+ puts "# POST #{url(path)} #{fields}"
72
+ req = Net::HTTP::Post.new(path)
73
+ setup_request(req)
74
+ req.form_data = fields
75
+ res = @client.request(req)
76
+ decode_response(res)
77
+ rescue EOFError
78
+ connect
79
+ retry
80
+ rescue => ex
81
+ puts "#{__method__}: #{ex}, sleep for 1 second and retry"
82
+ sleep(1)
83
+ retry
84
+ end
85
+
86
+ def post_json(path, object)
87
+ data = JSON.generate(object)
88
+ puts "# POST #{url(path)} #{data}"
89
+ req = Net::HTTP::Post.new(path)
90
+ req['content-type'] = "application/json"
91
+ setup_request(req)
92
+ res = @client.request(req, data)
93
+ decode_response(res)
94
+ rescue EOFError
95
+ connect
96
+ retry
97
+ rescue => ex
98
+ puts "#{__method__}: #{ex}, sleep for 1 second and retry"
99
+ sleep(1)
100
+ retry
101
+ end
102
+
103
+ def put_json(path, object)
104
+ data = JSON.generate(object)
105
+ puts "# PUT #{url(path)} #{data}"
106
+ req = Net::HTTP::Put.new(path)
107
+ req['content-type'] = "application/json"
108
+ setup_request(req)
109
+ res = @client.request(req, data)
110
+ decode_response(res)
111
+ rescue EOFError
112
+ connect
113
+ retry
114
+ rescue => ex
115
+ puts "#{__method__}: #{ex}, sleep for 1 second and retry"
116
+ sleep(1)
117
+ retry
118
+ end
119
+ end
120
+
121
+ def service_port_for_bucket(api, service, bucket, options)
122
+ port_key = options[:strict_encryption] ? "#{service}SSL" : service
123
+ port = 0
124
+ while port.zero?
125
+ config = api.get("/pools/default/b/#{bucket}")
126
+ port = config["nodesExt"].find{|n| n["services"].key?(port_key)}["services"][port_key].to_i rescue 0
127
+ sleep 1
128
+ end
129
+ port
130
+ end
131
+
132
+ options = {
133
+ host: ARGV[0] || "127.0.0.1",
134
+ strict_encryption: ARGV[1] == "true" || ARGV[1] == "1",
135
+ username: ARGV[2] || "Administrator",
136
+ password: ARGV[3] || "password",
137
+ bucket: "travel-sample",
138
+ verbose: true,
139
+ }
140
+ p options: options
141
+
142
+ management_api = API.new(options.merge(port: options[:strict_encryption] ? 18091 : 8091))
143
+ search_service_port = service_port_for_bucket(management_api, "fts", options[:bucket], options)
144
+
145
+ has_v6_nodes =
146
+ management_api.get("/pools/default")["nodes"]
147
+ .any? { |node| node["version"] =~ /^6\./ && node["services"].include?("fts") }
148
+
149
+ search_api = API.new(options.merge(port: search_service_port))
150
+ index_definition_path = File.join(__dir__, "travel-sample-index#{"-v6" if has_v6_nodes}.json")
151
+ puts "using index definition: #{File.basename(index_definition_path)}"
152
+ index_definition = JSON.load(File.read(index_definition_path))
153
+ search_api.put_json("/api/index/travel-sample-index", index_definition)
154
+
155
+ expected_number_of_the_documents = 1000
156
+ indexed_documents = 0
157
+
158
+ Timeout.timeout(10 * 60) do # give it 10 minutes to index
159
+ while indexed_documents < expected_number_of_the_documents
160
+ resp = search_api.get("/api/index/travel-sample-index/count")
161
+ indexed_documents = resp['count'].to_i
162
+ sleep 1
163
+ end
164
+ end
@@ -15,7 +15,9 @@
15
15
  # limitations under the License.
16
16
 
17
17
  require "set"
18
+ require "timeout"
18
19
  require "optparse"
20
+ require "openssl"
19
21
 
20
22
  class Object
21
23
  def to_b
@@ -117,6 +119,24 @@ class API
117
119
  data = JSON.generate(object)
118
120
  puts "# POST #{url(path)} #{data}"
119
121
  req = Net::HTTP::Post.new(path)
122
+ req['content-type'] = "application/json"
123
+ setup_request(req)
124
+ res = @client.request(req, data)
125
+ decode_response(res)
126
+ rescue EOFError
127
+ connect
128
+ retry
129
+ rescue => ex
130
+ puts "#{__method__}: #{ex}, sleep for 1 second and retry"
131
+ sleep(1)
132
+ retry
133
+ end
134
+
135
+ def put_json(path, object)
136
+ data = JSON.generate(object)
137
+ puts "# PUT #{url(path)} #{data}"
138
+ req = Net::HTTP::Put.new(path)
139
+ req['content-type'] = "application/json"
120
140
  setup_request(req)
121
141
  res = @client.request(req, data)
122
142
  decode_response(res)
@@ -219,21 +239,46 @@ api.post_json("/sampleBuckets/install", options[:sample_buckets].to_a) if option
219
239
 
220
240
  api.post_form("/settings/developerPreview", enabled: true) if options[:enable_developer_preview]
221
241
 
222
- def query_port_for_bucket(api, name, options)
223
- query_port_key = options[:strict_encryption] ? "n1qlSSL" : "n1ql"
224
- query_port = 0
225
- while query_port.zero?
226
- config = api.get("/pools/default/b/#{name}")
227
- query_port = config["nodesExt"][0]["services"][query_port_key].to_i
242
+ def service_port_for_bucket(api, service, bucket, options)
243
+ port_key = options[:strict_encryption] ? "#{service}SSL" : service
244
+ port = 0
245
+ while port.zero?
246
+ config = api.get("/pools/default/b/#{bucket}")
247
+ port = config["nodesExt"].find{|n| n["services"].key?(port_key)}["services"][port_key].to_i rescue 0
228
248
  sleep 1
229
249
  end
230
- query_port
250
+ port
231
251
  end
232
252
 
233
-
234
- query_api = API.new(options.merge(port: query_port_for_bucket(api, options[:bucket], options)))
253
+ query_api = API.new(options.merge(port: service_port_for_bucket(api, "n1ql", options[:bucket], options)))
235
254
  query_api.post_form("/query/service", statement: "CREATE PRIMARY INDEX ON `#{options[:bucket]}` USING GSI")
236
255
  options[:sample_buckets].each do |bucket|
237
- query_port_for_bucket(api, bucket, options)
256
+ service_port_for_bucket(api, "n1ql", bucket, options)
238
257
  query_api.post_form("/query/service", statement: "CREATE PRIMARY INDEX ON `#{bucket}` USING GSI")
239
258
  end
259
+
260
+ puts service_port_for_bucket(api, "fts", options[:bucket], options)
261
+
262
+ if options[:sample_buckets].include?("travel-sample") && services.include?("fts")
263
+ search_api = API.new(options.merge(port: service_port_for_bucket(api, "fts", options[:bucket], options)))
264
+
265
+ has_v6_nodes =
266
+ api.get("/pools/default")["nodes"]
267
+ .any? { |node| node["version"] =~ /^6\./ && node["services"].include?("fts") }
268
+
269
+ index_definition_path = File.join(__dir__, "travel-sample-index#{"-v6" if has_v6_nodes}.json")
270
+ puts "using index definition: #{File.basename(index_definition_path)}"
271
+ index_definition = JSON.load(File.read(index_definition_path))
272
+ search_api.put_json("/api/index/travel-sample-index", index_definition)
273
+
274
+ expected_number_of_the_documents = 1000
275
+ indexed_documents = 0
276
+ Timeout.timeout(10 * 60) do # give it 10 minutes to index
277
+ while indexed_documents < expected_number_of_the_documents
278
+ resp = search_api.get("/api/index/travel-sample-index/count")
279
+ indexed_documents = resp['count'].to_i
280
+ sleep 1
281
+ end
282
+ end
283
+ end
284
+
@@ -37,7 +37,55 @@ fi
37
37
 
38
38
  cd "${BUILD_DIR}"
39
39
 
40
- cat /proc/sys/kernel/core_pattern
40
+ CB_USE_GOCAVES=${CB_USE_GOCAVES:-""}
41
+ GOCAVES_PID=
42
+ GOCAVES_CONNECTION_STRING=
43
+ if [ "$CB_USE_GOCAVES" = "yes" -o "$CB_USE_GOCAVES" = "1" ]
44
+ then
45
+ GOCAVES=
46
+ case "$(uname -sm)" in
47
+ "Darwin x86_64")
48
+ GOCAVES="gocaves-macos"
49
+ ;;
50
+
51
+ "Darwin arm64")
52
+ GOCAVES="gocaves-macos-arm64"
53
+ ;;
54
+
55
+ "Linux x86_64")
56
+ GOCAVES="gocaves-linux-amd64"
57
+ ;;
58
+
59
+ "Linux aarch64")
60
+ GOCAVES="gocaves-linux-arm64"
61
+ ;;
62
+ esac
63
+ echo "GOCAVES=${GOCAVES}"
64
+ if [ "${GOCAVES}x" != "x" ]
65
+ then
66
+ GOCAVES_VERSION="v0.0.1-78"
67
+ echo "GOCAVES_VERSION=${GOCAVES_VERSION}"
68
+ GOCAVES_PATH="${BUILD_DIR}/${GOCAVES}-${GOCAVES_VERSION}"
69
+ if [ ! -e "${GOCAVES_PATH}" ]
70
+ then
71
+ curl -L -o "${GOCAVES_PATH}" https://github.com/couchbaselabs/gocaves/releases/download/${GOCAVES_VERSION}/${GOCAVES}
72
+ chmod u+x "${GOCAVES_PATH}"
73
+ fi
74
+ ${GOCAVES_PATH} -mock-only > gocaves.txt 2>&1 &
75
+ sleep 1
76
+ GOCAVES_PID=$!
77
+ GOCAVES_CONNECTION_STRING=$(grep -o 'couchbase://[^"]\+' gocaves.txt)
78
+ echo "GOCAVES_CONNECTION_STRING=${GOCAVES_CONNECTION_STRING}"
79
+ if [ ! -z "${GOCAVES_CONNECTION_STRING}" ]
80
+ then
81
+ export TEST_CONNECTION_STRING="${GOCAVES_CONNECTION_STRING}"
82
+ export TEST_USE_GOCAVES=1
83
+ trap "kill -9 ${GOCAVES_PID}" SIGINT SIGTERM
84
+ fi
85
+ fi
86
+ fi
87
+
88
+ [ -f /proc/sys/kernel/core_pattern ] && cat /proc/sys/kernel/core_pattern
41
89
  if [ -e /usr/bin/apport-unpack ]
42
90
  then
43
91
  mkdir -p $HOME/.config/apport
@@ -52,6 +100,11 @@ ulimit -c unlimited
52
100
  ${CB_CTEST} --output-on-failure --label-regex 'integration|unit' --output-junit results.xml
53
101
  STATUS=$?
54
102
 
103
+ if [ ! -z "${GOCAVES_PID}" ]
104
+ then
105
+ kill -9 ${GOCAVES_PID}
106
+ fi
107
+
55
108
  if [ "x${STATUS}" != "x0" ]
56
109
  then
57
110
  if [ -e /usr/bin/coredumpctl ]
@@ -74,11 +127,14 @@ then
74
127
  fi
75
128
  for core in /tmp/core.* "${PWD}/core*"
76
129
  do
77
- echo $core
78
- executable=$(file $core | ruby -e "print ARGF.read[/execfn: '([^']+)'/, 1]")
79
- echo $executable
80
- gdb $executable $core --batch -ex "thread apply all bt"
81
- rm -f $core
130
+ if [ -f $core ]
131
+ then
132
+ echo $core
133
+ executable=$(file $core | ruby -e "print ARGF.read[/execfn: '([^']+)'/, 1]")
134
+ echo $executable
135
+ gdb $executable $core --batch -ex "thread apply all bt"
136
+ rm -f $core
137
+ fi
82
138
  done
83
139
  fi
84
140
 
@@ -0,0 +1,184 @@
1
+ {
2
+ "name": "travel-sample-index",
3
+ "type": "fulltext-index",
4
+ "params": {
5
+ "doc_config": {
6
+ "docid_prefix_delim": "",
7
+ "docid_regexp": "",
8
+ "mode": "type_field",
9
+ "type_field": "type"
10
+ },
11
+ "mapping": {
12
+ "default_analyzer": "standard",
13
+ "default_datetime_parser": "dateTimeOptional",
14
+ "default_field": "_all",
15
+ "default_mapping": {
16
+ "dynamic": true,
17
+ "enabled": true
18
+ },
19
+ "default_type": "_default",
20
+ "docvalues_dynamic": true,
21
+ "index_dynamic": true,
22
+ "store_dynamic": false,
23
+ "type_field": "_type",
24
+ "types": {
25
+ "airline": {
26
+ "dynamic": true,
27
+ "enabled": true,
28
+ "properties": {
29
+ "country": {
30
+ "enabled": true,
31
+ "dynamic": false,
32
+ "fields": [
33
+ {
34
+ "docvalues": true,
35
+ "include_in_all": true,
36
+ "include_term_vectors": true,
37
+ "index": true,
38
+ "name": "country",
39
+ "store": true,
40
+ "type": "text"
41
+ }
42
+ ]
43
+ },
44
+ "name": {
45
+ "enabled": true,
46
+ "dynamic": false,
47
+ "fields": [
48
+ {
49
+ "docvalues": true,
50
+ "include_in_all": true,
51
+ "include_term_vectors": true,
52
+ "index": true,
53
+ "name": "name",
54
+ "store": true,
55
+ "type": "text"
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ },
61
+ "hotel": {
62
+ "dynamic": true,
63
+ "enabled": true,
64
+ "properties": {
65
+ "reviews": {
66
+ "dynamic": true,
67
+ "enabled": true,
68
+ "properties": {
69
+ "ratings": {
70
+ "dynamic": true,
71
+ "enabled": true,
72
+ "properties": {
73
+ "Overall": {
74
+ "enabled": true,
75
+ "dynamic": false,
76
+ "fields": [
77
+ {
78
+ "docvalues": true,
79
+ "include_in_all": true,
80
+ "include_term_vectors":
81
+ true,
82
+ "index": true,
83
+ "name": "Overall",
84
+ "store": true,
85
+ "type": "number"
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ },
91
+ "content": {
92
+ "enabled": true,
93
+ "dynamic": false,
94
+ "fields": [
95
+ {
96
+ "docvalues": true,
97
+ "include_in_all": true,
98
+ "include_term_vectors": true,
99
+ "index": true,
100
+ "name": "content",
101
+ "store": true,
102
+ "type": "text"
103
+ }
104
+ ]
105
+ }
106
+ }
107
+ },
108
+ "city": {
109
+ "enabled": true,
110
+ "dynamic": false,
111
+ "fields": [
112
+ {
113
+ "docvalues": true,
114
+ "include_in_all": true,
115
+ "include_term_vectors": true,
116
+ "index": true,
117
+ "name": "city",
118
+ "store": true,
119
+ "type": "text"
120
+ }
121
+ ]
122
+ },
123
+ "country": {
124
+ "enabled": true,
125
+ "dynamic": false,
126
+ "fields": [
127
+ {
128
+ "docvalues": true,
129
+ "include_in_all": true,
130
+ "include_term_vectors": true,
131
+ "index": true,
132
+ "name": "country",
133
+ "store": true,
134
+ "type": "text"
135
+ }
136
+ ]
137
+ },
138
+ "description": {
139
+ "enabled": true,
140
+ "dynamic": false,
141
+ "fields": [
142
+ {
143
+ "docvalues": true,
144
+ "include_in_all": true,
145
+ "include_term_vectors": true,
146
+ "index": true,
147
+ "name": "description",
148
+ "store": true,
149
+ "type": "text"
150
+ }
151
+ ]
152
+ },
153
+ "title": {
154
+ "enabled": true,
155
+ "dynamic": false,
156
+ "fields": [
157
+ {
158
+ "docvalues": true,
159
+ "include_in_all": true,
160
+ "include_term_vectors": true,
161
+ "index": true,
162
+ "name": "title",
163
+ "store": true,
164
+ "type": "text"
165
+ }
166
+ ]
167
+ }
168
+ }
169
+ }
170
+ }
171
+ },
172
+ "store": {
173
+ "indexType": "scorch"
174
+ }
175
+ },
176
+ "sourceType": "couchbase",
177
+ "sourceName": "travel-sample",
178
+ "sourceParams": {},
179
+ "planParams": {
180
+ "maxPartitionsPerPIndex": 171,
181
+ "indexPartitions": 6,
182
+ "numReplicas": 0
183
+ }
184
+ }