@constructive-io/graphql-env 3.15.0 → 3.16.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/env.js +6 -14
- package/esm/env.js +1 -9
- package/package.json +4 -3
package/env.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGraphQLEnvVars = void 0;
|
|
4
|
-
|
|
5
|
-
* Parse GraphQL-related environment variables.
|
|
6
|
-
* These are the env vars that Constructive packages need but pgpm doesn't.
|
|
7
|
-
*/
|
|
8
|
-
const parseEnvBoolean = (val) => {
|
|
9
|
-
if (val === undefined)
|
|
10
|
-
return undefined;
|
|
11
|
-
return ['true', '1', 'yes'].includes(val.toLowerCase());
|
|
12
|
-
};
|
|
4
|
+
const _12factor_env_1 = require("12factor-env");
|
|
13
5
|
/**
|
|
14
6
|
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
15
7
|
*/
|
|
@@ -24,13 +16,13 @@ const getGraphQLEnvVars = (env = process.env) => {
|
|
|
24
16
|
}),
|
|
25
17
|
},
|
|
26
18
|
features: {
|
|
27
|
-
...(FEATURES_SIMPLE_INFLECTION && { simpleInflection: parseEnvBoolean(FEATURES_SIMPLE_INFLECTION) }),
|
|
28
|
-
...(FEATURES_OPPOSITE_BASE_NAMES && { oppositeBaseNames: parseEnvBoolean(FEATURES_OPPOSITE_BASE_NAMES) }),
|
|
29
|
-
...(FEATURES_POSTGIS && { postgis: parseEnvBoolean(FEATURES_POSTGIS) }),
|
|
19
|
+
...(FEATURES_SIMPLE_INFLECTION && { simpleInflection: (0, _12factor_env_1.parseEnvBoolean)(FEATURES_SIMPLE_INFLECTION) }),
|
|
20
|
+
...(FEATURES_OPPOSITE_BASE_NAMES && { oppositeBaseNames: (0, _12factor_env_1.parseEnvBoolean)(FEATURES_OPPOSITE_BASE_NAMES) }),
|
|
21
|
+
...(FEATURES_POSTGIS && { postgis: (0, _12factor_env_1.parseEnvBoolean)(FEATURES_POSTGIS) }),
|
|
30
22
|
},
|
|
31
23
|
api: {
|
|
32
|
-
...(API_ENABLE_SERVICES && { enableServicesApi: parseEnvBoolean(API_ENABLE_SERVICES) }),
|
|
33
|
-
...(API_IS_PUBLIC && { isPublic: parseEnvBoolean(API_IS_PUBLIC) }),
|
|
24
|
+
...(API_ENABLE_SERVICES && { enableServicesApi: (0, _12factor_env_1.parseEnvBoolean)(API_ENABLE_SERVICES) }),
|
|
25
|
+
...(API_IS_PUBLIC && { isPublic: (0, _12factor_env_1.parseEnvBoolean)(API_IS_PUBLIC) }),
|
|
34
26
|
...(API_EXPOSED_SCHEMAS && { exposedSchemas: API_EXPOSED_SCHEMAS.split(',').map(s => s.trim()) }),
|
|
35
27
|
...(API_META_SCHEMAS && { metaSchemas: API_META_SCHEMAS.split(',').map(s => s.trim()) }),
|
|
36
28
|
...(API_ANON_ROLE && { anonRole: API_ANON_ROLE }),
|
package/esm/env.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Parse GraphQL-related environment variables.
|
|
3
|
-
* These are the env vars that Constructive packages need but pgpm doesn't.
|
|
4
|
-
*/
|
|
5
|
-
const parseEnvBoolean = (val) => {
|
|
6
|
-
if (val === undefined)
|
|
7
|
-
return undefined;
|
|
8
|
-
return ['true', '1', 'yes'].includes(val.toLowerCase());
|
|
9
|
-
};
|
|
1
|
+
import { parseEnvBoolean } from '12factor-env';
|
|
10
2
|
/**
|
|
11
3
|
* @param env - Environment object to read from (defaults to process.env for backwards compatibility)
|
|
12
4
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-env",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive environment configuration with GraphQL/Graphile support",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"test:watch": "jest --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"12factor-env": "^1.17.0",
|
|
32
33
|
"@constructive-io/graphql-types": "^3.14.0",
|
|
33
|
-
"@pgpmjs/env": "^2.
|
|
34
|
+
"@pgpmjs/env": "^2.28.0",
|
|
34
35
|
"deepmerge": "^4.3.1"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"makage": "^0.3.0"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ff6c442b789cbe8803f33036110f6e09124e65df"
|
|
48
49
|
}
|