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.
- package/dist/_virtual/rolldown_runtime.mjs +8 -0
- package/dist/adapters/drizzle-adapter/index.mjs +4 -1
- package/dist/adapters/drizzle-adapter/index.mjs.map +1 -1
- package/dist/adapters/mongodb-adapter/index.mjs +12 -11
- package/dist/adapters/mongodb-adapter/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +14 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +54 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +36 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +27 -0
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +3728 -0
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +1 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +137 -0
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +211 -0
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +95 -0
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +158 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +195 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +710 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +53 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +63 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +368 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +234 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +545 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +83 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +146 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +58 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +30 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +135 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +25 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +47 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +362 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +58 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +123 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +128 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +133 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +126 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +79 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +65 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +127 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +47 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +44 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +101 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +33 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +53 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +29 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +83 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +36 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +32 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +206 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +45 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +213 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +411 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +288 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +423 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +483 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +207 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +116 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +183 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +55 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +60 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +139 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +28 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +117 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +182 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +304 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +34 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +739 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +805 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +174 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +726 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +172 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +103 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +66 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +41 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +365 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +50 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +48 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +23 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +106 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +428 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +124 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +95 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +1305 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +59 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +250 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +170 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +315 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +925 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +520 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +90 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +582 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +64 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +86 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +60 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +264 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +109 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +172 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +68 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +53 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +123 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +119 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +65 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +97 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +47 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +188 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +103 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +136 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +61 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +179 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +77 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +48 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +60 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +43 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +105 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +50 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +39 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +49 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +58 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +46 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +48 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +46 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +67 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +37 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +171 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +45 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +71 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +165 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +62 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +51 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +156 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +477 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +315 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +157 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +184 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +96 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +107 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +540 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +298 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +623 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +91 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +254 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +138 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +993 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +81 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +171 -0
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +1 -0
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +295 -0
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +1 -0
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +81 -0
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +206 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +33590 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +37 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +18 -0
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +1 -0
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +252 -0
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +41 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +41 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +173 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +334 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +90 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +356 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +23 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +29 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +140 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +831 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +77 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +147 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +1 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +17 -0
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +1 -0
- package/package.json +1 -39
|
@@ -0,0 +1,315 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,cA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M,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"}
|
package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,QAAQ,kBAAkB,8DAA8D;AAEtG,QAAK,UACD,OAAO,YAAY,WACb,QAAQ,YAAY,WAAW,QAAQ,CAAC,UAAU,GAClD,QAAQ,UAAU;AAC5B,QAAK,OAAO,gBAAgB,OAAO,QAAQ;AAC3C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