@mongosh/types
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -112,2 +112,10 @@ export interface ApiEventArguments { | ||
} | ||
export interface SpConnectAttemptInitializedEvent { | ||
driver: { | ||
name: string; | ||
version: string; | ||
}; | ||
serviceProviderVersion: string; | ||
host: string; | ||
} | ||
export interface SpConnectHeartbeatFailureEvent { | ||
@@ -135,5 +143,21 @@ connectionId: string; | ||
} | ||
export interface EditorRunEditCommandEvent { | ||
tmpDoc: string; | ||
editor: string; | ||
code: string; | ||
} | ||
export interface EditorRunEditCommandFailedEvent { | ||
action: string; | ||
error: string; | ||
} | ||
export interface EditorReadVscodeExtensionsDoneEvent { | ||
vscodeDir: string; | ||
hasMongodbExtension: boolean; | ||
} | ||
export interface EditorReadVscodeExtensionsFailedEvent { | ||
action: string; | ||
error: string; | ||
} | ||
export interface MongoshBusEventsMap { | ||
'mongosh:connect': (ev: ConnectEvent) => void; | ||
'mongosh:driver-initialized': (driverMetadata: any) => void; | ||
'mongosh:new-user': (id: string, enableTelemetry: boolean) => void; | ||
@@ -179,2 +203,3 @@ 'mongosh:update-user': (id: string, enableTelemetry: boolean) => void; | ||
'mongosh-snippets:transform-error': (ev: SnippetsTransformErrorEvent) => void; | ||
'mongosh-sp:connect-attempt-initialized': (ev: SpConnectAttemptInitializedEvent) => void; | ||
'mongosh-sp:connect-heartbeat-failure': (ev: SpConnectHeartbeatFailureEvent) => void; | ||
@@ -188,2 +213,5 @@ 'mongosh-sp:connect-heartbeat-succeeded': (ev: SpConnectHeartbeatSucceededEvent) => void; | ||
'mongosh-sp:missing-optional-dependency': (ev: SpMissingOptionalDependencyEvent) => void; | ||
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void; | ||
'mongosh-editor:read-vscode-extensions-done': (ev: EditorReadVscodeExtensionsDoneEvent) => void; | ||
'mongosh-editor:read-vscode-extensions-failed': (ev: EditorReadVscodeExtensionsFailedEvent) => void; | ||
} | ||
@@ -199,2 +227,3 @@ export interface MongoshBus { | ||
enableTelemetry: boolean; | ||
editor: string | null; | ||
} | ||
@@ -201,0 +230,0 @@ export declare class ShellUserConfigValidator { |
@@ -9,2 +9,3 @@ "use strict"; | ||
this.enableTelemetry = false; | ||
this.editor = null; | ||
} | ||
@@ -31,2 +32,7 @@ } | ||
return null; | ||
case 'editor': | ||
if (typeof value !== 'string' && value !== null) { | ||
return `${key} must be a string or null`; | ||
} | ||
return null; | ||
default: | ||
@@ -33,0 +39,0 @@ return `${key} is not a known config option`; |
{ | ||
"name": "@mongosh/types", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Types for mongosh internals", | ||
@@ -34,3 +34,3 @@ "author": "Anna Henningsen <anna.henningsen@mongodb.com>", | ||
}, | ||
"gitHead": "9eef48ae7aa36725d4776df7817b93713873fd1b" | ||
"gitHead": "fa92af95014f84e2ae640aacbe063ec0ba62fbd1" | ||
} |
@@ -137,2 +137,8 @@ /* eslint camelcase: 0 */ | ||
export interface SpConnectAttemptInitializedEvent { | ||
driver: { name: string, version: string }; | ||
serviceProviderVersion: string; | ||
host: string; | ||
} | ||
export interface SpConnectHeartbeatFailureEvent { | ||
@@ -165,2 +171,23 @@ connectionId: string; | ||
export interface EditorRunEditCommandEvent { | ||
tmpDoc: string; | ||
editor: string; | ||
code: string; | ||
} | ||
export interface EditorRunEditCommandFailedEvent { | ||
action: string; | ||
error: string; | ||
} | ||
export interface EditorReadVscodeExtensionsDoneEvent { | ||
vscodeDir: string; | ||
hasMongodbExtension: boolean; | ||
} | ||
export interface EditorReadVscodeExtensionsFailedEvent { | ||
action: string; | ||
error: string; | ||
} | ||
export interface MongoshBusEventsMap { | ||
@@ -173,7 +200,2 @@ /** | ||
/** | ||
* Signals the creation of a new Mongo client with metadata provided | ||
* by the underlying driver implementation. | ||
*/ | ||
'mongosh:driver-initialized': (driverMetadata: any) => void; | ||
/** | ||
* Signals that the shell is started by a new user. | ||
@@ -323,2 +345,4 @@ */ | ||
/** Signals that a connection attempt is about to be performed. */ | ||
'mongosh-sp:connect-attempt-initialized': (ev: SpConnectAttemptInitializedEvent) => void; | ||
/** Signals that communicating to a specific server during connection did not succeed. */ | ||
@@ -340,2 +364,9 @@ 'mongosh-sp:connect-heartbeat-failure': (ev: SpConnectHeartbeatFailureEvent) => void; | ||
'mongosh-sp:missing-optional-dependency': (ev: SpMissingOptionalDependencyEvent) => void; | ||
/** Signals that open external editor command was called. */ | ||
'mongosh-editor:run-edit-command': (ev: EditorRunEditCommandEvent) => void; | ||
/** Signals that reading vscode extensions from disc succeeded. */ | ||
'mongosh-editor:read-vscode-extensions-done': (ev: EditorReadVscodeExtensionsDoneEvent) => void; | ||
/** Signals that reading vscode extensions from disc failed. */ | ||
'mongosh-editor:read-vscode-extensions-failed': (ev: EditorReadVscodeExtensionsFailedEvent) => void; | ||
} | ||
@@ -354,6 +385,7 @@ | ||
enableTelemetry = false; | ||
editor: string | null = null; | ||
} | ||
export class ShellUserConfigValidator { | ||
// eslint-disable-next-line @typescript-eslint/require-await | ||
// eslint-disable-next-line complexity, @typescript-eslint/require-await | ||
static async validate<K extends keyof ShellUserConfig>(key: K, value: ShellUserConfig[K]): Promise<string | null> { | ||
@@ -376,2 +408,7 @@ switch (key) { | ||
return null; | ||
case 'editor': | ||
if (typeof value !== 'string' && value !== null) { | ||
return `${key} must be a string or null`; | ||
} | ||
return null; | ||
default: | ||
@@ -378,0 +415,0 @@ return `${key} is not a known config option`; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51669
939