pecunia-root 0.1.1 → 0.1.3

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 (328) 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/context/index.mjs +1 -1
  5. package/dist/context/index.mjs.map +1 -1
  6. package/dist/index.d.mts +1 -2
  7. package/dist/index.mjs +1 -2
  8. package/package.json +2 -16
  9. package/dist/_virtual/rolldown_runtime.mjs +0 -8
  10. package/dist/adapters/mongodb-adapter/index.d.mts +0 -35
  11. package/dist/adapters/mongodb-adapter/index.mjs +0 -314
  12. package/dist/adapters/mongodb-adapter/index.mjs.map +0 -1
  13. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +0 -14
  14. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +0 -1
  15. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +0 -54
  16. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +0 -1
  17. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +0 -36
  18. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +0 -1
  19. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +0 -27
  20. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +0 -1
  21. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +0 -3728
  22. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +0 -1
  23. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +0 -137
  24. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/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/index.mjs +0 -211
  26. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +0 -1
  27. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +0 -95
  28. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +0 -1
  29. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +0 -158
  30. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +0 -1
  31. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +0 -195
  32. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +0 -1
  33. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +0 -710
  34. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +0 -1
  35. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +0 -53
  36. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +0 -1
  37. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +0 -63
  38. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +0 -1
  39. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +0 -368
  40. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +0 -1
  41. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +0 -234
  42. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +0 -1
  43. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +0 -545
  44. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +0 -1
  45. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +0 -83
  46. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +0 -1
  47. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +0 -146
  48. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +0 -1
  49. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +0 -58
  50. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +0 -30
  52. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +0 -1
  53. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +0 -135
  54. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +0 -1
  55. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +0 -25
  56. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +0 -47
  58. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +0 -1
  59. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +0 -362
  60. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +0 -1
  61. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +0 -58
  62. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +0 -123
  64. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +0 -1
  65. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +0 -128
  66. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +0 -1
  67. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +0 -133
  68. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +0 -126
  70. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +0 -1
  71. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +0 -79
  72. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +0 -1
  73. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +0 -65
  74. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +0 -127
  76. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +0 -47
  78. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +0 -44
  80. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +0 -101
  82. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +0 -33
  84. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +0 -53
  86. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +0 -29
  88. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +0 -83
  90. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +0 -1
  91. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +0 -36
  92. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +0 -32
  94. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +0 -206
  96. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +0 -1
  97. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +0 -45
  98. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +0 -213
  100. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +0 -411
  102. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +0 -1
  103. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +0 -288
  104. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +0 -423
  106. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +0 -483
  108. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +0 -1
  109. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +0 -207
  110. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +0 -116
  112. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +0 -1
  113. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +0 -183
  114. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +0 -1
  115. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +0 -55
  116. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +0 -1
  117. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +0 -60
  118. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +0 -1
  119. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +0 -139
  120. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +0 -1
  121. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +0 -28
  122. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +0 -1
  123. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +0 -117
  124. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +0 -1
  125. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +0 -182
  126. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +0 -1
  127. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +0 -304
  128. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +0 -1
  129. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +0 -34
  130. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +0 -1
  131. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +0 -739
  132. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +0 -1
  133. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +0 -805
  134. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +0 -1
  135. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +0 -174
  136. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +0 -1
  137. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +0 -726
  138. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +0 -1
  139. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +0 -172
  140. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +0 -1
  141. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +0 -103
  142. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +0 -1
  143. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +0 -66
  144. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +0 -1
  145. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +0 -41
  146. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +0 -1
  147. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +0 -365
  148. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +0 -1
  149. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +0 -50
  150. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +0 -1
  151. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +0 -48
  152. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +0 -1
  153. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +0 -23
  154. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +0 -1
  155. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +0 -106
  156. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +0 -1
  157. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +0 -428
  158. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +0 -1
  159. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +0 -124
  160. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +0 -1
  161. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +0 -95
  162. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +0 -1
  163. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +0 -1305
  164. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +0 -1
  165. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +0 -59
  166. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +0 -1
  167. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +0 -250
  168. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +0 -1
  169. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +0 -170
  170. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +0 -1
  171. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +0 -315
  172. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +0 -1
  173. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +0 -925
  174. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +0 -1
  175. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +0 -520
  176. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +0 -1
  177. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +0 -90
  178. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +0 -1
  179. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +0 -582
  180. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +0 -1
  181. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +0 -64
  182. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +0 -1
  183. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +0 -86
  184. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +0 -1
  185. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +0 -60
  186. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +0 -1
  187. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +0 -264
  188. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +0 -1
  189. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +0 -109
  190. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +0 -1
  191. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +0 -172
  192. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +0 -1
  193. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +0 -68
  194. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +0 -1
  195. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +0 -53
  196. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +0 -1
  197. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +0 -123
  198. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +0 -1
  199. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +0 -119
  200. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +0 -1
  201. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +0 -65
  202. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +0 -1
  203. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +0 -97
  204. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +0 -1
  205. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +0 -47
  206. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +0 -1
  207. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +0 -188
  208. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +0 -1
  209. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +0 -103
  210. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +0 -1
  211. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +0 -136
  212. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +0 -1
  213. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +0 -61
  214. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +0 -1
  215. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +0 -179
  216. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +0 -1
  217. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +0 -77
  218. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +0 -1
  219. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +0 -48
  220. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +0 -1
  221. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +0 -60
  222. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +0 -1
  223. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +0 -43
  224. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +0 -1
  225. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +0 -105
  226. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +0 -1
  227. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +0 -50
  228. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +0 -1
  229. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +0 -39
  230. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +0 -1
  231. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +0 -49
  232. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +0 -1
  233. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +0 -58
  234. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +0 -1
  235. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +0 -46
  236. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +0 -1
  237. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +0 -48
  238. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +0 -1
  239. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +0 -46
  240. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +0 -1
  241. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +0 -67
  242. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +0 -1
  243. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +0 -37
  244. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +0 -1
  245. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +0 -171
  246. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +0 -1
  247. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +0 -45
  248. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +0 -1
  249. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +0 -71
  250. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +0 -1
  251. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +0 -165
  252. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +0 -62
  254. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +0 -1
  255. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +0 -51
  256. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +0 -1
  257. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +0 -156
  258. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +0 -477
  260. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +0 -1
  261. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +0 -315
  262. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +0 -1
  263. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +0 -157
  264. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +0 -184
  266. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +0 -1
  267. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +0 -96
  268. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +0 -1
  269. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +0 -107
  270. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +0 -540
  272. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +0 -1
  273. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +0 -298
  274. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +0 -1
  275. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +0 -623
  276. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +0 -91
  278. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +0 -1
  279. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +0 -254
  280. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +0 -1
  281. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +0 -138
  282. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +0 -993
  284. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +0 -1
  285. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +0 -81
  286. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +0 -1
  287. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +0 -171
  288. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +0 -295
  290. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +0 -1
  291. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +0 -81
  292. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +0 -1
  293. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +0 -206
  294. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +0 -33590
  296. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +0 -1
  297. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +0 -37
  298. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +0 -1
  299. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +0 -18
  300. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +0 -1
  301. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +0 -252
  302. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +0 -1
  303. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +0 -41
  304. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +0 -1
  305. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +0 -41
  306. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +0 -1
  307. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +0 -173
  308. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +0 -1
  309. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +0 -334
  310. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +0 -1
  311. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +0 -90
  312. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +0 -1
  313. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +0 -356
  314. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +0 -1
  315. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +0 -23
  316. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +0 -1
  317. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +0 -29
  318. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +0 -1
  319. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +0 -140
  320. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +0 -1
  321. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +0 -831
  322. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +0 -1
  323. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +0 -77
  324. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +0 -1
  325. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +0 -147
  326. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +0 -1
  327. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +0 -17
  328. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +0 -1
