@achs/env 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +260 -260
  2. package/arguments.d.ts.map +1 -1
  3. package/arguments.js.map +1 -1
  4. package/commands/env.command.d.ts.map +1 -1
  5. package/commands/env.command.js.map +1 -1
  6. package/commands/export.command.d.ts.map +1 -1
  7. package/commands/export.command.js.map +1 -1
  8. package/commands/pull.command.d.ts.map +1 -1
  9. package/commands/pull.command.js.map +1 -1
  10. package/commands/push.command.d.ts.map +1 -1
  11. package/commands/push.command.js.map +1 -1
  12. package/commands/schema.command.d.ts.map +1 -1
  13. package/commands/schema.command.js +1 -0
  14. package/commands/schema.command.js.map +1 -1
  15. package/exec.js.map +1 -1
  16. package/interfaces/loader.interface.d.ts.map +1 -1
  17. package/package.json +90 -89
  18. package/providers/app-settings.provider.d.ts.map +1 -1
  19. package/providers/app-settings.provider.js.map +1 -1
  20. package/providers/azure-key-vault.provider.d.ts.map +1 -1
  21. package/providers/azure-key-vault.provider.js.map +1 -1
  22. package/providers/index.js.map +1 -1
  23. package/providers/local.provider.d.ts.map +1 -1
  24. package/providers/local.provider.js.map +1 -1
  25. package/providers/package-json.provider.d.ts +1 -1
  26. package/providers/package-json.provider.d.ts.map +1 -1
  27. package/providers/package-json.provider.js +9 -9
  28. package/providers/package-json.provider.js.map +1 -1
  29. package/tsconfig.build.tsbuildinfo +1 -1
  30. package/utils/command.util.d.ts.map +1 -1
  31. package/utils/command.util.js.map +1 -1
  32. package/utils/interpolate.util.d.ts.map +1 -1
  33. package/utils/interpolate.util.js.map +1 -1
  34. package/utils/json.util.d.ts.map +1 -1
  35. package/utils/json.util.js.map +1 -1
  36. package/utils/logger.js.map +1 -1
  37. package/utils/normalize.util.d.ts.map +1 -1
  38. package/utils/normalize.util.js.map +1 -1
  39. package/utils/schema.util.d.ts.map +1 -1
  40. package/utils/schema.util.js.map +1 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  <div id="top" align="center">
2
2
  <img
3
- alt="logo"
4
- src="https://nodejs.org/static/images/logo.svg"
5
- width="256px"
3
+ alt="logo"
4
+ src="https://nodejs.org/static/images/logo.svg"
5
+ width="256px"
6
6
  />
7
7
 
8
8
  </br>
@@ -15,23 +15,23 @@
15
15
 
16
16
  <p align="center">
17
17
  <img
18
- src="https://img.shields.io/badge/version-1.0.0-blue?style=flat-square"
19
- alt="version"
18
+ src="https://img.shields.io/badge/version-1.0.0-blue?style=flat-square"
19
+ alt="version"
20
20
  />
21
21
  &nbsp;
22
22
  <img
23
- src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white"
24
- alt="typescript"
23
+ src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white"
24
+ alt="typescript"
25
25
  />
26
26
  &nbsp;
27
27
  <img
28
- src="https://img.shields.io/badge/nodejs-~14.0.0_||_^16.14.2-darkgreen?style=flat-square"
29
- alt="nodejs engine"
28
+ src="https://img.shields.io/badge/nodejs-~14.0.0_||_^16.14.2-darkgreen?style=flat-square"
29
+ alt="nodejs engine"
30
30
  />
31
31
  &nbsp;
32
32
  <img
33
- src="https://img.shields.io/badge/npm->=7.5.6-darkgreen?style=flat-square"
34
- alt="npm engine"
33
+ src="https://img.shields.io/badge/npm->=7.5.6-darkgreen?style=flat-square"
34
+ alt="npm engine"
35
35
  />
36
36
  </p>
37
37
 
@@ -94,10 +94,10 @@ You can initialize a new npm project using:
94
94
  Usage: env [command] [options..] [: subcmd [:]] [options..]
