couchbase 4.4.2 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +13 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
  13. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
  14. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  15. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
  16. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  17. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  21. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  22. package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
  23. package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
  24. package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
  25. package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
  26. package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
  27. package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
  28. package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
  29. package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
  30. package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
  31. package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
  32. package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
  33. package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
  34. package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
  36. package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
  37. package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
  38. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  39. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
  40. package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
  41. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
  42. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
  43. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
  44. package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
  45. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
  46. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  47. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
  50. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
  51. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  52. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  53. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
  54. package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
  55. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  56. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
  57. package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
  58. package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
  59. package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
  60. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
  61. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
  62. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
  63. package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
  64. package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
  65. package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
  66. package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
  67. package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
  68. package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
  69. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  70. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  71. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
  72. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
  73. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  74. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  75. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  79. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  83. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  85. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  91. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  92. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  93. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  94. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  95. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  96. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  97. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  98. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  99. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  114. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  115. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
  118. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
  120. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
  122. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
  124. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
  127. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  129. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
  132. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
  134. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  135. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
  136. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  137. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  138. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  139. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  140. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  141. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  142. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  143. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  144. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  145. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  146. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  147. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  148. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  149. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  150. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  151. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
  152. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  153. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  154. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  155. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  156. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  157. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  158. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  159. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  160. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
  161. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  162. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
  163. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  164. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
  165. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  166. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  167. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
  168. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  169. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
  170. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  171. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
  172. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  173. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
  174. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  175. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
  176. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  177. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
  178. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  179. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
  180. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  181. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
  182. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  183. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  184. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
  185. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  186. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  187. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  188. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  189. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  190. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  191. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
  192. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  193. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
  194. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  195. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
  196. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  197. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
  198. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  199. package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
  200. package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
  201. package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
  202. package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
  203. package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
  204. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
  205. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
  206. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
  207. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
  208. package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
  209. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
  210. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
  211. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  212. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  213. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
  214. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
  215. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
  216. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  217. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  218. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
  219. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
  220. package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
  221. package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
  222. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  223. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  224. package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
  225. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
  226. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
  227. package/dist/analyticsindexmanager.d.ts +98 -14
  228. package/dist/analyticsindexmanager.js +452 -411
  229. package/dist/binding.d.ts +53 -4
  230. package/dist/bindingutilities.d.ts +26 -1
  231. package/dist/bindingutilities.js +108 -1
  232. package/dist/couchbase.d.ts +3 -1
  233. package/dist/couchbase.js +2 -0
  234. package/dist/rangeScan.d.ts +1 -1
  235. package/dist/rangeScan.js +1 -1
  236. package/dist/transactions.d.ts +34 -3
  237. package/dist/transactions.js +25 -18
  238. package/dist/transcoders.d.ts +68 -0
  239. package/dist/transcoders.js +194 -1
  240. package/dist/usermanager.d.ts +14 -14
  241. package/dist/usermanager.js +178 -228
  242. package/dist/utilities.js +4 -6
  243. package/dist/utilities_internal.js +1 -2
  244. package/package.json +9 -8
  245. package/src/binding.cpp +13 -13
  246. package/src/connection.cpp +22 -0
  247. package/src/connection.hpp +12 -0
  248. package/src/connection_autogen.cpp +100 -0
  249. package/src/jstocbpp_autogen.hpp +315 -8
  250. package/src/jstocbpp_transactions.hpp +1 -2
  251. package/tools/gen-bindings-js.js +38 -3
  252. package/tools/gen-bindings-json.py +575 -328
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultTranscoder = void 0;
3
+ exports.RawJsonTranscoder = exports.RawStringTranscoder = exports.RawBinaryTranscoder = exports.DefaultTranscoder = void 0;
4
4
  const NF_JSON = 0x00;
5
5
  const NF_RAW = 0x02;
6
6
  const NF_UTF8 = 0x04;
@@ -86,3 +86,196 @@ class DefaultTranscoder {
86
86
  }
87
87
  }
88
88
  exports.DefaultTranscoder = DefaultTranscoder;
