Skip to content

Commit 6684890

Browse files
authored
Merge pull request #1 from jvoliveiraGN/main
Release 1.0
2 parents 72a6510 + e4f0d39 commit 6684890

File tree

79 files changed

+2122
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2122
-0
lines changed

.eslintrc.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"airbnb-base",
9+
"plugin:prettier/recommended",
10+
"prettier"
11+
],
12+
"globals": {
13+
"Atomics": "readonly",
14+
"SharedArrayBuffer": "readonly"
15+
},
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": {
18+
"ecmaVersion": 12,
19+
"sourceType": "module"
20+
},
21+
"plugins": [
22+
"@typescript-eslint",
23+
"prettier"
24+
],
25+
"rules": {
26+
27+
},
28+
"settings": {
29+
"import/resolver": {
30+
"node": {
31+
"paths": [
32+
"src",
33+
"examples"
34+
],
35+
"extensions": [
36+
".js",
37+
".jsx",
38+
".ts",
39+
".tsx"
40+
]
41+
}
42+
}
43+
}
44+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*.p12
3+
simulaMod.ts
4+
teste.ts

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"jsxBracketSameLine": true,
6+
"trailingComma": "es5",
7+
"semi": true
8+
}

examples/config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export = {
2+
// PRODUÇÃO = false
3+
// HOMOLOGAÇÃO = true
4+
sandbox: false,
5+
6+
// CREDENCIAIS DE PRODUÇÃO
7+
clientIdProducao: '',
8+
clientSecretProducao: '',
9+
pathCertProducao: '',
10+
11+
// CREDENCIAIS DE HOMOLOGAÇÃO
12+
clientIdHomologacao: '',
13+
clientSecretHomologacao: '',
14+
pathCertHomologacao: '',
15+
16+
// VALIDAR MTLS?
17+
validateMtls: false,
18+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const params = {
7+
id: 0,
8+
};
9+
10+
const gerencianet = Gerencianet(options);
11+
12+
gerencianet.cancelCarnet(params).then(console.log).catch(console.log).done();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const params = {
7+
id: 0,
8+
parcel: 1,
9+
};
10+
11+
const gerencianet = Gerencianet(options);
12+
13+
gerencianet.cancelParcel(params).then(console.log).catch(console.log).done();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const body = {
7+
items: [
8+
{
9+
name: 'Carnet Item 1',
10+
value: 1000,
11+
amount: 2,
12+
},
13+
],
14+
customer: {
15+
name: 'Gorbadoc Oldbuck',
16+
email: 'oldbuck@gerencianet.com.br',
17+
cpf: '94271564656',
18+
birth: '1977-01-15',
19+
phone_number: '5144916523',
20+
},
21+
repeats: 12,
22+
split_items: false,
23+
expire_at: '2022-01-05',
24+
};
25+
26+
const gerencianet = Gerencianet(options);
27+
28+
gerencianet.createCarnet({}, body).then(console.log).catch(console.log).done();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const params = {
7+
id: 1001,
8+
};
9+
10+
const body = {
11+
description: 'This carnet is about a service',
12+
};
13+
14+
const gerencianet = Gerencianet(options);
15+
16+
gerencianet.createCarnetHistory(params, body).then(console.log).catch(console.log).done();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const params = {
7+
id: 0,
8+
};
9+
10+
const gerencianet = Gerencianet(options);
11+
12+
gerencianet.detailCarnet(params).then(console.log).catch(console.log).done();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable import/extensions */
2+
/* eslint-disable import/no-unresolved */
3+
import Gerencianet from 'gn-api-sdk-typescript';
4+
import options from '../../config';
5+
6+
const params = {
7+
id: 1002,
8+
};
9+
10+
const body = {
11+
email: 'oldbuck@gerencianet.com.br',
12+
};
13+
14+
const gerencianet = Gerencianet(options);
15+
16+
gerencianet.resendCarnet(params, body).then(console.log).catch(console.log).done();

0 commit comments

Comments
 (0)