@mongosh/node-runtime-worker-thread 1.3.1 → 1.5.0
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/dist/child-process-evaluation-listener.d.ts +1 -1
- package/dist/child-process-evaluation-listener.js +51 -0
- package/dist/child-process-evaluation-listener.js.map +1 -0
- package/dist/child-process-mongosh-bus.js +25 -0
- package/dist/child-process-mongosh-bus.js.map +1 -0
- package/dist/child-process-proxy.js +1 -1
- package/dist/child-process-proxy.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/lock.js +37 -0
- package/dist/lock.js.map +1 -0
- package/dist/rpc.js +143 -0
- package/dist/rpc.js.map +1 -0
- package/dist/serializer.d.ts +3 -0
- package/dist/serializer.js +106 -0
- package/dist/serializer.js.map +1 -0
- package/dist/spawn-child-from-source.js +68 -0
- package/dist/spawn-child-from-source.js.map +1 -0
- package/dist/src/child-process-evaluation-listener.d.ts +10 -0
- package/dist/src/child-process-mongosh-bus.d.ts +9 -0
- package/dist/src/child-process-proxy.d.ts +1 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/lock.d.ts +10 -0
- package/dist/src/rpc.d.ts +28 -0
- package/dist/src/serializer.d.ts +13 -0
- package/dist/src/spawn-child-from-source.d.ts +4 -0
- package/dist/src/worker-runtime.d.ts +14 -0
- package/dist/worker-runtime.d.ts +3 -1
- package/dist/worker-runtime.js +101 -97
- package/dist/worker-runtime.js.map +1 -0
- package/package.json +11 -11
- package/src/child-process-evaluation-listener.ts +1 -1
- package/src/index.ts +4 -3
- package/src/serializer.spec.ts +87 -1
- package/src/serializer.ts +32 -0
- package/src/worker-runtime.ts +6 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-runtime.js","sourceRoot":"","sources":["../src/worker-runtime.ts"],"names":[],"mappings":";;AAGA,mDAA0D;AAM1D,gFAAoE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IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC3D;QAED,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,WAAW,KAAK,IAAI,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACrD;QAED,OAAO,IAAA,sCAAyB,EAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAAI;QACvB,OAAO,aAAa,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,OAAO,aAAa,CAAC,gBAAgB,CAAC,CAAC,cAAc,EAAE,CAAC;IAC1D,CAAC;IAED,qBAAqB;QACnB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,cAAc,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;CACF,CAAC;AAMF,2BAAU,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;AAE/B,IAAA,eAAS,EAAC,aAAa,EAAE,2BAAU,CAAC,CAAC;AAErC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;IACpB,IAAI,2BAAU,EAAE;QACd,2BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KACjC;AACH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongosh/node-runtime-worker-thread",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "MongoDB shell runtime that lives in a worker thread",
|
|
5
5
|
"homepage": "https://github.com/mongodb-js/mongosh",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/mongodb-js/mongosh"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=14.15.1"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "cross-env TS_NODE_PROJECT=./tsconfig.test.json mocha -r \"../../scripts/import-expansions.js\" --timeout 15000 -r ts-node/register \"./src/**/*.spec.ts\"",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"test-ci": "node ../../scripts/run-if-package-requested.js npm test",
|
|
23
23
|
"lint": "eslint --report-unused-disable-directives \"./{src,test}/**/*.{js,ts,tsx}\"",
|
|
24
24
|
"check": "npm run lint && depcheck",
|
|
25
|
-
"webpack-build": "webpack --mode production",
|
|
26
|
-
"webpack-build-dev": "webpack --mode development",
|
|
25
|
+
"webpack-build": "npm run compile-ts && webpack --mode production",
|
|
26
|
+
"webpack-build-dev": "npm run compile-ts && webpack --mode development",
|
|
27
27
|
"compile-ts": "tsc -p tsconfig.json",
|
|
28
28
|
"prepublish": "npm run webpack-build"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@mongosh/browser-runtime-core": "1.
|
|
32
|
-
"@mongosh/browser-runtime-electron": "1.
|
|
33
|
-
"@mongosh/service-provider-core": "1.
|
|
34
|
-
"@mongosh/service-provider-server": "1.
|
|
35
|
-
"@mongosh/types": "1.
|
|
36
|
-
"bson": "^4.6.
|
|
31
|
+
"@mongosh/browser-runtime-core": "1.5.0",
|
|
32
|
+
"@mongosh/browser-runtime-electron": "1.5.0",
|
|
33
|
+
"@mongosh/service-provider-core": "1.5.0",
|
|
34
|
+
"@mongosh/service-provider-server": "1.5.0",
|
|
35
|
+
"@mongosh/types": "1.5.0",
|
|
36
|
+
"bson": "^4.6.2",
|
|
37
37
|
"mocha": "^7.1.2",
|
|
38
38
|
"postmsg-rpc": "^2.4.0",
|
|
39
39
|
"terser-webpack-plugin": "^4.2.3",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"interruptor": "^1.0.1",
|
|
46
46
|
"system-ca": "^1.0.2"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "78a16fa4cbd0c5d98ca8131aa2896be5845aa919"
|
|
49
49
|
}
|
|
@@ -4,7 +4,7 @@ import type { WorkerRuntime } from './index';
|
|
|
4
4
|
import { RuntimeEvaluationListener } from '@mongosh/browser-runtime-core';
|
|
5
5
|
|
|
6
6
|
export class ChildProcessEvaluationListener {
|
|
7
|
-
exposedListener: Exposed<Required<Omit<RuntimeEvaluationListener, 'onLoad' | '
|
|
7
|
+
exposedListener: Exposed<Required<Omit<RuntimeEvaluationListener, 'onLoad' | 'getCryptLibraryOptions'>>>;
|
|
8
8
|
|
|
9
9
|
constructor(workerRuntime: WorkerRuntime, childProcess: ChildProcess) {
|
|
10
10
|
this.exposedListener = exposeAll(
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* ^^^ we test the dist directly, so isntanbul can't calculate the coverage correctly */
|
|
3
3
|
|
|
4
4
|
import { ChildProcess, spawn, SpawnOptionsWithoutStdio } from 'child_process';
|
|
5
|
-
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
|
|
6
5
|
import {
|
|
7
6
|
Runtime,
|
|
8
7
|
RuntimeEvaluationListener,
|
|
@@ -15,9 +14,11 @@ import { kill } from './spawn-child-from-source';
|
|
|
15
14
|
import { Caller, createCaller, cancel } from './rpc';
|
|
16
15
|
import { ChildProcessEvaluationListener } from './child-process-evaluation-listener';
|
|
17
16
|
import type { WorkerRuntime as WorkerThreadWorkerRuntime } from './worker-runtime';
|
|
18
|
-
import { deserializeEvaluationResult } from './serializer';
|
|
17
|
+
import { deserializeEvaluationResult, serializeConnectOptions } from './serializer';
|
|
19
18
|
import { ChildProcessMongoshBus } from './child-process-mongosh-bus';
|
|
19
|
+
import type { CompassServiceProvider } from '@mongosh/service-provider-server';
|
|
20
20
|
|
|
21
|
+
type DevtoolsConnectOptions = Parameters<(typeof CompassServiceProvider)['connect']>[1];
|
|
21
22
|
type ChildProcessRuntime = Caller<WorkerThreadWorkerRuntime>;
|
|
22
23
|
|
|
23
24
|
function parseStderrToError(str: string): Error | null {
|
|
@@ -158,7 +159,7 @@ class WorkerRuntime implements Runtime {
|
|
|
158
159
|
this.childProcess
|
|
159
160
|
);
|
|
160
161
|
|
|
161
|
-
await this.childProcessRuntime.init(uri, driverOptions, cliOptions);
|
|
162
|
+
await this.childProcessRuntime.init(uri, serializeConnectOptions(driverOptions), cliOptions);
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
async evaluate(code: string): Promise<RuntimeEvaluationResult> {
|
package/src/serializer.spec.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { DevtoolsConnectOptions } from '@mongosh/service-provider-server/lib/cli-service-provider';
|
|
1
2
|
import { expect } from 'chai';
|
|
3
|
+
import { UUID, Long } from 'bson';
|
|
2
4
|
import {
|
|
3
5
|
serializeError,
|
|
4
6
|
deserializeError,
|
|
5
7
|
serializeEvaluationResult,
|
|
6
8
|
deserializeEvaluationResult,
|
|
7
|
-
SerializedResultTypes
|
|
9
|
+
SerializedResultTypes,
|
|
10
|
+
serializeConnectOptions,
|
|
11
|
+
deserializeConnectOptions
|
|
8
12
|
} from './serializer';
|
|
9
13
|
|
|
10
14
|
describe('serializer', () => {
|
|
@@ -135,4 +139,86 @@ describe('serializer', () => {
|
|
|
135
139
|
expect(deserialized).to.have.property('printable', 'Hello');
|
|
136
140
|
});
|
|
137
141
|
});
|
|
142
|
+
|
|
143
|
+
describe('connection options', () => {
|
|
144
|
+
it('should serialize and deserialize FLE1 connection options', () => {
|
|
145
|
+
const options: DevtoolsConnectOptions = {
|
|
146
|
+
autoEncryption: {
|
|
147
|
+
schemaMap: {
|
|
148
|
+
'hr.employees': {
|
|
149
|
+
bsonType: 'object',
|
|
150
|
+
properties: {
|
|
151
|
+
taxid: {
|
|
152
|
+
encrypt: {
|
|
153
|
+
keyId: [ new UUID('a21ddc6a-8806-4384-9fdf-8ba02a767b5f').toBinary() ],
|
|
154
|
+
bsonType: 'string',
|
|
155
|
+
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const serialized = serializeConnectOptions(options);
|
|
165
|
+
|
|
166
|
+
expect(serialized).to.deep.equal({
|
|
167
|
+
autoEncryption: {
|
|
168
|
+
schemaMap: {
|
|
169
|
+
'hr.employees': {
|
|
170
|
+
bsonType: 'object',
|
|
171
|
+
properties: {
|
|
172
|
+
taxid: {
|
|
173
|
+
encrypt: {
|
|
174
|
+
keyId: [ { $binary: { base64: 'oh3caogGQ4Sf34ugKnZ7Xw==', subType: '04' } } ],
|
|
175
|
+
bsonType: 'string',
|
|
176
|
+
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
expect(deserializeConnectOptions(serialized)).to.deep.equal(options);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('should serialize and deserialize FLE2 connection options', () => {
|
|
189
|
+
const options: DevtoolsConnectOptions = {
|
|
190
|
+
autoEncryption: {
|
|
191
|
+
encryptedFieldsMap: {
|
|
192
|
+
'hr.employees': {
|
|
193
|
+
fields: [{
|
|
194
|
+
path: 'phoneNumber',
|
|
195
|
+
keyId: new UUID('fd6275d7-9260-4e6c-a86b-68ec5240814a').toBinary(),
|
|
196
|
+
bsonType: 'string',
|
|
197
|
+
queries: { queryType: 'equality', contention: new Long(0) }
|
|
198
|
+
}]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const serialized = serializeConnectOptions(options);
|
|
205
|
+
|
|
206
|
+
expect(serialized).to.deep.equal({
|
|
207
|
+
autoEncryption: {
|
|
208
|
+
encryptedFieldsMap: {
|
|
209
|
+
'hr.employees': {
|
|
210
|
+
fields: [{
|
|
211
|
+
path: 'phoneNumber',
|
|
212
|
+
keyId: { $binary: { base64: '/WJ115JgTmyoa2jsUkCBSg==', subType: '04' } },
|
|
213
|
+
bsonType: 'string',
|
|
214
|
+
queries: { queryType: 'equality', contention: { $numberLong: '0' } }
|
|
215
|
+
}]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
expect(deserializeConnectOptions(serialized)).to.deep.equal(options);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
138
224
|
});
|
package/src/serializer.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inspect } from 'util';
|
|
2
2
|
import { EJSON } from 'bson';
|
|
3
3
|
import { RuntimeEvaluationResult } from '@mongosh/browser-runtime-core';
|
|
4
|
+
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server/lib/cli-service-provider';
|
|
4
5
|
|
|
5
6
|
function isPrimitive(
|
|
6
7
|
val: any
|
|
@@ -110,3 +111,34 @@ export function deserializeEvaluationResult({
|
|
|
110
111
|
|
|
111
112
|
return { type, printable, source };
|
|
112
113
|
}
|
|
114
|
+
|
|
115
|
+
const autoEncryptionBSONOptions = [
|
|
116
|
+
'schemaMap',
|
|
117
|
+
'encryptedFieldsMap'
|
|
118
|
+
] as const;
|
|
119
|
+
|
|
120
|
+
export function serializeConnectOptions(options: Readonly<DevtoolsConnectOptions> = {}): DevtoolsConnectOptions {
|
|
121
|
+
const serializedOptions: any = { ...options };
|
|
122
|
+
for (const autoEncryptionOption of autoEncryptionBSONOptions) {
|
|
123
|
+
if (serializedOptions.autoEncryption?.[autoEncryptionOption]) {
|
|
124
|
+
serializedOptions.autoEncryption = {
|
|
125
|
+
...serializedOptions.autoEncryption,
|
|
126
|
+
[autoEncryptionOption]: EJSON.serialize(serializedOptions.autoEncryption[autoEncryptionOption], { relaxed: false })
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return serializedOptions;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function deserializeConnectOptions(options: Readonly<DevtoolsConnectOptions>): DevtoolsConnectOptions {
|
|
134
|
+
const deserializedOptions: any = { ...options };
|
|
135
|
+
for (const autoEncryptionOption of autoEncryptionBSONOptions) {
|
|
136
|
+
if (deserializedOptions.autoEncryption?.[autoEncryptionOption]) {
|
|
137
|
+
deserializedOptions.autoEncryption = {
|
|
138
|
+
...deserializedOptions.autoEncryption,
|
|
139
|
+
[autoEncryptionOption]: EJSON.deserialize(deserializedOptions.autoEncryption[autoEncryptionOption], { relaxed: false })
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return deserializedOptions;
|
|
144
|
+
}
|
package/src/worker-runtime.ts
CHANGED
|
@@ -8,19 +8,18 @@ import {
|
|
|
8
8
|
RuntimeEvaluationResult
|
|
9
9
|
} from '@mongosh/browser-runtime-core';
|
|
10
10
|
import { ElectronRuntime } from '@mongosh/browser-runtime-electron';
|
|
11
|
-
import type {
|
|
12
|
-
ServiceProvider
|
|
13
|
-
} from '@mongosh/service-provider-core';
|
|
11
|
+
import type { ServiceProvider } from '@mongosh/service-provider-core';
|
|
14
12
|
import {
|
|
15
|
-
CompassServiceProvider
|
|
16
|
-
DevtoolsConnectOptions
|
|
13
|
+
CompassServiceProvider
|
|
17
14
|
} from '@mongosh/service-provider-server';
|
|
18
15
|
import { exposeAll, createCaller } from './rpc';
|
|
19
|
-
import { serializeEvaluationResult } from './serializer';
|
|
16
|
+
import { serializeEvaluationResult, deserializeConnectOptions } from './serializer';
|
|
20
17
|
import type { MongoshBus } from '@mongosh/types';
|
|
21
18
|
import { Lock, UNLOCKED } from './lock';
|
|
22
19
|
import { runInterruptible, InterruptHandle } from 'interruptor';
|
|
23
20
|
|
|
21
|
+
type DevtoolsConnectOptions = Parameters<(typeof CompassServiceProvider)['connect']>[1];
|
|
22
|
+
|
|
24
23
|
if (!parentPort || isMainThread) {
|
|
25
24
|
throw new Error('Worker runtime can be used only in a worker thread');
|
|
26
25
|
}
|
|
@@ -98,7 +97,7 @@ const workerRuntime: WorkerRuntime = {
|
|
|
98
97
|
// will have to do for now.
|
|
99
98
|
provider = await (CompassServiceProvider as any).connect(
|
|
100
99
|
uri,
|
|
101
|
-
driverOptions,
|
|
100
|
+
deserializeConnectOptions(driverOptions),
|
|
102
101
|
cliOptions,
|
|
103
102
|
messageBus
|
|
104
103
|
);
|