@davixlabs/n8n-nodes-davix-h2i 2.2.0 → 2.3.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/README.md +4 -2
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/errors.js +13 -2
- package/dist/core/fields.js +44 -6
- package/dist/core/forms/binary.d.ts +5 -0
- package/dist/core/forms/binary.js +60 -0
- package/dist/core/forms/index.d.ts +1 -0
- package/dist/core/forms/index.js +4 -1
- package/dist/core/forms/props.js +4 -1
- package/dist/core/forms/read.js +5 -0
- package/dist/core/help.js +11 -0
- package/dist/core/hidden.js +2 -0
- package/dist/core/params.js +18 -1
- package/dist/core/primary.js +3 -0
- package/dist/core/results.js +1 -1
- package/dist/core/studio.d.ts +16 -0
- package/dist/core/studio.js +55 -0
- package/dist/nodes/DavixH2I.node.js +5 -7
- package/dist/nodes/resources/ai-content/index.js +8 -0
- package/dist/nodes/resources/ai-documents/index.js +18 -0
- package/dist/nodes/resources/ai-extraction/index.js +5 -0
- package/dist/nodes/resources/ai-generation/index.js +5 -0
- package/dist/nodes/resources/ai-ocr/index.js +2 -0
- package/dist/nodes/resources/ai-vision/index.js +2 -0
- package/dist/nodes/resources/data/index.js +21 -0
- package/dist/nodes/resources/documents/index.js +39 -0
- package/dist/nodes/resources/images/index.js +34 -0
- package/dist/nodes/resources/pdfs/index.js +23 -0
- package/dist/nodes/resources/render/index.js +16 -0
- package/dist/nodes/resources/usage/index.js +2 -1
- package/dist/vendor/davix-h2i-sdk/LICENSE +10 -0
- package/dist/vendor/davix-h2i-sdk/index.d.ts +16775 -4369
- package/dist/vendor/davix-h2i-sdk/package.json +3 -2
- package/dist/vendor/davix-h2i-sdk/src/generated/api.js +177 -0
- package/dist/vendor/davix-h2i-sdk/src/generated/contract.json +1 -1
- package/dist/vendor/davix-h2i-sdk/src/generated/enums.js +1938 -66
- package/dist/vendor/davix-h2i-sdk/src/generated/error-codes.js +4 -0
- package/dist/vendor/studio-specs/colors.js +78 -0
- package/dist/vendor/studio-specs/field-examples.js +406 -0
- package/dist/vendor/studio-specs/field-placeholders.js +43 -0
- package/dist/vendor/studio-specs/field-specs.js +284 -14
- package/dist/vendor/studio-specs/input-choice.js +49 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Davix H2I for n8n
|
|
2
2
|
|
|
3
|
-
One node, **Davix H2I**, with
|
|
3
|
+
One node, **Davix H2I**, with all 308 tools: images, AI, PDFs, documents, data, render, and your own templates, presets, files and jobs.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Create a **Davix H2I API** credential and paste your API key from the Dashboard.
|
|
|
13
13
|
## How it works
|
|
14
14
|
|
|
15
15
|
1. Pick a **Resource**. (For **AI** pick the kind of AI work next.) Then pick the **Operation**.
|
|
16
|
-
2. The **input
|
|
16
|
+
2. The **input** comes first: the name of the binary field that holds the file (usually `data`), or a **Source URL** under Options. Actions that also take typed text have an **Input** choice (*Upload a file* or *Paste the text*).
|
|
17
17
|
3. **Settings**: fill them in on the screen, or start from one of your **saved presets**. Anything you set on the screen replaces that value of the preset.
|
|
18
18
|
4. For **Render**, choose **Write HTML Here** or **Use a Saved Template**. A template shows the variables it needs as fields to fill in.
|
|
19
19
|
5. The main settings of each action are on the screen. Everything less common is under **Options → Add Option**. Hover the **?** next to any field to see what it does.
|
|
@@ -21,6 +21,8 @@ Create a **Davix H2I API** credential and paste your API key from the Dashboard.
|
|
|
21
21
|
|
|
22
22
|
Give a call an **App Name** (Options) to see in your History which workflow made it. Left empty, the name of the workflow is used.
|
|
23
23
|
|
|
24
|
+
**Check Only (No Credits Used)** (Options) tests a call without running it. Colours use a colour picker, choices are drop-downs, and a ***** marks what must be filled in.
|
|
25
|
+
|
|
24
26
|
Long actions can run as a **background job**: turn on *Run as Background Job* and keep *Wait for Completion* on, or fetch the job later with **Job → Wait for Completion**.
|
|
25
27
|
|
|
26
28
|
See [docs/](docs/README.md) for the structure, development and testing.
|
package/dist/core/config.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export declare const SERVER_URL = "https://app.h2i.davixlabs.io";
|
|
6
6
|
/** Shown in the customer's History when a workflow does not name its own app. */
|
|
7
7
|
export declare const DEFAULT_APP_NAME = "Davix H2I n8n node";
|
|
8
|
-
export declare const NODE_PACKAGE_VERSION = "2.
|
|
8
|
+
export declare const NODE_PACKAGE_VERSION = "2.3.0";
|
|
9
9
|
export declare const CREDENTIAL_NAME = "davixH2IApi";
|
|
10
10
|
/** How long a "wait for the background job" call may take at most, in seconds. */
|
|
11
11
|
export declare const DEFAULT_MAX_WAIT_SECONDS = 300;
|
package/dist/core/config.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.DEFAULT_MAX_WAIT_SECONDS = exports.CREDENTIAL_NAME = exports.NODE_PACKAG
|
|
|
8
8
|
exports.SERVER_URL = 'https://app.h2i.davixlabs.io';
|
|
9
9
|
/** Shown in the customer's History when a workflow does not name its own app. */
|
|
10
10
|
exports.DEFAULT_APP_NAME = 'Davix H2I n8n node';
|
|
11
|
-
exports.NODE_PACKAGE_VERSION = '2.
|
|
11
|
+
exports.NODE_PACKAGE_VERSION = '2.3.0'; // the same as package.json (a unit test checks it)
|
|
12
12
|
exports.CREDENTIAL_NAME = 'davixH2IApi';
|
|
13
13
|
/** How long a "wait for the background job" call may take at most, in seconds. */
|
|
14
14
|
exports.DEFAULT_MAX_WAIT_SECONDS = 300;
|
package/dist/core/errors.js
CHANGED
|
@@ -8,6 +8,17 @@ const n8n_workflow_1 = require("n8n-workflow");
|
|
|
8
8
|
function redact(text) {
|
|
9
9
|
return String(text).replace(/h2i_[A-Za-z0-9_\-]{8,}/g, 'h2i_****').replace(/Bearer\s+[A-Za-z0-9._\-]+/gi, 'Bearer ****');
|
|
10
10
|
}
|
|
11
|
+
/** What a plan-related answer means for a person, in plain words (the service sends its own hint too; this is added when it is a plan limit). */
|
|
12
|
+
const PLAN_HINTS = {
|
|
13
|
+
monthly_quota_exceeded: "Your plan's credits for this period are used up.",
|
|
14
|
+
key_quota_exceeded: 'This API key has reached the limit set for it in your Dashboard.',
|
|
15
|
+
ai_quota_exceeded: "Your plan's AI allowance for this period is used up.",
|
|
16
|
+
endpoint_not_allowed: 'This action is not included in your plan.',
|
|
17
|
+
file_too_large: 'The file is bigger than your plan allows.',
|
|
18
|
+
format_not_allowed: 'This file type is not allowed on your plan.',
|
|
19
|
+
rate_limit_exceeded: 'Too many calls too fast for your plan. Wait a moment, or slow the workflow down.',
|
|
20
|
+
async_requires_customer_key: 'Background jobs need your own API key (create one in the Dashboard).',
|
|
21
|
+
};
|
|
11
22
|
/** An SDK error (or any other error) turned into a short message and a helpful second line. */
|
|
12
23
|
function describeError(err) {
|
|
13
24
|
const e = err;
|
|
@@ -15,8 +26,8 @@ function describeError(err) {
|
|
|
15
26
|
const parts = [];
|
|
16
27
|
if (e && e.hint)
|
|
17
28
|
parts.push(redact(String(e.hint)));
|
|
18
|
-
if (e && e.code
|
|
19
|
-
parts.push(
|
|
29
|
+
if (e && e.code && PLAN_HINTS[e.code])
|
|
30
|
+
parts.push(PLAN_HINTS[e.code]);
|
|
20
31
|
if (e && e.renewalUrl)
|
|
21
32
|
parts.push(`Renew or upgrade: ${redact(String(e.renewalUrl))}`);
|
|
22
33
|
if (e && e.requestId)
|
package/dist/core/fields.js
CHANGED
|
@@ -17,6 +17,7 @@ const config_1 = require("./config");
|
|
|
17
17
|
const help_1 = require("./help");
|
|
18
18
|
const forms_1 = require("./forms");
|
|
19
19
|
const primary_1 = require("./primary");
|
|
20
|
+
const studio_1 = require("./studio");
|
|
20
21
|
const sdk_1 = require("./sdk");
|
|
21
22
|
/**
|
|
22
23
|
* Turns an API endpoint from the SDK contract into n8n screens. Nothing about a parameter is written by hand: its name,
|
|
@@ -272,7 +273,10 @@ function propertyFor(endpointId, f, topLevel) {
|
|
|
272
273
|
typeOptions.numberPrecision = 3;
|
|
273
274
|
// A number that is not required and has no default starts empty: empty means "not set".
|
|
274
275
|
const start = typeof f.default === 'number' ? f.default : f.required ? (f.minimum !== undefined && f.minimum > 0 ? f.minimum : 0) : '';
|
|
275
|
-
|
|
276
|
+
const num = { ...base, type: 'number', typeOptions, default: start };
|
|
277
|
+
if (f.placeholder)
|
|
278
|
+
num.placeholder = String(f.placeholder);
|
|
279
|
+
return num;
|
|
276
280
|
}
|
|
277
281
|
case 'array': {
|
|
278
282
|
const items = f.items || {};
|
|
@@ -292,6 +296,10 @@ function propertyFor(endpointId, f, topLevel) {
|
|
|
292
296
|
case 'object':
|
|
293
297
|
return { ...base, type: 'json', default: optionalMain ? '' : '{}', description: `${base.description} Write it as a JSON object, for example { ... }.` };
|
|
294
298
|
default: {
|
|
299
|
+
// A colour gets n8n's colour picker (Studio draws a swatch for the same parameters); typing a code or an expression still works.
|
|
300
|
+
if ((0, studio_1.isColour)(endpointId, f)) {
|
|
301
|
+
return { ...base, type: 'color', default: typeof f.default === 'string' && /^#[0-9a-f]{3,8}$/i.test(f.default) ? f.default : '' };
|
|
302
|
+
}
|
|
295
303
|
const typeOptions = {};
|
|
296
304
|
if (f.format === 'password' || /^(password|userPassword|ownerPassword|keyPem|passphrase)$/.test(f.name))
|
|
297
305
|
typeOptions.password = true;
|
|
@@ -300,10 +308,10 @@ function propertyFor(endpointId, f, topLevel) {
|
|
|
300
308
|
const out = { ...base, type: 'string', default: typeof f.default === 'string' ? f.default : '' };
|
|
301
309
|
if (Object.keys(typeOptions).length)
|
|
302
310
|
out.typeOptions = typeOptions;
|
|
303
|
-
if (f.format === 'hex-color')
|
|
304
|
-
out.placeholder = '#112233';
|
|
305
311
|
if (f.example !== undefined && typeof f.example === 'string')
|
|
306
312
|
out.placeholder = f.example;
|
|
313
|
+
if (f.placeholder)
|
|
314
|
+
out.placeholder = String(f.placeholder).split('\n')[0];
|
|
307
315
|
return out;
|
|
308
316
|
}
|
|
309
317
|
}
|
|
@@ -500,11 +508,14 @@ function buildOperationProperties(scope, op) {
|
|
|
500
508
|
const flags = endpointFlags(endpointId);
|
|
501
509
|
const when = (extra) => ({ show: { ...show.show, ...extra } });
|
|
502
510
|
// The lists of presets and templates depend on the action that is open, so they reload when it changes.
|
|
503
|
-
const reloadOn = ['resource',
|
|
511
|
+
const reloadOn = ['resource', 'operation'];
|
|
504
512
|
const mains = fields.filter((x) => (0, primary_1.isMain)(endpointId, x) && !isAppLabel(x));
|
|
505
513
|
const primaryFiles = mains.filter((x) => x.type === 'file' && x._primary);
|
|
506
514
|
const belowMains = mains.filter((x) => !(x.type === 'file' && x._primary));
|
|
507
515
|
const manualOnly = preset ? { settingsSource: ['manual'] } : {};
|
|
516
|
+
// Tools that take typed values OR a file (Studio's "input choice"): a switch at the top shows only the chosen input.
|
|
517
|
+
const choice = (0, studio_1.inputChoice)(endpointId);
|
|
518
|
+
const either = choice !== null && choice.kind === 'either';
|
|
508
519
|
// ---------------------------------------------------------------- above the divider
|
|
509
520
|
if (preset) {
|
|
510
521
|
out.push({
|
|
@@ -534,8 +545,23 @@ function buildOperationProperties(scope, op) {
|
|
|
534
545
|
displayOptions: show,
|
|
535
546
|
});
|
|
536
547
|
}
|
|
548
|
+
if (choice !== null && either) {
|
|
549
|
+
const name = (s) => s.replace(/\b([a-z])/g, (m) => m.toUpperCase()).replace(/\b(A|An|The|To|Of|It|In|Or)\b(?!$)/g, (m) => m.toLowerCase());
|
|
550
|
+
out.push({
|
|
551
|
+
displayName: 'Input',
|
|
552
|
+
name: 'inputType',
|
|
553
|
+
type: 'options',
|
|
554
|
+
default: 'file',
|
|
555
|
+
description: 'What this action works on: a file (the Input Binary Field, or a Source URL under Options) or the values you type here. Only the one you choose is sent.',
|
|
556
|
+
options: [
|
|
557
|
+
{ name: name(choice.labels[1]), value: 'file', description: 'Use a file from an earlier node, or a web address' },
|
|
558
|
+
{ name: name(choice.labels[0]), value: 'typed', description: 'Type or paste it in the fields below' },
|
|
559
|
+
],
|
|
560
|
+
displayOptions: show,
|
|
561
|
+
});
|
|
562
|
+
}
|
|
537
563
|
for (const f of primaryFiles) {
|
|
538
|
-
out.push({ ...propertyFor(endpointId, f, true), required: Boolean(f.required), displayOptions: show });
|
|
564
|
+
out.push({ ...propertyFor(endpointId, f, true), required: Boolean(f.required), displayOptions: either ? when({ inputType: ['file'] }) : show });
|
|
539
565
|
}
|
|
540
566
|
if (preset) {
|
|
541
567
|
out.push(section('sectionManual', 'Your Settings', 'Fill in the settings below. Anything you leave empty uses the default.', { ...show.show, settingsSource: ['manual'] }), section('sectionPreset', 'Saved Preset', 'Choose a preset. Its saved settings appear below as fields with their values; change a value to replace it for this run only.', { ...show.show, settingsSource: ['preset'] }));
|
|
@@ -641,6 +667,9 @@ function buildOperationProperties(scope, op) {
|
|
|
641
667
|
const p = propertyFor(endpointId, f, true);
|
|
642
668
|
const gated = template && ['html', 'css'].includes(f.name); // only needed when the content is written here
|
|
643
669
|
const conditions = { ...manualOnly };
|
|
670
|
+
const typedStandIn = choice !== null && either && choice.alt.includes(f.name);
|
|
671
|
+
if (typedStandIn)
|
|
672
|
+
conditions.inputType = ['typed'];
|
|
644
673
|
if (gated)
|
|
645
674
|
conditions.contentSource = ['manual'];
|
|
646
675
|
// Files other than the main input (a watermark image, a logo) are not part of a preset, so they stay visible.
|
|
@@ -650,7 +679,9 @@ function buildOperationProperties(scope, op) {
|
|
|
650
679
|
out.push({ ...p, required: false, displayOptions: formDisplay }, toggle, json);
|
|
651
680
|
continue;
|
|
652
681
|
}
|
|
653
|
-
|
|
682
|
+
// The pink star of Studio: required and with nothing to fall back on (a default is what the action uses when the box is left alone). A hidden box (preset in use) is never checked by n8n.
|
|
683
|
+
const starred = (Boolean(f.required) && (f.default === undefined || f.default === null || f.default === '')) || (typedStandIn && choice !== null && choice.stars.includes(f.name));
|
|
684
|
+
out.push({ ...p, required: starred && !gated, displayOptions: where });
|
|
654
685
|
}
|
|
655
686
|
if (op.paged) {
|
|
656
687
|
out.push({
|
|
@@ -678,6 +709,13 @@ function buildOperationProperties(scope, op) {
|
|
|
678
709
|
function mapOptional(f) {
|
|
679
710
|
{
|
|
680
711
|
const p = propertyFor(endpointId, f, false);
|
|
712
|
+
if (f.name === 'validate_only') {
|
|
713
|
+
return {
|
|
714
|
+
...p,
|
|
715
|
+
displayName: 'Check Only (No Credits Used)',
|
|
716
|
+
description: 'Whether to only check this call without running it. You get back whether it would work (valid), a list of every problem found, what it would count against your plan (estimate) and the limits that apply to you. Nothing is processed, no file is made and no credits are used. Use it to test a workflow safely.',
|
|
717
|
+
};
|
|
718
|
+
}
|
|
681
719
|
if (f.name === 'async') {
|
|
682
720
|
return { ...p, displayName: 'Run as Background Job', description: `${helpText(f, endpointId)} Pair it with "Wait for Completion" to get the finished result in the same step.` };
|
|
683
721
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const BINARY_MARK = "\u0001binary:";
|
|
3
|
+
export declare function hasBinaryMark(value: unknown): boolean;
|
|
4
|
+
/** The value with every marked binary field name replaced by the picture's data. */
|
|
5
|
+
export declare function resolveBinary(ctx: IExecuteFunctions, itemIndex: number, value: unknown): Promise<unknown>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BINARY_MARK = void 0;
|
|
4
|
+
exports.hasBinaryMark = hasBinaryMark;
|
|
5
|
+
exports.resolveBinary = resolveBinary;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
/*
|
|
8
|
+
* A few forms hold a small picture that the API takes inside the request (the logo of an invoice, for example). On the n8n screen that box
|
|
9
|
+
* is the name of a binary field. `read.ts` writes the name behind this mark; after the form is built, `resolveBinary` replaces every marked
|
|
10
|
+
* value with the picture as the data the API takes ("data:image/png;base64,...").
|
|
11
|
+
*/
|
|
12
|
+
exports.BINARY_MARK = '\u0001binary:';
|
|
13
|
+
/** What the service accepts for an embedded picture, with room to spare (about 400 KB of picture). */
|
|
14
|
+
const MAX_CHARS = 540000;
|
|
15
|
+
function hasBinaryMark(value) {
|
|
16
|
+
if (typeof value === 'string')
|
|
17
|
+
return value.startsWith(exports.BINARY_MARK);
|
|
18
|
+
if (Array.isArray(value))
|
|
19
|
+
return value.some(hasBinaryMark);
|
|
20
|
+
if (value !== null && typeof value === 'object')
|
|
21
|
+
return Object.values(value).some(hasBinaryMark);
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
async function one(ctx, itemIndex, field) {
|
|
25
|
+
const node = ctx.getNode();
|
|
26
|
+
if (!(ctx.getInputData()[itemIndex].binary ?? {})[field]) {
|
|
27
|
+
throw new n8n_workflow_1.NodeOperationError(node, `There is no binary field called "${field}" on this item.`, { itemIndex, description: 'Give the name of the binary field that holds the picture. It is usually "data".' });
|
|
28
|
+
}
|
|
29
|
+
const meta = ctx.helpers.assertBinaryData(itemIndex, field);
|
|
30
|
+
if (!/^image\//i.test(String(meta.mimeType ?? ''))) {
|
|
31
|
+
throw new n8n_workflow_1.NodeOperationError(node, `The binary field "${field}" is not a picture (${meta.mimeType || 'unknown type'}).`, { itemIndex, description: 'Use a PNG, JPEG, WebP, GIF or SVG picture.' });
|
|
32
|
+
}
|
|
33
|
+
const data = (await ctx.helpers.getBinaryDataBuffer(itemIndex, field)).toString('base64');
|
|
34
|
+
const url = `data:${meta.mimeType};base64,${data}`;
|
|
35
|
+
if (url.length > MAX_CHARS) {
|
|
36
|
+
throw new n8n_workflow_1.NodeOperationError(node, `The picture in "${field}" is too big to send inside the request (about ${Math.round((data.length * 3) / 4 / 1024)} KB; the limit is about 400 KB).`, {
|
|
37
|
+
itemIndex,
|
|
38
|
+
description: 'Make it smaller first, for example with Image → Resize or Image → Optimize.',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return url;
|
|
42
|
+
}
|
|
43
|
+
/** The value with every marked binary field name replaced by the picture's data. */
|
|
44
|
+
async function resolveBinary(ctx, itemIndex, value) {
|
|
45
|
+
if (typeof value === 'string')
|
|
46
|
+
return value.startsWith(exports.BINARY_MARK) ? one(ctx, itemIndex, value.slice(exports.BINARY_MARK.length)) : value;
|
|
47
|
+
if (Array.isArray(value)) {
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const v of value)
|
|
50
|
+
out.push(await resolveBinary(ctx, itemIndex, v));
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
if (value !== null && typeof value === 'object') {
|
|
54
|
+
const out = {};
|
|
55
|
+
for (const [k, v] of Object.entries(value))
|
|
56
|
+
out[k] = await resolveBinary(ctx, itemIndex, v);
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
package/dist/core/forms/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stateOf = exports.readForm = exports.safeName = exports.formNode = exports.buildFromState = exports.parseToState = exports.formSpec = exports.CODE_ONLY = void 0;
|
|
3
|
+
exports.hasBinaryMark = exports.resolveBinary = exports.stateOf = exports.readForm = exports.safeName = exports.formNode = exports.buildFromState = exports.parseToState = exports.formSpec = exports.CODE_ONLY = void 0;
|
|
4
4
|
var specs_1 = require("./specs");
|
|
5
5
|
Object.defineProperty(exports, "CODE_ONLY", { enumerable: true, get: function () { return specs_1.CODE_ONLY; } });
|
|
6
6
|
Object.defineProperty(exports, "formSpec", { enumerable: true, get: function () { return specs_1.formSpec; } });
|
|
@@ -12,3 +12,6 @@ Object.defineProperty(exports, "safeName", { enumerable: true, get: function ()
|
|
|
12
12
|
var read_1 = require("./read");
|
|
13
13
|
Object.defineProperty(exports, "readForm", { enumerable: true, get: function () { return read_1.readForm; } });
|
|
14
14
|
Object.defineProperty(exports, "stateOf", { enumerable: true, get: function () { return read_1.stateOf; } });
|
|
15
|
+
var binary_1 = require("./binary");
|
|
16
|
+
Object.defineProperty(exports, "resolveBinary", { enumerable: true, get: function () { return binary_1.resolveBinary; } });
|
|
17
|
+
Object.defineProperty(exports, "hasBinaryMark", { enumerable: true, get: function () { return binary_1.hasBinaryMark; } });
|
package/dist/core/forms/props.js
CHANGED
|
@@ -41,7 +41,10 @@ function leaf(sp, name, displayName, description, show) {
|
|
|
41
41
|
case 'textarea':
|
|
42
42
|
return withShow({ ...base, type: 'string', typeOptions: { rows: 3 }, default: '' }, show);
|
|
43
43
|
case 'color':
|
|
44
|
-
return withShow({ ...base, type: '
|
|
44
|
+
return withShow({ ...base, type: 'color', default: '' }, show);
|
|
45
|
+
case 'image':
|
|
46
|
+
// A small picture the API takes inside the request: it is chosen by the name of the binary field that holds it (read.ts and params.ts turn it into the data it needs).
|
|
47
|
+
return withShow({ displayName: `${displayName} (Binary Field)`, name, description: `${description} Name of the binary field that holds the picture, usually "data". It is sent inside the request, so use a small picture (up to about 400 KB; make it smaller first with Image → Resize).`, type: 'string', placeholder: 'data', default: '' }, show);
|
|
45
48
|
default:
|
|
46
49
|
return withShow({ ...base, type: 'string', default: '' }, show);
|
|
47
50
|
}
|
package/dist/core/forms/read.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stateOf = stateOf;
|
|
4
4
|
exports.readForm = readForm;
|
|
5
|
+
const binary_1 = require("./binary");
|
|
5
6
|
const csv_1 = require("./csv");
|
|
6
7
|
const props_1 = require("./props");
|
|
7
8
|
const specs_1 = require("./specs");
|
|
@@ -79,6 +80,10 @@ function stateOf(sp, v) {
|
|
|
79
80
|
rows: list(obj(g.props).p).map((r) => ({ name: text(r.name), type: text(r.type) || 'string', format: text(r.format), required: r.required === true ? 'true' : '' })),
|
|
80
81
|
};
|
|
81
82
|
}
|
|
83
|
+
case 'image': {
|
|
84
|
+
const field = text(v).trim();
|
|
85
|
+
return field ? binary_1.BINARY_MARK + field : '';
|
|
86
|
+
}
|
|
82
87
|
default:
|
|
83
88
|
return text(v);
|
|
84
89
|
}
|
package/dist/core/help.js
CHANGED
|
@@ -8,6 +8,17 @@ exports.lookup = lookup;
|
|
|
8
8
|
*/
|
|
9
9
|
const HELP = {
|
|
10
10
|
// ------------------------------------------------------------------ common to many actions
|
|
11
|
+
'ai.content.quiz.count': 'How many questions or flashcards to make. Example: 10.',
|
|
12
|
+
'data.bank.bank_id': 'Only for the OFX result: the bank identifier written into the statement file (the routing or sort code of the bank). Leave it empty if you do not know it.',
|
|
13
|
+
'documents.accessibility.skip': 'Rules you do not want checked, so they are left out of the report. Pick them from the list, or type their names separated by commas.',
|
|
14
|
+
'documents.ebook.publisher': 'The name of the publisher, saved inside the e-book. Example: Davix Labs.',
|
|
15
|
+
'documents.invoice.paper': 'The paper size of the invoice: A4 (the default, used in most countries) or Letter (US and Canada).',
|
|
16
|
+
'images.meme.bottom_text': 'The text at the bottom of the picture. Example: "and then it worked". Leave it empty for no bottom text.',
|
|
17
|
+
'render.calendar.today': 'A day to circle, written as a date, for example 2026-12-24. Leave it empty to circle nothing.',
|
|
18
|
+
'render.code.code': 'The source code to show in the picture. Paste it exactly as it is, with its line breaks.',
|
|
19
|
+
'render.code.line_numbers': 'Whether to show a line number next to every line of code.',
|
|
20
|
+
'render.resume.paper': 'The paper size of the CV: A4 (the default, used in most countries) or Letter (US and Canada).',
|
|
21
|
+
'render.word-cloud.stopwords': 'More words to leave out of the cloud (every language already has its common small words removed). Separate them with commas.',
|
|
11
22
|
app: 'A label for this call. It is shown in your Davix H2I History next to the result, so you can tell which workflow made it. Type any short name, for example "Shop importer". Leave it empty to use the name of this n8n workflow.',
|
|
12
23
|
async: 'Normally n8n waits while the service works. Turn this on to hand the work to a background job instead: useful for big files or slow actions. With "Wait for Completion" on (below) n8n still returns the finished result; turn that off to get only a job number.',
|
|
13
24
|
source_url: 'A web address of a file, used instead of an Input Binary Field (or in addition to it). Paste a full address that starts with https://, for example https://example.com/photo.jpg. It must be reachable from the internet; the service downloads it for you. Note that the service accepts either a file or a web address, not both, in one call.',
|
package/dist/core/hidden.js
CHANGED
|
@@ -21,6 +21,8 @@ const HIDDEN_ENDPOINTS = [
|
|
|
21
21
|
{ match: 'subscription', why: 'Billing: Dashboard.' },
|
|
22
22
|
{ match: /^keys(\.|$)/, why: 'API keys: a workflow must never create or rotate its own key.' },
|
|
23
23
|
{ match: /^notifications(\.|$)/, why: 'Portal inbox.' },
|
|
24
|
+
{ match: /^email\.preferences(\.|$)/, why: 'Which e-mails you receive: set in the Dashboard.' },
|
|
25
|
+
{ match: 'reports', why: 'A note to the team about a problem: written in the Dashboard, never from a workflow.' },
|
|
24
26
|
{ match: 'certificates.post', why: 'Private keys are uploaded in the Dashboard, never through a workflow.' },
|
|
25
27
|
{ match: 'certificates.{id}.delete', why: 'Certificates are removed in the Dashboard.' },
|
|
26
28
|
];
|
package/dist/core/params.js
CHANGED
|
@@ -6,6 +6,7 @@ const config_1 = require("./config");
|
|
|
6
6
|
const fields_1 = require("./fields");
|
|
7
7
|
const forms_1 = require("./forms");
|
|
8
8
|
const primary_1 = require("./primary");
|
|
9
|
+
const studio_1 = require("./studio");
|
|
9
10
|
const SKIPPED = new Set(['Idempotency-Key']);
|
|
10
11
|
/** Lists the service reads only as comma text, although its contract also names a JSON list (checked against the real service). */
|
|
11
12
|
const COMMA_LISTS = new Set(['images.inspect.checks']);
|
|
@@ -111,6 +112,11 @@ function rowValue(p, v) {
|
|
|
111
112
|
}
|
|
112
113
|
return v;
|
|
113
114
|
}
|
|
115
|
+
/** Does this call use the typed input instead of the file? (only tools with an input choice have the switch) */
|
|
116
|
+
function typedInputEarly(ctx, itemIndex, endpointId) {
|
|
117
|
+
const c = (0, studio_1.inputChoice)(endpointId);
|
|
118
|
+
return c !== null && c.kind === 'either' && String(ctx.getNodeParameter('inputType', itemIndex, 'file')) === 'typed';
|
|
119
|
+
}
|
|
114
120
|
/** Reads every parameter of the operation off the node screen and shapes it the way the SDK wants it. */
|
|
115
121
|
async function collectParams(ctx, itemIndex, op) {
|
|
116
122
|
const endpointId = op.endpoint;
|
|
@@ -118,14 +124,23 @@ async function collectParams(ctx, itemIndex, op) {
|
|
|
118
124
|
const options = ctx.getNodeParameter('options', itemIndex, {}) ?? {};
|
|
119
125
|
const params = {};
|
|
120
126
|
const replaced = (0, fields_1.replacedFields)(endpointId);
|
|
121
|
-
const withLink = isSet(options[(0, fields_1.uiName)('source_url')]) || isSet(options[(0, fields_1.uiName)('source_urls')]);
|
|
127
|
+
const withLink = !typedInputEarly(ctx, itemIndex, endpointId) && (isSet(options[(0, fields_1.uiName)('source_url')]) || isSet(options[(0, fields_1.uiName)('source_urls')]));
|
|
122
128
|
const subs = {};
|
|
129
|
+
// Tools that take typed values or a file (Studio's "input choice"): only the chosen input is read and sent, so both can never go out together.
|
|
130
|
+
const choice = (0, studio_1.inputChoice)(endpointId);
|
|
131
|
+
const typedInput = typedInputEarly(ctx, itemIndex, endpointId);
|
|
123
132
|
const presetMode = (0, fields_1.supportsPreset)(endpointId) && ctx.getNodeParameter('settingsSource', itemIndex, 'manual') === 'preset';
|
|
124
133
|
for (const f of (0, fields_1.virtualFields)(endpointId)) {
|
|
125
134
|
if (SKIPPED.has(f.name) || (f.location === 'header' && f.standard))
|
|
126
135
|
continue;
|
|
127
136
|
if ((0, fields_1.isAppLabel)(f) || replaced.has(f.name))
|
|
128
137
|
continue;
|
|
138
|
+
if (choice !== null && choice.kind === 'either') {
|
|
139
|
+
if (typedInput && (f.type === 'file' || f.name === 'source_url' || f.name === 'source_urls'))
|
|
140
|
+
continue;
|
|
141
|
+
if (!typedInput && choice.alt.includes(f.name))
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
129
144
|
const main = (0, primary_1.isMain)(endpointId, f);
|
|
130
145
|
// A parameter with a form: what was typed in the fields, or the JSON when "Edit as Code" is on (or the "(JSON)" option is used).
|
|
131
146
|
if (f._spec) {
|
|
@@ -140,6 +155,8 @@ async function collectParams(ctx, itemIndex, op) {
|
|
|
140
155
|
value = (0, forms_1.readForm)(f._spec, ctx.getNodeParameter(name, itemIndex, {}));
|
|
141
156
|
else if (Object.prototype.hasOwnProperty.call(options, name))
|
|
142
157
|
value = (0, forms_1.readForm)(f._spec, options[name]);
|
|
158
|
+
if ((0, forms_1.hasBinaryMark)(value))
|
|
159
|
+
value = await (0, forms_1.resolveBinary)(ctx, itemIndex, value);
|
|
143
160
|
if (value === undefined)
|
|
144
161
|
continue;
|
|
145
162
|
if (f._kind === 'sub')
|
package/dist/core/primary.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isMain = isMain;
|
|
4
4
|
const sdk_1 = require("./sdk");
|
|
5
|
+
const studio_1 = require("./studio");
|
|
5
6
|
/**
|
|
6
7
|
* Which parameters of an action sit on the main screen and which wait under "Options → Add Option". The rule is Studio's own ("More options"):
|
|
7
8
|
* the required ones first, then the others in the order of the contract, at least eight up front; settings that are technical or shared by every
|
|
@@ -36,6 +37,8 @@ function isMain(endpointId, f) {
|
|
|
36
37
|
return true;
|
|
37
38
|
if (f.type === 'file')
|
|
38
39
|
return true; // an optional file is still an input, not a tuning knob
|
|
40
|
+
if ((0, studio_1.isTypedInput)(endpointId, f._parent ?? f.name))
|
|
41
|
+
return true; // typed text that stands in for the file is an input too
|
|
39
42
|
if (endpointId.startsWith('ai.') && INPUT_NAMES.has(f.name))
|
|
40
43
|
return true;
|
|
41
44
|
const name = f._parent ?? f.name;
|
package/dist/core/results.js
CHANGED
|
@@ -93,7 +93,7 @@ async function buildItems(ctx, client, itemIndex, endpointId, res, options, list
|
|
|
93
93
|
item.json = {};
|
|
94
94
|
item.binary = { data: await ctx.helpers.prepareBinaryData(data, 'result') };
|
|
95
95
|
}
|
|
96
|
-
else if (flags.files && options.downloadFiles !== false) {
|
|
96
|
+
else if (flags.files && options.downloadFiles !== false && !(data && data.validated === true)) {
|
|
97
97
|
await attachFiles(ctx, client, data, item);
|
|
98
98
|
}
|
|
99
99
|
return [item];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Is this contract parameter a colour? (text that is not a list of choices, named or formatted like a colour) */
|
|
2
|
+
export declare function isColour(endpointId: string, f: any): boolean;
|
|
3
|
+
export interface InputChoice {
|
|
4
|
+
/** 'either': the file or typed values are two ways to give the same input. 'extra': the file is only an optional extra. */
|
|
5
|
+
kind: 'either' | 'extra';
|
|
6
|
+
/** The typed parameters that stand in for the file. */
|
|
7
|
+
alt: string[];
|
|
8
|
+
/** The parameters that get the star (one of the two must be given). */
|
|
9
|
+
stars: string[];
|
|
10
|
+
/** What the two choices are called: [typed, file]. */
|
|
11
|
+
labels: [string, string];
|
|
12
|
+
}
|
|
13
|
+
/** What the input of an action looks like: null when the action simply needs a file (or has no file at all). */
|
|
14
|
+
export declare function inputChoice(endpointId: string): InputChoice | null;
|
|
15
|
+
/** Is this parameter one of the typed values that stand in for the file of an "either" action? */
|
|
16
|
+
export declare function isTypedInput(endpointId: string, name: string): boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isColour = isColour;
|
|
4
|
+
exports.inputChoice = inputChoice;
|
|
5
|
+
exports.isTypedInput = isTypedInput;
|
|
6
|
+
const sdk_1 = require("./sdk");
|
|
7
|
+
/*
|
|
8
|
+
* Two small data modules of Davix H2I Studio, installed untouched (apart from the last line that lets Node load them) in vendor/studio-specs by
|
|
9
|
+
* bin/update-sdk.js. They are why the node and Studio agree on the same two things:
|
|
10
|
+
*
|
|
11
|
+
* colours which parameters are colours (a colour picker, not a text box)
|
|
12
|
+
* input choice which tools take typed text OR an uploaded file (a switch that sends only the one chosen)
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
|
+
const Colors = require('../vendor/studio-specs/colors.js');
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17
|
+
const Choice = require('../vendor/studio-specs/input-choice.js');
|
|
18
|
+
/** Is this contract parameter a colour? (text that is not a list of choices, named or formatted like a colour) */
|
|
19
|
+
function isColour(endpointId, f) {
|
|
20
|
+
if (!f || f.type !== 'string' || (Array.isArray(f.enum) && f.enum.length))
|
|
21
|
+
return false;
|
|
22
|
+
try {
|
|
23
|
+
return Boolean(Colors.is(endpointId, String(f.name).split('__').pop(), { type: f.type, enum: f.enum, format: f.format }));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const cache = new Map();
|
|
30
|
+
/** What the input of an action looks like: null when the action simply needs a file (or has no file at all). */
|
|
31
|
+
function inputChoice(endpointId) {
|
|
32
|
+
if (cache.has(endpointId))
|
|
33
|
+
return cache.get(endpointId);
|
|
34
|
+
const endpoint = sdk_1.contract.endpoints.find((e) => e.id === endpointId);
|
|
35
|
+
let out = null;
|
|
36
|
+
if (endpoint) {
|
|
37
|
+
const fields = endpoint.request.fields;
|
|
38
|
+
const files = fields.filter((f) => f.type === 'file');
|
|
39
|
+
const primary = files.find((f) => f.required) ?? files[0];
|
|
40
|
+
const info = Choice.info({
|
|
41
|
+
id: endpointId,
|
|
42
|
+
fileFields: files.map((f) => ({ name: f.name, main: f === primary, required: Boolean(f.required), requiredWhen: f.requiredWhen })),
|
|
43
|
+
params: fields.map((f) => ({ name: f.name })),
|
|
44
|
+
});
|
|
45
|
+
if (info && (info.kind === 'either' || info.kind === 'extra'))
|
|
46
|
+
out = { kind: info.kind, alt: info.alt ?? [], stars: info.stars ?? [], labels: info.labels };
|
|
47
|
+
}
|
|
48
|
+
cache.set(endpointId, out);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** Is this parameter one of the typed values that stand in for the file of an "either" action? */
|
|
52
|
+
function isTypedInput(endpointId, name) {
|
|
53
|
+
const c = inputChoice(endpointId);
|
|
54
|
+
return Boolean(c && c.kind === 'either' && c.alt.includes(name));
|
|
55
|
+
}
|
|
@@ -21,13 +21,11 @@ const files_1 = require("./resources/files");
|
|
|
21
21
|
const jobs_1 = require("./resources/jobs");
|
|
22
22
|
const certificates_1 = require("./resources/certificates");
|
|
23
23
|
const usage_1 = require("./resources/usage");
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
const aiGroups = [ai_content_1.aiContent, ai_documents_1.aiDocuments, ai_enhancement_1.aiEnhancement, ai_extraction_1.aiExtraction, ai_generation_1.aiGeneration, ai_vision_1.aiVision, ai_ocr_1.aiOcr, ai_general_1.aiGeneral].map((r) => ({ ...r, parent: AI }));
|
|
24
|
+
/**
|
|
25
|
+
* Every kind of AI work is a Resource of its own ("AI: Content Writing", "AI: Documents"...). n8n lists the actions of a Resource in its node picker, so every AI action
|
|
26
|
+
* can be found there by name. (A second choice under one "AI" Resource would hide them from the picker.)
|
|
27
|
+
*/
|
|
28
|
+
const aiGroups = [ai_content_1.aiContent, ai_documents_1.aiDocuments, ai_enhancement_1.aiEnhancement, ai_extraction_1.aiExtraction, ai_generation_1.aiGeneration, ai_vision_1.aiVision, ai_ocr_1.aiOcr, ai_general_1.aiGeneral].map((r) => ({ ...r, name: `AI: ${r.name}` }));
|
|
31
29
|
const node = (0, factory_1.defineNode)({
|
|
32
30
|
displayName: 'Davix H2I',
|
|
33
31
|
name: 'davixH2I',
|
|
@@ -11,4 +11,12 @@ exports.aiContent = (0, define_1.resource)('ai-content', 'Content Writing', 'Wri
|
|
|
11
11
|
'ai.content.social-post',
|
|
12
12
|
'ai.content.product-description',
|
|
13
13
|
'ai.content.document-description',
|
|
14
|
+
['ai.content.cover-letter', { name: 'Cover Letter Writer', description: 'A cover letter from your CV and a job description: only experience that is in the CV is used, requirements it does not show are listed as gaps; code assembles the lett...' }],
|
|
15
|
+
['ai.content.document', { name: 'Document Writer', description: 'Write a letter, report, article, proposal, memo or policy from your instructions and source material; code counts the words, assembles the text and lists the placehold...' }],
|
|
16
|
+
['ai.content.email-reply', { name: 'Reply to an Email', description: 'A ready-to-send reply to the email you give, in the tone and length you choose, covering the points you list; missing facts are left as marked placeholders, never inve...' }],
|
|
17
|
+
['ai.content.html-design', { name: 'Design to HTML', description: 'Turn a screenshot or mockup of a page into one HTML file with its CSS; code takes the page apart and rebuilds it (no scripts, no remote files, remote pictures replaced...' }],
|
|
18
|
+
['ai.content.listing', { name: 'Marketplace Listing', description: 'A listing for eBay, Etsy, Amazon, Facebook, OLX or Vinted from photos and notes: title, description, bullet points, tags and what is still unknown; code applies the ti...' }],
|
|
19
|
+
['ai.content.quiz', { name: 'Quiz and Flashcards', description: 'Make questions from documents or text: multiple choice, true/false, short answer, flashcards or a mix; code makes each question fit its kind (exactly one correct optio...' }],
|
|
20
|
+
['ai.content.slides', { name: 'Slides from a Document', description: 'Turn a document into a slide outline: a title, slides with short bullets and speaker notes; code enforces the slide count and the bullet limits and builds a Markdown o...' }],
|
|
21
|
+
['ai.content.translate', { name: 'Translate Text', description: 'Translate text or UI strings into a language, with formality, a glossary and checks that placeholders such as {{name}} or %s survive.' }],
|
|
14
22
|
]);
|
|
@@ -19,4 +19,22 @@ exports.aiDocuments = (0, define_1.resource)('ai-documents', 'Document Analysis'
|
|
|
19
19
|
'ai.documents.analyze-form',
|
|
20
20
|
'ai.documents.analyze-risks',
|
|
21
21
|
'ai.documents.analyze-table',
|
|
22
|
+
['ai.documents.chart', { name: 'Chart from a Request', description: 'Describe the chart you want in words; the model picks type and columns (and a SQL summary), code runs the SQL and draws the chart as PNG or SVG.' }],
|
|
23
|
+
['ai.documents.checklist', { name: 'Review Documents Against a Checklist', description: 'Check documents against your list of requirements: each requirement is marked met, partly met, not met or unknown with a quote; a quote that is not in the document is ...' }],
|
|
24
|
+
['ai.documents.column', { name: 'AI Column', description: 'Add a column to a table: the instructions say what to work out for each row (a category, a sentiment, a cleaned value, a number); code checks the rows, the type and th...' }],
|
|
25
|
+
['ai.documents.compare', { name: 'Compare Versions of a Document', description: 'Explain what changed between an older and a newer document and how much it matters; the similarity and word counts come from a real diff.' }],
|
|
26
|
+
['ai.documents.compare-offers', { name: 'Compare Offers', description: 'Two to five offers or quotes side by side on the criteria that matter, with pros, cons, caveats and an optional recommendation; code makes every offer complete and fin...' }],
|
|
27
|
+
['ai.documents.detect-pii', { name: 'Detect Personal Data', description: 'Find personal data (names, contacts, ids, financial data, health) with a risk level; patterns add cards, IBANs, e-mails and numbers; values are masked by default.' }],
|
|
28
|
+
['ai.documents.entities', { name: 'Entities and Timeline', description: 'The people, organizations, places, dates, amounts and events of a document, with a dated timeline; code merges repeats, sorts the timeline and counts the mentions in t...' }],
|
|
29
|
+
['ai.documents.fill-form', { name: 'Fill a PDF Form', description: 'Fill the fields of a PDF form from other documents or text: the form fields are read by code, the model matches the information to them, and code checks every value, f...' }],
|
|
30
|
+
['ai.documents.formula', { name: 'Formula Helper', description: 'Write, explain or fix a spreadsheet formula for Excel, Google Sheets or LibreOffice; code checks the brackets, the starting = and the argument separator.' }],
|
|
31
|
+
['ai.documents.humanize', { name: 'Humanize / Change Tone', description: 'Rewrite text so it sounds natural, in the tone and strength you choose; code checks that every number, name, link and placeholder of the original is still there.' }],
|
|
32
|
+
['ai.documents.insights', { name: 'Data Insights', description: 'What a table shows: findings with their evidence, anomalies, chart suggestions and questions to ask next; code checks that every named column exists.' }],
|
|
33
|
+
['ai.documents.localize', { name: 'Translate a Localization File', description: 'Translate the strings of a JSON, YAML, PO, properties, XLIFF or ARB file: keys stay as they are, placeholders are checked, the glossary is applied and a file in the sa...' }],
|
|
34
|
+
['ai.documents.mind-map', { name: 'Mind Map from a Document', description: 'The ideas of a document as a mind map; code checks the tree (parents, loops, depth, size) and writes it as an outline and as a Mermaid mind map.' }],
|
|
35
|
+
['ai.documents.rename', { name: 'Rename Files from Their Content', description: 'Suggest a file name for each document from what it says (date, type, party ...), following a pattern if you give one; code cleans the names (no path characters, separa...' }],
|
|
36
|
+
['ai.documents.resume-match', { name: 'Match a Resume to a Job', description: 'Compare a resume with a job description: every requirement is marked met, partly met or missing with a quote from the resume; quotes are checked against the resume, ke...' }],
|
|
37
|
+
['ai.documents.split', { name: 'Split a Mixed Scan', description: 'Find where one document ends and the next begins in a scan of mixed papers; code makes the page ranges valid (no overlaps, gaps kept as their own parts) and cuts the P...' }],
|
|
38
|
+
['ai.documents.transform', { name: 'Data from a Request', description: 'Describe the table you want in words; the model writes one SQL query, code runs it on your files and gives the result as CSV, TSV, JSON or XLSX.' }],
|
|
39
|
+
['ai.documents.translate-layout', { name: 'Translate a PDF and Keep Its Layout', description: 'Translate the text of a PDF in place: code reads the text blocks with their places, the model translates each block by id, and code covers the old text and draws the t...' }],
|
|
22
40
|
]);
|
|
@@ -11,4 +11,9 @@ exports.aiExtraction = (0, define_1.resource)('ai-extraction', 'Data Extraction'
|
|
|
11
11
|
'ai.extraction.resume',
|
|
12
12
|
'ai.extraction.business-card',
|
|
13
13
|
'ai.extraction.custom',
|
|
14
|
+
['ai.extraction.expense-report', { name: 'Expense Report', description: 'Receipts and invoices become one expense report: lines with date, merchant, category and amount; code adds up the totals, the tax and the groups and compares them with...' }],
|
|
15
|
+
['ai.extraction.payslip', { name: 'Extract a Payslip', description: 'Employer, employee, pay period, earnings, deductions, gross and net pay; earnings, deductions and net are re-added and checked.' }],
|
|
16
|
+
['ai.extraction.shipping-label', { name: 'Extract a Shipping Label', description: 'Carrier, service, tracking numbers, sender, recipient, weight and reference; tracking-number formats and UPS check digits are verified.' }],
|
|
17
|
+
['ai.extraction.tax-form', { name: 'Extract a Tax Form', description: 'Form type, year, recipient, payer and every box (W-2, 1099, P60 and similar); tax identifiers are masked to their last 4 characters unless you turn that off.' }],
|
|
18
|
+
['ai.extraction.utility-bill', { name: 'Extract a Utility Bill', description: 'Provider, account, meter, billing period, usage, charges and amount due; readings, charges and the balance are re-added and checked.' }],
|
|
14
19
|
]);
|
|
@@ -13,4 +13,9 @@ exports.aiGeneration = (0, define_1.resource)('ai-generation', 'Image Generation
|
|
|
13
13
|
'ai.generation.poster',
|
|
14
14
|
'ai.generation.social',
|
|
15
15
|
'ai.generation.thumbnail',
|
|
16
|
+
['ai.generation.erase', { name: 'AI Object Eraser', description: 'Remove an object (and its shadow) and fill the gap so it looks as if it was never there.' }],
|
|
17
|
+
['ai.generation.logo', { name: 'AI Logo Maker', description: 'The model draws the symbol; the name, tagline, layout, colours and background are set as exact text and shapes, on a transparent background if you like.' }],
|
|
18
|
+
['ai.generation.portrait', { name: 'Portrait Styles', description: 'Restyle a portrait photo: professional headshot, LinkedIn, passport-style, studio, cinematic, painting, anime and more, keeping the person recognisable; background, ou...' }],
|
|
19
|
+
['ai.generation.sketch', { name: 'Sketch to Image / Room Redesign / Try-on', description: 'Finish a sketch, redesign a room photo in a style, or show a person wearing a garment from a second picture.' }],
|
|
20
|
+
['ai.generation.style', { name: 'AI Style Transfer', description: 'Restyle a picture after a second picture, or after a description, with a strength and a choice of what to keep (structure, colours or subject).' }],
|
|
16
21
|
]);
|
|
@@ -13,4 +13,6 @@ exports.aiOcr = (0, define_1.resource)('ai-ocr', 'OCR', 'Read text from images a
|
|
|
13
13
|
'ai.ocr.qa',
|
|
14
14
|
'ai.ocr.correct',
|
|
15
15
|
'ai.ocr.detect-language',
|
|
16
|
+
['ai.ocr.formula-table', { name: 'Formula or Table Picture to File', description: 'Read a picture of a formula or a table into LaTeX, Markdown, CSV or HTML; code builds the table files and checks the LaTeX brackets.' }],
|
|
17
|
+
['ai.ocr.math', { name: 'Math Solver', description: 'Solve a maths problem from a picture or text with the steps shown; code checks plain arithmetic answers itself.' }],
|
|
16
18
|
]);
|
|
@@ -13,4 +13,6 @@ exports.aiVision = (0, define_1.resource)('ai-vision', 'Image Understanding', 'D
|
|
|
13
13
|
'ai.images.extract',
|
|
14
14
|
'ai.images.qa',
|
|
15
15
|
'ai.images.translate',
|
|
16
|
+
['ai.images.font', { name: 'Identify a Font', description: 'The closest known fonts for the lettering in a picture, with what matches and a free alternative; these are estimates, never a certain match.' }],
|
|
17
|
+
['ai.images.prompt', { name: 'Image to Prompt', description: 'A prompt that would recreate a picture, written for Midjourney, Stable Diffusion, DALL-E, Flux or any model, with a negative prompt and variants; code enforces the wor...' }],
|
|
16
18
|
]);
|