pecunia-root 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/dist/adapters/prisma-adapter/index.d.mts +1 -1
  2. package/dist/adapters/prisma-adapter/index.mjs +1 -1
  3. package/dist/adapters/prisma-adapter/index.mjs.map +1 -1
  4. package/dist/index.d.mts +1 -2
  5. package/dist/index.mjs +1 -2
  6. package/package.json +2 -16
  7. package/dist/_virtual/rolldown_runtime.mjs +0 -8
  8. package/dist/adapters/mongodb-adapter/index.d.mts +0 -35
  9. package/dist/adapters/mongodb-adapter/index.mjs +0 -314
  10. package/dist/adapters/mongodb-adapter/index.mjs.map +0 -1
  11. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +0 -14
  12. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +0 -1
  13. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +0 -54
  14. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +0 -1
  15. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +0 -36
  16. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +0 -1
  17. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +0 -27
  18. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +0 -1
  19. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +0 -3728
  20. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +0 -1
  21. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +0 -137
  22. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +0 -1
  23. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +0 -211
  24. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +0 -1
  25. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +0 -95
  26. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +0 -1
  27. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +0 -158
  28. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +0 -1
  29. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +0 -195
  30. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +0 -1
  31. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +0 -710
  32. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +0 -1
  33. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +0 -53
  34. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +0 -1
  35. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +0 -63
  36. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +0 -1
  37. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +0 -368
  38. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +0 -1
  39. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +0 -234
  40. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +0 -1
  41. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +0 -545
  42. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +0 -1
  43. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +0 -83
  44. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +0 -1
  45. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +0 -146
  46. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +0 -1
  47. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +0 -58
  48. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +0 -1
  49. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +0 -30
  50. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +0 -135
  52. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +0 -1
  53. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +0 -25
  54. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +0 -1
  55. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +0 -47
  56. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +0 -362
  58. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +0 -1
  59. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +0 -58
  60. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +0 -1
  61. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +0 -123
  62. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +0 -128
  64. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +0 -1
  65. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +0 -133
  66. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +0 -1
  67. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +0 -126
  68. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +0 -79
  70. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +0 -1
  71. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +0 -65
  72. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +0 -1
  73. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +0 -127
  74. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +0 -47
  76. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +0 -44
  78. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +0 -101
  80. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +0 -33
  82. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +0 -53
  84. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +0 -29
  86. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +0 -83
  88. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +0 -36
  90. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +0 -1
  91. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +0 -32
  92. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +0 -206
  94. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +0 -45
  96. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +0 -1
  97. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +0 -213
  98. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +0 -411
  100. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +0 -288
  102. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +0 -1
  103. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +0 -423
  104. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +0 -483
  106. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +0 -207
  108. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +0 -1
  109. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +0 -116
  110. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +0 -183
  112. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +0 -1
  113. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +0 -55
  114. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +0 -1
  115. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +0 -60
  116. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +0 -1
  117. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +0 -139
  118. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +0 -1
  119. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +0 -28
  120. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +0 -1
  121. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +0 -117
  122. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +0 -1
  123. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +0 -182
  124. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +0 -1
  125. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +0 -304
  126. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +0 -1
  127. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +0 -34
  128. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +0 -1
  129. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +0 -739
  130. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +0 -1
  131. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +0 -805
  132. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +0 -1
  133. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +0 -174
  134. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +0 -1
  135. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +0 -726
  136. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +0 -1
  137. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +0 -172
  138. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +0 -1
  139. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +0 -103
  140. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +0 -1
  141. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +0 -66
  142. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +0 -1
  143. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +0 -41
  144. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +0 -1
  145. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +0 -365
  146. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +0 -1
  147. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +0 -50
  148. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +0 -1
  149. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +0 -48
  150. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +0 -1
  151. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +0 -23
  152. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +0 -1
  153. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +0 -106
  154. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +0 -1
  155. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +0 -428
  156. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +0 -1
  157. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +0 -124
  158. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +0 -1
  159. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +0 -95
  160. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +0 -1
  161. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +0 -1305
  162. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +0 -1
  163. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +0 -59
  164. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +0 -1
  165. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +0 -250
  166. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +0 -1
  167. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +0 -170
  168. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +0 -1
  169. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +0 -315
  170. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +0 -1
  171. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +0 -925
  172. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +0 -1
  173. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +0 -520
  174. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +0 -1
  175. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +0 -90
  176. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +0 -1
  177. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +0 -582
  178. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +0 -1
  179. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +0 -64
  180. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +0 -1
  181. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +0 -86
  182. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +0 -1
  183. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +0 -60
  184. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +0 -1
  185. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +0 -264
  186. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +0 -1
  187. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +0 -109
  188. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +0 -1
  189. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +0 -172
  190. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +0 -1
  191. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +0 -68
  192. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +0 -1
  193. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +0 -53
  194. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +0 -1
  195. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +0 -123
  196. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +0 -1
  197. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +0 -119
  198. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +0 -1
  199. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +0 -65
  200. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +0 -1
  201. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +0 -97
  202. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +0 -1
  203. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +0 -47
  204. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +0 -1
  205. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +0 -188
  206. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +0 -1
  207. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +0 -103
  208. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +0 -1
  209. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +0 -136
  210. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +0 -1
  211. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +0 -61
  212. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +0 -1
  213. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +0 -179
  214. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +0 -1
  215. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +0 -77
  216. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +0 -1
  217. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +0 -48
  218. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +0 -1
  219. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +0 -60
  220. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +0 -1
  221. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +0 -43
  222. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +0 -1
  223. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +0 -105
  224. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +0 -1
  225. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +0 -50
  226. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +0 -1
  227. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +0 -39
  228. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +0 -1
  229. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +0 -49
  230. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +0 -1
  231. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +0 -58
  232. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +0 -1
  233. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +0 -46
  234. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +0 -1
  235. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +0 -48
  236. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +0 -1
  237. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +0 -46
  238. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +0 -1
  239. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +0 -67
  240. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +0 -1
  241. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +0 -37
  242. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +0 -1
  243. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +0 -171
  244. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +0 -1
  245. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +0 -45
  246. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +0 -1
  247. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +0 -71
  248. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +0 -1
  249. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +0 -165
  250. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +0 -1
  251. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +0 -62
  252. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +0 -51
  254. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +0 -1
  255. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +0 -156
  256. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +0 -1
  257. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +0 -477
  258. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +0 -315
  260. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +0 -1
  261. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +0 -157
  262. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +0 -1
  263. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +0 -184
  264. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +0 -96
  266. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +0 -1
  267. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +0 -107
  268. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +0 -1
  269. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +0 -540
  270. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +0 -298
  272. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +0 -1
  273. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +0 -623
  274. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +0 -1
  275. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +0 -91
  276. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +0 -254
  278. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +0 -1
  279. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +0 -138
  280. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +0 -1
  281. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +0 -993
  282. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +0 -81
  284. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +0 -1
  285. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +0 -171
  286. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +0 -1
  287. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +0 -295
  288. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +0 -81
  290. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +0 -1
  291. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +0 -206
  292. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +0 -1
  293. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +0 -33590
  294. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +0 -37
  296. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +0 -1
  297. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +0 -18
  298. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +0 -1
  299. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +0 -252
  300. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +0 -1
  301. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +0 -41
  302. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +0 -1
  303. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +0 -41
  304. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +0 -1
  305. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +0 -173
  306. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +0 -1
  307. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +0 -334
  308. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +0 -1
  309. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +0 -90
  310. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +0 -1
  311. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +0 -356
  312. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +0 -1
  313. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +0 -23
  314. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +0 -1
  315. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +0 -29
  316. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +0 -1
  317. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +0 -140
  318. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +0 -1
  319. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +0 -831
  320. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +0 -1
  321. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +0 -77
  322. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +0 -1
  323. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +0 -147
  324. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +0 -1
  325. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +0 -17
  326. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +0 -1
