apigratis-sdk-nodejs
Advanced tools
Comparing version 0.0.9 to 0.1.0
101
package.json
{ | ||
"name": "apigratis-sdk-nodejs", | ||
"version": "0.0.9", | ||
"description": "A ideia desse SDK é otimizar o tempo de código dos usuários auxiliando na integração com a plataforma", | ||
"homepage": "https://apigratis.com.br", | ||
"author": "APIGratis <contato@apigratis.com.br> (https://apigratis.com.br)", | ||
"main": "src/APIGratis.js", | ||
"strict": true, | ||
"keywords": [ | ||
"node", | ||
"npm", | ||
"whatsapp", | ||
"api-rest", | ||
"apigratis", | ||
"apibrasil", | ||
"geolocation", | ||
"cep", | ||
"cpf", | ||
"cnpj", | ||
"correios" | ||
], | ||
"scripts": { | ||
"build": "tsc -p .", | ||
"dev": "ts-node-dev --inspect --ignore-watch node_modules src/APIGratis.js", | ||
"start": "node src/APIGratis.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"funding": { | ||
"type": " Buy me a coffee", | ||
"url": "https://issuehunt.io/r/jhowbhz" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/APIBrasil/apigratis-sdk-node/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/APIBrasil/apigratis-sdk-node.git" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.25.0" | ||
}, | ||
"publishConfig": { | ||
"@jhowbhz:registry": "https://npm.pkg.github.com" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": {} | ||
"name": "apigratis-sdk-nodejs", | ||
"version": "0.1.0", | ||
"description": "A ideia desse SDK é otimizar o tempo de código dos usuários auxiliando na integração com a plataforma", | ||
"homepage": "https://apigratis.com.br", | ||
"author": "APIGratis <contato@apigratis.com.br> (https://apigratis.com.br)", | ||
"main": "./dist", | ||
"strict": true, | ||
"keywords": [ | ||
"node", | ||
"npm", | ||
"whatsapp", | ||
"api-rest", | ||
"apigratis", | ||
"apibrasil", | ||
"geolocation", | ||
"cep", | ||
"cpf", | ||
"cnpj", | ||
"correios" | ||
], | ||
"scripts": { | ||
"build": "tsc -p .", | ||
"start": "tsc && link-module-alias && node dist/index.js", | ||
"dev": "tsc && link-module-alias && concurrently \"tsc --watch\" \"nodemon dist/index.js\"", | ||
"test": "jest", | ||
"docs": "typedoc ./src/index.ts" | ||
}, | ||
"funding": { | ||
"type": " Buy me a coffee", | ||
"url": "https://issuehunt.io/r/jhowbhz" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/APIBrasil/apigratis-sdk-node/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/APIBrasil/apigratis-sdk-node.git" | ||
}, | ||
"dependencies": { | ||
"axios": "^1.4.0", | ||
"link-module-alias": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.2.5", | ||
"concurrently": "^7.5.0", | ||
"nodemon": "^2.0.22", | ||
"typedoc": "^0.23.21", | ||
"typescript": "^4.9.3" | ||
}, | ||
"publishConfig": { | ||
"@jhowbhz:registry": "https://npm.pkg.github.com" | ||
}, | ||
"license": "MIT" | ||
} |
166
README.md
@@ -1,17 +0,17 @@ | ||
# SDK JavaScript - APIGratis by API BRASIL 🚀 | ||
# SDK NODEJS - APIGratis by API BRASIL 🚀 | ||
Conjunto de API, para desenvolvedores. | ||
_Transforme seus projetos em soluções inteligentes com nossa API. Com recursos como API do WhatsApp, geolocalização, rastreamento de encomendas, verificação de CPF/CNPJ e mais, você pode criar soluções eficientes e funcionais. Comece agora._ | ||
_Transforme seus projetos em soluções inteligentes com nossa API. Com recursos como API do WhatsApp, geolocalização, rastreamento de encomendas, verificação de CPF/CNPJ e mais, você pode criar soluções eficientes e funcionais. Comece agora._ | ||
[![npm version](https://img.shields.io/npm/v/apigratis.svg?color=green)](https://www.npmjs.com/package/apigratis) | ||
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/jhowbhz/package-apigratis-npm.svg)](https://isitmaintained.com/project/jhowbhz/apigratis 'Average time to resolve an issue') | ||
[![Percentage of issues still open](https://isitmaintained.com/badge/open/jhowbhz/package-apigratis-npm.svg)](https://isitmaintained.com/project/jhowbhz/package-apigratis-npm 'Percentage of issues still open') | ||
[![release-it](https://img.shields.io/badge/%F0%9F%93%A6%F0%9F%9A%80-release--it-e10079.svg)](https://github.com/release-it/release-it) | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/issues" target="_blank"><img alt="GitHub issues" src="https://img.shields.io/github/issues/jhowbhz/package-apigratis-npm"></a> | ||
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/jhowbhz/package-apigratis-npm/total"> | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/network" target="_blank"><img alt="GitHub forks" src="https://img.shields.io/github/forks/jhowbhz/package-apigratis-npm"></a> | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/stargazers" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/jhowbhz/package-apigratis-npm"></a> | ||
[![npm version](https://img.shields.io/npm/v/apigratis-sdk-nodejs.svg?color=green)](https://www.npmjs.com/package/apigratis-sdk-nodejs) | ||
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/APIBrasil/apigratis-sdk-nodejs.svg)](https://isitmaintained.com/project/APIBrasil/apigratis-sdk-node 'Average time to resolve an issue') | ||
[![Percentage of issues still open](https://isitmaintained.com/badge/open/APIBrasil/apigratis-sdk-nodejs.svg)](https://isitmaintained.com/project/APIBrasil/apigratis-sdk-node 'Percentage of issues still open') | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/issues" target="_blank"><img alt="GitHub issues" src="https://img.shields.io/github/issues/APIBrasil/apigratis-sdk-node"></a> | ||
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/APIBrasil/apigratis-sdk-node/total"> | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/network" target="_blank"><img alt="GitHub forks" src="https://img.shields.io/github/forks/APIBrasil/apigratis-sdk-node"></a> | ||
<a href="https://github.com/APIBrasil/apigratis-sdk-node/stargazers" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/APIBrasil/apigratis-sdk-node"></a> | ||
## Canais de suporte (Comunidade) | ||
[![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/KsxrUGIPWvUBYAjI1ogaGs) | ||
@@ -21,23 +21,25 @@ [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/apigratisoficial) | ||
## Obtenha suas credenciais | ||
https://apigratis.com.br | ||
## Instalando pacote com o composer | ||
```npm i apigratis-sdk-nodejs --save``` | ||
`npm i apigratis-sdk-nodejs --save` | ||
## Mais informações | ||
https://www.npmjs.com/package/apigratis | ||
https://www.npmjs.com/package/apigratis-sdk-nodejs | ||
## Serviços de API disponíveis | ||
| Up | Services available | Description | Free | Beta | Stable | | ||
------|-------------------------------|-------------------|---------| ------------------------- | ------------------------- | | ||
| ✅ | WhatsAppService | API do WhatsApp Gratuita. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | Receita Data CNPJ | API Dados CNPJ Receita. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | Receita Data CPF | API Dados de CPF Serasa. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | CorreiosService | API Busca encomendas Correios Brazil. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | CEPLocation | API CEP Geolocation + IBGE Brazil. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | VehiclesService | API Placa Dados. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | FipeService | API Placa FIPE. | ⌛ | ⌛ | ⌛ | | ||
| Up | Services available | Description | Free | Beta | Stable | | ||
| --- | ------------------ | ------------------------------------- | ---- | ---- | ------ | | ||
| ✅ | WhatsAppService | API do WhatsApp Gratuita. | ✅ | ✅ | ⌛ | | ||
| ⌛ | Receita Data CNPJ | API Dados CNPJ Receita. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | Receita Data CPF | API Dados de CPF Serasa. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | CorreiosService | API Busca encomendas Correios Brazil. | ⌛ | ⌛ | ⌛ | | ||
| ⌛ | CEPLocation | API CEP Geolocation + IBGE Brazil. | ⌛ | ⌛ | ⌛ | | ||
| ✅ | VehiclesService | API Placa Dados. | ✅ | ✅ | ⌛ | | ||
| ⌛ | FipeService | API Placa FIPE. | ⌛ | ⌛ | ⌛ | | ||
## WhatsApp Service | ||
@@ -50,33 +52,18 @@ | ||
```javascript | ||
import { WhatsApp } from 'apigratis-sdk-nodejs'; | ||
import { createCpfApi } from 'apigratis-sdk-nodejs'; | ||
async function sendText() { | ||
const cpfApi = createCpfApi({ | ||
BearerToken: 'bearer_token', | ||
DeviceToken: 'device_token', | ||
SecretKey: 'secret_key', | ||
PublicToken: 'public_token', | ||
}); | ||
try { | ||
const response = await WhatsApp({ | ||
action: "sendText", | ||
credentials: { | ||
SecretKey: "SUA_CREDENCIAL", | ||
PublicToken: "SUA_CREDENCIAL", | ||
DeviceToken: "SUA_CREDENCIAL", | ||
BearerToken: "SUA_CREDENCIAL", | ||
}, | ||
body: { | ||
text: "Hello World por JavaScript", | ||
number: "5531994359434", | ||
time_typing: 1 | ||
} | ||
}); | ||
cpfApi | ||
.request('/', { | ||
cpf: '__CPF__', | ||
}) | ||
.then(resp => console.log(JSON.stringify(resp, undefined, ' '))); | ||
``` | ||
console.log(response); | ||
} catch (error) { | ||
console.log(response); | ||
} | ||
} | ||
sendText(); | ||
``` | ||
## Vehicles Service | ||
@@ -89,62 +76,37 @@ | ||
```javascript | ||
import { Vehicles } from 'apigratis-sdk-nodejs'; | ||
import { createVehiclesApi } from 'apigratis-sdk-nodejs'; | ||
//Obtenha dados de um veículo pela placa | ||
//Obtenha dados de um veículo pela placa | ||
async function dadosPorPlaca { | ||
try { | ||
const response = await Vehicles({ | ||
action: "dados", | ||
credentials: { | ||
SecretKey: "SUA_CREDENCIAL", | ||
PublicToken: "SUA_CREDENCIAL", | ||
DeviceToken: "SUA_CREDENCIAL", | ||
BearerToken: "SUA_CREDENCIAL", | ||
}, | ||
body: { | ||
placa: "OQH3065" | ||
} | ||
}); | ||
const vehiclesApi = createVehiclesApi({ | ||
BearerToken: 'bearer_token', | ||
DeviceToken: 'device_token', | ||
SecretKey: 'secret_key', | ||
PublicToken: 'public_token', | ||
}); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(response); | ||
} | ||
} | ||
dadosPorPlaca(); | ||
vehiclesApi | ||
.request('/dados', { | ||
placa: '__Placa__', | ||
}) | ||
.then(resp => console.log(JSON.stringify(resp, undefined, ' '))); | ||
``` | ||
```javascript | ||
import { Vehicles } from 'apigratis-sdk-nodejs'; | ||
import { createVehiclesApi } from 'apigratis-sdk-nodejs'; | ||
//Obtenha a TABELA FIPE de um veículo pela placa | ||
//Obtenha dados de um veículo pela placa | ||
async function fipePorPlaca { | ||
const vehiclesApi = createVehiclesApi({ | ||
BearerToken: 'bearer_token', | ||
DeviceToken: 'device_token', | ||
SecretKey: 'secret_key', | ||
PublicToken: 'public_token', | ||
}); | ||
try { | ||
const response = await Vehicles({ | ||
action: "fipe", | ||
credentials: { | ||
SecretKey: "SUA_CREDENCIAL", | ||
PublicToken: "SUA_CREDENCIAL", | ||
DeviceToken: "SUA_CREDENCIAL", | ||
BearerToken: "SUA_CREDENCIAL", | ||
}, | ||
body: { | ||
placa: "OQH3065" | ||
} | ||
}); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(response); | ||
} | ||
} | ||
fipePorPlaca(); | ||
``` | ||
vehiclesApi | ||
.request('/fipe', { | ||
placa: '__Placa__', | ||
}) | ||
.then(resp => console.log(JSON.stringify(resp, undefined, ' '))); | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
25698
13
0
310
1
2
5
110
+ Addedlink-module-alias@^1.2.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.6.8(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedlink-module-alias@1.2.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedaxios@0.25.0(transitive)
Updatedaxios@^1.4.0