@e22m4u/js-repository-mongodb-adapter 0.5.0 → 0.5.6
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/LICENSE +1 -1
- package/dist/cjs/index.cjs +61 -6
- package/package.json +13 -14
- package/setup.sh +4 -4
- package/src/mongodb-adapter.js +59 -6
- package/test.env +1 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2023 e22m4u@yandex.ru
|
|
3
|
+
Copyright (c) 2023-2025 Mikhail Evstropov <e22m4u@yandex.ru>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -153,41 +153,93 @@ __name(transformValuesDeep, "transformValuesDeep");
|
|
|
153
153
|
var import_js_repository3 = require("@e22m4u/js-repository");
|
|
154
154
|
var import_js_repository4 = require("@e22m4u/js-repository");
|
|
155
155
|
var import_js_repository5 = require("@e22m4u/js-repository");
|
|
156
|
-
|
|
156
|
+
|
|
157
|
+
// node_modules/@e22m4u/js-service/src/errors/invalid-argument-error.js
|
|
158
|
+
var import_js_format = require("@e22m4u/js-format");
|
|
159
|
+
|
|
160
|
+
// src/mongodb-adapter.js
|
|
157
161
|
var import_js_repository6 = require("@e22m4u/js-repository");
|
|
158
162
|
var import_js_repository7 = require("@e22m4u/js-repository");
|
|
159
163
|
var import_js_repository8 = require("@e22m4u/js-repository");
|
|
160
164
|
var import_js_repository9 = require("@e22m4u/js-repository");
|
|
161
165
|
var import_js_repository10 = require("@e22m4u/js-repository");
|
|
162
166
|
var MONGODB_OPTION_NAMES = [
|
|
163
|
-
"
|
|
167
|
+
"ALPNProtocols",
|
|
168
|
+
"allowPartialTrustChain",
|
|
169
|
+
"appName",
|
|
170
|
+
"auth",
|
|
164
171
|
"authMechanism",
|
|
165
172
|
"authMechanismProperties",
|
|
166
173
|
"authSource",
|
|
174
|
+
"autoEncryption",
|
|
175
|
+
"autoSelectFamily",
|
|
176
|
+
"autoSelectFamilyAttemptTimeout",
|
|
177
|
+
"bsonRegExp",
|
|
178
|
+
"ca",
|
|
179
|
+
"cert",
|
|
180
|
+
"checkKeys",
|
|
181
|
+
"checkServerIdentity",
|
|
182
|
+
"ciphers",
|
|
167
183
|
"compressors",
|
|
168
184
|
"connectTimeoutMS",
|
|
185
|
+
"crl",
|
|
169
186
|
"directConnection",
|
|
187
|
+
"driverInfo",
|
|
188
|
+
"ecdhCurve",
|
|
189
|
+
"enableUtf8Validation",
|
|
190
|
+
"family",
|
|
191
|
+
"fieldsAsRaw",
|
|
192
|
+
"forceServerObjectId",
|
|
170
193
|
"heartbeatFrequencyMS",
|
|
194
|
+
"hints",
|
|
195
|
+
"ignoreUndefined",
|
|
171
196
|
"journal",
|
|
197
|
+
"keepAliveInitialDelay",
|
|
198
|
+
"key",
|
|
172
199
|
"loadBalanced",
|
|
200
|
+
"localAddress",
|
|
201
|
+
"localPort",
|
|
173
202
|
"localThresholdMS",
|
|
203
|
+
"lookup",
|
|
204
|
+
"maxConnecting",
|
|
174
205
|
"maxIdleTimeMS",
|
|
175
206
|
"maxPoolSize",
|
|
176
|
-
"maxConnecting",
|
|
177
207
|
"maxStalenessSeconds",
|
|
208
|
+
"minDHSize",
|
|
209
|
+
"minHeartbeatFrequencyMS",
|
|
178
210
|
"minPoolSize",
|
|
211
|
+
"mongodbLogComponentSeverities",
|
|
212
|
+
"mongodbLogMaxDocumentLength",
|
|
213
|
+
"mongodbLogPath",
|
|
214
|
+
"monitorCommands",
|
|
215
|
+
"noDelay",
|
|
216
|
+
"passphrase",
|
|
217
|
+
"pfx",
|
|
218
|
+
"pkFactory",
|
|
219
|
+
"promoteBuffers",
|
|
220
|
+
"promoteLongs",
|
|
221
|
+
"promoteValues",
|
|
179
222
|
"proxyHost",
|
|
223
|
+
"proxyPassword",
|
|
180
224
|
"proxyPort",
|
|
181
225
|
"proxyUsername",
|
|
182
|
-
"
|
|
226
|
+
"raw",
|
|
227
|
+
"readConcern",
|
|
183
228
|
"readConcernLevel",
|
|
184
229
|
"readPreference",
|
|
185
230
|
"readPreferenceTags",
|
|
231
|
+
"rejectUnauthorized",
|
|
186
232
|
"replicaSet",
|
|
187
233
|
"retryReads",
|
|
188
234
|
"retryWrites",
|
|
235
|
+
"secureContext",
|
|
236
|
+
"secureProtocol",
|
|
237
|
+
"serializeFunctions",
|
|
238
|
+
"serverApi",
|
|
239
|
+
"serverMonitoringMode",
|
|
189
240
|
"serverSelectionTimeoutMS",
|
|
190
|
-
"
|
|
241
|
+
"servername",
|
|
242
|
+
"session",
|
|
191
243
|
"socketTimeoutMS",
|
|
192
244
|
"srvMaxHosts",
|
|
193
245
|
"srvServiceName",
|
|
@@ -197,12 +249,15 @@ var MONGODB_OPTION_NAMES = [
|
|
|
197
249
|
"tlsAllowInvalidCertificates",
|
|
198
250
|
"tlsAllowInvalidHostnames",
|
|
199
251
|
"tlsCAFile",
|
|
252
|
+
"tlsCRLFile",
|
|
200
253
|
"tlsCertificateKeyFile",
|
|
201
254
|
"tlsCertificateKeyFilePassword",
|
|
202
255
|
"tlsInsecure",
|
|
256
|
+
"useBigInt64",
|
|
203
257
|
"w",
|
|
204
258
|
"waitQueueTimeoutMS",
|
|
205
|
-
"
|
|
259
|
+
"writeConcern",
|
|
260
|
+
"wtimeoutMS",
|
|
206
261
|
"zlibCompressionLevel"
|
|
207
262
|
];
|
|
208
263
|
var DEFAULT_SETTINGS = {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e22m4u/js-repository-mongodb-adapter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "MongoDB адаптер для @e22m4u/js-repository",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "Mikhail Evstropov <e22m4u@yandex.ru>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"MongoDB",
|
|
@@ -38,30 +38,29 @@
|
|
|
38
38
|
"prepare": "husky"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"mongodb": "6.
|
|
41
|
+
"mongodb": "6.19.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@e22m4u/js-format": "~0.1.0",
|
|
45
|
-
"@e22m4u/js-repository": "~0.3.0"
|
|
46
|
-
"@e22m4u/js-service": "~0.2.0"
|
|
45
|
+
"@e22m4u/js-repository": "~0.3.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@commitlint/cli": "~19.8.1",
|
|
50
49
|
"@commitlint/config-conventional": "~19.8.1",
|
|
51
|
-
"@eslint/js": "~9.
|
|
50
|
+
"@eslint/js": "~9.34.0",
|
|
52
51
|
"c8": "~10.1.3",
|
|
53
|
-
"chai": "~
|
|
54
|
-
"chai-as-promised": "~8.0.
|
|
55
|
-
"dotenv": "~
|
|
56
|
-
"esbuild": "~0.25.
|
|
57
|
-
"eslint": "~9.
|
|
58
|
-
"eslint-config-prettier": "~10.1.
|
|
52
|
+
"chai": "~6.0.1",
|
|
53
|
+
"chai-as-promised": "~8.0.2",
|
|
54
|
+
"dotenv": "~17.2.1",
|
|
55
|
+
"esbuild": "~0.25.9",
|
|
56
|
+
"eslint": "~9.34.0",
|
|
57
|
+
"eslint-config-prettier": "~10.1.8",
|
|
59
58
|
"eslint-plugin-chai-expect": "~3.1.0",
|
|
60
59
|
"eslint-plugin-mocha": "~11.1.0",
|
|
61
|
-
"globals": "~16.
|
|
60
|
+
"globals": "~16.3.0",
|
|
62
61
|
"husky": "~9.1.7",
|
|
63
62
|
"mocha": "~11.7.1",
|
|
64
|
-
"prettier": "~3.6.
|
|
63
|
+
"prettier": "~3.6.2",
|
|
65
64
|
"rimraf": "~6.0.1"
|
|
66
65
|
}
|
|
67
66
|
}
|
package/setup.sh
CHANGED
|
@@ -20,9 +20,9 @@ if [ "$DOCKER_EXISTS" -ne 0 ]; then
|
|
|
20
20
|
exit 1
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
# Pulling
|
|
24
|
-
printf "\nPulling
|
|
25
|
-
docker pull mongo:
|
|
23
|
+
# Pulling mongodb image
|
|
24
|
+
printf "\nPulling mongodb $MONGODB_VERSION image..."
|
|
25
|
+
docker pull mongo:"$MONGODB_VERSION" > /dev/null 2>&1
|
|
26
26
|
|
|
27
27
|
# Starting the mongodb container
|
|
28
28
|
printf "\nStarting the mongodb container..."
|
|
@@ -30,7 +30,7 @@ CONTAINER_EXISTS=$(docker ps -a -q -f name="$MONGODB_CONTAINER")
|
|
|
30
30
|
if [ "$CONTAINER_EXISTS" ]; then
|
|
31
31
|
docker rm -f "$MONGODB_CONTAINER" > /dev/null
|
|
32
32
|
fi
|
|
33
|
-
docker run --name "$MONGODB_CONTAINER" -p "$MONGODB_PORT":27017 -d mongo:
|
|
33
|
+
docker run --name "$MONGODB_CONTAINER" -p "$MONGODB_PORT":27017 -d mongo:"$MONGODB_VERSION" > /dev/null
|
|
34
34
|
|
|
35
35
|
# Mongodb container has started
|
|
36
36
|
printf "\n\nStatus: Mongodb container has started."
|
package/src/mongodb-adapter.js
CHANGED
|
@@ -17,39 +17,89 @@ import {InvalidOperatorValueError} from '@e22m4u/js-repository';
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Mongodb option names.
|
|
20
|
-
*
|
|
20
|
+
* 6.19.0
|
|
21
|
+
*
|
|
22
|
+
* https://mongodb.github.io/node-mongodb-native/6.19/interfaces/MongoClientOptions.html
|
|
21
23
|
*
|
|
22
24
|
* @type {string[]}
|
|
23
25
|
*/
|
|
24
26
|
const MONGODB_OPTION_NAMES = [
|
|
25
|
-
'
|
|
27
|
+
'ALPNProtocols',
|
|
28
|
+
'allowPartialTrustChain',
|
|
29
|
+
'appName',
|
|
30
|
+
'auth',
|
|
26
31
|
'authMechanism',
|
|
27
32
|
'authMechanismProperties',
|
|
28
33
|
'authSource',
|
|
34
|
+
'autoEncryption',
|
|
35
|
+
'autoSelectFamily',
|
|
36
|
+
'autoSelectFamilyAttemptTimeout',
|
|
37
|
+
'bsonRegExp',
|
|
38
|
+
'ca',
|
|
39
|
+
'cert',
|
|
40
|
+
'checkKeys',
|
|
41
|
+
'checkServerIdentity',
|
|
42
|
+
'ciphers',
|
|
29
43
|
'compressors',
|
|
30
44
|
'connectTimeoutMS',
|
|
45
|
+
'crl',
|
|
31
46
|
'directConnection',
|
|
47
|
+
'driverInfo',
|
|
48
|
+
'ecdhCurve',
|
|
49
|
+
'enableUtf8Validation',
|
|
50
|
+
'family',
|
|
51
|
+
'fieldsAsRaw',
|
|
52
|
+
'forceServerObjectId',
|
|
32
53
|
'heartbeatFrequencyMS',
|
|
54
|
+
'hints',
|
|
55
|
+
'ignoreUndefined',
|
|
33
56
|
'journal',
|
|
57
|
+
'keepAliveInitialDelay',
|
|
58
|
+
'key',
|
|
34
59
|
'loadBalanced',
|
|
60
|
+
'localAddress',
|
|
61
|
+
'localPort',
|
|
35
62
|
'localThresholdMS',
|
|
63
|
+
'lookup',
|
|
64
|
+
'maxConnecting',
|
|
36
65
|
'maxIdleTimeMS',
|
|
37
66
|
'maxPoolSize',
|
|
38
|
-
'maxConnecting',
|
|
39
67
|
'maxStalenessSeconds',
|
|
68
|
+
'minDHSize',
|
|
69
|
+
'minHeartbeatFrequencyMS',
|
|
40
70
|
'minPoolSize',
|
|
71
|
+
'mongodbLogComponentSeverities',
|
|
72
|
+
'mongodbLogMaxDocumentLength',
|
|
73
|
+
'mongodbLogPath',
|
|
74
|
+
'monitorCommands',
|
|
75
|
+
'noDelay',
|
|
76
|
+
'passphrase',
|
|
77
|
+
'pfx',
|
|
78
|
+
'pkFactory',
|
|
79
|
+
'promoteBuffers',
|
|
80
|
+
'promoteLongs',
|
|
81
|
+
'promoteValues',
|
|
41
82
|
'proxyHost',
|
|
83
|
+
'proxyPassword',
|
|
42
84
|
'proxyPort',
|
|
43
85
|
'proxyUsername',
|
|
44
|
-
'
|
|
86
|
+
'raw',
|
|
87
|
+
'readConcern',
|
|
45
88
|
'readConcernLevel',
|
|
46
89
|
'readPreference',
|
|
47
90
|
'readPreferenceTags',
|
|
91
|
+
'rejectUnauthorized',
|
|
48
92
|
'replicaSet',
|
|
49
93
|
'retryReads',
|
|
50
94
|
'retryWrites',
|
|
95
|
+
'secureContext',
|
|
96
|
+
'secureProtocol',
|
|
97
|
+
'serializeFunctions',
|
|
98
|
+
'serverApi',
|
|
99
|
+
'serverMonitoringMode',
|
|
51
100
|
'serverSelectionTimeoutMS',
|
|
52
|
-
'
|
|
101
|
+
'servername',
|
|
102
|
+
'session',
|
|
53
103
|
'socketTimeoutMS',
|
|
54
104
|
'srvMaxHosts',
|
|
55
105
|
'srvServiceName',
|
|
@@ -59,12 +109,15 @@ const MONGODB_OPTION_NAMES = [
|
|
|
59
109
|
'tlsAllowInvalidCertificates',
|
|
60
110
|
'tlsAllowInvalidHostnames',
|
|
61
111
|
'tlsCAFile',
|
|
112
|
+
'tlsCRLFile',
|
|
62
113
|
'tlsCertificateKeyFile',
|
|
63
114
|
'tlsCertificateKeyFilePassword',
|
|
64
115
|
'tlsInsecure',
|
|
116
|
+
'useBigInt64',
|
|
65
117
|
'w',
|
|
66
118
|
'waitQueueTimeoutMS',
|
|
67
|
-
'
|
|
119
|
+
'writeConcern',
|
|
120
|
+
'wtimeoutMS',
|
|
68
121
|
'zlibCompressionLevel',
|
|
69
122
|
];
|
|
70
123
|
|
package/test.env
CHANGED