@frogbotai/piece-crypto 0.26.0 → 0.28.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/actions/decodeBase64.d.ts +3 -13
- package/dist/actions/decodeBase64.d.ts.map +1 -1
- package/dist/actions/decodeBase64.js +3 -2
- package/dist/actions/decodeBase64.js.map +1 -1
- package/dist/actions/encodeBase64.d.ts +3 -13
- package/dist/actions/encodeBase64.d.ts.map +1 -1
- package/dist/actions/encodeBase64.js +3 -2
- package/dist/actions/encodeBase64.js.map +1 -1
- package/dist/actions/encryptFile.d.ts +11 -23
- package/dist/actions/encryptFile.d.ts.map +1 -1
- package/dist/actions/encryptFile.js +4 -3
- package/dist/actions/encryptFile.js.map +1 -1
- package/dist/actions/generateHmac.d.ts +3 -28
- package/dist/actions/generateHmac.d.ts.map +1 -1
- package/dist/actions/generateHmac.js +3 -2
- package/dist/actions/generateHmac.js.map +1 -1
- package/dist/actions/generatePassword.d.ts +3 -17
- package/dist/actions/generatePassword.d.ts.map +1 -1
- package/dist/actions/generatePassword.js +3 -2
- package/dist/actions/generatePassword.js.map +1 -1
- package/dist/actions/generateRsaSignature.d.ts +3 -24
- package/dist/actions/generateRsaSignature.d.ts.map +1 -1
- package/dist/actions/generateRsaSignature.js +3 -2
- package/dist/actions/generateRsaSignature.js.map +1 -1
- package/dist/actions/hashText.d.ts +3 -19
- package/dist/actions/hashText.d.ts.map +1 -1
- package/dist/actions/hashText.js +3 -2
- package/dist/actions/hashText.js.map +1 -1
- package/dist/define.d.ts +6 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +3 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +79 -165
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const decodeBase64: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
text: z.ZodString;
|
|
5
|
-
}, z.core.$strip
|
|
6
|
-
|
|
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>;
|
|
4
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
5
|
+
slug: "decodeBase64";
|
|
15
6
|
};
|
|
16
|
-
export {};
|
|
17
7
|
//# sourceMappingURL=decodeBase64.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"decodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,YAAY;;;;CASvB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
const inputSchema = z.object({ text: z.string().meta({ label: 'Text' }) });
|
|
3
|
-
export const decodeBase64 = {
|
|
4
|
+
export const decodeBase64 = defineAction({
|
|
4
5
|
slug: 'decodeBase64',
|
|
5
6
|
label: 'Decode Base64',
|
|
6
7
|
description: 'Decode Base64 text as UTF-8.',
|
|
@@ -9,5 +10,5 @@ export const decodeBase64 = {
|
|
|
9
10
|
async run({ input }) {
|
|
10
11
|
return Buffer.from(input.text, 'base64').toString();
|
|
11
12
|
},
|
|
12
|
-
};
|
|
13
|
+
});
|
|
13
14
|
//# sourceMappingURL=decodeBase64.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeBase64.js","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decodeBase64.js","sourceRoot":"","sources":["../../src/actions/decodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IACvC,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,EAAE;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const encodeBase64: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
text: z.ZodString;
|
|
5
|
-
}, z.core.$strip
|
|
6
|
-
|
|
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>;
|
|
4
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
5
|
+
slug: "encodeBase64";
|
|
15
6
|
};
|
|
16
|
-
export {};
|
|
17
7
|
//# sourceMappingURL=encodeBase64.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"encodeBase64.d.ts","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,YAAY;;;;CASvB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
const inputSchema = z.object({ text: z.string().meta({ label: 'Text' }) });
|
|
3
|
-
export const encodeBase64 = {
|
|
4
|
+
export const encodeBase64 = defineAction({
|
|
4
5
|
slug: 'encodeBase64',
|
|
5
6
|
label: 'Encode Base64',
|
|
6
7
|
description: 'Encode UTF-8 text as Base64.',
|
|
@@ -9,5 +10,5 @@ export const encodeBase64 = {
|
|
|
9
10
|
async run({ input }) {
|
|
10
11
|
return Buffer.from(input.text).toString('base64');
|
|
11
12
|
},
|
|
12
|
-
};
|
|
13
|
+
});
|
|
13
14
|
//# sourceMappingURL=encodeBase64.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encodeBase64.js","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encodeBase64.js","sourceRoot":"","sources":["../../src/actions/encodeBase64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IACvC,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,EAAE;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const encryptFile: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
5
4
|
publicKey: z.ZodString;
|
|
6
|
-
}, z.core.$strip
|
|
7
|
-
declare const output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
6
|
success: z.ZodLiteral<true>;
|
|
9
7
|
filename: z.ZodString;
|
|
10
8
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
11
9
|
}, z.core.$strip>, z.ZodObject<{
|
|
12
10
|
success: z.ZodLiteral<false>;
|
|
13
11
|
error: z.ZodString;
|
|
14
|
-
}, z.core.$strip>], "success"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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>>;
|
|
12
|
+
}, z.core.$strip>], "success">, Record<string, never>, undefined, {
|
|
13
|
+
success: true;
|
|
14
|
+
filename: string;
|
|
15
|
+
file: string | number;
|
|
16
|
+
} | {
|
|
17
|
+
success: false;
|
|
18
|
+
error: string;
|
|
19
|
+
}> & {
|
|
20
|
+
slug: "encryptFile";
|
|
32
21
|
};
|
|
33
|
-
export {};
|
|
34
22
|
//# sourceMappingURL=encryptFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryptFile.d.ts","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encryptFile.d.ts","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyDxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;CAyCtB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createMessage, encrypt, readKey } from 'openpgp';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineAction } from '../define.js';
|
|
3
4
|
const fileId = z.union([z.string(), z.number()]);
|
|
4
5
|
const inputSchema = z.object({
|
|
5
6
|
file: fileId.meta({ label: 'File' }),
|
|
@@ -43,13 +44,13 @@ async function loadFile(req, id) {
|
|
|
43
44
|
name: String(doc.filename ?? 'file'),
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
export const encryptFile = {
|
|
47
|
+
export const encryptFile = defineAction({
|
|
47
48
|
slug: 'encryptFile',
|
|
48
49
|
label: 'Encrypt File',
|
|
49
50
|
description: 'Encrypt a file with an ASCII-armored OpenPGP public key.',
|
|
50
51
|
input: inputSchema,
|
|
51
52
|
output,
|
|
52
|
-
async run({ input, req
|
|
53
|
+
async run({ input, req }) {
|
|
53
54
|
try {
|
|
54
55
|
const source = await loadFile(req, input.file);
|
|
55
56
|
const publicKey = await readKey({ armoredKey: input.publicKey });
|
|
@@ -81,5 +82,5 @@ export const encryptFile = {
|
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
},
|
|
84
|
-
};
|
|
85
|
+
});
|
|
85
86
|
//# sourceMappingURL=encryptFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryptFile.js","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encryptFile.js","sourceRoot":"","sources":["../../src/actions/encryptFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,MA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AAC,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,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const generateHmac: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
secretKey: z.ZodString;
|
|
5
4
|
secretKeyEncoding: z.ZodEnum<{
|
|
6
5
|
"utf-8": "utf-8";
|
|
@@ -17,31 +16,7 @@ declare const inputSchema: z.ZodObject<{
|
|
|
17
16
|
base64: "base64";
|
|
18
17
|
hex: "hex";
|
|
19
18
|
}>>;
|
|
20
|
-
}, z.core.$strip
|
|
21
|
-
|
|
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>;
|
|
19
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
20
|
+
slug: "generateHmac";
|
|
45
21
|
};
|
|
46
|
-
export {};
|
|
47
22
|
//# sourceMappingURL=generateHmac.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateHmac.d.ts","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"generateHmac.d.ts","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CAWvB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHmac } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineAction } from '../define.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
secretKey: z.string().meta({ label: 'Secret Key', secret: true }),
|
|
5
6
|
secretKeyEncoding: z.enum(['utf-8', 'hex', 'base64']).meta({ label: 'Secret Key Encoding' }),
|
|
@@ -7,7 +8,7 @@ const inputSchema = z.object({
|
|
|
7
8
|
text: z.string().meta({ label: 'Text', description: 'The text to sign' }),
|
|
8
9
|
outputEncoding: z.enum(['hex', 'base64']).default('hex').meta({ label: 'Output Encoding' }),
|
|
9
10
|
});
|
|
10
|
-
export const generateHmac = {
|
|
11
|
+
export const generateHmac = defineAction({
|
|
11
12
|
slug: 'generateHmac',
|
|
12
13
|
label: 'Generate HMAC',
|
|
13
14
|
description: 'Generate a keyed hash-based message authentication code.',
|
|
@@ -17,5 +18,5 @@ export const generateHmac = {
|
|
|
17
18
|
const key = Buffer.from(input.secretKey, input.secretKeyEncoding);
|
|
18
19
|
return createHmac(input.method, key).update(input.text).digest(input.outputEncoding);
|
|
19
20
|
},
|
|
20
|
-
};
|
|
21
|
+
});
|
|
21
22
|
//# sourceMappingURL=generateHmac.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateHmac.js","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"generateHmac.js","sourceRoot":"","sources":["../../src/actions/generateHmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IACvC,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,EAAE;QACjB,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,CAAC"}
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const generatePassword: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
length: z.ZodNumber;
|
|
5
4
|
characterSet: z.ZodDefault<z.ZodEnum<{
|
|
6
5
|
alphanumeric: "alphanumeric";
|
|
7
6
|
"alphanumeric-symbols": "alphanumeric-symbols";
|
|
8
7
|
}>>;
|
|
9
|
-
}, z.core.$strip
|
|
10
|
-
|
|
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>;
|
|
8
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
9
|
+
slug: "generatePassword";
|
|
23
10
|
};
|
|
24
|
-
export {};
|
|
25
11
|
//# sourceMappingURL=generatePassword.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePassword.d.ts","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"generatePassword.d.ts","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,gBAAgB;;;;;;;;CAiB3B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomInt } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineAction } from '../define.js';
|
|
3
4
|
const alphanumeric = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
4
5
|
const symbols = '!@#$%^&*()_+~`|}{[]:;?><,./-=';
|
|
5
6
|
const inputSchema = z.object({
|
|
@@ -9,7 +10,7 @@ const inputSchema = z.object({
|
|
|
9
10
|
.default('alphanumeric')
|
|
10
11
|
.meta({ label: 'Character Set' }),
|
|
11
12
|
});
|
|
12
|
-
export const generatePassword = {
|
|
13
|
+
export const generatePassword = defineAction({
|
|
13
14
|
slug: 'generatePassword',
|
|
14
15
|
label: 'Generate Password',
|
|
15
16
|
description: 'Generate a cryptographically secure random password.',
|
|
@@ -23,5 +24,5 @@ export const generatePassword = {
|
|
|
23
24
|
}
|
|
24
25
|
return password;
|
|
25
26
|
},
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
//# sourceMappingURL=generatePassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePassword.js","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"generatePassword.js","sourceRoot":"","sources":["../../src/actions/generatePassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IAC3C,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,EAAE;QACjB,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,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const generateRsaSignature: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
privateKey: z.ZodString;
|
|
5
4
|
passphrase: z.ZodOptional<z.ZodString>;
|
|
6
5
|
method: z.ZodDefault<z.ZodEnum<{
|
|
@@ -13,27 +12,7 @@ declare const inputSchema: z.ZodObject<{
|
|
|
13
12
|
base64: "base64";
|
|
14
13
|
hex: "hex";
|
|
15
14
|
}>>;
|
|
16
|
-
}, z.core.$strip
|
|
17
|
-
|
|
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>;
|
|
15
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
16
|
+
slug: "generateRsaSignature";
|
|
37
17
|
};
|
|
38
|
-
export {};
|
|
39
18
|
//# sourceMappingURL=generateRsaSignature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRsaSignature.d.ts","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"generateRsaSignature.d.ts","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;CAgB/B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSign } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineAction } from '../define.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
privateKey: z.string().meta({ label: 'Private Key', secret: true }),
|
|
5
6
|
passphrase: z.string().optional().meta({ label: 'Passphrase', secret: true }),
|
|
@@ -7,7 +8,7 @@ const inputSchema = z.object({
|
|
|
7
8
|
text: z.string().meta({ label: 'Text', description: 'The text to sign' }),
|
|
8
9
|
outputEncoding: z.enum(['base64', 'hex']).default('base64').meta({ label: 'Output Encoding' }),
|
|
9
10
|
});
|
|
10
|
-
export const generateRsaSignature = {
|
|
11
|
+
export const generateRsaSignature = defineAction({
|
|
11
12
|
slug: 'generateRsaSignature',
|
|
12
13
|
label: 'Generate RSA Signature',
|
|
13
14
|
description: 'Sign text with an RSA private key.',
|
|
@@ -21,5 +22,5 @@ export const generateRsaSignature = {
|
|
|
21
22
|
signer.end();
|
|
22
23
|
return signer.sign(key, input.outputEncoding);
|
|
23
24
|
},
|
|
24
|
-
};
|
|
25
|
+
});
|
|
25
26
|
//# sourceMappingURL=generateRsaSignature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRsaSignature.js","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"generateRsaSignature.js","sourceRoot":"","sources":["../../src/actions/generateRsaSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IAC/C,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,EAAE;QACjB,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,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
declare const
|
|
2
|
+
export declare const hashText: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
4
3
|
method: z.ZodEnum<{
|
|
5
4
|
md5: "md5";
|
|
6
5
|
sha256: "sha256";
|
|
@@ -8,22 +7,7 @@ declare const inputSchema: z.ZodObject<{
|
|
|
8
7
|
"sha3-512": "sha3-512";
|
|
9
8
|
}>;
|
|
10
9
|
text: z.ZodString;
|
|
11
|
-
}, z.core.$strip
|
|
12
|
-
|
|
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>;
|
|
10
|
+
}, z.core.$strip>, z.ZodString, Record<string, never>, undefined, string> & {
|
|
11
|
+
slug: "hashText";
|
|
27
12
|
};
|
|
28
|
-
export {};
|
|
29
13
|
//# sourceMappingURL=hashText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashText.d.ts","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"hashText.d.ts","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,QAAQ;;;;;;;;;;CASnB,CAAC"}
|
package/dist/actions/hashText.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { defineAction } from '../define.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
method: z.enum(['md5', 'sha256', 'sha512', 'sha3-512']).meta({ label: 'Method' }),
|
|
5
6
|
text: z.string().meta({ label: 'Text', description: 'The text to hash' }),
|
|
6
7
|
});
|
|
7
|
-
export const hashText = {
|
|
8
|
+
export const hashText = defineAction({
|
|
8
9
|
slug: 'hashText',
|
|
9
10
|
label: 'Hash Text',
|
|
10
11
|
description: 'Hash text with a selected digest algorithm.',
|
|
@@ -13,5 +14,5 @@ export const hashText = {
|
|
|
13
14
|
async run({ input }) {
|
|
14
15
|
return createHash(input.method).update(input.text).digest('hex');
|
|
15
16
|
},
|
|
16
|
-
};
|
|
17
|
+
});
|
|
17
18
|
//# sourceMappingURL=hashText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashText.js","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hashText.js","sourceRoot":"","sources":["../../src/actions/hashText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,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,YAAY,CAAC;IACnC,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,EAAE;QACjB,OAAO,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnE,CAAC;CACF,CAAC,CAAC"}
|
package/dist/define.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const defineAction: <const TSlug extends string, TInput extends import("zod").ZodType, TOutput extends import("zod").ZodType | undefined = undefined, TResult = unknown>(action: TOutput extends unknown ? import("frogbot").PieceActionDefinition<TInput, TOutput, Record<string, never>, undefined, TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : TResult> & {
|
|
2
|
+
slug: TSlug;
|
|
3
|
+
} : never) => import("frogbot").PieceActionDefinition<TInput, TOutput, Record<string, never>, undefined, TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : TResult> & {
|
|
4
|
+
slug: TSlug;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAEA,eAAO,MAAQ,YAAY;;;;CAAyB,CAAC"}
|
package/dist/define.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,kBAAkB,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,171 +5,85 @@ export declare const createCrypto: import("frogbot").PieceFactory<{
|
|
|
5
5
|
readonly description: "Hash, sign, encode, encrypt, and generate secure values";
|
|
6
6
|
readonly group: "Core";
|
|
7
7
|
};
|
|
8
|
-
readonly actions: readonly [{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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">>>;
|
|
8
|
+
readonly actions: readonly [import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
9
|
+
method: import("zod").ZodEnum<{
|
|
10
|
+
md5: "md5";
|
|
11
|
+
sha256: "sha256";
|
|
12
|
+
sha512: "sha512";
|
|
13
|
+
"sha3-512": "sha3-512";
|
|
14
|
+
}>;
|
|
15
|
+
text: import("zod").ZodString;
|
|
16
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
17
|
+
slug: "hashText";
|
|
18
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
19
|
+
secretKey: import("zod").ZodString;
|
|
20
|
+
secretKeyEncoding: import("zod").ZodEnum<{
|
|
21
|
+
"utf-8": "utf-8";
|
|
22
|
+
base64: "base64";
|
|
23
|
+
hex: "hex";
|
|
24
|
+
}>;
|
|
25
|
+
method: import("zod").ZodEnum<{
|
|
26
|
+
md5: "md5";
|
|
27
|
+
sha256: "sha256";
|
|
28
|
+
sha512: "sha512";
|
|
29
|
+
}>;
|
|
30
|
+
text: import("zod").ZodString;
|
|
31
|
+
outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
32
|
+
base64: "base64";
|
|
33
|
+
hex: "hex";
|
|
34
|
+
}>>;
|
|
35
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
36
|
+
slug: "generateHmac";
|
|
37
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
38
|
+
privateKey: import("zod").ZodString;
|
|
39
|
+
passphrase: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
method: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
41
|
+
sha256: "sha256";
|
|
42
|
+
sha512: "sha512";
|
|
43
|
+
sha384: "sha384";
|
|
44
|
+
}>>;
|
|
45
|
+
text: import("zod").ZodString;
|
|
46
|
+
outputEncoding: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
47
|
+
base64: "base64";
|
|
48
|
+
hex: "hex";
|
|
49
|
+
}>>;
|
|
50
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
51
|
+
slug: "generateRsaSignature";
|
|
52
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
53
|
+
length: import("zod").ZodNumber;
|
|
54
|
+
characterSet: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
55
|
+
alphanumeric: "alphanumeric";
|
|
56
|
+
"alphanumeric-symbols": "alphanumeric-symbols";
|
|
57
|
+
}>>;
|
|
58
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
59
|
+
slug: "generatePassword";
|
|
60
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
61
|
+
text: import("zod").ZodString;
|
|
62
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
63
|
+
slug: "decodeBase64";
|
|
64
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
65
|
+
text: import("zod").ZodString;
|
|
66
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<string, never>, undefined, string> & {
|
|
67
|
+
slug: "encodeBase64";
|
|
68
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
69
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
70
|
+
publicKey: import("zod").ZodString;
|
|
71
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
72
|
+
success: import("zod").ZodLiteral<true>;
|
|
73
|
+
filename: import("zod").ZodString;
|
|
74
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
75
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
76
|
+
success: import("zod").ZodLiteral<false>;
|
|
77
|
+
error: import("zod").ZodString;
|
|
78
|
+
}, import("zod/v4/core").$strip>], "success">, Record<string, never>, undefined, {
|
|
79
|
+
success: true;
|
|
80
|
+
filename: string;
|
|
81
|
+
file: string | number;
|
|
82
|
+
} | {
|
|
83
|
+
success: false;
|
|
84
|
+
error: string;
|
|
85
|
+
}> & {
|
|
86
|
+
slug: "encryptFile";
|
|
173
87
|
}];
|
|
174
88
|
}>;
|
|
175
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-crypto",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "crypto tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"zod": "^4.3.6"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"frogbot": "0.
|
|
26
|
+
"frogbot": "0.28.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "5.6.2",
|
|
30
|
-
"frogbot": "0.
|
|
30
|
+
"frogbot": "0.28.0"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "tsc -p tsconfig.json",
|
|
36
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
37
37
|
"clean": "rm -rf dist",
|
|
38
38
|
"typecheck": "tsc --noEmit"
|
|
39
39
|
}
|