Skip to content

Commit 9559308

Browse files
committed
translate public_api to pt-br
1 parent 64bc958 commit 9559308

File tree

1 file changed

+68
-69
lines changed

1 file changed

+68
-69
lines changed

developer_docs/pt-br/public_api.md

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
# Public API
1+
# API Pública
22

3-
This API provides a way to programmatically import data into the p5.js Web Editor.
3+
Essa API provê uma forma de importar informações para o p5.js Web Editor de forma programática.
44

5-
# Authentication
5+
# Authenticação
66

7-
Access to the API is available via a Personal Access Token, linked to an existing editor user account. Tokens can be created and deleted via logged-in user’s Settings page.
7+
Acesso à API está disponível via um Token de Acesso Pessoal, relacionado à uma conta de editor existente. Tokens podem ser criados e deletados na tela de Configurações de um usuário loggado.
88

9-
When contacting the API, the username and token must be sent with every request using basic auth.
9+
Quando entrar em contato com a API, o nome de usuário e token devem ser enviados em todas requisições usando autenticação básica.
1010

11-
This involved sending the base64 encoded `${username}:${personalAccessToken}` in the `Authorization` header. For example:
11+
Isso envolve enviar o base64 codificado `${username}:${personalAccessToken}` no header `Authorization`, Por exemplo:
1212
`Authorization: Basic cDU6YWJjMTIzYWJj`
1313

14-
# API Access
14+
# Acesso à API
1515

16-
- All requests send and receive `Content-Type: application/json` unless otherwise stated
16+
- Toda requisição envia e recebe `Content-Type: application/json` a não ser que seja declarado o contrário
1717

18-
# Versioning
18+
# Versionamento
1919

20-
The API is versioned and this version is indicated in the root URL path e.g. version 1 of the API can be found at `http://editor.p5js.org/api/v1`.
20+
A API é versionada e essa versão está indicada no caminho raíz da URL e.g. a versão 1 da API pode ser encontrada em `http://editor.p5js.org/api/v1`.
2121

22-
You must provide the version number when accessing the API.
22+
Você deve fornecer o número da versão quando acessar a API.
2323

24-
| Version | Release date |
25-
| ------- | ------------ |
26-
| v1 | Unreleased |
24+
| Versão | Data de lançamento |
25+
| ------ | ------------------ |
26+
| v1 | Não lançado |
2727

2828
# Models
2929

30-
The API accepts and returns the following model objects, as JSON.
30+
A API aceita e retorna as seguintes Models como JSON.
3131

3232
## Sketch
3333

34-
| Name | Type | Description |
35-
| ----- | ----------------- | ------------------------------------------------------------------------------------ |
36-
| name | String | The sketch’s title |
37-
| files | DirectoryContents | The files and directories in this sketch. See `DirectoryContents` for the structure. |
38-
| slug | String | A path that can be used to access the sketch |
34+
| Nome | Tipo | Descrição |
35+
| ----- | ----------------- | ------------------------------------------------------------------------------ |
36+
| name | String | O título do esboço |
37+
| files | DirectoryContents | Os arquivos e diretórios no esboço. Veja `DirectoryContents` para a estrutura. |
38+
| slug | String | Um caminho que pode ser usado para acessar o esboço |
3939

4040

4141
{
@@ -45,16 +45,15 @@ The API accepts and returns the following model objects, as JSON.
4545
"slug": String // optional
4646
}
4747

48-
### Validations
48+
### Validações
4949

50-
- `files` must have exactly one top-level file with the `.html` extension. If none is provided, then a default `index.html` and associated `style.css` will be automatically created.
51-
- `slug` must be an URL-safe string
52-
- `slug` must be unique across all user's sketches
50+
- `files` devem ter exatamente exatamente um arquivo no nível mais alto com a extenção `.html`. Se nenhum for fornecido um `index.html` padrão e um `style.css` associado serão automaticamente criados.
51+
- `slug` deve ser uma string segura pra URL
52+
- `slug` deve ser única entre todos os esboços do usuário
5353

5454
## DirectoryContents
5555

56-
A map of filenames to `File` or `Directory`. The key of each item is used as the filename. Using a map ensures that filenames are unique in the directory.
57-
56+
Um map de nomes de arquivo para `File` ou `Directory`. A chave para cada item é usada como nome do arquivo. Usar um map assegura que nomes de arquivo sejam únicos no diretório.
5857