89
+ /**
90
+ * The raw binary transcoder provides an explicit mechanism for storing and retrieving raw
91
+ * byte data.
92
+ *
93
+ * @category Key-Value
94
+ */
95
+ class RawBinaryTranscoder {
96
+ /**
97
+ * Encodes the specified value, returning a buffer and flags that are
98
+ * stored to the server and later used for decoding.
99
+ *
100
+ * @param value The value to encode.
101
+ */
102
+ encode(value) {
103
+ // If its a buffer, write that directly as raw.
104
+ if (Buffer.isBuffer(value)) {
105
+ return [value, CF_RAW | NF_RAW];
106
+ }
107
+ throw new Error('Only binary data supported by RawBinaryTranscoder.');
108
+ }
109
+ /**
110
+ * Decodes a buffer and flags tuple back to the original type of the
111
+ * document.
112
+ *
113
+ * @param bytes The bytes that were previously encoded.
114
+ * @param flags The flags associated with the data.
115
+ */
116
+ decode(bytes, flags) {
117
+ let format = flags & NF_MASK;
118
+ const cfformat = flags & CF_MASK;
119
+ if (cfformat !== CF_NONE) {
120
+ if (cfformat === CF_JSON) {
121
+ format = NF_JSON;
122
+ }
123
+ else if (cfformat === CF_RAW) {
124
+ format = NF_RAW;
125
+ }
126
+ else if (cfformat === CF_UTF8) {
127
+ format = NF_UTF8;
128
+ }
129
+ else if (cfformat !== CF_PRIVATE) {
130
+ // Unknown CF Format! The following will force
131
+ // fallback to reporting RAW data.
132
+ format = NF_UNKNOWN;
133
+ }
134
+ }
135
+ if (format === NF_RAW) {
136
+ return bytes;
137
+ }
138
+ else if (format === NF_UTF8) {
139
+ throw new Error('String format not supported by RawBinaryTranscoder.');
140
+ }
141
+ else if (format === NF_JSON) {
142
+ throw new Error('JSON format not supported by RawBinaryTranscoder.');
143
+ }
144
+ else if (format === NF_UNKNOWN) {
145
+ throw new Error('Unknown format not supported by RawBinaryTranscoder.');
146
+ }
147
+ else {
148
+ throw new Error(`Unrecognized format provided: ${format}.`);
149
+ }
150
+ }
151
+ }
152
+ exports.RawBinaryTranscoder = RawBinaryTranscoder;
153
+ /**
154
+ * The raw string transcoder provides an explicit mechanism for storing and retrieving raw
155
+ * string data.
156
+ *
157
+ * @category Key-Value
158
+ */
159
+ class RawStringTranscoder {
160
+ /**
161
+ * Encodes the specified value, returning a buffer and flags that are
162
+ * stored to the server and later used for decoding.
163
+ *
164
+ * @param value The value to encode.
165
+ */
166
+ encode(value) {
167
+ // If its a string, encode it as a UTF8 string.
168
+ if (typeof value === 'string') {
169
+ return [Buffer.from(value), CF_UTF8 | NF_UTF8];
170
+ }
171
+ throw new Error('Only string data supported by RawStringTranscoder.');
172
+ }
173
+ /**
174
+ * Decodes a buffer and flags tuple back to the original type of the
175
+ * document.
176
+ *
177
+ * @param bytes The bytes that were previously encoded.
178
+ * @param flags The flags associated with the data.
179
+ */
180
+ decode(bytes, flags) {
181
+ let format = flags & NF_MASK;
182
+ const cfformat = flags & CF_MASK;
183
+ if (cfformat !== CF_NONE) {
184
+ if (cfformat === CF_JSON) {
185
+ format = NF_JSON;
186
+ }
187
+ else if (cfformat === CF_RAW) {
188
+ format = NF_RAW;
189
+ }
190
+ else if (cfformat === CF_UTF8) {
191
+ format = NF_UTF8;
192
+ }
193
+ else if (cfformat !== CF_PRIVATE) {
194
+ // Unknown CF Format! The following will force
195
+ // fallback to reporting RAW data.
196
+ format = NF_UNKNOWN;
197
+ }
198
+ }
199
+ if (format === NF_UTF8) {
200
+ return bytes.toString('utf8');
201
+ }
202
+ else if (format === NF_RAW) {
203
+ throw new Error('Binary format not supported by RawStringTranscoder.');
204
+ }
205
+ else if (format === NF_JSON) {
206
+ throw new Error('JSON format not supported by RawStringTranscoder.');
207
+ }
208
+ else if (format === NF_UNKNOWN) {
209
+ throw new Error('Unknown format not supported by RawStringTranscoder.');
210
+ }
211
+ else {
212
+ throw new Error(`Unrecognized format provided: ${format}.`);
213
+ }
214
+ }
215
+ }
216
+ exports.RawStringTranscoder = RawStringTranscoder;
217
+ /**
218
+ * The raw JSON transcoder provides an explicit mechanism for storing and retrieving JSON data.
219
+ *
220
+ * @category Key-Value
221
+ */
222
+ class RawJsonTranscoder {
223
+ /**
224
+ * Encodes the specified value, returning a buffer and flags that are
225
+ * stored to the server and later used for decoding.
226
+ *
227
+ * @param value The value to encode.
228
+ */
229
+ encode(value) {
230
+ if (typeof value === 'string') {
231
+ return [Buffer.from(value), CF_JSON | NF_JSON];
232
+ }
233
+ if (Buffer.isBuffer(value)) {
234
+ return [value, CF_JSON | NF_JSON];
235
+ }
236
+ throw new Error('Only binary and string data supported by RawJsonTranscoder.');
237
+ }
238
+ /**
239
+ * Decodes a buffer and flags tuple back to the original type of the
240
+ * document.
241
+ *
242
+ * @param bytes The bytes that were previously encoded.
243
+ * @param flags The flags associated with the data.
244
+ */
245
+ decode(bytes, flags) {
246
+ let format = flags & NF_MASK;
247
+ const cfformat = flags & CF_MASK;
248
+ if (cfformat !== CF_NONE) {
249
+ if (cfformat === CF_JSON) {
250
+ format = NF_JSON;
251
+ }
252
+ else if (cfformat === CF_RAW) {
253
+ format = NF_RAW;
254
+ }
255
+ else if (cfformat === CF_UTF8) {
256
+ format = NF_UTF8;
257
+ }
258
+ else if (cfformat !== CF_PRIVATE) {
259
+ // Unknown CF Format! The following will force
260
+ // fallback to reporting RAW data.
261
+ format = NF_UNKNOWN;
262
+ }
263
+ }
264
+ if (format === NF_UTF8) {
265
+ throw new Error('string format not supported by RawJsonTranscoder.');
266
+ }
267
+ else if (format === NF_RAW) {
268
+ throw new Error('Binary format not supported by RawJsonTranscoder.');
269
+ }
270
+ else if (format === NF_JSON) {
271
+ return bytes;
272
+ }
273
+ else if (format === NF_UNKNOWN) {
274
+ throw new Error('Unknown format not supported by RawJsonTranscoder.');
275
+ }
276
+ else {
277
+ throw new Error(`Unrecognized format provided: ${format}.`);
278
+ }
279
+ }
280
+ }
281
+ exports.RawJsonTranscoder = RawJsonTranscoder;
@@ -1,4 +1,5 @@
1
1
  import { Cluster } from './cluster';
