pecunia-root 0.1.0 → 0.1.1

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 (358) hide show
  1. package/dist/_virtual/rolldown_runtime.mjs +8 -0
  2. package/dist/adapters/drizzle-adapter/index.mjs +4 -1
  3. package/dist/adapters/drizzle-adapter/index.mjs.map +1 -1
  4. package/dist/adapters/mongodb-adapter/index.mjs +12 -11
  5. package/dist/adapters/mongodb-adapter/index.mjs.map +1 -1
  6. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +14 -0
  7. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +1 -0
  8. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +54 -0
  9. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +1 -0
  10. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +36 -0
  11. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +1 -0
  12. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +27 -0
  13. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +1 -0
  14. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +3728 -0
  15. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +1 -0
  16. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/column-builder.mjs +108 -0
  17. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/column-builder.mjs.map +1 -0
  18. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/column.mjs +55 -0
  19. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/column.mjs.map +1 -0
  20. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/entity.mjs +18 -0
  21. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/entity.mjs.map +1 -0
  22. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/columns/common.mjs +183 -0
  23. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/columns/common.mjs.map +1 -0
  24. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/columns/enum.mjs +35 -0
  25. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/columns/enum.mjs.map +1 -0
  26. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/foreign-keys.mjs +68 -0
  27. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/foreign-keys.mjs.map +1 -0
  28. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/unique-constraint.mjs +56 -0
  29. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/unique-constraint.mjs.map +1 -0
  30. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/utils/array.mjs +65 -0
  31. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/pg-core/utils/array.mjs.map +1 -0
  32. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/expressions/conditions.mjs +69 -0
  33. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/expressions/conditions.mjs.map +1 -0
  34. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/expressions/select.mjs +13 -0
  35. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/expressions/select.mjs.map +1 -0
  36. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/functions/aggregate.mjs +10 -0
  37. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/functions/aggregate.mjs.map +1 -0
  38. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/sql.mjs +366 -0
  39. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/sql/sql.mjs.map +1 -0
  40. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/subquery.mjs +22 -0
  41. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/subquery.mjs.map +1 -0
  42. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/table.mjs +62 -0
  43. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/table.mjs.map +1 -0
  44. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/table.utils.mjs +6 -0
  45. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/table.utils.mjs.map +1 -0
  46. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/tracing-utils.mjs +8 -0
  47. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/tracing-utils.mjs.map +1 -0
  48. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/tracing.mjs +8 -0
  49. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/tracing.mjs.map +1 -0
  50. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/view-common.mjs +6 -0
  51. package/dist/node_modules/.pnpm/drizzle-orm@0.41.0_@prisma_client@5.22.0_prisma@5.22.0__@types_better-sqlite3@7.6.13_@t_b8c798d02fdf3681c336f03696200539/node_modules/drizzle-orm/view-common.mjs.map +1 -0
  52. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +137 -0
  53. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +1 -0
  54. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +211 -0
  55. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +1 -0
  56. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +95 -0
  57. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +1 -0
  58. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +158 -0
  59. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +1 -0
  60. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +195 -0
  61. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +1 -0
  62. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +710 -0
  63. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +1 -0
  64. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +53 -0
  65. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +1 -0
  66. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +63 -0
  67. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +1 -0
  68. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +368 -0
  69. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +1 -0
  70. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +234 -0
  71. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +1 -0
  72. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +545 -0
  73. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +1 -0
  74. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +83 -0
  75. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +1 -0
  76. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +146 -0
  77. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +1 -0
  78. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +58 -0
  79. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +1 -0
  80. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +30 -0
  81. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +1 -0
  82. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +135 -0
  83. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +1 -0
  84. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +25 -0
  85. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +1 -0
  86. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +47 -0
  87. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +1 -0
  88. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +362 -0
  89. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +1 -0
  90. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +58 -0
  91. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +1 -0
  92. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +123 -0
  93. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +1 -0
  94. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +128 -0
  95. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +1 -0
  96. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +133 -0
  97. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +1 -0
  98. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +126 -0
  99. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +1 -0
  100. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +79 -0
  101. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +1 -0
  102. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +65 -0
  103. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +1 -0
  104. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +127 -0
  105. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +1 -0
  106. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +47 -0
  107. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +1 -0
  108. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +44 -0
  109. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +1 -0
  110. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +101 -0
  111. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +1 -0
  112. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +33 -0
  113. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +1 -0
  114. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +53 -0
  115. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +1 -0
  116. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +29 -0
  117. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +1 -0
  118. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +83 -0
  119. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +1 -0
  120. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +36 -0
  121. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +1 -0
  122. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +32 -0
  123. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +1 -0
  124. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +206 -0
  125. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +1 -0
  126. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +45 -0
  127. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +1 -0
  128. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +213 -0
  129. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +1 -0
  130. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +411 -0
  131. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +1 -0
  132. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +288 -0
  133. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +1 -0
  134. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +423 -0
  135. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +1 -0
  136. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +483 -0
  137. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +1 -0
  138. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +207 -0
  139. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +1 -0
  140. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +116 -0
  141. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +1 -0
  142. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +183 -0
  143. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +1 -0
  144. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +55 -0
  145. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +1 -0
  146. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +60 -0
  147. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +1 -0
  148. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +139 -0
  149. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +1 -0
  150. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +28 -0
  151. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +1 -0
  152. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +117 -0
  153. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +1 -0
  154. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +182 -0
  155. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +1 -0
  156. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +304 -0
  157. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +1 -0
  158. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +34 -0
  159. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +1 -0
  160. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +739 -0
  161. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +1 -0
  162. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +805 -0
  163. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +1 -0
  164. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +174 -0
  165. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +1 -0
  166. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +726 -0
  167. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +1 -0
  168. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +172 -0
  169. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +1 -0
  170. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +103 -0
  171. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +1 -0
  172. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +66 -0
  173. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +1 -0
  174. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +41 -0
  175. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +1 -0
  176. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +365 -0
  177. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +1 -0
  178. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +50 -0
  179. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +1 -0
  180. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +48 -0
  181. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +1 -0
  182. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +23 -0
  183. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +1 -0
  184. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +106 -0
  185. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +1 -0
  186. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +428 -0
  187. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +1 -0
  188. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +124 -0
  189. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +1 -0
  190. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +95 -0
  191. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +1 -0
  192. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +1305 -0
  193. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +1 -0
  194. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +59 -0
  195. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +1 -0
  196. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +250 -0
  197. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +1 -0
  198. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +170 -0
  199. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +1 -0
  200. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +315 -0
  201. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +1 -0
  202. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +925 -0
  203. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +1 -0
  204. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +520 -0
  205. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +1 -0
  206. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +90 -0
  207. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +1 -0
  208. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +582 -0
  209. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +1 -0
  210. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +64 -0
  211. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +1 -0
  212. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +86 -0
  213. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +1 -0
  214. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +60 -0
  215. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +1 -0
  216. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +264 -0
  217. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +1 -0
  218. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +109 -0
  219. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +1 -0
  220. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +172 -0
  221. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +1 -0
  222. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +68 -0
  223. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +1 -0
  224. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +53 -0
  225. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +1 -0
  226. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +123 -0
  227. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +1 -0
  228. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +119 -0
  229. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +1 -0
  230. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +65 -0
  231. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +1 -0
  232. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +97 -0
  233. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +1 -0
  234. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +47 -0
  235. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +1 -0
  236. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +188 -0
  237. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +1 -0
  238. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +103 -0
  239. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +1 -0
  240. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +136 -0
  241. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +1 -0
  242. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +61 -0
  243. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +1 -0
  244. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +179 -0
  245. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +1 -0
  246. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +77 -0
  247. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +1 -0
  248. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +48 -0
  249. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +1 -0
  250. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +60 -0
  251. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +1 -0
  252. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +43 -0
  253. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +1 -0
  254. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +105 -0
  255. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +1 -0
  256. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +50 -0
  257. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +1 -0
  258. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +39 -0
  259. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +1 -0
  260. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +49 -0
  261. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +1 -0
  262. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +58 -0
  263. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +1 -0
  264. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +46 -0
  265. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +1 -0
  266. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +48 -0
  267. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +1 -0
  268. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +46 -0
  269. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +1 -0
  270. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +67 -0
  271. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +1 -0
  272. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +37 -0
  273. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +1 -0
  274. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +171 -0
  275. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +1 -0
  276. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +45 -0
  277. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +1 -0
  278. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +71 -0
  279. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +1 -0
  280. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +165 -0
  281. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +1 -0
  282. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +62 -0
  283. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +1 -0
  284. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +51 -0
  285. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +1 -0
  286. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +156 -0
  287. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +1 -0
  288. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +477 -0
  289. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +1 -0
  290. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +315 -0
  291. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +1 -0
  292. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +157 -0
  293. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +1 -0
  294. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +184 -0
  295. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +1 -0
  296. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +96 -0
  297. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +1 -0
  298. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +107 -0
  299. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +1 -0
  300. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +540 -0
  301. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +1 -0
  302. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +298 -0
  303. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +1 -0
  304. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +623 -0
  305. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +1 -0
  306. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +91 -0
  307. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +1 -0
  308. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +254 -0
  309. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +1 -0
  310. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +138 -0
  311. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +1 -0
  312. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +993 -0
  313. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +1 -0
  314. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +81 -0
  315. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +1 -0
  316. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +171 -0
  317. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +1 -0
  318. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +295 -0
  319. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +1 -0
  320. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +81 -0
  321. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +1 -0
  322. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +206 -0
  323. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +1 -0
  324. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +33590 -0
  325. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +1 -0
  326. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +37 -0
  327. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +1 -0
  328. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +18 -0
  329. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +1 -0
  330. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +252 -0
  331. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +1 -0
  332. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +41 -0
  333. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +1 -0
  334. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +41 -0
  335. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +1 -0
  336. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +173 -0
  337. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +1 -0
  338. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +334 -0
  339. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +1 -0
  340. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +90 -0
  341. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +1 -0
  342. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +356 -0
  343. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +1 -0
  344. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +23 -0
  345. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +1 -0
  346. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +29 -0
  347. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +1 -0
  348. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +140 -0
  349. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +1 -0
  350. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +831 -0
  351. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +1 -0
  352. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +77 -0
  353. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +1 -0
  354. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +147 -0
  355. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +1 -0
  356. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +17 -0
  357. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +1 -0
  358. package/package.json +1 -39