95
95
 
96
96
  Commands:
97
- env [options..] [: <subcmd> :]
98
- env pull [options..]
99
- env push [options..]
100
- env schema [options..]
97
+ env [options..] [: <subcmd> :]
98
+ env pull [options..]
99
+ env push [options..]
100
+ env schema [options..]
101
101
  > _
102
102
  ```
103
103
 
@@ -107,10 +107,10 @@ You can initialize a new npm project using:
107
107
  Usage: env [command] [options..] [: subcmd [:]] [options..]
108
108
 
109
109
  Commands:
110
- env [options..] [: <subcmd> :]
111
- env pull [options..]
112
- env push [options..]
113
- env schema [options..]
110
+ env [options..] [: <subcmd> :]
111
+ env pull [options..]
112
+ env push [options..]
113
+ env schema [options..]
114
114
  > _
115
115
  ```
116
116
 
@@ -120,19 +120,19 @@ You can initialize a new npm project using:
120
120
  {
121
121
  ...,
122
122
  "scripts": {
123
- // starts project injecting "dev" environment variables and debug log level
124
- "start:dev": "env -e dev -m debug : node dist/main.js : --log debug",
125
- // starts project injecting "prod" environment variables
126
- "start:prod": "env -e prod -m debug : node dist/main.js",
127
- ...,
128
- // builds project injecting "prod" environment variables
129
- "build:prod": "env -e prod -m build : tsc",
130
- ...,
131
- "env:schema": "env schema -e dev --ci",
132
- // uploads environment "dev" variables
133
- "env:push:dev": "env push -e dev",
134
- // downloads environment "dev" variables
135
- "env:pull:dev": "env pull -e dev"
123
+ // starts project injecting "dev" environment variables and debug log level
124
+ "start:dev": "env -e dev -m debug : node dist/main.js : --log debug",
125
+ // starts project injecting "prod" environment variables
126
+ "start:prod": "env -e prod -m debug : node dist/main.js",
127
+ ...,
128
+ // builds project injecting "prod" environment variables
129
+ "build:prod": "env -e prod -m build : tsc",
130
+ ...,
131
+ "env:schema": "env schema -e dev --ci",
132
+ // uploads environment "dev" variables
133
+ "env:push:dev": "env push -e dev",
134
+ // downloads environment "dev" variables
135
+ "env:pull:dev": "env pull -e dev"
136
136
  },
137
137
  ...
138
138
  }
@@ -155,15 +155,15 @@ console.log(`My environment loaded is: ${process.env.ENV}`);
155
155
  13:31:59.914 DEBUG using secrets provider
156
156
  13:32:00.109 DEBUG environment loaded:
157
157
  {
158
- NODE_ENV: 'development',
159
- ENV: 'dev',
160
- VERSION: '1.0.0',
161
- NAME: '@my-app',
162
- VAR1: true,
163
- VAR2: true,
164
- GROUP1__VAR1: 'G1V2',
165
- ARR1: '1,val,true',
166
- SECRET: '***'
158
+ NODE_ENV: 'development',
159
+ ENV: 'dev',
160
+ VERSION: '1.0.0',
161
+ NAME: '@my-app',
162
+ VAR1: true,
163
+ VAR2: true,
164
+ GROUP1__VAR1: 'G1V2',
165
+ ARR1: '1,val,true',
166
+ SECRET: '***'
167
167
  }
168
168
  13:32:00.116 INFO executing command > node dist/main.js
169
169
  My environment loaded is: dev
@@ -224,39 +224,39 @@ _`[[root]]/config-file.[[env]].json`_ will be _`config/config-file.dev.json`_.
224
224
 
225
225
  ### Global options
226
226
 
227
- | Option | Description | Type | Default | Required? |
227
+ | Option | Description | Type | Default | Required? |
228
228
  | ---------------------------------- | ----------------------------------------------- | ---------- | ------- | --------- |
