index.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. import { Admin } from './admin';
  2. import { OrderedBulkOperation } from './bulk/ordered';
  3. import { UnorderedBulkOperation } from './bulk/unordered';
  4. import { ChangeStream } from './change_stream';
  5. import { Collection } from './collection';
  6. import { AbstractCursor } from './cursor/abstract_cursor';
  7. import { AggregationCursor } from './cursor/aggregation_cursor';
  8. import { FindCursor } from './cursor/find_cursor';
  9. import { ListCollectionsCursor } from './cursor/list_collections_cursor';
  10. import { ListIndexesCursor } from './cursor/list_indexes_cursor';
  11. import type { RunCommandCursor } from './cursor/run_command_cursor';
  12. import { Db } from './db';
  13. import { GridFSBucket } from './gridfs';
  14. import { GridFSBucketReadStream } from './gridfs/download';
  15. import { GridFSBucketWriteStream } from './gridfs/upload';
  16. import { MongoClient } from './mongo_client';
  17. import { CancellationToken } from './mongo_types';
  18. import { ClientSession } from './sessions';
  19. /** @public */
  20. export { BSON } from './bson';
  21. export {
  22. Binary,
  23. BSONRegExp,
  24. BSONSymbol,
  25. BSONType,
  26. Code,
  27. DBRef,
  28. Decimal128,
  29. Double,
  30. Int32,
  31. Long,
  32. MaxKey,
  33. MinKey,
  34. ObjectId,
  35. Timestamp
  36. } from './bson';
  37. export { AnyBulkWriteOperation, BulkWriteOptions, MongoBulkWriteError } from './bulk/common';
  38. export { ChangeStreamCursor } from './cursor/change_stream_cursor';
  39. export {
  40. MongoAPIError,
  41. MongoAWSError,
  42. MongoAzureError,
  43. MongoBatchReExecutionError,
  44. MongoChangeStreamError,
  45. MongoCompatibilityError,
  46. MongoCursorExhaustedError,
  47. MongoCursorInUseError,
  48. MongoDecompressionError,
  49. MongoDriverError,
  50. MongoError,
  51. MongoExpiredSessionError,
  52. MongoGridFSChunkError,
  53. MongoGridFSStreamError,
  54. MongoInvalidArgumentError,
  55. MongoKerberosError,
  56. MongoMissingCredentialsError,
  57. MongoMissingDependencyError,
  58. MongoNetworkError,
  59. MongoNetworkTimeoutError,
  60. MongoNotConnectedError,
  61. MongoParseError,
  62. MongoRuntimeError,
  63. MongoServerClosedError,
  64. MongoServerError,
  65. MongoServerSelectionError,
  66. MongoSystemError,
  67. MongoTailableCursorError,
  68. MongoTopologyClosedError,
  69. MongoTransactionError,
  70. MongoUnexpectedServerResponseError,
  71. MongoWriteConcernError
  72. } from './error';
  73. export {
  74. AbstractCursor,
  75. // Actual driver classes exported
  76. Admin,
  77. AggregationCursor,
  78. CancellationToken,
  79. ChangeStream,
  80. ClientSession,
  81. Collection,
  82. Db,
  83. FindCursor,
  84. GridFSBucket,
  85. GridFSBucketReadStream,
  86. GridFSBucketWriteStream,
  87. ListCollectionsCursor,
  88. ListIndexesCursor,
  89. MongoClient,
  90. OrderedBulkOperation,
  91. RunCommandCursor,
  92. UnorderedBulkOperation
  93. };
  94. // enums
  95. export { BatchType } from './bulk/common';
  96. export { GSSAPICanonicalizationValue } from './cmap/auth/gssapi';
  97. export { AuthMechanism } from './cmap/auth/providers';
  98. export { Compressor } from './cmap/wire_protocol/compression';
  99. export { CURSOR_FLAGS } from './cursor/abstract_cursor';
  100. export { AutoEncryptionLoggerLevel } from './deps';
  101. export { MongoErrorLabel } from './error';
  102. export { ExplainVerbosity } from './explain';
  103. export { ServerApiVersion } from './mongo_client';
  104. export { ReturnDocument } from './operations/find_and_modify';
  105. export { ProfilingLevel } from './operations/set_profiling_level';
  106. export { ReadConcernLevel } from './read_concern';
  107. export { ReadPreferenceMode } from './read_preference';
  108. export { ServerType, TopologyType } from './sdam/common';
  109. // Helper classes
  110. export { ReadConcern } from './read_concern';
  111. export { ReadPreference } from './read_preference';
  112. export { WriteConcern } from './write_concern';
  113. // events
  114. export {
  115. CommandFailedEvent,
  116. CommandStartedEvent,
  117. CommandSucceededEvent
  118. } from './cmap/command_monitoring_events';
  119. export {
  120. ConnectionCheckedInEvent,
  121. ConnectionCheckedOutEvent,
  122. ConnectionCheckOutFailedEvent,
  123. ConnectionCheckOutStartedEvent,
  124. ConnectionClosedEvent,
  125. ConnectionCreatedEvent,
  126. ConnectionPoolClearedEvent,
  127. ConnectionPoolClosedEvent,
  128. ConnectionPoolCreatedEvent,
  129. ConnectionPoolMonitoringEvent,
  130. ConnectionPoolReadyEvent,
  131. ConnectionReadyEvent
  132. } from './cmap/connection_pool_events';
  133. export {
  134. ServerClosedEvent,
  135. ServerDescriptionChangedEvent,
  136. ServerHeartbeatFailedEvent,
  137. ServerHeartbeatStartedEvent,
  138. ServerHeartbeatSucceededEvent,
  139. ServerOpeningEvent,
  140. TopologyClosedEvent,
  141. TopologyDescriptionChangedEvent,
  142. TopologyOpeningEvent
  143. } from './sdam/events';
  144. export { SrvPollingEvent } from './sdam/srv_polling';
  145. // type only exports below, these are removed from emitted JS
  146. export type { AdminPrivate } from './admin';
  147. export type { BSONSerializeOptions, Document } from './bson';
  148. export type { deserialize, serialize } from './bson';
  149. export type {
  150. BulkResult,
  151. BulkWriteOperationError,
  152. BulkWriteResult,
  153. DeleteManyModel,
  154. DeleteOneModel,
  155. InsertOneModel,
  156. ReplaceOneModel,
  157. UpdateManyModel,
  158. UpdateOneModel,
  159. WriteConcernError,
  160. WriteError
  161. } from './bulk/common';
  162. export type {
  163. Batch,
  164. BulkOperationBase,
  165. BulkOperationPrivate,
  166. FindOperators,
  167. WriteConcernErrorData
  168. } from './bulk/common';
  169. export type {
  170. ChangeStreamCollModDocument,
  171. ChangeStreamCreateDocument,
  172. ChangeStreamCreateIndexDocument,
  173. ChangeStreamDeleteDocument,
  174. ChangeStreamDocument,
  175. ChangeStreamDocumentCollectionUUID,
  176. ChangeStreamDocumentCommon,
  177. ChangeStreamDocumentKey,
  178. ChangeStreamDocumentOperationDescription,
  179. ChangeStreamDropDatabaseDocument,
  180. ChangeStreamDropDocument,
  181. ChangeStreamDropIndexDocument,
  182. ChangeStreamEvents,
  183. ChangeStreamInsertDocument,
  184. ChangeStreamInvalidateDocument,
  185. ChangeStreamNameSpace,
  186. ChangeStreamOptions,
  187. ChangeStreamRefineCollectionShardKeyDocument,
  188. ChangeStreamRenameDocument,
  189. ChangeStreamReplaceDocument,
  190. ChangeStreamReshardCollectionDocument,
  191. ChangeStreamShardCollectionDocument,
  192. ChangeStreamSplitEvent,
  193. ChangeStreamUpdateDocument,
  194. OperationTime,
  195. ResumeOptions,
  196. ResumeToken,
  197. UpdateDescription
  198. } from './change_stream';
  199. export type { AuthContext } from './cmap/auth/auth_provider';
  200. export type {
  201. AuthMechanismProperties,
  202. MongoCredentials,
  203. MongoCredentialsOptions
  204. } from './cmap/auth/mongo_credentials';
  205. export type {
  206. IdPServerInfo,
  207. IdPServerResponse,
  208. OIDCCallbackContext,
  209. OIDCRefreshFunction,
  210. OIDCRequestFunction
  211. } from './cmap/auth/mongodb_oidc';
  212. export type {
  213. BinMsg,
  214. MessageHeader,
  215. Msg,
  216. OpMsgOptions,
  217. OpQueryOptions,
  218. OpResponseOptions,
  219. Query,
  220. Response,
  221. WriteProtocolMessageType
  222. } from './cmap/commands';
  223. export type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS, Stream } from './cmap/connect';
  224. export type {
  225. CommandOptions,
  226. Connection,
  227. ConnectionEvents,
  228. ConnectionOptions,
  229. DestroyOptions,
  230. ProxyOptions
  231. } from './cmap/connection';
  232. export type {
  233. CloseOptions,
  234. ConnectionPool,
  235. ConnectionPoolEvents,
  236. ConnectionPoolOptions,
  237. PoolState,
  238. WaitQueueMember,
  239. WithConnectionCallback
  240. } from './cmap/connection_pool';
  241. export type { ClientMetadata, ClientMetadataOptions } from './cmap/handshake/client_metadata';
  242. export type {
  243. MessageStream,
  244. MessageStreamOptions,
  245. OperationDescription
  246. } from './cmap/message_stream';
  247. export type { ConnectionPoolMetrics } from './cmap/metrics';
  248. export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description';
  249. export type { CompressorName } from './cmap/wire_protocol/compression';
  250. export type { CollectionOptions, CollectionPrivate, ModifyResult } from './collection';
  251. export type {
  252. CONNECTION_CHECK_OUT_FAILED,
  253. CONNECTION_CHECK_OUT_STARTED,
  254. CONNECTION_CHECKED_IN,
  255. CONNECTION_CHECKED_OUT,
  256. CONNECTION_CLOSED,
  257. CONNECTION_CREATED,
  258. CONNECTION_POOL_CLEARED,
  259. CONNECTION_POOL_CLOSED,
  260. CONNECTION_POOL_CREATED,
  261. CONNECTION_POOL_READY,
  262. CONNECTION_READY,
  263. MONGO_CLIENT_EVENTS
  264. } from './constants';
  265. export type {
  266. AbstractCursorEvents,
  267. AbstractCursorOptions,
  268. CursorFlag,
  269. CursorStreamOptions
  270. } from './cursor/abstract_cursor';
  271. export type { InternalAbstractCursorOptions } from './cursor/abstract_cursor';
  272. export type { AggregationCursorOptions } from './cursor/aggregation_cursor';
  273. export type {
  274. ChangeStreamAggregateRawResult,
  275. ChangeStreamCursorOptions
  276. } from './cursor/change_stream_cursor';
  277. export type {
  278. ListSearchIndexesCursor,
  279. ListSearchIndexesOptions
  280. } from './cursor/list_search_indexes_cursor';
  281. export type { RunCursorCommandOptions } from './cursor/run_command_cursor';
  282. export type { DbOptions, DbPrivate } from './db';
  283. export type { AutoEncrypter, AutoEncryptionOptions, AutoEncryptionTlsOptions } from './deps';
  284. export type { Encrypter, EncrypterOptions } from './encrypter';
  285. export type { AnyError, ErrorDescription, MongoNetworkErrorOptions } from './error';
  286. export type { Explain, ExplainOptions, ExplainVerbosityLike } from './explain';
  287. export type {
  288. GridFSBucketReadStreamOptions,
  289. GridFSBucketReadStreamOptionsWithRevision,
  290. GridFSBucketReadStreamPrivate,
  291. GridFSFile
  292. } from './gridfs/download';
  293. export type { GridFSBucketEvents, GridFSBucketOptions, GridFSBucketPrivate } from './gridfs/index';
  294. export type { GridFSBucketWriteStreamOptions, GridFSChunk } from './gridfs/upload';
  295. export type {
  296. Auth,
  297. DriverInfo,
  298. MongoClientEvents,
  299. MongoClientOptions,
  300. MongoClientPrivate,
  301. MongoOptions,
  302. PkFactory,
  303. ServerApi,
  304. SupportedNodeConnectionOptions,
  305. SupportedSocketOptions,
  306. SupportedTLSConnectionOptions,
  307. SupportedTLSSocketOptions,
  308. WithSessionCallback
  309. } from './mongo_client';
  310. export type {
  311. Log,
  312. LogConvertible,
  313. Loggable,
  314. LoggableEvent,
  315. MongoDBLogWritable,
  316. MongoLoggableComponent,
  317. MongoLogger,
  318. MongoLoggerEnvOptions,
  319. MongoLoggerMongoClientOptions,
  320. MongoLoggerOptions,
  321. SeverityLevel
  322. } from './mongo_logger';
  323. export type {
  324. CommonEvents,
  325. EventsDescription,
  326. GenericListener,
  327. TypedEventEmitter
  328. } from './mongo_types';
  329. export type {
  330. AcceptedFields,
  331. AddToSetOperators,
  332. AlternativeType,
  333. ArrayElement,
  334. ArrayOperator,
  335. BitwiseFilter,
  336. BSONTypeAlias,
  337. Condition,
  338. EnhancedOmit,
  339. Filter,
  340. FilterOperations,
  341. FilterOperators,
  342. Flatten,
  343. InferIdType,
  344. IntegerType,
  345. IsAny,
  346. Join,
  347. KeysOfAType,
  348. KeysOfOtherType,
  349. MatchKeysAndValues,
  350. NestedPaths,
  351. NestedPathsOfType,
  352. NonObjectIdLikeDocument,
  353. NotAcceptedFields,
  354. NumericType,
  355. OneOrMore,
  356. OnlyFieldsOfType,
  357. OptionalId,
  358. OptionalUnlessRequiredId,
  359. PropertyType,
  360. PullAllOperator,
  361. PullOperator,
  362. PushOperator,
  363. RegExpOrString,
  364. RootFilterOperators,
  365. SchemaMember,
  366. SetFields,
  367. StrictFilter,
  368. StrictMatchKeysAndValues,
  369. StrictUpdateFilter,
  370. UpdateFilter,
  371. WithId,
  372. WithoutId
  373. } from './mongo_types';
  374. export type { AddUserOptions, RoleSpecification } from './operations/add_user';
  375. export type {
  376. AggregateOperation,
  377. AggregateOptions,
  378. DB_AGGREGATE_COLLECTION
  379. } from './operations/aggregate';
  380. export type {
  381. CollationOptions,
  382. CommandOperation,
  383. CommandOperationOptions,
  384. OperationParent
  385. } from './operations/command';
  386. export type { CommandCallbackOperation } from './operations/command';
  387. export type { IndexInformationOptions } from './operations/common_functions';
  388. export type { CountOptions } from './operations/count';
  389. export type { CountDocumentsOptions } from './operations/count_documents';
  390. export type {
  391. ClusteredCollectionOptions,
  392. CreateCollectionOptions,
  393. TimeSeriesCollectionOptions
  394. } from './operations/create_collection';
  395. export type { DeleteOptions, DeleteResult, DeleteStatement } from './operations/delete';
  396. export type { DistinctOptions } from './operations/distinct';
  397. export type { DropCollectionOptions, DropDatabaseOptions } from './operations/drop';
  398. export type { EstimatedDocumentCountOptions } from './operations/estimated_document_count';
  399. export type { EvalOptions } from './operations/eval';
  400. export type { ExecutionResult } from './operations/execute_operation';
  401. export type { FindOptions } from './operations/find';
  402. export type {
  403. FindOneAndDeleteOptions,
  404. FindOneAndReplaceOptions,
  405. FindOneAndUpdateOptions
  406. } from './operations/find_and_modify';
  407. export type {
  408. CreateIndexesOptions,
  409. DropIndexesOptions,
  410. IndexDescription,
  411. IndexDirection,
  412. IndexSpecification,
  413. ListIndexesOptions
  414. } from './operations/indexes';
  415. export type { InsertManyResult, InsertOneOptions, InsertOneResult } from './operations/insert';
  416. export type { CollectionInfo, ListCollectionsOptions } from './operations/list_collections';
  417. export type { ListDatabasesOptions, ListDatabasesResult } from './operations/list_databases';
  418. export type {
  419. AbstractCallbackOperation,
  420. AbstractOperation,
  421. Hint,
  422. OperationOptions
  423. } from './operations/operation';
  424. export type { ProfilingLevelOptions } from './operations/profiling_level';
  425. export type { RemoveUserOptions } from './operations/remove_user';
  426. export type { RenameOptions } from './operations/rename';
  427. export type { RunCommandOptions } from './operations/run_command';
  428. export type { SearchIndexDescription } from './operations/search_indexes/create';
  429. export type { SetProfilingLevelOptions } from './operations/set_profiling_level';
  430. export type {
  431. CollStats,
  432. CollStatsOptions,
  433. DbStatsOptions,
  434. WiredTigerData
  435. } from './operations/stats';
  436. export type {
  437. ReplaceOptions,
  438. UpdateOptions,
  439. UpdateResult,
  440. UpdateStatement
  441. } from './operations/update';
  442. export type { ValidateCollectionOptions } from './operations/validate_collection';
  443. export type { ReadConcernLike } from './read_concern';
  444. export type {
  445. HedgeOptions,
  446. ReadPreferenceFromOptions,
  447. ReadPreferenceLike,
  448. ReadPreferenceLikeOptions,
  449. ReadPreferenceOptions
  450. } from './read_preference';
  451. export type { ClusterTime, TimerQueue } from './sdam/common';
  452. export type {
  453. Monitor,
  454. MonitorEvents,
  455. MonitorInterval,
  456. MonitorIntervalOptions,
  457. MonitorOptions,
  458. MonitorPrivate,
  459. RTTPinger,
  460. RTTPingerOptions
  461. } from './sdam/monitor';
  462. export type { Server, ServerEvents, ServerOptions, ServerPrivate } from './sdam/server';
  463. export type {
  464. ServerDescription,
  465. ServerDescriptionOptions,
  466. TagSet,
  467. TopologyVersion
  468. } from './sdam/server_description';
  469. export type { ServerSelector } from './sdam/server_selection';
  470. export type { SrvPoller, SrvPollerEvents, SrvPollerOptions } from './sdam/srv_polling';
  471. export type {
  472. ConnectOptions,
  473. SelectServerOptions,
  474. ServerCapabilities,
  475. ServerSelectionCallback,
  476. ServerSelectionRequest,
  477. Topology,
  478. TopologyEvents,
  479. TopologyOptions,
  480. TopologyPrivate
  481. } from './sdam/topology';
  482. export type { TopologyDescription, TopologyDescriptionOptions } from './sdam/topology_description';
  483. export type {
  484. ClientSessionEvents,
  485. ClientSessionOptions,
  486. EndSessionOptions,
  487. ServerSession,
  488. ServerSessionId,
  489. ServerSessionPool,
  490. WithTransactionCallback
  491. } from './sessions';
  492. export type { Sort, SortDirection, SortDirectionForCmd, SortForCmd } from './sort';
  493. export type { Transaction, TransactionOptions, TxnState } from './transactions';
  494. export type {
  495. BufferPool,
  496. Callback,
  497. EventEmitterWithState,
  498. HostAddress,
  499. List,
  500. MongoDBCollectionNamespace,
  501. MongoDBNamespace
  502. } from './utils';
  503. export type { W, WriteConcernOptions, WriteConcernSettings } from './write_concern';