@skillrecordings/cli 0.2.3 → 0.4.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.
- package/dist/{chunk-5QCJIGF3.js → chunk-TFLLCHUX.js} +23 -6
- package/dist/chunk-TFLLCHUX.js.map +1 -0
- package/dist/index.js +2526 -2601
- package/dist/index.js.map +1 -1
- package/dist/{pipeline-JELLPZAE.js → pipeline-DRKFIH73.js} +2 -2
- package/dist/preload.js +17 -57
- package/dist/preload.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5QCJIGF3.js.map +0 -1
- package/dist/chunk-MNFDM56Q.js +0 -36
- package/dist/chunk-MNFDM56Q.js.map +0 -1
- /package/dist/{pipeline-JELLPZAE.js.map → pipeline-DRKFIH73.js.map} +0 -0
package/dist/chunk-MNFDM56Q.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-WFANXVQG.js";
|
|
4
|
-
|
|
5
|
-
// src/lib/crypto.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
import {
|
|
8
|
-
Decrypter,
|
|
9
|
-
Encrypter,
|
|
10
|
-
generateIdentity,
|
|
11
|
-
identityToRecipient
|
|
12
|
-
} from "age-encryption";
|
|
13
|
-
async function generateKeypair() {
|
|
14
|
-
const privateKey = await generateIdentity();
|
|
15
|
-
const publicKey = await identityToRecipient(privateKey);
|
|
16
|
-
return { publicKey, privateKey };
|
|
17
|
-
}
|
|
18
|
-
async function encrypt(data, recipientPublicKey) {
|
|
19
|
-
const encrypter = new Encrypter();
|
|
20
|
-
encrypter.addRecipient(recipientPublicKey);
|
|
21
|
-
const input = typeof data === "string" ? data : new TextDecoder().decode(data);
|
|
22
|
-
return encrypter.encrypt(input);
|
|
23
|
-
}
|
|
24
|
-
async function decrypt(encrypted, privateKey) {
|
|
25
|
-
const decrypter = new Decrypter();
|
|
26
|
-
decrypter.addIdentity(privateKey);
|
|
27
|
-
const input = encrypted instanceof Buffer ? new Uint8Array(encrypted) : encrypted;
|
|
28
|
-
return decrypter.decrypt(input, "text");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
generateKeypair,
|
|
33
|
-
encrypt,
|
|
34
|
-
decrypt
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-MNFDM56Q.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/crypto.ts"],"sourcesContent":["import {\n Decrypter,\n Encrypter,\n generateIdentity,\n identityToRecipient,\n} from 'age-encryption'\n\nexport interface Keypair {\n publicKey: string\n privateKey: string\n}\n\n/**\n * Generate an age keypair\n * @returns Keypair with publicKey (age1...) and privateKey (AGE-SECRET-KEY-1...)\n */\nexport async function generateKeypair(): Promise<Keypair> {\n const privateKey = await generateIdentity()\n const publicKey = await identityToRecipient(privateKey)\n return { publicKey, privateKey }\n}\n\n/**\n * Encrypt data with an age public key\n * @param data - String or Buffer to encrypt\n * @param recipientPublicKey - age public key (age1...)\n * @returns Encrypted data as Uint8Array\n */\nexport async function encrypt(\n data: string | Buffer,\n recipientPublicKey: string\n): Promise<Uint8Array> {\n const encrypter = new Encrypter()\n encrypter.addRecipient(recipientPublicKey)\n\n const input = typeof data === 'string' ? data : new TextDecoder().decode(data)\n return encrypter.encrypt(input)\n}\n\n/**\n * Decrypt data with an age private key\n * @param encrypted - Encrypted data as Uint8Array or Buffer\n * @param privateKey - age private key (AGE-SECRET-KEY-1...)\n * @returns Decrypted data as string\n */\nexport async function decrypt(\n encrypted: Uint8Array | Buffer,\n privateKey: string\n): Promise<string> {\n const decrypter = new Decrypter()\n decrypter.addIdentity(privateKey)\n\n const input =\n encrypted instanceof Buffer ? new Uint8Array(encrypted) : encrypted\n return decrypter.decrypt(input, 'text')\n}\n"],"mappings":";;;;;AAAA;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWP,eAAsB,kBAAoC;AACxD,QAAM,aAAa,MAAM,iBAAiB;AAC1C,QAAM,YAAY,MAAM,oBAAoB,UAAU;AACtD,SAAO,EAAE,WAAW,WAAW;AACjC;AAQA,eAAsB,QACpB,MACA,oBACqB;AACrB,QAAM,YAAY,IAAI,UAAU;AAChC,YAAU,aAAa,kBAAkB;AAEzC,QAAM,QAAQ,OAAO,SAAS,WAAW,OAAO,IAAI,YAAY,EAAE,OAAO,IAAI;AAC7E,SAAO,UAAU,QAAQ,KAAK;AAChC;AAQA,eAAsB,QACpB,WACA,YACiB;AACjB,QAAM,YAAY,IAAI,UAAU;AAChC,YAAU,YAAY,UAAU;AAEhC,QAAM,QACJ,qBAAqB,SAAS,IAAI,WAAW,SAAS,IAAI;AAC5D,SAAO,UAAU,QAAQ,OAAO,MAAM;AACxC;","names":[]}
|
|
File without changes
|