me_api 2.4.0 → 2.4.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.
- checksums.yaml +4 -4
- data/README.md +361 -30
- data/lib/me_api/client_production.rb +9 -6
- data/lib/me_api/version.rb +1 -1
- metadata +4 -6
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7a157a2a3242535623add2993dea63b287048dcd45691cbb44d17377f5a5af5
|
4
|
+
data.tar.gz: c80927031785a7827ad487d856be1ef02261df75f9b911bb7bb84bfdb4d3c36a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61316bca78dd2f5c8f59fb327460d76b83bfa1413c16f5acccd563b07ca29972c858cc9505d588fb063428da5bff3405837cded0bec65a5b8b3e50d478eb3a84
|
7
|
+
data.tar.gz: fac2d713021f43aff0d947b8614c3f7f074f51083c3ec253fe60c1892d76b8fa10061c2bdb218c5dd4ddeef69e8e38e46d72e3ae5ab1efde8f36bd0c8863a673
|
data/README.md
CHANGED
@@ -1,58 +1,389 @@
|
|
1
1
|
# MeApi
|
2
2
|
|
3
|
-
|
3
|
+
Uma gem Ruby para integração completa com a API do Melhor Envio, permitindo calcular fretes, criar etiquetas, gerenciar envios e muito mais de forma simples e eficiente.
|
4
|
+
|
5
|
+
[](https://badge.fury.io/rb/me_api)
|
4
6
|
|
5
7
|
[Documentação API Melhor Envio](https://docs.melhorenvio.com.br/reference/introducao-api-melhor-envio)
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
-
|
9
|
+
## Funcionalidades
|
10
|
+
|
11
|
+
- ✅ **Autenticação**: Authorization code e refresh token
|
12
|
+
- ✅ **Cotação de frete**: Calcular preços de envio
|
13
|
+
- ✅ **Gestão de etiquetas**: Criar, pagar, gerar e imprimir etiquetas
|
14
|
+
- ✅ **Consultas**: Dados da conta, saldo, pedidos
|
15
|
+
- ✅ **Suporte a sandbox**: Ambiente de testes
|
16
|
+
- ✅ **Classes auxiliares**: Volume e Product para facilitar o uso
|
10
17
|
|
11
18
|
## Instalação
|
12
19
|
|
13
|
-
|
20
|
+
Adicione esta linha ao Gemfile da sua aplicação:
|
14
21
|
|
15
22
|
```ruby
|
16
23
|
gem 'me_api'
|
17
24
|
```
|
18
|
-
ou
|
19
|
-
```shell
|
20
|
-
bundle add me_api
|
21
|
-
```
|
22
25
|
|
23
|
-
|
26
|
+
E então execute:
|
27
|
+
|
28
|
+
$ bundle install
|
29
|
+
|
30
|
+
Ou instale diretamente com:
|
31
|
+
|
32
|
+
$ gem install me_api
|
33
|
+
|
34
|
+
## Configuração
|
35
|
+
|
36
|
+
Para usar a gem, você precisa ter credenciais da API do Melhor Envio. Você pode obter essas credenciais criando uma aplicação no painel do desenvolvedor do Melhor Envio.
|
37
|
+
|
38
|
+
### Criando um cliente
|
39
|
+
|
40
|
+
A gem suporta dois modos de operação:
|
41
|
+
- **Produção**: Para uso em ambiente de produção
|
42
|
+
- **Sandbox**: Para testes (use `test_mode: true`)
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
# Cliente de produção
|
46
|
+
client = MeApi::Client.new(
|
47
|
+
access_token: "seu_access_token",
|
48
|
+
refresh_token: "seu_refresh_token",
|
49
|
+
client_id: "seu_client_id",
|
50
|
+
client_secret: "seu_client_secret",
|
51
|
+
token_expires_at: Time.now + 3600
|
52
|
+
)
|
24
53
|
|
25
|
-
|
26
|
-
|
54
|
+
# Cliente de sandbox/teste
|
55
|
+
client = MeApi::Client.new(
|
56
|
+
access_token: "seu_access_token",
|
57
|
+
refresh_token: "seu_refresh_token",
|
58
|
+
client_id: "seu_client_id",
|
59
|
+
client_secret: "seu_client_secret",
|
60
|
+
token_expires_at: Time.now + 3600,
|
61
|
+
test_mode: true
|
62
|
+
)
|
27
63
|
```
|
28
64
|
|
29
65
|
## Uso
|
30
66
|
|
31
|
-
###
|
32
|
-
|
67
|
+
### Formato das respostas
|
68
|
+
|
69
|
+
Todas as respostas dos métodos da API retornam objetos `AcObject` ou arrays de `AcObject`. Esses objetos permitem acesso aos dados de duas formas:
|
70
|
+
|
71
|
+
- **Notação de ponto**: `response.access_token`
|
72
|
+
- **Notação de hash**: `response["access_token"]`
|
73
|
+
- **Conversão para JSON**: `response.json` (retorna um hash Ruby)
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
# Exemplo com refresh_token
|
77
|
+
response = client.refresh_token(
|
78
|
+
client_id: "seu_client_id",
|
79
|
+
client_secret: "seu_client_secret",
|
80
|
+
refresh_token: "seu_refresh_token"
|
81
|
+
)
|
82
|
+
|
83
|
+
# Todas essas formas funcionam:
|
84
|
+
puts response.access_token # "novo_access_token"
|
85
|
+
puts response["access_token"] # "novo_access_token"
|
86
|
+
puts response.json["access_token"] # "novo_access_token"
|
87
|
+
|
88
|
+
# Para ver toda a resposta como hash
|
89
|
+
puts response.json
|
90
|
+
# => {"access_token"=>"...", "refresh_token"=>"...", "expires_in"=>21600, "token_type"=>"Bearer"}
|
91
|
+
```
|
92
|
+
|
93
|
+
### Autenticação
|
94
|
+
|
95
|
+
#### Autorizando uma aplicação
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
response = client.authorize(
|
99
|
+
client_id: "seu_client_id",
|
100
|
+
client_secret: "seu_client_secret",
|
101
|
+
code: "codigo_retornado_pela_api",
|
102
|
+
redirect_url: "sua_url_de_redirect"
|
103
|
+
)
|
104
|
+
|
105
|
+
# Acessando dados da resposta
|
106
|
+
puts response.access_token # "abcde12345"
|
107
|
+
puts response.refresh_token # "asdfghjk123456"
|
108
|
+
puts response.expires_in # 21600
|
109
|
+
puts response.token_type # "Bearer"
|
110
|
+
|
111
|
+
# Ou usando notação de hash
|
112
|
+
puts response["access_token"] # "abcde12345"
|
113
|
+
puts response["refresh_token"] # "asdfghjk123456"
|
114
|
+
```
|
115
|
+
|
116
|
+
#### Renovando token
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
response = client.refresh_token(
|
120
|
+
client_id: "seu_client_id",
|
121
|
+
client_secret: "seu_client_secret",
|
122
|
+
refresh_token: "seu_refresh_token"
|
123
|
+
)
|
124
|
+
|
125
|
+
# Acessando dados da resposta
|
126
|
+
puts response.access_token # "novo_access_token"
|
127
|
+
puts response.refresh_token # "novo_refresh_token"
|
128
|
+
puts response.token_type # "Bearer"
|
129
|
+
```
|
130
|
+
|
131
|
+
### Cotação de frete
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
# Criar objeto de volume/dimensões
|
135
|
+
volume = MeApi::Volume.new(
|
136
|
+
width_cm: 20,
|
137
|
+
height_cm: 15,
|
138
|
+
length_cm: 30,
|
139
|
+
weight_kg: 1.5
|
140
|
+
)
|
141
|
+
|
142
|
+
# Calcular frete (retorna array de AcObject)
|
143
|
+
rates = client.rates(
|
144
|
+
from_postal_code: "13870329",
|
145
|
+
to_postal_code: "88063500",
|
146
|
+
volume: volume,
|
147
|
+
contents_value_brl: 50.00
|
148
|
+
)
|
149
|
+
|
150
|
+
# Acessando dados do primeiro resultado
|
151
|
+
puts rates.first.price # Preço do frete mais barato
|
152
|
+
puts rates.first.service_name # Nome do serviço (ex: "PAC")
|
153
|
+
puts rates.first.carrier_name # Nome da transportadora (ex: "Correios")
|
154
|
+
|
155
|
+
# Ou usando notação de hash
|
156
|
+
puts rates.first["price"] # Preço do frete
|
157
|
+
puts rates.first["service_name"] # Nome do serviço
|
158
|
+
```
|
159
|
+
|
160
|
+
### Gestão de produtos e volumes
|
161
|
+
|
162
|
+
#### Criando produtos
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
products = [
|
166
|
+
MeApi::Product.new(
|
167
|
+
name: "Produto A",
|
168
|
+
quantity: 2,
|
169
|
+
unitary_value: 25.00
|
170
|
+
),
|
171
|
+
MeApi::Product.new(
|
172
|
+
name: "Produto B",
|
173
|
+
quantity: 1,
|
174
|
+
unitary_value: 50.00
|
175
|
+
)
|
176
|
+
]
|
177
|
+
```
|
178
|
+
|
179
|
+
#### Criando volumes
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
volumes = [
|
183
|
+
MeApi::Volume.new(
|
184
|
+
width_cm: 20,
|
185
|
+
height_cm: 15,
|
186
|
+
length_cm: 30,
|
187
|
+
weight_kg: 1.5
|
188
|
+
)
|
189
|
+
]
|
190
|
+
```
|
191
|
+
|
192
|
+
### Gestão de etiquetas
|
193
|
+
|
194
|
+
#### Adicionando etiqueta ao carrinho
|
195
|
+
|
196
|
+
```ruby
|
197
|
+
response = client.add_label_to_cart(
|
198
|
+
service_id: 1, # ID do serviço de entrega
|
199
|
+
from_name: "Remetente",
|
200
|
+
from_phone: "(11) 99999-9999",
|
201
|
+
from_email: "remetente@email.com",
|
202
|
+
from_address: "Rua do Remetente",
|
203
|
+
from_address_complement: "Apto 123",
|
204
|
+
from_address_number: "100",
|
205
|
+
from_address_district: "Centro",
|
206
|
+
from_address_city: "São Paulo",
|
207
|
+
from_postal_code: "01000000",
|
208
|
+
from_address_state_abbr: "SP",
|
209
|
+
from_tax_id: "12345678901", # CPF ou CNPJ
|
210
|
+
to_name: "Destinatário",
|
211
|
+
to_phone: "(11) 88888-8888",
|
212
|
+
to_email: "destinatario@email.com",
|
213
|
+
to_address: "Rua do Destinatário",
|
214
|
+
to_address_complement: "",
|
215
|
+
to_address_number: "200",
|
216
|
+
to_address_district: "Vila Nova",
|
217
|
+
to_address_city: "Rio de Janeiro",
|
218
|
+
to_postal_code: "20000000",
|
219
|
+
to_address_state_abbr: "RJ",
|
220
|
+
to_tax_id: "98765432109", # CPF ou CNPJ
|
221
|
+
products: products,
|
222
|
+
volumes: volumes,
|
223
|
+
insurance_value: 100.00
|
224
|
+
)
|
225
|
+
|
226
|
+
# Acessando dados da resposta
|
227
|
+
order_id = response.id # ID do pedido
|
228
|
+
puts response.protocol # Protocolo do pedido
|
229
|
+
puts response["status"] # Status do pedido
|
230
|
+
```
|
231
|
+
|
232
|
+
#### Pagando etiqueta
|
233
|
+
|
234
|
+
```ruby
|
235
|
+
payment_response = client.pay_label(order_id)
|
236
|
+
puts payment_response.purchase_id # ID da compra
|
237
|
+
puts payment_response["digitable_line"] # Linha digitável (se boleto)
|
238
|
+
```
|
239
|
+
|
240
|
+
#### Gerando etiqueta
|
241
|
+
|
33
242
|
```ruby
|
34
|
-
|
35
|
-
#
|
36
|
-
puts api_client["access_token"] # string -> "abcde12345"
|
37
|
-
puts api_client["refresh_token"] # string -> "asdfghjk123456"
|
38
|
-
puts api_client["expires_in"] # integer -> 216000
|
243
|
+
generate_response = client.generate_label(order_id)
|
244
|
+
puts generate_response["status"] # Status da geração
|
39
245
|
```
|
40
246
|
|
41
|
-
####
|
247
|
+
#### Imprimindo etiqueta
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
pdf_response = client.print_label(order_id)
|
251
|
+
puts pdf_response.first # URL do PDF da etiqueta
|
252
|
+
```
|
253
|
+
|
254
|
+
### Consultas
|
255
|
+
|
256
|
+
#### Dados da conta
|
257
|
+
|
42
258
|
```ruby
|
43
|
-
|
44
|
-
#
|
45
|
-
puts
|
46
|
-
puts
|
47
|
-
puts
|
259
|
+
account = client.get_account_data
|
260
|
+
puts account.firstname # Nome do usuário
|
261
|
+
puts account.email # Email da conta
|
262
|
+
puts account["document"] # CPF/CNPJ da conta
|
263
|
+
puts account.json # Todos os dados como hash
|
48
264
|
```
|
49
265
|
|
50
|
-
####
|
266
|
+
#### Saldo disponível
|
267
|
+
|
268
|
+
```ruby
|
269
|
+
balance = client.get_balance
|
270
|
+
puts balance.current # Saldo atual
|
271
|
+
puts balance["currency"] # Moeda (BRL)
|
272
|
+
```
|
273
|
+
|
274
|
+
#### Detalhes de um pedido
|
275
|
+
|
51
276
|
```ruby
|
52
|
-
|
277
|
+
order = client.get_label(order_id)
|
278
|
+
puts order.status # Status do pedido
|
279
|
+
puts order.tracking # Código de rastreamento
|
280
|
+
puts order["service_name"] # Nome do serviço utilizado
|
281
|
+
puts order.json # Todos os dados do pedido
|
282
|
+
```
|
283
|
+
|
284
|
+
## Classes auxiliares
|
285
|
+
|
286
|
+
### MeApi::Volume
|
287
|
+
|
288
|
+
Representa as dimensões e peso de um pacote:
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
volume = MeApi::Volume.new(
|
292
|
+
width_cm: 20, # Largura em centímetros
|
293
|
+
height_cm: 15, # Altura em centímetros
|
294
|
+
length_cm: 30, # Comprimento em centímetros
|
295
|
+
weight_kg: 1.5 # Peso em quilogramas
|
296
|
+
)
|
297
|
+
|
298
|
+
# Converte para formato da API
|
299
|
+
volume.to_api_format
|
300
|
+
# => { width: 20, height: 15, length: 30, weight: 1.5 }
|
301
|
+
```
|
302
|
+
|
303
|
+
### MeApi::Product
|
304
|
+
|
305
|
+
Representa um produto a ser enviado:
|
306
|
+
|
307
|
+
```ruby
|
308
|
+
product = MeApi::Product.new(
|
309
|
+
name: "Nome do produto", # Nome do produto
|
310
|
+
quantity: 2, # Quantidade
|
311
|
+
unitary_value: 25.00 # Valor unitário em reais
|
312
|
+
)
|
313
|
+
|
314
|
+
# Converte para formato da API
|
315
|
+
product.to_api_format
|
316
|
+
# => { name: "Nome do produto", quantity: 2, unitary_value: 25.0 }
|
317
|
+
```
|
318
|
+
|
319
|
+
## Exemplo completo
|
320
|
+
|
321
|
+
```ruby
|
322
|
+
require 'me_api'
|
323
|
+
|
324
|
+
# Configurar cliente
|
325
|
+
client = MeApi::Client.new(
|
326
|
+
access_token: "seu_access_token",
|
327
|
+
refresh_token: "seu_refresh_token",
|
328
|
+
client_id: "seu_client_id",
|
329
|
+
client_secret: "seu_client_secret",
|
330
|
+
token_expires_at: Time.now + 3600
|
331
|
+
)
|
332
|
+
|
333
|
+
# Calcular frete
|
334
|
+
volume = MeApi::Volume.new(width_cm: 20, height_cm: 15, length_cm: 30, weight_kg: 1.5)
|
335
|
+
rates = client.rates(
|
336
|
+
from_postal_code: "13870329",
|
337
|
+
to_postal_code: "88063500",
|
338
|
+
volume: volume,
|
339
|
+
contents_value_brl: 50.00
|
340
|
+
)
|
341
|
+
|
342
|
+
puts "Melhor preço: R$ #{rates.first.price}"
|
343
|
+
puts "Serviço: #{rates.first.service_name}"
|
344
|
+
|
345
|
+
# Criar pedido
|
346
|
+
products = [MeApi::Product.new(name: "Produto A", quantity: 1, unitary_value: 50.00)]
|
347
|
+
volumes = [volume]
|
348
|
+
|
349
|
+
response = client.add_label_to_cart(
|
350
|
+
service_id: rates.first.id,
|
351
|
+
from_name: "Loja Online",
|
352
|
+
from_phone: "(11) 99999-9999",
|
353
|
+
from_email: "loja@email.com",
|
354
|
+
from_address: "Rua da Loja",
|
355
|
+
from_address_number: "123",
|
356
|
+
from_address_district: "Centro",
|
357
|
+
from_address_city: "São Paulo",
|
358
|
+
from_postal_code: "13870329",
|
359
|
+
from_address_state_abbr: "SP",
|
360
|
+
from_tax_id: "12345678000123",
|
361
|
+
to_name: "João Silva",
|
362
|
+
to_phone: "(11) 88888-8888",
|
363
|
+
to_email: "joao@email.com",
|
364
|
+
to_address: "Rua do Cliente",
|
365
|
+
to_address_number: "456",
|
366
|
+
to_address_district: "Vila Nova",
|
367
|
+
to_address_city: "Florianópolis",
|
368
|
+
to_postal_code: "88063500",
|
369
|
+
to_address_state_abbr: "SC",
|
370
|
+
to_tax_id: "98765432109",
|
371
|
+
products: products,
|
372
|
+
volumes: volumes,
|
373
|
+
insurance_value: 50.00
|
374
|
+
)
|
375
|
+
|
376
|
+
order_id = response.id # Usando notação de ponto
|
377
|
+
puts "Pedido criado: #{response.protocol}"
|
378
|
+
|
379
|
+
# Pagar e gerar etiqueta
|
380
|
+
payment = client.pay_label(order_id)
|
381
|
+
puts "Pagamento: #{payment.purchase_id}"
|
53
382
|
|
54
|
-
|
55
|
-
puts
|
383
|
+
generate = client.generate_label(order_id)
|
384
|
+
puts "Status geração: #{generate.status}"
|
56
385
|
|
57
|
-
|
386
|
+
# Obter URL do PDF
|
387
|
+
pdf_response = client.print_label(order_id)
|
388
|
+
puts "Etiqueta: #{pdf_response.first}"
|
58
389
|
```
|
@@ -3,24 +3,27 @@ module MeApi
|
|
3
3
|
BASE_URL = "https://melhorenvio.com.br"
|
4
4
|
SAVE_RESPONSES = true
|
5
5
|
|
6
|
-
|
7
|
-
def initialize(access_token: nil,
|
6
|
+
attr_accessor :refresh, :client_id, :client_secret, :token_expires_at, :test_mode
|
7
|
+
def initialize(access_token: nil, refresh: nil, client_id:, client_secret:, token_expires_at:, test_mode: false)
|
8
8
|
@access_token = access_token
|
9
|
-
@
|
9
|
+
@refresh = refresh
|
10
10
|
@client_id = client_id
|
11
11
|
@client_secret = client_secret
|
12
12
|
@test_mode = test_mode
|
13
13
|
@token_expires_at = token_expires_at
|
14
14
|
end
|
15
15
|
|
16
|
-
def refresh_token
|
16
|
+
def refresh_token
|
17
17
|
body = {
|
18
18
|
grant_type: "refresh_token",
|
19
19
|
client_id: client_id,
|
20
20
|
client_secret: client_secret,
|
21
|
-
refresh_token:
|
21
|
+
refresh_token: refresh
|
22
22
|
}
|
23
|
-
post("/oauth/token", body:, skip_authentication: true)
|
23
|
+
response = post("/oauth/token", body:, skip_authentication: true)
|
24
|
+
@access_token = response.access_token
|
25
|
+
@refresh = response.refresh_token
|
26
|
+
@token_expires_at = Time.now + response.expires_in.to_i
|
24
27
|
end
|
25
28
|
|
26
29
|
def authorize client_id:, client_secret:, code:, redirect_url:
|
data/lib/me_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: me_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todas Essas Coisas
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-08-
|
10
|
+
date: 2025-08-05 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ac
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 1.1.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 1.1.0
|
26
26
|
email:
|
27
27
|
- contato7bulloleo@gmail.com
|
28
28
|
executables: []
|
@@ -30,8 +30,6 @@ extensions: []
|
|
30
30
|
extra_rdoc_files: []
|
31
31
|
files:
|
32
32
|
- ".standard.yml"
|
33
|
-
- CHANGELOG.md
|
34
|
-
- CODE_OF_CONDUCT.md
|
35
33
|
- LICENSE.txt
|
36
34
|
- README.md
|
37
35
|
- Rakefile
|
data/CHANGELOG.md
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
-
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
-
|
9
|
-
## Our Standards
|
10
|
-
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
-
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
-
|
19
|
-
Examples of unacceptable behavior include:
|
20
|
-
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
22
|
-
advances of any kind
|
23
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
-
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or email
|
26
|
-
address, without their explicit permission
|
27
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
-
professional setting
|
29
|
-
|
30
|
-
## Enforcement Responsibilities
|
31
|
-
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
-
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
-
|
36
|
-
## Scope
|
37
|
-
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
-
|
40
|
-
## Enforcement
|
41
|
-
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at contato7bulloleo@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
-
|
44
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
-
|
46
|
-
## Enforcement Guidelines
|
47
|
-
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
-
|
50
|
-
### 1. Correction
|
51
|
-
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
-
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
-
|
56
|
-
### 2. Warning
|
57
|
-
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
-
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
-
|
62
|
-
### 3. Temporary Ban
|
63
|
-
|
64
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
-
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
-
|
68
|
-
### 4. Permanent Ban
|
69
|
-
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
-
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
-
|
74
|
-
## Attribution
|
75
|
-
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
-
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
-
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
82
|
-
|
83
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|