pecunia-root 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/prisma-adapter/index.d.mts +1 -1
- package/dist/adapters/prisma-adapter/index.mjs +1 -1
- package/dist/adapters/prisma-adapter/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +2 -16
- package/dist/_virtual/rolldown_runtime.mjs +0 -8
- package/dist/adapters/mongodb-adapter/index.d.mts +0 -35
- package/dist/adapters/mongodb-adapter/index.mjs +0 -314
- package/dist/adapters/mongodb-adapter/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +0 -14
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +0 -54
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +0 -36
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +0 -27
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +0 -1
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +0 -3728
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +0 -1
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +0 -137
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +0 -211
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +0 -95
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +0 -158
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +0 -195
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +0 -710
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +0 -63
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +0 -368
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +0 -234
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +0 -545
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +0 -83
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +0 -146
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +0 -30
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +0 -135
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +0 -25
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +0 -362
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +0 -123
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +0 -128
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +0 -133
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +0 -126
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +0 -79
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +0 -65
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +0 -127
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +0 -44
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +0 -101
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +0 -33
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +0 -29
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +0 -83
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +0 -36
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +0 -32
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +0 -206
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +0 -45
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +0 -213
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +0 -411
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +0 -288
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +0 -423
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +0 -483
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +0 -207
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +0 -116
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +0 -183
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +0 -55
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +0 -139
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +0 -28
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +0 -117
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +0 -182
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +0 -304
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +0 -34
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +0 -739
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +0 -805
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +0 -174
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +0 -726
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +0 -172
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +0 -103
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +0 -66
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +0 -41
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +0 -365
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +0 -50
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +0 -23
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +0 -106
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +0 -428
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +0 -124
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +0 -95
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +0 -1305
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +0 -59
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +0 -250
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +0 -170
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +0 -315
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +0 -925
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +0 -520
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +0 -90
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +0 -582
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +0 -64
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +0 -86
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +0 -264
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +0 -109
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +0 -172
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +0 -68
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +0 -123
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +0 -119
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +0 -65
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +0 -97
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +0 -188
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +0 -103
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +0 -136
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +0 -61
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +0 -179
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +0 -77
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +0 -43
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +0 -105
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +0 -50
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +0 -39
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +0 -49
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +0 -46
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +0 -46
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +0 -67
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +0 -37
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +0 -171
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +0 -45
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +0 -71
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +0 -165
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +0 -62
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +0 -51
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +0 -156
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +0 -477
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +0 -315
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +0 -157
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +0 -184
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +0 -96
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +0 -107
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +0 -540
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +0 -298
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +0 -623
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +0 -91
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +0 -254
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +0 -138
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +0 -993
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +0 -81
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +0 -171
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +0 -1
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +0 -295
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +0 -1
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +0 -81
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +0 -206
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +0 -33590
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +0 -37
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +0 -18
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +0 -1
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +0 -252
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +0 -41
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +0 -41
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +0 -173
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +0 -334
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +0 -90
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +0 -356
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +0 -23
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +0 -29
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +0 -140
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +0 -831
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +0 -77
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +0 -147
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +0 -17
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.mjs","names":["session"],"sources":["../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerSessionPool = exports.ServerSession = exports.ClientSession = void 0;\nexports.maybeClearPinnedConnection = maybeClearPinnedConnection;\nexports.applySession = applySession;\nexports.updateSessionFromResponse = updateSessionFromResponse;\nconst bson_1 = require(\"./bson\");\nconst metrics_1 = require(\"./cmap/metrics\");\nconst constants_1 = require(\"./constants\");\nconst error_1 = require(\"./error\");\nconst mongo_types_1 = require(\"./mongo_types\");\nconst execute_operation_1 = require(\"./operations/execute_operation\");\nconst run_command_1 = require(\"./operations/run_command\");\nconst read_concern_1 = require(\"./read_concern\");\nconst read_preference_1 = require(\"./read_preference\");\nconst resource_management_1 = require(\"./resource_management\");\nconst common_1 = require(\"./sdam/common\");\nconst timeout_1 = require(\"./timeout\");\nconst transactions_1 = require(\"./transactions\");\nconst utils_1 = require(\"./utils\");\nconst write_concern_1 = require(\"./write_concern\");\n/**\n * A class representing a client session on the server\n *\n * NOTE: not meant to be instantiated directly.\n * @public\n */\nclass ClientSession extends mongo_types_1.TypedEventEmitter {\n /**\n * Create a client session.\n * @internal\n * @param client - The current client\n * @param sessionPool - The server session pool (Internal Class)\n * @param options - Optional settings\n * @param clientOptions - Optional settings provided when creating a MongoClient\n */\n constructor(client, sessionPool, options, clientOptions) {\n super();\n /** @internal */\n this.timeoutContext = null;\n this.on('error', utils_1.noop);\n if (client == null) {\n // TODO(NODE-3483)\n throw new error_1.MongoRuntimeError('ClientSession requires a MongoClient');\n }\n if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) {\n // TODO(NODE-3483)\n throw new error_1.MongoRuntimeError('ClientSession requires a ServerSessionPool');\n }\n options = options ?? {};\n this.snapshotEnabled = options.snapshot === true;\n if (options.causalConsistency === true && this.snapshotEnabled) {\n throw new error_1.MongoInvalidArgumentError('Properties \"causalConsistency\" and \"snapshot\" are mutually exclusive');\n }\n this.client = client;\n this.sessionPool = sessionPool;\n this.hasEnded = false;\n this.clientOptions = clientOptions;\n this.timeoutMS = options.defaultTimeoutMS ?? client.s.options?.timeoutMS;\n this.explicit = !!options.explicit;\n this._serverSession = this.explicit ? this.sessionPool.acquire() : null;\n this.txnNumberIncrement = 0;\n const defaultCausalConsistencyValue = this.explicit && options.snapshot !== true;\n this.supports = {\n // if we can enable causal consistency, do so by default\n causalConsistency: options.causalConsistency ?? defaultCausalConsistencyValue\n };\n this.clusterTime = options.initialClusterTime;\n this.operationTime = undefined;\n this.owner = options.owner;\n this.defaultTransactionOptions = { ...options.defaultTransactionOptions };\n this.transaction = new transactions_1.Transaction();\n }\n /** The server id associated with this session */\n get id() {\n return this.serverSession?.id;\n }\n get serverSession() {\n let serverSession = this._serverSession;\n if (serverSession == null) {\n if (this.explicit) {\n throw new error_1.MongoRuntimeError('Unexpected null serverSession for an explicit session');\n }\n if (this.hasEnded) {\n throw new error_1.MongoRuntimeError('Unexpected null serverSession for an ended implicit session');\n }\n serverSession = this.sessionPool.acquire();\n this._serverSession = serverSession;\n }\n return serverSession;\n }\n get loadBalanced() {\n return this.client.topology?.description.type === common_1.TopologyType.LoadBalanced;\n }\n /** @internal */\n pin(conn) {\n if (this.pinnedConnection) {\n throw TypeError('Cannot pin multiple connections to the same session');\n }\n this.pinnedConnection = conn;\n conn.emit(constants_1.PINNED, this.inTransaction() ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR);\n }\n /** @internal */\n unpin(options) {\n if (this.loadBalanced) {\n return maybeClearPinnedConnection(this, options);\n }\n this.transaction.unpinServer();\n }\n get isPinned() {\n return this.loadBalanced ? !!this.pinnedConnection : this.transaction.isPinned;\n }\n /**\n * Frees any client-side resources held by the current session. If a session is in a transaction,\n * the transaction is aborted.\n *\n * Does not end the session on the server.\n *\n * @param options - Optional settings. Currently reserved for future use\n */\n async endSession(options) {\n try {\n if (this.inTransaction()) {\n await this.abortTransaction({ ...options, throwTimeout: true });\n }\n }\n catch (error) {\n // spec indicates that we should ignore all errors for `endSessions`\n if (error.name === 'MongoOperationTimeoutError')\n throw error;\n (0, utils_1.squashError)(error);\n }\n finally {\n if (!this.hasEnded) {\n const serverSession = this.serverSession;\n if (serverSession != null) {\n // release the server session back to the pool\n this.sessionPool.release(serverSession);\n // Store a clone of the server session for reference (debugging)\n this._serverSession = new ServerSession(serverSession);\n }\n // mark the session as ended, and emit a signal\n this.hasEnded = true;\n this.emit('ended', this);\n }\n maybeClearPinnedConnection(this, { force: true, ...options });\n }\n }\n /** @internal */\n async asyncDispose() {\n await this.endSession({ force: true });\n }\n /**\n * Advances the operationTime for a ClientSession.\n *\n * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to\n */\n advanceOperationTime(operationTime) {\n if (this.operationTime == null) {\n this.operationTime = operationTime;\n return;\n }\n if (operationTime.greaterThan(this.operationTime)) {\n this.operationTime = operationTime;\n }\n }\n /**\n * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession\n *\n * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature\n */\n advanceClusterTime(clusterTime) {\n if (!clusterTime || typeof clusterTime !== 'object') {\n throw new error_1.MongoInvalidArgumentError('input cluster time must be an object');\n }\n if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== 'Timestamp') {\n throw new error_1.MongoInvalidArgumentError('input cluster time \"clusterTime\" property must be a valid BSON Timestamp');\n }\n if (!clusterTime.signature ||\n clusterTime.signature.hash?._bsontype !== 'Binary' ||\n (typeof clusterTime.signature.keyId !== 'bigint' &&\n typeof clusterTime.signature.keyId !== 'number' &&\n clusterTime.signature.keyId?._bsontype !== 'Long') // apparently we decode the key to number?\n ) {\n throw new error_1.MongoInvalidArgumentError('input cluster time must have a valid \"signature\" property with BSON Binary hash and BSON Long keyId');\n }\n (0, common_1._advanceClusterTime)(this, clusterTime);\n }\n /**\n * Used to determine if this session equals another\n *\n * @param session - The session to compare to\n */\n equals(session) {\n if (!(session instanceof ClientSession)) {\n return false;\n }\n if (this.id == null || session.id == null) {\n return false;\n }\n return utils_1.ByteUtils.equals(this.id.id.buffer, session.id.id.buffer);\n }\n /**\n * Increment the transaction number on the internal ServerSession\n *\n * @privateRemarks\n * This helper increments a value stored on the client session that will be\n * added to the serverSession's txnNumber upon applying it to a command.\n * This is because the serverSession is lazily acquired after a connection is obtained\n */\n incrementTransactionNumber() {\n this.txnNumberIncrement += 1;\n }\n /** @returns whether this session is currently in a transaction or not */\n inTransaction() {\n return this.transaction.isActive;\n }\n /**\n * Starts a new transaction with the given options.\n *\n * @remarks\n * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`,\n * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is\n * undefined behaviour.\n *\n * @param options - Options for the transaction\n */\n startTransaction(options) {\n if (this.snapshotEnabled) {\n throw new error_1.MongoCompatibilityError('Transactions are not supported in snapshot sessions');\n }\n if (this.inTransaction()) {\n throw new error_1.MongoTransactionError('Transaction already in progress');\n }\n if (this.isPinned && this.transaction.isCommitted) {\n this.unpin();\n }\n this.commitAttempted = false;\n // increment txnNumber\n this.incrementTransactionNumber();\n // create transaction state\n this.transaction = new transactions_1.Transaction({\n readConcern: options?.readConcern ??\n this.defaultTransactionOptions.readConcern ??\n this.clientOptions?.readConcern,\n writeConcern: options?.writeConcern ??\n this.defaultTransactionOptions.writeConcern ??\n this.clientOptions?.writeConcern,\n readPreference: options?.readPreference ??\n this.defaultTransactionOptions.readPreference ??\n this.clientOptions?.readPreference,\n maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS\n });\n this.transaction.transition(transactions_1.TxnState.STARTING_TRANSACTION);\n }\n /**\n * Commits the currently active transaction in this session.\n *\n * @param options - Optional options, can be used to override `defaultTimeoutMS`.\n */\n async commitTransaction(options) {\n if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) {\n throw new error_1.MongoTransactionError('No transaction started');\n }\n if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION ||\n this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) {\n // the transaction was never started, we can safely exit here\n this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY);\n return;\n }\n if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) {\n throw new error_1.MongoTransactionError('Cannot call commitTransaction after calling abortTransaction');\n }\n const command = { commitTransaction: 1 };\n const timeoutMS = typeof options?.timeoutMS === 'number'\n ? options.timeoutMS\n : typeof this.timeoutMS === 'number'\n ? this.timeoutMS\n : null;\n const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern;\n if (wc != null) {\n if (timeoutMS == null && this.timeoutContext == null) {\n write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc });\n }\n else {\n const wcKeys = Object.keys(wc);\n if (wcKeys.length > 2 || (!wcKeys.includes('wtimeoutMS') && !wcKeys.includes('wTimeoutMS')))\n // if the write concern was specified with wTimeoutMS, then we set both wtimeoutMS and wTimeoutMS, guaranteeing at least two keys, so if we have more than two keys, then we can automatically assume that we should add the write concern to the command. If it has 2 or fewer keys, we need to check that those keys aren't the wtimeoutMS or wTimeoutMS options before we add the write concern to the command\n write_concern_1.WriteConcern.apply(command, { ...wc, wtimeoutMS: undefined });\n }\n }\n if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.commitAttempted) {\n if (timeoutMS == null && this.timeoutContext == null) {\n write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' });\n }\n else {\n write_concern_1.WriteConcern.apply(command, { w: 'majority', ...wc, wtimeoutMS: undefined });\n }\n }\n if (typeof this.transaction.options.maxTimeMS === 'number') {\n command.maxTimeMS = this.transaction.options.maxTimeMS;\n }\n if (this.transaction.recoveryToken) {\n command.recoveryToken = this.transaction.recoveryToken;\n }\n const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, {\n session: this,\n readPreference: read_preference_1.ReadPreference.primary,\n bypassPinningCheck: true\n });\n const timeoutContext = this.timeoutContext ??\n (typeof timeoutMS === 'number'\n ? timeout_1.TimeoutContext.create({\n serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,\n socketTimeoutMS: this.clientOptions.socketTimeoutMS,\n timeoutMS\n })\n : null);\n try {\n await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);\n this.commitAttempted = undefined;\n return;\n }\n catch (firstCommitError) {\n this.commitAttempted = true;\n if (firstCommitError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstCommitError)) {\n // SPEC-1185: apply majority write concern when retrying commitTransaction\n write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, ...wc, w: 'majority' });\n // per txns spec, must unpin session in this case\n this.unpin({ force: true });\n try {\n await (0, execute_operation_1.executeOperation)(this.client, new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, {\n session: this,\n readPreference: read_preference_1.ReadPreference.primary,\n bypassPinningCheck: true\n }), timeoutContext);\n return;\n }\n catch (retryCommitError) {\n // If the retry failed, we process that error instead of the original\n if (shouldAddUnknownTransactionCommitResultLabel(retryCommitError)) {\n retryCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult);\n }\n if (shouldUnpinAfterCommitError(retryCommitError)) {\n this.unpin({ error: retryCommitError });\n }\n throw retryCommitError;\n }\n }\n if (shouldAddUnknownTransactionCommitResultLabel(firstCommitError)) {\n firstCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult);\n }\n if (shouldUnpinAfterCommitError(firstCommitError)) {\n this.unpin({ error: firstCommitError });\n }\n throw firstCommitError;\n }\n finally {\n this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED);\n }\n }\n async abortTransaction(options) {\n if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) {\n throw new error_1.MongoTransactionError('No transaction started');\n }\n if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) {\n // the transaction was never started, we can safely exit here\n this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED);\n return;\n }\n if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) {\n throw new error_1.MongoTransactionError('Cannot call abortTransaction twice');\n }\n if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED ||\n this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) {\n throw new error_1.MongoTransactionError('Cannot call abortTransaction after calling commitTransaction');\n }\n const command = { abortTransaction: 1 };\n const timeoutMS = typeof options?.timeoutMS === 'number'\n ? options.timeoutMS\n : this.timeoutContext?.csotEnabled()\n ? this.timeoutContext.timeoutMS // refresh timeoutMS for abort operation\n : typeof this.timeoutMS === 'number'\n ? this.timeoutMS\n : null;\n const timeoutContext = timeoutMS != null\n ? timeout_1.TimeoutContext.create({\n timeoutMS,\n serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,\n socketTimeoutMS: this.clientOptions.socketTimeoutMS\n })\n : null;\n const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern;\n if (wc != null && timeoutMS == null) {\n write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 10000, w: 'majority', ...wc });\n }\n if (this.transaction.recoveryToken) {\n command.recoveryToken = this.transaction.recoveryToken;\n }\n const operation = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace('admin'), command, {\n session: this,\n readPreference: read_preference_1.ReadPreference.primary,\n bypassPinningCheck: true\n });\n try {\n await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);\n this.unpin();\n return;\n }\n catch (firstAbortError) {\n this.unpin();\n if (firstAbortError.name === 'MongoRuntimeError')\n throw firstAbortError;\n if (options?.throwTimeout && firstAbortError.name === 'MongoOperationTimeoutError') {\n throw firstAbortError;\n }\n if (firstAbortError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstAbortError)) {\n try {\n await (0, execute_operation_1.executeOperation)(this.client, operation, timeoutContext);\n return;\n }\n catch (secondAbortError) {\n if (secondAbortError.name === 'MongoRuntimeError')\n throw secondAbortError;\n if (options?.throwTimeout && secondAbortError.name === 'MongoOperationTimeoutError') {\n throw secondAbortError;\n }\n // we do not retry the retry\n }\n }\n // The spec indicates that if the operation times out or fails with a non-retryable error, we should ignore all errors on `abortTransaction`\n }\n finally {\n this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED);\n if (this.loadBalanced) {\n maybeClearPinnedConnection(this, { force: false });\n }\n }\n }\n /**\n * This is here to ensure that ClientSession is never serialized to BSON.\n */\n toBSON() {\n throw new error_1.MongoRuntimeError('ClientSession cannot be serialized to BSON.');\n }\n /**\n * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed.\n *\n * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise.\n *\n * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,\n * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is\n * undefined behaviour.\n *\n * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not\n * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS.\n *\n *\n * @remarks\n * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function.\n * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error.\n * - If the transaction is manually aborted within the provided function it will not throw.\n * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times.\n *\n * Checkout a descriptive example here:\n * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions\n *\n * If a command inside withTransaction fails:\n * - It may cause the transaction on the server to be aborted.\n * - This situation is normally handled transparently by the driver.\n * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not.\n * - The driver will then retry the transaction indefinitely.\n *\n * To avoid this situation, the application must not silently handle errors within the provided function.\n * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction.\n *\n * @param fn - callback to run within a transaction\n * @param options - optional settings for the transaction\n * @returns A raw command response or undefined\n */\n async withTransaction(fn, options) {\n const MAX_TIMEOUT = 120000;\n const timeoutMS = options?.timeoutMS ?? this.timeoutMS ?? null;\n this.timeoutContext =\n timeoutMS != null\n ? timeout_1.TimeoutContext.create({\n timeoutMS,\n serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS,\n socketTimeoutMS: this.clientOptions.socketTimeoutMS\n })\n : null;\n const startTime = this.timeoutContext?.csotEnabled() ? this.timeoutContext.start : (0, utils_1.now)();\n let committed = false;\n let result;\n try {\n while (!committed) {\n this.startTransaction(options); // may throw on error\n try {\n const promise = fn(this);\n if (!(0, utils_1.isPromiseLike)(promise)) {\n throw new error_1.MongoInvalidArgumentError('Function provided to `withTransaction` must return a Promise');\n }\n result = await promise;\n if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION ||\n this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED ||\n this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) {\n // Assume callback intentionally ended the transaction\n return result;\n }\n }\n catch (fnError) {\n if (!(fnError instanceof error_1.MongoError) || fnError instanceof error_1.MongoInvalidArgumentError) {\n await this.abortTransaction();\n throw fnError;\n }\n if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION ||\n this.transaction.state === transactions_1.TxnState.TRANSACTION_IN_PROGRESS) {\n await this.abortTransaction();\n }\n if (fnError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) &&\n (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) {\n continue;\n }\n throw fnError;\n }\n while (!committed) {\n try {\n /*\n * We will rely on ClientSession.commitTransaction() to\n * apply a majority write concern if commitTransaction is\n * being retried (see: DRIVERS-601)\n */\n await this.commitTransaction();\n committed = true;\n }\n catch (commitError) {\n /*\n * Note: a maxTimeMS error will have the MaxTimeMSExpired\n * code (50) and can be reported as a top-level error or\n * inside writeConcernError, ex.\n * { ok:0, code: 50, codeName: 'MaxTimeMSExpired' }\n * { ok:1, writeConcernError: { code: 50, codeName: 'MaxTimeMSExpired' } }\n */\n if (!isMaxTimeMSExpiredError(commitError) &&\n commitError.hasErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult) &&\n (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) {\n continue;\n }\n if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) &&\n (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) {\n break;\n }\n throw commitError;\n }\n }\n }\n return result;\n }\n finally {\n this.timeoutContext = null;\n }\n }\n}\nexports.ClientSession = ClientSession;\n(0, resource_management_1.configureResourceManagement)(ClientSession.prototype);\nconst NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([\n 'CannotSatisfyWriteConcern',\n 'UnknownReplWriteConcern',\n 'UnsatisfiableWriteConcern'\n]);\nfunction shouldUnpinAfterCommitError(commitError) {\n if (commitError instanceof error_1.MongoError) {\n if ((0, error_1.isRetryableWriteError)(commitError) ||\n commitError instanceof error_1.MongoWriteConcernError ||\n isMaxTimeMSExpiredError(commitError)) {\n if (isUnknownTransactionCommitResult(commitError)) {\n // per txns spec, must unpin session in this case\n return true;\n }\n }\n else if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) {\n return true;\n }\n }\n return false;\n}\nfunction shouldAddUnknownTransactionCommitResultLabel(commitError) {\n let ok = (0, error_1.isRetryableWriteError)(commitError);\n ok ||= commitError instanceof error_1.MongoWriteConcernError;\n ok ||= isMaxTimeMSExpiredError(commitError);\n ok &&= isUnknownTransactionCommitResult(commitError);\n return ok;\n}\nfunction isUnknownTransactionCommitResult(err) {\n const isNonDeterministicWriteConcernError = err instanceof error_1.MongoServerError &&\n err.codeName &&\n NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName);\n return (isMaxTimeMSExpiredError(err) ||\n (!isNonDeterministicWriteConcernError &&\n err.code !== error_1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern &&\n err.code !== error_1.MONGODB_ERROR_CODES.UnknownReplWriteConcern));\n}\nfunction maybeClearPinnedConnection(session, options) {\n // unpin a connection if it has been pinned\n const conn = session.pinnedConnection;\n const error = options?.error;\n if (session.inTransaction() &&\n error &&\n error instanceof error_1.MongoError &&\n error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) {\n return;\n }\n const topology = session.client.topology;\n // NOTE: the spec talks about what to do on a network error only, but the tests seem to\n // to validate that we don't unpin on _all_ errors?\n if (conn && topology != null) {\n const servers = Array.from(topology.s.servers.values());\n const loadBalancer = servers[0];\n if (options?.error == null || options?.force) {\n loadBalancer.pool.checkIn(conn);\n session.pinnedConnection = undefined;\n conn.emit(constants_1.UNPINNED, session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION\n ? metrics_1.ConnectionPoolMetrics.TXN\n : metrics_1.ConnectionPoolMetrics.CURSOR);\n if (options?.forceClear) {\n loadBalancer.pool.clear({ serviceId: conn.serviceId });\n }\n }\n }\n}\nfunction isMaxTimeMSExpiredError(err) {\n if (err == null || !(err instanceof error_1.MongoServerError)) {\n return false;\n }\n return (err.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired ||\n err.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired);\n}\n/**\n * Reflects the existence of a session on the server. Can be reused by the session pool.\n * WARNING: not meant to be instantiated directly. For internal use only.\n * @public\n */\nclass ServerSession {\n /** @internal */\n constructor(cloned) {\n if (cloned != null) {\n const idBytes = Buffer.allocUnsafe(16);\n idBytes.set(cloned.id.id.buffer);\n this.id = { id: new bson_1.Binary(idBytes, cloned.id.id.sub_type) };\n this.lastUse = cloned.lastUse;\n this.txnNumber = cloned.txnNumber;\n this.isDirty = cloned.isDirty;\n return;\n }\n this.id = { id: new bson_1.Binary((0, utils_1.uuidV4)(), bson_1.Binary.SUBTYPE_UUID) };\n this.lastUse = (0, utils_1.now)();\n this.txnNumber = 0;\n this.isDirty = false;\n }\n /**\n * Determines if the server session has timed out.\n *\n * @param sessionTimeoutMinutes - The server's \"logicalSessionTimeoutMinutes\"\n */\n hasTimedOut(sessionTimeoutMinutes) {\n // Take the difference of the lastUse timestamp and now, which will result in a value in\n // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes`\n const idleTimeMinutes = Math.round((((0, utils_1.calculateDurationInMs)(this.lastUse) % 86400000) % 3600000) / 60000);\n return idleTimeMinutes > sessionTimeoutMinutes - 1;\n }\n}\nexports.ServerSession = ServerSession;\n/**\n * Maintains a pool of Server Sessions.\n * For internal use only\n * @internal\n */\nclass ServerSessionPool {\n constructor(client) {\n if (client == null) {\n throw new error_1.MongoRuntimeError('ServerSessionPool requires a MongoClient');\n }\n this.client = client;\n this.sessions = new utils_1.List();\n }\n /**\n * Acquire a Server Session from the pool.\n * Iterates through each session in the pool, removing any stale sessions\n * along the way. The first non-stale session found is removed from the\n * pool and returned. If no non-stale session is found, a new ServerSession is created.\n */\n acquire() {\n const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10;\n let session = null;\n // Try to obtain from session pool\n while (this.sessions.length > 0) {\n const potentialSession = this.sessions.shift();\n if (potentialSession != null &&\n (!!this.client.topology?.loadBalanced ||\n !potentialSession.hasTimedOut(sessionTimeoutMinutes))) {\n session = potentialSession;\n break;\n }\n }\n // If nothing valid came from the pool make a new one\n if (session == null) {\n session = new ServerSession();\n }\n return session;\n }\n /**\n * Release a session to the session pool\n * Adds the session back to the session pool if the session has not timed out yet.\n * This method also removes any stale sessions from the pool.\n *\n * @param session - The session to release to the pool\n */\n release(session) {\n const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10;\n if (this.client.topology?.loadBalanced && !sessionTimeoutMinutes) {\n this.sessions.unshift(session);\n }\n if (!sessionTimeoutMinutes) {\n return;\n }\n this.sessions.prune(session => session.hasTimedOut(sessionTimeoutMinutes));\n if (!session.hasTimedOut(sessionTimeoutMinutes)) {\n if (session.isDirty) {\n return;\n }\n // otherwise, readd this session to the session pool\n this.sessions.unshift(session);\n }\n }\n}\nexports.ServerSessionPool = ServerSessionPool;\n/**\n * Optionally decorate a command with sessions specific keys\n *\n * @param session - the session tracking transaction state\n * @param command - the command to decorate\n * @param options - Optional settings passed to calling operation\n *\n * @internal\n */\nfunction applySession(session, command, options) {\n if (session.hasEnded) {\n return new error_1.MongoExpiredSessionError();\n }\n // May acquire serverSession here\n const serverSession = session.serverSession;\n if (serverSession == null) {\n return new error_1.MongoRuntimeError('Unable to acquire server session');\n }\n if (options.writeConcern?.w === 0) {\n if (session && session.explicit) {\n // Error if user provided an explicit session to an unacknowledged write (SPEC-1019)\n return new error_1.MongoAPIError('Cannot have explicit session with unacknowledged writes');\n }\n return;\n }\n // mark the last use of this session, and apply the `lsid`\n serverSession.lastUse = (0, utils_1.now)();\n command.lsid = serverSession.id;\n const inTxnOrTxnCommand = session.inTransaction() || (0, transactions_1.isTransactionCommand)(command);\n const isRetryableWrite = !!options.willRetryWrite;\n if (isRetryableWrite || inTxnOrTxnCommand) {\n serverSession.txnNumber += session.txnNumberIncrement;\n session.txnNumberIncrement = 0;\n // TODO(NODE-2674): Preserve int64 sent from MongoDB\n command.txnNumber = bson_1.Long.fromNumber(serverSession.txnNumber);\n }\n if (!inTxnOrTxnCommand) {\n if (session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION) {\n session.transaction.transition(transactions_1.TxnState.NO_TRANSACTION);\n }\n if (session.supports.causalConsistency &&\n session.operationTime &&\n (0, utils_1.commandSupportsReadConcern)(command)) {\n command.readConcern = command.readConcern || {};\n Object.assign(command.readConcern, { afterClusterTime: session.operationTime });\n }\n else if (session.snapshotEnabled) {\n command.readConcern = command.readConcern || { level: read_concern_1.ReadConcernLevel.snapshot };\n if (session.snapshotTime != null) {\n Object.assign(command.readConcern, { atClusterTime: session.snapshotTime });\n }\n }\n return;\n }\n // now attempt to apply transaction-specific sessions data\n // `autocommit` must always be false to differentiate from retryable writes\n command.autocommit = false;\n if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) {\n session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS);\n command.startTransaction = true;\n const readConcern = session.transaction.options.readConcern || session?.clientOptions?.readConcern;\n if (readConcern) {\n command.readConcern = readConcern;\n }\n if (session.supports.causalConsistency && session.operationTime) {\n command.readConcern = command.readConcern || {};\n Object.assign(command.readConcern, { afterClusterTime: session.operationTime });\n }\n }\n return;\n}\nfunction updateSessionFromResponse(session, document) {\n if (document.$clusterTime) {\n (0, common_1._advanceClusterTime)(session, document.$clusterTime);\n }\n if (document.operationTime && session && session.supports.causalConsistency) {\n session.advanceOperationTime(document.operationTime);\n }\n if (document.recoveryToken && session && session.inTransaction()) {\n session.transaction._recoveryToken = document.recoveryToken;\n }\n if (session?.snapshotEnabled && session.snapshotTime == null) {\n // find and aggregate commands return atClusterTime on the cursor\n // distinct includes it in the response body\n const atClusterTime = document.atClusterTime;\n if (atClusterTime) {\n session.snapshotTime = atClusterTime;\n }\n }\n}\n//# sourceMappingURL=sessions.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,oBA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b/lib/sort.js
|
|
5
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.formatSort = formatSort;
|
|
8
|
-
const error_1 = require_error();
|
|
9
|
-
/** @internal */
|
|
10
|
-
function prepareDirection(direction = 1) {
|
|
11
|
-
const value = `${direction}`.toLowerCase();
|
|
12
|
-
if (isMeta(direction)) return direction;
|
|
13
|
-
switch (value) {
|
|
14
|
-
case "ascending":
|
|
15
|
-
case "asc":
|
|
16
|
-
case "1": return 1;
|
|
17
|
-
case "descending":
|
|
18
|
-
case "desc":
|
|
19
|
-
case "-1": return -1;
|
|
20
|
-
default: throw new error_1.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/** @internal */
|
|
24
|
-
function isMeta(t) {
|
|
25
|
-
return typeof t === "object" && t != null && "$meta" in t && typeof t.$meta === "string";
|
|
26
|
-
}
|
|
27
|
-
/** @internal */
|
|
28
|
-
function isPair(t) {
|
|
29
|
-
if (Array.isArray(t) && t.length === 2) try {
|
|
30
|
-
prepareDirection(t[1]);
|
|
31
|
-
return true;
|
|
32
|
-
} catch {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
function isDeep(t) {
|
|
38
|
-
return Array.isArray(t) && Array.isArray(t[0]);
|
|
39
|
-
}
|
|
40
|
-
function isMap(t) {
|
|
41
|
-
return t instanceof Map && t.size > 0;
|
|
42
|
-
}
|
|
43
|
-
function isReadonlyArray(value) {
|
|
44
|
-
return Array.isArray(value);
|
|
45
|
-
}
|
|
46
|
-
/** @internal */
|
|
47
|
-
function pairToMap(v) {
|
|
48
|
-
return new Map([[`${v[0]}`, prepareDirection([v[1]])]]);
|
|
49
|
-
}
|
|
50
|
-
/** @internal */
|
|
51
|
-
function deepToMap(t) {
|
|
52
|
-
const sortEntries = t.map(([k, v]) => [`${k}`, prepareDirection(v)]);
|
|
53
|
-
return new Map(sortEntries);
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
|
-
function stringsToMap(t) {
|
|
57
|
-
const sortEntries = t.map((key) => [`${key}`, 1]);
|
|
58
|
-
return new Map(sortEntries);
|
|
59
|
-
}
|
|
60
|
-
/** @internal */
|
|
61
|
-
function objectToMap(t) {
|
|
62
|
-
const sortEntries = Object.entries(t).map(([k, v]) => [`${k}`, prepareDirection(v)]);
|
|
63
|
-
return new Map(sortEntries);
|
|
64
|
-
}
|
|
65
|
-
/** @internal */
|
|
66
|
-
function mapToMap(t) {
|
|
67
|
-
const sortEntries = Array.from(t).map(([k, v]) => [`${k}`, prepareDirection(v)]);
|
|
68
|
-
return new Map(sortEntries);
|
|
69
|
-
}
|
|
70
|
-
/** converts a Sort type into a type that is valid for the server (SortForCmd) */
|
|
71
|
-
function formatSort(sort, direction) {
|
|
72
|
-
if (sort == null) return void 0;
|
|
73
|
-
if (typeof sort === "string") return new Map([[sort, prepareDirection(direction)]]);
|
|
74
|
-
if (typeof sort !== "object") throw new error_1.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object`);
|
|
75
|
-
if (!isReadonlyArray(sort)) {
|
|
76
|
-
if (isMap(sort)) return mapToMap(sort);
|
|
77
|
-
if (Object.keys(sort).length) return objectToMap(sort);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (!sort.length) return void 0;
|
|
81
|
-
if (isDeep(sort)) return deepToMap(sort);
|
|
82
|
-
if (isPair(sort)) return pairToMap(sort);
|
|
83
|
-
return stringsToMap(sort);
|
|
84
|
-
}
|
|
85
|
-
}));
|
|
86
|
-
|
|
87
|
-
//#endregion
|
|
88
|
-
export default require_sort();
|
|
89
|
-
|
|
90
|
-
export { require_sort };
|
|
91
|
-
//# sourceMappingURL=sort.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sort.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatSort = formatSort;\nconst error_1 = require(\"./error\");\n/** @internal */\nfunction prepareDirection(direction = 1) {\n const value = `${direction}`.toLowerCase();\n if (isMeta(direction))\n return direction;\n switch (value) {\n case 'ascending':\n case 'asc':\n case '1':\n return 1;\n case 'descending':\n case 'desc':\n case '-1':\n return -1;\n default:\n throw new error_1.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`);\n }\n}\n/** @internal */\nfunction isMeta(t) {\n return typeof t === 'object' && t != null && '$meta' in t && typeof t.$meta === 'string';\n}\n/** @internal */\nfunction isPair(t) {\n if (Array.isArray(t) && t.length === 2) {\n try {\n prepareDirection(t[1]);\n return true;\n }\n catch {\n return false;\n }\n }\n return false;\n}\nfunction isDeep(t) {\n return Array.isArray(t) && Array.isArray(t[0]);\n}\nfunction isMap(t) {\n return t instanceof Map && t.size > 0;\n}\nfunction isReadonlyArray(value) {\n return Array.isArray(value);\n}\n/** @internal */\nfunction pairToMap(v) {\n return new Map([[`${v[0]}`, prepareDirection([v[1]])]]);\n}\n/** @internal */\nfunction deepToMap(t) {\n const sortEntries = t.map(([k, v]) => [`${k}`, prepareDirection(v)]);\n return new Map(sortEntries);\n}\n/** @internal */\nfunction stringsToMap(t) {\n const sortEntries = t.map(key => [`${key}`, 1]);\n return new Map(sortEntries);\n}\n/** @internal */\nfunction objectToMap(t) {\n const sortEntries = Object.entries(t).map(([k, v]) => [\n `${k}`,\n prepareDirection(v)\n ]);\n return new Map(sortEntries);\n}\n/** @internal */\nfunction mapToMap(t) {\n const sortEntries = Array.from(t).map(([k, v]) => [\n `${k}`,\n prepareDirection(v)\n ]);\n return new Map(sortEntries);\n}\n/** converts a Sort type into a type that is valid for the server (SortForCmd) */\nfunction formatSort(sort, direction) {\n if (sort == null)\n return undefined;\n if (typeof sort === 'string')\n return new Map([[sort, prepareDirection(direction)]]); // 'fieldName'\n if (typeof sort !== 'object') {\n throw new error_1.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object`);\n }\n if (!isReadonlyArray(sort)) {\n if (isMap(sort))\n return mapToMap(sort); // Map<fieldName, SortDirection>\n if (Object.keys(sort).length)\n return objectToMap(sort); // { [fieldName: string]: SortDirection }\n return undefined;\n }\n if (!sort.length)\n return undefined;\n if (isDeep(sort))\n return deepToMap(sort); // [ [fieldName, sortDir], [fieldName, sortDir] ... ]\n if (isPair(sort))\n return pairToMap(sort); // [ fieldName, sortDir ]\n return stringsToMap(sort); // [ fieldName, fieldName ]\n}\n//# sourceMappingURL=sort.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,aAAa;CACrB,MAAM;;CAEN,SAAS,iBAAiB,YAAY,GAAG;EACrC,MAAM,QAAQ,GAAG,YAAY,aAAa;AAC1C,MAAI,OAAO,UAAU,CACjB,QAAO;AACX,UAAQ,OAAR;GACI,KAAK;GACL,KAAK;GACL,KAAK,IACD,QAAO;GACX,KAAK;GACL,KAAK;GACL,KAAK,KACD,QAAO;GACX,QACI,OAAM,IAAI,QAAQ,0BAA0B,2BAA2B,KAAK,UAAU,UAAU,GAAG;;;;CAI/G,SAAS,OAAO,GAAG;AACf,SAAO,OAAO,MAAM,YAAY,KAAK,QAAQ,WAAW,KAAK,OAAO,EAAE,UAAU;;;CAGpF,SAAS,OAAO,GAAG;AACf,MAAI,MAAM,QAAQ,EAAE,IAAI,EAAE,WAAW,EACjC,KAAI;AACA,oBAAiB,EAAE,GAAG;AACtB,UAAO;UAEL;AACF,UAAO;;AAGf,SAAO;;CAEX,SAAS,OAAO,GAAG;AACf,SAAO,MAAM,QAAQ,EAAE,IAAI,MAAM,QAAQ,EAAE,GAAG;;CAElD,SAAS,MAAM,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QAAO,YAAY,KAAK;AAC5B;;AAEJ,MAAI,CAAC,KAAK,OACN,QAAO;AACX,MAAI,OAAO,KAAK,CACZ,QAAO,UAAU,KAAK;AAC1B,MAAI,OAAO,KAAK,CACZ,QAAO,UAAU,KAAK;AAC1B,SAAO,aAAa,KAAK"}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin, __require } from "../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_error } from "./error.mjs";
|
|
3
|
-
import { require_utils } from "./utils.mjs";
|
|
4
|
-
|
|
5
|
-
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.js
|
|
6
|
-
var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.LegacyTimeoutContext = exports.CSOTTimeoutContext = exports.TimeoutContext = exports.Timeout = exports.TimeoutError = void 0;
|
|
9
|
-
const timers_1 = __require("timers");
|
|
10
|
-
const error_1 = require_error();
|
|
11
|
-
const utils_1 = require_utils();
|
|
12
|
-
/** @internal */
|
|
13
|
-
var TimeoutError = class extends Error {
|
|
14
|
-
get name() {
|
|
15
|
-
return "TimeoutError";
|
|
16
|
-
}
|
|
17
|
-
constructor(message, options) {
|
|
18
|
-
super(message, options);
|
|
19
|
-
this.duration = options.duration;
|
|
20
|
-
}
|
|
21
|
-
static is(error) {
|
|
22
|
-
return error != null && typeof error === "object" && "name" in error && error.name === "TimeoutError";
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
exports.TimeoutError = TimeoutError;
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
* This class is an abstraction over timeouts
|
|
29
|
-
* The Timeout class can only be in the pending or rejected states. It is guaranteed not to resolve
|
|
30
|
-
* if interacted with exclusively through its public API
|
|
31
|
-
* */
|
|
32
|
-
var Timeout = class Timeout extends Promise {
|
|
33
|
-
get remainingTime() {
|
|
34
|
-
if (this.timedOut) return 0;
|
|
35
|
-
if (this.duration === 0) return Infinity;
|
|
36
|
-
return this.start + this.duration - Math.trunc(performance.now());
|
|
37
|
-
}
|
|
38
|
-
get timeElapsed() {
|
|
39
|
-
return Math.trunc(performance.now()) - this.start;
|
|
40
|
-
}
|
|
41
|
-
/** Create a new timeout that expires in `duration` ms */
|
|
42
|
-
constructor(executor = () => null, options) {
|
|
43
|
-
const duration = options?.duration ?? 0;
|
|
44
|
-
const unref = !!options?.unref;
|
|
45
|
-
const rejection = options?.rejection;
|
|
46
|
-
if (duration < 0) throw new error_1.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration");
|
|
47
|
-
let reject;
|
|
48
|
-
super((_, promiseReject) => {
|
|
49
|
-
reject = promiseReject;
|
|
50
|
-
executor(utils_1.noop, promiseReject);
|
|
51
|
-
});
|
|
52
|
-
this.ended = null;
|
|
53
|
-
this.timedOut = false;
|
|
54
|
-
this.cleared = false;
|
|
55
|
-
this.duration = duration;
|
|
56
|
-
this.start = Math.trunc(performance.now());
|
|
57
|
-
if (rejection == null && this.duration > 0) {
|
|
58
|
-
this.id = (0, timers_1.setTimeout)(() => {
|
|
59
|
-
this.ended = Math.trunc(performance.now());
|
|
60
|
-
this.timedOut = true;
|
|
61
|
-
reject(new TimeoutError(`Expired after ${duration}ms`, { duration }));
|
|
62
|
-
}, this.duration);
|
|
63
|
-
if (typeof this.id.unref === "function" && unref) this.id.unref();
|
|
64
|
-
} else if (rejection != null) {
|
|
65
|
-
this.ended = Math.trunc(performance.now());
|
|
66
|
-
this.timedOut = true;
|
|
67
|
-
reject(rejection);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Clears the underlying timeout. This method is idempotent
|
|
72
|
-
*/
|
|
73
|
-
clear() {
|
|
74
|
-
(0, timers_1.clearTimeout)(this.id);
|
|
75
|
-
this.id = void 0;
|
|
76
|
-
this.timedOut = false;
|
|
77
|
-
this.cleared = true;
|
|
78
|
-
}
|
|
79
|
-
throwIfExpired() {
|
|
80
|
-
if (this.timedOut) {
|
|
81
|
-
this.then(void 0, utils_1.squashError);
|
|
82
|
-
throw new TimeoutError("Timed out", { duration: this.duration });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
static expires(duration, unref) {
|
|
86
|
-
return new Timeout(void 0, {
|
|
87
|
-
duration,
|
|
88
|
-
unref
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
static reject(rejection) {
|
|
92
|
-
return new Timeout(void 0, {
|
|
93
|
-
duration: 0,
|
|
94
|
-
unref: true,
|
|
95
|
-
rejection
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
exports.Timeout = Timeout;
|
|
100
|
-
function isLegacyTimeoutContextOptions(v) {
|
|
101
|
-
return v != null && typeof v === "object" && "serverSelectionTimeoutMS" in v && typeof v.serverSelectionTimeoutMS === "number" && "waitQueueTimeoutMS" in v && typeof v.waitQueueTimeoutMS === "number";
|
|
102
|
-
}
|
|
103
|
-
function isCSOTTimeoutContextOptions(v) {
|
|
104
|
-
return v != null && typeof v === "object" && "serverSelectionTimeoutMS" in v && typeof v.serverSelectionTimeoutMS === "number" && "timeoutMS" in v && typeof v.timeoutMS === "number";
|
|
105
|
-
}
|
|
106
|
-
/** @internal */
|
|
107
|
-
var TimeoutContext = class {
|
|
108
|
-
static create(options) {
|
|
109
|
-
if (options.session?.timeoutContext != null) return options.session?.timeoutContext;
|
|
110
|
-
if (isCSOTTimeoutContextOptions(options)) return new CSOTTimeoutContext(options);
|
|
111
|
-
else if (isLegacyTimeoutContextOptions(options)) return new LegacyTimeoutContext(options);
|
|
112
|
-
else throw new error_1.MongoRuntimeError("Unrecognized options");
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
exports.TimeoutContext = TimeoutContext;
|
|
116
|
-
/** @internal */
|
|
117
|
-
var CSOTTimeoutContext = class CSOTTimeoutContext extends TimeoutContext {
|
|
118
|
-
constructor(options) {
|
|
119
|
-
super();
|
|
120
|
-
this.minRoundTripTime = 0;
|
|
121
|
-
this.start = Math.trunc(performance.now());
|
|
122
|
-
this.timeoutMS = options.timeoutMS;
|
|
123
|
-
this.serverSelectionTimeoutMS = options.serverSelectionTimeoutMS;
|
|
124
|
-
this.socketTimeoutMS = options.socketTimeoutMS;
|
|
125
|
-
this.clearServerSelectionTimeout = false;
|
|
126
|
-
}
|
|
127
|
-
get maxTimeMS() {
|
|
128
|
-
return this.remainingTimeMS - this.minRoundTripTime;
|
|
129
|
-
}
|
|
130
|
-
get remainingTimeMS() {
|
|
131
|
-
const timePassed = Math.trunc(performance.now()) - this.start;
|
|
132
|
-
return this.timeoutMS <= 0 ? Infinity : this.timeoutMS - timePassed;
|
|
133
|
-
}
|
|
134
|
-
csotEnabled() {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
get serverSelectionTimeout() {
|
|
138
|
-
if (typeof this._serverSelectionTimeout !== "object" || this._serverSelectionTimeout?.cleared) {
|
|
139
|
-
const { remainingTimeMS, serverSelectionTimeoutMS } = this;
|
|
140
|
-
if (remainingTimeMS <= 0) return Timeout.reject(new error_1.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));
|
|
141
|
-
if (serverSelectionTimeoutMS !== 0 && (0, utils_1.csotMin)(remainingTimeMS, serverSelectionTimeoutMS) === serverSelectionTimeoutMS) this._serverSelectionTimeout = Timeout.expires(serverSelectionTimeoutMS);
|
|
142
|
-
else if (remainingTimeMS > 0 && Number.isFinite(remainingTimeMS)) this._serverSelectionTimeout = Timeout.expires(remainingTimeMS);
|
|
143
|
-
else this._serverSelectionTimeout = null;
|
|
144
|
-
}
|
|
145
|
-
return this._serverSelectionTimeout;
|
|
146
|
-
}
|
|
147
|
-
get connectionCheckoutTimeout() {
|
|
148
|
-
if (typeof this._connectionCheckoutTimeout !== "object" || this._connectionCheckoutTimeout?.cleared) if (typeof this._serverSelectionTimeout === "object") this._connectionCheckoutTimeout = this._serverSelectionTimeout;
|
|
149
|
-
else throw new error_1.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira");
|
|
150
|
-
return this._connectionCheckoutTimeout;
|
|
151
|
-
}
|
|
152
|
-
get timeoutForSocketWrite() {
|
|
153
|
-
const { remainingTimeMS } = this;
|
|
154
|
-
if (!Number.isFinite(remainingTimeMS)) return null;
|
|
155
|
-
if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS);
|
|
156
|
-
return Timeout.reject(new error_1.MongoOperationTimeoutError("Timed out before socket write"));
|
|
157
|
-
}
|
|
158
|
-
get timeoutForSocketRead() {
|
|
159
|
-
const { remainingTimeMS } = this;
|
|
160
|
-
if (!Number.isFinite(remainingTimeMS)) return null;
|
|
161
|
-
if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS);
|
|
162
|
-
return Timeout.reject(new error_1.MongoOperationTimeoutError("Timed out before socket read"));
|
|
163
|
-
}
|
|
164
|
-
refresh() {
|
|
165
|
-
this.start = Math.trunc(performance.now());
|
|
166
|
-
this.minRoundTripTime = 0;
|
|
167
|
-
this._serverSelectionTimeout?.clear();
|
|
168
|
-
this._connectionCheckoutTimeout?.clear();
|
|
169
|
-
}
|
|
170
|
-
clear() {
|
|
171
|
-
this._serverSelectionTimeout?.clear();
|
|
172
|
-
this._connectionCheckoutTimeout?.clear();
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* @internal
|
|
176
|
-
* Throws a MongoOperationTimeoutError if the context has expired.
|
|
177
|
-
* If the context has not expired, returns the `remainingTimeMS`
|
|
178
|
-
**/
|
|
179
|
-
getRemainingTimeMSOrThrow(message) {
|
|
180
|
-
const { remainingTimeMS } = this;
|
|
181
|
-
if (remainingTimeMS <= 0) throw new error_1.MongoOperationTimeoutError(message ?? `Expired after ${this.timeoutMS}ms`);
|
|
182
|
-
return remainingTimeMS;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @internal
|
|
186
|
-
* This method is intended to be used in situations where concurrent operation are on the same deadline, but cannot share a single `TimeoutContext` instance.
|
|
187
|
-
* Returns a new instance of `CSOTTimeoutContext` constructed with identical options, but setting the `start` property to `this.start`.
|
|
188
|
-
*/
|
|
189
|
-
clone() {
|
|
190
|
-
const timeoutContext = new CSOTTimeoutContext({
|
|
191
|
-
timeoutMS: this.timeoutMS,
|
|
192
|
-
serverSelectionTimeoutMS: this.serverSelectionTimeoutMS
|
|
193
|
-
});
|
|
194
|
-
timeoutContext.start = this.start;
|
|
195
|
-
return timeoutContext;
|
|
196
|
-
}
|
|
197
|
-
refreshed() {
|
|
198
|
-
return new CSOTTimeoutContext(this);
|
|
199
|
-
}
|
|
200
|
-
addMaxTimeMSToCommand(command, options) {
|
|
201
|
-
if (options.omitMaxTimeMS) return;
|
|
202
|
-
const maxTimeMS = this.remainingTimeMS - this.minRoundTripTime;
|
|
203
|
-
if (maxTimeMS > 0 && Number.isFinite(maxTimeMS)) command.maxTimeMS = maxTimeMS;
|
|
204
|
-
}
|
|
205
|
-
getSocketTimeoutMS() {
|
|
206
|
-
return 0;
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
exports.CSOTTimeoutContext = CSOTTimeoutContext;
|
|
210
|
-
/** @internal */
|
|
211
|
-
var LegacyTimeoutContext = class LegacyTimeoutContext extends TimeoutContext {
|
|
212
|
-
constructor(options) {
|
|
213
|
-
super();
|
|
214
|
-
this.options = options;
|
|
215
|
-
this.clearServerSelectionTimeout = true;
|
|
216
|
-
}
|
|
217
|
-
csotEnabled() {
|
|
218
|
-
return false;
|
|
219
|
-
}
|
|
220
|
-
get serverSelectionTimeout() {
|
|
221
|
-
if (this.options.serverSelectionTimeoutMS != null && this.options.serverSelectionTimeoutMS > 0) return Timeout.expires(this.options.serverSelectionTimeoutMS);
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
get connectionCheckoutTimeout() {
|
|
225
|
-
if (this.options.waitQueueTimeoutMS != null && this.options.waitQueueTimeoutMS > 0) return Timeout.expires(this.options.waitQueueTimeoutMS);
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
get timeoutForSocketWrite() {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
get timeoutForSocketRead() {
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
refresh() {}
|
|
235
|
-
clear() {}
|
|
236
|
-
get maxTimeMS() {
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
refreshed() {
|
|
240
|
-
return new LegacyTimeoutContext(this.options);
|
|
241
|
-
}
|
|
242
|
-
addMaxTimeMSToCommand(_command, _options) {}
|
|
243
|
-
getSocketTimeoutMS() {
|
|
244
|
-
return this.options.socketTimeoutMS;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
exports.LegacyTimeoutContext = LegacyTimeoutContext;
|
|
248
|
-
}));
|
|
249
|
-
|
|
250
|
-
//#endregion
|
|
251
|
-
export default require_timeout();
|
|
252
|
-
|
|
253
|
-
export { require_timeout };
|
|
254
|
-
//# sourceMappingURL=timeout.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LegacyTimeoutContext = exports.CSOTTimeoutContext = exports.TimeoutContext = exports.Timeout = exports.TimeoutError = void 0;\nconst timers_1 = require(\"timers\");\nconst error_1 = require(\"./error\");\nconst utils_1 = require(\"./utils\");\n/** @internal */\nclass TimeoutError extends Error {\n get name() {\n return 'TimeoutError';\n }\n constructor(message, options) {\n super(message, options);\n this.duration = options.duration;\n }\n static is(error) {\n return (error != null && typeof error === 'object' && 'name' in error && error.name === 'TimeoutError');\n }\n}\nexports.TimeoutError = TimeoutError;\n/**\n * @internal\n * This class is an abstraction over timeouts\n * The Timeout class can only be in the pending or rejected states. It is guaranteed not to resolve\n * if interacted with exclusively through its public API\n * */\nclass Timeout extends Promise {\n get remainingTime() {\n if (this.timedOut)\n return 0;\n if (this.duration === 0)\n return Infinity;\n return this.start + this.duration - Math.trunc(performance.now());\n }\n get timeElapsed() {\n return Math.trunc(performance.now()) - this.start;\n }\n /** Create a new timeout that expires in `duration` ms */\n constructor(executor = () => null, options) {\n const duration = options?.duration ?? 0;\n const unref = !!options?.unref;\n const rejection = options?.rejection;\n if (duration < 0) {\n throw new error_1.MongoInvalidArgumentError('Cannot create a Timeout with a negative duration');\n }\n let reject;\n super((_, promiseReject) => {\n reject = promiseReject;\n executor(utils_1.noop, promiseReject);\n });\n this.ended = null;\n this.timedOut = false;\n this.cleared = false;\n this.duration = duration;\n this.start = Math.trunc(performance.now());\n if (rejection == null && this.duration > 0) {\n this.id = (0, timers_1.setTimeout)(() => {\n this.ended = Math.trunc(performance.now());\n this.timedOut = true;\n reject(new TimeoutError(`Expired after ${duration}ms`, { duration }));\n }, this.duration);\n if (typeof this.id.unref === 'function' && unref) {\n // Ensure we do not keep the Node.js event loop running\n this.id.unref();\n }\n }\n else if (rejection != null) {\n this.ended = Math.trunc(performance.now());\n this.timedOut = true;\n reject(rejection);\n }\n }\n /**\n * Clears the underlying timeout. This method is idempotent\n */\n clear() {\n (0, timers_1.clearTimeout)(this.id);\n this.id = undefined;\n this.timedOut = false;\n this.cleared = true;\n }\n throwIfExpired() {\n if (this.timedOut) {\n // This method is invoked when someone wants to throw immediately instead of await the result of this promise\n // Since they won't be handling the rejection from the promise (because we're about to throw here)\n // attach handling to prevent this from bubbling up to Node.js\n this.then(undefined, utils_1.squashError);\n throw new TimeoutError('Timed out', { duration: this.duration });\n }\n }\n static expires(duration, unref) {\n return new Timeout(undefined, { duration, unref });\n }\n static reject(rejection) {\n return new Timeout(undefined, { duration: 0, unref: true, rejection });\n }\n}\nexports.Timeout = Timeout;\nfunction isLegacyTimeoutContextOptions(v) {\n return (v != null &&\n typeof v === 'object' &&\n 'serverSelectionTimeoutMS' in v &&\n typeof v.serverSelectionTimeoutMS === 'number' &&\n 'waitQueueTimeoutMS' in v &&\n typeof v.waitQueueTimeoutMS === 'number');\n}\nfunction isCSOTTimeoutContextOptions(v) {\n return (v != null &&\n typeof v === 'object' &&\n 'serverSelectionTimeoutMS' in v &&\n typeof v.serverSelectionTimeoutMS === 'number' &&\n 'timeoutMS' in v &&\n typeof v.timeoutMS === 'number');\n}\n/** @internal */\nclass TimeoutContext {\n static create(options) {\n if (options.session?.timeoutContext != null)\n return options.session?.timeoutContext;\n if (isCSOTTimeoutContextOptions(options))\n return new CSOTTimeoutContext(options);\n else if (isLegacyTimeoutContextOptions(options))\n return new LegacyTimeoutContext(options);\n else\n throw new error_1.MongoRuntimeError('Unrecognized options');\n }\n}\nexports.TimeoutContext = TimeoutContext;\n/** @internal */\nclass CSOTTimeoutContext extends TimeoutContext {\n constructor(options) {\n super();\n this.minRoundTripTime = 0;\n this.start = Math.trunc(performance.now());\n this.timeoutMS = options.timeoutMS;\n this.serverSelectionTimeoutMS = options.serverSelectionTimeoutMS;\n this.socketTimeoutMS = options.socketTimeoutMS;\n this.clearServerSelectionTimeout = false;\n }\n get maxTimeMS() {\n return this.remainingTimeMS - this.minRoundTripTime;\n }\n get remainingTimeMS() {\n const timePassed = Math.trunc(performance.now()) - this.start;\n return this.timeoutMS <= 0 ? Infinity : this.timeoutMS - timePassed;\n }\n csotEnabled() {\n return true;\n }\n get serverSelectionTimeout() {\n // check for undefined\n if (typeof this._serverSelectionTimeout !== 'object' || this._serverSelectionTimeout?.cleared) {\n const { remainingTimeMS, serverSelectionTimeoutMS } = this;\n if (remainingTimeMS <= 0)\n return Timeout.reject(new error_1.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`));\n const usingServerSelectionTimeoutMS = serverSelectionTimeoutMS !== 0 &&\n (0, utils_1.csotMin)(remainingTimeMS, serverSelectionTimeoutMS) === serverSelectionTimeoutMS;\n if (usingServerSelectionTimeoutMS) {\n this._serverSelectionTimeout = Timeout.expires(serverSelectionTimeoutMS);\n }\n else {\n if (remainingTimeMS > 0 && Number.isFinite(remainingTimeMS)) {\n this._serverSelectionTimeout = Timeout.expires(remainingTimeMS);\n }\n else {\n this._serverSelectionTimeout = null;\n }\n }\n }\n return this._serverSelectionTimeout;\n }\n get connectionCheckoutTimeout() {\n if (typeof this._connectionCheckoutTimeout !== 'object' ||\n this._connectionCheckoutTimeout?.cleared) {\n if (typeof this._serverSelectionTimeout === 'object') {\n // null or Timeout\n this._connectionCheckoutTimeout = this._serverSelectionTimeout;\n }\n else {\n throw new error_1.MongoRuntimeError('Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira');\n }\n }\n return this._connectionCheckoutTimeout;\n }\n get timeoutForSocketWrite() {\n const { remainingTimeMS } = this;\n if (!Number.isFinite(remainingTimeMS))\n return null;\n if (remainingTimeMS > 0)\n return Timeout.expires(remainingTimeMS);\n return Timeout.reject(new error_1.MongoOperationTimeoutError('Timed out before socket write'));\n }\n get timeoutForSocketRead() {\n const { remainingTimeMS } = this;\n if (!Number.isFinite(remainingTimeMS))\n return null;\n if (remainingTimeMS > 0)\n return Timeout.expires(remainingTimeMS);\n return Timeout.reject(new error_1.MongoOperationTimeoutError('Timed out before socket read'));\n }\n refresh() {\n this.start = Math.trunc(performance.now());\n this.minRoundTripTime = 0;\n this._serverSelectionTimeout?.clear();\n this._connectionCheckoutTimeout?.clear();\n }\n clear() {\n this._serverSelectionTimeout?.clear();\n this._connectionCheckoutTimeout?.clear();\n }\n /**\n * @internal\n * Throws a MongoOperationTimeoutError if the context has expired.\n * If the context has not expired, returns the `remainingTimeMS`\n **/\n getRemainingTimeMSOrThrow(message) {\n const { remainingTimeMS } = this;\n if (remainingTimeMS <= 0)\n throw new error_1.MongoOperationTimeoutError(message ?? `Expired after ${this.timeoutMS}ms`);\n return remainingTimeMS;\n }\n /**\n * @internal\n * This method is intended to be used in situations where concurrent operation are on the same deadline, but cannot share a single `TimeoutContext` instance.\n * Returns a new instance of `CSOTTimeoutContext` constructed with identical options, but setting the `start` property to `this.start`.\n */\n clone() {\n const timeoutContext = new CSOTTimeoutContext({\n timeoutMS: this.timeoutMS,\n serverSelectionTimeoutMS: this.serverSelectionTimeoutMS\n });\n timeoutContext.start = this.start;\n return timeoutContext;\n }\n refreshed() {\n return new CSOTTimeoutContext(this);\n }\n addMaxTimeMSToCommand(command, options) {\n if (options.omitMaxTimeMS)\n return;\n const maxTimeMS = this.remainingTimeMS - this.minRoundTripTime;\n if (maxTimeMS > 0 && Number.isFinite(maxTimeMS))\n command.maxTimeMS = maxTimeMS;\n }\n getSocketTimeoutMS() {\n return 0;\n }\n}\nexports.CSOTTimeoutContext = CSOTTimeoutContext;\n/** @internal */\nclass LegacyTimeoutContext extends TimeoutContext {\n constructor(options) {\n super();\n this.options = options;\n this.clearServerSelectionTimeout = true;\n }\n csotEnabled() {\n return false;\n }\n get serverSelectionTimeout() {\n if (this.options.serverSelectionTimeoutMS != null && this.options.serverSelectionTimeoutMS > 0)\n return Timeout.expires(this.options.serverSelectionTimeoutMS);\n return null;\n }\n get connectionCheckoutTimeout() {\n if (this.options.waitQueueTimeoutMS != null && this.options.waitQueueTimeoutMS > 0)\n return Timeout.expires(this.options.waitQueueTimeoutMS);\n return null;\n }\n get timeoutForSocketWrite() {\n return null;\n }\n get timeoutForSocketRead() {\n return null;\n }\n refresh() {\n return;\n }\n clear() {\n return;\n }\n get maxTimeMS() {\n return null;\n }\n refreshed() {\n return new LegacyTimeoutContext(this.options);\n }\n addMaxTimeMSToCommand(_command, _options) {\n // No max timeMS is added to commands in legacy timeout mode.\n }\n getSocketTimeoutMS() {\n return this.options.socketTimeoutMS;\n }\n}\nexports.LegacyTimeoutContext = LegacyTimeoutContext;\n//# sourceMappingURL=timeout.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,uBAAuB,QAAQ,qBAAq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