@frogbotai/piece-file-helper 0.27.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.d.ts +78 -203
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +15 -14
- package/dist/actions.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 +142 -246
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/actions.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
type RunArgs<T extends z.ZodType> = PieceRunArgs<z.output<T>, object, undefined>;
|
|
5
|
-
declare const createFileInput: z.ZodObject<{
|
|
2
|
+
export declare const createFile: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
6
3
|
content: z.ZodString;
|
|
7
4
|
fileName: z.ZodString;
|
|
8
5
|
encoding: z.ZodDefault<z.ZodEnum<{
|
|
@@ -16,22 +13,58 @@ declare const createFileInput: z.ZodObject<{
|
|
|
16
13
|
binary: "binary";
|
|
17
14
|
hex: "hex";
|
|
18
15
|
}>>;
|
|
19
|
-
}, z.core.$strip
|
|
20
|
-
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
18
|
+
filename: z.ZodString;
|
|
19
|
+
url: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>, Record<string, never>, undefined, {
|
|
21
|
+
id: string | number;
|
|
22
|
+
filename: string;
|
|
23
|
+
url?: string | undefined;
|
|
24
|
+
}> & {
|
|
25
|
+
slug: "createFile";
|
|
26
|
+
};
|
|
27
|
+
export declare const readFile: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
21
28
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
22
29
|
format: z.ZodEnum<{
|
|
23
30
|
base64: "base64";
|
|
24
31
|
text: "text";
|
|
25
32
|
}>;
|
|
26
|
-
}, z.core.$strip
|
|
27
|
-
|
|
33
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
34
|
+
text: z.ZodString;
|
|
35
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
36
|
+
base64: z.ZodString;
|
|
37
|
+
base64WithMimeType: z.ZodString;
|
|
38
|
+
}, z.core.$strip>]>, Record<string, never>, undefined, {
|
|
39
|
+
text: string;
|
|
40
|
+
} | {
|
|
41
|
+
base64: string;
|
|
42
|
+
base64WithMimeType: string;
|
|
43
|
+
}> & {
|
|
44
|
+
slug: "readFile";
|
|
45
|
+
};
|
|
46
|
+
export declare const getFileName: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
28
47
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
29
|
-
}, z.core.$strip
|
|
30
|
-
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
fileName: z.ZodString;
|
|
50
|
+
}, z.core.$strip>, Record<string, never>, undefined, {
|
|
51
|
+
fileName: string;
|
|
52
|
+
}> & {
|
|
53
|
+
slug: "getFileName";
|
|
54
|
+
};
|
|
55
|
+
export declare const checkFileType: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
31
56
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
32
57
|
mimeType: z.ZodString;
|
|
33
|
-
}, z.core.$strip
|
|
34
|
-
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
mimeType: z.ZodString;
|
|
60
|
+
isMatch: z.ZodBoolean;
|
|
61
|
+
}, z.core.$strip>, Record<string, never>, undefined, {
|
|
62
|
+
mimeType: string;
|
|
63
|
+
isMatch: boolean;
|
|
64
|
+
}> & {
|
|
65
|
+
slug: "checkFileType";
|
|
66
|
+
};
|
|
67
|
+
export declare const changeFileEncoding: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
35
68
|
inputFile: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
36
69
|
inputEncoding: z.ZodEnum<{
|
|
37
70
|
ascii: "ascii";
|
|
@@ -56,8 +89,18 @@ declare const changeFileEncodingInput: z.ZodObject<{
|
|
|
56
89
|
binary: "binary";
|
|
57
90
|
hex: "hex";
|
|
58
91
|
}>;
|
|
59
|
-
}, z.core.$strip
|
|
60
|
-
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
94
|
+
filename: z.ZodString;
|
|
95
|
+
url: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>, Record<string, never>, undefined, {
|
|
97
|
+
id: string | number;
|
|
98
|
+
filename: string;
|
|
99
|
+
url?: string | undefined;
|
|
100
|
+
}> & {
|
|
101
|
+
slug: "changeFileEncoding";
|
|
102
|
+
};
|
|
103
|
+
export declare const zipFiles: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
61
104
|
files: z.ZodArray<z.ZodObject<{
|
|
62
105
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
63
106
|
filePath: z.ZodOptional<z.ZodString>;
|
|
@@ -71,8 +114,18 @@ declare const zipFilesInput: z.ZodObject<{
|
|
|
71
114
|
"aes-256": "aes-256";
|
|
72
115
|
}>>>;
|
|
73
116
|
}, z.core.$strip>>;
|
|
74
|
-
}, z.core.$strip
|
|
75
|
-
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
119
|
+
filename: z.ZodString;
|
|
120
|
+
url: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>, Record<string, never>, undefined, {
|
|
122
|
+
id: string | number;
|
|
123
|
+
filename: string;
|
|
124
|
+
url?: string | undefined;
|
|
125
|
+
}> & {
|
|
126
|
+
slug: "zipFiles";
|
|
127
|
+
};
|
|
128
|
+
export declare const unzipFile: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
76
129
|
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
77
130
|
maxResults: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
78
131
|
usePassword: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -88,199 +141,21 @@ declare const unzipFileInput: z.ZodObject<{
|
|
|
88
141
|
password: string;
|
|
89
142
|
encryptionMethod?: "zipcrypto" | "aes-256" | undefined;
|
|
90
143
|
} | undefined>>;
|
|
91
|
-
}, z.core.$strip
|
|
92
|
-
|
|
93
|
-
slug: string;
|
|
94
|
-
label: string;
|
|
95
|
-
description: string;
|
|
96
|
-
input: z.ZodObject<{
|
|
97
|
-
content: z.ZodString;
|
|
98
|
-
fileName: z.ZodString;
|
|
99
|
-
encoding: z.ZodDefault<z.ZodEnum<{
|
|
100
|
-
ascii: "ascii";
|
|
101
|
-
utf8: "utf8";
|
|
102
|
-
utf16le: "utf16le";
|
|
103
|
-
ucs2: "ucs2";
|
|
104
|
-
base64: "base64";
|
|
105
|
-
base64url: "base64url";
|
|
106
|
-
latin1: "latin1";
|
|
107
|
-
binary: "binary";
|
|
108
|
-
hex: "hex";
|
|
109
|
-
}>>;
|
|
110
|
-
}, z.core.$strip>;
|
|
111
|
-
output: z.ZodObject<{
|
|
112
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
113
|
-
filename: z.ZodString;
|
|
114
|
-
url: z.ZodOptional<z.ZodString>;
|
|
115
|
-
}, z.core.$strip>;
|
|
116
|
-
run({ input, req }: RunArgs<typeof createFileInput>): Promise<{
|
|
117
|
-
url?: string | undefined;
|
|
118
|
-
id: string | number;
|
|
119
|
-
filename: string;
|
|
120
|
-
}>;
|
|
121
|
-
};
|
|
122
|
-
export declare const readFile: {
|
|
123
|
-
slug: string;
|
|
124
|
-
label: string;
|
|
125
|
-
description: string;
|
|
126
|
-
input: z.ZodObject<{
|
|
127
|
-
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
128
|
-
format: z.ZodEnum<{
|
|
129
|
-
base64: "base64";
|
|
130
|
-
text: "text";
|
|
131
|
-
}>;
|
|
132
|
-
}, z.core.$strip>;
|
|
133
|
-
output: z.ZodUnion<readonly [z.ZodObject<{
|
|
134
|
-
text: z.ZodString;
|
|
135
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
-
base64: z.ZodString;
|
|
137
|
-
base64WithMimeType: z.ZodString;
|
|
138
|
-
}, z.core.$strip>]>;
|
|
139
|
-
run({ input, req }: RunArgs<typeof readFileInput>): Promise<{
|
|
140
|
-
text: string;
|
|
141
|
-
base64?: undefined;
|
|
142
|
-
base64WithMimeType?: undefined;
|
|
143
|
-
} | {
|
|
144
|
-
base64: string;
|
|
145
|
-
base64WithMimeType: string;
|
|
146
|
-
text?: undefined;
|
|
147
|
-
}>;
|
|
148
|
-
};
|
|
149
|
-
export declare const getFileName: {
|
|
150
|
-
slug: string;
|
|
151
|
-
label: string;
|
|
152
|
-
description: string;
|
|
153
|
-
input: z.ZodObject<{
|
|
154
|
-
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
155
|
-
}, z.core.$strip>;
|
|
156
|
-
output: z.ZodObject<{
|
|
157
|
-
fileName: z.ZodString;
|
|
158
|
-
}, z.core.$strip>;
|
|
159
|
-
run({ input, req }: RunArgs<typeof getFileNameInput>): Promise<{
|
|
160
|
-
fileName: string;
|
|
161
|
-
}>;
|
|
162
|
-
};
|
|
163
|
-
export declare const checkFileType: {
|
|
164
|
-
slug: string;
|
|
165
|
-
label: string;
|
|
166
|
-
description: string;
|
|
167
|
-
input: z.ZodObject<{
|
|
168
|
-
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
169
|
-
mimeType: z.ZodString;
|
|
170
|
-
}, z.core.$strip>;
|
|
171
|
-
output: z.ZodObject<{
|
|
172
|
-
mimeType: z.ZodString;
|
|
173
|
-
isMatch: z.ZodBoolean;
|
|
174
|
-
}, z.core.$strip>;
|
|
175
|
-
run({ input, req }: RunArgs<typeof checkFileTypeInput>): Promise<{
|
|
176
|
-
mimeType: string;
|
|
177
|
-
isMatch: boolean;
|
|
178
|
-
}>;
|
|
179
|
-
};
|
|
180
|
-
export declare const changeFileEncoding: {
|
|
181
|
-
slug: string;
|
|
182
|
-
label: string;
|
|
183
|
-
description: string;
|
|
184
|
-
input: z.ZodObject<{
|
|
185
|
-
inputFile: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
186
|
-
inputEncoding: z.ZodEnum<{
|
|
187
|
-
ascii: "ascii";
|
|
188
|
-
utf8: "utf8";
|
|
189
|
-
utf16le: "utf16le";
|
|
190
|
-
ucs2: "ucs2";
|
|
191
|
-
base64: "base64";
|
|
192
|
-
base64url: "base64url";
|
|
193
|
-
latin1: "latin1";
|
|
194
|
-
binary: "binary";
|
|
195
|
-
hex: "hex";
|
|
196
|
-
}>;
|
|
197
|
-
outputFileName: z.ZodString;
|
|
198
|
-
outputEncoding: z.ZodEnum<{
|
|
199
|
-
ascii: "ascii";
|
|
200
|
-
utf8: "utf8";
|
|
201
|
-
utf16le: "utf16le";
|
|
202
|
-
ucs2: "ucs2";
|
|
203
|
-
base64: "base64";
|
|
204
|
-
base64url: "base64url";
|
|
205
|
-
latin1: "latin1";
|
|
206
|
-
binary: "binary";
|
|
207
|
-
hex: "hex";
|
|
208
|
-
}>;
|
|
209
|
-
}, z.core.$strip>;
|
|
210
|
-
output: z.ZodObject<{
|
|
144
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
145
|
+
file: z.ZodObject<{
|
|
211
146
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
212
147
|
filename: z.ZodString;
|
|
213
148
|
url: z.ZodOptional<z.ZodString>;
|
|
214
149
|
}, z.core.$strip>;
|
|
215
|
-
|
|
216
|
-
|
|
150
|
+
filePath: z.ZodString;
|
|
151
|
+
}, z.core.$strip>>, Record<string, never>, undefined, {
|
|
152
|
+
file: {
|
|
217
153
|
id: string | number;
|
|
218
154
|
filename: string;
|
|
219
|
-
}>;
|
|
220
|
-
};
|
|
221
|
-
export declare const zipFiles: {
|
|
222
|
-
slug: string;
|
|
223
|
-
label: string;
|
|
224
|
-
description: string;
|
|
225
|
-
input: z.ZodObject<{
|
|
226
|
-
files: z.ZodArray<z.ZodObject<{
|
|
227
|
-
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
228
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
229
|
-
}, z.core.$strip>>;
|
|
230
|
-
outputFileName: z.ZodString;
|
|
231
|
-
usePassword: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
232
|
-
passwordOptions: z.ZodOptional<z.ZodObject<{
|
|
233
|
-
password: z.ZodString;
|
|
234
|
-
encryptionMethod: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
235
|
-
zipcrypto: "zipcrypto";
|
|
236
|
-
"aes-256": "aes-256";
|
|
237
|
-
}>>>;
|
|
238
|
-
}, z.core.$strip>>;
|
|
239
|
-
}, z.core.$strip>;
|
|
240
|
-
output: z.ZodObject<{
|
|
241
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
242
|
-
filename: z.ZodString;
|
|
243
|
-
url: z.ZodOptional<z.ZodString>;
|
|
244
|
-
}, z.core.$strip>;
|
|
245
|
-
run({ input, req }: RunArgs<typeof zipFilesInput>): Promise<{
|
|
246
155
|
url?: string | undefined;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
export declare const unzipFile: {
|
|
252
|
-
slug: string;
|
|
253
|
-
label: string;
|
|
254
|
-
description: string;
|
|
255
|
-
input: z.ZodObject<{
|
|
256
|
-
file: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
257
|
-
maxResults: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
258
|
-
usePassword: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
259
|
-
passwordOptions: z.ZodPipe<z.ZodOptional<z.ZodObject<{
|
|
260
|
-
password: z.ZodString;
|
|
261
|
-
encryptionMethod: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
262
|
-
zipcrypto: "zipcrypto";
|
|
263
|
-
"aes-256": "aes-256";
|
|
264
|
-
}>>>;
|
|
265
|
-
}, z.core.$strip>>, z.ZodTransform<{
|
|
266
|
-
password: string;
|
|
267
|
-
} | undefined, {
|
|
268
|
-
password: string;
|
|
269
|
-
encryptionMethod?: "zipcrypto" | "aes-256" | undefined;
|
|
270
|
-
} | undefined>>;
|
|
271
|
-
}, z.core.$strip>;
|
|
272
|
-
output: z.ZodArray<z.ZodObject<{
|
|
273
|
-
file: z.ZodObject<{
|
|
274
|
-
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
275
|
-
filename: z.ZodString;
|
|
276
|
-
url: z.ZodOptional<z.ZodString>;
|
|
277
|
-
}, z.core.$strip>;
|
|
278
|
-
filePath: z.ZodString;
|
|
279
|
-
}, z.core.$strip>>;
|
|
280
|
-
run({ input, req }: RunArgs<typeof unzipFileInput>): Promise<{
|
|
281
|
-
file: z.output<typeof savedFile>;
|
|
282
|
-
filePath: string;
|
|
283
|
-
}[]>;
|
|
156
|
+
};
|
|
157
|
+
filePath: string;
|
|
158
|
+
}[]> & {
|
|
159
|
+
slug: "unzipFile";
|
|
284
160
|
};
|
|
285
|
-
export {};
|
|
286
161
|
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsDxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;CAWrB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAkBnB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;CAWtB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;CAYxB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa7B,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;CAuCnB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CpB,CAAC"}
|
package/dist/actions.js
CHANGED
|
@@ -2,6 +2,7 @@ import { BlobReader, BlobWriter, getMimeType, ZipReader, ZipWriter } from '@zip.
|
|
|
2
2
|
import { lookup } from 'mime-types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { encoding } from './config.js';
|
|
5
|
+
import { defineAction } from './define.js';
|
|
5
6
|
import { fileId, loadFile, savedFile, saveFile } from './files.js';
|
|
6
7
|
const passwordOptions = z
|
|
7
8
|
.object({
|
|
@@ -41,7 +42,7 @@ const unzipFileInput = z.object({
|
|
|
41
42
|
usePassword: z.boolean().default(false).optional(),
|
|
42
43
|
passwordOptions: passwordOptions.transform((value) => value ? { password: value.password } : undefined),
|
|
43
44
|
});
|
|
44
|
-
export const createFile = {
|
|
45
|
+
export const createFile = defineAction({
|
|
45
46
|
slug: 'createFile',
|
|
46
47
|
label: 'Create file',
|
|
47
48
|
description: 'Create a file from content',
|
|
@@ -51,8 +52,8 @@ export const createFile = {
|
|
|
51
52
|
const data = Buffer.from(input.content, input.encoding);
|
|
52
53
|
return saveFile({ req, data, filename: input.fileName });
|
|
53
54
|
},
|
|
54
|
-
};
|
|
55
|
-
export const readFile = {
|
|
55
|
+
});
|
|
56
|
+
export const readFile = defineAction({
|
|
56
57
|
slug: 'readFile',
|
|
57
58
|
label: 'Read file',
|
|
58
59
|
description: 'Read a file as text or Base64',
|
|
@@ -68,8 +69,8 @@ export const readFile = {
|
|
|
68
69
|
const base64 = file.data.toString('base64');
|
|
69
70
|
return { base64, base64WithMimeType: `data:${file.mimeType};base64,${base64}` };
|
|
70
71
|
},
|
|
71
|
-
};
|
|
72
|
-
export const getFileName = {
|
|
72
|
+
});
|
|
73
|
+
export const getFileName = defineAction({
|
|
73
74
|
slug: 'getFileName',
|
|
74
75
|
label: 'Get file name',
|
|
75
76
|
description: 'Get the name of a file',
|
|
@@ -79,8 +80,8 @@ export const getFileName = {
|
|
|
79
80
|
const file = await loadFile({ req, id: input.file });
|
|
80
81
|
return { fileName: file.filename };
|
|
81
82
|
},
|
|
82
|
-
};
|
|
83
|
-
export const checkFileType = {
|
|
83
|
+
});
|
|
84
|
+
export const checkFileType = defineAction({
|
|
84
85
|
slug: 'checkFileType',
|
|
85
86
|
label: 'Check file type',
|
|
86
87
|
description: 'Check whether a file matches a MIME type',
|
|
@@ -91,8 +92,8 @@ export const checkFileType = {
|
|
|
91
92
|
const mimeType = lookup(file.filename) || 'application/octet-stream';
|
|
92
93
|
return { mimeType, isMatch: mimeType === input.mimeType };
|
|
93
94
|
},
|
|
94
|
-
};
|
|
95
|
-
export const changeFileEncoding = {
|
|
95
|
+
});
|
|
96
|
+
export const changeFileEncoding = defineAction({
|
|
96
97
|
slug: 'changeFileEncoding',
|
|
97
98
|
label: 'Change file encoding',
|
|
98
99
|
description: 'Change the encoding of a file',
|
|
@@ -104,8 +105,8 @@ export const changeFileEncoding = {
|
|
|
104
105
|
const data = Buffer.from(decoded, input.outputEncoding);
|
|
105
106
|
return saveFile({ req, data, filename: input.outputFileName });
|
|
106
107
|
},
|
|
107
|
-
};
|
|
108
|
-
export const zipFiles = {
|
|
108
|
+
});
|
|
109
|
+
export const zipFiles = defineAction({
|
|
109
110
|
slug: 'zipFiles',
|
|
110
111
|
label: 'Zip files',
|
|
111
112
|
description: 'Create a compressed ZIP file from one or more files',
|
|
@@ -139,8 +140,8 @@ export const zipFiles = {
|
|
|
139
140
|
const data = Buffer.from(await (await writer.getData()).arrayBuffer());
|
|
140
141
|
return saveFile({ req, data, filename: input.outputFileName, mimeType: 'application/zip' });
|
|
141
142
|
},
|
|
142
|
-
};
|
|
143
|
-
export const unzipFile = {
|
|
143
|
+
});
|
|
144
|
+
export const unzipFile = defineAction({
|
|
144
145
|
slug: 'unzipFile',
|
|
145
146
|
label: 'Unzip file',
|
|
146
147
|
description: 'Extract files from a compressed ZIP file',
|
|
@@ -181,5 +182,5 @@ export const unzipFile = {
|
|
|
181
182
|
await reader.close();
|
|
182
183
|
}
|
|
183
184
|
},
|
|
184
|
-
};
|
|
185
|
+
});
|
|
185
186
|
//# sourceMappingURL=actions.js.map
|
package/dist/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE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,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;IACH,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,262 +5,158 @@ export declare const createFileHelper: import("frogbot").PieceFactory<{
|
|
|
5
5
|
readonly description: "Create, inspect, convert, compress, and extract files";
|
|
6
6
|
readonly group: "Core";
|
|
7
7
|
};
|
|
8
|
-
readonly actions: readonly [{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
14
|
-
format: import("zod").ZodEnum<{
|
|
15
|
-
base64: "base64";
|
|
16
|
-
text: "text";
|
|
17
|
-
}>;
|
|
18
|
-
}, import("zod/v4/core").$strip>;
|
|
19
|
-
output: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
20
|
-
text: import("zod").ZodString;
|
|
21
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
22
|
-
base64: import("zod").ZodString;
|
|
23
|
-
base64WithMimeType: import("zod").ZodString;
|
|
24
|
-
}, import("zod/v4/core").$strip>]>;
|
|
25
|
-
run({ input, req }: {
|
|
26
|
-
input: {
|
|
27
|
-
file: string | number;
|
|
28
|
-
format: "base64" | "text";
|
|
29
|
-
};
|
|
30
|
-
client: undefined;
|
|
31
|
-
options: object;
|
|
32
|
-
req: import("frogbot").FrogBotRequest;
|
|
33
|
-
}): Promise<{
|
|
34
|
-
text: string;
|
|
35
|
-
base64?: undefined;
|
|
36
|
-
base64WithMimeType?: undefined;
|
|
37
|
-
} | {
|
|
38
|
-
base64: string;
|
|
39
|
-
base64WithMimeType: string;
|
|
40
|
-
text?: undefined;
|
|
8
|
+
readonly actions: readonly [import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
9
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
10
|
+
format: import("zod").ZodEnum<{
|
|
11
|
+
base64: "base64";
|
|
12
|
+
text: "text";
|
|
41
13
|
}>;
|
|
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
|
-
|
|
14
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
15
|
+
text: import("zod").ZodString;
|
|
16
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
17
|
+
base64: import("zod").ZodString;
|
|
18
|
+
base64WithMimeType: import("zod").ZodString;
|
|
19
|
+
}, import("zod/v4/core").$strip>]>, Record<string, never>, undefined, {
|
|
20
|
+
text: string;
|
|
21
|
+
} | {
|
|
22
|
+
base64: string;
|
|
23
|
+
base64WithMimeType: string;
|
|
24
|
+
}> & {
|
|
25
|
+
slug: "readFile";
|
|
26
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
27
|
+
content: import("zod").ZodString;
|
|
28
|
+
fileName: import("zod").ZodString;
|
|
29
|
+
encoding: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
30
|
+
ascii: "ascii";
|
|
31
|
+
utf8: "utf8";
|
|
32
|
+
utf16le: "utf16le";
|
|
33
|
+
ucs2: "ucs2";
|
|
34
|
+
base64: "base64";
|
|
35
|
+
base64url: "base64url";
|
|
36
|
+
latin1: "latin1";
|
|
37
|
+
binary: "binary";
|
|
38
|
+
hex: "hex";
|
|
39
|
+
}>>;
|
|
40
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
41
|
+
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
42
|
+
filename: import("zod").ZodString;
|
|
43
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
|
+
}, import("zod/v4/core").$strip>, Record<string, never>, undefined, {
|
|
45
|
+
id: string | number;
|
|
46
|
+
filename: string;
|
|
47
|
+
url?: string | undefined;
|
|
48
|
+
}> & {
|
|
49
|
+
slug: "createFile";
|
|
50
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
51
|
+
inputFile: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
52
|
+
inputEncoding: import("zod").ZodEnum<{
|
|
53
|
+
ascii: "ascii";
|
|
54
|
+
utf8: "utf8";
|
|
55
|
+
utf16le: "utf16le";
|
|
56
|
+
ucs2: "ucs2";
|
|
57
|
+
base64: "base64";
|
|
58
|
+
base64url: "base64url";
|
|
59
|
+
latin1: "latin1";
|
|
60
|
+
binary: "binary";
|
|
61
|
+
hex: "hex";
|
|
79
62
|
}>;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
base64: "base64";
|
|
92
|
-
base64url: "base64url";
|
|
93
|
-
latin1: "latin1";
|
|
94
|
-
binary: "binary";
|
|
95
|
-
hex: "hex";
|
|
96
|
-
}>;
|
|
97
|
-
outputFileName: import("zod").ZodString;
|
|
98
|
-
outputEncoding: import("zod").ZodEnum<{
|
|
99
|
-
ascii: "ascii";
|
|
100
|
-
utf8: "utf8";
|
|
101
|
-
utf16le: "utf16le";
|
|
102
|
-
ucs2: "ucs2";
|
|
103
|
-
base64: "base64";
|
|
104
|
-
base64url: "base64url";
|
|
105
|
-
latin1: "latin1";
|
|
106
|
-
binary: "binary";
|
|
107
|
-
hex: "hex";
|
|
108
|
-
}>;
|
|
109
|
-
}, import("zod/v4/core").$strip>;
|
|
110
|
-
output: import("zod").ZodObject<{
|
|
111
|
-
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
112
|
-
filename: import("zod").ZodString;
|
|
113
|
-
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
114
|
-
}, import("zod/v4/core").$strip>;
|
|
115
|
-
run({ input, req }: {
|
|
116
|
-
input: {
|
|
117
|
-
inputFile: string | number;
|
|
118
|
-
inputEncoding: "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
|
|
119
|
-
outputFileName: string;
|
|
120
|
-
outputEncoding: "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
|
|
121
|
-
};
|
|
122
|
-
client: undefined;
|
|
123
|
-
options: object;
|
|
124
|
-
req: import("frogbot").FrogBotRequest;
|
|
125
|
-
}): Promise<{
|
|
126
|
-
url?: string | undefined;
|
|
127
|
-
id: string | number;
|
|
128
|
-
filename: string;
|
|
63
|
+
outputFileName: import("zod").ZodString;
|
|
64
|
+
outputEncoding: import("zod").ZodEnum<{
|
|
65
|
+
ascii: "ascii";
|
|
66
|
+
utf8: "utf8";
|
|
67
|
+
utf16le: "utf16le";
|
|
68
|
+
ucs2: "ucs2";
|
|
69
|
+
base64: "base64";
|
|
70
|
+
base64url: "base64url";
|
|
71
|
+
latin1: "latin1";
|
|
72
|
+
binary: "binary";
|
|
73
|
+
hex: "hex";
|
|
129
74
|
}>;
|
|
130
|
-
}, {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
75
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
76
|
+
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
77
|
+
filename: import("zod").ZodString;
|
|
78
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
}, import("zod/v4/core").$strip>, Record<string, never>, undefined, {
|
|
80
|
+
id: string | number;
|
|
81
|
+
filename: string;
|
|
82
|
+
url?: string | undefined;
|
|
83
|
+
}> & {
|
|
84
|
+
slug: "changeFileEncoding";
|
|
85
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
86
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
87
|
+
mimeType: import("zod").ZodString;
|
|
88
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
89
|
+
mimeType: import("zod").ZodString;
|
|
90
|
+
isMatch: import("zod").ZodBoolean;
|
|
91
|
+
}, import("zod/v4/core").$strip>, Record<string, never>, undefined, {
|
|
92
|
+
mimeType: string;
|
|
93
|
+
isMatch: boolean;
|
|
94
|
+
}> & {
|
|
95
|
+
slug: "checkFileType";
|
|
96
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
97
|
+
files: import("zod").ZodArray<import("zod").ZodObject<{
|
|
135
98
|
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
136
|
-
|
|
137
|
-
}, import("zod/v4/core").$strip
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
99
|
+
filePath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
100
|
+
}, import("zod/v4/core").$strip>>;
|
|
101
|
+
outputFileName: import("zod").ZodString;
|
|
102
|
+
usePassword: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
103
|
+
passwordOptions: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
104
|
+
password: import("zod").ZodString;
|
|
105
|
+
encryptionMethod: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
106
|
+
zipcrypto: "zipcrypto";
|
|
107
|
+
"aes-256": "aes-256";
|
|
108
|
+
}>>>;
|
|
109
|
+
}, import("zod/v4/core").$strip>>;
|
|
110
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
111
|
+
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
112
|
+
filename: import("zod").ZodString;
|
|
113
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
114
|
+
}, import("zod/v4/core").$strip>, Record<string, never>, undefined, {
|
|
115
|
+
id: string | number;
|
|
116
|
+
filename: string;
|
|
117
|
+
url?: string | undefined;
|
|
118
|
+
}> & {
|
|
119
|
+
slug: "zipFiles";
|
|
120
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
121
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
122
|
+
maxResults: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNumber>>;
|
|
123
|
+
usePassword: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
124
|
+
passwordOptions: import("zod").ZodPipe<import("zod").ZodOptional<import("zod").ZodObject<{
|
|
125
|
+
password: import("zod").ZodString;
|
|
126
|
+
encryptionMethod: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
127
|
+
zipcrypto: "zipcrypto";
|
|
128
|
+
"aes-256": "aes-256";
|
|
129
|
+
}>>>;
|
|
130
|
+
}, import("zod/v4/core").$strip>>, import("zod").ZodTransform<{
|
|
131
|
+
password: string;
|
|
132
|
+
} | undefined, {
|
|
133
|
+
password: string;
|
|
134
|
+
encryptionMethod?: "zipcrypto" | "aes-256" | undefined;
|
|
135
|
+
} | undefined>>;
|
|
136
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
|
|
137
|
+
file: import("zod").ZodObject<{
|
|
174
138
|
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
175
139
|
filename: import("zod").ZodString;
|
|
176
140
|
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
177
141
|
}, import("zod/v4/core").$strip>;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
file: string | number;
|
|
182
|
-
filePath?: string | undefined;
|
|
183
|
-
}[];
|
|
184
|
-
outputFileName: string;
|
|
185
|
-
usePassword?: boolean | undefined;
|
|
186
|
-
passwordOptions?: {
|
|
187
|
-
password: string;
|
|
188
|
-
encryptionMethod?: "zipcrypto" | "aes-256" | undefined;
|
|
189
|
-
} | undefined;
|
|
190
|
-
};
|
|
191
|
-
client: undefined;
|
|
192
|
-
options: object;
|
|
193
|
-
req: import("frogbot").FrogBotRequest;
|
|
194
|
-
}): Promise<{
|
|
195
|
-
url?: string | undefined;
|
|
142
|
+
filePath: import("zod").ZodString;
|
|
143
|
+
}, import("zod/v4/core").$strip>>, Record<string, never>, undefined, {
|
|
144
|
+
file: {
|
|
196
145
|
id: string | number;
|
|
197
146
|
filename: string;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
"aes-256": "aes-256";
|
|
212
|
-
}>>>;
|
|
213
|
-
}, import("zod/v4/core").$strip>>, import("zod").ZodTransform<{
|
|
214
|
-
password: string;
|
|
215
|
-
} | undefined, {
|
|
216
|
-
password: string;
|
|
217
|
-
encryptionMethod?: "zipcrypto" | "aes-256" | undefined;
|
|
218
|
-
} | undefined>>;
|
|
219
|
-
}, import("zod/v4/core").$strip>;
|
|
220
|
-
output: import("zod").ZodArray<import("zod").ZodObject<{
|
|
221
|
-
file: import("zod").ZodObject<{
|
|
222
|
-
id: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
223
|
-
filename: import("zod").ZodString;
|
|
224
|
-
url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
225
|
-
}, import("zod/v4/core").$strip>;
|
|
226
|
-
filePath: import("zod").ZodString;
|
|
227
|
-
}, import("zod/v4/core").$strip>>;
|
|
228
|
-
run({ input, req }: {
|
|
229
|
-
input: {
|
|
230
|
-
file: string | number;
|
|
231
|
-
passwordOptions: {
|
|
232
|
-
password: string;
|
|
233
|
-
} | undefined;
|
|
234
|
-
maxResults?: number | undefined;
|
|
235
|
-
usePassword?: boolean | undefined;
|
|
236
|
-
};
|
|
237
|
-
client: undefined;
|
|
238
|
-
options: object;
|
|
239
|
-
req: import("frogbot").FrogBotRequest;
|
|
240
|
-
}): Promise<{
|
|
241
|
-
file: import("zod").infer<typeof import("./files.js").savedFile>;
|
|
242
|
-
filePath: string;
|
|
243
|
-
}[]>;
|
|
244
|
-
}, {
|
|
245
|
-
slug: string;
|
|
246
|
-
label: string;
|
|
247
|
-
description: string;
|
|
248
|
-
input: import("zod").ZodObject<{
|
|
249
|
-
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
250
|
-
}, import("zod/v4/core").$strip>;
|
|
251
|
-
output: import("zod").ZodObject<{
|
|
252
|
-
fileName: import("zod").ZodString;
|
|
253
|
-
}, import("zod/v4/core").$strip>;
|
|
254
|
-
run({ input, req }: {
|
|
255
|
-
input: {
|
|
256
|
-
file: string | number;
|
|
257
|
-
};
|
|
258
|
-
client: undefined;
|
|
259
|
-
options: object;
|
|
260
|
-
req: import("frogbot").FrogBotRequest;
|
|
261
|
-
}): Promise<{
|
|
262
|
-
fileName: string;
|
|
263
|
-
}>;
|
|
147
|
+
url?: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
filePath: string;
|
|
150
|
+
}[]> & {
|
|
151
|
+
slug: "unzipFile";
|
|
152
|
+
}, import("frogbot").PieceActionDefinition<import("zod").ZodObject<{
|
|
153
|
+
file: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
154
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
155
|
+
fileName: import("zod").ZodString;
|
|
156
|
+
}, import("zod/v4/core").$strip>, Record<string, never>, undefined, {
|
|
157
|
+
fileName: string;
|
|
158
|
+
}> & {
|
|
159
|
+
slug: "getFileName";
|
|
264
160
|
}];
|
|
265
161
|
}>;
|
|
266
162
|
//# 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":"AAYA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-file-helper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "file-helper tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"frogbot": "0.
|
|
22
|
+
"frogbot": "0.28.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@zip.js/zip.js": "2.8.15",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/mime-types": "2.1.1",
|
|
31
31
|
"typescript": "5.6.2",
|
|
32
|
-
"frogbot": "0.
|
|
32
|
+
"frogbot": "0.28.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|