| 130 | } |
| 131 | |
| 132 | export class UnifiedMongoClient extends MongoClient { |
| 133 | commandEvents: CommandEvent[] = []; |
| 134 | cmapEvents: CmapEvent[] = []; |
| 135 | sdamEvents: SdamEvent[] = []; |
| 136 | failPoints: Document[] = []; |
| 137 | logCollector?: { buffer: LogMessage[]; write: (log: Log) => void }; |
| 138 | |
| 139 | ignoredEvents: string[]; |
| 140 | observeSensitiveCommands: boolean; |
| 141 | observedCommandEvents: ('commandStarted' | 'commandSucceeded' | 'commandFailed')[]; |
| 142 | observedCmapEvents: ( |
| 143 | | 'connectionPoolCreated' |
| 144 | | 'connectionPoolClosed' |
| 145 | | 'connectionPoolReady' |
| 146 | | 'connectionPoolCleared' |
| 147 | | 'connectionCreated' |
| 148 | | 'connectionReady' |
| 149 | | 'connectionClosed' |
| 150 | | 'connectionCheckOutStarted' |
| 151 | | 'connectionCheckOutFailed' |
| 152 | | 'connectionCheckedOut' |
| 153 | | 'connectionCheckedIn' |
| 154 | )[]; |
| 155 | observedSdamEvents: ( |
| 156 | | 'serverDescriptionChanged' |
| 157 | | 'serverHeartbeatStarted' |
| 158 | | 'serverHeartbeatFailed' |
| 159 | | 'serverHeartbeatSucceeded' |
| 160 | | 'serverOpened' |
| 161 | | 'serverClosed' |
| 162 | | 'topologyOpened' |
| 163 | | 'topologyClosed' |
| 164 | | 'topologyDescriptionChangedEvent' |
| 165 | )[]; |
| 166 | observedEventEmitter = new EventEmitter(); |
| 167 | _credentials: MongoCredentials | null; |
| 168 | |
| 169 | static COMMAND_EVENT_NAME_LOOKUP = { |
| 170 | commandStartedEvent: 'commandStarted', |
| 171 | commandSucceededEvent: 'commandSucceeded', |
| 172 | commandFailedEvent: 'commandFailed' |
| 173 | } as const; |
| 174 | |
| 175 | static CMAP_EVENT_NAME_LOOKUP = { |
| 176 | poolCreatedEvent: 'connectionPoolCreated', |
| 177 | poolClosedEvent: 'connectionPoolClosed', |
| 178 | poolReadyEvent: 'connectionPoolReady', |
| 179 | poolClearedEvent: 'connectionPoolCleared', |
| 180 | connectionCreatedEvent: 'connectionCreated', |
| 181 | connectionReadyEvent: 'connectionReady', |
| 182 | connectionClosedEvent: 'connectionClosed', |
| 183 | connectionCheckOutStartedEvent: 'connectionCheckOutStarted', |
| 184 | connectionCheckOutFailedEvent: 'connectionCheckOutFailed', |
| 185 | connectionCheckedOutEvent: 'connectionCheckedOut', |
| 186 | connectionCheckedInEvent: 'connectionCheckedIn' |
| 187 | } as const; |
| 188 | |
| 189 | static SDAM_EVENT_NAME_LOOKUP = { |
nothing calls this directly
no test coverage detected