diff --git a/semana-15/aula-42/src/Exercicio1.ts b/semana-15/aula-42/src/Exercicio1.ts deleted file mode 100644 index c25d3bc..0000000 --- a/semana-15/aula-42/src/Exercicio1.ts +++ /dev/null @@ -1,45 +0,0 @@ -//a) Quando atribuido um numero mostra o erro de tipo, o valor da minha variavel precisa ser uma string -//let minhaString: string = 5 - -//b) Para a variável aceitar mais de uma tipagem podemos utilizar o "|". - -let meuNumero: number | string = "Dois" -//let meuNumero: number = 2 - -//c) e d) -enum CorArcoIris { - VIOLETA = "Violeta", - ANIL = "Anil", - AZUL = "Azul", - VERDE = "Verde", - AMARELO = "Amarelo", - LARANJA = "Laranja", - VERMELHO = "Vermelho" -} - -type Pessoa = { - nome: string - idade: number - corFavorita: CorArcoIris -} - -const mariana: Pessoa = { - nome: "Mariana", - idade: 33, - corFavorita: CorArcoIris.VIOLETA -} -const lucas: Pessoa = { - nome: "lucas", - idade: 30, - corFavorita: CorArcoIris.ANIL -} -const ana: Pessoa = { - nome: "Ana", - idade: 25, - corFavorita: CorArcoIris.VERDE -} -const pedro: Pessoa = { - nome: "Pedro", - idade: 40, - corFavorita: CorArcoIris.LARANJA -} diff --git a/semana-15/aula-42/src/Exercicio2.ts b/semana-15/aula-42/src/Exercicio2.ts deleted file mode 100644 index 29c5271..0000000 --- a/semana-15/aula-42/src/Exercicio2.ts +++ /dev/null @@ -1,24 +0,0 @@ -//a) -function obterEstatisticas(numeros:any) { - - const numerosOrdenados = numeros.sort( - (a:number, b:number) => a - b - ) - - let soma = 0 - - for (let num of numeros) { - soma += num - } - - const estatisticas = { - maior: numerosOrdenados[numeros.length - 1], - menor: numerosOrdenados[0], - media: soma / numeros.length - } - - return estatisticas -} -obterEstatisticas(45) - -//b) \ No newline at end of file diff --git a/semana-15/aula-42/tsconfig.json b/semana-15/aula-42/tsconfig.json deleted file mode 100644 index d25ba3d..0000000 --- a/semana-15/aula-42/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", /* Specify ECMAScript target version */ - "module": "commonjs", /* Specify module code generation */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - "outDir": "./build", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. */ - "removeComments": true, /* Do not emit comments to output. */ - "noImplicitAny": true, /* Raise error on declarations with an implied 'any' type. */ - } -} \ No newline at end of file diff --git "a/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" "b/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" new file mode 100644 index 0000000..2624fda --- /dev/null +++ "b/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" @@ -0,0 +1,341 @@ +{ + "info": { + "_postman_id": "d5c83294-b088-41d4-b9e9-40f8f7c9ee69", + "name": "Labefy", + "description": "## Descrição\n
Esta API gerencia playlists e músicas.\n```\n\tFeito pela Labenu. Todos os direitos reservados\n```\n\n## Instruções gerais.\n\n**Autenticação**\n\nToda requisição deve ter uma identificação de quem está fazendo a requisição. Ela deve ser enviada por meio do header `Authorization`, da seguinte forma:\n\n`Authorization: \"nome-sobrenome-turma\"`\n\nPor exemplo, se meu nome é Bob Marley e eu sou da turma Newton, o header deve ser:\n\n`Authorization: \"bob-marley-newton\"`", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "searchPlaylist", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/search?name=string", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + "search" + ], + "query": [ + { + "key": "name", + "value": "string" + } + ] + }, + "description": "### Descrição:\nEssa requisição parmite pesquisar por uma playlist, usando o nome dela ou parte dele.\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Query String**\n
`name`: nome da playlist ou parte dele (obrigatório)\n```\n\tname:\"string\" \n```\n\n### Output:\n**Body**\n
`quantity`: quantidade de playlists encontradas\n
`list`: array com as playlists\n
`id`: id de cada playlist\n
`name`: nome de cada playlist\n```\n{\n \"result\": {\n \t\"quantity\": \"number\", \n \"list\": [\n {\n \"id\": \"string\", \n \"name\": \"string\" \n }\n ]\n }\n}\n```\n\n\n\n" + }, + "response": [] + }, + { + "name": "getAllPlaylists", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Mariana-Stamatakis-Maryam", + "type": "default" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists" + ] + } + }, + "response": [] + }, + { + "name": "getPlaylistTracks", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Mariana-Stamatakis-Maryam" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks" + ], + "variable": [ + { + "key": "playlistId", + "value": "201caaf4-42bd-4b79-97f1-963bccc1be0a" + } + ] + }, + "description": "### Descrição:\nEsta requisição permite verificar quais músicas estão em uma determinada playlist\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n### Output:\n**Body**\n
`quantity`: quantidade de músicas da playlist\n
`tracks`: array com as informações das músicas\n
`id`: id de cada música\n
`name`: nome de cada música\n
`artist`: cantor ou band da música\n
`url`: URL da música para ser tocada\n```\n{\n \"result\": {\n \"quantity\": \"number\",\n \"tracks\": [ \n {\n \"id\": \"string\", \n \"name\": \"string\", \n \"artist\": \"string\",\n \"url\": \"string\"\n }\n ]\n }\n}\n```\n\n" + }, + "response": [] + }, + { + "name": "createPlaylist", + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Mariana-Stamatakis-Maryam", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"Pop Internacional\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists?name=Pop Internacional", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists" + ], + "query": [ + { + "key": "name", + "value": "Pop Internacional" + } + ] + }, + "description": "### Descrição:\nEssa requisição cria uma nova playlist. \n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n**Body**\n
`name`: nome da playlist (obrigatório)\n```\n{\n\t\"name\": \"string\" \n}\n```" + }, + "response": [ + { + "name": "createPlaylist", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "auth", + "value": "authentication-token", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"playlist-name\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/playlists/createPlaylist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "playlists", + "createPlaylist" + ] + } + }, + "_postman_previewlanguage": "Text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "addTrackToPlaylist", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Mariana-Stamatakis-Maryam" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"Titanium ft. Sia\",\n\t\"artist\": \"David Guetta\",\n\t\"url\": \"https://www.youtube.com/watch?v=JRfuAukYTKg&ab_channel=DavidGuetta\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks" + ], + "variable": [ + { + "key": "playlistId", + "value": "201caaf4-42bd-4b79-97f1-963bccc1be0a" + } + ] + }, + "description": "### Descrição:\nEssa requisição adiciona uma música a uma playlist existente\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n**Body**\n
`name`: nome da música (obrigatório)\n
`artist`: cantor ou banda da música (obrigatório)\n
`url`: URL da música para ser tocada (obrigatório)\n```\n{\n\t\"name\": \"string\", \n\t\"artist\": \"string\",\n\t\"url\": \"string\"\n}\n```\n\n\n" + }, + "response": [] + }, + { + "name": "deletePlaylist", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId" + ], + "variable": [ + { + "key": "playlistId", + "value": "247e3159-ac9f-491e-8eac-3ee4027681d8" + } + ] + }, + "description": "### Descrição:\nEsta requisição serve para deletar alguma playlist.\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n" + }, + "response": [] + }, + { + "name": "removeTrackFromPlaylist", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks/:trackId", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks", + ":trackId" + ], + "variable": [ + { + "key": "playlistId", + "value": "" + }, + { + "key": "trackId", + "value": "" + } + ] + }, + "description": "### Descrição:\nEsta requisição serve para deletar alguma música de alguma playlist\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Params**\n
`playlistId`: id da playlist (obrigatório)\n
`trackId`: id da música (obrigatório)\n" + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file