@@ -1,545 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_bson } from "../bson.mjs";
3
- import { require_utils } from "../utils.mjs";
4
- import { require_timeout } from "../timeout.mjs";
5
- import { require_deps } from "../deps.mjs";
6
- import { require_crypto_callbacks } from "./crypto_callbacks.mjs";
7
- import { require_errors } from "./errors.mjs";
8
- import { require_providers } from "./providers/index.mjs";
9
- import { require_state_machine } from "./state_machine.mjs";
10
-
11
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js
12
- var require_client_encryption = /* @__PURE__ */ __commonJSMin(((exports) => {
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.ClientEncryption = void 0;
15
- exports.autoSelectSocketOptions = autoSelectSocketOptions;
16
- const bson_1 = require_bson();
17
- const deps_1 = require_deps();
18
- const timeout_1 = require_timeout();
19
- const utils_1 = require_utils();
20
- const cryptoCallbacks = require_crypto_callbacks();
21
- const errors_1 = require_errors();
22
- const index_1 = require_providers();
23
- const state_machine_1 = require_state_machine();
24
- /**
25
- * @public
26
- * The public interface for explicit in-use encryption
27
- */
28
- var ClientEncryption = class ClientEncryption {
29
- /** @internal */
30
- static getMongoCrypt() {
31
- const encryption = (0, deps_1.getMongoDBClientEncryption)();
32
- if ("kModuleError" in encryption) throw encryption.kModuleError;
33
- return encryption.MongoCrypt;
34
- }
35
- /**
36
- * Create a new encryption instance
37
- *
38
- * @example
39
- * ```ts
40
- * new ClientEncryption(mongoClient, {
41
- * keyVaultNamespace: 'client.encryption',
42
- * kmsProviders: {
43
- * local: {
44
- * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer
45
- * }
46
- * }
47
- * });
48
- * ```
49
- *
50
- * @example
51
- * ```ts
52
- * new ClientEncryption(mongoClient, {
53
- * keyVaultNamespace: 'client.encryption',
54
- * kmsProviders: {
55
- * aws: {
56
- * accessKeyId: AWS_ACCESS_KEY,
57
- * secretAccessKey: AWS_SECRET_KEY
58
- * }
59
- * }
60
- * });
61
- * ```
62
- */
63
- constructor(client, options) {
64
- this._client = client;
65
- this._proxyOptions = options.proxyOptions ?? {};
66
- this._tlsOptions = options.tlsOptions ?? {};
67
- this._kmsProviders = options.kmsProviders || {};
68
- const { timeoutMS } = (0, utils_1.resolveTimeoutOptions)(client, options);
69
- this._timeoutMS = timeoutMS;
70
- this._credentialProviders = options.credentialProviders;
71
- if (options.credentialProviders?.aws && !(0, index_1.isEmptyCredentials)("aws", this._kmsProviders)) throw new errors_1.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching");
72
- if (options.keyVaultNamespace == null) throw new errors_1.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`");
73
- const mongoCryptOptions = {
74
- ...options,
75
- cryptoCallbacks,
76
- kmsProviders: !Buffer.isBuffer(this._kmsProviders) ? (0, bson_1.serialize)(this._kmsProviders) : this._kmsProviders
77
- };
78
- this._keyVaultNamespace = options.keyVaultNamespace;
79
- this._keyVaultClient = options.keyVaultClient || client;
80
- this._mongoCrypt = new (ClientEncryption.getMongoCrypt())(mongoCryptOptions);
81
- }
82
- /**
83
- * Creates a data key used for explicit encryption and inserts it into the key vault namespace
84
- *
85
- * @example
86
- * ```ts
87
- * // Using async/await to create a local key
88
- * const dataKeyId = await clientEncryption.createDataKey('local');
89
- * ```
90
- *
91
- * @example
92
- * ```ts
93
- * // Using async/await to create an aws key
94
- * const dataKeyId = await clientEncryption.createDataKey('aws', {
95
- * masterKey: {
96
- * region: 'us-east-1',
97
- * key: 'xxxxxxxxxxxxxx' // CMK ARN here
98
- * }
99
- * });
100
- * ```
101
- *
102
- * @example
103
- * ```ts
104
- * // Using async/await to create an aws key with a keyAltName
105
- * const dataKeyId = await clientEncryption.createDataKey('aws', {
106
- * masterKey: {
107
- * region: 'us-east-1',
108
- * key: 'xxxxxxxxxxxxxx' // CMK ARN here
109
- * },
110
- * keyAltNames: [ 'mySpecialKey' ]
111
- * });
112
- * ```
113
- */
114
- async createDataKey(provider, options = {}) {
115
- if (options.keyAltNames && !Array.isArray(options.keyAltNames)) throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof options.keyAltNames}.`);
116
- let keyAltNames = void 0;
117
- if (options.keyAltNames && options.keyAltNames.length > 0) keyAltNames = options.keyAltNames.map((keyAltName, i) => {
118
- if (typeof keyAltName !== "string") throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${i} was of type ${typeof keyAltName}`);
119
- return (0, bson_1.serialize)({ keyAltName });
120
- });
121
- let keyMaterial = void 0;
122
- if (options.keyMaterial) keyMaterial = (0, bson_1.serialize)({ keyMaterial: options.keyMaterial });
123
- const dataKeyBson = (0, bson_1.serialize)({
124
- provider,
125
- ...options.masterKey
126
- });
127
- const context = this._mongoCrypt.makeDataKeyContext(dataKeyBson, {
128
- keyAltNames,
129
- keyMaterial
130
- });
131
- const stateMachine = new state_machine_1.StateMachine({
132
- proxyOptions: this._proxyOptions,
133
- tlsOptions: this._tlsOptions,
134
- socketOptions: autoSelectSocketOptions(this._client.s.options)
135
- });
136
- const timeoutContext = options?.timeoutContext ?? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }));
137
- const dataKey = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));
138
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
139
- const { insertedId } = await this._keyVaultClient.db(dbName).collection(collectionName).insertOne(dataKey, {
140
- writeConcern: { w: "majority" },
141
- timeoutMS: timeoutContext?.csotEnabled() ? timeoutContext?.getRemainingTimeMSOrThrow() : void 0
142
- });
143
- return insertedId;
144
- }
145
- /**
146
- * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options.
147
- *
148
- * If no matches are found, then no bulk write is performed.
149
- *
150
- * @example
151
- * ```ts
152
- * // rewrapping all data data keys (using a filter that matches all documents)
153
- * const filter = {};
154
- *
155
- * const result = await clientEncryption.rewrapManyDataKey(filter);
156
- * if (result.bulkWriteResult != null) {
157
- * // keys were re-wrapped, results will be available in the bulkWrite object.
158
- * }
159
- * ```
160
- *
161
- * @example
162
- * ```ts
163
- * // attempting to rewrap all data keys with no matches
164
- * const filter = { _id: new Binary() } // assume _id matches no documents in the database
165
- * const result = await clientEncryption.rewrapManyDataKey(filter);
166
- *
167
- * if (result.bulkWriteResult == null) {
168
- * // no keys matched, `bulkWriteResult` does not exist on the result object
169
- * }
170
- * ```
171
- */
172
- async rewrapManyDataKey(filter, options) {
173
- let keyEncryptionKeyBson = void 0;
174
- if (options) {
175
- const keyEncryptionKey = Object.assign({ provider: options.provider }, options.masterKey);
176
- keyEncryptionKeyBson = (0, bson_1.serialize)(keyEncryptionKey);
177
- }
178
- const filterBson = (0, bson_1.serialize)(filter);
179
- const context = this._mongoCrypt.makeRewrapManyDataKeyContext(filterBson, keyEncryptionKeyBson);
180
- const stateMachine = new state_machine_1.StateMachine({
181
- proxyOptions: this._proxyOptions,
182
- tlsOptions: this._tlsOptions,
183
- socketOptions: autoSelectSocketOptions(this._client.s.options)
184
- });
185
- const timeoutContext = timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }));
186
- const { v: dataKeys } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));
187
- if (dataKeys.length === 0) return {};
188
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
189
- const replacements = dataKeys.map((key) => ({ updateOne: {
190
- filter: { _id: key._id },
191
- update: {
192
- $set: {
193
- masterKey: key.masterKey,
194
- keyMaterial: key.keyMaterial
195
- },
196
- $currentDate: { updateDate: true }
197
- }
198
- } }));
199
- return { bulkWriteResult: await this._keyVaultClient.db(dbName).collection(collectionName).bulkWrite(replacements, {
200
- writeConcern: { w: "majority" },
201
- timeoutMS: timeoutContext.csotEnabled() ? timeoutContext?.remainingTimeMS : void 0
202
- }) };
203
- }
204
- /**
205
- * Deletes the key with the provided id from the keyvault, if it exists.
206
- *
207
- * @example
208
- * ```ts
209
- * // delete a key by _id
210
- * const id = new Binary(); // id is a bson binary subtype 4 object
211
- * const { deletedCount } = await clientEncryption.deleteKey(id);
212
- *
213
- * if (deletedCount != null && deletedCount > 0) {
214
- * // successful deletion
215
- * }
216
- * ```
217
- *
218
- */
219
- async deleteKey(_id) {
220
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
221
- return await this._keyVaultClient.db(dbName).collection(collectionName).deleteOne({ _id }, {
222
- writeConcern: { w: "majority" },
223
- timeoutMS: this._timeoutMS
224
- });
225
- }
226
- /**
227
- * Finds all the keys currently stored in the keyvault.
228
- *
229
- * This method will not throw.
230
- *
231
- * @returns a FindCursor over all keys in the keyvault.
232
- * @example
233
- * ```ts
234
- * // fetching all keys
235
- * const keys = await clientEncryption.getKeys().toArray();
236
- * ```
237
- */
238
- getKeys() {
239
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
240
- return this._keyVaultClient.db(dbName).collection(collectionName).find({}, {
241
- readConcern: { level: "majority" },
242
- timeoutMS: this._timeoutMS
243
- });
244
- }
245
- /**
246
- * Finds a key in the keyvault with the specified _id.
247
- *
248
- * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents
249
- * match the id. The promise rejects with an error if an error is thrown.
250
- * @example
251
- * ```ts
252
- * // getting a key by id
253
- * const id = new Binary(); // id is a bson binary subtype 4 object
254
- * const key = await clientEncryption.getKey(id);
255
- * if (!key) {
256
- * // key is null if there was no matching key
257
- * }
258
- * ```
259
- */
260
- async getKey(_id) {
261
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
262
- return await this._keyVaultClient.db(dbName).collection(collectionName).findOne({ _id }, {
263
- readConcern: { level: "majority" },
264
- timeoutMS: this._timeoutMS
265
- });
266
- }
267
- /**
268
- * Finds a key in the keyvault which has the specified keyAltName.
269
- *
270
- * @param keyAltName - a keyAltName to search for a key
271
- * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents
272
- * match the keyAltName. The promise rejects with an error if an error is thrown.
273
- * @example
274
- * ```ts
275
- * // get a key by alt name
276
- * const keyAltName = 'keyAltName';
277
- * const key = await clientEncryption.getKeyByAltName(keyAltName);
278
- * if (!key) {
279
- * // key is null if there is no matching key
280
- * }
281
- * ```
282
- */
283
- async getKeyByAltName(keyAltName) {
284
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
285
- return await this._keyVaultClient.db(dbName).collection(collectionName).findOne({ keyAltNames: keyAltName }, {
286
- readConcern: { level: "majority" },
287
- timeoutMS: this._timeoutMS
288
- });
289
- }
290
- /**
291
- * Adds a keyAltName to a key identified by the provided _id.
292
- *
293
- * This method resolves to/returns the *old* key value (prior to adding the new altKeyName).
294
- *
295
- * @param _id - The id of the document to update.
296
- * @param keyAltName - a keyAltName to search for a key
297
- * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents
298
- * match the id. The promise rejects with an error if an error is thrown.
299
- * @example
300
- * ```ts
301
- * // adding an keyAltName to a data key
302
- * const id = new Binary(); // id is a bson binary subtype 4 object
303
- * const keyAltName = 'keyAltName';
304
- * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName);
305
- * if (!oldKey) {
306
- * // null is returned if there is no matching document with an id matching the supplied id
307
- * }
308
- * ```
309
- */
310
- async addKeyAltName(_id, keyAltName) {
311
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
312
- return await this._keyVaultClient.db(dbName).collection(collectionName).findOneAndUpdate({ _id }, { $addToSet: { keyAltNames: keyAltName } }, {
313
- writeConcern: { w: "majority" },
314
- returnDocument: "before",
315
- timeoutMS: this._timeoutMS
316
- });
317
- }
318
- /**
319
- * Adds a keyAltName to a key identified by the provided _id.
320
- *
321
- * This method resolves to/returns the *old* key value (prior to removing the new altKeyName).
322
- *
323
- * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document.
324
- *
325
- * @param _id - The id of the document to update.
326
- * @param keyAltName - a keyAltName to search for a key
327
- * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents
328
- * match the id. The promise rejects with an error if an error is thrown.
329
- * @example
330
- * ```ts
331
- * // removing a key alt name from a data key
332
- * const id = new Binary(); // id is a bson binary subtype 4 object
333
- * const keyAltName = 'keyAltName';
334
- * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName);
335
- *
336
- * if (!oldKey) {
337
- * // null is returned if there is no matching document with an id matching the supplied id
338
- * }
339
- * ```
340
- */
341
- async removeKeyAltName(_id, keyAltName) {
342
- const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);
343
- const pipeline = [{ $set: { keyAltNames: { $cond: [
344
- { $eq: ["$keyAltNames", [keyAltName]] },
345
- "$$REMOVE",
346
- { $filter: {
347
- input: "$keyAltNames",
348
- cond: { $ne: ["$$this", keyAltName] }
349
- } }
350
- ] } } }];
351
- return await this._keyVaultClient.db(dbName).collection(collectionName).findOneAndUpdate({ _id }, pipeline, {
352
- writeConcern: { w: "majority" },
353
- returnDocument: "before",
354
- timeoutMS: this._timeoutMS
355
- });
356
- }
357
- /**
358
- * A convenience method for creating an encrypted collection.
359
- * This method will create data keys for any encryptedFields that do not have a `keyId` defined
360
- * and then create a new collection with the full set of encryptedFields.
361
- *
362
- * @param db - A Node.js driver Db object with which to create the collection
363
- * @param name - The name of the collection to be created
364
- * @param options - Options for createDataKey and for createCollection
365
- * @returns created collection and generated encryptedFields
366
- * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created.
367
- * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created.
368
- */
369
- async createEncryptedCollection(db, name, options) {
370
- const { provider, masterKey, createCollectionOptions: { encryptedFields: { ...encryptedFields }, ...createCollectionOptions } } = options;
371
- const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0;
372
- if (Array.isArray(encryptedFields.fields)) {
373
- const createDataKeyPromises = encryptedFields.fields.map(async (field) => field == null || typeof field !== "object" || field.keyId != null ? field : {
374
- ...field,
375
- keyId: await this.createDataKey(provider, {
376
- masterKey,
377
- timeoutContext: timeoutContext?.csotEnabled() ? timeoutContext?.clone() : void 0
378
- })
379
- });
380
- const createDataKeyResolutions = await Promise.allSettled(createDataKeyPromises);
381
- encryptedFields.fields = createDataKeyResolutions.map((resolution, index) => resolution.status === "fulfilled" ? resolution.value : encryptedFields.fields[index]);
382
- const rejection = createDataKeyResolutions.find((result) => result.status === "rejected");
383
- if (rejection != null) throw new errors_1.MongoCryptCreateDataKeyError(encryptedFields, { cause: rejection.reason });
384
- }
385
- try {
386
- return {
387
- collection: await db.createCollection(name, {
388
- ...createCollectionOptions,
389
- encryptedFields,
390
- timeoutMS: timeoutContext?.csotEnabled() ? timeoutContext?.getRemainingTimeMSOrThrow() : void 0
391
- }),
392
- encryptedFields
393
- };
394
- } catch (cause) {
395
- throw new errors_1.MongoCryptCreateEncryptedCollectionError(encryptedFields, { cause });
396
- }
397
- }
398
- /**
399
- * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must
400
- * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.
401
- *
402
- * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON
403
- * @param options -
404
- * @returns a Promise that either resolves with the encrypted value, or rejects with an error.
405
- *
406
- * @example
407
- * ```ts
408
- * // Encryption with async/await api
409
- * async function encryptMyData(value) {
410
- * const keyId = await clientEncryption.createDataKey('local');
411
- * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });
412
- * }
413
- * ```
414
- *
415
- * @example
416
- * ```ts
417
- * // Encryption using a keyAltName
418
- * async function encryptMyData(value) {
419
- * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' });
420
- * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });
421
- * }
422
- * ```
423
- */
424
- async encrypt(value, options) {
425
- return await this._encrypt(value, false, options);
426
- }
427
- /**
428
- * Encrypts a Match Expression or Aggregate Expression to query a range index.
429
- *
430
- * Only supported when queryType is "range" and algorithm is "Range".
431
- *
432
- * @param expression - a BSON document of one of the following forms:
433
- * 1. A Match Expression of this form:
434
- * `{$and: [{<field>: {$gt: <value1>}}, {<field>: {$lt: <value2> }}]}`
435
- * 2. An Aggregate Expression of this form:
436
- * `{$and: [{$gt: [<fieldpath>, <value1>]}, {$lt: [<fieldpath>, <value2>]}]}`
437
- *
438
- * `$gt` may also be `$gte`. `$lt` may also be `$lte`.
439
- *
440
- * @param options -
441
- * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error.
442
- */
443
- async encryptExpression(expression, options) {
444
- return await this._encrypt(expression, true, options);
445
- }
446
- /**
447
- * Explicitly decrypt a provided encrypted value
448
- *
449
- * @param value - An encrypted value
450
- * @returns a Promise that either resolves with the decrypted value, or rejects with an error
451
- *
452
- * @example
453
- * ```ts
454
- * // Decrypting value with async/await API
455
- * async function decryptMyValue(value) {
456
- * return clientEncryption.decrypt(value);
457
- * }
458
- * ```
459
- */
460
- async decrypt(value) {
461
- const valueBuffer = (0, bson_1.serialize)({ v: value });
462
- const context = this._mongoCrypt.makeExplicitDecryptionContext(valueBuffer);
463
- const stateMachine = new state_machine_1.StateMachine({
464
- proxyOptions: this._proxyOptions,
465
- tlsOptions: this._tlsOptions,
466
- socketOptions: autoSelectSocketOptions(this._client.s.options)
467
- });
468
- const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0;
469
- const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));
470
- return v;
471
- }
472
- /**
473
- * @internal
474
- * Ask the user for KMS credentials.
475
- *
476
- * This returns anything that looks like the kmsProviders original input
477
- * option. It can be empty, and any provider specified here will override
478
- * the original ones.
479
- */
480
- async askForKMSCredentials() {
481
- return await (0, index_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders);
482
- }
483
- static get libmongocryptVersion() {
484
- return ClientEncryption.getMongoCrypt().libmongocryptVersion;
485
- }
486
- /**
487
- * @internal
488
- * A helper that perform explicit encryption of values and expressions.
489
- * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must
490
- * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.
491
- *
492
- * @param value - The value that you wish to encrypt. Must be of a type that can be serialized into BSON
493
- * @param expressionMode - a boolean that indicates whether or not to encrypt the value as an expression
494
- * @param options - options to pass to encrypt
495
- * @returns the raw result of the call to stateMachine.execute(). When expressionMode is set to true, the return
496
- * value will be a bson document. When false, the value will be a BSON Binary.
497
- *
498
- */
499
- async _encrypt(value, expressionMode, options) {
500
- const { algorithm, keyId, keyAltName, contentionFactor, queryType, rangeOptions, textOptions } = options;
501
- const contextOptions = {
502
- expressionMode,
503
- algorithm
504
- };
505
- if (keyId) contextOptions.keyId = keyId.buffer;
506
- if (keyAltName) {
507
- if (keyId) throw new errors_1.MongoCryptInvalidArgumentError(`"options" cannot contain both "keyId" and "keyAltName"`);
508
- if (typeof keyAltName !== "string") throw new errors_1.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof keyAltName}`);
509
- contextOptions.keyAltName = (0, bson_1.serialize)({ keyAltName });
510
- }
511
- if (typeof contentionFactor === "number" || typeof contentionFactor === "bigint") contextOptions.contentionFactor = contentionFactor;
512
- if (typeof queryType === "string") contextOptions.queryType = queryType;
513
- if (typeof rangeOptions === "object") contextOptions.rangeOptions = (0, bson_1.serialize)(rangeOptions);
514
- if (typeof textOptions === "object") contextOptions.textOptions = (0, bson_1.serialize)(textOptions);
515
- const valueBuffer = (0, bson_1.serialize)({ v: value });
516
- const stateMachine = new state_machine_1.StateMachine({
517
- proxyOptions: this._proxyOptions,
518
- tlsOptions: this._tlsOptions,
519
- socketOptions: autoSelectSocketOptions(this._client.s.options)
520
- });
521
- const context = this._mongoCrypt.makeExplicitEncryptionContext(valueBuffer, contextOptions);
522
- const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0;
523
- const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));
524
- return v;
525
- }
526
- };
527
- exports.ClientEncryption = ClientEncryption;
528
- /**
529
- * Get the socket options from the client.
530
- * @param baseOptions - The mongo client options.
531
- * @returns ClientEncryptionSocketOptions
532
- */
533
- function autoSelectSocketOptions(baseOptions) {
534
- const options = { autoSelectFamily: true };
535
- if ("autoSelectFamily" in baseOptions) options.autoSelectFamily = baseOptions.autoSelectFamily;
536
- if ("autoSelectFamilyAttemptTimeout" in baseOptions) options.autoSelectFamilyAttemptTimeout = baseOptions.autoSelectFamilyAttemptTimeout;
537
- return options;
538
- }
539
- }));
540
-
541
- //#endregion
542
- export default require_client_encryption();
543
-
544
- export { require_client_encryption };
545
- //# sourceMappingURL=client_encryption.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client_encryption.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientEncryption = void 0;\nexports.autoSelectSocketOptions = autoSelectSocketOptions;\nconst bson_1 = require(\"../bson\");\nconst deps_1 = require(\"../deps\");\nconst timeout_1 = require(\"../timeout\");\nconst utils_1 = require(\"../utils\");\nconst cryptoCallbacks = require(\"./crypto_callbacks\");\nconst errors_1 = require(\"./errors\");\nconst index_1 = require(\"./providers/index\");\nconst state_machine_1 = require(\"./state_machine\");\n/**\n * @public\n * The public interface for explicit in-use encryption\n */\nclass ClientEncryption {\n /** @internal */\n static getMongoCrypt() {\n const encryption = (0, deps_1.getMongoDBClientEncryption)();\n if ('kModuleError' in encryption) {\n throw encryption.kModuleError;\n }\n return encryption.MongoCrypt;\n }\n /**\n * Create a new encryption instance\n *\n * @example\n * ```ts\n * new ClientEncryption(mongoClient, {\n * keyVaultNamespace: 'client.encryption',\n * kmsProviders: {\n * local: {\n * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer\n * }\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * new ClientEncryption(mongoClient, {\n * keyVaultNamespace: 'client.encryption',\n * kmsProviders: {\n * aws: {\n * accessKeyId: AWS_ACCESS_KEY,\n * secretAccessKey: AWS_SECRET_KEY\n * }\n * }\n * });\n * ```\n */\n constructor(client, options) {\n this._client = client;\n this._proxyOptions = options.proxyOptions ?? {};\n this._tlsOptions = options.tlsOptions ?? {};\n this._kmsProviders = options.kmsProviders || {};\n const { timeoutMS } = (0, utils_1.resolveTimeoutOptions)(client, options);\n this._timeoutMS = timeoutMS;\n this._credentialProviders = options.credentialProviders;\n if (options.credentialProviders?.aws && !(0, index_1.isEmptyCredentials)('aws', this._kmsProviders)) {\n throw new errors_1.MongoCryptInvalidArgumentError('Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching');\n }\n if (options.keyVaultNamespace == null) {\n throw new errors_1.MongoCryptInvalidArgumentError('Missing required option `keyVaultNamespace`');\n }\n const mongoCryptOptions = {\n ...options,\n cryptoCallbacks,\n kmsProviders: !Buffer.isBuffer(this._kmsProviders)\n ? (0, bson_1.serialize)(this._kmsProviders)\n : this._kmsProviders\n };\n this._keyVaultNamespace = options.keyVaultNamespace;\n this._keyVaultClient = options.keyVaultClient || client;\n const MongoCrypt = ClientEncryption.getMongoCrypt();\n this._mongoCrypt = new MongoCrypt(mongoCryptOptions);\n }\n /**\n * Creates a data key used for explicit encryption and inserts it into the key vault namespace\n *\n * @example\n * ```ts\n * // Using async/await to create a local key\n * const dataKeyId = await clientEncryption.createDataKey('local');\n * ```\n *\n * @example\n * ```ts\n * // Using async/await to create an aws key\n * const dataKeyId = await clientEncryption.createDataKey('aws', {\n * masterKey: {\n * region: 'us-east-1',\n * key: 'xxxxxxxxxxxxxx' // CMK ARN here\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Using async/await to create an aws key with a keyAltName\n * const dataKeyId = await clientEncryption.createDataKey('aws', {\n * masterKey: {\n * region: 'us-east-1',\n * key: 'xxxxxxxxxxxxxx' // CMK ARN here\n * },\n * keyAltNames: [ 'mySpecialKey' ]\n * });\n * ```\n */\n async createDataKey(provider, options = {}) {\n if (options.keyAltNames && !Array.isArray(options.keyAltNames)) {\n throw new errors_1.MongoCryptInvalidArgumentError(`Option \"keyAltNames\" must be an array of strings, but was of type ${typeof options.keyAltNames}.`);\n }\n let keyAltNames = undefined;\n if (options.keyAltNames && options.keyAltNames.length > 0) {\n keyAltNames = options.keyAltNames.map((keyAltName, i) => {\n if (typeof keyAltName !== 'string') {\n throw new errors_1.MongoCryptInvalidArgumentError(`Option \"keyAltNames\" must be an array of strings, but item at index ${i} was of type ${typeof keyAltName}`);\n }\n return (0, bson_1.serialize)({ keyAltName });\n });\n }\n let keyMaterial = undefined;\n if (options.keyMaterial) {\n keyMaterial = (0, bson_1.serialize)({ keyMaterial: options.keyMaterial });\n }\n const dataKeyBson = (0, bson_1.serialize)({\n provider,\n ...options.masterKey\n });\n const context = this._mongoCrypt.makeDataKeyContext(dataKeyBson, {\n keyAltNames,\n keyMaterial\n });\n const stateMachine = new state_machine_1.StateMachine({\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: autoSelectSocketOptions(this._client.s.options)\n });\n const timeoutContext = options?.timeoutContext ??\n timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }));\n const dataKey = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n const { insertedId } = await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .insertOne(dataKey, {\n writeConcern: { w: 'majority' },\n timeoutMS: timeoutContext?.csotEnabled()\n ? timeoutContext?.getRemainingTimeMSOrThrow()\n : undefined\n });\n return insertedId;\n }\n /**\n * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options.\n *\n * If no matches are found, then no bulk write is performed.\n *\n * @example\n * ```ts\n * // rewrapping all data data keys (using a filter that matches all documents)\n * const filter = {};\n *\n * const result = await clientEncryption.rewrapManyDataKey(filter);\n * if (result.bulkWriteResult != null) {\n * // keys were re-wrapped, results will be available in the bulkWrite object.\n * }\n * ```\n *\n * @example\n * ```ts\n * // attempting to rewrap all data keys with no matches\n * const filter = { _id: new Binary() } // assume _id matches no documents in the database\n * const result = await clientEncryption.rewrapManyDataKey(filter);\n *\n * if (result.bulkWriteResult == null) {\n * // no keys matched, `bulkWriteResult` does not exist on the result object\n * }\n * ```\n */\n async rewrapManyDataKey(filter, options) {\n let keyEncryptionKeyBson = undefined;\n if (options) {\n const keyEncryptionKey = Object.assign({ provider: options.provider }, options.masterKey);\n keyEncryptionKeyBson = (0, bson_1.serialize)(keyEncryptionKey);\n }\n const filterBson = (0, bson_1.serialize)(filter);\n const context = this._mongoCrypt.makeRewrapManyDataKeyContext(filterBson, keyEncryptionKeyBson);\n const stateMachine = new state_machine_1.StateMachine({\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: autoSelectSocketOptions(this._client.s.options)\n });\n const timeoutContext = timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }));\n const { v: dataKeys } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));\n if (dataKeys.length === 0) {\n return {};\n }\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n const replacements = dataKeys.map((key) => ({\n updateOne: {\n filter: { _id: key._id },\n update: {\n $set: {\n masterKey: key.masterKey,\n keyMaterial: key.keyMaterial\n },\n $currentDate: {\n updateDate: true\n }\n }\n }\n }));\n const result = await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .bulkWrite(replacements, {\n writeConcern: { w: 'majority' },\n timeoutMS: timeoutContext.csotEnabled() ? timeoutContext?.remainingTimeMS : undefined\n });\n return { bulkWriteResult: result };\n }\n /**\n * Deletes the key with the provided id from the keyvault, if it exists.\n *\n * @example\n * ```ts\n * // delete a key by _id\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const { deletedCount } = await clientEncryption.deleteKey(id);\n *\n * if (deletedCount != null && deletedCount > 0) {\n * // successful deletion\n * }\n * ```\n *\n */\n async deleteKey(_id) {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n return await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .deleteOne({ _id }, { writeConcern: { w: 'majority' }, timeoutMS: this._timeoutMS });\n }\n /**\n * Finds all the keys currently stored in the keyvault.\n *\n * This method will not throw.\n *\n * @returns a FindCursor over all keys in the keyvault.\n * @example\n * ```ts\n * // fetching all keys\n * const keys = await clientEncryption.getKeys().toArray();\n * ```\n */\n getKeys() {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n return this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .find({}, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS });\n }\n /**\n * Finds a key in the keyvault with the specified _id.\n *\n * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // getting a key by id\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const key = await clientEncryption.getKey(id);\n * if (!key) {\n * // key is null if there was no matching key\n * }\n * ```\n */\n async getKey(_id) {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n return await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .findOne({ _id }, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS });\n }\n /**\n * Finds a key in the keyvault which has the specified keyAltName.\n *\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the keyAltName. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // get a key by alt name\n * const keyAltName = 'keyAltName';\n * const key = await clientEncryption.getKeyByAltName(keyAltName);\n * if (!key) {\n * // key is null if there is no matching key\n * }\n * ```\n */\n async getKeyByAltName(keyAltName) {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n return await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .findOne({ keyAltNames: keyAltName }, { readConcern: { level: 'majority' }, timeoutMS: this._timeoutMS });\n }\n /**\n * Adds a keyAltName to a key identified by the provided _id.\n *\n * This method resolves to/returns the *old* key value (prior to adding the new altKeyName).\n *\n * @param _id - The id of the document to update.\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // adding an keyAltName to a data key\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const keyAltName = 'keyAltName';\n * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName);\n * if (!oldKey) {\n * // null is returned if there is no matching document with an id matching the supplied id\n * }\n * ```\n */\n async addKeyAltName(_id, keyAltName) {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n const value = await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .findOneAndUpdate({ _id }, { $addToSet: { keyAltNames: keyAltName } }, { writeConcern: { w: 'majority' }, returnDocument: 'before', timeoutMS: this._timeoutMS });\n return value;\n }\n /**\n * Adds a keyAltName to a key identified by the provided _id.\n *\n * This method resolves to/returns the *old* key value (prior to removing the new altKeyName).\n *\n * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document.\n *\n * @param _id - The id of the document to update.\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // removing a key alt name from a data key\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const keyAltName = 'keyAltName';\n * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName);\n *\n * if (!oldKey) {\n * // null is returned if there is no matching document with an id matching the supplied id\n * }\n * ```\n */\n async removeKeyAltName(_id, keyAltName) {\n const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace);\n const pipeline = [\n {\n $set: {\n keyAltNames: {\n $cond: [\n {\n $eq: ['$keyAltNames', [keyAltName]]\n },\n '$$REMOVE',\n {\n $filter: {\n input: '$keyAltNames',\n cond: {\n $ne: ['$$this', keyAltName]\n }\n }\n }\n ]\n }\n }\n }\n ];\n const value = await this._keyVaultClient\n .db(dbName)\n .collection(collectionName)\n .findOneAndUpdate({ _id }, pipeline, {\n writeConcern: { w: 'majority' },\n returnDocument: 'before',\n timeoutMS: this._timeoutMS\n });\n return value;\n }\n /**\n * A convenience method for creating an encrypted collection.\n * This method will create data keys for any encryptedFields that do not have a `keyId` defined\n * and then create a new collection with the full set of encryptedFields.\n *\n * @param db - A Node.js driver Db object with which to create the collection\n * @param name - The name of the collection to be created\n * @param options - Options for createDataKey and for createCollection\n * @returns created collection and generated encryptedFields\n * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created.\n * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created.\n */\n async createEncryptedCollection(db, name, options) {\n const { provider, masterKey, createCollectionOptions: { encryptedFields: { ...encryptedFields }, ...createCollectionOptions } } = options;\n const timeoutContext = this._timeoutMS != null\n ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }))\n : undefined;\n if (Array.isArray(encryptedFields.fields)) {\n const createDataKeyPromises = encryptedFields.fields.map(async (field) => field == null || typeof field !== 'object' || field.keyId != null\n ? field\n : {\n ...field,\n keyId: await this.createDataKey(provider, {\n masterKey,\n // clone the timeoutContext\n // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations\n timeoutContext: timeoutContext?.csotEnabled() ? timeoutContext?.clone() : undefined\n })\n });\n const createDataKeyResolutions = await Promise.allSettled(createDataKeyPromises);\n encryptedFields.fields = createDataKeyResolutions.map((resolution, index) => resolution.status === 'fulfilled' ? resolution.value : encryptedFields.fields[index]);\n const rejection = createDataKeyResolutions.find((result) => result.status === 'rejected');\n if (rejection != null) {\n throw new errors_1.MongoCryptCreateDataKeyError(encryptedFields, { cause: rejection.reason });\n }\n }\n try {\n const collection = await db.createCollection(name, {\n ...createCollectionOptions,\n encryptedFields,\n timeoutMS: timeoutContext?.csotEnabled()\n ? timeoutContext?.getRemainingTimeMSOrThrow()\n : undefined\n });\n return { collection, encryptedFields };\n }\n catch (cause) {\n throw new errors_1.MongoCryptCreateEncryptedCollectionError(encryptedFields, { cause });\n }\n }\n /**\n * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must\n * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.\n *\n * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON\n * @param options -\n * @returns a Promise that either resolves with the encrypted value, or rejects with an error.\n *\n * @example\n * ```ts\n * // Encryption with async/await api\n * async function encryptMyData(value) {\n * const keyId = await clientEncryption.createDataKey('local');\n * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });\n * }\n * ```\n *\n * @example\n * ```ts\n * // Encryption using a keyAltName\n * async function encryptMyData(value) {\n * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' });\n * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });\n * }\n * ```\n */\n async encrypt(value, options) {\n return await this._encrypt(value, false, options);\n }\n /**\n * Encrypts a Match Expression or Aggregate Expression to query a range index.\n *\n * Only supported when queryType is \"range\" and algorithm is \"Range\".\n *\n * @param expression - a BSON document of one of the following forms:\n * 1. A Match Expression of this form:\n * `{$and: [{<field>: {$gt: <value1>}}, {<field>: {$lt: <value2> }}]}`\n * 2. An Aggregate Expression of this form:\n * `{$and: [{$gt: [<fieldpath>, <value1>]}, {$lt: [<fieldpath>, <value2>]}]}`\n *\n * `$gt` may also be `$gte`. `$lt` may also be `$lte`.\n *\n * @param options -\n * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error.\n */\n async encryptExpression(expression, options) {\n return await this._encrypt(expression, true, options);\n }\n /**\n * Explicitly decrypt a provided encrypted value\n *\n * @param value - An encrypted value\n * @returns a Promise that either resolves with the decrypted value, or rejects with an error\n *\n * @example\n * ```ts\n * // Decrypting value with async/await API\n * async function decryptMyValue(value) {\n * return clientEncryption.decrypt(value);\n * }\n * ```\n */\n async decrypt(value) {\n const valueBuffer = (0, bson_1.serialize)({ v: value });\n const context = this._mongoCrypt.makeExplicitDecryptionContext(valueBuffer);\n const stateMachine = new state_machine_1.StateMachine({\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: autoSelectSocketOptions(this._client.s.options)\n });\n const timeoutContext = this._timeoutMS != null\n ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }))\n : undefined;\n const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));\n return v;\n }\n /**\n * @internal\n * Ask the user for KMS credentials.\n *\n * This returns anything that looks like the kmsProviders original input\n * option. It can be empty, and any provider specified here will override\n * the original ones.\n */\n async askForKMSCredentials() {\n return await (0, index_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders);\n }\n static get libmongocryptVersion() {\n return ClientEncryption.getMongoCrypt().libmongocryptVersion;\n }\n /**\n * @internal\n * A helper that perform explicit encryption of values and expressions.\n * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must\n * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.\n *\n * @param value - The value that you wish to encrypt. Must be of a type that can be serialized into BSON\n * @param expressionMode - a boolean that indicates whether or not to encrypt the value as an expression\n * @param options - options to pass to encrypt\n * @returns the raw result of the call to stateMachine.execute(). When expressionMode is set to true, the return\n * value will be a bson document. When false, the value will be a BSON Binary.\n *\n */\n async _encrypt(value, expressionMode, options) {\n const { algorithm, keyId, keyAltName, contentionFactor, queryType, rangeOptions, textOptions } = options;\n const contextOptions = {\n expressionMode,\n algorithm\n };\n if (keyId) {\n contextOptions.keyId = keyId.buffer;\n }\n if (keyAltName) {\n if (keyId) {\n throw new errors_1.MongoCryptInvalidArgumentError(`\"options\" cannot contain both \"keyId\" and \"keyAltName\"`);\n }\n if (typeof keyAltName !== 'string') {\n throw new errors_1.MongoCryptInvalidArgumentError(`\"options.keyAltName\" must be of type string, but was of type ${typeof keyAltName}`);\n }\n contextOptions.keyAltName = (0, bson_1.serialize)({ keyAltName });\n }\n if (typeof contentionFactor === 'number' || typeof contentionFactor === 'bigint') {\n contextOptions.contentionFactor = contentionFactor;\n }\n if (typeof queryType === 'string') {\n contextOptions.queryType = queryType;\n }\n if (typeof rangeOptions === 'object') {\n contextOptions.rangeOptions = (0, bson_1.serialize)(rangeOptions);\n }\n if (typeof textOptions === 'object') {\n contextOptions.textOptions = (0, bson_1.serialize)(textOptions);\n }\n const valueBuffer = (0, bson_1.serialize)({ v: value });\n const stateMachine = new state_machine_1.StateMachine({\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: autoSelectSocketOptions(this._client.s.options)\n });\n const context = this._mongoCrypt.makeExplicitEncryptionContext(valueBuffer, contextOptions);\n const timeoutContext = this._timeoutMS != null\n ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS }))\n : undefined;\n const { v } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext }));\n return v;\n }\n}\nexports.ClientEncryption = ClientEncryption;\n/**\n * Get the socket options from the client.\n * @param baseOptions - The mongo client options.\n * @returns ClientEncryptionSocketOptions\n */\nfunction autoSelectSocketOptions(baseOptions) {\n const options = { autoSelectFamily: true };\n if ('autoSelectFamily' in baseOptions) {\n options.autoSelectFamily = baseOptions.autoSelectFamily;\n }\n if ('autoSelectFamilyAttemptTimeout' in baseOptions) {\n options.autoSelectFamilyAttemptTimeout = baseOptions.autoSelectFamilyAttemptTimeout;\n }\n return options;\n}\n//# sourceMappingURL=client_encryption.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,mBAAmB,KAAK;AAChC,SAAQ,0BAA0B;CAClC,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;;;;;CAKN,IAAM,mBAAN,MAAM,iBAAiB;;EAEnB,OAAO,gBAAgB;GACnB,MAAM,cAAc,GAAG,OAAO,6BAA6B;AAC3D,OAAI,kBAAkB,WAClB,OAAM,WAAW;AAErB,UAAO,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BtB,YAAY,QAAQ,SAAS;AACzB,QAAK,UAAU;AACf,QAAK,gBAAgB,QAAQ,gBAAgB,EAAE;AAC/C,QAAK,cAAc,QAAQ,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