229
- | `--help` | Shows help | `boolean` | | No |
230
- | `--e, --env` | Environment for load | `string` | | Yes |
231
- | `-m, --modes` | Execution modes | `string[]` | `[]` | No |
232
- | `--nd, --nestingDelimiter` | Nesting level delimiter for flatten | `string` | `__` | No |
233
- | `--arrDesc, --arrayDescomposition` | Whether serialize or break down arrays | `boolean` | `false` | No |
234
- | `-x, --expand` | Interpolates environment variables using itself | `boolean` | `false` | No |
235
- | `-ci` | Continuous Integration mode | `boolean` | `false` | No |
229
+ | `--help` | Shows help | `boolean` | | No |
230
+ | `--e, --env` | Environment for load | `string` | | Yes |
231
+ | `-m, --modes` | Execution modes | `string[]` | `[]` | No |
232
+ | `--nd, --nestingDelimiter` | Nesting level delimiter for flatten | `string` | `__` | No |
233
+ | `--arrDesc, --arrayDescomposition` | Whether serialize or break down arrays | `boolean` | `false` | No |
234
+ | `-x, --expand` | Interpolates environment variables using itself | `boolean` | `false` | No |
235
+ | `-ci` | Continuous Integration mode | `boolean` | `false` | No |
236
236
 
237
237
  </br>
238
238
 
239
239
  ### Workspace options
240
240
 
241
- | Option | Description | Type | Default | Required? |
241
+ | Option | Description | Type | Default | Required? |
242
242
  | ------------------ | --------------------------------- | -------- | --------------------------------- | --------- |
243
- | `--root` | Default environment folder path | `string` | `env` | No |
244
- | `-c, --configFile` | Config JSON file path | `string` | `[[root]]/settings/settings.json` | No |
245
- | `-s, --schemaFile` | Environment Schema JSON file path | `string` | `[[root]]/settings/schema.json` | No |
243
+ | `--root` | Default environment folder path | `string` | `env` | No |
244
+ | `-c, --configFile` | Config JSON file path | `string` | `[[root]]/settings/settings.json` | No |
245
+ | `-s, --schemaFile` | Environment Schema JSON file path | `string` | `[[root]]/settings/schema.json` | No |
246
246
 
247
247
  ### JSON Schema options
248
248
 
249
- | Option | Description | Type | Default | Required? |
249
+ | Option | Description | Type | Default | Required? |
250
250
  | ---------------------- | ---------------------------------------------------------- | ----------------- | ------- | --------- |
251
- | `-r, --resolve` | Whether merges new schema or override | `merge, override` | `merge` | No |
252
- | `--null, --nullable` | Whether variables are nullable by default | `boolean` | `true` | No |
253
- | `--df, --detectFormat` | Whether format of strings variables are included in schema | `boolean` | `true` | No |
251
+ | `-r, --resolve` | Whether merges new schema or override | `merge, override` | `merge` | No |
252
+ | `--null, --nullable` | Whether variables are nullable by default | `boolean` | `true` | No |
253
+ | `--df, --detectFormat` | Whether format of strings variables are included in schema | `boolean` | `true` | No |
254
254
 
255
255
  ### Logger options
256
256
 
257
- | Option | Description | Type | Default | Required? |
257
+ | Option | Description | Type | Default | Required? |
258
258
  | ------------------- | ----------- | ---------------------------------------- | ------- | --------- |
259
- | `--log, --logLevel` | Log level | `silly, trace, debug, info, warn, error` | `info` | No |
259
+ | `--log, --logLevel` | Log level | `silly, trace, debug, info, warn, error` | `info` | No |
260
260
 
261
261
  <div align="center">
262
262
  <span style="font-size:20px;font-weight:bold" align="center">Commands</span>
@@ -292,9 +292,9 @@ Pulls environment variables from providers stores.
292
292
  env pull -e [env] [options..]
293
293
  ```
294
294
 
295
- | Option | Description | Type | Default | Required? |
295
+ | Option | Description | Type | Default | Required? |
296
296
  | ----------------- | ------------------------- | --------- | ------- | --------- |
297
- | `-o, --overwrite` | Overwrite local variables | `boolean` | `false` | No |
297
+ | `-o, --overwrite` | Overwrite local variables | `boolean` | `false` | No |
298
298
 
299
299
  Examples:
300
300
 
@@ -310,9 +310,9 @@ Pushes environment variables to providers stores.
310
310
  env push -e [env] [options..]
311
311
  ```