2
+ import { CppManagementRbacGroup, CppManagementRbacOrigin, CppManagementRbacRole, CppManagementRbacRoleAndDescription, CppManagementRbacRoleAndOrigins, CppManagementRbacUser, CppManagementRbacUserAndMetadata } from './binding';
2
3
  import { NodeCallback } from './utilities';
3
4
  /**
4
5
  * Contains information about an origin for a role.
@@ -13,7 +14,7 @@ export declare class Origin {
13
14
  /**
14
15
  * The name of this origin.
15
16
  */
16
- name: string;
17
+ name?: string;
17
18
  /**
18
19
  * @internal
19
20
  */
@@ -21,7 +22,7 @@ export declare class Origin {
21
22
  /**
22
23
  * @internal
23
24
  */
24
- static _fromNsData(data: any): Origin;
25
+ static _fromCppData(data: CppManagementRbacOrigin): Origin;
25
26
  }
26
27
  /**
27
28
  * Contains information about a role.
@@ -52,11 +53,11 @@ export declare class Role {
52
53
  /**
53
54
  * @internal
54
55
  */
55
- static _fromNsData(data: any): Role;
56
+ static _fromCppData(data: CppManagementRbacRole): Role;
56
57
  /**
57
58
  * @internal
58
59
  */
59
- static _toNsStr(role: string | Role): string;
60
+ static _toCppData(data: Role): CppManagementRbacRole;
60
61
  }
