@vyriy/env 0.1.9 → 0.1.13
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/README.md +0 -8
- package/aws.d.ts +3 -4
- package/aws.js +1 -2
- package/cdk.d.ts +3 -4
- package/ecs.d.ts +4 -5
- package/gitlab.d.ts +3 -4
- package/index.d.ts +1 -2
- package/index.js +0 -2
- package/localstack.d.ts +2 -3
- package/package.json +6 -21
- package/server.d.ts +1 -2
- package/stage.d.ts +15 -15
- package/stage.js +27 -28
- package/types.d.ts +1 -58
- package/vpc.d.ts +3 -4
package/README.md
CHANGED
|
@@ -68,13 +68,6 @@ CI / local tooling:
|
|
|
68
68
|
- `getLocalstackPort()`
|
|
69
69
|
- `getLogLevel()`
|
|
70
70
|
|
|
71
|
-
Chaos:
|
|
72
|
-
|
|
73
|
-
- `getChaosEnabled()`
|
|
74
|
-
- `getChaosErrorEnabled()`
|
|
75
|
-
- `getChaosTimeoutEnabled()`
|
|
76
|
-
- `getChaosTimeoutMs()`
|
|
77
|
-
|
|
78
71
|
Server:
|
|
79
72
|
|
|
80
73
|
- `getPort()`
|
|
@@ -100,6 +93,5 @@ Stage helpers:
|
|
|
100
93
|
|
|
101
94
|
- `existsEnv` only checks whether the variable is defined.
|
|
102
95
|
- `getEnv` throws if the variable is missing and no default value is provided.
|
|
103
|
-
- chaos helpers default to `CHAOS_ENABLED=false`, `CHAOS_ERROR_ENABLED=true`, `CHAOS_TIMEOUT_ENABLED=true`, and `CHAOS_TIMEOUT_MS=1000`.
|
|
104
96
|
- Stage helpers are based on the `STAGE` environment variable.
|
|
105
97
|
- `getNodeEnv` defaults to `'development'`.
|
package/aws.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const getSecretAccessKey: GetEnvWithValue;
|
|
1
|
+
export declare const getRegion: () => string;
|
|
2
|
+
export declare const getAccessKeyId: () => string;
|
|
3
|
+
export declare const getSecretAccessKey: () => string;
|
package/aws.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getEnv } from './env.js';
|
|
2
|
-
|
|
3
|
-
export const getRegion = () => getEnv('REGION', AwsRegion.EuCentral1);
|
|
2
|
+
export const getRegion = () => getEnv('REGION');
|
|
4
3
|
export const getAccessKeyId = () => getEnv('AWS_ACCESS_KEY_ID');
|
|
5
4
|
export const getSecretAccessKey = () => getEnv('AWS_SECRET_ACCESS_KEY');
|
package/cdk.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const getStack: GetEnvWithValue;
|
|
1
|
+
export declare const getCdkAccount: () => string;
|
|
2
|
+
export declare const getCdkRegion: () => string;
|
|
3
|
+
export declare const getStack: () => string;
|
package/ecs.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const getTask: GetEnvWithValue;
|
|
1
|
+
export declare const getEcsClusterName: () => string;
|
|
2
|
+
export declare const getEcsTaskDefinition: () => string;
|
|
3
|
+
export declare const getEcsContainerName: () => string;
|
|
4
|
+
export declare const getTask: () => string;
|
package/gitlab.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const getCiProjectName: GetEnvWithValue;
|
|
1
|
+
export declare const getCiPipelineId: () => string;
|
|
2
|
+
export declare const getCiMergeRequestId: () => string;
|
|
3
|
+
export declare const getCiProjectName: () => string;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './aws.js';
|
|
2
|
-
export * from './chaos.js';
|
|
3
2
|
export * from './cdk.js';
|
|
4
3
|
export * from './ecs.js';
|
|
5
4
|
export * from './env.js';
|
|
@@ -9,4 +8,4 @@ export * from './logger.js';
|
|
|
9
8
|
export * from './server.js';
|
|
10
9
|
export * from './stage.js';
|
|
11
10
|
export * from './vpc.js';
|
|
12
|
-
export * from './types.js';
|
|
11
|
+
export type * from './types.js';
|
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './aws.js';
|
|
2
|
-
export * from './chaos.js';
|
|
3
2
|
export * from './cdk.js';
|
|
4
3
|
export * from './ecs.js';
|
|
5
4
|
export * from './env.js';
|
|
@@ -9,4 +8,3 @@ export * from './logger.js';
|
|
|
9
8
|
export * from './server.js';
|
|
10
9
|
export * from './stage.js';
|
|
11
10
|
export * from './vpc.js';
|
|
12
|
-
export * from './types.js';
|
package/localstack.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const getLocalstackPort: GetEnvWithValue;
|
|
1
|
+
export declare const getLocalstackHost: () => string;
|
|
2
|
+
export declare const getLocalstackPort: () => string;
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/env",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Shared env utility for Vyriy projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/evheniy/vyriy",
|
|
11
|
+
"directory": "packages/env"
|
|
12
|
+
},
|
|
8
13
|
"types": "./index.d.ts",
|
|
9
14
|
"exports": {
|
|
10
15
|
".": {
|
|
@@ -32,16 +37,6 @@
|
|
|
32
37
|
"import": "./cdk.js",
|
|
33
38
|
"default": "./cdk.js"
|
|
34
39
|
},
|
|
35
|
-
"./chaos": {
|
|
36
|
-
"types": "./chaos.d.ts",
|
|
37
|
-
"import": "./chaos.js",
|
|
38
|
-
"default": "./chaos.js"
|
|
39
|
-
},
|
|
40
|
-
"./chaos.js": {
|
|
41
|
-
"types": "./chaos.d.ts",
|
|
42
|
-
"import": "./chaos.js",
|
|
43
|
-
"default": "./chaos.js"
|
|
44
|
-
},
|
|
45
40
|
"./ecs": {
|
|
46
41
|
"types": "./ecs.d.ts",
|
|
47
42
|
"import": "./ecs.js",
|
|
@@ -122,16 +117,6 @@
|
|
|
122
117
|
"import": "./stage.js",
|
|
123
118
|
"default": "./stage.js"
|
|
124
119
|
},
|
|
125
|
-
"./types": {
|
|
126
|
-
"types": "./types.d.ts",
|
|
127
|
-
"import": "./types.js",
|
|
128
|
-
"default": "./types.js"
|
|
129
|
-
},
|
|
130
|
-
"./types.js": {
|
|
131
|
-
"types": "./types.d.ts",
|
|
132
|
-
"import": "./types.js",
|
|
133
|
-
"default": "./types.js"
|
|
134
|
-
},
|
|
135
120
|
"./vpc": {
|
|
136
121
|
"types": "./vpc.d.ts",
|
|
137
122
|
"import": "./vpc.js",
|
package/server.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getPort: GetEnvWithValue;
|
|
1
|
+
export declare const getPort: () => string;
|
package/stage.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
import type { GetStage, IsStage } from './types.js';
|
|
2
|
+
export declare const LOCAL = "local";
|
|
3
|
+
export declare const DEV = "dev";
|
|
4
|
+
export declare const DEVELOP = "develop";
|
|
5
|
+
export declare const TEST = "test";
|
|
6
|
+
export declare const TESTING = "testing";
|
|
7
|
+
export declare const QA = "qa";
|
|
8
|
+
export declare const UAT = "uat";
|
|
9
|
+
export declare const STAGING = "staging";
|
|
10
|
+
export declare const PREPROD = "preprod";
|
|
11
|
+
export declare const PREPRODUCTION = "pre-production";
|
|
12
|
+
export declare const FEATURE = "feature";
|
|
13
|
+
export declare const HOTFIX = "hotfix";
|
|
14
|
+
export declare const PRODUCTION = "production";
|
|
15
|
+
export declare const getStage: GetStage;
|
|
4
16
|
export declare const isLocal: IsStage;
|
|
5
|
-
export declare const DEV = Stage.Dev;
|
|
6
17
|
export declare const isDev: IsStage;
|
|
7
|
-
export declare const DEVELOP = Stage.Develop;
|
|
8
18
|
export declare const isDevelop: IsStage;
|
|
9
|
-
export declare const TEST = Stage.Test;
|
|
10
19
|
export declare const isTest: IsStage;
|
|
11
|
-
export declare const TESTING = Stage.Testing;
|
|
12
20
|
export declare const isTesting: IsStage;
|
|
13
|
-
export declare const QA = Stage.Qa;
|
|
14
21
|
export declare const isQa: IsStage;
|
|
15
|
-
export declare const UAT = Stage.Uat;
|
|
16
22
|
export declare const isUat: IsStage;
|
|
17
|
-
export declare const STAGING = Stage.Staging;
|
|
18
23
|
export declare const isStaging: IsStage;
|
|
19
|
-
export declare const PREPROD = Stage.PreProd;
|
|
20
24
|
export declare const isPreProd: IsStage;
|
|
21
|
-
export declare const PREPRODUCTION = Stage.PreProduction;
|
|
22
25
|
export declare const isPreProduction: IsStage;
|
|
23
|
-
export declare const FEATURE = Stage.Feature;
|
|
24
26
|
export declare const isFeature: IsStage;
|
|
25
|
-
export declare const HOTFIX = Stage.Hotfix;
|
|
26
27
|
export declare const isHotfix: IsStage;
|
|
27
|
-
export declare const PRODUCTION = Stage.Production;
|
|
28
28
|
export declare const isProduction: IsStage;
|
package/stage.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { getEnv } from './env.js';
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const isHotfix = () => getStage() ===
|
|
28
|
-
export const
|
|
29
|
-
export const isProduction = () => getStage() === Stage.Production;
|
|
2
|
+
export const LOCAL = 'local';
|
|
3
|
+
export const DEV = 'dev';
|
|
4
|
+
export const DEVELOP = 'develop';
|
|
5
|
+
export const TEST = 'test';
|
|
6
|
+
export const TESTING = 'testing';
|
|
7
|
+
export const QA = 'qa';
|
|
8
|
+
export const UAT = 'uat';
|
|
9
|
+
export const STAGING = 'staging';
|
|
10
|
+
export const PREPROD = 'preprod';
|
|
11
|
+
export const PREPRODUCTION = 'pre-production';
|
|
12
|
+
export const FEATURE = 'feature';
|
|
13
|
+
export const HOTFIX = 'hotfix';
|
|
14
|
+
export const PRODUCTION = 'production';
|
|
15
|
+
export const getStage = () => getEnv('STAGE', LOCAL);
|
|
16
|
+
export const isLocal = () => getStage() === LOCAL;
|
|
17
|
+
export const isDev = () => getStage() === DEV;
|
|
18
|
+
export const isDevelop = () => getStage() === DEVELOP;
|
|
19
|
+
export const isTest = () => getStage() === TEST;
|
|
20
|
+
export const isTesting = () => getStage() === TESTING;
|
|
21
|
+
export const isQa = () => getStage() === QA;
|
|
22
|
+
export const isUat = () => getStage() === UAT;
|
|
23
|
+
export const isStaging = () => getStage() === STAGING;
|
|
24
|
+
export const isPreProd = () => getStage() === PREPROD;
|
|
25
|
+
export const isPreProduction = () => getStage() === PREPRODUCTION;
|
|
26
|
+
export const isFeature = () => getStage() === FEATURE;
|
|
27
|
+
export const isHotfix = () => getStage() === HOTFIX;
|
|
28
|
+
export const isProduction = () => getStage() === PRODUCTION;
|
package/types.d.ts
CHANGED
|
@@ -4,65 +4,8 @@ export type GetEnv = {
|
|
|
4
4
|
<T extends string>(name: string, defaultValue: T): T;
|
|
5
5
|
};
|
|
6
6
|
export type ExistsEnv = (name: string) => boolean;
|
|
7
|
-
export type GetEnvWithValue<T extends string = string> = () => T;
|
|
8
|
-
export type GetBooleanEnvWithValue = () => boolean;
|
|
9
|
-
export type GetNumberEnvWithValue = () => number;
|
|
10
7
|
export type NodeEnv = 'production' | 'development' | 'test';
|
|
11
8
|
export type GetNodeEnv = () => NodeEnv;
|
|
12
9
|
export type IsNodeEnv = () => boolean;
|
|
10
|
+
export type GetStage = () => string;
|
|
13
11
|
export type IsStage = () => boolean;
|
|
14
|
-
export declare enum AwsRegion {
|
|
15
|
-
UsEast1 = "us-east-1",
|
|
16
|
-
UsEast2 = "us-east-2",
|
|
17
|
-
UsWest1 = "us-west-1",
|
|
18
|
-
UsWest2 = "us-west-2",
|
|
19
|
-
CaCentral1 = "ca-central-1",
|
|
20
|
-
CaWest1 = "ca-west-1",
|
|
21
|
-
MxCentral1 = "mx-central-1",
|
|
22
|
-
SaEast1 = "sa-east-1",
|
|
23
|
-
EuWest1 = "eu-west-1",
|
|
24
|
-
EuWest2 = "eu-west-2",
|
|
25
|
-
EuWest3 = "eu-west-3",
|
|
26
|
-
EuCentral1 = "eu-central-1",
|
|
27
|
-
EuCentral2 = "eu-central-2",
|
|
28
|
-
EuNorth1 = "eu-north-1",
|
|
29
|
-
EuSouth1 = "eu-south-1",
|
|
30
|
-
EuSouth2 = "eu-south-2",
|
|
31
|
-
MeSouth1 = "me-south-1",
|
|
32
|
-
MeCentral1 = "me-central-1",
|
|
33
|
-
AfSouth1 = "af-south-1",
|
|
34
|
-
IlCentral1 = "il-central-1",
|
|
35
|
-
ApNorthEast1 = "ap-northeast-1",
|
|
36
|
-
ApNorthEast2 = "ap-northeast-2",
|
|
37
|
-
ApNorthEast3 = "ap-northeast-3",
|
|
38
|
-
ApSouth1 = "ap-south-1",
|
|
39
|
-
ApSouth2 = "ap-south-2",
|
|
40
|
-
ApEast1 = "ap-east-1",
|
|
41
|
-
ApEast2 = "ap-east-2",
|
|
42
|
-
ApSouthEast1 = "ap-southeast-1",
|
|
43
|
-
ApSouthEast2 = "ap-southeast-2",
|
|
44
|
-
ApSouthEast3 = "ap-southeast-3",
|
|
45
|
-
ApSouthEast4 = "ap-southeast-4",
|
|
46
|
-
ApSouthEast5 = "ap-southeast-5",
|
|
47
|
-
ApSouthEast6 = "ap-southeast-6",
|
|
48
|
-
ApSouthEast7 = "ap-southeast-7",
|
|
49
|
-
UsGovWest1 = "us-gov-west-1",
|
|
50
|
-
UsGovEast1 = "us-gov-east-1",
|
|
51
|
-
CnNorth1 = "cn-north-1",
|
|
52
|
-
CnNorthWest1 = "cn-northwest-1"
|
|
53
|
-
}
|
|
54
|
-
export declare enum Stage {
|
|
55
|
-
Local = "local",
|
|
56
|
-
Dev = "dev",
|
|
57
|
-
Develop = "develop",
|
|
58
|
-
Test = "test",
|
|
59
|
-
Testing = "testing",
|
|
60
|
-
Qa = "qa",
|
|
61
|
-
Uat = "uat",
|
|
62
|
-
Staging = "staging",
|
|
63
|
-
PreProduction = "pre-production",
|
|
64
|
-
PreProd = "preprod",
|
|
65
|
-
Feature = "feature",
|
|
66
|
-
Hotfix = "hotfix",
|
|
67
|
-
Production = "production"
|
|
68
|
-
}
|
package/vpc.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const getVpcSubnets: GetEnvWithValue;
|
|
1
|
+
export declare const getVpc: () => string;
|
|
2
|
+
export declare const getVpcSecurityGroup: () => string;
|
|
3
|
+
export declare const getVpcSubnets: () => string;
|