312
312
 
313
- | Option | Description | Type | Default | Required? |
313
+ | Option | Description | Type | Default | Required? |
314
314
  | ------------- | ------------------------------------ | --------- | ------- | --------- |
315
- | `-f, --force` | Force push for secrets (replace all) | `boolean` | `false` | No |
315
+ | `-f, --force` | Force push for secrets (replace all) | `boolean` | `false` | No |
316
316
 
317
317
  Examples:
318
318
 
@@ -342,10 +342,10 @@ Export unified environment variables to a file from providers.
342
342
  env export -e [env] -m [modes] [options..]
343
343
  ```
344
344
 
345
- | Option | Description | Type | Default | Required? |
345
+ | Option | Description | Type | Default | Required? |
346
346
  | --------------- | ---------------------------------- | -------- | -------- | --------- |
347
- | `-u, -p, --uri` | Uri for export file with variables | `string` | `.env` | No |
348
- | `-f, --format` | Format for export variables | `string` | `dotenv` | No |
347
+ | `-u, -p, --uri` | Uri for export file with variables | `string` | `.env` | No |
348
+ | `-f, --format` | Format for export variables | `string` | `dotenv` | No |
349
349
 
350
350
  Examples:
351
351
 
@@ -370,17 +370,17 @@ Info read is:
370
370
 
371
371
  ```json
372
372
  {
373
- "version": "1.0.0",
374
- "project": "project-name",
375
- "name": "@package-name",
376
- "title": "app-name",
377
- "description": "any description"
373
+ "version": "1.0.0",
374
+ "project": "project-name",
375
+ "name": "@package-name",
376
+ "title": "app-name",
377
+ "description": "any description"
378
378
  }
379
379
  ```
380
380
 
381
- | Option | Description | Type | Default | Required? |
381
+ | Option | Description | Type | Default | Required? |
382
382
  | ------------------- | --------------------------- | -------- | ------- | --------- |
383
- | `--vp, --varPrefix` | Prefix for loaded variables | `string` | `""` | No |
383
+ | `--vp, --varPrefix` | Prefix for loaded variables | `string` | `""` | No |
384
384
 
385
385
  Examples:
386
386
 
@@ -398,9 +398,9 @@ Non secrets loader for `appsettings.json`.
398
398
 
399
399
  ```json
400
400
  {
401
- "|DEFAULT|": {},
402
- "|MODE|": {},
403
- "|ENV|": {}
401
+ "|DEFAULT|": {},
402
+ "|MODE|": {},
403
+ "|ENV|": {}
404
404
  }
405
405
  ```
406
406
 
@@ -408,43 +408,43 @@ In example:
408
408
 
409
409
  ```json
410
410
  {
411
- "|DEFAULT|": {
412
- "VAR1": "v1_default"
413
- },
414
- "|MODE|": {
415
- "build": {
416
- "NODE_ENV": "production"
417
- },
418
- "debug": {
419
- "NODE_ENV": "development"
420
- },
421
- "test": {
422
- "NODE_ENV": "test"
423
- }
424
- },
425
- "|ENV|": {
426
- "dev": {
427
- "C1": "V1",
428
- "C2": "V2",
429
- "C3": 3,
430
- "GROUP1": {
431
- "VAR1": null,
432
- "VAR2": "G1V2",
433
- "VAR3": true,
434
- "GROUP2": {
435
- "VAR1": "G1G2V1"
436
- }
437
- },
438
- "C4": "23"
439
- }
440
- }
411
+ "|DEFAULT|": {
412
+ "VAR1": "v1_default"
413
+ },
414
+ "|MODE|": {
415
+ "build": {
416
+ "NODE_ENV": "production"
417
+ },
418
+ "debug": {
419
+ "NODE_ENV": "development"
420
+ },
421
+ "test": {
422
+ "NODE_ENV": "test"
423
+ }
424
+ },
425
+ "|ENV|": {
426
+ "dev": {
427
+ "C1": "V1",
428
+ "C2": "V2",
429
+ "C3": 3,
430
+ "GROUP1": {
431
+ "VAR1": null,
432
+ "VAR2": "G1V2",
433
+ "VAR3": true,
434
+ "GROUP2": {
435
+ "VAR1": "G1G2V1"
436
+ }
437
+ },
438
+ "C4": "23"
439
+ }
440
+ }
441
441
  }
