@quercle/n8n-nodes-quercle 0.1.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/LICENSE +21 -0
- package/README.md +188 -0
- package/dist/credentials/QuercleApi.credentials.d.ts +9 -0
- package/dist/credentials/QuercleApi.credentials.js +40 -0
- package/dist/credentials/QuercleApi.credentials.js.map +1 -0
- package/dist/nodes/Quercle/Quercle.node.d.ts +5 -0
- package/dist/nodes/Quercle/Quercle.node.js +221 -0
- package/dist/nodes/Quercle/Quercle.node.js.map +1 -0
- package/dist/nodes/Quercle/Quercle.node.json +18 -0
- package/dist/nodes/Quercle/quercle.svg +4 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Quercle
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# @quercle/n8n-nodes-quercle
|
|
2
|
+
|
|
3
|
+
AI-powered web search and fetch nodes for [n8n](https://n8n.io).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Search**: Perform AI-powered web searches with optional domain filtering
|
|
8
|
+
- **Fetch**: Fetch and process web content with custom AI instructions
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### Community Nodes (Recommended)
|
|
13
|
+
|
|
14
|
+
1. Go to **Settings > Community Nodes**
|
|
15
|
+
2. Select **Install**
|
|
16
|
+
3. Enter `@quercle/n8n-nodes-quercle`
|
|
17
|
+
4. Agree to the risks and select **Install**
|
|
18
|
+
|
|
19
|
+
### Manual Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cd ~/.n8n/nodes
|
|
23
|
+
npm install @quercle/n8n-nodes-quercle
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then restart n8n.
|
|
27
|
+
|
|
28
|
+
## Authentication
|
|
29
|
+
|
|
30
|
+
You can provide your API key in two ways:
|
|
31
|
+
|
|
32
|
+
### Option 1: Environment Variable (Recommended for self-hosted)
|
|
33
|
+
|
|
34
|
+
Set the `QUERCLE_API_KEY` environment variable:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export QUERCLE_API_KEY=qk_your_api_key_here
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Option 2: n8n Credentials
|
|
41
|
+
|
|
42
|
+
1. Get your API key from [Quercle Dashboard](https://quercle.dev)
|
|
43
|
+
2. In n8n, go to **Credentials** and create new credentials
|
|
44
|
+
3. Search for **Quercle API**
|
|
45
|
+
4. Enter your API key (starts with `qk_`)
|
|
46
|
+
|
|
47
|
+
**Note:** If both are configured, the n8n credential takes precedence.
|
|
48
|
+
|
|
49
|
+
## Operations
|
|
50
|
+
|
|
51
|
+
### Search
|
|
52
|
+
|
|
53
|
+
Perform AI-powered web search that returns synthesized answers with source citations.
|
|
54
|
+
|
|
55
|
+
| Parameter | Type | Required | Description |
|
|
56
|
+
|-----------|------|----------|-------------|
|
|
57
|
+
| Query | string | Yes | The search query |
|
|
58
|
+
| Domain Filter | options | No | Filter by allowed or blocked domains |
|
|
59
|
+
| Domains | string | No | Comma-separated list of domains (when filter is set) |
|
|
60
|
+
|
|
61
|
+
**Example Use Cases:**
|
|
62
|
+
- Research competitors and market trends
|
|
63
|
+
- Find documentation and technical answers
|
|
64
|
+
- Gather news and updates on specific topics
|
|
65
|
+
|
|
66
|
+
### Fetch
|
|
67
|
+
|
|
68
|
+
Fetch content from a URL and process it with custom AI instructions.
|
|
69
|
+
|
|
70
|
+
| Parameter | Type | Required | Description |
|
|
71
|
+
|-----------|------|----------|-------------|
|
|
72
|
+
| URL | string | Yes | The URL to fetch |
|
|
73
|
+
| Prompt | string | Yes | Instructions for processing the content |
|
|
74
|
+
|
|
75
|
+
**Example Use Cases:**
|
|
76
|
+
- Extract structured data from web pages
|
|
77
|
+
- Summarize articles and documentation
|
|
78
|
+
- Monitor pricing or product information
|
|
79
|
+
|
|
80
|
+
## Workflow Examples
|
|
81
|
+
|
|
82
|
+
### Example 1: Research Pipeline
|
|
83
|
+
|
|
84
|
+
Create a workflow that researches a topic and sends a summary:
|
|
85
|
+
|
|
86
|
+
1. **Manual Trigger** - Start the workflow
|
|
87
|
+
2. **Quercle (Search)** - Search for "latest AI developments 2025"
|
|
88
|
+
3. **Send Email** - Send the search results
|
|
89
|
+
|
|
90
|
+
### Example 2: Content Monitoring
|
|
91
|
+
|
|
92
|
+
Monitor a webpage for changes and extract key information:
|
|
93
|
+
|
|
94
|
+
1. **Schedule Trigger** - Run every hour
|
|
95
|
+
2. **Quercle (Fetch)** - Fetch URL with prompt "Extract the main headline and any price changes"
|
|
96
|
+
3. **IF** - Check if content changed
|
|
97
|
+
4. **Slack** - Send notification
|
|
98
|
+
|
|
99
|
+
### Example 3: Multi-Source Research
|
|
100
|
+
|
|
101
|
+
Research from multiple sources with domain filtering:
|
|
102
|
+
|
|
103
|
+
1. **Manual Trigger**
|
|
104
|
+
2. **Quercle (Search)** - Query with allowed domains: `github.com, stackoverflow.com`
|
|
105
|
+
3. **Quercle (Search)** - Query with allowed domains: `docs.python.org, pypi.org`
|
|
106
|
+
4. **Merge** - Combine results
|
|
107
|
+
5. **OpenAI** - Synthesize findings
|
|
108
|
+
|
|
109
|
+
### Example 4: Web Scraping Pipeline
|
|
110
|
+
|
|
111
|
+
Extract and process data from multiple pages:
|
|
112
|
+
|
|
113
|
+
1. **Spreadsheet** - List of URLs to process
|
|
114
|
+
2. **Loop Over Items**
|
|
115
|
+
3. **Quercle (Fetch)** - Process each URL with extraction prompt
|
|
116
|
+
4. **Google Sheets** - Save extracted data
|
|
117
|
+
|
|
118
|
+
## Node Configuration
|
|
119
|
+
|
|
120
|
+
### Search Node
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Operation: Search
|
|
124
|
+
Query: {{ $json.searchTerm }}
|
|
125
|
+
Domain Filter: Allowed Domains
|
|
126
|
+
Domains: example.com, docs.example.com
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Fetch Node
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Operation: Fetch
|
|
133
|
+
URL: {{ $json.url }}
|
|
134
|
+
Prompt: Extract the product name, price, and availability status. Return as JSON.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Working with Expressions
|
|
138
|
+
|
|
139
|
+
Use n8n expressions to make your queries dynamic:
|
|
140
|
+
|
|
141
|
+
**Dynamic Search Query:**
|
|
142
|
+
```
|
|
143
|
+
Query: latest news about {{ $json.company }} {{ $json.topic }}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Dynamic URL:**
|
|
147
|
+
```
|
|
148
|
+
URL: https://example.com/products/{{ $json.productId }}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Dynamic Prompt:**
|
|
152
|
+
```
|
|
153
|
+
Prompt: Extract {{ $json.fields.join(', ') }} from this page
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Error Handling
|
|
157
|
+
|
|
158
|
+
The node supports n8n's "Continue on Fail" option. When enabled:
|
|
159
|
+
- Failed items return `{ "error": "error message" }` instead of stopping the workflow
|
|
160
|
+
- Other items continue processing normally
|
|
161
|
+
|
|
162
|
+
Common errors:
|
|
163
|
+
- **401**: Invalid API key - check your credentials
|
|
164
|
+
- **402**: Insufficient credits - add credits at quercle.dev
|
|
165
|
+
- **403**: Inactive account - contact support
|
|
166
|
+
- **504**: Request timeout - the page may be slow to respond
|
|
167
|
+
|
|
168
|
+
## Best Practices
|
|
169
|
+
|
|
170
|
+
1. **Use Domain Filters** - When searching for specific sources, use allowed domains to get more relevant results
|
|
171
|
+
2. **Be Specific in Prompts** - Clear instructions in fetch prompts produce better results
|
|
172
|
+
3. **Handle Errors** - Enable "Continue on Fail" for batch processing
|
|
173
|
+
4. **Cache Results** - For repeated queries, consider caching with n8n's built-in caching
|
|
174
|
+
|
|
175
|
+
## Requirements
|
|
176
|
+
|
|
177
|
+
- n8n >= 1.0.0
|
|
178
|
+
- Quercle API key ([get one here](https://quercle.dev))
|
|
179
|
+
|
|
180
|
+
## Resources
|
|
181
|
+
|
|
182
|
+
- [Quercle Documentation](https://quercle.dev/docs)
|
|
183
|
+
- [n8n Community Nodes](https://docs.n8n.io/integrations/community-nodes/)
|
|
184
|
+
- [n8n Expressions](https://docs.n8n.io/code/expressions/)
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from "n8n-workflow";
|
|
2
|
+
export declare class QuercleApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuercleApi = void 0;
|
|
4
|
+
const BASE_URL = "https://api.quercle.dev";
|
|
5
|
+
class QuercleApi {
|
|
6
|
+
name = "quercleApi";
|
|
7
|
+
displayName = "Quercle API";
|
|
8
|
+
documentationUrl = "https://quercle.dev/docs";
|
|
9
|
+
properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: "API Key",
|
|
12
|
+
name: "apiKey",
|
|
13
|
+
type: "string",
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: "",
|
|
16
|
+
required: true,
|
|
17
|
+
description: "Your Quercle API key (starts with qk_). Can also be set via QUERCLE_API_KEY environment variable.",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
authenticate = {
|
|
21
|
+
type: "generic",
|
|
22
|
+
properties: {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: "=Bearer {{$credentials.apiKey}}",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
test = {
|
|
29
|
+
request: {
|
|
30
|
+
baseURL: BASE_URL,
|
|
31
|
+
url: "/v1/search",
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: {
|
|
34
|
+
query: "test",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.QuercleApi = QuercleApi;
|
|
40
|
+
//# sourceMappingURL=QuercleApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuercleApi.credentials.js","sourceRoot":"","sources":["../../credentials/QuercleApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAM,QAAQ,GAAG,yBAAyB,CAAC;AAE3C,MAAa,UAAU;IACtB,IAAI,GAAG,YAAY,CAAC;IACpB,WAAW,GAAG,aAAa,CAAC;IAC5B,gBAAgB,GAAG,0BAA0B,CAAC;IAC9C,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EACV,mGAAmG;SACpG;KACD,CAAC;IAEF,YAAY,GAAyB;QACpC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACX,OAAO,EAAE;gBACR,aAAa,EAAE,iCAAiC;aAChD;SACD;KACD,CAAC;IAEF,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,OAAO,EAAE,QAAQ;YACjB,GAAG,EAAE,YAAY;YACjB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACL,KAAK,EAAE,MAAM;aACb;SACD;KACD,CAAC;CACF;AApCD,gCAoCC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Quercle = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const BASE_URL = "https://api.quercle.dev";
|
|
6
|
+
const TOOL_DESCRIPTIONS = {
|
|
7
|
+
SEARCH: "Search the web and get an AI-synthesized answer with citations. The response includes the answer and source URLs that can be fetched for further investigation. Optionally filter by allowed or blocked domains.",
|
|
8
|
+
FETCH: "Fetch a web page and analyze its content using AI. Provide a URL and a prompt describing what information you want to extract or how to analyze the content. The raw HTML is NOT returned - only the AI's analysis based on your prompt.",
|
|
9
|
+
};
|
|
10
|
+
const FIELD_DESCRIPTIONS = {
|
|
11
|
+
SEARCH_QUERY: "The search query to find information about. Be specific",
|
|
12
|
+
FETCH_URL: "The URL to fetch and analyze",
|
|
13
|
+
FETCH_PROMPT: "Instructions for how to analyze the page content. Be specific about what information you want to extract",
|
|
14
|
+
ALLOWED_DOMAINS: "Only include results from these domains (e.g., 'example.com, *.example.org')",
|
|
15
|
+
};
|
|
16
|
+
class Quercle {
|
|
17
|
+
description = {
|
|
18
|
+
displayName: "Quercle",
|
|
19
|
+
name: "quercle",
|
|
20
|
+
icon: "file:quercle.svg",
|
|
21
|
+
group: ["transform"],
|
|
22
|
+
version: 1,
|
|
23
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
24
|
+
description: "AI-powered web search and fetch",
|
|
25
|
+
defaults: {
|
|
26
|
+
name: "Quercle",
|
|
27
|
+
},
|
|
28
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
29
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
30
|
+
credentials: [
|
|
31
|
+
{
|
|
32
|
+
name: "quercleApi",
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
properties: [
|
|
37
|
+
{
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: true,
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: "Search",
|
|
45
|
+
value: "search",
|
|
46
|
+
description: TOOL_DESCRIPTIONS.SEARCH,
|
|
47
|
+
action: "Perform AI powered web search",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Fetch",
|
|
51
|
+
value: "fetch",
|
|
52
|
+
description: TOOL_DESCRIPTIONS.FETCH,
|
|
53
|
+
action: "Fetch and process content from a URL",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
default: "search",
|
|
57
|
+
},
|
|
58
|
+
// Search operation fields
|
|
59
|
+
{
|
|
60
|
+
displayName: "Query",
|
|
61
|
+
name: "query",
|
|
62
|
+
type: "string",
|
|
63
|
+
required: true,
|
|
64
|
+
displayOptions: {
|
|
65
|
+
show: {
|
|
66
|
+
operation: ["search"],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
default: "",
|
|
70
|
+
description: FIELD_DESCRIPTIONS.SEARCH_QUERY,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: "Domain Filter",
|
|
74
|
+
name: "domainFilter",
|
|
75
|
+
type: "options",
|
|
76
|
+
displayOptions: {
|
|
77
|
+
show: {
|
|
78
|
+
operation: ["search"],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
options: [
|
|
82
|
+
{ name: "None", value: "none" },
|
|
83
|
+
{ name: "Allowed Domains", value: "allowed" },
|
|
84
|
+
{ name: "Blocked Domains", value: "blocked" },
|
|
85
|
+
],
|
|
86
|
+
default: "none",
|
|
87
|
+
description: "Filter search results by domain",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: "Domains",
|
|
91
|
+
name: "domains",
|
|
92
|
+
type: "string",
|
|
93
|
+
displayOptions: {
|
|
94
|
+
show: {
|
|
95
|
+
operation: ["search"],
|
|
96
|
+
domainFilter: ["allowed", "blocked"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
default: "",
|
|
100
|
+
description: FIELD_DESCRIPTIONS.ALLOWED_DOMAINS,
|
|
101
|
+
placeholder: "example.com, another.com",
|
|
102
|
+
},
|
|
103
|
+
// Fetch operation fields
|
|
104
|
+
{
|
|
105
|
+
displayName: "URL",
|
|
106
|
+
name: "url",
|
|
107
|
+
type: "string",
|
|
108
|
+
required: true,
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: {
|
|
111
|
+
operation: ["fetch"],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
default: "",
|
|
115
|
+
description: FIELD_DESCRIPTIONS.FETCH_URL,
|
|
116
|
+
placeholder: "https://example.com/page",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
displayName: "Prompt",
|
|
120
|
+
name: "prompt",
|
|
121
|
+
type: "string",
|
|
122
|
+
required: true,
|
|
123
|
+
displayOptions: {
|
|
124
|
+
show: {
|
|
125
|
+
operation: ["fetch"],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
default: "",
|
|
129
|
+
description: FIELD_DESCRIPTIONS.FETCH_PROMPT,
|
|
130
|
+
typeOptions: {
|
|
131
|
+
rows: 4,
|
|
132
|
+
},
|
|
133
|
+
placeholder: "Extract the main article content and summarize it",
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
};
|
|
137
|
+
async execute() {
|
|
138
|
+
const items = this.getInputData();
|
|
139
|
+
const returnData = [];
|
|
140
|
+
// Get API key from credentials or environment variable
|
|
141
|
+
let apiKey;
|
|
142
|
+
try {
|
|
143
|
+
const credentials = await this.getCredentials("quercleApi");
|
|
144
|
+
apiKey = credentials?.apiKey;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// Credentials not configured, try environment variable
|
|
148
|
+
}
|
|
149
|
+
if (!apiKey) {
|
|
150
|
+
apiKey = process.env.QUERCLE_API_KEY;
|
|
151
|
+
}
|
|
152
|
+
if (!apiKey) {
|
|
153
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "No API key provided. Set QUERCLE_API_KEY environment variable or configure Quercle API credentials.");
|
|
154
|
+
}
|
|
155
|
+
for (let i = 0; i < items.length; i++) {
|
|
156
|
+
try {
|
|
157
|
+
const operation = this.getNodeParameter("operation", i);
|
|
158
|
+
let response;
|
|
159
|
+
const headers = {
|
|
160
|
+
Authorization: `Bearer ${apiKey}`,
|
|
161
|
+
"Content-Type": "application/json",
|
|
162
|
+
};
|
|
163
|
+
if (operation === "search") {
|
|
164
|
+
const query = this.getNodeParameter("query", i);
|
|
165
|
+
const domainFilter = this.getNodeParameter("domainFilter", i);
|
|
166
|
+
const body = { query };
|
|
167
|
+
if (domainFilter !== "none") {
|
|
168
|
+
const domains = this.getNodeParameter("domains", i)
|
|
169
|
+
.split(",")
|
|
170
|
+
.map((d) => d.trim())
|
|
171
|
+
.filter((d) => d);
|
|
172
|
+
if (domainFilter === "allowed") {
|
|
173
|
+
body.allowed_domains = domains;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
body.blocked_domains = domains;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
response = await this.helpers.httpRequest({
|
|
180
|
+
method: "POST",
|
|
181
|
+
url: `${BASE_URL}/v1/search`,
|
|
182
|
+
headers,
|
|
183
|
+
body,
|
|
184
|
+
json: true,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
else if (operation === "fetch") {
|
|
188
|
+
const url = this.getNodeParameter("url", i);
|
|
189
|
+
const prompt = this.getNodeParameter("prompt", i);
|
|
190
|
+
response = await this.helpers.httpRequest({
|
|
191
|
+
method: "POST",
|
|
192
|
+
url: `${BASE_URL}/v1/fetch`,
|
|
193
|
+
headers,
|
|
194
|
+
body: { url, prompt },
|
|
195
|
+
json: true,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
|
|
200
|
+
}
|
|
201
|
+
returnData.push({
|
|
202
|
+
json: { result: response.result },
|
|
203
|
+
pairedItem: { item: i },
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
if (this.continueOnFail()) {
|
|
208
|
+
returnData.push({
|
|
209
|
+
json: { error: error.message },
|
|
210
|
+
pairedItem: { item: i },
|
|
211
|
+
});
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return [returnData];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
exports.Quercle = Quercle;
|
|
221
|
+
//# sourceMappingURL=Quercle.node.js.map
|
|
@@ -0,0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credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://quercle.dev/docs/api-keys"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://quercle.dev/docs"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
|
2
|
+
<circle cx="32" cy="32" r="28" fill="#6366f1"/>
|
|
3
|
+
<path d="M32 16c-8.837 0-16 7.163-16 16s7.163 16 16 16c3.314 0 6.394-1.01 8.95-2.74l5.79 5.79a2 2 0 0 0 2.83-2.83l-5.79-5.79A15.92 15.92 0 0 0 48 32c0-8.837-7.163-16-16-16zm0 28c-6.627 0-12-5.373-12-12s5.373-12 12-12 12 5.373 12 12-5.373 12-12 12z" fill="white"/>
|
|
4
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quercle/n8n-nodes-quercle",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n nodes for Quercle AI-powered web search and fetch API",
|
|
5
|
+
"keywords": ["n8n-community-node-package", "n8n", "quercle", "web-search", "ai", "web-fetch"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/quercledev/n8n-nodes-quercle",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Quercle",
|
|
10
|
+
"email": "support@quercle.dev"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/quercledev/n8n-nodes-quercle.git"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc && bun run copy-assets",
|
|
18
|
+
"copy-assets": "cp nodes/Quercle/quercle.svg dist/nodes/Quercle/ && cp nodes/Quercle/Quercle.node.json dist/nodes/Quercle/",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"test": "bun test",
|
|
22
|
+
"lint": "biome check .",
|
|
23
|
+
"lint:fix": "biome check --write .",
|
|
24
|
+
"format": "biome format --write .",
|
|
25
|
+
"knip": "knip",
|
|
26
|
+
"prepublishOnly": "bun run build"
|
|
27
|
+
},
|
|
28
|
+
"files": ["dist"],
|
|
29
|
+
"n8n": {
|
|
30
|
+
"n8nNodesApiVersion": 1,
|
|
31
|
+
"strict": true,
|
|
32
|
+
"credentials": ["dist/credentials/QuercleApi.credentials.js"],
|
|
33
|
+
"nodes": ["dist/nodes/Quercle/Quercle.node.js"]
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@biomejs/biome": "^1.9.4",
|
|
37
|
+
"@types/bun": "^1.3.8",
|
|
38
|
+
"@types/node": "^22.19.7",
|
|
39
|
+
"knip": "^5.82.1",
|
|
40
|
+
"n8n-workflow": "^2.6.0",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"n8n-workflow": "*"
|
|
45
|
+
}
|
|
46
|
+
}
|