@diegofemello/bitbot-types 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +173 -153
- package/package.json +52 -52
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Diego Mello
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Diego Mello
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,153 +1,173 @@
|
|
|
1
|
-
# BitBot Types
|
|
2
|
-
|
|
3
|
-
Interfaces e tipos compartilhados do Bit Bot - Uma biblioteca TypeScript profissional para desenvolvimento de bots Discord.
|
|
4
|
-
|
|
5
|
-
## 📦 Instalação
|
|
6
|
-
|
|
7
|
-
### Via NPM (Recomendado)
|
|
8
|
-
```bash
|
|
9
|
-
npm install @diegofemello/bitbot-types
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
### Via Yarn
|
|
13
|
-
```bash
|
|
14
|
-
yarn add @diegofemello/bitbot-types
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Via GitHub (Desenvolvimento)
|
|
18
|
-
```bash
|
|
19
|
-
npm install github:diegofemello/bitbot-types#master
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 🚀 Uso
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// Importando interfaces e enums específicos
|
|
26
|
-
import { User, Bot, Card, Pokemon, Auction, UserRole, CommandIndex } from '@diegofemello/bitbot-types';
|
|
27
|
-
|
|
28
|
-
// Importando tudo
|
|
29
|
-
import * as BitBotTypes from '@diegofemello/bitbot-types';
|
|
30
|
-
|
|
31
|
-
// Exemplos de uso
|
|
32
|
-
const user: BitBotTypes.User = {
|
|
33
|
-
// ... propriedades do usuário
|
|
34
|
-
roles: [UserRole.User, UserRole.Vip]
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const command = CommandIndex.abracar;
|
|
38
|
-
|
|
39
|
-
const card: BitBotTypes.Card = {
|
|
40
|
-
// ... propriedades do card
|
|
41
|
-
};
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## 📋 Interfaces Disponíveis
|
|
45
|
-
|
|
46
|
-
| Interface | Descrição |
|
|
47
|
-
|-----------|-----------|
|
|
48
|
-
| `User` | Interface do usuário do bot |
|
|
49
|
-
| `Bot` | Interface de configuração do bot |
|
|
50
|
-
| `Card` | Interface de cartas colecionáveis |
|
|
51
|
-
| `Pokemon` | Interface de Pokémon |
|
|
52
|
-
| `Auction` | Interface de leilões |
|
|
53
|
-
| `Tournament` | Interface de torneios |
|
|
54
|
-
| `RPGPlayer` | Interface do jogador RPG |
|
|
55
|
-
| `Raid` | Interface de raids |
|
|
56
|
-
| `Group` | Interface de grupos |
|
|
57
|
-
| E muitas outras... | Veja todos os tipos no [código fonte](./src/interfaces/) |
|
|
58
|
-
|
|
59
|
-
## 🎮 Enums Disponíveis
|
|
60
|
-
|
|
61
|
-
| Enum | Descrição | Valores |
|
|
62
|
-
|------|-----------|---------|
|
|
63
|
-
| `CommandIndex` | Índice de comandos do bot | `abracar`, `addgrupo`, `atividade`, etc. |
|
|
64
|
-
| `UserRole` | Níveis de acesso do usuário | `User`, `Admin`, `GameMaster`, `SuperAdmin`, `Moderator`, `Vip` |
|
|
65
|
-
|
|
66
|
-
## ✅ Testando a Instalação
|
|
67
|
-
|
|
68
|
-
Para testar se a instalação funcionou corretamente, você pode criar um arquivo de teste:
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// test.ts
|
|
72
|
-
import { User, CommandIndex, Card, Pokemon, UserRole } from '@diegofemello/bitbot-types';
|
|
73
|
-
|
|
74
|
-
// Teste de enum
|
|
75
|
-
console.log('Comando:', CommandIndex.abracar);
|
|
76
|
-
console.log('Role:', UserRole.Admin);
|
|
77
|
-
|
|
78
|
-
// Teste de interface
|
|
79
|
-
const user: User = {
|
|
80
|
-
id: '123',
|
|
81
|
-
roles: [UserRole.User],
|
|
82
|
-
// ... outras propriedades
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
console.log('Tipos importados com sucesso!');
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## 🛠️ Desenvolvimento
|
|
89
|
-
|
|
90
|
-
### Para contribuir com este projeto:
|
|
91
|
-
|
|
92
|
-
1. **Clone o repositório**
|
|
93
|
-
```bash
|
|
94
|
-
git clone https://github.com/diegofemello/bitbot-types.git
|
|
95
|
-
cd bitbot-types
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
2. **Instale as dependências**
|
|
99
|
-
```bash
|
|
100
|
-
npm install
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
3. **Faça suas alterações nos arquivos TypeScript**
|
|
104
|
-
- Edite os arquivos em `src/interfaces/` ou `src/enum/`
|
|
105
|
-
|
|
106
|
-
4. **Compile
|
|
107
|
-
```bash
|
|
108
|
-
npm run build
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
##
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
# BitBot Types
|
|
2
|
+
|
|
3
|
+
Interfaces e tipos compartilhados do Bit Bot - Uma biblioteca TypeScript profissional para desenvolvimento de bots Discord.
|
|
4
|
+
|
|
5
|
+
## 📦 Instalação
|
|
6
|
+
|
|
7
|
+
### Via NPM (Recomendado)
|
|
8
|
+
```bash
|
|
9
|
+
npm install @diegofemello/bitbot-types
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Via Yarn
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @diegofemello/bitbot-types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Via GitHub (Desenvolvimento)
|
|
18
|
+
```bash
|
|
19
|
+
npm install github:diegofemello/bitbot-types#master
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 🚀 Uso
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// Importando interfaces e enums específicos
|
|
26
|
+
import { User, Bot, Card, Pokemon, Auction, UserRole, CommandIndex } from '@diegofemello/bitbot-types';
|
|
27
|
+
|
|
28
|
+
// Importando tudo
|
|
29
|
+
import * as BitBotTypes from '@diegofemello/bitbot-types';
|
|
30
|
+
|
|
31
|
+
// Exemplos de uso
|
|
32
|
+
const user: BitBotTypes.User = {
|
|
33
|
+
// ... propriedades do usuário
|
|
34
|
+
roles: [UserRole.User, UserRole.Vip]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const command = CommandIndex.abracar;
|
|
38
|
+
|
|
39
|
+
const card: BitBotTypes.Card = {
|
|
40
|
+
// ... propriedades do card
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 📋 Interfaces Disponíveis
|
|
45
|
+
|
|
46
|
+
| Interface | Descrição |
|
|
47
|
+
|-----------|-----------|
|
|
48
|
+
| `User` | Interface do usuário do bot |
|
|
49
|
+
| `Bot` | Interface de configuração do bot |
|
|
50
|
+
| `Card` | Interface de cartas colecionáveis |
|
|
51
|
+
| `Pokemon` | Interface de Pokémon |
|
|
52
|
+
| `Auction` | Interface de leilões |
|
|
53
|
+
| `Tournament` | Interface de torneios |
|
|
54
|
+
| `RPGPlayer` | Interface do jogador RPG |
|
|
55
|
+
| `Raid` | Interface de raids |
|
|
56
|
+
| `Group` | Interface de grupos |
|
|
57
|
+
| E muitas outras... | Veja todos os tipos no [código fonte](./src/interfaces/) |
|
|
58
|
+
|
|
59
|
+
## 🎮 Enums Disponíveis
|
|
60
|
+
|
|
61
|
+
| Enum | Descrição | Valores |
|
|
62
|
+
|------|-----------|---------|
|
|
63
|
+
| `CommandIndex` | Índice de comandos do bot | `abracar`, `addgrupo`, `atividade`, etc. |
|
|
64
|
+
| `UserRole` | Níveis de acesso do usuário | `User`, `Admin`, `GameMaster`, `SuperAdmin`, `Moderator`, `Vip` |
|
|
65
|
+
|
|
66
|
+
## ✅ Testando a Instalação
|
|
67
|
+
|
|
68
|
+
Para testar se a instalação funcionou corretamente, você pode criar um arquivo de teste:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// test.ts
|
|
72
|
+
import { User, CommandIndex, Card, Pokemon, UserRole } from '@diegofemello/bitbot-types';
|
|
73
|
+
|
|
74
|
+
// Teste de enum
|
|
75
|
+
console.log('Comando:', CommandIndex.abracar);
|
|
76
|
+
console.log('Role:', UserRole.Admin);
|
|
77
|
+
|
|
78
|
+
// Teste de interface
|
|
79
|
+
const user: User = {
|
|
80
|
+
id: '123',
|
|
81
|
+
roles: [UserRole.User],
|
|
82
|
+
// ... outras propriedades
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
console.log('Tipos importados com sucesso!');
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 🛠️ Desenvolvimento
|
|
89
|
+
|
|
90
|
+
### Para contribuir com este projeto:
|
|
91
|
+
|
|
92
|
+
1. **Clone o repositório**
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/diegofemello/bitbot-types.git
|
|
95
|
+
cd bitbot-types
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
2. **Instale as dependências**
|
|
99
|
+
```bash
|
|
100
|
+
npm install
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Faça suas alterações nos arquivos TypeScript**
|
|
104
|
+
- Edite os arquivos em `src/interfaces/` ou `src/enum/`
|
|
105
|
+
|
|
106
|
+
4. **Compile e teste localmente**
|
|
107
|
+
```bash
|
|
108
|
+
npm run build
|
|
109
|
+
npm test
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
5. **Faça commit e push das mudanças**
|
|
113
|
+
```bash
|
|
114
|
+
git add .
|
|
115
|
+
git commit -m "Descrição das mudanças"
|
|
116
|
+
git push origin master
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
6. **📦 Publicação Automática**
|
|
120
|
+
- O GitHub Actions irá automaticamente:
|
|
121
|
+
- Fazer build do projeto
|
|
122
|
+
- Executar testes
|
|
123
|
+
- Publicar no NPM (se a versão não existir)
|
|
124
|
+
- Criar uma release no GitHub
|
|
125
|
+
|
|
126
|
+
### Scripts Disponíveis
|
|
127
|
+
|
|
128
|
+
- `npm run build` - Compila o TypeScript
|
|
129
|
+
- `npm run clean` - Remove o diretório dist
|
|
130
|
+
- `npm test` - Executa os testes
|
|
131
|
+
- `npm run prepare` - Build automático antes de install
|
|
132
|
+
|
|
133
|
+
### 🔄 CI/CD com GitHub Actions
|
|
134
|
+
|
|
135
|
+
Este projeto utiliza GitHub Actions para:
|
|
136
|
+
|
|
137
|
+
- ✅ **Build automático** a cada push/PR
|
|
138
|
+
- ✅ **Testes** em múltiplas versões do Node.js (18.x, 20.x)
|
|
139
|
+
- ✅ **Publicação automática** no NPM quando há push na master
|
|
140
|
+
- ✅ **Criação de releases** automáticas no GitHub
|
|
141
|
+
- ✅ **Verificação de versão** - só publica se a versão não existir
|
|
142
|
+
|
|
143
|
+
## 📝 Versionamento
|
|
144
|
+
|
|
145
|
+
Para publicar uma nova versão:
|
|
146
|
+
|
|
147
|
+
1. **Atualize a versão no package.json manualmente**
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"version": "1.0.1" // ou 1.1.0, 2.0.0, etc.
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
2. **Faça commit e push**
|
|
155
|
+
```bash
|
|
156
|
+
git add package.json
|
|
157
|
+
git commit -m "Bump version to 1.0.1"
|
|
158
|
+
git push origin master
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
3. **A publicação será automática** via GitHub Actions
|
|
162
|
+
|
|
163
|
+
## 📄 Licença
|
|
164
|
+
|
|
165
|
+
MIT - Veja o arquivo [LICENSE](LICENSE) para mais detalhes.
|
|
166
|
+
|
|
167
|
+
## 🤝 Contribuição
|
|
168
|
+
|
|
169
|
+
Contribuições são bem-vindas! Por favor, abra uma issue ou faça um pull request.
|
|
170
|
+
|
|
171
|
+
## 📞 Suporte
|
|
172
|
+
|
|
173
|
+
Se você encontrar algum problema ou tiver dúvidas, por favor [abra uma issue](https://github.com/diegofemello/bitbot-types/issues) no GitHub.
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@diegofemello/bitbot-types",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Interfaces e tipos compartilhados do Bit Bot",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Diego Mello <diegofemello@example.com>",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/diegofemello/bitbot-types.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/diegofemello/bitbot-types/issues"
|
|
13
|
-
},
|
|
14
|
-
"homepage": "https://github.com/diegofemello/bitbot-types#readme",
|
|
15
|
-
"types": "dist/index.d.ts",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"module": "dist/index.js",
|
|
18
|
-
"exports": {
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"default": "./dist/index.js"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsc --project tsconfig.json",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"typescript",
|
|
35
|
-
"types",
|
|
36
|
-
"interfaces",
|
|
37
|
-
"bitbot",
|
|
38
|
-
"discord",
|
|
39
|
-
"bot",
|
|
40
|
-
"gaming"
|
|
41
|
-
],
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"rimraf": "^5.0.10",
|
|
44
|
-
"typescript": "^5.0.0"
|
|
45
|
-
},
|
|
46
|
-
"engines": {
|
|
47
|
-
"node": ">=16.0.0"
|
|
48
|
-
},
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"access": "public"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@diegofemello/bitbot-types",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Interfaces e tipos compartilhados do Bit Bot",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Diego Mello <diegofemello@example.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/diegofemello/bitbot-types.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/diegofemello/bitbot-types/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/diegofemello/bitbot-types#readme",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"module": "dist/index.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc --project tsconfig.json",
|
|
29
|
+
"test": "echo \"No tests specified\"",
|
|
30
|
+
"clean": "rimraf dist",
|
|
31
|
+
"prepare": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"typescript",
|
|
35
|
+
"types",
|
|
36
|
+
"interfaces",
|
|
37
|
+
"bitbot",
|
|
38
|
+
"discord",
|
|
39
|
+
"bot",
|
|
40
|
+
"gaming"
|
|
41
|
+
],
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"rimraf": "^5.0.10",
|
|
44
|
+
"typescript": "^5.0.0"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=16.0.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|