442
442
  ```
443
443
 
444
- | Option | Description | Type | Default | Required? |
444
+ | Option | Description | Type | Default | Required? |
445
445
  | ----------------------- | ------------------------------------ | -------- | --------------------------- | --------- |
446
- | `--ef, --envFile` | Environment variables file path | `string` | `[[root]]/appsettings.json` | No |
447
- | `--sp, --sectionPrefix` | Prefix for env and modes in env file | `string` | `::` | No |
446
+ | `--ef, --envFile` | Environment variables file path | `string` | `[[root]]/appsettings.json` | No |
447
+ | `--sp, --sectionPrefix` | Prefix for env and modes in env file | `string` | `::` | No |
448
448
 
449
449
  </br>
450
450
 
@@ -456,17 +456,17 @@ Info read is:
456
456
 
457
457
  ```json
458
458
  {
459
- "version": "1.0.0",
460
- "project": "project-name",
461
- "name": "@package-name",
462
- "title": "app-name",
463
- "description": "any description"
459
+ "version": "1.0.0",
460
+ "project": "project-name",
461
+ "name": "@package-name",
462
+ "title": "app-name",
463
+ "description": "any description"
464
464
  }
465
465
  ```
466
466
 
467
- | Option | Description | Type | Default | Required? |
467
+ | Option | Description | Type | Default | Required? |
468
468
  | ------------------- | --------------------------- | -------- | ------- | --------- |
469
- | `--vp, --varPrefix` | Prefix for loaded variables | `string` | `""` | No |
469
+ | `--vp, --varPrefix` | Prefix for loaded variables | `string` | `""` | No |
470
470
 
471
471
  Examples:
472
472
 
@@ -479,17 +479,17 @@ Examples:
479
479
  Azure Key Vault provider, allows to load secrets from vault store to `env/secrets/[[env]].env.json` per environment.
480
480
  Also, handles `env/secrets/[[env]].local.env.json` for load local variables with precedence over base.
481
481
 
482
- | Option | Description | Type | Default | Required? |
482
+ | Option | Description | Type | Default | Required? |
483
483
  | --------------------------------------- | ---------------------------------------------- | ---------- | ----------------------------------------- | --------- |
484
- | `--secretFolder` | Secret variables folder path | `string` | `[[root]]/secrets` | No |
485
- | `--secretFile` | Secret variables file path | `string` | `[[secretFolder]]/[[env]].env.json` | No |
486
- | `--localSecretFile` | Local secret variables file path | `string` | `[[secretFolder]]/[[env]].local.env.json` | No |
487
- | `-k, --keys, --keysFile` | Azure Key Vault SPN credentials files paths | `string[]` | `['../keys.json', '[[root]]/keys.json']` | No |
488
- | `--url, --vaultUrl` | Azure Key Vault server URL | `string` | | Yes |
489
- | `--spn, --clientId, --id` | SPN Client ID | `string` | | Yes |
490
- | `-p --password, --pass, --clientSecret` | SPN Client Secret Password | `string` | | Yes |
491
- | `-t, --tenant` | Azure Tenant ID | `string` | | Yes |
492
- | `--mock` | Mocks Azure Key Vault client (testing purpose) | `string` | `false` | No |
484
+ | `--secretFolder` | Secret variables folder path | `string` | `[[root]]/secrets` | No |
485
+ | `--secretFile` | Secret variables file path | `string` | `[[secretFolder]]/[[env]].env.json` | No |
486
+ | `--localSecretFile` | Local secret variables file path | `string` | `[[secretFolder]]/[[env]].local.env.json` | No |
487
+ | `-k, --keys, --keysFile` | Azure Key Vault SPN credentials files paths | `string[]` | `['../keys.json', '[[root]]/keys.json']` | No |
488
+ | `--url, --vaultUrl` | Azure Key Vault server URL | `string` | | Yes |
489
+ | `--spn, --clientId, --id` | SPN Client ID | `string` | | Yes |
490
+ | `-p --password, --pass, --clientSecret` | SPN Client Secret Password | `string` | | Yes |
491
+ | `-t, --tenant` | Azure Tenant ID | `string` | | Yes |
492
+ | `--mock` | Mocks Azure Key Vault client (testing purpose) | `string` | `false` | No |
493
493
 
494
494
  <p align="right">(<a href="#top">back to top</a>)</p>
495
495
 
@@ -513,60 +513,60 @@ import { logger, readJson, writeJson } from '@achs/env/utils';
513
513
  const KEY = 'my-unique-provider-key';
514
514
 
515
515
  interface MyProviderCommandArguments extends CommandArguments {
516
- anyExtraOption: boolean;
516
+ anyExtraOption: boolean;
517
517
  }
518
518
 
519
519
  export const MyProvider: EnvProvider<MyProviderCommandArguments> = {
520
- // unique identifier for provider
521
- key: KEY,
522
-
523
- // (optional) allows to provider adds new arguments/options
524
- // to commands using yargs for builder
525
- builder: (builder) => {
526
- builder.options({
527
- anyExtraOption: {
528
- group: KEY,
529
- alias: ['a', 'aeo'],
530
- type: 'boolean',
531
- default: false,
532
- describe: 'Any option description',
533
- },
534
- });
535
- },
536
-
537
- // call on environment variables loading,
538
- // may be a Promise
539
- load: ({ env, modes, ...options }) => {
540
- if (env === 'dev')
541
- return {
542
- NODE_ENV: 'development',
543
- };
544
-
545
- // you can return a list of JSON environment variables for merge
546
- return [
547
- {
548
- NODE_ENV: 'production',
549
- },
550
- {
551
- ANY_VAR: 'ANY_VALUE',
552
- ANY_GROUP: {
553
- INNER_VAR: 12,
554
- },
555
- },
556
- ];
557
- },
558
-
559
- // (optional) call on pulling variables from provider store,
560
- // config may pass in your config file
561
- pull: ({ env, modes, ...options }, config) => {
562
- // anyway you want for pulling variables to cache
563
- },
564
-
565
- // (optional) call on pushing/updating variables to provider store,
566
- // config may pass in your config file
567
- push: ({ env, modes, ...options }, config) => {
568
- // anyway you should do for pushing or updating your variables
569
- },
520
+ // unique identifier for provider
521
+ key: KEY,
522
+
523
+ // (optional) allows to provider adds new arguments/options
524
+ // to commands using yargs for builder
525
+ builder: (builder) => {
526
+ builder.options({
527
+ anyExtraOption: {
528
+ group: KEY,
529
+ alias: ['a', 'aeo'],
530
+ type: 'boolean',
531
+ default: false,
532
+ describe: 'Any option description',
533
+ },
534
+ });
535
+ },
536
+
537
+ // call on environment variables loading,
538
+ // may be a Promise
539
+ load: ({ env, modes, ...options }) => {
540
+ if (env === 'dev')
541
+ return {
542
+ NODE_ENV: 'development',
543
+ };
544
+
545
+ // you can return a list of JSON environment variables for merge
546
+ return [
547
+ {
548
+ NODE_ENV: 'production',
549
+ },
550
+ {
551
+ ANY_VAR: 'ANY_VALUE',
552
+ ANY_GROUP: {
553
+ INNER_VAR: 12,
554
+ },
555
+ },
556
+ ];
557
+ },
558
+
559
+ // (optional) call on pulling variables from provider store,
560
+ // config may pass in your config file
561
+ pull: ({ env, modes, ...options }, config) => {
562
+ // anyway you want for pulling variables to cache
563
+ },
564
+
565
+ // (optional) call on pushing/updating variables to provider store,
566
+ // config may pass in your config file
567
+ push: ({ env, modes, ...options }, config) => {
568
+ // anyway you should do for pushing or updating your variables
569
+ },
570
570
  };
571
571
  ```
