n8n-nodes-cleanedweb 0.0.0-stage → 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 +158 -2
- package/dist/credentials/CleanedWebApi.credentials.d.ts +13 -0
- package/dist/credentials/CleanedWebApi.credentials.js +51 -0
- package/dist/credentials/CleanedWebApi.credentials.js.map +1 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.d.ts +11 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.js +175 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.js.map +1 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.json +19 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.d.ts +121 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.js +511 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.js.map +1 -0
- package/dist/nodes/CleanedWeb/Operations.d.ts +9 -0
- package/dist/nodes/CleanedWeb/Operations.js +140 -0
- package/dist/nodes/CleanedWeb/Operations.js.map +1 -0
- package/dist/nodes/CleanedWeb/cleanedweb.dark.svg +11 -0
- package/dist/nodes/CleanedWeb/cleanedweb.svg +11 -0
- package/dist/nodes/CleanedWeb/constants.d.ts +14 -0
- package/dist/nodes/CleanedWeb/constants.js +18 -0
- package/dist/nodes/CleanedWeb/constants.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.d.ts +4 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.js +129 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.d.ts +3 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.js +44 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.d.ts +4 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.js +258 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.js.map +1 -0
- package/dist/package.json +66 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +65 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CleanedWeb
|
|
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
CHANGED
|
@@ -1,3 +1,159 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n8n-nodes-cleanedweb
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is an n8n community node for [CleanedWeb](https://cleanedweb.com/?utm_source=github&utm_medium=n8n-nodes-cleanedweb). It lets you run CleanedWeb's maintained REST APIs from n8n workflows and AI agents.
|
|
4
|
+
|
|
5
|
+
CleanedWeb turns public website collections into maintained REST APIs that return structured records. 5,000 records are free once, then credit is prepaid from $1 per 1,000 records. A run is charged per record delivered.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
> Status: pre-release, not yet published to npm or submitted to the n8n Creator Portal.
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Operations](#operations)
|
|
13
|
+
- [Credentials](#credentials)
|
|
14
|
+
- [Using the node](#using-the-node)
|
|
15
|
+
- [Compatibility](#compatibility)
|
|
16
|
+
- [Example workflows](#example-workflows)
|
|
17
|
+
- [Development](#development)
|
|
18
|
+
- [Resources](#resources)
|
|
19
|
+
- [Version history](#version-history)
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Follow the [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) and install `n8n-nodes-cleanedweb`.
|
|
24
|
+
|
|
25
|
+
Until the package is on npm, build it and install the tarball into your n8n's `~/.n8n/nodes` folder:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm ci && npm run build && npm pack
|
|
29
|
+
cd ~/.n8n/nodes && npm install /path/to/n8n-nodes-cleanedweb-0.1.0.tgz
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then restart n8n.
|
|
33
|
+
|
|
34
|
+
## Operations
|
|
35
|
+
|
|
36
|
+
| Resource | Operation | What it does | API key |
|
|
37
|
+
| --- | --- | --- | --- |
|
|
38
|
+
| Catalog | List APIs | Lists the published catalog APIs from the live catalog (`app.cleanedweb.com/api/catalog/apis`), with text search, category and sort. One item per API. | not needed |
|
|
39
|
+
| Catalog | Get API Contract | Reads the live contract of an endpoint: input schema, output schema, definition version. Optionally for a pinned major version. | not needed |
|
|
40
|
+
| Run | Run Catalog Endpoint | Runs a catalog API endpoint and returns its records, one n8n item per record. | `run` scope |
|
|
41
|
+
| Run | Get | Reads a run: status, stop reason, progress, units charged. | `run` or `results` scope |
|
|
42
|
+
| Run | Get Items | Reads the records a run has committed so far (also while it is running), following the cursor. | `run` or `results` scope |
|
|
43
|
+
| Run | Abort | Stops a run. Records committed so far stay readable and charged. | `run` scope |
|
|
44
|
+
| Private API | Run Source | Runs one of your own private APIs (`POST /v1/sources/{source_id}/run`) and returns its records. | `run` scope with access to the source |
|
|
45
|
+
|
|
46
|
+
The node is usable as a tool by n8n AI agents (`usableAsTool`).
|
|
47
|
+
|
|
48
|
+
## Credentials
|
|
49
|
+
|
|
50
|
+
1. Create a CleanedWeb account and an API key with the `run` scope ([authentication](https://cleanedweb.com/docs/authentication/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)). Add `results` only if you also read retained results.
|
|
51
|
+
2. In n8n, create a **CleanedWeb API** credential and paste the key.
|
|
52
|
+
3. Leave **Run Origin** at `https://api.cleanedweb.com` unless your workspace supplies another origin. The key is sent only to this origin, over https, and the node does not follow redirects.
|
|
53
|
+
|
|
54
|
+
The credential test calls `GET /v1/runs?limit=1`, a read-only request that starts nothing and uses no credit.
|
|
55
|
+
|
|
56
|
+
The Catalog operations need no credential; n8n does not ask for one when only they are used.
|
|
57
|
+
|
|
58
|
+
## Using the node
|
|
59
|
+
|
|
60
|
+
### Run a catalog API
|
|
61
|
+
|
|
62
|
+
1. Choose **Run > Run Catalog Endpoint**, then the **API** and **Endpoint** from the live catalog. (Or use an expression with an API ID and endpoint ID.)
|
|
63
|
+
2. Read the endpoint's contract (**Catalog > Get API Contract**, or its page in the [catalog](https://cleanedweb.com/catalog/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)) and set **Input** to a JSON object of the inputs it names. Every input in `input_schema.required` must be sent; `{}` is valid when none is required. Unknown inputs are rejected.
|
|
64
|
+
3. Set **Max Items**. The default is 25, so a first run stays small. **Run Without Max Items** lets the run end when the source has no more records, or by time or money.
|
|
65
|
+
4. Each output item is one record.
|
|
66
|
+
|
|
67
|
+
### Idempotency Key
|
|
68
|
+
|
|
69
|
+
CleanedWeb requires an `Idempotency-Key` on every run. The same key with the same request returns the original run instead of starting another, so an n8n retry or a lost response does not charge twice. A new key starts a new run.
|
|
70
|
+
|
|
71
|
+
The default is `{{ $execution.id }}-{{ $runIndex }}-{{ $itemIndex }}`:
|
|
72
|
+
|
|
73
|
+
- It is stable across n8n's *Retry On Fail* of the same node, so a retry recovers the same run.
|
|
74
|
+
- Every execution has its own id, so every scheduled run and every click on *Test workflow* is a new run, and a new charge.
|
|
75
|
+
- Two CleanedWeb run nodes in the same workflow share it; give one of them a different key (for example add a suffix) or the second answers `409 delivery_identity_conflict`.
|
|
76
|
+
- A key must be 1-200 characters: letters, numbers, `.`, `_`, `:`, `-`.
|
|
77
|
+
- A run that failed is final for its key: the same key returns the same error for 7 days. Use a new key to run again.
|
|
78
|
+
|
|
79
|
+
### Waiting for the result
|
|
80
|
+
|
|
81
|
+
With **Wait for Result** on (the default), the node sends the run request, and when the server answers `202` it reads `.../result` with the same API key and Idempotency Key, waiting `Retry-After` seconds (or `poll_after_seconds`, or **Poll Interval Fallback**) between reads, until the run ends. The POST is never sent again with a new key.
|
|
82
|
+
|
|
83
|
+
- If a request fails with a timeout, a lost connection, or a gateway error that does not show whether the run started, the node repeats the same request with the same key (up to 3 times), because a repeat returns the original run.
|
|
84
|
+
- If the run is still going after **Max Wait (Seconds)** (default 900), the node fails with the run ID. The run continues on the server and is charged per record delivered. Read it with **Run > Get** or **Get Items**, or stop it with **Abort**.
|
|
85
|
+
- With **Wait for Result** off, the node returns the run object right away (`run_id`, `status`, `links`). Pair it with a *Wait* node and **Get Items**; see the example.
|
|
86
|
+
|
|
87
|
+
### Accepting a result
|
|
88
|
+
|
|
89
|
+
HTTP 200 alone does not show a usable result. By default (**Fail on Unaccepted Result**) the node fails when `summary.status` is not `completed` or `bounded`, or `summary.within_scope_passed` is not `true`. The records the run saved stay readable and charged: switch the option off to receive them, or read them with **Get Items**. `bounded` and `partial` results can leave records uncollected at the source; see the stop reasons in the [run reference](https://cleanedweb.com/docs/run-catalog-api/?utm_source=github&utm_medium=n8n-nodes-cleanedweb#stop-reasons). For **Run Source** with an **Expected Version**, the result's `summary.definition_version` must also match it.
|
|
90
|
+
|
|
91
|
+
Choose **Output > Full Response** to get one item with `records`, `summary`, `metadata`, `run` and `delivery` (run ID, record count) for your own storage envelope.
|
|
92
|
+
|
|
93
|
+
### Other options
|
|
94
|
+
|
|
95
|
+
| Option | Meaning |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| Major Version | Pin the API to a major (`version`) so a newer major cannot change your results. Pin one in production. |
|
|
98
|
+
| Fields | Comma-separated output fields to return. |
|
|
99
|
+
| Include Null Fields | Send every published field, with absent values as `null`. |
|
|
100
|
+
| Run Timeout (Seconds) | The run's own time budget, 60-86400, default 10800. Changing it, `Input` or `Max Items` creates a new request identity. |
|
|
101
|
+
| Wait per Request (Seconds) | How long each start request waits before answering `202`, 0-86400, default 90. Not part of the request identity. |
|
|
102
|
+
| Definition Version (Run Source) | Select an accepted revision explicitly. Use instead of **Expected Version**, never both. |
|
|
103
|
+
|
|
104
|
+
Notes:
|
|
105
|
+
|
|
106
|
+
- **Include Null Fields** is applied to the first answer and to `Get Items`; the catalog result route does not take it, so a run that needed polling returns the records as that route delivers them.
|
|
107
|
+
- Reading a result never collects the website again and never charges again.
|
|
108
|
+
|
|
109
|
+
### Scheduling and storage
|
|
110
|
+
|
|
111
|
+
n8n's Schedule Trigger is the scheduler; see CleanedWeb's guides to [scheduled runs](https://cleanedweb.com/docs/scheduled-runs/?utm_source=github&utm_medium=n8n-nodes-cleanedweb) and [storing results](https://cleanedweb.com/docs/storing-results/?utm_source=github&utm_medium=n8n-nodes-cleanedweb): keep the run ID, deduplicate across runs yourself, and never delete rows missing from a bounded result.
|
|
112
|
+
|
|
113
|
+
## Compatibility
|
|
114
|
+
|
|
115
|
+
- Requires Node.js 20.15 or newer and an n8n version that supports `n8nNodesApiVersion` 1 (the `n8n-workflow` peer dependency is not pinned).
|
|
116
|
+
- The node was loaded and its no-key operations executed on n8n 2.48.6 (see `CHANGELOG.md`). The paid run operations are covered by unit tests with mocked helpers; they have not yet been run live.
|
|
117
|
+
- The package has no runtime dependencies.
|
|
118
|
+
|
|
119
|
+
## Example workflows
|
|
120
|
+
|
|
121
|
+
Import these from n8n's **Import from File**:
|
|
122
|
+
|
|
123
|
+
| File | What it shows |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| [`examples/catalog-list-and-contract.json`](examples/catalog-list-and-contract.json) | List APIs, then read each one's contract. Needs no API key. |
|
|
126
|
+
| [`examples/run-catalog-api-daily.json`](examples/run-catalog-api-daily.json) | Schedule, run the GitHub Topics Repositories API (25 records), keep two fields. |
|
|
127
|
+
| [`examples/recover-a-run.json`](examples/recover-a-run.json) | Start without waiting, wait, then read the run's items. |
|
|
128
|
+
|
|
129
|
+
Replace the credential placeholder after import. The run examples use real runs that are charged per record.
|
|
130
|
+
|
|
131
|
+
## Development
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npm ci
|
|
135
|
+
npm run lint # n8n's linter (@n8n/node-cli)
|
|
136
|
+
npm run build
|
|
137
|
+
npm test # builds, then runs the unit tests (mocked helpers, no network)
|
|
138
|
+
npm run dev # n8n with the node linked (needs Docker or Podman)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The unit tests in `test/` cover request building, idempotency and retry behavior, `Retry-After` polling, result acceptance and pagination. No test sends a request to CleanedWeb.
|
|
142
|
+
|
|
143
|
+
## Resources
|
|
144
|
+
|
|
145
|
+
- [CleanedWeb](https://cleanedweb.com/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
146
|
+
- [Published catalog APIs](https://cleanedweb.com/docs/catalog-apis/?utm_source=github&utm_medium=n8n-nodes-cleanedweb) and the [catalog](https://cleanedweb.com/catalog/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
147
|
+
- [Run a catalog API](https://cleanedweb.com/docs/run-catalog-api/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
148
|
+
- [Run an API (private sources)](https://cleanedweb.com/docs/run-api/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
149
|
+
- [Idempotency and recovery](https://cleanedweb.com/docs/idempotency/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
150
|
+
- [Billing and Units](https://cleanedweb.com/docs/billing/?utm_source=github&utm_medium=n8n-nodes-cleanedweb)
|
|
151
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
152
|
+
|
|
153
|
+
## Version history
|
|
154
|
+
|
|
155
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CleanedWebApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: {
|
|
6
|
+
readonly light: "file:../nodes/CleanedWeb/cleanedweb.svg";
|
|
7
|
+
readonly dark: "file:../nodes/CleanedWeb/cleanedweb.dark.svg";
|
|
8
|
+
};
|
|
9
|
+
documentationUrl: string;
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
test: ICredentialTestRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CleanedWebApi = void 0;
|
|
4
|
+
const constants_1 = require("../nodes/CleanedWeb/constants");
|
|
5
|
+
class CleanedWebApi {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'cleanedWebApi';
|
|
8
|
+
this.displayName = 'CleanedWeb API';
|
|
9
|
+
this.icon = {
|
|
10
|
+
light: 'file:../nodes/CleanedWeb/cleanedweb.svg',
|
|
11
|
+
dark: 'file:../nodes/CleanedWeb/cleanedweb.dark.svg',
|
|
12
|
+
};
|
|
13
|
+
this.documentationUrl = 'https://cleanedweb.com/docs/authentication/?utm_source=github&utm_medium=n8n-nodes-cleanedweb';
|
|
14
|
+
this.properties = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'API Key',
|
|
17
|
+
name: 'apiKey',
|
|
18
|
+
type: 'string',
|
|
19
|
+
typeOptions: { password: true },
|
|
20
|
+
required: true,
|
|
21
|
+
default: '',
|
|
22
|
+
description: 'A CleanedWeb API key with the run scope. Runs use the credits of its workspace; keep it secret.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Run Origin',
|
|
26
|
+
name: 'origin',
|
|
27
|
+
type: 'string',
|
|
28
|
+
default: constants_1.DEFAULT_RUN_ORIGIN,
|
|
29
|
+
description: 'Where runs and results are served, without a path. Leave the default unless your workspace supplies another origin. The API key is sent only to this origin, over https.',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
this.authenticate = {
|
|
33
|
+
type: 'generic',
|
|
34
|
+
properties: {
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
this.test = {
|
|
41
|
+
request: {
|
|
42
|
+
baseURL: `={{$credentials.origin || '${constants_1.DEFAULT_RUN_ORIGIN}'}}`,
|
|
43
|
+
url: '/v1/runs',
|
|
44
|
+
method: 'GET',
|
|
45
|
+
qs: { limit: 1 },
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.CleanedWebApi = CleanedWebApi;
|
|
51
|
+
//# sourceMappingURL=CleanedWebApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CleanedWebApi.credentials.js","sourceRoot":"","sources":["../../credentials/CleanedWebApi.credentials.ts"],"names":[],"mappings":";;;AAOA,6DAAmE;AAEnE,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QAEvB,gBAAW,GAAG,gBAAgB,CAAC;QAE/B,SAAI,GAAG;YACN,KAAK,EAAE,yCAAyC;YAChD,IAAI,EAAE,8CAA8C;SAC3C,CAAC;QAEX,qBAAgB,GACf,+FAA+F,CAAC;QAEjG,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,iGAAiG;aAClG;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,8BAAkB;gBAC3B,WAAW,EACV,0KAA0K;aAC3K;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAGF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,8BAA8B,8BAAkB,KAAK;gBAC9D,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAAK;gBACb,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;aAChB;SACD,CAAC;IACH,CAAC;CAAA;AApDD,sCAoDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class CleanedWeb implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getCatalogApis(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getCatalogEndpoints(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CleanedWeb = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const CatalogDescription_1 = require("./descriptions/CatalogDescription");
|
|
7
|
+
const PrivateApiDescription_1 = require("./descriptions/PrivateApiDescription");
|
|
8
|
+
const RunDescription_1 = require("./descriptions/RunDescription");
|
|
9
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
10
|
+
const Operations_1 = require("./Operations");
|
|
11
|
+
function toNodeError(ctx, error, itemIndex) {
|
|
12
|
+
const node = ctx.getNode();
|
|
13
|
+
if (error instanceof GenericFunctions_1.BrokerError) {
|
|
14
|
+
const response = { message: error.message, code: error.code, errorCode: error.errorCode };
|
|
15
|
+
return new n8n_workflow_1.NodeApiError(node, response, {
|
|
16
|
+
message: error.message,
|
|
17
|
+
description: error.description,
|
|
18
|
+
httpCode: error.statusCode ? String(error.statusCode) : undefined,
|
|
19
|
+
itemIndex,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (error instanceof GenericFunctions_1.RunStillRunningError) {
|
|
23
|
+
return new n8n_workflow_1.NodeOperationError(node, error.message, {
|
|
24
|
+
itemIndex,
|
|
25
|
+
description: 'The run continues on the server and is charged per record delivered. Read it with the Run > Get or Get Items operation, or stop it with Abort, using the run ID.',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (error instanceof GenericFunctions_1.ResultNotAcceptedError) {
|
|
29
|
+
return new n8n_workflow_1.NodeOperationError(node, error.message, {
|
|
30
|
+
itemIndex,
|
|
31
|
+
description: 'The records the run saved stay readable and charged: read them with Run > Get Items. Turn off "Fail on Unaccepted Result" to receive them directly.',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof GenericFunctions_1.CleanedWebUsageError) {
|
|
35
|
+
return new n8n_workflow_1.NodeOperationError(node, error.message, { itemIndex, description: error.description });
|
|
36
|
+
}
|
|
37
|
+
if (error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError)
|
|
38
|
+
return error;
|
|
39
|
+
if (error instanceof Error && 'httpCode' in error) {
|
|
40
|
+
return new n8n_workflow_1.NodeApiError(node, error, { itemIndex });
|
|
41
|
+
}
|
|
42
|
+
return new n8n_workflow_1.NodeOperationError(node, error, { itemIndex });
|
|
43
|
+
}
|
|
44
|
+
class CleanedWeb {
|
|
45
|
+
constructor() {
|
|
46
|
+
this.description = {
|
|
47
|
+
displayName: 'CleanedWeb',
|
|
48
|
+
name: 'cleanedWeb',
|
|
49
|
+
icon: { light: 'file:cleanedweb.svg', dark: 'file:cleanedweb.dark.svg' },
|
|
50
|
+
group: ['input'],
|
|
51
|
+
version: 1,
|
|
52
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
53
|
+
description: 'Run maintained APIs for public website collections and read their structured records',
|
|
54
|
+
defaults: { name: 'CleanedWeb' },
|
|
55
|
+
usableAsTool: true,
|
|
56
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
57
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
58
|
+
credentials: [
|
|
59
|
+
{
|
|
60
|
+
name: constants_1.CREDENTIAL_NAME,
|
|
61
|
+
required: true,
|
|
62
|
+
displayOptions: { show: { resource: ['run', 'privateApi'] } },
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
properties: [
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Resource',
|
|
68
|
+
name: 'resource',
|
|
69
|
+
type: 'options',
|
|
70
|
+
noDataExpression: true,
|
|
71
|
+
options: [
|
|
72
|
+
{ name: 'Catalog', value: 'catalog' },
|
|
73
|
+
{ name: 'Private API', value: 'privateApi' },
|
|
74
|
+
{ name: 'Run', value: 'run' },
|
|
75
|
+
],
|
|
76
|
+
default: 'run',
|
|
77
|
+
},
|
|
78
|
+
...CatalogDescription_1.catalogOperations,
|
|
79
|
+
...CatalogDescription_1.catalogFields,
|
|
80
|
+
...RunDescription_1.runOperations,
|
|
81
|
+
...RunDescription_1.runFields,
|
|
82
|
+
...PrivateApiDescription_1.privateApiOperations,
|
|
83
|
+
...PrivateApiDescription_1.privateApiFields,
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
this.methods = {
|
|
87
|
+
loadOptions: {
|
|
88
|
+
async getCatalogApis() {
|
|
89
|
+
const apis = await (0, GenericFunctions_1.listCatalogApis)(this, { sort: 'name' });
|
|
90
|
+
return apis
|
|
91
|
+
.filter((api) => typeof api.api_id === 'string')
|
|
92
|
+
.map((api) => {
|
|
93
|
+
var _a;
|
|
94
|
+
const site = (0, GenericFunctions_1.isRecord)(api.site) ? api.site : {};
|
|
95
|
+
const domain = typeof site.domain === 'string' ? ` (${site.domain})` : '';
|
|
96
|
+
return {
|
|
97
|
+
name: `${String((_a = api.name) !== null && _a !== void 0 ? _a : api.api_id)}${domain}`,
|
|
98
|
+
value: String(api.api_id),
|
|
99
|
+
description: typeof api.short_description === 'string' ? api.short_description : undefined,
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
async getCatalogEndpoints() {
|
|
104
|
+
const apiId = this.getCurrentNodeParameter('apiId');
|
|
105
|
+
if (typeof apiId !== 'string' || apiId === '' || apiId.startsWith('='))
|
|
106
|
+
return [];
|
|
107
|
+
const api = await (0, GenericFunctions_1.getCatalogApi)(this, apiId);
|
|
108
|
+
const endpoints = Array.isArray(api.endpoints) ? api.endpoints : [];
|
|
109
|
+
return endpoints
|
|
110
|
+
.filter((endpoint) => typeof endpoint.endpoint_id === 'string')
|
|
111
|
+
.map((endpoint) => {
|
|
112
|
+
var _a;
|
|
113
|
+
return ({
|
|
114
|
+
name: String((_a = endpoint.name) !== null && _a !== void 0 ? _a : endpoint.endpoint_id),
|
|
115
|
+
value: String(endpoint.endpoint_id),
|
|
116
|
+
description: (typeof endpoint.description === 'string' ? endpoint.description : '') +
|
|
117
|
+
(endpoint.status && endpoint.status !== 'available'
|
|
118
|
+
? ` (status: ${String(endpoint.status)})`
|
|
119
|
+
: ''),
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async execute() {
|
|
127
|
+
const items = this.getInputData();
|
|
128
|
+
const returnData = [];
|
|
129
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
130
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
131
|
+
for (let i = 0; i < items.length; i++) {
|
|
132
|
+
try {
|
|
133
|
+
let result;
|
|
134
|
+
if (resource === 'catalog' && operation === 'list') {
|
|
135
|
+
result = await (0, Operations_1.listApis)(this, i);
|
|
136
|
+
}
|
|
137
|
+
else if (resource === 'catalog' && operation === 'getContract') {
|
|
138
|
+
result = await (0, Operations_1.getApiContract)(this, i);
|
|
139
|
+
}
|
|
140
|
+
else if (resource === 'run' && operation === 'runCatalog') {
|
|
141
|
+
result = await (0, Operations_1.startRun)(this, i, 'catalog');
|
|
142
|
+
}
|
|
143
|
+
else if (resource === 'run' && operation === 'get') {
|
|
144
|
+
result = await (0, Operations_1.getRun)(this, i);
|
|
145
|
+
}
|
|
146
|
+
else if (resource === 'run' && operation === 'getItems') {
|
|
147
|
+
result = await (0, Operations_1.getRunItems)(this, i);
|
|
148
|
+
}
|
|
149
|
+
else if (resource === 'run' && operation === 'abort') {
|
|
150
|
+
result = await (0, Operations_1.abortRun)(this, i);
|
|
151
|
+
}
|
|
152
|
+
else if (resource === 'privateApi' && operation === 'runSource') {
|
|
153
|
+
result = await (0, Operations_1.startRun)(this, i, 'source');
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported for "${resource}"`, { itemIndex: i });
|
|
157
|
+
}
|
|
158
|
+
returnData.push(...result);
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
if (this.continueOnFail()) {
|
|
162
|
+
returnData.push({
|
|
163
|
+
json: { error: error.message },
|
|
164
|
+
pairedItem: { item: i },
|
|
165
|
+
});
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
throw toNodeError(this, error, i);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return [returnData];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.CleanedWeb = CleanedWeb;
|
|
175
|
+
//# sourceMappingURL=CleanedWeb.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CleanedWeb.node.js","sourceRoot":"","sources":["../../../nodes/CleanedWeb/CleanedWeb.node.ts"],"names":[],"mappings":";;;AAUA,+CAAqF;AAErF,2CAA8C;AAC9C,0EAAqF;AACrF,gFAA8F;AAC9F,kEAAyE;AACzE,yDAQ4B;AAC5B,6CAOsB;AAGtB,SAAS,WAAW,CAAC,GAAsB,EAAE,KAAc,EAAE,SAAiB;IAC7E,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC3B,IAAI,KAAK,YAAY,8BAAW,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAgB,CAAC;QACxG,OAAO,IAAI,2BAAY,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AAI,CAAC,GAAG,MAAM,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YACnC,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA/HD,gCA+HC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-cleanedweb.cleanedWeb",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Data & Storage", "Development"],
|
|
6
|
+
"alias": ["website data", "scraping", "web data api", "extract records", "catalog api"],
|
|
7
|
+
"resources": {
|
|
8
|
+
"credentialDocumentation": [
|
|
9
|
+
{
|
|
10
|
+
"url": "https://github.com/cleanedweb/n8n-nodes-cleanedweb#credentials"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"primaryDocumentation": [
|
|
14
|
+
{
|
|
15
|
+
"url": "https://github.com/cleanedweb/n8n-nodes-cleanedweb#readme"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
export type Ctx = IExecuteFunctions | ILoadOptionsFunctions;
|
|
3
|
+
export declare class CleanedWebUsageError extends Error {
|
|
4
|
+
readonly description?: string | undefined;
|
|
5
|
+
constructor(message: string, description?: string | undefined);
|
|
6
|
+
}
|
|
7
|
+
export interface BrokerErrorInit {
|
|
8
|
+
message: string;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
description?: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
errorCode?: string;
|
|
13
|
+
runId?: string;
|
|
14
|
+
unsure: boolean;
|
|
15
|
+
retryAfterSeconds?: number;
|
|
16
|
+
body?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare class BrokerError extends Error {
|
|
19
|
+
readonly statusCode: number;
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
readonly code?: string;
|
|
22
|
+
readonly errorCode?: string;
|
|
23
|
+
readonly runId?: string;
|
|
24
|
+
readonly unsure: boolean;
|
|
25
|
+
readonly retryAfterSeconds?: number;
|
|
26
|
+
readonly body?: unknown;
|
|
27
|
+
constructor(init: BrokerErrorInit);
|
|
28
|
+
}
|
|
29
|
+
export declare class RunStillRunningError extends Error {
|
|
30
|
+
readonly runId: string | undefined;
|
|
31
|
+
readonly waitedSeconds: number;
|
|
32
|
+
constructor(runId: string | undefined, waitedSeconds: number);
|
|
33
|
+
}
|
|
34
|
+
export declare class ResultNotAcceptedError extends Error {
|
|
35
|
+
readonly runId: string | undefined;
|
|
36
|
+
readonly body: IDataObject;
|
|
37
|
+
constructor(message: string, runId: string | undefined, body: IDataObject);
|
|
38
|
+
}
|
|
39
|
+
export interface BrokerResponse {
|
|
40
|
+
statusCode: number;
|
|
41
|
+
headers: Record<string, string | string[] | undefined>;
|
|
42
|
+
body: IDataObject;
|
|
43
|
+
}
|
|
44
|
+
export interface Deps {
|
|
45
|
+
sleep: (ctx: IExecuteFunctions, ms: number) => Promise<void>;
|
|
46
|
+
now: () => number;
|
|
47
|
+
}
|
|
48
|
+
export declare const defaultDeps: Deps;
|
|
49
|
+
export type Settled<T> = {
|
|
50
|
+
ok: true;
|
|
51
|
+
value: T;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
error: unknown;
|
|
55
|
+
};
|
|
56
|
+
export declare function settle<T>(promise: Promise<T>): Promise<Settled<T>>;
|
|
57
|
+
export declare function isRecord(value: unknown): value is IDataObject;
|
|
58
|
+
export declare function normalizeOrigin(raw: unknown): string;
|
|
59
|
+
export declare function validateIdempotencyKey(value: unknown): string;
|
|
60
|
+
export declare function parseInput(value: unknown): IDataObject;
|
|
61
|
+
export declare function parseFields(value: unknown): string[] | undefined;
|
|
62
|
+
export interface RunBodyInput {
|
|
63
|
+
input: IDataObject;
|
|
64
|
+
maxItems?: number;
|
|
65
|
+
timeoutSeconds?: number;
|
|
66
|
+
waitSeconds?: number;
|
|
67
|
+
fields?: string[];
|
|
68
|
+
nulls?: boolean;
|
|
69
|
+
version?: number;
|
|
70
|
+
expectedVersion?: string;
|
|
71
|
+
definitionVersion?: string;
|
|
72
|
+
}
|
|
73
|
+
export declare function buildRunBody(init: RunBodyInput): IDataObject;
|
|
74
|
+
export declare function parseRetryAfter(headers: BrokerResponse['headers'] | undefined, now?: number): number | undefined;
|
|
75
|
+
export declare function extractRunId(body: IDataObject | undefined): string | undefined;
|
|
76
|
+
export declare function assertAccepted(body: IDataObject, expectedVersion?: string): void;
|
|
77
|
+
export interface BrokerRequest {
|
|
78
|
+
method: IHttpRequestMethods;
|
|
79
|
+
path: string;
|
|
80
|
+
qs?: IDataObject;
|
|
81
|
+
body?: IDataObject;
|
|
82
|
+
headers?: Record<string, string>;
|
|
83
|
+
timeoutMs?: number;
|
|
84
|
+
}
|
|
85
|
+
export declare function brokerRequest(ctx: IExecuteFunctions, request: BrokerRequest): Promise<BrokerResponse>;
|
|
86
|
+
export declare function catalogGet(ctx: Ctx, path: string, qs?: IDataObject): Promise<IDataObject>;
|
|
87
|
+
export interface CatalogListOptions {
|
|
88
|
+
limit?: number;
|
|
89
|
+
query?: string;
|
|
90
|
+
category?: string;
|
|
91
|
+
sort?: string;
|
|
92
|
+
}
|
|
93
|
+
export declare function listCatalogApis(ctx: Ctx, options?: CatalogListOptions): Promise<IDataObject[]>;
|
|
94
|
+
export declare function getCatalogApi(ctx: Ctx, apiId: string): Promise<IDataObject>;
|
|
95
|
+
export declare function getCatalogContract(ctx: Ctx, apiId: string, endpointId: string, version?: number): Promise<IDataObject>;
|
|
96
|
+
export interface RunRequest {
|
|
97
|
+
startPath: string;
|
|
98
|
+
body: IDataObject;
|
|
99
|
+
idempotencyKey: string;
|
|
100
|
+
waitForResult: boolean;
|
|
101
|
+
resultRequest: (runId: string | undefined) => {
|
|
102
|
+
path: string;
|
|
103
|
+
headers?: Record<string, string>;
|
|
104
|
+
};
|
|
105
|
+
maxWaitSeconds: number;
|
|
106
|
+
pollFallbackSeconds: number;
|
|
107
|
+
}
|
|
108
|
+
export interface RunOutcome {
|
|
109
|
+
finished: boolean;
|
|
110
|
+
body: IDataObject;
|
|
111
|
+
runId?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare function executeRun(ctx: IExecuteFunctions, request: RunRequest, deps?: Deps): Promise<RunOutcome>;
|
|
114
|
+
export interface RunItemsOptions {
|
|
115
|
+
returnAll: boolean;
|
|
116
|
+
limit?: number;
|
|
117
|
+
pageSize: number;
|
|
118
|
+
startCursor: string;
|
|
119
|
+
nulls?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export declare function fetchRunItems(ctx: IExecuteFunctions, runId: string, options: RunItemsOptions): Promise<IDataObject[]>;
|