@ferchy/n8n-nodes-aimc-toolkit 0.1.35 → 0.1.37
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/README.md +83 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,6 +145,21 @@ return rows.map((row, index) => ({
|
|
|
145
145
|
}));
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
**Prompt starter (for GPT/Claude)**
|
|
149
|
+
If you want AI to generate your node code, paste this prompt into ChatGPT, Claude, or any GPT-style tool and fill in your task:
|
|
150
|
+
```text
|
|
151
|
+
You are writing code for an n8n AIMC Code node.
|
|
152
|
+
Goal: <describe what you want to do>
|
|
153
|
+
Execution mode: <Run Once for Each Item OR Run Once for All Items>
|
|
154
|
+
Inputs: items are available as `items` (all) or `item` (single)
|
|
155
|
+
Return: return a plain object or array of objects (JSON-safe)
|
|
156
|
+
Libraries (globals): axios, lodash (_), zod (z), joi (Joi), yup, Ajv, validator, dayjs, dateFns, dateFnsTz, moment,
|
|
157
|
+
cheerio, papaparse (Papa), yaml (YAML), xml2js, XMLParser, qs, FormData, uuid, nanoid, bytes, cronParser, ms,
|
|
158
|
+
fuzzy, stringSimilarity, slug, pluralize, jsonDiff, htmlToText, marked, qrcode/QRCode, ytdl, ffmpeg, ffmpegStatic, ffprobeStatic.
|
|
159
|
+
Helpers: utils.now(), utils.safeJson(), utils.toArray()
|
|
160
|
+
Please return only the JavaScript code for the AIMC Code node.
|
|
161
|
+
```
|
|
162
|
+
|
|
148
163
|
### AIMC Media
|
|
149
164
|
|
|
150
165
|
**Operations**
|
|
@@ -176,58 +191,78 @@ Social media scraping functionality is currently under development.
|
|
|
176
191
|
|
|
177
192
|
## Library Reference (AIMC Code)
|
|
178
193
|
|
|
179
|
-
Libraries are available as globals or via libs
|
|
194
|
+
Libraries are available as globals or via `libs.<name>`. Examples below are minimal and meant to be copy-paste friendly.
|
|
180
195
|
|
|
181
196
|
### HTTP and Networking
|
|
182
|
-
- axios
|
|
183
|
-
- qs
|
|
184
|
-
- FormData
|
|
185
|
-
- httpProxyAgent
|
|
186
|
-
- socksProxyAgent
|
|
187
|
-
|
|
188
|
-
### Data Parsing
|
|
189
|
-
-
|
|
190
|
-
- toml
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
197
|
+
- `axios`: HTTP client. Example: `const { data } = await axios.get('https://api.example.com');`
|
|
198
|
+
- `qs`: querystring builder/parser. Example: `qs.stringify({ filter: { status: 'open' } })`.
|
|
199
|
+
- `FormData`: multipart uploads. Example: `const form = new FormData(); form.append('file', $binary.data);`
|
|
200
|
+
- `httpProxyAgent`: route HTTP(S) via proxy. Example: `axios.get(url, { httpAgent: new httpProxyAgent('http://user:pass@host:8080') });`
|
|
201
|
+
- `socksProxyAgent`: SOCKS proxy support. Example: `axios.get(url, { httpAgent: new socksProxyAgent('socks5://host:1080') });`
|
|
202
|
+
|
|
203
|
+
### Data Parsing and Templates
|
|
204
|
+
- `YAML`: parse/stringify YAML. Example: `const obj = YAML.parse(text);`
|
|
205
|
+
- `toml`: parse TOML. Example: `const obj = toml.parse(text);`
|
|
206
|
+
- `ini`: parse INI files. Example: `const cfg = ini.parse(text);`
|
|
207
|
+
- `xml2js`: XML to JS objects. Example: `const obj = await xml2js.parseStringPromise(xml);`
|
|
208
|
+
- `XMLParser`: fast XML parsing. Example: `const obj = new XMLParser().parse(xml);`
|
|
209
|
+
- `papaparse` / `Papa`: CSV parsing. Example: `papaparse.parse(csv, { header: true }).data;`
|
|
210
|
+
- `Handlebars`: templates. Example: `const tpl = Handlebars.compile('Hi {{name}}'); tpl({ name: 'AIMC' });`
|
|
211
|
+
- `protobufjs` / `protobuf`: Protobuf support. Example: `const root = await protobuf.load('schema.proto');`
|
|
212
|
+
|
|
213
|
+
### Validation and Schema
|
|
214
|
+
- `zod` / `z`: schema validation. Example: `z.object({ id: z.string() }).parse(input);`
|
|
215
|
+
- `joi` / `Joi`: expressive validation. Example: `Joi.object({ id: Joi.string().required() }).validate(input);`
|
|
216
|
+
- `yup`: object schema validation. Example: `await yup.object({ email: yup.string().email() }).validate(input);`
|
|
217
|
+
- `Ajv`: JSON Schema validator. Example: `const validate = new Ajv().compile(schema); validate(input);`
|
|
218
|
+
- `validator`: common validators. Example: `validator.isEmail(email);`
|
|
219
|
+
|
|
220
|
+
### Dates, Time, and Scheduling
|
|
221
|
+
- `dayjs`: date formatting/math. Example: `dayjs().add(1, 'day').format('YYYY-MM-DD');`
|
|
222
|
+
- `dateFns`: functional date utils. Example: `dateFns.addDays(new Date(), 7);`
|
|
223
|
+
- `dateFnsTz`: timezone helpers. Example: `dateFnsTz.formatInTimeZone(new Date(), 'UTC', 'yyyy-MM-dd');`
|
|
224
|
+
- `moment`: timezone-aware dates. Example: `moment().tz('America/New_York').format();`
|
|
225
|
+
- `cronParser`: cron schedule parsing. Example: `cronParser.parseExpression('0 * * * *').next().toString();`
|
|
226
|
+
- `ms`: duration parsing. Example: `ms('2h');`
|
|
227
|
+
|
|
228
|
+
### Text, Search, and Similarity
|
|
229
|
+
- `cheerio`: HTML parsing. Example: `const $ = cheerio.load(html); $('title').text();`
|
|
230
|
+
- `fuzzy` (Fuse.js): fuzzy search. Example: `const fuse = new fuzzy(list, { keys: ['title'] }); fuse.search('term');`
|
|
231
|
+
- `stringSimilarity`: string similarity score. Example: `stringSimilarity.compareTwoStrings(a, b);`
|
|
232
|
+
- `marked`: Markdown to HTML. Example: `marked.parse('# Title');`
|
|
233
|
+
- `slug`: slugify strings. Example: `slug('My Title');`
|
|
234
|
+
- `pluralize`: pluralization. Example: `pluralize('person', 2);`
|
|
235
|
+
- `htmlToText`: HTML to text. Example: `htmlToText.convert('<b>hi</b>');`
|
|
219
236
|
|
|
220
237
|
### IDs and Utilities
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
-
|
|
230
|
-
-
|
|
238
|
+
- `_` / `lodash`: utility helpers. Example: `_.uniqBy(items, 'id');`
|
|
239
|
+
- `uuid`: UUID generation. Example: `uuid.v4();`
|
|
240
|
+
- `nanoid`: compact IDs. Example: `nanoid();`
|
|
241
|
+
- `bytes`: parse/format bytes. Example: `bytes(1024);` or `bytes('1MB');`
|
|
242
|
+
- `jsonDiff`: JSON diffing. Example: `jsonDiff.diff(a, b);`
|
|
243
|
+
- `pRetry`: retry helper. Example: `await pRetry(() => axios.get(url), { retries: 3 });`
|
|
244
|
+
|
|
245
|
+
### Language and NLP
|
|
246
|
+
- `franc`: language detection. Example: `franc('This is English');`
|
|
247
|
+
- `compromise`: NLP utilities. Example: `compromise('Hello world').nouns().out('array');`
|
|
248
|
+
|
|
249
|
+
### Media and Files
|
|
250
|
+
- `QRCode` / `qrcode`: QR generation. Example: `await QRCode.toDataURL('hello');`
|
|
251
|
+
- `ytdl`: media downloads. Example: `const stream = ytdl(url, { quality: 'highest' });`
|
|
252
|
+
- `ffmpeg` (fluent-ffmpeg): build FFmpeg pipelines. Example: `ffmpeg('in.mp4').size('1280x?').save('out.mp4');`
|
|
253
|
+
- `ffmpegStatic`: FFmpeg binary path. Example: `ffmpeg.setFfmpegPath(ffmpegStatic);`
|
|
254
|
+
- `ffprobeStatic`: ffprobe binary path. Example: `ffmpeg.setFfprobePath(ffprobeStatic);`
|
|
255
|
+
|
|
256
|
+
### Database
|
|
257
|
+
- `knex`: SQL query builder. Example: `const db = knex({ client: 'pg', connection: process.env.DB_URL });`
|
|
258
|
+
|
|
259
|
+
### Other Utilities
|
|
260
|
+
- `phoneNumber` (libphonenumber-js): phone parsing. Example: `phoneNumber.parsePhoneNumber('+14155552671').formatInternational();`
|
|
261
|
+
- `iban`: IBAN validation. Example: `iban.isValid('GB82WEST12345698765432');`
|
|
262
|
+
|
|
263
|
+
### Optional Native Helpers
|
|
264
|
+
- `bufferutil`: optional native buffer helpers (if installed).
|
|
265
|
+
- `utf8Validate`: optional UTF-8 validation (if installed).
|
|
231
266
|
|
|
232
267
|
## Configuration
|
|
233
268
|
|