572
572
 
@@ -580,45 +580,45 @@ You can configure any config argument inside you config file, but commonly provi
580
580
 
581
581
  ```javascript
582
582
  {
583
- "log": "silly",
584
- // will hide values of keys SECRET and MY_API_KEY in logging
585
- "logMaskValuesOfKeys": ["SECRET", "MY_API_KEY"],
586
- // integrated providers and custom providers together
587
- "providers": [
588
- {
589
- "path": "package-json"
590
- },
591
- {
592
- "path": "app-settings"
593
- },
594
- {
595
- "path": "azure-key-vault",
596
- "config": {
597
- "dev": {
598
- "vaultUrl": "https://kv-desa-ittec-sti.vault.azure.net"
599
- },
600
- "qa": {
601
- "vaultUrl": "https://kv-qa-ittec-sti.vault.azure.net"
602
- }
603
- }
604
- },
605
- {
606
- "path": "local"
607
- },
608
- {
609
- // custom NPM package
610
- "path": "@npm-package",
611
- "type": "module",
612
- "config": {
613
- "any-config": "any value"
614
- }
615
- },
616
- {
617
- // custom script inside project
618
- "path": "scripts/custom-loader.js",
619
- "type": "script"
620
- }
621
- ]
583
+ "log": "silly",
584
+ // will hide values of keys SECRET and MY_API_KEY in logging
585
+ "logMaskValuesOfKeys": ["SECRET", "MY_API_KEY"],
586
+ // integrated providers and custom providers together
587
+ "providers": [
588
+ {
589
+ "path": "package-json"
590
+ },
591
+ {
592
+ "path": "app-settings"
593
+ },
594
+ {
595
+ "path": "azure-key-vault",
596
+ "config": {
597
+ "dev": {
598
+ "vaultUrl": "https://kv-desa-ittec-sti.vault.azure.net"
599
+ },
600
+ "qa": {
601
+ "vaultUrl": "https://kv-qa-ittec-sti.vault.azure.net"
602
+ }
603
+ }
604
+ },
605
+ {
606
+ "path": "local"
607
+ },
608
+ {
609
+ // custom NPM package
610
+ "path": "@npm-package",
611
+ "type": "module",
612
+ "config": {
613
+ "any-config": "any value"
614
+ }
615
+ },
616
+ {
617
+ // custom script inside project
618
+ "path": "scripts/custom-loader.js",
619
+ "type": "script"
620
+ }
621
+ ]
622
622
  }
623
623
  ```
