@mongosh/types 1.1.8 → 1.2.2
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 +9 -2
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +14 -2
package/AUTHORS
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export interface ScriptLoadFileEvent {
|
|
|
60
60
|
export interface StartLoadingCliScriptsEvent {
|
|
61
61
|
usesShellOption: boolean;
|
|
62
62
|
}
|
|
63
|
+
export interface GlobalConfigFileLoadEvent {
|
|
64
|
+
filename: string;
|
|
65
|
+
found: boolean;
|
|
66
|
+
}
|
|
63
67
|
export interface MongocryptdTrySpawnEvent {
|
|
64
68
|
spawnPath: string[];
|
|
65
69
|
path: string;
|
|
@@ -134,8 +138,8 @@ export interface EditorReadVscodeExtensionsFailedEvent {
|
|
|
134
138
|
}
|
|
135
139
|
export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
136
140
|
'mongosh:connect': (ev: ConnectEvent) => void;
|
|
137
|
-
'mongosh:new-user': (id: string
|
|
138
|
-
'mongosh:update-user': (id: string
|
|
141
|
+
'mongosh:new-user': (id: string) => void;
|
|
142
|
+
'mongosh:update-user': (id: string) => void;
|
|
139
143
|
'mongosh:error': (error: Error, component: string) => void;
|
|
140
144
|
'mongosh:evaluate-input': (ev: EvaluateInputEvent) => void;
|
|
141
145
|
'mongosh:evaluate-started': () => void;
|
|
@@ -151,6 +155,7 @@ export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
|
151
155
|
'mongosh:start-loading-cli-scripts': (event: StartLoadingCliScriptsEvent) => void;
|
|
152
156
|
'mongosh:start-mongosh-repl': (ev: StartMongoshReplEvent) => void;
|
|
153
157
|
'mongosh:mongoshrc-load': () => void;
|
|
158
|
+
'mongosh:globalconfig-load': (ev: GlobalConfigFileLoadEvent) => void;
|
|
154
159
|
'mongosh:mongoshrc-mongorc-warn': () => void;
|
|
155
160
|
'mongosh:eval-cli-script': () => void;
|
|
156
161
|
'mongosh:eval-interrupted': () => void;
|
|
@@ -205,6 +210,7 @@ export declare class SnippetShellUserConfigValidator extends ShellUserConfigVali
|
|
|
205
210
|
export declare class CliUserConfig extends SnippetShellUserConfig {
|
|
206
211
|
userId: string;
|
|
207
212
|
disableGreetingMessage: boolean;
|
|
213
|
+
forceDisableTelemetry: boolean;
|
|
208
214
|
inspectCompact: number | boolean;
|
|
209
215
|
inspectDepth: number;
|
|
210
216
|
historyLength: number;
|
|
@@ -217,6 +223,7 @@ export declare class CliUserConfigValidator extends SnippetShellUserConfigValida
|
|
|
217
223
|
export interface ConfigProvider<T> {
|
|
218
224
|
getConfig<K extends keyof T>(key: K): Promise<T[K]>;
|
|
219
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'>;
|
|
220
227
|
validateConfig<K extends keyof T>(key: K, value: T[K]): Promise<string | null>;
|
|
221
228
|
listConfigOptions(): string[] | Promise<string[]>;
|
|
222
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,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;AAED,MAAa,sBAAuB,SAAQ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;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.
|
|
3
|
+
"version": "1.2.2",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"unitTestsOnly": true
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mongodb-js/devtools-connect": "^1.
|
|
35
|
+
"@mongodb-js/devtools-connect": "^1.2.4"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7956ae40dde9eb7e6ee8cad058f88953781dc049"
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -72,6 +72,11 @@ export interface StartLoadingCliScriptsEvent {
|
|
|
72
72
|
usesShellOption: boolean;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
export interface GlobalConfigFileLoadEvent {
|
|
76
|
+
filename: string;
|
|
77
|
+
found: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
75
80
|
export interface MongocryptdTrySpawnEvent {
|
|
76
81
|
spawnPath: string[];
|
|
77
82
|
path: string;
|
|
@@ -171,11 +176,11 @@ export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
|
171
176
|
/**
|
|
172
177
|
* Signals that the shell is started by a new user.
|
|
173
178
|
*/
|
|
174
|
-
'mongosh:new-user': (id: string
|
|
179
|
+
'mongosh:new-user': (id: string) => void;
|
|
175
180
|
/**
|
|
176
181
|
* Signals a change of the user telemetry settings.
|
|
177
182
|
*/
|
|
178
|
-
'mongosh:update-user': (id: string
|
|
183
|
+
'mongosh:update-user': (id: string) => void;
|
|
179
184
|
/**
|
|
180
185
|
* Signals an error that should be logged or potentially tracked by analytics.
|
|
181
186
|
*/
|
|
@@ -238,6 +243,10 @@ export interface MongoshBusEventsMap extends ConnectEventMap {
|
|
|
238
243
|
* Signals the start of loading a mongosh configuration file.
|
|
239
244
|
*/
|
|
240
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;
|
|
241
250
|
/**
|
|
242
251
|
* Signals the detection of a legacy `mongo` configuration file or a misnamed mongosh configuration file.
|
|
243
252
|
*/
|
|
@@ -405,6 +414,7 @@ export class SnippetShellUserConfigValidator extends ShellUserConfigValidator {
|
|
|
405
414
|
export class CliUserConfig extends SnippetShellUserConfig {
|
|
406
415
|
userId = '';
|
|
407
416
|
disableGreetingMessage = false;
|
|
417
|
+
forceDisableTelemetry = false;
|
|
408
418
|
inspectCompact: number | boolean = 3;
|
|
409
419
|
inspectDepth = 6;
|
|
410
420
|
historyLength = 1000;
|
|
@@ -430,6 +440,7 @@ export class CliUserConfigValidator extends SnippetShellUserConfigValidator {
|
|
|
430
440
|
return `${key} must be a positive integer`;
|
|
431
441
|
}
|
|
432
442
|
return null;
|
|
443
|
+
case 'forceDisableTelemetry':
|
|
433
444
|
case 'showStackTraces':
|
|
434
445
|
if (typeof value !== 'boolean') {
|
|
435
446
|
return `${key} must be a boolean`;
|
|
@@ -449,6 +460,7 @@ export class CliUserConfigValidator extends SnippetShellUserConfigValidator {
|
|
|
449
460
|
export interface ConfigProvider<T> {
|
|
450
461
|
getConfig<K extends keyof T>(key: K): Promise<T[K]>;
|
|
451
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'>;
|
|
452
464
|
validateConfig<K extends keyof T>(key: K, value: T[K]): Promise<string | null>;
|
|
453
465
|
listConfigOptions(): string[] | Promise<string[]>;
|
|
454
466
|
}
|