n8n-nodes-chatads 0.1.0 → 0.1.2
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
CHANGED
|
@@ -4,7 +4,7 @@ Custom n8n node + credential that call the FastAPI endpoint defined in `affiliat
|
|
|
4
4
|
|
|
5
5
|
### Layout
|
|
6
6
|
|
|
7
|
-
- `credentials/ChatAdsApi.credentials.ts` – stores the base URL
|
|
7
|
+
- `credentials/ChatAdsApi.credentials.ts` – stores the base URL and API key reused by every node call.
|
|
8
8
|
- `nodes/ChatAds/ChatAds.node.ts` – single `Analyze Prospect` operation that posts to `/v1/chatads/messages`.
|
|
9
9
|
- `nodes/ChatAds/chatads.svg` – lightweight icon so the node is recognizable inside the n8n editor.
|
|
10
10
|
- `package.json`, `tsconfig.json`, `.gitignore` – helper files so you can compile to `dist/` with `tsc` (the artifacts n8n loads).
|
|
@@ -19,7 +19,7 @@ Custom n8n node + credential that call the FastAPI endpoint defined in `affiliat
|
|
|
19
19
|
```
|
|
20
20
|
This produces `dist/credentials/ChatAdsApi.credentials.js` and `dist/nodes/ChatAds/ChatAds.node.js`.
|
|
21
21
|
2. Copy the compiled `dist` directory into your n8n custom nodes directory (for example `~/.n8n/custom/`) or publish the package to your internal npm registry and install it where your n8n instance can resolve it.
|
|
22
|
-
3. Restart n8n. The new **ChatAds** node will appear under the “Transform” group. Add it to a workflow, select the `ChatAds API` credential
|
|
22
|
+
3. Restart n8n. The new **ChatAds** node will appear under the “Transform” group. Add it to a workflow, select the `ChatAds API` credential, and supply either:
|
|
23
23
|
- A simple `message` plus optional fields (IP, domain, etc.), or
|
|
24
24
|
- A raw JSON payload that matches the server-side `FunctionItem` contract (only documented fields are accepted; unexpected keys are rejected to prevent tampering).
|
|
25
25
|
4. Optionally tune `Max Concurrent Requests` (default 4) and `Request Timeout (seconds)` for high-volume workflows. The node keeps item ordering consistent even when issuing requests in parallel.
|
|
@@ -23,14 +23,7 @@ class ChatAdsApi {
|
|
|
23
23
|
default: '',
|
|
24
24
|
required: true,
|
|
25
25
|
description: 'Value to send in the x-api-key header when calling ChatAds',
|
|
26
|
-
}
|
|
27
|
-
{
|
|
28
|
-
displayName: 'Health Check Path',
|
|
29
|
-
name: 'healthCheckPath',
|
|
30
|
-
type: 'string',
|
|
31
|
-
default: '/health',
|
|
32
|
-
description: 'Relative path to a lightweight GET endpoint for credential testing (set to an endpoint that validates the API key without running the full scoring pipeline)',
|
|
33
|
-
},
|
|
26
|
+
}
|
|
34
27
|
];
|
|
35
28
|
this.authenticate = {
|
|
36
29
|
type: 'generic',
|
|
@@ -43,7 +36,7 @@ class ChatAdsApi {
|
|
|
43
36
|
this.test = {
|
|
44
37
|
request: {
|
|
45
38
|
method: 'GET',
|
|
46
|
-
url: '={{($credentials.baseUrl || "").replace(/\/+$/, "")
|
|
39
|
+
url: '={{($credentials.baseUrl || "").replace(/\/+$/, "") || "https://app.getchatads.com"}}',
|
|
47
40
|
qs: {
|
|
48
41
|
source: 'n8n-credential-test',
|
|
49
42
|
},
|