@@ -1,315 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_error } from "../error.mjs";
3
- import { require_common } from "./common.mjs";
4
- import { require_server_selection } from "./server_selection.mjs";
5
- import { require_constants } from "../constants.mjs";
6
- import { require_write_concern } from "../write_concern.mjs";
7
- import { require_utils } from "../utils.mjs";
8
- import { require_aggregate } from "../operations/aggregate.mjs";
9
- import { require_mongo_types } from "../mongo_types.mjs";
10
- import { require_transactions } from "../transactions.mjs";
11
- import { require_server_description } from "./server_description.mjs";
12
- import { require_connection } from "../cmap/connection.mjs";
13
- import { require_errors } from "../cmap/errors.mjs";
14
- import { require_connection_pool } from "../cmap/connection_pool.mjs";
15
- import { require_monitor } from "./monitor.mjs";
16
-
17
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.js
18
- var require_server = /* @__PURE__ */ __commonJSMin(((exports) => {
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.Server = void 0;
21
- const connection_1 = require_connection();
22
- const connection_pool_1 = require_connection_pool();
23
- const errors_1 = require_errors();
24
- const constants_1 = require_constants();
25
- const error_1 = require_error();
26
- const mongo_types_1 = require_mongo_types();
27
- const aggregate_1 = require_aggregate();
28
- const transactions_1 = require_transactions();
29
- const utils_1 = require_utils();
30
- const write_concern_1 = require_write_concern();
31
- const common_1 = require_common();
32
- const monitor_1 = require_monitor();
33
- const server_description_1 = require_server_description();
34
- const server_selection_1 = require_server_selection();
35
- const stateTransition = (0, utils_1.makeStateMachine)({
36
- [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING],
37
- [common_1.STATE_CONNECTING]: [
38
- common_1.STATE_CONNECTING,
39
- common_1.STATE_CLOSING,
40
- common_1.STATE_CONNECTED,
41
- common_1.STATE_CLOSED
42
- ],
43
- [common_1.STATE_CONNECTED]: [
44
- common_1.STATE_CONNECTED,
45
- common_1.STATE_CLOSING,
46
- common_1.STATE_CLOSED
47
- ],
48
- [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED]
49
- });
50
- /** @internal */
51
- var Server = class Server extends mongo_types_1.TypedEventEmitter {
52
- /**
53
- * Create a server
54
- */
55
- constructor(topology, description, options) {
56
- super();
57
- this.on("error", utils_1.noop);
58
- this.serverApi = options.serverApi;
59
- const poolOptions = {
60
- hostAddress: description.hostAddress,
61
- ...options
62
- };
63
- this.topology = topology;
64
- this.pool = new connection_pool_1.ConnectionPool(this, poolOptions);
65
- this.s = {
66
- description,
67
- options,
68
- state: common_1.STATE_CLOSED,
69
- operationCount: 0
70
- };
71
- for (const event of [...constants_1.CMAP_EVENTS, ...constants_1.APM_EVENTS]) this.pool.on(event, (e) => this.emit(event, e));
72
- this.pool.on(connection_1.Connection.CLUSTER_TIME_RECEIVED, (clusterTime) => {
73
- this.clusterTime = clusterTime;
74
- });
75
- if (this.loadBalanced) {
76
- this.monitor = null;
77
- return;
78
- }
79
- this.monitor = new monitor_1.Monitor(this, this.s.options);
80
- for (const event of constants_1.HEARTBEAT_EVENTS) this.monitor.on(event, (e) => this.emit(event, e));
81
- this.monitor.on("resetServer", (error) => markServerUnknown(this, error));
82
- this.monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event) => {
83
- this.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(this.description.hostAddress, event.reply, {
84
- roundTripTime: this.monitor?.roundTripTime,
85
- minRoundTripTime: this.monitor?.minRoundTripTime
86
- }));
87
- if (this.s.state === common_1.STATE_CONNECTING) {
88
- stateTransition(this, common_1.STATE_CONNECTED);
89
- this.emit(Server.CONNECT, this);
90
- }
91
- });
92
- }
93
- get clusterTime() {
94
- return this.topology.clusterTime;
95
- }
96
- set clusterTime(clusterTime) {
97
- this.topology.clusterTime = clusterTime;
98
- }
99
- get description() {
100
- return this.s.description;
101
- }
102
- get name() {
103
- return this.s.description.address;
104
- }
105
- get autoEncrypter() {
106
- if (this.s.options && this.s.options.autoEncrypter) return this.s.options.autoEncrypter;
107
- }
108
- get loadBalanced() {
109
- return this.topology.description.type === common_1.TopologyType.LoadBalanced;
110
- }
111
- /**
112
- * Initiate server connect
113
- */
114
- connect() {
115
- if (this.s.state !== common_1.STATE_CLOSED) return;
116
- stateTransition(this, common_1.STATE_CONNECTING);
117
- if (!this.loadBalanced) this.monitor?.connect();
118
- else {
119
- stateTransition(this, common_1.STATE_CONNECTED);
120
- this.emit(Server.CONNECT, this);
121
- }
122
- }
123
- closeCheckedOutConnections() {
124
- return this.pool.closeCheckedOutConnections();
125
- }
126
- /** Destroy the server connection */
127
- close() {
128
- if (this.s.state === common_1.STATE_CLOSED) return;
129
- stateTransition(this, common_1.STATE_CLOSING);
130
- if (!this.loadBalanced) this.monitor?.close();
131
- this.pool.close();
132
- stateTransition(this, common_1.STATE_CLOSED);
133
- this.emit("closed");
134
- }
135
- /**
136
- * Immediately schedule monitoring of this server. If there already an attempt being made
137
- * this will be a no-op.
138
- */
139
- requestCheck() {
140
- if (!this.loadBalanced) this.monitor?.requestCheck();
141
- }
142
- async command(operation, timeoutContext) {
143
- if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) throw new error_1.MongoServerClosedError();
144
- const session = operation.session;
145
- let conn = session?.pinnedConnection;
146
- this.incrementOperationCount();
147
- if (conn == null) try {
148
- conn = await this.pool.checkOut({
149
- timeoutContext,
150
- signal: operation.options.signal
151
- });
152
- } catch (checkoutError) {
153
- this.decrementOperationCount();
154
- if (!(checkoutError instanceof errors_1.PoolClearedError)) this.handleError(checkoutError);
155
- throw checkoutError;
156
- }
157
- let reauthPromise = null;
158
- const cleanup = () => {
159
- this.decrementOperationCount();
160
- if (session?.pinnedConnection !== conn) if (reauthPromise != null) {
161
- const checkBackIn = () => {
162
- this.pool.checkIn(conn);
163
- };
164
- reauthPromise.then(checkBackIn, checkBackIn);
165
- } else this.pool.checkIn(conn);
166
- };
167
- let cmd;
168
- try {
169
- cmd = operation.buildCommand(conn, session);
170
- } catch (e) {
171
- cleanup();
172
- throw e;
173
- }
174
- const options = operation.buildOptions(timeoutContext);
175
- const ns = operation.ns;
176
- if (this.loadBalanced && isPinnableCommand(cmd, session) && !session?.pinnedConnection) session?.pin(conn);
177
- options.directConnection = this.topology.s.options.directConnection;
178
- if (operation instanceof aggregate_1.AggregateOperation && operation.hasWriteStage && (0, utils_1.maxWireVersion)(conn) < server_selection_1.MIN_SECONDARY_WRITE_WIRE_VERSION) delete options.readPreference;
179
- if (this.description.iscryptd) options.omitMaxTimeMS = true;
180
- try {
181
- try {
182
- const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE);
183
- (0, write_concern_1.throwIfWriteConcernError)(res);
184
- return res;
185
- } catch (commandError) {
186
- throw this.decorateCommandError(conn, cmd, options, commandError);
187
- }
188
- } catch (operationError) {
189
- if (operationError instanceof error_1.MongoError && operationError.code === error_1.MONGODB_ERROR_CODES.Reauthenticate) {
190
- reauthPromise = this.pool.reauthenticate(conn);
191
- reauthPromise.then(void 0, (error) => {
192
- reauthPromise = null;
193
- (0, utils_1.squashError)(error);
194
- });
195
- await (0, utils_1.abortable)(reauthPromise, options);
196
- reauthPromise = null;
197
- try {
198
- const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE);
199
- (0, write_concern_1.throwIfWriteConcernError)(res);
200
- return res;
201
- } catch (commandError) {
202
- throw this.decorateCommandError(conn, cmd, options, commandError);
203
- }
204
- } else throw operationError;
205
- } finally {
206
- cleanup();
207
- }
208
- }
209
- /**
210
- * Handle SDAM error
211
- * @internal
212
- */
213
- handleError(error, connection) {
214
- if (!(error instanceof error_1.MongoError)) return;
215
- if (error.connectionGeneration && error.connectionGeneration < this.pool.generation) return;
216
- const isNetworkNonTimeoutError = error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError);
217
- const isNetworkTimeoutBeforeHandshakeError = error instanceof error_1.MongoNetworkError && error.beforeHandshake;
218
- const isAuthHandshakeError = error.hasErrorLabel(error_1.MongoErrorLabel.HandshakeError);
219
- if (isNetworkNonTimeoutError || isNetworkTimeoutBeforeHandshakeError || isAuthHandshakeError) {
220
- if (!this.loadBalanced) {
221
- error.addErrorLabel(error_1.MongoErrorLabel.ResetPool);
222
- markServerUnknown(this, error);
223
- } else if (connection) this.pool.clear({ serviceId: connection.serviceId });
224
- } else if ((0, error_1.isSDAMUnrecoverableError)(error)) {
225
- if (shouldHandleStateChangeError(this, error)) {
226
- const shouldClearPool = (0, error_1.isNodeShuttingDownError)(error);
227
- if (this.loadBalanced && connection && shouldClearPool) this.pool.clear({ serviceId: connection.serviceId });
228
- if (!this.loadBalanced) {
229
- if (shouldClearPool) error.addErrorLabel(error_1.MongoErrorLabel.ResetPool);
230
- markServerUnknown(this, error);
231
- process.nextTick(() => this.requestCheck());
232
- }
233
- }
234
- }
235
- }
236
- /**
237
- * Ensure that error is properly decorated and internal state is updated before throwing
238
- * @internal
239
- */
240
- decorateCommandError(connection, cmd, options, error) {
241
- if (typeof error !== "object" || error == null || !("name" in error)) throw new error_1.MongoRuntimeError("An unexpected error type: " + typeof error);
242
- if (error.name === "AbortError" && "cause" in error && error.cause instanceof error_1.MongoError) error = error.cause;
243
- if (!(error instanceof error_1.MongoError)) return error;
244
- if (connectionIsStale(this.pool, connection)) return error;
245
- const session = options?.session;
246
- if (error instanceof error_1.MongoNetworkError) {
247
- if (session && !session.hasEnded && session.serverSession) session.serverSession.isDirty = true;
248
- if (inActiveTransaction(session, cmd) && !error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) error.addErrorLabel(error_1.MongoErrorLabel.TransientTransactionError);
249
- if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && (0, utils_1.supportsRetryableWrites)(this) && !inActiveTransaction(session, cmd)) error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError);
250
- } else if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && (0, error_1.needsRetryableWriteLabel)(error, (0, utils_1.maxWireVersion)(this), this.description.type) && !inActiveTransaction(session, cmd)) error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError);
251
- if (session && session.isPinned && error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) session.unpin({ force: true });
252
- this.handleError(error, connection);
253
- return error;
254
- }
255
- /**
256
- * Decrement the operation count, returning the new count.
257
- */
258
- decrementOperationCount() {
259
- return this.s.operationCount -= 1;
260
- }
261
- /**
262
- * Increment the operation count, returning the new count.
263
- */
264
- incrementOperationCount() {
265
- return this.s.operationCount += 1;
266
- }
267
- };
268
- exports.Server = Server;
269
- /** @event */
270
- Server.SERVER_HEARTBEAT_STARTED = constants_1.SERVER_HEARTBEAT_STARTED;
271
- /** @event */
272
- Server.SERVER_HEARTBEAT_SUCCEEDED = constants_1.SERVER_HEARTBEAT_SUCCEEDED;
273
- /** @event */
274
- Server.SERVER_HEARTBEAT_FAILED = constants_1.SERVER_HEARTBEAT_FAILED;
275
- /** @event */
276
- Server.CONNECT = constants_1.CONNECT;
277
- /** @event */
278
- Server.DESCRIPTION_RECEIVED = constants_1.DESCRIPTION_RECEIVED;
279
- /** @event */
280
- Server.CLOSED = constants_1.CLOSED;
281
- /** @event */
282
- Server.ENDED = constants_1.ENDED;
283
- function markServerUnknown(server, error) {
284
- if (server.loadBalanced) return;
285
- if (error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError)) server.monitor?.reset();
286
- server.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(server.description.hostAddress, void 0, { error }));
287
- }
288
- function isPinnableCommand(cmd, session) {
289
- if (session) return session.inTransaction() || session.transaction.isCommitted && "commitTransaction" in cmd || "aggregate" in cmd || "find" in cmd || "getMore" in cmd || "listCollections" in cmd || "listIndexes" in cmd || "bulkWrite" in cmd;
290
- return false;
291
- }
292
- function connectionIsStale(pool, connection) {
293
- if (connection.serviceId) return connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString());
294
- return connection.generation !== pool.generation;
295
- }
296
- function shouldHandleStateChangeError(server, err) {
297
- const etv = err.topologyVersion;
298
- const stv = server.description.topologyVersion;
299
- return (0, server_description_1.compareTopologyVersion)(stv, etv) < 0;
300
- }
301
- function inActiveTransaction(session, cmd) {
302
- return session && session.inTransaction() && !(0, transactions_1.isTransactionCommand)(cmd);
303
- }
304
- /** this checks the retryWrites option passed down from the client options, it
305
- * does not check if the server supports retryable writes */
306
- function isRetryableWritesEnabled(topology) {
307
- return topology.s.options.retryWrites !== false;
308
- }
309
- }));
310
-
311
- //#endregion
312
- export default require_server();
313
-
314
- export { require_server };
315
- //# sourceMappingURL=server.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Server = void 0;\nconst connection_1 = require(\"../cmap/connection\");\nconst connection_pool_1 = require(\"../cmap/connection_pool\");\nconst errors_1 = require(\"../cmap/errors\");\nconst constants_1 = require(\"../constants\");\nconst error_1 = require(\"../error\");\nconst mongo_types_1 = require(\"../mongo_types\");\nconst aggregate_1 = require(\"../operations/aggregate\");\nconst transactions_1 = require(\"../transactions\");\nconst utils_1 = require(\"../utils\");\nconst write_concern_1 = require(\"../write_concern\");\nconst common_1 = require(\"./common\");\nconst monitor_1 = require(\"./monitor\");\nconst server_description_1 = require(\"./server_description\");\nconst server_selection_1 = require(\"./server_selection\");\nconst stateTransition = (0, utils_1.makeStateMachine)({\n [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING],\n [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED],\n [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED],\n [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED]\n});\n/** @internal */\nclass Server extends mongo_types_1.TypedEventEmitter {\n /**\n * Create a server\n */\n constructor(topology, description, options) {\n super();\n this.on('error', utils_1.noop);\n this.serverApi = options.serverApi;\n const poolOptions = { hostAddress: description.hostAddress, ...options };\n this.topology = topology;\n this.pool = new connection_pool_1.ConnectionPool(this, poolOptions);\n this.s = {\n description,\n options,\n state: common_1.STATE_CLOSED,\n operationCount: 0\n };\n for (const event of [...constants_1.CMAP_EVENTS, ...constants_1.APM_EVENTS]) {\n this.pool.on(event, (e) => this.emit(event, e));\n }\n this.pool.on(connection_1.Connection.CLUSTER_TIME_RECEIVED, (clusterTime) => {\n this.clusterTime = clusterTime;\n });\n if (this.loadBalanced) {\n this.monitor = null;\n // monitoring is disabled in load balancing mode\n return;\n }\n // create the monitor\n this.monitor = new monitor_1.Monitor(this, this.s.options);\n for (const event of constants_1.HEARTBEAT_EVENTS) {\n this.monitor.on(event, (e) => this.emit(event, e));\n }\n this.monitor.on('resetServer', (error) => markServerUnknown(this, error));\n this.monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event) => {\n this.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(this.description.hostAddress, event.reply, {\n roundTripTime: this.monitor?.roundTripTime,\n minRoundTripTime: this.monitor?.minRoundTripTime\n }));\n if (this.s.state === common_1.STATE_CONNECTING) {\n stateTransition(this, common_1.STATE_CONNECTED);\n this.emit(Server.CONNECT, this);\n }\n });\n }\n get clusterTime() {\n return this.topology.clusterTime;\n }\n set clusterTime(clusterTime) {\n this.topology.clusterTime = clusterTime;\n }\n get description() {\n return this.s.description;\n }\n get name() {\n return this.s.description.address;\n }\n get autoEncrypter() {\n if (this.s.options && this.s.options.autoEncrypter) {\n return this.s.options.autoEncrypter;\n }\n return;\n }\n get loadBalanced() {\n return this.topology.description.type === common_1.TopologyType.LoadBalanced;\n }\n /**\n * Initiate server connect\n */\n connect() {\n if (this.s.state !== common_1.STATE_CLOSED) {\n return;\n }\n stateTransition(this, common_1.STATE_CONNECTING);\n // If in load balancer mode we automatically set the server to\n // a load balancer. It never transitions out of this state and\n // has no monitor.\n if (!this.loadBalanced) {\n this.monitor?.connect();\n }\n else {\n stateTransition(this, common_1.STATE_CONNECTED);\n this.emit(Server.CONNECT, this);\n }\n }\n closeCheckedOutConnections() {\n return this.pool.closeCheckedOutConnections();\n }\n /** Destroy the server connection */\n close() {\n if (this.s.state === common_1.STATE_CLOSED) {\n return;\n }\n stateTransition(this, common_1.STATE_CLOSING);\n if (!this.loadBalanced) {\n this.monitor?.close();\n }\n this.pool.close();\n stateTransition(this, common_1.STATE_CLOSED);\n this.emit('closed');\n }\n /**\n * Immediately schedule monitoring of this server. If there already an attempt being made\n * this will be a no-op.\n */\n requestCheck() {\n if (!this.loadBalanced) {\n this.monitor?.requestCheck();\n }\n }\n async command(operation, timeoutContext) {\n if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) {\n throw new error_1.MongoServerClosedError();\n }\n const session = operation.session;\n let conn = session?.pinnedConnection;\n this.incrementOperationCount();\n if (conn == null) {\n try {\n conn = await this.pool.checkOut({ timeoutContext, signal: operation.options.signal });\n }\n catch (checkoutError) {\n this.decrementOperationCount();\n if (!(checkoutError instanceof errors_1.PoolClearedError))\n this.handleError(checkoutError);\n throw checkoutError;\n }\n }\n let reauthPromise = null;\n const cleanup = () => {\n this.decrementOperationCount();\n if (session?.pinnedConnection !== conn) {\n if (reauthPromise != null) {\n // The reauth promise only exists if it hasn't thrown.\n const checkBackIn = () => {\n this.pool.checkIn(conn);\n };\n void reauthPromise.then(checkBackIn, checkBackIn);\n }\n else {\n this.pool.checkIn(conn);\n }\n }\n };\n let cmd;\n try {\n cmd = operation.buildCommand(conn, session);\n }\n catch (e) {\n cleanup();\n throw e;\n }\n const options = operation.buildOptions(timeoutContext);\n const ns = operation.ns;\n if (this.loadBalanced && isPinnableCommand(cmd, session) && !session?.pinnedConnection) {\n session?.pin(conn);\n }\n options.directConnection = this.topology.s.options.directConnection;\n const omitReadPreference = operation instanceof aggregate_1.AggregateOperation &&\n operation.hasWriteStage &&\n (0, utils_1.maxWireVersion)(conn) < server_selection_1.MIN_SECONDARY_WRITE_WIRE_VERSION;\n if (omitReadPreference) {\n delete options.readPreference;\n }\n if (this.description.iscryptd) {\n options.omitMaxTimeMS = true;\n }\n try {\n try {\n const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE);\n (0, write_concern_1.throwIfWriteConcernError)(res);\n return res;\n }\n catch (commandError) {\n throw this.decorateCommandError(conn, cmd, options, commandError);\n }\n }\n catch (operationError) {\n if (operationError instanceof error_1.MongoError &&\n operationError.code === error_1.MONGODB_ERROR_CODES.Reauthenticate) {\n reauthPromise = this.pool.reauthenticate(conn);\n reauthPromise.then(undefined, error => {\n reauthPromise = null;\n (0, utils_1.squashError)(error);\n });\n await (0, utils_1.abortable)(reauthPromise, options);\n reauthPromise = null; // only reachable if reauth succeeds\n try {\n const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE);\n (0, write_concern_1.throwIfWriteConcernError)(res);\n return res;\n }\n catch (commandError) {\n throw this.decorateCommandError(conn, cmd, options, commandError);\n }\n }\n else {\n throw operationError;\n }\n }\n finally {\n cleanup();\n }\n }\n /**\n * Handle SDAM error\n * @internal\n */\n handleError(error, connection) {\n if (!(error instanceof error_1.MongoError)) {\n return;\n }\n const isStaleError = error.connectionGeneration && error.connectionGeneration < this.pool.generation;\n if (isStaleError) {\n return;\n }\n const isNetworkNonTimeoutError = error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError);\n const isNetworkTimeoutBeforeHandshakeError = error instanceof error_1.MongoNetworkError && error.beforeHandshake;\n const isAuthHandshakeError = error.hasErrorLabel(error_1.MongoErrorLabel.HandshakeError);\n if (isNetworkNonTimeoutError || isNetworkTimeoutBeforeHandshakeError || isAuthHandshakeError) {\n // In load balanced mode we never mark the server as unknown and always\n // clear for the specific service id.\n if (!this.loadBalanced) {\n error.addErrorLabel(error_1.MongoErrorLabel.ResetPool);\n markServerUnknown(this, error);\n }\n else if (connection) {\n this.pool.clear({ serviceId: connection.serviceId });\n }\n }\n else {\n if ((0, error_1.isSDAMUnrecoverableError)(error)) {\n if (shouldHandleStateChangeError(this, error)) {\n const shouldClearPool = (0, error_1.isNodeShuttingDownError)(error);\n if (this.loadBalanced && connection && shouldClearPool) {\n this.pool.clear({ serviceId: connection.serviceId });\n }\n if (!this.loadBalanced) {\n if (shouldClearPool) {\n error.addErrorLabel(error_1.MongoErrorLabel.ResetPool);\n }\n markServerUnknown(this, error);\n process.nextTick(() => this.requestCheck());\n }\n }\n }\n }\n }\n /**\n * Ensure that error is properly decorated and internal state is updated before throwing\n * @internal\n */\n decorateCommandError(connection, cmd, options, error) {\n if (typeof error !== 'object' || error == null || !('name' in error)) {\n throw new error_1.MongoRuntimeError('An unexpected error type: ' + typeof error);\n }\n if (error.name === 'AbortError' && 'cause' in error && error.cause instanceof error_1.MongoError) {\n error = error.cause;\n }\n if (!(error instanceof error_1.MongoError)) {\n // Node.js or some other error we have not special handling for\n return error;\n }\n if (connectionIsStale(this.pool, connection)) {\n return error;\n }\n const session = options?.session;\n if (error instanceof error_1.MongoNetworkError) {\n if (session && !session.hasEnded && session.serverSession) {\n session.serverSession.isDirty = true;\n }\n // inActiveTransaction check handles commit and abort.\n if (inActiveTransaction(session, cmd) &&\n !error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) {\n error.addErrorLabel(error_1.MongoErrorLabel.TransientTransactionError);\n }\n if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) &&\n (0, utils_1.supportsRetryableWrites)(this) &&\n !inActiveTransaction(session, cmd)) {\n error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError);\n }\n }\n else {\n if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) &&\n (0, error_1.needsRetryableWriteLabel)(error, (0, utils_1.maxWireVersion)(this), this.description.type) &&\n !inActiveTransaction(session, cmd)) {\n error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError);\n }\n }\n if (session &&\n session.isPinned &&\n error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) {\n session.unpin({ force: true });\n }\n this.handleError(error, connection);\n return error;\n }\n /**\n * Decrement the operation count, returning the new count.\n */\n decrementOperationCount() {\n return (this.s.operationCount -= 1);\n }\n /**\n * Increment the operation count, returning the new count.\n */\n incrementOperationCount() {\n return (this.s.operationCount += 1);\n }\n}\nexports.Server = Server;\n/** @event */\nServer.SERVER_HEARTBEAT_STARTED = constants_1.SERVER_HEARTBEAT_STARTED;\n/** @event */\nServer.SERVER_HEARTBEAT_SUCCEEDED = constants_1.SERVER_HEARTBEAT_SUCCEEDED;\n/** @event */\nServer.SERVER_HEARTBEAT_FAILED = constants_1.SERVER_HEARTBEAT_FAILED;\n/** @event */\nServer.CONNECT = constants_1.CONNECT;\n/** @event */\nServer.DESCRIPTION_RECEIVED = constants_1.DESCRIPTION_RECEIVED;\n/** @event */\nServer.CLOSED = constants_1.CLOSED;\n/** @event */\nServer.ENDED = constants_1.ENDED;\nfunction markServerUnknown(server, error) {\n // Load balancer servers can never be marked unknown.\n if (server.loadBalanced) {\n return;\n }\n if (error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError)) {\n server.monitor?.reset();\n }\n server.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(server.description.hostAddress, undefined, { error }));\n}\nfunction isPinnableCommand(cmd, session) {\n if (session) {\n return (session.inTransaction() ||\n (session.transaction.isCommitted && 'commitTransaction' in cmd) ||\n 'aggregate' in cmd ||\n 'find' in cmd ||\n 'getMore' in cmd ||\n 'listCollections' in cmd ||\n 'listIndexes' in cmd ||\n 'bulkWrite' in cmd);\n }\n return false;\n}\nfunction connectionIsStale(pool, connection) {\n if (connection.serviceId) {\n return (connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString()));\n }\n return connection.generation !== pool.generation;\n}\nfunction shouldHandleStateChangeError(server, err) {\n const etv = err.topologyVersion;\n const stv = server.description.topologyVersion;\n return (0, server_description_1.compareTopologyVersion)(stv, etv) < 0;\n}\nfunction inActiveTransaction(session, cmd) {\n return session && session.inTransaction() && !(0, transactions_1.isTransactionCommand)(cmd);\n}\n/** this checks the retryWrites option passed down from the client options, it\n * does not check if the server supports retryable writes */\nfunction isRetryableWritesEnabled(topology) {\n return topology.s.options.retryWrites !== false;\n}\n//# sourceMappingURL=server.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS,KAAK;CACtB,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,mBAAmB,GAAG,QAAQ,kBAAkB;GACjD,SAAS,eAAe,CAAC,SAAS,cAAc,SAAS,iBAAiB;GAC1E,SAAS,mBAAmB;GAAC,SAAS;GAAkB,SAAS;GAAe,SAAS;GAAiB,SAAS;GAAa;GAChI,SAAS,kBAAkB;GAAC,SAAS;GAAiB,SAAS;GAAe,SAAS;GAAa;GACpG,SAAS,gBAAgB,CAAC,SAAS,eAAe,SAAS,aAAa;EAC5E,CAAC;;CAEF,IAAM,SAAN,MAAM,eAAe,cAAc,kBAAkB;;;;EAIjD,YAAY,UAAU,aAAa,SAAS;AACxC,UAAO;AACP,QAAK,GAAG,SAAS,QAAQ,KAAK;AAC9B,QAAK,YAAY,QAAQ;GACzB,MAAM,cAAc;IAAE,aAAa,YAAY;IAAa,GAAG;IAAS;AACxE,QAAK,WAAW;AAChB,QAAK,OAAO,IAAI,kBAAkB,eAAe,MAAM,YAAY;AACnE,QAAK,IAAI;IACL;IACA;IACA,OAAO,SAAS;IAChB,gBAAgB;IACnB;AACD,QAAK,MAAM,SAAS,CAAC,GAAG,Y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A,QAAQ,QAAQ,eAAe,IAC1B,QAAQ,YAAY,eAAe,uBAAuB,OAC3D,eAAe,OACf,UAAU,OACV,aAAa,OACb,qBAAqB,OACrB,iBAAiB,OACjB,eAAe;AAEvB,SAAO;;CAEX,SAAS,kBAAkB,MAAM,YAAY;AACzC,MAAI,WAAW,UACX,QAAQ,WAAW,eAAe,KAAK,mBAAmB,IAAI,WAAW,UAAU,aAAa,CAAC;AAErG,SAAO,WAAW,eAAe,KAAK;;CAE1C,SAAS,6BAA6B,QAAQ,KAAK;EAC/C,MAAM,MAAM,IAAI;EAChB,MAAM,MAAM,OAAO,YAAY;AAC/B,UAAQ,GAAG,qBAAqB,wBAAwB,KAAK,IAAI,GAAG;;CAExE,SAAS,oBAAoB,SAAS,KAAK;AACvC,SAAO,WAAW,QAAQ,eAAe,IAAI,EAAE,GAAG,eAAe,sBAAsB,IAAI;;;;CAI/F,SAAS,yBAAyB,UAAU;AACxC,SAAO,SAAS,EAAE,QAAQ,gBAAgB"}
@@ -1,157 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_bson } from "../bson.mjs";
3
- import { require_error } from "../error.mjs";
4
- import { require_common } from "./common.mjs";
5
- import { require_utils } from "../utils.mjs";
6
-
7
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.js
8
- var require_server_description = /* @__PURE__ */ __commonJSMin(((exports) => {
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ServerDescription = void 0;
11
- exports.parseServerType = parseServerType;
12
- exports.compareTopologyVersion = compareTopologyVersion;
13
- const bson_1 = require_bson();
14
- const error_1 = require_error();
15
- const utils_1 = require_utils();
16
- const common_1 = require_common();
17
- const WRITABLE_SERVER_TYPES = new Set([
18
- common_1.ServerType.RSPrimary,
19
- common_1.ServerType.Standalone,
20
- common_1.ServerType.Mongos,
21
- common_1.ServerType.LoadBalancer
22
- ]);
23
- const DATA_BEARING_SERVER_TYPES = new Set([
24
- common_1.ServerType.RSPrimary,
25
- common_1.ServerType.RSSecondary,
26
- common_1.ServerType.Mongos,
27
- common_1.ServerType.Standalone,
28
- common_1.ServerType.LoadBalancer
29
- ]);
30
- /**
31
- * The client's view of a single server, based on the most recent hello outcome.
32
- *
33
- * Internal type, not meant to be directly instantiated
34
- * @public
35
- */
36
- var ServerDescription = class {
37
- /**
38
- * Create a ServerDescription
39
- * @internal
40
- *
41
- * @param address - The address of the server
42
- * @param hello - An optional hello response for this server
43
- */
44
- constructor(address, hello, options = {}) {
45
- if (address == null || address === "") throw new error_1.MongoRuntimeError("ServerDescription must be provided with a non-empty address");
46
- this.address = typeof address === "string" ? utils_1.HostAddress.fromString(address).toString() : address.toString();
47
- this.type = parseServerType(hello, options);
48
- this.hosts = hello?.hosts?.map((host) => host.toLowerCase()) ?? [];
49
- this.passives = hello?.passives?.map((host) => host.toLowerCase()) ?? [];
50
- this.arbiters = hello?.arbiters?.map((host) => host.toLowerCase()) ?? [];
51
- this.tags = hello?.tags ?? {};
52
- this.minWireVersion = hello?.minWireVersion ?? 0;
53
- this.maxWireVersion = hello?.maxWireVersion ?? 0;
54
- this.roundTripTime = options?.roundTripTime ?? -1;
55
- this.minRoundTripTime = options?.minRoundTripTime ?? 0;
56
- this.lastUpdateTime = (0, utils_1.now)();
57
- this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0;
58
- this.error = options.error ?? null;
59
- this.error?.stack;
60
- this.topologyVersion = this.error?.topologyVersion ?? hello?.topologyVersion ?? null;
61
- this.setName = hello?.setName ?? null;
62
- this.setVersion = hello?.setVersion ?? null;
63
- this.electionId = hello?.electionId ?? null;
64
- this.logicalSessionTimeoutMinutes = hello?.logicalSessionTimeoutMinutes ?? null;
65
- this.maxMessageSizeBytes = hello?.maxMessageSizeBytes ?? null;
66
- this.maxWriteBatchSize = hello?.maxWriteBatchSize ?? null;
67
- this.maxBsonObjectSize = hello?.maxBsonObjectSize ?? null;
68
- this.primary = hello?.primary ?? null;
69
- this.me = hello?.me?.toLowerCase() ?? null;
70
- this.$clusterTime = hello?.$clusterTime ?? null;
71
- this.iscryptd = Boolean(hello?.iscryptd);
72
- }
73
- get hostAddress() {
74
- return utils_1.HostAddress.fromString(this.address);
75
- }
76
- get allHosts() {
77
- return this.hosts.concat(this.arbiters).concat(this.passives);
78
- }
79
- /** Is this server available for reads*/
80
- get isReadable() {
81
- return this.type === common_1.ServerType.RSSecondary || this.isWritable;
82
- }
83
- /** Is this server data bearing */
84
- get isDataBearing() {
85
- return DATA_BEARING_SERVER_TYPES.has(this.type);
86
- }
87
- /** Is this server available for writes */
88
- get isWritable() {
89
- return WRITABLE_SERVER_TYPES.has(this.type);
90
- }
91
- get host() {
92
- const chopLength = `:${this.port}`.length;
93
- return this.address.slice(0, -chopLength);
94
- }
95
- get port() {
96
- const port = this.address.split(":").pop();
97
- return port ? Number.parseInt(port, 10) : 27017;
98
- }
99
- /**
100
- * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification.
101
- * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md
102
- */
103
- equals(other) {
104
- const topologyVersionsEqual = this.topologyVersion === other?.topologyVersion || compareTopologyVersion(this.topologyVersion, other?.topologyVersion) === 0;
105
- const electionIdsEqual = this.electionId != null && other?.electionId != null ? (0, utils_1.compareObjectId)(this.electionId, other.electionId) === 0 : this.electionId === other?.electionId;
106
- return other != null && other.iscryptd === this.iscryptd && (0, utils_1.errorStrictEqual)(this.error, other.error) && this.type === other.type && this.minWireVersion === other.minWireVersion && (0, utils_1.arrayStrictEqual)(this.hosts, other.hosts) && tagsStrictEqual(this.tags, other.tags) && this.setName === other.setName && this.setVersion === other.setVersion && electionIdsEqual && this.primary === other.primary && this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && topologyVersionsEqual;
107
- }
108
- };
109
- exports.ServerDescription = ServerDescription;
110
- function parseServerType(hello, options) {
111
- if (options?.loadBalanced) return common_1.ServerType.LoadBalancer;
112
- if (!hello || !hello.ok) return common_1.ServerType.Unknown;
113
- if (hello.isreplicaset) return common_1.ServerType.RSGhost;
114
- if (hello.msg && hello.msg === "isdbgrid") return common_1.ServerType.Mongos;
115
- if (hello.setName) if (hello.hidden) return common_1.ServerType.RSOther;
116
- else if (hello.isWritablePrimary) return common_1.ServerType.RSPrimary;
117
- else if (hello.secondary) return common_1.ServerType.RSSecondary;
118
- else if (hello.arbiterOnly) return common_1.ServerType.RSArbiter;
119
- else return common_1.ServerType.RSOther;
120
- return common_1.ServerType.Standalone;
121
- }
122
- function tagsStrictEqual(tags, tags2) {
123
- const tagsKeys = Object.keys(tags);
124
- const tags2Keys = Object.keys(tags2);
125
- return tagsKeys.length === tags2Keys.length && tagsKeys.every((key) => tags2[key] === tags[key]);
126
- }
127
- /**
128
- * Compares two topology versions.
129
- *
130
- * 1. If the response topologyVersion is unset or the ServerDescription's
131
- * topologyVersion is null, the client MUST assume the response is more recent.
132
- * 1. If the response's topologyVersion.processId is not equal to the
133
- * ServerDescription's, the client MUST assume the response is more recent.
134
- * 1. If the response's topologyVersion.processId is equal to the
135
- * ServerDescription's, the client MUST use the counter field to determine
136
- * which topologyVersion is more recent.
137
- *
138
- * ```ts
139
- * currentTv < newTv === -1
140
- * currentTv === newTv === 0
141
- * currentTv > newTv === 1
142
- * ```
143
- */
144
- function compareTopologyVersion(currentTv, newTv) {
145
- if (currentTv == null || newTv == null) return -1;
146
- if (!currentTv.processId.equals(newTv.processId)) return -1;
147
- const currentCounter = typeof currentTv.counter === "bigint" ? bson_1.Long.fromBigInt(currentTv.counter) : bson_1.Long.isLong(currentTv.counter) ? currentTv.counter : bson_1.Long.fromNumber(currentTv.counter);
148
- const newCounter = typeof newTv.counter === "bigint" ? bson_1.Long.fromBigInt(newTv.counter) : bson_1.Long.isLong(newTv.counter) ? newTv.counter : bson_1.Long.fromNumber(newTv.counter);
149
- return currentCounter.compare(newCounter);
150
- }
151
- }));
152
-
153
- //#endregion
154
- export default require_server_description();
155
-
156
- export { require_server_description };
157
- //# sourceMappingURL=server_description.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server_description.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerDescription = void 0;\nexports.parseServerType = parseServerType;\nexports.compareTopologyVersion = compareTopologyVersion;\nconst bson_1 = require(\"../bson\");\nconst error_1 = require(\"../error\");\nconst utils_1 = require(\"../utils\");\nconst common_1 = require(\"./common\");\nconst WRITABLE_SERVER_TYPES = new Set([\n common_1.ServerType.RSPrimary,\n common_1.ServerType.Standalone,\n common_1.ServerType.Mongos,\n common_1.ServerType.LoadBalancer\n]);\nconst DATA_BEARING_SERVER_TYPES = new Set([\n common_1.ServerType.RSPrimary,\n common_1.ServerType.RSSecondary,\n common_1.ServerType.Mongos,\n common_1.ServerType.Standalone,\n common_1.ServerType.LoadBalancer\n]);\n/**\n * The client's view of a single server, based on the most recent hello outcome.\n *\n * Internal type, not meant to be directly instantiated\n * @public\n */\nclass ServerDescription {\n /**\n * Create a ServerDescription\n * @internal\n *\n * @param address - The address of the server\n * @param hello - An optional hello response for this server\n */\n constructor(address, hello, options = {}) {\n if (address == null || address === '') {\n throw new error_1.MongoRuntimeError('ServerDescription must be provided with a non-empty address');\n }\n this.address =\n typeof address === 'string'\n ? utils_1.HostAddress.fromString(address).toString() // Use HostAddress to normalize\n : address.toString();\n this.type = parseServerType(hello, options);\n this.hosts = hello?.hosts?.map((host) => host.toLowerCase()) ?? [];\n this.passives = hello?.passives?.map((host) => host.toLowerCase()) ?? [];\n this.arbiters = hello?.arbiters?.map((host) => host.toLowerCase()) ?? [];\n this.tags = hello?.tags ?? {};\n this.minWireVersion = hello?.minWireVersion ?? 0;\n this.maxWireVersion = hello?.maxWireVersion ?? 0;\n this.roundTripTime = options?.roundTripTime ?? -1;\n this.minRoundTripTime = options?.minRoundTripTime ?? 0;\n this.lastUpdateTime = (0, utils_1.now)();\n this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0;\n // NOTE: This actually builds the stack string instead of holding onto the getter and all its\n // associated references. This is done to prevent a memory leak.\n this.error = options.error ?? null;\n this.error?.stack;\n // TODO(NODE-2674): Preserve int64 sent from MongoDB\n this.topologyVersion = this.error?.topologyVersion ?? hello?.topologyVersion ?? null;\n this.setName = hello?.setName ?? null;\n this.setVersion = hello?.setVersion ?? null;\n this.electionId = hello?.electionId ?? null;\n this.logicalSessionTimeoutMinutes = hello?.logicalSessionTimeoutMinutes ?? null;\n this.maxMessageSizeBytes = hello?.maxMessageSizeBytes ?? null;\n this.maxWriteBatchSize = hello?.maxWriteBatchSize ?? null;\n this.maxBsonObjectSize = hello?.maxBsonObjectSize ?? null;\n this.primary = hello?.primary ?? null;\n this.me = hello?.me?.toLowerCase() ?? null;\n this.$clusterTime = hello?.$clusterTime ?? null;\n this.iscryptd = Boolean(hello?.iscryptd);\n }\n get hostAddress() {\n return utils_1.HostAddress.fromString(this.address);\n }\n get allHosts() {\n return this.hosts.concat(this.arbiters).concat(this.passives);\n }\n /** Is this server available for reads*/\n get isReadable() {\n return this.type === common_1.ServerType.RSSecondary || this.isWritable;\n }\n /** Is this server data bearing */\n get isDataBearing() {\n return DATA_BEARING_SERVER_TYPES.has(this.type);\n }\n /** Is this server available for writes */\n get isWritable() {\n return WRITABLE_SERVER_TYPES.has(this.type);\n }\n get host() {\n const chopLength = `:${this.port}`.length;\n return this.address.slice(0, -chopLength);\n }\n get port() {\n const port = this.address.split(':').pop();\n return port ? Number.parseInt(port, 10) : 27017;\n }\n /**\n * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification.\n * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md\n */\n equals(other) {\n // Despite using the comparator that would determine a nullish topologyVersion as greater than\n // for equality we should only always perform direct equality comparison\n const topologyVersionsEqual = this.topologyVersion === other?.topologyVersion ||\n compareTopologyVersion(this.topologyVersion, other?.topologyVersion) === 0;\n const electionIdsEqual = this.electionId != null && other?.electionId != null\n ? (0, utils_1.compareObjectId)(this.electionId, other.electionId) === 0\n : this.electionId === other?.electionId;\n return (other != null &&\n other.iscryptd === this.iscryptd &&\n (0, utils_1.errorStrictEqual)(this.error, other.error) &&\n this.type === other.type &&\n this.minWireVersion === other.minWireVersion &&\n (0, utils_1.arrayStrictEqual)(this.hosts, other.hosts) &&\n tagsStrictEqual(this.tags, other.tags) &&\n this.setName === other.setName &&\n this.setVersion === other.setVersion &&\n electionIdsEqual &&\n this.primary === other.primary &&\n this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes &&\n topologyVersionsEqual);\n }\n}\nexports.ServerDescription = ServerDescription;\n// Parses a `hello` message and determines the server type\nfunction parseServerType(hello, options) {\n if (options?.loadBalanced) {\n return common_1.ServerType.LoadBalancer;\n }\n if (!hello || !hello.ok) {\n return common_1.ServerType.Unknown;\n }\n if (hello.isreplicaset) {\n return common_1.ServerType.RSGhost;\n }\n if (hello.msg && hello.msg === 'isdbgrid') {\n return common_1.ServerType.Mongos;\n }\n if (hello.setName) {\n if (hello.hidden) {\n return common_1.ServerType.RSOther;\n }\n else if (hello.isWritablePrimary) {\n return common_1.ServerType.RSPrimary;\n }\n else if (hello.secondary) {\n return common_1.ServerType.RSSecondary;\n }\n else if (hello.arbiterOnly) {\n return common_1.ServerType.RSArbiter;\n }\n else {\n return common_1.ServerType.RSOther;\n }\n }\n return common_1.ServerType.Standalone;\n}\nfunction tagsStrictEqual(tags, tags2) {\n const tagsKeys = Object.keys(tags);\n const tags2Keys = Object.keys(tags2);\n return (tagsKeys.length === tags2Keys.length &&\n tagsKeys.every((key) => tags2[key] === tags[key]));\n}\n/**\n * Compares two topology versions.\n *\n * 1. If the response topologyVersion is unset or the ServerDescription's\n * topologyVersion is null, the client MUST assume the response is more recent.\n * 1. If the response's topologyVersion.processId is not equal to the\n * ServerDescription's, the client MUST assume the response is more recent.\n * 1. If the response's topologyVersion.processId is equal to the\n * ServerDescription's, the client MUST use the counter field to determine\n * which topologyVersion is more recent.\n *\n * ```ts\n * currentTv < newTv === -1\n * currentTv === newTv === 0\n * currentTv > newTv === 1\n * ```\n */\nfunction compareTopologyVersion(currentTv, newTv) {\n if (currentTv == null || newTv == null) {\n return -1;\n }\n if (!currentTv.processId.equals(newTv.processId)) {\n return -1;\n }\n // TODO(NODE-2674): Preserve int64 sent from MongoDB\n const currentCounter = typeof currentTv.counter === 'bigint'\n ? bson_1.Long.fromBigInt(currentTv.counter)\n : bson_1.Long.isLong(currentTv.counter)\n ? currentTv.counter\n : bson_1.Long.fromNumber(currentTv.counter);\n const newCounter = typeof newTv.counter === 'bigint'\n ? bson_1.Long.fromBigInt(newTv.counter)\n : bson_1.Long.isLong(newTv.counter)\n ? newTv.counter\n : bson_1.Long.fromNumber(newTv.counter);\n return currentCounter.compare(newCounter);\n}\n//# sourceMappingURL=server_description.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,oBAAoB,KAAK;AACjC,SAAQ,kBAAkB;AAC1B,SAAQ,yBAAyB;CACjC,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,wBAAwB,IAAI,IAAI;EAClC,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,SAAS,WAAW;EACvB,CAAC;CACF,MAAM,4BAA4B,IAAI,IAAI;EACtC,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,SAAS,WAAW;EACvB,CAAC;;;;;;;CAOF,IAAM,oBAAN,MAAwB;;;;;;;;EAQpB,YAAY,SAAS,OAAO,UAAU,EAAE,EAAE;AACtC,OAAI,WAAW,QAAQ,YAAY,GAC/B,OAAM,I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