@spider-cloud/piece-spider 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 +62 -2
- package/package.json +25 -4
- package/src/index.js +107 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Spider Contributors
|
|
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,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Spider piece for Activepieces
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@spider-cloud/piece-spider` adds [Spider](https://spider.cloud?utm_source=activepieces&utm_medium=directory&utm_campaign=activepieces-listing) to Activepieces flows and agents. It calls the Spider API at `https://api.spider.cloud`.
|
|
4
|
+
|
|
5
|
+
## Actions
|
|
6
|
+
|
|
7
|
+
| Action | Endpoint | Returns |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Scrape page | `POST /scrape` | One page object with the content in the format you pick |
|
|
10
|
+
| Crawl site | `POST /crawl` | One page object per page, up to the page limit |
|
|
11
|
+
| Search the web | `POST /search` | Ranked results, or page objects when Fetch page content is on |
|
|
12
|
+
| Collect links | `POST /links` | One object per page with the links found on it |
|
|
13
|
+
| Custom API call | any path | The raw response, for routes the actions above don't cover |
|
|
14
|
+
|
|
15
|
+
Each content action has an Additional parameters field. It takes a JSON object with any other request parameter from the [API reference](https://spider.cloud/docs/api?utm_source=activepieces&utm_medium=directory&utm_campaign=activepieces-listing), for example `{"metadata": true}`. A field set in the form wins over the same key in that JSON.
|
|
16
|
+
|
|
17
|
+
Crawl site and Collect links default to a page limit of 10. A limit of 0 crawls every page found, capped by your credit balance.
|
|
18
|
+
|
|
19
|
+
## Connection
|
|
20
|
+
|
|
21
|
+
Create an API key at [spider.cloud/api-keys](https://spider.cloud/api-keys?utm_source=activepieces&utm_medium=directory&utm_campaign=activepieces-listing) and paste it into the connection. The piece sends it as `Authorization: Bearer <key>`.
|
|
22
|
+
|
|
23
|
+
When you save the connection, the piece calls `GET /data/credits` to check the key. That call reads your balance and spends nothing. A 401 rejects the key. A 402 means the key works but the account has no credits, so the connection still saves.
|
|
24
|
+
|
|
25
|
+
## Install on a self-hosted Activepieces
|
|
26
|
+
|
|
27
|
+
The Activepieces docs list two ways to add a piece that isn't in the official catalog. Both go through **Platform Admin → Catalogue → Pieces → Install Piece**. The server needs release 0.82.0 or later.
|
|
28
|
+
|
|
29
|
+
### From npm
|
|
30
|
+
|
|
31
|
+
Once the package is on npm, pick npm as the source and enter `@spider-cloud/piece-spider`. See [Community (public npm)](https://www.activepieces.com/docs/build-pieces/sharing-pieces/community) and [Manage pieces](https://www.activepieces.com/docs/admin-guide/guides/manage-pieces).
|
|
32
|
+
|
|
33
|
+
### From a tarball
|
|
34
|
+
|
|
35
|
+
Build the archive yourself and upload it with the Upload File source:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/spider-rs/spider-clients.git
|
|
39
|
+
cd spider-clients/activepieces
|
|
40
|
+
npm ci
|
|
41
|
+
npm run pack # writes spider-cloud-piece-spider-<version>.tgz here
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
See [Install private pieces](https://www.activepieces.com/docs/admin-guide/guides/manage-pieces#install-private-pieces). The docs mark this upload as an enterprise feature.
|
|
45
|
+
|
|
46
|
+
`AP_DEV_PIECES` is not an install path. The [development setup](https://www.activepieces.com/docs/build-pieces/building-pieces/development-setup) uses it to load pieces from the `packages/pieces` folder of an Activepieces source checkout.
|
|
47
|
+
|
|
48
|
+
## Develop
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm ci
|
|
52
|
+
npm test # vitest, HTTP mocked, no key or network needed
|
|
53
|
+
npm run build # typecheck, then bundle to dist/
|
|
54
|
+
npm test # run again after a build to also check the bundle
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`npm run build` writes `dist/src/index.js`, one CommonJS file with the framework inlined, and a `dist/package.json` with no runtime dependencies. That is the layout Activepieces uses for its own pieces, so the server installs one artifact. The root `package.json` is private on purpose. Publish from `dist/`.
|
|
58
|
+
|
|
59
|
+
The piece builds against `@activepieces/pieces-framework` 0.32.0 and `@activepieces/pieces-common` 0.12.5 from npm.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spider-cloud/piece-spider",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Spider piece for Activepieces: scrape, crawl, search and collect links with the Spider API.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/spider-rs/spider-clients.git",
|
|
9
|
+
"directory": "activepieces"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/spider-rs/spider-clients/tree/main/activepieces",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"activepieces",
|
|
14
|
+
"activepieces-piece",
|
|
15
|
+
"spider",
|
|
16
|
+
"web-scraping",
|
|
17
|
+
"crawler"
|
|
18
|
+
],
|
|
19
|
+
"main": "./src/index.js",
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"files": [
|
|
22
|
+
"src/index.js",
|
|
23
|
+
"package.json",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
]
|
|
27
|
+
}
|