├── 0
└── index.html
├── 1
└── index.html
├── 2
└── index.html
├── 3
└── index.html
├── 4
└── index.html
├── 5
├── util.js
├── teste.js
├── index.html
├── lancamento.js
├── mes.js
└── main.js
├── 6
├── util.js
├── teste.js
├── lancamento.js
├── ano.js
├── index.html
├── mes.js
└── main.js
├── 7
├── teste.js
├── util.js
├── lancamento.js
├── ano.js
├── mes.js
├── index.html
└── main.js
├── 8
├── main.js
├── base_components
│ ├── h4.js
│ ├── input.js
│ ├── button.js
│ ├── div.js
│ ├── select.js
│ └── tabela.js
├── domain
│ ├── ano.js
│ ├── lancamento.js
│ └── mes.js
├── app_components
│ └── grafico.js
├── index.html
├── style.css
└── views
│ └── tela.js
├── 9
├── .gitignore
├── client
│ ├── main.js
│ ├── base_components
│ │ ├── h4.js
│ │ ├── input.js
│ │ ├── button.js
│ │ ├── div.js
│ │ ├── select.js
│ │ └── tabela.js
│ ├── domain
│ │ ├── ano.js
│ │ ├── lancamento.js
│ │ └── mes.js
│ ├── app_components
│ │ └── grafico.js
│ ├── index.html
│ ├── style.css
│ └── views
│ │ └── tela.js
├── package.json
├── server.js
└── package-lock.json
├── 10
├── .gitignore
├── client
│ ├── main.js
│ ├── base_components
│ │ ├── h4.js
│ │ ├── input.js
│ │ ├── button.js
│ │ ├── div.js
│ │ ├── select.js
│ │ └── tabela.js
│ ├── domain
│ │ ├── ano.js
│ │ ├── lancamento.js
│ │ └── mes.js
│ ├── app_components
│ │ └── grafico.js
│ ├── index.html
│ ├── style.css
│ └── views
│ │ └── tela.js
├── drop.sql
├── package.json
├── server.js
└── create.sql
├── 11
├── .gitignore
├── client
│ ├── main.js
│ ├── base_components
│ │ ├── h4.js
│ │ ├── input.js
│ │ ├── button.js
│ │ ├── div.js
│ │ ├── select.js
│ │ └── tabela.js
│ ├── domain
│ │ ├── lancamento.js
│ │ ├── ano.js
│ │ └── mes.js
│ ├── app_components
│ │ └── grafico.js
│ ├── index.html
│ ├── style.css
│ └── views
│ │ └── tela.js
├── drop.sql
├── server
│ ├── Connection.js
│ ├── HttpServer.js
│ ├── Lancamento.js
│ ├── LancamentoController.js
│ └── LancamentoData.js
├── package.json
├── main.js
└── create.sql
├── 12
├── .gitignore
├── drop.sql
├── client
│ ├── base_components
│ │ ├── h4.js
│ │ ├── button.js
│ │ ├── div.js
│ │ ├── select.js
│ │ ├── input.js
│ │ └── tabela.js
│ ├── main.js
│ ├── infra
│ │ └── FetchHttpClient.js
│ ├── services
│ │ └── LancamentoService.js
│ ├── domain
│ │ ├── lancamento.js
│ │ ├── ano.js
│ │ └── mes.js
│ ├── app_components
│ │ └── grafico.js
│ ├── index.html
│ ├── style.css
│ └── views
│ │ └── tela.js
├── server
│ ├── Connection.js
│ ├── HttpServer.js
│ ├── Lancamento.js
│ ├── LancamentoController.js
│ └── LancamentoData.js
├── package.json
├── main.js
└── create.sql
└── README.md
/10/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/10/client/main.js:
--------------------------------------------------------------------------------
1 | new Tela();
--------------------------------------------------------------------------------
/11/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/11/client/main.js:
--------------------------------------------------------------------------------
1 | new Tela();
--------------------------------------------------------------------------------
/12/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/9/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/9/client/main.js:
--------------------------------------------------------------------------------
1 | new Tela();
--------------------------------------------------------------------------------
/8/main.js:
--------------------------------------------------------------------------------
1 | const tela = new Tela();
2 | tela.renderizar();
3 |
--------------------------------------------------------------------------------
/5/util.js:
--------------------------------------------------------------------------------
1 | function arredondar (valor) {
2 | return Math.round(valor*100)/100;
3 | }
--------------------------------------------------------------------------------
/6/util.js:
--------------------------------------------------------------------------------
1 | function arredondar (valor) {
2 | return Math.round(valor*100)/100;
3 | }
--------------------------------------------------------------------------------
/10/drop.sql:
--------------------------------------------------------------------------------
1 | drop table financas_pessoais.lancamento;
2 | drop schema financas_pessoais;
--------------------------------------------------------------------------------
/11/drop.sql:
--------------------------------------------------------------------------------
1 | drop table financas_pessoais.lancamento;
2 | drop schema financas_pessoais;
--------------------------------------------------------------------------------
/12/drop.sql:
--------------------------------------------------------------------------------
1 | drop table financas_pessoais.lancamento;
2 | drop schema financas_pessoais;
--------------------------------------------------------------------------------
/0/index.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Este conteúdo é parte do curso Hello World da Branas.io
2 |
3 | Para mais informações acesse:
4 |
5 | https://app.branas.io/hello-world
6 |
--------------------------------------------------------------------------------
/8/base_components/h4.js:
--------------------------------------------------------------------------------
1 | class h4 {
2 | constructor (text) {
3 | this.element = document.createElement("h4");
4 | this.element.innerText = text;
5 | }
6 | }
--------------------------------------------------------------------------------
/10/client/base_components/h4.js:
--------------------------------------------------------------------------------
1 | class h4 {
2 | constructor (text) {
3 | this.element = document.createElement("h4");
4 | this.element.innerText = text;
5 | }
6 | }
--------------------------------------------------------------------------------
/11/client/base_components/h4.js:
--------------------------------------------------------------------------------
1 | class h4 {
2 | constructor (text) {
3 | this.element = document.createElement("h4");
4 | this.element.innerText = text;
5 | }
6 | }
--------------------------------------------------------------------------------
/12/client/base_components/h4.js:
--------------------------------------------------------------------------------
1 | class h4 {
2 | constructor (text) {
3 | this.element = document.createElement("h4");
4 | this.element.innerText = text;
5 | }
6 | }
--------------------------------------------------------------------------------
/5/teste.js:
--------------------------------------------------------------------------------
1 | console.log(janeiro.totalizador.saldo === 100.5)
2 | console.log(fevereiro.totalizador.saldo === -494.45)
3 | console.log(marco.totalizador.saldo === -983.89)
--------------------------------------------------------------------------------
/6/teste.js:
--------------------------------------------------------------------------------
1 | console.log(janeiro.totalizador.saldo === 100.5)
2 | console.log(fevereiro.totalizador.saldo === -494.45)
3 | console.log(marco.totalizador.saldo === -983.89)
--------------------------------------------------------------------------------
/7/teste.js:
--------------------------------------------------------------------------------
1 | console.log(janeiro.totalizador.saldo === 100.5)
2 | console.log(fevereiro.totalizador.saldo === -494.45)
3 | console.log(marco.totalizador.saldo === -983.89)
--------------------------------------------------------------------------------
/9/client/base_components/h4.js:
--------------------------------------------------------------------------------
1 | class h4 {
2 | constructor (text) {
3 | this.element = document.createElement("h4");
4 | this.element.innerText = text;
5 | }
6 | }
--------------------------------------------------------------------------------
/12/client/main.js:
--------------------------------------------------------------------------------
1 | const httpClient = new FetchHttpClient();
2 | const baseUrl = "http://localhost:3000";
3 | const lancamentoService = new LancamentoService(httpClient, baseUrl);
4 | new Tela(lancamentoService);
--------------------------------------------------------------------------------
/5/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/7/util.js:
--------------------------------------------------------------------------------
1 | function arredondar (valor) {
2 | return Math.round(valor*100)/100;
3 | }
4 |
5 | function formatarDinheiro (valor) {
6 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
7 | }
8 |
--------------------------------------------------------------------------------
/8/base_components/input.js:
--------------------------------------------------------------------------------
1 | class Input {
2 |
3 | constructor (id, type, placeholder) {
4 | this.element = document.createElement("input");
5 | this.element.id = id;
6 | this.element.type = type;
7 | this.element.placeholder = placeholder;
8 | }
9 | }
--------------------------------------------------------------------------------
/10/client/base_components/input.js:
--------------------------------------------------------------------------------
1 | class Input {
2 |
3 | constructor (id, type, placeholder) {
4 | this.element = document.createElement("input");
5 | this.element.id = id;
6 | this.element.type = type;
7 | this.element.placeholder = placeholder;
8 | }
9 | }
--------------------------------------------------------------------------------
/11/client/base_components/input.js:
--------------------------------------------------------------------------------
1 | class Input {
2 |
3 | constructor (id, type, placeholder) {
4 | this.element = document.createElement("input");
5 | this.element.id = id;
6 | this.element.type = type;
7 | this.element.placeholder = placeholder;
8 | }
9 | }
--------------------------------------------------------------------------------
/9/client/base_components/input.js:
--------------------------------------------------------------------------------
1 | class Input {
2 |
3 | constructor (id, type, placeholder) {
4 | this.element = document.createElement("input");
5 | this.element.id = id;
6 | this.element.type = type;
7 | this.element.placeholder = placeholder;
8 | }
9 | }
--------------------------------------------------------------------------------
/8/base_components/button.js:
--------------------------------------------------------------------------------
1 | class Button {
2 | constructor (id, text) {
3 | this.element = document.createElement("button");
4 | this.element.id = id;
5 | this.element.innerText = text;
6 | }
7 |
8 | addListener (fn) {
9 | this.element.addEventListener("click", fn);
10 | }
11 | }
--------------------------------------------------------------------------------
/8/base_components/div.js:
--------------------------------------------------------------------------------
1 | class Div {
2 | constructor (id, className) {
3 | this.element = document.createElement("div");
4 | this.element.id = id;
5 | this.element.className = className;
6 | }
7 |
8 | adicionarElementoFilho (child) {
9 | this.element.appendChild(child);
10 | }
11 | }
--------------------------------------------------------------------------------
/9/client/base_components/button.js:
--------------------------------------------------------------------------------
1 | class Button {
2 | constructor (id, text) {
3 | this.element = document.createElement("button");
4 | this.element.id = id;
5 | this.element.innerText = text;
6 | }
7 |
8 | addListener (fn) {
9 | this.element.addEventListener("click", fn);
10 | }
11 | }
--------------------------------------------------------------------------------
/10/client/base_components/button.js:
--------------------------------------------------------------------------------
1 | class Button {
2 | constructor (id, text) {
3 | this.element = document.createElement("button");
4 | this.element.id = id;
5 | this.element.innerText = text;
6 | }
7 |
8 | addListener (fn) {
9 | this.element.addEventListener("click", fn);
10 | }
11 | }
--------------------------------------------------------------------------------
/10/client/base_components/div.js:
--------------------------------------------------------------------------------
1 | class Div {
2 | constructor (id, className) {
3 | this.element = document.createElement("div");
4 | this.element.id = id;
5 | this.element.className = className;
6 | }
7 |
8 | adicionarElementoFilho (child) {
9 | this.element.appendChild(child);
10 | }
11 | }
--------------------------------------------------------------------------------
/11/client/base_components/button.js:
--------------------------------------------------------------------------------
1 | class Button {
2 | constructor (id, text) {
3 | this.element = document.createElement("button");
4 | this.element.id = id;
5 | this.element.innerText = text;
6 | }
7 |
8 | addListener (fn) {
9 | this.element.addEventListener("click", fn);
10 | }
11 | }
--------------------------------------------------------------------------------
/11/client/base_components/div.js:
--------------------------------------------------------------------------------
1 | class Div {
2 | constructor (id, className) {
3 | this.element = document.createElement("div");
4 | this.element.id = id;
5 | this.element.className = className;
6 | }
7 |
8 | adicionarElementoFilho (child) {
9 | this.element.appendChild(child);
10 | }
11 | }
--------------------------------------------------------------------------------
/12/client/base_components/button.js:
--------------------------------------------------------------------------------
1 | class Button {
2 | constructor (id, text) {
3 | this.element = document.createElement("button");
4 | this.element.id = id;
5 | this.element.innerText = text;
6 | }
7 |
8 | addListener (fn) {
9 | this.element.addEventListener("click", fn);
10 | }
11 | }
--------------------------------------------------------------------------------
/12/client/base_components/div.js:
--------------------------------------------------------------------------------
1 | class Div {
2 | constructor (id, className) {
3 | this.element = document.createElement("div");
4 | this.element.id = id;
5 | this.element.className = className;
6 | }
7 |
8 | adicionarElementoFilho (child) {
9 | this.element.appendChild(child);
10 | }
11 | }
--------------------------------------------------------------------------------
/9/client/base_components/div.js:
--------------------------------------------------------------------------------
1 | class Div {
2 | constructor (id, className) {
3 | this.element = document.createElement("div");
4 | this.element.id = id;
5 | this.element.className = className;
6 | }
7 |
8 | adicionarElementoFilho (child) {
9 | this.element.appendChild(child);
10 | }
11 | }
--------------------------------------------------------------------------------
/8/base_components/select.js:
--------------------------------------------------------------------------------
1 | class Select {
2 | constructor (id) {
3 | this.element = document.createElement("select");
4 | this.element.id = id;
5 | }
6 |
7 | addOption (text) {
8 | const option = document.createElement("option");
9 | option.text = text;
10 | this.element.appendChild(option);
11 | }
12 | }
--------------------------------------------------------------------------------
/10/client/base_components/select.js:
--------------------------------------------------------------------------------
1 | class Select {
2 | constructor (id) {
3 | this.element = document.createElement("select");
4 | this.element.id = id;
5 | }
6 |
7 | addOption (text) {
8 | const option = document.createElement("option");
9 | option.text = text;
10 | this.element.appendChild(option);
11 | }
12 | }
--------------------------------------------------------------------------------
/11/client/base_components/select.js:
--------------------------------------------------------------------------------
1 | class Select {
2 | constructor (id) {
3 | this.element = document.createElement("select");
4 | this.element.id = id;
5 | }
6 |
7 | addOption (text) {
8 | const option = document.createElement("option");
9 | option.text = text;
10 | this.element.appendChild(option);
11 | }
12 | }
--------------------------------------------------------------------------------
/9/client/base_components/select.js:
--------------------------------------------------------------------------------
1 | class Select {
2 | constructor (id) {
3 | this.element = document.createElement("select");
4 | this.element.id = id;
5 | }
6 |
7 | addOption (text) {
8 | const option = document.createElement("option");
9 | option.text = text;
10 | this.element.appendChild(option);
11 | }
12 | }
--------------------------------------------------------------------------------
/11/server/Connection.js:
--------------------------------------------------------------------------------
1 | const pgp = require("pg-promise");
2 |
3 | class Connection {
4 |
5 | constructor () {
6 | this.connection = pgp()("postgres://postgres:123456@localhost:5432/app");
7 | }
8 |
9 | query (statement, params) {
10 | return this.connection.query(statement, params);
11 | }
12 | }
13 |
14 | module.exports = Connection;
--------------------------------------------------------------------------------
/12/server/Connection.js:
--------------------------------------------------------------------------------
1 | const pgp = require("pg-promise");
2 |
3 | class Connection {
4 |
5 | constructor () {
6 | this.connection = pgp()("postgres://postgres:123456@localhost:5432/app");
7 | }
8 |
9 | query (statement, params) {
10 | return this.connection.query(statement, params);
11 | }
12 | }
13 |
14 | module.exports = Connection;
--------------------------------------------------------------------------------
/9/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "9",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.1"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/10/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "9",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.1",
14 | "pg-promise": "^10.11.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/12/client/base_components/select.js:
--------------------------------------------------------------------------------
1 | class Select {
2 | constructor (id) {
3 | this.element = document.createElement("select");
4 | this.element.id = id;
5 | }
6 |
7 | addOption (text) {
8 | const option = document.createElement("option");
9 | option.text = text;
10 | this.element.appendChild(option);
11 | }
12 |
13 | getValue () {
14 | return this.element.value;
15 | }
16 | }
--------------------------------------------------------------------------------
/11/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "9",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.1",
14 | "nodemon": "^2.0.19",
15 | "pg-promise": "^10.11.1"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/12/client/base_components/input.js:
--------------------------------------------------------------------------------
1 | class Input {
2 |
3 | constructor (id, type, placeholder) {
4 | this.element = document.createElement("input");
5 | this.element.id = id;
6 | this.element.type = type;
7 | this.element.placeholder = placeholder;
8 | }
9 |
10 | getValue () {
11 | if (this.element.type === "number") return this.element.valueAsNumber;
12 | return this.element.value;
13 | }
14 | }
--------------------------------------------------------------------------------
/12/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "9",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.1",
14 | "nodemon": "^2.0.19",
15 | "pg-promise": "^10.11.1"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/8/base_components/tabela.js:
--------------------------------------------------------------------------------
1 | class Tabela {
2 | constructor (className) {
3 | this.element = document.createElement("table");
4 | this.element.className = className;
5 | }
6 |
7 | addRow (type, values) {
8 | const tr = document.createElement("tr");
9 | for (const value of values) {
10 | const td = document.createElement(type);
11 | td.innerText = value;
12 | tr.appendChild(td);
13 | }
14 |
15 | this.element.appendChild(tr);
16 | }
17 | }
--------------------------------------------------------------------------------
/12/client/infra/FetchHttpClient.js:
--------------------------------------------------------------------------------
1 | class FetchHttpClient {
2 |
3 | async get (url) {
4 | const response = await fetch(url);
5 | return response.json();
6 | }
7 |
8 | async post (url, data) {
9 | await fetch(url, {
10 | method: "post",
11 | headers: { "content-type": "application/json" },
12 | body: JSON.stringify(data)
13 | });
14 | }
15 |
16 | async delete (url) {
17 | await fetch(url, {
18 | method: "delete"
19 | });
20 | }
21 | }
--------------------------------------------------------------------------------
/10/client/base_components/tabela.js:
--------------------------------------------------------------------------------
1 | class Tabela {
2 | constructor (className) {
3 | this.element = document.createElement("table");
4 | this.element.className = className;
5 | }
6 |
7 | addRow (type, values) {
8 | const tr = document.createElement("tr");
9 | for (const value of values) {
10 | const td = document.createElement(type);
11 | td.innerText = value;
12 | tr.appendChild(td);
13 | }
14 |
15 | this.element.appendChild(tr);
16 | }
17 | }
--------------------------------------------------------------------------------
/9/client/base_components/tabela.js:
--------------------------------------------------------------------------------
1 | class Tabela {
2 | constructor (className) {
3 | this.element = document.createElement("table");
4 | this.element.className = className;
5 | }
6 |
7 | addRow (type, values) {
8 | const tr = document.createElement("tr");
9 | for (const value of values) {
10 | const td = document.createElement(type);
11 | td.innerText = value;
12 | tr.appendChild(td);
13 | }
14 |
15 | this.element.appendChild(tr);
16 | }
17 | }
--------------------------------------------------------------------------------
/11/main.js:
--------------------------------------------------------------------------------
1 | const Connection = require("./server/Connection");
2 | const HttpServer = require("./server/HttpServer");
3 | const LancamentoController = require("./server/LancamentoController");
4 | const LancamentoData = require("./server/LancamentoData");
5 |
6 | const connection = new Connection();
7 | const lancamentoData = new LancamentoData(connection);
8 | const httpServer = new HttpServer();
9 | new LancamentoController(httpServer, lancamentoData);
10 | httpServer.listen(3000);
11 |
--------------------------------------------------------------------------------
/12/main.js:
--------------------------------------------------------------------------------
1 | const Connection = require("./server/Connection");
2 | const HttpServer = require("./server/HttpServer");
3 | const LancamentoController = require("./server/LancamentoController");
4 | const LancamentoData = require("./server/LancamentoData");
5 |
6 | const connection = new Connection();
7 | const lancamentoData = new LancamentoData(connection);
8 | const httpServer = new HttpServer();
9 | new LancamentoController(httpServer, lancamentoData);
10 | httpServer.listen(3000);
11 |
--------------------------------------------------------------------------------
/5/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa")
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero")
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória")
12 | }
13 | this.categoria = categoria
14 | this.tipo = tipo
15 | this.valor = valor
16 | }
17 | }
--------------------------------------------------------------------------------
/6/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa")
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero")
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória")
12 | }
13 | this.categoria = categoria
14 | this.tipo = tipo
15 | this.valor = valor
16 | }
17 | }
--------------------------------------------------------------------------------
/7/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa")
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero")
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória")
12 | }
13 | this.categoria = categoria
14 | this.tipo = tipo
15 | this.valor = valor
16 | }
17 | }
--------------------------------------------------------------------------------
/11/server/HttpServer.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | class HttpServer {
4 |
5 | constructor () {
6 | this.app = express();
7 | this.app.use(express.json());
8 | this.app.use("/", express.static("./client"));
9 | }
10 |
11 | register (method, url, callback) {
12 | this.app[method](url, async function (req, res) {
13 | const output = await callback(req.params, req.body);
14 | res.json(output);
15 | });
16 | }
17 |
18 | listen (port) {
19 | this.app.listen(port);
20 | }
21 | }
22 |
23 | module.exports = HttpServer;
--------------------------------------------------------------------------------
/12/server/HttpServer.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | class HttpServer {
4 |
5 | constructor () {
6 | this.app = express();
7 | this.app.use(express.json());
8 | this.app.use("/", express.static("./client"));
9 | }
10 |
11 | register (method, url, callback) {
12 | this.app[method](url, async function (req, res) {
13 | const output = await callback(req.params, req.body);
14 | res.json(output);
15 | });
16 | }
17 |
18 | listen (port) {
19 | this.app.listen(port);
20 | }
21 | }
22 |
23 | module.exports = HttpServer;
--------------------------------------------------------------------------------
/12/client/services/LancamentoService.js:
--------------------------------------------------------------------------------
1 | class LancamentoService {
2 |
3 | constructor (httpClient, baseUrl) {
4 | this.httpClient = httpClient;
5 | this.baseUrl = baseUrl;
6 | }
7 |
8 | async getLancamentos () {
9 | return this.httpClient.get(`${this.baseUrl}/api/lancamentos`);
10 | }
11 |
12 | async saveLancamento (lancamento) {
13 | return this.httpClient.post(`${this.baseUrl}/api/lancamentos`, lancamento);
14 | }
15 |
16 | async deleteLancamento (idLancamento) {
17 | return this.httpClient.delete(`${this.baseUrl}/api/lancamentos/${idLancamento}`);
18 | }
19 | }
--------------------------------------------------------------------------------
/6/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | calcularSaldo () {
21 | let saldoInicial = 0;
22 | for (const mes of this.meses) {
23 | mes.saldoInicial = saldoInicial;
24 | mes.calcularSaldo();
25 | saldoInicial = mes.totalizador.saldo;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/7/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | calcularSaldo () {
21 | let saldoInicial = 0;
22 | for (const mes of this.meses) {
23 | mes.saldoInicial = saldoInicial;
24 | mes.calcularSaldo();
25 | saldoInicial = mes.totalizador.saldo;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/8/domain/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | calcularSaldo () {
21 | let saldoInicial = 0;
22 | for (const mes of this.meses) {
23 | mes.saldoInicial = saldoInicial;
24 | mes.calcularSaldo();
25 | saldoInicial = mes.totalizador.saldo;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/9/client/domain/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | calcularSaldo () {
21 | let saldoInicial = 0;
22 | for (const mes of this.meses) {
23 | mes.saldoInicial = saldoInicial;
24 | mes.calcularSaldo();
25 | saldoInicial = mes.totalizador.saldo;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/10/client/domain/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | calcularSaldo () {
21 | let saldoInicial = 0;
22 | for (const mes of this.meses) {
23 | mes.saldoInicial = saldoInicial;
24 | mes.calcularSaldo();
25 | saldoInicial = mes.totalizador.saldo;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/6/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Finanças Pessoais
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/8/domain/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
12 | }
13 | this.categoria = categoria;
14 | this.tipo = tipo;
15 | this.valor = valor;
16 | }
17 |
18 | getValorString () {
19 | return (this.tipo === "despesa") ? this.valor * -1 : this.valor;
20 | }
21 | }
--------------------------------------------------------------------------------
/10/client/domain/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
12 | }
13 | this.categoria = categoria;
14 | this.tipo = tipo;
15 | this.valor = valor;
16 | }
17 |
18 | getValorString () {
19 | return (this.tipo === "despesa") ? this.valor * -1 : this.valor;
20 | }
21 | }
--------------------------------------------------------------------------------
/9/client/domain/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
12 | }
13 | this.categoria = categoria;
14 | this.tipo = tipo;
15 | this.valor = valor;
16 | }
17 |
18 | getValorString () {
19 | return (this.tipo === "despesa") ? this.valor * -1 : this.valor;
20 | }
21 | }
--------------------------------------------------------------------------------
/11/client/base_components/tabela.js:
--------------------------------------------------------------------------------
1 | class Tabela {
2 | constructor (className) {
3 | this.element = document.createElement("table");
4 | this.element.className = className;
5 | }
6 |
7 | addRow (type, values, buttons) {
8 | const tr = document.createElement("tr");
9 | for (const value of values) {
10 | const td = document.createElement(type);
11 | td.innerText = value;
12 | tr.appendChild(td);
13 | }
14 | if (buttons) {
15 | for (const button of buttons) {
16 | const td = document.createElement(type);
17 | td.append(button.element);
18 | tr.appendChild(td);
19 | }
20 | }
21 |
22 | this.element.appendChild(tr);
23 | }
24 | }
--------------------------------------------------------------------------------
/11/server/Lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (idLancamento, mes, categoria, tipo, valor) {
4 | this.idLancamento = idLancamento;
5 | this.mes = mes;
6 | if (tipo !== "receita" && tipo !== "despesa") {
7 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
8 | }
9 | if (valor <= 0) {
10 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
11 | }
12 | if (categoria === "") {
13 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
14 | }
15 | this.categoria = categoria;
16 | this.tipo = tipo;
17 | this.valor = valor;
18 | }
19 | }
20 |
21 | module.exports = Lancamento;
--------------------------------------------------------------------------------
/12/client/base_components/tabela.js:
--------------------------------------------------------------------------------
1 | class Tabela {
2 | constructor (className) {
3 | this.element = document.createElement("table");
4 | this.element.className = className;
5 | }
6 |
7 | addRow (type, values, buttons) {
8 | const tr = document.createElement("tr");
9 | for (const value of values) {
10 | const td = document.createElement(type);
11 | td.innerText = value;
12 | tr.appendChild(td);
13 | }
14 | if (buttons) {
15 | for (const button of buttons) {
16 | const td = document.createElement(type);
17 | td.append(button.element);
18 | tr.appendChild(td);
19 | }
20 | }
21 |
22 | this.element.appendChild(tr);
23 | }
24 | }
--------------------------------------------------------------------------------
/12/server/Lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (idLancamento, mes, categoria, tipo, valor) {
4 | this.idLancamento = idLancamento;
5 | this.mes = mes;
6 | if (tipo !== "receita" && tipo !== "despesa") {
7 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
8 | }
9 | if (valor <= 0) {
10 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
11 | }
12 | if (categoria === "") {
13 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
14 | }
15 | this.categoria = categoria;
16 | this.tipo = tipo;
17 | this.valor = valor;
18 | }
19 | }
20 |
21 | module.exports = Lancamento;
--------------------------------------------------------------------------------
/11/client/domain/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor, idLancamento) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
12 | }
13 | this.categoria = categoria;
14 | this.tipo = tipo;
15 | this.valor = valor;
16 | this.idLancamento = idLancamento;
17 | }
18 |
19 | getValorString () {
20 | return (this.tipo === "despesa") ? this.valor * -1 : this.valor;
21 | }
22 | }
--------------------------------------------------------------------------------
/12/client/domain/lancamento.js:
--------------------------------------------------------------------------------
1 | class Lancamento {
2 |
3 | constructor (categoria, tipo, valor, idLancamento) {
4 | if (tipo !== "receita" && tipo !== "despesa") {
5 | throw new Error("Lançamento Inválido: Tipo deve ser receita ou despesa");
6 | }
7 | if (valor <= 0) {
8 | throw new Error("Lançamento Inválido: Valor deve ser maior que zero");
9 | }
10 | if (categoria === "") {
11 | throw new Error("Lançamento Inválido: A Categoria é obrigatória");
12 | }
13 | this.categoria = categoria;
14 | this.tipo = tipo;
15 | this.valor = valor;
16 | this.idLancamento = idLancamento;
17 | }
18 |
19 | getValorString () {
20 | return (this.tipo === "despesa") ? this.valor * -1 : this.valor;
21 | }
22 | }
--------------------------------------------------------------------------------
/11/client/domain/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | for (const mes of this.meses) {
13 | if (mes.nome === nomeDoMes) {
14 | mes.adicionarLancamento(lancamento);
15 | break;
16 | }
17 | }
18 | }
19 |
20 | deletarLancamento (mes, lancamento) {
21 | const pos = mes.lancamentos.indexOf(lancamento);
22 | mes.lancamentos.splice(pos, 1);
23 | }
24 |
25 | calcularSaldo () {
26 | let saldoInicial = 0;
27 | for (const mes of this.meses) {
28 | mes.saldoInicial = saldoInicial;
29 | mes.calcularSaldo();
30 | saldoInicial = mes.totalizador.saldo;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/11/server/LancamentoController.js:
--------------------------------------------------------------------------------
1 | class LancamentoController {
2 |
3 | constructor (httpServer, lancamentoData) {
4 | httpServer.register("get", "/api/lancamentos", async function (params, body) {
5 | const lancamentos = await lancamentoData.getLancamentos();
6 | return lancamentos;
7 | });
8 |
9 | httpServer.register("post", "/api/lancamentos", async function (params, body) {
10 | const lancamento = body;
11 | await lancamentoData.saveLancamento(lancamento);
12 | });
13 |
14 | httpServer.register("delete", "/api/lancamentos/:idLancamento", async function (params, body) {
15 | const idLancamento = params.idLancamento;
16 | await lancamentoData.deleteLancamento(idLancamento);
17 | });
18 | }
19 | }
20 |
21 | module.exports = LancamentoController;
--------------------------------------------------------------------------------
/12/server/LancamentoController.js:
--------------------------------------------------------------------------------
1 | class LancamentoController {
2 |
3 | constructor (httpServer, lancamentoData) {
4 | httpServer.register("get", "/api/lancamentos", async function (params, body) {
5 | const lancamentos = await lancamentoData.getLancamentos();
6 | return lancamentos;
7 | });
8 |
9 | httpServer.register("post", "/api/lancamentos", async function (params, body) {
10 | const lancamento = body;
11 | await lancamentoData.saveLancamento(lancamento);
12 | });
13 |
14 | httpServer.register("delete", "/api/lancamentos/:idLancamento", async function (params, body) {
15 | const idLancamento = params.idLancamento;
16 | await lancamentoData.deleteLancamento(idLancamento);
17 | });
18 | }
19 | }
20 |
21 | module.exports = LancamentoController;
--------------------------------------------------------------------------------
/8/app_components/grafico.js:
--------------------------------------------------------------------------------
1 | class Grafico {
2 | constructor () {
3 | this.element = document.createElement("div");
4 | this.element.className = "grafico";
5 | this.cores = ["red", "yellow", "green", "blue"];
6 | }
7 |
8 | adicionarColuna (valor, descricao) {
9 | const coluna = document.createElement("div");
10 | coluna.className = "grafico-coluna";
11 | const cor = document.createElement("div");
12 | cor.style.height = (valor*100)/10000;
13 | cor.style.background = this.cores.pop();
14 | coluna.appendChild(cor);
15 | const nomeDoMes = document.createElement("div");
16 | nomeDoMes.className = "grafico-coluna-texto";
17 | nomeDoMes.innerText = descricao;
18 | coluna.appendChild(cor);
19 | coluna.appendChild(nomeDoMes);
20 | this.element.appendChild(coluna);
21 | }
22 | }
--------------------------------------------------------------------------------
/10/client/app_components/grafico.js:
--------------------------------------------------------------------------------
1 | class Grafico {
2 | constructor () {
3 | this.element = document.createElement("div");
4 | this.element.className = "grafico";
5 | this.cores = ["red", "yellow", "green", "blue"];
6 | }
7 |
8 | adicionarColuna (valor, descricao) {
9 | const coluna = document.createElement("div");
10 | coluna.className = "grafico-coluna";
11 | const cor = document.createElement("div");
12 | cor.style.height = (valor*100)/10000;
13 | cor.style.background = this.cores.pop();
14 | coluna.appendChild(cor);
15 | const nomeDoMes = document.createElement("div");
16 | nomeDoMes.className = "grafico-coluna-texto";
17 | nomeDoMes.innerText = descricao;
18 | coluna.appendChild(cor);
19 | coluna.appendChild(nomeDoMes);
20 | this.element.appendChild(coluna);
21 | }
22 | }
--------------------------------------------------------------------------------
/11/client/app_components/grafico.js:
--------------------------------------------------------------------------------
1 | class Grafico {
2 | constructor () {
3 | this.element = document.createElement("div");
4 | this.element.className = "grafico";
5 | this.cores = ["red", "yellow", "green", "blue"];
6 | }
7 |
8 | adicionarColuna (valor, descricao) {
9 | const coluna = document.createElement("div");
10 | coluna.className = "grafico-coluna";
11 | const cor = document.createElement("div");
12 | cor.style.height = (valor*100)/10000;
13 | cor.style.background = this.cores.pop();
14 | coluna.appendChild(cor);
15 | const nomeDoMes = document.createElement("div");
16 | nomeDoMes.className = "grafico-coluna-texto";
17 | nomeDoMes.innerText = descricao;
18 | coluna.appendChild(cor);
19 | coluna.appendChild(nomeDoMes);
20 | this.element.appendChild(coluna);
21 | }
22 | }
--------------------------------------------------------------------------------
/12/client/app_components/grafico.js:
--------------------------------------------------------------------------------
1 | class Grafico {
2 | constructor () {
3 | this.element = document.createElement("div");
4 | this.element.className = "grafico";
5 | this.cores = ["red", "yellow", "green", "blue"];
6 | }
7 |
8 | adicionarColuna (valor, descricao) {
9 | const coluna = document.createElement("div");
10 | coluna.className = "grafico-coluna";
11 | const cor = document.createElement("div");
12 | cor.style.height = (valor*100)/10000;
13 | cor.style.background = this.cores.pop();
14 | coluna.appendChild(cor);
15 | const nomeDoMes = document.createElement("div");
16 | nomeDoMes.className = "grafico-coluna-texto";
17 | nomeDoMes.innerText = descricao;
18 | coluna.appendChild(cor);
19 | coluna.appendChild(nomeDoMes);
20 | this.element.appendChild(coluna);
21 | }
22 | }
--------------------------------------------------------------------------------
/9/client/app_components/grafico.js:
--------------------------------------------------------------------------------
1 | class Grafico {
2 | constructor () {
3 | this.element = document.createElement("div");
4 | this.element.className = "grafico";
5 | this.cores = ["red", "yellow", "green", "blue"];
6 | }
7 |
8 | adicionarColuna (valor, descricao) {
9 | const coluna = document.createElement("div");
10 | coluna.className = "grafico-coluna";
11 | const cor = document.createElement("div");
12 | cor.style.height = (valor*100)/10000;
13 | cor.style.background = this.cores.pop();
14 | coluna.appendChild(cor);
15 | const nomeDoMes = document.createElement("div");
16 | nomeDoMes.className = "grafico-coluna-texto";
17 | nomeDoMes.innerText = descricao;
18 | coluna.appendChild(cor);
19 | coluna.appendChild(nomeDoMes);
20 | this.element.appendChild(coluna);
21 | }
22 | }
--------------------------------------------------------------------------------
/10/server.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const pgp = require("pg-promise");
3 |
4 | const app = express();
5 | app.use(express.json());
6 | app.use("/", express.static("./client"));
7 |
8 | const connection = pgp()("postgres://postgres:123456@localhost:5432/app");
9 |
10 | app.get("/api/lancamentos", async function (req, res) {
11 | const lancamentos = await connection.query("select * from financas_pessoais.lancamento", []);
12 | res.json(lancamentos);
13 | });
14 |
15 | app.post("/api/lancamentos", async function (req, res) {
16 | const lancamento = req.body;
17 | await connection.query("insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ($1, $2, $3, $4)", [lancamento.mes, lancamento.categoria, lancamento.tipo, lancamento.valor]);
18 | res.end();
19 | });
20 |
21 | app.listen(3000);
22 |
--------------------------------------------------------------------------------
/12/client/domain/ano.js:
--------------------------------------------------------------------------------
1 | class Ano {
2 |
3 | constructor () {
4 | this.meses = [];
5 | }
6 |
7 | adicionarMes (mes) {
8 | this.meses.push(mes);
9 | }
10 |
11 | adicionarLancamento (nomeDoMes, lancamento) {
12 | if(!this.meses.some(mes => mes.nome === nomeDoMes)) {
13 | this.adicionarMes(new Mes(nomeDoMes));
14 | }
15 | for (const mes of this.meses) {
16 | if (mes.nome === nomeDoMes) {
17 | mes.adicionarLancamento(lancamento);
18 | break;
19 | }
20 | }
21 | }
22 |
23 | deletarLancamento (mes, lancamento) {
24 | const pos = mes.lancamentos.indexOf(lancamento);
25 | mes.lancamentos.splice(pos, 1);
26 | }
27 |
28 | calcularSaldo () {
29 | let saldoInicial = 0;
30 | for (const mes of this.meses) {
31 | mes.saldoInicial = saldoInicial;
32 | mes.calcularSaldo();
33 | saldoInicial = mes.totalizador.saldo;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/8/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/10/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/11/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/9/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/12/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/11/server/LancamentoData.js:
--------------------------------------------------------------------------------
1 | const Lancamento = require("./Lancamento");
2 |
3 | class LancamentoData {
4 |
5 | constructor (connection) {
6 | this.connection = connection;
7 | }
8 |
9 | async getLancamentos () {
10 | const lancamentosData = await this.connection.query("select * from financas_pessoais.lancamento", [])
11 | const lancamentos = [];
12 | for (const lancamentoData of lancamentosData) {
13 | lancamentos.push(new Lancamento(lancamentoData.id_lancamento, lancamentoData.mes, lancamentoData.categoria, lancamentoData.tipo, parseFloat(lancamentoData.valor)));
14 | }
15 | return lancamentos;
16 | }
17 |
18 | async saveLancamento (lancamento) {
19 | await this.connection.query("insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ($1, $2, $3, $4)", [lancamento.mes, lancamento.categoria, lancamento.tipo, lancamento.valor]);
20 | }
21 |
22 | async deleteLancamento (idLancamento) {
23 | await this.connection.query("delete from financas_pessoais.lancamento where id_lancamento = $1", [idLancamento]);
24 | }
25 | }
26 |
27 | module.exports = LancamentoData;
--------------------------------------------------------------------------------
/12/server/LancamentoData.js:
--------------------------------------------------------------------------------
1 | const Lancamento = require("./Lancamento");
2 |
3 | class LancamentoData {
4 |
5 | constructor (connection) {
6 | this.connection = connection;
7 | }
8 |
9 | async getLancamentos () {
10 | const lancamentosData = await this.connection.query("select * from financas_pessoais.lancamento", [])
11 | const lancamentos = [];
12 | for (const lancamentoData of lancamentosData) {
13 | lancamentos.push(new Lancamento(lancamentoData.id_lancamento, lancamentoData.mes, lancamentoData.categoria, lancamentoData.tipo, parseFloat(lancamentoData.valor)));
14 | }
15 | return lancamentos;
16 | }
17 |
18 | async saveLancamento (lancamento) {
19 | await this.connection.query("insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ($1, $2, $3, $4)", [lancamento.mes, lancamento.categoria, lancamento.tipo, lancamento.valor]);
20 | }
21 |
22 | async deleteLancamento (idLancamento) {
23 | await this.connection.query("delete from financas_pessoais.lancamento where id_lancamento = $1", [idLancamento]);
24 | }
25 | }
26 |
27 | module.exports = LancamentoData;
--------------------------------------------------------------------------------
/8/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Verdana;
3 | }
4 | input {
5 | width: 100%;
6 | height: 30px;
7 | padding: 3px;
8 | font-size: 15px;
9 | border-radius: 4px;
10 | margin-bottom: 5px;
11 | border: 1px solid #CCC;
12 | text-indent: 4px;
13 | }
14 | select {
15 | width: 100%;
16 | height: 30px;
17 | font-size: 15px;
18 | border-radius: 4px;
19 | margin-bottom: 5px;
20 | border: 1px solid #CCC;
21 | }
22 | #form-lancamento {
23 | position: fixed;
24 | right: 20;
25 | width: 200px;
26 | border: 1px solid #000;
27 | padding: 10px;
28 | }
29 | button {
30 | width: 100%;
31 | height: 30px;
32 | color: #FFF;
33 | background-color: #000;
34 | border: none;
35 | border-radius: 4px;
36 | }
37 | .tabela-lancamentos {
38 | width: 600px;
39 | background-color: #EEE;
40 | border-collapse: collapse;
41 | }
42 | .tabela-lancamentos td, .tabela-lancamentos th {
43 | border: 1px solid #ddd;
44 | padding: 8px;
45 | }
46 | .tabela-lancamentos tr:nth-child(even) {
47 | background-color: #FFF;
48 | }
49 | .tabela-lancamentos th {
50 | padding-top: 10px;
51 | padding-bottom: 10px;
52 | background-color: #CCC;
53 | text-align: left;
54 | width: 50%;
55 | }
56 | .grafico {
57 | width: 600px;
58 | height: 200px;
59 | border: 1px solid #000;
60 | display: flex;
61 | flex-direction: row;
62 | justify-content: space-around;
63 | align-items: flex-end;
64 | }
65 | .grafico-coluna {
66 | width: 120px;
67 | }
68 | .grafico-coluna-cor {
69 | height: 120px;
70 | background-color: red;
71 | }
72 | .grafico-coluna-texto {
73 | text-align: center;
74 | }
--------------------------------------------------------------------------------
/10/client/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Verdana;
3 | }
4 | input {
5 | width: 100%;
6 | height: 30px;
7 | padding: 3px;
8 | font-size: 15px;
9 | border-radius: 4px;
10 | margin-bottom: 5px;
11 | border: 1px solid #CCC;
12 | text-indent: 4px;
13 | }
14 | select {
15 | width: 100%;
16 | height: 30px;
17 | font-size: 15px;
18 | border-radius: 4px;
19 | margin-bottom: 5px;
20 | border: 1px solid #CCC;
21 | }
22 | #form-lancamento {
23 | position: fixed;
24 | right: 20;
25 | width: 200px;
26 | border: 1px solid #000;
27 | padding: 10px;
28 | }
29 | button {
30 | width: 100%;
31 | height: 30px;
32 | color: #FFF;
33 | background-color: #000;
34 | border: none;
35 | border-radius: 4px;
36 | }
37 | .tabela-lancamentos {
38 | width: 600px;
39 | background-color: #EEE;
40 | border-collapse: collapse;
41 | }
42 | .tabela-lancamentos td, .tabela-lancamentos th {
43 | border: 1px solid #ddd;
44 | padding: 8px;
45 | }
46 | .tabela-lancamentos tr:nth-child(even) {
47 | background-color: #FFF;
48 | }
49 | .tabela-lancamentos th {
50 | padding-top: 10px;
51 | padding-bottom: 10px;
52 | background-color: #CCC;
53 | text-align: left;
54 | width: 50%;
55 | }
56 | .grafico {
57 | width: 600px;
58 | height: 200px;
59 | border: 1px solid #000;
60 | display: flex;
61 | flex-direction: row;
62 | justify-content: space-around;
63 | align-items: flex-end;
64 | }
65 | .grafico-coluna {
66 | width: 120px;
67 | }
68 | .grafico-coluna-cor {
69 | height: 120px;
70 | background-color: red;
71 | }
72 | .grafico-coluna-texto {
73 | text-align: center;
74 | }
--------------------------------------------------------------------------------
/11/client/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Verdana;
3 | }
4 | input {
5 | width: 100%;
6 | height: 30px;
7 | padding: 3px;
8 | font-size: 15px;
9 | border-radius: 4px;
10 | margin-bottom: 5px;
11 | border: 1px solid #CCC;
12 | text-indent: 4px;
13 | }
14 | select {
15 | width: 100%;
16 | height: 30px;
17 | font-size: 15px;
18 | border-radius: 4px;
19 | margin-bottom: 5px;
20 | border: 1px solid #CCC;
21 | }
22 | #form-lancamento {
23 | position: fixed;
24 | right: 20;
25 | width: 200px;
26 | border: 1px solid #000;
27 | padding: 10px;
28 | }
29 | button {
30 | width: 100%;
31 | height: 30px;
32 | color: #FFF;
33 | background-color: #000;
34 | border: none;
35 | border-radius: 4px;
36 | }
37 | .tabela-lancamentos {
38 | width: 600px;
39 | background-color: #EEE;
40 | border-collapse: collapse;
41 | }
42 | .tabela-lancamentos td, .tabela-lancamentos th {
43 | border: 1px solid #ddd;
44 | padding: 8px;
45 | }
46 | .tabela-lancamentos tr:nth-child(even) {
47 | background-color: #FFF;
48 | }
49 | .tabela-lancamentos th {
50 | padding-top: 10px;
51 | padding-bottom: 10px;
52 | background-color: #CCC;
53 | text-align: left;
54 | width: 50%;
55 | }
56 | .grafico {
57 | width: 600px;
58 | height: 200px;
59 | border: 1px solid #000;
60 | display: flex;
61 | flex-direction: row;
62 | justify-content: space-around;
63 | align-items: flex-end;
64 | }
65 | .grafico-coluna {
66 | width: 120px;
67 | }
68 | .grafico-coluna-cor {
69 | height: 120px;
70 | background-color: red;
71 | }
72 | .grafico-coluna-texto {
73 | text-align: center;
74 | }
--------------------------------------------------------------------------------
/12/client/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Verdana;
3 | }
4 | input {
5 | width: 100%;
6 | height: 30px;
7 | padding: 3px;
8 | font-size: 15px;
9 | border-radius: 4px;
10 | margin-bottom: 5px;
11 | border: 1px solid #CCC;
12 | text-indent: 4px;
13 | }
14 | select {
15 | width: 100%;
16 | height: 30px;
17 | font-size: 15px;
18 | border-radius: 4px;
19 | margin-bottom: 5px;
20 | border: 1px solid #CCC;
21 | }
22 | #form-lancamento {
23 | position: fixed;
24 | right: 20;
25 | width: 200px;
26 | border: 1px solid #000;
27 | padding: 10px;
28 | }
29 | button {
30 | width: 100%;
31 | height: 30px;
32 | color: #FFF;
33 | background-color: #000;
34 | border: none;
35 | border-radius: 4px;
36 | }
37 | .tabela-lancamentos {
38 | width: 600px;
39 | background-color: #EEE;
40 | border-collapse: collapse;
41 | }
42 | .tabela-lancamentos td, .tabela-lancamentos th {
43 | border: 1px solid #ddd;
44 | padding: 8px;
45 | }
46 | .tabela-lancamentos tr:nth-child(even) {
47 | background-color: #FFF;
48 | }
49 | .tabela-lancamentos th {
50 | padding-top: 10px;
51 | padding-bottom: 10px;
52 | background-color: #CCC;
53 | text-align: left;
54 | width: 50%;
55 | }
56 | .grafico {
57 | width: 600px;
58 | height: 200px;
59 | border: 1px solid #000;
60 | display: flex;
61 | flex-direction: row;
62 | justify-content: space-around;
63 | align-items: flex-end;
64 | }
65 | .grafico-coluna {
66 | width: 120px;
67 | }
68 | .grafico-coluna-cor {
69 | height: 120px;
70 | background-color: red;
71 | }
72 | .grafico-coluna-texto {
73 | text-align: center;
74 | }
--------------------------------------------------------------------------------
/9/client/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Verdana;
3 | }
4 | input {
5 | width: 100%;
6 | height: 30px;
7 | padding: 3px;
8 | font-size: 15px;
9 | border-radius: 4px;
10 | margin-bottom: 5px;
11 | border: 1px solid #CCC;
12 | text-indent: 4px;
13 | }
14 | select {
15 | width: 100%;
16 | height: 30px;
17 | font-size: 15px;
18 | border-radius: 4px;
19 | margin-bottom: 5px;
20 | border: 1px solid #CCC;
21 | }
22 | #form-lancamento {
23 | position: fixed;
24 | right: 20;
25 | width: 200px;
26 | border: 1px solid #000;
27 | padding: 10px;
28 | }
29 | button {
30 | width: 100%;
31 | height: 30px;
32 | color: #FFF;
33 | background-color: #000;
34 | border: none;
35 | border-radius: 4px;
36 | }
37 | .tabela-lancamentos {
38 | width: 600px;
39 | background-color: #EEE;
40 | border-collapse: collapse;
41 | }
42 | .tabela-lancamentos td, .tabela-lancamentos th {
43 | border: 1px solid #ddd;
44 | padding: 8px;
45 | }
46 | .tabela-lancamentos tr:nth-child(even) {
47 | background-color: #FFF;
48 | }
49 | .tabela-lancamentos th {
50 | padding-top: 10px;
51 | padding-bottom: 10px;
52 | background-color: #CCC;
53 | text-align: left;
54 | width: 50%;
55 | }
56 | .grafico {
57 | width: 600px;
58 | height: 200px;
59 | border: 1px solid #000;
60 | display: flex;
61 | flex-direction: row;
62 | justify-content: space-around;
63 | align-items: flex-end;
64 | }
65 | .grafico-coluna {
66 | width: 120px;
67 | }
68 | .grafico-coluna-cor {
69 | height: 120px;
70 | background-color: red;
71 | }
72 | .grafico-coluna-texto {
73 | text-align: center;
74 | }
--------------------------------------------------------------------------------
/9/server.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const app = express();
3 | app.use(express.json());
4 | app.use("/", express.static("./client"));
5 |
6 | const lancamentos = [
7 | { mes: "janeiro", categoria: "Salário", tipo: "receita", valor: 4000 },
8 | { mes: "janeiro", categoria: "Aluguel", tipo: "despesa", valor: 1000 },
9 | { mes: "janeiro", categoria: "Conta de Luz", tipo: "despesa", valor: 200 },
10 | { mes: "janeiro", categoria: "Conta de Água", tipo: "despesa", valor: 100 },
11 | { mes: "janeiro", categoria: "Internet", tipo: "despesa", valor: 100 },
12 | { mes: "fevereiro", categoria: "Salário", tipo: "receita", valor: 3000 },
13 | { mes: "fevereiro", categoria: "Aluguel", tipo: "despesa", valor: 1200 },
14 | { mes: "fevereiro", categoria: "Conta de Luz", tipo: "despesa", valor: 250 },
15 | { mes: "fevereiro", categoria: "Conta de Água", tipo: "despesa", valor: 100 },
16 | { mes: "fevereiro", categoria: "Internet", tipo: "despesa", valor: 100 },
17 | { mes: "marco", categoria: "Salário", tipo: "receita", valor: 4000 },
18 | { mes: "marco", categoria: "Aluguel", tipo: "despesa", valor: 1200 },
19 | { mes: "marco", categoria: "Conta de Luz", tipo: "despesa", valor: 200 },
20 | { mes: "marco", categoria: "Conta de Água", tipo: "despesa", valor: 100 },
21 | { mes: "marco", categoria: "Internet", tipo: "despesa", valor: 200 },
22 | { mes: "abril", categoria: "Salário", tipo: "receita", valor: 4000 }
23 | ];
24 |
25 | // leio
26 | app.get("/api/lancamentos", function (req, res) {
27 | res.json(lancamentos);
28 | });
29 |
30 | // escrevo
31 | app.post("/api/lancamentos", function (req, res) {
32 | const lancamento = req.body;
33 | lancamentos.push(lancamento);
34 | res.end();
35 | });
36 |
37 | app.listen(3000);
38 |
--------------------------------------------------------------------------------
/1/index.html:
--------------------------------------------------------------------------------
1 |
2 |
60 |
--------------------------------------------------------------------------------
/2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
67 |
68 |
--------------------------------------------------------------------------------
/10/create.sql:
--------------------------------------------------------------------------------
1 | create schema financas_pessoais;
2 |
3 | create table financas_pessoais.lancamento (
4 | id_lancamento serial primary key,
5 | mes text,
6 | categoria text,
7 | tipo text,
8 | valor numeric
9 | );
10 |
11 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Salário', 'receita', 3000);
12 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Aluguel', 'despesa', 1000);
13 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Luz', 'despesa', 200);
14 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Água', 'despesa', 100);
15 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Transporte', 'despesa', 500);
16 |
17 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Salário', 'receita', 4000);
18 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Aluguel', 'despesa', 1000);
19 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Luz', 'despesa', 200);
20 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Água', 'despesa', 100);
21 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Transporte', 'despesa', 500);
22 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Alimentação', 'despesa', 500);
23 |
24 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Salário', 'receita', 4000);
25 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Aluguel', 'despesa', 1000);
26 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Conta de Luz', 'despesa', 200);
27 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Transporte', 'despesa', 500);
28 |
29 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('abril', 'Salário', 'receita', 4000);
30 |
--------------------------------------------------------------------------------
/11/create.sql:
--------------------------------------------------------------------------------
1 | create schema financas_pessoais;
2 |
3 | create table financas_pessoais.lancamento (
4 | id_lancamento serial primary key,
5 | mes text,
6 | categoria text,
7 | tipo text,
8 | valor numeric
9 | );
10 |
11 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Salário', 'receita', 3000);
12 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Aluguel', 'despesa', 1000);
13 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Luz', 'despesa', 200);
14 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Água', 'despesa', 100);
15 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Transporte', 'despesa', 500);
16 |
17 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Salário', 'receita', 4000);
18 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Aluguel', 'despesa', 1000);
19 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Luz', 'despesa', 200);
20 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Água', 'despesa', 100);
21 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Transporte', 'despesa', 500);
22 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Alimentação', 'despesa', 500);
23 |
24 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Salário', 'receita', 4000);
25 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Aluguel', 'despesa', 1000);
26 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Conta de Luz', 'despesa', 200);
27 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Transporte', 'despesa', 500);
28 |
29 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('abril', 'Salário', 'receita', 4000);
30 |
--------------------------------------------------------------------------------
/12/create.sql:
--------------------------------------------------------------------------------
1 | create schema financas_pessoais;
2 |
3 | create table financas_pessoais.lancamento (
4 | id_lancamento serial primary key,
5 | mes text,
6 | categoria text,
7 | tipo text,
8 | valor numeric
9 | );
10 |
11 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Salário', 'receita', 3000);
12 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Aluguel', 'despesa', 1000);
13 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Luz', 'despesa', 200);
14 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Conta de Água', 'despesa', 100);
15 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('janeiro', 'Transporte', 'despesa', 500);
16 |
17 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Salário', 'receita', 4000);
18 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Aluguel', 'despesa', 1000);
19 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Luz', 'despesa', 200);
20 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Conta de Água', 'despesa', 100);
21 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Transporte', 'despesa', 500);
22 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('fevereiro', 'Alimentação', 'despesa', 500);
23 |
24 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Salário', 'receita', 4000);
25 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Aluguel', 'despesa', 1000);
26 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Conta de Luz', 'despesa', 200);
27 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('marco', 'Transporte', 'despesa', 500);
28 |
29 | insert into financas_pessoais.lancamento (mes, categoria, tipo, valor) values ('abril', 'Salário', 'receita', 4000);
30 |
--------------------------------------------------------------------------------
/5/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome, saldoInicial) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = saldoInicial;
7 | this.totalizador = { saldo: 0, saldoInicial, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | adicionarLancamento (lancamento) {
12 | this.lancamentos.push(lancamento);
13 | }
14 |
15 | calcularSaldo () {
16 | this.totalizador.saldo = this.saldoInicial;
17 | this.apurarReceitas();
18 | this.apurarDespesas();
19 | this.distribuirDespesas();
20 | this.apurarJuros();
21 | this.apurarRendimentos();
22 | }
23 |
24 | apurarReceitas () {
25 | for (const lancamento of this.lancamentos) {
26 | if (lancamento.tipo === "receita") {
27 | this.totalizador.saldo += lancamento.valor
28 | this.totalizador.receitas += lancamento.valor
29 | }
30 | }
31 | }
32 |
33 | apurarDespesas () {
34 | for (const lancamento of this.lancamentos) {
35 | if (lancamento.tipo === "despesa") {
36 | this.totalizador.saldo -= lancamento.valor
37 | this.totalizador.despesas += lancamento.valor
38 | }
39 | }
40 | }
41 |
42 | distribuirDespesas () {
43 | const distribuicaoDeDespesas = [];
44 | for (const lancamento of this.lancamentos) {
45 | if (lancamento.tipo === "despesa") {
46 | const percentual = arredondar((lancamento.valor/this.totalizador.despesas)*100)
47 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual })
48 | }
49 | }
50 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas
51 | }
52 |
53 | apurarJuros () {
54 | if (this.totalizador.saldo < 0) {
55 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo)
56 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.juros)
57 | }
58 | }
59 |
60 | calcularJuros (valor) {
61 | const juros = arredondar(valor * 0.1);
62 | return juros;
63 | }
64 |
65 | apurarRendimentos () {
66 | if (this.totalizador.saldo > 0) {
67 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo)
68 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.rendimentos)
69 | }
70 | }
71 |
72 | calcularRendimentos (valor) {
73 | const rendimentos = arredondar(valor * 0.005);
74 | return rendimentos;
75 | }
76 | }
--------------------------------------------------------------------------------
/5/main.js:
--------------------------------------------------------------------------------
1 | const saldoInicial = 0
2 | const janeiro = new Mes("janeiro", saldoInicial);
3 | janeiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
4 | janeiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1000));
5 | janeiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
6 | janeiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
7 | janeiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
8 | janeiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 300));
9 | janeiro.adicionarLancamento(new Lancamento("Lazer", "despesa", 300));
10 | janeiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 500));
11 | janeiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 300));
12 | janeiro.adicionarLancamento(new Lancamento("Farmácia", "despesa", 100));
13 | janeiro.calcularSaldo();
14 | console.log(janeiro);
15 |
16 | const fevereiro = new Mes("fevereiro", janeiro.totalizador.saldo);
17 | fevereiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
18 | fevereiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
19 | fevereiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 250));
20 | fevereiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
21 | fevereiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
22 | fevereiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
23 | fevereiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
24 | fevereiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
25 | fevereiro.calcularSaldo();
26 | console.log(fevereiro)
27 |
28 | const marco = new Mes("marco", fevereiro.totalizador.saldo);
29 | marco.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
30 | marco.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
31 | marco.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
32 | marco.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
33 | marco.adicionarLancamento(new Lancamento("Internet", "despesa", 200));
34 | marco.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
35 | marco.adicionarLancamento(new Lancamento("Lazer", "despesa", 800));
36 | marco.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
37 | marco.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
38 | marco.calcularSaldo();
39 | console.log(marco);
--------------------------------------------------------------------------------
/6/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | adicionarLancamento (lancamento) {
12 | this.lancamentos.push(lancamento);
13 | }
14 |
15 | calcularSaldo () {
16 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
17 | this.totalizador.saldo = this.saldoInicial;
18 | this.apurarReceitas();
19 | this.apurarDespesas();
20 | this.distribuirDespesas();
21 | this.apurarJuros();
22 | this.apurarRendimentos();
23 | }
24 |
25 | apurarReceitas () {
26 | for (const lancamento of this.lancamentos) {
27 | if (lancamento.tipo === "receita") {
28 | this.totalizador.saldo += lancamento.valor;
29 | this.totalizador.receitas += lancamento.valor;
30 | }
31 | }
32 | }
33 |
34 | apurarDespesas () {
35 | for (const lancamento of this.lancamentos) {
36 | if (lancamento.tipo === "despesa") {
37 | this.totalizador.saldo -= lancamento.valor;
38 | this.totalizador.despesas += lancamento.valor;
39 | }
40 | }
41 | }
42 |
43 | distribuirDespesas () {
44 | const distribuicaoDeDespesas = [];
45 | for (const lancamento of this.lancamentos) {
46 | if (lancamento.tipo === "despesa") {
47 | const percentual = arredondar((lancamento.valor/this.totalizador.despesas)*100);
48 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
49 | }
50 | }
51 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
52 | }
53 |
54 | apurarJuros () {
55 | if (this.totalizador.saldo < 0) {
56 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
57 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.juros);
58 | }
59 | }
60 |
61 | calcularJuros (valor) {
62 | const juros = arredondar(valor * 0.1);
63 | return juros;
64 | }
65 |
66 | apurarRendimentos () {
67 | if (this.totalizador.saldo > 0) {
68 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
69 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
70 | }
71 | }
72 |
73 | calcularRendimentos (valor) {
74 | const rendimentos = arredondar(valor * 0.005);
75 | return rendimentos;
76 | }
77 | }
--------------------------------------------------------------------------------
/7/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | adicionarLancamento (lancamento) {
12 | this.lancamentos.push(lancamento);
13 | }
14 |
15 | calcularSaldo () {
16 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
17 | this.totalizador.saldo = this.saldoInicial;
18 | this.apurarReceitas();
19 | this.apurarDespesas();
20 | this.distribuirDespesas();
21 | this.apurarJuros();
22 | this.apurarRendimentos();
23 | }
24 |
25 | apurarReceitas () {
26 | for (const lancamento of this.lancamentos) {
27 | if (lancamento.tipo === "receita") {
28 | this.totalizador.saldo += lancamento.valor;
29 | this.totalizador.receitas += lancamento.valor;
30 | }
31 | }
32 | }
33 |
34 | apurarDespesas () {
35 | for (const lancamento of this.lancamentos) {
36 | if (lancamento.tipo === "despesa") {
37 | this.totalizador.saldo -= lancamento.valor;
38 | this.totalizador.despesas += lancamento.valor;
39 | }
40 | }
41 | }
42 |
43 | distribuirDespesas () {
44 | const distribuicaoDeDespesas = [];
45 | for (const lancamento of this.lancamentos) {
46 | if (lancamento.tipo === "despesa") {
47 | const percentual = arredondar((lancamento.valor/this.totalizador.despesas)*100);
48 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
49 | }
50 | }
51 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
52 | }
53 |
54 | apurarJuros () {
55 | if (this.totalizador.saldo < 0) {
56 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
57 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.juros);
58 | }
59 | }
60 |
61 | calcularJuros (valor) {
62 | const juros = arredondar(valor * 0.1);
63 | return juros;
64 | }
65 |
66 | apurarRendimentos () {
67 | if (this.totalizador.saldo > 0) {
68 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
69 | this.totalizador.saldo = arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
70 | }
71 | }
72 |
73 | calcularRendimentos (valor) {
74 | const rendimentos = arredondar(valor * 0.005);
75 | return rendimentos;
76 | }
77 | }
--------------------------------------------------------------------------------
/8/domain/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | arredondar (valor) {
12 | return Math.round(valor*100)/100;
13 | }
14 |
15 | adicionarLancamento (lancamento) {
16 | this.lancamentos.push(lancamento);
17 | }
18 |
19 | calcularSaldo () {
20 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
21 | this.totalizador.saldo = this.saldoInicial;
22 | this.apurarReceitas();
23 | this.apurarDespesas();
24 | this.distribuirDespesas();
25 | this.apurarJuros();
26 | this.apurarRendimentos();
27 | }
28 |
29 | apurarReceitas () {
30 | for (const lancamento of this.lancamentos) {
31 | if (lancamento.tipo === "receita") {
32 | this.totalizador.saldo += lancamento.valor;
33 | this.totalizador.receitas += lancamento.valor;
34 | }
35 | }
36 | }
37 |
38 | apurarDespesas () {
39 | for (const lancamento of this.lancamentos) {
40 | if (lancamento.tipo === "despesa") {
41 | this.totalizador.saldo -= lancamento.valor;
42 | this.totalizador.despesas += lancamento.valor;
43 | }
44 | }
45 | }
46 |
47 | distribuirDespesas () {
48 | const distribuicaoDeDespesas = [];
49 | for (const lancamento of this.lancamentos) {
50 | if (lancamento.tipo === "despesa") {
51 | const percentual = this.arredondar((lancamento.valor/this.totalizador.despesas)*100);
52 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
53 | }
54 | }
55 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
56 | }
57 |
58 | apurarJuros () {
59 | if (this.totalizador.saldo < 0) {
60 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
61 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.juros);
62 | }
63 | }
64 |
65 | calcularJuros (valor) {
66 | const juros = this.arredondar(valor * 0.1);
67 | return juros;
68 | }
69 |
70 | apurarRendimentos () {
71 | if (this.totalizador.saldo > 0) {
72 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
73 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
74 | }
75 | }
76 |
77 | calcularRendimentos (valor) {
78 | const rendimentos = this.arredondar(valor * 0.005);
79 | return rendimentos;
80 | }
81 | }
--------------------------------------------------------------------------------
/9/client/domain/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | arredondar (valor) {
12 | return Math.round(valor*100)/100;
13 | }
14 |
15 | adicionarLancamento (lancamento) {
16 | this.lancamentos.push(lancamento);
17 | }
18 |
19 | calcularSaldo () {
20 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
21 | this.totalizador.saldo = this.saldoInicial;
22 | this.apurarReceitas();
23 | this.apurarDespesas();
24 | this.distribuirDespesas();
25 | this.apurarJuros();
26 | this.apurarRendimentos();
27 | }
28 |
29 | apurarReceitas () {
30 | for (const lancamento of this.lancamentos) {
31 | if (lancamento.tipo === "receita") {
32 | this.totalizador.saldo += lancamento.valor;
33 | this.totalizador.receitas += lancamento.valor;
34 | }
35 | }
36 | }
37 |
38 | apurarDespesas () {
39 | for (const lancamento of this.lancamentos) {
40 | if (lancamento.tipo === "despesa") {
41 | this.totalizador.saldo -= lancamento.valor;
42 | this.totalizador.despesas += lancamento.valor;
43 | }
44 | }
45 | }
46 |
47 | distribuirDespesas () {
48 | const distribuicaoDeDespesas = [];
49 | for (const lancamento of this.lancamentos) {
50 | if (lancamento.tipo === "despesa") {
51 | const percentual = this.arredondar((lancamento.valor/this.totalizador.despesas)*100);
52 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
53 | }
54 | }
55 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
56 | }
57 |
58 | apurarJuros () {
59 | if (this.totalizador.saldo < 0) {
60 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
61 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.juros);
62 | }
63 | }
64 |
65 | calcularJuros (valor) {
66 | const juros = this.arredondar(valor * 0.1);
67 | return juros;
68 | }
69 |
70 | apurarRendimentos () {
71 | if (this.totalizador.saldo > 0) {
72 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
73 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
74 | }
75 | }
76 |
77 | calcularRendimentos (valor) {
78 | const rendimentos = this.arredondar(valor * 0.005);
79 | return rendimentos;
80 | }
81 | }
--------------------------------------------------------------------------------
/10/client/domain/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | arredondar (valor) {
12 | return Math.round(valor*100)/100;
13 | }
14 |
15 | adicionarLancamento (lancamento) {
16 | this.lancamentos.push(lancamento);
17 | }
18 |
19 | calcularSaldo () {
20 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
21 | this.totalizador.saldo = this.saldoInicial;
22 | this.apurarReceitas();
23 | this.apurarDespesas();
24 | this.distribuirDespesas();
25 | this.apurarJuros();
26 | this.apurarRendimentos();
27 | }
28 |
29 | apurarReceitas () {
30 | for (const lancamento of this.lancamentos) {
31 | if (lancamento.tipo === "receita") {
32 | this.totalizador.saldo += lancamento.valor;
33 | this.totalizador.receitas += lancamento.valor;
34 | }
35 | }
36 | }
37 |
38 | apurarDespesas () {
39 | for (const lancamento of this.lancamentos) {
40 | if (lancamento.tipo === "despesa") {
41 | this.totalizador.saldo -= lancamento.valor;
42 | this.totalizador.despesas += lancamento.valor;
43 | }
44 | }
45 | }
46 |
47 | distribuirDespesas () {
48 | const distribuicaoDeDespesas = [];
49 | for (const lancamento of this.lancamentos) {
50 | if (lancamento.tipo === "despesa") {
51 | const percentual = this.arredondar((lancamento.valor/this.totalizador.despesas)*100);
52 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
53 | }
54 | }
55 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
56 | }
57 |
58 | apurarJuros () {
59 | if (this.totalizador.saldo < 0) {
60 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
61 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.juros);
62 | }
63 | }
64 |
65 | calcularJuros (valor) {
66 | const juros = this.arredondar(valor * 0.1);
67 | return juros;
68 | }
69 |
70 | apurarRendimentos () {
71 | if (this.totalizador.saldo > 0) {
72 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
73 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
74 | }
75 | }
76 |
77 | calcularRendimentos (valor) {
78 | const rendimentos = this.arredondar(valor * 0.005);
79 | return rendimentos;
80 | }
81 | }
--------------------------------------------------------------------------------
/11/client/domain/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | arredondar (valor) {
12 | return Math.round(valor*100)/100;
13 | }
14 |
15 | adicionarLancamento (lancamento) {
16 | this.lancamentos.push(lancamento);
17 | }
18 |
19 | calcularSaldo () {
20 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
21 | this.totalizador.saldo = this.saldoInicial;
22 | this.apurarReceitas();
23 | this.apurarDespesas();
24 | this.distribuirDespesas();
25 | this.apurarJuros();
26 | this.apurarRendimentos();
27 | }
28 |
29 | apurarReceitas () {
30 | for (const lancamento of this.lancamentos) {
31 | if (lancamento.tipo === "receita") {
32 | this.totalizador.saldo += lancamento.valor;
33 | this.totalizador.receitas += lancamento.valor;
34 | }
35 | }
36 | }
37 |
38 | apurarDespesas () {
39 | for (const lancamento of this.lancamentos) {
40 | if (lancamento.tipo === "despesa") {
41 | this.totalizador.saldo -= lancamento.valor;
42 | this.totalizador.despesas += lancamento.valor;
43 | }
44 | }
45 | }
46 |
47 | distribuirDespesas () {
48 | const distribuicaoDeDespesas = [];
49 | for (const lancamento of this.lancamentos) {
50 | if (lancamento.tipo === "despesa") {
51 | const percentual = this.arredondar((lancamento.valor/this.totalizador.despesas)*100);
52 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
53 | }
54 | }
55 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
56 | }
57 |
58 | apurarJuros () {
59 | if (this.totalizador.saldo < 0) {
60 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
61 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.juros);
62 | }
63 | }
64 |
65 | calcularJuros (valor) {
66 | const juros = this.arredondar(valor * 0.1);
67 | return juros;
68 | }
69 |
70 | apurarRendimentos () {
71 | if (this.totalizador.saldo > 0) {
72 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
73 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
74 | }
75 | }
76 |
77 | calcularRendimentos (valor) {
78 | const rendimentos = this.arredondar(valor * 0.005);
79 | return rendimentos;
80 | }
81 | }
--------------------------------------------------------------------------------
/12/client/domain/mes.js:
--------------------------------------------------------------------------------
1 | class Mes {
2 |
3 | constructor (nome) {
4 | if (nome === "") throw new Error("Mês Inválido: O nome é obrigatório");
5 | this.nome = nome;
6 | this.saldoInicial = 0;
7 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
8 | this.lancamentos = [];
9 | }
10 |
11 | arredondar (valor) {
12 | return Math.round(valor*100)/100;
13 | }
14 |
15 | adicionarLancamento (lancamento) {
16 | this.lancamentos.push(lancamento);
17 | }
18 |
19 | calcularSaldo () {
20 | this.totalizador = { saldo: 0, juros: 0, rendimentos: 0, receitas: 0, despesas: 0, distribuicaoDeDespesas: [] };
21 | this.totalizador.saldo = this.saldoInicial;
22 | this.apurarReceitas();
23 | this.apurarDespesas();
24 | this.distribuirDespesas();
25 | this.apurarJuros();
26 | this.apurarRendimentos();
27 | }
28 |
29 | apurarReceitas () {
30 | for (const lancamento of this.lancamentos) {
31 | if (lancamento.tipo === "receita") {
32 | this.totalizador.saldo += lancamento.valor;
33 | this.totalizador.receitas += lancamento.valor;
34 | }
35 | }
36 | }
37 |
38 | apurarDespesas () {
39 | for (const lancamento of this.lancamentos) {
40 | if (lancamento.tipo === "despesa") {
41 | this.totalizador.saldo -= lancamento.valor;
42 | this.totalizador.despesas += lancamento.valor;
43 | }
44 | }
45 | }
46 |
47 | distribuirDespesas () {
48 | const distribuicaoDeDespesas = [];
49 | for (const lancamento of this.lancamentos) {
50 | if (lancamento.tipo === "despesa") {
51 | const percentual = this.arredondar((lancamento.valor/this.totalizador.despesas)*100);
52 | distribuicaoDeDespesas.push({ categoria: lancamento.categoria, percentual });
53 | }
54 | }
55 | this.totalizador.distribuicaoDeDespesas = distribuicaoDeDespesas;
56 | }
57 |
58 | apurarJuros () {
59 | if (this.totalizador.saldo < 0) {
60 | this.totalizador.juros = this.calcularJuros(this.totalizador.saldo);
61 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.juros);
62 | }
63 | }
64 |
65 | calcularJuros (valor) {
66 | const juros = this.arredondar(valor * 0.1);
67 | return juros;
68 | }
69 |
70 | apurarRendimentos () {
71 | if (this.totalizador.saldo > 0) {
72 | this.totalizador.rendimentos = this.calcularRendimentos(this.totalizador.saldo);
73 | this.totalizador.saldo = this.arredondar(this.totalizador.saldo + this.totalizador.rendimentos);
74 | }
75 | }
76 |
77 | calcularRendimentos (valor) {
78 | const rendimentos = this.arredondar(valor * 0.005);
79 | return rendimentos;
80 | }
81 | }
--------------------------------------------------------------------------------
/7/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
79 |
80 |
81 | Finanças Pessoais
82 |
83 |
85 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/3/index.html:
--------------------------------------------------------------------------------
1 |
2 |
83 |
84 |
--------------------------------------------------------------------------------
/9/client/views/tela.js:
--------------------------------------------------------------------------------
1 | class Tela {
2 | constructor () {
3 | this.init();
4 | }
5 |
6 | async init () {
7 | const response = await fetch("http://localhost:3000/api/lancamentos");
8 | const lancamentos = await response.json();
9 | const ano = new Ano();
10 | ano.adicionarMes(new Mes("janeiro"));
11 | ano.adicionarMes(new Mes("fevereiro"));
12 | ano.adicionarMes(new Mes("marco"));
13 | ano.adicionarMes(new Mes("abril"));
14 | for (const lancamento of lancamentos) {
15 | ano.adicionarLancamento(lancamento.mes, new Lancamento(lancamento.categoria, lancamento.tipo, lancamento.valor));
16 | }
17 | ano.calcularSaldo();
18 | this.ano = ano;
19 | this.renderizar();
20 | }
21 |
22 | formatarDinheiro (valor) {
23 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
24 | }
25 |
26 | adicionarLancamento () {
27 | const mes = document.getElementById("mes");
28 | const categoria = document.getElementById("categoria");
29 | const tipo = document.getElementById("tipo");
30 | const valor = document.getElementById("valor");
31 | this.ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
32 | fetch("http://localhost:3000/api/lancamentos", { method: "post", headers: { "content-type": "application/json" }, body: JSON.stringify({ mes: mes.value, categoria: categoria.value, tipo: tipo.value, valor: parseFloat(valor.value) }) });
33 | this.ano.calcularSaldo();
34 | this.renderizar();
35 | mes.value = this.ano.meses[0].nome;
36 | tipo.value = "receita";
37 | categoria.value = "";
38 | valor.value = "";
39 | }
40 |
41 | renderizar () {
42 | document.getElementById("app").remove();
43 | const app = new Div("app");
44 | const titulo = new h4("Finanças Pessoais");
45 | app.adicionarElementoFilho(titulo.element);
46 | const form = new Div("form-lancamento");
47 | const mesSelect = new Select("mes");
48 | for (const mes of this.ano.meses) {
49 | mesSelect.addOption(mes.nome);
50 | }
51 | const tipoSelect = new Select("tipo");
52 | tipoSelect.addOption("receita");
53 | tipoSelect.addOption("despesa");
54 | const categoriaInputText = new Input("categoria", "text", "Categoria");
55 | const valorInputNumber = new Input("valor", "number", "Valor");
56 | const adicionarButton = new Button("botao", "Adicionar");
57 | adicionarButton.addListener(() => {
58 | this.adicionarLancamento();
59 | });
60 | form.adicionarElementoFilho(mesSelect.element);
61 | form.adicionarElementoFilho(tipoSelect.element);
62 | form.adicionarElementoFilho(categoriaInputText.element);
63 | form.adicionarElementoFilho(valorInputNumber.element);
64 | form.adicionarElementoFilho(adicionarButton.element);
65 | app.adicionarElementoFilho(form.element);
66 |
67 | const grafico = new Grafico();
68 | for (const mes of this.ano.meses) {
69 | grafico.adicionarColuna(mes.totalizador.saldo, mes.nome);
70 | }
71 | app.adicionarElementoFilho(grafico.element);
72 | for (const mes of this.ano.meses) {
73 | const nomeDoMes = new h4(mes.nome);
74 | app.adicionarElementoFilho(nomeDoMes.element);
75 | const tabelaLancamentos = new Tabela("tabela-lancamentos");
76 | tabelaLancamentos.addRow("th", ["Categoria", "Valor"]);
77 | for (const lancamento of mes.lancamentos) {
78 | tabelaLancamentos.addRow("td", [lancamento.categoria, this.formatarDinheiro(lancamento.getValorString())]);
79 | }
80 | tabelaLancamentos.addRow("th", ["Juros", this.formatarDinheiro(mes.totalizador.juros)]);
81 | tabelaLancamentos.addRow("th", ["Rendimentos", this.formatarDinheiro(mes.totalizador.rendimentos)]);
82 | tabelaLancamentos.addRow("th", ["Total", this.formatarDinheiro(mes.totalizador.saldo)]);
83 | app.adicionarElementoFilho(tabelaLancamentos.element);
84 | }
85 | const [body] = document.getElementsByTagName("body");
86 | body.appendChild(app.element);
87 | }
88 | }
--------------------------------------------------------------------------------
/10/client/views/tela.js:
--------------------------------------------------------------------------------
1 | class Tela {
2 | constructor () {
3 | this.init();
4 | }
5 |
6 | async init () {
7 | const response = await fetch("http://localhost:3000/api/lancamentos");
8 | const lancamentos = await response.json();
9 | const ano = new Ano();
10 | ano.adicionarMes(new Mes("janeiro"));
11 | ano.adicionarMes(new Mes("fevereiro"));
12 | ano.adicionarMes(new Mes("marco"));
13 | ano.adicionarMes(new Mes("abril"));
14 | for (const lancamento of lancamentos) {
15 | ano.adicionarLancamento(lancamento.mes, new Lancamento(lancamento.categoria, lancamento.tipo, parseFloat(lancamento.valor)));
16 | }
17 | ano.calcularSaldo();
18 | this.ano = ano;
19 | this.renderizar();
20 | }
21 |
22 | formatarDinheiro (valor) {
23 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
24 | }
25 |
26 | adicionarLancamento () {
27 | const mes = document.getElementById("mes");
28 | const categoria = document.getElementById("categoria");
29 | const tipo = document.getElementById("tipo");
30 | const valor = document.getElementById("valor");
31 | this.ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
32 | fetch("http://localhost:3000/api/lancamentos", { method: "post", headers: { "content-type": "application/json" }, body: JSON.stringify({ mes: mes.value, categoria: categoria.value, tipo: tipo.value, valor: parseFloat(valor.value) }) });
33 | this.ano.calcularSaldo();
34 | this.renderizar();
35 | mes.value = this.ano.meses[0].nome;
36 | tipo.value = "receita";
37 | categoria.value = "";
38 | valor.value = "";
39 | }
40 |
41 | renderizar () {
42 | document.getElementById("app").remove();
43 | const app = new Div("app");
44 | const titulo = new h4("Finanças Pessoais");
45 | app.adicionarElementoFilho(titulo.element);
46 | const form = new Div("form-lancamento");
47 | const mesSelect = new Select("mes");
48 | for (const mes of this.ano.meses) {
49 | mesSelect.addOption(mes.nome);
50 | }
51 | const tipoSelect = new Select("tipo");
52 | tipoSelect.addOption("receita");
53 | tipoSelect.addOption("despesa");
54 | const categoriaInputText = new Input("categoria", "text", "Categoria");
55 | const valorInputNumber = new Input("valor", "number", "Valor");
56 | const adicionarButton = new Button("botao", "Adicionar");
57 | adicionarButton.addListener(() => {
58 | this.adicionarLancamento();
59 | });
60 | form.adicionarElementoFilho(mesSelect.element);
61 | form.adicionarElementoFilho(tipoSelect.element);
62 | form.adicionarElementoFilho(categoriaInputText.element);
63 | form.adicionarElementoFilho(valorInputNumber.element);
64 | form.adicionarElementoFilho(adicionarButton.element);
65 | app.adicionarElementoFilho(form.element);
66 |
67 | const grafico = new Grafico();
68 | for (const mes of this.ano.meses) {
69 | grafico.adicionarColuna(mes.totalizador.saldo, mes.nome);
70 | }
71 | app.adicionarElementoFilho(grafico.element);
72 | for (const mes of this.ano.meses) {
73 | const nomeDoMes = new h4(mes.nome);
74 | app.adicionarElementoFilho(nomeDoMes.element);
75 | const tabelaLancamentos = new Tabela("tabela-lancamentos");
76 | tabelaLancamentos.addRow("th", ["Categoria", "Valor"]);
77 | for (const lancamento of mes.lancamentos) {
78 | tabelaLancamentos.addRow("td", [lancamento.categoria, this.formatarDinheiro(lancamento.getValorString())]);
79 | }
80 | tabelaLancamentos.addRow("th", ["Juros", this.formatarDinheiro(mes.totalizador.juros)]);
81 | tabelaLancamentos.addRow("th", ["Rendimentos", this.formatarDinheiro(mes.totalizador.rendimentos)]);
82 | tabelaLancamentos.addRow("th", ["Total", this.formatarDinheiro(mes.totalizador.saldo)]);
83 | app.adicionarElementoFilho(tabelaLancamentos.element);
84 | }
85 | const [body] = document.getElementsByTagName("body");
86 | body.appendChild(app.element);
87 | }
88 | }
--------------------------------------------------------------------------------
/11/client/views/tela.js:
--------------------------------------------------------------------------------
1 | class Tela {
2 | constructor () {
3 | this.init();
4 | }
5 |
6 | async init () {
7 | const response = await fetch("http://localhost:3000/api/lancamentos");
8 | const lancamentos = await response.json();
9 | const ano = new Ano();
10 | ano.adicionarMes(new Mes("janeiro"));
11 | ano.adicionarMes(new Mes("fevereiro"));
12 | ano.adicionarMes(new Mes("marco"));
13 | ano.adicionarMes(new Mes("abril"));
14 | for (const lancamento of lancamentos) {
15 | ano.adicionarLancamento(lancamento.mes, new Lancamento(lancamento.categoria, lancamento.tipo, lancamento.valor, lancamento.idLancamento));
16 | }
17 | ano.calcularSaldo();
18 | this.ano = ano;
19 | this.renderizar();
20 | }
21 |
22 | formatarDinheiro (valor) {
23 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
24 | }
25 |
26 | adicionarLancamento () {
27 | const mes = document.getElementById("mes");
28 | const categoria = document.getElementById("categoria");
29 | const tipo = document.getElementById("tipo");
30 | const valor = document.getElementById("valor");
31 | this.ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
32 | fetch("http://localhost:3000/api/lancamentos", { method: "post", headers: { "content-type": "application/json" }, body: JSON.stringify({ mes: mes.value, categoria: categoria.value, tipo: tipo.value, valor: parseFloat(valor.value) }) });
33 | this.ano.calcularSaldo();
34 | this.renderizar();
35 | mes.value = this.ano.meses[0].nome;
36 | tipo.value = "receita";
37 | categoria.value = "";
38 | valor.value = "";
39 | }
40 |
41 | deletarLancamento (idLancamento) {
42 | fetch(`http://localhost:3000/api/lancamentos/${idLancamento}`, { method: "delete" });
43 | }
44 |
45 | renderizar () {
46 | document.getElementById("app").remove();
47 | const app = new Div("app");
48 | const titulo = new h4("Finanças Pessoais");
49 | app.adicionarElementoFilho(titulo.element);
50 | const form = new Div("form-lancamento");
51 | const mesSelect = new Select("mes");
52 | for (const mes of this.ano.meses) {
53 | mesSelect.addOption(mes.nome);
54 | }
55 | const tipoSelect = new Select("tipo");
56 | tipoSelect.addOption("receita");
57 | tipoSelect.addOption("despesa");
58 | const categoriaInputText = new Input("categoria", "text", "Categoria");
59 | const valorInputNumber = new Input("valor", "number", "Valor");
60 | const adicionarButton = new Button("botao", "Adicionar");
61 | adicionarButton.addListener(() => {
62 | this.adicionarLancamento();
63 | });
64 | form.adicionarElementoFilho(mesSelect.element);
65 | form.adicionarElementoFilho(tipoSelect.element);
66 | form.adicionarElementoFilho(categoriaInputText.element);
67 | form.adicionarElementoFilho(valorInputNumber.element);
68 | form.adicionarElementoFilho(adicionarButton.element);
69 | app.adicionarElementoFilho(form.element);
70 |
71 | const grafico = new Grafico();
72 | for (const mes of this.ano.meses) {
73 | grafico.adicionarColuna(mes.totalizador.saldo, mes.nome);
74 | }
75 | app.adicionarElementoFilho(grafico.element);
76 | for (const mes of this.ano.meses) {
77 | const nomeDoMes = new h4(mes.nome);
78 | app.adicionarElementoFilho(nomeDoMes.element);
79 | const tabelaLancamentos = new Tabela("tabela-lancamentos");
80 | tabelaLancamentos.addRow("th", ["Categoria", "Valor"]);
81 | for (const lancamento of mes.lancamentos) {
82 | const button = new Button("delete-lancamento", "delete");
83 | button.addListener(() => {
84 | this.deletarLancamento(lancamento.idLancamento);
85 | this.ano.deletarLancamento(mes, lancamento);
86 | this.renderizar();
87 | });
88 | tabelaLancamentos.addRow("td", [lancamento.categoria, this.formatarDinheiro(lancamento.getValorString())], [button]);
89 | }
90 | tabelaLancamentos.addRow("th", ["Juros", this.formatarDinheiro(mes.totalizador.juros)]);
91 | tabelaLancamentos.addRow("th", ["Rendimentos", this.formatarDinheiro(mes.totalizador.rendimentos)]);
92 | tabelaLancamentos.addRow("th", ["Total", this.formatarDinheiro(mes.totalizador.saldo)]);
93 | app.adicionarElementoFilho(tabelaLancamentos.element);
94 | }
95 | const [body] = document.getElementsByTagName("body");
96 | body.appendChild(app.element);
97 | }
98 | }
--------------------------------------------------------------------------------
/12/client/views/tela.js:
--------------------------------------------------------------------------------
1 | class Tela {
2 | constructor (lancamentoService) {
3 | this.lancamentoService = lancamentoService;
4 | this.init();
5 | }
6 |
7 | async init () {
8 | const lancamentos = await this.lancamentoService.getLancamentos();
9 | this.ano = new Ano();
10 | for (const lancamento of lancamentos) {
11 | this.ano.adicionarLancamento(lancamento.mes, new Lancamento(lancamento.categoria, lancamento.tipo, lancamento.valor, lancamento.idLancamento));
12 | }
13 | this.ano.calcularSaldo();
14 | this.renderizar();
15 | }
16 |
17 | formatarDinheiro (valor) {
18 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
19 | }
20 |
21 | adicionarLancamento () {
22 | const mes = this.mesSelect.getValue();
23 | const categoria = this.categoriaInputText.getValue();
24 | const tipo = this.tipoSelect.getValue();
25 | const valor = this.valorInputNumber.getValue();
26 | this.ano.adicionarLancamento(mes, new Lancamento(categoria, tipo, valor));
27 | const lancamento = { mes, categoria: categoria, tipo: tipo, valor: valor};
28 | this.lancamentoService.saveLancamento(lancamento);
29 | this.ano.calcularSaldo();
30 | this.renderizar();
31 | }
32 |
33 | deletarLancamento (mes, lancamento) {
34 | this.lancamentoService.deleteLancamento(lancamento.idLancamento);
35 | this.ano.deletarLancamento(mes, lancamento);
36 | this.ano.calcularSaldo();
37 | this.renderizar();
38 | }
39 |
40 | renderizar () {
41 | document.getElementById("app").remove();
42 | const app = new Div("app");
43 | const titulo = new h4("Finanças Pessoais");
44 | app.adicionarElementoFilho(titulo.element);
45 | const form = this.criarForm();
46 | app.adicionarElementoFilho(form.element);
47 | const grafico = this.criarGrafico();
48 | app.adicionarElementoFilho(grafico.element);
49 | for (const mes of this.ano.meses) {
50 | const nomeDoMes = new h4(mes.nome);
51 | app.adicionarElementoFilho(nomeDoMes.element);
52 | const tabelaLancamentos = this.criarTabelaLancamentos(mes);
53 | app.adicionarElementoFilho(tabelaLancamentos.element);
54 | }
55 | const [body] = document.getElementsByTagName("body");
56 | body.appendChild(app.element);
57 | }
58 |
59 | criarForm () {
60 | const form = new Div("form-lancamento");
61 | this.mesSelect = new Select("mes");
62 | for (const mes of this.ano.meses) {
63 | this.mesSelect.addOption(mes.nome);
64 | }
65 | this.tipoSelect = new Select("tipo");
66 | this.tipoSelect.addOption("receita");
67 | this.tipoSelect.addOption("despesa");
68 | this.categoriaInputText = new Input("categoria", "text", "Categoria");
69 | this.valorInputNumber = new Input("valor", "number", "Valor");
70 | const adicionarButton = new Button("botao", "Adicionar");
71 | adicionarButton.addListener(() => {
72 | this.adicionarLancamento();
73 | });
74 | form.adicionarElementoFilho(this.mesSelect.element);
75 | form.adicionarElementoFilho(this.tipoSelect.element);
76 | form.adicionarElementoFilho(this.categoriaInputText.element);
77 | form.adicionarElementoFilho(this.valorInputNumber.element);
78 | form.adicionarElementoFilho(adicionarButton.element);
79 | return form;
80 | }
81 |
82 | criarGrafico () {
83 | const grafico = new Grafico();
84 | for (const mes of this.ano.meses) {
85 | grafico.adicionarColuna(mes.totalizador.saldo, mes.nome);
86 | }
87 | return grafico;
88 | }
89 |
90 | criarTabelaLancamentos (mes) {
91 | const tabelaLancamentos = new Tabela("tabela-lancamentos");
92 | tabelaLancamentos.addRow("th", ["Categoria", "Valor"]);
93 | for (const lancamento of mes.lancamentos) {
94 | const button = new Button("delete-lancamento", "delete");
95 | button.addListener(() => {
96 | this.deletarLancamento(mes, lancamento);
97 | });
98 | tabelaLancamentos.addRow("td", [lancamento.categoria, this.formatarDinheiro(lancamento.getValorString())], [button]);
99 | }
100 | tabelaLancamentos.addRow("th", ["Juros", this.formatarDinheiro(mes.totalizador.juros)]);
101 | tabelaLancamentos.addRow("th", ["Rendimentos", this.formatarDinheiro(mes.totalizador.rendimentos)]);
102 | tabelaLancamentos.addRow("th", ["Total", this.formatarDinheiro(mes.totalizador.saldo)]);
103 | return tabelaLancamentos;
104 | }
105 | }
--------------------------------------------------------------------------------
/6/main.js:
--------------------------------------------------------------------------------
1 | const janeiro = new Mes("janeiro");
2 | janeiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
3 | janeiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1000));
4 | // janeiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
5 | // janeiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
6 | // janeiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
7 | // janeiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 300));
8 | // janeiro.adicionarLancamento(new Lancamento("Lazer", "despesa", 300));
9 | // janeiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 500));
10 | // janeiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 300));
11 | // janeiro.adicionarLancamento(new Lancamento("Farmácia", "despesa", 100));
12 |
13 | const fevereiro = new Mes("fevereiro");
14 | fevereiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
15 | fevereiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
16 | // fevereiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 250));
17 | // fevereiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
18 | // fevereiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
19 | // fevereiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
20 | // fevereiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
21 | // fevereiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
22 |
23 | const marco = new Mes("marco");
24 | marco.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
25 | marco.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
26 | // marco.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
27 | // marco.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
28 | // marco.adicionarLancamento(new Lancamento("Internet", "despesa", 200));
29 | // marco.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
30 | // marco.adicionarLancamento(new Lancamento("Lazer", "despesa", 800));
31 | // marco.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
32 | // marco.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
33 |
34 | const abril = new Mes("abril");
35 | abril.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
36 |
37 | const ano = new Ano();
38 | ano.adicionarMes(janeiro);
39 | ano.adicionarMes(fevereiro);
40 | ano.adicionarMes(marco);
41 | ano.adicionarMes(abril);
42 | ano.calcularSaldo();
43 |
44 | janeiro.adicionarLancamento(new Lancamento("Escola", "despesa", 500));
45 | fevereiro.adicionarLancamento(new Lancamento("Escola", "despesa", 400));
46 | marco.adicionarLancamento(new Lancamento("Escola", "despesa", 500));
47 | ano.calcularSaldo();
48 |
49 | console.log(ano.meses);
50 |
51 | function addElement (parent, elementType, text) {
52 | const element = document.createElement(elementType);
53 | if (text !== "" && text !== undefined && text !== null) {
54 | element.innerText = text;
55 | }
56 | parent.appendChild(element);
57 | }
58 |
59 | function renderizar () {
60 | const app = document.getElementById("app");
61 | if (app.firstChild) {
62 | app.firstChild.remove();
63 | }
64 | const painel = document.createElement("div");
65 | for (const mes of ano.meses) {
66 | addElement(painel, "h3", mes.nome);
67 | for (const lancamento of mes.lancamentos) {
68 | const detalhesLancamento = lancamento.tipo + " " + lancamento.categoria + " " + lancamento.valor;
69 | addElement(painel, "p", detalhesLancamento);
70 | }
71 | addElement(painel, "h4", mes.totalizador.saldo);
72 | addElement(painel, "hr");
73 | }
74 | app.appendChild(painel);
75 | }
76 |
77 | renderizar();
78 |
79 | function adicionarLancamento () {
80 | const mes = document.getElementById("mes");
81 | const categoria = document.getElementById("categoria");
82 | const tipo = document.getElementById("tipo");
83 | const valor = document.getElementById("valor");
84 | ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
85 | ano.calcularSaldo();
86 | renderizar();
87 | mes.value = "";
88 | categoria.value = "";
89 | tipo.value = "";
90 | valor.value = "";
91 | }
92 |
93 | const botao = document.getElementById("botao");
94 | botao.addEventListener("click", adicionarLancamento);
95 |
--------------------------------------------------------------------------------
/8/views/tela.js:
--------------------------------------------------------------------------------
1 | class Tela {
2 | constructor () {
3 | const janeiro = new Mes("janeiro");
4 | janeiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
5 | janeiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1000));
6 | janeiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
7 | janeiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
8 | janeiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
9 | const fevereiro = new Mes("fevereiro");
10 | fevereiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
11 | fevereiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
12 | fevereiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 250));
13 | fevereiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
14 | fevereiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
15 | const marco = new Mes("marco");
16 | marco.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
17 | marco.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
18 | marco.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
19 | marco.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
20 | marco.adicionarLancamento(new Lancamento("Internet", "despesa", 200));
21 | const abril = new Mes("abril");
22 | abril.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
23 | const ano = new Ano();
24 | ano.adicionarMes(janeiro);
25 | ano.adicionarMes(fevereiro);
26 | ano.adicionarMes(marco);
27 | ano.adicionarMes(abril);
28 | ano.calcularSaldo();
29 | this.ano = ano;
30 | }
31 |
32 | formatarDinheiro (valor) {
33 | return new Intl.NumberFormat("pt-br", { currency: "BRL", style: "currency" }).format(valor);
34 | }
35 |
36 | adicionarLancamento () {
37 | const mes = document.getElementById("mes");
38 | const categoria = document.getElementById("categoria");
39 | const tipo = document.getElementById("tipo");
40 | const valor = document.getElementById("valor");
41 | this.ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
42 | this.ano.calcularSaldo();
43 | this.renderizar();
44 | mes.value = this.ano.meses[0].nome;
45 | tipo.value = "receita";
46 | categoria.value = "";
47 | valor.value = "";
48 | }
49 |
50 | renderizar () {
51 | document.getElementById("app").remove();
52 | const app = new Div("app");
53 | const titulo = new h4("Finanças Pessoais");
54 | app.adicionarElementoFilho(titulo.element);
55 | const form = new Div("form-lancamento");
56 | const mesSelect = new Select("mes");
57 | for (const mes of this.ano.meses) {
58 | mesSelect.addOption(mes.nome);
59 | }
60 | const tipoSelect = new Select("tipo");
61 | tipoSelect.addOption("receita");
62 | tipoSelect.addOption("despesa");
63 | const categoriaInputText = new Input("categoria", "text", "Categoria");
64 | const valorInputNumber = new Input("valor", "number", "Valor");
65 | const adicionarButton = new Button("botao", "Adicionar");
66 | adicionarButton.addListener(() => {
67 | this.adicionarLancamento();
68 | });
69 | form.adicionarElementoFilho(mesSelect.element);
70 | form.adicionarElementoFilho(tipoSelect.element);
71 | form.adicionarElementoFilho(categoriaInputText.element);
72 | form.adicionarElementoFilho(valorInputNumber.element);
73 | form.adicionarElementoFilho(adicionarButton.element);
74 | app.adicionarElementoFilho(form.element);
75 |
76 | const grafico = new Grafico();
77 | for (const mes of this.ano.meses) {
78 | grafico.adicionarColuna(mes.totalizador.saldo, mes.nome);
79 | }
80 | app.adicionarElementoFilho(grafico.element);
81 | for (const mes of this.ano.meses) {
82 | const nomeDoMes = new h4(mes.nome);
83 | app.adicionarElementoFilho(nomeDoMes.element);
84 | const tabelaLancamentos = new Tabela("tabela-lancamentos");
85 | tabelaLancamentos.addRow("th", ["Categoria", "Valor"]);
86 | for (const lancamento of mes.lancamentos) {
87 | tabelaLancamentos.addRow("td", [lancamento.categoria, this.formatarDinheiro(lancamento.getValorString())]);
88 | }
89 | tabelaLancamentos.addRow("th", ["Juros", this.formatarDinheiro(mes.totalizador.juros)]);
90 | tabelaLancamentos.addRow("th", ["Rendimentos", this.formatarDinheiro(mes.totalizador.rendimentos)]);
91 | tabelaLancamentos.addRow("th", ["Total", this.formatarDinheiro(mes.totalizador.saldo)]);
92 | app.adicionarElementoFilho(tabelaLancamentos.element);
93 | }
94 | const [body] = document.getElementsByTagName("body");
95 | body.appendChild(app.element);
96 | }
97 | }
--------------------------------------------------------------------------------
/4/index.html:
--------------------------------------------------------------------------------
1 |
2 |
115 |
116 |
--------------------------------------------------------------------------------
/7/main.js:
--------------------------------------------------------------------------------
1 | const janeiro = new Mes("janeiro");
2 | janeiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
3 | janeiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1000));
4 | janeiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
5 | janeiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
6 | janeiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
7 | // janeiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 300));
8 | // janeiro.adicionarLancamento(new Lancamento("Lazer", "despesa", 300));
9 | // janeiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 500));
10 | // janeiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 300));
11 | // janeiro.adicionarLancamento(new Lancamento("Farmácia", "despesa", 100));
12 |
13 | const fevereiro = new Mes("fevereiro");
14 | fevereiro.adicionarLancamento(new Lancamento("Salário", "receita", 3000));
15 | fevereiro.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
16 | fevereiro.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 250));
17 | fevereiro.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
18 | fevereiro.adicionarLancamento(new Lancamento("Internet", "despesa", 100));
19 | // fevereiro.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
20 | // fevereiro.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
21 | // fevereiro.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
22 |
23 | const marco = new Mes("marco");
24 | marco.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
25 | marco.adicionarLancamento(new Lancamento("Aluguel", "despesa", 1200));
26 | marco.adicionarLancamento(new Lancamento("Conta de Luz", "despesa", 200));
27 | marco.adicionarLancamento(new Lancamento("Conta de Água", "despesa", 100));
28 | marco.adicionarLancamento(new Lancamento("Internet", "despesa", 200));
29 | // marco.adicionarLancamento(new Lancamento("Transporte", "despesa", 500));
30 | // marco.adicionarLancamento(new Lancamento("Lazer", "despesa", 800));
31 | // marco.adicionarLancamento(new Lancamento("Alimentação", "despesa", 1000));
32 | // marco.adicionarLancamento(new Lancamento("Condomínio", "despesa", 400));
33 |
34 | const abril = new Mes("abril");
35 | abril.adicionarLancamento(new Lancamento("Salário", "receita", 4000));
36 |
37 | const ano = new Ano();
38 | ano.adicionarMes(janeiro);
39 | ano.adicionarMes(fevereiro);
40 | ano.adicionarMes(marco);
41 | ano.adicionarMes(abril);
42 | ano.calcularSaldo();
43 |
44 | janeiro.adicionarLancamento(new Lancamento("Escola", "despesa", 500));
45 | fevereiro.adicionarLancamento(new Lancamento("Escola", "despesa", 400));
46 | marco.adicionarLancamento(new Lancamento("Escola", "despesa", 500));
47 | ano.calcularSaldo();
48 |
49 | console.log(ano.meses);
50 |
51 | function addElement (parent, elementType, text) {
52 | const element = document.createElement(elementType);
53 | if (text !== "" && text !== undefined && text !== null) {
54 | element.innerText = text;
55 | }
56 | parent.appendChild(element);
57 | }
58 |
59 | function renderizar () {
60 | const app = document.getElementById("app");
61 | if (app.firstChild) {
62 | app.firstChild.remove();
63 | }
64 | const painel = document.createElement("div");
65 | const cores = ["red", "yellow", "green", "blue"];
66 | const grafico = document.createElement("div");
67 | grafico.className = "grafico";
68 | for (const mes of ano.meses) {
69 | const coluna = document.createElement("div");
70 | coluna.className = "grafico-coluna";
71 | const cor = document.createElement("div");
72 | cor.style.height = (mes.totalizador.saldo*100)/10000;
73 | cor.style.background = cores.pop();
74 | coluna.appendChild(cor);
75 | const nomeDoMes = document.createElement("div");
76 | nomeDoMes.className = "grafico-coluna-texto";
77 | nomeDoMes.innerText = mes.nome;
78 | coluna.appendChild(cor);
79 | coluna.appendChild(nomeDoMes);
80 | grafico.appendChild(coluna);
81 | }
82 | painel.appendChild(grafico);
83 |
84 | for (const mes of ano.meses) {
85 | addElement(painel, "h4", mes.nome);
86 | const tabelaLancamentos = document.createElement("table");
87 | tabelaLancamentos.className = "tabela-lancamentos";
88 | const linhaTitulo = document.createElement("tr");
89 | addElement(linhaTitulo, "th", "Categoria");
90 | addElement(linhaTitulo, "th", "Valor");
91 | tabelaLancamentos.appendChild(linhaTitulo);
92 | for (const lancamento of mes.lancamentos) {
93 | const linhaLancamento = document.createElement("tr");
94 | addElement(linhaLancamento, "td", lancamento.categoria);
95 | addElement(linhaLancamento, "td", formatarDinheiro(lancamento.valor));
96 | tabelaLancamentos.appendChild(linhaLancamento);
97 | }
98 | const linhaJuros = document.createElement("tr");
99 | addElement(linhaJuros, "th", "Juros");
100 | addElement(linhaJuros, "th", formatarDinheiro(mes.totalizador.juros));
101 | tabelaLancamentos.appendChild(linhaJuros);
102 | const linhaRendimentos = document.createElement("tr");
103 | addElement(linhaRendimentos, "th", "Rendimentos");
104 | addElement(linhaRendimentos, "th", formatarDinheiro(mes.totalizador.rendimentos));
105 | tabelaLancamentos.appendChild(linhaRendimentos);
106 | const linhaSaldo = document.createElement("tr");
107 | addElement(linhaSaldo, "th", "Total");
108 | addElement(linhaSaldo, "th", formatarDinheiro(mes.totalizador.saldo));
109 | tabelaLancamentos.appendChild(linhaSaldo);
110 | painel.appendChild(tabelaLancamentos);
111 | }
112 | app.appendChild(painel);
113 | }
114 |
115 | renderizar();
116 |
117 | function adicionarLancamento () {
118 | const mes = document.getElementById("mes");
119 | const categoria = document.getElementById("categoria");
120 | const tipo = document.getElementById("tipo");
121 | const valor = document.getElementById("valor");
122 | ano.adicionarLancamento(mes.value, new Lancamento(categoria.value, tipo.value, parseFloat(valor.value)));
123 | ano.calcularSaldo();
124 | renderizar();
125 | mes.value = ano.meses[0].nome;
126 | tipo.value = "receita";
127 | categoria.value = "";
128 | valor.value = "";
129 | }
130 |
131 | const botao = document.getElementById("botao");
132 | botao.addEventListener("click", adicionarLancamento);
133 |
134 | const mesSelect = document.getElementById("mes");
135 | for (const mes of ano.meses) {
136 | const option = document.createElement("option");
137 | option.text = mes.nome;
138 | mesSelect.add(option);
139 | }
--------------------------------------------------------------------------------
/9/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "9",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "9",
9 | "version": "1.0.0",
10 | "license": "ISC",
11 | "dependencies": {
12 | "express": "^4.18.1"
13 | }
14 | },
15 | "node_modules/accepts": {
16 | "version": "1.3.8",
17 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
18 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
19 | "dependencies": {
20 | "mime-types": "~2.1.34",
21 | "negotiator": "0.6.3"
22 | },
23 | "engines": {
24 | "node": ">= 0.6"
25 | }
26 | },
27 | "node_modules/array-flatten": {
28 | "version": "1.1.1",
29 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
30 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
31 | },
32 | "node_modules/body-parser": {
33 | "version": "1.20.0",
34 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
35 | "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
36 | "dependencies": {
37 | "bytes": "3.1.2",
38 | "content-type": "~1.0.4",
39 | "debug": "2.6.9",
40 | "depd": "2.0.0",
41 | "destroy": "1.2.0",
42 | "http-errors": "2.0.0",
43 | "iconv-lite": "0.4.24",
44 | "on-finished": "2.4.1",
45 | "qs": "6.10.3",
46 | "raw-body": "2.5.1",
47 | "type-is": "~1.6.18",
48 | "unpipe": "1.0.0"
49 | },
50 | "engines": {
51 | "node": ">= 0.8",
52 | "npm": "1.2.8000 || >= 1.4.16"
53 | }
54 | },
55 | "node_modules/bytes": {
56 | "version": "3.1.2",
57 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
58 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
59 | "engines": {
60 | "node": ">= 0.8"
61 | }
62 | },
63 | "node_modules/call-bind": {
64 | "version": "1.0.2",
65 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
66 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
67 | "dependencies": {
68 | "function-bind": "^1.1.1",
69 | "get-intrinsic": "^1.0.2"
70 | },
71 | "funding": {
72 | "url": "https://github.com/sponsors/ljharb"
73 | }
74 | },
75 | "node_modules/content-disposition": {
76 | "version": "0.5.4",
77 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
78 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
79 | "dependencies": {
80 | "safe-buffer": "5.2.1"
81 | },
82 | "engines": {
83 | "node": ">= 0.6"
84 | }
85 | },
86 | "node_modules/content-type": {
87 | "version": "1.0.4",
88 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
89 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
90 | "engines": {
91 | "node": ">= 0.6"
92 | }
93 | },
94 | "node_modules/cookie": {
95 | "version": "0.5.0",
96 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
97 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
98 | "engines": {
99 | "node": ">= 0.6"
100 | }
101 | },
102 | "node_modules/cookie-signature": {
103 | "version": "1.0.6",
104 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
105 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
106 | },
107 | "node_modules/debug": {
108 | "version": "2.6.9",
109 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
110 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
111 | "dependencies": {
112 | "ms": "2.0.0"
113 | }
114 | },
115 | "node_modules/depd": {
116 | "version": "2.0.0",
117 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
118 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
119 | "engines": {
120 | "node": ">= 0.8"
121 | }
122 | },
123 | "node_modules/destroy": {
124 | "version": "1.2.0",
125 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
126 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
127 | "engines": {
128 | "node": ">= 0.8",
129 | "npm": "1.2.8000 || >= 1.4.16"
130 | }
131 | },
132 | "node_modules/ee-first": {
133 | "version": "1.1.1",
134 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
135 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
136 | },
137 | "node_modules/encodeurl": {
138 | "version": "1.0.2",
139 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
140 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
141 | "engines": {
142 | "node": ">= 0.8"
143 | }
144 | },
145 | "node_modules/escape-html": {
146 | "version": "1.0.3",
147 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
148 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
149 | },
150 | "node_modules/etag": {
151 | "version": "1.8.1",
152 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
153 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
154 | "engines": {
155 | "node": ">= 0.6"
156 | }
157 | },
158 | "node_modules/express": {
159 | "version": "4.18.1",
160 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
161 | "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
162 | "dependencies": {
163 | "accepts": "~1.3.8",
164 | "array-flatten": "1.1.1",
165 | "body-parser": "1.20.0",
166 | "content-disposition": "0.5.4",
167 | "content-type": "~1.0.4",
168 | "cookie": "0.5.0",
169 | "cookie-signature": "1.0.6",
170 | "debug": "2.6.9",
171 | "depd": "2.0.0",
172 | "encodeurl": "~1.0.2",
173 | "escape-html": "~1.0.3",
174 | "etag": "~1.8.1",
175 | "finalhandler": "1.2.0",
176 | "fresh": "0.5.2",
177 | "http-errors": "2.0.0",
178 | "merge-descriptors": "1.0.1",
179 | "methods": "~1.1.2",
180 | "on-finished": "2.4.1",
181 | "parseurl": "~1.3.3",
182 | "path-to-regexp": "0.1.7",
183 | "proxy-addr": "~2.0.7",
184 | "qs": "6.10.3",
185 | "range-parser": "~1.2.1",
186 | "safe-buffer": "5.2.1",
187 | "send": "0.18.0",
188 | "serve-static": "1.15.0",
189 | "setprototypeof": "1.2.0",
190 | "statuses": "2.0.1",
191 | "type-is": "~1.6.18",
192 | "utils-merge": "1.0.1",
193 | "vary": "~1.1.2"
194 | },
195 | "engines": {
196 | "node": ">= 0.10.0"
197 | }
198 | },
199 | "node_modules/finalhandler": {
200 | "version": "1.2.0",
201 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
202 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
203 | "dependencies": {
204 | "debug": "2.6.9",
205 | "encodeurl": "~1.0.2",
206 | "escape-html": "~1.0.3",
207 | "on-finished": "2.4.1",
208 | "parseurl": "~1.3.3",
209 | "statuses": "2.0.1",
210 | "unpipe": "~1.0.0"
211 | },
212 | "engines": {
213 | "node": ">= 0.8"
214 | }
215 | },
216 | "node_modules/forwarded": {
217 | "version": "0.2.0",
218 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
219 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
220 | "engines": {
221 | "node": ">= 0.6"
222 | }
223 | },
224 | "node_modules/fresh": {
225 | "version": "0.5.2",
226 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
227 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
228 | "engines": {
229 | "node": ">= 0.6"
230 | }
231 | },
232 | "node_modules/function-bind": {
233 | "version": "1.1.1",
234 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
235 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
236 | },
237 | "node_modules/get-intrinsic": {
238 | "version": "1.1.2",
239 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
240 | "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
241 | "dependencies": {
242 | "function-bind": "^1.1.1",
243 | "has": "^1.0.3",
244 | "has-symbols": "^1.0.3"
245 | },
246 | "funding": {
247 | "url": "https://github.com/sponsors/ljharb"
248 | }
249 | },
250 | "node_modules/has": {
251 | "version": "1.0.3",
252 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
253 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
254 | "dependencies": {
255 | "function-bind": "^1.1.1"
256 | },
257 | "engines": {
258 | "node": ">= 0.4.0"
259 | }
260 | },
261 | "node_modules/has-symbols": {
262 | "version": "1.0.3",
263 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
264 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
265 | "engines": {
266 | "node": ">= 0.4"
267 | },
268 | "funding": {
269 | "url": "https://github.com/sponsors/ljharb"
270 | }
271 | },
272 | "node_modules/http-errors": {
273 | "version": "2.0.0",
274 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
275 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
276 | "dependencies": {
277 | "depd": "2.0.0",
278 | "inherits": "2.0.4",
279 | "setprototypeof": "1.2.0",
280 | "statuses": "2.0.1",
281 | "toidentifier": "1.0.1"
282 | },
283 | "engines": {
284 | "node": ">= 0.8"
285 | }
286 | },
287 | "node_modules/iconv-lite": {
288 | "version": "0.4.24",
289 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
290 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
291 | "dependencies": {
292 | "safer-buffer": ">= 2.1.2 < 3"
293 | },
294 | "engines": {
295 | "node": ">=0.10.0"
296 | }
297 | },
298 | "node_modules/inherits": {
299 | "version": "2.0.4",
300 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
301 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
302 | },
303 | "node_modules/ipaddr.js": {
304 | "version": "1.9.1",
305 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
306 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
307 | "engines": {
308 | "node": ">= 0.10"
309 | }
310 | },
311 | "node_modules/media-typer": {
312 | "version": "0.3.0",
313 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
314 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
315 | "engines": {
316 | "node": ">= 0.6"
317 | }
318 | },
319 | "node_modules/merge-descriptors": {
320 | "version": "1.0.1",
321 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
322 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
323 | },
324 | "node_modules/methods": {
325 | "version": "1.1.2",
326 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
327 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
328 | "engines": {
329 | "node": ">= 0.6"
330 | }
331 | },
332 | "node_modules/mime": {
333 | "version": "1.6.0",
334 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
335 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
336 | "bin": {
337 | "mime": "cli.js"
338 | },
339 | "engines": {
340 | "node": ">=4"
341 | }
342 | },
343 | "node_modules/mime-db": {
344 | "version": "1.52.0",
345 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
346 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
347 | "engines": {
348 | "node": ">= 0.6"
349 | }
350 | },
351 | "node_modules/mime-types": {
352 | "version": "2.1.35",
353 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
354 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
355 | "dependencies": {
356 | "mime-db": "1.52.0"
357 | },
358 | "engines": {
359 | "node": ">= 0.6"
360 | }
361 | },
362 | "node_modules/ms": {
363 | "version": "2.0.0",
364 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
365 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
366 | },
367 | "node_modules/negotiator": {
368 | "version": "0.6.3",
369 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
370 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
371 | "engines": {
372 | "node": ">= 0.6"
373 | }
374 | },
375 | "node_modules/object-inspect": {
376 | "version": "1.12.2",
377 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
378 | "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
379 | "funding": {
380 | "url": "https://github.com/sponsors/ljharb"
381 | }
382 | },
383 | "node_modules/on-finished": {
384 | "version": "2.4.1",
385 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
386 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
387 | "dependencies": {
388 | "ee-first": "1.1.1"
389 | },
390 | "engines": {
391 | "node": ">= 0.8"
392 | }
393 | },
394 | "node_modules/parseurl": {
395 | "version": "1.3.3",
396 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
397 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
398 | "engines": {
399 | "node": ">= 0.8"
400 | }
401 | },
402 | "node_modules/path-to-regexp": {
403 | "version": "0.1.7",
404 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
405 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
406 | },
407 | "node_modules/proxy-addr": {
408 | "version": "2.0.7",
409 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
410 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
411 | "dependencies": {
412 | "forwarded": "0.2.0",
413 | "ipaddr.js": "1.9.1"
414 | },
415 | "engines": {
416 | "node": ">= 0.10"
417 | }
418 | },
419 | "node_modules/qs": {
420 | "version": "6.10.3",
421 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
422 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
423 | "dependencies": {
424 | "side-channel": "^1.0.4"
425 | },
426 | "engines": {
427 | "node": ">=0.6"
428 | },
429 | "funding": {
430 | "url": "https://github.com/sponsors/ljharb"
431 | }
432 | },
433 | "node_modules/range-parser": {
434 | "version": "1.2.1",
435 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
436 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
437 | "engines": {
438 | "node": ">= 0.6"
439 | }
440 | },
441 | "node_modules/raw-body": {
442 | "version": "2.5.1",
443 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
444 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
445 | "dependencies": {
446 | "bytes": "3.1.2",
447 | "http-errors": "2.0.0",
448 | "iconv-lite": "0.4.24",
449 | "unpipe": "1.0.0"
450 | },
451 | "engines": {
452 | "node": ">= 0.8"
453 | }
454 | },
455 | "node_modules/safe-buffer": {
456 | "version": "5.2.1",
457 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
458 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
459 | "funding": [
460 | {
461 | "type": "github",
462 | "url": "https://github.com/sponsors/feross"
463 | },
464 | {
465 | "type": "patreon",
466 | "url": "https://www.patreon.com/feross"
467 | },
468 | {
469 | "type": "consulting",
470 | "url": "https://feross.org/support"
471 | }
472 | ]
473 | },
474 | "node_modules/safer-buffer": {
475 | "version": "2.1.2",
476 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
477 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
478 | },
479 | "node_modules/send": {
480 | "version": "0.18.0",
481 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
482 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
483 | "dependencies": {
484 | "debug": "2.6.9",
485 | "depd": "2.0.0",
486 | "destroy": "1.2.0",
487 | "encodeurl": "~1.0.2",
488 | "escape-html": "~1.0.3",
489 | "etag": "~1.8.1",
490 | "fresh": "0.5.2",
491 | "http-errors": "2.0.0",
492 | "mime": "1.6.0",
493 | "ms": "2.1.3",
494 | "on-finished": "2.4.1",
495 | "range-parser": "~1.2.1",
496 | "statuses": "2.0.1"
497 | },
498 | "engines": {
499 | "node": ">= 0.8.0"
500 | }
501 | },
502 | "node_modules/send/node_modules/ms": {
503 | "version": "2.1.3",
504 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
505 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
506 | },
507 | "node_modules/serve-static": {
508 | "version": "1.15.0",
509 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
510 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
511 | "dependencies": {
512 | "encodeurl": "~1.0.2",
513 | "escape-html": "~1.0.3",
514 | "parseurl": "~1.3.3",
515 | "send": "0.18.0"
516 | },
517 | "engines": {
518 | "node": ">= 0.8.0"
519 | }
520 | },
521 | "node_modules/setprototypeof": {
522 | "version": "1.2.0",
523 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
524 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
525 | },
526 | "node_modules/side-channel": {
527 | "version": "1.0.4",
528 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
529 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
530 | "dependencies": {
531 | "call-bind": "^1.0.0",
532 | "get-intrinsic": "^1.0.2",
533 | "object-inspect": "^1.9.0"
534 | },
535 | "funding": {
536 | "url": "https://github.com/sponsors/ljharb"
537 | }
538 | },
539 | "node_modules/statuses": {
540 | "version": "2.0.1",
541 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
542 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
543 | "engines": {
544 | "node": ">= 0.8"
545 | }
546 | },
547 | "node_modules/toidentifier": {
548 | "version": "1.0.1",
549 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
550 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
551 | "engines": {
552 | "node": ">=0.6"
553 | }
554 | },
555 | "node_modules/type-is": {
556 | "version": "1.6.18",
557 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
558 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
559 | "dependencies": {
560 | "media-typer": "0.3.0",
561 | "mime-types": "~2.1.24"
562 | },
563 | "engines": {
564 | "node": ">= 0.6"
565 | }
566 | },
567 | "node_modules/unpipe": {
568 | "version": "1.0.0",
569 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
570 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
571 | "engines": {
572 | "node": ">= 0.8"
573 | }
574 | },
575 | "node_modules/utils-merge": {
576 | "version": "1.0.1",
577 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
578 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
579 | "engines": {
580 | "node": ">= 0.4.0"
581 | }
582 | },
583 | "node_modules/vary": {
584 | "version": "1.1.2",
585 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
586 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
587 | "engines": {
588 | "node": ">= 0.8"
589 | }
590 | }
591 | },
592 | "dependencies": {
593 | "accepts": {
594 | "version": "1.3.8",
595 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
596 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
597 | "requires": {
598 | "mime-types": "~2.1.34",
599 | "negotiator": "0.6.3"
600 | }
601 | },
602 | "array-flatten": {
603 | "version": "1.1.1",
604 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
605 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
606 | },
607 | "body-parser": {
608 | "version": "1.20.0",
609 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
610 | "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
611 | "requires": {
612 | "bytes": "3.1.2",
613 | "content-type": "~1.0.4",
614 | "debug": "2.6.9",
615 | "depd": "2.0.0",
616 | "destroy": "1.2.0",
617 | "http-errors": "2.0.0",
618 | "iconv-lite": "0.4.24",
619 | "on-finished": "2.4.1",
620 | "qs": "6.10.3",
621 | "raw-body": "2.5.1",
622 | "type-is": "~1.6.18",
623 | "unpipe": "1.0.0"
624 | }
625 | },
626 | "bytes": {
627 | "version": "3.1.2",
628 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
629 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="
630 | },
631 | "call-bind": {
632 | "version": "1.0.2",
633 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
634 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
635 | "requires": {
636 | "function-bind": "^1.1.1",
637 | "get-intrinsic": "^1.0.2"
638 | }
639 | },
640 | "content-disposition": {
641 | "version": "0.5.4",
642 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
643 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
644 | "requires": {
645 | "safe-buffer": "5.2.1"
646 | }
647 | },
648 | "content-type": {
649 | "version": "1.0.4",
650 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
651 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
652 | },
653 | "cookie": {
654 | "version": "0.5.0",
655 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
656 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="
657 | },
658 | "cookie-signature": {
659 | "version": "1.0.6",
660 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
661 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
662 | },
663 | "debug": {
664 | "version": "2.6.9",
665 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
666 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
667 | "requires": {
668 | "ms": "2.0.0"
669 | }
670 | },
671 | "depd": {
672 | "version": "2.0.0",
673 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
674 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="
675 | },
676 | "destroy": {
677 | "version": "1.2.0",
678 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
679 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
680 | },
681 | "ee-first": {
682 | "version": "1.1.1",
683 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
684 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
685 | },
686 | "encodeurl": {
687 | "version": "1.0.2",
688 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
689 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
690 | },
691 | "escape-html": {
692 | "version": "1.0.3",
693 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
694 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
695 | },
696 | "etag": {
697 | "version": "1.8.1",
698 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
699 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
700 | },
701 | "express": {
702 | "version": "4.18.1",
703 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
704 | "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
705 | "requires": {
706 | "accepts": "~1.3.8",
707 | "array-flatten": "1.1.1",
708 | "body-parser": "1.20.0",
709 | "content-disposition": "0.5.4",
710 | "content-type": "~1.0.4",
711 | "cookie": "0.5.0",
712 | "cookie-signature": "1.0.6",
713 | "debug": "2.6.9",
714 | "depd": "2.0.0",
715 | "encodeurl": "~1.0.2",
716 | "escape-html": "~1.0.3",
717 | "etag": "~1.8.1",
718 | "finalhandler": "1.2.0",
719 | "fresh": "0.5.2",
720 | "http-errors": "2.0.0",
721 | "merge-descriptors": "1.0.1",
722 | "methods": "~1.1.2",
723 | "on-finished": "2.4.1",
724 | "parseurl": "~1.3.3",
725 | "path-to-regexp": "0.1.7",
726 | "proxy-addr": "~2.0.7",
727 | "qs": "6.10.3",
728 | "range-parser": "~1.2.1",
729 | "safe-buffer": "5.2.1",
730 | "send": "0.18.0",
731 | "serve-static": "1.15.0",
732 | "setprototypeof": "1.2.0",
733 | "statuses": "2.0.1",
734 | "type-is": "~1.6.18",
735 | "utils-merge": "1.0.1",
736 | "vary": "~1.1.2"
737 | }
738 | },
739 | "finalhandler": {
740 | "version": "1.2.0",
741 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
742 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
743 | "requires": {
744 | "debug": "2.6.9",
745 | "encodeurl": "~1.0.2",
746 | "escape-html": "~1.0.3",
747 | "on-finished": "2.4.1",
748 | "parseurl": "~1.3.3",
749 | "statuses": "2.0.1",
750 | "unpipe": "~1.0.0"
751 | }
752 | },
753 | "forwarded": {
754 | "version": "0.2.0",
755 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
756 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
757 | },
758 | "fresh": {
759 | "version": "0.5.2",
760 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
761 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
762 | },
763 | "function-bind": {
764 | "version": "1.1.1",
765 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
766 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
767 | },
768 | "get-intrinsic": {
769 | "version": "1.1.2",
770 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
771 | "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
772 | "requires": {
773 | "function-bind": "^1.1.1",
774 | "has": "^1.0.3",
775 | "has-symbols": "^1.0.3"
776 | }
777 | },
778 | "has": {
779 | "version": "1.0.3",
780 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
781 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
782 | "requires": {
783 | "function-bind": "^1.1.1"
784 | }
785 | },
786 | "has-symbols": {
787 | "version": "1.0.3",
788 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
789 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
790 | },
791 | "http-errors": {
792 | "version": "2.0.0",
793 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
794 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
795 | "requires": {
796 | "depd": "2.0.0",
797 | "inherits": "2.0.4",
798 | "setprototypeof": "1.2.0",
799 | "statuses": "2.0.1",
800 | "toidentifier": "1.0.1"
801 | }
802 | },
803 | "iconv-lite": {
804 | "version": "0.4.24",
805 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
806 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
807 | "requires": {
808 | "safer-buffer": ">= 2.1.2 < 3"
809 | }
810 | },
811 | "inherits": {
812 | "version": "2.0.4",
813 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
814 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
815 | },
816 | "ipaddr.js": {
817 | "version": "1.9.1",
818 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
819 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
820 | },
821 | "media-typer": {
822 | "version": "0.3.0",
823 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
824 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="
825 | },
826 | "merge-descriptors": {
827 | "version": "1.0.1",
828 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
829 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
830 | },
831 | "methods": {
832 | "version": "1.1.2",
833 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
834 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="
835 | },
836 | "mime": {
837 | "version": "1.6.0",
838 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
839 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
840 | },
841 | "mime-db": {
842 | "version": "1.52.0",
843 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
844 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
845 | },
846 | "mime-types": {
847 | "version": "2.1.35",
848 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
849 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
850 | "requires": {
851 | "mime-db": "1.52.0"
852 | }
853 | },
854 | "ms": {
855 | "version": "2.0.0",
856 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
857 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
858 | },
859 | "negotiator": {
860 | "version": "0.6.3",
861 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
862 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
863 | },
864 | "object-inspect": {
865 | "version": "1.12.2",
866 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
867 | "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ=="
868 | },
869 | "on-finished": {
870 | "version": "2.4.1",
871 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
872 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
873 | "requires": {
874 | "ee-first": "1.1.1"
875 | }
876 | },
877 | "parseurl": {
878 | "version": "1.3.3",
879 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
880 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
881 | },
882 | "path-to-regexp": {
883 | "version": "0.1.7",
884 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
885 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
886 | },
887 | "proxy-addr": {
888 | "version": "2.0.7",
889 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
890 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
891 | "requires": {
892 | "forwarded": "0.2.0",
893 | "ipaddr.js": "1.9.1"
894 | }
895 | },
896 | "qs": {
897 | "version": "6.10.3",
898 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
899 | "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
900 | "requires": {
901 | "side-channel": "^1.0.4"
902 | }
903 | },
904 | "range-parser": {
905 | "version": "1.2.1",
906 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
907 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
908 | },
909 | "raw-body": {
910 | "version": "2.5.1",
911 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
912 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
913 | "requires": {
914 | "bytes": "3.1.2",
915 | "http-errors": "2.0.0",
916 | "iconv-lite": "0.4.24",
917 | "unpipe": "1.0.0"
918 | }
919 | },
920 | "safe-buffer": {
921 | "version": "5.2.1",
922 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
923 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
924 | },
925 | "safer-buffer": {
926 | "version": "2.1.2",
927 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
928 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
929 | },
930 | "send": {
931 | "version": "0.18.0",
932 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
933 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
934 | "requires": {
935 | "debug": "2.6.9",
936 | "depd": "2.0.0",
937 | "destroy": "1.2.0",
938 | "encodeurl": "~1.0.2",
939 | "escape-html": "~1.0.3",
940 | "etag": "~1.8.1",
941 | "fresh": "0.5.2",
942 | "http-errors": "2.0.0",
943 | "mime": "1.6.0",
944 | "ms": "2.1.3",
945 | "on-finished": "2.4.1",
946 | "range-parser": "~1.2.1",
947 | "statuses": "2.0.1"
948 | },
949 | "dependencies": {
950 | "ms": {
951 | "version": "2.1.3",
952 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
953 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
954 | }
955 | }
956 | },
957 | "serve-static": {
958 | "version": "1.15.0",
959 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
960 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
961 | "requires": {
962 | "encodeurl": "~1.0.2",
963 | "escape-html": "~1.0.3",
964 | "parseurl": "~1.3.3",
965 | "send": "0.18.0"
966 | }
967 | },
968 | "setprototypeof": {
969 | "version": "1.2.0",
970 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
971 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
972 | },
973 | "side-channel": {
974 | "version": "1.0.4",
975 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
976 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
977 | "requires": {
978 | "call-bind": "^1.0.0",
979 | "get-intrinsic": "^1.0.2",
980 | "object-inspect": "^1.9.0"
981 | }
982 | },
983 | "statuses": {
984 | "version": "2.0.1",
985 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
986 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
987 | },
988 | "toidentifier": {
989 | "version": "1.0.1",
990 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
991 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
992 | },
993 | "type-is": {
994 | "version": "1.6.18",
995 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
996 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
997 | "requires": {
998 | "media-typer": "0.3.0",
999 | "mime-types": "~2.1.24"
1000 | }
1001 | },
1002 | "unpipe": {
1003 | "version": "1.0.0",
1004 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
1005 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="
1006 | },
1007 | "utils-merge": {
1008 | "version": "1.0.1",
1009 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
1010 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
1011 | },
1012 | "vary": {
1013 | "version": "1.1.2",
1014 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
1015 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
1016 | }
1017 | }
1018 | }
1019 |
--------------------------------------------------------------------------------