@orion-js/mongodb 3.1.7 → 3.1.10
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.
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMongoURLFromEnv = void 0;
|
|
4
4
|
const connections_1 = require("./connections");
|
|
5
|
+
const helpers_1 = require("@orion-js/helpers");
|
|
5
6
|
const getMongoURLFromEnv = (connectionName) => {
|
|
6
7
|
if (connectionName === 'main') {
|
|
7
|
-
if (!
|
|
8
|
+
if (!(0, helpers_1.internalGetEnv)('mongo_url', 'MONGO_URL')) {
|
|
8
9
|
throw new Error('MONGO_URL is required');
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return (0, helpers_1.internalGetEnv)('mongo_url', 'MONGO_URL');
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
const
|
|
13
|
+
const envName = `mongo_url_${connectionName.toLowerCase()}`;
|
|
14
|
+
const processEnvName = `MONGO_URL_${connectionName.toUpperCase()}`;
|
|
15
|
+
const uri = connections_1.connections[connectionName]?.uri ?? (0, helpers_1.internalGetEnv)(envName, processEnvName);
|
|
14
16
|
if (!uri) {
|
|
15
|
-
throw new Error(`To use the connection "${connectionName}" you must initialize it first calling getMongoConnection({name: "${connectionName}", uri: "MONGOURI"}) or setting the environment variable ${
|
|
17
|
+
throw new Error(`To use the connection "${connectionName}" you must initialize it first calling getMongoConnection({name: "${connectionName}", uri: "MONGOURI"}) or setting the environment variable ${processEnvName}.`);
|
|
16
18
|
}
|
|
17
19
|
return uri;
|
|
18
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/mongodb",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"upgrade-interactive": "yarn upgrade-interactive"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orion-js/helpers": "^3.1.
|
|
21
|
-
"@orion-js/models": "^3.1.
|
|
22
|
-
"@orion-js/resolvers": "^3.1.
|
|
20
|
+
"@orion-js/helpers": "^3.1.10",
|
|
21
|
+
"@orion-js/models": "^3.1.10",
|
|
22
|
+
"@orion-js/resolvers": "^3.1.10",
|
|
23
23
|
"@orion-js/schema": "^3.1.6",
|
|
24
|
-
"@orion-js/typed-model": "^3.1.
|
|
24
|
+
"@orion-js/typed-model": "^3.1.10",
|
|
25
25
|
"dataloader": "2.0.0",
|
|
26
26
|
"dot-object": "2.1.4",
|
|
27
27
|
"mongodb": "4.1.4"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "40fa0800303f49ad08890b2bedff2cdadb81360d"
|
|
42
42
|
}
|