constants.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = exports.LEGACY_HELLO_COMMAND = exports.MONGO_CLIENT_EVENTS = exports.LOCAL_SERVER_EVENTS = exports.SERVER_RELAY_EVENTS = exports.APM_EVENTS = exports.TOPOLOGY_EVENTS = exports.CMAP_EVENTS = exports.HEARTBEAT_EVENTS = exports.SERVER_HEARTBEAT_FAILED = exports.SERVER_HEARTBEAT_SUCCEEDED = exports.SERVER_HEARTBEAT_STARTED = exports.COMMAND_FAILED = exports.COMMAND_SUCCEEDED = exports.COMMAND_STARTED = exports.CLUSTER_TIME_RECEIVED = exports.CONNECTION_CHECKED_IN = exports.CONNECTION_CHECKED_OUT = exports.CONNECTION_CHECK_OUT_FAILED = exports.CONNECTION_CHECK_OUT_STARTED = exports.CONNECTION_CLOSED = exports.CONNECTION_READY = exports.CONNECTION_CREATED = exports.CONNECTION_POOL_CLEARED = exports.CONNECTION_POOL_CLOSED = exports.CONNECTION_POOL_CREATED = exports.TOPOLOGY_DESCRIPTION_CHANGED = exports.TOPOLOGY_CLOSED = exports.TOPOLOGY_OPENING = exports.SERVER_DESCRIPTION_CHANGED = exports.SERVER_CLOSED = exports.SERVER_OPENING = exports.DESCRIPTION_RECEIVED = exports.UNPINNED = exports.PINNED = exports.MESSAGE = exports.ENDED = exports.CLOSED = exports.CONNECT = exports.OPEN = exports.CLOSE = exports.TIMEOUT = exports.ERROR = exports.SYSTEM_JS_COLLECTION = exports.SYSTEM_COMMAND_COLLECTION = exports.SYSTEM_USER_COLLECTION = exports.SYSTEM_PROFILE_COLLECTION = exports.SYSTEM_INDEX_COLLECTION = exports.SYSTEM_NAMESPACE_COLLECTION = void 0;
  4. exports.SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces';
  5. exports.SYSTEM_INDEX_COLLECTION = 'system.indexes';
  6. exports.SYSTEM_PROFILE_COLLECTION = 'system.profile';
  7. exports.SYSTEM_USER_COLLECTION = 'system.users';
  8. exports.SYSTEM_COMMAND_COLLECTION = '$cmd';
  9. exports.SYSTEM_JS_COLLECTION = 'system.js';
  10. // events
  11. exports.ERROR = 'error';
  12. exports.TIMEOUT = 'timeout';
  13. exports.CLOSE = 'close';
  14. exports.OPEN = 'open';
  15. exports.CONNECT = 'connect';
  16. exports.CLOSED = 'closed';
  17. exports.ENDED = 'ended';
  18. exports.MESSAGE = 'message';
  19. exports.PINNED = 'pinned';
  20. exports.UNPINNED = 'unpinned';
  21. exports.DESCRIPTION_RECEIVED = 'descriptionReceived';
  22. exports.SERVER_OPENING = 'serverOpening';
  23. exports.SERVER_CLOSED = 'serverClosed';
  24. exports.SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged';
  25. exports.TOPOLOGY_OPENING = 'topologyOpening';
  26. exports.TOPOLOGY_CLOSED = 'topologyClosed';
  27. exports.TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged';
  28. exports.CONNECTION_POOL_CREATED = 'connectionPoolCreated';
  29. exports.CONNECTION_POOL_CLOSED = 'connectionPoolClosed';
  30. exports.CONNECTION_POOL_CLEARED = 'connectionPoolCleared';
  31. exports.CONNECTION_CREATED = 'connectionCreated';
  32. exports.CONNECTION_READY = 'connectionReady';
  33. exports.CONNECTION_CLOSED = 'connectionClosed';
  34. exports.CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted';
  35. exports.CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed';
  36. exports.CONNECTION_CHECKED_OUT = 'connectionCheckedOut';
  37. exports.CONNECTION_CHECKED_IN = 'connectionCheckedIn';
  38. exports.CLUSTER_TIME_RECEIVED = 'clusterTimeReceived';
  39. exports.COMMAND_STARTED = 'commandStarted';
  40. exports.COMMAND_SUCCEEDED = 'commandSucceeded';
  41. exports.COMMAND_FAILED = 'commandFailed';
  42. exports.SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted';
  43. exports.SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded';
  44. exports.SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed';
  45. /** @public */
  46. exports.HEARTBEAT_EVENTS = Object.freeze([
  47. exports.SERVER_HEARTBEAT_STARTED,
  48. exports.SERVER_HEARTBEAT_SUCCEEDED,
  49. exports.SERVER_HEARTBEAT_FAILED
  50. ]);
  51. /** @public */
  52. exports.CMAP_EVENTS = Object.freeze([
  53. exports.CONNECTION_POOL_CREATED,
  54. exports.CONNECTION_POOL_CLOSED,
  55. exports.CONNECTION_CREATED,
  56. exports.CONNECTION_READY,
  57. exports.CONNECTION_CLOSED,
  58. exports.CONNECTION_CHECK_OUT_STARTED,
  59. exports.CONNECTION_CHECK_OUT_FAILED,
  60. exports.CONNECTION_CHECKED_OUT,
  61. exports.CONNECTION_CHECKED_IN,
  62. exports.CONNECTION_POOL_CLEARED
  63. ]);
  64. /** @public */
  65. exports.TOPOLOGY_EVENTS = Object.freeze([
  66. exports.SERVER_OPENING,
  67. exports.SERVER_CLOSED,
  68. exports.SERVER_DESCRIPTION_CHANGED,
  69. exports.TOPOLOGY_OPENING,
  70. exports.TOPOLOGY_CLOSED,
  71. exports.TOPOLOGY_DESCRIPTION_CHANGED,
  72. exports.ERROR,
  73. exports.TIMEOUT,
  74. exports.CLOSE
  75. ]);
  76. /** @public */
  77. exports.APM_EVENTS = Object.freeze([
  78. exports.COMMAND_STARTED,
  79. exports.COMMAND_SUCCEEDED,
  80. exports.COMMAND_FAILED
  81. ]);
  82. /**
  83. * All events that we relay to the `Topology`
  84. * @internal
  85. */
  86. exports.SERVER_RELAY_EVENTS = Object.freeze([
  87. exports.SERVER_HEARTBEAT_STARTED,
  88. exports.SERVER_HEARTBEAT_SUCCEEDED,
  89. exports.SERVER_HEARTBEAT_FAILED,
  90. exports.COMMAND_STARTED,
  91. exports.COMMAND_SUCCEEDED,
  92. exports.COMMAND_FAILED,
  93. ...exports.CMAP_EVENTS
  94. ]);
  95. /**
  96. * All events we listen to from `Server` instances, but do not forward to the client
  97. * @internal
  98. */
  99. exports.LOCAL_SERVER_EVENTS = Object.freeze([
  100. exports.CONNECT,
  101. exports.DESCRIPTION_RECEIVED,
  102. exports.CLOSED,
  103. exports.ENDED
  104. ]);
  105. /** @public */
  106. exports.MONGO_CLIENT_EVENTS = Object.freeze([
  107. ...exports.CMAP_EVENTS,
  108. ...exports.APM_EVENTS,
  109. ...exports.TOPOLOGY_EVENTS,
  110. ...exports.HEARTBEAT_EVENTS
  111. ]);
  112. /**
  113. * @internal
  114. * The legacy hello command that was deprecated in MongoDB 5.0.
  115. */
  116. exports.LEGACY_HELLO_COMMAND = 'ismaster';
  117. /**
  118. * @internal
  119. * The legacy hello command that was deprecated in MongoDB 5.0.
  120. */
  121. exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster';
  122. //# sourceMappingURL=constants.js.map