constants.js 5.6 KB

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