Skip to content

Commit 52b8c45

Browse files
committed
feat(repo): initial commit
0 parents  commit 52b8c45

35 files changed

+33935
-0
lines changed

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
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

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
module.exports = {
2+
root: true,
3+
4+
env: {
5+
browser: true,
6+
es6: true,
7+
node: true,
8+
},
9+
10+
parser: '@typescript-eslint/parser',
11+
parserOptions: {
12+
project: ['./tsconfig.json'],
13+
sourceType: 'module',
14+
extraFileExtensions: ['.json'],
15+
},
16+
ignorePatterns: [
17+
'.eslintrc.js',
18+
'**/*.js',
19+
'**/node_modules/**',
20+
'**/dist/**',
21+
],
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-execute-block-missing-continue-on-fail': 'off',
47+
'n8n-nodes-base/node-resource-description-filename-against-convention':
48+
'off',
49+
'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off',
50+
'n8n-nodes-base/node-execute-block-operation-missing-singular-pairing':
51+
'off',
52+
'n8n-nodes-base/node-execute-block-operation-missing-plural-pairing':
53+
'off',
54+
},
55+
},
56+
],
57+
};

.eslintrc.prepublish.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
extends: './.eslintrc.js',
3+
overrides: [
4+
{
5+
files: ['package.json'],
6+
plugins: ['eslint-plugin-n8n-nodes-base'],
7+
rules: {
8+
'n8n-nodes-base/community-package-json-name-still-default': 'error',
9+
},
10+
},
11+
],
12+
};

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules
2+
.DS_Store
3+
.tmp
4+
tmp
5+
dist
6+
npm-debug.log*
7+
.vscode/launch.json
8+
.eslintcache
9+
yarn-error.log
10+
.env*
11+
.jest-cache
12+
13+
n8n-nodes-openpix*.tgz

.husky/pre-commit

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
branch="$(git rev-parse --abbrev-ref HEAD)"
4+
5+
if [ "$branch" = "main" ]; then
6+
echo "You can't commit directly to main branch"
7+
exit 1
8+
fi
9+
10+
. "$(dirname "$0")/_/husky.sh"
11+
12+
yarn lint-staged --no-stash
13+

.npmignore

Whitespace-only changes.

.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
trailingComma: 'all',
3+
singleQuote: true,
4+
semi: true,
5+
};

.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"EditorConfig.EditorConfig",
5+
"esbenp.prettier-vscode",
6+
]
7+
}

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

LICENSE.md

+19
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

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# n8n-nodes-openpix
2+
3+
![OpenPix N8N logo](img/openpix-n8n.png)
4+
5+
[![NPM Version](https://badge.fury.io/js/n8n-nodes-openpix.svg?style=flat)](https://npmjs.org/package/n8n-nodes-openpix)
6+
7+
[![https://nodei.co/npm/n8n-nodes-openpix.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/n8n-nodes-openpix.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/n8n-nodes-openpix)
8+
9+
n8n nodes for create charges and payments with [OpenPix](https://openpix.com.br)
10+
11+
## How to use
12+
13+
### Community Nodes (Recommended)
14+
15+
1. Go to Settings > Community Nodes.
16+
2. Select Install.
17+
3. Enter `n8n-nodes-openpix` in _Enter npm package name._ field.
18+
4. Agree to the risks of using community nodes: select I understand the risks of installing unverified code from a public source.
19+
5. Select Install.
20+
21+
### Manual installation
22+
23+
To get started install the package in your n8n root directory:
24+
25+
`npm install n8n-nodes-openpix`
26+
27+
### Setup
28+
29+
1. Go to Credentials.
30+
2. Select `Add Credential` button.
31+
3. Select `OpenPix API` from the _Search for app_ dropdown.
32+
4. Get your OpenPix API key from [API Getting Started](https://developers.openpix.com.br/docs/apis/api-getting-started).
33+
5. Enter your OpenPix API key in the _API Key_ field.
34+
35+
## API Reference
36+
37+
- [OpenPix API](https://developers.openpix.com.br/docs/apis/api-getting-started)
38+
39+
## Contributing
40+
41+
1. Fork it (<https://github.com/entria/n8n-nodes-openpix/fork>)
42+
2. Create your feature branch (`git checkout -b feature/fooBar`)
43+
3. Commit your changes (`git commit -m 'feat(fooBar) Add some fooBar'`)
44+
4. Push to the branch (`git push origin feature/fooBar`)
45+
5. Create a new Pull Request

credentials/OpenPixApi.credentials.ts

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type {
2+
IAuthenticateGeneric,
3+
ICredentialType,
4+
INodeProperties,
5+
} from 'n8n-workflow';
6+
7+
export class OpenPixApi implements ICredentialType {
8+
name = 'openpixApi';
9+
displayName = 'OpenPix API';
10+
// Uses the link to this tutorial as an example
11+
// Replace with your own docs links when building your own nodes
12+
documentationUrl =
13+
'https://developers.openpix.com.br/docs/apis/api-getting-started';
14+
properties: INodeProperties[] = [
15+
{
16+
displayName: 'API Key',
17+
name: 'Authorization',
18+
type: 'string',
19+
typeOptions: { password: true },
20+
default: '',
21+
},
22+
{
23+
displayName: 'Base URL',
24+
name: 'baseUrl',
25+
type: 'string',
26+
default: 'https://api.openpix.com.br/api',
27+
},
28+
];
29+
authenticate: IAuthenticateGeneric = {
30+
type: 'generic',
31+
properties: {
32+
headers: {
33+
Authorization: '={{$credentials.Authorization}}',
34+
},
35+
},
36+
};
37+
}

gulpfile.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const path = require('path');
2+
const { task, src, dest } = require('gulp');
3+
4+
task('build:icons', copyIcons);
5+
6+
function copyIcons() {
7+
const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
8+
const nodeDestination = path.resolve('dist', 'nodes');
9+
10+
src(nodeSource).pipe(dest(nodeDestination));
11+
12+
const credSource = path.resolve('credentials', '**', '*.{png,svg}');
13+
const credDestination = path.resolve('dist', 'credentials');
14+
15+
return src(credSource).pipe(dest(credDestination));
16+
}

img/openpix-n8n.png

78 KB
Loading

jest.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
rootDir: './',
3+
testPathIgnorePatterns: ['/node_modules/', './dist', '__generated__'],
4+
5+
setupFiles: ['./jest.setup.js'],
6+
resetModules: false,
7+
transform: {
8+
'^.+\\.(js|ts|tsx)?$': '@swc/jest',
9+
},
10+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts|tsx)?$',
11+
moduleFileExtensions: ['ts', 'js', 'tsx', 'json'],
12+
cacheDirectory: '.jest-cache',
13+
};

jest.setup.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import nock from 'nock';
2+
3+
nock.disableNetConnect();

nodes/OpenPix/OpenPix.node.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"node": "n8n-nodes-base.OpenPix",
3+
"nodeVersion": "1.0",
4+
"codexVersion": "1.0",
5+
"categories": ["Sales"],
6+
"resources": {
7+
"credentialDocumentation": [
8+
{
9+
"url": "https://developers.openpix.com.br/docs/apis/api-getting-started"
10+
}
11+
],
12+
"primaryDocumentation": [
13+
{
14+
"url": "https://developers.openpix.com.br/api"
15+
}
16+
]
17+
}
18+
}

0 commit comments

Comments
 (0)