Skip to content

Commit 993df01

Browse files
committed
feat: init commit
0 parents  commit 993df01

32 files changed

+7782
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[package.json]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.yml]
19+
indent_style = space
20+
indent_size = 2

.eslintrc.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* @type {import('@types/eslint').ESLint.ConfigData}
3+
*/
4+
module.exports = {
5+
root: true,
6+
7+
env: {
8+
browser: true,
9+
es6: true,
10+
node: true,
11+
},
12+
13+
parser: '@typescript-eslint/parser',
14+
15+
parserOptions: {
16+
project: ['./tsconfig.json'],
17+
sourceType: 'module',
18+
extraFileExtensions: ['.json'],
19+
},
20+
21+
ignorePatterns: ['.eslintrc.js', '**/*.js', '**/node_modules/**', '**/dist/**'],
22+
23+
overrides: [
24+
{
25+
files: ['package.json'],
26+
plugins: ['eslint-plugin-n8n-nodes-base'],
27+
extends: ['plugin:n8n-nodes-base/community'],
28+
rules: {
29+
'n8n-nodes-base/community-package-json-name-still-default': 'off',
30+
},
31+
},
32+
{
33+
files: ['./credentials/**/*.ts'],
34+
plugins: ['eslint-plugin-n8n-nodes-base'],
35+
extends: ['plugin:n8n-nodes-base/credentials'],
36+
rules: {
37+
'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off',
38+
'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off',
39+
},
40+
},
41+
{
42+
files: ['./nodes/**/*.ts'],
43+
plugins: ['eslint-plugin-n8n-nodes-base'],
44+
extends: ['plugin:n8n-nodes-base/nodes'],
45+
rules: {
46+
'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off',
47+
'n8n-nodes-base/node-param-type-options-password-missing': 'off',
48+
'n8n-nodes-base/node-param-display-name-miscased': 'off',
49+
'n8n-nodes-base/node-param-default-wrong-for-options': 'off',
50+
'n8n-nodes-base/node-param-description-boolean-without-whether': 'off',
51+
'n8n-nodes-base/node-param-default-missing': 'off',
52+
'n8n-nodes-base/node-param-collection-type-unsorted-items': 'off',
53+
},
54+
},
55+
],
56+
};

.eslintrc.prepublish.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @type {import('@types/eslint').ESLint.ConfigData}
3+
*/
4+
module.exports = {
5+
extends: "./.eslintrc.js",
6+
7+
overrides: [
8+
{
9+
files: ['package.json'],
10+
plugins: ['eslint-plugin-n8n-nodes-base'],
11+
rules: {
12+
'n8n-nodes-base/community-package-json-name-still-default': 'error',
13+
},
14+
},
15+
],
16+
};

.github/workflows/publish-npm.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish NPM
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'credentials/**'
12+
- 'nodes/**'
13+
- 'package.json'
14+
- 'tsconfig.json'
15+
- 'gulpfile.js'
16+
- 'README.md'
17+
- 'LICENSE.md'
18+
19+
permissions:
20+
contents: write
21+
packages: write
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Install Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 20
36+
registry-url: 'https://registry.npmjs.org'
37+
38+
- uses: pnpm/action-setup@v4
39+
name: Install pnpm
40+
with:
41+
version: 10
42+
- name: Get pnpm store directory
43+
id: pnpm-cache
44+
shell: bash
45+
run: |
46+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
47+
48+
- uses: actions/cache@v4
49+
name: Setup pnpm cache
50+
with:
51+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: pnpm install
58+
59+
- name: Build package
60+
run: pnpm build
61+
62+
- name: Configure Git
63+
run: |
64+
git config --global user.name "github-actions[bot]"
65+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
66+
67+
- name: Check for releasable commits
68+
id: check-commits
69+
run: |
70+
# Get the last release tag
71+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
72+
73+
if [ -z "$LAST_TAG" ]; then
74+
echo "No previous tags found, will create initial release"
75+
echo "should_release=true" >> $GITHUB_OUTPUT
76+
echo "version_type=minor" >> $GITHUB_OUTPUT
77+
else
78+
# Check for release prefix commits (force major version update)
79+
RELEASE_COMMITS=$(git log $LAST_TAG..HEAD --oneline --grep="^release" || echo "")
80+
if [ -n "$RELEASE_COMMITS" ]; then
81+
echo "Found release commits, triggering major version update"
82+
echo "should_release=true" >> $GITHUB_OUTPUT
83+
echo "version_type=major" >> $GITHUB_OUTPUT
84+
exit 0
85+
fi
86+
87+
# Check for breaking changes
88+
BREAKING_COMMITS=$(git log $LAST_TAG..HEAD --grep="BREAKING CHANGE:" -i || echo "")
89+
if [ -n "$BREAKING_COMMITS" ]; then
90+
echo "Found breaking changes, triggering major version update"
91+
echo "should_release=true" >> $GITHUB_OUTPUT
92+
echo "version_type=major" >> $GITHUB_OUTPUT
93+
exit 0
94+
fi
95+
96+
# Check for new features or performance improvements
97+
FEAT_COMMITS=$(git log $LAST_TAG..HEAD --oneline --grep="^feat\|^perf" || echo "")
98+
if [ -n "$FEAT_COMMITS" ]; then
99+
echo "Found new features, triggering minor version update"
100+
echo "should_release=true" >> $GITHUB_OUTPUT
101+
echo "version_type=minor" >> $GITHUB_OUTPUT
102+
exit 0
103+
fi
104+
105+
# Check other normal commits
106+
COMMITS=$(git log $LAST_TAG..HEAD --oneline --grep="^fix\|^refactor\|^docs\|^style\|^test\|^build\|^ci\|^chore\|^revert" || echo "")
107+
if [ -n "$COMMITS" ]; then
108+
echo "Found releasable commits since $LAST_TAG"
109+
echo "should_release=true" >> $GITHUB_OUTPUT
110+
echo "version_type=patch" >> $GITHUB_OUTPUT
111+
else
112+
echo "No releasable commits found since $LAST_TAG"
113+
echo "should_release=false" >> $GITHUB_OUTPUT
114+
fi
115+
fi
116+
117+
- name: Generate release
118+
if: steps.check-commits.outputs.should_release == 'true'
119+
run: |
120+
if [ "${{ steps.check-commits.outputs.version_type }}" == "major" ]; then
121+
echo "Running major release"
122+
pnpm release:major
123+
elif [ "${{ steps.check-commits.outputs.version_type }}" == "minor" ]; then
124+
echo "Running minor release"
125+
pnpm release:minor
126+
else
127+
echo "Running patch release"
128+
pnpm release:patch
129+
fi
130+
131+
- name: Push changes and tags
132+
if: steps.check-commits.outputs.should_release == 'true'
133+
run: |
134+
git push --follow-tags origin main
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
138+
- name: Publish package
139+
if: steps.check-commits.outputs.should_release == 'true'
140+
run: npm publish --access public
141+
env:
142+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.DS_Store
3+
.tmp
4+
tmp
5+
dist
6+
npm-debug.log*
7+
yarn.lock
8+
.vscode/launch.json
9+
.idea
10+
logs/
11+
.env

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
*.tsbuildinfo

