diff --git a/Week3/assignment/.gitignore b/Week3/assignment/.gitignore deleted file mode 100644 index eebb675f0..000000000 --- a/Week3/assignment/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Node.js -node_modules/ - -# Environment variables -.env - - -# OS files -.DS_Store -Thumbs.db - -# IDE/editor settings -.vscode/ diff --git a/Week3/assignment/SQL-Normalization/SQL Normalization.md b/Week3/assignment/SQL-Normalization/SQL Normalization.md deleted file mode 100644 index 957dd54b2..000000000 --- a/Week3/assignment/SQL-Normalization/SQL Normalization.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Exercise 1: SQL Normalization - -## 1️ What columns violate 1NF? - -- **`food_code`** → contains multiple values in one cell (like `C1, C2`). -- **`food_description`** → contains multiple values in one cell (like `Curry, Cake`). - -> These columns break 1NF because each cell should store only **one atomic value**. - ---- - -## 2️ What entities can be extracted? - -From the original table, we can identify the following entities: - -1. **Member** - - `member_id`, `member_name`, `member_address` - -2. **Dinner** - - `dinner_id`, `dinner_date`, `venue_code` - -3. **Venue** - - `venue_code`, `venue_description` - -4. **Food** - - `food_code`, `food_description` - -5. **Dinner_Member** (linking table) - - Links members to dinners - -6. **Dinner_Food** (linking table) - - Links dinners to foods - ---- - -## 3️ Tables and columns for a 3NF compliant solution - -### Members -```sql -member_id, member_name, member_address diff --git a/Week3/assignment/SQL-Transactions/check-transactions.js b/Week3/assignment/SQL-Transactions/check-transactions.js deleted file mode 100644 index d2714b64a..000000000 --- a/Week3/assignment/SQL-Transactions/check-transactions.js +++ /dev/null @@ -1,50 +0,0 @@ -import pool from "./main.js"; - -export async function showChanges() { - try { - // Show current account balances - const accounts = await pool.query( - `SELECT * FROM account ORDER BY account_number` - ); - console.log("Current account balances:"); - console.table( - accounts.rows.map((acc) => ({ - "Account": acc.account_number, - Balance: acc.balance, - })) - ); - - // 2️ Show all transactions - const transactions = await pool.query( - `SELECT * FROM account_changes ORDER BY change_number` - ); - console.log("\nAll transactions:"); - console.table( - transactions.rows.map((trx) => { - const dateObj = new Date(trx.changed_date); - const localDate = - dateObj.getFullYear() + - "-" + - String(dateObj.getMonth() + 1).padStart(2, "0") + - "-" + - String(dateObj.getDate()).padStart(2, "0") + - " " + - String(dateObj.getHours()).padStart(2, "0") + - ":" + - String(dateObj.getMinutes()).padStart(2, "0") + - ":" + - String(dateObj.getSeconds()).padStart(2, "0"); - - return { - "Change": trx.change_number, - "Account": trx.account_number, - Amount: trx.amount, - Date: localDate, - Remark: trx.remark, - }; - }) - ); - } catch (error) { - console.error("Error:", error); - } -} diff --git a/Week3/assignment/SQL-Transactions/main.js b/Week3/assignment/SQL-Transactions/main.js deleted file mode 100644 index eec58dfa8..000000000 --- a/Week3/assignment/SQL-Transactions/main.js +++ /dev/null @@ -1,30 +0,0 @@ -import { Pool } from "pg"; -import { createTables } from "./transactions-create-tables.js"; -import { insertSampleData } from "./transactions-insert-values.js"; -import { transferAmount } from "./transaction.js"; -import { showChanges } from "./check-transactions.js"; - - -const pool = new Pool({ - host: "localhost", - user: "hyfuser", - password: "hyfpassword", - database: "transactiondb", - port: 5432, -}); -export default pool - -async function main(){ - try{ - await createTables(); - await insertSampleData(); - await transferAmount(101, 102, 1000); - await showChanges(); - - }catch (error) { - console.error("Error:", error); - } finally { - await pool.end(); - } -} -main() \ No newline at end of file diff --git a/Week3/assignment/SQL-Transactions/transaction.js b/Week3/assignment/SQL-Transactions/transaction.js deleted file mode 100644 index e2114d8eb..000000000 --- a/Week3/assignment/SQL-Transactions/transaction.js +++ /dev/null @@ -1,55 +0,0 @@ -import pool from "./main.js"; - -export async function transferAmount(senderAccount, receiverAccount, amount) { - const client = await pool.connect(); - - try { - await client.query("BEGIN"); // start transaction - - // Deduct from sender - const deduct = await client.query( - `UPDATE account - SET balance = balance - $1 - WHERE account_number = $2 - RETURNING *`, - [amount, senderAccount] - ); - - if (deduct.rows.length === 0) throw new Error("Sender account not found"); - - // Add to receiver - const add = await client.query( - `UPDATE account - SET balance = balance + $1 - WHERE account_number = $2 - RETURNING *`, - [amount, receiverAccount] - ); - - if (add.rows.length === 0) throw new Error("Receiver account not found"); - - // Log sender transaction - await client.query( - `INSERT INTO account_changes(account_number, amount, remark) - VALUES($1, $2, $3)`, - [senderAccount, -amount, `Transfer to account ${receiverAccount}`] - ); - - // Log receiver transaction - await client.query( - `INSERT INTO account_changes(account_number, amount, remark) - VALUES($1, $2, $3)`, - [receiverAccount, amount, `Received from account ${senderAccount}`] - ); - - await client.query("COMMIT"); // commit transaction - console.log(`Transfer of ${amount} from account ${senderAccount} to ${receiverAccount} completed successfully`); - } catch (error) { - await client.query("ROLLBACK"); // rollback on error - console.error("Transaction failed:", error.message); - } finally{ - client.release(); - } -} - - diff --git a/Week3/assignment/SQL-Transactions/transactions-create-tables.js b/Week3/assignment/SQL-Transactions/transactions-create-tables.js deleted file mode 100644 index 44a7ccd19..000000000 --- a/Week3/assignment/SQL-Transactions/transactions-create-tables.js +++ /dev/null @@ -1,35 +0,0 @@ -import pool from "./main.js"; - -export async function createTables() { - try { - // Drop tables if they exist - await pool.query("DROP TABLE IF EXISTS account_changes"); - await pool.query("DROP TABLE IF EXISTS account"); - console.log("Tables dropped successfully"); - - // Create account table first - const createAccount = `CREATE TABLE IF NOT EXISTS account ( - account_number SERIAL PRIMARY KEY, - balance NUMERIC(15,2) -);`; - - await pool.query(createAccount); - console.log("Account table created"); - - // Then create account_changes table - const createAccountChanges = `CREATE TABLE IF NOT EXISTS account_changes ( - change_number SERIAL PRIMARY KEY, - account_number INTEGER, - Foreign Key (account_number) REFERENCES account(account_number), - amount NUMERIC(15,2), - changed_date TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - remark TEXT -);`; - - await pool.query(createAccountChanges); - console.log("Account_changes table created"); - } catch (error) { - console.error("Error", error); - } -} - diff --git a/Week3/assignment/SQL-Transactions/transactions-insert-values.js b/Week3/assignment/SQL-Transactions/transactions-insert-values.js deleted file mode 100644 index 678a5f74c..000000000 --- a/Week3/assignment/SQL-Transactions/transactions-insert-values.js +++ /dev/null @@ -1,37 +0,0 @@ -import pool from "./main.js"; - -export async function insertSampleData() { - try { - // Insert account 101 - const account101 = await pool.query( - `INSERT INTO account(account_number, balance) VALUES($1, $2) RETURNING *`, - [101, 5000] - ); - - // Insert account 102 - const account102 = await pool.query( - `INSERT INTO account(account_number, balance) VALUES($1, $2) RETURNING *`, - [102, 3000] - ); - - console.log("Accounts inserted:", account101.rows[0], account102.rows[0]); - - // Insert initial transactions - await pool.query( - `INSERT INTO account_changes(account_number, amount, remark) - VALUES($1, $2, $3)`, - [101, 1000, "Initial deposit"] - ); - await pool.query( - `INSERT INTO account_changes(account_number, amount,remark) - VALUES($1, $2, $3)`, - [102, 500, "Initial deposit"] - ); - - console.log("Initial transactions inserted successfully"); - } catch (error) { - console.error("Error:", error); - } -} - - diff --git a/Week3/assignment/SQL-injection/test.js b/Week3/assignment/SQL-injection/test.js deleted file mode 100644 index a8d58afc9..000000000 --- a/Week3/assignment/SQL-injection/test.js +++ /dev/null @@ -1,63 +0,0 @@ -import { Pool } from "pg"; - -const pool = new Pool({ - host: "localhost", - user: "hyfuser", - password: "hyfpassword", - database: "world", - port: 5432, -}); - -async function getPopulationRisky(name, code) { - try { - console.log("\n[Risky Function]"); - const result = await pool.query( - `SELECT name, population FROM country WHERE Name = '${name}' AND code = '${code}'` - ); - - if (result.rows.length === 0) { - throw new Error("Not found"); - } - - console.table(result.rows); - } catch (err) { - console.error("Error:", err.message); - } -} - -async function getPopulationSafe(name, code) { - try { - - console.log("\n[Safe Function]"); - - const query = `SELECT name, population FROM country WHERE Name = $1 AND code = $2`; - const values = [name, code]; - - const result = await pool.query(query, values); - - if (result.rows.length === 0) { - throw new Error("Not found"); - } - - console.table(result.rows); - } catch (err) { - console.error("Error:", err.message); - } -} - -async function test() { - try { - const maliciousName = "' OR '1'='1"; - const maliciousCode = "' OR '1'='1"; - - await getPopulationRisky(maliciousName, maliciousCode); - await getPopulationSafe(maliciousName, maliciousCode); - - } catch (err) { - console.error("Error:", err.message); - } finally { - await pool.end(); - } -} - -test(); diff --git a/Week3/assignment/package-lock.json b/Week3/assignment/package-lock.json deleted file mode 100644 index 0c7207618..000000000 --- a/Week3/assignment/package-lock.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "name": "assignment", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "assignment", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "pg": "^8.16.3" - } - }, - "node_modules/pg": { - "version": "8.16.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", - "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", - "license": "MIT", - "dependencies": { - "pg-connection-string": "^2.9.1", - "pg-pool": "^3.10.1", - "pg-protocol": "^1.10.3", - "pg-types": "2.2.0", - "pgpass": "1.0.5" - }, - "engines": { - "node": ">= 16.0.0" - }, - "optionalDependencies": { - "pg-cloudflare": "^1.2.7" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } - } - }, - "node_modules/pg-cloudflare": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", - "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", - "license": "MIT", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", - "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", - "license": "MIT" - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "license": "ISC", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", - "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", - "license": "MIT", - "peerDependencies": { - "pg": ">=8.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", - "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==", - "license": "MIT" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "license": "MIT", - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "license": "MIT", - "dependencies": { - "split2": "^4.1.0" - } - }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "license": "MIT", - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "license": "ISC", - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "license": "MIT", - "engines": { - "node": ">=0.4" - } - } - } -} diff --git a/Week3/assignment/package.json b/Week3/assignment/package.json deleted file mode 100644 index dff1a8082..000000000 --- a/Week3/assignment/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "assignment", - "version": "1.0.0", - "description": "", - "main": "index.js", - "type": "module", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "pg": "^8.16.3" - } -} diff --git a/Week3/homework/mongodb/.gitignore b/Week3/homework/mongodb/.gitignore deleted file mode 100644 index eebb675f0..000000000 --- a/Week3/homework/mongodb/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# Node.js -node_modules/ - -# Environment variables -.env - - -# OS files -.DS_Store -Thumbs.db - -# IDE/editor settings -.vscode/ diff --git a/Week3/homework/mongodb/index.js b/Week3/homework/mongodb/index.js index f015cc118..41ee8b618 100644 --- a/Week3/homework/mongodb/index.js +++ b/Week3/homework/mongodb/index.js @@ -1,92 +1,85 @@ - -const dotenv = require("dotenv").config() const { MongoClient, ServerApiVersion } = require("mongodb"); const { seedDatabase } = require("./seedDatabase.js"); async function createEpisodeExercise(client) { + /** + * We forgot to add the last episode of season 9. It has this information: + * + * episode: S09E13 + * title: MOUNTAIN HIDE-AWAY + * elements: ["CIRRUS", "CLOUDS", "CONIFER", "DECIDIOUS", "GRASS", "MOUNTAIN", "MOUNTAINS", "RIVER", "SNOWY_MOUNTAIN", "TREE", "TREES"] + */ -const bobRossEpisode = client.db("databaseWeek3").collection("bob_ross_episodes") -const newEpisod = { - episode: "S09E13", - title: "MOUNTAIN HIDE-AWAY", - elements: ["CIRRUS", "CLOUDS", "CONIFER", "DECIDIOUS", "GRASS", "MOUNTAIN", "MOUNTAINS", "RIVER", "SNOWY_MOUNTAIN", "TREE", "TREES"] -} - const result= await bobRossEpisode.insertOne(newEpisod) + // Write code that will add this to the collection! console.log( - `Created season 9 episode 13 and the document got the id ${result.insertedId}` + `Created season 9 episode 13 and the document got the id ${"TODO: fill in variable here"}` ); } async function findEpisodesExercises(client) { + /** + * Complete the following exercises. + * The comments indicate what to do and what the result should be! + */ + + // Find the title of episode 2 in season 2 [Should be: WINTER SUN] - const bobRossEpisode = client.db("databaseWeek3").collection("bob_ross_episodes") - const result= await bobRossEpisode.findOne({episode: "S02E02"}) console.log( - `The title of episode 2 in season 2 is ${result.title}` + `The title of episode 2 in season 2 is ${"TODO: fill in variable here"}` ); - const blackRive = await bobRossEpisode.findOne({title:"BLACK RIVER"}) // Find the season and episode number of the episode called "BLACK RIVER" [Should be: S02E06] console.log( - `The season and episode number of the "BLACK RIVER" episode is ${blackRive.episode}` + `The season and episode number of the "BLACK RIVER" episode is ${"TODO: fill in variable here"}` ); // Find all of the episode titles where Bob Ross painted a CLIFF [Should be: NIGHT LIGHT, EVENING SEASCAPE, SURF'S UP, CLIFFSIDE, BY THE SEA, DEEP WILDERNESS HOME, CRIMSON TIDE, GRACEFUL WATERFALL] - const allEpisode = await bobRossEpisode.find({elements:"CLIFF"}, {projection:{_id: 0, title: 1}}).toArray(); + console.log( - `The episodes that Bob Ross painted a CLIFF are ${allEpisode.map((ep)=> ep.title).join(", ")}` + `The episodes that Bob Ross painted a CLIFF are ${"TODO: fill in variable here"}` ); // Find all of the episode titles where Bob Ross painted a CLIFF and a LIGHTHOUSE [Should be: NIGHT LIGHT] -const cliffLighthouse = await bobRossEpisode.find({ elements: { $all: ["CLIFF", "LIGHTHOUSE"] } },{ projection: { title: 1, _id: 0 } }).toArray(); - -console.log( -`The episodes that Bob Ross painted a CLIFF and a LIGHTHOUSE are: ${cliffLighthouse .map((ep) => ep.title) .join(", ")}` -); - + console.log( + `The episodes that Bob Ross painted a CLIFF and a LIGHTHOUSE are ${"TODO: fill in variable here"}` + ); } + async function updateEpisodeExercises(client) { - const bobRossEpisode = client.db("databaseWeek3").collection("bob_ross_episodes") - const filter = { episode: "S30E13" }; - const updateValue = { $set: { title: "BLUE RIDGE FALLS" } } - - const result = await bobRossEpisode.updateOne(filter,updateValue ) - + /** + * There are some problems in the initial data that was filled in. + * Let's use update functions to update this information. + * + * Note: do NOT change the data.json file + */ // Episode 13 in season 30 should be called BLUE RIDGE FALLS, yet it is called BLUE RIDGE FALLERS now. Fix that console.log( - `Ran a command to update episode 13 in season 30 and it updated ${result.modifiedCount} episodes` + `Ran a command to update episode 13 in season 30 and it updated ${"TODO: fill in variable here"} episodes` ); // Unfortunately we made a mistake in the arrays and the element type called 'BUSHES' should actually be 'BUSH' as sometimes only one bush was painted. // Update all of the documents in the collection that have `BUSHES` in the elements array to now have `BUSH` // It should update 120 episodes! - const filter1 = { elements: "BUSHES" } - const updateValue1 = { $set: { "elements.$": "BUSH" } } - - const result1 = await bobRossEpisode.updateMany(filter1, updateValue1); console.log( - `Ran a command to update all the BUSHES to BUSH and it updated ${result1.modifiedCount} episodes` + `Ran a command to update all the BUSHES to BUSH and it updated ${"TODO: fill in variable here"} episodes` ); } async function deleteEpisodeExercise(client) { - const bobRossEpisode = client.db("databaseWeek3").collection("bob_ross_episodes") /** * It seems an errand episode has gotten into our data. * This is episode 14 in season 31. Please remove it and verify that it has been removed! */ - const filter = { episode: "S31E14" } - const deleteResult = await bobRossEpisode.deleteOne(filter); console.log( - `Ran a command to delete episode and it deleted ${deleteResult.deletedCount} episodes` + `Ran a command to delete episode and it deleted ${"TODO: fill in variable here"} episodes` ); } diff --git a/Week3/homework/mongodb/package-lock.json b/Week3/homework/mongodb/package-lock.json deleted file mode 100644 index a4762e896..000000000 --- a/Week3/homework/mongodb/package-lock.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "mongodb", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "mongodb", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "dotenv": "^17.2.2", - "mogoose": "^0.0.1-security", - "mongodb": "^6.19.0" - } - }, - "node_modules/@mongodb-js/saslprep": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.3.0.tgz", - "integrity": "sha512-zlayKCsIjYb7/IdfqxorK5+xUMyi4vOKcFy10wKJYc63NSdKI8mNME+uJqfatkPmOSMMUiojrL58IePKBm3gvQ==", - "license": "MIT", - "dependencies": { - "sparse-bitfield": "^3.0.3" - } - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", - "license": "MIT" - }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "license": "MIT", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "node_modules/bson": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.4.tgz", - "integrity": "sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==", - "license": "Apache-2.0", - "engines": { - "node": ">=16.20.1" - } - }, - "node_modules/dotenv": { - "version": "17.2.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.2.tgz", - "integrity": "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "license": "MIT" - }, - "node_modules/mogoose": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/mogoose/-/mogoose-0.0.1-security.tgz", - "integrity": "sha512-TX97LVQnLr7jzee6nRZlKKS1XXC/Xp2M5OE2Vz7L/e3mkPMupVfuG4A5tIFFNeClFJ+LH/A0bsqekZolAPOIuA==" - }, - "node_modules/mongodb": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.19.0.tgz", - "integrity": "sha512-H3GtYujOJdeKIMLKBT9PwlDhGrQfplABNF1G904w6r5ZXKWyv77aB0X9B+rhmaAwjtllHzaEkvi9mkGVZxs2Bw==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/saslprep": "^1.1.9", - "bson": "^6.10.4", - "mongodb-connection-string-url": "^3.0.0" - }, - "engines": { - "node": ">=16.20.1" - }, - "peerDependencies": { - "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", - "gcp-metadata": "^5.2.0", - "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0 <7", - "snappy": "^7.3.2", - "socks": "^2.7.1" - }, - "peerDependenciesMeta": { - "@aws-sdk/credential-providers": { - "optional": true - }, - "@mongodb-js/zstd": { - "optional": true - }, - "gcp-metadata": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "snappy": { - "optional": true - }, - "socks": { - "optional": true - } - } - }, - "node_modules/mongodb-connection-string-url": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz", - "integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==", - "license": "Apache-2.0", - "dependencies": { - "@types/whatwg-url": "^11.0.2", - "whatwg-url": "^14.1.0 || ^13.0.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "license": "MIT", - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/tr46": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", - "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", - "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", - "license": "MIT", - "dependencies": { - "tr46": "^5.1.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=18" - } - } - } -} diff --git a/Week3/homework/mongodb/package.json b/Week3/homework/mongodb/package.json deleted file mode 100644 index d7f9c50fc..000000000 --- a/Week3/homework/mongodb/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "mongodb", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "dotenv": "^17.2.2", - "mogoose": "^0.0.1-security", - "mongodb": "^6.19.0" - } -}