61
62
  /**
62
63
  * Contains information about a role along with its description.
@@ -79,7 +80,7 @@ export declare class RoleAndDescription extends Role {
79
80
  /**
80
81
  * @internal
81
82
  */
82
- static _fromNsData(data: any): RoleAndDescription;
83
+ static _fromCppData(data: CppManagementRbacRoleAndDescription): RoleAndDescription;
83
84
  }
84
85
  /**
85
86
  * Contains information about a role along with its origin.
@@ -98,7 +99,7 @@ export declare class RoleAndOrigin extends Role {
98
99
  /**
99
100
  * @internal
100
101
  */
101
- static _fromNsData(data: any): RoleAndOrigin;
102
+ static _fromCppData(data: CppManagementRbacRoleAndOrigins): RoleAndOrigin;
102
103
  }
103
104
  /**
104
105
  * Specifies information about a user.
@@ -140,7 +141,7 @@ export declare class User implements IUser {
140
141
  /**
141
142
  * The display name of the user.
142
143
  */
143
- displayName: string;
144
+ displayName?: string;
144
145
  /**
145
146
  * The groups associated with this user.
146
147
  */
@@ -160,11 +161,11 @@ export declare class User implements IUser {
160
161
  /**
161
162
  * @internal
162
163
  */
163
- static _fromNsData(data: any): User;
164
+ static _fromCppData(data: CppManagementRbacUser): User;
164
165
  /**
165
166
  * @internal
166
167
  */
167
- static _toNsData(user: IUser): any;
168
+ static _toCppData(data: IUser): CppManagementRbacUser;
168
169
  }
169
170
  /**
170
171
  * Contains information about a user along with some additional meta-data
@@ -184,7 +185,7 @@ export declare class UserAndMetadata extends User {
184
185
  /**
185
186
  * The last time the users password was changed.
186
187
  */
187
- passwordChanged: Date;
188
+ passwordChanged?: Date;
188
189
  /**
189
190
  * The external groups that this user is associated with.
190
191
  */
@@ -203,7 +204,7 @@ export declare class UserAndMetadata extends User {
203
204
  /**
204
205
  * @internal
205
206
  */
206
- static _fromNsData(data: any): UserAndMetadata;
207
+ static _fromCppData(data: CppManagementRbacUserAndMetadata): UserAndMetadata;
207
208
  }
208
209
  /**
209
210
  * Specifies information about a group.
@@ -257,11 +258,11 @@ export declare class Group {
257
258
  /**
258
259
  * @internal
259
260
  */
260
- static _fromNsData(data: any): Group;
261
+ static _fromCppData(data: CppManagementRbacGroup): Group;
261
262
  /**
262
263
  * @internal
263
264
  */
264
- static _toNsData(group: IGroup): any;
265
+ static _toCppData(data: IGroup): CppManagementRbacGroup;
265
266
  }
266
267
  /**
267
268
  * @category Management
@@ -381,7 +382,6 @@ export declare class UserManager {
381
382
  * @internal
382
383
  */
383
384
  constructor(cluster: Cluster);
384
- private get _http();
385
385
  /**
386
386
  * Returns a specific user by their username.
387
387
  *