opusdev/vector-similarity-api
1
1export const SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces';2export const SYSTEM_INDEX_COLLECTION = 'system.indexes';3export const SYSTEM_PROFILE_COLLECTION = 'system.profile';4export const SYSTEM_USER_COLLECTION = 'system.users';5export const SYSTEM_COMMAND_COLLECTION = '$cmd';6export const SYSTEM_JS_COLLECTION = 'system.js';7 8// events9export const ERROR = 'error' as const;10export const TIMEOUT = 'timeout' as const;11export const CLOSE = 'close' as const;12export const OPEN = 'open' as const;13export const CONNECT = 'connect' as const;14export const CLOSED = 'closed' as const;15export const ENDED = 'ended' as const;16export const MESSAGE = 'message' as const;17export const PINNED = 'pinned' as const;18export const UNPINNED = 'unpinned' as const;19export const DESCRIPTION_RECEIVED = 'descriptionReceived';20/** @internal */21export const SERVER_OPENING = 'serverOpening' as const;22/** @internal */23export const SERVER_CLOSED = 'serverClosed' as const;24/** @internal */25export const SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged' as const;26/** @internal */27export const TOPOLOGY_OPENING = 'topologyOpening' as const;28/** @internal */29export const TOPOLOGY_CLOSED = 'topologyClosed' as const;30/** @internal */31export const TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged' as const;32/** @internal */33export const SERVER_SELECTION_STARTED = 'serverSelectionStarted' as const;34/** @internal */35export const SERVER_SELECTION_FAILED = 'serverSelectionFailed' as const;36/** @internal */37export const SERVER_SELECTION_SUCCEEDED = 'serverSelectionSucceeded' as const;38/** @internal */39export const WAITING_FOR_SUITABLE_SERVER = 'waitingForSuitableServer' as const;40/** @internal */41export const CONNECTION_POOL_CREATED = 'connectionPoolCreated' as const;42/** @internal */43export const CONNECTION_POOL_CLOSED = 'connectionPoolClosed' as const;44/** @internal */45export const CONNECTION_POOL_CLEARED = 'connectionPoolCleared' as const;46/** @internal */47export const CONNECTION_POOL_READY = 'connectionPoolReady' as const;48/** @internal */49export const CONNECTION_CREATED = 'connectionCreated' as const;50/** @internal */51export const CONNECTION_READY = 'connectionReady' as const;52/** @internal */53export const CONNECTION_CLOSED = 'connectionClosed' as const;54/** @internal */55export const CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted' as const;56/** @internal */57export const CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed' as const;58/** @internal */59export const CONNECTION_CHECKED_OUT = 'connectionCheckedOut' as const;60/** @internal */61export const CONNECTION_CHECKED_IN = 'connectionCheckedIn' as const;62export const CLUSTER_TIME_RECEIVED = 'clusterTimeReceived' as const;63/** @internal */64export const COMMAND_STARTED = 'commandStarted' as const;65/** @internal */66export const COMMAND_SUCCEEDED = 'commandSucceeded' as const;67/** @internal */68export const COMMAND_FAILED = 'commandFailed' as const;69/** @internal */70export const SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted' as const;71/** @internal */72export const SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded' as const;73/** @internal */74export const SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed' as const;75export const RESPONSE = 'response' as const;76export const MORE = 'more' as const;77export const INIT = 'init' as const;78export const CHANGE = 'change' as const;79export const END = 'end' as const;80export const RESUME_TOKEN_CHANGED = 'resumeTokenChanged' as const;81 82/** @public */83export const HEARTBEAT_EVENTS = Object.freeze([84 SERVER_HEARTBEAT_STARTED,85 SERVER_HEARTBEAT_SUCCEEDED,86 SERVER_HEARTBEAT_FAILED87] as const);88 89/** @public */90export const CMAP_EVENTS = Object.freeze([91 CONNECTION_POOL_CREATED,92 CONNECTION_POOL_READY,93 CONNECTION_POOL_CLEARED,94 CONNECTION_POOL_CLOSED,95 CONNECTION_CREATED,96 CONNECTION_READY,97 CONNECTION_CLOSED,98 CONNECTION_CHECK_OUT_STARTED,99 CONNECTION_CHECK_OUT_FAILED,100 CONNECTION_CHECKED_OUT,101 CONNECTION_CHECKED_IN102] as const);103 104/** @public */105export const TOPOLOGY_EVENTS = Object.freeze([106 SERVER_OPENING,107 SERVER_CLOSED,108 SERVER_DESCRIPTION_CHANGED,109 TOPOLOGY_OPENING,110 TOPOLOGY_CLOSED,111 TOPOLOGY_DESCRIPTION_CHANGED,112 ERROR,113 TIMEOUT,114 CLOSE115] as const);116 117/** @public */118export const APM_EVENTS = Object.freeze([119 COMMAND_STARTED,120 COMMAND_SUCCEEDED,121 COMMAND_FAILED122] as const);123 124/**125 * All events that we relay to the `Topology`126 * @internal127 */128export const SERVER_RELAY_EVENTS = Object.freeze([129 SERVER_HEARTBEAT_STARTED,130 SERVER_HEARTBEAT_SUCCEEDED,131 SERVER_HEARTBEAT_FAILED,132 COMMAND_STARTED,133 COMMAND_SUCCEEDED,134 COMMAND_FAILED,135 ...CMAP_EVENTS136] as const);137 138/**139 * All events we listen to from `Server` instances, but do not forward to the client140 * @internal141 */142export const LOCAL_SERVER_EVENTS = Object.freeze([143 CONNECT,144 DESCRIPTION_RECEIVED,145 CLOSED,146 ENDED147] as const);148 149/** @public */150export const MONGO_CLIENT_EVENTS = Object.freeze([151 ...CMAP_EVENTS,152 ...APM_EVENTS,153 ...TOPOLOGY_EVENTS,154 ...HEARTBEAT_EVENTS155] as const);156 157/**158 * @internal159 * The legacy hello command that was deprecated in MongoDB 5.0.160 */161export const LEGACY_HELLO_COMMAND = 'ismaster';162 163/**164 * @internal165 * The legacy hello command that was deprecated in MongoDB 5.0.166 */167export const LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster';168 169// Typescript errors if we index objects with `Symbol.for(...)`, so170// to avoid TS errors we pull them out into variables. Then we can type171// the objects (and class) that we expect to see them on and prevent TS172// errors.173/** @internal */174export const kDecorateResult = Symbol.for('@@mdb.decorateDecryptionResult');175/** @internal */176export const kDecoratedKeys = Symbol.for('@@mdb.decryptedKeys');177 