5958
{
6059
[String]: File | Directory
@@ -68,62 +67,62 @@ A map of filenames to `File` or `Directory`. The key of each item is used as the
6867

6968
## DirectFile
7069

71-
This file is editable in the Editor UI and stored in the Editor's database.
70+
Isso é editável na interfáce do editor e guardada no bando de dados do Editor.
7271

73-
| Name | Type | Description |
74-
| ------- | ------------ | ------------------------------------------ |
75-
| content | UTF-8 String | The contents of the file as a UTF-8 string |
72+
| Nome | Tipo | Descrição |
73+
| ------- | ------------ | ------------------------------------------- |
74+
| content | UTF-8 String | O conteúdo do arquivo como uma UTF-8 string |
7675

7776
{
7877
"content": String
7978
}
8079

8180
## ReferencedFile
8281

83-
This file is hosted elsewhere on the Internet. It appears in the Editor's listing and can be referenced using a proxy URL in the Editor.
82+
Esse arquivo é hospedado em outro lugar na Internet. Ele aparece na listagem do Editor e pode ser referenciado usando um proxy URL no Editor.
8483

8584

86-
| Name | Type | Description |
87-
| ---- | ---- | ----------------------------------------------- |
88-
| url | URL | A valid URL pointing to a file hosted elsewhere |
85+
| Nome | Tipo | Descrição |
86+
| ---- | ---- | ----------------------------------------------------------------- |
87+
| url | URL | Uma URL váçida apontando para um arquivo hospedado em outro lugar |
8988

9089
{
9190
"url": URL
9291
}
9392

9493
## File
9594

96-
A `File` is either a `DirectFile` or `ReferencedFile`. The API supports both everywhere.
95+
Um `File` é ou um `DirectFile` ou um `ReferencedFile`. A API suporta os dois em todo lugar.
9796

9897
## Directory
9998

100-
| Name | Type | Description |
101-
| ----- | ----------------- | ------------------------------- |
102-
| files | DirectoryContents | A map of the directory contents |
99+
| Nome | Tipo | Description |
100+
| ----- | ----------------- | ---------------------------------- |
101+
| files | DirectoryContents | Um map dos conteúdos ddo diretório |
103102

104103
{
105104
"files": DirectoryContents
106105
}
107106

108-
# API endpoints
107+
# Endpoints da API
109108

110109
## Sketches
111110

112111
## `GET /:user/sketches`
113112

114-
List a user’s sketches.
113+
Liste os esboços de um usuário.
115114

116-
This will not return the files within the sketch, just the sketch metadata.
115+
Isso não irá retornar os arquivos dentro de um esboço, apenas a metadata do esboço.
117116

118-
### Request format
119-
No body.
117+
### Formato da requisição
118+
Sem corpo.
120119

121-
### Response format
120+
### Formato da resposta
122121
{
123122
"sketches": Array<Sketch>
124123
}
125124

126-
### Example
125+
### Exemplo
127126

128127
GET /p5/sketches
129128

@@ -137,19 +136,19 @@ No body.
137136

138137
## `POST /:user/sketches`
139138

140-
Create a new sketch.
139+
Criar um novo esboço.
141140

142-
A sketch must contain at least one file with the `.html` extension. If none if provided in the payload, a default `index.html` and linked `style.css` file will be created automatically.
141+
Um esboço deve conter pelo menos um arquivo com a extenção `.html`. Se nenhum for fornecido no payload, um `index.html` padrão e um arquivo `style.css` associado serão criados automaticamente.
143142

144-
### Request format
145-
See `Sketch` in Models above.
143+
### Formato da requisição
144+
Veja `Sketch` nas Models abaixo.
146145

147-
### Response format
146+
### Formato da resposta
148147
{
149148
"id": String
150149
}
151150

152-
### Example
151+
### Exemplo
153152

154153
POST /p5/sketches
155154

@@ -161,7 +160,7 @@ See `Sketch` in Models above.
161160
}
162161
}
163162

164-
`files` can be nested to represent a folder structure. For example, this will create an empty “data” directory in the sketch:
163+
`files` podem possuir uma hierarquia para representar uma estrutura de pastas. Por exemplo, isso irá criar um diretório "data" vazio no esboço:
165164

166165

167166
POST /p5/sketches
@@ -181,15 +180,15 @@ See `Sketch` in Models above.
181180
}
182181
}
183182

184-
### Responses
183+
### Respostas
185184

186-
| HTTP code | Body |
187-
| ------------------------ | ----------------------------------------------------------------- |
188-
| 201 Created | id of sketch |
189-
| 422 Unprocessable Entity | file validation failed, unsupported filetype, slug already exists |
185+
| Código HTTP | Descrição |
186+
| ------------------------ | ------------------------------------------------------------------------------- |
187+
| 201 Created | id do esboço |
188+
| 422 Unprocessable Entity | falha na validação de um arquivo, tipo de arquivo não suportado, slug já existe |
190189

191190

192-
### Examples
191+
### Exemplos
193192

194193
201 CREATED
195194

@@ -199,21 +198,21 @@ See `Sketch` in Models above.
199198

200199
## `DELETE /:user/sketches/:id`
201200

202-
Delete a sketch and all it’s associated files.
201+
Delete um esboço e todos os seus arquivos associados.
203202

204-
### Request format
205-
No body
203+
### Formato da requisição
204+
Sem corpo
206205

207-
### Response format
208-
No body
206+
### Formato da resposta
207+
Sem corpo
209208

210-
### Example
209+
### Exemplo
211210

212211
DELETE /p5/sketches/Ckhf0APpg
213212

214-
### Responses
213+
### Respostas
215214

216-
| HTTP code | Description |
217-
| ------------- | ----------------------- |
218-
| 200 OK | Sketch has been deleted |
219-
| 404 Not Found | Sketch does not exist |
215+
| Código HTTP | Description |
216+
| ------------- | ------------------- |
217+
| 200 OK | Esboço foi deletado |
218+
| 404 Not Found | Esboço não existe |

0 commit comments

Comments
 (0)