itrm-tools 1.3.51 → 1.3.52

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.
@@ -1,15 +1,17 @@
1
1
  #!/usr/bin/env node
2
- const { encryptEnvFile } = require("../dist/env/EnvDecryption");
2
+ const { deriveKey, encryptEnvFile } = require("../dist/env/EnvDecryption");
3
3
 
4
- const secretKey = process.argv[2];
5
- if (secretKey) {
4
+ const masterKey = process.argv[2];
5
+ const serviceName = process.argv[3];
6
+ if (masterKey) {
7
+ const key = serviceName ? deriveKey(masterKey, serviceName) : masterKey;
6
8
  try {
7
- const encPath = encryptEnvFile(secretKey);
9
+ const encPath = encryptEnvFile(key);
8
10
  console.log(".env.enc creado en", encPath);
9
11
  process.exit(0);
10
12
  } catch (err) {
11
13
  console.error("Error:", err.message);
12
14
  }
13
15
  }
14
- console.error("Uso: encrypt-env <SECRET_KEY>");
16
+ console.error("Uso: encrypt-env <KEY> [SERVICE_NAME]");
15
17
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itrm-tools",
3
- "version": "1.3.51",
3
+ "version": "1.3.52",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",