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 +0,0 @@
1
- {"version":3,"file":"change_stream.mjs","names":["error"],"sources":["../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ChangeStream = void 0;\nconst collection_1 = require(\"./collection\");\nconst constants_1 = require(\"./constants\");\nconst abstract_cursor_1 = require(\"./cursor/abstract_cursor\");\nconst change_stream_cursor_1 = require(\"./cursor/change_stream_cursor\");\nconst db_1 = require(\"./db\");\nconst error_1 = require(\"./error\");\nconst mongo_client_1 = require(\"./mongo_client\");\nconst mongo_types_1 = require(\"./mongo_types\");\nconst resource_management_1 = require(\"./resource_management\");\nconst timeout_1 = require(\"./timeout\");\nconst utils_1 = require(\"./utils\");\nconst CHANGE_STREAM_OPTIONS = [\n 'resumeAfter',\n 'startAfter',\n 'startAtOperationTime',\n 'fullDocument',\n 'fullDocumentBeforeChange',\n 'showExpandedEvents'\n];\nconst CHANGE_DOMAIN_TYPES = {\n COLLECTION: Symbol('Collection'),\n DATABASE: Symbol('Database'),\n CLUSTER: Symbol('Cluster')\n};\nconst CHANGE_STREAM_EVENTS = [constants_1.RESUME_TOKEN_CHANGED, constants_1.END, constants_1.CLOSE];\nconst NO_RESUME_TOKEN_ERROR = 'A change stream document has been received that lacks a resume token (_id).';\nconst CHANGESTREAM_CLOSED_ERROR = 'ChangeStream is closed';\n/**\n * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.\n * @public\n */\nclass ChangeStream extends mongo_types_1.TypedEventEmitter {\n /** @internal */\n async asyncDispose() {\n await this.close();\n }\n /**\n * @internal\n *\n * @param parent - The parent object that created this change stream\n * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents\n */\n constructor(parent, pipeline = [], options = {}) {\n super();\n this.pipeline = pipeline;\n this.options = { ...options };\n let serverSelectionTimeoutMS;\n delete this.options.writeConcern;\n if (parent instanceof collection_1.Collection) {\n this.type = CHANGE_DOMAIN_TYPES.COLLECTION;\n serverSelectionTimeoutMS = parent.s.db.client.options.serverSelectionTimeoutMS;\n }\n else if (parent instanceof db_1.Db) {\n this.type = CHANGE_DOMAIN_TYPES.DATABASE;\n serverSelectionTimeoutMS = parent.client.options.serverSelectionTimeoutMS;\n }\n else if (parent instanceof mongo_client_1.MongoClient) {\n this.type = CHANGE_DOMAIN_TYPES.CLUSTER;\n serverSelectionTimeoutMS = parent.options.serverSelectionTimeoutMS;\n }\n else {\n throw new error_1.MongoChangeStreamError('Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient');\n }\n this.contextOwner = Symbol();\n this.parent = parent;\n this.namespace = parent.s.namespace;\n if (!this.options.readPreference && parent.readPreference) {\n this.options.readPreference = parent.readPreference;\n }\n // Create contained Change Stream cursor\n this.cursor = this._createChangeStreamCursor(options);\n this.isClosed = false;\n this.mode = false;\n // Listen for any `change` listeners being added to ChangeStream\n this.on('newListener', eventName => {\n if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) {\n this._streamEvents(this.cursor);\n }\n });\n this.on('removeListener', eventName => {\n if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) {\n this.cursorStream?.removeAllListeners('data');\n }\n });\n if (this.options.timeoutMS != null) {\n this.timeoutContext = new timeout_1.CSOTTimeoutContext({\n timeoutMS: this.options.timeoutMS,\n serverSelectionTimeoutMS\n });\n }\n }\n /** The cached resume token that is used to resume after the most recently returned change. */\n get resumeToken() {\n return this.cursor?.resumeToken;\n }\n /** Check if there is any document still available in the Change Stream */\n async hasNext() {\n this._setIsIterator();\n // Change streams must resume indefinitely while each resume event succeeds.\n // This loop continues until either a change event is received or until a resume attempt\n // fails.\n this.timeoutContext?.refresh();\n try {\n while (true) {\n try {\n const hasNext = await this.cursor.hasNext();\n return hasNext;\n }\n catch (error) {\n try {\n await this._processErrorIteratorMode(error, this.cursor.id != null);\n }\n catch (error) {\n if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) {\n throw error;\n }\n try {\n await this.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n throw error;\n }\n }\n }\n }\n finally {\n this.timeoutContext?.clear();\n }\n }\n /** Get the next available document from the Change Stream. */\n async next() {\n this._setIsIterator();\n // Change streams must resume indefinitely while each resume event succeeds.\n // This loop continues until either a change event is received or until a resume attempt\n // fails.\n this.timeoutContext?.refresh();\n try {\n while (true) {\n try {\n const change = await this.cursor.next();\n const processedChange = this._processChange(change ?? null);\n return processedChange;\n }\n catch (error) {\n try {\n await this._processErrorIteratorMode(error, this.cursor.id != null);\n }\n catch (error) {\n if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) {\n throw error;\n }\n try {\n await this.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n throw error;\n }\n }\n }\n }\n finally {\n this.timeoutContext?.clear();\n }\n }\n /**\n * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned\n */\n async tryNext() {\n this._setIsIterator();\n // Change streams must resume indefinitely while each resume event succeeds.\n // This loop continues until either a change event is received or until a resume attempt\n // fails.\n this.timeoutContext?.refresh();\n try {\n while (true) {\n try {\n const change = await this.cursor.tryNext();\n if (!change) {\n return null;\n }\n const processedChange = this._processChange(change);\n return processedChange;\n }\n catch (error) {\n try {\n await this._processErrorIteratorMode(error, this.cursor.id != null);\n }\n catch (error) {\n if (error instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null)\n throw error;\n try {\n await this.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n throw error;\n }\n }\n }\n }\n finally {\n this.timeoutContext?.clear();\n }\n }\n async *[Symbol.asyncIterator]() {\n if (this.closed) {\n return;\n }\n try {\n // Change streams run indefinitely as long as errors are resumable\n // So the only loop breaking condition is if `next()` throws\n while (true) {\n yield await this.next();\n }\n }\n finally {\n try {\n await this.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n }\n }\n /** Is the cursor closed */\n get closed() {\n return this.isClosed || this.cursor.closed;\n }\n /**\n * Frees the internal resources used by the change stream.\n */\n async close() {\n this.timeoutContext?.clear();\n this.timeoutContext = undefined;\n this.isClosed = true;\n const cursor = this.cursor;\n try {\n await cursor.close();\n }\n finally {\n this._endStream();\n }\n }\n /**\n * Return a modified Readable stream including a possible transform method.\n *\n * NOTE: When using a Stream to process change stream events, the stream will\n * NOT automatically resume in the case a resumable error is encountered.\n *\n * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed\n */\n stream(options) {\n if (this.closed) {\n throw new error_1.MongoChangeStreamError(CHANGESTREAM_CLOSED_ERROR);\n }\n this.streamOptions = options;\n return this.cursor.stream(options);\n }\n /** @internal */\n _setIsEmitter() {\n if (this.mode === 'iterator') {\n // TODO(NODE-3485): Replace with MongoChangeStreamModeError\n throw new error_1.MongoAPIError('ChangeStream cannot be used as an EventEmitter after being used as an iterator');\n }\n this.mode = 'emitter';\n }\n /** @internal */\n _setIsIterator() {\n if (this.mode === 'emitter') {\n // TODO(NODE-3485): Replace with MongoChangeStreamModeError\n throw new error_1.MongoAPIError('ChangeStream cannot be used as an iterator after being used as an EventEmitter');\n }\n this.mode = 'iterator';\n }\n /**\n * Create a new change stream cursor based on self's configuration\n * @internal\n */\n _createChangeStreamCursor(options) {\n const changeStreamStageOptions = (0, utils_1.filterOptions)(options, CHANGE_STREAM_OPTIONS);\n if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) {\n changeStreamStageOptions.allChangesForCluster = true;\n }\n const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline];\n const client = this.type === CHANGE_DOMAIN_TYPES.CLUSTER\n ? this.parent\n : this.type === CHANGE_DOMAIN_TYPES.DATABASE\n ? this.parent.client\n : this.type === CHANGE_DOMAIN_TYPES.COLLECTION\n ? this.parent.client\n : null;\n if (client == null) {\n // This should never happen because of the assertion in the constructor\n throw new error_1.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);\n }\n const changeStreamCursor = new change_stream_cursor_1.ChangeStreamCursor(client, this.namespace, pipeline, {\n ...options,\n timeoutContext: this.timeoutContext\n ? new abstract_cursor_1.CursorTimeoutContext(this.timeoutContext, this.contextOwner)\n : undefined\n });\n for (const event of CHANGE_STREAM_EVENTS) {\n changeStreamCursor.on(event, e => this.emit(event, e));\n }\n if (this.listenerCount(ChangeStream.CHANGE) > 0) {\n this._streamEvents(changeStreamCursor);\n }\n return changeStreamCursor;\n }\n /** @internal */\n _closeEmitterModeWithError(error) {\n this.emit(ChangeStream.ERROR, error);\n this.close().then(undefined, utils_1.squashError);\n }\n /** @internal */\n _streamEvents(cursor) {\n this._setIsEmitter();\n const stream = this.cursorStream ?? cursor.stream();\n this.cursorStream = stream;\n stream.on('data', change => {\n try {\n const processedChange = this._processChange(change);\n this.emit(ChangeStream.CHANGE, processedChange);\n }\n catch (error) {\n this.emit(ChangeStream.ERROR, error);\n }\n this.timeoutContext?.refresh();\n });\n stream.on('error', error => this._processErrorStreamMode(error, this.cursor.id != null));\n }\n /** @internal */\n _endStream() {\n this.cursorStream?.removeAllListeners('data');\n this.cursorStream?.removeAllListeners('close');\n this.cursorStream?.removeAllListeners('end');\n this.cursorStream?.destroy();\n this.cursorStream = undefined;\n }\n /** @internal */\n _processChange(change) {\n if (this.isClosed) {\n // TODO(NODE-3485): Replace with MongoChangeStreamClosedError\n throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR);\n }\n // a null change means the cursor has been notified, implicitly closing the change stream\n if (change == null) {\n // TODO(NODE-3485): Replace with MongoChangeStreamClosedError\n throw new error_1.MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR);\n }\n if (change && !change._id) {\n throw new error_1.MongoChangeStreamError(NO_RESUME_TOKEN_ERROR);\n }\n // cache the resume token\n this.cursor.cacheResumeToken(change._id);\n // wipe the startAtOperationTime if there was one so that there won't be a conflict\n // between resumeToken and startAtOperationTime if we need to reconnect the cursor\n this.options.startAtOperationTime = undefined;\n return change;\n }\n /** @internal */\n _processErrorStreamMode(changeStreamError, cursorInitialized) {\n // If the change stream has been closed explicitly, do not process error.\n if (this.isClosed)\n return;\n if (cursorInitialized &&\n ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) ||\n changeStreamError instanceof error_1.MongoOperationTimeoutError)) {\n this._endStream();\n this.cursor\n .close()\n .then(() => this._resume(changeStreamError), e => {\n (0, utils_1.squashError)(e);\n return this._resume(changeStreamError);\n })\n .then(() => {\n if (changeStreamError instanceof error_1.MongoOperationTimeoutError)\n this.emit(ChangeStream.ERROR, changeStreamError);\n }, () => this._closeEmitterModeWithError(changeStreamError));\n }\n else {\n this._closeEmitterModeWithError(changeStreamError);\n }\n }\n /** @internal */\n async _processErrorIteratorMode(changeStreamError, cursorInitialized) {\n if (this.isClosed) {\n // TODO(NODE-3485): Replace with MongoChangeStreamClosedError\n throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR);\n }\n if (cursorInitialized &&\n ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) ||\n changeStreamError instanceof error_1.MongoOperationTimeoutError)) {\n try {\n await this.cursor.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n await this._resume(changeStreamError);\n if (changeStreamError instanceof error_1.MongoOperationTimeoutError)\n throw changeStreamError;\n }\n else {\n try {\n await this.close();\n }\n catch (error) {\n (0, utils_1.squashError)(error);\n }\n throw changeStreamError;\n }\n }\n async _resume(changeStreamError) {\n this.timeoutContext?.refresh();\n const topology = (0, utils_1.getTopology)(this.parent);\n try {\n await topology.selectServer(this.cursor.readPreference, {\n operationName: 'reconnect topology in change stream',\n timeoutContext: this.timeoutContext\n });\n this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions);\n }\n catch {\n // if the topology can't reconnect, close the stream\n await this.close();\n throw changeStreamError;\n }\n }\n}\nexports.ChangeStream = ChangeStream;\n/** @event */\nChangeStream.RESPONSE = constants_1.RESPONSE;\n/** @event */\nChangeStream.MORE = constants_1.MORE;\n/** @event */\nChangeStream.INIT = constants_1.INIT;\n/** @event */\nChangeStream.CLOSE = constants_1.CLOSE;\n/**\n * Fired for each new matching change in the specified namespace. Attaching a `change`\n * event listener to a Change Stream will switch the stream into flowing mode. Data will\n * then be passed as soon as it is available.\n * @event\n */\nChangeStream.CHANGE = constants_1.CHANGE;\n/** @event */\nChangeStream.END = constants_1.END;\n/** @event */\nChangeStream.ERROR = constants_1.ERROR;\n/**\n * Emitted each time the change stream stores a new resume token.\n * @event\n */\nChangeStream.RESUME_TOKEN_CHANGED = constants_1.RESUME_TOKEN_CHANGED;\n(0, resource_management_1.configureResourceManagement)(ChangeStream.prototype);\n//# sourceMappingURL=change_stream.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,eAAe,KAAK;CAC5B,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,wBAAwB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACH;CACD,MAAM,sBAAsB;EACxB,YAAY,OAAO,aAAa;EAChC,UAAU,OAAO,WAAW;EAC5B,SAAS,OAAO,UAAU;EAC7B;CACD,MAAM,uBAAuB;EAAC,YAAY;EAAsB,YAAY;EAAK,YAAY;EAAM;CACnG,MAAM,wBAAwB;CAC9B,MAAM,4BAA4B;;;;;CAKlC,IAAM,eAAN,MAAM,qBAAqB,cAAc,kBAAkB;;EAEvD,MAAM,eAAe;AACjB,SAAM,KAAK,OAAO;;;;;;;;EAQtB,YAAY,QAAQ,WAAW,EAAE,EAAE,UAAU,EAAE,EAAE;AAC7C,UAAO;AACP,QAAK,WAAW;AAChB,QAAK,UAAU,EAAE,GAAG,SAAS;GAC7B,IAAI;AACJ,UAAO,KAAK,QAAQ;AACpB,OAAI,kBAAkB,aAAa,YAAY;AAC3C,SAAK,OAAO,oBAAoB;AAChC,+BAA2B,OAAO,EAAE,GAAG,OAAO,QAAQ;cAEjD,kBAAkB,KAAK,IAAI;AAChC,SAAK,OAAO,oBAAoB;AAChC,+BAA2B,OAAO,OAAO,QAAQ;cAE5C,kBAAkB,eAAe,aA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,YAAY;AAChD,EAAC,GAAG,sBAAsB,6BAA6B,aAAa,UAAU"}
@@ -1,234 +0,0 @@
1
- import { __commonJSMin, __require } from "../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_bson } from "../bson.mjs";
3
- import { require_error } from "../error.mjs";
4
- import { require_constants } from "../constants.mjs";
5
- import { require_utils } from "../utils.mjs";
6
- import { require_deps } from "../deps.mjs";
7
- import { require_crypto_callbacks } from "./crypto_callbacks.mjs";
8
- import { require_errors } from "./errors.mjs";
9
- import { require_providers } from "./providers/index.mjs";
10
- import { require_state_machine } from "./state_machine.mjs";
11
- import { require_client_encryption } from "./client_encryption.mjs";
12
- import { require_mongocryptd_manager } from "./mongocryptd_manager.mjs";
13
- import { require_mongo_client } from "../mongo_client.mjs";
14
-
15
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js
16
- var require_auto_encrypter = /* @__PURE__ */ __commonJSMin(((exports) => {
17
- var _a;
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.AutoEncrypter = exports.AutoEncryptionLoggerLevel = void 0;
20
- const net = __require("net");
21
- const bson_1 = require_bson();
22
- const constants_1 = require_constants();
23
- const deps_1 = require_deps();
24
- const error_1 = require_error();
25
- const mongo_client_1 = require_mongo_client();
26
- const utils_1 = require_utils();
27
- const client_encryption_1 = require_client_encryption();
28
- const cryptoCallbacks = require_crypto_callbacks();
29
- const errors_1 = require_errors();
30
- const mongocryptd_manager_1 = require_mongocryptd_manager();
31
- const providers_1 = require_providers();
32
- const state_machine_1 = require_state_machine();
33
- /** @public */
34
- exports.AutoEncryptionLoggerLevel = Object.freeze({
35
- FatalError: 0,
36
- Error: 1,
37
- Warning: 2,
38
- Info: 3,
39
- Trace: 4
40
- });
41
- /**
42
- * @internal An internal class to be used by the driver for auto encryption
43
- * **NOTE**: Not meant to be instantiated directly, this is for internal use only.
44
- */
45
- var AutoEncrypter = class AutoEncrypter {
46
- /** @internal */
47
- static getMongoCrypt() {
48
- const encryption = (0, deps_1.getMongoDBClientEncryption)();
49
- if ("kModuleError" in encryption) throw encryption.kModuleError;
50
- return encryption.MongoCrypt;
51
- }
52
- /**
53
- * Create an AutoEncrypter
54
- *
55
- * **Note**: Do not instantiate this class directly. Rather, supply the relevant options to a MongoClient
56
- *
57
- * **Note**: Supplying `options.schemaMap` provides more security than relying on JSON Schemas obtained from the server.
58
- * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending unencrypted data that should be encrypted.
59
- * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption.
60
- * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error.
61
- *
62
- * @example <caption>Create an AutoEncrypter that makes use of mongocryptd</caption>
63
- * ```ts
64
- * // Enabling autoEncryption via a MongoClient using mongocryptd
65
- * const { MongoClient } = require('mongodb');
66
- * const client = new MongoClient(URL, {
67
- * autoEncryption: {
68
- * kmsProviders: {
69
- * aws: {
70
- * accessKeyId: AWS_ACCESS_KEY,
71
- * secretAccessKey: AWS_SECRET_KEY
72
- * }
73
- * }
74
- * }
75
- * });
76
- * ```
77
- *
78
- * await client.connect();
79
- * // From here on, the client will be encrypting / decrypting automatically
80
- * @example <caption>Create an AutoEncrypter that makes use of libmongocrypt's CSFLE shared library</caption>
81
- * ```ts
82
- * // Enabling autoEncryption via a MongoClient using CSFLE shared library
83
- * const { MongoClient } = require('mongodb');
84
- * const client = new MongoClient(URL, {
85
- * autoEncryption: {
86
- * kmsProviders: {
87
- * aws: {}
88
- * },
89
- * extraOptions: {
90
- * cryptSharedLibPath: '/path/to/local/crypt/shared/lib',
91
- * cryptSharedLibRequired: true
92
- * }
93
- * }
94
- * });
95
- * ```
96
- *
97
- * await client.connect();
98
- * // From here on, the client will be encrypting / decrypting automatically
99
- */
100
- constructor(client, options) {
101
- /**
102
- * Used by devtools to enable decorating decryption results.
103
- *
104
- * When set and enabled, `decrypt` will automatically recursively
105
- * traverse a decrypted document and if a field has been decrypted,
106
- * it will mark it as decrypted. Compass uses this to determine which
107
- * fields were decrypted.
108
- */
109
- this[_a] = false;
110
- this._client = client;
111
- this._bypassEncryption = options.bypassAutoEncryption === true;
112
- this._keyVaultNamespace = options.keyVaultNamespace || "admin.datakeys";
113
- this._keyVaultClient = options.keyVaultClient || client;
114
- this._metaDataClient = options.metadataClient || client;
115
- this._proxyOptions = options.proxyOptions || {};
116
- this._tlsOptions = options.tlsOptions || {};
117
- this._kmsProviders = options.kmsProviders || {};
118
- this._credentialProviders = options.credentialProviders;
119
- if (options.credentialProviders?.aws && !(0, providers_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");
120
- const mongoCryptOptions = {
121
- enableMultipleCollinfo: true,
122
- cryptoCallbacks
123
- };
124
- if (options.schemaMap) mongoCryptOptions.schemaMap = Buffer.isBuffer(options.schemaMap) ? options.schemaMap : (0, bson_1.serialize)(options.schemaMap);
125
- if (options.encryptedFieldsMap) mongoCryptOptions.encryptedFieldsMap = Buffer.isBuffer(options.encryptedFieldsMap) ? options.encryptedFieldsMap : (0, bson_1.serialize)(options.encryptedFieldsMap);
126
- mongoCryptOptions.kmsProviders = !Buffer.isBuffer(this._kmsProviders) ? (0, bson_1.serialize)(this._kmsProviders) : this._kmsProviders;
127
- if (options.options?.logger) mongoCryptOptions.logger = options.options.logger;
128
- if (options.extraOptions && options.extraOptions.cryptSharedLibPath) mongoCryptOptions.cryptSharedLibPath = options.extraOptions.cryptSharedLibPath;
129
- if (options.bypassQueryAnalysis) mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis;
130
- if (options.keyExpirationMS != null) mongoCryptOptions.keyExpirationMS = options.keyExpirationMS;
131
- this._bypassMongocryptdAndCryptShared = this._bypassEncryption || !!options.bypassQueryAnalysis;
132
- if (options.extraOptions && options.extraOptions.cryptSharedLibSearchPaths) mongoCryptOptions.cryptSharedLibSearchPaths = options.extraOptions.cryptSharedLibSearchPaths;
133
- else if (!this._bypassMongocryptdAndCryptShared) mongoCryptOptions.cryptSharedLibSearchPaths = ["$SYSTEM"];
134
- this._mongocrypt = new (AutoEncrypter.getMongoCrypt())(mongoCryptOptions);
135
- this._contextCounter = 0;
136
- if (options.extraOptions && options.extraOptions.cryptSharedLibRequired && !this.cryptSharedLibVersionInfo) throw new errors_1.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded");
137
- if (!this._bypassMongocryptdAndCryptShared && !this.cryptSharedLibVersionInfo) {
138
- this._mongocryptdManager = new mongocryptd_manager_1.MongocryptdManager(options.extraOptions);
139
- const clientOptions = { serverSelectionTimeoutMS: 1e4 };
140
- if ((options.extraOptions == null || typeof options.extraOptions.mongocryptdURI !== "string") && !net.getDefaultAutoSelectFamily) clientOptions.family = 4;
141
- if (net.getDefaultAutoSelectFamily) Object.assign(clientOptions, (0, client_encryption_1.autoSelectSocketOptions)(this._client.s?.options ?? {}));
142
- this._mongocryptdClient = new mongo_client_1.MongoClient(this._mongocryptdManager.uri, clientOptions);
143
- }
144
- }
145
- /**
146
- * Initializes the auto encrypter by spawning a mongocryptd and connecting to it.
147
- *
148
- * This function is a no-op when bypassSpawn is set or the crypt shared library is used.
149
- */
150
- async init() {
151
- if (this._bypassMongocryptdAndCryptShared || this.cryptSharedLibVersionInfo) return;
152
- if (!this._mongocryptdManager) throw new error_1.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.");
153
- if (!this._mongocryptdClient) throw new error_1.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.");
154
- if (!this._mongocryptdManager.bypassSpawn) await this._mongocryptdManager.spawn();
155
- try {
156
- return await this._mongocryptdClient.connect();
157
- } catch (error) {
158
- throw new error_1.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn", { cause: error });
159
- }
160
- }
161
- /**
162
- * Cleans up the `_mongocryptdClient`, if present.
163
- */
164
- async close() {
165
- await this._mongocryptdClient?.close();
166
- }
167
- /**
168
- * Encrypt a command for a given namespace.
169
- */
170
- async encrypt(ns, cmd, options = {}) {
171
- options.signal?.throwIfAborted();
172
- if (this._bypassEncryption) return cmd;
173
- const commandBuffer = Buffer.isBuffer(cmd) ? cmd : (0, bson_1.serialize)(cmd, options);
174
- const context = this._mongocrypt.makeEncryptionContext(utils_1.MongoDBCollectionNamespace.fromString(ns).db, commandBuffer);
175
- context.id = this._contextCounter++;
176
- context.ns = ns;
177
- context.document = cmd;
178
- const stateMachine = new state_machine_1.StateMachine({
179
- promoteValues: false,
180
- promoteLongs: false,
181
- proxyOptions: this._proxyOptions,
182
- tlsOptions: this._tlsOptions,
183
- socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options)
184
- });
185
- return (0, bson_1.deserialize)(await stateMachine.execute(this, context, options), {
186
- promoteValues: false,
187
- promoteLongs: false
188
- });
189
- }
190
- /**
191
- * Decrypt a command response
192
- */
193
- async decrypt(response, options = {}) {
194
- options.signal?.throwIfAborted();
195
- const context = this._mongocrypt.makeDecryptionContext(response);
196
- context.id = this._contextCounter++;
197
- return await new state_machine_1.StateMachine({
198
- ...options,
199
- proxyOptions: this._proxyOptions,
200
- tlsOptions: this._tlsOptions,
201
- socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options)
202
- }).execute(this, context, options);
203
- }
204
- /**
205
- * Ask the user for KMS credentials.
206
- *
207
- * This returns anything that looks like the kmsProviders original input
208
- * option. It can be empty, and any provider specified here will override
209
- * the original ones.
210
- */
211
- async askForKMSCredentials() {
212
- return await (0, providers_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders);
213
- }
214
- /**
215
- * Return the current libmongocrypt's CSFLE shared library version
216
- * as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE
217
- * shared library was loaded.
218
- */
219
- get cryptSharedLibVersionInfo() {
220
- return this._mongocrypt.cryptSharedLibVersionInfo;
221
- }
222
- static get libmongocryptVersion() {
223
- return AutoEncrypter.getMongoCrypt().libmongocryptVersion;
224
- }
225
- };
226
- exports.AutoEncrypter = AutoEncrypter;
227
- _a = constants_1.kDecorateResult;
228
- }));
229
-
230
- //#endregion
231
- export default require_auto_encrypter();
232
-
233
- export { require_auto_encrypter };
234
- //# sourceMappingURL=auto_encrypter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auto_encrypter.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js"],"sourcesContent":["\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutoEncrypter = exports.AutoEncryptionLoggerLevel = void 0;\nconst net = require(\"net\");\nconst bson_1 = require(\"../bson\");\nconst constants_1 = require(\"../constants\");\nconst deps_1 = require(\"../deps\");\nconst error_1 = require(\"../error\");\nconst mongo_client_1 = require(\"../mongo_client\");\nconst utils_1 = require(\"../utils\");\nconst client_encryption_1 = require(\"./client_encryption\");\nconst cryptoCallbacks = require(\"./crypto_callbacks\");\nconst errors_1 = require(\"./errors\");\nconst mongocryptd_manager_1 = require(\"./mongocryptd_manager\");\nconst providers_1 = require(\"./providers\");\nconst state_machine_1 = require(\"./state_machine\");\n/** @public */\nexports.AutoEncryptionLoggerLevel = Object.freeze({\n FatalError: 0,\n Error: 1,\n Warning: 2,\n Info: 3,\n Trace: 4\n});\n/**\n * @internal An internal class to be used by the driver for auto encryption\n * **NOTE**: Not meant to be instantiated directly, this is for internal use only.\n */\nclass AutoEncrypter {\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 an AutoEncrypter\n *\n * **Note**: Do not instantiate this class directly. Rather, supply the relevant options to a MongoClient\n *\n * **Note**: Supplying `options.schemaMap` provides more security than relying on JSON Schemas obtained from the server.\n * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending unencrypted data that should be encrypted.\n * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption.\n * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error.\n *\n * @example <caption>Create an AutoEncrypter that makes use of mongocryptd</caption>\n * ```ts\n * // Enabling autoEncryption via a MongoClient using mongocryptd\n * const { MongoClient } = require('mongodb');\n * const client = new MongoClient(URL, {\n * autoEncryption: {\n * kmsProviders: {\n * aws: {\n * accessKeyId: AWS_ACCESS_KEY,\n * secretAccessKey: AWS_SECRET_KEY\n * }\n * }\n * }\n * });\n * ```\n *\n * await client.connect();\n * // From here on, the client will be encrypting / decrypting automatically\n * @example <caption>Create an AutoEncrypter that makes use of libmongocrypt's CSFLE shared library</caption>\n * ```ts\n * // Enabling autoEncryption via a MongoClient using CSFLE shared library\n * const { MongoClient } = require('mongodb');\n * const client = new MongoClient(URL, {\n * autoEncryption: {\n * kmsProviders: {\n * aws: {}\n * },\n * extraOptions: {\n * cryptSharedLibPath: '/path/to/local/crypt/shared/lib',\n * cryptSharedLibRequired: true\n * }\n * }\n * });\n * ```\n *\n * await client.connect();\n * // From here on, the client will be encrypting / decrypting automatically\n */\n constructor(client, options) {\n /**\n * Used by devtools to enable decorating decryption results.\n *\n * When set and enabled, `decrypt` will automatically recursively\n * traverse a decrypted document and if a field has been decrypted,\n * it will mark it as decrypted. Compass uses this to determine which\n * fields were decrypted.\n */\n this[_a] = false;\n this._client = client;\n this._bypassEncryption = options.bypassAutoEncryption === true;\n this._keyVaultNamespace = options.keyVaultNamespace || 'admin.datakeys';\n this._keyVaultClient = options.keyVaultClient || client;\n this._metaDataClient = options.metadataClient || client;\n this._proxyOptions = options.proxyOptions || {};\n this._tlsOptions = options.tlsOptions || {};\n this._kmsProviders = options.kmsProviders || {};\n this._credentialProviders = options.credentialProviders;\n if (options.credentialProviders?.aws && !(0, providers_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 const mongoCryptOptions = {\n enableMultipleCollinfo: true,\n cryptoCallbacks\n };\n if (options.schemaMap) {\n mongoCryptOptions.schemaMap = Buffer.isBuffer(options.schemaMap)\n ? options.schemaMap\n : (0, bson_1.serialize)(options.schemaMap);\n }\n if (options.encryptedFieldsMap) {\n mongoCryptOptions.encryptedFieldsMap = Buffer.isBuffer(options.encryptedFieldsMap)\n ? options.encryptedFieldsMap\n : (0, bson_1.serialize)(options.encryptedFieldsMap);\n }\n mongoCryptOptions.kmsProviders = !Buffer.isBuffer(this._kmsProviders)\n ? (0, bson_1.serialize)(this._kmsProviders)\n : this._kmsProviders;\n if (options.options?.logger) {\n mongoCryptOptions.logger = options.options.logger;\n }\n if (options.extraOptions && options.extraOptions.cryptSharedLibPath) {\n mongoCryptOptions.cryptSharedLibPath = options.extraOptions.cryptSharedLibPath;\n }\n if (options.bypassQueryAnalysis) {\n mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis;\n }\n if (options.keyExpirationMS != null) {\n mongoCryptOptions.keyExpirationMS = options.keyExpirationMS;\n }\n this._bypassMongocryptdAndCryptShared = this._bypassEncryption || !!options.bypassQueryAnalysis;\n if (options.extraOptions && options.extraOptions.cryptSharedLibSearchPaths) {\n // Only for driver testing\n mongoCryptOptions.cryptSharedLibSearchPaths = options.extraOptions.cryptSharedLibSearchPaths;\n }\n else if (!this._bypassMongocryptdAndCryptShared) {\n mongoCryptOptions.cryptSharedLibSearchPaths = ['$SYSTEM'];\n }\n const MongoCrypt = AutoEncrypter.getMongoCrypt();\n this._mongocrypt = new MongoCrypt(mongoCryptOptions);\n this._contextCounter = 0;\n if (options.extraOptions &&\n options.extraOptions.cryptSharedLibRequired &&\n !this.cryptSharedLibVersionInfo) {\n throw new errors_1.MongoCryptInvalidArgumentError('`cryptSharedLibRequired` set but no crypt_shared library loaded');\n }\n // Only instantiate mongocryptd manager/client once we know for sure\n // that we are not using the CSFLE shared library.\n if (!this._bypassMongocryptdAndCryptShared && !this.cryptSharedLibVersionInfo) {\n this._mongocryptdManager = new mongocryptd_manager_1.MongocryptdManager(options.extraOptions);\n const clientOptions = {\n serverSelectionTimeoutMS: 10000\n };\n if ((options.extraOptions == null || typeof options.extraOptions.mongocryptdURI !== 'string') &&\n !net.getDefaultAutoSelectFamily) {\n // Only set family if autoSelectFamily options are not supported.\n clientOptions.family = 4;\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: TS complains as this always returns true on versions where it is present.\n if (net.getDefaultAutoSelectFamily) {\n // AutoEncrypter is made inside of MongoClient constructor while options are being parsed,\n // we do not have access to the options that are in progress.\n // TODO(NODE-6449): AutoEncrypter does not use client options for autoSelectFamily\n Object.assign(clientOptions, (0, client_encryption_1.autoSelectSocketOptions)(this._client.s?.options ?? {}));\n }\n this._mongocryptdClient = new mongo_client_1.MongoClient(this._mongocryptdManager.uri, clientOptions);\n }\n }\n /**\n * Initializes the auto encrypter by spawning a mongocryptd and connecting to it.\n *\n * This function is a no-op when bypassSpawn is set or the crypt shared library is used.\n */\n async init() {\n if (this._bypassMongocryptdAndCryptShared || this.cryptSharedLibVersionInfo) {\n return;\n }\n if (!this._mongocryptdManager) {\n throw new error_1.MongoRuntimeError('Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified.');\n }\n if (!this._mongocryptdClient) {\n throw new error_1.MongoRuntimeError('Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified.');\n }\n if (!this._mongocryptdManager.bypassSpawn) {\n await this._mongocryptdManager.spawn();\n }\n try {\n const client = await this._mongocryptdClient.connect();\n return client;\n }\n catch (error) {\n throw new error_1.MongoRuntimeError('Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn', { cause: error });\n }\n }\n /**\n * Cleans up the `_mongocryptdClient`, if present.\n */\n async close() {\n await this._mongocryptdClient?.close();\n }\n /**\n * Encrypt a command for a given namespace.\n */\n async encrypt(ns, cmd, options = {}) {\n options.signal?.throwIfAborted();\n if (this._bypassEncryption) {\n // If `bypassAutoEncryption` has been specified, don't encrypt\n return cmd;\n }\n const commandBuffer = Buffer.isBuffer(cmd) ? cmd : (0, bson_1.serialize)(cmd, options);\n const context = this._mongocrypt.makeEncryptionContext(utils_1.MongoDBCollectionNamespace.fromString(ns).db, commandBuffer);\n context.id = this._contextCounter++;\n context.ns = ns;\n context.document = cmd;\n const stateMachine = new state_machine_1.StateMachine({\n promoteValues: false,\n promoteLongs: false,\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options)\n });\n return (0, bson_1.deserialize)(await stateMachine.execute(this, context, options), {\n promoteValues: false,\n promoteLongs: false\n });\n }\n /**\n * Decrypt a command response\n */\n async decrypt(response, options = {}) {\n options.signal?.throwIfAborted();\n const context = this._mongocrypt.makeDecryptionContext(response);\n context.id = this._contextCounter++;\n const stateMachine = new state_machine_1.StateMachine({\n ...options,\n proxyOptions: this._proxyOptions,\n tlsOptions: this._tlsOptions,\n socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options)\n });\n return await stateMachine.execute(this, context, options);\n }\n /**\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, providers_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders);\n }\n /**\n * Return the current libmongocrypt's CSFLE shared library version\n * as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE\n * shared library was loaded.\n */\n get cryptSharedLibVersionInfo() {\n return this._mongocrypt.cryptSharedLibVersionInfo;\n }\n static get libmongocryptVersion() {\n return AutoEncrypter.getMongoCrypt().libmongocryptVersion;\n }\n}\nexports.AutoEncrypter = AutoEncrypter;\n_a = constants_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