624
624
 
@@ -658,13 +658,13 @@ Your `keys.json` file should contains you Azure Key Vault SPN credentials per en
658
658
 
659
659
  ```json
660
660
  {
661
- "<env-name>": {
662
- "vaultUrl": "<azure-key-vault-url>", // you can skip this var if present in config
663
- "clientId": "<spn-client-id>",
664
- "clientSecret": "<spn-secret-password>",
665
- "tenantId": "<tenant-id>"
666
- },
667
- ...
661
+ "<env-name>": {
662
+ "vaultUrl": "<azure-key-vault-url>", // you can skip this var if present in config
663
+ "clientId": "<spn-client-id>",
664
+ "clientSecret": "<spn-secret-password>",
665
+ "tenantId": "<tenant-id>"
666
+ },
667
+ ...
668
668
  }
669
669
  ```
670
670
 
@@ -672,16 +672,16 @@ In example:
672
672
 
673
673
  ```json
674
674
  {
675
- "dev": {
676
- "clientId": "f176a774-239e-4cd3-8551-88fd9fb9b441",
677
- "clientSecret": "WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku",
678
- "tenantId": "6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7"
679
- },
680
- "qa": {
681
- "clientId": "5dcd9f45-7067-4387-94d8-e5e7066ba630",
682
- "clientSecret": "60ec5e16430a46eba70dfea80d721b66",
683
- "tenantId": "6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7"
684
- }
675
+ "dev": {
676
+ "clientId": "f176a774-239e-4cd3-8551-88fd9fb9b441",
677
+ "clientSecret": "WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku",
678
+ "tenantId": "6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7"
679
+ },
680
+ "qa": {
681
+ "clientId": "5dcd9f45-7067-4387-94d8-e5e7066ba630",
682
+ "clientSecret": "60ec5e16430a46eba70dfea80d721b66",
683
+ "tenantId": "6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7"
684
+ }
685
685
  }
686
686
  ```