.prettierrc.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = {
2+
/**
3+
* https://prettier.io/docs/en/options.html#semicolons
4+
*/
5+
semi: true,
6+
7+
/**
8+
* https://prettier.io/docs/en/options.html#trailing-commas
9+
*/
10+
trailingComma: 'all',
11+
12+
/**
13+
* https://prettier.io/docs/en/options.html#bracket-spacing
14+
*/
15+
bracketSpacing: true,
16+
17+
/**
18+
* https://prettier.io/docs/en/options.html#tabs
19+
*/
20+
useTabs: true,
21+
22+
/**
23+
* https://prettier.io/docs/en/options.html#tab-width
24+
*/
25+
tabWidth: 2,
26+
27+
/**
28+
* https://prettier.io/docs/en/options.html#arrow-function-parentheses
29+
*/
30+
arrowParens: 'always',
31+
32+
/**
33+
* https://prettier.io/docs/en/options.html#quotes
34+
*/
35+
singleQuote: true,
36+
37+
/**
38+
* https://prettier.io/docs/en/options.html#quote-props
39+
*/
40+
quoteProps: 'as-needed',
41+
42+
/**
43+
* https://prettier.io/docs/en/options.html#end-of-line
44+
*/
45+
endOfLine: 'lf',
46+
47+
/**
48+
* https://prettier.io/docs/en/options.html#print-width
49+
*/
50+
printWidth: 100,
51+
};

LICENSE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright 2022 n8n
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# n8n-nodes-capsolver
2+
3+
This repo contains CapSolver's community node for n8n.
4+
5+
## Installation
6+
7+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
8+
9+
## Credentials
10+
11+
You must have a CapSolver API key to use this node. You can register for a free account to get an API key here:
12+
13+
https://dashboard.capsolver.com/passport/register
14+
15+
Once registered, you can find your API key here:
16+
17+
Then you'll need to create a credential in n8n for CapSolver.
18+
19+
![Add Credentials](images/add-credentials.png)
20+
21+
22+
## 🎯 Captcha Type
23+
24+
The following captcha types are supported by this node:
25+
26+
Task(Recognition)
27+
1. ImageToText
28+
2. reCAPTCHA v2
29+
3. AWS WAF
30+
4. VisionEngine
31+
32+
Task(Token)
33+
1. Geetest V3
34+
2. Geetest V4
35+
3. reCAPTCHA v2
36+
4. reCAPTCHA v3
37+
5. Cloudflare Turnstile
38+
6. Cloudflare Challenge
39+
7. DataDome
40+
8. AWS WAF
41+
9. MTCaptcha
42+
43+
## 📖 Usage
44+
45+
Add the CapSolver node to your workflow.
46+
47+
![Add CapSolver to Workflow](images/workflow.png)
48+
49+
Configure the corresponding parameters, and then click "Execute step".
50+
51+
![Execute](images/execute.png)
52+
53+
## 📝 Resources
54+
55+
- [CapSolver](https://www.capsolver.com/)
56+
- [CapSolver Docs](https://docs.capsolver.com/)
57+
- [n8n Community Nodes](https://docs.n8n.io/integrations/community-nodes/)

0 commit comments

Comments
 (0)