PipedreamHQ / PipedreamHQ/pipedream

[APP] CPF.CNPJ

Open
#21,935 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

## Summary

Proposal for a new app in the registry, CPF/CNPJ, with two actions for looking up official Brazilian registry data. CPF/CNPJ (cpfcnpj.com.br) delivers real-time data (D+0) straight from the official sources, with no leaked or scraped databases, under the ISO/IEC 27001, ISO/IEC 27701 and ISO 37301 certifications.

API documentation: https://www.cpfcnpj.com.br/dev/

## Scope

New `components/cpfcnpj/` directory, mirroring the structure of `components/bigdatacorp/`:

- `cpfcnpj.app.mjs`: app with a document `propDefinition` and `_makeRequest` (token in the URL path).
- `actions/consultar-cnpj/consultar-cnpj.mjs`: CNPJ lookup (packages 6 full and 5 basic).
- `actions/consultar-cpf/consultar-cpf.mjs`: CPF lookup (packages 3 name and address, 1 name).
- `common/constants.mjs`: package catalog.

## Behavior

- Token authentication, sent in the URL path: `https://api.cpfcnpj.com.br/{token}/{pacote}/{documento}`.
- The document accepts CPF (11 digits) and CNPJ (14 digits), with or without formatting characters (dots, slashes and dashes). Formatting is stripped before building the request.
- A response with `status` equal to 1 indicates success, exported to `$summary`. Any other value throws an error with the message returned by the API (`erro` or `erroCodigo`).

## Acceptance criteria

- Repo ESLint (`@pipedream/eslint-plugin-pipedream` plugin) with no errors in the component files.
- `node scripts/generate-package-report.js --package=cpfcnpj` valid and publishable.
- `node --check` clean on all `.mjs` files.
- Action descriptions in English, following the repo's international standard, with a link to the documentation.

## References

- Documentation: https://www.cpfcnpj.com.br/dev/
- Reference pattern: `components/bigdatacorp/`

Contributor guide

Open the contributing guide

Research direction

Start by reading components/bigdatacorp/ and the CPF/CNPJ API documentation, then create the named components/cpfcnpj/ files and actions. Verify document normalization, package selection, token-path requests, and success/error handling against the stated behavior. Run the repository ESLint checks, node --check on all .mjs files, and node scripts/generate-package-report.js --package=cpfcnpj.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.