alex-c-line 1.17.1 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -10
- package/dist/index.js +7 -12
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -39,8 +39,6 @@ let dotenv = require("dotenv");
|
|
|
39
39
|
dotenv = __toESM(dotenv);
|
|
40
40
|
let dotenv_stringify = require("dotenv-stringify");
|
|
41
41
|
dotenv_stringify = __toESM(dotenv_stringify);
|
|
42
|
-
let libsodium_wrappers = require("libsodium-wrappers");
|
|
43
|
-
libsodium_wrappers = __toESM(libsodium_wrappers);
|
|
44
42
|
let node_os = require("node:os");
|
|
45
43
|
node_os = __toESM(node_os);
|
|
46
44
|
let zod = require("zod");
|
|
@@ -359,13 +357,9 @@ var edit_env_default = editEnv;
|
|
|
359
357
|
//#endregion
|
|
360
358
|
//#region src/commands/encrypt-with-key.ts
|
|
361
359
|
function encryptWithKey(program$1) {
|
|
362
|
-
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<
|
|
360
|
+
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<publicKey>", "The public base64 key to encrypt with").argument("<plaintextValue>", "The value to encrypt in plaintext").action(async (publicKey, plaintextValue) => {
|
|
363
361
|
try {
|
|
364
|
-
await
|
|
365
|
-
const base64Key = libsodium_wrappers.default.from_base64(key, libsodium_wrappers.default.base64_variants.ORIGINAL);
|
|
366
|
-
const encryptedValue = libsodium_wrappers.default.crypto_box_seal(value, base64Key);
|
|
367
|
-
const encryptedBase64Value = libsodium_wrappers.default.to_base64(encryptedValue, libsodium_wrappers.default.base64_variants.ORIGINAL);
|
|
368
|
-
console.info(encryptedBase64Value);
|
|
362
|
+
console.info(await (0, _alextheman_utility.encryptWithKey)(publicKey, plaintextValue));
|
|
369
363
|
} catch {
|
|
370
364
|
program$1.error("Encryption failed. Please double-check that the given key is a valid base 64 string.", {
|
|
371
365
|
exitCode: 1,
|
|
@@ -722,7 +716,7 @@ var commands_default = createCommands;
|
|
|
722
716
|
|
|
723
717
|
//#endregion
|
|
724
718
|
//#region package.json
|
|
725
|
-
var version = "1.17.
|
|
719
|
+
var version = "1.17.2";
|
|
726
720
|
var package_default = {
|
|
727
721
|
name: "alex-c-line",
|
|
728
722
|
version,
|
|
@@ -787,7 +781,7 @@ var package_default = {
|
|
|
787
781
|
"use-local-utility": "pnpm run prepare-local-utility"
|
|
788
782
|
},
|
|
789
783
|
dependencies: {
|
|
790
|
-
"@alextheman/utility": "^4.
|
|
784
|
+
"@alextheman/utility": "^4.5.1",
|
|
791
785
|
"commander": "^14.0.2",
|
|
792
786
|
"dotenv": "^17.2.3",
|
|
793
787
|
"dotenv-stringify": "^3.0.1",
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,10 @@ import updateNotifier from "update-notifier";
|
|
|
5
5
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
|
-
import { DataError, VersionNumber, kebabToCamel, normaliseIndents, parseVersionType, parseZodSchema } from "@alextheman/utility";
|
|
8
|
+
import { DataError, VersionNumber, encryptWithKey, kebabToCamel, normaliseIndents, parseVersionType, parseZodSchema } from "@alextheman/utility";
|
|
9
9
|
import { ExecaError, execa } from "execa";
|
|
10
10
|
import dotenv from "dotenv";
|
|
11
11
|
import dotenvStringify from "dotenv-stringify";
|
|
12
|
-
import sodium from "libsodium-wrappers";
|
|
13
12
|
import os from "node:os";
|
|
14
13
|
import z from "zod";
|
|
15
14
|
import { pathToFileURL } from "node:url";
|
|
@@ -324,14 +323,10 @@ var edit_env_default = editEnv;
|
|
|
324
323
|
|
|
325
324
|
//#endregion
|
|
326
325
|
//#region src/commands/encrypt-with-key.ts
|
|
327
|
-
function encryptWithKey(program$1) {
|
|
328
|
-
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<
|
|
326
|
+
function encryptWithKey$1(program$1) {
|
|
327
|
+
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<publicKey>", "The public base64 key to encrypt with").argument("<plaintextValue>", "The value to encrypt in plaintext").action(async (publicKey, plaintextValue) => {
|
|
329
328
|
try {
|
|
330
|
-
await
|
|
331
|
-
const base64Key = sodium.from_base64(key, sodium.base64_variants.ORIGINAL);
|
|
332
|
-
const encryptedValue = sodium.crypto_box_seal(value, base64Key);
|
|
333
|
-
const encryptedBase64Value = sodium.to_base64(encryptedValue, sodium.base64_variants.ORIGINAL);
|
|
334
|
-
console.info(encryptedBase64Value);
|
|
329
|
+
console.info(await encryptWithKey(publicKey, plaintextValue));
|
|
335
330
|
} catch {
|
|
336
331
|
program$1.error("Encryption failed. Please double-check that the given key is a valid base 64 string.", {
|
|
337
332
|
exitCode: 1,
|
|
@@ -340,7 +335,7 @@ function encryptWithKey(program$1) {
|
|
|
340
335
|
}
|
|
341
336
|
});
|
|
342
337
|
}
|
|
343
|
-
var encrypt_with_key_default = encryptWithKey;
|
|
338
|
+
var encrypt_with_key_default = encryptWithKey$1;
|
|
344
339
|
|
|
345
340
|
//#endregion
|
|
346
341
|
//#region src/commands/get-version-type.ts
|
|
@@ -688,7 +683,7 @@ var commands_default = createCommands;
|
|
|
688
683
|
|
|
689
684
|
//#endregion
|
|
690
685
|
//#region package.json
|
|
691
|
-
var version = "1.17.
|
|
686
|
+
var version = "1.17.2";
|
|
692
687
|
var package_default = {
|
|
693
688
|
name: "alex-c-line",
|
|
694
689
|
version,
|
|
@@ -753,7 +748,7 @@ var package_default = {
|
|
|
753
748
|
"use-local-utility": "pnpm run prepare-local-utility"
|
|
754
749
|
},
|
|
755
750
|
dependencies: {
|
|
756
|
-
"@alextheman/utility": "^4.
|
|
751
|
+
"@alextheman/utility": "^4.5.1",
|
|
757
752
|
"commander": "^14.0.2",
|
|
758
753
|
"dotenv": "^17.2.3",
|
|
759
754
|
"dotenv-stringify": "^3.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@alextheman/utility": "^4.
|
|
36
|
+
"@alextheman/utility": "^4.5.1",
|
|
37
37
|
"commander": "^14.0.2",
|
|
38
38
|
"dotenv": "^17.2.3",
|
|
39
39
|
"dotenv-stringify": "^3.0.1",
|