@ooneex/app-env 0.0.13 → 0.0.15
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/dist/index.js +2 -79
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,80 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { Exception } from "@ooneex/exception";
|
|
3
|
-
import { HttpStatus } from "@ooneex/http-status";
|
|
1
|
+
import{Exception as t}from"@ooneex/exception";import{HttpStatus as s}from"@ooneex/http-status";class o extends t{constructor(i,a={}){super(i,{status:s.Code.InternalServerError,data:a});this.name="AppEnvException"}}class n{env;isLocal;isDevelopment;isStaging;isTesting;isTest;isQa;isUat;isIntegration;isPreview;isDemo;isSandbox;isBeta;isCanary;isHotfix;isProduction;constructor(i){if(this.env=i,!this.env)throw new o("APP_ENV is not set");this.isLocal=this.env==="local",this.isDevelopment=this.env==="development",this.isStaging=this.env==="staging",this.isTesting=this.env==="testing",this.isTest=this.env==="test",this.isQa=this.env==="qa",this.isUat=this.env==="uat",this.isIntegration=this.env==="integration",this.isPreview=this.env==="preview",this.isDemo=this.env==="demo",this.isSandbox=this.env==="sandbox",this.isBeta=this.env==="beta",this.isCanary=this.env==="canary",this.isHotfix=this.env==="hotfix",this.isProduction=this.env==="production"}}var l;((e)=>{e.LOCAL="local";e.DEVELOPMENT="development";e.STAGING="staging";e.TESTING="testing";e.TEST="test";e.QA="qa";e.UAT="uat";e.INTEGRATION="integration";e.PREVIEW="preview";e.DEMO="demo";e.SANDBOX="sandbox";e.BETA="beta";e.CANARY="canary";e.HOTFIX="hotfix";e.PRODUCTION="production"})(l||={});export{l as Environment,o as AppEnvException,n as AppEnv};
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
constructor(message, data = {}) {
|
|
7
|
-
super(message, {
|
|
8
|
-
status: HttpStatus.Code.InternalServerError,
|
|
9
|
-
data
|
|
10
|
-
});
|
|
11
|
-
this.name = "AppEnvException";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// src/AppEnv.ts
|
|
16
|
-
class AppEnv {
|
|
17
|
-
env;
|
|
18
|
-
isLocal;
|
|
19
|
-
isDevelopment;
|
|
20
|
-
isStaging;
|
|
21
|
-
isTesting;
|
|
22
|
-
isTest;
|
|
23
|
-
isQa;
|
|
24
|
-
isUat;
|
|
25
|
-
isIntegration;
|
|
26
|
-
isPreview;
|
|
27
|
-
isDemo;
|
|
28
|
-
isSandbox;
|
|
29
|
-
isBeta;
|
|
30
|
-
isCanary;
|
|
31
|
-
isHotfix;
|
|
32
|
-
isProduction;
|
|
33
|
-
constructor(env) {
|
|
34
|
-
this.env = env;
|
|
35
|
-
if (!this.env) {
|
|
36
|
-
throw new AppEnvException("APP_ENV is not set");
|
|
37
|
-
}
|
|
38
|
-
this.isLocal = this.env === "local";
|
|
39
|
-
this.isDevelopment = this.env === "development";
|
|
40
|
-
this.isStaging = this.env === "staging";
|
|
41
|
-
this.isTesting = this.env === "testing";
|
|
42
|
-
this.isTest = this.env === "test";
|
|
43
|
-
this.isQa = this.env === "qa";
|
|
44
|
-
this.isUat = this.env === "uat";
|
|
45
|
-
this.isIntegration = this.env === "integration";
|
|
46
|
-
this.isPreview = this.env === "preview";
|
|
47
|
-
this.isDemo = this.env === "demo";
|
|
48
|
-
this.isSandbox = this.env === "sandbox";
|
|
49
|
-
this.isBeta = this.env === "beta";
|
|
50
|
-
this.isCanary = this.env === "canary";
|
|
51
|
-
this.isHotfix = this.env === "hotfix";
|
|
52
|
-
this.isProduction = this.env === "production";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// src/types.ts
|
|
56
|
-
var Environment;
|
|
57
|
-
((Environment2) => {
|
|
58
|
-
Environment2["LOCAL"] = "local";
|
|
59
|
-
Environment2["DEVELOPMENT"] = "development";
|
|
60
|
-
Environment2["STAGING"] = "staging";
|
|
61
|
-
Environment2["TESTING"] = "testing";
|
|
62
|
-
Environment2["TEST"] = "test";
|
|
63
|
-
Environment2["QA"] = "qa";
|
|
64
|
-
Environment2["UAT"] = "uat";
|
|
65
|
-
Environment2["INTEGRATION"] = "integration";
|
|
66
|
-
Environment2["PREVIEW"] = "preview";
|
|
67
|
-
Environment2["DEMO"] = "demo";
|
|
68
|
-
Environment2["SANDBOX"] = "sandbox";
|
|
69
|
-
Environment2["BETA"] = "beta";
|
|
70
|
-
Environment2["CANARY"] = "canary";
|
|
71
|
-
Environment2["HOTFIX"] = "hotfix";
|
|
72
|
-
Environment2["PRODUCTION"] = "production";
|
|
73
|
-
})(Environment ||= {});
|
|
74
|
-
export {
|
|
75
|
-
Environment,
|
|
76
|
-
AppEnvException,
|
|
77
|
-
AppEnv
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
//# debugId=CCF1842946E410DC64756E2164756E21
|
|
3
|
+
//# debugId=BB5FB3BC5D59A11664756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"import { AppEnvException } from \"./AppEnvException\";\nimport type { EnvType, IAppEnv } from \"./types\";\n\nexport class AppEnv implements IAppEnv {\n public readonly env: EnvType;\n public readonly isLocal: boolean;\n public readonly isDevelopment: boolean;\n public readonly isStaging: boolean;\n public readonly isTesting: boolean;\n public readonly isTest: boolean;\n public readonly isQa: boolean;\n public readonly isUat: boolean;\n public readonly isIntegration: boolean;\n public readonly isPreview: boolean;\n public readonly isDemo: boolean;\n public readonly isSandbox: boolean;\n public readonly isBeta: boolean;\n public readonly isCanary: boolean;\n public readonly isHotfix: boolean;\n public readonly isProduction: boolean;\n\n public constructor(env: EnvType) {\n this.env = env;\n\n if (!this.env) {\n throw new AppEnvException(\"APP_ENV is not set\");\n }\n\n this.isLocal = this.env === \"local\";\n this.isDevelopment = this.env === \"development\";\n this.isStaging = this.env === \"staging\";\n this.isTesting = this.env === \"testing\";\n this.isTest = this.env === \"test\";\n this.isQa = this.env === \"qa\";\n this.isUat = this.env === \"uat\";\n this.isIntegration = this.env === \"integration\";\n this.isPreview = this.env === \"preview\";\n this.isDemo = this.env === \"demo\";\n this.isSandbox = this.env === \"sandbox\";\n this.isBeta = this.env === \"beta\";\n this.isCanary = this.env === \"canary\";\n this.isHotfix = this.env === \"hotfix\";\n this.isProduction = this.env === \"production\";\n }\n}\n",
|
|
7
7
|
"export type AppEnvClassType = new (env: EnvType) => IAppEnv;\n\nexport enum Environment {\n LOCAL = \"local\",\n DEVELOPMENT = \"development\",\n STAGING = \"staging\",\n TESTING = \"testing\",\n TEST = \"test\",\n QA = \"qa\",\n UAT = \"uat\",\n INTEGRATION = \"integration\",\n PREVIEW = \"preview\",\n DEMO = \"demo\",\n SANDBOX = \"sandbox\",\n BETA = \"beta\",\n CANARY = \"canary\",\n HOTFIX = \"hotfix\",\n PRODUCTION = \"production\",\n}\n\nexport type EnvType = `${Environment}`;\n\nexport interface IAppEnv {\n readonly env: EnvType;\n readonly isLocal: boolean;\n readonly isDevelopment: boolean;\n readonly isStaging: boolean;\n readonly isTesting: boolean;\n readonly isTest: boolean;\n readonly isQa: boolean;\n readonly isUat: boolean;\n readonly isIntegration: boolean;\n readonly isPreview: boolean;\n readonly isDemo: boolean;\n readonly isSandbox: boolean;\n readonly isBeta: boolean;\n readonly isCanary: boolean;\n readonly isHotfix: boolean;\n readonly isProduction: boolean;\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": "AAAA,oBAAS,0BACT,qBAAS,4BAEF,MAAM,UAAwB,CAAU,CAC7C,WAAW,CAAC,EAAiB,EAAgC,CAAC,EAAG,CAC/D,MAAM,EAAS,CACb,OAAQ,EAAW,KAAK,oBACxB,MACF,CAAC,EACD,KAAK,KAAO,kBAEhB,CCRO,MAAM,CAA0B,CACrB,IACA,QACA,cACA,UACA,UACA,OACA,KACA,MACA,cACA,UACA,OACA,UACA,OACA,SACA,SACA,aAET,WAAW,CAAC,EAAc,CAG/B,GAFA,KAAK,IAAM,EAEP,CAAC,KAAK,IACR,MAAM,IAAI,EAAgB,oBAAoB,EAGhD,KAAK,QAAU,KAAK,MAAQ,QAC5B,KAAK,cAAgB,KAAK,MAAQ,cAClC,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,KAAO,KAAK,MAAQ,KACzB,KAAK,MAAQ,KAAK,MAAQ,MAC1B,KAAK,cAAgB,KAAK,MAAQ,cAClC,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,SAAW,KAAK,MAAQ,SAC7B,KAAK,SAAW,KAAK,MAAQ,SAC7B,KAAK,aAAe,KAAK,MAAQ,aAErC,CC1CO,IAAK,GAAL,CAAK,IAAL,CACL,QAAQ,QACR,cAAc,cACd,UAAU,UACV,UAAU,UACV,OAAO,OACP,KAAK,KACL,MAAM,MACN,cAAc,cACd,UAAU,UACV,OAAO,OACP,UAAU,UACV,OAAO,OACP,SAAS,SACT,SAAS,SACT,aAAa,eAfH",
|
|
10
|
+
"debugId": "BB5FB3BC5D59A11664756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/app-env",
|
|
3
3
|
"description": "Application environment configuration and management utilities for Ooneex framework",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"npm:publish": "bun publish --tolerate-republish --access public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ooneex/exception": "0.0.
|
|
32
|
-
"@ooneex/http-status": "0.0.
|
|
31
|
+
"@ooneex/exception": "0.0.13",
|
|
32
|
+
"@ooneex/http-status": "0.0.13"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {},
|
|
35
35
|
"keywords": [
|