687
687
 
@@ -705,20 +705,20 @@ In example:
705
705
 
706
706
  ```bash
707
707
  user@machine:/mnt/c/Users/user$ AZURE_VAULT_URL=https://kv-desa-ittec-sti.vault.azure.net \
708
- AZURE_CLIENT_ID=f176a774-239e-4cd3-8551-88fd9fb9b441 \
709
- AZURE_CLIENT_SECRET=WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku \
710
- AZURE_TENANT_ID=6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7 \
711
- node_modules/.bin/env pull -e dev -o
708
+ AZURE_CLIENT_ID=f176a774-239e-4cd3-8551-88fd9fb9b441 \
709
+ AZURE_CLIENT_SECRET=WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku \
710
+ AZURE_TENANT_ID=6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7 \
711
+ node_modules/.bin/env pull -e dev -o
712
712
  ```
713
713
 
714
714
  or
715
715
 
716
716
  ```bash
717
717
  user@machine:/mnt/c/Users/user$ npx pull -e dev -o \
718
- --vaultUrl https://kv-desa-ittec-sti.vault.azure.net \
719
- --spn f176a774-239e-4cd3-8551-88fd9fb9b441 \
720
- --password WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku \
721
- --tenant 6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7
718
+ --vaultUrl https://kv-desa-ittec-sti.vault.azure.net \
719
+ --spn f176a774-239e-4cd3-8551-88fd9fb9b441 \
720
+ --password WyBwkmcL8rGQe9B2fvRLDrqDuannE4Ku \
721
+ --tenant 6d4bbe0a-5654-4c69-a682-bf7dcdaed8e7
722
722
  ```
723
723
 
724
724
  ## 4. Schema
@@ -742,23 +742,23 @@ separation) prefixing with '\$' like:
742
742
 
743
743
  ```json
744
744
  {
745
- // .dev.env.json
746
- "$SHARED": "sharedValue",
747
- "GROUP1": {
748
- "$SHARED": "sharedValue2",
749
- "VAR": "anyValue1",
750
- ...
751
- },
752
- "GROUP2": {
753
- "VAR": "anyValue2",
754
- "SUBGROUP1": {
755
- "VAR": "anyValue1",
756
- ...
757
- },
758
- ...
759
- },
760
- "VAR3": "anyValue3",
761
- ...
745
+ // .dev.env.json
746
+ "$SHARED": "sharedValue",
747
+ "GROUP1": {
748
+ "$SHARED": "sharedValue2",
749
+ "VAR": "anyValue1",
750
+ ...
751
+ },
752
+ "GROUP2": {
753
+ "VAR": "anyValue2",
754
+ "SUBGROUP1": {
755
+ "VAR": "anyValue1",
756
+ ...
757
+ },
758
+ ...
759
+ },
760
+ "VAR3": "anyValue3",
761
+ ...
762
762
  }
763
763
  ```
764
764
 
@@ -822,8 +822,8 @@ For last changes see [CHANGELOG.md](CHANGELOG.md) file for details.
822
822
 
823
823
  <p align="center">
824
824
  <img
825
- width="15%"
826
- src="https://upload.wikimedia.org/wikipedia/commons/0/09/Logo_ACHS.svg"
825
+ width="15%"
826
+ src="https://upload.wikimedia.org/wikipedia/commons/0/09/Logo_ACHS.svg"
827
827
  />
828
828
  <h2 align="center">ASOCIACIÓN CHILENA DE SEGURIDAD</h2>
829
829
  <h3 align="center">Tranformación Digital ▪ Equipo de Desarrollo</h3>