@frogbotai/piece-crypto 0.22.0 → 0.24.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 (34) hide show
  1. package/README.md +25 -0
  2. package/dist/actions/decodeBase64.d.ts +17 -0
  3. package/dist/actions/decodeBase64.d.ts.map +1 -0
  4. package/dist/actions/decodeBase64.js +13 -0
  5. package/dist/actions/decodeBase64.js.map +1 -0
  6. package/dist/actions/encodeBase64.d.ts +17 -0
  7. package/dist/actions/encodeBase64.d.ts.map +1 -0
  8. package/dist/actions/encodeBase64.js +13 -0
  9. package/dist/actions/encodeBase64.js.map +1 -0
  10. package/dist/actions/encryptFile.d.ts +34 -0
  11. package/dist/actions/encryptFile.d.ts.map +1 -0
  12. package/dist/actions/encryptFile.js +85 -0
  13. package/dist/actions/encryptFile.js.map +1 -0
  14. package/dist/actions/generateHmac.d.ts +47 -0
  15. package/dist/actions/generateHmac.d.ts.map +1 -0
  16. package/dist/actions/generateHmac.js +21 -0
  17. package/dist/actions/generateHmac.js.map +1 -0
  18. package/dist/actions/generatePassword.d.ts +25 -0
  19. package/dist/actions/generatePassword.d.ts.map +1 -0
  20. package/dist/actions/generatePassword.js +27 -0
  21. package/dist/actions/generatePassword.js.map +1 -0
  22. package/dist/actions/generateRsaSignature.d.ts +39 -0
  23. package/dist/actions/generateRsaSignature.d.ts.map +1 -0
  24. package/dist/actions/generateRsaSignature.js +25 -0
  25. package/dist/actions/generateRsaSignature.js.map +1 -0
  26. package/dist/actions/hashText.d.ts +29 -0
  27. package/dist/actions/hashText.d.ts.map +1 -0
  28. package/dist/actions/hashText.js +17 -0
  29. package/dist/actions/hashText.js.map +1 -0
  30. package/dist/index.d.ts +174 -19
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +22 -37
  33. package/dist/index.js.map +1 -1
  34. package/package.json +6 -5
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # `@frogbotai/piece-crypto`
2
+
3
+ Hash, sign, encode, encrypt, and generate secure values without external credentials.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { createCrypto } from '@frogbotai/piece-crypto';
9
+
10
+ export const crypto = createCrypto();
11
+ ```
12
+
13
+ ## Actions
14
+
15
+ | Upstream action slug | Previous wrapper export | Native action | Notes |
16
+ | -------------------- | ----------------------- | ---------------------- | ------------------------------------------------ |
17
+ | `hash-text` | `hashText` | `hashText` | |
18
+ | `hmac-signature` | `hmacSignature` | `generateHmac` | |
19
+ | `rsa-signature` | `rsaSignature` | `generateRsaSignature` | Omitted from the previous default action list. |
20
+ | `generate-password` | `generatePassword` | `generatePassword` | Uses cryptographically secure randomness. |
21
+ | `base64-decode` | `base64Decode` | `decodeBase64` | |
22
+ | `base64-encode` | `base64Encode` | `encodeBase64` | |
23
+ | `openpgpEncrypt` | `openpgpEncrypt` | `encryptFile` | Accepts and returns configured FrogBot file IDs. |
24
+
25
+ The upstream piece registers no triggers.
@@ -0,0 +1,17 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ text: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const decodeBase64: {
7
+ slug: string;
8
+ label: string;
9
+ description: string;
10
+ input: z.ZodObject<{
11
+ text: z.ZodString;
12
+ }, z.core.$strip>;
13
+ output: z.ZodString;
14
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=decodeBase64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;iBAAyD,CAAC;AAE3E,eAAO,MAAM,YAAY;;;;;;;;mBAMF,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ const inputSchema = z.object({ text: z.string().meta({ label: 'Text' }) });
3
+ export const decodeBase64 = {
4
+ slug: 'decodeBase64',
5
+ label: 'Decode Base64',
6
+ description: 'Decode Base64 text as UTF-8.',
7
+ input: inputSchema,
8
+ output: z.string(),
9
+ async run({ input }) {
10
+ return Buffer.from(input.text, 'base64').toString();
11
+ },
12
+ };
13
+ //# sourceMappingURL=decodeBase64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeBase64.js","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtD,CAAC;CACF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ text: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const encodeBase64: {
7
+ slug: string;
8
+ label: string;
9
+ description: string;
10
+ input: z.ZodObject<{
11
+ text: z.ZodString;
12
+ }, z.core.$strip>;
13
+ output: z.ZodString;
14
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=encodeBase64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;iBAAyD,CAAC;AAE3E,eAAO,MAAM,YAAY;;;;;;;;mBAMF,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ const inputSchema = z.object({ text: z.string().meta({ label: 'Text' }) });
3
+ export const encodeBase64 = {
4
+ slug: 'encodeBase64',
5
+ label: 'Encode Base64',
6
+ description: 'Encode UTF-8 text as Base64.',
7
+ input: inputSchema,
8
+ output: z.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/),
9
+ async run({ input }) {
10
+ return Buffer.from(input.text).toString('base64');
11
+ },
12
+ };
13
+ //# sourceMappingURL=encodeBase64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeBase64.js","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kEAAkE,CAAC;IAC5F,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;CACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
5
+ publicKey: z.ZodString;
6
+ }, z.core.$strip>;
7
+ declare const output: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ success: z.ZodLiteral<true>;
9
+ filename: z.ZodString;
10
+ file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ success: z.ZodLiteral<false>;
13
+ error: z.ZodString;
14
+ }, z.core.$strip>], "success">;
15
+ export declare const encryptFile: {
16
+ slug: string;
17
+ label: string;
18
+ description: string;
19
+ input: z.ZodObject<{
20
+ file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
21
+ publicKey: z.ZodString;
22
+ }, z.core.$strip>;
23
+ output: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ success: z.ZodLiteral<true>;
25
+ filename: z.ZodString;
26
+ file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ success: z.ZodLiteral<false>;
29
+ error: z.ZodString;
30
+ }, z.core.$strip>], "success">;
31
+ run({ input, req, }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<z.output<typeof output>>;
32
+ };
33
+ export {};
34
+ //# sourceMappingURL=encryptFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryptFile.d.ts","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AACH,QAAA,MAAM,MAAM;;;;;;;8BAGV,CAAC;AA6CH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;yBASnB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,OAAO,CACxE,CAAC,CAAC,MAAM,CAAC,OAAO,MAAM,CAAC,CACxB;CAmCF,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { createMessage, encrypt, readKey } from 'openpgp';
2
+ import { z } from 'zod';
3
+ const fileId = z.union([z.string(), z.number()]);
4
+ const inputSchema = z.object({
5
+ file: fileId.meta({ label: 'File' }),
6
+ publicKey: z.string().meta({ label: 'Public Key' }),
7
+ });
8
+ const output = z.discriminatedUnion('success', [
9
+ z.object({ success: z.literal(true), filename: z.string().min(1), file: fileId }),
10
+ z.object({ success: z.literal(false), error: z.string().min(1) }),
11
+ ]);
12
+ async function loadFile(req, id) {
13
+ const collection = req.frogbot.config.files?.slug;
14
+ if (!collection) {
15
+ throw new Error('Crypto file encryption requires a configured files collection.');
16
+ }
17
+ const doc = await req.frogbot.findByID({ collection, id, depth: 0, req, overrideAccess: false });
18
+ if (typeof doc.url !== 'string')
19
+ throw new Error(`File '${id}' is unavailable.`);
20
+ const config = await req.frogbot.config._internal.payloadConfig;
21
+ const base = new URL(config.serverURL || req.url);
22
+ const url = new URL(doc.url, base);
23
+ if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password) {
24
+ throw new Error('Invalid file URL.');
25
+ }
26
+ const headers = new Headers();
27
+ if (url.origin === base.origin) {
28
+ for (const name of ['authorization', 'cookie']) {
29
+ const value = req.headers.get(name);
30
+ if (value)
31
+ headers.set(name, value);
32
+ }
33
+ }
34
+ const response = await fetch(url, {
35
+ headers,
36
+ signal: req.signal ?? undefined,
37
+ redirect: 'error',
38
+ });
39
+ if (!response.ok)
40
+ throw new Error(`File '${id}' is unavailable (${response.status}).`);
41
+ return {
42
+ data: new Uint8Array(await response.arrayBuffer()),
43
+ name: String(doc.filename ?? 'file'),
44
+ };
45
+ }
46
+ export const encryptFile = {
47
+ slug: 'encryptFile',
48
+ label: 'Encrypt File',
49
+ description: 'Encrypt a file with an ASCII-armored OpenPGP public key.',
50
+ input: inputSchema,
51
+ output,
52
+ async run({ input, req, }) {
53
+ try {
54
+ const source = await loadFile(req, input.file);
55
+ const publicKey = await readKey({ armoredKey: input.publicKey });
56
+ const encrypted = await encrypt({
57
+ message: await createMessage({ binary: source.data }),
58
+ encryptionKeys: publicKey,
59
+ format: 'armored',
60
+ });
61
+ const filename = `${source.name}.pgp`;
62
+ const data = Buffer.from(encrypted);
63
+ const collection = req.frogbot.config.files?.slug;
64
+ if (!collection) {
65
+ throw new Error('Crypto file encryption requires a configured files collection.');
66
+ }
67
+ req.signal?.throwIfAborted();
68
+ const doc = await req.frogbot.create({
69
+ collection,
70
+ data: {},
71
+ req,
72
+ file: { data, mimetype: 'application/pgp-encrypted', name: filename, size: data.length },
73
+ overrideAccess: false,
74
+ });
75
+ return { success: true, filename, file: doc.id };
76
+ }
77
+ catch (error) {
78
+ return {
79
+ success: false,
80
+ error: error instanceof Error ? error.message : 'Encryption failed',
81
+ };
82
+ }
83
+ },
84
+ };
85
+ //# sourceMappingURL=encryptFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryptFile.js","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"AAEA,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MAAM,EAAE,cAAc,EAAE,CAAC;YAE7B,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;gBACnC,UAAU;gBACV,IAAI,EAAE,EAAE;gBACR,GAAG;gBACH,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,2BAA2B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;gBACxF,cAAc,EAAE,KAAK;aACtB,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB;aACpE,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ secretKey: z.ZodString;
5
+ secretKeyEncoding: z.ZodEnum<{
6
+ "utf-8": "utf-8";
7
+ base64: "base64";
8
+ hex: "hex";
9
+ }>;
10
+ method: z.ZodEnum<{
11
+ md5: "md5";
12
+ sha256: "sha256";
13
+ sha512: "sha512";
14
+ }>;
15
+ text: z.ZodString;
16
+ outputEncoding: z.ZodDefault<z.ZodEnum<{
17
+ base64: "base64";
18
+ hex: "hex";
19
+ }>>;
20
+ }, z.core.$strip>;
21
+ export declare const generateHmac: {
22
+ slug: string;
23
+ label: string;
24
+ description: string;
25
+ input: z.ZodObject<{
26
+ secretKey: z.ZodString;
27
+ secretKeyEncoding: z.ZodEnum<{
28
+ "utf-8": "utf-8";
29
+ base64: "base64";
30
+ hex: "hex";
31
+ }>;
32
+ method: z.ZodEnum<{
33
+ md5: "md5";
34
+ sha256: "sha256";
35
+ sha512: "sha512";
36
+ }>;
37
+ text: z.ZodString;
38
+ outputEncoding: z.ZodDefault<z.ZodEnum<{
39
+ base64: "base64";
40
+ hex: "hex";
41
+ }>>;
42
+ }, z.core.$strip>;
43
+ output: z.ZodString;
44
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
45
+ };
46
+ export {};
47
+ //# sourceMappingURL=generateHmac.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateHmac.d.ts","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;iBAMf,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;mBAMF,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAKnF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { createHmac } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ const inputSchema = z.object({
4
+ secretKey: z.string().meta({ label: 'Secret Key', secret: true }),
5
+ secretKeyEncoding: z.enum(['utf-8', 'hex', 'base64']).meta({ label: 'Secret Key Encoding' }),
6
+ method: z.enum(['md5', 'sha256', 'sha512']).meta({ label: 'Method' }),
7
+ text: z.string().meta({ label: 'Text', description: 'The text to sign' }),
8
+ outputEncoding: z.enum(['hex', 'base64']).default('hex').meta({ label: 'Output Encoding' }),
9
+ });
10
+ export const generateHmac = {
11
+ slug: 'generateHmac',
12
+ label: 'Generate HMAC',
13
+ description: 'Generate a keyed hash-based message authentication code.',
14
+ input: inputSchema,
15
+ output: z.string().min(1),
16
+ async run({ input }) {
17
+ const key = Buffer.from(input.secretKey, input.secretKeyEncoding);
18
+ return createHmac(input.method, key).update(input.text).digest(input.outputEncoding);
19
+ },
20
+ };
21
+ //# sourceMappingURL=generateHmac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateHmac.js","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACjE,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC5F,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACrE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IACzE,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAElE,OAAO,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACvF,CAAC;CACF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ length: z.ZodNumber;
5
+ characterSet: z.ZodDefault<z.ZodEnum<{
6
+ alphanumeric: "alphanumeric";
7
+ "alphanumeric-symbols": "alphanumeric-symbols";
8
+ }>>;
9
+ }, z.core.$strip>;
10
+ export declare const generatePassword: {
11
+ slug: string;
12
+ label: string;
13
+ description: string;
14
+ input: z.ZodObject<{
15
+ length: z.ZodNumber;
16
+ characterSet: z.ZodDefault<z.ZodEnum<{
17
+ alphanumeric: "alphanumeric";
18
+ "alphanumeric-symbols": "alphanumeric-symbols";
19
+ }>>;
20
+ }, z.core.$strip>;
21
+ output: z.ZodString;
22
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
23
+ };
24
+ export {};
25
+ //# sourceMappingURL=generatePassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePassword.d.ts","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,WAAW;;;;;;iBAMf,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;mBAMN,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAWnF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { randomInt } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ const alphanumeric = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
4
+ const symbols = '!@#$%^&*()_+~`|}{[]:;?><,./-=';
5
+ const inputSchema = z.object({
6
+ length: z.number().int().min(0).max(256).meta({ label: 'Password Length' }),
7
+ characterSet: z
8
+ .enum(['alphanumeric', 'alphanumeric-symbols'])
9
+ .default('alphanumeric')
10
+ .meta({ label: 'Character Set' }),
11
+ });
12
+ export const generatePassword = {
13
+ slug: 'generatePassword',
14
+ label: 'Generate Password',
15
+ description: 'Generate a cryptographically secure random password.',
16
+ input: inputSchema,
17
+ output: z.string().max(256),
18
+ async run({ input }) {
19
+ const characters = input.characterSet === 'alphanumeric' ? alphanumeric : alphanumeric + symbols;
20
+ let password = '';
21
+ for (let index = 0; index < input.length; index++) {
22
+ password += characters[randomInt(characters.length)];
23
+ }
24
+ return password;
25
+ },
26
+ };
27
+ //# sourceMappingURL=generatePassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePassword.js","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG,gEAAgE,CAAC;AACtF,MAAM,OAAO,GAAG,+BAA+B,CAAC;AAChD,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3E,YAAY,EAAE,CAAC;SACZ,IAAI,CAAC,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;SAC9C,OAAO,CAAC,cAAc,CAAC;SACvB,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3B,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,MAAM,UAAU,GACd,KAAK,CAAC,YAAY,KAAK,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,GAAG,OAAO,CAAC;QAChF,IAAI,QAAQ,GAAG,EAAE,CAAC;QAElB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YAClD,QAAQ,IAAI,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ privateKey: z.ZodString;
5
+ passphrase: z.ZodOptional<z.ZodString>;
6
+ method: z.ZodDefault<z.ZodEnum<{
7
+ sha256: "sha256";
8
+ sha512: "sha512";
9
+ sha384: "sha384";
10
+ }>>;
11
+ text: z.ZodString;
12
+ outputEncoding: z.ZodDefault<z.ZodEnum<{
13
+ base64: "base64";
14
+ hex: "hex";
15
+ }>>;
16
+ }, z.core.$strip>;
17
+ export declare const generateRsaSignature: {
18
+ slug: string;
19
+ label: string;
20
+ description: string;
21
+ input: z.ZodObject<{
22
+ privateKey: z.ZodString;
23
+ passphrase: z.ZodOptional<z.ZodString>;
24
+ method: z.ZodDefault<z.ZodEnum<{
25
+ sha256: "sha256";
26
+ sha512: "sha512";
27
+ sha384: "sha384";
28
+ }>>;
29
+ text: z.ZodString;
30
+ outputEncoding: z.ZodDefault<z.ZodEnum<{
31
+ base64: "base64";
32
+ hex: "hex";
33
+ }>>;
34
+ }, z.core.$strip>;
35
+ output: z.ZodString;
36
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
37
+ };
38
+ export {};
39
+ //# sourceMappingURL=generateRsaSignature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRsaSignature.d.ts","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;iBAMf,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;mBAMV,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAUnF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { createSign } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ const inputSchema = z.object({
4
+ privateKey: z.string().meta({ label: 'Private Key', secret: true }),
5
+ passphrase: z.string().optional().meta({ label: 'Passphrase', secret: true }),
6
+ method: z.enum(['sha256', 'sha384', 'sha512']).default('sha256').meta({ label: 'Method' }),
7
+ text: z.string().meta({ label: 'Text', description: 'The text to sign' }),
8
+ outputEncoding: z.enum(['base64', 'hex']).default('base64').meta({ label: 'Output Encoding' }),
9
+ });
10
+ export const generateRsaSignature = {
11
+ slug: 'generateRsaSignature',
12
+ label: 'Generate RSA Signature',
13
+ description: 'Sign text with an RSA private key.',
14
+ input: inputSchema,
15
+ output: z.string().min(1),
16
+ async run({ input }) {
17
+ const signer = createSign(input.method).update(input.text);
18
+ const key = input.passphrase
19
+ ? { key: input.privateKey, passphrase: input.passphrase }
20
+ : input.privateKey;
21
+ signer.end();
22
+ return signer.sign(key, input.outputEncoding);
23
+ },
24
+ };
25
+ //# sourceMappingURL=generateRsaSignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRsaSignature.js","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7E,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC1F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IACzE,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU;YAC1B,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE;YACzD,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;QAErB,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;CACF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import { z } from 'zod';
3
+ declare const inputSchema: z.ZodObject<{
4
+ method: z.ZodEnum<{
5
+ md5: "md5";
6
+ sha256: "sha256";
7
+ sha512: "sha512";
8
+ "sha3-512": "sha3-512";
9
+ }>;
10
+ text: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export declare const hashText: {
13
+ slug: string;
14
+ label: string;
15
+ description: string;
16
+ input: z.ZodObject<{
17
+ method: z.ZodEnum<{
18
+ md5: "md5";
19
+ sha256: "sha256";
20
+ sha512: "sha512";
21
+ "sha3-512": "sha3-512";
22
+ }>;
23
+ text: z.ZodString;
24
+ }, z.core.$strip>;
25
+ output: z.ZodString;
26
+ run({ input }: PieceRunArgs<z.output<typeof inputSchema>, object, undefined>): Promise<string>;
27
+ };
28
+ export {};
29
+ //# sourceMappingURL=hashText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashText.d.ts","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;;;;;;iBAGf,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;mBAME,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC;CAGnF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ const inputSchema = z.object({
4
+ method: z.enum(['md5', 'sha256', 'sha512', 'sha3-512']).meta({ label: 'Method' }),
5
+ text: z.string().meta({ label: 'Text', description: 'The text to hash' }),
6
+ });
7
+ export const hashText = {
8
+ slug: 'hashText',
9
+ label: 'Hash Text',
10
+ description: 'Hash text with a selected digest algorithm.',
11
+ input: inputSchema,
12
+ output: z.string().regex(/^[a-f0-9]+$/),
13
+ async run({ input }) {
14
+ return createHash(input.method).update(input.text).digest('hex');
15
+ },
16
+ };
17
+ //# sourceMappingURL=hashText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashText.js","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IACjF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAC1E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;IACvC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAiE;QAChF,OAAO,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,CAAC;CACF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,20 +1,175 @@
1
- import { type PieceFactoryConfig } from 'frogbot/pieces';
2
- export declare const cryptoActions: readonly ["hash-text", "hmac-signature", "generate-password", "base64-decode", "base64-encode", "openpgpEncrypt"];
3
- export declare const cryptoScopes: readonly [];
4
- export declare function createCrypto(config?: PieceFactoryConfig): import("frogbot/pieces").Piece & {
5
- /** Text to Hash: Converts text to a hash value using various hashing algorithms */
6
- hashText: import("node_modules/frogbot/dist/tools/types").AnyTool;
7
- /** Generate HMAC Signature: Converts text to a HMAC signed hash value using various hashing algorithms */
8
- hmacSignature: import("node_modules/frogbot/dist/tools/types").AnyTool;
9
- /** Generate RSA Signature: Signs text with an RSA private key using SHA-256, SHA-384, or SHA-512 (RSA-SHA256 by default) */
10
- rsaSignature: import("node_modules/frogbot/dist/tools/types").AnyTool;
11
- /** Generate Password: Generates a random password with the specified length */
12
- generatePassword: import("node_modules/frogbot/dist/tools/types").AnyTool;
13
- /** Base64 Decode: Converts base64 text back to plain text. */
14
- base64Decode: import("node_modules/frogbot/dist/tools/types").AnyTool;
15
- /** Base64 Encode: Converts plain text into base64 format. */
16
- base64Encode: import("node_modules/frogbot/dist/tools/types").AnyTool;
17
- /** OpenPGP Encrypt: Encrypt a file using OpenPGP public key */
18
- openpgpEncrypt: import("node_modules/frogbot/dist/tools/types").AnyTool;
19
- };
1
+ export declare const createCrypto: import("frogbot").PieceFactory<{
2
+ readonly slug: "crypto";
3
+ readonly label: "Crypto";
4
+ readonly admin: {
5
+ readonly description: "Hash, sign, encode, encrypt, and generate secure values";
6
+ readonly group: "Core";
7
+ };
8
+ readonly actions: readonly [{
9
+ slug: string;
10
+ label: string;
11
+ description: string;
12
+ input: import("zod").ZodObject<{
13
+ method: import("zod").ZodEnum<{
14
+ md5: "md5";
15
+ sha256: "sha256";
16
+ sha512: "sha512";
17
+ "sha3-512": "sha3-512";
18
+ }>;
19
+ text: import("zod").ZodString;
20
+ }, import("zod/v4/core").$strip>;
21
+ output: import("zod").ZodString;
22
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
23
+ method: import("zod").ZodEnum<{
24
+ md5: "md5";
25
+ sha256: "sha256";
26
+ sha512: "sha512";
27
+ "sha3-512": "sha3-512";
28
+ }>;
29
+ text: import("zod").ZodString;
30
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
31
+ }, {
32
+ slug: string;
33
+ label: string;
34
+ description: string;
35
+ input: import("zod").ZodObject<{
36
+ secretKey: import("zod").ZodString;
37
+ secretKeyEncoding: import("zod").ZodEnum<{
38
+ "utf-8": "utf-8";
39
+ base64: "base64";
40
+ hex: "hex";
41
+ }>;
42
+ method: import("zod").ZodEnum<{
43
+ md5: "md5";
44
+ sha256: "sha256";
45
+ sha512: "sha512";
46
+ }>;
47
+ text: import("zod").ZodString;
48
+ outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
49
+ base64: "base64";
50
+ hex: "hex";
51
+ }>>;
52
+ }, import("zod/v4/core").$strip>;
53
+ output: import("zod").ZodString;
54
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
55
+ secretKey: import("zod").ZodString;
56
+ secretKeyEncoding: import("zod").ZodEnum<{
57
+ "utf-8": "utf-8";
58
+ base64: "base64";
59
+ hex: "hex";
60
+ }>;
61
+ method: import("zod").ZodEnum<{
62
+ md5: "md5";
63
+ sha256: "sha256";
64
+ sha512: "sha512";
65
+ }>;
66
+ text: import("zod").ZodString;
67
+ outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
68
+ base64: "base64";
69
+ hex: "hex";
70
+ }>>;
71
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
72
+ }, {
73
+ slug: string;
74
+ label: string;
75
+ description: string;
76
+ input: import("zod").ZodObject<{
77
+ privateKey: import("zod").ZodString;
78
+ passphrase: import("zod").ZodOptional<import("zod").ZodString>;
79
+ method: import("zod").ZodDefault<import("zod").ZodEnum<{
80
+ sha256: "sha256";
81
+ sha512: "sha512";
82
+ sha384: "sha384";
83
+ }>>;
84
+ text: import("zod").ZodString;
85
+ outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
86
+ base64: "base64";
87
+ hex: "hex";
88
+ }>>;
89
+ }, import("zod/v4/core").$strip>;
90
+ output: import("zod").ZodString;
91
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
92
+ privateKey: import("zod").ZodString;
93
+ passphrase: import("zod").ZodOptional<import("zod").ZodString>;
94
+ method: import("zod").ZodDefault<import("zod").ZodEnum<{
95
+ sha256: "sha256";
96
+ sha512: "sha512";
97
+ sha384: "sha384";
98
+ }>>;
99
+ text: import("zod").ZodString;
100
+ outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
101
+ base64: "base64";
102
+ hex: "hex";
103
+ }>>;
104
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
105
+ }, {
106
+ slug: string;
107
+ label: string;
108
+ description: string;
109
+ input: import("zod").ZodObject<{
110
+ length: import("zod").ZodNumber;
111
+ characterSet: import("zod").ZodDefault<import("zod").ZodEnum<{
112
+ alphanumeric: "alphanumeric";
113
+ "alphanumeric-symbols": "alphanumeric-symbols";
114
+ }>>;
115
+ }, import("zod/v4/core").$strip>;
116
+ output: import("zod").ZodString;
117
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
118
+ length: import("zod").ZodNumber;
119
+ characterSet: import("zod").ZodDefault<import("zod").ZodEnum<{
120
+ alphanumeric: "alphanumeric";
121
+ "alphanumeric-symbols": "alphanumeric-symbols";
122
+ }>>;
123
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
124
+ }, {
125
+ slug: string;
126
+ label: string;
127
+ description: string;
128
+ input: import("zod").ZodObject<{
129
+ text: import("zod").ZodString;
130
+ }, import("zod/v4/core").$strip>;
131
+ output: import("zod").ZodString;
132
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
133
+ text: import("zod").ZodString;
134
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
135
+ }, {
136
+ slug: string;
137
+ label: string;
138
+ description: string;
139
+ input: import("zod").ZodObject<{
140
+ text: import("zod").ZodString;
141
+ }, import("zod/v4/core").$strip>;
142
+ output: import("zod").ZodString;
143
+ run({ input }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
144
+ text: import("zod").ZodString;
145
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<string>;
146
+ }, {
147
+ slug: string;
148
+ label: string;
149
+ description: string;
150
+ input: import("zod").ZodObject<{
151
+ file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
152
+ publicKey: import("zod").ZodString;
153
+ }, import("zod/v4/core").$strip>;
154
+ output: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
155
+ success: import("zod").ZodLiteral<true>;
156
+ filename: import("zod").ZodString;
157
+ file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
158
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
159
+ success: import("zod").ZodLiteral<false>;
160
+ error: import("zod").ZodString;
161
+ }, import("zod/v4/core").$strip>], "success">;
162
+ run({ input, req, }: import("frogbot").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
163
+ file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
164
+ publicKey: import("zod").ZodString;
165
+ }, import("zod/v4/core").$strip>>, object, undefined>): Promise<import("zod").infer<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
166
+ success: import("zod").ZodLiteral<true>;
167
+ filename: import("zod").ZodString;
168
+ file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
169
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
170
+ success: import("zod").ZodLiteral<false>;
171
+ error: import("zod").ZodString;
172
+ }, import("zod/v4/core").$strip>], "success">>>;
173
+ }];
174
+ }>;
20
175
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAElF,eAAO,MAAM,aAAa,mHAOhB,CAAC;AACX,eAAO,MAAM,YAAY,aAAc,CAAC;AAExC,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,kBAAkB;IAUpD,mFAAmF;;IAEnF,0GAA0G;;IAE1G,4HAA4H;;IAE5H,+EAA+E;;IAE/E,8DAA8D;;IAE9D,6DAA6D;;IAE7D,+DAA+D;;EAGlE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavB,CAAC"}
package/dist/index.js CHANGED
@@ -1,38 +1,23 @@
1
- import * as module from '@activepieces/piece-crypto';
2
- import { createActivepiecesPiece } from 'frogbot/pieces';
3
- export const cryptoActions = [
4
- 'hash-text',
5
- 'hmac-signature',
6
- 'generate-password',
7
- 'base64-decode',
8
- 'base64-encode',
9
- 'openpgpEncrypt',
10
- ];
11
- export const cryptoScopes = [];
12
- export function createCrypto(config) {
13
- const piece = createActivepiecesPiece({
14
- module: module,
15
- service: 'crypto',
16
- credentialType: 'none',
17
- defaultActions: cryptoActions,
18
- scopes: cryptoScopes,
19
- config,
20
- });
21
- return Object.assign(piece, {
22
- /** Text to Hash: Converts text to a hash value using various hashing algorithms */
23
- hashText: piece.tool('hash-text'),
24
- /** Generate HMAC Signature: Converts text to a HMAC signed hash value using various hashing algorithms */
25
- hmacSignature: piece.tool('hmac-signature'),
26
- /** Generate RSA Signature: Signs text with an RSA private key using SHA-256, SHA-384, or SHA-512 (RSA-SHA256 by default) */
27
- rsaSignature: piece.tool('rsa-signature'),
28
- /** Generate Password: Generates a random password with the specified length */
29
- generatePassword: piece.tool('generate-password'),
30
- /** Base64 Decode: Converts base64 text back to plain text. */
31
- base64Decode: piece.tool('base64-decode'),
32
- /** Base64 Encode: Converts plain text into base64 format. */
33
- base64Encode: piece.tool('base64-encode'),
34
- /** OpenPGP Encrypt: Encrypt a file using OpenPGP public key */
35
- openpgpEncrypt: piece.tool('openpgpEncrypt'),
36
- });
37
- }
1
+ import { definePiece } from 'frogbot/pieces';
2
+ import { decodeBase64 } from './actions/decodeBase64.js';
3
+ import { encodeBase64 } from './actions/encodeBase64.js';
4
+ import { encryptFile } from './actions/encryptFile.js';
5
+ import { generateHmac } from './actions/generateHmac.js';
6
+ import { generatePassword } from './actions/generatePassword.js';
7
+ import { generateRsaSignature } from './actions/generateRsaSignature.js';
8
+ import { hashText } from './actions/hashText.js';
9
+ export const createCrypto = definePiece({
10
+ slug: 'crypto',
11
+ label: 'Crypto',
12
+ admin: { description: 'Hash, sign, encode, encrypt, and generate secure values', group: 'Core' },
13
+ actions: [
14
+ hashText,
15
+ generateHmac,
16
+ generateRsaSignature,
17
+ generatePassword,
18
+ decodeBase64,
19
+ encodeBase64,
20
+ encryptFile,
21
+ ],
22
+ });
38
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAA2B,MAAM,gBAAgB,CAAC;AAElF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,gBAAgB;CACR,CAAC;AACX,MAAM,CAAC,MAAM,YAAY,GAAG,EAAW,CAAC;AAExC,MAAM,UAAU,YAAY,CAAC,MAA2B;IACtD,MAAM,KAAK,GAAG,uBAAuB,CAAC;QACpC,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,MAAM;QACtB,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,MAAM;KACP,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;QAC1B,mFAAmF;QACnF,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;QACjC,0GAA0G;QAC1G,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAC3C,4HAA4H;QAC5H,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;QACzC,+EAA+E;QAC/E,gBAAgB,EAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;QACjD,8DAA8D;QAC9D,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;QACzC,6DAA6D;QAC7D,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;QACzC,+DAA+D;QAC/D,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;KAC7C,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,EAAE,WAAW,EAAE,yDAAyD,EAAE,KAAK,EAAE,MAAM,EAAE;IAChG,OAAO,EAAE;QACP,QAAQ;QACR,YAAY;QACZ,oBAAoB;QACpB,gBAAgB;QAChB,YAAY;QACZ,YAAY;QACZ,WAAW;KACZ;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frogbotai/piece-crypto",
3
- "version": "0.22.0",
4
- "description": "Cryptography tools for FrogBot.",
3
+ "version": "0.24.0",
4
+ "description": "crypto tools for FrogBot.",
5
5
  "license": "MIT",
6
6
  "author": "Colby Gilbert",
7
7
  "type": "module",
@@ -19,14 +19,15 @@
19
19
  ],
20
20
  "sideEffects": false,
21
21
  "dependencies": {
22
- "@activepieces/piece-crypto": "0.0.22"
22
+ "openpgp": "6.2.0",
23
+ "zod": "^4.3.6"
23
24
  },
24
25
  "peerDependencies": {
25
- "frogbot": "0.22.0"
26
+ "frogbot": "0.24.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "typescript": "5.6.2",
29
- "frogbot": "0.22.0"
30
+ "frogbot": "0.24.0"
30
31
  },
31
32
  "publishConfig": {
32
33
  "access": "public"