@mongosh/types 1.1.5 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +2 -40
- package/lib/index.js.map +1 -1
- package/package.json +5 -2
- package/src/index.ts +3 -51
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConnectEventMap } from '@mongodb-js/devtools-connect';
|
|
1
2
|
export interface ApiEventArguments {
|
|
2
3
|
pipeline?: any[];
|
|
3
4
|
query?: object;
|
|
@@ -118,37 +119,6 @@ export interface SnippetsTransformErrorEvent {
|
|
|
118
119
|
addition: string;
|
|
119
120
|
name: string;
|
|
120
121
|
}
|
|
121
|
-
export interface SpConnectAttemptInitializedEvent {
|
|
122
|
-
uri: string;
|
|
123
|
-
driver: {
|
|
124
|
-
name: string;
|
|
125
|
-
version: string;
|
|
126
|
-
};
|
|
127
|
-
serviceProviderVersion: string;
|
|
128
|
-
host: string;
|
|
129
|
-
}
|
|
130
|
-
export interface SpConnectHeartbeatFailureEvent {
|
|
131
|
-
connectionId: string;
|
|
132
|
-
failure: Error;
|
|
133
|
-
isFailFast: boolean;
|
|
134
|
-
isKnownServer: boolean;
|
|
135
|
-
}
|
|
136
|
-
export interface SpConnectHeartbeatSucceededEvent {
|
|
137
|
-
connectionId: string;
|
|
138
|
-
}
|
|
139
|
-
export interface SpResolveSrvErrorEvent {
|
|
140
|
-
from: string;
|
|
141
|
-
error: Error;
|
|
142
|
-
duringLoad: boolean;
|
|
143
|
-
}
|
|
144
|
-
export interface SpResolveSrvSucceededEvent {
|
|
145
|
-
from: string;
|
|
146
|
-
to: string;
|
|
147
|
-
}
|
|
148
|
-
export interface SpMissingOptionalDependencyEvent {
|
|
149
|
-
name: string;
|
|
150
|
-
error: Error;
|
|
151
|
-
}
|
|
152
122
|
export interface EditorRunEditCommandEvent {
|
|
153
123
|
tmpDoc: string;
|
|
154
124
|
editor: string;
|
|
@@ -162,7 +132,7 @@ export interface EditorReadVscodeExtensionsFailedEvent {
|
|
|
162
132
|
vscodeDir: string;
|
|
163
133
|
error: Error;
|
|
164
134
|
}
|
|
165
|
-
export interface MongoshBusEventsMap {
|
|
135
|
+
export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
166
136
|
'mongosh:connect': (ev: ConnectEvent) => void;
|
|
167
137
|
'mongosh:new-user': (id: string, enableTelemetry: boolean) => void;
|
|
168
138
|
'mongosh:update-user': (id: string, enableTelemetry: boolean) => void;
|
|
@@ -205,15 +175,7 @@ export interface MongoshBusEventsMap {
|
|
|
205
175
|
'mongosh-snippets:load-snippet': (ev: SnippetsLoadSnippetEvent) => void;
|
|
206
176
|
'mongosh-snippets:snippet-command': (ev: SnippetsCommandEvent) => void;
|
|
207
177
|
'mongosh-snippets:transform-error': (ev: SnippetsTransformErrorEvent) => void;
|
|
208
|
-
'mongosh-sp:connect-attempt-initialized': (ev: SpConnectAttemptInitializedEvent) => void;
|
|
209
|
-
'mongosh-sp:connect-heartbeat-failure': (ev: SpConnectHeartbeatFailureEvent) => void;
|
|
210
|
-
'mongosh-sp:connect-heartbeat-succeeded': (ev: SpConnectHeartbeatSucceededEvent) => void;
|
|
211
|
-
'mongosh-sp:connect-fail-early': () => void;
|
|
212
|
-
'mongosh-sp:connect-attempt-finished': () => void;
|
|
213
|
-
'mongosh-sp:resolve-srv-error': (ev: SpResolveSrvErrorEvent) => void;
|
|
214
|
-
'mongosh-sp:resolve-srv-succeeded': (ev: SpResolveSrvSucceededEvent) => void;
|
|
215
178
|
'mongosh-sp:reset-connection-options': () => void;
|
|
216
|
-
'mongosh-sp:missing-optional-dependency': (ev: SpMissingOptionalDependencyEvent) => void;
|
|
217
179
|
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void;
|
|
218
180
|
'mongosh-editor:read-vscode-extensions-done': (ev: EditorReadVscodeExtensionsDoneEvent) => void;
|
|
219
181
|
'mongosh-editor:read-vscode-extensions-failed': (ev: EditorReadVscodeExtensionsFailedEvent) => void;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiVA,MAAa,eAAe;IAA5B;QACE,qBAAgB,GAAG,EAAE,CAAC;QACtB,cAAS,GAAkB,IAAI,CAAC;QAChC,oBAAe,GAAG,KAAK,CAAC;QACxB,WAAM,GAAkB,IAAI,CAAC;IAC/B,CAAC;CAAA;AALD,0CAKC;AAED,MAAa,wBAAwB;IAEnC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAkC,GAAM,EAAE,KAAyB;QACtF,QAAQ,GAAG,EAAE;YACX,KAAK,kBAAkB;gBACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,CAAC,EAAE;oBAC3C,OAAO,GAAG,GAAG,6BAA6B,CAAC;iBAC5C;gBACD,OAAO,IAAI,CAAC;YACd,KAAK,WAAW;gBACd,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,CAAC,CAAC,EAAE;oBAC/D,OAAO,GAAG,GAAG,qCAAqC,CAAC;iBACpD;gBACD,OAAO,IAAI,CAAC;YACd,KAAK,iBAAiB;gBACpB,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;oBAC9B,OAAO,GAAG,GAAG,oBAAoB,CAAC;iBACnC;gBACD,OAAO,IAAI,CAAC;YACd,KAAK,QAAQ;gBACX,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;oBAC/C,OAAO,GAAG,GAAG,2BAA2B,CAAC;iBAC1C;gBACD,OAAO,IAAI,CAAC;YACd;gBACE,OAAO,GAAG,GAAG,+BAA+B,CAAC;SAChD;IACH,CAAC;CACF;AA5BD,4DA4BC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AAC;SACd;KACF;IAGD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongosh/types",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Types for mongosh internals",
|
|
5
5
|
"author": "Anna Henningsen <anna.henningsen@mongodb.com>",
|
|
6
6
|
"homepage": "https://github.com/mongodb-js/mongosh/tree/main/packages/types#readme",
|
|
@@ -31,5 +31,8 @@
|
|
|
31
31
|
"mongosh": {
|
|
32
32
|
"unitTestsOnly": true
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@mongodb-js/devtools-connect": "^1.1.1"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "1a200600554f6aa59ec10aaedb915f67771eb7fd"
|
|
35
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint camelcase: 0 */
|
|
2
|
+
import type { ConnectEventMap } from '@mongodb-js/devtools-connect';
|
|
3
|
+
|
|
2
4
|
export interface ApiEventArguments {
|
|
3
5
|
pipeline?: any[];
|
|
4
6
|
query?: object;
|
|
@@ -144,40 +146,6 @@ export interface SnippetsTransformErrorEvent {
|
|
|
144
146
|
name: string;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
export interface SpConnectAttemptInitializedEvent {
|
|
148
|
-
uri: string;
|
|
149
|
-
driver: { name: string, version: string };
|
|
150
|
-
serviceProviderVersion: string;
|
|
151
|
-
host: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface SpConnectHeartbeatFailureEvent {
|
|
155
|
-
connectionId: string;
|
|
156
|
-
failure: Error;
|
|
157
|
-
isFailFast: boolean;
|
|
158
|
-
isKnownServer: boolean;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface SpConnectHeartbeatSucceededEvent {
|
|
162
|
-
connectionId: string;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export interface SpResolveSrvErrorEvent {
|
|
166
|
-
from: string;
|
|
167
|
-
error: Error;
|
|
168
|
-
duringLoad: boolean;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export interface SpResolveSrvSucceededEvent {
|
|
172
|
-
from: string;
|
|
173
|
-
to: string;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export interface SpMissingOptionalDependencyEvent {
|
|
177
|
-
name: string;
|
|
178
|
-
error: Error;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
149
|
export interface EditorRunEditCommandEvent {
|
|
182
150
|
tmpDoc: string;
|
|
183
151
|
editor: string;
|
|
@@ -194,7 +162,7 @@ export interface EditorReadVscodeExtensionsFailedEvent {
|
|
|
194
162
|
error: Error;
|
|
195
163
|
}
|
|
196
164
|
|
|
197
|
-
export interface MongoshBusEventsMap {
|
|
165
|
+
export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
198
166
|
/**
|
|
199
167
|
* Signals a connection to a MongoDB instance has been established
|
|
200
168
|
* or the used database changed.
|
|
@@ -349,24 +317,8 @@ export interface MongoshBusEventsMap {
|
|
|
349
317
|
/** Signals that a snippet has modified an error message. */
|
|
350
318
|
'mongosh-snippets:transform-error': (ev: SnippetsTransformErrorEvent) => void;
|
|
351
319
|
|
|
352
|
-
/** Signals that a connection attempt is about to be performed. */
|
|
353
|
-
'mongosh-sp:connect-attempt-initialized': (ev: SpConnectAttemptInitializedEvent) => void;
|
|
354
|
-
/** Signals that communicating to a specific server during connection did not succeed. */
|
|
355
|
-
'mongosh-sp:connect-heartbeat-failure': (ev: SpConnectHeartbeatFailureEvent) => void;
|
|
356
|
-
/** Signals that communicating to a specific server during connection succeeded. */
|
|
357
|
-
'mongosh-sp:connect-heartbeat-succeeded': (ev: SpConnectHeartbeatSucceededEvent) => void;
|
|
358
|
-
/** Signals that the service provider failed to connect because it deemed further attempts futile. */
|
|
359
|
-
'mongosh-sp:connect-fail-early': () => void;
|
|
360
|
-
/** Signals that the service provider finished attempting to connect, regardless of success. */
|
|
361
|
-
'mongosh-sp:connect-attempt-finished': () => void;
|
|
362
|
-
/** Signals that resolving an mongodb+srv:// URL failed. */
|
|
363
|
-
'mongosh-sp:resolve-srv-error': (ev: SpResolveSrvErrorEvent) => void;
|
|
364
|
-
/** Signals that resolving an mongodb+srv:// URL succeeded. */
|
|
365
|
-
'mongosh-sp:resolve-srv-succeeded': (ev: SpResolveSrvSucceededEvent) => void;
|
|
366
320
|
/** Signals that the service provider is opening a new connection because options have changed. */
|
|
367
321
|
'mongosh-sp:reset-connection-options': () => void;
|
|
368
|
-
/** Signals that an optional dependency of the mongodb package is missing. */
|
|
369
|
-
'mongosh-sp:missing-optional-dependency': (ev: SpMissingOptionalDependencyEvent) => void;
|
|
370
322
|
|
|
371
323
|
/** Signals that open external editor command was called. */
|
|
372
324
|
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void;
|