@@ -0,0 +1,623 @@
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_read_preference } from "./read_preference.mjs";
5
+ import { require_common } from "./sdam/common.mjs";
6
+ import { require_constants } from "./constants.mjs";
7
+ import { require_read_concern } from "./read_concern.mjs";
8
+ import { require_write_concern } from "./write_concern.mjs";
9
+ import { require_utils } from "./utils.mjs";
10
+ import { require_timeout } from "./timeout.mjs";
11
+ import { require_execute_operation } from "./operations/execute_operation.mjs";
12
+ import { require_run_command } from "./operations/run_command.mjs";
13
+ import { require_mongo_types } from "./mongo_types.mjs";
14
+ import { require_metrics } from "./cmap/metrics.mjs";
15
+ import { require_transactions } from "./transactions.mjs";
16
+ import { require_resource_management } from "./resource_management.mjs";
17
+
18
+ //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.js
19
+ var require_sessions = /* @__PURE__ */ __commonJSMin(((exports) => {
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ServerSessionPool = exports.ServerSession = exports.ClientSession = void 0;
22
+ exports.maybeClearPinnedConnection = maybeClearPinnedConnection;
23
+ exports.applySession = applySession;
24
+ exports.updateSessionFromResponse = updateSessionFromResponse;
25
+ const bson_1 = require_bson();
26
+ const metrics_1 = require_metrics();
27
+ const constants_1 = require_constants();
28
+ const error_1 = require_error();
29
+ const mongo_types_1 = require_mongo_types();
30
+ const execute_operation_1 = require_execute_operation();
31
+ const run_command_1 = require_run_command();
32
+ const read_concern_1 = require_read_concern();
33
+ const read_preference_1 = require_read_preference();
34
+ const resource_management_1 = require_resource_management();
35
+ const common_1 = require_common();
36
+ const timeout_1 = require_timeout();
37
+ const transactions_1 = require_transactions();
38
+ const utils_1 = require_utils();
39
+ const write_concern_1 = require_write_concern();
40
+ /**
41
+ * A class representing a client session on the server
42
+ *
43
+ * NOTE: not meant to be instantiated directly.
44
+ * @public
45
+ */
46
+ var ClientSession = class ClientSession extends mongo_types_1.TypedEventEmitter {
47
+ /**
48
+ * Create a client session.
49
+ * @internal
50
+ * @param client - The current client
51
+ * @param sessionPool - The server session pool (Internal Class)
52
+ * @param options - Optional settings
53
+ * @param clientOptions - Optional settings provided when creating a MongoClient
54
+ */
55
+ constructor(client, sessionPool, options, clientOptions) {
56
+ super();
57
+ /** @internal */
58
+ this.timeoutContext = null;
59
+ this.on("error", utils_1.noop);
60
+ if (client == null) throw new error_1.MongoRuntimeError("ClientSession requires a MongoClient");
61
+ if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) throw new error_1.MongoRuntimeError("ClientSession requires a ServerSessionPool");
62
+ options = options ?? {};
63
+ this.snapshotEnabled = options.snapshot === true;
64
+ if (options.causalConsistency === true && this.snapshotEnabled) throw new error_1.MongoInvalidArgumentError("Properties \"causalConsistency\" and \"snapshot\" are mutually exclusive");
65
+ this.client = client;
66
+ this.sessionPool = sessionPool;
67
+ this.hasEnded = false;
68
+ this.clientOptions = clientOptions;
69
+ this.timeoutMS = options.defaultTimeoutMS ?? client.s.options?.timeoutMS;
70
+ this.explicit = !!options.explicit;
71
+ this._serverSession = this.explicit ? this.sessionPool.acquire() : null;
72
+ this.txnNumberIncrement = 0;
73
+ const defaultCausalConsistencyValue = this.explicit && options.snapshot !== true;
74
+ this.supports = { causalConsistency: options.causalConsistency ?? defaultCausalConsistencyValue };
75
+ this.clusterTime = options.initialClusterTime;
76
+ this.operationTime = void 0;
77
+ this.owner = options.owner;
78
+ this.defaultTransactionOptions = { ...options.defaultTransactionOptions };
79
+ this.transaction = new transactions_1.Transaction();
80
+ }
81
+ /** The server id associated with this session */
82
+ get id() {
83
+ return this.serverSession?.id;
84
+ }
85
+ get serverSession() {
86
+ let serverSession = this._serverSession;
87
+ if (serverSession == null) {
88
+ if (this.explicit) throw new error_1.MongoRuntimeError("Unexpected null serverSession for an explicit session");
89
+ if (this.hasEnded) throw new error_1.MongoRuntimeError("Unexpected null serverSession for an ended implicit session");
90
+ serverSession = this.sessionPool.acquire();
91
+ this._serverSession = serverSession;
92
+ }
93
+ return serverSession;
94
+ }
95
+ get loadBalanced() {
96
+ return this.client.topology?.description.type === common_1.TopologyType.LoadBalanced;
97
+ }
98
+ /** @internal */
99
+ pin(conn) {
100
+ if (this.pinnedConnection) throw TypeError("Cannot pin multiple connections to the same session");
101
+ this.pinnedConnection = conn;
102
+ conn.emit(constants_1.PINNED, this.inTransaction() ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR);
103
+ }
104
+ /** @internal */
105
+ unpin(options) {
106
+ if (this.loadBalanced) return maybeClearPinnedConnection(this, options);
107
+ this.transaction.unpinServer();
108
+ }
109
+ get isPinned() {
110
+ return this.loadBalanced ? !!this.pinnedConnection : this.transaction.isPinned;
111
+ }
112
+ /**
113
+ * Frees any client-side resources held by the current session. If a session is in a transaction,
114
+ * the transaction is aborted.
115
+ *
116
+ * Does not end the session on the server.
117
+ *
118
+ * @param options - Optional settings. Currently reserved for future use
119
+ */
120
+ async endSession(options) {
121
+ try {
122
+ if (this.inTransaction()) await this.abortTransaction({
123
+ ...options,
124
+ throwTimeout: true
125
+ });
126
+ } catch (error) {
127
+ if (error.name === "MongoOperationTimeoutError") throw error;
128
+ (0, utils_1.squashError)(error);
129
+ } finally {
130
+ if (!this.hasEnded) {
131
+ const serverSession = this.serverSession;
132
+ if (serverSession != null) {
133
+ this.sessionPool.release(serverSession);
134
+ this._serverSession = new ServerSession(serverSession);
135
+ }
136
+ this.hasEnded = true;
137
+ this.emit("ended", this);
138
+ }
139
+ maybeClearPinnedConnection(this, {
140
+ force: true,
141
+ ...options
142
+ });
143
+ }
144
+ }
145
+ /** @internal */
146
+ async asyncDispose() {
147
+ await this.endSession({ force: true });
148
+ }
149
+ /**
150
+ * Advances the operationTime for a ClientSession.
151
+ *
152
+ * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to
153
+ */
154
+ advanceOperationTime(operationTime) {
155
+ if (this.operationTime == null) {
156
+ this.operationTime = operationTime;
157
+ return;
158
+ }
159
+ if (operationTime.greaterThan(this.operationTime)) this.operationTime = operationTime;
160
+ }
161
+ /**
162
+ * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession
163
+ *
164
+ * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature
165
+ */
166
+ advanceClusterTime(clusterTime) {
167
+ if (!clusterTime || typeof clusterTime !== "object") throw new error_1.MongoInvalidArgumentError("input cluster time must be an object");
168
+ if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== "Timestamp") throw new error_1.MongoInvalidArgumentError("input cluster time \"clusterTime\" property must be a valid BSON Timestamp");
169
+ if (!clusterTime.signature || clusterTime.signature.hash?._bsontype !== "Binary" || typeof clusterTime.signature.keyId !== "bigint" && typeof clusterTime.signature.keyId !== "number" && clusterTime.signature.keyId?._bsontype !== "Long") throw new error_1.MongoInvalidArgumentError("input cluster time must have a valid \"signature\" property with BSON Binary hash and BSON Long keyId");
170
+ (0, common_1._advanceClusterTime)(this, clusterTime);
171
+ }
172
+ /**
173
+ * Used to determine if this session equals another
174
+ *
175
+ * @param session - The session to compare to
176
+ */
177
+ equals(session) {
178
+ if (!(session instanceof ClientSession)) return false;
179
+ if (this.id == null || session.id == null) return false;
180
+ return utils_1.ByteUtils.equals(this.id.id.buffer, session.id.id.buffer);
181
+ }
182
+ /**
183
+ * Increment the transaction number on the internal ServerSession
184
+ *
185
+ * @privateRemarks
186
+ * This helper increments a value stored on the client session that will be
187
+ * added to the serverSession's txnNumber upon applying it to a command.
188
+ * This is because the serverSession is lazily acquired after a connection is obtained
189
+ */
190
+ incrementTransactionNumber() {
191
+ this.txnNumberIncrement += 1;
192
+ }
193
+ /** @returns whether this session is currently in a transaction or not */
194
+ inTransaction() {
195
+ return this.transaction.isActive;
196
+ }
197
+ /**
198
+ * Starts a new transaction with the given options.
199
+ *
200
+ * @remarks
201
+ * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
202
+ * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
203
+ * undefined behaviour.
204
+ *
205
+ * @param options - Options for the transaction
206
+ */
207
+ startTransaction(options) {
208
+ if (this.snapshotEnabled) throw new error_1.MongoCompatibilityError("Transactions are not supported in snapshot sessions");
209
+ if (this.inTransaction()) throw new error_1.MongoTransactionError("Transaction already in progress");
210
+ if (this.isPinned && this.transaction.isCommitted) this.unpin();
211
+ this.commitAttempted = false;
212
+ this.incrementTransactionNumber();
213
+ this.transaction = new transactions_1.Transaction({
214
+ readConcern: options?.readConcern ?? this.defaultTransactionOptions.readConcern ?? this.clientOptions?.readConcern,
215
+ writeConcern: options?.writeConcern ?? this.defaultTransactionOptions.writeConcern ?? this.clientOptions?.writeConcern,
216
+ readPreference: options?.readPreference ?? this.defaultTransactionOptions.readPreference ?? this.clientOptions?.readPreference,
217
+ maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS
218
+ });
219
+ this.transaction.transition(transactions_1.TxnState.STARTING_TRANSACTION);
220
+ }
221
+ /**
222
+ * Commits the currently active transaction in this session.
223
+ *
224
+ * @param options - Optional options, can be used to override `defaultTimeoutMS`.
225
+ */
226
+ async commitTransaction(options) {
227
+ if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) throw new error_1.MongoTransactionError("No transaction started");
228
+ if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) {
229
+ this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY);
230
+ return;
231
+ }
232
+ if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) throw new error_1.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction");
233
+ const command = { commitTransaction: 1 };
234
+ const timeoutMS = typeof options?.timeoutMS === "number" ? options.timeoutMS : typeof this.timeoutMS === "number" ? this.timeoutMS : null;
235
+ const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern;
236
+ if (wc != null) if (timeoutMS == null && this.timeoutContext == null) write_concern_1.WriteConcern.apply(command, {
237
+ wtimeoutMS: 1e4,
238
+ w: "majority",
239
+ ...wc
240
+ });
241
+ else {
242
+ const wcKeys = Object.keys(wc);
243
+ if (wcKeys.length > 2 || !wcKeys.includes("wtimeoutMS") && !wcKeys.includes("wTimeoutMS")) write_concern_1.WriteConcern.apply(command, {
244
+ ...wc,
245
+ wtimeoutMS: void 0
246
+ });
247
+ }
248
+ if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.commitAttempted) if (timeoutMS == null && this.timeoutContext == null) write_concern_1.WriteConcern.apply(command, {
249
+ wtimeoutMS: 1e4,
250
+ ...wc,
251
+ w: "majority"
252
+ });
253
+ else write_concern_1.WriteConcern.apply(command, {
254
+ w: "majority",
255
+ ...wc,
256
+ wtimeoutMS: void 0
257
+ });
258
+ if (typeof this.transaction.options.maxTimeMS === "number") command.maxTimeMS = this.transaction.options.maxTimeMS;
259
+ if (this.transaction.recoveryToken) command.recoveryToken = this.transaction.recoveryToken;
260
+ const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, {
261
+ session: this,
262
+ readPreference: read_preference_1.ReadPreference.primary,
263
+ bypassPinningCheck: true
264
+ });
265
+ const timeoutContext = this.timeoutContext ?? (typeof timeoutMS === "number" ? timeout_1.TimeoutContext.create({
266
+ serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,
267
+ socketTimeoutMS: this.clientOptions.socketTimeoutMS,
268
+ timeoutMS
269
+ }) : null);
270
+ try {
271
+ await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);
272
+ this.commitAttempted = void 0;
273
+ return;
274
+ } catch (firstCommitError) {
275
+ this.commitAttempted = true;
276
+ if (firstCommitError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstCommitError)) {
277
+ write_concern_1.WriteConcern.apply(command, {
278
+ wtimeoutMS: 1e4,
279
+ ...wc,
280
+ w: "majority"
281
+ });
282
+ this.unpin({ force: true });
283
+ try {
284
+ await (0, execute_operation_1.executeOperation)(this.client, new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, {
285
+ session: this,
286
+ readPreference: read_preference_1.ReadPreference.primary,
287
+ bypassPinningCheck: true
288
+ }), timeoutContext);
289
+ return;
290
+ } catch (retryCommitError) {
291
+ if (shouldAddUnknownTransactionCommitResultLabel(retryCommitError)) retryCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult);
292
+ if (shouldUnpinAfterCommitError(retryCommitError)) this.unpin({ error: retryCommitError });
293
+ throw retryCommitError;
294
+ }
295
+ }
296
+ if (shouldAddUnknownTransactionCommitResultLabel(firstCommitError)) firstCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult);
297
+ if (shouldUnpinAfterCommitError(firstCommitError)) this.unpin({ error: firstCommitError });
298
+ throw firstCommitError;
299
+ } finally {
300
+ this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED);
301
+ }
302
+ }
303
+ async abortTransaction(options) {
304
+ if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) throw new error_1.MongoTransactionError("No transaction started");
305
+ if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) {
306
+ this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED);
307
+ return;
308
+ }
309
+ if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) throw new error_1.MongoTransactionError("Cannot call abortTransaction twice");
310
+ if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) throw new error_1.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction");
311
+ const command = { abortTransaction: 1 };
312
+ const timeoutMS = typeof options?.timeoutMS === "number" ? options.timeoutMS : this.timeoutContext?.csotEnabled() ? this.timeoutContext.timeoutMS : typeof this.timeoutMS === "number" ? this.timeoutMS : null;
313
+ const timeoutContext = timeoutMS != null ? timeout_1.TimeoutContext.create({
314
+ timeoutMS,
315
+ serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,
316
+ socketTimeoutMS: this.clientOptions.socketTimeoutMS
317
+ }) : null;
318
+ const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern;
319
+ if (wc != null && timeoutMS == null) write_concern_1.WriteConcern.apply(command, {
320
+ wtimeoutMS: 1e4,
321
+ w: "majority",
322
+ ...wc
323
+ });
324
+ if (this.transaction.recoveryToken) command.recoveryToken = this.transaction.recoveryToken;
325
+ const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, {
326
+ session: this,
327
+ readPreference: read_preference_1.ReadPreference.primary,
328
+ bypassPinningCheck: true
329
+ });
330
+ try {
331
+ await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);
332
+ this.unpin();
333
+ return;
334
+ } catch (firstAbortError) {
335
+ this.unpin();
336
+ if (firstAbortError.name === "MongoRuntimeError") throw firstAbortError;
337
+ if (options?.throwTimeout && firstAbortError.name === "MongoOperationTimeoutError") throw firstAbortError;
338
+ if (firstAbortError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstAbortError)) try {
339
+ await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);
340
+ return;
341
+ } catch (secondAbortError) {
342
+ if (secondAbortError.name === "MongoRuntimeError") throw secondAbortError;
343
+ if (options?.throwTimeout && secondAbortError.name === "MongoOperationTimeoutError") throw secondAbortError;
344
+ }
345
+ } finally {
346
+ this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED);
347
+ if (this.loadBalanced) maybeClearPinnedConnection(this, { force: false });
348
+ }
349
+ }
350
+ /**
351
+ * This is here to ensure that ClientSession is never serialized to BSON.
352
+ */
353
+ toBSON() {
354
+ throw new error_1.MongoRuntimeError("ClientSession cannot be serialized to BSON.");
355
+ }
356
+ /**
357
+ * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed.
358
+ *
359
+ * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise.
360
+ *
361
+ * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
362
+ * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
363
+ * undefined behaviour.
364
+ *
365
+ * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not
366
+ * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS.
367
+ *
368
+ *
369
+ * @remarks
370
+ * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function.
371
+ * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error.
372
+ * - If the transaction is manually aborted within the provided function it will not throw.
373
+ * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times.
374
+ *
375
+ * Checkout a descriptive example here:
376
+ * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions
377
+ *
378
+ * If a command inside withTransaction fails:
379
+ * - It may cause the transaction on the server to be aborted.
380
+ * - This situation is normally handled transparently by the driver.
381
+ * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not.
382
+ * - The driver will then retry the transaction indefinitely.
383
+ *
384
+ * To avoid this situation, the application must not silently handle errors within the provided function.
385
+ * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction.
386
+ *
387
+ * @param fn - callback to run within a transaction
388
+ * @param options - optional settings for the transaction
389
+ * @returns A raw command response or undefined
390
+ */
391
+ async withTransaction(fn, options) {
392
+ const MAX_TIMEOUT = 12e4;
393
+ const timeoutMS = options?.timeoutMS ?? this.timeoutMS ?? null;
394
+ this.timeoutContext = timeoutMS != null ? timeout_1.TimeoutContext.create({
395
+ timeoutMS,
396
+ serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,
397
+ socketTimeoutMS: this.clientOptions.socketTimeoutMS
398
+ }) : null;
399
+ const startTime = this.timeoutContext?.csotEnabled() ? this.timeoutContext.start : (0, utils_1.now)();
400
+ let committed = false;
401
+ let result;
402
+ try {
403
+ while (!committed) {
404
+ this.startTransaction(options);
405
+ try {
406
+ const promise = fn(this);
407
+ if (!(0, utils_1.isPromiseLike)(promise)) throw new error_1.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise");
408
+ result = await promise;
409
+ if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) return result;
410
+ } catch (fnError) {
411
+ if (!(fnError instanceof error_1.MongoError) || fnError instanceof error_1.MongoInvalidArgumentError) {
412
+ await this.abortTransaction();
413
+ throw fnError;
414
+ }
415
+ if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_IN_PROGRESS) await this.abortTransaction();
416
+ if (fnError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) continue;
417
+ throw fnError;
418
+ }
419
+ while (!committed) try {
420
+ await this.commitTransaction();
421
+ committed = true;
422
+ } catch (commitError) {
423
+ if (!isMaxTimeMSExpiredError(commitError) && commitError.hasErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) continue;
424
+ if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) break;
425
+ throw commitError;
426
+ }
427
+ }
428
+ return result;
429
+ } finally {
430
+ this.timeoutContext = null;
431
+ }
432
+ }
433
+ };
434
+ exports.ClientSession = ClientSession;
435
+ (0, resource_management_1.configureResourceManagement)(ClientSession.prototype);
436
+ const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([
437
+ "CannotSatisfyWriteConcern",
438
+ "UnknownReplWriteConcern",
439
+ "UnsatisfiableWriteConcern"
440
+ ]);
441
+ function shouldUnpinAfterCommitError(commitError) {
442
+ if (commitError instanceof error_1.MongoError) {
443
+ if ((0, error_1.isRetryableWriteError)(commitError) || commitError instanceof error_1.MongoWriteConcernError || isMaxTimeMSExpiredError(commitError)) {
444
+ if (isUnknownTransactionCommitResult(commitError)) return true;
445
+ } else if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) return true;
446
+ }
447
+ return false;
448
+ }
449
+ function shouldAddUnknownTransactionCommitResultLabel(commitError) {
450
+ let ok = (0, error_1.isRetryableWriteError)(commitError);
451
+ ok ||= commitError instanceof error_1.MongoWriteConcernError;
452
+ ok ||= isMaxTimeMSExpiredError(commitError);
453
+ ok &&= isUnknownTransactionCommitResult(commitError);
454
+ return ok;
455
+ }
456
+ function isUnknownTransactionCommitResult(err) {
457
+ const isNonDeterministicWriteConcernError = err instanceof error_1.MongoServerError && err.codeName && NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName);
458
+ return isMaxTimeMSExpiredError(err) || !isNonDeterministicWriteConcernError && err.code !== error_1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && err.code !== error_1.MONGODB_ERROR_CODES.UnknownReplWriteConcern;
459
+ }
460
+ function maybeClearPinnedConnection(session, options) {
461
+ const conn = session.pinnedConnection;
462
+ const error = options?.error;
463
+ if (session.inTransaction() && error && error instanceof error_1.MongoError && error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) return;
464
+ const topology = session.client.topology;
465
+ if (conn && topology != null) {
466
+ const loadBalancer = Array.from(topology.s.servers.values())[0];
467
+ if (options?.error == null || options?.force) {
468
+ loadBalancer.pool.checkIn(conn);
469
+ session.pinnedConnection = void 0;
470
+ conn.emit(constants_1.UNPINNED, session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR);
471
+ if (options?.forceClear) loadBalancer.pool.clear({ serviceId: conn.serviceId });
472
+ }
473
+ }
474
+ }
475
+ function isMaxTimeMSExpiredError(err) {
476
+ if (err == null || !(err instanceof error_1.MongoServerError)) return false;
477
+ return err.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired || err.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired;
478
+ }
479
+ /**
480
+ * Reflects the existence of a session on the server. Can be reused by the session pool.
481
+ * WARNING: not meant to be instantiated directly. For internal use only.
482
+ * @public
483
+ */
484
+ var ServerSession = class {
485
+ /** @internal */
486
+ constructor(cloned) {
487
+ if (cloned != null) {
488
+ const idBytes = Buffer.allocUnsafe(16);
489
+ idBytes.set(cloned.id.id.buffer);
490
+ this.id = { id: new bson_1.Binary(idBytes, cloned.id.id.sub_type) };
491
+ this.lastUse = cloned.lastUse;
492
+ this.txnNumber = cloned.txnNumber;
493
+ this.isDirty = cloned.isDirty;
494
+ return;
495
+ }
496
+ this.id = { id: new bson_1.Binary((0, utils_1.uuidV4)(), bson_1.Binary.SUBTYPE_UUID) };
497
+ this.lastUse = (0, utils_1.now)();
498
+ this.txnNumber = 0;
499
+ this.isDirty = false;
500
+ }
501
+ /**
502
+ * Determines if the server session has timed out.
503
+ *
504
+ * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes"
505
+ */
506
+ hasTimedOut(sessionTimeoutMinutes) {
507
+ return Math.round((0, utils_1.calculateDurationInMs)(this.lastUse) % 864e5 % 36e5 / 6e4) > sessionTimeoutMinutes - 1;
508
+ }
509
+ };
510
+ exports.ServerSession = ServerSession;
511
+ /**
512
+ * Maintains a pool of Server Sessions.
513
+ * For internal use only
514
+ * @internal
515
+ */
516
+ var ServerSessionPool = class {
517
+ constructor(client) {
518
+ if (client == null) throw new error_1.MongoRuntimeError("ServerSessionPool requires a MongoClient");
519
+ this.client = client;
520
+ this.sessions = new utils_1.List();
521
+ }
522
+ /**
523
+ * Acquire a Server Session from the pool.
524
+ * Iterates through each session in the pool, removing any stale sessions
525
+ * along the way. The first non-stale session found is removed from the
526
+ * pool and returned. If no non-stale session is found, a new ServerSession is created.
527
+ */
528
+ acquire() {
529
+ const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10;
530
+ let session = null;
531
+ while (this.sessions.length > 0) {
532
+ const potentialSession = this.sessions.shift();
533
+ if (potentialSession != null && (!!this.client.topology?.loadBalanced || !potentialSession.hasTimedOut(sessionTimeoutMinutes))) {
534
+ session = potentialSession;
535
+ break;
536
+ }
537
+ }
538
+ if (session == null) session = new ServerSession();
539
+ return session;
540
+ }
541
+ /**
542
+ * Release a session to the session pool
543
+ * Adds the session back to the session pool if the session has not timed out yet.
544
+ * This method also removes any stale sessions from the pool.
545
+ *
546
+ * @param session - The session to release to the pool
547
+ */
548
+ release(session) {
549
+ const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10;
550
+ if (this.client.topology?.loadBalanced && !sessionTimeoutMinutes) this.sessions.unshift(session);
551
+ if (!sessionTimeoutMinutes) return;
552
+ this.sessions.prune((session$1) => session$1.hasTimedOut(sessionTimeoutMinutes));
553
+ if (!session.hasTimedOut(sessionTimeoutMinutes)) {
554
+ if (session.isDirty) return;
555
+ this.sessions.unshift(session);
556
+ }
557
+ }
558
+ };
559
+ exports.ServerSessionPool = ServerSessionPool;
560
+ /**
561
+ * Optionally decorate a command with sessions specific keys
562
+ *
563
+ * @param session - the session tracking transaction state
564
+ * @param command - the command to decorate
565
+ * @param options - Optional settings passed to calling operation
566
+ *
567
+ * @internal
568
+ */
569
+ function applySession(session, command, options) {
570
+ if (session.hasEnded) return new error_1.MongoExpiredSessionError();
571
+ const serverSession = session.serverSession;
572
+ if (serverSession == null) return new error_1.MongoRuntimeError("Unable to acquire server session");
573
+ if (options.writeConcern?.w === 0) {
574
+ if (session && session.explicit) return new error_1.MongoAPIError("Cannot have explicit session with unacknowledged writes");
575
+ return;
576
+ }
577
+ serverSession.lastUse = (0, utils_1.now)();
578
+ command.lsid = serverSession.id;
579
+ const inTxnOrTxnCommand = session.inTransaction() || (0, transactions_1.isTransactionCommand)(command);
580
+ if (!!options.willRetryWrite || inTxnOrTxnCommand) {
581
+ serverSession.txnNumber += session.txnNumberIncrement;
582
+ session.txnNumberIncrement = 0;
583
+ command.txnNumber = bson_1.Long.fromNumber(serverSession.txnNumber);
584
+ }
585
+ if (!inTxnOrTxnCommand) {
586
+ if (session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION) session.transaction.transition(transactions_1.TxnState.NO_TRANSACTION);
587
+ if (session.supports.causalConsistency && session.operationTime && (0, utils_1.commandSupportsReadConcern)(command)) {
588
+ command.readConcern = command.readConcern || {};
589
+ Object.assign(command.readConcern, { afterClusterTime: session.operationTime });
590
+ } else if (session.snapshotEnabled) {
591
+ command.readConcern = command.readConcern || { level: read_concern_1.ReadConcernLevel.snapshot };
592
+ if (session.snapshotTime != null) Object.assign(command.readConcern, { atClusterTime: session.snapshotTime });
593
+ }
594
+ return;
595
+ }
596
+ command.autocommit = false;
597
+ if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) {
598
+ session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS);
599
+ command.startTransaction = true;
600
+ const readConcern = session.transaction.options.readConcern || session?.clientOptions?.readConcern;
601
+ if (readConcern) command.readConcern = readConcern;
602
+ if (session.supports.causalConsistency && session.operationTime) {
603
+ command.readConcern = command.readConcern || {};
604
+ Object.assign(command.readConcern, { afterClusterTime: session.operationTime });
605
+ }
606
+ }
607
+ }
608
+ function updateSessionFromResponse(session, document) {
609
+ if (document.$clusterTime) (0, common_1._advanceClusterTime)(session, document.$clusterTime);
610
+ if (document.operationTime && session && session.supports.causalConsistency) session.advanceOperationTime(document.operationTime);
611
+ if (document.recoveryToken && session && session.inTransaction()) session.transaction._recoveryToken = document.recoveryToken;
612
+ if (session?.snapshotEnabled && session.snapshotTime == null) {
613
+ const atClusterTime = document.atClusterTime;
614
+ if (atClusterTime) session.snapshotTime = atClusterTime;
615
+ }
616
+ }
617
+ }));
618
+
619
+ //#endregion
620
+ export default require_sessions();
621
+
622
+ export { require_sessions };
623
+ //# sourceMappingURL=sessions.mjs.map