@mongosh/types 1.1.7 → 1.2.1
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/AUTHORS +1 -0
- package/lib/index.d.ts +11 -42
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +5 -2
- package/src/index.ts +17 -53
package/AUTHORS
CHANGED
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;
|
|
@@ -59,6 +60,10 @@ export interface ScriptLoadFileEvent {
|
|
|
59
60
|
export interface StartLoadingCliScriptsEvent {
|
|
60
61
|
usesShellOption: boolean;
|
|
61
62
|
}
|
|
63
|
+
export interface GlobalConfigFileLoadEvent {
|
|
64
|
+
filename: string;
|
|
65
|
+
found: boolean;
|
|
66
|
+
}
|
|
62
67
|
export interface MongocryptdTrySpawnEvent {
|
|
63
68
|
spawnPath: string[];
|
|
64
69
|
path: string;
|
|
@@ -118,37 +123,6 @@ export interface SnippetsTransformErrorEvent {
|
|
|
118
123
|
addition: string;
|
|
119
124
|
name: string;
|
|
120
125
|
}
|
|
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
126
|
export interface EditorRunEditCommandEvent {
|
|
153
127
|
tmpDoc: string;
|
|
154
128
|
editor: string;
|
|
@@ -162,10 +136,10 @@ export interface EditorReadVscodeExtensionsFailedEvent {
|
|
|
162
136
|
vscodeDir: string;
|
|
163
137
|
error: Error;
|
|
164
138
|
}
|
|
165
|
-
export interface MongoshBusEventsMap {
|
|
139
|
+
export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
166
140
|
'mongosh:connect': (ev: ConnectEvent) => void;
|
|
167
|
-
'mongosh:new-user': (id: string
|
|
168
|
-
'mongosh:update-user': (id: string
|
|
141
|
+
'mongosh:new-user': (id: string) => void;
|
|
142
|
+
'mongosh:update-user': (id: string) => void;
|
|
169
143
|
'mongosh:error': (error: Error, component: string) => void;
|
|
170
144
|
'mongosh:evaluate-input': (ev: EvaluateInputEvent) => void;
|
|
171
145
|
'mongosh:evaluate-started': () => void;
|
|
@@ -181,6 +155,7 @@ export interface MongoshBusEventsMap {
|
|
|
181
155
|
'mongosh:start-loading-cli-scripts': (event: StartLoadingCliScriptsEvent) => void;
|
|
182
156
|
'mongosh:start-mongosh-repl': (ev: StartMongoshReplEvent) => void;
|
|
183
157
|
'mongosh:mongoshrc-load': () => void;
|
|
158
|
+
'mongosh:globalconfig-load': (ev: GlobalConfigFileLoadEvent) => void;
|
|
184
159
|
'mongosh:mongoshrc-mongorc-warn': () => void;
|
|
185
160
|
'mongosh:eval-cli-script': () => void;
|
|
186
161
|
'mongosh:eval-interrupted': () => void;
|
|
@@ -205,15 +180,7 @@ export interface MongoshBusEventsMap {
|
|
|
205
180
|
'mongosh-snippets:load-snippet': (ev: SnippetsLoadSnippetEvent) => void;
|
|
206
181
|
'mongosh-snippets:snippet-command': (ev: SnippetsCommandEvent) => void;
|
|
207
182
|
'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
183
|
'mongosh-sp:reset-connection-options': () => void;
|
|
216
|
-
'mongosh-sp:missing-optional-dependency': (ev: SpMissingOptionalDependencyEvent) => void;
|
|
217
184
|
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void;
|
|
218
185
|
'mongosh-editor:read-vscode-extensions-done': (ev: EditorReadVscodeExtensionsDoneEvent) => void;
|
|
219
186
|
'mongosh-editor:read-vscode-extensions-failed': (ev: EditorReadVscodeExtensionsFailedEvent) => void;
|
|
@@ -243,6 +210,7 @@ export declare class SnippetShellUserConfigValidator extends ShellUserConfigVali
|
|
|
243
210
|
export declare class CliUserConfig extends SnippetShellUserConfig {
|
|
244
211
|
userId: string;
|
|
245
212
|
disableGreetingMessage: boolean;
|
|
213
|
+
forceDisableTelemetry: boolean;
|
|
246
214
|
inspectCompact: number | boolean;
|
|
247
215
|
inspectDepth: number;
|
|
248
216
|
historyLength: number;
|
|
@@ -255,6 +223,7 @@ export declare class CliUserConfigValidator extends SnippetShellUserConfigValida
|
|
|
255
223
|
export interface ConfigProvider<T> {
|
|
256
224
|
getConfig<K extends keyof T>(key: K): Promise<T[K]>;
|
|
257
225
|
setConfig<K extends keyof T>(key: K, value: T[K]): Promise<'success' | 'ignored'>;
|
|
226
|
+
resetConfig<K extends keyof T>(key: K): Promise<'success' | 'ignored'>;
|
|
258
227
|
validateConfig<K extends keyof T>(key: K, value: T[K]): Promise<string | null>;
|
|
259
228
|
listConfigOptions(): string[] | Promise<string[]>;
|
|
260
229
|
}
|
package/lib/index.js
CHANGED
|
@@ -77,6 +77,7 @@ class CliUserConfig extends SnippetShellUserConfig {
|
|
|
77
77
|
super(...arguments);
|
|
78
78
|
this.userId = '';
|
|
79
79
|
this.disableGreetingMessage = false;
|
|
80
|
+
this.forceDisableTelemetry = false;
|
|
80
81
|
this.inspectCompact = 3;
|
|
81
82
|
this.inspectDepth = 6;
|
|
82
83
|
this.historyLength = 1000;
|
|
@@ -102,6 +103,7 @@ class CliUserConfigValidator extends SnippetShellUserConfigValidator {
|
|
|
102
103
|
return `${key} must be a positive integer`;
|
|
103
104
|
}
|
|
104
105
|
return null;
|
|
106
|
+
case 'forceDisableTelemetry':
|
|
105
107
|
case 'showStackTraces':
|
|
106
108
|
if (typeof value !== 'boolean') {
|
|
107
109
|
return `${key} must be a boolean`;
|
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":";;;AA0VA,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,E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,CAAC;YACd,KAAK,cAAc,CAAC;YACpB,KAAK,eAAe;gBAClB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,EAAE;oBAC1C,OAAO,GAAG,GAAG,6BAA6B,CAAC;iBAC5C;gBACD,OAAO,IAAI,CAAC;YACd,KAAK,uBAAuB,CAAC;YAC7B,KAAK,iBAAiB;gBACpB,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;oBAC9B,OAAO,GAAG,GAAG,oBAAoB,CAAC;iBACnC;gBACD,OAAO,IAAI,CAAC;YACd,KAAK,eAAe;gBAClB,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,eAAe,EAAE;oBACvE,OAAO,GAAG,GAAG,sDAAsD,CAAC;iBACrE;gBACD,OAAO,IAAI,CAAC;YACd;gBACE,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAmC,EAAE,KAAY,CAAC,CAAC;SAC5E;IACH,CAAC;CACF;AAjCD,wDAiCC;AAUD,SAAS,UAAU,CAAC,GAAW;IAM7B,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;QAC7B,IAAI;YAEF,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,IAAI,CAAC;SACb;QAAC,WAAM;YACN,OAAO,KAAK,CAAC;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.2.1",
|
|
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.2.4"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "62b1dff4ce48f4dd3706d4fd9ccd4582df403ee3"
|
|
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;
|
|
@@ -70,6 +72,11 @@ export interface StartLoadingCliScriptsEvent {
|
|
|
70
72
|
usesShellOption: boolean;
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
export interface GlobalConfigFileLoadEvent {
|
|
76
|
+
filename: string;
|
|
77
|
+
found: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
73
80
|
export interface MongocryptdTrySpawnEvent {
|
|
74
81
|
spawnPath: string[];
|
|
75
82
|
path: string;
|
|
@@ -144,40 +151,6 @@ export interface SnippetsTransformErrorEvent {
|
|
|
144
151
|
name: string;
|
|
145
152
|
}
|
|
146
153
|
|
|
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
154
|
export interface EditorRunEditCommandEvent {
|
|
182
155
|
tmpDoc: string;
|
|
183
156
|
editor: string;
|
|
@@ -194,7 +167,7 @@ export interface EditorReadVscodeExtensionsFailedEvent {
|
|
|
194
167
|
error: Error;
|
|
195
168
|
}
|
|
196
169
|
|
|
197
|
-
export interface MongoshBusEventsMap {
|
|
170
|
+
export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
198
171
|
/**
|
|
199
172
|
* Signals a connection to a MongoDB instance has been established
|
|
200
173
|
* or the used database changed.
|
|
@@ -203,11 +176,11 @@ export interface MongoshBusEventsMap {
|
|
|
203
176
|
/**
|
|
204
177
|
* Signals that the shell is started by a new user.
|
|
205
178
|
*/
|
|
206
|
-
'mongosh:new-user': (id: string
|
|
179
|
+
'mongosh:new-user': (id: string) => void;
|
|
207
180
|
/**
|
|
208
181
|
* Signals a change of the user telemetry settings.
|
|
209
182
|
*/
|
|
210
|
-
'mongosh:update-user': (id: string
|
|
183
|
+
'mongosh:update-user': (id: string) => void;
|
|
211
184
|
/**
|
|
212
185
|
* Signals an error that should be logged or potentially tracked by analytics.
|
|
213
186
|
*/
|
|
@@ -270,6 +243,10 @@ export interface MongoshBusEventsMap {
|
|
|
270
243
|
* Signals the start of loading a mongosh configuration file.
|
|
271
244
|
*/
|
|
272
245
|
'mongosh:mongoshrc-load': () => void;
|
|
246
|
+
/**
|
|
247
|
+
* Signals the start of loading a global mongosh configuration file.
|
|
248
|
+
*/
|
|
249
|
+
'mongosh:globalconfig-load': (ev: GlobalConfigFileLoadEvent) => void;
|
|
273
250
|
/**
|
|
274
251
|
* Signals the detection of a legacy `mongo` configuration file or a misnamed mongosh configuration file.
|
|
275
252
|
*/
|
|
@@ -349,24 +326,8 @@ export interface MongoshBusEventsMap {
|
|
|
349
326
|
/** Signals that a snippet has modified an error message. */
|
|
350
327
|
'mongosh-snippets:transform-error': (ev: SnippetsTransformErrorEvent) => void;
|
|
351
328
|
|
|
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
329
|
/** Signals that the service provider is opening a new connection because options have changed. */
|
|
367
330
|
'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
331
|
|
|
371
332
|
/** Signals that open external editor command was called. */
|
|
372
333
|
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void;
|
|
@@ -453,6 +414,7 @@ export class SnippetShellUserConfigValidator extends ShellUserConfigValidator {
|
|
|
453
414
|
export class CliUserConfig extends SnippetShellUserConfig {
|
|
454
415
|
userId = '';
|
|
455
416
|
disableGreetingMessage = false;
|
|
417
|
+
forceDisableTelemetry = false;
|
|
456
418
|
inspectCompact: number | boolean = 3;
|
|
457
419
|
inspectDepth = 6;
|
|
458
420
|
historyLength = 1000;
|
|
@@ -478,6 +440,7 @@ export class CliUserConfigValidator extends SnippetShellUserConfigValidator {
|
|
|
478
440
|
return `${key} must be a positive integer`;
|
|
479
441
|
}
|
|
480
442
|
return null;
|
|
443
|
+
case 'forceDisableTelemetry':
|
|
481
444
|
case 'showStackTraces':
|
|
482
445
|
if (typeof value !== 'boolean') {
|
|
483
446
|
return `${key} must be a boolean`;
|
|
@@ -497,6 +460,7 @@ export class CliUserConfigValidator extends SnippetShellUserConfigValidator {
|
|
|
497
460
|
export interface ConfigProvider<T> {
|
|
498
461
|
getConfig<K extends keyof T>(key: K): Promise<T[K]>;
|
|
499
462
|
setConfig<K extends keyof T>(key: K, value: T[K]): Promise<'success' | 'ignored'>;
|
|
463
|
+
resetConfig<K extends keyof T>(key: K): Promise<'success' | 'ignored'>;
|
|
500
464
|
validateConfig<K extends keyof T>(key: K, value: T[K]): Promise<string | null>;
|
|
501
465
|
listConfigOptions(): string[] | Promise<string[]>;
|
|
502
466
|
}
|