@vyriy/env 0.1.12 → 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 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
- import { AwsRegion, GetEnvWithValue } from './types.js';
2
- export declare const getRegion: GetEnvWithValue<AwsRegion>;
3
- export declare const getAccessKeyId: GetEnvWithValue;
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
- import { AwsRegion } from './types.js';
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
- import { AwsRegion, GetEnvWithValue } from './types.js';
2
- export declare const getCdkAccount: GetEnvWithValue;
3
- export declare const getCdkRegion: GetEnvWithValue<AwsRegion>;
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
- import { GetEnvWithValue } from './types.js';
2
- export declare const getEcsClusterName: GetEnvWithValue;
3
- export declare const getEcsTaskDefinition: GetEnvWithValue;
4
- export declare const getEcsContainerName: GetEnvWithValue;
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
- import { GetEnvWithValue } from './types.js';
2
- export declare const getCiPipelineId: GetEnvWithValue;
3
- export declare const getCiMergeRequestId: GetEnvWithValue;
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
- import { GetEnvWithValue } from './types.js';
2
- export declare const getLocalstackHost: GetEnvWithValue;
3
- export declare const getLocalstackPort: GetEnvWithValue;
1
+ export declare const getLocalstackHost: () => string;
2
+ export declare const getLocalstackPort: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/env",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Shared env utility for Vyriy projects",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -37,16 +37,6 @@
37
37
  "import": "./cdk.js",
38
38
  "default": "./cdk.js"
39
39
  },
40
- "./chaos": {
41
- "types": "./chaos.d.ts",
42
- "import": "./chaos.js",
43
- "default": "./chaos.js"
44
- },
45
- "./chaos.js": {
46
- "types": "./chaos.d.ts",
47
- "import": "./chaos.js",
48
- "default": "./chaos.js"
49
- },
50
40
  "./ecs": {
51
41
  "types": "./ecs.d.ts",
52
42
  "import": "./ecs.js",
@@ -127,16 +117,6 @@
127
117
  "import": "./stage.js",
128
118
  "default": "./stage.js"
129
119
  },
130
- "./types": {
131
- "types": "./types.d.ts",
132
- "import": "./types.js",
133
- "default": "./types.js"
134
- },
135
- "./types.js": {
136
- "types": "./types.d.ts",
137
- "import": "./types.js",
138
- "default": "./types.js"
139
- },
140
120
  "./vpc": {
141
121
  "types": "./vpc.d.ts",
142
122
  "import": "./vpc.js",
package/server.d.ts CHANGED
@@ -1,2 +1 @@
1
- import { GetEnvWithValue } from './types.js';
2
- export declare const getPort: GetEnvWithValue;
1
+ export declare const getPort: () => string;
package/stage.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- import { GetEnvWithValue, Stage, IsStage } from './types.js';
2
- export declare const getStage: GetEnvWithValue<Stage>;
3
- export declare const LOCAL = Stage.Local;
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
- import { Stage } from './types.js';
3
- export const getStage = () => getEnv('STAGE', Stage.Local);
4
- export const LOCAL = Stage.Local;
5
- export const isLocal = () => getStage() === Stage.Local;
6
- export const DEV = Stage.Dev;
7
- export const isDev = () => getStage() === Stage.Dev;
8
- export const DEVELOP = Stage.Develop;
9
- export const isDevelop = () => getStage() === Stage.Develop;
10
- export const TEST = Stage.Test;
11
- export const isTest = () => getStage() === Stage.Test;
12
- export const TESTING = Stage.Testing;
13
- export const isTesting = () => getStage() === Stage.Testing;
14
- export const QA = Stage.Qa;
15
- export const isQa = () => getStage() === Stage.Qa;
16
- export const UAT = Stage.Uat;
17
- export const isUat = () => getStage() === Stage.Uat;
18
- export const STAGING = Stage.Staging;
19
- export const isStaging = () => getStage() === Stage.Staging;
20
- export const PREPROD = Stage.PreProd;
21
- export const isPreProd = () => getStage() === Stage.PreProd;
22
- export const PREPRODUCTION = Stage.PreProduction;
23
- export const isPreProduction = () => getStage() === Stage.PreProduction;
24
- export const FEATURE = Stage.Feature;
25
- export const isFeature = () => getStage() === Stage.Feature;
26
- export const HOTFIX = Stage.Hotfix;
27
- export const isHotfix = () => getStage() === Stage.Hotfix;
28
- export const PRODUCTION = Stage.Production;
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
- import { GetEnvWithValue } from './types.js';
2
- export declare const getVpc: GetEnvWithValue;
3
- export declare const getVpcSecurityGroup: GetEnvWithValue;
4
- export declare const getVpcSubnets: GetEnvWithValue;
1
+ export declare const getVpc: () => string;
2
+ export declare const getVpcSecurityGroup: () => string;
3
+ export declare const getVpcSubnets: () => string;