@mongosh/types
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -138,3 +138,3 @@ export interface ApiEventArguments { | ||
'mongosh:update-user': (id: string, enableTelemetry: boolean) => void; | ||
'mongosh:error': (error: Error) => void; | ||
'mongosh:error': (error: Error, component: string) => void; | ||
'mongosh:evaluate-input': (ev: EvaluateInputEvent) => void; | ||
@@ -193,2 +193,3 @@ 'mongosh:evaluate-finished': () => void; | ||
displayBatchSize: number; | ||
maxTimeMS: number | null; | ||
enableTelemetry: boolean; | ||
@@ -195,0 +196,0 @@ } |
@@ -7,2 +7,3 @@ "use strict"; | ||
this.displayBatchSize = 20; | ||
this.maxTimeMS = null; | ||
this.enableTelemetry = false; | ||
@@ -20,2 +21,7 @@ } | ||
return null; | ||
case 'maxTimeMS': | ||
if (value !== null && (typeof value !== 'number' || value <= 0)) { | ||
return `${key} must be null or a positive integer`; | ||
} | ||
return null; | ||
case 'enableTelemetry': | ||
@@ -22,0 +28,0 @@ if (typeof value !== 'boolean') { |
{ | ||
"name": "@mongosh/types", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Types for mongosh internals", | ||
@@ -34,3 +34,3 @@ "author": "Anna Henningsen <anna.henningsen@mongodb.com>", | ||
}, | ||
"gitHead": "248a6f4c1c92ad432a8dc7d078600c6b86f03335" | ||
"gitHead": "e5a2dd853f0739496406c3698124b62c5affd9bd" | ||
} |
@@ -34,2 +34,7 @@ import { CliUserConfig, CliUserConfigValidator } from './'; | ||
expect(await validate('displayBatchSize', Infinity)).to.equal(null); | ||
expect(await validate('maxTimeMS', 'foo')).to.equal('maxTimeMS must be null or a positive integer'); | ||
expect(await validate('maxTimeMS', -1)).to.equal('maxTimeMS must be null or a positive integer'); | ||
expect(await validate('maxTimeMS', 0)).to.equal('maxTimeMS must be null or a positive integer'); | ||
expect(await validate('maxTimeMS', 1)).to.equal(null); | ||
expect(await validate('maxTimeMS', null)).to.equal(null); | ||
expect(await validate('enableTelemetry', 'foo')).to.equal('enableTelemetry must be a boolean'); | ||
@@ -36,0 +41,0 @@ expect(await validate('enableTelemetry', -1)).to.equal('enableTelemetry must be a boolean'); |
@@ -185,3 +185,3 @@ /* eslint camelcase: 0 */ | ||
*/ | ||
'mongosh:error': (error: Error) => void; | ||
'mongosh:error': (error: Error, component: string) => void; | ||
/** | ||
@@ -347,2 +347,3 @@ * Signals the start of the evaluation of user code inside Shellevaluator. | ||
displayBatchSize = 20; | ||
maxTimeMS: number | null = null; | ||
enableTelemetry = false; | ||
@@ -360,2 +361,7 @@ } | ||
return null; | ||
case 'maxTimeMS': | ||
if (value !== null && (typeof value !== 'number' || value <= 0)) { | ||
return `${key} must be null or a positive integer`; | ||
} | ||
return null; | ||
case 'enableTelemetry': | ||
@@ -362,0 +368,0 @@ if (typeof value !== 'boolean') { |
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
49075
871