@kibibit/configit 1.0.0-beta.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 kibibit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ <p align="center">
2
+ <a href="https://github.com/Kibibit/configit" target="blank"><img src="https://github.com/kibibit.png" width="150" ></a>
3
+ <h2 align="center">
4
+ @kibibit/configit
5
+ </h2>
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@kibibit/configit"><img src="https://img.shields.io/npm/v/@kibibit/configit/latest.svg?style=for-the-badge&logo=npm&color=CB3837"></a>
9
+ </p>
10
+ <p align="center">
11
+ <a href="https://github.com/semantic-release/semantic-release"><img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"></a>
12
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
13
+ <a href="#contributors-"><img src="https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square" alt="All Contributors"></a>
14
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
15
+ </p>
16
+ <p align="center">
17
+ A general typescript configuration service
18
+ </p>
19
+ <hr>
20
+
21
+ Unless forced to create a new service, this service will return the first created service
22
+
23
+ ### Usage
24
+
25
+ Create a new class to define your configuration.
26
+ The class should extend the `Config` class from this repo
27
+ ```typescript
28
+ import { Exclude, Expose } from 'class-transformer';
29
+ import { IsNumber, Validate, IsString, IsArray } from 'class-validator';
30
+ import { Config, JsonSchema } from '@kibibit/configit';
31
+
32
+ @Exclude()
33
+ export class ProjectConfig extends Config {
34
+ @Expose()
35
+ @IsNumber()
36
+ @Validate(JsonSchema, [
37
+ 'Server port'
38
+ ])
39
+ PORT: number;
40
+ }
41
+ ```
42
+ Then, in your code, initialize the config service when you bootstrap your application
43
+ ```typescript
44
+ import { ConfigService } from '@kibibit/configit';
45
+ import { ProjectConfig } from './project-config.model';
46
+ import express from "express";
47
+
48
+ export const configService = new ConfigService<ProjectConfig>(ProjectConfig);
49
+
50
+ console.log(configService.config.PORT);
51
+
52
+ const app = express();
53
+
54
+ app.get( "/", ( req, res ) => {
55
+ res.send( "Hello world!" );
56
+ } );
57
+
58
+ app.listen(configService.config.PORT, () => {
59
+ console.log( `server started at http://localhost:${ configService.config.PORT }` );
60
+ } );
61
+ ```
62
+
63
+ ## Contributors ✨
64
+
65
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
66
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
67
+ <!-- prettier-ignore-start -->
68
+ <!-- markdownlint-disable -->
69
+ <table>
70
+ <tr>
71
+ <td align="center"><a href="http://thatkookooguy.kibibit.io/"><img src="https://avatars3.githubusercontent.com/u/10427304?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Neil Kalman</b></sub></a><br /><a href="https://github.com/Kibibit/configit/commits?author=Thatkookooguy" title="Code">💻</a> <a href="https://github.com/Kibibit/configit/commits?author=Thatkookooguy" title="Documentation">📖</a> <a href="#design-Thatkookooguy" title="Design">🎨</a> <a href="#maintenance-Thatkookooguy" title="Maintenance">🚧</a> <a href="#infra-Thatkookooguy" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/Kibibit/configit/commits?author=Thatkookooguy" title="Tests">⚠️</a></td>
72
+ </tr>
73
+ </table>
74
+
75
+ <!-- markdownlint-restore -->
76
+ <!-- prettier-ignore-end -->
77
+
78
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
79
+
80
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!
81
+
82
+ ## Stay in touch
83
+
84
+ - Author - [Neil Kalman](https://github.com/thatkookooguy)
85
+ - Website - [https://github.com/kibibit](https://github.com/kibibit)
86
+ - StackOverflow - [thatkookooguy](https://stackoverflow.com/users/1788884/thatkookooguy)
87
+ - Twitter - [@thatkookooguy](https://twitter.com/thatkookooguy)
88
+ - Twitter - [@kibibit_opensrc](https://twitter.com/kibibit_opensrc)
@@ -0,0 +1,6 @@
1
+ import { ValidationError } from 'class-validator';
2
+ import KbError from '@kibibit/kb-error';
3
+ export declare class ConfigValidationError extends KbError {
4
+ constructor(validationErrors: ValidationError[]);
5
+ }
6
+ //# sourceMappingURL=config.errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.errors.d.ts","sourceRoot":"","sources":["../src/config.errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAExC,qBAAa,qBAAsB,SAAQ,OAAO;gBACpC,gBAAgB,EAAE,eAAe,EAAE;CAkBhD"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ConfigValidationError = void 0;
7
+ const colors_1 = require("colors");
8
+ const lodash_1 = require("lodash");
9
+ const kb_error_1 = __importDefault(require("@kibibit/kb-error"));
10
+ class ConfigValidationError extends kb_error_1.default {
11
+ constructor(validationErrors) {
12
+ const message = validationErrors
13
+ .map((validationError) => {
14
+ const deco = (0, colors_1.cyan)((0, lodash_1.times)(55, () => '=').join(''));
15
+ return [
16
+ '',
17
+ deco,
18
+ ` ${(0, colors_1.cyan)('property:')} ${validationError.property}`,
19
+ ` ${(0, colors_1.cyan)('value:')} ${(0, colors_1.red)(validationError.value)}`,
20
+ deco,
21
+ (0, lodash_1.values)(validationError.constraints)
22
+ .map((value) => ` - ${(0, colors_1.red)(value)}`).join('\n')
23
+ ].join('\n');
24
+ }).join('') + '\n\n';
25
+ super(message);
26
+ this.name = 'ConfigValidationError';
27
+ }
28
+ }
29
+ exports.ConfigValidationError = ConfigValidationError;
30
+ //# sourceMappingURL=config.errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.errors.js","sourceRoot":"","sources":["../src/config.errors.ts"],"names":[],"mappings":";;;;;;AACA,mCAAmC;AACnC,mCAAuC;AAEvC,iEAAwC;AAExC,MAAa,qBAAsB,SAAQ,kBAAO;IAChD,YAAY,gBAAmC;QAC7C,MAAM,OAAO,GAAG,gBAAgB;aAC7B,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,IAAA,aAAI,EAAC,IAAA,cAAK,EAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACjD,OAAO;gBACL,EAAE;gBACF,IAAI;gBACJ,IAAK,IAAA,aAAI,EAAC,WAAW,CAAE,IAAK,eAAe,CAAC,QAAS,EAAE;gBACvD,IAAK,IAAA,aAAI,EAAC,QAAQ,CAAE,IAAK,IAAA,YAAG,EAAC,eAAe,CAAC,KAAK,CAAE,EAAE;gBACtD,IAAI;gBACJ,IAAA,eAAM,EAAC,eAAe,CAAC,WAAW,CAAC;qBAChC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAU,IAAA,YAAG,EAAC,KAAK,CAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;aACtD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAnBD,sDAmBC"}
@@ -0,0 +1,8 @@
1
+ export declare const NODE_ENVIRONMENT_OPTIONS: string[];
2
+ export declare class Config {
3
+ NODE_ENV: string;
4
+ saveToFile: boolean;
5
+ constructor(partial?: Partial<Config>);
6
+ toJsonSchema(): import("openapi3-ts").SchemaObject;
7
+ }
8
+ //# sourceMappingURL=config.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.model.d.ts","sourceRoot":"","sources":["../src/config.model.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,wBAAwB,UAMpC,CAAC;AAEF,qBACa,MAAM;IAOjB,QAAQ,SAAiB;IAOzB,UAAU,UAAS;gBAEP,OAAO,GAAE,OAAO,CAAC,MAAM,CAAM;IAIlC,YAAY;CAwBpB"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Config = exports.NODE_ENVIRONMENT_OPTIONS = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
+ const lodash_1 = require("lodash");
17
+ const json_schema_validator_1 = require("./json-schema.validator");
18
+ exports.NODE_ENVIRONMENT_OPTIONS = [
19
+ 'google',
20
+ 'development',
21
+ 'production',
22
+ 'test',
23
+ 'devcontainer'
24
+ ];
25
+ let Config = class Config {
26
+ constructor(partial = {}) {
27
+ this.NODE_ENV = 'development';
28
+ this.saveToFile = false;
29
+ Object.assign(this, partial);
30
+ }
31
+ toJsonSchema() {
32
+ var _a, _b;
33
+ const configJsonSchemaObj = (0, class_validator_jsonschema_1.validationMetadatasToSchemas)({
34
+ additionalConverters: {
35
+ JsonSchema: (meta) => ({
36
+ description: meta.constraints.join('')
37
+ })
38
+ }
39
+ });
40
+ const classForSchema = (0, lodash_1.chain)(configJsonSchemaObj)
41
+ .keys()
42
+ .filter((className) => className !== 'Config')
43
+ .first()
44
+ .value();
45
+ const configJsonSchema = configJsonSchemaObj[classForSchema];
46
+ (_a = configJsonSchema.properties) === null || _a === void 0 ? true : delete _a.nodeEnv;
47
+ (_b = configJsonSchema.required) === null || _b === void 0 ? void 0 : _b.splice(configJsonSchema.required.indexOf('nodeEnv'), 1);
48
+ return configJsonSchema;
49
+ }
50
+ };
51
+ __decorate([
52
+ (0, class_transformer_1.Expose)(),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsIn)(exports.NODE_ENVIRONMENT_OPTIONS),
55
+ (0, class_validator_1.Validate)(json_schema_validator_1.JsonSchema, [
56
+ 'Tells which env file to use and what environment we are running on'
57
+ ]),
58
+ __metadata("design:type", Object)
59
+ ], Config.prototype, "NODE_ENV", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsBoolean)(),
62
+ (0, class_validator_1.Validate)(json_schema_validator_1.JsonSchema, [
63
+ 'Create a file made out of the internal config. This is mostly for ',
64
+ 'merging command line, environment, and file variables to a single instance'
65
+ ]),
66
+ __metadata("design:type", Object)
67
+ ], Config.prototype, "saveToFile", void 0);
68
+ Config = __decorate([
69
+ (0, class_transformer_1.Exclude)(),
70
+ __metadata("design:paramtypes", [Object])
71
+ ], Config);
72
+ exports.Config = Config;
73
+ //# sourceMappingURL=config.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.model.js","sourceRoot":"","sources":["../src/config.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAoD;AACpD,qDAKyB;AACzB,2EAA0E;AAC1E,mCAA+B;AAE/B,mEAAqD;AAExC,QAAA,wBAAwB,GAAG;IACtC,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,MAAM;IACN,cAAc;CACf,CAAC;AAGF,IAAa,MAAM,GAAnB,MAAa,MAAM;IAgBjB,YAAY,UAA2B,EAAE;QATzC,aAAQ,GAAG,aAAa,CAAC;QAOzB,eAAU,GAAG,KAAK,CAAC;QAGjB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,YAAY;;QACjB,MAAM,mBAAmB,GAAG,IAAA,yDAA4B,EAAC;YACvD,oBAAoB,EAAE;gBACpB,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBACrB,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;iBACvC,CAAC;aACH;SACF,CAAC,CAAC;QAEH,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,mBAAmB,CAAC;aAC9C,IAAI,EAAE;aACN,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,QAAQ,CAAC;aAC7C,KAAK,EAAE;aACP,KAAK,EAAE,CAAC;QACX,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEtD,MAAA,gBAAgB,CAAC,UAAU,+CAAE,OAAO,CAAC;QAC5C,MAAA,gBAAgB,CAAC,QAAQ,0CAAE,MAAM,CAC/B,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,EAC5C,CAAC,CACF,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF,CAAA;AArCC;IANC,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC,gCAAwB,CAAC;IAC9B,IAAA,0BAAQ,EAAC,kCAAU,EAAE;QACpB,oEAAoE;KACrE,CAAC;;wCACuB;AAOzB;IALC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,EAAC,kCAAU,EAAE;QACpB,oEAAoE;QACpE,4EAA4E;KAC7E,CAAC;;0CACiB;AAdR,MAAM;IADlB,IAAA,2BAAO,GAAE;;GACG,MAAM,CA4ClB;AA5CY,wBAAM"}
@@ -0,0 +1,25 @@
1
+ import { Config } from './config.model';
2
+ export interface IConfigServiceOptions {
3
+ convertToCamelCase?: boolean;
4
+ }
5
+ declare type TClass<T> = new (partial: Partial<T>) => T;
6
+ export declare class ConfigService<T extends Config> {
7
+ private readonly mode;
8
+ readonly options: IConfigServiceOptions;
9
+ readonly config?: T;
10
+ readonly genericClass?: TClass<T>;
11
+ readonly fileName?: string;
12
+ readonly jsonSchemaFullname?: string;
13
+ readonly defaultConfigFilePath?: string;
14
+ readonly configFileName: string;
15
+ readonly configFilePath?: string;
16
+ readonly configFileRoot?: string;
17
+ readonly appRoot: string;
18
+ constructor(givenClass: TClass<T>, passedConfig?: Partial<T>, options?: IConfigServiceOptions);
19
+ toPlainObject(): Record<string, any>;
20
+ private findRoot;
21
+ private findConfigRoot;
22
+ private validateInput;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=config.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.d.ts","sourceRoot":"","sources":["../src/config.service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAOD,aAAK,MAAM,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAQhD,qBAAa,aAAa,CAAC,CAAC,SAAS,MAAM;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAM;IACrC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAGvB,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EACrB,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EACzB,OAAO,GAAE,qBAA0B;IAuErC,aAAa;IAIb,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,aAAa;CAYtB"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ConfigService = void 0;
7
+ const path_1 = require("path");
8
+ const class_transformer_1 = require("class-transformer");
9
+ const class_validator_1 = require("class-validator");
10
+ const find_root_1 = __importDefault(require("find-root"));
11
+ const fs_extra_1 = require("fs-extra");
12
+ const lodash_1 = require("lodash");
13
+ const nconf_1 = __importDefault(require("nconf"));
14
+ const config_errors_1 = require("./config.errors");
15
+ const environment = (0, lodash_1.get)(process, 'env.NODE_ENV', 'development');
16
+ let configService;
17
+ class ConfigService {
18
+ constructor(givenClass, passedConfig, options = {}) {
19
+ this.mode = environment;
20
+ this.configFileName = '';
21
+ this.options = options;
22
+ this.appRoot = this.findRoot();
23
+ if (!passedConfig && configService) {
24
+ return configService;
25
+ }
26
+ this.genericClass = givenClass;
27
+ this.fileName = (0, lodash_1.chain)(this.genericClass.name)
28
+ .replace(/Config$/i, '')
29
+ .kebabCase()
30
+ .value();
31
+ this.jsonSchemaFullname = `.${this.fileName}.env.schema.json`;
32
+ this.configFileName = `${this.fileName}.${environment}.env.json`;
33
+ this.configFileRoot = this.findConfigRoot() || this.appRoot;
34
+ this.defaultConfigFilePath = (0, path_1.join)(this.configFileRoot, 'defaults.env.json');
35
+ this.configFilePath = (0, path_1.join)(this.configFileRoot, `${this.fileName}.${environment}.env.json`);
36
+ nconf_1.default
37
+ .argv({
38
+ parseValues: true
39
+ })
40
+ .env({
41
+ parseValues: true,
42
+ transform: this.options.convertToCamelCase ?
43
+ transformToCamelCase :
44
+ null
45
+ })
46
+ .file('defaults', { file: this.defaultConfigFilePath })
47
+ .file('environment', { file: this.configFilePath });
48
+ const config = passedConfig || nconf_1.default.get();
49
+ const envConfig = this.validateInput(config);
50
+ this.config = new this.genericClass(envConfig);
51
+ if (config.saveToFile || config.init) {
52
+ const plainConfig = (0, class_transformer_1.classToPlain)(this.config);
53
+ plainConfig.$schema = `./${this.jsonSchemaFullname}`;
54
+ const orderedKeys = (0, lodash_1.chain)(plainConfig)
55
+ .keys()
56
+ .sort()
57
+ .without('NODE_ENV')
58
+ .reduce((obj, key) => {
59
+ obj[key] = plainConfig[key];
60
+ return obj;
61
+ }, {})
62
+ .value();
63
+ console.log(orderedKeys);
64
+ (0, fs_extra_1.writeJson)(this.configFilePath, orderedKeys, { spaces: 2 });
65
+ }
66
+ const schema = this.config.toJsonSchema();
67
+ const schemaFullPath = (0, path_1.join)(this.configFileRoot, '/', this.jsonSchemaFullname);
68
+ (0, fs_extra_1.writeJSONSync)(schemaFullPath, schema);
69
+ configService = this;
70
+ }
71
+ toPlainObject() {
72
+ return (0, class_transformer_1.classToPlain)(this);
73
+ }
74
+ findRoot() {
75
+ return (0, find_root_1.default)(process.cwd(), (dir) => {
76
+ const packagePath = (0, path_1.join)(dir, 'package.json');
77
+ const isPackageJsonExists = (0, fs_extra_1.pathExistsSync)(packagePath);
78
+ if (isPackageJsonExists) {
79
+ const packageContent = (0, fs_extra_1.readJSONSync)(packagePath, { encoding: 'utf8' });
80
+ if (![''].includes(packageContent.name)) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ });
86
+ }
87
+ findConfigRoot() {
88
+ try {
89
+ return (0, find_root_1.default)(process.cwd(), (dir) => {
90
+ const fileNames = (0, fs_extra_1.readdirSync)(dir);
91
+ const isConfigFileExists = fileNames.includes(this.configFileName);
92
+ return isConfigFileExists;
93
+ });
94
+ }
95
+ catch (error) {
96
+ return this.findRoot();
97
+ }
98
+ }
99
+ validateInput(envConfig) {
100
+ if (!this.genericClass)
101
+ throw new Error('something went wrong');
102
+ const configInstance = new this.genericClass(envConfig);
103
+ const validationErrors = (0, class_validator_1.validateSync)(configInstance);
104
+ if (validationErrors.length > 0) {
105
+ throw new config_errors_1.ConfigValidationError(validationErrors);
106
+ }
107
+ return (0, class_transformer_1.classToPlain)(configInstance);
108
+ }
109
+ }
110
+ exports.ConfigService = ConfigService;
111
+ function transformToCamelCase(obj) {
112
+ const camelCasedKey = (0, lodash_1.camelCase)(obj.key);
113
+ obj.key = camelCasedKey;
114
+ return camelCasedKey && obj;
115
+ }
116
+ //# sourceMappingURL=config.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.js","sourceRoot":"","sources":["../src/config.service.ts"],"names":[],"mappings":"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"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './config.service';
2
+ export * from './config.errors';
3
+ export * from './config.model';
4
+ export * from './json-schema.validator';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./config.service"), exports);
14
+ __exportStar(require("./config.errors"), exports);
15
+ __exportStar(require("./config.model"), exports);
16
+ __exportStar(require("./json-schema.validator"), exports);
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC;AACjC,kDAAgC;AAChC,iDAA+B;AAC/B,0DAAwC"}
@@ -0,0 +1,6 @@
1
+ import { ValidatorConstraintInterface } from 'class-validator';
2
+ export declare class JsonSchema implements ValidatorConstraintInterface {
3
+ validate(): boolean;
4
+ defaultMessage(): string;
5
+ }
6
+ //# sourceMappingURL=json-schema.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.validator.d.ts","sourceRoot":"","sources":["../src/json-schema.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AAEzB,qBACa,UAAW,YAAW,4BAA4B;IAC7D,QAAQ;IAIR,cAAc;CAGf"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.JsonSchema = void 0;
10
+ const class_validator_1 = require("class-validator");
11
+ let JsonSchema = class JsonSchema {
12
+ validate() {
13
+ return true;
14
+ }
15
+ defaultMessage() {
16
+ return '';
17
+ }
18
+ };
19
+ JsonSchema = __decorate([
20
+ (0, class_validator_1.ValidatorConstraint)({ name: 'JsonSchema', async: false })
21
+ ], JsonSchema);
22
+ exports.JsonSchema = JsonSchema;
23
+ //# sourceMappingURL=json-schema.validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.validator.js","sourceRoot":"","sources":["../src/json-schema.validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAGyB;AAGzB,IAAa,UAAU,GAAvB,MAAa,UAAU;IACrB,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAA;AARY,UAAU;IADtB,IAAA,qCAAmB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;GAC7C,UAAU,CAQtB;AARY,gCAAU"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../node_modules/class-validator/types/validation/ValidationError.d.ts","../node_modules/class-validator/types/validation/ValidatorOptions.d.ts","../node_modules/class-validator/types/validation-schema/ValidationSchema.d.ts","../node_modules/class-validator/types/container.d.ts","../node_modules/class-validator/types/validation/ValidationArguments.d.ts","../node_modules/class-validator/types/decorator/ValidationOptions.d.ts","../node_modules/class-validator/types/decorator/common/Allow.d.ts","../node_modules/class-validator/types/decorator/common/IsDefined.d.ts","../node_modules/class-validator/types/decorator/common/IsOptional.d.ts","../node_modules/class-validator/types/decorator/common/Validate.d.ts","../node_modules/class-validator/types/validation/ValidatorConstraintInterface.d.ts","../node_modules/class-validator/types/decorator/common/ValidateBy.d.ts","../node_modules/class-validator/types/decorator/common/ValidateIf.d.ts","../node_modules/class-validator/types/decorator/common/ValidateNested.d.ts","../node_modules/class-validator/types/decorator/common/ValidatePromise.d.ts","../node_modules/class-validator/types/decorator/common/IsLatLong.d.ts","../node_modules/class-validator/types/decorator/common/IsLatitude.d.ts","../node_modules/class-validator/types/decorator/common/IsLongitude.d.ts","../node_modules/class-validator/types/decorator/common/Equals.d.ts","../node_modules/class-validator/types/decorator/common/NotEquals.d.ts","../node_modules/class-validator/types/decorator/common/IsEmpty.d.ts","../node_modules/class-validator/types/decorator/common/IsNotEmpty.d.ts","../node_modules/class-validator/types/decorator/common/IsIn.d.ts","../node_modules/class-validator/types/decorator/common/IsNotIn.d.ts","../node_modules/class-validator/types/decorator/number/IsDivisibleBy.d.ts","../node_modules/class-validator/types/decorator/number/IsPositive.d.ts","../node_modules/class-validator/types/decorator/number/IsNegative.d.ts","../node_modules/class-validator/types/decorator/number/Max.d.ts","../node_modules/class-validator/types/decorator/number/Min.d.ts","../node_modules/class-validator/types/decorator/date/MinDate.d.ts","../node_modules/class-validator/types/decorator/date/MaxDate.d.ts","../node_modules/class-validator/types/decorator/string/Contains.d.ts","../node_modules/class-validator/types/decorator/string/NotContains.d.ts","../node_modules/@types/validator/index.d.ts","../node_modules/class-validator/types/decorator/string/IsAlpha.d.ts","../node_modules/class-validator/types/decorator/string/IsAlphanumeric.d.ts","../node_modules/class-validator/types/decorator/string/IsDecimal.d.ts","../node_modules/class-validator/types/decorator/string/IsAscii.d.ts","../node_modules/class-validator/types/decorator/string/IsBase64.d.ts","../node_modules/class-validator/types/decorator/string/IsByteLength.d.ts","../node_modules/class-validator/types/decorator/string/IsCreditCard.d.ts","../node_modules/class-validator/types/decorator/string/IsCurrency.d.ts","../node_modules/class-validator/types/decorator/string/IsEmail.d.ts","../node_modules/class-validator/types/decorator/string/IsFQDN.d.ts","../node_modules/class-validator/types/decorator/string/IsFullWidth.d.ts","../node_modules/class-validator/types/decorator/string/IsHalfWidth.d.ts","../node_modules/class-validator/types/decorator/string/IsVariableWidth.d.ts","../node_modules/class-validator/types/decorator/string/IsHexColor.d.ts","../node_modules/class-validator/types/decorator/string/IsHexadecimal.d.ts","../node_modules/class-validator/types/decorator/string/IsMacAddress.d.ts","../node_modules/class-validator/types/decorator/string/IsIP.d.ts","../node_modules/class-validator/types/decorator/string/IsPort.d.ts","../node_modules/class-validator/types/decorator/string/IsISBN.d.ts","../node_modules/class-validator/types/decorator/string/IsISIN.d.ts","../node_modules/class-validator/types/decorator/string/IsISO8601.d.ts","../node_modules/class-validator/types/decorator/string/IsJSON.d.ts","../node_modules/class-validator/types/decorator/string/IsJWT.d.ts","../node_modules/class-validator/types/decorator/string/IsLowercase.d.ts","../node_modules/class-validator/types/decorator/string/IsMobilePhone.d.ts","../node_modules/class-validator/types/decorator/string/IsISO31661Alpha2.d.ts","../node_modules/class-validator/types/decorator/string/IsISO31661Alpha3.d.ts","../node_modules/class-validator/types/decorator/string/IsMongoId.d.ts","../node_modules/class-validator/types/decorator/string/IsMultibyte.d.ts","../node_modules/class-validator/types/decorator/string/IsSurrogatePair.d.ts","../node_modules/class-validator/types/decorator/string/IsUrl.d.ts","../node_modules/class-validator/types/decorator/string/IsUUID.d.ts","../node_modules/class-validator/types/decorator/string/IsFirebasePushId.d.ts","../node_modules/class-validator/types/decorator/string/IsUppercase.d.ts","../node_modules/class-validator/types/decorator/string/Length.d.ts","../node_modules/class-validator/types/decorator/string/MaxLength.d.ts","../node_modules/class-validator/types/decorator/string/MinLength.d.ts","../node_modules/class-validator/types/decorator/string/Matches.d.ts","../node_modules/libphonenumber-js/types.d.ts","../node_modules/libphonenumber-js/index.d.ts","../node_modules/class-validator/types/decorator/string/IsPhoneNumber.d.ts","../node_modules/class-validator/types/decorator/string/IsMilitaryTime.d.ts","../node_modules/class-validator/types/decorator/string/IsHash.d.ts","../node_modules/class-validator/types/decorator/string/IsISSN.d.ts","../node_modules/class-validator/types/decorator/string/IsDateString.d.ts","../node_modules/class-validator/types/decorator/string/IsBooleanString.d.ts","../node_modules/class-validator/types/decorator/string/IsNumberString.d.ts","../node_modules/class-validator/types/decorator/string/IsBase32.d.ts","../node_modules/class-validator/types/decorator/string/IsBIC.d.ts","../node_modules/class-validator/types/decorator/string/IsBtcAddress.d.ts","../node_modules/class-validator/types/decorator/string/IsDataURI.d.ts","../node_modules/class-validator/types/decorator/string/IsEAN.d.ts","../node_modules/class-validator/types/decorator/string/IsEthereumAddress.d.ts","../node_modules/class-validator/types/decorator/string/IsHSL.d.ts","../node_modules/class-validator/types/decorator/string/IsIBAN.d.ts","../node_modules/class-validator/types/decorator/string/IsIdentityCard.d.ts","../node_modules/class-validator/types/decorator/string/IsISRC.d.ts","../node_modules/class-validator/types/decorator/string/IsLocale.d.ts","../node_modules/class-validator/types/decorator/string/IsMagnetURI.d.ts","../node_modules/class-validator/types/decorator/string/IsMimeType.d.ts","../node_modules/class-validator/types/decorator/string/IsOctal.d.ts","../node_modules/class-validator/types/decorator/string/IsPassportNumber.d.ts","../node_modules/class-validator/types/decorator/string/IsPostalCode.d.ts","../node_modules/class-validator/types/decorator/string/IsRFC3339.d.ts","../node_modules/class-validator/types/decorator/string/IsRgbColor.d.ts","../node_modules/class-validator/types/decorator/string/IsSemVer.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsBoolean.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsDate.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsNumber.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsEnum.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsInt.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsString.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsArray.d.ts","../node_modules/class-validator/types/decorator/typechecker/IsObject.d.ts","../node_modules/class-validator/types/decorator/array/ArrayContains.d.ts","../node_modules/class-validator/types/decorator/array/ArrayNotContains.d.ts","../node_modules/class-validator/types/decorator/array/ArrayNotEmpty.d.ts","../node_modules/class-validator/types/decorator/array/ArrayMinSize.d.ts","../node_modules/class-validator/types/decorator/array/ArrayMaxSize.d.ts","../node_modules/class-validator/types/decorator/array/ArrayUnique.d.ts","../node_modules/class-validator/types/decorator/object/IsNotEmptyObject.d.ts","../node_modules/class-validator/types/decorator/object/IsInstance.d.ts","../node_modules/class-validator/types/decorator/decorators.d.ts","../node_modules/class-validator/types/validation/ValidationTypes.d.ts","../node_modules/class-validator/types/validation/Validator.d.ts","../node_modules/class-validator/types/register-decorator.d.ts","../node_modules/class-validator/types/metadata/ValidationMetadataArgs.d.ts","../node_modules/class-validator/types/metadata/ValidationMetadata.d.ts","../node_modules/class-validator/types/metadata/ConstraintMetadata.d.ts","../node_modules/class-validator/types/metadata/MetadataStorage.d.ts","../node_modules/class-validator/types/index.d.ts","../node_modules/colors/index.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@kibibit/kb-error/kb-error.d.ts","../src/config.errors.ts","../node_modules/class-transformer/types/interfaces/decorator-options/expose-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/decorator-options/exclude-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/decorator-options/transform-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/decorator-options/type-discriminator-descriptor.interface.d.ts","../node_modules/class-transformer/types/interfaces/decorator-options/type-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/metadata/exclude-metadata.interface.d.ts","../node_modules/class-transformer/types/interfaces/metadata/expose-metadata.interface.d.ts","../node_modules/class-transformer/types/enums/transformation-type.enum.d.ts","../node_modules/class-transformer/types/enums/index.d.ts","../node_modules/class-transformer/types/interfaces/target-map.interface.d.ts","../node_modules/class-transformer/types/interfaces/class-transformer-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/metadata/transform-fn-params.interface.d.ts","../node_modules/class-transformer/types/interfaces/metadata/transform-metadata.interface.d.ts","../node_modules/class-transformer/types/interfaces/metadata/type-metadata.interface.d.ts","../node_modules/class-transformer/types/interfaces/class-constructor.type.d.ts","../node_modules/class-transformer/types/interfaces/type-help-options.interface.d.ts","../node_modules/class-transformer/types/interfaces/index.d.ts","../node_modules/class-transformer/types/ClassTransformer.d.ts","../node_modules/class-transformer/types/decorators/exclude.decorator.d.ts","../node_modules/class-transformer/types/decorators/expose.decorator.d.ts","../node_modules/class-transformer/types/decorators/transform-class-to-class.decorator.d.ts","../node_modules/class-transformer/types/decorators/transform-class-to-plain.decorator.d.ts","../node_modules/class-transformer/types/decorators/transform-plain-to-class.decorator.d.ts","../node_modules/class-transformer/types/decorators/transform.decorator.d.ts","../node_modules/class-transformer/types/decorators/type.decorator.d.ts","../node_modules/class-transformer/types/decorators/index.d.ts","../node_modules/class-transformer/types/index.d.ts","../node_modules/openapi3-ts/dist/model/SpecificationExtension.d.ts","../node_modules/openapi3-ts/dist/model/OpenApi.d.ts","../node_modules/openapi3-ts/dist/model/Server.d.ts","../node_modules/openapi3-ts/dist/model/index.d.ts","../node_modules/openapi3-ts/dist/dsl/OpenApiBuilder.d.ts","../node_modules/openapi3-ts/dist/dsl/index.d.ts","../node_modules/openapi3-ts/dist/index.d.ts","../node_modules/class-transformer/types/MetadataStorage.d.ts","../node_modules/reflect-metadata/index.d.ts","../node_modules/class-validator-jsonschema/build/defaultConverters.d.ts","../node_modules/class-validator-jsonschema/build/options.d.ts","../node_modules/class-validator-jsonschema/build/decorators.d.ts","../node_modules/class-validator-jsonschema/build/index.d.ts","../src/json-schema.validator.ts","../src/config.model.ts","../node_modules/@types/find-root/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/fs-extra/index.d.ts","../node_modules/@types/nconf/index.d.ts","../src/config.service.ts","../src/index.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/minimist/index.d.ts","../node_modules/@types/normalize-package-data/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/retry/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"e34eb9339171ec45da2801c1967e4d378bd61a1dceaa1b1b4e1b6d28cb9ca962","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","e69d0b59db23f59172cb087ee44a71438f809bd214d4f4105abd6090b341cbdc","d5c1d4db425938fb1e0ff528b3edb945d4d851c001ab6e1528c62eb16813d96e","86f89124a90fae1b90421bcce1e0ba58614383ca72403bfc03ff89761b050a4d","5a6fbec8c8e62c37e9685a91a6ef0f6ecaddb1ee90f7b2c2b71b454b40a0d9a6","e7435f2f56c50688250f3b6ef99d8f3a1443f4e3d65b4526dfb31dfd4ba532f8","6fc56a681a637069675b2e11b4aa105efe146f7a88876f23537e9ea139297cf9","33b7f4106cf45ae7ccbb95acd551e9a5cd3c27f598d48216bda84213b8ae0c7e","542c82f0d719084ec6dde3ce4a69be8db0f5fa3ea1e38129f95ee6897b82de78","c5079a23a0200a682ec3db25bc789d6cee4275b676a86ec1a3964d919b977e6a","8bcb884d06860a129dbffa3500d51116d9d1040bb3bf1c9762eb2f1e7fd5c85c","e55c0f31407e1e4eee10994001a4f570e1817897a707655f0bbe4d4a66920e9e","a37c2194c586faa8979f50a5c5ca165b0903d31ee62a9fe65e4494aa099712c0","6602339ddc9cd7e54261bda0e70fb356d9cdc10e3ec7feb5fa28982f8a4d9e34","7ffaa736b8a04b0b8af66092da536f71ef13a5ef0428c7711f32b94b68f7c8c8","7b4930d666bbe5d10a19fcc8f60cfa392d3ad3383b7f61e979881d2c251bc895","46342f04405a2be3fbfb5e38fe3411325769f14482b8cd48077f2d14b64abcfb","8fa675c4f44e6020328cf85fdf25419300f35d591b4f56f56e00f9d52b6fbb3b","ba98f23160cfa6b47ee8072b8f54201f21a1ee9addc2ef461ebadf559fe5c43a","45a4591b53459e21217dc9803367a651e5a1c30358a015f27de0b3e719db816b","9ef22bee37885193b9fae7f4cad9502542c12c7fe16afe61e826cdd822643d84","b0451895b894c102eed19d50bd5fcb3afd116097f77a7d83625624fafcca8939","bce17120b679ff4f1be70f5fe5c56044e07ed45f1e555db6486c6ded8e1da1c8","7590477bfa2e309e677ff7f31cb466f377fcd0e10a72950439c3203175309958","3f9ebd554335d2c4c4e7dc67af342d37dc8f2938afa64605d8a93236022cc8a5","1c077c9f6c0bc02a36207994a6e92a8fbf72d017c4567f640b52bf32984d2392","600b42323925b32902b17563654405968aa12ee39e665f83987b7759224cc317","32c8f85f6b4e145537dfe61b94ddd98b47dbdd1d37dc4b7042a8d969cd63a1aa","0da77bc7e34afccd7d35dcc0d99db05b56235a536c69082c15f2a07ceb7ceae0","f364fb93abf1e50fa93e38b4cb32c99adb43e8c8044482da5b9bf29aa27eaf75","a460b56ced5a21969a819245f9f36b2b55aa2129e87159957d400d3dc0847529","e53e817cec71dc843700a1571356271d3e13abf8cb9d32f33b4a214c6dcdd1e0","252eb4750d0439d1674ad0dc30d2a2a3e4655e08ad9e58a7e236b21e78d1d540","e344b4a389bb2dfa98f144f3f195387a02b6bdb69deed4a96d16cc283c567778","40bc9bf6808edd4fed3703f1ce7b50f1eb9124d2ac168f85fc4adbb4bd77e291","d618d077158335a50ae6bb789d93dd29b62f930195a2e909e94f0afadad5680a","ae0eeabdb4b4129356ba04ce086c675af383a9ab2b275950d73067842ccd91e4","54f664311746f12a5b0b93a6a58b12a52660e3ff74f06aa0e9c275f46bd22d0e","506bc8f4d2d639bebb120e18d3752ddeee11321fd1070ad2ce05612753c628d6","4069e28d9ec7bb86c714d2d11b5811ebca88c114c12df3fb56b8fec4423dcf18","1977f62a560f3b0fc824281fd027a97ce06c4b2d47b408f3a439c29f1e9f7e10","627570f2487bd8d899dd4f36ecb20fe0eb2f8c379eff297e24caba0c985a6c43","445bbd11741254b30eb904776cbebc72b9d13b35e6a04a0dda331a7bbafe2428","85c9be6b38726347f80c528c950302900db744b558a95206c4de12e1d99b2dee","735baa325c8211ac962fa5927fa69d3702666d1247ceb16bf94c789ccd7bef26","9e82194af3a7d314ccbc64bb94bfb62f4bfea047db3422a7f6c5caf2d06540a9","c32373a44722e84517acd1f923284ce32514fecf3dd93cc5ae52111dc6aa682a","952a9eab21103b79b7a6cca8ad970c3872883aa71273f540285cad360c35da40","8ba48776335db39e0329018c04486907069f3d7ee06ce8b1a6134b7d745271cc","e6d5809e52ed7ef1860d1c483e005d1f71bab36772ef0fd80d5df6db1da0e815","6ee38318bdaa2852d9309e92842f099a9f40c5d3c5aff3833066c02ffd42dade","12ae46c46c5e2405ad3d7e96e2638f1d183095fa8cf8a876d3b3b4d6ba985f5b","e4b1e912737472765e6d2264b8721995f86a463a1225f5e2a27f783ecc013a7b","da09c0171b55ccdf5329e38c5249c0878e7aec151c2a4390c630a2bc1383e768","c40d552bd2a4644b0617ec2f0f1c58618a25d098d2d4aa7c65fb446f3c305b54","ecb4c715f74eb8b0e289c87483f8a4933dfa566f0745b4c86231a077e2f13fea","424ddba00938bb9ae68138f1d03c669f43556fc3e9448ed676866c864ca3f1d6","a0fe12181346c8404aab9d9a938360133b770a0c08b75a2fce967d77ca4b543f","3cc6eb7935ff45d7628b93bb6aaf1a32e8cb3b24287f9e75694b607484b377b3","51451e948351903941a53ed002977984413a3e6a24f748339dd1ed156a6122bf","efd463021ccc91579ed8ae62584176baab2cd407c555c69214152480531a2072","29647c3b79320cfeecb5862e1f79220e059b26db2be52ea256df9cf9203fb401","e8cdefd2dc293cb4866ee8f04368e7001884650bb0f43357c4fe044cc2e1674f","582a3578ebba9238eb0c5d30b4d231356d3e8116fea497119920208fb48ccf85","185eae4a1e8a54e38f36cd6681cfa54c975a2fc3bc2ba6a39bf8163fac85188d","e6e7ac06b50b2693488813f8de73613934d9aa2eb355cdffd2ef898db60c9af1","5b504f247d6388daa92ffb5bbd3ffc5fc5a1ebd3ff928f90b6285b620455dd04","cee72255e129896f0240ceb58c22e207b83d2cc81d8446190d1b4ef9b507ccd6","3b54670e11a8d3512f87e46645aa9c83ae93afead4a302299a192ac5458aa586","c2fc4d3a130e9dc0e40f7e7d192ef2494a39c37da88b5454c8adf143623e5979","2e693158fc1eedba3a5766e032d3620c0e9c8ad0418e4769be8a0f103fdb52cd","516275ccf3e66dc391533afd4d326c44dd750345b68bb573fc592e4e4b74545f","07c342622568693847f6cb898679402dd19740f815fd43bec996daf24a1e2b85","897f03cf3040a245761fb2e58c91bcdbc72ecab0499d7d95744142e2ba66e841","617e6438440c7634c2e25f43d3becc1eaac129e5f2b311be56f70025d281ec4b","6aacd53b14c96a0cd21435cae68eabe6d9a3d78dc5442ec6edcf391efd7989ef","a4096686f982f6977433ee9759ecbef49da29d7e6a5d8278f0fbc7b9f70fce12","2eb279b2ae63cf59b419eb41c4ccd8f0850a7114c0a6a0da386286799f62c38b","9c9b902ae773d4c1ca6bb8f05e06b1dc6ffe7514463e3ee9b9e28153014836ee","86df53d43eccf5f18b4bc8f876932bd8a4a2a9601eb06bbba13f937f3b2a2377","2147f8d114cf58c05106c3dccea9924d069c69508b5980ed4011d2b648af2ffe","edb8332e0c7c7ec8f8f321c96d29c80d5e90de63efdb1b96ad8299d383d4b6b9","fe61f001bd4bd0a374daa75a2ba6d1bb12c849060a607593a3d9a44e6b1df590","cfe8221c909ad721b3da6080570553dea2f0e729afbdbcf2c141252cf22f39b5","34e89249b6d840032b9acdec61d136877f84f2cd3e3980355b8a18f119809956","6f36ff8f8a898184277e7c6e3bf6126f91c7a8b6a841f5b5e6cb415cfc34820e","4b6378c9b1b3a2521316c96f5c777e32a1b14d05b034ccd223499e26de8a379c","07be5ae9bf5a51f3d98ffcfacf7de2fe4842a7e5016f741e9fad165bb929be93","cb1b37eda1afc730d2909a0f62cac4a256276d5e62fea36db1473981a5a65ab1","195f855b39c8a6e50eb1f37d8f794fbd98e41199dffbc98bf629506b6def73d7","da32b37d9dec18a1e66ce7a540c1a466c0a7499a02819a78c049810f8c80ec8f","108314a60f3cb2454f2d889c1fb8b3826795399e5d92e87b2918f14d70c01e69","d75cc838286d6b1260f0968557cd5f28495d7341c02ac93989fb5096deddfb47","d531dc11bb3a8a577bd9ff83e12638098bfc9e0856b25852b91aac70b0887f2a","19968b998a2ab7dfd39de0c942fc738b2b610895843fec25477bc393687babd8","c0e6319f0839d76beed6e37b45ec4bb80b394d836db308ae9db4dea0fe8a9297","1a7b11be5c442dab3f4af9faf20402798fddf1d3c904f7b310f05d91423ba870","48709e4ac55179f5f6789207691759f44e8e0d2bfbadd1ceecb93d4123a12cef","2c817fa37b3d2aa72f01ce4d3f93413a7fbdecafe1b9fb7bd7baaa1bbd46eb08","682203aed293a0986cc2fccc6321d862742b48d7359118ac8f36b290d28920d2","7406d75a4761b34ce126f099eafe6643b929522e9696e5db5043f4e5c74a9e40","ad74043d72ed605cecf58a589112083c78dfd97452b80cd0a81b31c57976af12","9bc363b91528a169b3d9451fba33f865c339a3397da80a44a754547962f4a210","64efb52cb6cf86c8a05ceec920db05f9ebdaac4dff5980d9a62227eb6d2ebc11","3286cf198cf5f068cd74cb0b6648c8cba440dade2fc55eb819e50e5ea9b3f92e","16a6d4efcce5bb20d42134ce52855a46cd4783668c6d6a67a86397eb670ad0d2","46bd71615bdf9bfa8499b9cfce52da03507f7140c93866805d04155fa19caa1b","334b49c56ad2d1285a113ae3df77733d304853afcf7328367f320934e37559af","a0e74be326371c0d49be38e1ca065441fb587c26ca49772d1c96db7b77a1bb14","bb1e5cf70d99c277c9f1fe7a216b527dd6bd2f26b307a8ab65d24248fb3319f5","817547eacf93922e22570ba411f23e9164544dead83e379c7ae9c1cfc700c2cf","a728478cb11ab09a46e664c0782610d7dd5c9db3f9a249f002c92918ca0308f7","9e91ef9c3e057d6d9df8bcbfbba0207e83ef9ab98aa302cf9223e81e32fdfe8d","66d30ef7f307f95b3f9c4f97e6c1a5e4c462703de03f2f81aca8a1a2f8739dbd","0f562669bc473ed1e1e2804f12d09831e6bf506181d7684fb386f60f22989057","90a4be0e17ba5824558c38c93894e7f480b3adf5edd1fe04877ab56c56111595","fadd55cddab059940934df39ce2689d37110cfe37cc6775f06b0e8decf3092d7","9115cfffd8ea095accd6edf950d4bdfabbd5118e7604be2e13fe07150344bb9d","b4f3b4e20e2193179481ab325b8bd0871b986e1e8a8ed2961ce020c2dba7c02d","41744c67366a0482db029a21f0df4b52cd6f1c85cbc426b981b83b378ccb6e65","c3f3cf7561dd31867635c22f3c47c8491af4cfa3758c53e822a136828fc24e5d","1a3f603fedd85d20c65eb7ca522dd6f0e264dbb6e1bfa9fb4f214f2e61b8bdf8","82a74e031ab992424f8874ceacbb43ad33bdcf69538a0fbddc28145e54980f5a","5515f17f45c6aafe6459afa3318bba040cb466a8d91617041566808a5fd77a44","4df1f0c17953b0450aa988c9930061f8861b114e1649e1a16cfd70c5cbdf8d83","441104b363d80fe57eb79a50d495e0b7e3ebeb45a5f0d1a4067d71ef75e8fbfa",{"version":"a17e831d16c27cbe4d6f0bb238c1ded0d4a26c282009e431c68733be0b792f4f","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","378df8bbbb9e3f6fca05d58f644aab538e1062eab5e778fb0b83d41125df246d","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"b8a2bb4b300024556529bf35365c9eb87b931d9564215f125c93d7a9985339f6","b9a9b74132eaf7629893ca39c9048b839800ff68f411f312ccaf1362b1970f8f","f11f9ebb146ec035ab0e81a0ccb25264a5ca094dfeb0e69cb319d340a16966f6","5d470930bf6142d7cbda81c157869024527dc7911ba55d90b8387ef6e1585aa1","01897098acd104c4af64e96f92a826a5875a85ecc72d91dc634bf0d69289ebc1","b7e6a6a3495301360edb9e1474702db73d18be7803b3f5c6c05571212acccd16","aa7527285c94043f21baf6e337bc60a92c20b6efaa90859473f6476954ac5f79","dd3be6d9dcd79e46d192175a756546630f2dc89dab28073823c936557b977f26","8d0566152618a1da6536c75a5659c139522d67c63a9ae27e8228d76ab0420584","ba06bf784edafe0db0e2bd1f6ecf3465b81f6b1819871bf190a0e0137b5b7f18","a0500233cb989bcb78f5f1a81f51eabc06b5c39e3042c560a7489f022f1f55a3","220508b3fb6b773f49d8fb0765b04f90ef15caacf0f3d260e3412ed38f71ef09","cdc28bdf0971731024c1ae0fd739e2e3411d460d9c9ae055ac28777f248dfba6","e56427c055602078cbf0e58e815960541136388f4fc62554813575508def98b6","1f58b0676a80db38df1ce19d15360c20ce9e983b35298a5d0b4aa4eb4fb67e0f","3d67e7eb73c6955ee27f1d845cae88923f75c8b0830d4b5440eea2339958e8ec","11fec302d58b56033ab07290a3abc29e9908e29d504db9468544b15c4cd7670d","c66d6817c931633650edf19a8644eea61aeeb84190c7219911cefa8ddea8bd9a","ab1359707e4fc610c5f37f1488063af65cda3badca6b692d44b95e8380e0f6c2","11f8380b827bc4bd2665651f1f6874ba4e6e5b498873ab9f376da576ff58aa7d","d80ffdd55e7f4bc69cde66933582b8592d3736d3b0d1d8cc63995a7b2bcca579","c9b71952b2178e8737b63079dba30e1b29872240b122905cbaba756cb60b32f5","d214bc31793fb7ff77032308ac53f5e73260a77aecc1ac9fd276dff030c9281f","da1fbedeb2962d086e3398b1ac87976d6f1282cb3e5e87c1336aa46d69c2c1cc","20515f70e7fd3cdd6cf05ac0a72588b61183a909b611d3bdbe57743bcd65445e","026726932a4964341ab8544f12b912c8dfaa388d2936b71cc3eca0cffb49cc1d","83188d037c81bd27076218934ba9e1742ddb69cd8cc64cdb8a554078de38eb12","c490298b35e03ecac14e83a3e701e9284fa87ee285c362475b063e437385d362","d90445b6258429107e0ebd116bc5476ebe155df2206f70aadf058ba28f092db8","9508fcc6616ea31bf848463f161571bcb0c8726b267a43e231f21fca775007e7","daf44d045f41c7dc023520708443bc42f914178fbaeb193a59b6acbe3183dc7e","b2284829ef9c690b488359fb486a8ebdf0e2d4423d1a7b2b74727e219e2e9002","ab135130c2e2f34a2bd54f69331a1a7773fcdb4d9cfdff9a23831dc4eb6c0a21","d055e7d26a8fd1de409ddc5fac4fb848c2c1814302c002735a66502eac96237e","1037017fc5dc0109d84ce24aa65eefff6cc9728c608cd1fc54212e4c2db18baa","2fd1f5f37a7da7c28e6e4ec088cca5c6882fe41cd2e4d512cd583ad35f11dcc7","86f4f26e7e2e216f49db89fe0e5f66dc6966edb34b6bb3d0e93608a223b1fed8",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"4a62e901bdc1d3d523871a38ee07dacc0effe7fd8215c21d6a51fc2093322b48","3cfef0a604c9dfc2c07224b8cecbeeef9c2d5ccbd50b3d0e1eeab4fb68520bfd","605ea258c6c3b91cb0ecd5e4919a5b2a9bbe2f23ec3f142b5ad35a21346ffcd2","40cdf91e74e7c77dac9a17722a4a3b15b4f871e826cbe69526427b8506576ae0","5e2d2a2bdbde34198d542d7285cb52dcc30f4926d223eaed8e3839c36a1cdbd9","681bc341c0be58588e125edc492914c00a0b17da89d31b4109e055712ba54c55","5c0bcafc5bca9e454abcd90499af1366179bd5fd7e407668929a842132d97dc0","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"43978f18d1165eea81040bc9bfac1a551717f5cc9bd0f13b31bf490c5fcdc75f","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","57a558a99ab24fdff45a2c2db0c34285de2dcbc66149d9a3d83fcde844426e37","260aad3a6bd3fc510b7f97cfb05859bfc045ce185f8c2b4d73ddb9c43b0eb3c0","cb428529763c6c8e38e42db2a39f333ffcc6d3aab396b24ac84b22da752c1de0","ad4b60488fb1e562bf375dac9299815f7028bf667d9b5887b2d01d501b7d1ddd","246341c3a7a2638cf830d690e69de1e6085a102c6a30596435b050e6ac86c11a","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"fd5d2f531376b1e84df315df0fe724445353a0ae2e2c4de7bae01e24c6c2047a","84214d474bed6e36b7608ba8a39d463ff90061b8af47cbd1a8f7ecb775e21fac","944660c079e97f62f513c33ec64cebc44154374053d3a9adb04bf02f67ee1066","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","62a00c9cc0c78d9f282dcd7b0a7776aefe220106c3bc327e259e5f6484c6f556",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f3e8bcce378a26bc672fce0ec05affabbbbfa18493b76f24c39136dea87100d0","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"e51bee3200733b1f58818b5a9ea90fcd61c5b8afa3a0378391991f3696826a65","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","e70339a3d63f806c43f24250c42aa0000093923457b0ed7dfc10e0ac910ebca9","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","b810390059fc34122556c644f586e7a2b4598ded8afe5ba70bb82fc2e50577b1","ba9de5c5823e06ee3314f959c138cdaf4477d3a1a0769f0d24e62911020e8088","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"893f4b8552c248f6542174b53d1519f739b20428c970dda89cd90485dab059d0","ed19da84b7dbf00952ad0b98ce5c194f1903bcf7c94d8103e8e0d63b271543ae","1a137445c4399e4c18b0989d7ead5c76da5fb5df0e2934a1e84e5b303b6bfe68","56949b812b798ae7538eebee0004e13a229d3ed67df6baff8b2ce4013ca690fe","c3b851a5ce7c35555cf146cc34176e856f84b404017e08e0a6a6e3692ca27673","0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05","6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","58a3914b1cce4560d9ad6eee2b716caaa030eda0a90b21ca2457ea9e2783eaa3"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"target":4},"fileIdsList":[[271],[244,271,278],[170,172,173,174,175,176,177,178,179,180,181,182,271],[170,171,173,174,175,176,177,178,179,180,181,182,271],[171,172,173,174,175,176,177,178,179,180,181,182,271],[170,171,172,174,175,176,177,178,179,180,181,182,271],[170,171,172,173,175,176,177,178,179,180,181,182,271],[170,171,172,173,174,176,177,178,179,180,181,182,271],[170,171,172,173,174,175,177,178,179,180,181,182,271],[170,171,172,173,174,175,176,178,179,180,181,182,271],[170,171,172,173,174,175,176,177,179,180,181,182,271],[170,171,172,173,174,175,176,177,178,180,181,182,271],[170,171,172,173,174,175,176,177,178,179,181,182,271],[170,171,172,173,174,175,176,177,178,179,180,182,271],[170,171,172,173,174,175,176,177,178,179,180,181,271],[228,271],[231,271],[232,237,271],[233,243,244,251,260,270,271],[233,234,243,251,271],[235,271],[236,237,244,252,271],[237,260,267,271],[238,240,243,251,271],[239,271],[240,241,271],[242,243,271],[243,271],[243,244,245,260,270,271],[243,244,245,260,271],[246,251,260,270,271],[243,244,246,247,251,260,267,270,271],[246,248,260,267,270,271],[228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277],[243,249,271],[250,270,271],[240,243,251,260,271],[252,271],[253,271],[231,254,271],[255,269,271,275],[256,271],[257,271],[243,258,271],[258,259,271,273],[243,260,261,262,271],[260,262,271],[260,261,271],[263,271],[264,271],[243,265,266,271],[265,266,271],[237,251,267,271],[268,271],[251,269,271],[232,246,257,270,271],[237,271],[260,271,272],[271,273],[271,274],[232,237,243,245,254,260,270,271,273,275],[260,271,276],[201,271],[193,201,271],[203,204,205,206,207,208,209,271],[192,271],[193,201,202,210,271],[194,271],[188,271],[185,186,187,188,189,190,191,194,195,196,197,198,199,200,271],[193,195,271],[196,201,271],[218,220,222,271],[165,218,220,222,271],[165,218,222,223,271],[168,219,221,271],[48,271],[49,271],[48,49,54,271],[50,51,52,53,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,271],[49,77,271],[49,117,271],[44,45,46,47,48,49,54,160,161,162,163,167,271],[54,271],[46,165,166,271],[48,164,271],[49,54,271],[44,45,271],[116,271],[215,271],[216,271],[215,217,271],[212,271],[213,271],[212,213,214,271],[168,169,182,183,271],[168,182,211,224,225,271],[168,182,184,211,226,227,253,271,279,280],[184,225,226,271,281],[168,271]],"referencedMap":[[183,1],[227,1],[279,2],[283,1],[284,1],[171,3],[172,4],[170,5],[173,6],[174,7],[175,8],[176,9],[177,10],[178,11],[179,12],[180,13],[181,14],[182,15],[285,1],[280,1],[228,16],[229,16],[231,17],[232,18],[233,19],[234,20],[235,21],[236,22],[237,23],[238,24],[239,25],[240,26],[241,26],[242,27],[243,28],[244,29],[245,30],[230,1],[277,1],[246,31],[247,32],[248,33],[278,34],[249,35],[250,36],[251,37],[252,38],[253,39],[254,40],[255,41],[256,42],[257,43],[258,44],[259,45],[260,46],[262,47],[261,48],[263,49],[264,50],[265,51],[266,52],[267,53],[268,54],[269,55],[270,56],[271,57],[272,58],[273,59],[274,60],[275,61],[276,62],[286,1],[287,1],[288,1],[77,1],[202,63],[219,64],[203,63],[204,63],[210,65],[205,63],[206,63],[207,63],[208,63],[209,63],[193,66],[192,1],[211,67],[199,1],[195,68],[186,1],[185,1],[187,1],[188,63],[189,69],[201,70],[190,63],[191,63],[196,71],[197,72],[198,63],[194,1],[200,1],[223,73],[221,74],[224,75],[222,76],[47,1],[49,77],[152,78],[156,78],[155,78],[153,78],[154,78],[157,78],[50,78],[62,78],[51,78],[64,78],[66,78],[59,78],[60,78],[61,78],[65,78],[67,78],[52,78],[63,78],[53,78],[55,79],[56,78],[57,78],[58,78],[74,78],[73,78],[160,80],[68,78],[70,78],[69,78],[71,78],[72,78],[159,78],[158,78],[75,78],[78,81],[79,81],[81,78],[126,78],[125,78],[82,78],[123,78],[127,78],[83,78],[84,78],[85,81],[128,78],[122,81],[80,81],[129,78],[86,81],[130,78],[87,81],[110,78],[88,78],[131,78],[89,78],[120,81],[91,78],[92,78],[132,78],[94,78],[96,78],[97,78],[103,78],[104,78],[98,81],[134,78],[121,81],[133,81],[99,78],[100,78],[135,78],[101,78],[93,81],[136,78],[119,78],[137,78],[102,81],[105,78],[106,78],[124,81],[138,78],[139,78],[118,82],[95,78],[140,81],[141,78],[142,78],[143,78],[107,78],[109,78],[111,78],[108,81],[90,78],[112,78],[115,78],[113,78],[114,78],[76,78],[150,78],[144,78],[145,78],[147,78],[148,78],[146,78],[151,78],[149,78],[168,83],[166,84],[167,85],[165,86],[164,78],[163,87],[46,1],[48,1],[44,1],[161,1],[162,88],[54,77],[45,1],[169,1],[117,89],[116,1],[216,90],[217,91],[218,92],[213,93],[214,94],[212,1],[215,95],[220,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[184,96],[226,97],[281,98],[282,99],[225,100]],"exportedModulesMap":[[183,1],[227,1],[279,2],[283,1],[284,1],[171,3],[172,4],[170,5],[173,6],[174,7],[175,8],[176,9],[177,10],[178,11],[179,12],[180,13],[181,14],[182,15],[285,1],[280,1],[228,16],[229,16],[231,17],[232,18],[233,19],[234,20],[235,21],[236,22],[237,23],[238,24],[239,25],[240,26],[241,26],[242,27],[243,28],[244,29],[245,30],[230,1],[277,1],[246,31],[247,32],[248,33],[278,34],[249,35],[250,36],[251,37],[252,38],[253,39],[254,40],[255,41],[256,42],[257,43],[258,44],[259,45],[260,46],[262,47],[261,48],[263,49],[264,50],[265,51],[266,52],[267,53],[268,54],[269,55],[270,56],[271,57],[272,58],[273,59],[274,60],[275,61],[276,62],[286,1],[287,1],[288,1],[77,1],[202,63],[219,64],[203,63],[204,63],[210,65],[205,63],[206,63],[207,63],[208,63],[209,63],[193,66],[192,1],[211,67],[199,1],[195,68],[186,1],[185,1],[187,1],[188,63],[189,69],[201,70],[190,63],[191,63],[196,71],[197,72],[198,63],[194,1],[200,1],[223,73],[221,74],[224,75],[222,76],[47,1],[49,77],[152,78],[156,78],[155,78],[153,78],[154,78],[157,78],[50,78],[62,78],[51,78],[64,78],[66,78],[59,78],[60,78],[61,78],[65,78],[67,78],[52,78],[63,78],[53,78],[55,79],[56,78],[57,78],[58,78],[74,78],[73,78],[160,80],[68,78],[70,78],[69,78],[71,78],[72,78],[159,78],[158,78],[75,78],[78,81],[79,81],[81,78],[126,78],[125,78],[82,78],[123,78],[127,78],[83,78],[84,78],[85,81],[128,78],[122,81],[80,81],[129,78],[86,81],[130,78],[87,81],[110,78],[88,78],[131,78],[89,78],[120,81],[91,78],[92,78],[132,78],[94,78],[96,78],[97,78],[103,78],[104,78],[98,81],[134,78],[121,81],[133,81],[99,78],[100,78],[135,78],[101,78],[93,81],[136,78],[119,78],[137,78],[102,81],[105,78],[106,78],[124,81],[138,78],[139,78],[118,82],[95,78],[140,81],[141,78],[142,78],[143,78],[107,78],[109,78],[111,78],[108,81],[90,78],[112,78],[115,78],[113,78],[114,78],[76,78],[150,78],[144,78],[145,78],[147,78],[148,78],[146,78],[151,78],[149,78],[168,83],[166,84],[167,85],[165,86],[164,78],[163,87],[46,1],[48,1],[44,1],[161,1],[162,88],[54,77],[45,1],[169,1],[117,89],[116,1],[216,90],[217,91],[218,92],[213,93],[214,94],[212,1],[215,95],[220,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[184,96],[226,97],[281,98],[282,99],[225,100]],"semanticDiagnosticsPerFile":[183,227,279,283,284,171,172,170,173,174,175,176,177,178,179,180,181,182,285,280,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,230,277,246,247,248,278,249,250,251,252,253,254,255,256,257,258,259,260,262,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,286,287,288,77,202,219,203,204,210,205,206,207,208,209,193,192,211,199,195,186,185,187,188,189,201,190,191,196,197,198,194,200,223,221,224,222,47,49,152,156,155,153,154,157,50,62,51,64,66,59,60,61,65,67,52,63,53,55,56,57,58,74,73,160,68,70,69,71,72,159,158,75,78,79,81,126,125,82,123,127,83,84,85,128,122,80,129,86,130,87,110,88,131,89,120,91,92,132,94,96,97,103,104,98,134,121,133,99,100,135,101,93,136,119,137,102,105,106,124,138,139,118,95,140,141,142,143,107,109,111,108,90,112,115,113,114,76,150,144,145,147,148,146,151,149,168,166,167,165,164,163,46,48,44,161,162,54,45,169,117,116,216,217,218,213,214,212,215,220,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,43,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,41,37,38,39,40,1,42,11,10,184,226,281,282,225]},"version":"4.4.3"}
package/package.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "@kibibit/configit",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "a general typescript configuration service",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "/lib",
9
+ "/src"
10
+ ],
11
+ "scripts": {
12
+ "prebuild": "rimraf lib",
13
+ "build": "tsc",
14
+ "lint": "eslint -c ./.eslintrc.js \"{src,apps,libs,test,examples}/**/*.ts\"",
15
+ "lint:fix": "eslint -c ./.eslintrc.js \"{src,apps,libs,test,examples}/**/*.ts\" --fix",
16
+ "test": "cd examples/simple-node && npm run start:dev",
17
+ "contributors:all": "cross-env HUSKY=0 node ./tools/get-all-contributors.js",
18
+ "contributors:add": "cross-env HUSKY=0 all-contributors add",
19
+ "contributors:generate": "cross-env HUSKY=1 all-contributors generate",
20
+ "prepare": "husky install",
21
+ "semantic-release": "cross-env HUSKY=0 semantic-release"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/Kibibit/configit.git"
26
+ },
27
+ "author": "thatkookooguy <neilkalman@gmail.com>",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://github.com/Kibibit/configit/issues"
31
+ },
32
+ "homepage": "https://github.com/Kibibit/configit#readme",
33
+ "dependencies": {
34
+ "@kibibit/kb-error": "^1.0.3",
35
+ "class-transformer": "^0.4.0",
36
+ "class-validator": "^0.13.1",
37
+ "class-validator-jsonschema": "^3.1.0",
38
+ "cli-table": "^0.3.6",
39
+ "colors": "^1.4.0",
40
+ "find-root": "^1.1.0",
41
+ "fs-extra": "^10.0.0",
42
+ "inquirer": "^8.2.0",
43
+ "lodash": "^4.17.21",
44
+ "nconf": "^0.11.3",
45
+ "simple-git": "^2.46.0"
46
+ },
47
+ "devDependencies": {
48
+ "@commitlint/cli": "^13.2.1",
49
+ "@commitlint/config-angular": "^13.2.0",
50
+ "@commitlint/config-conventional": "^13.2.0",
51
+ "@semantic-release/changelog": "^6.0.0",
52
+ "@semantic-release/commit-analyzer": "^9.0.1",
53
+ "@semantic-release/git": "^10.0.0",
54
+ "@semantic-release/github": "^8.0.1",
55
+ "@semantic-release/npm": "^8.0.0",
56
+ "@semantic-release/release-notes-generator": "^10.0.2",
57
+ "@types/colors": "^1.2.1",
58
+ "@types/find-root": "^1.1.2",
59
+ "@types/fs-extra": "^9.0.13",
60
+ "@types/lodash": "^4.14.175",
61
+ "@types/nconf": "^0.10.1",
62
+ "@types/node": "^16.10.3",
63
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
64
+ "@typescript-eslint/parser": "^4.33.0",
65
+ "all-contributors-cli": "^6.20.0",
66
+ "commitizen": "^4.2.4",
67
+ "cross-env": "^7.0.3",
68
+ "cz-conventional-changelog": "^3.3.0",
69
+ "cz-conventional-changelog-emoji": "^0.1.0",
70
+ "eslint": "^7.32.0",
71
+ "eslint-plugin-import": "^2.24.2",
72
+ "eslint-plugin-simple-import-sort": "^7.0.0",
73
+ "eslint-plugin-unused-imports": "^1.1.5",
74
+ "husky": "^7.0.2",
75
+ "rimraf": "^3.0.2",
76
+ "semantic-release": "^18.0.0",
77
+ "semantic-release-cli": "^5.4.4",
78
+ "ts-node": "^10.2.1",
79
+ "typescript": "^4.4.3"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "config": {
85
+ "commitizen": {
86
+ "path": "./node_modules/cz-conventional-changelog-emoji"
87
+ }
88
+ },
89
+ "release": {
90
+ "branches": [
91
+ {
92
+ "name": "main"
93
+ },
94
+ {
95
+ "name": "beta",
96
+ "channel": "beta",
97
+ "prerelease": "beta"
98
+ }
99
+ ],
100
+ "plugins": [
101
+ [
102
+ "@semantic-release/commit-analyzer",
103
+ {
104
+ "preset": "angular",
105
+ "parserOpts": {
106
+ "noteKeywords": [
107
+ "BREAKING CHANGE",
108
+ "BREAKING CHANGES",
109
+ "BREAKING"
110
+ ]
111
+ }
112
+ }
113
+ ],
114
+ [
115
+ "@semantic-release/release-notes-generator",
116
+ {
117
+ "preset": "angular",
118
+ "parserOpts": {
119
+ "noteKeywords": [
120
+ "BREAKING CHANGE",
121
+ "BREAKING CHANGES",
122
+ "BREAKING"
123
+ ]
124
+ },
125
+ "writerOpts": {
126
+ "commitsSort": [
127
+ "subject",
128
+ "scope"
129
+ ]
130
+ }
131
+ }
132
+ ],
133
+ [
134
+ "@semantic-release/changelog",
135
+ {
136
+ "changelogFile": "CHANGELOG.md",
137
+ "changelogTitle": "achievibit changelog"
138
+ }
139
+ ],
140
+ [
141
+ "@semantic-release/git",
142
+ {
143
+ "assets": [
144
+ "CHANGELOG.md"
145
+ ]
146
+ }
147
+ ],
148
+ "@semantic-release/npm",
149
+ "@semantic-release/git",
150
+ "@semantic-release/github"
151
+ ]
152
+ }
153
+ }
@@ -0,0 +1,26 @@
1
+ import { ValidationError } from 'class-validator';
2
+ import { cyan, red } from 'colors';
3
+ import { times, values } from 'lodash';
4
+
5
+ import KbError from '@kibibit/kb-error';
6
+
7
+ export class ConfigValidationError extends KbError {
8
+ constructor(validationErrors: ValidationError[]) {
9
+ const message = validationErrors
10
+ .map((validationError) => {
11
+ const deco = cyan(times(55, () => '=').join(''));
12
+ return [
13
+ '',
14
+ deco,
15
+ ` ${ cyan('property:') } ${ validationError.property }`,
16
+ ` ${ cyan('value:') } ${ red(validationError.value) }`,
17
+ deco,
18
+ values(validationError.constraints)
19
+ .map((value) => ` - ${ red(value) }`).join('\n')
20
+ ].join('\n');
21
+ }).join('') + '\n\n';
22
+
23
+ super(message);
24
+ this.name = 'ConfigValidationError';
25
+ }
26
+ }
@@ -0,0 +1,66 @@
1
+ import { Exclude, Expose } from 'class-transformer';
2
+ import {
3
+ IsBoolean,
4
+ IsIn,
5
+ IsString,
6
+ Validate
7
+ } from 'class-validator';
8
+ import { validationMetadatasToSchemas } from 'class-validator-jsonschema';
9
+ import { chain } from 'lodash';
10
+
11
+ import { JsonSchema } from './json-schema.validator';
12
+
13
+ export const NODE_ENVIRONMENT_OPTIONS = [
14
+ 'google',
15
+ 'development',
16
+ 'production',
17
+ 'test',
18
+ 'devcontainer'
19
+ ];
20
+
21
+ @Exclude()
22
+ export class Config {
23
+ @Expose()
24
+ @IsString()
25
+ @IsIn(NODE_ENVIRONMENT_OPTIONS)
26
+ @Validate(JsonSchema, [
27
+ 'Tells which env file to use and what environment we are running on'
28
+ ])
29
+ NODE_ENV = 'development';
30
+
31
+ @IsBoolean()
32
+ @Validate(JsonSchema, [
33
+ 'Create a file made out of the internal config. This is mostly for ',
34
+ 'merging command line, environment, and file variables to a single instance'
35
+ ])
36
+ saveToFile = false;
37
+
38
+ constructor(partial: Partial<Config> = {}) {
39
+ Object.assign(this, partial);
40
+ }
41
+
42
+ public toJsonSchema() {
43
+ const configJsonSchemaObj = validationMetadatasToSchemas({
44
+ additionalConverters: {
45
+ JsonSchema: (meta) => ({
46
+ description: meta.constraints.join('')
47
+ })
48
+ }
49
+ });
50
+
51
+ const classForSchema = chain(configJsonSchemaObj)
52
+ .keys()
53
+ .filter((className) => className !== 'Config')
54
+ .first()
55
+ .value();
56
+ const configJsonSchema = configJsonSchemaObj[classForSchema];
57
+
58
+ delete configJsonSchema.properties?.nodeEnv;
59
+ configJsonSchema.required?.splice(
60
+ configJsonSchema.required.indexOf('nodeEnv'),
61
+ 1
62
+ );
63
+
64
+ return configJsonSchema;
65
+ }
66
+ }
@@ -0,0 +1,179 @@
1
+ import { join } from 'path';
2
+
3
+ import { classToPlain } from 'class-transformer';
4
+ import { validateSync } from 'class-validator';
5
+ import findRoot from 'find-root';
6
+ import {
7
+ pathExistsSync,
8
+ readdirSync,
9
+ readJSONSync,
10
+ writeJson,
11
+ writeJSONSync
12
+ } from 'fs-extra';
13
+ import { camelCase, chain, get } from 'lodash';
14
+ import nconf from 'nconf';
15
+
16
+ import { ConfigValidationError } from './config.errors';
17
+ import { Config } from './config.model';
18
+
19
+ export interface IConfigServiceOptions {
20
+ convertToCamelCase?: boolean;
21
+ }
22
+
23
+ const environment = get(process, 'env.NODE_ENV', 'development');
24
+
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ let configService: ConfigService<any>;
27
+
28
+ type TClass<T> = new (partial: Partial<T>) => T;
29
+
30
+ /**
31
+ * This is a **Forced Singleton**.
32
+ * This means that even if you try to create
33
+ * another ConfigService, you'll always get the
34
+ * first one.
35
+ */
36
+ export class ConfigService<T extends Config> {
37
+ private readonly mode: string = environment;
38
+ readonly options: IConfigServiceOptions;
39
+ readonly config?: T;
40
+ readonly genericClass?: TClass<T>;
41
+ readonly fileName?: string;
42
+ readonly jsonSchemaFullname?: string;
43
+ readonly defaultConfigFilePath?: string;
44
+ readonly configFileName: string = '';
45
+ readonly configFilePath?: string;
46
+ readonly configFileRoot?: string;
47
+ readonly appRoot: string;
48
+
49
+ constructor(
50
+ givenClass: TClass<T>,
51
+ passedConfig?: Partial<T>,
52
+ options: IConfigServiceOptions = {}
53
+ ) {
54
+ this.options = options;
55
+ this.appRoot = this.findRoot();
56
+ if (!passedConfig && configService) { return configService; }
57
+
58
+ this.genericClass = givenClass;
59
+ this.fileName = chain(this.genericClass.name)
60
+ .replace(/Config$/i, '')
61
+ .kebabCase()
62
+ .value();
63
+ this.jsonSchemaFullname = `.${ this.fileName }.env.schema.json`;
64
+
65
+ this.configFileName = `${ this.fileName }.${ environment }.env.json`;
66
+
67
+ this.configFileRoot = this.findConfigRoot() || this.appRoot;
68
+
69
+ this.defaultConfigFilePath = join(this.configFileRoot, 'defaults.env.json');
70
+ this.configFilePath = join(
71
+ this.configFileRoot,
72
+ `${ this.fileName }.${ environment }.env.json`
73
+ );
74
+
75
+ nconf
76
+ .argv({
77
+ parseValues: true
78
+ })
79
+ .env({
80
+ parseValues: true,
81
+ transform: this.options.convertToCamelCase ?
82
+ transformToCamelCase :
83
+ null
84
+ })
85
+ .file('defaults', { file: this.defaultConfigFilePath })
86
+ .file('environment', { file: this.configFilePath });
87
+
88
+ const config = passedConfig || nconf.get();
89
+ const envConfig = this.validateInput(config);
90
+
91
+ this.config = new this.genericClass(envConfig as T);
92
+
93
+ if (config.saveToFile || config.init) {
94
+ const plainConfig = classToPlain(this.config);
95
+ plainConfig.$schema = `./${ this.jsonSchemaFullname }`;
96
+ const orderedKeys = chain(plainConfig)
97
+ .keys()
98
+ .sort()
99
+ .without('NODE_ENV')
100
+ .reduce((obj: { [key: string]: string }, key) => {
101
+ obj[key] = plainConfig[key];
102
+ return obj;
103
+ }, {})
104
+ // .omitBy((value, key) => key.startsWith('$'))
105
+ .value();
106
+
107
+ console.log(orderedKeys);
108
+
109
+ writeJson(this.configFilePath, orderedKeys, { spaces: 2 });
110
+ }
111
+
112
+ const schema = this.config.toJsonSchema();
113
+ const schemaFullPath = join(
114
+ this.configFileRoot,
115
+ '/',
116
+ this.jsonSchemaFullname
117
+ );
118
+ writeJSONSync(schemaFullPath, schema);
119
+
120
+ configService = this;
121
+ }
122
+
123
+ toPlainObject() {
124
+ return classToPlain(this);
125
+ }
126
+
127
+ private findRoot() {
128
+ return findRoot(process.cwd(), (dir) => {
129
+ const packagePath = join(dir, 'package.json');
130
+ const isPackageJsonExists = pathExistsSync(packagePath);
131
+
132
+ if (isPackageJsonExists) {
133
+ const packageContent = readJSONSync(packagePath, { encoding: 'utf8' });
134
+ if (![ '' ].includes(packageContent.name)) {
135
+ return true;
136
+ }
137
+ }
138
+
139
+ return false;
140
+ });
141
+ }
142
+
143
+ private findConfigRoot() {
144
+ try {
145
+ return findRoot(process.cwd(), (dir) => {
146
+ const fileNames = readdirSync(dir);
147
+ const isConfigFileExists = fileNames.includes(this.configFileName);
148
+ return isConfigFileExists;
149
+ });
150
+ } catch (error) {
151
+ return this.findRoot();
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Ensures all needed variables are set, and returns the validated JavaScript object
157
+ * including the applied default values.
158
+ */
159
+ private validateInput(
160
+ envConfig: Partial<T>
161
+ ): Partial<T> {
162
+ if (!this.genericClass) throw new Error('something went wrong');
163
+ const configInstance = new this.genericClass(envConfig);
164
+ const validationErrors = validateSync(configInstance);
165
+
166
+ if (validationErrors.length > 0) {
167
+ throw new ConfigValidationError(validationErrors);
168
+ }
169
+ return classToPlain(configInstance) as Partial<T>;
170
+ }
171
+ }
172
+
173
+ function transformToCamelCase(obj: { key: string; value: string }) {
174
+ const camelCasedKey = camelCase(obj.key);
175
+
176
+ obj.key = camelCasedKey;
177
+
178
+ return camelCasedKey && obj;
179
+ }
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from './config.service';
2
+ export * from './config.errors';
3
+ export * from './config.model';
4
+ export * from './json-schema.validator';
@@ -0,0 +1,15 @@
1
+ import {
2
+ ValidatorConstraint,
3
+ ValidatorConstraintInterface
4
+ } from 'class-validator';
5
+
6
+ @ValidatorConstraint({ name: 'JsonSchema', async: false })
7
+ export class JsonSchema implements ValidatorConstraintInterface {
8
+ validate() {
9
+ return true;
10
+ }
11
+
12
+ defaultMessage() {
13
+ return '';
14
+ }
15
+ }