n8n-nodes-exa-official 0.4.0 → 0.5.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 +21 -6
- package/dist/credentials/ExaApi.credentials.d.ts +1 -0
- package/dist/credentials/ExaApi.credentials.js +1 -0
- package/dist/credentials/ExaApi.credentials.js.map +1 -1
- package/dist/credentials/exa.svg +3 -0
- package/dist/nodes/Exa/Exa.node.js +2 -1
- package/dist/nodes/Exa/Exa.node.js.map +1 -1
- package/dist/nodes/Exa/Exa.node.json +1 -1
- package/dist/nodes/Exa/v2/actions/agent/create.operation.js +98 -36
- package/dist/nodes/Exa/v2/actions/agent/create.operation.js.map +1 -1
- package/dist/nodes/Exa/v2/actions/agent/getEvents.operation.js +12 -3
- package/dist/nodes/Exa/v2/actions/agent/getEvents.operation.js.map +1 -1
- package/dist/nodes/Exa/v2/actions/common.descriptions.js +7 -0
- package/dist/nodes/Exa/v2/actions/common.descriptions.js.map +1 -1
- package/dist/nodes/Exa/v2/actions/monitor/common.descriptions.d.ts +8 -0
- package/dist/nodes/Exa/v2/actions/monitor/common.descriptions.js +52 -0
- package/dist/nodes/Exa/v2/actions/monitor/common.descriptions.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/create.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/create.operation.js +167 -0
- package/dist/nodes/Exa/v2/actions/monitor/create.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/delete.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/delete.operation.js +15 -0
- package/dist/nodes/Exa/v2/actions/monitor/delete.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/get.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/get.operation.js +15 -0
- package/dist/nodes/Exa/v2/actions/monitor/get.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/getMany.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/getMany.operation.js +52 -0
- package/dist/nodes/Exa/v2/actions/monitor/getMany.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRun.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRun.operation.js +26 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRun.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRuns.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRuns.operation.js +17 -0
- package/dist/nodes/Exa/v2/actions/monitor/getRuns.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/index.d.ts +11 -0
- package/dist/nodes/Exa/v2/actions/monitor/index.js +121 -0
- package/dist/nodes/Exa/v2/actions/monitor/index.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/trigger.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/trigger.operation.js +15 -0
- package/dist/nodes/Exa/v2/actions/monitor/trigger.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/monitor/update.operation.d.ts +30 -0
- package/dist/nodes/Exa/v2/actions/monitor/update.operation.js +148 -0
- package/dist/nodes/Exa/v2/actions/monitor/update.operation.js.map +1 -0
- package/dist/nodes/Exa/v2/actions/router.js +16 -1
- package/dist/nodes/Exa/v2/actions/router.js.map +1 -1
- package/dist/nodes/Exa/v2/actions/search/search.operation.js +11 -0
- package/dist/nodes/Exa/v2/actions/search/search.operation.js.map +1 -1
- package/dist/nodes/Exa/v2/actions/versionDescription.js +9 -2
- package/dist/nodes/Exa/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Exa/v2/helpers/agentRun.d.ts +18 -0
- package/dist/nodes/Exa/v2/helpers/agentRun.js +36 -0
- package/dist/nodes/Exa/v2/helpers/agentRun.js.map +1 -0
- package/dist/nodes/Exa/v2/helpers/interfaces.d.ts +1 -1
- package/dist/nodes/Exa/v2/helpers/monitor.d.ts +33 -0
- package/dist/nodes/Exa/v2/helpers/monitor.js +78 -0
- package/dist/nodes/Exa/v2/helpers/monitor.js.map +1 -0
- package/dist/nodes/Exa/v2/helpers/utils.d.ts +1 -0
- package/dist/nodes/Exa/v2/helpers/utils.js +2 -0
- package/dist/nodes/Exa/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/Exa/v2/transport/index.d.ts +15 -3
- package/dist/nodes/Exa/v2/transport/index.js +73 -19
- package/dist/nodes/Exa/v2/transport/index.js.map +1 -1
- package/dist/nodes/ExaTrigger/ExaTrigger.node.d.ts +12 -0
- package/dist/nodes/ExaTrigger/ExaTrigger.node.js +306 -0
- package/dist/nodes/ExaTrigger/ExaTrigger.node.js.map +1 -0
- package/dist/nodes/ExaTrigger/ExaTrigger.node.json +18 -0
- package/dist/nodes/ExaTrigger/logo.svg +3 -0
- package/dist/package.json +8 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# n8n-nodes-exa-official
|
|
2
2
|
|
|
3
|
-
An n8n community node for the [Exa](https://exa.ai) API: web search, content extraction,
|
|
3
|
+
An n8n community node for the [Exa](https://exa.ai) API: web search, content extraction, research agents and web monitors. The package has two nodes:
|
|
4
|
+
|
|
5
|
+
- **Exa** — every operation below. Usable both as a regular node and as a tool for an n8n AI Agent.
|
|
6
|
+
- **Exa Trigger** — starts a workflow each time an Exa monitor finds new results.
|
|
4
7
|
|
|
5
8
|
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
6
9
|
|
|
@@ -27,11 +30,11 @@ Output formats:
|
|
|
27
30
|
- **Text** — a single written answer synthesised from the results.
|
|
28
31
|
- **Structured (JSON Schema)** — JSON matching a schema you provide.
|
|
29
32
|
|
|
30
|
-
Options include category (`company`, `publication`, `news`, `personal site`, `financial report`, `people`), domain and text filters, published-date ranges, additional queries for the deep types, moderation, a system prompt and user location. Content extraction (text, highlights, summary, links, images, `maxAgeHours`, subpages) is available on every search.
|
|
33
|
+
Options include category (`company`, `publication`, `news`, `personal site`, `financial report`, `people`), domain and text filters, published-date ranges, additional queries for the deep types, moderation, a system prompt and user location. Content extraction (text, highlights, summary, links, images, `maxAgeHours`, subpages, Snapshot As Of) is available on every search. New nodes (version 2.1) return highlights by default; workflows saved on version 2 keep returning metadata only.
|
|
31
34
|
|
|
32
35
|
### Contents — `POST /contents`
|
|
33
36
|
|
|
34
|
-
Fetch cleaned text, highlights, summaries, links and images for a list of URLs. Per-URL statuses are merged onto the results, so pages that failed to crawl arrive as items carrying `status` and `error` instead of silently disappearing.
|
|
37
|
+
Fetch cleaned text, highlights, summaries, links and images for a list of URLs. **Snapshot As Of** returns each page as Exa stored it at a past date-time instead of the live page (it cannot be combined with Max Age). Per-URL statuses are merged onto the results, so pages that failed to crawl arrive as items carrying `status` and `error` instead of silently disappearing.
|
|
35
38
|
|
|
36
39
|
### Answer — `POST /answer`
|
|
37
40
|
|
|
@@ -41,12 +44,23 @@ A grounded answer with citations, optionally as JSON matching a schema, optional
|
|
|
41
44
|
|
|
42
45
|
Multi-step research, list building and enrichment.
|
|
43
46
|
|
|
44
|
-
- **Create Run** — start a run, optionally waiting for it to finish by streaming server-sent events or by polling. Supports effort, system prompt, structured output, input rows, metadata, connector data sources and continuation from a previous run.
|
|
47
|
+
- **Create Run** — start a run, optionally waiting for it to finish by streaming server-sent events or by polling. Supports every effort (Minimal to Extra High at a fixed price; Auto and Ultra metered and capped by **Max Cost**, Ultra also by **Max Duration**), system prompt, structured output, input rows, metadata, connector data sources and continuation from a previous run.
|
|
45
48
|
- **Get Run** — status and output of a run.
|
|
46
49
|
- **Get Many Runs** — recent runs, with pagination.
|
|
47
50
|
- **Get Run Events** — list a run's events, or hold an SSE connection open and collect them until the run finishes.
|
|
48
51
|
- **Cancel Run** — stop a queued or running run.
|
|
49
52
|
|
|
53
|
+
### Monitor — `/monitors`
|
|
54
|
+
|
|
55
|
+
A search that runs on a schedule and delivers new results to a webhook.
|
|
56
|
+
|
|
57
|
+
- **Create** — query, schedule (hourly to weekly, a custom interval, or manual only), webhook URL, text or structured output, contents and domain filters. The response carries a `webhookSecret` that Exa shows only once.
|
|
58
|
+
- **Get**, **Get Many**, **Update** (including pause and resume), **Delete**, **Trigger** (run now; the monitor must be active), **Get Runs** and **Get Run**.
|
|
59
|
+
|
|
60
|
+
### Exa Trigger
|
|
61
|
+
|
|
62
|
+
Activating the workflow creates a monitor whose webhook is the trigger's own URL; deactivating it deletes the monitor, and changing the trigger's settings replaces it. Each delivery's `Exa-Signature` is verified against the monitor's secret before the workflow starts, and each finished run becomes one item with its `output` (results, plus the text or structured digest). Exa delivers only to public HTTPS URLs, so a self-hosted n8n needs `WEBHOOK_URL` set to a public address.
|
|
63
|
+
|
|
50
64
|
## Credentials
|
|
51
65
|
|
|
52
66
|
To use this node, you need an Exa API key. You can obtain one by:
|
|
@@ -60,7 +74,7 @@ Add the API key to your n8n credentials as "Exa API".
|
|
|
60
74
|
## Compatibility
|
|
61
75
|
|
|
62
76
|
- Requires n8n 1.60.0 or newer, and Node.js 20.15 or newer.
|
|
63
|
-
- Tested against n8n 2.
|
|
77
|
+
- Tested against n8n 2.45.7.
|
|
64
78
|
|
|
65
79
|
## Usage
|
|
66
80
|
|
|
@@ -75,7 +89,7 @@ Set the node's connection to an **AI Agent** and it appears as a tool. Any param
|
|
|
75
89
|
- **Stream** keeps one server-sent events connection open and returns the finished run (optionally with every event that led to it).
|
|
76
90
|
- **Poll** re-requests the run on an interval.
|
|
77
91
|
|
|
78
|
-
For long runs, turn **Wait for Completion** off, store the returned `id`, and follow the run later with **Get Run** — the run keeps going server-side.
|
|
92
|
+
For long runs, turn **Wait for Completion** off, store the returned `id`, and follow the run later with **Get Run** — the run keeps going server-side. If a wait times out, or the stream drops and polling cannot recover, the error names the run ID: collect it with **Get Run** rather than creating another run. Polling retries rate limits and server errors with backoff.
|
|
79
93
|
|
|
80
94
|
## Resources
|
|
81
95
|
|
|
@@ -94,6 +108,7 @@ npm install
|
|
|
94
108
|
# Build the node
|
|
95
109
|
npm run build
|
|
96
110
|
npm run lint
|
|
111
|
+
npm test
|
|
97
112
|
|
|
98
113
|
# Install the node in your n8n instance
|
|
99
114
|
mkdir -p ~/.n8n/custom && cd ~/.n8n/custom
|
|
@@ -2,6 +2,7 @@ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INo
|
|
|
2
2
|
export declare class ExaApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
|
+
icon: "file:exa.svg";
|
|
5
6
|
documentationUrl: string;
|
|
6
7
|
properties: INodeProperties[];
|
|
7
8
|
authenticate: IAuthenticateGeneric;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExaApi.credentials.js","sourceRoot":"","sources":["../../credentials/ExaApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,SAAS,CAAC;QACxB,qBAAgB,GAAG,+CAA+C,CAAC;QACnE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gEAAgE;aAC7E;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,oBAAoB;gBAC7B,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE;oBACL,KAAK,EAAE,6BAA6B;oBACpC,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,CAAC;iBACb;aACD;SACD,CAAC;IACH,CAAC;CAAA;
|
|
1
|
+
{"version":3,"file":"ExaApi.credentials.js","sourceRoot":"","sources":["../../credentials/ExaApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,SAAS,CAAC;QACxB,SAAI,GAAG,cAAuB,CAAC;QAC/B,qBAAgB,GAAG,+CAA+C,CAAC;QACnE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gEAAgE;aAC7E;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,oBAAoB;gBAC7B,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE;oBACL,KAAK,EAAE,6BAA6B;oBACpC,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,CAAC;iBACb;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAxCD,wBAwCC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="94" height="114" viewBox="0 0 94 114" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 112.14C0 112.691 0.446944 113.138 0.998277 113.138H92.1741C92.7255 113.138 93.1724 112.691 93.1724 112.14V107.396C93.1724 106.932 93.0115 106.483 92.7173 106.125L52.4924 57.203C52.1895 56.8346 52.1895 56.3034 52.4924 55.935L92.7173 7.0126C93.0115 6.6547 93.1724 6.20573 93.1724 5.74239V0.998283C93.1724 0.446953 92.7255 7.62939e-06 92.1741 7.62939e-06H0.998276C0.446943 7.62939e-06 0 0.446953 0 0.998283V112.14ZM47.1293 63.7789C46.8618 63.4535 46.363 63.4554 46.098 63.7828L13.756 103.735C13.4037 104.17 13.7134 104.819 14.2733 104.819H79.4644C80.0266 104.819 80.3356 104.165 79.9785 103.731L47.1293 63.7789ZM9.20606 96.1337C8.91009 96.4993 8.31897 96.29 8.31897 95.8196V61.394C8.31897 61.0264 8.61693 60.7285 8.98448 60.7285H36.4724C37.0322 60.7285 37.3419 61.3776 36.9897 61.8127L9.20606 96.1337ZM36.4724 52.4095C37.0322 52.4095 37.3419 51.7604 36.9897 51.3252L9.20606 17.0043C8.91009 16.6387 8.31897 16.848 8.31897 17.3183V51.744C8.31897 52.1115 8.61693 52.4095 8.98448 52.4095H36.4724ZM13.756 9.40324C13.4037 8.96811 13.7134 8.31898 14.2733 8.31898H79.4644C80.0266 8.31898 80.3356 8.97291 79.9785 9.40717L47.1293 49.3591C46.8618 49.6845 46.363 49.6826 46.098 49.3552L13.756 9.40324Z" fill="#1F40ED"/>
|
|
3
|
+
</svg>
|
|
@@ -12,11 +12,12 @@ class Exa extends n8n_workflow_1.VersionedNodeType {
|
|
|
12
12
|
icon: 'file:logo.svg',
|
|
13
13
|
group: ['transform'],
|
|
14
14
|
description: 'Search the web, read pages and run research agents with Exa',
|
|
15
|
-
defaultVersion: 2,
|
|
15
|
+
defaultVersion: 2.1,
|
|
16
16
|
};
|
|
17
17
|
const nodeVersions = {
|
|
18
18
|
1: new ExaV1_node_1.ExaV1(baseDescription),
|
|
19
19
|
2: new ExaV2_node_1.ExaV2(baseDescription),
|
|
20
|
+
2.1: new ExaV2_node_1.ExaV2(baseDescription),
|
|
20
21
|
};
|
|
21
22
|
super(nodeVersions, baseDescription);
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exa.node.js","sourceRoot":"","sources":["../../../nodes/Exa/Exa.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,gDAAwC;AACxC,gDAAwC;AAExC,MAAa,GAAI,SAAQ,gCAAiB;IACzC;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,KAAK;YAClB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,WAAW,EAAE,6DAA6D;YAC1E,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"Exa.node.js","sourceRoot":"","sources":["../../../nodes/Exa/Exa.node.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,gDAAwC;AACxC,gDAAwC;AAExC,MAAa,GAAI,SAAQ,gCAAiB;IACzC;QACC,MAAM,eAAe,GAA6B;YACjD,WAAW,EAAE,KAAK;YAClB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,WAAW,EAAE,6DAA6D;YAC1E,cAAc,EAAE,GAAG;SACnB,CAAC;QAEF,MAAM,YAAY,GAAuC;YACxD,CAAC,EAAE,IAAI,kBAAK,CAAC,eAAe,CAAC;YAC7B,CAAC,EAAE,IAAI,kBAAK,CAAC,eAAe,CAAC;YAC7B,GAAG,EAAE,IAAI,kBAAK,CAAC,eAAe,CAAC;SAC/B,CAAC;QAEF,KAAK,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC;CACD;AAnBD,kBAmBC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.description = void 0;
|
|
4
4
|
exports.execute = execute;
|
|
5
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const agentRun_1 = require("../../helpers/agentRun");
|
|
6
7
|
const interfaces_1 = require("../../helpers/interfaces");
|
|
7
8
|
const utils_1 = require("../../helpers/utils");
|
|
8
9
|
const transport_1 = require("../../transport");
|
|
@@ -85,9 +86,9 @@ const properties = [
|
|
|
85
86
|
name: 'timeout',
|
|
86
87
|
type: 'number',
|
|
87
88
|
default: 600,
|
|
88
|
-
typeOptions: { minValue: 10, maxValue:
|
|
89
|
+
typeOptions: { minValue: 10, maxValue: 10800 },
|
|
89
90
|
displayOptions: { show: { waitForCompletion: [true] } },
|
|
90
|
-
description: 'How long to wait before giving up on the
|
|
91
|
+
description: 'How long to wait before giving up. The run is not cancelled on timeout: the error names its ID so you can collect it with Get Run.',
|
|
91
92
|
},
|
|
92
93
|
{
|
|
93
94
|
displayName: 'Options',
|
|
@@ -126,12 +127,21 @@ const properties = [
|
|
|
126
127
|
type: 'options',
|
|
127
128
|
default: 'auto',
|
|
128
129
|
options: [
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
{ name: '
|
|
130
|
+
{
|
|
131
|
+
name: 'Auto',
|
|
132
|
+
value: 'auto',
|
|
133
|
+
description: 'Metered by usage, capped by Max Cost (default $5)',
|
|
134
|
+
},
|
|
135
|
+
{ name: 'Extra High', value: 'xhigh', description: 'Fixed price per run' },
|
|
136
|
+
{ name: 'High', value: 'high', description: 'Fixed price per run' },
|
|
137
|
+
{ name: 'Low', value: 'low', description: 'Fixed price per run' },
|
|
138
|
+
{ name: 'Medium', value: 'medium', description: 'Fixed price per run' },
|
|
139
|
+
{ name: 'Minimal', value: 'minimal', description: 'Fixed price per run' },
|
|
140
|
+
{
|
|
141
|
+
name: 'Ultra',
|
|
142
|
+
value: 'ultra',
|
|
143
|
+
description: 'Exhaustive research and large lists. Metered by usage, capped by Max Cost (default $20).',
|
|
144
|
+
},
|
|
135
145
|
],
|
|
136
146
|
description: 'How much work the agent should put into the run',
|
|
137
147
|
},
|
|
@@ -143,6 +153,22 @@ const properties = [
|
|
|
143
153
|
placeholder: 'e.g. [{"company":"Exa"}]',
|
|
144
154
|
description: 'Array of records for the agent to research or enrich',
|
|
145
155
|
},
|
|
156
|
+
{
|
|
157
|
+
displayName: 'Max Cost (Dollars)',
|
|
158
|
+
name: 'maxCostDollars',
|
|
159
|
+
type: 'number',
|
|
160
|
+
default: 5,
|
|
161
|
+
typeOptions: { minValue: 1, maxValue: 100, numberPrecision: 2 },
|
|
162
|
+
description: 'Spend ceiling for the run. For Auto and Ultra it caps the total cost (runs that finish early cost less); for the fixed-price efforts it caps contact enrichment and must cover the fixed price.',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Max Duration (Seconds)',
|
|
166
|
+
name: 'maxDurationSeconds',
|
|
167
|
+
type: 'number',
|
|
168
|
+
default: 3600,
|
|
169
|
+
typeOptions: { minValue: 300, maxValue: 10800 },
|
|
170
|
+
description: 'Soft wall-clock ceiling. Only for the Ultra effort; the run returns what it has when time runs out.',
|
|
171
|
+
},
|
|
146
172
|
{
|
|
147
173
|
displayName: 'Metadata (JSON)',
|
|
148
174
|
name: 'metadata',
|
|
@@ -164,7 +190,7 @@ const properties = [
|
|
|
164
190
|
];
|
|
165
191
|
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['agent'], operation: ['create'] } }, properties);
|
|
166
192
|
async function execute(i) {
|
|
167
|
-
var _a;
|
|
193
|
+
var _a, _b, _c;
|
|
168
194
|
const body = { query: this.getNodeParameter('query', i) };
|
|
169
195
|
const options = this.getNodeParameter('options', i, {});
|
|
170
196
|
const outputFormat = this.getNodeParameter('outputFormat', i);
|
|
@@ -173,8 +199,21 @@ async function execute(i) {
|
|
|
173
199
|
}
|
|
174
200
|
if (options.systemPrompt)
|
|
175
201
|
body.systemPrompt = options.systemPrompt;
|
|
176
|
-
|
|
177
|
-
|
|
202
|
+
body.effort = (_a = options.effort) !== null && _a !== void 0 ? _a : 'auto';
|
|
203
|
+
const budget = {};
|
|
204
|
+
if (options.maxCostDollars !== undefined)
|
|
205
|
+
budget.maxCostDollars = options.maxCostDollars;
|
|
206
|
+
if (options.maxDurationSeconds !== undefined) {
|
|
207
|
+
if (body.effort !== 'ultra') {
|
|
208
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Max Duration only applies to the Ultra effort', {
|
|
209
|
+
itemIndex: i,
|
|
210
|
+
description: 'Set Effort to Ultra, or remove Max Duration.',
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
budget.maxDurationSeconds = options.maxDurationSeconds;
|
|
214
|
+
}
|
|
215
|
+
if (Object.keys(budget).length)
|
|
216
|
+
body.budget = budget;
|
|
178
217
|
if (options.previousRunId)
|
|
179
218
|
body.previousRunId = options.previousRunId;
|
|
180
219
|
if (options.metadata) {
|
|
@@ -189,7 +228,7 @@ async function execute(i) {
|
|
|
189
228
|
}
|
|
190
229
|
body.input = { data };
|
|
191
230
|
}
|
|
192
|
-
const dataSources = (
|
|
231
|
+
const dataSources = (_b = options.dataSources) !== null && _b !== void 0 ? _b : [];
|
|
193
232
|
if (dataSources.length) {
|
|
194
233
|
body.dataSources = dataSources.map((provider) => ({ provider }));
|
|
195
234
|
}
|
|
@@ -200,42 +239,65 @@ async function execute(i) {
|
|
|
200
239
|
}
|
|
201
240
|
const timeoutMs = this.getNodeParameter('timeout', i) * 1000;
|
|
202
241
|
const waitMode = this.getNodeParameter('waitMode', i);
|
|
242
|
+
const startedAt = Date.now();
|
|
243
|
+
const deadline = startedAt + timeoutMs;
|
|
244
|
+
const fetchRun = async (runId, until) => (await transport_1.apiReadWithRetry.call(this, `/agent/runs/${runId}`, until));
|
|
245
|
+
const waitFor = async (runId, initial) => {
|
|
246
|
+
try {
|
|
247
|
+
return await (0, agentRun_1.pollRun)({
|
|
248
|
+
runId,
|
|
249
|
+
deadline,
|
|
250
|
+
startedAt,
|
|
251
|
+
intervalMs: waitMode === 'poll' ? this.getNodeParameter('pollInterval', i) * 1000 : 4000,
|
|
252
|
+
fetchRun,
|
|
253
|
+
sleep: n8n_workflow_1.sleep,
|
|
254
|
+
initial,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
throw runWaitError.call(this, error, runId, i);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
203
261
|
if (waitMode === 'stream') {
|
|
204
|
-
const events = await transport_1.streamEvents.call(this, '/agent/runs', {
|
|
262
|
+
const { events, outcome, error } = await transport_1.streamEvents.call(this, '/agent/runs', {
|
|
205
263
|
method: 'POST',
|
|
206
264
|
body,
|
|
207
265
|
timeoutMs,
|
|
208
266
|
shouldStop: (event) => { var _a; return interfaces_1.AGENT_TERMINAL_EVENTS.includes((_a = event.event) !== null && _a !== void 0 ? _a : ''); },
|
|
209
267
|
});
|
|
268
|
+
const includeEvents = this.getNodeParameter('includeEvents', i, false);
|
|
269
|
+
const withEvents = (run) => (includeEvents ? { ...run, events } : run);
|
|
210
270
|
const terminal = events.find((event) => { var _a; return interfaces_1.AGENT_TERMINAL_EVENTS.includes((_a = event.event) !== null && _a !== void 0 ? _a : ''); });
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
271
|
+
if (terminal) {
|
|
272
|
+
return [{ json: withEvents(terminal.data), pairedItem: { item: i } }];
|
|
273
|
+
}
|
|
274
|
+
const runId = (0, agentRun_1.runIdFromEvents)(events);
|
|
275
|
+
if (!runId) {
|
|
276
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: (_c = error === null || error === void 0 ? void 0 : error.message) !== null && _c !== void 0 ? _c : 'No events received' }, {
|
|
277
|
+
message: 'The Exa event stream ended before it announced a run ID',
|
|
278
|
+
description: 'The run may still have been created. Check Get Many Runs before creating another one.',
|
|
215
279
|
itemIndex: i,
|
|
216
280
|
});
|
|
217
281
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
];
|
|
282
|
+
if (outcome === 'timeout') {
|
|
283
|
+
throw runWaitError.call(this, new agentRun_1.AgentRunWaitTimeout(runId, timeoutMs / 1000), runId, i);
|
|
284
|
+
}
|
|
285
|
+
return [{ json: withEvents(await waitFor(runId)), pairedItem: { item: i } }];
|
|
223
286
|
}
|
|
224
287
|
const created = (await transport_1.apiRequest.call(this, 'POST', '/agent/runs', body));
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
itemIndex: i,
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
await (0, n8n_workflow_1.sleep)(pollIntervalMs);
|
|
237
|
-
run = (await transport_1.apiRequest.call(this, 'GET', `/agent/runs/${run.id}`));
|
|
288
|
+
return [{ json: await waitFor(created.id, created), pairedItem: { item: i } }];
|
|
289
|
+
}
|
|
290
|
+
function runWaitError(error, runId, itemIndex) {
|
|
291
|
+
if (error instanceof agentRun_1.AgentRunWaitTimeout) {
|
|
292
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), error.message, {
|
|
293
|
+
itemIndex,
|
|
294
|
+
description: 'Increase Timeout, or turn off Wait for Completion and follow the run with Get Run.',
|
|
295
|
+
});
|
|
238
296
|
}
|
|
239
|
-
|
|
297
|
+
const cause = error;
|
|
298
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), `Lost track of agent run ${runId} while waiting for it: ${cause.message}`, {
|
|
299
|
+
itemIndex,
|
|
300
|
+
description: `The run was created and may still be running. Collect it with Get Run and ID ${runId} instead of creating another run.`,
|
|
301
|
+
});
|
|
240
302
|
}
|
|
241
303
|
//# sourceMappingURL=create.operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Exa/v2/actions/agent/create.operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Exa/v2/actions/agent/create.operation.ts"],"names":[],"mappings":";;;AA6MA,0BAiIC;AA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AC,OAAO,EAAE,EACd,2BAA2B,KAAK,0BAA0B,KAAK,CAAC,OAAO,EAAE,EACzE;QACC,SAAS;QACT,WAAW,EAAE,gFAAgF,KAAK,mCAAmC;KACrI,CACD,CAAC;AACH,CAAC"}
|
|
@@ -52,16 +52,25 @@ const properties = [
|
|
|
52
52
|
];
|
|
53
53
|
exports.description = (0, n8n_workflow_1.updateDisplayOptions)({ show: { resource: ['agent'], operation: ['getEvents'] } }, properties);
|
|
54
54
|
async function execute(i) {
|
|
55
|
-
var _a;
|
|
55
|
+
var _a, _b, _c;
|
|
56
56
|
const runId = this.getNodeParameter('runId', i);
|
|
57
57
|
const stream = this.getNodeParameter('stream', i);
|
|
58
58
|
if (stream) {
|
|
59
59
|
const lastEventId = this.getNodeParameter('lastEventId', i, '');
|
|
60
|
-
const events = await transport_1.streamEvents.call(this, `/agent/runs/${runId}/events`, {
|
|
60
|
+
const { events, outcome } = await transport_1.streamEvents.call(this, `/agent/runs/${runId}/events`, {
|
|
61
61
|
timeoutMs: this.getNodeParameter('timeout', i) * 1000,
|
|
62
62
|
headers: lastEventId ? { 'Last-Event-ID': lastEventId } : {},
|
|
63
63
|
shouldStop: (event) => { var _a; return interfaces_1.AGENT_TERMINAL_EVENTS.includes((_a = event.event) !== null && _a !== void 0 ? _a : ''); },
|
|
64
64
|
});
|
|
65
|
+
if (outcome !== 'stopped') {
|
|
66
|
+
const last = (_b = (_a = events[events.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : lastEventId;
|
|
67
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The event stream for ${runId} ${outcome === 'timeout' ? 'timed out' : 'closed'} before the run finished, after ${events.length} events`, {
|
|
68
|
+
itemIndex: i,
|
|
69
|
+
description: last
|
|
70
|
+
? `Run this operation again with After Event ID set to ${last} to continue where it stopped.`
|
|
71
|
+
: 'Run this operation again to continue.',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
65
74
|
return events.map((event) => ({ json: event, pairedItem: { item: i } }));
|
|
66
75
|
}
|
|
67
76
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
@@ -73,7 +82,7 @@ async function execute(i) {
|
|
|
73
82
|
if (cursor)
|
|
74
83
|
qs.cursor = cursor;
|
|
75
84
|
const response = await transport_1.apiRequest.call(this, 'GET', `/agent/runs/${runId}/events`, {}, qs);
|
|
76
|
-
events.push(...((
|
|
85
|
+
events.push(...((_c = response.data) !== null && _c !== void 0 ? _c : []));
|
|
77
86
|
cursor = response.hasMore ? response.nextCursor : undefined;
|
|
78
87
|
} while (cursor && events.length < limit);
|
|
79
88
|
return events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEvents.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Exa/v2/actions/agent/getEvents.operation.ts"],"names":[],"mappings":";;;AA0DA,
|
|
1
|
+
{"version":3,"file":"getEvents.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Exa/v2/actions/agent/getEvents.operation.ts"],"names":[],"mappings":";;;AA0DA,0BAgDC;AAzGD,+CAAwE;AAExE,+DAAmD;AACnD,yDAAiE;AACjE,+CAA2D;AAE3D,MAAM,UAAU,GAAsB;IACrC,gCAAU;IACV;QACC,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EACV,gHAAgH;KACjH;IACD;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAC5C,WAAW,EAAE,mDAAmD;KAChE;IACD;QACC,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,aAAa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AAC,CAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAY,CAAC;IAEnF,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,MAA0B,CAAC;IAE/B,GAAG,CAAC;QACH,MAAM,EAAE,GAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,IAAI,MAAM;YAAE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;QAE/B,MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe,KAAK,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3F,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAC,QAAQ,CAAC,IAAsB,mCAAI,EAAE,CAAC,CAAC,CAAC;QACzD,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAE,QAAQ,CAAC,UAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,CAAC,QAAQ,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE;IAE1C,OAAO,MAAM;SACX,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;SACvC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -58,6 +58,13 @@ exports.contentsOptions = [
|
|
|
58
58
|
typeOptions: { minValue: -1, maxValue: 720 },
|
|
59
59
|
description: 'Freshness control. Use cached content up to this age, 0 to always crawl live, -1 for cache only.',
|
|
60
60
|
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Snapshot As Of',
|
|
63
|
+
name: 'snapshotAsOf',
|
|
64
|
+
type: 'dateTime',
|
|
65
|
+
default: '',
|
|
66
|
+
description: 'Return each page as Exa stored it at or before this date-time instead of the live page. Pages with no stored version by then are reported as failed. Cannot be combined with Max Age.',
|
|
67
|
+
},
|
|
61
68
|
{
|
|
62
69
|
displayName: 'Subpage Target',
|
|
63
70
|
name: 'subpageTarget',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.descriptions.js","sourceRoot":"","sources":["../../../../../nodes/Exa/v2/actions/common.descriptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,eAAe,GAAsB;IACjD;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EACV,4EAA4E;KAC7E;IACD;QACC,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7C,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAChD,WAAW,EAAE,+EAA+E;KAC5F;IACD;QACC,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAChD,WAAW,EAAE,oDAAoD;KACjE;IACD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,WAAW,EAAE,2CAA2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,EAAE,EAAE;QAC1C,WAAW,EAAE,yCAAyC;KACtD;CACD,CAAC;AAEW,QAAA,aAAa,GAAoB;IAC7C,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;IACb,WAAW,EACV,iGAAiG;CAClG,CAAC"}
|
|
1
|
+
{"version":3,"file":"common.descriptions.js","sourceRoot":"","sources":["../../../../../nodes/Exa/v2/actions/common.descriptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,eAAe,GAAsB;IACjD;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EACV,4EAA4E;KAC7E;IACD;QACC,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7C,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAChD,WAAW,EAAE,+EAA+E;KAC5F;IACD;QACC,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAChD,WAAW,EAAE,oDAAoD;KACjE;IACD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,WAAW,EAAE,2CAA2C;KACxD;IACD;QACC,WAAW,EAAE,OAAO;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3E;QACD,OAAO,EAAE,SAAS;QAClB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE;QAC1C,WAAW,EAAE,yCAAyC;KACtD;CACD,CAAC;AAEW,QAAA,aAAa,GAAoB;IAC7C,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,IAAI;IACb,WAAW,EACV,iGAAiG;CAClG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare const monitorIdField: INodeProperties;
|
|
3
|
+
export declare const scheduleOptions: INodePropertyOptions[];
|
|
4
|
+
export declare const customPeriodDescription = "Interval between runs, such as 2h, 3d or 2w. The minimum is 1h.";
|
|
5
|
+
export declare const monitorContentsOptions: INodeProperties[];
|
|
6
|
+
export declare const webhookEventsField: INodeProperties;
|
|
7
|
+
export declare const outputSchemaDefault = "{\n \"type\": \"object\",\n \"properties\": {\n \"events\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" },\n \"summary\": { \"type\": \"string\" }\n }\n }\n }\n },\n \"required\": [\"events\"]\n}";
|
|
8
|
+
export declare const paginationFields: INodeProperties[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginationFields = exports.outputSchemaDefault = exports.webhookEventsField = exports.monitorContentsOptions = exports.customPeriodDescription = exports.scheduleOptions = exports.monitorIdField = void 0;
|
|
4
|
+
const monitor_1 = require("../../helpers/monitor");
|
|
5
|
+
const common_descriptions_1 = require("../common.descriptions");
|
|
6
|
+
exports.monitorIdField = {
|
|
7
|
+
displayName: 'Monitor ID',
|
|
8
|
+
name: 'monitorId',
|
|
9
|
+
type: 'string',
|
|
10
|
+
default: '',
|
|
11
|
+
required: true,
|
|
12
|
+
description: 'ID of the monitor',
|
|
13
|
+
};
|
|
14
|
+
exports.scheduleOptions = [
|
|
15
|
+
{ name: 'Every Hour', value: '1h' },
|
|
16
|
+
{ name: 'Every 6 Hours', value: '6h' },
|
|
17
|
+
{ name: 'Every 12 Hours', value: '12h' },
|
|
18
|
+
{ name: 'Every Day', value: '1d' },
|
|
19
|
+
{ name: 'Every Week', value: '7d' },
|
|
20
|
+
{ name: 'Custom Interval', value: 'custom' },
|
|
21
|
+
{ name: 'Manual Only', value: 'none', description: 'Runs only when triggered' },
|
|
22
|
+
];
|
|
23
|
+
exports.customPeriodDescription = 'Interval between runs, such as 2h, 3d or 2w. The minimum is 1h.';
|
|
24
|
+
exports.monitorContentsOptions = common_descriptions_1.contentsOptions.filter((option) => option.name !== 'snapshotAsOf');
|
|
25
|
+
exports.webhookEventsField = {
|
|
26
|
+
displayName: 'Webhook Events',
|
|
27
|
+
name: 'webhookEvents',
|
|
28
|
+
type: 'multiOptions',
|
|
29
|
+
default: [],
|
|
30
|
+
options: monitor_1.MONITOR_WEBHOOK_EVENTS,
|
|
31
|
+
description: 'Events sent to the webhook. Leave empty for Exa’s default set.',
|
|
32
|
+
};
|
|
33
|
+
exports.outputSchemaDefault = '{\n "type": "object",\n "properties": {\n "events": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "title": { "type": "string" },\n "url": { "type": "string" },\n "summary": { "type": "string" }\n }\n }\n }\n },\n "required": ["events"]\n}';
|
|
34
|
+
exports.paginationFields = [
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Return All',
|
|
37
|
+
name: 'returnAll',
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
default: false,
|
|
40
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Limit',
|
|
44
|
+
name: 'limit',
|
|
45
|
+
type: 'number',
|
|
46
|
+
default: 50,
|
|
47
|
+
typeOptions: { minValue: 1 },
|
|
48
|
+
displayOptions: { show: { returnAll: [false] } },
|
|
49
|
+
description: 'Max number of results to return',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
//# sourceMappingURL=common.descriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.descriptions.js","sourceRoot":"","sources":["../../../../../../nodes/Exa/v2/actions/monitor/common.descriptions.ts"],"names":[],"mappings":";;;AAEA,mDAA+D;AAC/D,gEAAyD;AAE5C,QAAA,cAAc,GAAoB;IAC9C,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,mBAAmB;CAChC,CAAC;AAEW,QAAA,eAAe,GAA2B;IACtD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE;IACnC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE;IACtC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE;IACxC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE;IAClC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE;IACnC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC5C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;CAC/E,CAAC;AAEW,QAAA,uBAAuB,GACnC,iEAAiE,CAAC;AAGtD,QAAA,sBAAsB,GAAG,qCAAe,CAAC,MAAM,CAC3D,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAC1C,CAAC;AAEW,QAAA,kBAAkB,GAAoB;IAClD,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,gCAAsB;IAC/B,WAAW,EAAE,gEAAgE;CAC7E,CAAC;AAEW,QAAA,mBAAmB,GAC/B,qVAAqV,CAAC;AAE1U,QAAA,gBAAgB,GAAsB;IAClD;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,2DAA2D;KACxE;IACD;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;QAC5B,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;QAChD,WAAW,EAAE,iCAAiC;KAC9C;CACD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
builderHint?: import("n8n-workflow").IParameterBuilderHint;
|
|
12
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
13
|
+
envFeatureFlag?: Uppercase<string>;
|
|
14
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
isNodeSetting?: boolean;
|
|
17
|
+
noDataExpression?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
20
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
21
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
22
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
23
|
+
requiresDataPath?: "single" | "multiple";
|
|
24
|
+
doNotInherit?: boolean;
|
|
25
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
26
|
+
ignoreValidationDuringExecution?: boolean;
|
|
27
|
+
allowArbitraryValues?: boolean;
|
|
28
|
+
resolvableField?: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|