pecunia-root 0.0.9 → 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/db/migrations/index.mjs +0 -6
- package/dist/db/migrations/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 +2 -40
package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { require_bson } from "../bson.mjs";
|
|
3
|
+
import { require_common } from "../sdam/common.mjs";
|
|
4
|
+
import { require_server_description } from "../sdam/server_description.mjs";
|
|
5
|
+
|
|
6
|
+
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.js
|
|
7
|
+
var require_stream_description = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.StreamDescription = void 0;
|
|
10
|
+
const bson_1 = require_bson();
|
|
11
|
+
const common_1 = require_common();
|
|
12
|
+
const server_description_1 = require_server_description();
|
|
13
|
+
const RESPONSE_FIELDS = [
|
|
14
|
+
"minWireVersion",
|
|
15
|
+
"maxWireVersion",
|
|
16
|
+
"maxBsonObjectSize",
|
|
17
|
+
"maxMessageSizeBytes",
|
|
18
|
+
"maxWriteBatchSize",
|
|
19
|
+
"logicalSessionTimeoutMinutes"
|
|
20
|
+
];
|
|
21
|
+
/** @public */
|
|
22
|
+
var StreamDescription = class {
|
|
23
|
+
constructor(address, options) {
|
|
24
|
+
this.hello = null;
|
|
25
|
+
this.address = address;
|
|
26
|
+
this.type = common_1.ServerType.Unknown;
|
|
27
|
+
this.minWireVersion = void 0;
|
|
28
|
+
this.maxWireVersion = void 0;
|
|
29
|
+
this.maxBsonObjectSize = 16777216;
|
|
30
|
+
this.maxMessageSizeBytes = 48e6;
|
|
31
|
+
this.maxWriteBatchSize = 1e5;
|
|
32
|
+
this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes;
|
|
33
|
+
this.loadBalanced = !!options?.loadBalanced;
|
|
34
|
+
this.compressors = options && options.compressors && Array.isArray(options.compressors) ? options.compressors : [];
|
|
35
|
+
this.serverConnectionId = null;
|
|
36
|
+
}
|
|
37
|
+
receiveResponse(response) {
|
|
38
|
+
if (response == null) return;
|
|
39
|
+
this.hello = response;
|
|
40
|
+
this.type = (0, server_description_1.parseServerType)(response);
|
|
41
|
+
if ("connectionId" in response) this.serverConnectionId = this.parseServerConnectionID(response.connectionId);
|
|
42
|
+
else this.serverConnectionId = null;
|
|
43
|
+
for (const field of RESPONSE_FIELDS) {
|
|
44
|
+
if (response[field] != null) this[field] = response[field];
|
|
45
|
+
if ("__nodejs_mock_server__" in response) this.__nodejs_mock_server__ = response["__nodejs_mock_server__"];
|
|
46
|
+
}
|
|
47
|
+
if (response.compression) this.compressor = this.compressors.filter((c) => response.compression?.includes(c))[0];
|
|
48
|
+
}
|
|
49
|
+
parseServerConnectionID(serverConnectionId) {
|
|
50
|
+
return bson_1.Long.isLong(serverConnectionId) ? serverConnectionId.toBigInt() : BigInt(serverConnectionId);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.StreamDescription = StreamDescription;
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export default require_stream_description();
|
|
58
|
+
|
|
59
|
+
export { require_stream_description };
|
|
60
|
+
//# sourceMappingURL=stream_description.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream_description.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StreamDescription = void 0;\nconst bson_1 = require(\"../bson\");\nconst common_1 = require(\"../sdam/common\");\nconst server_description_1 = require(\"../sdam/server_description\");\nconst RESPONSE_FIELDS = [\n 'minWireVersion',\n 'maxWireVersion',\n 'maxBsonObjectSize',\n 'maxMessageSizeBytes',\n 'maxWriteBatchSize',\n 'logicalSessionTimeoutMinutes'\n];\n/** @public */\nclass StreamDescription {\n constructor(address, options) {\n this.hello = null;\n this.address = address;\n this.type = common_1.ServerType.Unknown;\n this.minWireVersion = undefined;\n this.maxWireVersion = undefined;\n this.maxBsonObjectSize = 16777216;\n this.maxMessageSizeBytes = 48000000;\n this.maxWriteBatchSize = 100000;\n this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes;\n this.loadBalanced = !!options?.loadBalanced;\n this.compressors =\n options && options.compressors && Array.isArray(options.compressors)\n ? options.compressors\n : [];\n this.serverConnectionId = null;\n }\n receiveResponse(response) {\n if (response == null) {\n return;\n }\n this.hello = response;\n this.type = (0, server_description_1.parseServerType)(response);\n if ('connectionId' in response) {\n this.serverConnectionId = this.parseServerConnectionID(response.connectionId);\n }\n else {\n this.serverConnectionId = null;\n }\n for (const field of RESPONSE_FIELDS) {\n if (response[field] != null) {\n this[field] = response[field];\n }\n // testing case\n if ('__nodejs_mock_server__' in response) {\n this.__nodejs_mock_server__ = response['__nodejs_mock_server__'];\n }\n }\n if (response.compression) {\n this.compressor = this.compressors.filter(c => response.compression?.includes(c))[0];\n }\n }\n /* @internal */\n parseServerConnectionID(serverConnectionId) {\n // Connection ids are always integral, so it's safe to coerce doubles as well as\n // any integral type.\n return bson_1.Long.isLong(serverConnectionId)\n ? serverConnectionId.toBigInt()\n : // @ts-expect-error: Doubles are coercible to number\n BigInt(serverConnectionId);\n }\n}\nexports.StreamDescription = StreamDescription;\n//# sourceMappingURL=stream_description.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,oBAAoB,KAAK;CACjC,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,kBAAkB;EACpB;EACA;EACA;EACA;EACA;EACA;EACH;;CAED,IAAM,oBAAN,MAAwB;EACpB,YAAY,SAAS,SAAS;AAC1B,QAAK,QAAQ;AACb,QAAK,UAAU;AACf,QAAK,OAAO,SAAS,WAAW;AAChC,QAAK,iBAAiB;AACtB,QAAK,iBAAiB;AACtB,QAAK,oBAAoB;AACzB,QAAK,sBAAsB;AAC3B,QAAK,oBAAoB;AACzB,QAAK,+BAA+B,SAAS;AAC7C,QAAK,eAAe,CAAC,CAAC,SAAS;AAC/B,QAAK,cACD,WAAW,QAAQ,eAAe,MAAM,QAAQ,QAAQ,YAAY,GAC9D,QAAQ,cACR,EAAE;AACZ,QAAK,qBAAqB;;EAE9B,gBAAgB,UAAU;AACtB,OAAI,YAAY,KACZ;AAEJ,QAAK,QAAQ;AACb,QAAK,QAAQ,GAAG,qBAAqB,iBAAiB,SAAS;AAC/D,OAAI,kBAAkB,SAClB,MAAK,qBAAqB,KAAK,wBAAwB,SAAS,aAAa;OAG7E,MAAK,qBAAqB;AAE9B,QAAK,MAAM,SAAS,iBAAiB;AACjC,QAAI,SAAS,UAAU,KACnB,MAAK,SAAS,SAAS;AAG3B,QAAI,4BAA4B,SAC5B,MAAK,yBAAyB,SAAS;;AAG/C,OAAI,SAAS,YACT,MAAK,aAAa,KAAK,YAAY,QAAO,MAAK,SAAS,aAAa,SAAS,EAAE,CAAC,CAAC;;EAI1F,wBAAwB,oBAAoB;AAGxC,UAAO,OAAO,KAAK,OAAO,mBAAmB,GACvC,mBAAmB,UAAU,GAE3B,OAAO,mBAAmB;;;AAG1C,SAAQ,oBAAoB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { require_error } from "../../error.mjs";
|
|
3
|
+
import { require_constants } from "./constants.mjs";
|
|
4
|
+
import { require_constants as require_constants$1 } from "../../constants.mjs";
|
|
5
|
+
import { require_deps } from "../../deps.mjs";
|
|
6
|
+
import { require_commands } from "../commands.mjs";
|
|
7
|
+
|
|
8
|
+
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js
|
|
9
|
+
var require_compression = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.uncompressibleCommands = exports.Compressor = void 0;
|
|
12
|
+
exports.compress = compress;
|
|
13
|
+
exports.decompress = decompress;
|
|
14
|
+
exports.compressCommand = compressCommand;
|
|
15
|
+
exports.decompressResponse = decompressResponse;
|
|
16
|
+
const util_1 = __require("util");
|
|
17
|
+
const zlib = __require("zlib");
|
|
18
|
+
const constants_1 = require_constants$1();
|
|
19
|
+
const deps_1 = require_deps();
|
|
20
|
+
const error_1 = require_error();
|
|
21
|
+
const commands_1 = require_commands();
|
|
22
|
+
const constants_2 = require_constants();
|
|
23
|
+
/** @public */
|
|
24
|
+
exports.Compressor = Object.freeze({
|
|
25
|
+
none: 0,
|
|
26
|
+
snappy: 1,
|
|
27
|
+
zlib: 2,
|
|
28
|
+
zstd: 3
|
|
29
|
+
});
|
|
30
|
+
exports.uncompressibleCommands = new Set([
|
|
31
|
+
constants_1.LEGACY_HELLO_COMMAND,
|
|
32
|
+
"saslStart",
|
|
33
|
+
"saslContinue",
|
|
34
|
+
"getnonce",
|
|
35
|
+
"authenticate",
|
|
36
|
+
"createUser",
|
|
37
|
+
"updateUser",
|
|
38
|
+
"copydbSaslStart",
|
|
39
|
+
"copydbgetnonce",
|
|
40
|
+
"copydb"
|
|
41
|
+
]);
|
|
42
|
+
const ZSTD_COMPRESSION_LEVEL = 3;
|
|
43
|
+
const zlibInflate = (0, util_1.promisify)(zlib.inflate.bind(zlib));
|
|
44
|
+
const zlibDeflate = (0, util_1.promisify)(zlib.deflate.bind(zlib));
|
|
45
|
+
let zstd;
|
|
46
|
+
let Snappy = null;
|
|
47
|
+
function loadSnappy() {
|
|
48
|
+
if (Snappy == null) {
|
|
49
|
+
const snappyImport = (0, deps_1.getSnappy)();
|
|
50
|
+
if ("kModuleError" in snappyImport) throw snappyImport.kModuleError;
|
|
51
|
+
Snappy = snappyImport;
|
|
52
|
+
}
|
|
53
|
+
return Snappy;
|
|
54
|
+
}
|
|
55
|
+
async function compress(options, dataToBeCompressed) {
|
|
56
|
+
const zlibOptions = {};
|
|
57
|
+
switch (options.agreedCompressor) {
|
|
58
|
+
case "snappy":
|
|
59
|
+
Snappy ??= loadSnappy();
|
|
60
|
+
return await Snappy.compress(dataToBeCompressed);
|
|
61
|
+
case "zstd":
|
|
62
|
+
loadZstd();
|
|
63
|
+
if ("kModuleError" in zstd) throw zstd["kModuleError"];
|
|
64
|
+
return await zstd.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL);
|
|
65
|
+
case "zlib":
|
|
66
|
+
if (options.zlibCompressionLevel) zlibOptions.level = options.zlibCompressionLevel;
|
|
67
|
+
return await zlibDeflate(dataToBeCompressed, zlibOptions);
|
|
68
|
+
default: throw new error_1.MongoInvalidArgumentError(`Unknown compressor ${options.agreedCompressor} failed to compress`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function decompress(compressorID, compressedData) {
|
|
72
|
+
if (compressorID !== exports.Compressor.snappy && compressorID !== exports.Compressor.zstd && compressorID !== exports.Compressor.zlib && compressorID !== exports.Compressor.none) throw new error_1.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})`);
|
|
73
|
+
switch (compressorID) {
|
|
74
|
+
case exports.Compressor.snappy:
|
|
75
|
+
Snappy ??= loadSnappy();
|
|
76
|
+
return await Snappy.uncompress(compressedData, { asBuffer: true });
|
|
77
|
+
case exports.Compressor.zstd:
|
|
78
|
+
loadZstd();
|
|
79
|
+
if ("kModuleError" in zstd) throw zstd["kModuleError"];
|
|
80
|
+
return await zstd.decompress(compressedData);
|
|
81
|
+
case exports.Compressor.zlib: return await zlibInflate(compressedData);
|
|
82
|
+
default: return compressedData;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Load ZStandard if it is not already set.
|
|
87
|
+
*/
|
|
88
|
+
function loadZstd() {
|
|
89
|
+
if (!zstd) zstd = (0, deps_1.getZstdLibrary)();
|
|
90
|
+
}
|
|
91
|
+
const MESSAGE_HEADER_SIZE = 16;
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
*
|
|
95
|
+
* Compresses an OP_MSG or OP_QUERY message, if compression is configured. This method
|
|
96
|
+
* also serializes the command to BSON.
|
|
97
|
+
*/
|
|
98
|
+
async function compressCommand(command, description) {
|
|
99
|
+
const data = await (description.agreedCompressor === "none" || !commands_1.OpCompressedRequest.canCompress(command) ? command : new commands_1.OpCompressedRequest(command, {
|
|
100
|
+
agreedCompressor: description.agreedCompressor ?? "none",
|
|
101
|
+
zlibCompressionLevel: description.zlibCompressionLevel ?? 0
|
|
102
|
+
})).toBin();
|
|
103
|
+
return Buffer.concat(data);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @internal
|
|
107
|
+
*
|
|
108
|
+
* Decompresses an OP_MSG or OP_QUERY response from the server, if compression is configured.
|
|
109
|
+
*
|
|
110
|
+
* This method does not parse the response's BSON.
|
|
111
|
+
*/
|
|
112
|
+
async function decompressResponse(message) {
|
|
113
|
+
const messageHeader = {
|
|
114
|
+
length: message.readInt32LE(0),
|
|
115
|
+
requestId: message.readInt32LE(4),
|
|
116
|
+
responseTo: message.readInt32LE(8),
|
|
117
|
+
opCode: message.readInt32LE(12)
|
|
118
|
+
};
|
|
119
|
+
if (messageHeader.opCode !== constants_2.OP_COMPRESSED) return new (messageHeader.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply)(message, messageHeader, message.subarray(MESSAGE_HEADER_SIZE));
|
|
120
|
+
const header = {
|
|
121
|
+
...messageHeader,
|
|
122
|
+
fromCompressed: true,
|
|
123
|
+
opCode: message.readInt32LE(MESSAGE_HEADER_SIZE),
|
|
124
|
+
length: message.readInt32LE(MESSAGE_HEADER_SIZE + 4)
|
|
125
|
+
};
|
|
126
|
+
const compressorID = message[MESSAGE_HEADER_SIZE + 8];
|
|
127
|
+
const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9);
|
|
128
|
+
const ResponseType = header.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply;
|
|
129
|
+
const messageBody = await decompress(compressorID, compressedBuffer);
|
|
130
|
+
if (messageBody.length !== header.length) throw new error_1.MongoDecompressionError("Message body and message header must be the same length");
|
|
131
|
+
return new ResponseType(message, header, messageBody);
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
export default require_compression();
|
|
137
|
+
|
|
138
|
+
export { require_compression };
|
|
139
|
+
//# sourceMappingURL=compression.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compression.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uncompressibleCommands = exports.Compressor = void 0;\nexports.compress = compress;\nexports.decompress = decompress;\nexports.compressCommand = compressCommand;\nexports.decompressResponse = decompressResponse;\nconst util_1 = require(\"util\");\nconst zlib = require(\"zlib\");\nconst constants_1 = require(\"../../constants\");\nconst deps_1 = require(\"../../deps\");\nconst error_1 = require(\"../../error\");\nconst commands_1 = require(\"../commands\");\nconst constants_2 = require(\"./constants\");\n/** @public */\nexports.Compressor = Object.freeze({\n none: 0,\n snappy: 1,\n zlib: 2,\n zstd: 3\n});\nexports.uncompressibleCommands = new Set([\n constants_1.LEGACY_HELLO_COMMAND,\n 'saslStart',\n 'saslContinue',\n 'getnonce',\n 'authenticate',\n 'createUser',\n 'updateUser',\n 'copydbSaslStart',\n 'copydbgetnonce',\n 'copydb'\n]);\nconst ZSTD_COMPRESSION_LEVEL = 3;\nconst zlibInflate = (0, util_1.promisify)(zlib.inflate.bind(zlib));\nconst zlibDeflate = (0, util_1.promisify)(zlib.deflate.bind(zlib));\nlet zstd;\nlet Snappy = null;\nfunction loadSnappy() {\n if (Snappy == null) {\n const snappyImport = (0, deps_1.getSnappy)();\n if ('kModuleError' in snappyImport) {\n throw snappyImport.kModuleError;\n }\n Snappy = snappyImport;\n }\n return Snappy;\n}\n// Facilitate compressing a message using an agreed compressor\nasync function compress(options, dataToBeCompressed) {\n const zlibOptions = {};\n switch (options.agreedCompressor) {\n case 'snappy': {\n Snappy ??= loadSnappy();\n return await Snappy.compress(dataToBeCompressed);\n }\n case 'zstd': {\n loadZstd();\n if ('kModuleError' in zstd) {\n throw zstd['kModuleError'];\n }\n return await zstd.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL);\n }\n case 'zlib': {\n if (options.zlibCompressionLevel) {\n zlibOptions.level = options.zlibCompressionLevel;\n }\n return await zlibDeflate(dataToBeCompressed, zlibOptions);\n }\n default: {\n throw new error_1.MongoInvalidArgumentError(`Unknown compressor ${options.agreedCompressor} failed to compress`);\n }\n }\n}\n// Decompress a message using the given compressor\nasync function decompress(compressorID, compressedData) {\n if (compressorID !== exports.Compressor.snappy &&\n compressorID !== exports.Compressor.zstd &&\n compressorID !== exports.Compressor.zlib &&\n compressorID !== exports.Compressor.none) {\n throw new error_1.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})`);\n }\n switch (compressorID) {\n case exports.Compressor.snappy: {\n Snappy ??= loadSnappy();\n return await Snappy.uncompress(compressedData, { asBuffer: true });\n }\n case exports.Compressor.zstd: {\n loadZstd();\n if ('kModuleError' in zstd) {\n throw zstd['kModuleError'];\n }\n return await zstd.decompress(compressedData);\n }\n case exports.Compressor.zlib: {\n return await zlibInflate(compressedData);\n }\n default: {\n return compressedData;\n }\n }\n}\n/**\n * Load ZStandard if it is not already set.\n */\nfunction loadZstd() {\n if (!zstd) {\n zstd = (0, deps_1.getZstdLibrary)();\n }\n}\nconst MESSAGE_HEADER_SIZE = 16;\n/**\n * @internal\n *\n * Compresses an OP_MSG or OP_QUERY message, if compression is configured. This method\n * also serializes the command to BSON.\n */\nasync function compressCommand(command, description) {\n const finalCommand = description.agreedCompressor === 'none' || !commands_1.OpCompressedRequest.canCompress(command)\n ? command\n : new commands_1.OpCompressedRequest(command, {\n agreedCompressor: description.agreedCompressor ?? 'none',\n zlibCompressionLevel: description.zlibCompressionLevel ?? 0\n });\n const data = await finalCommand.toBin();\n return Buffer.concat(data);\n}\n/**\n * @internal\n *\n * Decompresses an OP_MSG or OP_QUERY response from the server, if compression is configured.\n *\n * This method does not parse the response's BSON.\n */\nasync function decompressResponse(message) {\n const messageHeader = {\n length: message.readInt32LE(0),\n requestId: message.readInt32LE(4),\n responseTo: message.readInt32LE(8),\n opCode: message.readInt32LE(12)\n };\n if (messageHeader.opCode !== constants_2.OP_COMPRESSED) {\n const ResponseType = messageHeader.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply;\n const messageBody = message.subarray(MESSAGE_HEADER_SIZE);\n return new ResponseType(message, messageHeader, messageBody);\n }\n const header = {\n ...messageHeader,\n fromCompressed: true,\n opCode: message.readInt32LE(MESSAGE_HEADER_SIZE),\n length: message.readInt32LE(MESSAGE_HEADER_SIZE + 4)\n };\n const compressorID = message[MESSAGE_HEADER_SIZE + 8];\n const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9);\n // recalculate based on wrapped opcode\n const ResponseType = header.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply;\n const messageBody = await decompress(compressorID, compressedBuffer);\n if (messageBody.length !== header.length) {\n throw new error_1.MongoDecompressionError('Message body and message header must be the same length');\n }\n return new ResponseType(message, header, messageBody);\n}\n//# sourceMappingURL=compression.js.map"],"x_google_ignoreList":[0],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js
|
|
4
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OP_MSG = exports.OP_COMPRESSED = exports.OP_DELETE = exports.OP_QUERY = exports.OP_INSERT = exports.OP_UPDATE = exports.OP_REPLY = exports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = exports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = exports.MIN_SUPPORTED_QE_SERVER_VERSION = exports.MIN_SUPPORTED_QE_WIRE_VERSION = exports.MAX_SUPPORTED_WIRE_VERSION = exports.MIN_SUPPORTED_WIRE_VERSION = exports.MAX_SUPPORTED_SERVER_VERSION = exports.MIN_SUPPORTED_SERVER_VERSION = void 0;
|
|
7
|
+
exports.MIN_SUPPORTED_SERVER_VERSION = "4.2";
|
|
8
|
+
exports.MAX_SUPPORTED_SERVER_VERSION = "8.2";
|
|
9
|
+
exports.MIN_SUPPORTED_WIRE_VERSION = 8;
|
|
10
|
+
exports.MAX_SUPPORTED_WIRE_VERSION = 27;
|
|
11
|
+
exports.MIN_SUPPORTED_QE_WIRE_VERSION = 21;
|
|
12
|
+
exports.MIN_SUPPORTED_QE_SERVER_VERSION = "7.0";
|
|
13
|
+
exports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = 27;
|
|
14
|
+
exports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = "8.2";
|
|
15
|
+
exports.OP_REPLY = 1;
|
|
16
|
+
exports.OP_UPDATE = 2001;
|
|
17
|
+
exports.OP_INSERT = 2002;
|
|
18
|
+
exports.OP_QUERY = 2004;
|
|
19
|
+
exports.OP_DELETE = 2006;
|
|
20
|
+
exports.OP_COMPRESSED = 2012;
|
|
21
|
+
exports.OP_MSG = 2013;
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export default require_constants();
|
|
26
|
+
|
|
27
|
+
export { require_constants };
|
|
28
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OP_MSG = exports.OP_COMPRESSED = exports.OP_DELETE = exports.OP_QUERY = exports.OP_INSERT = exports.OP_UPDATE = exports.OP_REPLY = exports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = exports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = exports.MIN_SUPPORTED_QE_SERVER_VERSION = exports.MIN_SUPPORTED_QE_WIRE_VERSION = exports.MAX_SUPPORTED_WIRE_VERSION = exports.MIN_SUPPORTED_WIRE_VERSION = exports.MAX_SUPPORTED_SERVER_VERSION = exports.MIN_SUPPORTED_SERVER_VERSION = void 0;\nexports.MIN_SUPPORTED_SERVER_VERSION = '4.2';\nexports.MAX_SUPPORTED_SERVER_VERSION = '8.2';\nexports.MIN_SUPPORTED_WIRE_VERSION = 8;\nexports.MAX_SUPPORTED_WIRE_VERSION = 27;\nexports.MIN_SUPPORTED_QE_WIRE_VERSION = 21;\nexports.MIN_SUPPORTED_QE_SERVER_VERSION = '7.0';\nexports.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = 27;\nexports.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = '8.2';\nexports.OP_REPLY = 1;\nexports.OP_UPDATE = 2001;\nexports.OP_INSERT = 2002;\nexports.OP_QUERY = 2004;\nexports.OP_DELETE = 2006;\nexports.OP_COMPRESSED = 2012;\nexports.OP_MSG = 2013;\n//# sourceMappingURL=constants.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS,QAAQ,gBAAgB,QAAQ,YAAY,QAAQ,WAAW,QAAQ,YAAY,QAAQ,YAAY,QAAQ,WAAW,QAAQ,wCAAwC,QAAQ,sCAAsC,QAAQ,kCAAkC,QAAQ,gCAAgC,QAAQ,6BAA6B,QAAQ,6BAA6B,QAAQ,+BAA+B,QAAQ,+BAA+B,KAAK;AACxd,SAAQ,+BAA+B;AACvC,SAAQ,+BAA+B;AACvC,SAAQ,6BAA6B;AACrC,SAAQ,6BAA6B;AACrC,SAAQ,gCAAgC;AACxC,SAAQ,kCAAkC;AAC1C,SAAQ,sCAAsC;AAC9C,SAAQ,wCAAwC;AAChD,SAAQ,WAAW;AACnB,SAAQ,YAAY;AACpB,SAAQ,YAAY;AACpB,SAAQ,WAAW;AACnB,SAAQ,YAAY;AACpB,SAAQ,gBAAgB;AACxB,SAAQ,SAAS"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { require_utils } from "../../utils.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js
|
|
5
|
+
var require_on_data = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.onData = onData;
|
|
8
|
+
const utils_1 = require_utils();
|
|
9
|
+
/**
|
|
10
|
+
* onData is adapted from Node.js' events.on helper
|
|
11
|
+
* https://nodejs.org/api/events.html#eventsonemitter-eventname-options
|
|
12
|
+
*
|
|
13
|
+
* Returns an AsyncIterator that iterates each 'data' event emitted from emitter.
|
|
14
|
+
* It will reject upon an error event.
|
|
15
|
+
*/
|
|
16
|
+
function onData(emitter, { timeoutContext, signal }) {
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
/**
|
|
19
|
+
* When the caller has not yet called .next(), we store the
|
|
20
|
+
* value from the event in this list. Next time they call .next()
|
|
21
|
+
* we pull the first value out of this list and resolve a promise with it.
|
|
22
|
+
*/
|
|
23
|
+
const unconsumedEvents = new utils_1.List();
|
|
24
|
+
/**
|
|
25
|
+
* When there has not yet been an event, a new promise will be created
|
|
26
|
+
* and implicitly stored in this list. When an event occurs we take the first
|
|
27
|
+
* promise in this list and resolve it.
|
|
28
|
+
*/
|
|
29
|
+
const unconsumedPromises = new utils_1.List();
|
|
30
|
+
/**
|
|
31
|
+
* Stored an error created by an error event.
|
|
32
|
+
* This error will turn into a rejection for the subsequent .next() call
|
|
33
|
+
*/
|
|
34
|
+
let error = null;
|
|
35
|
+
/** Set to true only after event listeners have been removed. */
|
|
36
|
+
let finished = false;
|
|
37
|
+
const iterator = {
|
|
38
|
+
next() {
|
|
39
|
+
const value = unconsumedEvents.shift();
|
|
40
|
+
if (value != null) return Promise.resolve({
|
|
41
|
+
value,
|
|
42
|
+
done: false
|
|
43
|
+
});
|
|
44
|
+
if (error != null) {
|
|
45
|
+
const p = Promise.reject(error);
|
|
46
|
+
error = null;
|
|
47
|
+
return p;
|
|
48
|
+
}
|
|
49
|
+
if (finished) return closeHandler();
|
|
50
|
+
const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)();
|
|
51
|
+
unconsumedPromises.push({
|
|
52
|
+
resolve,
|
|
53
|
+
reject
|
|
54
|
+
});
|
|
55
|
+
return promise;
|
|
56
|
+
},
|
|
57
|
+
return() {
|
|
58
|
+
return closeHandler();
|
|
59
|
+
},
|
|
60
|
+
throw(err) {
|
|
61
|
+
errorHandler(err);
|
|
62
|
+
return Promise.resolve({
|
|
63
|
+
value: void 0,
|
|
64
|
+
done: true
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
[Symbol.asyncIterator]() {
|
|
68
|
+
return this;
|
|
69
|
+
},
|
|
70
|
+
async [Symbol.asyncDispose]() {
|
|
71
|
+
await closeHandler();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
emitter.on("data", eventHandler);
|
|
75
|
+
emitter.on("error", errorHandler);
|
|
76
|
+
const abortListener = (0, utils_1.addAbortListener)(signal, function() {
|
|
77
|
+
errorHandler(this.reason);
|
|
78
|
+
});
|
|
79
|
+
const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead;
|
|
80
|
+
timeoutForSocketRead?.throwIfExpired();
|
|
81
|
+
timeoutForSocketRead?.then(void 0, errorHandler);
|
|
82
|
+
return iterator;
|
|
83
|
+
function eventHandler(value) {
|
|
84
|
+
const promise = unconsumedPromises.shift();
|
|
85
|
+
if (promise != null) promise.resolve({
|
|
86
|
+
value,
|
|
87
|
+
done: false
|
|
88
|
+
});
|
|
89
|
+
else unconsumedEvents.push(value);
|
|
90
|
+
}
|
|
91
|
+
function errorHandler(err) {
|
|
92
|
+
const promise = unconsumedPromises.shift();
|
|
93
|
+
if (promise != null) promise.reject(err);
|
|
94
|
+
else error = err;
|
|
95
|
+
closeHandler();
|
|
96
|
+
}
|
|
97
|
+
function closeHandler() {
|
|
98
|
+
emitter.off("data", eventHandler);
|
|
99
|
+
emitter.off("error", errorHandler);
|
|
100
|
+
abortListener?.[utils_1.kDispose]();
|
|
101
|
+
finished = true;
|
|
102
|
+
timeoutForSocketRead?.clear();
|
|
103
|
+
const doneResult = {
|
|
104
|
+
value: void 0,
|
|
105
|
+
done: finished
|
|
106
|
+
};
|
|
107
|
+
for (const promise of unconsumedPromises) promise.resolve(doneResult);
|
|
108
|
+
return Promise.resolve(doneResult);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export default require_on_data();
|
|
115
|
+
|
|
116
|
+
export { require_on_data };
|
|
117
|
+
//# sourceMappingURL=on_data.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on_data.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onData = onData;\nconst utils_1 = require(\"../../utils\");\n/**\n * onData is adapted from Node.js' events.on helper\n * https://nodejs.org/api/events.html#eventsonemitter-eventname-options\n *\n * Returns an AsyncIterator that iterates each 'data' event emitted from emitter.\n * It will reject upon an error event.\n */\nfunction onData(emitter, { timeoutContext, signal }) {\n signal?.throwIfAborted();\n // Setup pending events and pending promise lists\n /**\n * When the caller has not yet called .next(), we store the\n * value from the event in this list. Next time they call .next()\n * we pull the first value out of this list and resolve a promise with it.\n */\n const unconsumedEvents = new utils_1.List();\n /**\n * When there has not yet been an event, a new promise will be created\n * and implicitly stored in this list. When an event occurs we take the first\n * promise in this list and resolve it.\n */\n const unconsumedPromises = new utils_1.List();\n /**\n * Stored an error created by an error event.\n * This error will turn into a rejection for the subsequent .next() call\n */\n let error = null;\n /** Set to true only after event listeners have been removed. */\n let finished = false;\n const iterator = {\n next() {\n // First, we consume all unread events\n const value = unconsumedEvents.shift();\n if (value != null) {\n return Promise.resolve({ value, done: false });\n }\n // Then we error, if an error happened\n // This happens one time if at all, because after 'error'\n // we stop listening\n if (error != null) {\n const p = Promise.reject(error);\n // Only the first element errors\n error = null;\n return p;\n }\n // If the iterator is finished, resolve to done\n if (finished)\n return closeHandler();\n // Wait until an event happens\n const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)();\n unconsumedPromises.push({ resolve, reject });\n return promise;\n },\n return() {\n return closeHandler();\n },\n throw(err) {\n errorHandler(err);\n return Promise.resolve({ value: undefined, done: true });\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n // Note this should currently not be used, but is required by the AsyncGenerator interface.\n async [Symbol.asyncDispose]() {\n await closeHandler();\n }\n };\n // Adding event handlers\n emitter.on('data', eventHandler);\n emitter.on('error', errorHandler);\n const abortListener = (0, utils_1.addAbortListener)(signal, function () {\n errorHandler(this.reason);\n });\n const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead;\n timeoutForSocketRead?.throwIfExpired();\n timeoutForSocketRead?.then(undefined, errorHandler);\n return iterator;\n function eventHandler(value) {\n const promise = unconsumedPromises.shift();\n if (promise != null)\n promise.resolve({ value, done: false });\n else\n unconsumedEvents.push(value);\n }\n function errorHandler(err) {\n const promise = unconsumedPromises.shift();\n if (promise != null)\n promise.reject(err);\n else\n error = err;\n void closeHandler();\n }\n function closeHandler() {\n // Adding event handlers\n emitter.off('data', eventHandler);\n emitter.off('error', errorHandler);\n abortListener?.[utils_1.kDispose]();\n finished = true;\n timeoutForSocketRead?.clear();\n const doneResult = { value: undefined, done: finished };\n for (const promise of unconsumedPromises) {\n promise.resolve(doneResult);\n }\n return Promise.resolve(doneResult);\n }\n}\n//# sourceMappingURL=on_data.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS;CACjB,MAAM;;;;;;;;CAQN,SAAS,OAAO,SAAS,EAAE,gBAAgB,UAAU;AACjD,UAAQ,gBAAgB;;;;;;EAOxB,MAAM,mBAAmB,IAAI,QAAQ,MAAM;;;;;;EAM3C,MAAM,qBAAqB,IAAI,QAAQ,MAAM;;;;;EAK7C,IAAI,QAAQ;;EAEZ,IAAI,WAAW;EACf,MAAM,WAAW;GACb,OAAO;IAEH,MAAM,QAAQ,iBAAiB,OAAO;AACtC,QAAI,SAAS,KACT,QAAO,QAAQ,QAAQ;KAAE;KAAO,MAAM;KAAO,CAAC;AAKlD,QAAI,SAAS,MAAM;KACf,MAAM,IAAI,QAAQ,OAAO,MAAM;AAE/B,aAAQ;AACR,YAAO;;AAGX,QAAI,SACA,QAAO,cAAc;IAEzB,MAAM,EAAE,SAAS,SAAS,YAAY,GAAG,QAAQ,uBAAuB;AACxE,uBAAmB,KAAK;KAAE;KAAS;KAAQ,CAAC;AAC5C,WAAO;;GAEX,SAAS;AACL,WAAO,cAAc;;GAEzB,MAAM,KAAK;AACP,iBAAa,IAAI;AACjB,WAAO,QAAQ,QAAQ;KAAE,OAAO;KAAW,MAAM;KAAM,CAAC;;GAE5D,CAAC,OAAO,iBAAiB;AACrB,WAAO;;GAGX,OAAO,OAAO,gBAAgB;AAC1B,UAAM,cAAc;;GAE3B;AAED,UAAQ,GAAG,QAAQ,aAAa;AAChC,UAAQ,GAAG,SAAS,aAAa;EACjC,MAAM,iBAAiB,GAAG,QAAQ,kBAAkB,QAAQ,WAAY;AACpE,gBAAa,KAAK,OAAO;IAC3B;EACF,MAAM,uBAAuB,gBAAgB;AAC7C,wBAAsB,gBAAgB;AACtC,wBAAsB,KAAK,QAAW,aAAa;AACnD,SAAO;EACP,SAAS,aAAa,OAAO;GACzB,MAAM,UAAU,mBAAmB,OAAO;AAC1C,OAAI,WAAW,KACX,SAAQ,QAAQ;IAAE;IAAO,MAAM;IAAO,CAAC;OAEvC,kBAAiB,KAAK,MAAM;;EAEpC,SAAS,aAAa,KAAK;GACvB,MAAM,UAAU,mBAAmB,OAAO;AAC1C,OAAI,WAAW,KACX,SAAQ,OAAO,IAAI;OAEnB,SAAQ;AACZ,GAAK,cAAc;;EAEvB,SAAS,eAAe;AAEpB,WAAQ,IAAI,QAAQ,aAAa;AACjC,WAAQ,IAAI,SAAS,aAAa;AAClC,mBAAgB,QAAQ,WAAW;AACnC,cAAW;AACX,yBAAsB,OAAO;GAC7B,MAAM,aAAa;IAAE,OAAO;IAAW,MAAM;IAAU;AACvD,QAAK,MAAM,WAAW,mBAClB,SAAQ,QAAQ,WAAW;AAE/B,UAAO,QAAQ,QAAQ,WAAW"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { require_bson } from "../../../bson.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js
|
|
5
|
+
var require_document = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.OnDemandDocument = void 0;
|
|
8
|
+
const bson_1 = require_bson();
|
|
9
|
+
const BSONElementOffset = {
|
|
10
|
+
type: 0,
|
|
11
|
+
nameOffset: 1,
|
|
12
|
+
nameLength: 2,
|
|
13
|
+
offset: 3,
|
|
14
|
+
length: 4
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
var OnDemandDocument = class OnDemandDocument {
|
|
18
|
+
constructor(bson, offset = 0, isArray = false, elements) {
|
|
19
|
+
/**
|
|
20
|
+
* Maps JS strings to elements and jsValues for speeding up subsequent lookups.
|
|
21
|
+
* - If `false` then name does not exist in the BSON document
|
|
22
|
+
* - If `CachedBSONElement` instance name exists
|
|
23
|
+
* - If `cache[name].value == null` jsValue has not yet been parsed
|
|
24
|
+
* - Null/Undefined values do not get cached because they are zero-length values.
|
|
25
|
+
*/
|
|
26
|
+
this.cache = Object.create(null);
|
|
27
|
+
/** Caches the index of elements that have been named */
|
|
28
|
+
this.indexFound = Object.create(null);
|
|
29
|
+
this.bson = bson;
|
|
30
|
+
this.offset = offset;
|
|
31
|
+
this.isArray = isArray;
|
|
32
|
+
this.elements = elements ?? (0, bson_1.parseToElementsToArray)(this.bson, offset);
|
|
33
|
+
}
|
|
34
|
+
/** Only supports basic latin strings */
|
|
35
|
+
isElementName(name, element) {
|
|
36
|
+
const nameLength = element[BSONElementOffset.nameLength];
|
|
37
|
+
const nameOffset = element[BSONElementOffset.nameOffset];
|
|
38
|
+
if (name.length !== nameLength) return false;
|
|
39
|
+
const nameEnd = nameOffset + nameLength;
|
|
40
|
+
for (let byteIndex = nameOffset, charIndex = 0; charIndex < name.length && byteIndex < nameEnd; charIndex++, byteIndex++) if (this.bson[byteIndex] !== name.charCodeAt(charIndex)) return false;
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Seeks into the elements array for an element matching the given name.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Caching:
|
|
48
|
+
* - Caches the existence of a property making subsequent look ups for non-existent properties return immediately
|
|
49
|
+
* - Caches names mapped to elements to avoid reiterating the array and comparing the name again
|
|
50
|
+
* - Caches the index at which an element has been found to prevent rechecking against elements already determined to belong to another name
|
|
51
|
+
*
|
|
52
|
+
* @param name - a basic latin string name of a BSON element
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
getElement(name) {
|
|
56
|
+
const cachedElement = this.cache[name];
|
|
57
|
+
if (cachedElement === false) return null;
|
|
58
|
+
if (cachedElement != null) return cachedElement;
|
|
59
|
+
if (typeof name === "number") if (this.isArray) if (name < this.elements.length) {
|
|
60
|
+
const cachedElement$1 = {
|
|
61
|
+
element: this.elements[name],
|
|
62
|
+
value: void 0
|
|
63
|
+
};
|
|
64
|
+
this.cache[name] = cachedElement$1;
|
|
65
|
+
this.indexFound[name] = true;
|
|
66
|
+
return cachedElement$1;
|
|
67
|
+
} else return null;
|
|
68
|
+
else return null;
|
|
69
|
+
for (let index = 0; index < this.elements.length; index++) {
|
|
70
|
+
const element = this.elements[index];
|
|
71
|
+
if (!(index in this.indexFound) && this.isElementName(name, element)) {
|
|
72
|
+
const cachedElement$1 = {
|
|
73
|
+
element,
|
|
74
|
+
value: void 0
|
|
75
|
+
};
|
|
76
|
+
this.cache[name] = cachedElement$1;
|
|
77
|
+
this.indexFound[index] = true;
|
|
78
|
+
return cachedElement$1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.cache[name] = false;
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
toJSValue(element, as) {
|
|
85
|
+
const type = element[BSONElementOffset.type];
|
|
86
|
+
const offset = element[BSONElementOffset.offset];
|
|
87
|
+
const length = element[BSONElementOffset.length];
|
|
88
|
+
if (as !== type) return null;
|
|
89
|
+
switch (as) {
|
|
90
|
+
case bson_1.BSONType.null:
|
|
91
|
+
case bson_1.BSONType.undefined: return null;
|
|
92
|
+
case bson_1.BSONType.double: return (0, bson_1.getFloat64LE)(this.bson, offset);
|
|
93
|
+
case bson_1.BSONType.int: return (0, bson_1.getInt32LE)(this.bson, offset);
|
|
94
|
+
case bson_1.BSONType.long: return (0, bson_1.getBigInt64LE)(this.bson, offset);
|
|
95
|
+
case bson_1.BSONType.bool: return Boolean(this.bson[offset]);
|
|
96
|
+
case bson_1.BSONType.objectId: return new bson_1.ObjectId(this.bson.subarray(offset, offset + 12));
|
|
97
|
+
case bson_1.BSONType.timestamp: return new bson_1.Timestamp((0, bson_1.getBigInt64LE)(this.bson, offset));
|
|
98
|
+
case bson_1.BSONType.string: return (0, bson_1.toUTF8)(this.bson, offset + 4, offset + length - 1, false);
|
|
99
|
+
case bson_1.BSONType.binData: {
|
|
100
|
+
const totalBinarySize = (0, bson_1.getInt32LE)(this.bson, offset);
|
|
101
|
+
const subType = this.bson[offset + 4];
|
|
102
|
+
if (subType === 2) {
|
|
103
|
+
const subType2BinarySize = (0, bson_1.getInt32LE)(this.bson, offset + 1 + 4);
|
|
104
|
+
if (subType2BinarySize < 0) throw new bson_1.BSONError("Negative binary type element size found for subtype 0x02");
|
|
105
|
+
if (subType2BinarySize > totalBinarySize - 4) throw new bson_1.BSONError("Binary type with subtype 0x02 contains too long binary size");
|
|
106
|
+
if (subType2BinarySize < totalBinarySize - 4) throw new bson_1.BSONError("Binary type with subtype 0x02 contains too short binary size");
|
|
107
|
+
return new bson_1.Binary(this.bson.subarray(offset + 1 + 4 + 4, offset + 1 + 4 + 4 + subType2BinarySize), 2);
|
|
108
|
+
}
|
|
109
|
+
return new bson_1.Binary(this.bson.subarray(offset + 1 + 4, offset + 1 + 4 + totalBinarySize), subType);
|
|
110
|
+
}
|
|
111
|
+
case bson_1.BSONType.date: return new Date(Number((0, bson_1.getBigInt64LE)(this.bson, offset)));
|
|
112
|
+
case bson_1.BSONType.object: return new OnDemandDocument(this.bson, offset);
|
|
113
|
+
case bson_1.BSONType.array: return new OnDemandDocument(this.bson, offset, true);
|
|
114
|
+
default: throw new bson_1.BSONError(`Unsupported BSON type: ${as}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns the number of elements in this BSON document
|
|
119
|
+
*/
|
|
120
|
+
size() {
|
|
121
|
+
return this.elements.length;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Checks for the existence of an element by name.
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* Uses `getElement` with the expectation that will populate caches such that a `has` call
|
|
128
|
+
* followed by a `getElement` call will not repeat the cost paid by the first look up.
|
|
129
|
+
*
|
|
130
|
+
* @param name - element name
|
|
131
|
+
*/
|
|
132
|
+
has(name) {
|
|
133
|
+
const cachedElement = this.cache[name];
|
|
134
|
+
if (cachedElement === false) return false;
|
|
135
|
+
if (cachedElement != null) return true;
|
|
136
|
+
return this.getElement(name) != null;
|
|
137
|
+
}
|
|
138
|
+
get(name, as, required) {
|
|
139
|
+
const element = this.getElement(name);
|
|
140
|
+
if (element == null) if (required === true) throw new bson_1.BSONError(`BSON element "${name}" is missing`);
|
|
141
|
+
else return null;
|
|
142
|
+
if (element.value == null) {
|
|
143
|
+
const value = this.toJSValue(element.element, as);
|
|
144
|
+
if (value == null) if (required === true) throw new bson_1.BSONError(`BSON element "${name}" is missing`);
|
|
145
|
+
else return null;
|
|
146
|
+
element.value = value;
|
|
147
|
+
}
|
|
148
|
+
return element.value;
|
|
149
|
+
}
|
|
150
|
+
getNumber(name, required) {
|
|
151
|
+
const maybeBool = this.get(name, bson_1.BSONType.bool);
|
|
152
|
+
const bool = maybeBool == null ? null : maybeBool ? 1 : 0;
|
|
153
|
+
const maybeLong = this.get(name, bson_1.BSONType.long);
|
|
154
|
+
const result = bool ?? (maybeLong == null ? null : Number(maybeLong)) ?? this.get(name, bson_1.BSONType.int) ?? this.get(name, bson_1.BSONType.double);
|
|
155
|
+
if (required === true && result == null) throw new bson_1.BSONError(`BSON element "${name}" is missing`);
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Deserialize this object, DOES NOT cache result so avoid multiple invocations
|
|
160
|
+
* @param options - BSON deserialization options
|
|
161
|
+
*/
|
|
162
|
+
toObject(options) {
|
|
163
|
+
return (0, bson_1.deserialize)(this.bson, {
|
|
164
|
+
...options,
|
|
165
|
+
index: this.offset,
|
|
166
|
+
allowObjectSmallerThanBufferSize: true
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/** Returns this document's bytes only */
|
|
170
|
+
toBytes() {
|
|
171
|
+
const size = (0, bson_1.getInt32LE)(this.bson, this.offset);
|
|
172
|
+
return this.bson.subarray(this.offset, this.offset + size);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
exports.OnDemandDocument = OnDemandDocument;
|
|
176
|
+
}));
|
|
177
|
+
|
|
178
|
+
//#endregion
|
|
179
|
+
export default require_document();
|
|
180
|
+
|
|
181
|
+
export { require_document };
|
|
182
|
+
//# sourceMappingURL=document.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.mjs","names":["cachedElement"],"sources":["../../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OnDemandDocument = void 0;\nconst bson_1 = require(\"../../../bson\");\nconst BSONElementOffset = {\n type: 0,\n nameOffset: 1,\n nameLength: 2,\n offset: 3,\n length: 4\n};\n/** @internal */\nclass OnDemandDocument {\n constructor(bson, offset = 0, isArray = false, \n /** If elements was already calculated */\n elements) {\n /**\n * Maps JS strings to elements and jsValues for speeding up subsequent lookups.\n * - If `false` then name does not exist in the BSON document\n * - If `CachedBSONElement` instance name exists\n * - If `cache[name].value == null` jsValue has not yet been parsed\n * - Null/Undefined values do not get cached because they are zero-length values.\n */\n this.cache = Object.create(null);\n /** Caches the index of elements that have been named */\n this.indexFound = Object.create(null);\n this.bson = bson;\n this.offset = offset;\n this.isArray = isArray;\n this.elements = elements ?? (0, bson_1.parseToElementsToArray)(this.bson, offset);\n }\n /** Only supports basic latin strings */\n isElementName(name, element) {\n const nameLength = element[BSONElementOffset.nameLength];\n const nameOffset = element[BSONElementOffset.nameOffset];\n if (name.length !== nameLength)\n return false;\n const nameEnd = nameOffset + nameLength;\n for (let byteIndex = nameOffset, charIndex = 0; charIndex < name.length && byteIndex < nameEnd; charIndex++, byteIndex++) {\n if (this.bson[byteIndex] !== name.charCodeAt(charIndex))\n return false;\n }\n return true;\n }\n /**\n * Seeks into the elements array for an element matching the given name.\n *\n * @remarks\n * Caching:\n * - Caches the existence of a property making subsequent look ups for non-existent properties return immediately\n * - Caches names mapped to elements to avoid reiterating the array and comparing the name again\n * - Caches the index at which an element has been found to prevent rechecking against elements already determined to belong to another name\n *\n * @param name - a basic latin string name of a BSON element\n * @returns\n */\n getElement(name) {\n const cachedElement = this.cache[name];\n if (cachedElement === false)\n return null;\n if (cachedElement != null) {\n return cachedElement;\n }\n if (typeof name === 'number') {\n if (this.isArray) {\n if (name < this.elements.length) {\n const element = this.elements[name];\n const cachedElement = { element, value: undefined };\n this.cache[name] = cachedElement;\n this.indexFound[name] = true;\n return cachedElement;\n }\n else {\n return null;\n }\n }\n else {\n return null;\n }\n }\n for (let index = 0; index < this.elements.length; index++) {\n const element = this.elements[index];\n // skip this element if it has already been associated with a name\n if (!(index in this.indexFound) && this.isElementName(name, element)) {\n const cachedElement = { element, value: undefined };\n this.cache[name] = cachedElement;\n this.indexFound[index] = true;\n return cachedElement;\n }\n }\n this.cache[name] = false;\n return null;\n }\n toJSValue(element, as) {\n const type = element[BSONElementOffset.type];\n const offset = element[BSONElementOffset.offset];\n const length = element[BSONElementOffset.length];\n if (as !== type) {\n return null;\n }\n switch (as) {\n case bson_1.BSONType.null:\n case bson_1.BSONType.undefined:\n return null;\n case bson_1.BSONType.double:\n return (0, bson_1.getFloat64LE)(this.bson, offset);\n case bson_1.BSONType.int:\n return (0, bson_1.getInt32LE)(this.bson, offset);\n case bson_1.BSONType.long:\n return (0, bson_1.getBigInt64LE)(this.bson, offset);\n case bson_1.BSONType.bool:\n return Boolean(this.bson[offset]);\n case bson_1.BSONType.objectId:\n return new bson_1.ObjectId(this.bson.subarray(offset, offset + 12));\n case bson_1.BSONType.timestamp:\n return new bson_1.Timestamp((0, bson_1.getBigInt64LE)(this.bson, offset));\n case bson_1.BSONType.string:\n return (0, bson_1.toUTF8)(this.bson, offset + 4, offset + length - 1, false);\n case bson_1.BSONType.binData: {\n const totalBinarySize = (0, bson_1.getInt32LE)(this.bson, offset);\n const subType = this.bson[offset + 4];\n if (subType === 2) {\n const subType2BinarySize = (0, bson_1.getInt32LE)(this.bson, offset + 1 + 4);\n if (subType2BinarySize < 0)\n throw new bson_1.BSONError('Negative binary type element size found for subtype 0x02');\n if (subType2BinarySize > totalBinarySize - 4)\n throw new bson_1.BSONError('Binary type with subtype 0x02 contains too long binary size');\n if (subType2BinarySize < totalBinarySize - 4)\n throw new bson_1.BSONError('Binary type with subtype 0x02 contains too short binary size');\n return new bson_1.Binary(this.bson.subarray(offset + 1 + 4 + 4, offset + 1 + 4 + 4 + subType2BinarySize), 2);\n }\n return new bson_1.Binary(this.bson.subarray(offset + 1 + 4, offset + 1 + 4 + totalBinarySize), subType);\n }\n case bson_1.BSONType.date:\n // Pretend this is correct.\n return new Date(Number((0, bson_1.getBigInt64LE)(this.bson, offset)));\n case bson_1.BSONType.object:\n return new OnDemandDocument(this.bson, offset);\n case bson_1.BSONType.array:\n return new OnDemandDocument(this.bson, offset, true);\n default:\n throw new bson_1.BSONError(`Unsupported BSON type: ${as}`);\n }\n }\n /**\n * Returns the number of elements in this BSON document\n */\n size() {\n return this.elements.length;\n }\n /**\n * Checks for the existence of an element by name.\n *\n * @remarks\n * Uses `getElement` with the expectation that will populate caches such that a `has` call\n * followed by a `getElement` call will not repeat the cost paid by the first look up.\n *\n * @param name - element name\n */\n has(name) {\n const cachedElement = this.cache[name];\n if (cachedElement === false)\n return false;\n if (cachedElement != null)\n return true;\n return this.getElement(name) != null;\n }\n get(name, as, required) {\n const element = this.getElement(name);\n if (element == null) {\n if (required === true) {\n throw new bson_1.BSONError(`BSON element \"${name}\" is missing`);\n }\n else {\n return null;\n }\n }\n if (element.value == null) {\n const value = this.toJSValue(element.element, as);\n if (value == null) {\n if (required === true) {\n throw new bson_1.BSONError(`BSON element \"${name}\" is missing`);\n }\n else {\n return null;\n }\n }\n // It is important to never store null\n element.value = value;\n }\n return element.value;\n }\n getNumber(name, required) {\n const maybeBool = this.get(name, bson_1.BSONType.bool);\n const bool = maybeBool == null ? null : maybeBool ? 1 : 0;\n const maybeLong = this.get(name, bson_1.BSONType.long);\n const long = maybeLong == null ? null : Number(maybeLong);\n const result = bool ?? long ?? this.get(name, bson_1.BSONType.int) ?? this.get(name, bson_1.BSONType.double);\n if (required === true && result == null) {\n throw new bson_1.BSONError(`BSON element \"${name}\" is missing`);\n }\n return result;\n }\n /**\n * Deserialize this object, DOES NOT cache result so avoid multiple invocations\n * @param options - BSON deserialization options\n */\n toObject(options) {\n return (0, bson_1.deserialize)(this.bson, {\n ...options,\n index: this.offset,\n allowObjectSmallerThanBufferSize: true\n });\n }\n /** Returns this document's bytes only */\n toBytes() {\n const size = (0, bson_1.getInt32LE)(this.bson, this.offset);\n return this.bson.subarray(this.offset, this.offset + size);\n }\n}\nexports.OnDemandDocument = OnDemandDocument;\n//# sourceMappingURL=document.js.map"],"x_google_ignoreList":[0],"mappings":"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"}
|